src/share/classes/org/openjdk/jigsaw/Resolver.java
Print this page
*** 29,39 ****
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.Trace.*;
// We resolve module versions by doing a recursive depth-first search of
// the space of possible choices.
--- 29,39 ----
import java.io.*;
import java.net.URI;
import java.util.*;
import static java.lang.module.Dependence.Modifier;
! 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,263 ****
//
// ## Policy issues: Anywhere vs. local, child vs. parent, ...
//
if (cat instanceof Library) {
Library lib = (Library)cat;
RemoteRepositoryList rrl = lib.repositoryList();
RemoteRepository rr = rrl.firstRepository();
if (rr != null) {
! candidates = rr.findModuleIds(mn);
Collections.sort(candidates, Collections.reverseOrder());
if (tracing)
trace(1, depth,
"considering candidates from repos of %s: %s",
lib.name(), candidates);
--- 250,264 ----
//
// ## 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.findlocalModuleIds(mn, modArch);
Collections.sort(candidates, Collections.reverseOrder());
if (tracing)
trace(1, depth,
"considering candidates from repos of %s: %s",
lib.name(), candidates);
*** 299,318 ****
// Find and read the ModuleInfo, saving its location
// and size data, if any
//
ModuleInfo mi = null;
URI ml = null;
! ModuleMetaData mmd = 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);
break;
}
}
if (mi == null)
throw new AssertionError("No ModuleInfo for " + mid
--- 300,319 ----
// Find and read the ModuleInfo, saving its location
// and size data, if any
//
ModuleInfo mi = null;
URI ml = 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)
! mfmd = ((RemoteRepository)c).fetchMetaData(mid);
break;
}
}
if (mi == null)
throw new AssertionError("No ModuleInfo for " + mid
*** 354,367 ****
if (ml != null)
locationForName.put(smn, ml);
// Save the module's download and install sizes, if any
//
! if (mmd != null) {
modulesNeeded.add(mi.id());
! downloadRequired += mmd.getDownloadSize();
! spaceRequired += mmd.getInstallSize();
}
// Push this module's dependences onto the choice stack,
// in reverse order so that the choices are examined in
// forward order
--- 355,368 ----
if (ml != null)
locationForName.put(smn, ml);
// Save the module's download and install sizes, if any
//
! if (mfmd != null) {
modulesNeeded.add(mi.id());
! 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,421 ****
moduleViewForName.remove(alias.name());
}
}
if (ml != null)
locationForName.remove(smn);
! if (mmd != null) {
modulesNeeded.remove(mi.id());
! downloadRequired -= mmd.getDownloadSize();
! spaceRequired -= mmd.getInstallSize();
}
if (tracing)
trace(1, depth, "fail: %s", mid);
return false;
--- 409,422 ----
moduleViewForName.remove(alias.name());
}
}
if (ml != null)
locationForName.remove(smn);
! if (mfmd != null) {
modulesNeeded.remove(mi.id());
! downloadRequired -= mfmd.getDownloadSize();
! spaceRequired -= mfmd.getInstallSize();
}
if (tracing)
trace(1, depth, "fail: %s", mid);
return false;