RFR: 8366498: Simplify ClassFileParser::parse_super_class [v3]

Coleen Phillimore coleenp at openjdk.org
Wed Sep 3 11:28:45 UTC 2025


On Mon, 1 Sep 2025 07:55:39 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> The if `cp->resolved_klass_at()` is never true called because we are very early in class file parsing, so no klass CP entries have been resolved at this point.
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
> 
>   removed test-only assert

It's a minor point really but while you're making this logic less confusing, might as well fix the extra else.

src/hotspot/share/classfile/classFileParser.cpp line 5770:

> 5768:                        "java.lang.Object cannot implement an interface in class file %s",
> 5769:                        CHECK);
> 5770:   }

This is somewhat strange logic.  Seems like there should be an assert that _super_klass == nullptr then an 'else' at 5779 and an assert that _super_class_index != 0.  The trailing else is confusing and it checks something here at 5775.

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

Changes requested by coleenp (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27026#pullrequestreview-3180189082
PR Review Comment: https://git.openjdk.org/jdk/pull/27026#discussion_r2318661824


More information about the hotspot-runtime-dev mailing list