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

Comparing jsr166/src/main/java/util/concurrent/ConcurrentSkipListMap.java (file contents):
Revision 1.44 by dl, Fri Nov 25 13:28:24 2005 UTC vs.
Revision 1.45 by dl, Fri Feb 10 12:17:56 2006 UTC

# Line 2141 | Line 2141 | public class ConcurrentSkipListMap<K,V>
2141       * @throws NullPointerException if the specified key is null
2142       */
2143      public boolean remove(Object key, Object value) {
2144 +        if (key == null)
2145 +            throw new NullPointerException();
2146          if (value == null)
2147              return false;
2148          return doRemove(key, value) != null;
# Line 2780 | Line 2782 | public class ConcurrentSkipListMap<K,V>
2782          public void clear() {
2783              ConcurrentSkipListMap.this.clear();
2784          }
2785 +        public boolean equals(Object o) {
2786 +            if (o == this)
2787 +                return true;
2788 +            if (!(o instanceof Set))
2789 +                return false;
2790 +            Collection<?> c = (Collection<?>) o;
2791 +            try {
2792 +                return containsAll(c) && c.containsAll(this);
2793 +            } catch (ClassCastException unused)   {
2794 +                return false;
2795 +            } catch (NullPointerException unused) {
2796 +                return false;
2797 +            }
2798 +        }
2799      }
2800  
2801      class DescendingKeySet extends KeySet {
# Line 2833 | Line 2849 | public class ConcurrentSkipListMap<K,V>
2849          public void clear() {
2850              ConcurrentSkipListMap.this.clear();
2851          }
2852 +        public boolean equals(Object o) {
2853 +            if (o == this)
2854 +                return true;
2855 +            if (!(o instanceof Set))
2856 +                return false;
2857 +            Collection<?> c = (Collection<?>) o;
2858 +            try {
2859 +                return containsAll(c) && c.containsAll(this);
2860 +            } catch (ClassCastException unused)   {
2861 +                return false;
2862 +            } catch (NullPointerException unused) {
2863 +                return false;
2864 +            }
2865 +        }
2866      }
2867  
2868      class DescendingEntrySet extends EntrySet {
# Line 3167 | Line 3197 | public class ConcurrentSkipListMap<K,V>
3197              public boolean contains(Object k) {
3198                  return ConcurrentSkipListSubMap.this.containsKey(k);
3199              }
3200 +            public boolean equals(Object o) {
3201 +                if (o == this)
3202 +                    return true;
3203 +                if (!(o instanceof Set))
3204 +                    return false;
3205 +                Collection<?> c = (Collection<?>) o;
3206 +                try {
3207 +                    return containsAll(c) && c.containsAll(this);
3208 +                } catch (ClassCastException unused)   {
3209 +                    return false;
3210 +                } catch (NullPointerException unused) {
3211 +                    return false;
3212 +                }
3213 +            }
3214 +
3215          }
3216  
3217          public Set<K> descendingKeySet() {
# Line 3234 | Line 3279 | public class ConcurrentSkipListMap<K,V>
3279                      return false;
3280                  return m.remove(key, e.getValue());
3281              }
3282 +            public boolean equals(Object o) {
3283 +                if (o == this)
3284 +                    return true;
3285 +                if (!(o instanceof Set))
3286 +                    return false;
3287 +                Collection<?> c = (Collection<?>) o;
3288 +                try {
3289 +                    return containsAll(c) && c.containsAll(this);
3290 +                } catch (ClassCastException unused)   {
3291 +                    return false;
3292 +                } catch (NullPointerException unused) {
3293 +                    return false;
3294 +                }
3295 +            }
3296          }
3297  
3298          public Set<Map.Entry<K,V>> descendingEntrySet() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines