ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166e/extra/ReadMostlyVector.java
(Generate patch)

Comparing jsr166/src/jsr166e/extra/ReadMostlyVector.java (file contents):
Revision 1.20 by jsr166, Sat Dec 31 18:48:47 2011 UTC vs.
Revision 1.22 by jsr166, Sat Dec 31 21:16:14 2011 UTC

# Line 49 | Line 49 | public class ReadMostlyVector<E>
49       * read-only mode, and then lock. When in read-only mode, they
50       * validate only at the end of an array scan unless the element is
51       * actually used (for example, as an argument of method equals).
52 +     *
53 +     * We rely on some invariants that are always true, even for field
54 +     * reads in read-only mode that have not yet been validated:
55 +     * - array != null
56 +     * - count >= 0
57       */
58  
59      /**
# Line 686 | Line 691 | public class ReadMostlyVector<E>
691                      if (lock.getSequence() != seq) {
692                          lock.lock();
693                          try {
694 <                            return rawLastIndexOf(o, count, 0);
694 >                            return rawLastIndexOf(o, count - 1, 0);
695                          } finally {
696                              lock.unlock();
697                          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines