I agree it would be nice if the JVM threw an exception but it's not a 
bug if it fails to do so - see 
http://java.sun.com/j2se/1.4.2/docs/api/java/util/ConcurrentModificationException.html

"Fail-fast operations throw ConcurrentModificationException on a 
best-effort basis. Therefore, it would be wrong to write a program that 
depended on this exception for its correctness: 
ConcurrentModificationException should be used only to detect bugs."

Mind you, that's for Iterators - I'm not sure that Enumerations even 
check for concurrent modification.

Cheers,
Michael

Sven-Ola Tuecke wrote:
> Hi,
> 
> a carefully crafted runtime may throw an excepetion in that case - which is 
> not the case in both sun and gnu implementations. The code snippet is 
> extracted from freenet/src/freenet/node/LocationManager.java...
> 
> // Sven-Ola
> 
> ----- Original Message ----- 
> From: "Michael Rogers" <m.rogers at cs.ucl.ac.uk>
> To: "Discussion of development issues" <devl at freenetproject.org>
> Sent: Sunday, April 13, 2008 11:47 AM
> Subject: Re: [freenet-dev] Classpath vs. Sun-Java diffs
> 
> 
> I'm used to Iterators rather than Enumerations, but doesn't modifying a
> collection invalidate any associated enumerations?
> 
> Cheers,
> Michael
> 
> Sven-Ola T?cke wrote:
>> Hi,
>>
>> found some time to investigate the "NPE while running freenet
>> under gcj/gij/classpath" issue. The attached java snippet's output is
>> different:
>>
>> root at pcacer:/media/hdd/PVR/src/test# update-java-alternatives -s java-gcj 
>>  > /dev/null 2>&1
>> root at pcacer:/media/hdd/PVR/src/test# java Hashme
>> next(-5625102382211955399)
>> remove(-5625102382211955399)
>> remove(-5625102382211955398)
>> next(-8661044121393429580)
>> next(null)
>> root at pcacer:/media/hdd/PVR/src/test# update-java-alternatives -s 
>> java-6-sun > /dev/null 2>&1
>> root at pcacer:/media/hdd/PVR/src/test# java Hashme
>> next(-5625102382211955399)
>> remove(-5625102382211955399)
>> remove(-5625102382211955398)
>> next(-8661044121393429580)
>>
>> As a temporaray fix, the 007*.patch works.
>>
>> // Sven-Ola
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Devl mailing list
>> Devl at freenetproject.org
>> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
> 
> _______________________________________________
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl 
> 
> _______________________________________________
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl


Reply via email to