On 10/15/19 2:26 AM, Alan Bateman wrote:
On 14/10/2019 23:34, Mandy Chung wrote:
MethodHandles::lookup produces a Lookup object on the caller class. The original intention for a Lookup object whose lookup class is always a non-array and non-primitive class.

MethodHandles::privateLookupIn and Lookup::in are the two other ways that can produce a new Lookup object and they should disallow the new lookup class be a primitive or array class.

This patch proposes to make Lookup::in consistent with MethodHandles::privateLookupIn to throw IAE if the target class is an array type or primitive type.


CSR: https://bugs.openjdk.java.net/browse/JDK-8232227
webrev:
http://cr.openjdk.java.net/~mchung/jdk14/8173975/webrev.00/
This change looks good and I've added myself as Reviewer to the CSR.

I updated the spec and CSR to explicitly call out void in @throw IAE behavior per Joe's suggestion (although Class::isPrimitive treats void as a primitive, that's not a natural categorization).

Revised webrev:
  http://cr.openjdk.java.net/~mchung/jdk14/8173975/webrev.01

Mandy

Reply via email to