This is the mail archive of the java-prs@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug java/35020] Class.getSimpleName() differs from Sun Java



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]