[Bug java/12857] Illegal method modifier when loading a generated .class

jsturm at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Nov 3 01:50:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


jsturm at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2003-10-31 15:37:37         |2003-11-03 01:50:18
               date|                            |
   Target Milestone|---                         |3.4


------- Additional Comments From jsturm at gcc dot gnu dot org  2003-11-03 01:50 -------
Nice test case, thanks.

The problem here is that gcj tries to create the static "class$" synthetic
method in TestInterface, which the verifier quite rightly complains about (as
does libgcj's bytecode verifier, for that matter).

The proper fix is to create an anonymous inner class of TestInterface to contain
the class$ method.  This is what jikes and javac do.

This is a little awkward in gcj where we don't discover that this anonymous
class is necessary until the 2nd pass, at which time the list of classes to
generate is normally complete.  I'll try to think of a non-intrusive patch so
this can go into 3.4.



More information about the Gcc-bugs mailing list