changeset 50427:f2344d7e7bbc condy-folding

fixing failure at test CondyRefTest
author vromero
date Sun, 29 Apr 2018 18:04:09 -0700
parents 1b996bb06569
children 8c9aa7e18db9
files src/java.base/share/classes/java/lang/invoke/constant/DynamicConstantDesc.java test/jdk/java/lang/invoke/constant/CondyRefTest.java
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/invoke/constant/DynamicConstantDesc.java	Fri Apr 27 12:52:35 2018 -0700
+++ b/src/java.base/share/classes/java/lang/invoke/constant/DynamicConstantDesc.java	Sun Apr 29 18:04:09 2018 -0700
@@ -442,7 +442,6 @@
 
     private static ConstantDesc<?> canonicalizeEnum(DynamicConstantDesc<?> desc) {
         if (desc.bootstrapArgs.length != 0
-            || !desc.constantType().equals(CR_Enum)
             || desc.constantName == null)
             return desc;
         return EnumDesc.of(desc.constantType, desc.constantName);
--- a/test/jdk/java/lang/invoke/constant/CondyRefTest.java	Fri Apr 27 12:52:35 2018 -0700
+++ b/test/jdk/java/lang/invoke/constant/CondyRefTest.java	Sun Apr 29 18:04:09 2018 -0700
@@ -49,6 +49,7 @@
 
 /**
  * @test
+ * @compile -XDfolding=false CondyRefTest.java
  * @run testng CondyRefTest
  * @summary unit tests for java.lang.invoke.constant.CondyRefTest
  */
@@ -170,6 +171,8 @@
         Class<?> clazz = prototype.getClass();
 
         assertTrue(canonical != nonCanonical);
+        System.out.println("clazz " + clazz);
+        System.out.println("canonical.getClass() " + canonical.getClass());
         assertTrue(clazz.isAssignableFrom(canonical.getClass()));
         assertFalse(clazz.isAssignableFrom(nonCanonical.getClass()));
         assertTrue(prototype.equals(canonical));