< prev index next >

test/jdk/java/lang/invoke/defineHiddenClass/BasicTest.java

Print this page
@@ -112,12 +112,12 @@
          // sanity check
          Class<?> c = t.getClass();
          Class<?>[] intfs = c.getInterfaces();
          assertTrue(c.isHidden());
          assertFalse(c.isPrimitive());
-         assertTrue(intfs.length == 1);
-         assertTrue(intfs[0] == HiddenTest.class);
+         assertTrue(intfs.length == 1 || intfs.length == 2);
+         assertTrue(intfs[0] == HiddenTest.class || (intfs.length == 2 && intfs[1] == HiddenTest.class));
          assertTrue(c.getCanonicalName() == null);
  
          String hcName = "HiddenClass";
          String hcSuffix = "0x[0-9a-f]+";
          assertTrue(c.getName().matches(hcName + "/" + hcSuffix));

@@ -345,12 +345,12 @@
          HiddenTest t = (HiddenTest)defineHiddenClass("HiddenCantReflect").newInstance();
          t.test();
  
          Class<?> c = t.getClass();
          Class<?>[] intfs = c.getInterfaces();
-         assertTrue(intfs.length == 1);
-         assertTrue(intfs[0] == HiddenTest.class);
+         assertTrue(intfs.length == 1 || intfs.length == 2);
+         assertTrue(intfs[0] == HiddenTest.class || (intfs.length == 2 && intfs[1] == HiddenTest.class));
  
          try {
              // this would cause loading of class HiddenCantReflect and NCDFE due
              // to error during verification
              c.getDeclaredMethods();
< prev index next >