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

Comparing jsr166/src/main/java/util/concurrent/CopyOnWriteArrayList.java (file contents):
Revision 1.145 by jsr166, Sun Jan 7 18:45:20 2018 UTC vs.
Revision 1.146 by jsr166, Sun Jan 7 19:17:44 2018 UTC

# Line 490 | Line 490 | public class CopyOnWriteArrayList<E>
490      public boolean remove(Object o) {
491          Object[] snapshot = getArray();
492          int index = indexOf(o, snapshot, 0, snapshot.length);
493 <        return (index < 0) ? false : remove(o, snapshot, index);
493 >        return index >= 0 && remove(o, snapshot, index);
494      }
495  
496      /**
# Line 569 | Line 569 | public class CopyOnWriteArrayList<E>
569       */
570      public boolean addIfAbsent(E e) {
571          Object[] snapshot = getArray();
572 <        return indexOf(e, snapshot, 0, snapshot.length) >= 0 ? false :
573 <            addIfAbsent(e, snapshot);
572 >        return indexOf(e, snapshot, 0, snapshot.length) < 0
573 >            && addIfAbsent(e, snapshot);
574      }
575  
576      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines