RFR: 8256867: Classes with empty PermittedSubclasses attribute cannot be extended [v2]

Harold Seigel hseigel at openjdk.java.net
Tue Dec 8 14:26:14 UTC 2020


On Tue, 8 Dec 2020 00:09:34 GMT, Mandy Chung <mchung at openjdk.org> wrote:

>> src/hotspot/share/prims/jvm.cpp line 2130:
>> 
>>> 2128:     JvmtiVMObjectAllocEventCollector oam;
>>> 2129:     Array<u2>* subclasses = ik->permitted_subclasses();
>>> 2130:     int length = subclasses == NULL ? 0 : subclasses->length();
>> 
>> Minor comment - you don't really need the check of subclasses == NULL here since subclasses will never be NULL.  You could just assign length to subclasses->length();
>
> +1.   is_sealed returns true iff `_permitted_subclasses != NULL`

Thanks for the reviews.  I removed the check of subclasses == NULL in the updated commit.

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

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


More information about the hotspot-dev mailing list