Skip to content

Commit 849e5b8

Browse files
committed
AntSpec: Improve filter for warning "Archived non-system classes are disabled"
In JDK 21, the prefix has changed once again, no longer being a JVM specifier like "OpenJDK 64-Bit Server VM" or "Java HotSpot(TM) 64-Bit Server VM" but rather something like "[0.016s][warning][cds]". Fixes LTWTests.testJ14LTWWithXML, which started failing on Java 21. Signed-off-by: Alexander Kriegisch <[email protected]>
1 parent 3e81ed5 commit 849e5b8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

testing/src/test/java/org/aspectj/testing/AntSpec.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,10 @@ public void messageLogged(BuildEvent event) {
236236
stderr2 = stderr2.replaceAll("WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations\n","");
237237
stderr2 = stderr2.replaceAll("WARNING: All illegal access operations will be denied in a future release\n","");
238238
}
239-
// J12: Line can start with e.g."OpenJDK 64-Bit Server VM" or "Java HotSpot(TM) 64-Bit Server VM". Therefore,
240-
// we have to match a substring instead of a whole line
241-
stderr2 = stderr2.replaceAll("[^\n]+ warning: Archived non-system classes are disabled because the java.system.class.loader property is specified .*org.aspectj.weaver.loadtime.WeavingURLClassLoader[^\n]+\n?","");
239+
// J12: Line can start with e.g. "OpenJDK 64-Bit Server VM" or "Java HotSpot(TM) 64-Bit Server VM".
240+
// J21: Line can start with e.g. "[0.016s][warning][cds]".
241+
// Therefore, we have to match a substring instead of a whole line.
242+
stderr2 = stderr2.replaceAll("[^\n]+( warning:|\\[warning\\]\\[cds\\]) Archived non-system classes are disabled because the java.system.class.loader property is specified .*org.aspectj.weaver.loadtime.WeavingURLClassLoader[^\n]+\n?","");
242243
m_stdErrSpec.matchAgainst(stderr2);
243244
}
244245
}

0 commit comments

Comments
 (0)