[lworld] RFR: 8378232: [lworld] Redundant clause in ClassFileParser::verify_legal_class_modifiers
Coleen Phillimore
coleenp at openjdk.org
Mon Feb 23 16:30:22 UTC 2026
On Fri, 20 Feb 2026 14:17:35 GMT, Chen Liang <liach at openjdk.org> wrote:
>> Hi everyone,
>>
>> In `ClassFileParser::verify_legal_class_modifiers`, the `valid_value_class` bool had a redundant `!is_identity`. Since `is_identity` is already handled by short-circuiting earlier in the expression, that condition is always true in the remaining branch. This change removes the redundancy without changing behavior.
>>
>> Testing:
>> - Tier 1
>
> src/hotspot/share/classfile/classFileParser.cpp line 4513:
>
>> 4511: (!valid_value_class)) {
>> 4512: ResourceMark rm(THREAD);
>> 4513: const char* class_note = "";
>
> This class_note variable controlled by valid_value_class is never used. Should we remove it? And the message would be wrong for the valid_value_class condition anyways because it allows ACC_IDENTITY.
please remove it, even though it's not strictly this issue, it's very close by, and also a cleanup.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/2146#discussion_r2841802887
More information about the valhalla-dev
mailing list