bug-classpath
[Top][All Lists]
Advanced

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

[Bug classpath/24752] ArrayList#listIterator(int).nextIndex() and previo


From: ujihara at aurora dot dti dot ne dot jp
Subject: [Bug classpath/24752] ArrayList#listIterator(int).nextIndex() and previousIndex() should not call checkMod().
Date: 12 Nov 2005 11:44:43 -0000


------- Comment #7 from ujihara at aurora dot dti dot ne dot jp  2005-11-12 
11:44 -------
The other example is in java/util/AbstractList.java of Classpath. 
The following is an methods implementing ListIterator creating in
AbstractList$SubList#listIterator(int). (See later part of AbstractList.java)

 public void remove()
 {
     i.remove();
     size--;
     position = nextIndex();
     modCount = backingList.modCount;
 }

'i' is ListIterator created by backingList.listIterator(int).
This method does i.remove() at the 1st line, and does i.nextIndex() at the 3rd
line through this.nextIndex() { return i.nextIndex() - offset; }.

It means SubList.remove() method always fails.
The same logic might be used by the other programs.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24752





reply via email to

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