From bc2f5635cdda458553009460235705e48a394e7f Mon Sep 17 00:00:00 2001 From: Stephane Gamard Date: Thu, 14 Aug 2014 13:21:31 +0200 Subject: [PATCH] fix quality flaw --- .../main/java/org/sonar/search/SearchServer.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java b/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java index d93136aad8f..9995ba789d0 100644 --- a/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java +++ b/server/sonar-search/src/main/java/org/sonar/search/SearchServer.java @@ -233,24 +233,27 @@ public class SearchServer extends MonitoredProcess { } private File esDataDir() { - if (props.contains(SONAR_PATH_DATA)) { - return new File(props.of(SONAR_PATH_DATA), "es"); + String dataDir = props.of(SONAR_PATH_DATA); + if (StringUtils.isNotEmpty(dataDir)) { + return new File(dataDir, "es"); } else { return new File(esHomeDir(), "data/es"); } } private File esLogDir() { - if (props.contains(SONAR_PATH_LOG)) { - return new File(props.of(SONAR_PATH_LOG)); + String logDir = props.of(SONAR_PATH_LOG); + if (StringUtils.isNotEmpty(logDir)) { + return new File(logDir); } else { return new File(esHomeDir(), "log"); } } private File esWorkDir() { - if (props.contains(SONAR_PATH_TEMP)) { - return new File(props.of(SONAR_PATH_TEMP)); + String workDir = props.of(SONAR_PATH_TEMP); + if (StringUtils.isNotEmpty(workDir)) { + return new File(workDir); } else { return new File(esHomeDir(), "temp"); } -- 2.39.5