HarisAdzemovic commented on issue #15: Strings and Boxed types should be 
compared using "equals()"
URL: 
https://github.com/apache/sling-org-apache-sling-feature/pull/15#issuecomment-551787523
 
 
   Sorry, you're right that it should probably be changed. I missed one case:
   ```
           Integer a = new Integer(10);
           Integer b = null;
           System.out.println(a.equals(b)); --> False
           System.out.println(b.equals(a)); --> NPE
   ```
   So equals() could "hide" an NPE.
   Should I change it to compare() or compareTo()?
   The documentation seems to indicate compare() is for int and compareTo for 
Integer but perhaps there's a good reason for using compare()?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to