gnodet-bot commented on code in PR #13441:
URL: https://github.com/apache/maven/pull/13441#discussion_r4249156812
##########
compat/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java:
##########
@@ -567,8 +567,8 @@ void normalize() {
if (lastItem.isNull()) {
if (i == size() - 1 || get(i + 1).getType() ==
STRING_ITEM) {
remove(i);
- } else if (get(i + 1).getType() == LIST_ITEM) {
- Item item = ((ListItem) get(i + 1)).get(0);
+ } else if (get(i + 1) instanceof ListItem list &&
!list.isEmpty()) {
Review Comment:
⚠️ **Stale fix:** MNG-7594 was already resolved by commit 9da38851f
([MNG-6568]). The `!list.isEmpty()` guard is defensive-only — parsing
invariants ensure an empty `ListItem` cannot reach this branch. The new test
passes on master without this change, confirming the guarded path is
unreachable. If keeping this PR, please reframe it as defensive hardening
rather than a bug fix.
--
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]