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

Comparing jsr166/src/main/java/util/concurrent/ConcurrentLinkedQueue.java (file contents):
Revision 1.7 by dholmes, Wed Aug 6 01:57:53 2003 UTC vs.
Revision 1.8 by dl, Wed Aug 6 10:28:23 2003 UTC

# Line 239 | Line 239 | public class ConcurrentLinkedQueue<E> ex
239      public int size() {
240          int count = 0;
241          for (AtomicLinkedNode p = first(); p != null; p = p.getNext()) {
242 <            if (p.getItem() != null)
243 <                ++count;
242 >            if (p.getItem() != null) {
243 >                // Collections.size() spec says to max out
244 >                if (++count == Integer.MAX_VALUE)
245 >                    break;
246 >            }
247          }
248          return count;
249      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines