logging cleanup
authorMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Wed, 4 May 2016 12:41:40 +0000 (14:41 +0200)
committerMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Wed, 4 May 2016 12:43:23 +0000 (14:43 +0200)
platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java
platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java

index 8fd182909247488c1a3e2f29ea308d44e36abf9d..4e59e6b6d1e1a3d84abfd79650a09be05c5a1152 100644 (file)
@@ -509,10 +509,12 @@ public class StubIndexImpl extends StubIndex implements ApplicationComponent, Pe
       indicesToDrop.remove(key.toString());
     }
 
-    LOG.info("Dropping indices:" + StringUtil.join(indicesToDrop, ","));
+    if (!indicesToDrop.isEmpty()) {
+      LOG.info("Dropping indices:" + StringUtil.join(indicesToDrop, ","));
 
-    for (String s : indicesToDrop) {
-      FileUtil.delete(IndexInfrastructure.getIndexRootDir(StubIndexKey.createIndexKey(s)));
+      for (String s : indicesToDrop) {
+        FileUtil.delete(IndexInfrastructure.getIndexRootDir(StubIndexKey.createIndexKey(s)));
+      }
     }
   }
 
index 8c3250b6e3c2b1178228b129ee55c95d5f347d70..b6ab68e58bf570770f3e0ef1334f5413790fc435 100644 (file)
@@ -442,9 +442,11 @@ public class FileBasedIndexImpl extends FileBasedIndex {
     for (ID<?, ?> key : ids) {
       indicesToDrop.remove(key.toString());
     }
-    LOG.info("Dropping indices:" + StringUtil.join(indicesToDrop, ","));
-    for (String s : indicesToDrop) {
-      FileUtil.deleteWithRenaming(IndexInfrastructure.getIndexRootDir(ID.create(s)));
+    if (!indicesToDrop.isEmpty()) {
+      LOG.info("Dropping indices:" + StringUtil.join(indicesToDrop, ","));
+      for (String s : indicesToDrop) {
+        FileUtil.deleteWithRenaming(IndexInfrastructure.getIndexRootDir(ID.create(s)));
+      }
     }
 
     try {