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

Comparing jsr166/src/test/tck/AtomicReferenceArrayTest.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 62 | Line 62 | public class AtomicReferenceArrayTest ex
62          AtomicReferenceArray<Integer> ai = new AtomicReferenceArray<Integer>(SIZE);
63          try {
64              ai.get(SIZE);
65 <        } catch(IndexOutOfBoundsException success){
65 >        } catch (IndexOutOfBoundsException success){
66          }
67          try {
68              ai.get(-1);
69 <        } catch(IndexOutOfBoundsException success){
69 >        } catch (IndexOutOfBoundsException success){
70          }
71          try {
72              ai.set(SIZE, null);
73 <        } catch(IndexOutOfBoundsException success){
73 >        } catch (IndexOutOfBoundsException success){
74          }
75          try {
76              ai.set(-1, null);
77 <        } catch(IndexOutOfBoundsException success){
77 >        } catch (IndexOutOfBoundsException success){
78          }
79      }
80  
# Line 134 | Line 134 | public class AtomicReferenceArrayTest ex
134          a.set(0, one);
135          Thread t = new Thread(new Runnable() {
136                  public void run() {
137 <                    while(!a.compareAndSet(0, two, three)) Thread.yield();
137 >                    while (!a.compareAndSet(0, two, three)) Thread.yield();
138                  }});
139          try {
140              t.start();
# Line 143 | Line 143 | public class AtomicReferenceArrayTest ex
143              assertFalse(t.isAlive());
144              assertEquals(a.get(0), three);
145          }
146 <        catch(Exception e) {
146 >        catch (Exception e) {
147              unexpectedException();
148          }
149      }
# Line 156 | Line 156 | public class AtomicReferenceArrayTest ex
156          AtomicReferenceArray ai = new AtomicReferenceArray(SIZE);
157          for (int i = 0; i < SIZE; ++i) {
158              ai.set(i, one);
159 <            while(!ai.weakCompareAndSet(i, one,two));
160 <            while(!ai.weakCompareAndSet(i, two,m4));
159 >            while (!ai.weakCompareAndSet(i, one,two));
160 >            while (!ai.weakCompareAndSet(i, two,m4));
161              assertEquals(m4,ai.get(i));
162 <            while(!ai.weakCompareAndSet(i, m4,seven));
162 >            while (!ai.weakCompareAndSet(i, m4,seven));
163              assertEquals(seven,ai.get(i));
164          }
165      }
# Line 199 | Line 199 | public class AtomicReferenceArrayTest ex
199              for (int i = 0; i < SIZE; ++i) {
200                  assertEquals(r.get(i), l.get(i));
201              }
202 <        } catch(Exception e){
202 >        } catch (Exception e){
203              unexpectedException();
204          }
205      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines