[lworld] RFR: 8378232: [lworld] Redundant clause in ClassFileParser::verify_legal_class_modifiers

Chen Liang liach at openjdk.org
Fri Feb 20 14:21:17 UTC 2026


On Fri, 20 Feb 2026 10:48:23 GMT, Casper Norrbin <cnorrbin 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.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/2146#discussion_r2833415120


More information about the valhalla-dev mailing list