Copilot commented on code in PR #1063:
URL:
https://github.com/apache/maven-compiler-plugin/pull/1063#discussion_r3523377462
##########
src/it/mcompiler-120/verify.groovy:
##########
@@ -20,7 +20,12 @@ def logFile = new File( basedir, 'build.log' )
assert logFile.exists()
content = logFile.text
+/*
+ * The message expected by this test was "unchecked call to add(E) as a member
of the raw type List".
+ * But we cannot test that message because it is locale-dependent. Check only
a few keywords instead.
+ */
+assert content.contains( 'add(E)' )
+assert content.contains( 'List' ) // May be `List` or `java.util.List`.
Review Comment:
The new keyword checks are very broad: `content.contains('List')` can match
unrelated occurrences (e.g., `ArrayList`, dependency/plugin names, etc.), and
the two `contains` calls don’t ensure `add(E)` and `List` come from the same
javac diagnostic. This can make the IT pass even if the expected
unchecked/raw-type message is no longer present.
Consider asserting that a *single log line* contains `add(E)` and a
whole-word `List`/`java.util.List` token, which stays locale-independent while
reducing false positives.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]