changeset 50933:36192f15b20d condy-folding

manual merge with jep-334
author vromero
date Mon, 04 Jun 2018 15:26:16 -0700
parents 9b942e8bd2ca 5d1a269035b9
children 7f2baec494c9
files src/java.base/share/classes/java/lang/Class.java src/java.base/share/classes/java/lang/Double.java src/java.base/share/classes/java/lang/Enum.java src/java.base/share/classes/java/lang/Float.java src/java.base/share/classes/java/lang/Integer.java src/java.base/share/classes/java/lang/Long.java src/java.base/share/classes/java/lang/String.java src/java.base/share/classes/java/lang/constant/AsTypeMethodHandleDesc.java src/java.base/share/classes/java/lang/constant/ClassDesc.java src/java.base/share/classes/java/lang/constant/Constable.java src/java.base/share/classes/java/lang/constant/ConstantClassDesc.java src/java.base/share/classes/java/lang/constant/ConstantDesc.java src/java.base/share/classes/java/lang/constant/ConstantDescs.java src/java.base/share/classes/java/lang/constant/ConstantMethodHandleDesc.java src/java.base/share/classes/java/lang/constant/ConstantMethodTypeDesc.java src/java.base/share/classes/java/lang/constant/ConstantUtils.java src/java.base/share/classes/java/lang/constant/DynamicCallSiteDesc.java src/java.base/share/classes/java/lang/constant/DynamicConstantDesc.java src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java src/java.base/share/classes/java/lang/constant/MethodTypeDesc.java src/java.base/share/classes/java/lang/constant/PrimitiveClassDesc.java src/java.base/share/classes/java/lang/constant/package-info.java src/java.base/share/classes/java/lang/invoke/MethodHandle.java src/java.base/share/classes/java/lang/invoke/MethodType.java src/java.base/share/classes/java/lang/invoke/VarHandle.java src/java.base/share/classes/module-info.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java test/jdk/java/lang/constant/ClassRefTest.java test/jdk/java/lang/constant/CondyRefTest.java test/jdk/java/lang/constant/MethodHandleRefTest.java test/langtools/jdk/javadoc/doclet/testClassTree/TestClassTree.java test/langtools/jdk/jshell/TypeNameTest.java test/langtools/tools/javac/T8187978/FilterOutCandidatesForDiagnosticsTest.out test/langtools/tools/javac/generics/inference/EagerReturnTypeResolution/EagerReturnTypeResolutionTestb.out test/langtools/tools/javac/varargs/6806876/T6806876.out
diffstat 2 files changed, 15 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/test/jdk/java/lang/constant/CondyRefTest.java	Mon Jun 04 14:59:22 2018 -0700
+++ b/test/jdk/java/lang/constant/CondyRefTest.java	Mon Jun 04 15:26:16 2018 -0700
@@ -44,7 +44,9 @@
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertNotEquals;
+import static org.testng.Assert.assertNotSame;
 import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertSame;
 import static org.testng.Assert.assertTrue;
 
 /**
@@ -170,26 +172,26 @@
                                  ConstantDesc<T> canonical) {
         Class<?> clazz = prototype.getClass();
 
-        assertTrue(canonical != nonCanonical);
+        assertNotSame(canonical, nonCanonical);
         assertTrue(clazz.isAssignableFrom(canonical.getClass()));
         assertFalse(clazz.isAssignableFrom(nonCanonical.getClass()));
-        assertTrue(prototype.equals(canonical));
-        assertTrue(canonical.equals(prototype));
+        assertEquals(prototype, canonical);
+        assertEquals(canonical, prototype);
         if (prototype instanceof DynamicConstantDesc) {
-            assertTrue(canonical.equals(nonCanonical));
-            assertTrue(nonCanonical.equals(canonical));
-            assertTrue(prototype.equals(nonCanonical));
-            assertTrue(nonCanonical.equals(prototype));
+            assertEquals(canonical, nonCanonical);
+            assertEquals(nonCanonical, canonical);
+            assertEquals(prototype, nonCanonical);
+            assertEquals(nonCanonical, prototype);
         }
     }
 
     public void testLifting() {
         DynamicConstantDesc<Object> unliftedNull = DynamicConstantDesc.of(ConstantDescs.BSM_NULL_CONSTANT, "_", CR_Object, EMPTY_ARGS);
         assertEquals(ConstantDescs.NULL, unliftedNull);
-        assertTrue(ConstantDescs.NULL != unliftedNull);
-        assertTrue(ConstantDescs.NULL == DynamicConstantDesc.ofCanonical(ConstantDescs.BSM_NULL_CONSTANT, "_", CR_Object, EMPTY_ARGS));
-        assertTrue(ConstantDescs.NULL == DynamicConstantDesc.ofCanonical(ConstantDescs.BSM_NULL_CONSTANT, "_", CR_String, EMPTY_ARGS));
-        assertTrue(ConstantDescs.NULL == DynamicConstantDesc.ofCanonical(ConstantDescs.BSM_NULL_CONSTANT, "wahoo", CR_Object, EMPTY_ARGS));
+        assertNotSame(ConstantDescs.NULL, unliftedNull);
+        assertSame(ConstantDescs.NULL, DynamicConstantDesc.ofCanonical(ConstantDescs.BSM_NULL_CONSTANT, "_", CR_Object, EMPTY_ARGS));
+        assertSame(ConstantDescs.NULL, DynamicConstantDesc.ofCanonical(ConstantDescs.BSM_NULL_CONSTANT, "_", CR_String, EMPTY_ARGS));
+        assertSame(ConstantDescs.NULL, DynamicConstantDesc.ofCanonical(ConstantDescs.BSM_NULL_CONSTANT, "wahoo", CR_Object, EMPTY_ARGS));
 
         assertLifted(CR_int,
                      DynamicConstantDesc.of(ConstantDescs.BSM_PRIMITIVE_CLASS, "I", ConstantDescs.CR_Class, EMPTY_ARGS),
--- a/test/jdk/java/lang/constant/MethodHandleRefTest.java	Mon Jun 04 14:59:22 2018 -0700
+++ b/test/jdk/java/lang/constant/MethodHandleRefTest.java	Mon Jun 04 15:26:16 2018 -0700
@@ -53,6 +53,7 @@
 import static java.lang.constant.ConstantDescs.CR_int;
 import static java.lang.constant.ConstantDescs.CR_void;
 import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotSame;
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
@@ -178,7 +179,7 @@
         TestClass instance2 = (TestClass) ctorRef.resolveConstantDesc(TestClass.LOOKUP).invokeExact();
         TestInterface instanceI = instance;
 
-        assertTrue(instance != instance2);
+        assertNotSame(instance, instance2);
 
         assertEquals(5, (int) staticMethodRef.resolveConstantDesc(LOOKUP).invokeExact(5));
         assertEquals(5, (int) staticMethodRef.resolveConstantDesc(TestClass.LOOKUP).invokeExact(5));