Re: RFR: 8329099: Undocumented exception thrown by Instruction factory methods accepting Opcode [v2]

2024-04-03 Thread Adam Sotona
On Wed, 3 Apr 2024 11:42:04 GMT, ExE Boss  wrote:

> The following factory methods are also missing `@throws 
> IllegalArgumentException`:
> 
> * `ConstantInstruction::ofIntrinsic`
> * `ConstantInstruction::ofArgument`
> * `ConstantInstruction::ofLoad`

Great catch, I'll add them, thank you!

-

PR Comment: https://git.openjdk.org/jdk/pull/18578#issuecomment-2034372250


Re: RFR: 8329099: Undocumented exception thrown by Instruction factory methods accepting Opcode [v2]

2024-04-03 Thread ExE Boss
On Wed, 3 Apr 2024 10:06:31 GMT, Adam Sotona  wrote:

>> `IllegalArgumentException` thrown by some static factory methods of the 
>> following `java.lang.classfile.instruction` interfaces are not documented:
>> 
>> - `ArrayLoadInstruction`
>> - `ArrayStoreInstruction`
>> - `BranchInstruction`
>> - `ConvertInstruction`
>> - `DiscontinuedInstruction`
>> - `FieldInstruction`
>> - `InvokeInstruction`
>> - `LoadInstruction`
>> - `MonitorInstruction`
>> - `NewPrimitiveArrayInstruction`
>> - `OperatorInstruction`
>> - `ReturnInstruction`
>> - `StackInstruction`
>> - `StoreInstruction`
>> - `TypeCheckInstruction`
>> 
>> `NewPrimitiveArrayInstruction::of` factory method also does not perform the 
>> check for invalid argument.
>> 
>> This patch adds all the missing `@throws` Javadoc tags and fixes 
>> `NewPrimitiveArrayInstruction::of` factory method to perform the argument 
>> check.
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Apply suggestions from code review
>   
>   Co-authored-by: ExE Boss <3889017+exe-b...@users.noreply.github.com>

The following factory methods are also missing `@throws 
IllegalArgumentException`:
- `ConstantInstruction::ofIntrinsic`
- `ConstantInstruction::ofArgument`
- `ConstantInstruction::ofLoad`

-

PR Comment: https://git.openjdk.org/jdk/pull/18578#issuecomment-2034350493


Re: RFR: 8329099: Undocumented exception thrown by Instruction factory methods accepting Opcode [v2]

2024-04-03 Thread Adam Sotona
> `IllegalArgumentException` thrown by some static factory methods of the 
> following `java.lang.classfile.instruction` interfaces are not documented:
> 
> - `ArrayLoadInstruction`
> - `ArrayStoreInstruction`
> - `BranchInstruction`
> - `ConvertInstruction`
> - `DiscontinuedInstruction`
> - `FieldInstruction`
> - `InvokeInstruction`
> - `LoadInstruction`
> - `MonitorInstruction`
> - `NewPrimitiveArrayInstruction`
> - `OperatorInstruction`
> - `ReturnInstruction`
> - `StackInstruction`
> - `StoreInstruction`
> - `TypeCheckInstruction`
> 
> `NewPrimitiveArrayInstruction::of` factory method also does not perform the 
> check for invalid argument.
> 
> This patch adds all the missing `@throws` Javadoc tags and fixes 
> `NewPrimitiveArrayInstruction::of` factory method to perform the argument 
> check.
> 
> Please review.
> 
> Thank you,
> Adam

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

  Apply suggestions from code review
  
  Co-authored-by: ExE Boss <3889017+exe-b...@users.noreply.github.com>

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/18578/files
  - new: https://git.openjdk.org/jdk/pull/18578/files/185dda1a..68949904

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=18578=01
 - incr: https://webrevs.openjdk.org/?repo=jdk=18578=00-01

  Stats: 3 lines in 1 file changed: 1 ins; 1 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/18578.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/18578/head:pull/18578

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