Java: Remove set_nested_class_simple_name_value()

Bryce McKinlay mckinlay@redhat.com
Thu Jun 24 05:09:00 GMT 2004


This patch fixes a bug that is exposed by another patch I'm working on, 
but the underlying problem is present on the current mainline compiler. 
What happens is:

1. GCJ parses Arrays.java, and set_nested_class_simple_name_value is 
called to set IDENTIFIER_CLASS_VALUE on indentifier nodes for each of 
its inner classes. IDENTIFIER_CLASS_VALUE for "ArrayList" is set to the 
inner class Arrays$ArrayList.

2. Then, while expanding methods in the Arrays class, a reference to the 
Collections class is seen and gcj recursively parses Collections.java. 
Collections has a reference to a type called "ArrayList". When 
do_resolve_class() is called, IDENTIFIER_CLASS_VALUE of "ArrayList" 
erronously obtains Arrays$ArrayList.

This sequence of events is sensitive to the order of files being parsed, 
whether or not they exist as classfiles, etc, but suffice to say that 
when other checks are improved, this bug is seen when compiling libjava. 
As far as I can tell, set_nested_class_simple_name_value does nothing 
useful and is quite broken given the recursive nature of gcj's class 
resolution and expansion. This patch removes it.

No testsuite regressions - ok to commit?

Bryce


-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcj-nested-class.patch
Type: text/x-patch
Size: 1842 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20040624/c6c5b758/attachment.bin>


More information about the Java-patches mailing list