arturobernalg opened a new pull request, #3599:
URL: https://github.com/apache/maven-surefire/pull/3599
Fixes #3229.
`Float.parseFloat()`, introduced by the SUREFIRE-2167 simplification,
rejects a grouping separator (e.g. `"1,323.333"`), unlike the
`NumberFormat.getInstance(ENGLISH)` it replaced. JUnit 5's own
`LegacyXmlReportGeneratingListener` writes elapsed times with a grouping
separator once they reach 1000 seconds, so any report it produces for a
long-running suite could never be re-parsed by `surefire-report-parser` (e.g.
via `maven-surefire-report-plugin`), aborting with a bare
`NumberFormatException` wrapped in a `SAXException`.
Strip the separator before parsing at all three call sites (`testsuite` and
`testcase` time attributes, and the legacy `<time>` element). This is the exact
patch michael-o already wrote out and endorsed in the original issue thread
(#2715, "No fuzz, simple and stupid patch!"); nobody had opened a PR for it
since.
Verified directly: `Float.parseFloat("1,323.333")` throws
`NumberFormatException`, confirming the real JDK behavior behind the
regression. Reproduced the exact reported error end-to-end via
revert-test-restore (the new test fails with the reporter's own error message,
`Failed to parse time value: For input string: "1,323.333"`, on the unpatched
code, and passes with the fix). Ran the full `surefire-report-parser` suite,
checkstyle and spotless locally, all green.
To make clear that you license your contribution under the Apache License
Version 2.0, January 2004, check one of the following:
- [x] I hereby declare this contribution to be licensed under the Apache
License Version 2.0, January 2004
- [x] I hereby declare that I have filed an Apache Individual Contributor
License Agreement.
--
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]