JPS: return modules and libraries from dependencies in proper order (IDEA-122154)
authornik <Nikolay.Chashnikov@jetbrains.com>
Mon, 17 Mar 2014 14:37:49 +0000 (18:37 +0400)
committernik <Nikolay.Chashnikov@jetbrains.com>
Mon, 17 Mar 2014 14:38:44 +0000 (18:38 +0400)
jps/model-impl/src/org/jetbrains/jps/model/module/impl/JpsDependenciesEnumeratorBase.java

index c6dee7b8cce1cfd3b1edb8fc20c9e6623bac68b6..5f273ea0b095ed9a5d853ef457fec208829e396a 100644 (file)
@@ -25,7 +25,7 @@ import org.jetbrains.jps.model.library.JpsLibrary;
 import org.jetbrains.jps.model.module.*;
 
 import java.util.Collection;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.Set;
 
 /**
@@ -91,7 +91,7 @@ public abstract class JpsDependenciesEnumeratorBase<Self extends JpsDependencies
   @NotNull
   @Override
   public Set<JpsModule> getModules() {
-    Set<JpsModule> result = new HashSet<JpsModule>();
+    Set<JpsModule> result = new LinkedHashSet<JpsModule>();
     processModules(new CollectConsumer<JpsModule>(result));
     return result;
   }
@@ -178,7 +178,7 @@ public abstract class JpsDependenciesEnumeratorBase<Self extends JpsDependencies
   @NotNull
   @Override
   public Set<JpsLibrary> getLibraries() {
-    Set<JpsLibrary> libraries = new HashSet<JpsLibrary>();
+    Set<JpsLibrary> libraries = new LinkedHashSet<JpsLibrary>();
     processLibraries(new CollectConsumer<JpsLibrary>(libraries));
     return libraries;
   }