提交 d3f06249 编写于 作者: L lana

Merge

......@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
tzdata2014j
tzdata2015a
......@@ -70,8 +70,8 @@ Rule ChileAQ 2009 only - Mar Sun>=9 3:00u 0 -
Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 -
Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 -
Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S
Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 -
Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S
Rule ChileAQ 2012 2015 - Apr Sun>=23 3:00u 0 -
Rule ChileAQ 2012 2014 - Sep Sun>=2 4:00u 1:00 S
# Argentina - year-round bases
# Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
......@@ -379,7 +379,8 @@ Zone Antarctica/Rothera 0 - zzz 1976 Dec 1
Zone Antarctica/Palmer 0 - zzz 1965
-4:00 ArgAQ AR%sT 1969 Oct 5
-3:00 ArgAQ AR%sT 1982 May
-4:00 ChileAQ CL%sT
-4:00 ChileAQ CL%sT 2015 Apr 26 3:00u
-3:00 - CLT
#
#
# McMurdo Station, Ross Island, since 1955-12
......
......@@ -168,10 +168,7 @@ Zone Asia/Baku 3:19:24 - LMT 1924 May 2
4:00 Azer AZ%sT
# Bahrain
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah
4:00 - GST 1972 Jun
3:00 - AST
# See Asia/Qatar.
# Bangladesh
# From Alexander Krivenyshev (2009-05-13):
......@@ -1754,9 +1751,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1
###############################################################################
# Kuwait
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Kuwait 3:11:56 - LMT 1950
3:00 - AST
# See Asia/Riyadh.
# Laos
# See Asia/Bangkok.
......@@ -1977,12 +1972,7 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920
5:45 - NPT # Nepal Time
# Oman
# Milne says 3:54:24 was the meridian of the Muscat Tidal Observatory.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Muscat 3:54:24 - LMT 1920
4:00 - GST
# See Asia/Dubai.
# Pakistan
......@@ -2476,6 +2466,7 @@ Zone Asia/Manila -15:56:00 - LMT 1844 Dec 31
Zone Asia/Qatar 3:26:08 - LMT 1920 # Al Dawhah / Doha
4:00 - GST 1972 Jun
3:00 - AST
Link Asia/Qatar Asia/Bahrain
# Saudi Arabia
#
......@@ -2502,6 +2493,8 @@ Zone Asia/Qatar 3:26:08 - LMT 1920 # Al Dawhah / Doha
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Riyadh 3:06:52 - LMT 1947 Mar 14
3:00 - AST
Link Asia/Riyadh Asia/Aden # Yemen
Link Asia/Riyadh Asia/Kuwait
# Singapore
# taken from Mok Ly Yng (2003-10-30)
......@@ -2790,6 +2783,7 @@ Zone Asia/Ashgabat 3:53:32 - LMT 1924 May 2 # or Ashkhabad
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Dubai 3:41:12 - LMT 1920
4:00 - GST
Link Asia/Dubai Asia/Muscat # Oman
# Uzbekistan
# Byalokoz 1919 says Uzbekistan was 4:27:53.
......@@ -2874,10 +2868,4 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 Jul 1
7:00 - ICT
# Yemen
# Milne says 2:59:54 was the meridian of the saluting battery at Aden,
# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Aden 2:59:54 - LMT 1950
3:00 - AST
# See Asia/Riyadh.
......@@ -28,7 +28,7 @@
# and their old names. Many names changed in late 1993.
# Link TARGET LINK-NAME
Link Africa/Asmara Africa/Asmera
Link Africa/Nairobi Africa/Asmera
Link Africa/Abidjan Africa/Timbuktu
Link America/Argentina/Catamarca America/Argentina/ComodRivadavia
Link America/Adak America/Atka
......
......@@ -1430,35 +1430,32 @@ Zone Europe/Budapest 1:16:20 - LMT 1890 Oct
# might be a reference to the Julian calendar as opposed to Gregorian, or it
# might mean something else (???).
#
# From Paul Eggert (2006-03-22):
# The Iceland Almanak, Shanks & Pottenger, and Whitman disagree on many points.
# We go with the Almanak, except for one claim from Shanks & Pottenger, namely
# that Reykavik was 21W57 from 1837 to 1908, local mean time before that.
# From Paul Eggert (2014-11-22):
# The information below is taken from the 1988 Almanak; see
# http://www.almanak.hi.is/klukkan.html
#
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Iceland 1917 1918 - Feb 19 23:00 1:00 S
Rule Iceland 1917 1919 - Feb 19 23:00 1:00 S
Rule Iceland 1917 only - Oct 21 1:00 0 -
Rule Iceland 1918 only - Nov 16 1:00 0 -
Rule Iceland 1918 1919 - Nov 16 1:00 0 -
Rule Iceland 1921 only - Mar 19 23:00 1:00 S
Rule Iceland 1921 only - Jun 23 1:00 0 -
Rule Iceland 1939 only - Apr 29 23:00 1:00 S
Rule Iceland 1939 only - Nov 29 2:00 0 -
Rule Iceland 1939 only - Oct 29 2:00 0 -
Rule Iceland 1940 only - Feb 25 2:00 1:00 S
Rule Iceland 1940 only - Nov 3 2:00 0 -
Rule Iceland 1941 only - Mar 2 1:00s 1:00 S
Rule Iceland 1941 only - Nov 2 1:00s 0 -
Rule Iceland 1942 only - Mar 8 1:00s 1:00 S
Rule Iceland 1942 only - Oct 25 1:00s 0 -
Rule Iceland 1940 1941 - Nov Sun>=2 1:00s 0 -
Rule Iceland 1941 1942 - Mar Sun>=2 1:00s 1:00 S
# 1943-1946 - first Sunday in March until first Sunday in winter
Rule Iceland 1943 1946 - Mar Sun>=1 1:00s 1:00 S
Rule Iceland 1943 1948 - Oct Sun>=22 1:00s 0 -
Rule Iceland 1942 1948 - Oct Sun>=22 1:00s 0 -
# 1947-1967 - first Sunday in April until first Sunday in winter
Rule Iceland 1947 1967 - Apr Sun>=1 1:00s 1:00 S
# 1949 Oct transition delayed by 1 week
# 1949 and 1967 Oct transitions delayed by 1 week
Rule Iceland 1949 only - Oct 30 1:00s 0 -
Rule Iceland 1950 1966 - Oct Sun>=22 1:00s 0 -
Rule Iceland 1967 only - Oct 29 1:00s 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Atlantic/Reykjavik -1:27:24 - LMT 1837
-1:27:48 - RMT 1908 # Reykjavik Mean Time?
Zone Atlantic/Reykjavik -1:28 - LMT 1908
-1:00 Iceland IS%sT 1968 Apr 7 1:00s
0:00 - GMT
......
......@@ -77,3 +77,7 @@ Leap 1998 Dec 31 23:59:60 + S
Leap 2005 Dec 31 23:59:60 + S
Leap 2008 Dec 31 23:59:60 + S
Leap 2012 Jun 30 23:59:60 + S
Leap 2015 Jun 30 23:59:60 + S
# Updated through IERS Bulletin C49
# File expires on: 28 December 2015
......@@ -147,7 +147,7 @@ Rule US 1918 1919 - Mar lastSun 2:00 1:00 D
Rule US 1918 1919 - Oct lastSun 2:00 0 S
Rule US 1942 only - Feb 9 2:00 1:00 W # War
Rule US 1945 only - Aug 14 23:00u 1:00 P # Peace
Rule US 1945 only - Sep 30 2:00 0 S
Rule US 1945 only - Sep lastSun 2:00 0 S
Rule US 1967 2006 - Oct lastSun 2:00 0 S
Rule US 1967 1973 - Apr lastSun 2:00 1:00 D
Rule US 1974 only - Jan 6 2:00 1:00 D
......@@ -2147,11 +2147,11 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
# Mexico
# From Paul Eggert (2001-03-05):
# From Paul Eggert (2014-12-07):
# The Investigation and Analysis Service of the
# Mexican Library of Congress (MLoC) has published a
# history of Mexican local time (in Spanish)
# http://www.cddhcu.gob.mx/bibliot/publica/inveyana/polisoc/horver/
# http://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/index.htm
#
# Here are the discrepancies between Shanks & Pottenger (S&P) and the MLoC.
# (In all cases we go with the MLoC.)
......@@ -2320,6 +2320,24 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
# efecto desde las dos horas del segundo domingo de marzo y concluirá a
# las dos horas del primer domingo de noviembre.
# From Steffen Thorsen (2014-12-08), translated by Gwillim Law:
# The Mexican state of Quintana Roo will likely change to EST in 2015.
#
# http://www.unioncancun.mx/articulo/2014/12/04/medio-ambiente/congreso-aprueba-una-hora-mas-de-sol-en-qroo
# "With this change, the time conflict that has existed between the municipios
# of Quintana Roo and the municipio of Felipe Carrillo Puerto may come to an
# end. The latter declared itself in rebellion 15 years ago when a time change
# was initiated in Mexico, and since then it has refused to change its time
# zone along with the rest of the country."
#
# From Steffen Thorsen (2015-01-14), translated by Gwillim Law:
# http://sipse.com/novedades/confirman-aplicacion-de-nueva-zona-horaria-para-quintana-roo-132331.html
# "...the new time zone will come into effect at two o'clock on the first Sunday
# of February, when we will have to advance the clock one hour from its current
# time..."
#
# Also, the new zone will not use DST.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Mexico 1939 only - Feb 5 0:00 1:00 D
Rule Mexico 1939 only - Jun 25 0:00 0 S
......@@ -2340,7 +2358,8 @@ Rule Mexico 2002 max - Oct lastSun 2:00 0 S
Zone America/Cancun -5:47:04 - LMT 1922 Jan 1 0:12:56
-6:00 - CST 1981 Dec 23
-5:00 Mexico E%sT 1998 Aug 2 2:00
-6:00 Mexico C%sT
-6:00 Mexico C%sT 2015 Feb 1 2:00
-5:00 - EST
# Campeche, Yucatán; represented by Mérida
Zone America/Merida -5:58:28 - LMT 1922 Jan 1 0:01:32
-6:00 - CST 1981 Dec 23
......
......@@ -1229,6 +1229,11 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# DST Start: first Saturday of September 2014 (Sun 07 Sep 2014 04:00 UTC)
# http://www.diariooficial.interior.gob.cl//media/2014/02/19/do-20140219.pdf
# From Juan Correa (2015-01-28):
# ... today the Ministry of Energy announced that Chile will drop DST, will keep
# "summer time" (UTC -3 / UTC -5) all year round....
# http://www.minenergia.cl/ministerio/noticias/generales/ministerio-de-energia-anuncia.html
# NOTE: ChileAQ rules for Antarctic bases are stored separately in the
# 'antarctica' file.
......@@ -1270,8 +1275,8 @@ Rule Chile 2009 only - Mar Sun>=9 3:00u 0 -
Rule Chile 2010 only - Apr Sun>=1 3:00u 0 -
Rule Chile 2011 only - May Sun>=2 3:00u 0 -
Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S
Rule Chile 2012 max - Apr Sun>=23 3:00u 0 -
Rule Chile 2012 max - Sep Sun>=2 4:00u 1:00 S
Rule Chile 2012 2015 - Apr Sun>=23 3:00u 0 -
Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 S
# IATA SSIM anomalies: (1992-02) says 1992-03-14;
# (1996-09) says 1998-03-08. Ignore these.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
......@@ -1282,11 +1287,13 @@ Zone America/Santiago -4:42:46 - LMT 1890
-4:00 - CLT 1919 Jul 1 # Chile Time
-4:42:46 - SMT 1927 Sep 1 # Santiago Mean Time
-5:00 Chile CL%sT 1947 May 22 # Chile Time
-4:00 Chile CL%sT
-4:00 Chile CL%sT 2015 Apr 26 3:00u
-3:00 - CLT
Zone Pacific/Easter -7:17:44 - LMT 1890
-7:17:28 - EMT 1932 Sep # Easter Mean Time
-7:00 Chile EAS%sT 1982 Mar 13 21:00 # Easter Time
-6:00 Chile EAS%sT
-7:00 Chile EAS%sT 1982 Mar 13 3:00u # Easter Time
-6:00 Chile EAS%sT 2015 Apr 26 3:00u
-5:00 - EAST
#
# Salas y Gómez Island is uninhabited.
# Other Chilean locations, including Juan Fernández Is, Desventuradas Is,
......
......@@ -297,7 +297,7 @@ MU -2010+05730 Indian/Mauritius
MV +0410+07330 Indian/Maldives
MW -1547+03500 Africa/Blantyre
MX +1924-09909 America/Mexico_City Central Time - most locations
MX +2105-08646 America/Cancun Central Time - Quintana Roo
MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo
MX +2058-08937 America/Merida Central Time - Campeche, Yucatan
MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas away from US border
MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas near US border
......
......@@ -825,8 +825,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \
LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
LDFLAGS_SUFFIX_solaris := -lawt -lawt_xawt -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
LDFLAGS_SUFFIX_aix := -lawt -lawt_xawt $(LIBM) $(LIBCXX) -ljava -ljvm,\
LDFLAGS_SUFFIX_solaris := -lawt -lawt_headless -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
LDFLAGS_SUFFIX_aix := -lawt -lawt_headless $(LIBM) $(LIBCXX) -ljava -ljvm,\
LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \
-ljava -ljvm, \
LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
......
......@@ -43,7 +43,7 @@ class AixNativeDispatcher extends UnixNativeDispatcher {
static native UnixMountEntry[] getmntctl() throws UnixException;
// initialize
private static native int init();
private static native void init();
static {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
......
......@@ -56,23 +56,26 @@ static void throwUnixException(JNIEnv* env, int errnum) {
/**
* Initialization
*/
JNIEXPORT jint JNICALL
JNIEXPORT void JNICALL
Java_sun_nio_fs_AixNativeDispatcher_init(JNIEnv* env, jclass this)
{
jint flags = 0;
jclass clazz;
clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
if (clazz == NULL) {
return 0;
}
CHECK_NULL(clazz);
entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
CHECK_NULL(entry_name);
entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
CHECK_NULL(entry_dir);
entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
CHECK_NULL(entry_fstype);
entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
CHECK_NULL(entry_options);
entry_cls = (*env)->NewGlobalRef(env, clazz);
return 0;
if (entry_cls == NULL) {
JNU_ThrowOutOfMemoryError(env, NULL);
return;
}
}
/**
......
此差异已折叠。
'\" t
.\" Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
.\"
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
......@@ -21,14 +21,17 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" Title: jcmd
.\" Language: English
.\" Date: 03 March 2015
.\" SectDesc: Troubleshooting Tools
.\" Title: jcmd.1
.\" Software: JDK 8
.\" Arch: generic
.\" Part Number: E38207-04
.\" Doc ID: JSSON
.\"
.if n .pl 99999
.TH jcmd 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
.TH "jcmd" "1" "03 March 2015" "JDK 8" "Troubleshooting Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
......@@ -48,65 +51,159 @@
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
.SH "NAME"
jcmd \- Sends diagnostic command requests to a running Java Virtual Machine (JVM)\&.
.SH SYNOPSIS
.SH "SYNOPSIS"
.sp
.if n \{\
.RS 4
.\}
.nf
\fBjcmd\fR [\fB\-l\fR|\fB\-h\fR|\fB\-help\fR]
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
\fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fBPerfCounter\&.print\fR
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
\fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fB\-f\fR \fIfilename\fR
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
\fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fIcommand\fR[ \fIarguments\fR]
.fi
.if n \{\
.RE
.\}
.SH "DESCRIPTION"
.PP
The
\fBjcmd\fR
utility is used to send diagnostic command requests to the JVM\&. It must be used on the same machine on which the JVM is running, and have the same effective user and group identifiers that were used to launch the JVM\&.
.if n \{\
.sp
.SH DESCRIPTION
The \f3jcmd\fR utility is used to send diagnostic command requests to the JVM\&. It must be used on the same machine on which the JVM is running, and have the same effective user and group identifiers that were used to launch the JVM\&.
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
.TS
allbox tab(:);
l.
T{
.PP
To invoke diagnostic commands from a remote machine or with different identifiers, you can use the
\fBcom\&.sun\&.management\&.DiagnosticCommandMBean\fR
interface\&. For more information about the
\fBDiagnosticCommandMBean\fR
interface, see the API documentation at http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/DiagnosticCommandMBean\&.html
T}
.TE
.sp 1
.sp .5v
.RE
.PP
\fINote:\fR To invoke diagnostic commands from a remote machine or with different identiers, you can use the \f3com\&.sun\&.management\&.DiagnosticCommandMBean\fR interface\&. For more information about the \f3DiagnosticCommandMBean\fR interface, see the API documentation at http://download\&.java\&.net/jdk8/docs/jre/api/management/extension/com/sun/management/DiagnosticCommandMBean\&.html
If you run
\fBjcmd\fR
without arguments or with the
\fB\-l\fR
option, it prints the list of running Java process identifiers with the main class and command\-line arguments that were used to launch the process\&. Running
\fBjcmd\fR
with the
\fB\-h\fR
or
\fB\-help\fR
option prints the tool\(cqs help message\&.
.PP
If you run \f3jcmd\fR without arguments or with the \f3-l\fR option, it prints the list of running Java process identifiers with the main class and command-line arguments that were used to launch the process\&. Running \f3jcmd\fR with the \f3-h\fR or \f3-help\fR option prints the tool\(cqs help message\&.
If you specify the processes identifier (\fIpid\fR) or the main class (\fImain\-class\fR) as the first argument,
\fBjcmd\fR
sends the diagnostic command request to the Java process with the specified identifier or to all Java processes with the specified name of the main class\&. You can also send the diagnostic command request to all available Java processes by specifying
\fB0\fR
as the process identifier\&. Use one of the following as the diagnostic command request:
.PP
If you specify the processes identifier (\fIpid\fR) or the main class (\fImain-class\fR) as the first argument, \f3jcmd\fR sends the diagnostic command request to the Java process with the specified identifier or to all Java processes with the specified name of the main class\&. You can also send the diagnostic command request to all available Java processes by specifying \f30\fR as the process identifier\&. Use one of the following as the diagnostic command request:
.TP
Perfcounter\&.print
.RS 4
Prints the performance counters available for the specified Java process\&. The list of performance counters might vary with the Java process\&.
.TP
-f \fIfilename\fR
.br
The name of the file from which to read diagnostic commands and send them to the specified Java process\&. Used only with the \f3-f\fR option\&. Each command in the file must be written on a single line\&. Lines starting with a number sign (\f3#\fR) are ignored\&. Processing of the file ends when all lines have been read or when a line containing the \f3stop\fR keyword is read\&.
.TP
.RE
.PP
\-f \fIfilename\fR
.RS 4
The name of the file from which to read diagnostic commands and send them to the specified Java process\&. Used only with the
\fB\-f\fR
option\&. Each command in the file must be written on a single line\&. Lines starting with a number sign (\fB#\fR) are ignored\&. Processing of the file ends when all lines have been read or when a line containing the
\fBstop\fR
keyword is read\&.
.RE
.PP
\fIcommand\fR [\fIarguments\fR]
The command to be sent to the specified Java process\&. The list of available diagnostic commands for a given process can be obtained by sending the \f3help\fR command to this process\&. Each diagnostic command has its own set of arguments\&. To see the description, syntax, and a list of available arguments for a command, use the name of the command as the argument for the \f3help\fR command\&.
\fINote:\fR If any arguments contain spaces, you must surround them with single or double quotation marks (\f3\&'\fR or \f3"\fR)\&. In addition, you must escape single or double quotation marks with a backslash (\f3\e\fR) to prevent the operating system shell from processing quotation marks\&. Alternatively, you can surround these arguments with single quotation marks and then with double quotation marks (or with double quotation marks and then with single quotation marks)\&.
.SH OPTIONS
.RS 4
The command to be sent to the specified Java process\&. The list of available diagnostic commands for a given process can be obtained by sending the
\fBhelp\fR
command to this process\&. Each diagnostic command has its own set of arguments\&. To see the description, syntax, and a list of available arguments for a command, use the name of the command as the argument for the
\fBhelp\fR
command\&.
.sp
\fBNote:\fR
If any arguments contain spaces, you must surround them with single or double quotation marks (\fB\*(Aq\fR
or
\fB"\fR)\&. In addition, you must escape single or double quotation marks with a backslash (\fB\e\fR) to prevent the operating system shell from processing quotation marks\&. Alternatively, you can surround these arguments with single quotation marks and then with double quotation marks (or with double quotation marks and then with single quotation marks)\&.
.RE
.SH "OPTIONS"
.PP
Options are mutually exclusive\&.
.TP
-f \fIfilename\fR
.br
Reads commands from the specified file\&. This option can be used only if you specify the process identifier or the main class as the first argument\&. Each command in the file must be written on a single line\&. Lines starting with a number sign (\f3#\fR) are ignored\&. Processing of the file ends when all lines have been read or when a line containing the \f3stop\fR keyword is read\&.
.TP
-h, -help
.PP
\-f \fIfilename\fR
.RS 4
Reads commands from the specified file\&. This option can be used only if you specify the process identifier or the main class as the first argument\&. Each command in the file must be written on a single line\&. Lines starting with a number sign (\fB#\fR) are ignored\&. Processing of the file ends when all lines have been read or when a line containing the
\fBstop\fR
keyword is read\&.
.RE
.PP
\-h
.br
\-help
.RS 4
Prints a help message\&.
.TP
-l
.br
Prints the list of running Java processes identifiers with the main class and command-line arguments\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
.RE
.PP
\-l
.RS 4
Prints the list of running Java processes identifiers with the main class and command\-line arguments\&.
.RE
.SH "SEE ALSO"
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
jps(1)
.RE
.br
......
......@@ -21,14 +21,17 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Title: jjs
.\" Language: English
.\" Date: 03 March 2015
.\" SectDesc: Basic Tools
.\" Title: jjs.1
.\" Software: JDK 8
.\" Arch: generic
.\" Part Number: E38207-04
.\" Doc ID: JSSON
.\"
.if n .pl 99999
.TH jjs 1 "03 March 2015" "JDK 8" "Basic Tools"
.TH "jjs" "1" "03 March 2015" "JDK 8" "Basic Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
......@@ -48,310 +51,198 @@
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
.SH "NAME"
jjs \- Invokes the Nashorn engine\&.
.SH SYNOPSIS
.SH "SYNOPSIS"
.sp
.if n \{\
.RS 4
.\}
.nf
\f3\fBjjs\fR [\fIoptions\fR] [\fIscript\-files\fR] [\-\- \fIarguments\fR]\fP
\fB\fBjjs\fR\fR\fB [\fR\fB\fIoptions\fR\fR\fB] [\fR\fB\fIscript\-files\fR\fR\fB] [\-\- \fR\fB\fIarguments\fR\fR\fB]\fR
.fi
.sp
.TP
.if n \{\
.RE
.\}
.PP
\fIoptions\fR
One or more options of the \f3jjs\fR command, separated by spaces\&. For more information, see Options\&.
.TP
\fIscript-files\fR
.RS 4
One or more options of the
\fBjjs\fR
command, separated by spaces\&. For more information, see Options\&.
.RE
.PP
\fIscript\-files\fR
.RS 4
One or more script files which you want to interpret using Nashorn, separated by spaces\&. If no files are specified, an interactive shell is started\&.
.TP
.RE
.PP
\fIarguments\fR
All values after the double hyphen marker (\f3--\fR) are passed through to the script or the interactive shell as arguments\&. These values can be accessed by using the \f3arguments\fR property (see )\&.
.SH DESCRIPTION
The \f3jjs\fR command-line tool is used to invoke the Nashorn engine\&. You can use it to interpret one or several script files, or to run an interactive shell\&.
.SH OPTIONS
The options of the \f3jjs\fR command control the conditions under which scripts are interpreted by Nashorn\&.
.TP
-ccs=\fIsize\fR , --class-cache-size=\fIsize\fR
.br
Sets the class cache size (in bytes)\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes (KB), \f3m\fR or \f3M\fR to indicate megabytes (MB), \f3g\fR or \f3G\fR to indicate gigabytes (GB)\&. By default, the class cache size is set to 50 bytes\&. The following example shows how to set it to 1024 bytes (1 KB):
.sp
.nf
\f3\-css=100\fP
.fi
.nf
\f3\-css=1k\fP
.fi
.nf
\f3\fP
.fi
.sp
.TP
-co, --compile-only
.br
Compiles the script without running it\&.
.TP
-cp \fIpath\fR , -classpath \fIpath\fR
.br
.RS 4
All values after the double hyphen marker (\fB\-\-\fR) are passed through to the script or the interactive shell as arguments\&. These values can be accessed by using the
\fBarguments\fR
property (see Example 3)\&.
.RE
.SH "DESCRIPTION"
.PP
The
\fBjjs\fR
command\-line tool is used to invoke the Nashorn engine\&. You can use it to interpret one or several script files, or to run an interactive shell\&.
.SH "OPTIONS"
.PP
The options of the
\fBjjs\fR
command control the conditions under which scripts are interpreted by Nashorn\&.
.PP
\-cp \fIpath\fR
.br
\-classpath \fIpath\fR
.RS 4
Specifies the path to the supporting class files To set multiple paths, the option can be repeated, or you can separate each path with a colon (:)\&.
.TP
-D\fIname\fR=\fIvalue\fR
.br
Sets a system property to be passed to the script by assigning a value to a property name\&. The following example shows how to invoke Nashorn in interactive mode and assign \f3myValue\fR to the property named \f3myKey\fR:
.sp
.nf
\f3>> \fIjjs \-DmyKey=myValue\fR\fP
.fi
.nf
\f3jjs> \fIjava\&.lang\&.System\&.getProperty("myKey")\fR\fP
.fi
.nf
\f3myValue\fP
.fi
.nf
\f3jjs>\fP
.fi
.nf
\f3\fP
.fi
.sp
.RE
.PP
\-D\fIname\fR=\fIvalue\fR
.RS 4
Sets a system property to be passed to the script by assigning a value to a property name\&. The following example shows how to invoke Nashorn in interactive mode and assign
\fBmyValue\fR
to the property named
\fBmyKey\fR:
.sp
.if n \{\
.RS 4
.\}
.nf
\fB>> \fR\fB\fBjjs \-DmyKey=myValue\fR\fR
\fBjjs> \fR\fB\fBjava\&.lang\&.System\&.getProperty("myKey")\fR\fR
\fBmyValue\fR
\fBjjs>\fR
.fi
.if n \{\
.RE
.\}
This option can be repeated to set multiple properties\&.
.TP
-d=\fIpath\fR , --dump-debug-dir=\fIpath\fR
.br
Specifies the path to the directory where class files are dumped\&.
.TP
--debug-lines
.br
Generates a line number table in the class file\&. By default, this option is enabled\&. To disable it, specify \f3--debug-lines=false\fR\&.
.TP
--debug-locals
.br
Generates a local variable table in the class file\&.
.TP
-doe, --dump-on-error
.RE
.PP
\-doe
.br
\-\-dump\-on\-error
.RS 4
Provides a full stack trace when an error occurs\&. By default, only a brief error message is printed\&.
.TP
--early-lvalue-error
.br
Reports invalid lvalue expressions as early errors (that is, when the code is parsed)\&. By default, this option is enabled\&. To disable it, specify \f3--early-lvalue-error=false\fR\&. When disabled, invalid lvalue expressions will not be reported until the code is executed\&.
.TP
--empty-statements
.br
Preserves empty statements in the Java abstract syntax tree\&.
.TP
-fv, --fullversion
.RE
.PP
\-fv
.br
\-\-fullversion
.RS 4
Prints the full Nashorn version string\&.
.TP
--function-statement-error
.br
Prints an error message when a function declaration is used as a statement\&.
.TP
--function-statement-warning
.br
Prints a warning message when a function declaration is used as a statement\&.
.TP
-fx
.br
.RE
.PP
\-fx
.RS 4
Launches the script as a JavaFX application\&.
.TP
-h, -help
.RE
.PP
\-h
.br
\-help
.RS 4
Prints the list of options and their descriptions\&.
.TP
-J\fIoption\fR
.br
Passes the specified \f3java\fR launcher option to the JVM\&. The following example shows how to invoke Nashorn in interactive mode and set the maximum memory used by the JVM to 4 GB:
.sp
.nf
\f3>> \fIjjs \-J\-Xmx4g\fR\fP
.fi
.nf
\f3jjs> \fIjava\&.lang\&.Runtime\&.getRuntime()\&.maxMemory()\fR\fP
.fi
.nf
\f33817799680\fP
.fi
.nf
\f3jjs>\fP
.fi
.nf
\f3\fP
.fi
.sp
This option can be repeated to pass multiple \f3java\fR command options\&.
.TP
--language=[es5]
.br
.RE
.PP
\-\-language=[es5]
.RS 4
Specifies the ECMAScript language version\&. The default version is ES5\&.
.TP
--lazy-compilation
.br
Enables lazy code generation strategies (that is, the entire script is not compiled at once)\&. This option is experimental\&.
.TP
--loader-per-compile
.br
Creates a new class loader per compile\&. By default, this option is enabled\&. To disable it, specify \f3--loader-per-compile=false\fR\&.
.TP
--log=\fIsubsystem\fR:\fIlevel\fR
.br
Performs logging at a given level for the specified subsystems\&. You can specify logging levels for multiple subsystems separating them with commas\&. For example:
.sp
.nf
\f3\-\-log=fields:finest,codegen:info\fP
.fi
.sp
.TP
--optimistic-types=[true|false]
.RE
.PP
\-ot
.br
\-\-optimistic\-types=[true|false]
.RS 4
Enables or disables optimistic type assumptions with deoptimizing recompilation\&. Running with optimistic types will yield higher final speed, but may increase warmup time\&.
.TP
--package=\fIname\fR
.br
Specifies the package to which generated class files are added\&.
.TP
--parse-only
.br
Parses the code without compiling\&.
.TP
--print-ast
.br
Prints the abstract syntax tree\&.
.TP
--print-code
.br
Prints bytecode\&.
.TP
--print-lower-ast
.br
Prints the lowered abstract syntax tree\&.
.TP
--print-lower-parse
.br
Prints the lowered parse tree\&.
.TP
--print-no-newline
.br
Forces other \f3--print*\fR options to print the output on one line\&.
.TP
--print-parse
.br
Prints the parse tree\&.
.TP
--print-symbols
.br
Prints the symbol table\&.
.TP
-pcs, --profile-callsites
.br
Dumps callsite profile data\&.
.TP
-scripting
.br
.RE
.PP
\-scripting
.RS 4
Enables shell scripting features\&.
.TP
--stderr=\fIfilename\fR|\fIstream\fR|\fItty\fR
.br
Redirects the standard error stream to the specified file, stream (for example, to \f3stdout\fR), or text terminal\&.
.TP
--stdout=\fIfilename\fR|\fIstream\fR|\fItty\fR
.br
Redirects the standard output stream to the specified file, stream (for example, to \f3stderr\fR), or text terminal\&.
.TP
-strict
.br
.RE
.PP
\-strict
.RS 4
Enables strict mode, which enforces stronger adherence to the standard (ECMAScript Edition 5\&.1), making it easier to detect common coding errors\&.
.TP
-t=\fIzone\fR , -timezone=\fIzone\fR
.br
Sets the specified time zone for script execution\&. It overrides the time zone set in the OS and used by the \f3Date\fR object\&.
.TP
-tcs=\fIparameter\fR , --trace-callsites=\fIparameter\fR
.br
Enables callsite trace mode\&. Possible parameters are the following:
.RS
.TP
miss
Trace callsite misses\&.
.TP
enterexit
Trace callsite enter/exit\&.
.TP
objects
Print object properties\&.
.RE
.TP
--verify-code
.br
Verifies bytecode before running\&.
.TP
-v, -version
.PP
\-t=\fIzone\fR
.br
\-timezone=\fIzone\fR
.RS 4
Sets the specified time zone for script execution\&. It overrides the time zone set in the OS and used by the
\fBDate\fR
object\&.
.RE
.PP
\-v
.br
\-version
.RS 4
Prints the Nashorn version string\&.
.TP
-xhelp
.br
Prints extended help for command-line options\&.
.SH EXAMPLES
\f3Example 1 Running a Script with Nashorn\fR
.sp
.nf
\f3jjs script\&.js\fP
.fi
.nf
\f3\fP
.fi
.sp
\f3Example 2 Running Nashorn in Interactive Mode\fR
.sp
.nf
\f3>> \fIjjs\fR\fP
.fi
.nf
\f3jjs> \fIprintln("Hello, World!")\fR\fP
.fi
.nf
\f3Hello, World!\fP
.fi
.nf
\f3jjs> \fIquit()\fR\fP
.fi
.nf
\f3>>\fP
.fi
.nf
\f3\fP
.fi
.sp
\f3Example 3 Passing Arguments to Nashorn\fR
.RE
.SH "EXAMPLES"
.PP
\fBExample 1 \fRRunning a Script with Nashorn
.RS 4
.sp
.if n \{\
.RS 4
.\}
.nf
\f3>> \fIjjs \-\- a b c\fR\fP
.fi
.nf
\f3jjs> \fIarguments\&.join(", ")\fR\fP
.fi
.nf
\f3a, b, c\fP
\fBjjs script\&.js\fR
.fi
.nf
\f3jjs>\fP
.if n \{\
.RE
.\}
.RE
.PP
\fBExample 2 \fRRunning Nashorn in Interactive Mode
.RS 4
.sp
.if n \{\
.RS 4
.\}
.nf
\fB>> \fR\fB\fBjjs\fR\fR
\fBjjs> \fR\fB\fBprintln("Hello, World!")\fR\fR
\fBHello, World!\fR
\fBjjs> \fR\fB\fBquit()\fR\fR
\fB>>\fR
.fi
.nf
\f3\fP
.if n \{\
.RE
.\}
.RE
.PP
\fBExample 3 \fRPassing Arguments to Nashorn
.RS 4
.sp
.if n \{\
.RS 4
.\}
.nf
\fB>> \fR\fB\fBjjs \-\- a b c\fR\fR
\fBjjs> \fR\fB\fBarguments\&.join(", ")\fR\fR
\fBa, b, c\fR
\fBjjs>\fR
.fi
.sp
.SH SEE\ ALSO
\f3jrunscript\fR
.if n \{\
.RE
.\}
.RE
.SH "SEE ALSO"
.PP
\fBjrunscript\fR
.br
'pl 8.5i
'bp
此差异已折叠。
此差异已折叠。
'\" t
.\" Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
.\"
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
......@@ -21,14 +21,17 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" Title: jcmd
.\" Language: English
.\" Date: 03 March 2015
.\" SectDesc: Troubleshooting Tools
.\" Title: jcmd.1
.\" Software: JDK 8
.\" Arch: generic
.\" Part Number: E38207-04
.\" Doc ID: JSSON
.\"
.if n .pl 99999
.TH jcmd 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
.TH "jcmd" "1" "03 March 2015" "JDK 8" "Troubleshooting Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
......@@ -48,65 +51,159 @@
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
.SH "NAME"
jcmd \- Sends diagnostic command requests to a running Java Virtual Machine (JVM)\&.
.SH SYNOPSIS
.SH "SYNOPSIS"
.sp
.if n \{\
.RS 4
.\}
.nf
\fBjcmd\fR [\fB\-l\fR|\fB\-h\fR|\fB\-help\fR]
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
\fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fBPerfCounter\&.print\fR
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
\fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fB\-f\fR \fIfilename\fR
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
\fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fIcommand\fR[ \fIarguments\fR]
.fi
.if n \{\
.RE
.\}
.SH "DESCRIPTION"
.PP
The
\fBjcmd\fR
utility is used to send diagnostic command requests to the JVM\&. It must be used on the same machine on which the JVM is running, and have the same effective user and group identifiers that were used to launch the JVM\&.
.if n \{\
.sp
.SH DESCRIPTION
The \f3jcmd\fR utility is used to send diagnostic command requests to the JVM\&. It must be used on the same machine on which the JVM is running, and have the same effective user and group identifiers that were used to launch the JVM\&.
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
.TS
allbox tab(:);
l.
T{
.PP
To invoke diagnostic commands from a remote machine or with different identifiers, you can use the
\fBcom\&.sun\&.management\&.DiagnosticCommandMBean\fR
interface\&. For more information about the
\fBDiagnosticCommandMBean\fR
interface, see the API documentation at http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/DiagnosticCommandMBean\&.html
T}
.TE
.sp 1
.sp .5v
.RE
.PP
\fINote:\fR To invoke diagnostic commands from a remote machine or with different identiers, you can use the \f3com\&.sun\&.management\&.DiagnosticCommandMBean\fR interface\&. For more information about the \f3DiagnosticCommandMBean\fR interface, see the API documentation at http://download\&.java\&.net/jdk8/docs/jre/api/management/extension/com/sun/management/DiagnosticCommandMBean\&.html
If you run
\fBjcmd\fR
without arguments or with the
\fB\-l\fR
option, it prints the list of running Java process identifiers with the main class and command\-line arguments that were used to launch the process\&. Running
\fBjcmd\fR
with the
\fB\-h\fR
or
\fB\-help\fR
option prints the tool\(cqs help message\&.
.PP
If you run \f3jcmd\fR without arguments or with the \f3-l\fR option, it prints the list of running Java process identifiers with the main class and command-line arguments that were used to launch the process\&. Running \f3jcmd\fR with the \f3-h\fR or \f3-help\fR option prints the tool\(cqs help message\&.
If you specify the processes identifier (\fIpid\fR) or the main class (\fImain\-class\fR) as the first argument,
\fBjcmd\fR
sends the diagnostic command request to the Java process with the specified identifier or to all Java processes with the specified name of the main class\&. You can also send the diagnostic command request to all available Java processes by specifying
\fB0\fR
as the process identifier\&. Use one of the following as the diagnostic command request:
.PP
If you specify the processes identifier (\fIpid\fR) or the main class (\fImain-class\fR) as the first argument, \f3jcmd\fR sends the diagnostic command request to the Java process with the specified identifier or to all Java processes with the specified name of the main class\&. You can also send the diagnostic command request to all available Java processes by specifying \f30\fR as the process identifier\&. Use one of the following as the diagnostic command request:
.TP
Perfcounter\&.print
.RS 4
Prints the performance counters available for the specified Java process\&. The list of performance counters might vary with the Java process\&.
.TP
-f \fIfilename\fR
.br
The name of the file from which to read diagnostic commands and send them to the specified Java process\&. Used only with the \f3-f\fR option\&. Each command in the file must be written on a single line\&. Lines starting with a number sign (\f3#\fR) are ignored\&. Processing of the file ends when all lines have been read or when a line containing the \f3stop\fR keyword is read\&.
.TP
.RE
.PP
\-f \fIfilename\fR
.RS 4
The name of the file from which to read diagnostic commands and send them to the specified Java process\&. Used only with the
\fB\-f\fR
option\&. Each command in the file must be written on a single line\&. Lines starting with a number sign (\fB#\fR) are ignored\&. Processing of the file ends when all lines have been read or when a line containing the
\fBstop\fR
keyword is read\&.
.RE
.PP
\fIcommand\fR [\fIarguments\fR]
The command to be sent to the specified Java process\&. The list of available diagnostic commands for a given process can be obtained by sending the \f3help\fR command to this process\&. Each diagnostic command has its own set of arguments\&. To see the description, syntax, and a list of available arguments for a command, use the name of the command as the argument for the \f3help\fR command\&.
\fINote:\fR If any arguments contain spaces, you must surround them with single or double quotation marks (\f3\&'\fR or \f3"\fR)\&. In addition, you must escape single or double quotation marks with a backslash (\f3\e\fR) to prevent the operating system shell from processing quotation marks\&. Alternatively, you can surround these arguments with single quotation marks and then with double quotation marks (or with double quotation marks and then with single quotation marks)\&.
.SH OPTIONS
.RS 4
The command to be sent to the specified Java process\&. The list of available diagnostic commands for a given process can be obtained by sending the
\fBhelp\fR
command to this process\&. Each diagnostic command has its own set of arguments\&. To see the description, syntax, and a list of available arguments for a command, use the name of the command as the argument for the
\fBhelp\fR
command\&.
.sp
\fBNote:\fR
If any arguments contain spaces, you must surround them with single or double quotation marks (\fB\*(Aq\fR
or
\fB"\fR)\&. In addition, you must escape single or double quotation marks with a backslash (\fB\e\fR) to prevent the operating system shell from processing quotation marks\&. Alternatively, you can surround these arguments with single quotation marks and then with double quotation marks (or with double quotation marks and then with single quotation marks)\&.
.RE
.SH "OPTIONS"
.PP
Options are mutually exclusive\&.
.TP
-f \fIfilename\fR
.br
Reads commands from the specified file\&. This option can be used only if you specify the process identifier or the main class as the first argument\&. Each command in the file must be written on a single line\&. Lines starting with a number sign (\f3#\fR) are ignored\&. Processing of the file ends when all lines have been read or when a line containing the \f3stop\fR keyword is read\&.
.TP
-h, -help
.PP
\-f \fIfilename\fR
.RS 4
Reads commands from the specified file\&. This option can be used only if you specify the process identifier or the main class as the first argument\&. Each command in the file must be written on a single line\&. Lines starting with a number sign (\fB#\fR) are ignored\&. Processing of the file ends when all lines have been read or when a line containing the
\fBstop\fR
keyword is read\&.
.RE
.PP
\-h
.br
\-help
.RS 4
Prints a help message\&.
.TP
-l
.br
Prints the list of running Java processes identifiers with the main class and command-line arguments\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
.RE
.PP
\-l
.RS 4
Prints the list of running Java processes identifiers with the main class and command\-line arguments\&.
.RE
.SH "SEE ALSO"
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
jps(1)
.RE
.br
......
......@@ -21,14 +21,17 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Title: jjs
.\" Language: English
.\" Date: 03 March 2015
.\" SectDesc: Basic Tools
.\" Title: jjs.1
.\" Software: JDK 8
.\" Arch: generic
.\" Part Number: E38207-04
.\" Doc ID: JSSON
.\"
.if n .pl 99999
.TH jjs 1 "03 March 2015" "JDK 8" "Basic Tools"
.TH "jjs" "1" "03 March 2015" "JDK 8" "Basic Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
......@@ -48,310 +51,198 @@
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
.SH "NAME"
jjs \- Invokes the Nashorn engine\&.
.SH SYNOPSIS
.SH "SYNOPSIS"
.sp
.if n \{\
.RS 4
.\}
.nf
\f3\fBjjs\fR [\fIoptions\fR] [\fIscript\-files\fR] [\-\- \fIarguments\fR]\fP
\fB\fBjjs\fR\fR\fB [\fR\fB\fIoptions\fR\fR\fB] [\fR\fB\fIscript\-files\fR\fR\fB] [\-\- \fR\fB\fIarguments\fR\fR\fB]\fR
.fi
.sp
.TP
.if n \{\
.RE
.\}
.PP
\fIoptions\fR
One or more options of the \f3jjs\fR command, separated by spaces\&. For more information, see Options\&.
.TP
\fIscript-files\fR
.RS 4
One or more options of the
\fBjjs\fR
command, separated by spaces\&. For more information, see Options\&.
.RE
.PP
\fIscript\-files\fR
.RS 4
One or more script files which you want to interpret using Nashorn, separated by spaces\&. If no files are specified, an interactive shell is started\&.
.TP
.RE
.PP
\fIarguments\fR
All values after the double hyphen marker (\f3--\fR) are passed through to the script or the interactive shell as arguments\&. These values can be accessed by using the \f3arguments\fR property (see )\&.
.SH DESCRIPTION
The \f3jjs\fR command-line tool is used to invoke the Nashorn engine\&. You can use it to interpret one or several script files, or to run an interactive shell\&.
.SH OPTIONS
The options of the \f3jjs\fR command control the conditions under which scripts are interpreted by Nashorn\&.
.TP
-ccs=\fIsize\fR , --class-cache-size=\fIsize\fR
.br
Sets the class cache size (in bytes)\&. Append the letter \f3k\fR or \f3K\fR to indicate kilobytes (KB), \f3m\fR or \f3M\fR to indicate megabytes (MB), \f3g\fR or \f3G\fR to indicate gigabytes (GB)\&. By default, the class cache size is set to 50 bytes\&. The following example shows how to set it to 1024 bytes (1 KB):
.sp
.nf
\f3\-css=100\fP
.fi
.nf
\f3\-css=1k\fP
.fi
.nf
\f3\fP
.fi
.sp
.TP
-co, --compile-only
.br
Compiles the script without running it\&.
.TP
-cp \fIpath\fR , -classpath \fIpath\fR
.br
.RS 4
All values after the double hyphen marker (\fB\-\-\fR) are passed through to the script or the interactive shell as arguments\&. These values can be accessed by using the
\fBarguments\fR
property (see Example 3)\&.
.RE
.SH "DESCRIPTION"
.PP
The
\fBjjs\fR
command\-line tool is used to invoke the Nashorn engine\&. You can use it to interpret one or several script files, or to run an interactive shell\&.
.SH "OPTIONS"
.PP
The options of the
\fBjjs\fR
command control the conditions under which scripts are interpreted by Nashorn\&.
.PP
\-cp \fIpath\fR
.br
\-classpath \fIpath\fR
.RS 4
Specifies the path to the supporting class files To set multiple paths, the option can be repeated, or you can separate each path with a colon (:)\&.
.TP
-D\fIname\fR=\fIvalue\fR
.br
Sets a system property to be passed to the script by assigning a value to a property name\&. The following example shows how to invoke Nashorn in interactive mode and assign \f3myValue\fR to the property named \f3myKey\fR:
.sp
.nf
\f3>> \fIjjs \-DmyKey=myValue\fR\fP
.fi
.nf
\f3jjs> \fIjava\&.lang\&.System\&.getProperty("myKey")\fR\fP
.fi
.nf
\f3myValue\fP
.fi
.nf
\f3jjs>\fP
.fi
.nf
\f3\fP
.fi
.sp
.RE
.PP
\-D\fIname\fR=\fIvalue\fR
.RS 4
Sets a system property to be passed to the script by assigning a value to a property name\&. The following example shows how to invoke Nashorn in interactive mode and assign
\fBmyValue\fR
to the property named
\fBmyKey\fR:
.sp
.if n \{\
.RS 4
.\}
.nf
\fB>> \fR\fB\fBjjs \-DmyKey=myValue\fR\fR
\fBjjs> \fR\fB\fBjava\&.lang\&.System\&.getProperty("myKey")\fR\fR
\fBmyValue\fR
\fBjjs>\fR
.fi
.if n \{\
.RE
.\}
This option can be repeated to set multiple properties\&.
.TP
-d=\fIpath\fR , --dump-debug-dir=\fIpath\fR
.br
Specifies the path to the directory where class files are dumped\&.
.TP
--debug-lines
.br
Generates a line number table in the class file\&. By default, this option is enabled\&. To disable it, specify \f3--debug-lines=false\fR\&.
.TP
--debug-locals
.br
Generates a local variable table in the class file\&.
.TP
-doe, --dump-on-error
.RE
.PP
\-doe
.br
\-\-dump\-on\-error
.RS 4
Provides a full stack trace when an error occurs\&. By default, only a brief error message is printed\&.
.TP
--early-lvalue-error
.br
Reports invalid lvalue expressions as early errors (that is, when the code is parsed)\&. By default, this option is enabled\&. To disable it, specify \f3--early-lvalue-error=false\fR\&. When disabled, invalid lvalue expressions will not be reported until the code is executed\&.
.TP
--empty-statements
.br
Preserves empty statements in the Java abstract syntax tree\&.
.TP
-fv, --fullversion
.RE
.PP
\-fv
.br
\-\-fullversion
.RS 4
Prints the full Nashorn version string\&.
.TP
--function-statement-error
.br
Prints an error message when a function declaration is used as a statement\&.
.TP
--function-statement-warning
.br
Prints a warning message when a function declaration is used as a statement\&.
.TP
-fx
.br
.RE
.PP
\-fx
.RS 4
Launches the script as a JavaFX application\&.
.TP
-h, -help
.RE
.PP
\-h
.br
\-help
.RS 4
Prints the list of options and their descriptions\&.
.TP
-J\fIoption\fR
.br
Passes the specified \f3java\fR launcher option to the JVM\&. The following example shows how to invoke Nashorn in interactive mode and set the maximum memory used by the JVM to 4 GB:
.sp
.nf
\f3>> \fIjjs \-J\-Xmx4g\fR\fP
.fi
.nf
\f3jjs> \fIjava\&.lang\&.Runtime\&.getRuntime()\&.maxMemory()\fR\fP
.fi
.nf
\f33817799680\fP
.fi
.nf
\f3jjs>\fP
.fi
.nf
\f3\fP
.fi
.sp
This option can be repeated to pass multiple \f3java\fR command options\&.
.TP
--language=[es5]
.br
.RE
.PP
\-\-language=[es5]
.RS 4
Specifies the ECMAScript language version\&. The default version is ES5\&.
.TP
--lazy-compilation
.br
Enables lazy code generation strategies (that is, the entire script is not compiled at once)\&. This option is experimental\&.
.TP
--loader-per-compile
.br
Creates a new class loader per compile\&. By default, this option is enabled\&. To disable it, specify \f3--loader-per-compile=false\fR\&.
.TP
--log=\fIsubsystem\fR:\fIlevel\fR
.br
Performs logging at a given level for the specified subsystems\&. You can specify logging levels for multiple subsystems separating them with commas\&. For example:
.sp
.nf
\f3\-\-log=fields:finest,codegen:info\fP
.fi
.sp
.TP
--optimistic-types=[true|false]
.RE
.PP
\-ot
.br
\-\-optimistic\-types=[true|false]
.RS 4
Enables or disables optimistic type assumptions with deoptimizing recompilation\&. Running with optimistic types will yield higher final speed, but may increase warmup time\&.
.TP
--package=\fIname\fR
.br
Specifies the package to which generated class files are added\&.
.TP
--parse-only
.br
Parses the code without compiling\&.
.TP
--print-ast
.br
Prints the abstract syntax tree\&.
.TP
--print-code
.br
Prints bytecode\&.
.TP
--print-lower-ast
.br
Prints the lowered abstract syntax tree\&.
.TP
--print-lower-parse
.br
Prints the lowered parse tree\&.
.TP
--print-no-newline
.br
Forces other \f3--print*\fR options to print the output on one line\&.
.TP
--print-parse
.br
Prints the parse tree\&.
.TP
--print-symbols
.br
Prints the symbol table\&.
.TP
-pcs, --profile-callsites
.br
Dumps callsite profile data\&.
.TP
-scripting
.br
.RE
.PP
\-scripting
.RS 4
Enables shell scripting features\&.
.TP
--stderr=\fIfilename\fR|\fIstream\fR|\fItty\fR
.br
Redirects the standard error stream to the specified file, stream (for example, to \f3stdout\fR), or text terminal\&.
.TP
--stdout=\fIfilename\fR|\fIstream\fR|\fItty\fR
.br
Redirects the standard output stream to the specified file, stream (for example, to \f3stderr\fR), or text terminal\&.
.TP
-strict
.br
.RE
.PP
\-strict
.RS 4
Enables strict mode, which enforces stronger adherence to the standard (ECMAScript Edition 5\&.1), making it easier to detect common coding errors\&.
.TP
-t=\fIzone\fR , -timezone=\fIzone\fR
.br
Sets the specified time zone for script execution\&. It overrides the time zone set in the OS and used by the \f3Date\fR object\&.
.TP
-tcs=\fIparameter\fR , --trace-callsites=\fIparameter\fR
.br
Enables callsite trace mode\&. Possible parameters are the following:
.RS
.TP
miss
Trace callsite misses\&.
.TP
enterexit
Trace callsite enter/exit\&.
.TP
objects
Print object properties\&.
.RE
.TP
--verify-code
.br
Verifies bytecode before running\&.
.TP
-v, -version
.PP
\-t=\fIzone\fR
.br
\-timezone=\fIzone\fR
.RS 4
Sets the specified time zone for script execution\&. It overrides the time zone set in the OS and used by the
\fBDate\fR
object\&.
.RE
.PP
\-v
.br
\-version
.RS 4
Prints the Nashorn version string\&.
.TP
-xhelp
.br
Prints extended help for command-line options\&.
.SH EXAMPLES
\f3Example 1 Running a Script with Nashorn\fR
.sp
.nf
\f3jjs script\&.js\fP
.fi
.nf
\f3\fP
.fi
.sp
\f3Example 2 Running Nashorn in Interactive Mode\fR
.sp
.nf
\f3>> \fIjjs\fR\fP
.fi
.nf
\f3jjs> \fIprintln("Hello, World!")\fR\fP
.fi
.nf
\f3Hello, World!\fP
.fi
.nf
\f3jjs> \fIquit()\fR\fP
.fi
.nf
\f3>>\fP
.fi
.nf
\f3\fP
.fi
.sp
\f3Example 3 Passing Arguments to Nashorn\fR
.RE
.SH "EXAMPLES"
.PP
\fBExample 1 \fRRunning a Script with Nashorn
.RS 4
.sp
.if n \{\
.RS 4
.\}
.nf
\f3>> \fIjjs \-\- a b c\fR\fP
.fi
.nf
\f3jjs> \fIarguments\&.join(", ")\fR\fP
.fi
.nf
\f3a, b, c\fP
\fBjjs script\&.js\fR
.fi
.nf
\f3jjs>\fP
.if n \{\
.RE
.\}
.RE
.PP
\fBExample 2 \fRRunning Nashorn in Interactive Mode
.RS 4
.sp
.if n \{\
.RS 4
.\}
.nf
\fB>> \fR\fB\fBjjs\fR\fR
\fBjjs> \fR\fB\fBprintln("Hello, World!")\fR\fR
\fBHello, World!\fR
\fBjjs> \fR\fB\fBquit()\fR\fR
\fB>>\fR
.fi
.nf
\f3\fP
.if n \{\
.RE
.\}
.RE
.PP
\fBExample 3 \fRPassing Arguments to Nashorn
.RS 4
.sp
.if n \{\
.RS 4
.\}
.nf
\fB>> \fR\fB\fBjjs \-\- a b c\fR\fR
\fBjjs> \fR\fB\fBarguments\&.join(", ")\fR\fR
\fBa, b, c\fR
\fBjjs>\fR
.fi
.sp
.SH SEE\ ALSO
\f3jrunscript\fR
.if n \{\
.RE
.\}
.RE
.SH "SEE ALSO"
.PP
\fBjrunscript\fR
.br
'pl 8.5i
'bp
此差异已折叠。
......@@ -30,6 +30,7 @@
#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import <JavaRuntimeSupport/JavaRuntimeSupport.h>
#import "jni_util.h"
#import "NSApplicationAWT.h"
#import "PropertiesUtilities.h"
#import "ThreadUtilities.h"
......@@ -436,8 +437,11 @@ JNF_COCOA_ENTER(env);
}
JNIEnv* env = [ThreadUtilities getJNIEnvUncached];
jclass jc_ThreadGroupUtils = (*env)->FindClass(env, "sun/misc/ThreadGroupUtils");
CHECK_NULL_RETURN(jc_ThreadGroupUtils, JNI_VERSION_1_4);
jmethodID sjm_getRootThreadGroup = (*env)->GetStaticMethodID(env, jc_ThreadGroupUtils, "getRootThreadGroup", "()Ljava/lang/ThreadGroup;");
CHECK_NULL_RETURN(sjm_getRootThreadGroup, JNI_VERSION_1_4);
jobject rootThreadGroup = (*env)->CallStaticObjectMethod(env, jc_ThreadGroupUtils, sjm_getRootThreadGroup);
CHECK_NULL_RETURN(rootThreadGroup, JNI_VERSION_1_4);
[ThreadUtilities setAppkitThreadGroup:(*env)->NewGlobalRef(env, rootThreadGroup)];
// The current thread was attached in getJNIEnvUnchached.
// Detach it back. It will be reattached later if needed with a proper TG
......
......@@ -182,7 +182,14 @@ public class EventQueue {
private FwDispatcher fwDispatcher;
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.EventQueue");
private static volatile PlatformLogger eventLog;
private static final PlatformLogger getEventLog() {
if(eventLog == null) {
eventLog = PlatformLogger.getLogger("java.awt.event.EventQueue");
}
return eventLog;
}
static {
AWTAccessor.setEventQueueAccessor(
......@@ -759,8 +766,8 @@ public class EventQueue {
dispatchThread.stopDispatching();
}
} else {
if (eventLog.isLoggable(PlatformLogger.Level.FINE)) {
eventLog.fine("Unable to dispatch event: " + event);
if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
getEventLog().fine("Unable to dispatch event: " + event);
}
}
}
......@@ -857,8 +864,8 @@ public class EventQueue {
* @since 1.2
*/
public void push(EventQueue newEventQueue) {
if (eventLog.isLoggable(PlatformLogger.Level.FINE)) {
eventLog.fine("EventQueue.push(" + newEventQueue + ")");
if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
getEventLog().fine("EventQueue.push(" + newEventQueue + ")");
}
pushPopLock.lock();
......@@ -883,8 +890,8 @@ public class EventQueue {
// Use getNextEventPrivate() as it doesn't call flushPendingEvents()
newEventQueue.postEventPrivate(topQueue.getNextEventPrivate());
} catch (InterruptedException ie) {
if (eventLog.isLoggable(PlatformLogger.Level.FINE)) {
eventLog.fine("Interrupted push", ie);
if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
getEventLog().fine("Interrupted push", ie);
}
}
}
......@@ -922,8 +929,8 @@ public class EventQueue {
* @since 1.2
*/
protected void pop() throws EmptyStackException {
if (eventLog.isLoggable(PlatformLogger.Level.FINE)) {
eventLog.fine("EventQueue.pop(" + this + ")");
if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
getEventLog().fine("EventQueue.pop(" + this + ")");
}
pushPopLock.lock();
......@@ -945,8 +952,8 @@ public class EventQueue {
try {
prevQueue.postEventPrivate(topQueue.getNextEventPrivate());
} catch (InterruptedException ie) {
if (eventLog.isLoggable(PlatformLogger.Level.FINE)) {
eventLog.fine("Interrupted pop", ie);
if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
getEventLog().fine("Interrupted pop", ie);
}
}
}
......
......@@ -453,7 +453,7 @@ public class Object {
"nanosecond timeout value out of range");
}
if (nanos >= 500000 || (nanos != 0 && timeout == 0)) {
if (nanos > 0) {
timeout++;
}
......
......@@ -135,7 +135,7 @@ public final class String
* unnecessary since Strings are immutable.
*/
public String() {
this.value = new char[0];
this.value = "".value;
}
/**
......@@ -191,9 +191,15 @@ public final class String
if (offset < 0) {
throw new StringIndexOutOfBoundsException(offset);
}
if (count <= 0) {
if (count < 0) {
throw new StringIndexOutOfBoundsException(count);
}
if (offset <= value.length) {
this.value = "".value;
return;
}
}
// Note: offset or count might be near -1>>>1.
if (offset > value.length - count) {
throw new StringIndexOutOfBoundsException(offset + count);
......@@ -233,9 +239,15 @@ public final class String
if (offset < 0) {
throw new StringIndexOutOfBoundsException(offset);
}
if (count <= 0) {
if (count < 0) {
throw new StringIndexOutOfBoundsException(count);
}
if (offset <= codePoints.length) {
this.value = "".value;
return;
}
}
// Note: offset or count might be near -1>>>1.
if (offset > codePoints.length - count) {
throw new StringIndexOutOfBoundsException(offset + count);
......@@ -782,7 +794,7 @@ public final class String
* subarray of {@code dst} starting at index {@code dstBegin}
* and ending at index:
* <blockquote><pre>
* dstbegin + (srcEnd-srcBegin) - 1
* dstBegin + (srcEnd-srcBegin) - 1
* </pre></blockquote>
*
* @param srcBegin index of the first character in the string
......@@ -827,7 +839,7 @@ public final class String
* dst} starting at index {@code dstBegin} and ending at index:
*
* <blockquote><pre>
* dstbegin + (srcEnd-srcBegin) - 1
* dstBegin + (srcEnd-srcBegin) - 1
* </pre></blockquote>
*
* @deprecated This method does not properly convert characters into
......
......@@ -846,12 +846,14 @@ public final class Unsafe {
throws InstantiationException;
/** Lock the object. It must get unlocked via {@link #monitorExit}. */
@Deprecated
public native void monitorEnter(Object o);
/**
* Unlock the object. It must have been locked via {@link
* #monitorEnter}.
*/
@Deprecated
public native void monitorExit(Object o);
/**
......@@ -859,6 +861,7 @@ public final class Unsafe {
* whether the lock succeeded. If it did, the object must be
* unlocked via {@link #monitorExit}.
*/
@Deprecated
public native boolean tryMonitorEnter(Object o);
/** Throw the exception without telling the verifier. */
......
......@@ -192,22 +192,6 @@ final class HttpsClient extends HttpClient
return userAgent;
}
// should remove once HttpClient.newHttpProxy is putback
private static Proxy newHttpProxy(String proxyHost, int proxyPort) {
InetSocketAddress saddr = null;
final String phost = proxyHost;
final int pport = proxyPort < 0 ? httpsPortNumber : proxyPort;
try {
saddr = java.security.AccessController.doPrivileged(new
java.security.PrivilegedExceptionAction<InetSocketAddress>() {
public InetSocketAddress run() {
return new InetSocketAddress(phost, pport);
}});
} catch (java.security.PrivilegedActionException pae) {
}
return new Proxy(Proxy.Type.HTTP, saddr);
}
// CONSTRUCTOR, FACTORY
......@@ -251,7 +235,7 @@ final class HttpsClient extends HttpClient
throws IOException {
this(sf, url,
(proxyHost == null? null:
HttpsClient.newHttpProxy(proxyHost, proxyPort)),
HttpClient.newHttpProxy(proxyHost, proxyPort, "https")),
connectTimeout);
}
......@@ -261,6 +245,11 @@ final class HttpsClient extends HttpClient
HttpsClient(SSLSocketFactory sf, URL url, Proxy proxy,
int connectTimeout)
throws IOException {
PlatformLogger logger = HttpURLConnection.getHttpLogger();
if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
logger.finest("Creating new HttpsClient with url:" + url + " and proxy:" + proxy +
" with connect timeout:" + connectTimeout);
}
this.proxy = proxy;
setSSLSocketFactory(sf);
this.proxyDisabled = true;
......@@ -317,7 +306,7 @@ final class HttpsClient extends HttpClient
return HttpsClient.New(sf, url, hv,
(proxyHost == null? null :
HttpsClient.newHttpProxy(proxyHost, proxyPort)),
HttpClient.newHttpProxy(proxyHost, proxyPort, "https")),
useCache, connectTimeout, httpuc);
}
......@@ -329,6 +318,11 @@ final class HttpsClient extends HttpClient
if (p == null) {
p = Proxy.NO_PROXY;
}
PlatformLogger logger = HttpURLConnection.getHttpLogger();
if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
logger.finest("Looking for HttpClient for URL " + url +
" and proxy value of " + p);
}
HttpsClient ret = null;
if (useCache) {
/* see if one's already around */
......@@ -342,14 +336,13 @@ final class HttpsClient extends HttpClient
if (ret != null) {
if ((ret.proxy != null && ret.proxy.equals(p)) ||
(ret.proxy == null && p == null)) {
(ret.proxy == null && p == Proxy.NO_PROXY)) {
synchronized (ret) {
ret.cachedHttpClient = true;
assert ret.inCache;
ret.inCache = false;
if (httpuc != null && ret.needsTunneling())
httpuc.setTunnelState(TUNNELING);
PlatformLogger logger = HttpURLConnection.getHttpLogger();
if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
logger.finest("KeepAlive stream retrieved from the cache, " + ret);
}
......@@ -360,6 +353,9 @@ final class HttpsClient extends HttpClient
// This should be fine as it is very rare that a connection
// to the same host will not use the same proxy.
synchronized(ret) {
if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
logger.finest("Not returning this connection to cache: " + ret);
}
ret.inCache = false;
ret.closeServer();
}
......
......@@ -763,9 +763,9 @@ public class Config {
private static String trimmed(String s) {
s = s.trim();
if (s.isEmpty()) return s;
if (s.charAt(0) == '"' && s.charAt(s.length()-1) == '"' ||
s.charAt(0) == '\'' && s.charAt(s.length()-1) == '\'') {
if (s.length() >= 2 &&
((s.charAt(0) == '"' && s.charAt(s.length()-1) == '"') ||
(s.charAt(0) == '\'' && s.charAt(s.length()-1) == '\''))) {
s = s.substring(1, s.length()-1).trim();
}
return s;
......
......@@ -60,22 +60,12 @@ public class KrbApReq {
private static boolean DEBUG = Krb5.DEBUG;
private static final char[] hexConst = "0123456789ABCDEF".toCharArray();
private static final MessageDigest md;
static {
try {
md = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException ex) {
throw new RuntimeException("Impossible");
}
}
/**
* Constructs an AP-REQ message to send to the peer.
* @param tgsCred the <code>Credentials</code> to be used to construct the
* AP Request protocol message.
* @param mutualRequired Whether mutual authentication is required
* @param useSubkey Whether the subkey is to be used to protect this
* @param useSubKey Whether the subkey is to be used to protect this
* specific application session. If this is not set then the
* session key from the ticket will be used.
* @throws KrbException for any Kerberos protocol specific error
......@@ -99,10 +89,10 @@ public class KrbApReq {
* @param tgsCred the <code>Credentials</code> to be used to construct the
* AP Request protocol message.
* @param mutualRequired Whether mutual authentication is required
* @param useSubkey Whether the subkey is to be used to protect this
* @param useSubKey Whether the subkey is to be used to protect this
* specific application session. If this is not set then the
* session key from the ticket will be used.
* @param checksum checksum of the the application data that accompanies
* @param cksum checksum of the the application data that accompanies
* the KRB_AP_REQ.
* @throws KrbException for any Kerberos protocol specific error
* @throws IOException for any IO related errors
......@@ -142,8 +132,8 @@ public class KrbApReq {
* Constructs an AP-REQ message from the bytes received from the
* peer.
* @param message The message received from the peer
* @param keys <code>EncrtyptionKey</code>s to decrypt the message;
* key selected will depend on etype used to encrypte data
* @param cred <code>KrbAcceptCredential</code> containing keys to decrypt
* the message; key selected will depend on etype used to encrypt data
* @throws KrbException for any Kerberos protocol specific error
* @throws IOException for any IO related errors
* (e.g. socket operations)
......@@ -311,7 +301,14 @@ public class KrbApReq {
if (!authenticator.ctime.inClockSkew())
throw new KrbApErrException(Krb5.KRB_AP_ERR_SKEW);
byte[] hash = md.digest(apReqMessg.authenticator.cipher);
byte[] hash;
try {
hash = MessageDigest.getInstance("MD5")
.digest(apReqMessg.authenticator.cipher);
} catch (NoSuchAlgorithmException ex) {
throw new AssertionError("Impossible");
}
char[] h = new char[hash.length * 2];
for (int i=0; i<hash.length; i++) {
h[2*i] = hexConst[(hash[i]&0xff)>>4];
......
......@@ -26,6 +26,8 @@
package sun.security.util;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.*;
import java.security.Principal;
......@@ -148,6 +150,17 @@ public class HostnameChecker {
String ipAddress = (String)next.get(1);
if (expectedIP.equalsIgnoreCase(ipAddress)) {
return;
} else {
// compare InetAddress objects in order to ensure
// equality between a long IPv6 address and its
// abbreviated form.
try {
if (InetAddress.getByName(expectedIP).equals(
InetAddress.getByName(ipAddress))) {
return;
}
} catch (UnknownHostException e) {
} catch (SecurityException e) {}
}
}
}
......
/*
* Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2015, 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
......@@ -408,7 +408,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
{"America/Buenos_Aires", AGT},
{"America/Cambridge_Bay", MST},
{"America/Campo_Grande", AMT},
{"America/Cancun", CST},
{"America/Cancun", EST},
{"America/Caracas", new String[] {"Venezuela Time", "VET",
"Venezuela Summer Time", "VEST",
"Venezuela Time", "VET"}},
......
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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
......@@ -409,7 +409,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
{"America/Buenos_Aires", AGT},
{"America/Cambridge_Bay", MST},
{"America/Campo_Grande", AMT},
{"America/Cancun", CST},
{"America/Cancun", EST},
{"America/Caracas", new String[] {"Venezuelanische Zeit", "VET",
"Venezuelanische Sommerzeit", "VEST",
"Venezuelanische Zeit", "VET"}},
......
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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
......@@ -409,7 +409,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
{"America/Buenos_Aires", AGT},
{"America/Cambridge_Bay", MST},
{"America/Campo_Grande", AMT},
{"America/Cancun", CST},
{"America/Cancun", EST},
{"America/Caracas", new String[] {"Hora de Venezuela", "VET",
"Hora de verano de Venezuela", "VEST",
"Hora de Venezuela", "VET"}},
......
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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
......@@ -409,7 +409,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
{"America/Buenos_Aires", AGT},
{"America/Cambridge_Bay", MST},
{"America/Campo_Grande", AMT},
{"America/Cancun", CST},
{"America/Cancun", EST},
{"America/Caracas", new String[] {"Heure du Venezuela", "VET",
"Heure d'\u00e9t\u00e9 du Venezuela", "VEST",
"Heure du Venezuela", "VET"}},
......
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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
......@@ -409,7 +409,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
{"America/Buenos_Aires", AGT},
{"America/Cambridge_Bay", MST},
{"America/Campo_Grande", AMT},
{"America/Cancun", CST},
{"America/Cancun", EST},
{"America/Caracas", new String[] {"Ora del Venezuela", "VET",
"Ora estiva del Venezuela", "VEST",
"Ora del Venezuela", "VET"}},
......
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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
......@@ -409,7 +409,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
{"America/Buenos_Aires", AGT},
{"America/Cambridge_Bay", MST},
{"America/Campo_Grande", AMT},
{"America/Cancun", CST},
{"America/Cancun", EST},
{"America/Caracas", new String[] {"\u30d9\u30cd\u30ba\u30a8\u30e9\u6642\u9593", "VET",
"\u30d9\u30cd\u30ba\u30a8\u30e9\u590f\u6642\u9593", "VEST",
"\u30D9\u30CD\u30BA\u30A8\u30E9\u6642\u9593", "VET"}},
......
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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
......@@ -409,7 +409,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
{"America/Buenos_Aires", AGT},
{"America/Cambridge_Bay", MST},
{"America/Campo_Grande", AMT},
{"America/Cancun", CST},
{"America/Cancun", EST},
{"America/Caracas", new String[] {"\ubca0\ub124\uc218\uc5d8\ub77c \uc2dc\uac04", "VET",
"\ubca0\ub124\uc218\uc5d8\ub77c \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "VEST",
"\uBCA0\uB124\uC218\uC5D8\uB77C \uD45C\uC900\uC2DC", "VET"}},
......
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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
......@@ -409,7 +409,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
{"America/Buenos_Aires", AGT},
{"America/Cambridge_Bay", MST},
{"America/Campo_Grande", AMT},
{"America/Cancun", CST},
{"America/Cancun", EST},
{"America/Caracas", new String[] {"Fuso hor\u00e1rio da Venezuela", "VET",
"Fuso hor\u00e1rio de ver\u00e3o da Venezuela", "VEST",
"Hor\u00E1rio da Venezuela", "VET"}},
......
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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
......@@ -409,7 +409,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
{"America/Buenos_Aires", AGT},
{"America/Cambridge_Bay", MST},
{"America/Campo_Grande", AMT},
{"America/Cancun", CST},
{"America/Cancun", EST},
{"America/Caracas", new String[] {"Venezuela, normaltid", "VET",
"Venezuela, sommartid", "VEST",
"Venezuelansk tid", "VET"}},
......
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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
......@@ -409,7 +409,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
{"America/Buenos_Aires", AGT},
{"America/Cambridge_Bay", MST},
{"America/Campo_Grande", AMT},
{"America/Cancun", CST},
{"America/Cancun", EST},
{"America/Caracas", new String[] {"\u59d4\u5185\u745e\u62c9\u65f6\u95f4", "VET",
"\u59d4\u5185\u745e\u62c9\u590f\u4ee4\u65f6", "VEST",
"\u59D4\u5185\u745E\u62C9\u65F6\u95F4", "VET"}},
......
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2015, 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
......@@ -409,7 +409,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
{"America/Buenos_Aires", AGT},
{"America/Cambridge_Bay", MST},
{"America/Campo_Grande", AMT},
{"America/Cancun", CST},
{"America/Cancun", EST},
{"America/Caracas", new String[] {"\u59d4\u5167\u745e\u62c9\u6642\u9593", "VET",
"\u59d4\u5167\u745e\u62c9\u590f\u4ee4\u6642\u9593", "VEST",
"\u59D4\u5167\u745E\u62C9\u6642\u9593", "VET"}},
......
......@@ -405,14 +405,17 @@ final class UNIXProcess extends Process {
if (hasExited) return true;
if (timeout <= 0) return false;
long timeoutAsNanos = unit.toNanos(timeout);
long startTime = System.nanoTime();
long rem = timeoutAsNanos;
long remainingNanos = unit.toNanos(timeout);
long deadline = System.nanoTime() + remainingNanos;
while (!hasExited && (rem > 0)) {
wait(Math.max(TimeUnit.NANOSECONDS.toMillis(rem), 1));
rem = timeoutAsNanos - (System.nanoTime() - startTime);
do {
// Round up to next millisecond
wait(TimeUnit.NANOSECONDS.toMillis(remainingNanos + 999_999L));
if (hasExited) {
return true;
}
remainingNanos = deadline - System.nanoTime();
} while (remainingNanos > 0);
return hasExited;
}
......
此差异已折叠。
'\" t
.\" Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
.\" Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
.\"
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
.\"
......@@ -21,14 +21,17 @@
.\" or visit www.oracle.com if you need additional information or have any
.\" questions.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 21 November 2013
.\" Title: jcmd
.\" Language: English
.\" Date: 03 March 2015
.\" SectDesc: Troubleshooting Tools
.\" Title: jcmd.1
.\" Software: JDK 8
.\" Arch: generic
.\" Part Number: E38207-04
.\" Doc ID: JSSON
.\"
.if n .pl 99999
.TH jcmd 1 "21 November 2013" "JDK 8" "Troubleshooting Tools"
.TH "jcmd" "1" "03 March 2015" "JDK 8" "Troubleshooting Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
......@@ -48,65 +51,159 @@
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
.SH "NAME"
jcmd \- Sends diagnostic command requests to a running Java Virtual Machine (JVM)\&.
.SH SYNOPSIS
.SH "SYNOPSIS"
.sp
.if n \{\
.RS 4
.\}
.nf
\fBjcmd\fR [\fB\-l\fR|\fB\-h\fR|\fB\-help\fR]
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
\fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fBPerfCounter\&.print\fR
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
\fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fB\-f\fR \fIfilename\fR
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
\fBjcmd\fR \fIpid\fR|\fImain\-class\fR \fIcommand\fR[ \fIarguments\fR]
.fi
.if n \{\
.RE
.\}
.SH "DESCRIPTION"
.PP
The
\fBjcmd\fR
utility is used to send diagnostic command requests to the JVM\&. It must be used on the same machine on which the JVM is running, and have the same effective user and group identifiers that were used to launch the JVM\&.
.if n \{\
.sp
.SH DESCRIPTION
The \f3jcmd\fR utility is used to send diagnostic command requests to the JVM\&. It must be used on the same machine on which the JVM is running, and have the same effective user and group identifiers that were used to launch the JVM\&.
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
.TS
allbox tab(:);
l.
T{
.PP
To invoke diagnostic commands from a remote machine or with different identifiers, you can use the
\fBcom\&.sun\&.management\&.DiagnosticCommandMBean\fR
interface\&. For more information about the
\fBDiagnosticCommandMBean\fR
interface, see the API documentation at http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/DiagnosticCommandMBean\&.html
T}
.TE
.sp 1
.sp .5v
.RE
.PP
\fINote:\fR To invoke diagnostic commands from a remote machine or with different identiers, you can use the \f3com\&.sun\&.management\&.DiagnosticCommandMBean\fR interface\&. For more information about the \f3DiagnosticCommandMBean\fR interface, see the API documentation at http://download\&.java\&.net/jdk8/docs/jre/api/management/extension/com/sun/management/DiagnosticCommandMBean\&.html
If you run
\fBjcmd\fR
without arguments or with the
\fB\-l\fR
option, it prints the list of running Java process identifiers with the main class and command\-line arguments that were used to launch the process\&. Running
\fBjcmd\fR
with the
\fB\-h\fR
or
\fB\-help\fR
option prints the tool\(cqs help message\&.
.PP
If you run \f3jcmd\fR without arguments or with the \f3-l\fR option, it prints the list of running Java process identifiers with the main class and command-line arguments that were used to launch the process\&. Running \f3jcmd\fR with the \f3-h\fR or \f3-help\fR option prints the tool\(cqs help message\&.
If you specify the processes identifier (\fIpid\fR) or the main class (\fImain\-class\fR) as the first argument,
\fBjcmd\fR
sends the diagnostic command request to the Java process with the specified identifier or to all Java processes with the specified name of the main class\&. You can also send the diagnostic command request to all available Java processes by specifying
\fB0\fR
as the process identifier\&. Use one of the following as the diagnostic command request:
.PP
If you specify the processes identifier (\fIpid\fR) or the main class (\fImain-class\fR) as the first argument, \f3jcmd\fR sends the diagnostic command request to the Java process with the specified identifier or to all Java processes with the specified name of the main class\&. You can also send the diagnostic command request to all available Java processes by specifying \f30\fR as the process identifier\&. Use one of the following as the diagnostic command request:
.TP
Perfcounter\&.print
.RS 4
Prints the performance counters available for the specified Java process\&. The list of performance counters might vary with the Java process\&.
.TP
-f \fIfilename\fR
.br
The name of the file from which to read diagnostic commands and send them to the specified Java process\&. Used only with the \f3-f\fR option\&. Each command in the file must be written on a single line\&. Lines starting with a number sign (\f3#\fR) are ignored\&. Processing of the file ends when all lines have been read or when a line containing the \f3stop\fR keyword is read\&.
.TP
.RE
.PP
\-f \fIfilename\fR
.RS 4
The name of the file from which to read diagnostic commands and send them to the specified Java process\&. Used only with the
\fB\-f\fR
option\&. Each command in the file must be written on a single line\&. Lines starting with a number sign (\fB#\fR) are ignored\&. Processing of the file ends when all lines have been read or when a line containing the
\fBstop\fR
keyword is read\&.
.RE
.PP
\fIcommand\fR [\fIarguments\fR]
The command to be sent to the specified Java process\&. The list of available diagnostic commands for a given process can be obtained by sending the \f3help\fR command to this process\&. Each diagnostic command has its own set of arguments\&. To see the description, syntax, and a list of available arguments for a command, use the name of the command as the argument for the \f3help\fR command\&.
\fINote:\fR If any arguments contain spaces, you must surround them with single or double quotation marks (\f3\&'\fR or \f3"\fR)\&. In addition, you must escape single or double quotation marks with a backslash (\f3\e\fR) to prevent the operating system shell from processing quotation marks\&. Alternatively, you can surround these arguments with single quotation marks and then with double quotation marks (or with double quotation marks and then with single quotation marks)\&.
.SH OPTIONS
.RS 4
The command to be sent to the specified Java process\&. The list of available diagnostic commands for a given process can be obtained by sending the
\fBhelp\fR
command to this process\&. Each diagnostic command has its own set of arguments\&. To see the description, syntax, and a list of available arguments for a command, use the name of the command as the argument for the
\fBhelp\fR
command\&.
.sp
\fBNote:\fR
If any arguments contain spaces, you must surround them with single or double quotation marks (\fB\*(Aq\fR
or
\fB"\fR)\&. In addition, you must escape single or double quotation marks with a backslash (\fB\e\fR) to prevent the operating system shell from processing quotation marks\&. Alternatively, you can surround these arguments with single quotation marks and then with double quotation marks (or with double quotation marks and then with single quotation marks)\&.
.RE
.SH "OPTIONS"
.PP
Options are mutually exclusive\&.
.TP
-f \fIfilename\fR
.br
Reads commands from the specified file\&. This option can be used only if you specify the process identifier or the main class as the first argument\&. Each command in the file must be written on a single line\&. Lines starting with a number sign (\f3#\fR) are ignored\&. Processing of the file ends when all lines have been read or when a line containing the \f3stop\fR keyword is read\&.
.TP
-h, -help
.PP
\-f \fIfilename\fR
.RS 4
Reads commands from the specified file\&. This option can be used only if you specify the process identifier or the main class as the first argument\&. Each command in the file must be written on a single line\&. Lines starting with a number sign (\fB#\fR) are ignored\&. Processing of the file ends when all lines have been read or when a line containing the
\fBstop\fR
keyword is read\&.
.RE
.PP
\-h
.br
\-help
.RS 4
Prints a help message\&.
.TP
-l
.br
Prints the list of running Java processes identifiers with the main class and command-line arguments\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
.RE
.PP
\-l
.RS 4
Prints the list of running Java processes identifiers with the main class and command\-line arguments\&.
.RE
.SH "SEE ALSO"
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
jps(1)
.RE
.br
......
此差异已折叠。
......@@ -283,6 +283,10 @@ Java_java_io_UnixFileSystem_list(JNIEnv *env, jobject this,
struct dirent64 *result;
int len, maxlen;
jobjectArray rv, old;
jclass str_class;
str_class = JNU_ClassString(env);
CHECK_NULL_RETURN(str_class, NULL);
WITH_FIELD_PLATFORM_STRING(env, file, ids.path, path) {
dir = opendir(path);
......@@ -299,7 +303,7 @@ Java_java_io_UnixFileSystem_list(JNIEnv *env, jobject this,
/* Allocate an initial String array */
len = 0;
maxlen = 16;
rv = (*env)->NewObjectArray(env, maxlen, JNU_ClassString(env), NULL);
rv = (*env)->NewObjectArray(env, maxlen, str_class, NULL);
if (rv == NULL) goto error;
/* Scan the directory */
......@@ -309,8 +313,7 @@ Java_java_io_UnixFileSystem_list(JNIEnv *env, jobject this,
continue;
if (len == maxlen) {
old = rv;
rv = (*env)->NewObjectArray(env, maxlen <<= 1,
JNU_ClassString(env), NULL);
rv = (*env)->NewObjectArray(env, maxlen <<= 1, str_class, NULL);
if (rv == NULL) goto error;
if (JNU_CopyObjectArray(env, rv, old, len) < 0) goto error;
(*env)->DeleteLocalRef(env, old);
......@@ -329,7 +332,7 @@ Java_java_io_UnixFileSystem_list(JNIEnv *env, jobject this,
/* Copy the final results into an appropriately-sized array */
old = rv;
rv = (*env)->NewObjectArray(env, len, JNU_ClassString(env), NULL);
rv = (*env)->NewObjectArray(env, len, str_class, NULL);
if (rv == NULL) {
return NULL;
}
......
......@@ -56,18 +56,28 @@ JNIEXPORT void JNICALL
Java_sun_nio_ch_DatagramChannelImpl_initIDs(JNIEnv *env, jclass clazz)
{
clazz = (*env)->FindClass(env, "java/net/InetSocketAddress");
CHECK_NULL(clazz);
isa_class = (*env)->NewGlobalRef(env, clazz);
if (isa_class == NULL) {
JNU_ThrowOutOfMemoryError(env, NULL);
return;
}
isa_ctorID = (*env)->GetMethodID(env, clazz, "<init>",
"(Ljava/net/InetAddress;I)V");
CHECK_NULL(isa_ctorID);
clazz = (*env)->FindClass(env, "sun/nio/ch/DatagramChannelImpl");
CHECK_NULL(clazz);
dci_senderID = (*env)->GetFieldID(env, clazz, "sender",
"Ljava/net/SocketAddress;");
CHECK_NULL(dci_senderID);
dci_senderAddrID = (*env)->GetFieldID(env, clazz,
"cachedSenderInetAddress",
"Ljava/net/InetAddress;");
CHECK_NULL(dci_senderAddrID);
dci_senderPortID = (*env)->GetFieldID(env, clazz,
"cachedSenderPort", "I");
CHECK_NULL(dci_senderPortID);
}
JNIEXPORT void JNICALL
......@@ -192,17 +202,11 @@ Java_sun_nio_ch_DatagramChannelImpl_receive0(JNIEnv *env, jobject this,
if (senderAddr == NULL) {
jobject isa = NULL;
int port;
jobject ia = NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa,
&port);
jobject ia = NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa, &port);
if (ia != NULL) {
isa = (*env)->NewObject(env, isa_class, isa_ctorID, ia, port);
}
if (isa == NULL) {
JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
return IOS_THROWN;
}
CHECK_NULL_RETURN(isa, IOS_THROWN);
(*env)->SetObjectField(env, this, dci_senderAddrID, ia);
(*env)->SetIntField(env, this, dci_senderPortID,
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
tzdata2014j
tzdata2015a
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册