RFR: 8323058: Revisit j.l.classfile.CodeBuilder API surface [v2]

Paul Sandoz psandoz at openjdk.org
Mon Feb 5 23:53:12 UTC 2024


On Mon, 5 Feb 2024 18:31:44 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> `java.lang.classfile.CodeBuilder` contains more than 230 API methods.
>> Existing ClassFile API use cases proved the concept one big CodeBuilder is comfortable. However there are some redundancies, glitches in the naming conventions, some frequently used methods are hard to find and some methods have low practical use.
>> 
>> This patch revisits the `CodeBuilder` API methods and introduces some changes.
>> 
>> For more details, please, visit the [CSR ](https://bugs.openjdk.org/browse/JDK-8323067)
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
> 
>   removed CodeBuilder::newObject methods

Marked as reviewed by psandoz (Reviewer).

src/java.base/share/classes/java/lang/classfile/CodeBuilder.java line 507:

> 505:      * @return this builder
> 506:      */
> 507:     default CodeBuilder newObject(ClassEntry type) {

The two `newObject` methods seem to fit in the pattern of methods that are being removed, since they don't differentiate sufficiently with the `new_` methods that defer to them.

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

PR Review: https://git.openjdk.org/jdk/pull/17282#pullrequestreview-1863531162
PR Review Comment: https://git.openjdk.org/jdk/pull/17282#discussion_r1478611886


More information about the hotspot-jfr-dev mailing list