RFR JDK-8181425: Reflection API defend against issues with internal VM derived value type

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue Jun 20 23:19:27 UTC 2017


The new version looks good - I wonder if we should add a dual method 
called isValueCapable(Class<?>) and use that for the assertion check? 
The method would look at the class, retrieve the @VCC annotation and 
return true if one such annotation exists.

As things stand, it is possible to pass classes to the 
loadValueClassType that are not VCC but which fail to trigger the 
assertion check.

Probably a nitpick - but since we're tweaking in this area...

Cheers
Maurizio


On 20/06/17 23:20, Mandy Chung wrote:
> All MVT tests passed.
>
> Mandy
>
>> On Jun 20, 2017, at 3:01 PM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
>>
>> That explains why i could not see what Maurizio was observing :-)
>>
>> Looks good.
>>
>> Paul.
>>
>>> On 20 Jun 2017, at 14:50, Mandy Chung <mandy.chung at oracle.com> wrote:
>>>
>>>
>>>> On Jun 20, 2017, at 1:48 PM, Maurizio Cimadamore <maurizio.cimadamore at oracle.com> wrote:
>>>>
>>>> Hi Mandy - overall looks very good. One question - is this code correct?
>>>>
>>>> public static Class<?> loadValueTypeClass(Class<?> vcc, String className) {
>>>> 113         if (!isValueType(vcc)) {
>>>> 114             throw new IllegalArgumentException(vcc.getName() + " is a derived value class");
>>>> 115         }
>>>> 116         return JLA.loadValueTypeClass(vcc.getModule(), vcc.getClassLoader(), className);
>>>> 117     }
>>>>
>>> My bad! I added this last minute check that are in the progress of testing.
>>> It intends to do the same check as getValueTypeClass.
>>>
>>> if (isValueType(vcc)) {
>>>    throw new IllegalArgumentException(vcc.getName() + " is a derived value class");
>>> }
>>>
>>> I updated webrev.00 in place.
>>>
>>> Mandy



More information about the valhalla-dev mailing list