classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in JVM ?


From: Poornima Ramarao
Subject: Bug in JVM ?
Date: Fri, 05 Apr 2002 13:25:47 -0800

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]