From 9d3ac1a6033fa111f7ace2b2495a63a91318ff3e Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Fri, 18 Aug 2023 18:30:12 +0200 Subject: [PATCH] Show java.logging module in JCL comparison --- .../JCLComparisonBuilder.java | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/tools/classlib-comparison-gen/src/main/java/org/teavm/tools/classlibcomparison/JCLComparisonBuilder.java b/tools/classlib-comparison-gen/src/main/java/org/teavm/tools/classlibcomparison/JCLComparisonBuilder.java index b5cb9f9ec..9be2174fe 100644 --- a/tools/classlib-comparison-gen/src/main/java/org/teavm/tools/classlibcomparison/JCLComparisonBuilder.java +++ b/tools/classlib-comparison-gen/src/main/java/org/teavm/tools/classlibcomparison/JCLComparisonBuilder.java @@ -121,23 +121,25 @@ public class JCLComparisonBuilder { var packageMap = new HashMap(); var classSource = new ClasspathClassHolderSource(classLoader, new ReferenceCache()); visitor = new JCLComparisonVisitor(classSource, packageMap); - try { - var fs = FileSystems.getFileSystem(URI.create("jrt:/")); - var p = fs.getPath("modules/java.base/java"); - Files.walkFileTree(p, new SimpleFileVisitor<>() { - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - if (validateName(file.getFileName().toString())) { - try (InputStream input = Files.newInputStream(file)) { - compareClass(input); + for (var moduleName : List.of("java.base", "java.logging")) { + try { + var fs = FileSystems.getFileSystem(URI.create("jrt:/")); + var p = fs.getPath("modules/" + moduleName + "/java"); + Files.walkFileTree(p, new SimpleFileVisitor<>() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + if (validateName(file.getFileName().toString())) { + try (InputStream input = Files.newInputStream(file)) { + compareClass(input); + } } + return FileVisitResult.CONTINUE; } - return FileVisitResult.CONTINUE; - } - }); - System.out.println(); - } catch (FileSystemNotFoundException ex) { - System.out.println("Could not read my modules (perhaps not Java 9?)."); + }); + System.out.println(); + } catch (FileSystemNotFoundException ex) { + System.out.println("Could not read my modules (perhaps not Java 9?)."); + } } for (JCLPackage pkg : packageMap.values()) {