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

Comparing jsr166/src/test/tck/AtomicLongTest.java (file contents):
Revision 1.11 by jsr166, Mon Nov 2 20:28:31 2009 UTC vs.
Revision 1.12 by jsr166, Mon Nov 16 04:57:10 2009 UTC

# Line 82 | Line 82 | public class AtomicLongTest extends JSR1
82          final AtomicLong ai = new AtomicLong(1);
83          Thread t = new Thread(new Runnable() {
84                  public void run() {
85 <                    while(!ai.compareAndSet(2, 3)) Thread.yield();
85 >                    while (!ai.compareAndSet(2, 3)) Thread.yield();
86                  }});
87          try {
88              t.start();
# Line 91 | Line 91 | public class AtomicLongTest extends JSR1
91              assertFalse(t.isAlive());
92              assertEquals(ai.get(), 3);
93          }
94 <        catch(Exception e) {
94 >        catch (Exception e) {
95              unexpectedException();
96          }
97      }
# Line 102 | Line 102 | public class AtomicLongTest extends JSR1
102       */
103      public void testWeakCompareAndSet(){
104          AtomicLong ai = new AtomicLong(1);
105 <        while(!ai.weakCompareAndSet(1,2));
106 <        while(!ai.weakCompareAndSet(2,-4));
105 >        while (!ai.weakCompareAndSet(1,2));
106 >        while (!ai.weakCompareAndSet(2,-4));
107          assertEquals(-4,ai.get());
108 <        while(!ai.weakCompareAndSet(-4,7));
108 >        while (!ai.weakCompareAndSet(-4,7));
109          assertEquals(7,ai.get());
110      }
111  
# Line 207 | Line 207 | public class AtomicLongTest extends JSR1
207              ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
208              AtomicLong r = (AtomicLong) in.readObject();
209              assertEquals(l.get(), r.get());
210 <        } catch(Exception e){
210 >        } catch (Exception e){
211              unexpectedException();
212          }
213      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines