Patch: java.util.Hashtable enumerator vs specjvm javac

Bryce McKinlay bryce@waitaki.otago.ac.nz
Thu Sep 13 17:07:00 GMT 2001


This patch changes our Hashtable enumerator implementation to work more 
like Sun's, so that the specjvm javac benchmark will run correctly. In 
the event that a new element is added to a table while an enumeration is 
in progress, we previously could possibly throw an exception on 
nextElement() even if hasMoreElements(), called before the table was 
changed, returned true. nextElement() will now always return something 
if the last hasMoreElements() was true. I dont think the old behaviour 
was outside spec, since table modification during enumeration is unsafe 
and has undefined behaviour, but the old javac used in the benchmark 
apparantly expected it.

The "bug" was originally reported (and initial patch proposed) by Gansha Wu.

I've checked this in.

regards

Bryce.




More information about the Java-patches mailing list