equal
deleted
inserted
replaced
56 private final Map<String, Set<String>> opens; |
56 private final Map<String, Set<String>> opens; |
57 private final boolean isSystem; |
57 private final boolean isSystem; |
58 private final URI location; |
58 private final URI location; |
59 |
59 |
60 protected Module(String name) { |
60 protected Module(String name) { |
|
61 this(name, null, false); |
|
62 } |
|
63 |
|
64 protected Module(String name, ModuleDescriptor descriptor, boolean isSystem) { |
61 super(name); |
65 super(name); |
62 this.descriptor = null; |
66 this.descriptor = descriptor; |
63 this.location = null; |
67 this.location = null; |
64 this.exports = Collections.emptyMap(); |
68 this.exports = Collections.emptyMap(); |
65 this.opens = Collections.emptyMap(); |
69 this.opens = Collections.emptyMap(); |
66 this.isSystem = true; |
70 this.isSystem = isSystem; |
67 } |
71 } |
68 |
72 |
69 private Module(String name, |
73 private Module(String name, |
70 URI location, |
74 URI location, |
71 ModuleDescriptor descriptor, |
75 ModuleDescriptor descriptor, |
87 public String name() { |
91 public String name() { |
88 return descriptor != null ? descriptor.name() : getName(); |
92 return descriptor != null ? descriptor.name() : getName(); |
89 } |
93 } |
90 |
94 |
91 public boolean isNamed() { |
95 public boolean isNamed() { |
92 return true; |
96 return descriptor != null; |
93 } |
97 } |
94 |
98 |
95 public boolean isAutomatic() { |
99 public boolean isAutomatic() { |
96 return descriptor.isAutomatic(); |
100 return descriptor != null && descriptor.isAutomatic(); |
97 } |
101 } |
98 |
102 |
99 public Module getModule() { |
103 public Module getModule() { |
100 return this; |
104 return this; |
101 } |
105 } |
230 } |
234 } |
231 } |
235 } |
232 |
236 |
233 private static class UnnamedModule extends Module { |
237 private static class UnnamedModule extends Module { |
234 private UnnamedModule() { |
238 private UnnamedModule() { |
235 super("unnamed", null, null, |
239 super("unnamed", null, false); |
236 Collections.emptyMap(), Collections.emptyMap(), |
|
237 false, null); |
|
238 } |
240 } |
239 |
241 |
240 @Override |
242 @Override |
241 public String name() { |
243 public String name() { |
242 return "unnamed"; |
244 return "unnamed"; |
243 } |
|
244 |
|
245 @Override |
|
246 public boolean isNamed() { |
|
247 return false; |
|
248 } |
|
249 |
|
250 @Override |
|
251 public boolean isAutomatic() { |
|
252 return false; |
|
253 } |
245 } |
254 |
246 |
255 @Override |
247 @Override |
256 public boolean isExported(String pn) { |
248 public boolean isExported(String pn) { |
257 return true; |
249 return true; |