On Wed, 1 Mar 2023 23:07:38 GMT, Paul Sandoz <psan...@openjdk.org> wrote:

>> Adam Sotona has updated the pull request incrementally with four additional 
>> commits since the last revision:
>> 
>>  - renamed all remaining ConcreteXyzEntry to XyzEntryImpl
>>  - abstract implementations of RefEntry, RefsEntry and NamedEntry renamed to 
>> AbstractRefEntry, AbstractRefsEntry and AbstractNamedEntry
>>  - renamed ConcreteBootstrapMethodEntry to BootstrapMethodEntryImpl
>>  - ConcreteEntry renamed to AbstractPoolEntry
>
> src/java.base/share/classes/jdk/internal/classfile/ClassReader.java line 144:
> 
>> 142:      *         constant pool size, or zero
>> 143:      * @throws ClassCastException if the index does not correspond to
>> 144:      *         a module entry
> 
> Throwing `ClassCastException` is certainly convenient from an implementation 
> perspective, but I think it is better to throw `IllegalArgumentException`.

Fixed in all `ClassReader::readXyzEntry` methods, thanks.

> src/java.base/share/classes/jdk/internal/classfile/impl/ClassReaderImpl.java 
> line 90:
> 
>> 88:     private BootstrapMethodsAttribute bootstrapMethodsAttribute;
>> 89: 
>> 90:     @SuppressWarnings("unchecked")
> 
> Is this needed?

not needed, removed, thanks

> src/java.base/share/classes/jdk/internal/classfile/impl/ClassReaderImpl.java 
> line 115:
> 
>> 113: 
>> 114:                 // 4
>> 115:                 case TAG_CONSTANTDYNAMIC, TAG_FIELDREF, TAG_FLOAT, 
>> TAG_INTEGER, TAG_INTERFACEMETHODREF, TAG_INVOKEDYNAMIC, TAG_METHODREF, 
>> TAG_NAMEANDTYPE -> p += 4;
> 
> Break the line

fixed, thanks.

> src/java.base/share/classes/jdk/internal/classfile/impl/ClassReaderImpl.java 
> line 132:
> 
>> 130:         this.cp = new PoolEntry[constantPoolCount];
>> 131: 
>> 132:         p = metadataStart;
> 
> Redundant assignment (see line 127).

fixed, thanks.

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

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

Reply via email to