提交 eaaf5643 编写于 作者: S sspitsyn

Merge

......@@ -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
......@@ -445,7 +514,8 @@ JNF_COCOA_ENTER(env);
else
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) {
......
/*
* 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;
}
......
/*
* 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);
......
/*
* 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,42 +129,66 @@ 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 {
int ret;
int status;
do {
// Wait for debuggee to stop.
ret = waitpid(pid, &status, 0);
if (ret >= 0) {
if (WIFSTOPPED(status)) {
// Debuggee stopped.
}
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 {
// 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;
} else {
print_debug("waitpid(): Child process exited/terminated (status = 0x%x)\n", status);
}
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 {
switch (errno) {
case EINTR:
continue;
break;
case ECHILD:
print_debug("waitpid() failed. Child process pid (%d) does not exist \n", pid);
break;
case EINVAL:
print_debug("waitpid() failed. Invalid options argument.\n");
break;
default:
print_debug("waitpid() failed. Unexpected error %d\n",errno);
}
print_debug("waitpid(): Child process exited/terminated (status = 0x%x)\n", status);
return false;
}
} while(true);
} else {
switch (errno) {
case EINTR:
continue;
break;
case ECHILD:
print_debug("waitpid() failed. Child process pid (%d) does not exist \n", pid);
break;
case EINVAL:
print_debug("waitpid() failed. Invalid options argument.\n");
break;
default:
print_debug("waitpid() failed. Unexpected error %d\n",errno);
}
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);
}
}
......
/*
* 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;
}
......
/*
* 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);
......
/*
* 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,46 +143,71 @@ 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 {
int ret;
int status;
do {
// Wait for debuggee to stop.
ret = waitpid(pid, &status, 0);
if (ret == -1 && errno == ECHILD) {
// try cloned process.
ret = waitpid(pid, &status, __WALL);
}
if (ret >= 0) {
if (WIFSTOPPED(status)) {
// Debuggee stopped.
}
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 == -1 && errno == ECHILD) {
// try cloned process.
ret = waitpid(pid, &status, __WALL);
}
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;
} else {
print_debug("waitpid(): Child process exited/terminated (status = 0x%x)\n", status);
}
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 {
switch (errno) {
case EINTR:
continue;
break;
case ECHILD:
print_debug("waitpid() failed. Child process pid (%d) does not exist \n", pid);
break;
case EINVAL:
print_debug("waitpid() failed. Invalid options argument.\n");
break;
default:
print_debug("waitpid() failed. Unexpected error %d\n",errno);
}
print_debug("waitpid(): Child process exited/terminated (status = 0x%x)\n", status);
return false;
}
} while(true);
} else {
switch (errno) {
case EINTR:
continue;
break;
case ECHILD:
print_debug("waitpid() failed. Child process pid (%d) does not exist \n", pid);
break;
case EINVAL:
print_debug("waitpid() failed. Invalid options argument.\n");
break;
default:
print_debug("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) {
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,15 +61,13 @@ 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;
//missing Printezis 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) ){
......
......@@ -90,10 +90,6 @@ public class VM {
/** Flags indicating whether we are attached to a core, C1, or C2 build */
private boolean usingClientCompiler;
private boolean usingServerCompiler;
/** Flag indicating whether UseTLAB is turned on */
private boolean useTLAB;
/** Flag indicating whether invokedynamic support is on */
private boolean enableInvokeDynamic;
/** alignment constants */
private boolean isLP64;
private int bytesPerLong;
......@@ -326,9 +322,6 @@ public class VM {
}
}
useTLAB = (db.lookupIntConstant("UseTLAB").intValue() != 0);
enableInvokeDynamic = (db.lookupIntConstant("EnableInvokeDynamic").intValue() != 0);
if (debugger != null) {
isLP64 = debugger.getMachineDescription().isLP64();
}
......@@ -579,15 +572,6 @@ public class VM {
}
}
/** Indicates whether Thread-Local Allocation Buffers are used */
public boolean getUseTLAB() {
return useTLAB;
}
public boolean getEnableInvokeDynamic() {
return enableInvokeDynamic;
}
public TypeDataBase getTypeDataBase() {
return db;
}
......@@ -822,6 +806,12 @@ public class VM {
return objectAlignmentInBytes;
}
/** Indicates whether Thread-Local Allocation Buffers are used */
public boolean getUseTLAB() {
Flag flag = getCommandLineFlag("UseTLAB");
return (flag == null) ? false: flag.getBool();
}
// returns null, if not available.
public Flag[] getCommandLineFlags() {
if (commandLineFlags == null) {
......
......@@ -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)
......
......@@ -2887,7 +2887,9 @@ JVM_handle_bsd_signal(int signo, siginfo_t* siginfo,
void signalHandler(int sig, siginfo_t* info, void* uc) {
assert(info != NULL && uc != NULL, "it must be old kernel");
int orig_errno = errno; // Preserve errno value over signal handler.
JVM_handle_bsd_signal(sig, info, uc, true);
errno = orig_errno;
}
......
......@@ -3653,7 +3653,9 @@ JVM_handle_linux_signal(int signo, siginfo_t* siginfo,
void signalHandler(int sig, siginfo_t* info, void* uc) {
assert(info != NULL && uc != NULL, "it must be old kernel");
int orig_errno = errno; // Preserve errno value over signal handler.
JVM_handle_linux_signal(sig, info, uc, true);
errno = orig_errno;
}
......
......@@ -1865,7 +1865,7 @@ void os::abort(bool dump_core) {
// Die immediately, no exit hook, no abort hook, no cleanup.
void os::die() {
_exit(-1);
::abort(); // dump core (for debugging)
}
// unused
......@@ -4317,7 +4317,9 @@ JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext,
void signalHandler(int sig, siginfo_t* info, void* ucVoid) {
int orig_errno = errno; // Preserve errno value over signal handler.
JVM_handle_solaris_signal(sig, info, ucVoid, true);
errno = orig_errno;
}
/* Do not delete - if guarantee is ever removed, a signal handler (even empty)
......
......@@ -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;
Atomic::inc(&pending_signals[signal_number]);
ret = ::ReleaseSemaphore(sig_sem, 1, NULL);
assert(ret != 0, "ReleaseSemaphore() failed");
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) {
......
/*
* 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
......@@ -61,7 +61,8 @@
# include "bytes_ppc.hpp"
#endif
#define NOFAILOVER_MAJOR_VERSION 51
#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;
}
......
......@@ -456,6 +456,8 @@ class Method : public Metadata {
void print_codes_on(int from, int to, outputStream* st) const PRODUCT_RETURN;
// method parameters
bool has_method_parameters() const
{ return constMethod()->has_method_parameters(); }
int method_parameters_length() const
{ return constMethod()->method_parameters_length(); }
MethodParametersElement* method_parameters_start() const
......
......@@ -1558,6 +1558,18 @@ void VM_RedefineClasses::rewrite_cp_refs_in_method(methodHandle method,
} break;
}
} // end for each bytecode
// We also need to rewrite the parameter name indexes, if there is
// method parameter data present
if(method->has_method_parameters()) {
const int len = method->method_parameters_length();
MethodParametersElement* elem = method->method_parameters_start();
for (int i = 0; i < len; i++) {
const u2 cp_index = elem[i].name_cp_index;
elem[i].name_cp_index = find_new_index(cp_index);
}
}
} // end rewrite_cp_refs_in_method()
......
......@@ -2109,8 +2109,6 @@ typedef BinaryTreeDictionary<Metablock, FreeList> MetablockTreeDictionary;
/* Useful globals */ \
/******************/ \
\
declare_constant(UseTLAB) \
declare_constant(EnableInvokeDynamic) \
\
/**************/ \
/* Stack bias */ \
......
/*
* 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()";
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册