diff --git a/src/main/java/org/checkerframework/specimin/SpeciminRunner.java b/src/main/java/org/checkerframework/specimin/SpeciminRunner.java index 5b434410..3a77c32c 100644 --- a/src/main/java/org/checkerframework/specimin/SpeciminRunner.java +++ b/src/main/java/org/checkerframework/specimin/SpeciminRunner.java @@ -502,10 +502,20 @@ private static void performMinimizationImpl( // cache to avoid called Files.createDirectories repeatedly with the same arguments Set createdDirectories = new HashSet<>(); + Set targetFilesAbsolutePaths = new HashSet<>(); + + for (String target : targetFiles) { + File targetFile = new File(target); + // Convert to absolute path for comparison + targetFilesAbsolutePaths.add(targetFile.getAbsolutePath()); + } for (Entry target : parsedTargetFiles.entrySet()) { - // ignore classes from the Java package. - if (target.getKey().startsWith("java/")) { + // ignore classes from the Java package, unless we are targeting a JDK file. + // However, all related java/ files should not be included (as in used, but not targeted) + String absolutePath = new File(target.getKey()).getAbsolutePath(); + if (!targetFilesAbsolutePaths.contains(absolutePath) + && (target.getKey().startsWith("java/") || target.getKey().startsWith("java\\"))) { continue; } // If a compilation output's entire body has been removed and the related class is not used by diff --git a/src/main/resources/preservation_status.json b/src/main/resources/preservation_status.json index d4d7c3c5..6274ea26 100644 --- a/src/main/resources/preservation_status.json +++ b/src/main/resources/preservation_status.json @@ -20,7 +20,7 @@ "jdk-8319461": "PASS", "jdk-8288590": "PASS", "na-89": "FAIL", - "na-97": "FAIL", + "na-97": "PASS", "na-102": "PASS", "na-103": "PASS", "na-176": "FAIL",