178 .forEach(cn -> { 179 count.incrementAndGet(); 180 try { 181 System.out.println("Loading " + cn); 182 Class.forName(cn, false, loader); 183 } catch (VerifyError ve) { 184 System.err.println("VerifyError for " + cn); 185 failed.add(reader.imageName() + ": " + cn + " not verified: " + ve.getMessage()); 186 } catch (ClassNotFoundException e) { 187 failed.add(reader.imageName() + ": " + cn + " not found"); 188 } 189 }); 190 } 191 192 private String toClassName(String entry) { 193 int index = entry.indexOf('/', 1); 194 return entry.substring(index + 1, entry.length()) 195 .replaceAll("\\.class$", "").replace('/', '.'); 196 } 197 198 private static Set<String> DEPLOY_MODULES = 199 Set.of("javafx.deploy", "jdk.deploy", "jdk.plugin", "jdk.javaws"); 200 201 private boolean accept(String entry) { 202 int index = entry.indexOf('/', 1); 203 String mn = index > 1 ? entry.substring(1, index) : ""; 204 // filter deployment modules 205 206 if (mn.isEmpty() || DEPLOY_MODULES.contains(mn)) { 207 return false; 208 } 209 return entry.endsWith(".class") && !entry.endsWith(MODULE_INFO); 210 } 211 212 private static JImageReader newJImageReader() throws IOException { 213 String home = System.getProperty("java.home"); 214 Path jimage = Paths.get(home, "lib", "modules"); 215 System.out.println("opened " + jimage); 216 return new JImageReader(jimage); 217 } 218 219 static class JImageReader extends BasicImageReader { 220 final Path jimage; 221 JImageReader(Path p) throws IOException { 222 super(p); 223 this.jimage = p; 224 } 225 226 String imageName() { | 178 .forEach(cn -> { 179 count.incrementAndGet(); 180 try { 181 System.out.println("Loading " + cn); 182 Class.forName(cn, false, loader); 183 } catch (VerifyError ve) { 184 System.err.println("VerifyError for " + cn); 185 failed.add(reader.imageName() + ": " + cn + " not verified: " + ve.getMessage()); 186 } catch (ClassNotFoundException e) { 187 failed.add(reader.imageName() + ": " + cn + " not found"); 188 } 189 }); 190 } 191 192 private String toClassName(String entry) { 193 int index = entry.indexOf('/', 1); 194 return entry.substring(index + 1, entry.length()) 195 .replaceAll("\\.class$", "").replace('/', '.'); 196 } 197 198 private static Set<String> EXCLUDED_MODULES = 199 Set.of("javafx.deploy", "jdk.deploy", "jdk.plugin", "jdk.javaws", 200 // All JVMCI packages other than jdk.vm.ci.services are dynamically 201 // exported to jdk.internal.vm.compiler and jdk.aot 202 "jdk.internal.vm.compiler", "jdk.aot" 203 ); 204 205 private boolean accept(String entry) { 206 int index = entry.indexOf('/', 1); 207 String mn = index > 1 ? entry.substring(1, index) : ""; 208 // filter deployment modules 209 210 if (mn.isEmpty() || EXCLUDED_MODULES.contains(mn)) { 211 return false; 212 } 213 return entry.endsWith(".class") && !entry.endsWith(MODULE_INFO); 214 } 215 216 private static JImageReader newJImageReader() throws IOException { 217 String home = System.getProperty("java.home"); 218 Path jimage = Paths.get(home, "lib", "modules"); 219 System.out.println("opened " + jimage); 220 return new JImageReader(jimage); 221 } 222 223 static class JImageReader extends BasicImageReader { 224 final Path jimage; 225 JImageReader(Path p) throws IOException { 226 super(p); 227 this.jimage = p; 228 } 229 230 String imageName() { |