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

Comparing jsr166/src/test/loops/ListBash.java (file contents):
Revision 1.4 by dl, Sun Sep 25 13:10:45 2005 UTC vs.
Revision 1.7 by jsr166, Mon Nov 2 23:42:46 2009 UTC

# Line 21 | Line 21 | public class ListBash {
21  
22          try {
23              cl = Class.forName(args[0]);
24 <        } catch(ClassNotFoundException e) {
24 >        } catch (ClassNotFoundException e) {
25              fail("Class " + args[0] + " not found.");
26          }
27  
# Line 29 | Line 29 | public class ListBash {
29          oneRun();
30          oneRun();
31          oneRun();
32        oneRun();
33        oneRun();
32      }
33  
34      static void oneRun() {
# Line 96 | Line 94 | public class ListBash {
94              sum -= (s2.get(k)).intValue();
95          }
96          if (sum == 0) System.out.print(" ");
97 <    }    
97 >    }
98  
99      static void sets(List<Integer> s1, List<Integer> s2) {
100          List<Integer> intersection = clone(s1, cl,synch);intersection.retainAll(s2);
# Line 154 | Line 152 | public class ListBash {
152              all = clone(s, cl, synch);
153          else {
154              it = even.iterator();
155 <            while(it.hasNext())
156 <                if((it.next()).intValue() % 2 == 1)
155 >            while (it.hasNext())
156 >                if ((it.next()).intValue() % 2 == 1)
157                      it.remove();
158              it = even.iterator();
159 <            while(it.hasNext())
160 <                if((it.next()).intValue() % 2 == 1)
159 >            while (it.hasNext())
160 >                if ((it.next()).intValue() % 2 == 1)
161                      fail("Failed to remove all odd nubmers.");
162 <            
162 >
163              for (int i=0; i<(listSize/2); i++)
164                  odd.remove(i);
165              for (int i=0; i<(listSize/2); i++) {
166                  int ii = (odd.get(i)).intValue();
167 <                if(ii % 2 != 1)
167 >                if (ii % 2 != 1)
168                      fail("Failed to remove all even nubmers. " + ii);
169              }
170  
# Line 175 | Line 173 | public class ListBash {
173                  all.add(2*i, even.get(i));
174              if (!all.equals(s))
175                  fail("Failed to reconstruct ints from odds and evens.");
176 <            
176 >
177              all = clone(odd,  cl, synch);
178              ListIterator<Integer> itAll = all.listIterator(all.size());
179              ListIterator<Integer> itEven = even.listIterator(even.size());
# Line 191 | Line 189 | public class ListBash {
189              }
190              itAll = all.listIterator();
191              it = s.iterator();
192 <            while(it.hasNext())
193 <                if(it.next()==itAll.next())
192 >            while (it.hasNext())
193 >                if (it.next()==itAll.next())
194                      fail("Iterator.set failed to change value.");
195          }
196          if (!all.equals(s))
# Line 267 | Line 265 | public class ListBash {
265              if (!s.isEmpty())
266                  fail("New instance non empty.");
267              return s;
268 <        } catch(Throwable t) {
268 >        } catch (Throwable t) {
269              fail("Can't instantiate " + cl + ": " + t);
270          }
271          return null; //Shut up compiler.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines