提交 e1609748 编写于 作者: L lana

Merge

...@@ -429,7 +429,7 @@ ifeq ($(USE_EXTERNAL_LIBZ), true) ...@@ -429,7 +429,7 @@ ifeq ($(USE_EXTERNAL_LIBZ), true)
UNPACKEXE_CFLAGS := -DSYSTEM_ZLIB UNPACKEXE_CFLAGS := -DSYSTEM_ZLIB
UNPACKEXE_ZIPOBJS := -lz UNPACKEXE_ZIPOBJS := -lz
else else
UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5 UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.8
UNPACKEXE_ZIPOBJS := $(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \ UNPACKEXE_ZIPOBJS := $(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \
$(JDK_OUTPUTDIR)/objs/libzip/deflate$(OBJ_SUFFIX) \ $(JDK_OUTPUTDIR)/objs/libzip/deflate$(OBJ_SUFFIX) \
$(JDK_OUTPUTDIR)/objs/libzip/trees$(OBJ_SUFFIX) \ $(JDK_OUTPUTDIR)/objs/libzip/trees$(OBJ_SUFFIX) \
......
...@@ -1242,7 +1242,7 @@ ifndef BUILD_HEADLESS_ONLY ...@@ -1242,7 +1242,7 @@ ifndef BUILD_HEADLESS_ONLY
LIBSPLASHSCREEN_LDFLAGS_SUFFIX := LIBSPLASHSCREEN_LDFLAGS_SUFFIX :=
ifneq ($(USE_EXTERNAL_LIBZ), true) ifneq ($(USE_EXTERNAL_LIBZ), true)
LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5 LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.8
LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS) LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
endif endif
......
...@@ -230,9 +230,9 @@ $(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM) ...@@ -230,9 +230,9 @@ $(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM)
BUILD_LIBZIP_EXCLUDES := BUILD_LIBZIP_EXCLUDES :=
ifeq ($(USE_EXTERNAL_LIBZ), true) ifeq ($(USE_EXTERNAL_LIBZ), true)
LIBZ := -lz LIBZ := -lz
LIBZIP_EXCLUDES += zlib-1.2.5 LIBZIP_EXCLUDES += zlib-1.2.8
else else
ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5 ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.8
endif endif
BUILD_LIBZIP_REORDER := BUILD_LIBZIP_REORDER :=
...@@ -384,7 +384,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) ...@@ -384,7 +384,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
endif endif
ifneq ($(USE_EXTERNAL_LIBZ), true) ifneq ($(USE_EXTERNAL_LIBZ), true)
BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5 BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.8
LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS) LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
BUILD_LIBJLI_FILES += \ BUILD_LIBJLI_FILES += \
inflate.c \ inflate.c \
......
...@@ -155,6 +155,7 @@ SUNWprivate_1.1 { ...@@ -155,6 +155,7 @@ SUNWprivate_1.1 {
g_CMpDataID; g_CMpDataID;
colorValueID; colorValueID;
mul8table; mul8table;
div8table;
jvm; jvm;
# ProcessPath entry points and data # ProcessPath entry points and data
......
...@@ -359,7 +359,57 @@ int NET_Accept(int s, struct sockaddr *addr, int *addrlen) { ...@@ -359,7 +359,57 @@ int NET_Accept(int s, struct sockaddr *addr, int *addrlen) {
} }
int NET_Connect(int s, struct sockaddr *addr, int addrlen) { int NET_Connect(int s, struct sockaddr *addr, int addrlen) {
BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen) ); int crc = -1, prc = -1;
threadEntry_t self;
fdEntry_t* fdEntry = getFdEntry(s);
if (fdEntry == NULL) {
errno = EBADF;
return -1;
}
/* On AIX, when the system call connect() is interrupted, the connection
* is not aborted and it will be established asynchronously by the kernel.
* Hence, no need to restart connect() when EINTR is received
*/
startOp(fdEntry, &self);
crc = connect(s, addr, addrlen);
endOp(fdEntry, &self);
if (crc == -1 && errno == EINTR) {
struct pollfd s_pollfd;
int sockopt_arg = 0;
socklen_t len;
s_pollfd.fd = s;
s_pollfd.events = POLLOUT | POLLERR;
/* poll the file descriptor */
do {
startOp(fdEntry, &self);
prc = poll(&s_pollfd, 1, -1);
endOp(fdEntry, &self);
} while (prc == -1 && errno == EINTR);
if (prc < 0)
return prc;
len = sizeof(sockopt_arg);
/* Check whether the connection has been established */
if (getsockopt(s, SOL_SOCKET, SO_ERROR, &sockopt_arg, &len) == -1)
return -1;
if (sockopt_arg != 0 ) {
errno = sockopt_arg;
return -1;
}
} else {
return crc;
}
/* At this point, fd is connected. Set successful return code */
return 0;
} }
#ifndef USE_SELECT #ifndef USE_SELECT
......
此差异已折叠。
此差异已折叠。
'\" t '\" t
.\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. .\" Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved.
.\" .\"
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\" .\"
...@@ -21,14 +21,16 @@ ...@@ -21,14 +21,16 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Arch: generic .\" Title: javap
.\" Software: JDK 8 .\" Language: English
.\" Date: 21 November 2013 .\" Date: 8 August 2014
.\" SectDesc: Basic Tools .\" SectDesc: Basic Tools
.\" Title: javap.1 .\" Software: JDK 8
.\" Arch: generic
.\" Part Number: E38207-03
.\" .\"
.if n .pl 99999 .if n .pl 99999
.TH javap 1 "21 November 2013" "JDK 8" "Basic Tools" .TH "javap" "1" "8 August 2014" "JDK 8" "Basic Tools"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * Define some portability stuff .\" * Define some portability stuff
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
...@@ -48,395 +50,342 @@ ...@@ -48,395 +50,342 @@
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE * .\" * MAIN CONTENT STARTS HERE *
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.SH "NAME"
.SH NAME
javap \- Disassembles one or more class files\&. javap \- Disassembles one or more class files\&.
.SH SYNOPSIS .SH "SYNOPSIS"
.sp .sp
.if n \{\
.RS 4
.\}
.nf .nf
\fBjavap\fR [\fIoptions\fR] \fIclassfile\fR\&.\&.\&. \fBjavap\fR [\fIoptions\fR] \fIclassfile\fR\&.\&.\&.
.fi .fi
.sp .if n \{\
.TP .RE
.\}
.PP
\fIoptions\fR \fIoptions\fR
The command-line options\&. See Options\&. .RS 4
.TP The command\-line options\&. See Options\&.
.RE
.PP
\fIclassfile\fR \fIclassfile\fR
One or more classes separated by spaces to be processed for annotations such as DocFooter\&.class\&. You can specify a class that can be found in the class path, by its file name or with a URL such as \f3file:///home/user/myproject/src/DocFooter\&.class\fR\&. .RS 4
.SH DESCRIPTION One or more classes separated by spaces to be processed for annotations such as DocFooter\&.class\&. You can specify a class that can be found in the class path, by its file name or with a URL such as
The \f3javap\fR command disassembles one or more class files\&. The output depends on the options used\&. When no options are used, then the \f3javap\fR command prints the package, protected and public fields, and methods of the classes passed to it\&. The \f3javap\fR command prints its output to \f3stdout\fR\&. \fBfile:///home/user/myproject/src/DocFooter\&.class\fR\&.
.SH OPTIONS .RE
.TP .SH "DESCRIPTION"
-help, --help, -? .PP
The
\fBjavap\fR
command disassembles one or more class files\&. The output depends on the options used\&. When no options are used, then the
\fBjavap\fR
command prints the package, protected and public fields, and methods of the classes passed to it\&. The
\fBjavap\fR
command prints its output to
\fBstdout\fR\&.
.SH "OPTIONS"
.PP
\-help
.br .br
Prints a help message for the \f3javap\fR command\&. \-\-help
.TP
-version
.br .br
\-?
.RS 4
Prints a help message for the
\fBjavap\fR
command\&.
.RE
.PP
\-version
.RS 4
Prints release information\&. Prints release information\&.
.TP .RE
-l .PP
.br \-l
.RS 4
Prints line and local variable tables\&. Prints line and local variable tables\&.
.TP .RE
-public .PP
.br \-public
.RS 4
Shows only public classes and members\&. Shows only public classes and members\&.
.TP .RE
-protected .PP
.br \-protected
.RS 4
Shows only protected and public classes and members\&. Shows only protected and public classes and members\&.
.TP .RE
-private, -p .PP
\-private
.br .br
\-p
.RS 4
Shows all classes and members\&. Shows all classes and members\&.
.TP .RE
-J\fIoption\fR .PP
.br \-J\fIoption\fR
.RS 4
Passes the specified option to the JVM\&. For example: Passes the specified option to the JVM\&. For example:
.sp .sp
.if n \{\
.RS 4
.\}
.nf .nf
\f3javap \-J\-version\fP \fBjavap \-J\-version\fR
.fi \fBjavap \-J\-Djava\&.security\&.manager \-J\-Djava\&.security\&.policy=MyPolicy MyClassName\fR
.nf
\f3javap \-J\-Djava\&.security\&.manager \-J\-Djava\&.security\&.policy=MyPolicy MyClassName\fP
.fi
.nf
\f3\fP
.fi
.sp
.fi
For more information about JVM options, see the \f3java(1)\fR command documentation\&. .if n \{\
.TP .RE
-s .\}
.br For more information about JVM options, see the command documentation\&.
.RE
.PP
\-s
.RS 4
Prints internal type signatures\&. Prints internal type signatures\&.
.TP .RE
-sysinfo .PP
.br \-sysinfo
.RS 4
Shows system information (path, size, date, MD5 hash) of the class being processed\&. Shows system information (path, size, date, MD5 hash) of the class being processed\&.
.TP .RE
-constants .PP
.br \-constants
Shows \f3static final\fR constants\&. .RS 4
.TP Shows
-c \fBstatic final\fR
.br constants\&.
.RE
.PP
\-c
.RS 4
Prints disassembled code, for example, the instructions that comprise the Java bytecodes, for each of the methods in the class\&. Prints disassembled code, for example, the instructions that comprise the Java bytecodes, for each of the methods in the class\&.
.TP .RE
-verbose .PP
.br \-verbose
.RS 4
Prints stack size, number of locals and arguments for methods\&. Prints stack size, number of locals and arguments for methods\&.
.TP .RE
-classpath \fIpath\fR .PP
.br \-classpath \fIpath\fR
Specifies the path the \f3javap\fR command uses to look up classes\&. Overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. .RS 4
.TP Specifies the path the
-bootclasspath \fIpath\fR \fBjavap\fR
.br command uses to look up classes\&. Overrides the default or the
Specifies the path from which to load bootstrap classes\&. By default, the bootstrap classes are the classes that implement the core Java platform located in \f3jre/lib/rt\&.jar\fR and several other JAR files\&. \fBCLASSPATH\fR
.TP environment variable when it is set\&.
-extdir \fIdirs\fR .RE
.br .PP
Overrides the location at which installed extensions are searched for\&. The default location for extensions is the value of \f3java\&.ext\&.dirs\fR\&. \-bootclasspath \fIpath\fR
.SH EXAMPLE .RS 4
Compile the following \f3DocFooter\fR class: Specifies the path from which to load bootstrap classes\&. By default, the bootstrap classes are the classes that implement the core Java platform located in
\fBjre/lib/rt\&.jar\fR
and several other JAR files\&.
.RE
.PP
\-extdir \fIdirs\fR
.RS 4
Overrides the location at which installed extensions are searched for\&. The default location for extensions is the value of
\fBjava\&.ext\&.dirs\fR\&.
.RE
.SH "EXAMPLE"
.PP
Compile the following
\fBDocFooter\fR
class:
.sp .sp
.nf .if n \{\
\f3import java\&.awt\&.*;\fP .RS 4
.fi .\}
.nf .nf
\f3import java\&.applet\&.*;\fP \fBimport java\&.awt\&.*;\fR
.fi \fBimport java\&.applet\&.*;\fR
.nf \fB \fR
\f3\fP \fBpublic class DocFooter extends Applet {\fR
.fi \fB String date;\fR
.nf \fB String email;\fR
\f3public class DocFooter extends Applet {\fP \fB \fR
.fi \fB public void init() {\fR
.nf \fB resize(500,100);\fR
\f3 String date;\fP \fB date = getParameter("LAST_UPDATED");\fR
.fi \fB email = getParameter("EMAIL");\fR
.nf \fB }\fR
\f3 String email;\fP \fB \fR
.fi \fB public void paint(Graphics g) {\fR
.nf \fB g\&.drawString(date + " by ",100, 15);\fR
\f3\fP \fB g\&.drawString(email,290,15);\fR
.fi \fB }\fR
.nf \fB}\fR
\f3 public void init() {\fP
.fi
.nf
\f3 resize(500,100);\fP
.fi
.nf
\f3 date = getParameter("LAST_UPDATED");\fP
.fi
.nf
\f3 email = getParameter("EMAIL");\fP
.fi
.nf
\f3 }\fP
.fi
.nf
\f3\fP
.fi
.nf
\f3 public void paint(Graphics g) {\fP
.fi
.nf
\f3 g\&.drawString(date + " by ",100, 15);\fP
.fi
.nf
\f3 g\&.drawString(email,290,15);\fP
.fi
.nf
\f3 }\fP
.fi .fi
.nf .if n \{\
\f3}\fP .RE
.\}
.PP
The output from the
\fBjavap DocFooter\&.class\fR
command yields the following:
.sp
.if n \{\
.RS 4
.\}
.nf
\fBCompiled from "DocFooter\&.java"\fR
\fBpublic class DocFooter extends java\&.applet\&.Applet {\fR
\fB java\&.lang\&.String date;\fR
\fB java\&.lang\&.String email;\fR
\fB public DocFooter();\fR
\fB public void init();\fR
\fB public void paint(java\&.awt\&.Graphics);\fR
\fB}\fR
.fi .fi
.nf .if n \{\
\f3\fP .RE
.\}
.PP
The output from
\fBjavap \-c DocFooter\&.class\fR
command yields the following:
.sp
.if n \{\
.RS 4
.\}
.nf
\fBCompiled from "DocFooter\&.java"\fR
\fBpublic class DocFooter extends java\&.applet\&.Applet {\fR
\fB java\&.lang\&.String date;\fR
\fB java\&.lang\&.String email;\fR
\fB public DocFooter();\fR
\fB Code:\fR
\fB 0: aload_0 \fR
\fB 1: invokespecial #1 // Method\fR
\fBjava/applet/Applet\&."<init>":()V\fR
\fB 4: return \fR
\fB public void init();\fR
\fB Code:\fR
\fB 0: aload_0 \fR
\fB 1: sipush 500\fR
\fB 4: bipush 100\fR
\fB 6: invokevirtual #2 // Method resize:(II)V\fR
\fB 9: aload_0 \fR
\fB 10: aload_0 \fR
\fB 11: ldc #3 // String LAST_UPDATED\fR
\fB 13: invokevirtual #4 // Method\fR
\fB getParameter:(Ljava/lang/String;)Ljava/lang/String;\fR
\fB 16: putfield #5 // Field date:Ljava/lang/String;\fR
\fB 19: aload_0 \fR
\fB 20: aload_0 \fR
\fB 21: ldc #6 // String EMAIL\fR
\fB 23: invokevirtual #4 // Method\fR
\fB getParameter:(Ljava/lang/String;)Ljava/lang/String;\fR
\fB 26: putfield #7 // Field email:Ljava/lang/String;\fR
\fB 29: return \fR
\fB public void paint(java\&.awt\&.Graphics);\fR
\fB Code:\fR
\fB 0: aload_1 \fR
\fB 1: new #8 // class java/lang/StringBuilder\fR
\fB 4: dup \fR
\fB 5: invokespecial #9 // Method\fR
\fB java/lang/StringBuilder\&."<init>":()V\fR
\fB 8: aload_0 \fR
\fB 9: getfield #5 // Field date:Ljava/lang/String;\fR
\fB 12: invokevirtual #10 // Method\fR
\fB java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fR
\fB 15: ldc #11 // String by \fR
\fB 17: invokevirtual #10 // Method\fR
\fB java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fR
\fB 20: invokevirtual #12 // Method\fR
\fB java/lang/StringBuilder\&.toString:()Ljava/lang/String;\fR
\fB 23: bipush 100\fR
\fB 25: bipush 15\fR
\fB 27: invokevirtual #13 // Method\fR
\fB java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fR
\fB 30: aload_1 \fR
\fB 31: aload_0 \fR
\fB 32: getfield #7 // Field email:Ljava/lang/String;\fR
\fB 35: sipush 290\fR
\fB 38: bipush 15\fR
\fB 40: invokevirtual #13 // Method\fR
\fBjava/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fR
\fB 43: return \fR
\fB}\fR
.fi .fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.sp .sp
The output from the \f3javap DocFooter\&.class\fR command yields the following: .RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
java(1)
.RE
.sp .sp
.nf .RS 4
\f3Compiled from "DocFooter\&.java"\fP .ie n \{\
.fi \h'-04'\(bu\h'+03'\c
.nf .\}
\f3public class DocFooter extends java\&.applet\&.Applet {\fP .el \{\
.fi .sp -1
.nf .IP \(bu 2.3
\f3 java\&.lang\&.String date;\fP .\}
.fi javac(1)
.nf .RE
\f3 java\&.lang\&.String email;\fP
.fi
.nf
\f3 public DocFooter();\fP
.fi
.nf
\f3 public void init();\fP
.fi
.nf
\f3 public void paint(java\&.awt\&.Graphics);\fP
.fi
.nf
\f3}\fP
.fi
.nf
\f3\fP
.fi
.sp .sp
The output from \f3javap -c DocFooter\&.class\fR command yields the following: .RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
javadoc(1)
.RE
.sp .sp
.nf .RS 4
\f3Compiled from "DocFooter\&.java"\fP .ie n \{\
.fi \h'-04'\(bu\h'+03'\c
.nf .\}
\f3public class DocFooter extends java\&.applet\&.Applet {\fP .el \{\
.fi .sp -1
.nf .IP \(bu 2.3
\f3 java\&.lang\&.String date;\fP .\}
.fi javah(1)
.nf .RE
\f3 java\&.lang\&.String email;\fP
.fi
.nf
\f3\fP
.fi
.nf
\f3 public DocFooter();\fP
.fi
.nf
\f3 Code:\fP
.fi
.nf
\f3 0: aload_0 \fP
.fi
.nf
\f3 1: invokespecial #1 // Method\fP
.fi
.nf
\f3java/applet/Applet\&."<init>":()V\fP
.fi
.nf
\f3 4: return \fP
.fi
.nf
\f3\fP
.fi
.nf
\f3 public void init();\fP
.fi
.nf
\f3 Code:\fP
.fi
.nf
\f3 0: aload_0 \fP
.fi
.nf
\f3 1: sipush 500\fP
.fi
.nf
\f3 4: bipush 100\fP
.fi
.nf
\f3 6: invokevirtual #2 // Method resize:(II)V\fP
.fi
.nf
\f3 9: aload_0 \fP
.fi
.nf
\f3 10: aload_0 \fP
.fi
.nf
\f3 11: ldc #3 // String LAST_UPDATED\fP
.fi
.nf
\f3 13: invokevirtual #4 // Method\fP
.fi
.nf
\f3 getParameter:(Ljava/lang/String;)Ljava/lang/String;\fP
.fi
.nf
\f3 16: putfield #5 // Field date:Ljava/lang/String;\fP
.fi
.nf
\f3 19: aload_0 \fP
.fi
.nf
\f3 20: aload_0 \fP
.fi
.nf
\f3 21: ldc #6 // String EMAIL\fP
.fi
.nf
\f3 23: invokevirtual #4 // Method\fP
.fi
.nf
\f3 getParameter:(Ljava/lang/String;)Ljava/lang/String;\fP
.fi
.nf
\f3 26: putfield #7 // Field email:Ljava/lang/String;\fP
.fi
.nf
\f3 29: return \fP
.fi
.nf
\f3\fP
.fi
.nf
\f3 public void paint(java\&.awt\&.Graphics);\fP
.fi
.nf
\f3 Code:\fP
.fi
.nf
\f3 0: aload_1 \fP
.fi
.nf
\f3 1: new #8 // class java/lang/StringBuilder\fP
.fi
.nf
\f3 4: dup \fP
.fi
.nf
\f3 5: invokespecial #9 // Method\fP
.fi
.nf
\f3 java/lang/StringBuilder\&."<init>":()V\fP
.fi
.nf
\f3 8: aload_0 \fP
.fi
.nf
\f3 9: getfield #5 // Field date:Ljava/lang/String;\fP
.fi
.nf
\f3 12: invokevirtual #10 // Method\fP
.fi
.nf
\f3 java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fP
.fi
.nf
\f3 15: ldc #11 // String by \fP
.fi
.nf
\f3 17: invokevirtual #10 // Method\fP
.fi
.nf
\f3 java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fP
.fi
.nf
\f3 20: invokevirtual #12 // Method\fP
.fi
.nf
\f3 java/lang/StringBuilder\&.toString:()Ljava/lang/String;\fP
.fi
.nf
\f3 23: bipush 100\fP
.fi
.nf
\f3 25: bipush 15\fP
.fi
.nf
\f3 27: invokevirtual #13 // Method\fP
.fi
.nf
\f3 java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fP
.fi
.nf
\f3 30: aload_1 \fP
.fi
.nf
\f3 31: aload_0 \fP
.fi
.nf
\f3 32: getfield #7 // Field email:Ljava/lang/String;\fP
.fi
.nf
\f3 35: sipush 290\fP
.fi
.nf
\f3 38: bipush 15\fP
.fi
.nf
\f3 40: invokevirtual #13 // Method\fP
.fi
.nf
\f3java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fP
.fi
.nf
\f3 43: return \fP
.fi
.nf
\f3}\fP
.fi
.nf
\f3\fP
.fi
.sp .sp
.SH SEE\ ALSO .RS 4
.TP 0.2i .ie n \{\
\(bu \h'-04'\(bu\h'+03'\c
javac(1) .\}
.TP 0.2i .el \{\
\(bu .sp -1
java(1) .IP \(bu 2.3
.TP 0.2i .\}
\(bu
jdb(1) jdb(1)
.TP 0.2i .RE
\(bu .sp
javah(1) .RS 4
.TP 0.2i .ie n \{\
\(bu \h'-04'\(bu\h'+03'\c
javadoc(1) .\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
jdeps(1)
.RE .RE
.br .br
'pl 8.5i 'pl 8.5i
......
此差异已折叠。
此差异已折叠。
'\" t '\" t
.\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. .\" Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved.
.\" .\"
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\" .\"
...@@ -21,14 +21,16 @@ ...@@ -21,14 +21,16 @@
.\" or visit www.oracle.com if you need additional information or have any .\" or visit www.oracle.com if you need additional information or have any
.\" questions. .\" questions.
.\" .\"
.\" Arch: generic .\" Title: javap
.\" Software: JDK 8 .\" Language: English
.\" Date: 21 November 2013 .\" Date: 8 August 2014
.\" SectDesc: Basic Tools .\" SectDesc: Basic Tools
.\" Title: javap.1 .\" Software: JDK 8
.\" Arch: generic
.\" Part Number: E38207-03
.\" .\"
.if n .pl 99999 .if n .pl 99999
.TH javap 1 "21 November 2013" "JDK 8" "Basic Tools" .TH "javap" "1" "8 August 2014" "JDK 8" "Basic Tools"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * Define some portability stuff .\" * Define some portability stuff
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
...@@ -48,395 +50,342 @@ ...@@ -48,395 +50,342 @@
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE * .\" * MAIN CONTENT STARTS HERE *
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.SH "NAME"
.SH NAME
javap \- Disassembles one or more class files\&. javap \- Disassembles one or more class files\&.
.SH SYNOPSIS .SH "SYNOPSIS"
.sp .sp
.if n \{\
.RS 4
.\}
.nf .nf
\fBjavap\fR [\fIoptions\fR] \fIclassfile\fR\&.\&.\&. \fBjavap\fR [\fIoptions\fR] \fIclassfile\fR\&.\&.\&.
.fi .fi
.sp .if n \{\
.TP .RE
.\}
.PP
\fIoptions\fR \fIoptions\fR
The command-line options\&. See Options\&. .RS 4
.TP The command\-line options\&. See Options\&.
.RE
.PP
\fIclassfile\fR \fIclassfile\fR
One or more classes separated by spaces to be processed for annotations such as DocFooter\&.class\&. You can specify a class that can be found in the class path, by its file name or with a URL such as \f3file:///home/user/myproject/src/DocFooter\&.class\fR\&. .RS 4
.SH DESCRIPTION One or more classes separated by spaces to be processed for annotations such as DocFooter\&.class\&. You can specify a class that can be found in the class path, by its file name or with a URL such as
The \f3javap\fR command disassembles one or more class files\&. The output depends on the options used\&. When no options are used, then the \f3javap\fR command prints the package, protected and public fields, and methods of the classes passed to it\&. The \f3javap\fR command prints its output to \f3stdout\fR\&. \fBfile:///home/user/myproject/src/DocFooter\&.class\fR\&.
.SH OPTIONS .RE
.TP .SH "DESCRIPTION"
-help, --help, -? .PP
The
\fBjavap\fR
command disassembles one or more class files\&. The output depends on the options used\&. When no options are used, then the
\fBjavap\fR
command prints the package, protected and public fields, and methods of the classes passed to it\&. The
\fBjavap\fR
command prints its output to
\fBstdout\fR\&.
.SH "OPTIONS"
.PP
\-help
.br .br
Prints a help message for the \f3javap\fR command\&. \-\-help
.TP
-version
.br .br
\-?
.RS 4
Prints a help message for the
\fBjavap\fR
command\&.
.RE
.PP
\-version
.RS 4
Prints release information\&. Prints release information\&.
.TP .RE
-l .PP
.br \-l
.RS 4
Prints line and local variable tables\&. Prints line and local variable tables\&.
.TP .RE
-public .PP
.br \-public
.RS 4
Shows only public classes and members\&. Shows only public classes and members\&.
.TP .RE
-protected .PP
.br \-protected
.RS 4
Shows only protected and public classes and members\&. Shows only protected and public classes and members\&.
.TP .RE
-private, -p .PP
\-private
.br .br
\-p
.RS 4
Shows all classes and members\&. Shows all classes and members\&.
.TP .RE
-J\fIoption\fR .PP
.br \-J\fIoption\fR
.RS 4
Passes the specified option to the JVM\&. For example: Passes the specified option to the JVM\&. For example:
.sp .sp
.if n \{\
.RS 4
.\}
.nf .nf
\f3javap \-J\-version\fP \fBjavap \-J\-version\fR
.fi \fBjavap \-J\-Djava\&.security\&.manager \-J\-Djava\&.security\&.policy=MyPolicy MyClassName\fR
.nf
\f3javap \-J\-Djava\&.security\&.manager \-J\-Djava\&.security\&.policy=MyPolicy MyClassName\fP
.fi
.nf
\f3\fP
.fi
.sp
.fi
For more information about JVM options, see the \f3java(1)\fR command documentation\&. .if n \{\
.TP .RE
-s .\}
.br For more information about JVM options, see the command documentation\&.
.RE
.PP
\-s
.RS 4
Prints internal type signatures\&. Prints internal type signatures\&.
.TP .RE
-sysinfo .PP
.br \-sysinfo
.RS 4
Shows system information (path, size, date, MD5 hash) of the class being processed\&. Shows system information (path, size, date, MD5 hash) of the class being processed\&.
.TP .RE
-constants .PP
.br \-constants
Shows \f3static final\fR constants\&. .RS 4
.TP Shows
-c \fBstatic final\fR
.br constants\&.
.RE
.PP
\-c
.RS 4
Prints disassembled code, for example, the instructions that comprise the Java bytecodes, for each of the methods in the class\&. Prints disassembled code, for example, the instructions that comprise the Java bytecodes, for each of the methods in the class\&.
.TP .RE
-verbose .PP
.br \-verbose
.RS 4
Prints stack size, number of locals and arguments for methods\&. Prints stack size, number of locals and arguments for methods\&.
.TP .RE
-classpath \fIpath\fR .PP
.br \-classpath \fIpath\fR
Specifies the path the \f3javap\fR command uses to look up classes\&. Overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. .RS 4
.TP Specifies the path the
-bootclasspath \fIpath\fR \fBjavap\fR
.br command uses to look up classes\&. Overrides the default or the
Specifies the path from which to load bootstrap classes\&. By default, the bootstrap classes are the classes that implement the core Java platform located in \f3jre/lib/rt\&.jar\fR and several other JAR files\&. \fBCLASSPATH\fR
.TP environment variable when it is set\&.
-extdir \fIdirs\fR .RE
.br .PP
Overrides the location at which installed extensions are searched for\&. The default location for extensions is the value of \f3java\&.ext\&.dirs\fR\&. \-bootclasspath \fIpath\fR
.SH EXAMPLE .RS 4
Compile the following \f3DocFooter\fR class: Specifies the path from which to load bootstrap classes\&. By default, the bootstrap classes are the classes that implement the core Java platform located in
\fBjre/lib/rt\&.jar\fR
and several other JAR files\&.
.RE
.PP
\-extdir \fIdirs\fR
.RS 4
Overrides the location at which installed extensions are searched for\&. The default location for extensions is the value of
\fBjava\&.ext\&.dirs\fR\&.
.RE
.SH "EXAMPLE"
.PP
Compile the following
\fBDocFooter\fR
class:
.sp .sp
.nf .if n \{\
\f3import java\&.awt\&.*;\fP .RS 4
.fi .\}
.nf .nf
\f3import java\&.applet\&.*;\fP \fBimport java\&.awt\&.*;\fR
.fi \fBimport java\&.applet\&.*;\fR
.nf \fB \fR
\f3\fP \fBpublic class DocFooter extends Applet {\fR
.fi \fB String date;\fR
.nf \fB String email;\fR
\f3public class DocFooter extends Applet {\fP \fB \fR
.fi \fB public void init() {\fR
.nf \fB resize(500,100);\fR
\f3 String date;\fP \fB date = getParameter("LAST_UPDATED");\fR
.fi \fB email = getParameter("EMAIL");\fR
.nf \fB }\fR
\f3 String email;\fP \fB \fR
.fi \fB public void paint(Graphics g) {\fR
.nf \fB g\&.drawString(date + " by ",100, 15);\fR
\f3\fP \fB g\&.drawString(email,290,15);\fR
.fi \fB }\fR
.nf \fB}\fR
\f3 public void init() {\fP
.fi
.nf
\f3 resize(500,100);\fP
.fi
.nf
\f3 date = getParameter("LAST_UPDATED");\fP
.fi
.nf
\f3 email = getParameter("EMAIL");\fP
.fi
.nf
\f3 }\fP
.fi
.nf
\f3\fP
.fi
.nf
\f3 public void paint(Graphics g) {\fP
.fi
.nf
\f3 g\&.drawString(date + " by ",100, 15);\fP
.fi
.nf
\f3 g\&.drawString(email,290,15);\fP
.fi
.nf
\f3 }\fP
.fi .fi
.nf .if n \{\
\f3}\fP .RE
.\}
.PP
The output from the
\fBjavap DocFooter\&.class\fR
command yields the following:
.sp
.if n \{\
.RS 4
.\}
.nf
\fBCompiled from "DocFooter\&.java"\fR
\fBpublic class DocFooter extends java\&.applet\&.Applet {\fR
\fB java\&.lang\&.String date;\fR
\fB java\&.lang\&.String email;\fR
\fB public DocFooter();\fR
\fB public void init();\fR
\fB public void paint(java\&.awt\&.Graphics);\fR
\fB}\fR
.fi .fi
.nf .if n \{\
\f3\fP .RE
.\}
.PP
The output from
\fBjavap \-c DocFooter\&.class\fR
command yields the following:
.sp
.if n \{\
.RS 4
.\}
.nf
\fBCompiled from "DocFooter\&.java"\fR
\fBpublic class DocFooter extends java\&.applet\&.Applet {\fR
\fB java\&.lang\&.String date;\fR
\fB java\&.lang\&.String email;\fR
\fB public DocFooter();\fR
\fB Code:\fR
\fB 0: aload_0 \fR
\fB 1: invokespecial #1 // Method\fR
\fBjava/applet/Applet\&."<init>":()V\fR
\fB 4: return \fR
\fB public void init();\fR
\fB Code:\fR
\fB 0: aload_0 \fR
\fB 1: sipush 500\fR
\fB 4: bipush 100\fR
\fB 6: invokevirtual #2 // Method resize:(II)V\fR
\fB 9: aload_0 \fR
\fB 10: aload_0 \fR
\fB 11: ldc #3 // String LAST_UPDATED\fR
\fB 13: invokevirtual #4 // Method\fR
\fB getParameter:(Ljava/lang/String;)Ljava/lang/String;\fR
\fB 16: putfield #5 // Field date:Ljava/lang/String;\fR
\fB 19: aload_0 \fR
\fB 20: aload_0 \fR
\fB 21: ldc #6 // String EMAIL\fR
\fB 23: invokevirtual #4 // Method\fR
\fB getParameter:(Ljava/lang/String;)Ljava/lang/String;\fR
\fB 26: putfield #7 // Field email:Ljava/lang/String;\fR
\fB 29: return \fR
\fB public void paint(java\&.awt\&.Graphics);\fR
\fB Code:\fR
\fB 0: aload_1 \fR
\fB 1: new #8 // class java/lang/StringBuilder\fR
\fB 4: dup \fR
\fB 5: invokespecial #9 // Method\fR
\fB java/lang/StringBuilder\&."<init>":()V\fR
\fB 8: aload_0 \fR
\fB 9: getfield #5 // Field date:Ljava/lang/String;\fR
\fB 12: invokevirtual #10 // Method\fR
\fB java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fR
\fB 15: ldc #11 // String by \fR
\fB 17: invokevirtual #10 // Method\fR
\fB java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fR
\fB 20: invokevirtual #12 // Method\fR
\fB java/lang/StringBuilder\&.toString:()Ljava/lang/String;\fR
\fB 23: bipush 100\fR
\fB 25: bipush 15\fR
\fB 27: invokevirtual #13 // Method\fR
\fB java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fR
\fB 30: aload_1 \fR
\fB 31: aload_0 \fR
\fB 32: getfield #7 // Field email:Ljava/lang/String;\fR
\fB 35: sipush 290\fR
\fB 38: bipush 15\fR
\fB 40: invokevirtual #13 // Method\fR
\fBjava/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fR
\fB 43: return \fR
\fB}\fR
.fi .fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.sp .sp
The output from the \f3javap DocFooter\&.class\fR command yields the following: .RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
java(1)
.RE
.sp .sp
.nf .RS 4
\f3Compiled from "DocFooter\&.java"\fP .ie n \{\
.fi \h'-04'\(bu\h'+03'\c
.nf .\}
\f3public class DocFooter extends java\&.applet\&.Applet {\fP .el \{\
.fi .sp -1
.nf .IP \(bu 2.3
\f3 java\&.lang\&.String date;\fP .\}
.fi javac(1)
.nf .RE
\f3 java\&.lang\&.String email;\fP
.fi
.nf
\f3 public DocFooter();\fP
.fi
.nf
\f3 public void init();\fP
.fi
.nf
\f3 public void paint(java\&.awt\&.Graphics);\fP
.fi
.nf
\f3}\fP
.fi
.nf
\f3\fP
.fi
.sp .sp
The output from \f3javap -c DocFooter\&.class\fR command yields the following: .RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
javadoc(1)
.RE
.sp .sp
.nf .RS 4
\f3Compiled from "DocFooter\&.java"\fP .ie n \{\
.fi \h'-04'\(bu\h'+03'\c
.nf .\}
\f3public class DocFooter extends java\&.applet\&.Applet {\fP .el \{\
.fi .sp -1
.nf .IP \(bu 2.3
\f3 java\&.lang\&.String date;\fP .\}
.fi javah(1)
.nf .RE
\f3 java\&.lang\&.String email;\fP
.fi
.nf
\f3\fP
.fi
.nf
\f3 public DocFooter();\fP
.fi
.nf
\f3 Code:\fP
.fi
.nf
\f3 0: aload_0 \fP
.fi
.nf
\f3 1: invokespecial #1 // Method\fP
.fi
.nf
\f3java/applet/Applet\&."<init>":()V\fP
.fi
.nf
\f3 4: return \fP
.fi
.nf
\f3\fP
.fi
.nf
\f3 public void init();\fP
.fi
.nf
\f3 Code:\fP
.fi
.nf
\f3 0: aload_0 \fP
.fi
.nf
\f3 1: sipush 500\fP
.fi
.nf
\f3 4: bipush 100\fP
.fi
.nf
\f3 6: invokevirtual #2 // Method resize:(II)V\fP
.fi
.nf
\f3 9: aload_0 \fP
.fi
.nf
\f3 10: aload_0 \fP
.fi
.nf
\f3 11: ldc #3 // String LAST_UPDATED\fP
.fi
.nf
\f3 13: invokevirtual #4 // Method\fP
.fi
.nf
\f3 getParameter:(Ljava/lang/String;)Ljava/lang/String;\fP
.fi
.nf
\f3 16: putfield #5 // Field date:Ljava/lang/String;\fP
.fi
.nf
\f3 19: aload_0 \fP
.fi
.nf
\f3 20: aload_0 \fP
.fi
.nf
\f3 21: ldc #6 // String EMAIL\fP
.fi
.nf
\f3 23: invokevirtual #4 // Method\fP
.fi
.nf
\f3 getParameter:(Ljava/lang/String;)Ljava/lang/String;\fP
.fi
.nf
\f3 26: putfield #7 // Field email:Ljava/lang/String;\fP
.fi
.nf
\f3 29: return \fP
.fi
.nf
\f3\fP
.fi
.nf
\f3 public void paint(java\&.awt\&.Graphics);\fP
.fi
.nf
\f3 Code:\fP
.fi
.nf
\f3 0: aload_1 \fP
.fi
.nf
\f3 1: new #8 // class java/lang/StringBuilder\fP
.fi
.nf
\f3 4: dup \fP
.fi
.nf
\f3 5: invokespecial #9 // Method\fP
.fi
.nf
\f3 java/lang/StringBuilder\&."<init>":()V\fP
.fi
.nf
\f3 8: aload_0 \fP
.fi
.nf
\f3 9: getfield #5 // Field date:Ljava/lang/String;\fP
.fi
.nf
\f3 12: invokevirtual #10 // Method\fP
.fi
.nf
\f3 java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fP
.fi
.nf
\f3 15: ldc #11 // String by \fP
.fi
.nf
\f3 17: invokevirtual #10 // Method\fP
.fi
.nf
\f3 java/lang/StringBuilder\&.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\fP
.fi
.nf
\f3 20: invokevirtual #12 // Method\fP
.fi
.nf
\f3 java/lang/StringBuilder\&.toString:()Ljava/lang/String;\fP
.fi
.nf
\f3 23: bipush 100\fP
.fi
.nf
\f3 25: bipush 15\fP
.fi
.nf
\f3 27: invokevirtual #13 // Method\fP
.fi
.nf
\f3 java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fP
.fi
.nf
\f3 30: aload_1 \fP
.fi
.nf
\f3 31: aload_0 \fP
.fi
.nf
\f3 32: getfield #7 // Field email:Ljava/lang/String;\fP
.fi
.nf
\f3 35: sipush 290\fP
.fi
.nf
\f3 38: bipush 15\fP
.fi
.nf
\f3 40: invokevirtual #13 // Method\fP
.fi
.nf
\f3java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V\fP
.fi
.nf
\f3 43: return \fP
.fi
.nf
\f3}\fP
.fi
.nf
\f3\fP
.fi
.sp .sp
.SH SEE\ ALSO .RS 4
.TP 0.2i .ie n \{\
\(bu \h'-04'\(bu\h'+03'\c
javac(1) .\}
.TP 0.2i .el \{\
\(bu .sp -1
java(1) .IP \(bu 2.3
.TP 0.2i .\}
\(bu
jdb(1) jdb(1)
.TP 0.2i .RE
\(bu .sp
javah(1) .RS 4
.TP 0.2i .ie n \{\
\(bu \h'-04'\(bu\h'+03'\c
javadoc(1) .\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
jdeps(1)
.RE .RE
.br .br
'pl 8.5i 'pl 8.5i
......
...@@ -120,6 +120,10 @@ class AquaComboBoxPopup extends BasicComboPopup { ...@@ -120,6 +120,10 @@ class AquaComboBoxPopup extends BasicComboPopup {
public void show() { public void show() {
final int startItemCount = comboBox.getItemCount(); final int startItemCount = comboBox.getItemCount();
if (startItemCount == 0) {
return;
}
final Rectangle popupBounds = adjustPopupAndGetBounds(); final Rectangle popupBounds = adjustPopupAndGetBounds();
if (popupBounds == null) return; // null means don't show if (popupBounds == null) return; // null means don't show
......
...@@ -171,7 +171,9 @@ final class LWChoicePeer extends LWComponentPeer<Choice, JComboBox<String>> ...@@ -171,7 +171,9 @@ final class LWChoicePeer extends LWComponentPeer<Choice, JComboBox<String>>
SwingUtilities.invokeLater(() -> { SwingUtilities.invokeLater(() -> {
JPopupMenu popupMenu = getPopupMenu(); JPopupMenu popupMenu = getPopupMenu();
// Need to override the invoker for proper grab handling // Need to override the invoker for proper grab handling
if (popupMenu != null && popupMenu.getInvoker() != getTarget()) { if (popupMenu != null
&& popupMenu.isShowing()
&& popupMenu.getInvoker() != getTarget()) {
// The popup is now visible with correct location // The popup is now visible with correct location
// Save it and restore after toggling visibility and changing invoker // Save it and restore after toggling visibility and changing invoker
Point loc = popupMenu.getLocationOnScreen(); Point loc = popupMenu.getLocationOnScreen();
......
...@@ -319,6 +319,8 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent> ...@@ -319,6 +319,8 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
* subclasses to initialize specific peers properties. * subclasses to initialize specific peers properties.
*/ */
void initializeImpl() { void initializeImpl() {
// note that these methods can be overridden by the user and
// can return some strange values like null.
setBackground(target.getBackground()); setBackground(target.getBackground());
setForeground(target.getForeground()); setForeground(target.getForeground());
setFont(target.getFont()); setFont(target.getFont());
......
...@@ -443,6 +443,12 @@ public class LWWindowPeer ...@@ -443,6 +443,12 @@ public class LWWindowPeer
getPlatformWindow().updateIconImages(); getPlatformWindow().updateIconImages();
} }
@Override
public void setBackground(final Color c) {
super.setBackground(c);
updateOpaque();
}
@Override @Override
public void setOpacity(float opacity) { public void setOpacity(float opacity) {
getPlatformWindow().setOpacity(opacity); getPlatformWindow().setOpacity(opacity);
......
...@@ -96,7 +96,8 @@ public class CEmbeddedFrame extends EmbeddedFrame { ...@@ -96,7 +96,8 @@ public class CEmbeddedFrame extends EmbeddedFrame {
public void handleKeyEvent(int eventType, int modifierFlags, String characters, public void handleKeyEvent(int eventType, int modifierFlags, String characters,
String charsIgnoringMods, boolean isRepeat, short keyCode, String charsIgnoringMods, boolean isRepeat, short keyCode,
boolean needsKeyTyped) { boolean needsKeyTyped) {
responder.handleKeyEvent(eventType, modifierFlags, charsIgnoringMods, keyCode, needsKeyTyped, isRepeat); responder.handleKeyEvent(eventType, modifierFlags, characters, charsIgnoringMods,
keyCode, needsKeyTyped, isRepeat);
} }
public void handleInputEvent(String text) { public void handleInputEvent(String text) {
......
...@@ -125,7 +125,7 @@ final class CPlatformResponder { ...@@ -125,7 +125,7 @@ final class CPlatformResponder {
/** /**
* Handles key events. * Handles key events.
*/ */
void handleKeyEvent(int eventType, int modifierFlags, String chars, void handleKeyEvent(int eventType, int modifierFlags, String chars, String charsIgnoringModifiers,
short keyCode, boolean needsKeyTyped, boolean needsKeyReleased) { short keyCode, boolean needsKeyTyped, boolean needsKeyReleased) {
boolean isFlagsChangedEvent = boolean isFlagsChangedEvent =
isNpapiCallback ? (eventType == CocoaConstants.NPCocoaEventFlagsChanged) : isNpapiCallback ? (eventType == CocoaConstants.NPCocoaEventFlagsChanged) :
...@@ -153,7 +153,10 @@ final class CPlatformResponder { ...@@ -153,7 +153,10 @@ final class CPlatformResponder {
testChar = chars.charAt(0); testChar = chars.charAt(0);
} }
int[] in = new int[] {testChar, isDeadChar ? 1 : 0, modifierFlags, keyCode}; char testCharIgnoringModifiers = charsIgnoringModifiers != null && charsIgnoringModifiers.length() > 0 ?
charsIgnoringModifiers.charAt(0) : KeyEvent.CHAR_UNDEFINED;
int[] in = new int[] {testCharIgnoringModifiers, isDeadChar ? 1 : 0, modifierFlags, keyCode};
int[] out = new int[3]; // [jkeyCode, jkeyLocation, deadChar] int[] out = new int[3]; // [jkeyCode, jkeyLocation, deadChar]
postsTyped = NSEvent.nsToJavaKeyInfo(in, out); postsTyped = NSEvent.nsToJavaKeyInfo(in, out);
......
...@@ -200,7 +200,7 @@ public class CPlatformView extends CFRetainedResource { ...@@ -200,7 +200,7 @@ public class CPlatformView extends CFRetainedResource {
} }
private void deliverKeyEvent(NSEvent event) { private void deliverKeyEvent(NSEvent event) {
responder.handleKeyEvent(event.getType(), event.getModifierFlags(), responder.handleKeyEvent(event.getType(), event.getModifierFlags(), event.getCharacters(),
event.getCharactersIgnoringModifiers(), event.getKeyCode(), true, false); event.getCharactersIgnoringModifiers(), event.getKeyCode(), true, false);
} }
......
...@@ -119,6 +119,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo ...@@ -119,6 +119,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
static final int NONACTIVATING = 1 << 24; static final int NONACTIVATING = 1 << 24;
static final int IS_DIALOG = 1 << 25; static final int IS_DIALOG = 1 << 25;
static final int IS_MODAL = 1 << 26; static final int IS_MODAL = 1 << 26;
static final int IS_POPUP = 1 << 27;
static final int _STYLE_PROP_BITMASK = DECORATED | TEXTURED | UNIFIED | UTILITY | HUD | SHEET | CLOSEABLE | MINIMIZABLE | RESIZABLE; static final int _STYLE_PROP_BITMASK = DECORATED | TEXTURED | UNIFIED | UTILITY | HUD | SHEET | CLOSEABLE | MINIMIZABLE | RESIZABLE;
...@@ -318,6 +319,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo ...@@ -318,6 +319,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
styleBits = SET(styleBits, TEXTURED, false); styleBits = SET(styleBits, TEXTURED, false);
// Popups in applets don't activate applet's process // Popups in applets don't activate applet's process
styleBits = SET(styleBits, NONACTIVATING, true); styleBits = SET(styleBits, NONACTIVATING, true);
styleBits = SET(styleBits, IS_POPUP, true);
} }
if (Window.Type.UTILITY.equals(target.getType())) { if (Window.Type.UTILITY.equals(target.getType())) {
...@@ -745,20 +747,22 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo ...@@ -745,20 +747,22 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
@Override @Override
public void setOpaque(boolean isOpaque) { public void setOpaque(boolean isOpaque) {
CWrapper.NSWindow.setOpaque(getNSWindowPtr(), isOpaque); CWrapper.NSWindow.setOpaque(getNSWindowPtr(), isOpaque);
boolean isTextured = (peer == null)? false : peer.isTextured(); boolean isTextured = (peer == null) ? false : peer.isTextured();
if (!isOpaque && !isTextured) { if (!isTextured) {
long clearColor = CWrapper.NSColor.clearColor(); if (!isOpaque) {
CWrapper.NSWindow.setBackgroundColor(getNSWindowPtr(), clearColor); CWrapper.NSWindow.setBackgroundColor(getNSWindowPtr(), 0);
} else if (peer != null) {
Color color = peer.getBackground();
if (color != null) {
int rgb = color.getRGB();
CWrapper.NSWindow.setBackgroundColor(getNSWindowPtr(), rgb);
}
}
} }
//This is a temporary workaround. Looks like after 7124236 will be fixed //This is a temporary workaround. Looks like after 7124236 will be fixed
//the correct place for invalidateShadow() is CGLayer.drawInCGLContext. //the correct place for invalidateShadow() is CGLayer.drawInCGLContext.
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(this::invalidateShadow);
@Override
public void run() {
invalidateShadow();
}
});
} }
@Override @Override
......
...@@ -61,7 +61,14 @@ final class CWrapper { ...@@ -61,7 +61,14 @@ final class CWrapper {
static native void setAlphaValue(long window, float alpha); static native void setAlphaValue(long window, float alpha);
static native void setOpaque(long window, boolean opaque); static native void setOpaque(long window, boolean opaque);
static native void setBackgroundColor(long window, long color);
/**
* Sets background color of the NSWindow.
*
* @param window the pointer of the NSWindow
* @param color the color in argb format
*/
static native void setBackgroundColor(long window, int color);
static native void miniaturize(long window); static native void miniaturize(long window);
static native void deminiaturize(long window); static native void deminiaturize(long window);
...@@ -82,8 +89,4 @@ final class CWrapper { ...@@ -82,8 +89,4 @@ final class CWrapper {
static native void setToolTip(long view, String msg); static native void setToolTip(long view, String msg);
} }
static final class NSColor {
static native long clearColor();
}
} }
...@@ -47,13 +47,15 @@ final class NSEvent { ...@@ -47,13 +47,15 @@ final class NSEvent {
// Key event information // Key event information
private short keyCode; private short keyCode;
private String characters;
private String charactersIgnoringModifiers; private String charactersIgnoringModifiers;
// Called from native // Called from native
NSEvent(int type, int modifierFlags, short keyCode, String charactersIgnoringModifiers) { NSEvent(int type, int modifierFlags, short keyCode, String characters, String charactersIgnoringModifiers) {
this.type = type; this.type = type;
this.modifierFlags = modifierFlags; this.modifierFlags = modifierFlags;
this.keyCode = keyCode; this.keyCode = keyCode;
this.characters = characters;
this.charactersIgnoringModifiers = charactersIgnoringModifiers; this.charactersIgnoringModifiers = charactersIgnoringModifiers;
} }
...@@ -121,12 +123,16 @@ final class NSEvent { ...@@ -121,12 +123,16 @@ final class NSEvent {
return charactersIgnoringModifiers; return charactersIgnoringModifiers;
} }
String getCharacters() {
return characters;
}
@Override @Override
public String toString() { public String toString() {
return "NSEvent[" + getType() + " ," + getModifierFlags() + " ," return "NSEvent[" + getType() + " ," + getModifierFlags() + " ,"
+ getClickCount() + " ," + getButtonNumber() + " ," + getX() + " ," + getClickCount() + " ," + getButtonNumber() + " ," + getX() + " ,"
+ getY() + " ," + getAbsX() + " ," + getAbsY()+ " ," + getKeyCode() + " ," + getY() + " ," + getAbsX() + " ," + getAbsY()+ " ," + getKeyCode() + " ,"
+ getCharactersIgnoringModifiers() + "]"; + getCharacters() + " ," + getCharactersIgnoringModifiers() + "]";
} }
/* /*
......
...@@ -367,7 +367,7 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -367,7 +367,7 @@ AWT_ASSERT_APPKIT_THREAD;
// TODO: need consitent way for doing that both with global as well as with local coordinates. // TODO: need consitent way for doing that both with global as well as with local coordinates.
// The reason to do it here is one more native method for getting screen dimension otherwise. // The reason to do it here is one more native method for getting screen dimension otherwise.
NSRect screenRect = [[NSScreen mainScreen] frame]; NSRect screenRect = [[[NSScreen screens] objectAtIndex:0] frame];
absP.y = screenRect.size.height - absP.y; absP.y = screenRect.size.height - absP.y;
jint clickCount; jint clickCount;
...@@ -441,17 +441,20 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -441,17 +441,20 @@ AWT_ASSERT_APPKIT_THREAD;
JNIEnv *env = [ThreadUtilities getJNIEnv]; JNIEnv *env = [ThreadUtilities getJNIEnv];
jstring characters = NULL; jstring characters = NULL;
jstring charactersIgnoringModifiers = NULL;
if ([event type] != NSFlagsChanged) { if ([event type] != NSFlagsChanged) {
characters = JNFNSToJavaString(env, [event characters]); characters = JNFNSToJavaString(env, [event characters]);
charactersIgnoringModifiers = JNFNSToJavaString(env, [event charactersIgnoringModifiers]);
} }
static JNF_CLASS_CACHE(jc_NSEvent, "sun/lwawt/macosx/NSEvent"); static JNF_CLASS_CACHE(jc_NSEvent, "sun/lwawt/macosx/NSEvent");
static JNF_CTOR_CACHE(jctor_NSEvent, jc_NSEvent, "(IISLjava/lang/String;)V"); static JNF_CTOR_CACHE(jctor_NSEvent, jc_NSEvent, "(IISLjava/lang/String;Ljava/lang/String;)V");
jobject jevent = JNFNewObject(env, jctor_NSEvent, jobject jevent = JNFNewObject(env, jctor_NSEvent,
[event type], [event type],
[event modifierFlags], [event modifierFlags],
[event keyCode], [event keyCode],
characters); characters,
charactersIgnoringModifiers);
static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView"); static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView");
static JNF_MEMBER_CACHE(jm_deliverKeyEvent, jc_PlatformView, static JNF_MEMBER_CACHE(jm_deliverKeyEvent, jc_PlatformView,
......
/* /*
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -252,6 +252,10 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -252,6 +252,10 @@ AWT_ASSERT_APPKIT_THREAD;
self.ownerWindow = owner; self.ownerWindow = owner;
[self setPropertiesForStyleBits:styleBits mask:MASK(_METHOD_PROP_BITMASK)]; [self setPropertiesForStyleBits:styleBits mask:MASK(_METHOD_PROP_BITMASK)];
if (IS(self.styleBits, IS_POPUP)) {
[self.nsWindow setCollectionBehavior:(1 << 8) /*NSWindowCollectionBehaviorFullScreenAuxiliary*/];
}
return self; return self;
} }
......
...@@ -337,12 +337,17 @@ JNF_COCOA_EXIT(env); ...@@ -337,12 +337,17 @@ JNF_COCOA_EXIT(env);
*/ */
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_setBackgroundColor Java_sun_lwawt_macosx_CWrapper_00024NSWindow_setBackgroundColor
(JNIEnv *env, jclass cls, jlong windowPtr, jlong colorPtr) (JNIEnv *env, jclass cls, jlong windowPtr, jint rgb)
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
NSColor *color = (NSColor *)jlong_to_ptr(colorPtr); CGFloat alpha = (((rgb >> 24) & 0xff) / 255.0);
CGFloat red = (((rgb >> 16) & 0xff) / 255.0);
CGFloat green = (((rgb >> 8) & 0xff) / 255.0);
CGFloat blue = (((rgb >> 0) & 0xff) / 255.0);
NSColor *color = [NSColor colorWithCalibratedRed:red green:green blue:blue
alpha:alpha];
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[window setBackgroundColor:color]; [window setBackgroundColor:color];
}]; }];
...@@ -575,26 +580,3 @@ JNF_COCOA_ENTER(env); ...@@ -575,26 +580,3 @@ JNF_COCOA_ENTER(env);
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
/*
* Class: sun_lwawt_macosx_CWrapper$NSColor
* Method: clearColor
* Signature: ()J
*/
JNIEXPORT jlong JNICALL
Java_sun_lwawt_macosx_CWrapper_00024NSColor_clearColor
(JNIEnv *env, jclass cls)
{
__block jlong clearColorPtr = 0L;
JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
clearColorPtr = ptr_to_jlong([NSColor clearColor]);
}];
JNF_COCOA_EXIT(env);
return clearColorPtr;
}
/* /*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -459,10 +459,10 @@ public final class Connection implements Runnable { ...@@ -459,10 +459,10 @@ public final class Connection implements Runnable {
// will be woken up before readTimeout only if reply is // will be woken up before readTimeout only if reply is
// available // available
ldr.wait(readTimeout); ldr.wait(readTimeout);
waited = true;
} else { } else {
ldr.wait(15 * 1000); // 15 second timeout ldr.wait(15 * 1000); // 15 second timeout
} }
waited = true;
} else { } else {
break; break;
} }
...@@ -474,7 +474,7 @@ public final class Connection implements Runnable { ...@@ -474,7 +474,7 @@ public final class Connection implements Runnable {
} }
if ((rber == null) && waited) { if ((rber == null) && waited) {
removeRequest(ldr); abandonRequest(ldr, null);
throw new NamingException("LDAP response read timed out, timeout used:" throw new NamingException("LDAP response read timed out, timeout used:"
+ readTimeout + "ms." ); + readTimeout + "ms." );
......
...@@ -482,7 +482,7 @@ class LambdaForm { ...@@ -482,7 +482,7 @@ class LambdaForm {
assert(m.getName().equals("interpret" + sig.substring(sig.indexOf('_')))); assert(m.getName().equals("interpret" + sig.substring(sig.indexOf('_'))));
LambdaForm form = new LambdaForm(sig); LambdaForm form = new LambdaForm(sig);
form.vmentry = m; form.vmentry = m;
mt.form().setCachedLambdaForm(MethodTypeForm.LF_COUNTER, form); form = mt.form().setCachedLambdaForm(MethodTypeForm.LF_COUNTER, form);
// FIXME: get rid of PREPARED_FORMS; use MethodTypeForm cache only // FIXME: get rid of PREPARED_FORMS; use MethodTypeForm cache only
forms.put(sig, form); forms.put(sig, form);
} }
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册