You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2019/11/08 13:13:05 UTC

[GitHub] [sling-org-apache-sling-feature] HarisAdzemovic commented on issue #15: Strings and Boxed types should be compared using "equals()"

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-551771185
 
 
   They differ in how they handle null:
   ```
           Integer a = new Integer(10);
           Integer b = null;
           a == b; --> False
           a.equals(b); --> False
           Integer.compare(a, b); --> NPE
           a.compareTo(b); --> NPE
   ```
   .equals() mirrors the previous behaviour but you know better than me what's actually preferable.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services