ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/RLMap.java
(Generate patch)

Comparing jsr166/src/test/loops/RLMap.java (file contents):
Revision 1.2 by dl, Mon Feb 19 00:46:06 2007 UTC vs.
Revision 1.3 by jsr166, Thu Oct 29 23:09:08 2009 UTC

# Line 18 | Line 18 | import java.util.concurrent.locks.*;
18   public class RLMap implements Map {
19      private final Map m;
20      private final ReentrantLock rl = new ReentrantLock();
21 <    
21 >
22      public RLMap(Map m) {
23          if (m == null)
24              throw new NullPointerException();
25          this.m = m;
26      }
27  
28 <    public RLMap() {
28 >    public RLMap() {
29          this(new TreeMap()); // use TreeMap by default
30      }
31  
# Line 51 | Line 51 | public class RLMap implements Map {
51      public Set keySet() { // Not implemented
52          return m.keySet();
53      }
54 <    
54 >
55      public Set entrySet() { // Not implemented
56          return m.entrySet();
57      }
58 <    
58 >
59      public Collection values() { // Not implemented
60          return m.values();
61      }
62 <    
62 >
63      public boolean equals(Object o) {
64          rl.lock(); try {return m.equals(o);} finally { rl.unlock(); }
65      }
# Line 84 | Line 84 | public class RLMap implements Map {
84      public void clear() {
85          rl.lock(); try {m.clear();} finally { rl.unlock(); }
86      }
87 <    
87 >
88   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines