src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java Thu Sep 8 09:06:09 2016
--- new/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java Thu Sep 8 09:06:07 2016
*** 151,163 ****
--- 151,161 ----
// additional module(s) specified by --add-modules
boolean addAllDefaultModules = false;
boolean addAllSystemModules = false;
boolean addAllApplicationModules = false;
String propValue = getAndRemoveProperty("jdk.module.addmods");
if (propValue != null) {
for (String mod: propValue.split(",")) {
+ for (String mod: getExtraAddModules()) {
switch (mod) {
case ALL_DEFAULT:
addAllDefaultModules = true;
break;
case ALL_SYSTEM:
*** 168,181 ****
--- 166,178 ----
break;
default :
roots.add(mod);
}
}
}
// --limit-modules
! String propValue = getAndRemoveProperty("jdk.module.limitmods");
if (propValue != null) {
Set<String> mods = new HashSet<>();
for (String mod: propValue.split(",")) {
mods.add(mod);
}
*** 390,399 ****
--- 387,418 ----
}
return ModuleFinder.of(paths);
}
}
+ /**
+ * Returns the set of module names specified via --add-modules options
+ * on the command line.
+ */
+ private static Set<String> getExtraAddModules() {
+ Set<String> modules = new HashSet<>();
+
+ String prefix = "jdk.module.addmods.";
+ int index = 0;
+ // the system property is removed after decoding
+ String value = getAndRemoveProperty(prefix + index);
+ while (value != null) {
+ for (String s : value.split(",")) {
+ if (s.length() > 0) modules.add(s);
+ }
+
+ index++;
+ value = getAndRemoveProperty(prefix + index);
+ }
+
+ return modules;
+ }
/**
* Process the --add-reads options to add any additional read edges that
* are specified on the command-line.
*/
*** 509,525 ****
--- 528,539 ----
String rhs = value.substring(pos+1);
if (rhs.isEmpty())
fail("Unable to parse: " + value);
// value is <module>(,<module>)*
if (map.containsKey(key))
fail(key + " specified more than once");
Set<String> values = new HashSet<>();
map.put(key, values);
+ Set<String> values = map.computeIfAbsent(key, k -> new HashSet<>());
for (String s : rhs.split(",")) {
if (s.length() > 0) values.add(s);
}
index++;
src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File