RFR: 8287064: Modernize ProxyGenerator.PrimitiveTypeInfo [v4]

Mandy Chung mchung at openjdk.java.net
Fri May 27 00:01:42 UTC 2022


On Thu, 26 May 2022 23:42:27 GMT, liach <duke at openjdk.java.net> wrote:

>> Simplify opcode handling, use `final` in `PrimitiveTypeInfo`, and replace the hash map with a simple lookup, similar to what's done in [JDK-8284880](https://bugs.openjdk.java.net/browse/JDK-8284880) (#8242)
>
> liach has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Make primitive type info more reader friendly

src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 979:

> 977:             unwrapMethodDesc = "()" + baseTypeString;
> 978:             this.loadOpcode = loadOpcode;
> 979:             this.returnOpcode = loadOpcode - ILOAD + IRETURN;

This could do it.  It would be more explicit to take the return opcode as an argument to the constructor.

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

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


More information about the core-libs-dev mailing list