This is the mail archive of the java-patches@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: Work around compiler bug


This patch comments out two lines of code which are causing problems for
gcj due to a static inner class related bug (see my recent follow up to
PR 297 for a test case)

Without this code is enabled, nested sublist iterators will not
correctly check for concurrent modifications.

regards

  [ bryce ]


2000-11-02  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/util/AbstractList.java (remove): Comment out modCount increment
	to work around compiler bug.
	(add): Ditto.

Index: java/util/AbstractList.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/AbstractList.java,v
retrieving revision 1.3
diff -u -r1.3 AbstractList.java
--- AbstractList.java	2000/11/02 10:08:03	1.3
+++ AbstractList.java	2000/11/02 10:14:45
@@ -496,7 +496,8 @@
         public void remove()
 	{
           i.remove();
-	  SubList.this.modCount++;
+	  // FIXME: Uncomment the following line once the compiler is fixed.
+	  //SubList.this.modCount++;
           size--;
           position = nextIndex();
         }
@@ -509,7 +510,8 @@
         public void add(Object o)
 	{
           i.add(o);
-	  SubList.this.modCount++;
+	  // FIXME: Uncomment the following line once the compiler is fixed.
+	  //SubList.this.modCount++;
           size++;
           position++;
         }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]