mbien commented on code in PR #4678:
URL: https://github.com/apache/netbeans/pull/4678#discussion_r985175283


##########
java/spi.java.hints/src/org/netbeans/modules/java/hints/spiimpl/Utilities.java:
##########
@@ -1090,7 +1091,7 @@ public synchronized ClasspathInfo createUniversalCPInfo() 
{
                     .filter((p) -> 
"j2se".equals(p.getSpecification().getName()))
                     .filter((p) -> p.getSpecification().getVersion() != null)
                     .filter((p) -> 
p.getSpecification().getVersion().compareTo(maxVersion) < 0)
-                    .max((p1, p2) -> 
p1.getSpecification().getVersion().compareTo(p2.getSpecification().getVersion()))
+                    .max(Comparator.comparing((p) -> 
p.getSpecification().getVersion()))

Review Comment:
   to do this I had add generics to `SpecificationVersion`'s `Comparable` 
interface.
   
   i believe this should be safe since the class is final and the `compareTo` 
method would have thrown a `ClassCastException` anyway when anything other than 
SpecificationVersion would be passed as parameter.
   
   This requires a sig file change. 
   
   @neilcsmith-net could you take a look at the second commit if that is ok? 
The second commit is entirely optional, no big deal to drop it. I didn't bump 
any versions.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to