RFR: 8367368: Add message for verify_legal_class_modifiers for inner classes

David Holmes dholmes at openjdk.org
Thu Sep 11 02:21:24 UTC 2025


On Wed, 10 Sep 2025 18:38:56 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> This adds the inner class name (or unnamed) to the error message for invalid inner class modifiers.
> Testing with tier1-4.

Overall seems fine, but a few minor nits/suggestions. Thanks

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

> 4275: // utility methods for format checking
> 4276: 
> 4277: void ClassFileParser::verify_legal_class_modifiers(jint flags, Symbol* inner_name, TRAPS) const {

Suggestion:

// Verify the class modifiers for the current class, or an inner class if inner_name is non-null.
void ClassFileParser::verify_legal_class_modifiers(jint flags, Symbol* inner_name, TRAPS) const {

src/hotspot/share/classfile/vmSymbols.hpp line 515:

> 513:   template(lockStackSize_name,                        "lockStackSize")                            \
> 514:   template(objectWaiter_name,                         "objectWaiter")                             \
> 515:   template(unnamed_name,                              "unnamed")                                  \

Shouldn't this use "anonymous" rather than "unnamed"?

test/hotspot/jtreg/runtime/InnerClassesAttr/OuterTest1.jcod line 109:

> 107:     Attr(#16) { // InnerClasses
> 108:       [] { // classes
> 109:         #14 #7 #17 0x0fff;

Is this where the invalid part is? Please add a comment

test/hotspot/jtreg/runtime/InnerClassesAttr/OuterTest2.jcod line 164:

> 162:     Attr(#26) { // InnerClasses
> 163:       [] { // classes
> 164:         #7 #0 #0 0x0fff;

Again, explanatory comment please.

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

PR Review: https://git.openjdk.org/jdk/pull/27201#pullrequestreview-3208421103
PR Review Comment: https://git.openjdk.org/jdk/pull/27201#discussion_r2338331347
PR Review Comment: https://git.openjdk.org/jdk/pull/27201#discussion_r2338333068
PR Review Comment: https://git.openjdk.org/jdk/pull/27201#discussion_r2338334162
PR Review Comment: https://git.openjdk.org/jdk/pull/27201#discussion_r2338335010


More information about the hotspot-dev mailing list