elharo opened a new issue, #136:
URL: https://github.com/apache/maven-dependency-tree/issues/136

   ## Summary
   `VerboseJavaScopeSelector.ScopeComparator` orders scopes by `indexOf` in the 
fixed list `["compile", "runtime", "provided", "test"]`. Any scope not in that 
list (e.g. `system`, or a custom scope) returns `indexOf == -1` for both 
operands, so the comparator returns `0` for such pairs and can select the wrong 
“max” scope. This violates the `Comparator` contract and can corrupt the 
`REDUCED_SCOPE` value recorded on the winning node.
   
   ## Affected code
   
`src/main/java/org/apache/maven/shared/dependency/graph/internal/VerboseJavaScopeSelector.java:50-57`
   
   ## Suggested fix
   Give unknown scopes a deterministic ordering (e.g. treat as lower/least, or 
fall back to the full known Java scope list including `system`), and add a test 
for scopes outside the four listed ones.


-- 
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]

Reply via email to