Re: RFR: 8294982: Implementation of Classfile API [v58]

2023-06-26 Thread Adam Sotona
On Fri, 23 Jun 2023 09:05:21 GMT, Andrey Turbanov  wrote:

>> Adam Sotona has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   removed obsolete javadoc from implementation classes
>
> src/java.base/share/classes/jdk/internal/classfile/instruction/ConstantInstruction.java
>  line 139:
> 
>> 137: Util.checkKind(op, Opcode.Kind.CONSTANT);
>> 138: if (op != Opcode.BIPUSH && op != Opcode.SIPUSH)
>> 139: throw new IllegalArgumentException(String.format("Wrong 
>> opcode specified; found %s, expected BIPUSH or SIPUSH", op, op.kind()));
> 
> IDEA shows warning here.
> Too many arguments for format string (found: 2, expected: 1)
> 
> Seems op.kind() parameter is unused in the format string.
> 
> And the same issue in 
> `jdk.internal.classfile.instruction.ConstantInstruction#ofLoad`

I'll fix it, thank you.

-

PR Review Comment: https://git.openjdk.org/jdk/pull/10982#discussion_r1241816908


Re: RFR: 8294982: Implementation of Classfile API [v58]

2023-06-23 Thread Andrey Turbanov
On Wed, 8 Mar 2023 08:50:24 GMT, Adam Sotona  wrote:

>> This is root pull request with Classfile API implementation, tests and 
>> benchmarks initial drop into JDK.
>> 
>> Following pull requests consolidating JDK class files parsing, generating, 
>> and transforming 
>> ([JDK-8294957](https://bugs.openjdk.org/browse/JDK-8294957)) will chain to 
>> this one.
>> 
>> Classfile API development is tracked at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-branch
>> 
>> Development branch of consolidated JDK class files parsing, generating, and 
>> transforming is at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-dev-branch
>> 
>> Classfile API [JEP](https://bugs.openjdk.org/browse/JDK-8280389) and [online 
>> API 
>> documentation](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk-sandbox/classfile-api-javadoc-branch/doc/classfile-api/javadoc/java.base/jdk/internal/classfile/package-summary.html)
>>  is also available.
>> 
>> Please take you time to review this non-trivial JDK addition.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   removed obsolete javadoc from implementation classes

src/java.base/share/classes/jdk/internal/classfile/instruction/ConstantInstruction.java
 line 139:

> 137: Util.checkKind(op, Opcode.Kind.CONSTANT);
> 138: if (op != Opcode.BIPUSH && op != Opcode.SIPUSH)
> 139: throw new IllegalArgumentException(String.format("Wrong 
> opcode specified; found %s, expected BIPUSH or SIPUSH", op, op.kind()));

IDEA shows warning here.
Too many arguments for format string (found: 2, expected: 1)

Seems op.kind() parameter is unused in the format string.

And the same issue in 
`jdk.internal.classfile.instruction.ConstantInstruction#ofLoad`

-

PR Review Comment: https://git.openjdk.org/jdk/pull/10982#discussion_r1239565938


Re: RFR: 8294982: Implementation of Classfile API [v58]

2023-03-14 Thread Glavo
On Wed, 8 Mar 2023 08:50:24 GMT, Adam Sotona  wrote:

>> This is root pull request with Classfile API implementation, tests and 
>> benchmarks initial drop into JDK.
>> 
>> Following pull requests consolidating JDK class files parsing, generating, 
>> and transforming 
>> ([JDK-8294957](https://bugs.openjdk.org/browse/JDK-8294957)) will chain to 
>> this one.
>> 
>> Classfile API development is tracked at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-branch
>> 
>> Development branch of consolidated JDK class files parsing, generating, and 
>> transforming is at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-dev-branch
>> 
>> Classfile API [JEP](https://bugs.openjdk.org/browse/JDK-8280389) and [online 
>> API 
>> documentation](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk-sandbox/classfile-api-javadoc-branch/doc/classfile-api/javadoc/java.base/jdk/internal/classfile/package-summary.html)
>>  is also available.
>> 
>> Please take you time to review this non-trivial JDK addition.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   removed obsolete javadoc from implementation classes

I ported the Classfile API implemented in this PR back to Java 17 and published 
it to Maven Central as a standalone library: https://github.com/Glavo/classfile

Some of my senior developer friends are trying to replace ASM with it. If I get 
any feedback, I'll report it to you.

-

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


Re: RFR: 8294982: Implementation of Classfile API [v58]

2023-03-08 Thread Adam Sotona
> This is root pull request with Classfile API implementation, tests and 
> benchmarks initial drop into JDK.
> 
> Following pull requests consolidating JDK class files parsing, generating, 
> and transforming ([JDK-8294957](https://bugs.openjdk.org/browse/JDK-8294957)) 
> will chain to this one.
> 
> Classfile API development is tracked at:
> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-branch
> 
> Development branch of consolidated JDK class files parsing, generating, and 
> transforming is at:
> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-dev-branch
> 
> Classfile API [JEP](https://bugs.openjdk.org/browse/JDK-8280389) and [online 
> API 
> documentation](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk-sandbox/classfile-api-javadoc-branch/doc/classfile-api/javadoc/java.base/jdk/internal/classfile/package-summary.html)
>  is also available.
> 
> Please take you time to review this non-trivial JDK addition.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with one additional 
commit since the last revision:

  removed obsolete javadoc from implementation classes

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/10982/files
  - new: https://git.openjdk.org/jdk/pull/10982/files/cd4a01cd..385cb264

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=10982&range=57
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10982&range=56-57

  Stats: 129 lines in 42 files changed: 0 ins; 128 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/10982.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10982/head:pull/10982

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