< prev index next >

test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java

Print this page
*** 251,11 ***
      public void getInterfacesTest() {
          for (Class<?> c : classes) {
              ResolvedJavaType type = metaAccess.lookupJavaType(c);
              Class<?>[] expected = c.getInterfaces();
              ResolvedJavaType[] actual = type.getInterfaces();
!             assertEquals(expected.length, actual.length);
              for (int i = 0; i < expected.length; i++) {
                  assertTrue(actual[i].equals(metaAccess.lookupJavaType(expected[i])));
              }
          }
      }
--- 251,13 ---
      public void getInterfacesTest() {
          for (Class<?> c : classes) {
              ResolvedJavaType type = metaAccess.lookupJavaType(c);
              Class<?>[] expected = c.getInterfaces();
              ResolvedJavaType[] actual = type.getInterfaces();
!             // With injection of the IdentityObject interface by the JVM, the number of
+             // interfaces visible through reflection and through JVMCI could differ by one
+             assertTrue(expected.length == actual.length || (actual.length - expected.length) == 1);
              for (int i = 0; i < expected.length; i++) {
                  assertTrue(actual[i].equals(metaAccess.lookupJavaType(expected[i])));
              }
          }
      }
< prev index next >