< prev index next >

test/jdk/valhalla/valuetypes/Reflection.java

Print this page
rev 55117 : 8223350: [lworld] Use inline classes instead of value classes

*** 22,32 **** */ /* * @test ! * @summary test reflection on value types * @compile -XDallowWithFieldOperator Point.java Line.java NonFlattenValue.java * @run main/othervm -XX:+EnableValhalla Reflection */ import java.lang.reflect.*; --- 22,32 ---- */ /* * @test ! * @summary test reflection on inline types * @compile -XDallowWithFieldOperator Point.java Line.java NonFlattenValue.java * @run main/othervm -XX:+EnableValhalla Reflection */ import java.lang.reflect.*;
*** 73,83 **** private final Constructor<?> ctor; private final Object o; Reflection(Class<?> type, String cn, Object o) throws Exception { this.c = Class.forName(cn); if (!c.isValue() || c != type) { ! throw new RuntimeException(cn + " is not a value class"); } // the box type is the primary mirror assertEquals(type, o.getClass()); assertEquals(type, c.asBoxType()); --- 73,83 ---- private final Constructor<?> ctor; private final Object o; Reflection(Class<?> type, String cn, Object o) throws Exception { this.c = Class.forName(cn); if (!c.isValue() || c != type) { ! throw new RuntimeException(cn + " is not an inline class"); } // the box type is the primary mirror assertEquals(type, o.getClass()); assertEquals(type, c.asBoxType());
*** 131,141 **** } void newInstance() throws Exception { try { Object o = c.newInstance(); ! throw new RuntimeException("newInstance expected to be unsupported on value class"); } catch (IllegalAccessException e) {} } void constructor() throws Exception { try { --- 131,141 ---- } void newInstance() throws Exception { try { Object o = c.newInstance(); ! throw new RuntimeException("newInstance expected to be unsupported on inline class"); } catch (IllegalAccessException e) {} } void constructor() throws Exception { try {
< prev index next >