< prev index next >

test/jdk/valhalla/valuetypes/MethodHandleTest.java

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

@@ -22,11 +22,11 @@
  */
 
 
 /*
  * @test
- * @summary test MethodHandle/VarHandle on value types
+ * @summary test MethodHandle/VarHandle on inline types 
  * @compile -XDallowWithFieldOperator Point.java Line.java MutablePath.java MixedValues.java
  * @run testng/othervm -XX:+EnableValhalla MethodHandleTest
  */
 
 import java.lang.invoke.*;

@@ -69,11 +69,11 @@
     }
 
     @Test
     public static void testValueFields() throws Throwable {
         MutablePath path = MutablePath.makePath(1, 2, 3, 4);
-        // p1 and p2 are a non-final field of value type in a reference
+        // p1 and p2 are a non-final field of inline type in a reference
         MethodHandleTest test1 = new MethodHandleTest("Point", path.p1, "x", "y");
         test1.run();
 
         MethodHandleTest test2 = new MethodHandleTest("Point", path.p2, "x", "y");
         test2.run();

@@ -120,15 +120,15 @@
         }
 
         // set an array element to null
         Class<?> elementType = c.getComponentType();
         try {
-            // value array element is flattenable
+            // inline array element is flattenable
             Object v = (Object)setter.invoke(array, 0, null);
-            assertFalse(elementType.isValue(), "should fail to set a value array element to null");
+            assertFalse(elementType.isValue(), "should fail to set an inline class array element to null");
         } catch (NullPointerException e) {
-            assertTrue(elementType.isValue(), "should only fail to set a value array element to null");
+            assertTrue(elementType.isValue(), "should only fail to set an inline class array element to null");
         }
     }
 
     private final Class<?> c;
     private final Object o;

@@ -170,11 +170,11 @@
         MethodHandle mh = MethodHandles.lookup().unreflectGetter(f);
         Object value = mh.invoke(o);
     }
 
     /*
-     * Test setting value field to a new value.
+     * Test setting a field of an inline type to a new value.
      * The field must be flattenable but may or may not be flattened.
      */
     void setValueField(String name, Object obj, Object value) throws Throwable {
         Field f = c.getDeclaredField(name);
         boolean isStatic = Modifier.isStatic(f.getModifiers());
< prev index next >