RFR: 8294982: Implementation of Classfile API [v15]

Adam Sotona asotona at openjdk.org
Wed Feb 15 08:22:58 UTC 2023


On Thu, 9 Feb 2023 14:01:10 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   AttributeElement.Kind removal (#48)
>
> src/java.base/share/classes/jdk/internal/classfile/constantpool/ConstantPoolBuilder.java line 537:
> 
>> 535:      * @param <T> the type of the entry
>> 536:      */
>> 537:     <T extends PoolEntry> T maybeClone(T entry);
> 
> This feels a more primitive operation than the name suggests. Have you considered making ConstantPool extend Consumer<PoolEntry> and call this "accept" ?

I'm not quite sure what exactly do you propose.
`ConstantPool` should not accept anything as it is read-only, so "accept" would be confusing.
`ConstantPoolBuilder::maybeClone` is rather a `Function`, where the name might be changed to `ConstantPoolBuilder::apply`.
However there are so many "accepts" and "applies" across the API, that reducing API verbosity to just these functional terms might significantly decrease readability.

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

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



More information about the build-dev mailing list