RFR: 8294982: Implementation of Classfile API [v20]

Adam Sotona asotona at openjdk.org
Wed Mar 1 10:09:06 UTC 2023


On Thu, 16 Feb 2023 14:19:12 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   added 4-byte Unicode text to Utf8EntryTest
>
> src/java.base/share/classes/jdk/internal/classfile/impl/ChainedFieldBuilder.java line 48:
> 
>> 46:         this.consumer = consumer;
>> 47:         FieldBuilder b = downstream;
>> 48:         while (b instanceof ChainedFieldBuilder cb)
> 
> I'm probably missing something - but if `b` is another chained builder, instead of using a loop, can't we just skip to its  `terminal` field? Also, the `downstream` field seems unused. (same considerations apply for `ChainedMethodBuilder` and `ChainedClassBuilder`).
> 
> I note that `NonTerminalCodeBuilder` seems to be already doing what I suggest here (e.g. skip to `terminal`).

I would have to test possible side-effects of the proposed shortcut to give you answer.
Thanks for pointing it out.

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

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



More information about the build-dev mailing list