On Mon, 6 May 2024 19:31:43 GMT, Per Minborg <pminb...@openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/lang/StableArray.java line 25:
>> 
>>> 23:  * @since 23
>>> 24:  */
>>> 25: public sealed interface StableArray<V>
>> 
>> Do we have a use case for StableArray beyond those of StableList?
>
> I am trying to model multi-dimensional arrays that also provide flattening. 
> Let's see if it becomes useful.

I think this StableArray can be used as an explicit field type to block 
reflection modifications and enforce constant-folding; the List interface 
cannot. Though in long term I still believe strict final fields are better.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18794#discussion_r1601931752

Reply via email to