Skip to content

Commit

Permalink
Handle new format of used_classes_* reports in GraalVM for JDK 24
Browse files Browse the repository at this point in the history
Starting with GraalVM for JDK 24 the format of the report has changed
prefixing each line with the class loader name and a colon, e.g.:

GraalVM for JDK 22 (and 23 which is not released yet):
```
org.postgresql.jdbc.PgSQLXML
```

GraalVM for JDK 24:
```
com.oracle.svm.hosted.NativeImageClassLoader:org.postgresql.jdbc.PgSQLXML
```

Closes quarkusio#41917
  • Loading branch information
zakkak committed Jul 16, 2024
1 parent fdbcaf1 commit e849b75
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ public static ClassInclusionReport load() {
TreeSet<String> set = new TreeSet<>();
try (Scanner scanner = new Scanner(usedClassesReport.toFile())) {
while (scanner.hasNextLine()) {
set.add(scanner.nextLine());
// Starting with GraalVM for JDK 24 the format of the report has changed prefixing each line with
// the class loader name and a colon. We need to strip that part.
String[] line = scanner.nextLine().split(":");
set.add(line[line.length - 1]);
}
} catch (FileNotFoundException e) {
throw new RuntimeException("Could not load used classes report", e);
Expand Down

0 comments on commit e849b75

Please sign in to comment.