Skip to content

Commit 636e103

Browse files
committed
Fix build failure
1 parent d8da22b commit 636e103

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsHomePropertiesPostProcessor.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ public class DevToolsHomePropertiesPostProcessor implements EnvironmentPostProce
5252

5353
private static final String CONFIG_PATH = "/.config/spring-boot/";
5454

55-
private static final File HOME_FOLDER;
56-
static {
57-
String home = System.getProperty("user.home");
58-
HOME_FOLDER = StringUtils.hasLength(home) ? new File(home) : null;
59-
}
60-
6155
@Override
6256
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
6357
if (DevToolsEnablementDeducer.shouldEnable(Thread.currentThread())) {
@@ -104,7 +98,11 @@ private void addPropertySource(List<PropertySource<?>> propertySources, FileSyst
10498
}
10599

106100
protected File getHomeFolder() {
107-
return HOME_FOLDER;
101+
String home = System.getProperty("user.home");
102+
if (StringUtils.hasLength(home)) {
103+
return new File(home);
104+
}
105+
return null;
108106
}
109107

110108
}

0 commit comments

Comments
 (0)