RFR: 8294982: Implementation of Classfile API [v12]

Adam Sotona asotona at openjdk.org
Mon Feb 6 14:35:57 UTC 2023


On Fri, 3 Feb 2023 18:37:43 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Classfile API moved under jdk.internal.classfile package
>
> src/java.base/share/classes/jdk/internal/classfile/ClassSignature.java line 34:
> 
>> 32:  * Models the generic signature of a class file, as defined by JVMS 4.7.9.
>> 33:  */
>> 34: public sealed interface ClassSignature
> 
> It is a bit odd to have Signature and XYZSignature in the API with the latter not extending the former. I think I get what the API is aiming for though - e.g. Signature is for modelling low-level "portions" of the signature attributes, whereas ClassSignature, MethodSignature and friends are there to model the signature attribute attached to a class, method, etc.

The confusion come from simplified name. Signature probably should be called JavaTypeSignature according to the spec. ClassSignature and MethodSignature could not extend it, as it would not respect the reality. Each of them are completely different species. Signature (or JavaTypeSignature) on the other side has many sub-types.

-------------

PR: https://git.openjdk.org/jdk/pull/10982



More information about the build-dev mailing list