8203960: [TESTBUG] runtime/logging/DefaultMethodsTest.java failed when running in CDS mode
authorccheung
Thu, 31 May 2018 11:41:25 -0700
changeset 50331 2712cf4711d1
parent 50330 2cbc42a5764b
child 50332 d0d933d61610
8203960: [TESTBUG] runtime/logging/DefaultMethodsTest.java failed when running in CDS mode Summary: Added an interface with a default method. The InnerClass implements the interface. Reviewed-by: iklam, dholmes
test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java
--- a/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java	Thu May 31 10:38:05 2018 -0700
+++ b/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java	Thu May 31 11:41:25 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8139564
+ * @bug 8139564 8203960
  * @summary defaultmethods=debug should have logging from each of the statements in the code
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
@@ -50,7 +50,15 @@
         output.shouldHaveExitValue(0);
     }
 
-    public static class InnerClass {
+    interface TestInterface {
+        default void doSomething() {
+            System.out.println("Default TestInterface");
+        }
+    }
+
+    public static class InnerClass implements TestInterface {
+        // InnerClass implements TestInterface with a default method.
+        // Loading of InnerClass will trigger default method processing.
         public static void main(String[] args) throws Exception {
             System.out.println("Inner Class");
         }