From e8aba519f7201701555f77e3ea6f8c1846635645 Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Thu, 31 May 2018 11:41:25 -0700 Subject: [PATCH] 8203960: [TESTBUG] runtime/logging/DefaultMethodsTest.java failed when running in CDS mode Added an interface with a default method. The InnerClass implements the interface. Reviewed-by: iklam, dholmes --- .../jtreg/runtime/logging/DefaultMethodsTest.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java b/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java index 757d3478b35..1f5ed9b5f6e 100644 --- a/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java +++ b/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java @@ -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 @@ public class DefaultMethodsTest { 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"); }