author | alanb |
Fri, 07 Apr 2017 08:05:54 +0000 | |
changeset 44545 | 83b611b88ac8 |
parent 44359 | c6761862ca0b |
child 45004 | ea3137042a61 |
permissions | -rw-r--r-- |
43336
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
1 |
/* |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
2 |
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
4 |
* |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
8 |
* |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
13 |
* accompanied this code). |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
14 |
* |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
18 |
* |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
21 |
* questions. |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
22 |
*/ |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
23 |
|
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
24 |
package p4; |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
25 |
|
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
26 |
import java.io.IOException; |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
27 |
import java.io.InputStream; |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
28 |
import java.lang.module.ModuleDescriptor; |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
29 |
import java.lang.module.ModuleFinder; |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
30 |
import java.net.URI; |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
31 |
import java.nio.file.FileSystem; |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
32 |
import java.nio.file.FileSystems; |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
33 |
import java.nio.file.Files; |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
34 |
import java.nio.file.Path; |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
35 |
import java.util.Collections; |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
36 |
import java.util.Set; |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
37 |
|
44359
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
38 |
import jdk.internal.module.ClassFileAttributes; |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
39 |
import jdk.internal.module.ClassFileAttributes.ModuleTargetAttribute; |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
40 |
import jdk.internal.module.ClassFileConstants; |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
41 |
import jdk.internal.org.objectweb.asm.Attribute; |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
42 |
import jdk.internal.org.objectweb.asm.ClassReader; |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
43 |
import jdk.internal.org.objectweb.asm.ClassVisitor; |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
44 |
import jdk.internal.org.objectweb.asm.Opcodes; |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
45 |
|
43336
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
46 |
public class Main { |
44359
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
47 |
private static boolean hasModuleTarget(InputStream in) throws IOException { |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
48 |
ModuleTargetAttribute[] modTargets = new ModuleTargetAttribute[1]; |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
49 |
ClassVisitor cv = new ClassVisitor(Opcodes.ASM5) { |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
50 |
@Override |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
51 |
public void visitAttribute(Attribute attr) { |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
52 |
if (attr instanceof ModuleTargetAttribute) { |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
53 |
modTargets[0] = (ModuleTargetAttribute)attr; |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
54 |
} |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
55 |
} |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
56 |
}; |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
57 |
|
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
58 |
// prototype of attributes that should be parsed |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
59 |
Attribute[] attrs = new Attribute[] { |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
60 |
new ModuleTargetAttribute() |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
61 |
}; |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
62 |
|
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
63 |
// parse module-info.class |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
64 |
ClassReader cr = new ClassReader(in); |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
65 |
cr.accept(cv, attrs, 0); |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
66 |
return modTargets[0] != null && |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
67 |
(modTargets[0].osName() != null || modTargets[0].osArch() != null); |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
68 |
} |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
69 |
|
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
70 |
private static boolean hasModuleTarget(String modName) throws IOException { |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
71 |
FileSystem fs = FileSystems.newFileSystem(URI.create("jrt:/"), |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
72 |
Collections.emptyMap()); |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
73 |
Path path = fs.getPath("/", "modules", modName, "module-info.class"); |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
74 |
try (InputStream in = Files.newInputStream(path)) { |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
75 |
return hasModuleTarget(in); |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
76 |
} |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
77 |
} |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
78 |
|
43336
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
79 |
// the system module plugin by default drops ModuleTarget attribute |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
80 |
private static boolean expectModuleTarget = false; |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
81 |
public static void main(String... args) throws IOException { |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
82 |
if (args.length > 0) { |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
83 |
if (!args[0].equals("retainModuleTarget")) { |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
84 |
throw new IllegalArgumentException(args[0]); |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
85 |
} |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
86 |
|
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
87 |
expectModuleTarget = true; |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
88 |
} |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
89 |
|
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
90 |
// java.base is packaged with osName/osArch/osVersion |
44359
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
91 |
if (! hasModuleTarget("java.base")) { |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
92 |
throw new RuntimeException("ModuleTarget absent for java.base"); |
43336
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
93 |
} |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
94 |
|
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
95 |
// verify module-info.class for m1 and m4 |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
96 |
checkModule("m1", "p1", "p2"); |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
97 |
checkModule("m4", "p4"); |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
98 |
} |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
99 |
|
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
100 |
private static void checkModule(String mn, String... packages) throws IOException { |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
101 |
// verify ModuleDescriptor from the runtime module |
44545
83b611b88ac8
8177530: Module system implementation refresh (4/2017)
alanb
parents:
44359
diff
changeset
|
102 |
ModuleDescriptor md = ModuleLayer.boot().findModule(mn).get() |
43336
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
103 |
.getDescriptor(); |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
104 |
checkModuleDescriptor(md, packages); |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
105 |
|
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
106 |
// verify ModuleDescriptor from module-info.class read from ModuleReader |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
107 |
try (InputStream in = ModuleFinder.ofSystem().find(mn).get() |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
108 |
.open().open("module-info.class").get()) { |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
109 |
checkModuleDescriptor(ModuleDescriptor.read(in), packages); |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
110 |
} |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
111 |
|
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
112 |
// verify ModuleDescriptor from module-info.class read from jimage |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
113 |
FileSystem fs = FileSystems.newFileSystem(URI.create("jrt:/"), |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
114 |
Collections.emptyMap()); |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
115 |
Path path = fs.getPath("/", "modules", mn, "module-info.class"); |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
116 |
checkModuleDescriptor(ModuleDescriptor.read(Files.newInputStream(path)), packages); |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
117 |
} |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
118 |
|
44359
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
119 |
static void checkModuleDescriptor(ModuleDescriptor md, String... packages) throws IOException { |
43336
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
120 |
String mainClass = md.name().replace('m', 'p') + ".Main"; |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
121 |
if (!md.mainClass().get().equals(mainClass)) { |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
122 |
throw new RuntimeException(md.mainClass().toString()); |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
123 |
} |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
124 |
|
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
125 |
if (expectModuleTarget) { |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
126 |
// ModuleTarget attribute is retained |
44359
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
127 |
if (! hasModuleTarget(md.name())) { |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
128 |
throw new RuntimeException("ModuleTarget missing for " + md.name()); |
43336
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
129 |
} |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
130 |
} else { |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
131 |
// by default ModuleTarget attribute is dropped |
44359
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
132 |
if (hasModuleTarget(md.name())) { |
c6761862ca0b
8174823: Module system implementation refresh (3/2017)
alanb
parents:
43336
diff
changeset
|
133 |
throw new RuntimeException("ModuleTarget present for " + md.name()); |
43336
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
134 |
} |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
135 |
} |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
136 |
|
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
137 |
Set<String> pkgs = md.packages(); |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
138 |
if (!pkgs.equals(Set.of(packages))) { |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
139 |
throw new RuntimeException(pkgs + " expected: " + Set.of(packages)); |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
140 |
} |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
141 |
} |
be9fca030f91
8173381: osName/osArch/osVersion is missing in ModuleDescriptor created by SystemModules
mchung
parents:
diff
changeset
|
142 |
} |