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

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

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines