RFR: 8287064: Modernize ProxyGenerator.PrimitiveTypeInfo [v2]

liach duke at openjdk.java.net
Fri May 20 22:18:42 UTC 2022


On Fri, 20 May 2022 20:02:28 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> liach has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Convert PrimitiveTypeInfo to an enum
>
> src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 932:
> 
>> 930:      */
>> 931:     private static final class PrimitiveTypeInfo {
>> 932:         private static final PrimitiveTypeInfo BYTE = new PrimitiveTypeInfo(byte.class, 0);
> 
> Can this be `private enum PrimitiveTypeInfo...` or perhaps a record class?

Thanks. I've converted it into an enum following the suit of `sun.invoke.util.Wrapper`. I think an enum fits better here as we don't need the canonical constructor and object methods of a record.

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

PR: https://git.openjdk.java.net/jdk/pull/8801


More information about the core-libs-dev mailing list