changeset 50930:0f629ccfee9a jep-334

several stylistic changes
author vromero
date Mon, 04 Jun 2018 13:04:48 -0700
parents 05169a7b9350
children 5d1a269035b9
files test/jdk/java/lang/invoke/constant/CondyRefTest.java test/jdk/java/lang/invoke/constant/MethodHandleRefTest.java
diffstat 2 files changed, 15 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/test/jdk/java/lang/invoke/constant/CondyRefTest.java	Sat Jun 02 19:34:57 2018 -0700
+++ b/test/jdk/java/lang/invoke/constant/CondyRefTest.java	Mon Jun 04 13:04:48 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/invoke/constant/MethodHandleRefTest.java	Sat Jun 02 19:34:57 2018 -0700
+++ b/test/jdk/java/lang/invoke/constant/MethodHandleRefTest.java	Mon Jun 04 13:04:48 2018 -0700
@@ -53,6 +53,7 @@
 import static java.lang.invoke.constant.ConstantDescs.CR_int;
 import static java.lang.invoke.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));