RFR: 8294982: Implementation of Classfile API [v15]
Adam Sotona
asotona at openjdk.org
Wed Feb 15 14:27:28 UTC 2023
On Thu, 9 Feb 2023 14:18:56 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
>>
>> AttributeElement.Kind removal (#48)
>
> src/java.base/share/classes/jdk/internal/classfile/instruction/CharacterRange.java line 47:
>
>> 45: * {@return the start of the instruction range}
>> 46: */
>> 47: Label startScope();
>
> I noticed that this pattern of start/endScope is here, but also in ExceptionCatch, LocalVariable and LocalVariableType. Consider using a common interface for "instructions that are associated with a range".
That is interesting RFE, thanks.
> src/java.base/share/classes/jdk/internal/classfile/instruction/InvokeInstruction.java line 60:
>
>> 58: * {@return whether the class holding the method is an interface}
>> 59: */
>> 60: boolean isInterface();
>
> This can also be tested with pattern matching on the MemberRefEntry?
Unfortunately the distinction is dynamic. As of my imagination pattern matching is not the best to model interface distinction of `InvokeInstruction`.
-------------
PR: https://git.openjdk.org/jdk/pull/10982
More information about the core-libs-dev
mailing list