RFR: 8265130: Make ConstantDesc class hierarchy sealed [v2]

Mandy Chung mchung at openjdk.java.net
Thu May 20 22:31:29 UTC 2021


On Thu, 20 May 2021 22:17:03 GMT, Gavin Bierman <gbierman at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/constant/DynamicConstantDesc.java line 59:
>> 
>>> 57:  * @since 12
>>> 58:  */
>>> 59: non-sealed public abstract class DynamicConstantDesc<T>
>> 
>> can you explain why `DynamicConstantDesc` is non-sealed?
>
> It's a permitted subclass of `ConstantDesc`, so it must be either `final`, `sealed`, or `non-sealed`. Making it `non-sealed` means it can still be extended.

I should have made it clear.  I was expecting `DynamicConstantDesc` should be `sealed`.  Do you expect non-JDK implementation class extending `DynamicConstantDesc`?

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

PR: https://git.openjdk.java.net/jdk/pull/4135


More information about the core-libs-dev mailing list