mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
Merge
This commit is contained in:
commit
dd9a6fc8eb
17 changed files with 311 additions and 88 deletions
|
@ -38,6 +38,8 @@
|
|||
#import <dlfcn.h>
|
||||
#import <limits.h>
|
||||
#import <errno.h>
|
||||
#import <sys/types.h>
|
||||
#import <sys/ptrace.h>
|
||||
|
||||
jboolean debug = JNI_FALSE;
|
||||
|
||||
|
@ -430,6 +432,73 @@ Java_sun_jvm_hotspot_debugger_macosx_MacOSXDebuggerLocal_translateTID0(
|
|||
return (jint) usable_tid;
|
||||
}
|
||||
|
||||
|
||||
static bool ptrace_continue(pid_t pid, int signal) {
|
||||
// pass the signal to the process so we don't swallow it
|
||||
int res;
|
||||
if ((res = ptrace(PT_CONTINUE, pid, (caddr_t)1, signal)) < 0) {
|
||||
fprintf(stderr, "attach: ptrace(PT_CONTINUE, %d) failed with %d\n", pid, res);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// waits until the ATTACH has stopped the process
|
||||
// by signal SIGSTOP
|
||||
static bool ptrace_waitpid(pid_t pid) {
|
||||
int ret;
|
||||
int status;
|
||||
while (true) {
|
||||
// Wait for debuggee to stop.
|
||||
ret = waitpid(pid, &status, 0);
|
||||
if (ret >= 0) {
|
||||
if (WIFSTOPPED(status)) {
|
||||
// Any signal will stop the thread, make sure it is SIGSTOP. Otherwise SIGSTOP
|
||||
// will still be pending and delivered when the process is DETACHED and the process
|
||||
// will go to sleep.
|
||||
if (WSTOPSIG(status) == SIGSTOP) {
|
||||
// Debuggee stopped by SIGSTOP.
|
||||
return true;
|
||||
}
|
||||
if (!ptrace_continue(pid, WSTOPSIG(status))) {
|
||||
fprintf(stderr, "attach: Failed to correctly attach to VM. VM might HANG! [PTRACE_CONT failed, stopped by %d]\n", WSTOPSIG(status));
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "attach: waitpid(): Child process exited/terminated (status = 0x%x)\n", status);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
switch (errno) {
|
||||
case EINTR:
|
||||
continue;
|
||||
break;
|
||||
case ECHILD:
|
||||
fprintf(stderr, "attach: waitpid() failed. Child process pid (%d) does not exist \n", pid);
|
||||
break;
|
||||
case EINVAL:
|
||||
fprintf(stderr, "attach: waitpid() failed. Invalid options argument.\n");
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "attach: waitpid() failed. Unexpected error %d\n",errno);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// attach to a process/thread specified by "pid"
|
||||
static bool ptrace_attach(pid_t pid) {
|
||||
int res;
|
||||
if ((res = ptrace(PT_ATTACH, pid, 0, 0)) < 0) {
|
||||
fprintf(stderr, "ptrace(PT_ATTACH, %d) failed with %d\n", pid, res);
|
||||
return false;
|
||||
} else {
|
||||
return ptrace_waitpid(pid);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal
|
||||
* Method: attach0
|
||||
|
@ -446,6 +515,7 @@ JNF_COCOA_ENTER(env);
|
|||
debug = JNI_FALSE;
|
||||
if (debug) printf("attach0 called for jpid=%d\n", (int)jpid);
|
||||
|
||||
// get the task from the pid
|
||||
kern_return_t result;
|
||||
task_t gTask = 0;
|
||||
result = task_for_pid(mach_task_self(), jpid, &gTask);
|
||||
|
@ -455,6 +525,13 @@ JNF_COCOA_ENTER(env);
|
|||
}
|
||||
putTask(env, this_obj, gTask);
|
||||
|
||||
// use ptrace to stop the process
|
||||
// on os x, ptrace only needs to be called on the process, not the individual threads
|
||||
if (ptrace_attach(jpid) != true) {
|
||||
mach_port_deallocate(mach_task_self(), gTask);
|
||||
THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the process");
|
||||
}
|
||||
|
||||
id symbolicator = nil;
|
||||
id jrsSymbolicator = objc_lookUpClass("JRSSymbolicator");
|
||||
if (jrsSymbolicator != nil) {
|
||||
|
@ -486,6 +563,21 @@ JNF_COCOA_ENTER(env);
|
|||
if (debug) printf("detach0 called\n");
|
||||
|
||||
task_t gTask = getTask(env, this_obj);
|
||||
|
||||
// detach from the ptraced process causing it to resume execution
|
||||
int pid;
|
||||
kern_return_t k_res;
|
||||
k_res = pid_for_task(gTask, &pid);
|
||||
if (k_res != KERN_SUCCESS) {
|
||||
fprintf(stderr, "detach: pid_for_task(%d) failed (%d)\n", pid, k_res);
|
||||
}
|
||||
else {
|
||||
int res = ptrace(PT_DETACH, pid, 0, 0);
|
||||
if (res < 0) {
|
||||
fprintf(stderr, "detach: ptrace(PT_DETACH, %d) failed (%d)\n", pid, res);
|
||||
}
|
||||
}
|
||||
|
||||
mach_port_deallocate(mach_task_self(), gTask);
|
||||
id symbolicator = getSymbolicator(env, this_obj);
|
||||
if (symbolicator != nil) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, 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
|
||||
|
@ -91,6 +91,14 @@ void print_debug(const char* format,...) {
|
|||
}
|
||||
}
|
||||
|
||||
void print_error(const char* format,...) {
|
||||
va_list alist;
|
||||
va_start(alist, format);
|
||||
fputs("ERROR: ", stderr);
|
||||
vfprintf(stderr, format, alist);
|
||||
va_end(alist);
|
||||
}
|
||||
|
||||
bool is_debug() {
|
||||
return _libsaproc_debug;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, 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
|
||||
|
@ -107,6 +107,7 @@ struct ps_prochandle {
|
|||
int pathmap_open(const char* name);
|
||||
|
||||
void print_debug(const char* format,...);
|
||||
void print_error(const char* format,...);
|
||||
bool is_debug();
|
||||
|
||||
typedef bool (*thread_info_callback)(struct ps_prochandle* ph, pthread_t pid, lwpid_t lwpid);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, 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
|
||||
|
@ -129,12 +129,18 @@ static bool process_get_lwp_info(struct ps_prochandle *ph, lwpid_t lwp_id, void
|
|||
return (errno == 0)? true: false;
|
||||
}
|
||||
|
||||
// attach to a process/thread specified by "pid"
|
||||
static bool ptrace_attach(pid_t pid) {
|
||||
if (ptrace(PT_ATTACH, pid, NULL, 0) < 0) {
|
||||
print_debug("ptrace(PTRACE_ATTACH, ..) failed for %d\n", pid);
|
||||
static bool ptrace_continue(pid_t pid, int signal) {
|
||||
// pass the signal to the process so we don't swallow it
|
||||
if (ptrace(PTRACE_CONT, pid, NULL, signal) < 0) {
|
||||
print_debug("ptrace(PTRACE_CONT, ..) failed for %d\n", pid);
|
||||
return false;
|
||||
} else {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// waits until the ATTACH has stopped the process
|
||||
// by signal SIGSTOP
|
||||
static bool ptrace_waitpid(pid_t pid) {
|
||||
int ret;
|
||||
int status;
|
||||
do {
|
||||
|
@ -142,8 +148,17 @@ static bool ptrace_attach(pid_t pid) {
|
|||
ret = waitpid(pid, &status, 0);
|
||||
if (ret >= 0) {
|
||||
if (WIFSTOPPED(status)) {
|
||||
// Debuggee stopped.
|
||||
// Any signal will stop the thread, make sure it is SIGSTOP. Otherwise SIGSTOP
|
||||
// will still be pending and delivered when the process is DETACHED and the process
|
||||
// will go to sleep.
|
||||
if (WSTOPSIG(status) == SIGSTOP) {
|
||||
// Debuggee stopped by SIGSTOP.
|
||||
return true;
|
||||
}
|
||||
if (!ptrace_continue(pid, WSTOPSIG(status))) {
|
||||
print_error("Failed to correctly attach to VM. VM might HANG! [PTRACE_CONT failed, stopped by %d]\n", WSTOPSIG(status));
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
print_debug("waitpid(): Child process exited/terminated (status = 0x%x)\n", status);
|
||||
return false;
|
||||
|
@ -165,6 +180,15 @@ static bool ptrace_attach(pid_t pid) {
|
|||
return false;
|
||||
}
|
||||
} while(true);
|
||||
}
|
||||
|
||||
// attach to a process/thread specified by "pid"
|
||||
static bool ptrace_attach(pid_t pid) {
|
||||
if (ptrace(PT_ATTACH, pid, NULL, 0) < 0) {
|
||||
print_debug("ptrace(PTRACE_ATTACH, ..) failed for %d\n", pid);
|
||||
return false;
|
||||
} else {
|
||||
return ptrace_waitpid(pid);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, 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
|
||||
|
@ -92,6 +92,14 @@ void print_debug(const char* format,...) {
|
|||
}
|
||||
}
|
||||
|
||||
void print_error(const char* format,...) {
|
||||
va_list alist;
|
||||
va_start(alist, format);
|
||||
fputs("ERROR: ", stderr);
|
||||
vfprintf(stderr, format, alist);
|
||||
va_end(alist);
|
||||
}
|
||||
|
||||
bool is_debug() {
|
||||
return _libsaproc_debug;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, 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
|
||||
|
@ -105,6 +105,7 @@ struct ps_prochandle {
|
|||
int pathmap_open(const char* name);
|
||||
|
||||
void print_debug(const char* format,...);
|
||||
void print_error(const char* format,...);
|
||||
bool is_debug();
|
||||
|
||||
typedef bool (*thread_info_callback)(struct ps_prochandle* ph, pthread_t pid, lwpid_t lwpid);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, 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
|
||||
|
@ -25,6 +25,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <sys/ptrace.h>
|
||||
#include "libproc_impl.h"
|
||||
|
@ -142,15 +143,21 @@ static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct use
|
|||
|
||||
}
|
||||
|
||||
// attach to a process/thread specified by "pid"
|
||||
static bool ptrace_attach(pid_t pid) {
|
||||
if (ptrace(PTRACE_ATTACH, pid, NULL, NULL) < 0) {
|
||||
print_debug("ptrace(PTRACE_ATTACH, ..) failed for %d\n", pid);
|
||||
static bool ptrace_continue(pid_t pid, int signal) {
|
||||
// pass the signal to the process so we don't swallow it
|
||||
if (ptrace(PTRACE_CONT, pid, NULL, signal) < 0) {
|
||||
print_debug("ptrace(PTRACE_CONT, ..) failed for %d\n", pid);
|
||||
return false;
|
||||
} else {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// waits until the ATTACH has stopped the process
|
||||
// by signal SIGSTOP
|
||||
static bool ptrace_waitpid(pid_t pid) {
|
||||
int ret;
|
||||
int status;
|
||||
do {
|
||||
while (true) {
|
||||
// Wait for debuggee to stop.
|
||||
ret = waitpid(pid, &status, 0);
|
||||
if (ret == -1 && errno == ECHILD) {
|
||||
|
@ -159,8 +166,17 @@ static bool ptrace_attach(pid_t pid) {
|
|||
}
|
||||
if (ret >= 0) {
|
||||
if (WIFSTOPPED(status)) {
|
||||
// Debuggee stopped.
|
||||
// Any signal will stop the thread, make sure it is SIGSTOP. Otherwise SIGSTOP
|
||||
// will still be pending and delivered when the process is DETACHED and the process
|
||||
// will go to sleep.
|
||||
if (WSTOPSIG(status) == SIGSTOP) {
|
||||
// Debuggee stopped by SIGSTOP.
|
||||
return true;
|
||||
}
|
||||
if (!ptrace_continue(pid, WSTOPSIG(status))) {
|
||||
print_error("Failed to correctly attach to VM. VM might HANG! [PTRACE_CONT failed, stopped by %d]\n", WSTOPSIG(status));
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
print_debug("waitpid(): Child process exited/terminated (status = 0x%x)\n", status);
|
||||
return false;
|
||||
|
@ -178,10 +194,20 @@ static bool ptrace_attach(pid_t pid) {
|
|||
break;
|
||||
default:
|
||||
print_debug("waitpid() failed. Unexpected error %d\n",errno);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} while(true);
|
||||
}
|
||||
}
|
||||
|
||||
// attach to a process/thread specified by "pid"
|
||||
static bool ptrace_attach(pid_t pid) {
|
||||
if (ptrace(PTRACE_ATTACH, pid, NULL, NULL) < 0) {
|
||||
print_debug("ptrace(PTRACE_ATTACH, ..) failed for %d\n", pid);
|
||||
return false;
|
||||
} else {
|
||||
return ptrace_waitpid(pid);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,14 +61,12 @@ public class CMSCollector extends VMObject {
|
|||
CMSBitMap markBitMap = markBitMap();
|
||||
long addressSize = VM.getVM().getAddressSize();
|
||||
if ( markBitMap.isMarked(addr) && markBitMap.isMarked(addr.addOffsetTo(1*addressSize)) ) {
|
||||
System.err.println("Printezis bits are set...");
|
||||
Address nextOneAddr = markBitMap.getNextMarkedWordAddress(addr.addOffsetTo(2*addressSize));
|
||||
//return size in bytes
|
||||
long size = (nextOneAddr.addOffsetTo(1*addressSize)).minus(addr);
|
||||
return size;
|
||||
} else {
|
||||
//missing Printezis marks
|
||||
System.err.println("Missing Printszis marks...");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -191,7 +191,6 @@ public class CompactibleFreeListSpace extends CompactibleSpace {
|
|||
//Find the object size using Printezis bits and skip over
|
||||
long size = collector().blockSizeUsingPrintezisBits(cur);
|
||||
if (size == -1) {
|
||||
System.err.println("Printezis bits not set...");
|
||||
break;
|
||||
}
|
||||
cur = cur.addOffsetTo(adjustObjectSizeInBytes(size));
|
||||
|
|
|
@ -184,7 +184,6 @@ public class MethodData extends Metadata {
|
|||
if (trapReasonName[index] == null) {
|
||||
throw new InternalError("missing reason for " + index);
|
||||
}
|
||||
System.out.println(trapReasonName[index]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -335,7 +335,6 @@ public class ObjectHeap {
|
|||
}
|
||||
if (obj == null) {
|
||||
//Find the object size using Printezis bits and skip over
|
||||
System.err.println("Finding object size using Printezis bits and skipping over...");
|
||||
long size = 0;
|
||||
|
||||
if ( (cmsSpaceOld != null) && cmsSpaceOld.contains(handle) ){
|
||||
|
|
|
@ -94,7 +94,12 @@ CXXFLAGS = \
|
|||
# This is VERY important! The version define must only be supplied to vm_version.o
|
||||
# If not, ccache will not re-use the cache at all, since the version string might contain
|
||||
# a time and date.
|
||||
vm_version.o: CXXFLAGS += ${JRE_VERSION}
|
||||
CXXFLAGS/vm_version.o += ${JRE_VERSION}
|
||||
|
||||
CXXFLAGS/BYFILE = $(CXXFLAGS/$@)
|
||||
|
||||
# File specific flags
|
||||
CXXFLAGS += $(CXXFLAGS/BYFILE)
|
||||
|
||||
ifdef DEFAULT_LIBPATH
|
||||
CXXFLAGS += -DDEFAULT_LIBPATH="\"$(DEFAULT_LIBPATH)\""
|
||||
|
|
|
@ -100,7 +100,13 @@ CXXFLAGS = \
|
|||
# This is VERY important! The version define must only be supplied to vm_version.o
|
||||
# If not, ccache will not re-use the cache at all, since the version string might contain
|
||||
# a time and date.
|
||||
vm_version.o: CXXFLAGS += ${JRE_VERSION}
|
||||
CXXFLAGS/vm_version.o += ${JRE_VERSION}
|
||||
|
||||
CXXFLAGS/BYFILE = $(CXXFLAGS/$@)
|
||||
|
||||
# File specific flags
|
||||
CXXFLAGS += $(CXXFLAGS/BYFILE)
|
||||
|
||||
|
||||
ifndef JAVASE_EMBEDDED
|
||||
ifneq (${ARCH},arm)
|
||||
|
|
|
@ -88,7 +88,13 @@ CXXFLAGS = \
|
|||
# This is VERY important! The version define must only be supplied to vm_version.o
|
||||
# If not, ccache will not re-use the cache at all, since the version string might contain
|
||||
# a time and date.
|
||||
vm_version.o: CXXFLAGS += ${JRE_VERSION}
|
||||
CXXFLAGS/vm_version.o += ${JRE_VERSION}
|
||||
|
||||
CXXFLAGS/BYFILE = $(CXXFLAGS/$@)
|
||||
|
||||
# File specific flags
|
||||
CXXFLAGS += $(CXXFLAGS/BYFILE)
|
||||
|
||||
|
||||
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
|
||||
CFLAGS += $(CFLAGS_WARN)
|
||||
|
|
|
@ -1940,7 +1940,7 @@ int os::sigexitnum_pd(){
|
|||
|
||||
// a counter for each possible signal value, including signal_thread exit signal
|
||||
static volatile jint pending_signals[NSIG+1] = { 0 };
|
||||
static HANDLE sig_sem;
|
||||
static HANDLE sig_sem = NULL;
|
||||
|
||||
void os::signal_init_pd() {
|
||||
// Initialize signal structures
|
||||
|
@ -1970,10 +1970,11 @@ void os::signal_init_pd() {
|
|||
|
||||
void os::signal_notify(int signal_number) {
|
||||
BOOL ret;
|
||||
|
||||
if (sig_sem != NULL) {
|
||||
Atomic::inc(&pending_signals[signal_number]);
|
||||
ret = ::ReleaseSemaphore(sig_sem, 1, NULL);
|
||||
assert(ret != 0, "ReleaseSemaphore() failed");
|
||||
}
|
||||
}
|
||||
|
||||
static int check_pending_signals(bool wait_for_signal) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2013, 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
|
||||
|
@ -62,6 +62,7 @@
|
|||
#endif
|
||||
|
||||
#define NOFAILOVER_MAJOR_VERSION 51
|
||||
#define STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION 52
|
||||
|
||||
// Access to external entry for VerifyClassCodes - old byte code verifier
|
||||
|
||||
|
@ -2317,6 +2318,11 @@ void ClassVerifier::verify_invoke_instructions(
|
|||
types = (1 << JVM_CONSTANT_InterfaceMethodref) |
|
||||
(1 << JVM_CONSTANT_Methodref);
|
||||
break;
|
||||
case Bytecodes::_invokestatic:
|
||||
types = (_klass->major_version() < STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION) ?
|
||||
(1 << JVM_CONSTANT_Methodref) :
|
||||
((1 << JVM_CONSTANT_InterfaceMethodref) | (1 << JVM_CONSTANT_Methodref));
|
||||
break;
|
||||
default:
|
||||
types = 1 << JVM_CONSTANT_Methodref;
|
||||
}
|
||||
|
|
44
hotspot/test/runtime/8007736/TestStaticIF.java
Normal file
44
hotspot/test/runtime/8007736/TestStaticIF.java
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (c) 2013, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8007736
|
||||
* @summary Test static interface method.
|
||||
* @run main/othervm -Xverify:all TestStaticIF
|
||||
*/
|
||||
|
||||
public class TestStaticIF implements StaticMethodInInterface {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.printf("main: %s%n", StaticMethodInInterface.get());
|
||||
}
|
||||
}
|
||||
|
||||
interface StaticMethodInInterface {
|
||||
|
||||
public static String get() {
|
||||
return "Hello from StaticMethodInInterface.get()";
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue