--- jsr166/src/jsr166x/ConcurrentSkipListSet.java 2009/11/16 04:16:42 1.7 +++ jsr166/src/jsr166x/ConcurrentSkipListSet.java 2009/11/24 03:57:04 1.8 @@ -119,11 +119,11 @@ public class ConcurrentSkipListSet */ public Object clone() { ConcurrentSkipListSet clone = null; - try { - clone = (ConcurrentSkipListSet) super.clone(); - } catch (CloneNotSupportedException e) { - throw new InternalError(); - } + try { + clone = (ConcurrentSkipListSet) super.clone(); + } catch (CloneNotSupportedException e) { + throw new InternalError(); + } clone.m.initialize(); clone.addAll(this); @@ -149,7 +149,7 @@ public class ConcurrentSkipListSet * @return the number of elements in this set. */ public int size() { - return m.size(); + return m.size(); } /** @@ -157,7 +157,7 @@ public class ConcurrentSkipListSet * @return true if this set contains no elements. */ public boolean isEmpty() { - return m.isEmpty(); + return m.isEmpty(); } /** @@ -167,11 +167,11 @@ public class ConcurrentSkipListSet * @return true if this set contains the specified element. * * @throws ClassCastException if the specified object cannot be compared - * with the elements currently in the set. + * with the elements currently in the set. * @throws NullPointerException if o is null. */ public boolean contains(Object o) { - return m.containsKey(o); + return m.containsKey(o); } /** @@ -182,11 +182,11 @@ public class ConcurrentSkipListSet * element. * * @throws ClassCastException if the specified object cannot be compared - * with the elements currently in the set. + * with the elements currently in the set. * @throws NullPointerException if o is null. */ public boolean add(E o) { - return m.putIfAbsent(o, Boolean.TRUE) == null; + return m.putIfAbsent(o, Boolean.TRUE) == null; } /** @@ -196,18 +196,18 @@ public class ConcurrentSkipListSet * @return true if the set contained the specified element. * * @throws ClassCastException if the specified object cannot be compared - * with the elements currently in the set. + * with the elements currently in the set. * @throws NullPointerException if o is null. */ public boolean remove(Object o) { - return m.removep(o); + return m.removep(o); } /** * Removes all of the elements from this set. */ public void clear() { - m.clear(); + m.clear(); } /** @@ -217,7 +217,7 @@ public class ConcurrentSkipListSet * @return an iterator over the elements in this set. */ public Iterator iterator() { - return m.keyIterator(); + return m.keyIterator(); } /** @@ -227,7 +227,7 @@ public class ConcurrentSkipListSet * @return an iterator over the elements in this set. */ public Iterator descendingIterator() { - return m.descendingKeyIterator(); + return m.descendingKeyIterator(); } /* ---------------- AbstractSet Overrides -------------- */ @@ -246,11 +246,11 @@ public class ConcurrentSkipListSet */ public boolean equals(Object o) { // Override AbstractSet version to avoid calling size() - if (o == this) - return true; - if (!(o instanceof Set)) - return false; - Collection c = (Collection) o; + if (o == this) + return true; + if (!(o instanceof Set)) + return false; + Collection c = (Collection) o; try { return containsAll(c) && c.containsAll(this); } catch(ClassCastException unused) { @@ -411,8 +411,8 @@ public class ConcurrentSkipListSet * @param fromElement low endpoint (inclusive) of the subSet. * @param toElement high endpoint (exclusive) of the subSet. * @return a view of the portion of this set whose elements range from - * fromElement, inclusive, to toElement, - * exclusive. + * fromElement, inclusive, to toElement, + * exclusive. * @throws ClassCastException if fromElement and * toElement cannot be compared to one another using * this set's comparator (or, if the set has no comparator, @@ -420,10 +420,10 @@ public class ConcurrentSkipListSet * @throws IllegalArgumentException if fromElement is * greater than toElement. * @throws NullPointerException if fromElement or - * toElement is null. + * toElement is null. */ public NavigableSet subSet(E fromElement, E toElement) { - return new ConcurrentSkipListSubSet(m, fromElement, toElement); + return new ConcurrentSkipListSubSet(m, fromElement, toElement); } /** @@ -433,14 +433,14 @@ public class ConcurrentSkipListSet * set, and vice-versa. * @param toElement high endpoint (exclusive) of the headSet. * @return a view of the portion of this set whose elements are strictly - * less than toElement. + * less than toElement. * @throws ClassCastException if toElement is not compatible * with this set's comparator (or, if the set has no comparator, * if toElement does not implement Comparable). * @throws NullPointerException if toElement is null. */ public NavigableSet headSet(E toElement) { - return new ConcurrentSkipListSubSet(m, null, toElement); + return new ConcurrentSkipListSubSet(m, null, toElement); } @@ -459,7 +459,7 @@ public class ConcurrentSkipListSet * @throws NullPointerException if fromElement is null. */ public NavigableSet tailSet(E fromElement) { - return new ConcurrentSkipListSubSet(m, fromElement, null); + return new ConcurrentSkipListSubSet(m, fromElement, null); } /**