< prev index next >
src/java.base/share/classes/jdk/internal/module/Builder.java
Print this page
*** 130,147 ****
--- 130,150 ----
String osName;
String osArch;
String osVersion;
String algorithm;
Map<String, byte[]> hashes;
+ boolean doNotResolveByDefault;
+ WarnIfResolvedReason warnIfResolvedReason;
Builder(String name) {
this.name = name;
this.requires = Collections.emptySet();
this.exports = Collections.emptySet();
this.opens = Collections.emptySet();
this.provides = Collections.emptySet();
this.uses = Collections.emptySet();
+ warnIfResolvedReason = WarnIfResolvedReason.NONE;
}
Builder open(boolean value) {
this.open = value;
return this;
*** 292,301 ****
--- 295,320 ----
hashes.put(mn, hash);
return this;
}
/**
+ * Sets module DO_NOT_RESOLVE_BY_DEFAULT.
+ */
+ public Builder doNotResolveByDefault(boolean doNotResolveByDefault) {
+ this.doNotResolveByDefault = doNotResolveByDefault;
+ return this;
+ }
+
+ /**
+ * Sets module WARN_IF_RESOLVED.
+ */
+ public Builder warnIfResolved(WarnIfResolvedReason reason) {
+ this.warnIfResolvedReason = reason;
+ return this;
+ }
+
+ /**
* Builds a {@code ModuleDescriptor} from the components.
*/
public ModuleDescriptor build(int hashCode) {
assert name != null;
*** 316,323 ****
osName,
osArch,
osVersion,
packages,
moduleHashes,
! hashCode);
}
}
--- 335,344 ----
osName,
osArch,
osVersion,
packages,
moduleHashes,
! hashCode,
! doNotResolveByDefault,
! warnIfResolvedReason);
}
}
< prev index next >