ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ConcurrentHashMap.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ConcurrentHashMap.java (file contents):
Revision 1.203 by dl, Thu Apr 11 18:15:53 2013 UTC vs.
Revision 1.204 by dl, Thu Apr 11 18:43:33 2013 UTC

# Line 754 | Line 754 | public class ConcurrentHashMap<K,V>
754          /**
755           * Compares k and x: if k's comparable class (cc) matches x's,
756           * uses Comparable.compareTo. Otherwise compares on comparable
757 <         * class name if either exist, else 0.
757 >         * class name if both exist, else 0.
758           */
759          @SuppressWarnings("unchecked")
760          static int cccompare(Class<?> cc, Object k, Object x) {
761 <            Class<?> cx = comparableClassFor(x);
762 <            return ((cc == null) ? ((cx == null) ? 0 : 1) :
763 <                    (cx == null) ? -1 :
764 <                    (cx == cc) ? ((Comparable<Object>)k).compareTo(x) :
765 <                    cc.getName().compareTo(cx.getName()));
761 >            Class<?> cx;
762 >            return ((cc != null && (cx = comparableClassFor(x)) != null) ?
763 >                    ((cx == cc) ? ((Comparable<Object>)k).compareTo(x) :
764 >                     cc.getName().compareTo(cx.getName())) : 0);
765          }
766  
767          /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines