]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9811 fix quality flaws
authorDaniel Schwarz <daniel.schwarz@sonarsource.com>
Mon, 2 Oct 2017 07:20:54 +0000 (09:20 +0200)
committerDaniel Schwarz <bartfastiel@users.noreply.github.com>
Mon, 2 Oct 2017 08:29:19 +0000 (10:29 +0200)
Renamed variable to avoid misunderstandings

server/sonar-main/src/main/java/org/sonar/application/es/EsFileSystem.java
server/sonar-main/src/main/java/org/sonar/application/process/ProcessLauncherImpl.java

index b7f87df7a765c7b791c0af713a31ad9db0e294f7..1fb91dc528720279f52a497d8f81e8cfc66c45ba 100644 (file)
@@ -35,7 +35,7 @@ import org.sonar.process.Props;
  */
 public class EsFileSystem {
   private final File homeDirectory;
-  private final List<File> outdatedDataDirectories;
+  private final List<File> outdatedSearchDirectories;
   private final File dataDirectory;
   private final File confDirectory;
   private final File logDirectory;
@@ -44,13 +44,13 @@ public class EsFileSystem {
     File sqHomeDir = props.nonNullValueAsFile(ProcessProperties.PATH_HOME);
 
     this.homeDirectory = new File(sqHomeDir, "elasticsearch");
-    this.outdatedDataDirectories = buildOutdatedDataDirs(props);
+    this.outdatedSearchDirectories = buildOutdatedSearchDirs(props);
     this.dataDirectory = buildDataDir(props);
     this.confDirectory = buildConfDir(props);
     this.logDirectory = buildLogPath(props);
   }
 
-  private static List<File> buildOutdatedDataDirs(Props props) {
+  private static List<File> buildOutdatedSearchDirs(Props props) {
     String dataPath = props.nonNullValue(ProcessProperties.PATH_DATA);
     return Collections.singletonList(new File(dataPath, "es"));
   }
@@ -73,8 +73,8 @@ public class EsFileSystem {
     return homeDirectory;
   }
 
-  public List<File> getOutdatedDataDirectories() {
-    return Collections.unmodifiableList(outdatedDataDirectories);
+  public List<File> getOutdatedSearchDirectories() {
+    return Collections.unmodifiableList(outdatedSearchDirectories);
   }
 
   public File getDataDirectory() {
index 0f172a9530f510382a79345d6ffcd1a5c0e1efc3..802d53bdf162d3f47fb2f4fff9e54e7680576e23 100644 (file)
@@ -92,7 +92,7 @@ public class ProcessLauncherImpl implements ProcessLauncher {
 
   private static void cleanupOutdatedEsData(EsCommand esCommand) {
     EsFileSystem esFileSystem = esCommand.getFileSystem();
-    esFileSystem.getOutdatedDataDirectories().forEach(outdatedDir -> {
+    esFileSystem.getOutdatedSearchDirectories().forEach(outdatedDir -> {
       if (outdatedDir.exists()) {
         LOG.info("Deleting outdated search index data directory {}", outdatedDir.getAbsolutePath());
         try {