I am implementing an Iterator and wish to throw the
concurrentMoficationException when the underlying list is modified. I do

this by keeping track of modCount variable in the iterator
implementation and throw the exception if         the modcount has
changed after the iterator is created. It works fine on NT and gives
runtime"        Exception in thread "main" java.lang.IllegalAccessError:

try to access field java.util.AbstractList.modCount from class
oracle.tip.repos.core.driver.AssociationList$Itr

Here AssociationList is my implementation of ArrayList.

 In the iterator
 private class Itr implements Iterator {
     int firstModCount = modCount;
     public Object next() throws ConcurrentModificationException {
     // after the iterator is created list has been modified, throw
     // concurrent modified exception
      int newModCount = modCount;

    if (firstModCount != newModCount)
    {
        throw new ConcurrentModificationException();
      }
 }
   This code executes in NT 4.0 without any problem only on solaris I
get the above runtime exception.

Could this be a bug ?  Any pointers on troubleshooting this problem ?

 thanks
       Poornima


_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to