11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 8031195
27 * @bug 8071657
28 * @bug 8165827
29 * @summary JDI: Add support for static, private and default methods in interfaces
30 *
31 * @modules jdk.jdi
32 * @run build TestScaffold VMConnection TargetListener TargetAdapter
33 * @run build InterfaceMethodsTest
34 * @run driver InterfaceMethodsTest
35 */
36 import com.sun.jdi.*;
37 import com.sun.jdi.event.*;
38 import java.util.Collections;
39 import java.util.Iterator;
40 import java.util.List;
41
42 public class InterfaceMethodsTest extends TestScaffold {
43 private static final int RESULT_A = 1;
44 private static final int RESULT_B = 2;
45 private static final int RESULT_TARGET = 3;
46
47 static interface InterfaceA {
48 static int staticMethodA() {
49 System.out.println("-InterfaceA: static interface method A-");
50 return RESULT_A;
51 }
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 8031195
27 * @bug 8071657
28 * @bug 8165827
29 * @summary JDI: Add support for static, private and default methods in interfaces
30 *
31 * @run build TestScaffold VMConnection TargetListener TargetAdapter
32 * @run build InterfaceMethodsTest
33 * @run driver InterfaceMethodsTest
34 */
35 import com.sun.jdi.*;
36 import com.sun.jdi.event.*;
37 import java.util.Collections;
38 import java.util.Iterator;
39 import java.util.List;
40
41 public class InterfaceMethodsTest extends TestScaffold {
42 private static final int RESULT_A = 1;
43 private static final int RESULT_B = 2;
44 private static final int RESULT_TARGET = 3;
45
46 static interface InterfaceA {
47 static int staticMethodA() {
48 System.out.println("-InterfaceA: static interface method A-");
49 return RESULT_A;
50 }
|