harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qi...@apache.org
Subject svn commit: r660395 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/util/AbstractList.java test/api/common/org/apache/harmony/luni/tests/java/util/AbstractListTest.java
Date Tue, 27 May 2008 05:55:35 GMT
Author: qiuxx
Date: Mon May 26 22:55:26 2008
New Revision: 660395

URL: http://svn.apache.org/viewvc?rev=660395&view=rev
Log:
Applying patch from HARMONY-5808 ([classlib][luni] add() method of listIterator implementation
in AbstractList may throw unexpected ConcurrentModificationException)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractList.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/AbstractListTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractList.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractList.java?rev=660395&r1=660394&r2=660395&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractList.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractList.java
Mon May 26 22:55:26 2008
@@ -103,7 +103,7 @@
                 pos++;
                 lastPosition = -1;
                 if (modCount != expectedModCount) {
-                    expectedModCount++;
+                    expectedModCount = modCount;
                 }
             } else {
                 throw new ConcurrentModificationException();

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/AbstractListTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/AbstractListTest.java?rev=660395&r1=660394&r2=660395&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/AbstractListTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/AbstractListTest.java
Mon May 26 22:55:26 2008
@@ -111,6 +111,13 @@
 		ListIterator lit2 = list2.listIterator();
 		lit2.add(new Object());
 		lit2.next();
+        
+        //Regression test for Harmony-5808
+        list = new MockArrayList();
+        ListIterator it = list.listIterator();
+        it.add("one");
+        it.add("two");
+        assertEquals(2,list.size());
 	}
 
 	/**
@@ -222,7 +229,7 @@
     	}
     	
     	public void add(int idx, E o) {
-    		modCount++;
+    		modCount += 10;
     		list.add(idx, o);
     	}
     }



Mime
View raw message