On Fri, 8 Sep 2023 10:15:26 GMT, Adam Sotona <asot...@openjdk.org> wrote:

>> javap uses proprietary com.sun.tools.classfile library to parse class files.
>> 
>> This patch converts javap to use Classfile API.
>> 
>> Please review.
>> 
>> Thanks,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   applied suggested changes from review

src/java.base/share/classes/jdk/internal/classfile/ClassReader.java line 184:

> 182:      */
> 183:     ConstantValueEntry readConstantValueEntry(int offset);
> 184: 

I'm not sure that all this additional API surface carries its weight in 
ClassReader, when each of these methods just called readEntry() and casts to 
the desired type?  I can see two alternate ways here:

 - Ordinary casts at the use site (worse error handling, but ultimately the 
same result), or
 -  A single method 

<T extends ConstantPoolEntry> T readEntry(int pos, Class<T> t)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/11411#discussion_r1326241987

Reply via email to