Re: RFR: 8331744: java.lang.classfile.TypeKind improvements [v5]

2024-05-10 Thread Chen Liang
On Thu, 9 May 2024 21:15:31 GMT, Chen Liang wrote: >> A peek into TypeKind during the research for #19105 reveals that TypeKind >> has a few issues: >> 1. Name mismatch for `newarraycode` and `fromNewArrayCode`: Renamed both to >> use "newarray code" >> 2. `fromDescriptor` can throw IOOBE if

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements [v5]

2024-05-10 Thread Claes Redestad
On Thu, 9 May 2024 21:15:31 GMT, Chen Liang wrote: >> A peek into TypeKind during the research for #19105 reveals that TypeKind >> has a few issues: >> 1. Name mismatch for `newarraycode` and `fromNewArrayCode`: Renamed both to >> use "newarray code" >> 2. `fromDescriptor` can throw IOOBE if

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements [v5]

2024-05-10 Thread Adam Sotona
On Thu, 9 May 2024 21:15:31 GMT, Chen Liang wrote: >> A peek into TypeKind during the research for #19105 reveals that TypeKind >> has a few issues: >> 1. Name mismatch for `newarraycode` and `fromNewArrayCode`: Renamed both to >> use "newarray code" >> 2. `fromDescriptor` can throw IOOBE if

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements [v5]

2024-05-09 Thread Chen Liang
On Thu, 9 May 2024 21:15:31 GMT, Chen Liang wrote: >> A peek into TypeKind during the research for #19105 reveals that TypeKind >> has a few issues: >> 1. Name mismatch for `newarraycode` and `fromNewArrayCode`: Renamed both to >> use "newarray code" >> 2. `fromDescriptor` can throw IOOBE if

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements [v5]

2024-05-09 Thread Chen Liang
> A peek into TypeKind during the research for #19105 reveals that TypeKind has > a few issues: > 1. Name mismatch for `newarraycode` and `fromNewArrayCode`: Renamed both to > use "newarray code" > 2. `fromDescriptor` can throw IOOBE if the input string is empty: changed to > throw IAE and

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements [v4]

2024-05-09 Thread Claes Redestad
On Thu, 9 May 2024 12:29:40 GMT, Adam Sotona wrote: >> I actually am not sure of the reason; it is indeed a tableswitch in >> bytecode. @cl4es might know it better? > > Generally I agree with the API changes and with the > `descriptor.isPrimitive()` test before requesting a descriptor string.

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements [v4]

2024-05-09 Thread Adam Sotona
On Thu, 9 May 2024 12:07:22 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/classfile/TypeKind.java line 139: >> >>> 137: case 'V' -> TypeKind.VoidType; >>> 138: default -> throw new IllegalArgumentException("Bad type: " >>> + s); >>> 139: }; >>

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements [v4]

2024-05-09 Thread Chen Liang
On Thu, 9 May 2024 07:23:16 GMT, Adam Sotona wrote: >> Chen Liang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Hash table, use fixed random seed > > src/java.base/share/classes/java/lang/classfile/TypeKind.java line 139: > >> 137:

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements [v4]

2024-05-09 Thread Adam Sotona
On Tue, 7 May 2024 15:23:10 GMT, Chen Liang wrote: >> A peek into TypeKind during the research for #19105 reveals that TypeKind >> has a few issues: >> 1. Name mismatch for `newarraycode` and `fromNewArrayCode`: Renamed both to >> use "newarray code" >> 2. `fromDescriptor` can throw IOOBE if

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements [v3]

2024-05-07 Thread Chen Liang
On Tue, 7 May 2024 10:46:41 GMT, Claes Redestad wrote: >> Chen Liang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add a mixed scenario > > Nice improvement to the micro. It might be preferable to use random > generation with a

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements [v4]

2024-05-07 Thread Chen Liang
> A peek into TypeKind during the research for #19105 reveals that TypeKind has > a few issues: > 1. Name mismatch for `newarraycode` and `fromNewArrayCode`: Renamed both to > use "newarray code" > 2. `fromDescriptor` can throw IOOBE if the input string is empty: changed to > throw IAE and

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements [v3]

2024-05-07 Thread Claes Redestad
On Tue, 7 May 2024 01:49:27 GMT, Chen Liang wrote: >> A peek into TypeKind during the research for #19105 reveals that TypeKind >> has a few issues: >> 1. Name mismatch for `newarraycode` and `fromNewArrayCode`: Renamed both to >> use "newarray code" >> 2. `fromDescriptor` can throw IOOBE if

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements

2024-05-06 Thread Chen Liang
On Mon, 6 May 2024 22:00:24 GMT, Claes Redestad wrote: >> A peek into TypeKind during the research for #19105 reveals that TypeKind >> has a few issues: >> 1. Name mismatch for `newarraycode` and `fromNewArrayCode`: Renamed both to >> use "newarray code" >> 2. `fromDescriptor` can throw IOOBE

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements [v3]

2024-05-06 Thread Chen Liang
> A peek into TypeKind during the research for #19105 reveals that TypeKind has > a few issues: > 1. Name mismatch for `newarraycode` and `fromNewArrayCode`: Renamed both to > use "newarray code" > 2. `fromDescriptor` can throw IOOBE if the input string is empty: changed to > throw IAE and

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements [v2]

2024-05-06 Thread Chen Liang
> A peek into TypeKind during the research for #19105 reveals that TypeKind has > a few issues: > 1. Name mismatch for `newarraycode` and `fromNewArrayCode`: Renamed both to > use "newarray code" > 2. `fromDescriptor` can throw IOOBE if the input string is empty: changed to > throw IAE and

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements

2024-05-06 Thread Claes Redestad
On Mon, 6 May 2024 20:48:05 GMT, Chen Liang wrote: > A peek into TypeKind during the research for #19105 reveals that TypeKind has > a few issues: > 1. Name mismatch for `newarraycode` and `fromNewArrayCode`: Renamed both to > use "newarray code" > 2. `fromDescriptor` can throw IOOBE if the

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements

2024-05-06 Thread Claes Redestad
On Mon, 6 May 2024 20:48:05 GMT, Chen Liang wrote: > A peek into TypeKind during the research for #19105 reveals that TypeKind has > a few issues: > 1. Name mismatch for `newarraycode` and `fromNewArrayCode`: Renamed both to > use "newarray code" > 2. `fromDescriptor` can throw IOOBE if the

RFR: 8331744: java.lang.classfile.TypeKind improvements

2024-05-06 Thread Chen Liang
A peek into TypeKind during the research for #19105 reveals that TypeKind has a few issues: 1. Name mismatch for `newarraycode` and `fromNewArrayCode`: Renamed both to use "newarray code" 2. `fromDescriptor` can throw IOOBE if the input string is empty: changed to throw IAE and added tests. 3.

Re: RFR: 8331744: java.lang.classfile.TypeKind improvements

2024-05-06 Thread Chen Liang
On Mon, 6 May 2024 20:48:05 GMT, Chen Liang wrote: > A peek into TypeKind during the research for #19105 reveals that TypeKind has > a few issues: > 1. Name mismatch for `newarraycode` and `fromNewArrayCode`: Renamed both to > use "newarray code" > 2. `fromDescriptor` can throw IOOBE if the