modify code for single binary file stub builder
authorMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Thu, 5 Dec 2013 17:06:36 +0000 (18:06 +0100)
committerMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Thu, 5 Dec 2013 17:06:36 +0000 (18:06 +0100)
platform/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java

index 62f1b1cd7ec69b8b063e0477494251b6d9c902df..9e81f7f2aa7f4059f3189d8041e5b2ed9daeeb64 100644 (file)
@@ -224,19 +224,11 @@ public class StubUpdatingIndex extends CustomImplementationFileBasedIndexExtensi
         }
       }
 
-      List<BinaryFileStubBuilder> builders = BinaryFileStubBuilders.INSTANCE.allForFileType(fileType);
-      if (builders.size() > 0) {
-        Collections.sort(builders, new Comparator<BinaryFileStubBuilder>() { // stable order
-          @Override
-          public int compare(BinaryFileStubBuilder o1, BinaryFileStubBuilder o2) {
-            return o1.getClass().getName().compareTo(o2.getClass().getName());
-          }
-        });
+      BinaryFileStubBuilder builder = BinaryFileStubBuilders.INSTANCE.forFileType(fileType);
+      if (builder != null) {
         Integer integer = map.get(fileType);
         int value = integer != null ? integer : 0;
-        for(BinaryFileStubBuilder builder:builders) {
-          value = value * 31 + builder.getStubVersion() + builder.getClass().getName().hashCode();
-        }
+        value = value * 31 + builder.getStubVersion() + builder.getClass().getName().hashCode();
         map.put(fileType, value);
       }
     }