RFR: 8219810: javac throws NullPointerException [v3]

Archie L. Cobbs duke at openjdk.org
Wed Jan 4 16:00:00 UTC 2023


On Tue, 3 Jan 2023 21:19:05 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> Archie L. Cobbs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>> 
>>  - Merge branch 'master' into JDK-8219810
>>  - Merge branch 'master' into JDK-8219810
>>  - Also disallow field access flags from having both FINAL and VOLATILE.
>>  - Detect invalid access flag combinations for fields and methods in classfiles.
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java line 2268:
> 
>> 2266: 
>> 2267:         if (Integer.bitCount(rawFlags & (PUBLIC | PRIVATE | PROTECTED)) > 1)
>> 2268:             throw badClassFile("illegal.flag.combo", String.format("0x%04x", (int)rawFlags), "method", m);
> 
> instead of: `String.format("0x%04x", (int)rawFlags)`, you could use method `com.sun.tools.javac.code.Flags::toString` which generates a string representation of the flags passed to it

Great idea - thanks.

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

PR: https://git.openjdk.org/jdk/pull/10826


More information about the compiler-dev mailing list