src/share/classes/org/openjdk/jigsaw/Resolver.java

Print this page

        

@@ -29,11 +29,11 @@
 import java.io.*;
 import java.net.URI;
 import java.util.*;
 
 import static java.lang.module.Dependence.Modifier;
-import static org.openjdk.jigsaw.Repository.ModuleMetaData;
+import static org.openjdk.jigsaw.Repository.ModuleFileMetaData;
 import static org.openjdk.jigsaw.Trace.*;
 
 
 // We resolve module versions by doing a recursive depth-first search of
 // the space of possible choices.

@@ -250,14 +250,15 @@
         //
         // ## Policy issues: Anywhere vs. local, child vs. parent, ...
         //
         if (cat instanceof Library) {
             Library lib = (Library)cat;
+            ModuleArchitecture modArch = lib.architecture();
             RemoteRepositoryList rrl = lib.repositoryList();
             RemoteRepository rr = rrl.firstRepository();
             if (rr != null) {
-                candidates = rr.findModuleIds(mn);
+                candidates = rr.findlocalModuleIds(mn, modArch);
                 Collections.sort(candidates, Collections.reverseOrder());
                 if (tracing)
                     trace(1, depth,
                           "considering candidates from repos of %s: %s",
                           lib.name(), candidates);

@@ -299,20 +300,20 @@
         // Find and read the ModuleInfo, saving its location
         // and size data, if any
         //
         ModuleInfo mi = null;
         URI ml = null;
-        ModuleMetaData mmd = null;
+        ModuleFileMetaData mfmd = null;
         for (Catalog c = cat; c != null; c = c.parent()) {
             mi = c.readLocalModuleInfo(mid);
             if (mi != null) {
                 if (c != this.cat && c instanceof LocatableCatalog) {
                     ml = ((LocatableCatalog)c).location();
                     assert ml != null;
                 }
                 if (c instanceof RemoteRepository)
-                    mmd = ((RemoteRepository)c).fetchMetaData(mid);
+                    mfmd = ((RemoteRepository)c).fetchMetaData(mid);
                 break;
             }
         }
         if (mi == null)
             throw new AssertionError("No ModuleInfo for " + mid

@@ -354,14 +355,14 @@
         if (ml != null)
             locationForName.put(smn, ml);
 
         // Save the module's download and install sizes, if any
         //
-        if (mmd != null) {
+        if (mfmd != null) {
             modulesNeeded.add(mi.id());
-            downloadRequired += mmd.getDownloadSize();
-            spaceRequired += mmd.getInstallSize();
+            downloadRequired += mfmd.getDownloadSize();
+            spaceRequired += mfmd.getInstallSize();
         }
 
         // Push this module's dependences onto the choice stack,
         // in reverse order so that the choices are examined in
         // forward order

@@ -408,14 +409,14 @@
                     moduleViewForName.remove(alias.name());
                 }
             }
             if (ml != null)
                 locationForName.remove(smn);
-            if (mmd != null) {
+            if (mfmd != null) {
                 modulesNeeded.remove(mi.id());
-                downloadRequired -= mmd.getDownloadSize();
-                spaceRequired -= mmd.getInstallSize();
+                downloadRequired -= mfmd.getDownloadSize();
+                spaceRequired -= mfmd.getInstallSize();
             }
             if (tracing)
                 trace(1, depth, "fail: %s", mid);
             return false;