This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug java/35020] Class.getSimpleName() differs from Sun Java
- From: "mark at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 29 Jan 2008 21:02:44 -0000
- Subject: [Bug java/35020] Class.getSimpleName() differs from Sun Java
- References: <bug-35020-15511@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from mark at gcc dot gnu dot org 2008-01-29 21:02 -------
Note that the libgcj and classpath versions of getSimpleName() were written
independently.
Although the classpath implementation might help in the short run. It is based
on syntactically reconstructing the simple name. The correct fix would use the
out class InnerClasses bytecode attribute.
inner_name_index
If C is anonymous, the value of the inner_name_index item must be zero.
Otherwise, the value of the inner_name_index item must be a valid index into
the constant_pool table, and the entry at that index must be a
CONSTANT_Utf8_info (§4.4.7) structure that represents the original simple name
of C, as given in the source code from which this class file was compiled.
See
http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#79996
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35020