Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8057919

Class.getSimpleName() should work for non-JLS compliant class names

XMLWordPrintable

        http://mail.openjdk.java.net/pipermail/mlvm-dev/2014-September/005939.html

        On 9/2/14, 12:59 PM, Jochen Theodorou wrote:
        I just wanted to ask, why Class#getSimpleName() is used in MethodType#toString(). People knowing this method from Class will also know that getSimpleName makes assumption about the inner class names, that are based on the JLS, which allows only a fraction of the names the JVM allows. Resulting in things like this:

        > java.lang.InternalError: Malformed class name
        > at java.lang.Class.getSimpleName(Class.java:1317)
        > at java.lang.invoke.MethodType.toString(MethodType.java:724)
        > at java.lang.String.valueOf(String.java:2979)
        > at java.lang.StringBuilder.append(StringBuilder.java:131)
        > at org.codehaus.groovy.vmplugin.v7.Selector$MethodSelector.<init>(Selector.java:477)

        bye Jochen

          There are no Sub-Tasks for this issue.

              vlivanov Vladimir Ivanov
              vlivanov Vladimir Ivanov
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: