< prev index next >

src/java.base/share/classes/java/lang/reflect/Module.java

Print this page

        

*** 121,131 **** this.loader = loader; this.descriptor = descriptor; // define module to VM ! boolean isOpen = descriptor.isOpen(); Version version = descriptor.version().orElse(null); String vs = Objects.toString(version, null); String loc = Objects.toString(uri, null); String[] packages = descriptor.packages().toArray(new String[0]); defineModule0(this, isOpen, vs, loc, packages); --- 121,131 ---- this.loader = loader; this.descriptor = descriptor; // define module to VM ! boolean isOpen = descriptor.isOpen() || descriptor.isAutomatic(); Version version = descriptor.version().orElse(null); String vs = Objects.toString(version, null); String loc = Objects.toString(uri, null); String[] packages = descriptor.packages().toArray(new String[0]); defineModule0(this, isOpen, vs, loc, packages);
*** 1164,1180 **** */ private static void initExportsAndOpens(ModuleDescriptor descriptor, Map<String, Module> nameToModule, Module m) { ! // The VM doesn't special case open or automatic modules so need to ! // export all packages if (descriptor.isOpen() || descriptor.isAutomatic()) { - assert descriptor.opens().isEmpty(); - for (String source : descriptor.packages()) { - addExportsToAll0(m, source); - } return; } Map<String, Set<Module>> openPackages = new HashMap<>(); Map<String, Set<Module>> exportedPackages = new HashMap<>(); --- 1164,1176 ---- */ private static void initExportsAndOpens(ModuleDescriptor descriptor, Map<String, Module> nameToModule, Module m) { ! // The VM special cases open and automatic modules so don't need to ! // export their packages if (descriptor.isOpen() || descriptor.isAutomatic()) { return; } Map<String, Set<Module>> openPackages = new HashMap<>(); Map<String, Set<Module>> exportedPackages = new HashMap<>();
< prev index next >