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

Comparing jsr166/src/test/tck/AtomicIntegerArrayTest.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 61 | Line 61 | public class AtomicIntegerArrayTest exte
61          AtomicIntegerArray ai = new AtomicIntegerArray(SIZE);
62          try {
63              ai.get(SIZE);
64 <        } catch(IndexOutOfBoundsException success){
64 >        } catch (IndexOutOfBoundsException success){
65          }
66          try {
67              ai.get(-1);
68 <        } catch(IndexOutOfBoundsException success){
68 >        } catch (IndexOutOfBoundsException success){
69          }
70          try {
71              ai.set(SIZE, 0);
72 <        } catch(IndexOutOfBoundsException success){
72 >        } catch (IndexOutOfBoundsException success){
73          }
74          try {
75              ai.set(-1, 0);
76 <        } catch(IndexOutOfBoundsException success){
76 >        } catch (IndexOutOfBoundsException success){
77          }
78      }
79  
# Line 133 | Line 133 | public class AtomicIntegerArrayTest exte
133          a.set(0, 1);
134          Thread t = new Thread(new Runnable() {
135                  public void run() {
136 <                    while(!a.compareAndSet(0, 2, 3)) Thread.yield();
136 >                    while (!a.compareAndSet(0, 2, 3)) Thread.yield();
137                  }});
138          try {
139              t.start();
# Line 142 | Line 142 | public class AtomicIntegerArrayTest exte
142              assertFalse(t.isAlive());
143              assertEquals(a.get(0), 3);
144          }
145 <        catch(Exception e) {
145 >        catch (Exception e) {
146              unexpectedException();
147          }
148      }
# Line 155 | Line 155 | public class AtomicIntegerArrayTest exte
155          AtomicIntegerArray ai = new AtomicIntegerArray(SIZE);
156          for (int i = 0; i < SIZE; ++i) {
157              ai.set(i, 1);
158 <            while(!ai.weakCompareAndSet(i, 1,2));
159 <            while(!ai.weakCompareAndSet(i, 2,-4));
158 >            while (!ai.weakCompareAndSet(i, 1,2));
159 >            while (!ai.weakCompareAndSet(i, 2,-4));
160              assertEquals(-4,ai.get(i));
161 <            while(!ai.weakCompareAndSet(i, -4,7));
161 >            while (!ai.weakCompareAndSet(i, -4,7));
162              assertEquals(7,ai.get(i));
163          }
164      }
# Line 308 | Line 308 | public class AtomicIntegerArrayTest exte
308              t2.join();
309              assertEquals(c1.counts+c2.counts, SIZE * COUNTDOWN);
310          }
311 <        catch(InterruptedException ie) {
311 >        catch (InterruptedException ie) {
312              unexpectedException();
313          }
314      }
# Line 334 | Line 334 | public class AtomicIntegerArrayTest exte
334              for (int i = 0; i < SIZE; ++i) {
335                  assertEquals(l.get(i), r.get(i));
336              }
337 <        } catch(Exception e){
337 >        } catch (Exception e){
338              e.printStackTrace();
339              unexpectedException();
340          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines