RFR: 8345836: stable annotation documentation is incomplete
Dan Heidinga
heidinga at openjdk.org
Tue Dec 10 16:31:59 UTC 2024
On Tue, 10 Dec 2024 07:36:26 GMT, Per Minborg <pminborg at openjdk.org> wrote:
>> The javadoc for jdk.internal.vm.annotation.Stable is incomplete.
>>
>> The existing documentation gives an over-simple user model,
>> and does not explain how it is implemented.
>> Proposed new documentation will detail how the annotation
>> is implemented, and how it may be used correctly.
>>
>> The improved documentation will makes it easier for JDK programmers
>> to use the annotation more aggressively, and more confidently.
>>
>> This is a first cut. Please comment…
>
> src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java line 63:
>
>> 61: * if the consequent optimization is desired.
>> 62: * <p>
>> 63: * As a special case, if a stable field is declared as an array type
>
> If `array` is a stable array field, is `array.length` treated as an independent stable variable?
If `array` is a stable field, wouldn't `array.length` just be a (potentially compile time) constant?
-------------
PR Review Comment: https://git.openjdk.org/leyden/pull/26#discussion_r1878426359
More information about the leyden-dev
mailing list