Copilot commented on code in PR #3645:
URL: https://github.com/apache/maven-surefire/pull/3645#discussion_r4733008081
##########
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java:
##########
@@ -590,9 +590,12 @@ private static void getTestProblems(
//noinspection ThrowableResultOfMethodCallIgnored
SafeThrowable t = report.getStackTraceWriter().getThrowable();
if (t != null) {
- if (t.getMessage() != null) {
- int delimiter = stackTrace.indexOf(":");
- String type = delimiter == -1 ? stackTrace :
stackTrace.substring(0, delimiter);
+ if (t.getLocalizedMessage() != null) {
Review Comment:
Selecting this branch by the localized message can abort XML reporting when
a writer returns a null trace for a localized-only throwable. It also produces
`type="Class:"` in-process when the ordinary message is set, the localized
message is null, and a custom `toString()` returns `Class: message`. Guard
header parsing with `isNotBlank(stackTrace)` instead, independently of either
message accessor.
--
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]