ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/jtreg/util/Collections/CheckedListBash.java
(Generate patch)

Comparing jsr166/src/test/jtreg/util/Collections/CheckedListBash.java (file contents):
Revision 1.2 by jsr166, Wed Sep 1 07:47:27 2010 UTC vs.
Revision 1.3 by jsr166, Wed Sep 1 20:12:39 2010 UTC

# Line 108 | Line 108 | public class CheckedListBash {
108  
109          List even = clone(s);
110          Iterator it = even.iterator();
111 <        while(it.hasNext())
112 <            if(((Integer)it.next()).intValue() % 2 == 1)
111 >        while (it.hasNext())
112 >            if (((Integer)it.next()).intValue() % 2 == 1)
113                  it.remove();
114          it = even.iterator();
115 <        while(it.hasNext())
116 <            if(((Integer)it.next()).intValue() % 2 == 1)
115 >        while (it.hasNext())
116 >            if (((Integer)it.next()).intValue() % 2 == 1)
117                  fail("Failed to remove all odd nubmers.");
118  
119          List odd = clone(s);
120          for (int i=0; i<(listSize/2); i++)
121              odd.remove(i);
122          for (int i=0; i<(listSize/2); i++)
123 <            if(((Integer)odd.get(i)).intValue() % 2 != 1)
123 >            if (((Integer)odd.get(i)).intValue() % 2 != 1)
124                  fail("Failed to remove all even nubmers.");
125  
126          List all = clone(odd);
# Line 144 | Line 144 | public class CheckedListBash {
144          }
145          itAll = all.listIterator();
146          it = s.iterator();
147 <        while(it.hasNext())
148 <            if(it.next()==itAll.next())
147 >        while (it.hasNext())
148 >            if (it.next()==itAll.next())
149                  fail("Iterator.set failed to change value.");
150          if (!all.equals(s))
151              fail("Failed to reconstruct ints with ListIterator.");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines