[9] RFR (S): Class.getSimpleName() should work for non-JLS compliant class names

John Rose john.r.rose at oracle.com
Thu Apr 9 06:33:41 UTC 2015


On Apr 8, 2015, at 7:52 PM, David Holmes <david.holmes at oracle.com> wrote:
> 
> Meta-question: if this is non-Java code then what does/should "simpleName" even mean? "Returns the simple name of the underlying class as given in the source code." If there is no (java) source code does this have any meaning? Should it return "" ?

Non-Java languages can use the JVM's features, including the InnerClasses attribute.

The simple name of a class has a natural (JVM-level) definition in terms of the contents of the class's InnerClasses attribute.

Parsing the name string was always a buggy stopgap.  It doesn't fully make sense for either Java or non-Java programs.

— John


More information about the core-libs-dev mailing list