RFR: 8294982: Implementation of Classfile API [v15]

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Feb 10 17:16:14 UTC 2023


On Fri, 10 Feb 2023 11:12:25 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/classfile/constantpool/AnnotationConstantValueEntry.java line 33:
>> 
>>> 31:  * which includes the four kinds of primitive constants, and UTF8 constants.
>>> 32:  */
>>> 33: public sealed interface AnnotationConstantValueEntry extends PoolEntry
>> 
>> Should this extend LoadableConstantEntry (and restrict it more) ?
>
> `LoadableConstantEntry` and `AnnotationConstantValueEntry` are just partially overlapping according to the spec.
> The biggest difference (and source of confusion) is that `StringEntry` is `LoadableConstantEntry`, however not `AnnotationConstantValueEntry` and `Utf8Entry` is `AnnotationConstantValueEntry`, however not `LoadableConstantEntry`.

Ugh - you are right of course!

>> src/java.base/share/classes/jdk/internal/classfile/instruction/CharacterRange.java line 60:
>> 
>>> 58:      * viewed as an array of (possibly multi-byte) characters.
>>> 59:      */
>>> 60:     int characterRangeStart();
>> 
>> Not sure if this belongs here - e.g. it seems to me that `characterRangeStart` is less useful than the labels. But I'm not super expert on how this code element might be used.
>
> It is character range within the source code, not the bytecode.

I see - I was probably confusing myself (I wonder if the method names played some part in that)

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

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



More information about the build-dev mailing list