diff --git a/initializr-web/src/main/java/io/spring/initializr/web/project/ProjectGenerationInvoker.java b/initializr-web/src/main/java/io/spring/initializr/web/project/ProjectGenerationInvoker.java index 7f159f94..52e5f88b 100644 --- a/initializr-web/src/main/java/io/spring/initializr/web/project/ProjectGenerationInvoker.java +++ b/initializr-web/src/main/java/io/spring/initializr/web/project/ProjectGenerationInvoker.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +56,7 @@ public class ProjectGenerationInvoker { private final ProjectRequestToDescriptionConverter requestConverter; - private transient Map> temporaryFiles = new ConcurrentHashMap<>(); + private final transient Map> temporaryFiles = new ConcurrentHashMap<>(); public ProjectGenerationInvoker(ApplicationContext parentApplicationContext, ProjectRequestToDescriptionConverter requestConverter) { @@ -144,10 +144,7 @@ public class ProjectGenerationInvoker { private void addTempFile(Path group, Path file) { this.temporaryFiles.compute(group, (path, paths) -> { - List newPaths = paths; - if (newPaths == null) { - newPaths = new ArrayList<>(); - } + List newPaths = (paths != null) ? paths : new ArrayList<>(); newPaths.add(file); return newPaths; });