[jira] [Created] (BCEL-314) Expose the true class name

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[jira] [Created] (BCEL-314) Expose the true class name

JIRA jira@apache.org
Maciej Kwidziński created BCEL-314:

             Summary: Expose the true class name
                 Key: BCEL-314
                 URL: https://issues.apache.org/jira/browse/BCEL-314
             Project: Commons BCEL
          Issue Type: Improvement
            Reporter: Maciej Kwidziński

Natively, in the bytecode, class names look like this:
You can see it in {{NoClassDefFoundError}}, etc.

Bytecode decompilers and other bytecode-engineering libs (like kotlinx-metadata) will use this native format.

For some reason, [BCEL explicitly converts it to the dot notation|https://commons.apache.org/proper/commons-bcel/apidocs/org/apache/bcel/classfile/Utility.html#compactClassName-java.lang.String-boolean-]:

Shorten long class names, _java/lang/String_ becomes _java.lang.String_

I'm not sure how is that shorter, but it definitely makes interoperability harder, ie. if you want to base Java-specific bytecode engineering with BCEL and still reuse Kotlin-specific libraries for Kotlin-specific bytecode.
Could JavaClass expose the real, actual, bytecode-level class name?

This message was sent by Atlassian JIRA