RFR: 8294982: Implementation of Classfile API [v36]

Adam Sotona asotona at openjdk.org
Tue Mar 7 14:39:07 UTC 2023


On Thu, 2 Mar 2023 22:05:24 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   StackMapFrameInfo extracted to top level from StackMapTableAttribute
>
> src/java.base/share/classes/jdk/internal/classfile/impl/AbstractInstruction.java line 156:
> 
>> 154:         @Override
>> 155:         public String toString() {
>> 156:             return String.format("Store[OP=%s, slot=%d]", this.opcode(), slot());
> 
> A suggestion. I believe the `toString` output for bound and unbound instructions should be identical and it can composed solely from methods on the public instruction interface. There are some differences e.g. `Increment` and `Inc` for the unbound and bound increment instruction respectively.
> 
> If those assumptions are correct i recommend placing a static `toString` method on all unbound instructions that also have bound instructions, accepting the public instruction interface as an argument. Then the overridden `Object::toString` method defers to those. Thereby there is no duplication.
> (Alas we cannot override `toString` on the instruction interface itself).

resolved using common static format Strings

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

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



More information about the build-dev mailing list