This is the mail archive of the java-prs@gcc.gnu.org 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]
Other format: [Raw text]

[Bug classpath/27028] Iterator.hasNext() throws ConcurrentModificationException



------- Comment #5 from mckinlay at redhat dot com  2006-04-05 15:19 -------
(In reply to comment #4)
> I would argue that Sun's implementation is correct in this case in the
> sense that hasNext() doesn't actually modify anything, only next() does.

Yeah, I agree - although you might get a bogus answer for hasNext(), 99% of the
time, the application is about to call next(), so they'll get the exception
there anyway. Changing this also gives a slight performance improvement for
iterators.

This bug seems to be coming up pretty regularly. I'm working on a patch and
test case for it.


-- 

mckinlay at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|mckinlay at redhat dot com  |unassigned at gcc dot gnu
                   |                            |dot org
             Status|ASSIGNED                    |NEW


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


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