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

Mandy Chung mandy.chung at oracle.com
Tue Jun 20 21:50:34 UTC 2017


> 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