This commit is contained in:
J. Duke 2017-07-05 22:33:39 +02:00
commit 7913a2c16d
432 changed files with 26526 additions and 17981 deletions

View File

@ -390,3 +390,4 @@ f64afae7f1a5608e438585bbf0bc23785e69cba0 jdk-9+141
ff98aa9ec9fae991e426ce5926fc9036d25f5562 jdk-9+145
a22e2671d88f6b22a4aa82e3966986542ed2a381 jdk-9+146
5f6920274c48eb00d31afee6c034826a754c13d9 jdk-9+147
3ffc3e886c74736e387f3685e86b557cdea706c8 jdk-9+148

View File

@ -671,6 +671,8 @@ LLVM_LIBS
LLVM_LDFLAGS
LLVM_CFLAGS
LLVM_CONFIG
LIBFFI_LIB_FILE
ENABLE_LIBFFI_BUNDLING
LIBFFI_LIBS
LIBFFI_CFLAGS
ALSA_LIBS
@ -1208,6 +1210,7 @@ with_alsa_lib
with_libffi
with_libffi_include
with_libffi_lib
enable_libffi_bundling
with_libjpeg
with_giflib
with_libpng
@ -1990,6 +1993,9 @@ Optional Features:
disable bundling of the freetype library with the
build result [enabled on Windows or when using
--with-freetype, disabled otherwise]
--enable-libffi-bundling
enable bundling of libffi.so to make the built JDK
runnable on more systems
--enable-jtreg-failure-handler
forces build of the jtreg failure handler to be
enabled, missing dependencies become fatal errors.
@ -4171,7 +4177,7 @@ apt_help() {
ffi)
PKGHANDLER_COMMAND="sudo apt-get install libffi-dev" ;;
x11)
PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;;
PKGHANDLER_COMMAND="sudo apt-get install libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;;
ccache)
PKGHANDLER_COMMAND="sudo apt-get install ccache" ;;
dtrace)
@ -5082,7 +5088,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1480714260
DATE_WHEN_GENERATED=1481104795
###############################################################################
#
@ -24451,11 +24457,10 @@ $as_echo "$as_me: WARNING: --with-version-opt value has been sanitized from '$wi
fi
else
if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
# Default is to calculate a string like this <timestamp>.<username>.<base dir name>
timestamp=`$DATE '+%Y-%m-%d-%H%M%S'`
# Default is to calculate a string like this 'adhoc.<username>.<base dir name>'
# Outer [ ] to quote m4.
basedirname=`$BASENAME "$TOPDIR" | $TR -d -c '[a-z][A-Z][0-9].-'`
VERSION_OPT="$timestamp.$USERNAME.$basedirname"
VERSION_OPT="adhoc.$USERNAME.$basedirname"
fi
fi
@ -62634,6 +62639,11 @@ if test "${with_libffi_lib+set}" = set; then :
withval=$with_libffi_lib;
fi
# Check whether --enable-libffi-bundling was given.
if test "${enable_libffi_bundling+set}" = set; then :
enableval=$enable_libffi_bundling;
fi
if test "x$NEEDS_LIB_FFI" = xfalse; then
if (test "x${with_libffi}" != x && test "x${with_libffi}" != xno) || \
@ -62652,6 +62662,7 @@ $as_echo "$as_me: WARNING: libffi not used, so --with-libffi[-*] is ignored" >&2
fi
if test "x${with_libffi}" != x; then
LIBFFI_LIB_PATH="${with_libffi}/lib"
LIBFFI_LIBS="-L${with_libffi}/lib -lffi"
LIBFFI_CFLAGS="-I${with_libffi}/include"
LIBFFI_FOUND=yes
@ -62661,6 +62672,7 @@ $as_echo "$as_me: WARNING: libffi not used, so --with-libffi[-*] is ignored" >&2
LIBFFI_FOUND=yes
fi
if test "x${with_libffi_lib}" != x; then
LIBFFI_LIB_PATH="${with_libffi_lib}"
LIBFFI_LIBS="-L${with_libffi_lib} -lffi"
LIBFFI_FOUND=yes
fi
@ -62870,12 +62882,75 @@ $as_echo "$LIBFFI_WORKS" >&6; }
as_fn_error $? "Found libffi but could not link and compile with it. $HELP_MSG" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libffi should be bundled" >&5
$as_echo_n "checking if libffi should be bundled... " >&6; }
if test "x$enable_libffi_bundling" = "x"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
ENABLE_LIBFFI_BUNDLING=false
elif test "x$enable_libffi_bundling" = "xno"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5
$as_echo "no, forced" >&6; }
ENABLE_LIBFFI_BUNDLING=false
elif test "x$enable_libffi_bundling" = "xyes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5
$as_echo "yes, forced" >&6; }
ENABLE_LIBFFI_BUNDLING=true
else
as_fn_error $? "Invalid value for --enable-libffi-bundling" "$LINENO" 5
fi
# Find the libffi.so.X to bundle
if test "x${ENABLE_LIBFFI_BUNDLING}" = "xtrue"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libffi lib file location" >&5
$as_echo_n "checking for libffi lib file location... " >&6; }
if test "x${LIBFFI_LIB_PATH}" != x; then
if test -e ${LIBFFI_LIB_PATH}/libffi.so.?; then
LIBFFI_LIB_FILE="${LIBFFI_LIB_PATH}/libffi.so.?"
else
as_fn_error $? "Could not locate libffi.so.? for bundling in ${LIBFFI_LIB_PATH}" "$LINENO" 5
fi
else
# If we don't have an explicit path, look in a few obvious places
if test "x${OPENJDK_TARGET_CPU}" = "xx86"; then
if test -e ${SYSROOT}/usr/lib/libffi.so.? ; then
LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/libffi.so.?"
elif test -e ${SYSROOT}/usr/lib/i386-linux-gnu/libffi.so.? ; then
LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/i386-linux-gnu/libffi.so.?"
else
as_fn_error $? "Could not locate libffi.so.? for bundling" "$LINENO" 5
fi
elif test "x${OPENJDK_TARGET_CPU}" = "xx86_64"; then
if test -e ${SYSROOT}/usr/lib64/libffi.so.? ; then
LIBFFI_LIB_FILE="${SYSROOT}/usr/lib64/libffi.so.?"
elif test -e ${SYSROOT}/usr/lib/x86_64-linux-gnu/libffi.so.? ; then
LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/x86_64-linux-gnu/libffi.so.?"
else
as_fn_error $? "Could not locate libffi.so.? for bundling" "$LINENO" 5
fi
else
# Fallback on the default /usr/lib dir
if test -e ${SYSROOT}/usr/lib/libffi.so.? ; then
LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/libffi.so.?"
else
as_fn_error $? "Could not locate libffi.so.? for bundling" "$LINENO" 5
fi
fi
fi
# Make sure the wildcard is evaluated
LIBFFI_LIB_FILE="$(ls ${LIBFFI_LIB_FILE})"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${LIBFFI_LIB_FILE}" >&5
$as_echo "${LIBFFI_LIB_FILE}" >&6; }
fi
fi
if [[ " $JVM_VARIANTS " =~ " zeroshark " ]] ; then
# Extract the first word of "llvm-config", so it can be a program name with args.
set dummy llvm-config; ac_word=$2

View File

@ -116,7 +116,7 @@ apt_help() {
ffi)
PKGHANDLER_COMMAND="sudo apt-get install libffi-dev" ;;
x11)
PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;;
PKGHANDLER_COMMAND="sudo apt-get install libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;;
ccache)
PKGHANDLER_COMMAND="sudo apt-get install ccache" ;;
dtrace)

View File

@ -160,11 +160,10 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
fi
else
if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
# Default is to calculate a string like this <timestamp>.<username>.<base dir name>
timestamp=`$DATE '+%Y-%m-%d-%H%M%S'`
# Default is to calculate a string like this 'adhoc.<username>.<base dir name>'
# Outer [ ] to quote m4.
[ basedirname=`$BASENAME "$TOPDIR" | $TR -d -c '[a-z][A-Z][0-9].-'` ]
VERSION_OPT="$timestamp.$USERNAME.$basedirname"
VERSION_OPT="adhoc.$USERNAME.$basedirname"
fi
fi

View File

@ -35,6 +35,8 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBFFI],
[specify directory for the libffi include files])])
AC_ARG_WITH(libffi-lib, [AS_HELP_STRING([--with-libffi-lib],
[specify directory for the libffi library])])
AC_ARG_ENABLE(libffi-bundling, [AS_HELP_STRING([--enable-libffi-bundling],
[enable bundling of libffi.so to make the built JDK runnable on more systems])])
if test "x$NEEDS_LIB_FFI" = xfalse; then
if (test "x${with_libffi}" != x && test "x${with_libffi}" != xno) || \
@ -52,6 +54,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBFFI],
fi
if test "x${with_libffi}" != x; then
LIBFFI_LIB_PATH="${with_libffi}/lib"
LIBFFI_LIBS="-L${with_libffi}/lib -lffi"
LIBFFI_CFLAGS="-I${with_libffi}/include"
LIBFFI_FOUND=yes
@ -61,6 +64,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBFFI],
LIBFFI_FOUND=yes
fi
if test "x${with_libffi_lib}" != x; then
LIBFFI_LIB_PATH="${with_libffi_lib}"
LIBFFI_LIBS="-L${with_libffi_lib} -lffi"
LIBFFI_FOUND=yes
fi
@ -109,8 +113,65 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBFFI],
HELP_MSG_MISSING_DEPENDENCY([ffi])
AC_MSG_ERROR([Found libffi but could not link and compile with it. $HELP_MSG])
fi
AC_MSG_CHECKING([if libffi should be bundled])
if test "x$enable_libffi_bundling" = "x"; then
AC_MSG_RESULT([no])
ENABLE_LIBFFI_BUNDLING=false
elif test "x$enable_libffi_bundling" = "xno"; then
AC_MSG_RESULT([no, forced])
ENABLE_LIBFFI_BUNDLING=false
elif test "x$enable_libffi_bundling" = "xyes"; then
AC_MSG_RESULT([yes, forced])
ENABLE_LIBFFI_BUNDLING=true
else
AC_MSG_ERROR([Invalid value for --enable-libffi-bundling])
fi
# Find the libffi.so.X to bundle
if test "x${ENABLE_LIBFFI_BUNDLING}" = "xtrue"; then
AC_MSG_CHECKING([for libffi lib file location])
if test "x${LIBFFI_LIB_PATH}" != x; then
if test -e ${LIBFFI_LIB_PATH}/libffi.so.?; then
LIBFFI_LIB_FILE="${LIBFFI_LIB_PATH}/libffi.so.?"
else
AC_MSG_ERROR([Could not locate libffi.so.? for bundling in ${LIBFFI_LIB_PATH}])
fi
else
# If we don't have an explicit path, look in a few obvious places
if test "x${OPENJDK_TARGET_CPU}" = "xx86"; then
if test -e ${SYSROOT}/usr/lib/libffi.so.? ; then
LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/libffi.so.?"
elif test -e ${SYSROOT}/usr/lib/i386-linux-gnu/libffi.so.? ; then
LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/i386-linux-gnu/libffi.so.?"
else
AC_MSG_ERROR([Could not locate libffi.so.? for bundling])
fi
elif test "x${OPENJDK_TARGET_CPU}" = "xx86_64"; then
if test -e ${SYSROOT}/usr/lib64/libffi.so.? ; then
LIBFFI_LIB_FILE="${SYSROOT}/usr/lib64/libffi.so.?"
elif test -e ${SYSROOT}/usr/lib/x86_64-linux-gnu/libffi.so.? ; then
LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/x86_64-linux-gnu/libffi.so.?"
else
AC_MSG_ERROR([Could not locate libffi.so.? for bundling])
fi
else
# Fallback on the default /usr/lib dir
if test -e ${SYSROOT}/usr/lib/libffi.so.? ; then
LIBFFI_LIB_FILE="${SYSROOT}/usr/lib/libffi.so.?"
else
AC_MSG_ERROR([Could not locate libffi.so.? for bundling])
fi
fi
fi
# Make sure the wildcard is evaluated
LIBFFI_LIB_FILE="$(ls ${LIBFFI_LIB_FILE})"
AC_MSG_RESULT([${LIBFFI_LIB_FILE}])
fi
fi
AC_SUBST(LIBFFI_CFLAGS)
AC_SUBST(LIBFFI_LIBS)
AC_SUBST(ENABLE_LIBFFI_BUNDLING)
AC_SUBST(LIBFFI_LIB_FILE)
])

View File

@ -319,6 +319,8 @@ ALSA_LIBS:=@ALSA_LIBS@
ALSA_CFLAGS:=@ALSA_CFLAGS@
LIBFFI_LIBS:=@LIBFFI_LIBS@
LIBFFI_CFLAGS:=@LIBFFI_CFLAGS@
ENABLE_LIBFFI_BUNDLING:=@ENABLE_LIBFFI_BUNDLING@
LIBFFI_LIB_FILE:=@LIBFFI_LIB_FILE@
PACKAGE_PATH=@PACKAGE_PATH@

View File

@ -346,6 +346,35 @@ var getJibProfilesProfiles = function (input, common) {
// Generate debug profiles for the open jprt profiles
profiles = concatObjects(profiles, generateDebugProfiles(common, openOnlyProfiles));
// Profiles for building the zero jvm variant. These are used for verification
// in JPRT.
var zeroProfiles = {
"linux-x64-zero": {
target_os: "linux",
target_cpu: "x64",
dependencies: concat(common.dependencies, "devkit"),
configure_args: concat(common.configure_args,
"--with-zlib=system",
"--with-jvm-variants=zero",
"--enable-libffi-bundling"),
default_make_targets: common.default_make_targets
},
"linux-x86-zero": {
target_os: "linux",
target_cpu: "x86",
build_cpu: "x64",
dependencies: concat(common.dependencies, "devkit"),
configure_args: concat(common.configure_args, common.configure_args_32bit,
"--with-zlib=system",
"--with-jvm-variants=zero",
"--enable-libffi-bundling"),
default_make_targets: common.default_make_targets
},
}
profiles = concatObjects(profiles, zeroProfiles);
profiles = concatObjects(profiles, generateDebugProfiles(common, zeroProfiles));
// Profiles used to run tests. Used in JPRT.
var testOnlyProfiles = {
@ -380,7 +409,7 @@ var getJibProfilesDependencies = function (input, common) {
+ (input.build_cpu == "x86" ? "i586" : input.build_cpu);
var devkit_platform_revisions = {
linux_x64: "gcc4.9.2-OEL6.4+1.0",
linux_x64: "gcc4.9.2-OEL6.4+1.1",
macosx_x64: "Xcode6.3-MacOSX10.9+1.0",
solaris_x64: "SS12u4-Solaris11u1+1.0",
solaris_sparcv9: "SS12u4-Solaris11u1+1.0",

View File

@ -390,3 +390,4 @@ d4f1dae174098e799c48948e866054c52e11a186 jdk-9+144
a44b156ae7f06bf41b9bece30df7775e482395dd jdk-9+145
ecd74b41ab65bf228837b5bdf99690638d55425c jdk-9+146
dc49e0922a8e4387cbf8670bbe1dc51c9874b74b jdk-9+147
f95cc86b6ac22ec1ade5d4f825dc7782adeea228 jdk-9+148

View File

@ -550,3 +550,4 @@ d87d5d430c42342f0320ca7f5cbe0cbd1f9d62ba jdk-9+143
61e7ea56312351657e69198c503a6f7bf865af83 jdk-9+145
a82cb5350cad96a0b4de496afebe3ded89f27efa jdk-9+146
132a72c782071cc11ab25cc7c9ee167c3632fea4 jdk-9+147
5e4e893520ecdbd517c6ed6375f0885664fe62c4 jdk-9+148

View File

@ -65,3 +65,17 @@ $(INCLUDE_DST_DIR)/$(JNI_MD_SUBDIR)/jni_md.h: $(JNI_MD_H_SRC)
#TARGETS += $(INCLUDE_DST_DIR)/$(JNI_MD_SUBDIR)/jni_md.h
################################################################################
# Optionally copy libffi.so.? into the the image
ifeq ($(ENABLE_LIBFFI_BUNDLING), true)
$(eval $(call SetupCopyFiles, COPY_LIBFFI, \
FILES := $(LIBFFI_LIB_FILE), \
DEST := $(call FindLibDirForModule, $(MODULE)), \
FLATTEN := true, \
MACRO := install-file-nolink, \
))
TARGETS += $(COPY_LIBFFI)
endif
################################################################################

View File

@ -4,7 +4,9 @@
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -22,262 +24,59 @@
#
#
#
# Makefile to run various hotspot tests
#
NATIVE_TEST_PATH := hotspot/jtreg/native
ALT_MAKE ?= closed
TREAT_EXIT_CODE_1_AS_0 := true
GETMIXEDPATH=echo
CLEAN_BEFORE_PREP := true
# Utilities used
AWK = awk
CAT = cat
CD = cd
CHMOD = chmod
CP = cp
CUT = cut
DIRNAME = dirname
ECHO = echo
EGREP = egrep
EXPAND = expand
FIND = find
MKDIR = mkdir
PWD = pwd
SED = sed
SORT = sort
TEE = tee
UNAME = uname
UNIQ = uniq
WC = wc
ZIPEXE = zip
USE_JTREG_VERSION := 4.1
define NEWLINE
USE_JTREG_ASSERT := false
LIMIT_JTREG_VM_MEMORY := false
endef
IGNORE_MARKED_TESTS := true
# Get OS name from uname (Cygwin inexplicably adds _NT-5.1)
UNAME_S := $(shell $(UNAME) -s | $(CUT) -f1 -d_)
UNAME_S := $(shell uname -s | cut -f1 -d_)
ifeq ($(UNAME_S), SunOS)
PLATFORM = solaris
SLASH_JAVA = /java
ARCH = $(shell uname -p)
ifeq ($(ARCH), i386)
ARCH=i586
endif
NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line)
endif
ifeq ($(UNAME_S), Linux)
PLATFORM = linux
SLASH_JAVA = /java
ARCH = $(shell uname -m)
ifeq ($(ARCH), i386)
ARCH = i586
endif
NUM_CORES := $(shell cat /proc/cpuinfo | grep -c processor)
endif
ifeq ($(UNAME_S), Darwin)
PLATFORM = bsd
SLASH_JAVA = /java
ARCH = $(shell uname -m)
ifeq ($(ARCH), i386)
ARCH = i586
endif
NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
endif
ifeq ($(findstring BSD,$(UNAME_S)), BSD)
PLATFORM = bsd
SLASH_JAVA = /java
ARCH = $(shell uname -m)
ifeq ($(ARCH), i386)
ARCH = i586
endif
endif
ifeq ($(PLATFORM),)
# detect whether we're running in MKS or cygwin
ifeq ($(UNAME_S), Windows_NT) # MKS
GETMIXEDPATH=dosname -s
endif
ifeq ($(findstring CYGWIN,$(UNAME_S)), CYGWIN)
GETMIXEDPATH=cygpath -m
endif
PLATFORM = windows
SLASH_JAVA = J:
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
ARCH = ia64
else
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64)
ARCH = x64
else
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T)
ARCH = x64
else
ARCH = i586
endif
endif
endif
EXESUFFIX = .exe
ifeq ($(findstring CYGWIN,$(UNAME_S)), CYGWIN)
ifneq ($(NUMBER_OF_PROCESSORS), )
NUM_CORES := $(NUMBER_OF_PROCESSORS)
else
ifneq ($(HOTSPOT_BUILD_JOBS), )
NUM_CORES := $(HOTSPOT_BUILD_JOBS)
else
NUM_CORES := 1 # fallback
endif
endif
endif
ifdef ALT_SLASH_JAVA
SLASH_JAVA = $(ALT_SLASH_JAVA)
# Concurrency based on min(cores / 2, 12)
CONCURRENCY := $(shell expr $(NUM_CORES) / 2)
ifeq ($(CONCURRENCY), 0)
CONCURRENCY := 1
else ifeq ($(shell expr $(CONCURRENCY) \> 12), 1)
CONCURRENCY := 12
endif
# Root of this test area (important to use full paths in some places)
TEST_ROOT := $(shell pwd)
# Make sure MaxRAMFraction is high enough to not cause OOM or swapping since we may end up with a lot of JVM's
JTREG_BASIC_OPTIONS += -vmoption:-XX:MaxRAMFraction=$(shell expr $(CONCURRENCY) \* 4)
# Root of all test results
ifdef TEST_OUTPUT_DIR
$(shell $(MKDIR) -p $(TEST_OUTPUT_DIR)/jtreg)
ABS_TEST_OUTPUT_DIR := \
$(shell $(CD) $(TEST_OUTPUT_DIR)/jtreg && $(PWD))
else
ifdef ALT_OUTPUTDIR
ABS_OUTPUTDIR = $(shell $(CD) $(ALT_OUTPUTDIR) && $(PWD))
else
ABS_OUTPUTDIR = $(shell $(CD) $(TEST_ROOT)/.. && $(PWD))
endif
ABS_PLATFORM_BUILD_ROOT = $(ABS_OUTPUTDIR)
ABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR)
endif
# Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
ifndef PRODUCT_HOME
# Try to use images/jdk if it exists
ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/images/jdk
PRODUCT_HOME := \
$(shell \
if [ -d $(ABS_JDK_IMAGE) ] ; then \
$(ECHO) "$(ABS_JDK_IMAGE)"; \
else \
$(ECHO) "$(ABS_PLATFORM_BUILD_ROOT)"; \
fi)
PRODUCT_HOME := $(PRODUCT_HOME)
endif
# Expect JPRT to set JAVA_ARGS (e.g. -server etc.)
JAVA_OPTIONS =
ifdef JAVA_ARGS
JAVA_OPTIONS = $(JAVA_ARGS)
endif
# jtreg -nativepath <dir>
#
# Local make tests will be TEST_IMAGE_DIR and JPRT with jprt.use.reg.test.bundle=true
# should be JPRT_TESTNATIVE_PATH
ifdef TEST_IMAGE_DIR
TESTNATIVE_DIR = $(TEST_IMAGE_DIR)
else ifdef JPRT_TESTNATIVE_PATH
TESTNATIVE_DIR = $(JPRT_TESTNATIVE_PATH)
endif
ifdef TESTNATIVE_DIR
JTREG_NATIVE_PATH = -nativepath:$(shell $(GETMIXEDPATH) "$(TESTNATIVE_DIR)/hotspot/jtreg/native")
endif
# jtreg failure handler config
ifeq ($(FAILURE_HANDLER_DIR), )
ifneq ($(TESTNATIVE_DIR), )
FAILURE_HANDLER_DIR := $(TESTNATIVE_DIR)/failure_handler
endif
endif
ifneq ($(FAILURE_HANDLER_DIR), )
FAILURE_HANDLER_DIR_MIXED := $(shell $(GETMIXEDPATH) "$(FAILURE_HANDLER_DIR)")
JTREG_FAILURE_HANDLER_OPTIONS := \
-timeoutHandlerDir:$(FAILURE_HANDLER_DIR_MIXED)/jtregFailureHandler.jar \
-observerDir:$(FAILURE_HANDLER_DIR_MIXED)/jtregFailureHandler.jar \
-timeoutHandler:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \
-observer:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \
-timeoutHandlerTimeout:0
ifeq ($(PLATFORM), windows)
JTREG_FAILURE_HANDLER_OPTIONS += -J-Djava.library.path="$(FAILURE_HANDLER_DIR_MIXED)"
endif
endif
# Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
ifdef JPRT_ARCHIVE_BUNDLE
ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
endif
# How to create the test bundle (pass or fail, we want to create this)
# Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \
&& $(CD) $(ABS_TEST_OUTPUT_DIR) \
&& $(CHMOD) -R a+r . \
&& $(ZIPEXE) -q -r $(ARCHIVE_BUNDLE) . )
# important results files
SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport/text/summary.txt")
STATS_TXT_NAME = Stats.txt
STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/$(STATS_TXT_NAME)")
RUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/runlist.txt")
PASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/passlist.txt")
FAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/faillist.txt")
EXITCODE = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/exitcode.txt")
TESTEXIT = \
if [ ! -s $(EXITCODE) ] ; then \
$(ECHO) "ERROR: EXITCODE file not filled in."; \
$(ECHO) "1" > $(EXITCODE); \
fi ; \
testExitCode=`$(CAT) $(EXITCODE)`; \
$(ECHO) "EXIT CODE: $${testExitCode}"; \
exit $${testExitCode}
BUNDLE_UP_AND_EXIT = \
( \
jtregExitCode=$$? && \
_summary="$(SUMMARY_TXT)"; \
if [ $${jtregExitCode} = 1 ] ; then \
jtregExitCode=0; \
fi; \
$(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
$(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
if [ -r "$${_summary}" ] ; then \
$(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \
$(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \
$(EGREP) ' Passed\.' $(RUNLIST) \
| $(EGREP) -v ' Error\.' \
| $(EGREP) -v ' Failed\.' > $(PASSLIST); \
( $(EGREP) ' Failed\.' $(RUNLIST); \
$(EGREP) ' Error\.' $(RUNLIST); \
$(EGREP) -v ' Passed\.' $(RUNLIST) ) \
| $(SORT) | $(UNIQ) > $(FAILLIST); \
if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \
$(EXPAND) $(FAILLIST) \
| $(CUT) -d' ' -f1 \
| $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \
if [ $${jtregExitCode} = 0 ] ; then \
jtregExitCode=1; \
fi; \
fi; \
runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
exclc="FIXME CODETOOLS-7900176"; \
$(ECHO) "TEST STATS: name=$(UNIQUE_DIR) run=$${runc} pass=$${passc} fail=$${failc}" \
>> $(STATS_TXT); \
else \
$(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
fi; \
if [ -f $(STATS_TXT) ] ; then \
$(CAT) $(STATS_TXT); \
fi; \
$(ZIP_UP_RESULTS) ; \
$(TESTEXIT) \
)
# Include the common base file with most of the logic
include ../../test/TestCommon.gmk
################################################################
# Default make rule (runs jtreg_tests)
all: hotspot_all
@$(ECHO) "Testing completed successfully"
@ -292,106 +91,10 @@ hotspot_%:
hotspot_internal:
$(ALT_OUTPUTDIR)/jdk/bin/java -XX:+ExecuteInternalVMTests -XX:+ShowMessageBoxOnError -version
# Prep for output
prep: clean
@$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
@$(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)`
# Cleanup
clean:
@$(RM) -r $(ABS_TEST_OUTPUT_DIR)
@$(RM) $(ARCHIVE_BUNDLE)
################################################################
# jtreg tests
# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
ifndef JT_HOME
JT_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg
ifdef JPRT_JTREG_HOME
JT_HOME = $(JPRT_JTREG_HOME)
endif
endif
# When called from JPRT the TESTDIRS variable is set to the jtreg tests to run
ifdef TESTDIRS
TEST_SELECTION = $(TESTDIRS)
endif
# Concurrency based on min(cores / 2, 12)
ifdef NUM_CORES
CONCURRENCY := $(shell expr $(NUM_CORES) / 2)
ifeq ($(CONCURRENCY), 0)
CONCURRENCY := 1
else ifeq ($(shell expr $(CONCURRENCY) \> 12), 1)
CONCURRENCY := 12
endif
else
CONCURRENCY := 1
endif
JTREG_BASIC_OPTIONS += -concurrency:$(CONCURRENCY)
# Make sure MaxRAMFraction is high enough to not cause OOM or swapping since we may end up with a lot of JVM's
JTREG_BASIC_OPTIONS += -vmoption:-XX:MaxRAMFraction=$(shell expr $(CONCURRENCY) \* 4)
ifdef EXTRA_JTREG_OPTIONS
JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
endif
# Default JTREG to run
JTREG = $(JT_HOME)/bin/jtreg
# Use agent mode
JTREG_BASIC_OPTIONS += -agentvm
# Only run automatic tests
JTREG_BASIC_OPTIONS += -a
# Report details on all failed or error tests, times too
JTREG_BASIC_OPTIONS += -v:fail,error,time
# Retain all files for failing tests
JTREG_BASIC_OPTIONS += -retain:fail,error
# Ignore tests are not run and completely silent about it
JTREG_IGNORE_OPTION = -ignore:quiet
JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION)
# Multiply by 4 the timeout factor
JTREG_TIMEOUT_OPTION = -timeoutFactor:4
JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
# Set other vm and test options
JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_OPTIONS:%=-vmoption:%) $(JAVA_VM_ARGS:%=-vmoption:%)
# Option to tell jtreg to not run tests marked with "ignore"
ifeq ($(PLATFORM), windows)
JTREG_KEY_OPTION = -k:!ignore
else
JTREG_KEY_OPTION = -k:\!ignore
endif
JTREG_BASIC_OPTIONS += $(JTREG_KEY_OPTION)
ALT_MAKE ?= closed
-include $(ALT_MAKE)/Makefile
# Make sure jtreg exists
$(JTREG): $(JT_HOME)
jtreg_tests: prep $(PRODUCT_HOME) $(JTREG)
( \
( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \
export JT_HOME; \
$(shell $(GETMIXEDPATH) "$(JTREG)") \
$(JTREG_BASIC_OPTIONS) \
-r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport") \
-w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTwork") \
-jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
$(JTREG_NATIVE_PATH) \
$(JTREG_FAILURE_HANDLER_OPTIONS) \
$(JTREG_EXCLUSIONS) \
$(JTREG_TEST_OPTIONS) \
$(TEST_SELECTION) \
) ; \
$(BUNDLE_UP_AND_EXIT) \
) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
PHONY_LIST += jtreg_tests
# flags used to execute java in test targets
TEST_FLAGS += -version -Xinternalversion -X -help
@ -471,6 +174,12 @@ PHONY_LIST += hotspot_servertest servertest
# Run the native gtest tests from the test image
define NEWLINE
endef
hotspot_gtest:
$(foreach v, $(JVM_VARIANTS), \
$(MAKE) hotspot_gtest$v $(NEWLINE) )
@ -481,9 +190,3 @@ hotspot_gtestserver hotspot_gtestclient hotspot_gtestminimal: hotspot_gtest%:
PHONY_LIST += hotspot_gtest hotspot_gtestserver hotspot_gtestclient \
hotspot_gtestminimal
################################################################
# Phony targets (e.g. these are not filenames)
.PHONY: all clean prep $(PHONY_LIST)
################################################################

View File

@ -390,3 +390,4 @@ efa71dc820eb8bd5a6c9f2f66f39c383ac3ee99d jdk-9+144
99b7853cfbd8227c4441de4b6119c10742556840 jdk-9+145
6e4ff59afb5d0adf21a72c4ff534326594a99e5d jdk-9+146
c41140100bf1e5c10c7b8f3bde91c16eff7485f5 jdk-9+147
9098b2b9d997d65af0026fc2f39cf75234e26bc5 jdk-9+148

View File

@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
tzdata2016i
tzdata2016j

View File

@ -142,7 +142,7 @@ Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01
# Cameroon
# See Africa/Lagos.
# Cape Verde
# Cape Verde / Cabo Verde
#
# Shanks gives 1907 for the transition to CVT.
# Perhaps the 1911-05-26 Portuguese decree

View File

@ -1606,12 +1606,12 @@ Zone Asia/Amman 2:23:44 - LMT 1931
# was "blended" with the Central zone. Therefore, Kazakhstan now has
# two time zones, and difference between them is one hour. The zone
# closer to UTC is the former Western zone (probably still called the
# same), encompassing four provinces in the west: Aqtobe, Atyrau,
# Mangghystau, and West Kazakhstan. The other zone encompasses
# same), encompassing four provinces in the west: Aqtöbe, Atyraū,
# Mangghystaū, and West Kazakhstan. The other zone encompasses
# everything else.... I guess that would make Kazakhstan time zones
# de jure UTC+5 and UTC+6 respectively.
# From Stepan Golosunov (2016-03-27) ([*] means see later comments below):
# From Stepan Golosunov (2016-03-27):
# Review of the linked documents from http://adilet.zan.kz/
# produced the following data for post-1991 Kazakhstan:
#
@ -1657,7 +1657,7 @@ Zone Asia/Amman 2:23:44 - LMT 1931
#
# This implies that on 1991-03-31 Asia/Oral remained on +04/+05 while
# the rest of Kazakhstan switched from +06/+07 to +05/06 or from +05/06
# to +04/+05. It's unclear how Kzyl-Orda oblast moved into the fifth
# to +04/+05. It's unclear how Qyzylorda oblast moved into the fifth
# time belt. (By switching from +04/+05 to +05/+06 on 1991-09-29?) ...
#
# 1. Act of the Cabinet of Ministers of the Republic of Kazakhstan
@ -1670,25 +1670,25 @@ Zone Asia/Amman 2:23:44 - LMT 1931
# on the whole territory of Kazakhstan 1 hour forward on 1992-01-19 at
# 2:00, specified DST rules. It acknowledged that Kazakhstan was
# located in the fourth and the fifth time belts and specified the
# border between them to be located east of Kustanay and Aktyubinsk
# oblasts (notably including Turgai and Kzyl-Orda oblasts into the fifth
# border between them to be located east of Qostanay and Aktyubinsk
# oblasts (notably including Turgai and Qyzylorda oblasts into the fifth
# time belt).
#
# This means switch on 1992-01-19 at 2:00 from +04/+05 to +05/+06 for
# Asia/Aqtau, Asia/Aqtobe, Asia/Oral, Atyrau and Kustanay oblasts; from
# +05/+06 to +06/+07 for Asia/Almaty and Asia/Qyzylorda (and Arkalyk) [*]....
# Asia/Aqtau, Asia/Aqtobe, Asia/Oral, Atyraū and Qostanay oblasts; from
# +05/+06 to +06/+07 for Asia/Almaty and Asia/Qyzylorda (and Arkalyk)....
#
# 2. Act of the Cabinet of Ministers of the Republic of Kazakhstan
# from 1992-03-27 No. 284
# http://adilet.zan.kz/rus/docs/P920000284_
# cancels extra hour ("decree time") for Uralsk and Kzyl-Orda oblasts
# cancels extra hour ("decree time") for Uralsk and Qyzylorda oblasts
# since the last Sunday of March 1992, while keeping them in the fourth
# and the fifth time belts respectively.
#
# 3. Order of the Prime Minister of the Republic of Kazakhstan
# from 1994-09-23 No. 384
# http://adilet.zan.kz/rus/docs/R940000384_
# cancels the extra hour ("decree time") on the territory of Mangystau
# cancels the extra hour ("decree time") on the territory of Mangghystaū
# oblast since the last Sunday of September 1994 (saying that time on
# the territory would correspond to the third time belt as a
# result)....
@ -1702,14 +1702,11 @@ Zone Asia/Amman 2:23:44 - LMT 1931
# 5. Act of the Government of the Republic of Kazakhstan
# from 1999-03-26 No. 305
# http://adilet.zan.kz/rus/docs/P990000305_
# cancels the extra hour ("decree time") for Atyrau oblast since the
# cancels the extra hour ("decree time") for Atyraū oblast since the
# last Sunday of March 1999 while retaining the oblast in the fourth
# time belt.
#
# This means change from +05/+06 to +04/+05.
#
# There is no zone for Atyrau currently (listed under Asia/Aqtau in
# zone1970.tab).[*]
# This means change from +05/+06 to +04/+05....
#
# 6. Act of the Government of the Republic of Kazakhstan
# from 2000-11-23 No. 1749
@ -1719,10 +1716,10 @@ Zone Asia/Amman 2:23:44 - LMT 1931
# The only changes I noticed are in definition of the border between the
# fourth and the fifth time belts. They account for changes in spelling
# and administrative division (splitting of Turgai oblast in 1997
# probably changed time in territories incorporated into Kostanay oblast
# (including Arkalyk) from +06/+07 to +05/+06) and move Kyzylorda oblast
# probably changed time in territories incorporated into Qostanay oblast
# (including Arkalyk) from +06/+07 to +05/+06) and move Qyzylorda oblast
# from being in the fifth time belt and not using decree time into the
# fourth time belt (no change in practice).[*]
# fourth time belt (no change in practice).
#
# 7. Act of the Government of the Republic of Kazakhstan
# from 2003-12-29 No. 1342
@ -1732,7 +1729,7 @@ Zone Asia/Amman 2:23:44 - LMT 1931
# 8. Act of the Government of the Republic of Kazakhstan
# from 2004-07-20 No. 775
# http://adilet.zan.kz/rus/archive/docs/P040000775_/20.07.2004
# modified the 2000-11-23 act to move Kostanay and Kyzylorda oblasts into
# modified the 2000-11-23 act to move Qostanay and Qyzylorda oblasts into
# the fifth time belt and add Aktobe oblast to the list of regions not
# using extra hour ("decree time"), leaving Kazakhstan with only 2 time
# zones (+04/+05 and +06/+07). The changes were to be implemented
@ -1744,14 +1741,14 @@ Zone Asia/Amman 2:23:44 - LMT 1931
# http://adilet.zan.kz/rus/docs/P040001059_
# modified the 2000-11-23 act to remove exceptions from the "decree time"
# (leaving Kazakhstan in +05/+06 and +06/+07 zones), amended the
# 2004-07-20 act to implement changes for Atyrau, West Kazakhstan,
# Kostanay, Kyzylorda and Mangystau oblasts by not moving clocks
# during the 2014 transition to "winter" time.
# 2004-07-20 act to implement changes for Atyraū, West Kazakhstan,
# Qostanay, Qyzylorda and Mangghystaū oblasts by not moving clocks
# during the 2004 transition to "winter" time.
#
# This means transition from +04/+05 to +05/+06 for Atyrau oblast (no
# This means transition from +04/+05 to +05/+06 for Atyraū oblast (no
# zone currently), Asia/Oral, Asia/Aqtau and transition from +05/+06 to
# +06/+07 for Kostanay oblast (Kostanay and Arkalyk, no zones currently)
# and Asia/Qyzylorda on 2004-10-31 at 3:00....[*]
# +06/+07 for Qostanay oblast (Qostanay and Arkalyk, no zones currently)
# and Asia/Qyzylorda on 2004-10-31 at 3:00....
#
# 10. Act of the Government of the Republic of Kazakhstan
# from 2005-03-15 No. 231
@ -1767,14 +1764,9 @@ Zone Asia/Amman 2:23:44 - LMT 1931
# Kazakh 1992-01-13 act appears to provide the same rules and 1992-03-27
# act was to be enacted on the last Sunday of March 1992.
# From Paul Eggert (2016-04-15):
# The tables below should reflect Stepan Golosunov's remarks above,
# except for the items marked "[*]" which I haven't gotten to yet.
# It looks like we will need new zones Asia/Atyrau and Asia/Qostanay
# to handle changes from 1992 through 2004 that we did not previously
# know about.
# From Paul Eggert (2016-11-07):
# The tables below reflect Golosunov's remarks, with exceptions as noted.
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
#
# Almaty (formerly Alma-Ata), representing most locations in Kazakhstan
@ -1787,6 +1779,8 @@ Zone Asia/Almaty 5:07:48 - LMT 1924 May 2 # or Alma-Ata
6:00 RussiaAsia +06/+07 2004 Oct 31 2:00s
6:00 - +06
# Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-KZY)
# This currently includes Qostanay (aka Kostanay, Kustanay) (KZ-KUS);
# see comments below.
Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2
4:00 - +04 1930 Jun 21
5:00 - +05 1981 Apr 1
@ -1798,7 +1792,21 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2
6:00 RussiaAsia +06/+07 1992 Mar 29 2:00s
5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s
6:00 - +06
# Aqtobe (aka Aktobe, formerly Aktyubinsk) (KZ-AKT)
# The following zone is like Asia/Qyzylorda except for being one
# hour earlier from 1991-09-29 to 1992-03-29. The 1991/2 rules for
# Qostenay are unclear partly because of the 1997 Turgai
# reorganization, so this zone is commented out for now.
#Zone Asia/Qostanay 4:14:20 - LMT 1924 May 2
# 4:00 - +04 1930 Jun 21
# 5:00 - +05 1981 Apr 1
# 5:00 1:00 +06 1981 Oct 1
# 6:00 - +06 1982 Apr 1
# 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s
# 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s
# 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s
# 6:00 - +06
#
# Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-AKT)
Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2
4:00 - +04 1930 Jun 21
5:00 - +05 1981 Apr 1
@ -1808,14 +1816,11 @@ Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2
4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s
5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s
5:00 - +05
# Qostanay (KZ-KUS)
# Mangghystau (KZ-MAN)
# Mangghystaū (KZ-MAN)
# Aqtau was not founded until 1963, but it represents an inhabited region,
# so include time stamps before 1963.
Zone Asia/Aqtau 3:21:04 - LMT 1924 May 2
4:00 - +04 1930 Jun 21
5:00 - +05 1963
5:00 - +05 1981 Oct 1
6:00 - +06 1982 Apr 1
5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s
@ -1823,7 +1828,17 @@ Zone Asia/Aqtau 3:21:04 - LMT 1924 May 2
5:00 RussiaAsia +05/+06 1994 Sep 25 2:00s
4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s
5:00 - +05
# Atyraū (KZ-ATY) is like Mangghystaū except it switched from
# +04/+05 to +05/+06 in spring 1999, not fall 1994.
Zone Asia/Atyrau 3:27:44 - LMT 1924 May 2
4:00 - +04 1930 Jun 21
5:00 - +05 1981 Oct 1
6:00 - +06 1982 Apr 1
5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s
4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s
5:00 RussiaAsia +05/+06 1999 Mar 28 2:00s
4:00 RussiaAsia +04/+05 2004 Oct 31 2:00s
5:00 - +05
# West Kazakhstan (KZ-ZAP)
# From Paul Eggert (2016-03-18):
# The 1989 transition is from USSR act No. 227 (1989-03-14).
@ -2639,7 +2654,7 @@ Rule Palestine 2016 max - Oct lastSat 1:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
2:00 Zion EET 1948 May 15
2:00 Zion EET/EEST 1948 May 15
2:00 EgyptAsia EE%sT 1967 Jun 5
2:00 Zion I%sT 1996
2:00 Jordan EE%sT 1999
@ -2652,7 +2667,7 @@ Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
2:00 Palestine EE%sT
Zone Asia/Hebron 2:20:23 - LMT 1900 Oct
2:00 Zion EET 1948 May 15
2:00 Zion EET/EEST 1948 May 15
2:00 EgyptAsia EE%sT 1967 Jun 5
2:00 Zion I%sT 1996
2:00 Jordan EE%sT 1999

View File

@ -924,7 +924,7 @@ Zone Europe/Sofia 1:33:16 - LMT 1880
# Cyprus
# Please see the 'asia' file for Asia/Nicosia.
# Czech Republic
# Czech Republic / Czechia
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Czech 1945 only - Apr 8 2:00s 1:00 S
Rule Czech 1945 only - Nov 18 2:00s 0 -
@ -2624,10 +2624,9 @@ Zone Europe/Astrakhan 3:12:12 - LMT 1924 May
3:00 - +03 2016 Mar 27 2:00s
4:00 - +04
# From Paul Eggert (2016-03-18):
# From Paul Eggert (2016-11-11):
# Europe/Volgograd covers:
# 34 RU-VGG Volgograd Oblast
# 64 RU-SAR Saratov Oblast
# The 1988 transition is from USSR act No. 5 (1988-01-04).
Zone Europe/Volgograd 2:57:40 - LMT 1920 Jan 3
@ -2640,6 +2639,27 @@ Zone Europe/Volgograd 2:57:40 - LMT 1920 Jan 3
4:00 - +04 2014 Oct 26 2:00s
3:00 - +03
# From Paul Eggert (2016-11-11):
# Europe/Saratov covers:
# 64 RU-SAR Saratov Oblast
# From Yuri Konotopov (2016-11-11):
# Dec 4, 2016 02:00 UTC+3.... Saratov Region's local time will be ... UTC+4.
# From Stepan Golosunov (2016-11-11):
# ... Byalokoz listed Saratov on 03:04:18.
# From Stepan Golosunov (2016-11-22):
# http://publication.pravo.gov.ru/Document/View/0001201611220031
Zone Europe/Saratov 3:04:18 - LMT 1919 Jul 1 0:00u
3:00 - +03 1930 Jun 21
4:00 Russia +04/+05 1988 Mar 27 2:00s
3:00 Russia +03/+04 1991 Mar 31 2:00s
4:00 - +04 1992 Mar 29 2:00s
3:00 Russia +03/+04 2011 Mar 27 2:00s
4:00 - +04 2014 Oct 26 2:00s
3:00 - +03 2016 Dec 4 2:00s
4:00 - +04
# From Paul Eggert (2016-03-18):
# Europe/Kirov covers:
# 43 RU-KIR Kirov Oblast

View File

@ -98,7 +98,7 @@ CO Colombia
CR Costa Rica
CU Cuba
CV Cape Verde
CW Curacao
CW Curaçao
CX Christmas Island
CY Cyprus
CZ Czech Republic

View File

@ -262,7 +262,8 @@ KY +1918-08123 America/Cayman
KZ +4315+07657 Asia/Almaty Kazakhstan (most areas)
KZ +4448+06528 Asia/Qyzylorda Qyzylorda/Kyzylorda/Kzyl-Orda
KZ +5017+05710 Asia/Aqtobe Aqtobe/Aktobe
KZ +4431+05016 Asia/Aqtau Atyrau/Atirau/Gur'yev, Mangghystau/Mankistau
KZ +4431+05016 Asia/Aqtau Mangghystau/Mankistau
KZ +4707+05156 Asia/Atyrau Atyrau/Atirau/Gur'yev
KZ +5113+05121 Asia/Oral West Kazakhstan
LA +1758+10236 Asia/Vientiane
LB +3353+03530 Asia/Beirut
@ -353,14 +354,15 @@ RS +4450+02030 Europe/Belgrade
RU +5443+02030 Europe/Kaliningrad MSK-01 - Kaliningrad
RU +554521+0373704 Europe/Moscow MSK+00 - Moscow area
RU +4457+03406 Europe/Simferopol MSK+00 - Crimea
RU +4844+04425 Europe/Volgograd MSK+00 - Volgograd, Saratov
RU +4844+04425 Europe/Volgograd MSK+00 - Volgograd
RU +5836+04939 Europe/Kirov MSK+00 - Kirov
RU +4621+04803 Europe/Astrakhan MSK+01 - Astrakhan
RU +5312+05009 Europe/Samara MSK+01 - Samara, Udmurtia
RU +5134+04602 Europe/Saratov MSK+01 - Saratov
RU +5420+04824 Europe/Ulyanovsk MSK+01 - Ulyanovsk
RU +5312+05009 Europe/Samara MSK+01 - Samara, Udmurtia
RU +5651+06036 Asia/Yekaterinburg MSK+02 - Urals
RU +5500+07324 Asia/Omsk MSK+03 - Omsk
RU +5502+08255 Asia/Novosibirsk MSK+03 - Novosibirsk
RU +5502+08255 Asia/Novosibirsk MSK+04 - Novosibirsk
RU +5322+08345 Asia/Barnaul MSK+04 - Altai
RU +5630+08458 Asia/Tomsk MSK+04 - Tomsk
RU +5345+08707 Asia/Novokuznetsk MSK+04 - Kemerovo

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2016, 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
@ -38,7 +38,6 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) \
$(addprefix -I, $(LIBJ2UCRYPTO_SRC)), \
DISABLED_WARNINGS_solstudio := E_MACRO_REDEFINED, \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libj2ucrypto/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB), \
LIBS := $(LIBDL), \

View File

@ -60,6 +60,7 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_FileChannelImpl_position0;
Java_sun_nio_ch_FileChannelImpl_transferTo0;
Java_sun_nio_ch_FileChannelImpl_unmap0;
Java_sun_nio_ch_FileDispatcherImpl_allocate0;
Java_sun_nio_ch_FileDispatcherImpl_close0;
Java_sun_nio_ch_FileDispatcherImpl_closeIntFD;
Java_sun_nio_ch_FileDispatcherImpl_force0;

View File

@ -43,6 +43,7 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_FileChannelImpl_position0;
Java_sun_nio_ch_FileChannelImpl_transferTo0;
Java_sun_nio_ch_FileChannelImpl_unmap0;
Java_sun_nio_ch_FileDispatcherImpl_allocate0;
Java_sun_nio_ch_FileDispatcherImpl_close0;
Java_sun_nio_ch_FileDispatcherImpl_closeIntFD;
Java_sun_nio_ch_FileDispatcherImpl_force0;

View File

@ -48,6 +48,7 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_FileChannelImpl_position0;
Java_sun_nio_ch_FileChannelImpl_transferTo0;
Java_sun_nio_ch_FileChannelImpl_unmap0;
Java_sun_nio_ch_FileDispatcherImpl_allocate0;
Java_sun_nio_ch_FileDispatcherImpl_close0;
Java_sun_nio_ch_FileDispatcherImpl_closeIntFD;
Java_sun_nio_ch_FileDispatcherImpl_force0;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2016, 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
@ -911,7 +911,6 @@ public final class KeychainStore extends KeyStoreSpi {
return true;
}
@SuppressWarnings("deprecation")
private byte[] fetchPrivateKeyFromBag(byte[] privateKeyInfo) throws IOException, NoSuchAlgorithmException, CertificateException
{
byte[] returnValue = null;
@ -972,7 +971,6 @@ public final class KeychainStore extends KeyStoreSpi {
return returnValue;
}
@SuppressWarnings("deprecation")
private byte[] extractKeyData(DerInputStream stream)
throws IOException, NoSuchAlgorithmException, CertificateException
{

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2016, 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
@ -68,10 +68,10 @@ final class ISO10126Padding implements Padding {
}
byte paddingOctet = (byte) (len & 0xff);
byte[] padding = new byte[len];
byte[] padding = new byte[len - 1];
SunJCE.getRandom().nextBytes(padding);
padding[len-1] = paddingOctet;
System.arraycopy(padding, 0, in, off, len);
System.arraycopy(padding, 0, in, off, len - 1);
in[off + len - 1] = paddingOctet;
return;
}
@ -101,7 +101,7 @@ final class ISO10126Padding implements Padding {
return -1;
}
int start = off + len - ((int)lastByte & 0x0ff);
int start = off + len - padValue;
if (start < off) {
return -1;
}

View File

@ -63,10 +63,10 @@ public class DriverResource_ja extends ListResourceBundle {
"\u5727\u7E2E\u30AA\u30D7\u30B7\u30E7\u30F3",
" -r\u3001--repack jar\u3092\u518D\u5727\u7E2E\u307E\u305F\u306F\u6B63\u898F\u5316\u3059\u308B\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3001",
" jarsigner\u306B\u3088\u308B\u7F72\u540D\u306B\u9069\u3057\u307E\u3059",
" -g\u3001--no-gzip \u30D7\u30EC\u30FC\u30F3\u306A\u5727\u7E2E\u30D5\u30A1\u30A4\u30EB\u3092\u51FA\u529B\u3059\u308B\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3001",
" -g\u3001--no-gzip \u30D7\u30EC\u30FC\u30F3\u306Apack\u30D5\u30A1\u30A4\u30EB\u3092\u51FA\u529B\u3059\u308B\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3001",
" \u30D5\u30A1\u30A4\u30EB\u5727\u7E2E\u30E6\u30FC\u30C6\u30A3\u30EA\u30C6\u30A3\u306B\u3088\u308B\u5727\u7E2E\u306B\u9069\u3057\u307E\u3059",
" --gzip (\u30C7\u30D5\u30A9\u30EB\u30C8)\u5727\u7E2E\u51FA\u529B\u3092gzip\u3067",
" \u5727\u7E2E\u306E\u5F8C\u51E6\u7406\u3092\u884C\u3044\u307E\u3059",
" --gzip (\u30C7\u30D5\u30A9\u30EB\u30C8) pack\u51FA\u529B\u3092\u5F8C\u51E6\u7406\u3067\u5727\u7E2E\u3057\u307E\u3059",
" (gzip\u3092\u4F7F\u7528)",
" -G\u3001--strip-debug \u5727\u7E2E\u4E2D\u306B\u30C7\u30D0\u30C3\u30B0\u5C5E\u6027(SourceFile\u3001",
" LineNumberTable\u3001LocalVariableTable",
" \u3001LocalVariableTypeTable)\u3092\u524A\u9664\u3057\u307E\u3059",

View File

@ -350,16 +350,24 @@ public interface ObjectInputFilter {
* The first pattern that matches, working from left to right, determines
* the {@link Status#ALLOWED Status.ALLOWED}
* or {@link Status#REJECTED Status.REJECTED} result.
* If nothing matches, the result is {@link Status#UNDECIDED Status.UNDECIDED}.
* If the limits are not exceeded and no pattern matches the class,
* the result is {@link Status#UNDECIDED Status.UNDECIDED}.
*
* @param pattern the pattern string to parse; not null
* @return a filter to check a class being deserialized; may be null;
* @return a filter to check a class being deserialized;
* {@code null} if no patterns
* @throws IllegalArgumentException
* if a limit is missing the name, or the long value
* is not a number or is negative,
* or the module name is missing if the pattern contains "/"
* or if the package is missing for ".*" and ".**"
* @throws IllegalArgumentException if the pattern string is illegal or
* malformed and cannot be parsed.
* In particular, if any of the following is true:
* <ul>
* <li> if a limit is missing the name or the name is not one of
* "maxdepth", "maxrefs", "maxbytes", or "maxarray"
* <li> if the value of the limit can not be parsed by
* {@link Long#parseLong Long.parseLong} or is negative
* <li> if the pattern contains "/" and the module name is missing
* or the remaining pattern is empty
* <li> if the package is missing for ".*" and ".**"
* </ul>
*/
public static ObjectInputFilter createFilter(String pattern) {
Objects.requireNonNull(pattern, "pattern");
@ -402,14 +410,19 @@ public interface ObjectInputFilter {
* Returns an ObjectInputFilter from a string of patterns.
*
* @param pattern the pattern string to parse
* @return a filter to check a class being deserialized; not null
* @return a filter to check a class being deserialized;
* {@code null} if no patterns
* @throws IllegalArgumentException if the parameter is malformed
* if the pattern is missing the name, the long value
* is not a number or is negative.
*/
static ObjectInputFilter createFilter(String pattern) {
Global filter = new Global(pattern);
return filter.isEmpty() ? null : filter;
try {
return new Global(pattern);
} catch (UnsupportedOperationException uoe) {
// no non-empty patterns
return null;
}
}
/**
@ -417,8 +430,10 @@ public interface ObjectInputFilter {
*
* @param pattern a pattern string of filters
* @throws IllegalArgumentException if the pattern is malformed
* @throws UnsupportedOperationException if there are no non-empty patterns
*/
private Global(String pattern) {
boolean hasLimits = false;
this.pattern = pattern;
maxArrayLength = Long.MAX_VALUE; // Default values are unlimited
@ -436,6 +451,7 @@ public interface ObjectInputFilter {
}
if (parseLimit(p)) {
// If the pattern contained a limit setting, i.e. type=value
hasLimits = true;
continue;
}
boolean negate = p.charAt(0) == '!';
@ -510,18 +526,9 @@ public interface ObjectInputFilter {
filters.add(c -> moduleName.equals(c.getModule().getName()) ? patternFilter.apply(c) : Status.UNDECIDED);
}
}
}
/**
* Returns if this filter has any checks.
* @return {@code true} if the filter has any checks, {@code false} otherwise
*/
private boolean isEmpty() {
return filters.isEmpty() &&
maxArrayLength == Long.MAX_VALUE &&
maxDepth == Long.MAX_VALUE &&
maxReferences == Long.MAX_VALUE &&
maxStreamBytes == Long.MAX_VALUE;
if (filters.isEmpty() && !hasLimits) {
throw new UnsupportedOperationException("no non-empty patterns");
}
}
/**

View File

@ -657,13 +657,11 @@ public class ObjectInputStream
* <pre>
* Class.forName(desc.getName(), false, loader)
* </pre>
* where <code>loader</code> is determined as follows: if there is a
* method on the current thread's stack whose declaring class is not a
* <a href="../lang/ClassLoader.html#builtinLoaders">
* <em>platform class</em></a>, then <code>loader</code> is
* the class loader of such class; otherwise, <code>loader</code>
* is the {@linkplain ClassLoader#getPlatformClassLoader()
* platform class loader}. If this call results in a
* where <code>loader</code> is the first class loader on the current
* thread's stack (starting from the currently executing method) that is
* neither the {@linkplain ClassLoader#getPlatformClassLoader() platform
* class loader} nor its ancestor; otherwise, <code>loader</code> is the
* <em>platform class loader</em>. If this call results in a
* <code>ClassNotFoundException</code> and the name of the passed
* <code>ObjectStreamClass</code> instance is the Java language keyword
* for a primitive type or void, then the <code>Class</code> object
@ -721,13 +719,11 @@ public class ObjectInputStream
* <pre>
* Class.forName(i, false, loader)
* </pre>
* where <code>loader</code> is determined as follows: if there is a
* method on the current thread's stack whose declaring class is not a
* <a href="../lang/ClassLoader.html#builtinLoaders">
* <em>platform class</em></a>, then <code>loader</code> is
* the class loader of such class; otherwise, <code>loader</code>
* is the {@linkplain ClassLoader#getPlatformClassLoader()
* platform class loader}.
* where <code>loader</code> is the first class loader on the current
* thread's stack (starting from the currently executing method) that is
* neither the {@linkplain ClassLoader#getPlatformClassLoader() platform
* class loader} nor its ancestor; otherwise, <code>loader</code> is the
* <em>platform class loader</em>.
* Unless any of the resolved interfaces are non-public, this same value
* of <code>loader</code> is also the class loader passed to
* <code>Proxy.getProxyClass</code>; if non-public interfaces are present,
@ -1168,6 +1164,13 @@ public class ObjectInputStream
* for each class and reference in the stream.
* The filter can check any or all of the class, the array length, the number
* of references, the depth of the graph, and the size of the input stream.
* The depth is the number of nested {@linkplain #readObject readObject}
* calls starting with the reading of the root of the graph being deserialized
* and the current object being deserialized.
* The number of references is the cumulative number of objects and references
* to objects already read from the stream including the current object being read.
* The filter is invoked only when reading objects from the stream and for
* not primitives.
* <p>
* If the filter returns {@link ObjectInputFilter.Status#REJECTED Status.REJECTED},
* {@code null} or throws a {@link RuntimeException},
@ -1182,8 +1185,9 @@ public class ObjectInputStream
*
* @implSpec
* The filter, when not {@code null}, is invoked during {@link #readObject readObject}
* and {@link #readUnshared readUnshared} for each object
* (regular or class) in the stream including the following:
* and {@link #readUnshared readUnshared} for each object (regular or class) in the stream.
* Strings are treated as primitives and do not invoke the filter.
* The filter is called for:
* <ul>
* <li>each object reference previously deserialized from the stream
* (class is {@code null}, arrayLength is -1),
@ -2370,16 +2374,10 @@ public class ObjectInputStream
int ndoubles);
/**
* Returns the first non-null and non-platform class loader
* (not counting class loaders of generated reflection implementation classes)
* up the execution stack, or null if only code from the bootstrap and
* platform class loader is on the stack.
* This method is also called via reflection by the following RMI-IIOP class:
*
* com.sun.corba.se.internal.util.JDKClassLoader
*
* This method should not be removed or its signature changed without
* corresponding modifications to the above class.
* Returns the first non-null and non-platform class loader (not counting
* class loaders of generated reflection implementation classes) up the
* execution stack, or the platform class loader if only code from the
* bootstrap and platform class loader is on the stack.
*/
private static ClassLoader latestUserDefinedLoader() {
return jdk.internal.misc.VM.latestUserDefinedLoader();

View File

@ -1277,33 +1277,40 @@ public final class Class<T> implements java.io.Serializable,
}
private static final class EnclosingMethodInfo {
private Class<?> enclosingClass;
private String name;
private String descriptor;
private final Class<?> enclosingClass;
private final String name;
private final String descriptor;
private EnclosingMethodInfo(Object[] enclosingInfo) {
static void validate(Object[] enclosingInfo) {
if (enclosingInfo.length != 3)
throw new InternalError("Malformed enclosing method information");
try {
// The array is expected to have three elements:
// the immediately enclosing class
enclosingClass = (Class<?>) enclosingInfo[0];
Class<?> enclosingClass = (Class<?>)enclosingInfo[0];
assert(enclosingClass != null);
// the immediately enclosing method or constructor's
// name (can be null).
name = (String) enclosingInfo[1];
String name = (String)enclosingInfo[1];
// the immediately enclosing method or constructor's
// descriptor (null iff name is).
descriptor = (String) enclosingInfo[2];
String descriptor = (String)enclosingInfo[2];
assert((name != null && descriptor != null) || name == descriptor);
} catch (ClassCastException cce) {
throw new InternalError("Invalid type in enclosing method information", cce);
}
}
EnclosingMethodInfo(Object[] enclosingInfo) {
validate(enclosingInfo);
this.enclosingClass = (Class<?>)enclosingInfo[0];
this.name = (String)enclosingInfo[1];
this.descriptor = (String)enclosingInfo[2];
}
boolean isPartial() {
return enclosingClass == null || name == null || descriptor == null;
}
@ -1481,7 +1488,7 @@ public final class Class<T> implements java.io.Serializable,
if (enclosingInfo == null) {
// This is a top level or a nested class or an inner class (a, b, or c)
enclosingCandidate = getDeclaringClass();
enclosingCandidate = getDeclaringClass0();
} else {
Class<?> enclosingClass = enclosingInfo.getEnclosingClass();
// This is a local class or an anonymous class (d or e)
@ -1547,14 +1554,6 @@ public final class Class<T> implements java.io.Serializable,
return getName();
}
/**
* Character.isDigit answers {@code true} to some non-ascii
* digits. This one does not.
*/
private static boolean isAsciiDigit(char c) {
return '0' <= c && c <= '9';
}
/**
* Returns the canonical name of the underlying class as
* defined by the Java Language Specification. Returns null if
@ -1594,7 +1593,8 @@ public final class Class<T> implements java.io.Serializable,
* @since 1.5
*/
public boolean isAnonymousClass() {
return "".equals(getSimpleName());
return !isArray() && isLocalOrAnonymousClass() &&
getSimpleBinaryName0() == null;
}
/**
@ -1605,7 +1605,8 @@ public final class Class<T> implements java.io.Serializable,
* @since 1.5
*/
public boolean isLocalClass() {
return isLocalOrAnonymousClass() && !isAnonymousClass();
return isLocalOrAnonymousClass() &&
(isArray() || getSimpleBinaryName0() != null);
}
/**
@ -1616,7 +1617,7 @@ public final class Class<T> implements java.io.Serializable,
* @since 1.5
*/
public boolean isMemberClass() {
return getSimpleBinaryName() != null && !isLocalOrAnonymousClass();
return !isLocalOrAnonymousClass() && getDeclaringClass0() != null;
}
/**
@ -1626,8 +1627,7 @@ public final class Class<T> implements java.io.Serializable,
* class.
*/
private String getSimpleBinaryName() {
Class<?> enclosingClass = getEnclosingClass();
if (enclosingClass == null) // top level class
if (isTopLevelClass())
return null;
String name = getSimpleBinaryName0();
if (name == null) // anonymous class
@ -1637,6 +1637,14 @@ public final class Class<T> implements java.io.Serializable,
private native String getSimpleBinaryName0();
/**
* Returns {@code true} if this is a top level class. Returns {@code false}
* otherwise.
*/
private boolean isTopLevelClass() {
return !isLocalOrAnonymousClass() && getDeclaringClass0() == null;
}
/**
* Returns {@code true} if this is a local class or an anonymous
* class. Returns {@code false} otherwise.
@ -1645,7 +1653,16 @@ public final class Class<T> implements java.io.Serializable,
// JVM Spec 4.7.7: A class must have an EnclosingMethod
// attribute if and only if it is a local class or an
// anonymous class.
return getEnclosingMethodInfo() != null;
return hasEnclosingMethodInfo();
}
private boolean hasEnclosingMethodInfo() {
Object[] enclosingInfo = getEnclosingMethod0();
if (enclosingInfo != null) {
EnclosingMethodInfo.validate(enclosingInfo);
return true;
}
return false;
}
/**

View File

@ -157,7 +157,6 @@ class Inet4Address extends InetAddress {
* address i.e first four bits of the address are 1110.
* @return a {@code boolean} indicating if the InetAddress is
* an IP multicast address
* @since 1.1
*/
public boolean isMulticastAddress() {
return ((holder().getAddress() & 0xf0000000) == 0xe0000000);
@ -167,7 +166,6 @@ class Inet4Address extends InetAddress {
* Utility routine to check if the InetAddress is a wildcard address.
* @return a {@code boolean} indicating if the Inetaddress is
* a wildcard address.
* @since 1.4
*/
public boolean isAnyLocalAddress() {
return holder().getAddress() == 0;
@ -178,7 +176,6 @@ class Inet4Address extends InetAddress {
*
* @return a {@code boolean} indicating if the InetAddress is
* a loopback address; or false otherwise.
* @since 1.4
*/
public boolean isLoopbackAddress() {
/* 127.x.x.x */
@ -191,7 +188,6 @@ class Inet4Address extends InetAddress {
*
* @return a {@code boolean} indicating if the InetAddress is
* a link local address; or false if address is not a link local unicast address.
* @since 1.4
*/
public boolean isLinkLocalAddress() {
// link-local unicast in IPv4 (169.254.0.0/16)
@ -208,7 +204,6 @@ class Inet4Address extends InetAddress {
*
* @return a {@code boolean} indicating if the InetAddress is
* a site local address; or false if address is not a site local unicast address.
* @since 1.4
*/
public boolean isSiteLocalAddress() {
// refer to RFC 1918
@ -229,7 +224,6 @@ class Inet4Address extends InetAddress {
* @return a {@code boolean} indicating if the address has
* is a multicast address of global scope, false if it is not
* of global scope or it is not a multicast address
* @since 1.4
*/
public boolean isMCGlobal() {
// 224.0.1.0 to 238.255.255.255
@ -245,7 +239,6 @@ class Inet4Address extends InetAddress {
* @return a {@code boolean} indicating if the address has
* is a multicast address of node-local scope, false if it is not
* of node-local scope or it is not a multicast address
* @since 1.4
*/
public boolean isMCNodeLocal() {
// unless ttl == 0
@ -258,7 +251,6 @@ class Inet4Address extends InetAddress {
* @return a {@code boolean} indicating if the address has
* is a multicast address of link-local scope, false if it is not
* of link-local scope or it is not a multicast address
* @since 1.4
*/
public boolean isMCLinkLocal() {
// 224.0.0/24 prefix and ttl == 1
@ -274,7 +266,6 @@ class Inet4Address extends InetAddress {
* @return a {@code boolean} indicating if the address has
* is a multicast address of site-local scope, false if it is not
* of site-local scope or it is not a multicast address
* @since 1.4
*/
public boolean isMCSiteLocal() {
// 239.255/16 prefix or ttl < 32
@ -290,7 +281,6 @@ class Inet4Address extends InetAddress {
* is a multicast address of organization-local scope,
* false if it is not of organization-local scope
* or it is not a multicast address
* @since 1.4
*/
public boolean isMCOrgLocal() {
// 239.192 - 239.195
@ -322,7 +312,6 @@ class Inet4Address extends InetAddress {
* Returns the IP address string in textual presentation form.
*
* @return the raw IP address in a string format.
* @since 1.0.2
*/
public String getHostAddress() {
return numericToTextFormat(getAddress());
@ -359,15 +348,14 @@ class Inet4Address extends InetAddress {
}
// Utilities
/*
/**
* Converts IPv4 binary address into a string suitable for presentation.
*
* @param src a byte array representing an IPv4 numeric address
* @return a String representing the IPv4 address in
* textual representation format
* @since 1.4
*/
static String numericToTextFormat(byte[] src)
{
return (src[0] & 0xff) + "." + (src[1] & 0xff) + "." + (src[2] & 0xff) + "." + (src[3] & 0xff);

View File

@ -682,8 +682,6 @@ class Inet6Address extends InetAddress {
*
* @return a {@code boolean} indicating if the InetAddress is an IP
* multicast address
*
* @since 1.1
*/
@Override
public boolean isMulticastAddress() {
@ -695,8 +693,6 @@ class Inet6Address extends InetAddress {
*
* @return a {@code boolean} indicating if the Inetaddress is
* a wildcard address.
*
* @since 1.4
*/
@Override
public boolean isAnyLocalAddress() {
@ -708,8 +704,6 @@ class Inet6Address extends InetAddress {
*
* @return a {@code boolean} indicating if the InetAddress is a loopback
* address; or false otherwise.
*
* @since 1.4
*/
@Override
public boolean isLoopbackAddress() {
@ -721,8 +715,6 @@ class Inet6Address extends InetAddress {
*
* @return a {@code boolean} indicating if the InetAddress is a link local
* address; or false if address is not a link local unicast address.
*
* @since 1.4
*/
@Override
public boolean isLinkLocalAddress() {
@ -740,8 +732,6 @@ class Inet6Address extends InetAddress {
*
* @return a {@code boolean} indicating if the InetAddress is a site local
* address; or false if address is not a site local unicast address.
*
* @since 1.4
*/
@Override
public boolean isSiteLocalAddress() {
@ -760,8 +750,6 @@ class Inet6Address extends InetAddress {
* @return a {@code boolean} indicating if the address has is a multicast
* address of global scope, false if it is not of global scope or
* it is not a multicast address
*
* @since 1.4
*/
@Override
public boolean isMCGlobal() {
@ -774,8 +762,6 @@ class Inet6Address extends InetAddress {
* @return a {@code boolean} indicating if the address has is a multicast
* address of node-local scope, false if it is not of node-local
* scope or it is not a multicast address
*
* @since 1.4
*/
@Override
public boolean isMCNodeLocal() {
@ -788,8 +774,6 @@ class Inet6Address extends InetAddress {
* @return a {@code boolean} indicating if the address has is a multicast
* address of link-local scope, false if it is not of link-local
* scope or it is not a multicast address
*
* @since 1.4
*/
@Override
public boolean isMCLinkLocal() {
@ -802,8 +786,6 @@ class Inet6Address extends InetAddress {
* @return a {@code boolean} indicating if the address has is a multicast
* address of site-local scope, false if it is not of site-local
* scope or it is not a multicast address
*
* @since 1.4
*/
@Override
public boolean isMCSiteLocal() {
@ -816,8 +798,6 @@ class Inet6Address extends InetAddress {
* @return a {@code boolean} indicating if the address has is a multicast
* address of organization-local scope, false if it is not of
* organization-local scope or it is not a multicast address
*
* @since 1.4
*/
@Override
public boolean isMCOrgLocal() {
@ -914,23 +894,21 @@ class Inet6Address extends InetAddress {
*
* @return a {@code boolean} indicating if the InetAddress is an IPv4
* compatible IPv6 address; or false if address is IPv4 address.
*
* @since 1.4
*/
public boolean isIPv4CompatibleAddress() {
return holder6.isIPv4CompatibleAddress();
}
// Utilities
private static final int INT16SZ = 2;
/*
/**
* Convert IPv6 binary address into presentation (printable) format.
*
* @param src a byte array representing the IPv6 numeric address
* @return a String representing an IPv6 address in
* textual representation format
* @since 1.4
*/
static String numericToTextFormat(byte[] src) {
StringBuilder sb = new StringBuilder(39);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2016, 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
@ -4699,8 +4699,8 @@ public class Collections {
public void forEachRemaining(Consumer<? super E> action) {
Objects.requireNonNull(action);
if (hasNext) {
action.accept(e);
hasNext = false;
action.accept(e);
}
}
};

View File

@ -46,6 +46,7 @@ import java.io.ObjectOutputStream;
import java.io.ObjectStreamField;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.concurrent.ConcurrentHashMap;
import java.util.spi.LocaleNameProvider;
import sun.security.action.GetPropertyAction;
@ -599,6 +600,68 @@ public final class Locale implements Cloneable, Serializable {
*/
static final long serialVersionUID = 9149081749638150636L;
/**
* Enum for specifying the type defined in ISO 3166. This enum is used to
* retrieve the two-letter ISO3166-1 alpha-2, three-letter ISO3166-1
* alpha-3, four-letter ISO3166-3 country codes.
*
* @see #getISOCountries(Locale.IsoCountryCode)
* @since 9
*/
public static enum IsoCountryCode {
/**
* PART1_ALPHA2 is used to represent the ISO3166-1 alpha-2 two letter
* country codes.
*/
PART1_ALPHA2 {
@Override
Set<String> createCountryCodeSet() {
return Set.of(Locale.getISOCountries());
}
},
/**
*
* PART1_ALPHA3 is used to represent the ISO3166-1 alpha-3 three letter
* country codes.
*/
PART1_ALPHA3 {
@Override
Set<String> createCountryCodeSet() {
return LocaleISOData.computeISO3166_1Alpha3Countries();
}
},
/**
* PART3 is used to represent the ISO3166-3 four letter country codes.
*/
PART3 {
@Override
Set<String> createCountryCodeSet() {
return Set.of(LocaleISOData.ISO3166_3);
}
};
/**
* Concrete implementation of this method attempts to compute value
* for iso3166CodesMap for each IsoCountryCode type key.
*/
abstract Set<String> createCountryCodeSet();
/**
* Map to hold country codes for each ISO3166 part.
*/
private static Map<IsoCountryCode, Set<String>> iso3166CodesMap = new ConcurrentHashMap<>();
/**
* This method is called from Locale class to retrieve country code set
* for getISOCountries(type)
*/
static Set<String> retrieveISOCountryCodes(IsoCountryCode type) {
return iso3166CodesMap.computeIfAbsent(type, IsoCountryCode::createCountryCodeSet);
}
}
/**
* Display types for retrieving localized names from the name providers.
*/
@ -996,12 +1059,18 @@ public final class Locale implements Cloneable, Serializable {
/**
* Returns a list of all 2-letter country codes defined in ISO 3166.
* Can be used to create Locales.
* This method is equivalent to {@link #getISOCountries(Locale.IsoCountryCode type)}
* with {@code type} {@link IsoCountryCode#PART1_ALPHA2}.
* <p>
* <b>Note:</b> The <code>Locale</code> class also supports other codes for
* country (region), such as 3-letter numeric UN M.49 area codes.
* Therefore, the list returned by this method does not contain ALL valid
* codes that can be used to create Locales.
*
* <p>
* Note that this method does not return obsolete 2-letter country codes.
* ISO3166-3 codes which designate country codes for those obsolete codes,
* can be retrieved from {@link #getISOCountries(Locale.IsoCountryCode type)} with
* {@code type} {@link IsoCountryCode#PART3}.
* @return An array of ISO 3166 two-letter country codes.
*/
public static String[] getISOCountries() {
@ -1013,6 +1082,20 @@ public final class Locale implements Cloneable, Serializable {
return result;
}
/**
* Returns a {@code Set} of ISO3166 country codes for the specified type.
*
* @param type {@link Locale.IsoCountryCode} specified ISO code type.
* @see java.util.Locale.IsoCountryCode
* @throws NullPointerException if type is null
* @return a {@code Set} of ISO country codes for the specified type.
* @since 9
*/
public static Set<String> getISOCountries(IsoCountryCode type) {
Objects.requireNonNull(type);
return IsoCountryCode.retrieveISOCountryCodes(type);
}
/**
* Returns a list of all 2-letter language codes defined in ISO 639.
* Can be used to create Locales.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2016, 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
@ -231,7 +231,7 @@ class LocaleISOData {
+ "AI" + "AIA" // Anguilla
+ "AL" + "ALB" // Albania, People's Socialist Republic of
+ "AM" + "ARM" // Armenia
+ "AN" + "ANT" // Netherlands Antilles
// + "AN" + "ANT" // Netherlands Antilles
+ "AO" + "AGO" // Angola, Republic of
+ "AQ" + "ATA" // Antarctica (the territory South of 60 deg S)
+ "AR" + "ARG" // Argentina, Argentine Republic
@ -477,6 +477,29 @@ class LocaleISOData {
+ "ZW" + "ZWE" // Zimbabwe
;
/**
* Array to hold country codes for ISO3166-3.
*/
static final String[] ISO3166_3 = {
"AIDJ", "ANHH", "BQAQ", "BUMM", "BYAA", "CSHH", "CSXX", "CTKI", "DDDE",
"DYBJ", "FQHH", "FXFR", "GEHH", "HVBF", "JTUM", "MIUM", "NHVU", "NQAQ",
"NTHH", "PCHH", "PUUM", "PZPA", "RHZW", "SKIN", "SUHH", "TPTL", "VDVN",
"WKUM", "YDYE", "YUCS", "ZRCD"
};
/**
* This method computes a set of ISO3166-1 alpha-3 country codes from
* existing isoCountryTable.
*/
static Set<String> computeISO3166_1Alpha3Countries() {
int tableLength = isoCountryTable.length();
String[] isoTable = new String[tableLength / 5];
for (int i = 0, index = 0; index < tableLength; i++, index += 5) {
isoTable[i] = isoCountryTable.substring(index + 2, index + 5);
}
return Set.of(isoTable);
}
private LocaleISOData() {
}
}

View File

@ -650,6 +650,7 @@ public abstract class ResourceBundle {
private Locale locale;
private KeyElementReference<ClassLoader> loaderRef;
private KeyElementReference<Module> moduleRef;
private KeyElementReference<Module> callerRef;
// bundle format which is necessary for calling
@ -680,7 +681,7 @@ public abstract class ResourceBundle {
// Boolean.TRUE if the factory method caller provides a ResourceBundleProvier.
private Boolean callerHasProvider;
CacheKey(String baseName, Locale locale, ClassLoader loader, Module module) {
CacheKey(String baseName, Locale locale, ClassLoader loader, Module module, Module caller) {
Objects.requireNonNull(module);
this.name = baseName;
@ -691,6 +692,8 @@ public abstract class ResourceBundle {
this.loaderRef = new KeyElementReference<>(loader, referenceQueue, this);
}
this.moduleRef = new KeyElementReference<>(module, referenceQueue, this);
this.callerRef = new KeyElementReference<>(caller, referenceQueue, this);
calculateHashCode();
}
@ -726,6 +729,10 @@ public abstract class ResourceBundle {
return moduleRef.get();
}
Module getCallerModule() {
return callerRef.get();
}
ServiceLoader<ResourceBundleProvider> getProviders() {
if (!providersChecked) {
providers = getServiceLoader(getModule(), name);
@ -767,6 +774,8 @@ public abstract class ResourceBundle {
}
ClassLoader loader = getLoader();
Module module = getModule();
Module caller = getCallerModule();
return (otherEntry.loaderRef != null)
// with a null reference we can no longer find
// out which class loader or module was referenced; so
@ -774,7 +783,9 @@ public abstract class ResourceBundle {
&& (loader != null)
&& (loader == otherEntry.getLoader())
&& (module != null)
&& (module.equals(otherEntry.getModule()));
&& (module.equals(otherEntry.getModule()))
&& (caller != null)
&& (caller.equals(otherEntry.getCallerModule()));
} catch (NullPointerException | ClassCastException e) {
}
return false;
@ -796,6 +807,10 @@ public abstract class ResourceBundle {
if (module != null) {
hashCodeCache ^= module.hashCode();
}
Module caller = getCallerModule();
if (caller != null) {
hashCodeCache ^= caller.hashCode();
}
}
@Override
@ -808,6 +823,9 @@ public abstract class ResourceBundle {
}
clone.moduleRef = new KeyElementReference<>(getModule(),
referenceQueue, clone);
clone.callerRef = new KeyElementReference<>(getCallerModule(),
referenceQueue, clone);
// Clear the reference to ResourceBundleProviders and the flag
clone.providers = null;
clone.providersChecked = false;
@ -1665,7 +1683,7 @@ public abstract class ResourceBundle {
// loader, and module will never change during the bundle loading
// process. We have to make sure that the locale is set before
// using it as a cache key.
CacheKey cacheKey = new CacheKey(baseName, locale, loader, module);
CacheKey cacheKey = new CacheKey(baseName, locale, loader, module, callerModule);
ResourceBundle bundle = null;
// Quick lookup of the cache.
@ -1869,7 +1887,7 @@ public abstract class ResourceBundle {
bundle = loadBundleFromProviders(baseName,
targetLocale,
cacheKey.getProviders(),
cacheKey);
cacheKey);
}
}
@ -2303,8 +2321,9 @@ public abstract class ResourceBundle {
private static void clearCache(ClassLoader loader, Module module) {
Set<CacheKey> set = cacheList.keySet();
set.stream().filter((key) -> (key.getLoader() == loader && key.getModule() == module))
.forEach(set::remove);
set.stream()
.filter((key) -> (key.getLoader() == loader && key.getModule() == module))
.forEach(set::remove);
}
/**

View File

@ -65,36 +65,37 @@ import java.util.function.ToLongFunction;
* common mutable reduction tasks:
*
* <pre>{@code
* // Accumulate names into a List
* List<String> list = people.stream().map(Person::getName).collect(Collectors.toList());
* // Accumulate names into a List
* List<String> list = people.stream()
* .map(Person::getName)
* .collect(Collectors.toList());
*
* // Accumulate names into a TreeSet
* Set<String> set = people.stream().map(Person::getName).collect(Collectors.toCollection(TreeSet::new));
* // Accumulate names into a TreeSet
* Set<String> set = people.stream()
* .map(Person::getName)
* .collect(Collectors.toCollection(TreeSet::new));
*
* // Convert elements to strings and concatenate them, separated by commas
* String joined = things.stream()
* .map(Object::toString)
* .collect(Collectors.joining(", "));
* // Convert elements to strings and concatenate them, separated by commas
* String joined = things.stream()
* .map(Object::toString)
* .collect(Collectors.joining(", "));
*
* // Compute sum of salaries of employee
* int total = employees.stream()
* .collect(Collectors.summingInt(Employee::getSalary)));
* // Compute sum of salaries of employee
* int total = employees.stream()
* .collect(Collectors.summingInt(Employee::getSalary));
*
* // Group employees by department
* Map<Department, List<Employee>> byDept
* = employees.stream()
* .collect(Collectors.groupingBy(Employee::getDepartment));
* // Group employees by department
* Map<Department, List<Employee>> byDept = employees.stream()
* .collect(Collectors.groupingBy(Employee::getDepartment));
*
* // Compute sum of salaries by department
* Map<Department, Integer> totalByDept
* = employees.stream()
* .collect(Collectors.groupingBy(Employee::getDepartment,
* Collectors.summingInt(Employee::getSalary)));
* // Compute sum of salaries by department
* Map<Department, Integer> totalByDept = employees.stream()
* .collect(Collectors.groupingBy(Employee::getDepartment,
* Collectors.summingInt(Employee::getSalary)));
*
* // Partition students into passing and failing
* Map<Boolean, List<Student>> passingFailing =
* students.stream()
* .collect(Collectors.partitioningBy(s -> s.getGrade() >= PASS_THRESHOLD));
* // Partition students into passing and failing
* Map<Boolean, List<Student>> passingFailing = students.stream()
* .collect(Collectors.partitioningBy(s -> s.getGrade() >= PASS_THRESHOLD));
*
* }</pre>
*
@ -248,8 +249,8 @@ public final class Collectors {
*
* @param <T> the type of the input elements
* @param <C> the type of the resulting {@code Collection}
* @param collectionFactory a {@code Supplier} which returns a new, empty
* {@code Collection} of the appropriate type
* @param collectionFactory a supplier providing a new empty {@code Collection}
* into which the results will be inserted
* @return a {@code Collector} which collects all the input elements into a
* {@code Collection}, in encounter order
*/
@ -384,9 +385,11 @@ public final class Collectors {
* {@code partitioningBy}. For example, given a stream of
* {@code Person}, to accumulate the set of last names in each city:
* <pre>{@code
* Map<City, Set<String>> lastNamesByCity
* = people.stream().collect(groupingBy(Person::getCity,
* mapping(Person::getLastName, toSet())));
* Map<City, Set<String>> lastNamesByCity
* = people.stream().collect(
* groupingBy(Person::getCity,
* mapping(Person::getLastName,
* toSet())));
* }</pre>
*
* @param <T> the type of the input elements
@ -424,9 +427,11 @@ public final class Collectors {
* {@code partitioningBy}. For example, given a stream of
* {@code Order}, to accumulate the set of line items for each customer:
* <pre>{@code
* Map<String, Set<LineItem>> itemsByCustomerName
* = orders.stream().collect(groupingBy(Order::getCustomerName,
* flatMapping(order -> order.getLineItems().stream(), toSet())));
* Map<String, Set<LineItem>> itemsByCustomerName
* = orders.stream().collect(
* groupingBy(Order::getCustomerName,
* flatMapping(order -> order.getLineItems().stream(),
* toSet())));
* }</pre>
*
* @param <T> the type of the input elements
@ -468,9 +473,11 @@ public final class Collectors {
* {@code Employee}, to accumulate the employees in each department that have a
* salary above a certain threshold:
* <pre>{@code
* Map<Department, Set<Employee>> wellPaidEmployeesByDepartment
* = employees.stream().collect(groupingBy(Employee::getDepartment,
* filtering(e -> e.getSalary() > 2000, toSet())));
* Map<Department, Set<Employee>> wellPaidEmployeesByDepartment
* = employees.stream().collect(
* groupingBy(Employee::getDepartment,
* filtering(e -> e.getSalary() > 2000,
* toSet())));
* }</pre>
* A filtering collector differs from a stream's {@code filter()} operation.
* In this example, suppose there are no employees whose salary is above the
@ -491,7 +498,7 @@ public final class Collectors {
*/
public static <T, A, R>
Collector<T, ?, R> filtering(Predicate<? super T> predicate,
Collector<? super T, A, R> downstream) {
Collector<? super T, A, R> downstream) {
BiConsumer<A, ? super T> downstreamAccumulator = downstream.accumulator();
return new CollectorImpl<>(downstream.supplier(),
(r, t) -> {
@ -508,8 +515,9 @@ public final class Collectors {
* transformation. For example, one could adapt the {@link #toList()}
* collector to always produce an immutable list with:
* <pre>{@code
* List<String> list
* = people.stream().collect(collectingAndThen(toList(), Collections::unmodifiableList));
* List<String> list = people.stream().collect(
* collectingAndThen(toList(),
* Collections::unmodifiableList));
* }</pre>
*
* @param <T> the type of the input elements
@ -829,9 +837,11 @@ public final class Collectors {
* <p>For example, given a stream of {@code Person}, to calculate tallest
* person in each city:
* <pre>{@code
* Comparator<Person> byHeight = Comparator.comparing(Person::getHeight);
* Map<City, Optional<Person>> tallestByCity
* = people.stream().collect(groupingBy(Person::getCity, reducing(BinaryOperator.maxBy(byHeight))));
* Comparator<Person> byHeight = Comparator.comparing(Person::getHeight);
* Map<City, Optional<Person>> tallestByCity
* = people.stream().collect(
* groupingBy(Person::getCity,
* reducing(BinaryOperator.maxBy(byHeight))));
* }</pre>
*
* @param <T> element type for the input and output of the reduction
@ -882,10 +892,13 @@ public final class Collectors {
* <p>For example, given a stream of {@code Person}, to calculate the longest
* last name of residents in each city:
* <pre>{@code
* Comparator<String> byLength = Comparator.comparing(String::length);
* Map<City, String> longestLastNameByCity
* = people.stream().collect(groupingBy(Person::getCity,
* reducing("", Person::getLastName, BinaryOperator.maxBy(byLength))));
* Comparator<String> byLength = Comparator.comparing(String::length);
* Map<City, String> longestLastNameByCity
* = people.stream().collect(
* groupingBy(Person::getCity,
* reducing("",
* Person::getLastName,
* BinaryOperator.maxBy(byLength))));
* }</pre>
*
* @param <T> the type of the input elements
@ -969,9 +982,11 @@ public final class Collectors {
*
* <p>For example, to compute the set of last names of people in each city:
* <pre>{@code
* Map<City, Set<String>> namesByCity
* = people.stream().collect(groupingBy(Person::getCity,
* mapping(Person::getLastName, toSet())));
* Map<City, Set<String>> namesByCity
* = people.stream().collect(
* groupingBy(Person::getCity,
* mapping(Person::getLastName,
* toSet())));
* }</pre>
*
* @implNote
@ -1016,9 +1031,12 @@ public final class Collectors {
* <p>For example, to compute the set of last names of people in each city,
* where the city names are sorted:
* <pre>{@code
* Map<City, Set<String>> namesByCity
* = people.stream().collect(groupingBy(Person::getCity, TreeMap::new,
* mapping(Person::getLastName, toSet())));
* Map<City, Set<String>> namesByCity
* = people.stream().collect(
* groupingBy(Person::getCity,
* TreeMap::new,
* mapping(Person::getLastName,
* toSet())));
* }</pre>
*
* @implNote
@ -1036,8 +1054,8 @@ public final class Collectors {
* @param <M> the type of the resulting {@code Map}
* @param classifier a classifier function mapping input elements to keys
* @param downstream a {@code Collector} implementing the downstream reduction
* @param mapFactory a function which, when called, produces a new empty
* {@code Map} of the desired type
* @param mapFactory a supplier providing a new empty {@code Map}
* into which the results will be inserted
* @return a {@code Collector} implementing the cascaded group-by operation
*
* @see #groupingBy(Function, Collector)
@ -1127,7 +1145,7 @@ public final class Collectors {
* <p>The classification function maps elements to some key type {@code K}.
* The downstream collector operates on elements of type {@code T} and
* produces a result of type {@code D}. The resulting collector produces a
* {@code Map<K, D>}.
* {@code ConcurrentMap<K, D>}.
*
* <p>There are no guarantees on the type, mutability, or serializability
* of the {@code ConcurrentMap} returned.
@ -1135,9 +1153,11 @@ public final class Collectors {
* <p>For example, to compute the set of last names of people in each city,
* where the city names are sorted:
* <pre>{@code
* ConcurrentMap<City, Set<String>> namesByCity
* = people.stream().collect(groupingByConcurrent(Person::getCity,
* mapping(Person::getLastName, toSet())));
* ConcurrentMap<City, Set<String>> namesByCity
* = people.stream().collect(
* groupingByConcurrent(Person::getCity,
* mapping(Person::getLastName,
* toSet())));
* }</pre>
*
* @param <T> the type of the input elements
@ -1172,17 +1192,19 @@ public final class Collectors {
* <p>The classification function maps elements to some key type {@code K}.
* The downstream collector operates on elements of type {@code T} and
* produces a result of type {@code D}. The resulting collector produces a
* {@code Map<K, D>}.
* {@code ConcurrentMap<K, D>}.
*
* <p>For example, to compute the set of last names of people in each city,
* where the city names are sorted:
* <pre>{@code
* ConcurrentMap<City, Set<String>> namesByCity
* = people.stream().collect(groupingBy(Person::getCity, ConcurrentSkipListMap::new,
* mapping(Person::getLastName, toSet())));
* ConcurrentMap<City, Set<String>> namesByCity
* = people.stream().collect(
* groupingByConcurrent(Person::getCity,
* ConcurrentSkipListMap::new,
* mapping(Person::getLastName,
* toSet())));
* }</pre>
*
*
* @param <T> the type of the input elements
* @param <K> the type of the keys
* @param <A> the intermediate accumulation type of the downstream collector
@ -1190,8 +1212,8 @@ public final class Collectors {
* @param <M> the type of the resulting {@code ConcurrentMap}
* @param classifier a classifier function mapping input elements to keys
* @param downstream a {@code Collector} implementing the downstream reduction
* @param mapFactory a function which, when called, produces a new empty
* {@code ConcurrentMap} of the desired type
* @param mapFactory a supplier providing a new empty {@code ConcurrentMap}
* into which the results will be inserted
* @return a concurrent, unordered {@code Collector} implementing the cascaded group-by operation
*
* @see #groupingByConcurrent(Function)
@ -1311,7 +1333,7 @@ public final class Collectors {
* {@code Map} whose keys and values are the result of applying the provided
* mapping functions to the input elements.
*
* <p>If the mapped keys contains duplicates (according to
* <p>If the mapped keys contain duplicates (according to
* {@link Object#equals(Object)}), an {@code IllegalStateException} is
* thrown when the collection operation is performed. If the mapped keys
* may have duplicates, use {@link #toMap(Function, Function, BinaryOperator)}
@ -1327,16 +1349,18 @@ public final class Collectors {
* For example, the following produces a {@code Map} mapping
* students to their grade point average:
* <pre>{@code
* Map<Student, Double> studentToGPA
* students.stream().collect(toMap(Function.identity(),
* student -> computeGPA(student)));
* Map<Student, Double> studentToGPA
* = students.stream().collect(
* toMap(Function.identity(),
* student -> computeGPA(student)));
* }</pre>
* And the following produces a {@code Map} mapping a unique identifier to
* students:
* <pre>{@code
* Map<String, Student> studentIdToStudent
* students.stream().collect(toMap(Student::getId,
* Function.identity());
* Map<String, Student> studentIdToStudent
* = students.stream().collect(
* toMap(Student::getId,
* Function.identity()));
* }</pre>
*
* @implNote
@ -1375,7 +1399,7 @@ public final class Collectors {
* mapping functions to the input elements.
*
* <p>If the mapped
* keys contains duplicates (according to {@link Object#equals(Object)}),
* keys contain duplicates (according to {@link Object#equals(Object)}),
* the value mapping function is applied to each equal element, and the
* results are merged using the provided merging function.
*
@ -1389,13 +1413,14 @@ public final class Collectors {
* more flexible merge policies. For example, if you have a stream
* of {@code Person}, and you want to produce a "phone book" mapping name to
* address, but it is possible that two persons have the same name, you can
* do as follows to gracefully deals with these collisions, and produce a
* do as follows to gracefully deal with these collisions, and produce a
* {@code Map} mapping names to a concatenated list of addresses:
* <pre>{@code
* Map<String, String> phoneBook
* people.stream().collect(toMap(Person::getName,
* Person::getAddress,
* (s, a) -> s + ", " + a));
* Map<String, String> phoneBook
* = people.stream().collect(
* toMap(Person::getName,
* Person::getAddress,
* (s, a) -> s + ", " + a));
* }</pre>
*
* @implNote
@ -1437,7 +1462,7 @@ public final class Collectors {
* mapping functions to the input elements.
*
* <p>If the mapped
* keys contains duplicates (according to {@link Object#equals(Object)}),
* keys contain duplicates (according to {@link Object#equals(Object)}),
* the value mapping function is applied to each equal element, and the
* results are merged using the provided merging function. The {@code Map}
* is created by a provided supplier function.
@ -1459,8 +1484,8 @@ public final class Collectors {
* @param mergeFunction a merge function, used to resolve collisions between
* values associated with the same key, as supplied
* to {@link Map#merge(Object, Object, BiFunction)}
* @param mapSupplier a function which returns a new, empty {@code Map} into
* which the results will be inserted
* @param mapFactory a supplier providing a new empty {@code Map}
* into which the results will be inserted
* @return a {@code Collector} which collects elements into a {@code Map}
* whose keys are the result of applying a key mapping function to the input
* elements, and whose values are the result of applying a value mapping
@ -1473,13 +1498,13 @@ public final class Collectors {
*/
public static <T, K, U, M extends Map<K, U>>
Collector<T, ?, M> toMap(Function<? super T, ? extends K> keyMapper,
Function<? super T, ? extends U> valueMapper,
BinaryOperator<U> mergeFunction,
Supplier<M> mapSupplier) {
Function<? super T, ? extends U> valueMapper,
BinaryOperator<U> mergeFunction,
Supplier<M> mapFactory) {
BiConsumer<M, T> accumulator
= (map, element) -> map.merge(keyMapper.apply(element),
valueMapper.apply(element), mergeFunction);
return new CollectorImpl<>(mapSupplier, accumulator, mapMerger(mergeFunction), CH_ID);
return new CollectorImpl<>(mapFactory, accumulator, mapMerger(mergeFunction), CH_ID);
}
/**
@ -1487,7 +1512,7 @@ public final class Collectors {
* {@code ConcurrentMap} whose keys and values are the result of applying
* the provided mapping functions to the input elements.
*
* <p>If the mapped keys contains duplicates (according to
* <p>If the mapped keys contain duplicates (according to
* {@link Object#equals(Object)}), an {@code IllegalStateException} is
* thrown when the collection operation is performed. If the mapped keys
* may have duplicates, use
@ -1500,19 +1525,21 @@ public final class Collectors {
* It is common for either the key or the value to be the input elements.
* In this case, the utility method
* {@link java.util.function.Function#identity()} may be helpful.
* For example, the following produces a {@code Map} mapping
* For example, the following produces a {@code ConcurrentMap} mapping
* students to their grade point average:
* <pre>{@code
* Map<Student, Double> studentToGPA
* students.stream().collect(toMap(Function.identity(),
* student -> computeGPA(student)));
* ConcurrentMap<Student, Double> studentToGPA
* = students.stream().collect(
* toConcurrentMap(Function.identity(),
* student -> computeGPA(student)));
* }</pre>
* And the following produces a {@code Map} mapping a unique identifier to
* students:
* And the following produces a {@code ConcurrentMap} mapping a
* unique identifier to students:
* <pre>{@code
* Map<String, Student> studentIdToStudent
* students.stream().collect(toConcurrentMap(Student::getId,
* Function.identity());
* ConcurrentMap<String, Student> studentIdToStudent
* = students.stream().collect(
* toConcurrentMap(Student::getId,
* Function.identity()));
* }</pre>
*
* <p>This is a {@link Collector.Characteristics#CONCURRENT concurrent} and
@ -1546,7 +1573,7 @@ public final class Collectors {
* {@code ConcurrentMap} whose keys and values are the result of applying
* the provided mapping functions to the input elements.
*
* <p>If the mapped keys contains duplicates (according to {@link Object#equals(Object)}),
* <p>If the mapped keys contain duplicates (according to {@link Object#equals(Object)}),
* the value mapping function is applied to each equal element, and the
* results are merged using the provided merging function.
*
@ -1560,13 +1587,14 @@ public final class Collectors {
* more flexible merge policies. For example, if you have a stream
* of {@code Person}, and you want to produce a "phone book" mapping name to
* address, but it is possible that two persons have the same name, you can
* do as follows to gracefully deals with these collisions, and produce a
* {@code Map} mapping names to a concatenated list of addresses:
* do as follows to gracefully deal with these collisions, and produce a
* {@code ConcurrentMap} mapping names to a concatenated list of addresses:
* <pre>{@code
* Map<String, String> phoneBook
* people.stream().collect(toConcurrentMap(Person::getName,
* Person::getAddress,
* (s, a) -> s + ", " + a));
* ConcurrentMap<String, String> phoneBook
* = people.stream().collect(
* toConcurrentMap(Person::getName,
* Person::getAddress,
* (s, a) -> s + ", " + a));
* }</pre>
*
* <p>This is a {@link Collector.Characteristics#CONCURRENT concurrent} and
@ -1603,7 +1631,7 @@ public final class Collectors {
* {@code ConcurrentMap} whose keys and values are the result of applying
* the provided mapping functions to the input elements.
*
* <p>If the mapped keys contains duplicates (according to {@link Object#equals(Object)}),
* <p>If the mapped keys contain duplicates (according to {@link Object#equals(Object)}),
* the value mapping function is applied to each equal element, and the
* results are merged using the provided merging function. The
* {@code ConcurrentMap} is created by a provided supplier function.
@ -1620,8 +1648,8 @@ public final class Collectors {
* @param mergeFunction a merge function, used to resolve collisions between
* values associated with the same key, as supplied
* to {@link Map#merge(Object, Object, BiFunction)}
* @param mapSupplier a function which returns a new, empty {@code Map} into
* which the results will be inserted
* @param mapFactory a supplier providing a new empty {@code ConcurrentMap}
* into which the results will be inserted
* @return a concurrent, unordered {@code Collector} which collects elements into a
* {@code ConcurrentMap} whose keys are the result of applying a key mapping
* function to the input elements, and whose values are the result of
@ -1636,11 +1664,11 @@ public final class Collectors {
Collector<T, ?, M> toConcurrentMap(Function<? super T, ? extends K> keyMapper,
Function<? super T, ? extends U> valueMapper,
BinaryOperator<U> mergeFunction,
Supplier<M> mapSupplier) {
Supplier<M> mapFactory) {
BiConsumer<M, T> accumulator
= (map, element) -> map.merge(keyMapper.apply(element),
valueMapper.apply(element), mergeFunction);
return new CollectorImpl<>(mapSupplier, accumulator, mapMerger(mergeFunction), CH_CONCURRENT_ID);
return new CollectorImpl<>(mapFactory, accumulator, mapMerger(mergeFunction), CH_CONCURRENT_ID);
}
/**

View File

@ -331,7 +331,9 @@ class ZipFile implements ZipConstants, Closeable {
ZipFileInputStream in = null;
synchronized (this) {
ensureOpen();
if (!zc.isUTF8() && (entry.flag & EFS) != 0) {
if (Objects.equals(lastEntryName, entry.name)) {
pos = lastEntryPos;
} else if (!zc.isUTF8() && (entry.flag & EFS) != 0) {
pos = zsrc.getEntryPos(zc.getBytesUTF8(entry.name), false);
} else {
pos = zsrc.getEntryPos(zc.getBytes(entry.name), false);
@ -526,6 +528,9 @@ class ZipFile implements ZipConstants, Closeable {
Spliterator.IMMUTABLE | Spliterator.NONNULL), false);
}
private String lastEntryName;
private int lastEntryPos;
/* Checks ensureOpen() before invoke this method */
private ZipEntry getZipEntry(String name, byte[] bname, int pos) {
byte[] cen = zsrc.cen;
@ -563,6 +568,8 @@ class ZipFile implements ZipConstants, Closeable {
e.comment = zc.toString(cen, start, clen);
}
}
lastEntryName = e.name;
lastEntryPos = pos;
return e;
}

View File

@ -28,8 +28,10 @@ package jdk.internal.jmod;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Iterator;
import java.util.stream.Stream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
@ -39,9 +41,9 @@ import java.util.zip.ZipFile;
*/
public class JmodFile implements AutoCloseable {
// jmod magic number and version number
public static final int JMOD_MAJOR_VERSION = 0x01;
public static final int JMOD_MINOR_VERSION = 0x00;
public static final byte[] JMOD_MAGIC_NUMBER = {
private static final int JMOD_MAJOR_VERSION = 0x01;
private static final int JMOD_MINOR_VERSION = 0x00;
private static final byte[] JMOD_MAGIC_NUMBER = {
0x4A, 0x4D, /* JM */
JMOD_MAJOR_VERSION, JMOD_MINOR_VERSION, /* version 1.0 */
};
@ -175,6 +177,10 @@ public class JmodFile implements AutoCloseable {
this.zipfile = new ZipFile(file.toFile());
}
public static void writeMagicNumber(OutputStream os) throws IOException {
os.write(JMOD_MAGIC_NUMBER);
}
/**
* Returns the {@code Entry} for a resource in a JMOD file section
* or {@code null} if not found.

View File

@ -156,6 +156,7 @@ module java.base {
exports jdk.internal.misc to
java.corba,
java.desktop,
jdk.incubator.httpclient,
java.logging,
java.management,
java.naming,
@ -199,7 +200,7 @@ module java.base {
java.management,
jdk.jvmstat;
exports sun.net to
java.httpclient;
jdk.incubator.httpclient;
exports sun.net.ext to
jdk.net;
exports sun.net.dns to
@ -210,6 +211,7 @@ module java.base {
jdk.jconsole,
jdk.naming.dns;
exports sun.net.www to
jdk.incubator.httpclient,
java.desktop,
jdk.jartool;
exports sun.net.www.protocol.http to

View File

@ -24,9 +24,9 @@
#
# Translators please note do not translate the options themselves
java.launcher.opt.header = Verwendung: {0} [options] class [args...]\n (zur Ausf\u00FChrung einer Klasse)\n oder {0} [options] -jar jarfile [args...]\n (zur Ausf\u00FChrung einer JAR-Datei)\n oder {0} [options] -mp <modulepath> -m <modulename>[/<mainclass>] [args...]\n (zur Ausf\u00FChrung der Hauptklasse in einem Modul)\nwobei "options" Folgendes umfasst:\n
java.launcher.opt.header = Verwendung: {0} [Optionen] Klasse [Argumente...]\n (zur Ausf\u00FChrung einer Klasse)\n oder {0} [Optionen] -jar JAR-Datei [Argumente...]\n (zur Ausf\u00FChrung einer JAR-Datei)\n oder {0} [Optionen] -p <Modulpfad> -m <Modulname>[/<Hauptklasse>] [Argumente...]\n (zur Ausf\u00FChrung der Hauptklasse in einem Modul)\nwobei "Optionen" Folgendes umfasst:\n
java.launcher.opt.datamodel =\ -d{0}\t Verwendet ein {0}-Bit-Datenmodell, sofern verf\u00FCgbar\n
java.launcher.opt.datamodel =\ -d{0}\t Veraltet, wird in einem zuk\u00FCnftigen Release entfernt\n
java.launcher.opt.vmselect =\ {0}\t zur Auswahl der "{1}" VM\n
java.launcher.opt.hotspot =\ {0}\t ist ein Synonym f\u00FCr die "{1}" VM [verworfen]\n
@ -34,11 +34,11 @@ java.launcher.ergo.message1 =\ Die Standard-VM ist {0}
java.launcher.ergo.message2 =\ weil die Ausf\u00FChrung auf einem Server-Class-Rechner erfolgt.\n
# Translators please note do not translate the options themselves
java.launcher.opt.footer =-cp <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n -classpath <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n Eine durch {0} getrennte Liste mit Verzeichnissen, JAR-Archiven\n und ZIP-Archiven zur Suche nach Klassendateien.\n -mp <Modulpfad>\n -modulepath <Modulpfad>...\n Eine durch {0} getrennte Liste mit Verzeichnissen, in der jedes Verzeichnis\n ein Modulverzeichnis darstellt.\n -upgrademodulepath <Modulpfad>...\n Eine durch {0} getrennte Liste mit Verzeichnissen, in der jedes Verzeichnis\n ein Verzeichnis von Modulen darstellt, die upgradef\u00E4hige\n Module im Laufzeitimage ersetzen\n -m <modulename>[/<mainclass>]\n Das aufzul\u00F6sende anf\u00E4ngliche Modul und der Name der auszuf\u00FChrenden Hauptklasse,\n wenn nicht durch das Modul angegeben\n -addmods <modulename>[,<modulename>...]\n Root-Module, die zus\u00E4tzlich zum anf\u00E4nglichen Modul aufgel\u00F6st werden sollen\n -limitmods <modulename>[,<modulename>...]\n Gesamtzahl der beobachtbaren Module einschr\u00E4nken\n -listmods[:<modulename>[,<modulename>...]]\n Beobachtbare Module auflisten und Vorgang beenden\n --dry-run VM erstellen, aber Hauptmethode nicht ausf\u00FChren.\n Diese dry-run-Option kann n\u00FCtzlich sein, um\n Befehlszeilenoptionen wie die Modulsystemkonfiguration zu validieren.\n -D<name>=<value>\n Systemeigenschaft festlegen\n -verbose:[class|gc|jni]\n Verbose-Ausgabe aktivieren\n -version Produktversion drucken und Vorgang beenden\n -showversion Produktversion drucken und fortfahren\n -? -help Diese Hilfemeldung drucken\n -X Hilfe zu Nicht-Standardoptionen drucken\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n Assertions mit angegebener Granularit\u00E4t aktivieren\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n Assertions mit angegebener Granularit\u00E4t deaktivieren\n -esa | -enablesystemassertions\n System-Assertions aktivieren\n -dsa | -disablesystemassertions\n System-Assertions deaktivieren\n -agentlib:<libname>[=<options>]\n Native Agent Library <libname> laden, z.\u00A0B. -agentlib:jdwp,\n siehe auch -agentlib:jdwp=help\n -agentpath:<pathname>[=<options>]\n Native Agent Library nach vollst\u00E4ndigem Pfadnamen laden\n -javaagent:<jarpath>[=<options>]\n Agent f\u00FCr Java-Programmiersprachen laden, siehe java.lang.instrument\n -splash:<imagepath>\n Startbildschirm mit angegebenem Bild anzeigen\n @<filepath> Optionen aus der angegebenen Datei lesen\n
java.launcher.opt.footer =\ -cp <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n -classpath <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n --class-path <Klassensuchpfad von Verzeichnissen und ZIP-/JAR-Dateien>\n Eine durch {0} getrennte Liste mit Verzeichnissen, JAR-Archiven\n und ZIP-Archiven zur Suche nach Klassendateien.\n -p <Modulpfad>\n --module-path <Modulpfad>...\n Eine durch {0} getrennte Liste mit Verzeichnissen, wobei jedes Verzeichnis\n ein Modulverzeichnis ist.\n --upgrade-module-path <Modulpfad>...\n Eine durch {0} getrennte Liste mit Verzeichnissen, wobei jedes Verzeichnis\n ein Verzeichnis mit Modulen ist, die upgradef\u00E4hige\n Module im Laufzeitimage ersetzen\n -m <Modul>[/<Hauptklasse>]\n --module <Modulname>[/<Hauptklasse>]\n Das anf\u00E4ngliche aufzul\u00F6sende Modul und der Name der auszuf\u00FChrenden\n Hauptklasse, wenn nicht durch das Modul angegeben\n --add-modules <Modulname>[,<Modulname>...]\n Zus\u00E4tzlich zu dem anf\u00E4nglichen Modul aufzul\u00F6sende Root-Module.\n <Modulname> kann auch ALL-DEFAULT, ALL-SYSTEM,\n ALL-MODULE-PATH sein.\n --limit-modules <Modulname>[,<Modulname>...]\n Begrenzt die gesamten beobachtbaren Module\n --list-modules [<Modulname>[,<Modulname>...]]\n F\u00FChrt die beobachtbaren Module auf und beendet den Vorgang\n --dry-run Erstellt VM, f\u00FChrt jedoch die Hauptmethode nicht aus.\n Diese --dry-run-Option kann zur Validierung der Befehlszeilenoptionen\n n\u00FCtzlich sein, wie der Modulsystemkonfiguration.\n -D<Name>=<Wert>\n Setzt eine Systemeigenschaft\n -verbose:[class|gc|jni]\n Aktiviert Verbose-Ausgabe\n -version Druckt Produktversion und beendet den Vorgang\n -showversion Druckt Produktversion und f\u00E4hrt fort\n -? -help --help\n Gibt diese Hilfemeldung aus\n -X Gibt Hilfe zu Nicht-Standardoptionen aus\n -ea[:<Packagename>...|:<Klassenname>]\n -enableassertions[:<Packagename>...|:<Klassenname>]\n Aktiviert Assertions mit angegebener Granularit\u00E4t\n -da[:<Packagename>...|:<Klassenname>]\n -disableassertions[:<Packagename>...|:<Klassenname>]\n Deaktiviert Assertions mit angegebener Granularit\u00E4t\n -esa | -enablesystemassertions\n Aktiviert System-Assertions\n -dsa | -disablesystemassertions\n Deaktiviert System-Assertions\n -agentlib:<Lib-Name>[=<Optionen>]\n L\u00E4dt native Agent Library <Lib-Name>, Beispiel: -agentlib:jdwp\n siehe auch -agentlib:jdwp=help\n -agentpath:<Pfadname>[=<Optionen>]\n L\u00E4dt native Agent Library nach vollst\u00E4ndigem Pfadnamen\n -javaagent:<JAR-Pfad>[=<Optionen>]\n L\u00E4dt Java-Programmiersprachen-Agent, siehe java.lang.instrument\n -splash:<Bildpfad>\n Zeigt Begr\u00FC\u00DFungsbildschirm mit angegebenem Bild an\n HiDPI-skalierte Bilder werden automatisch unterst\u00FCtzt und verwendet,\n sofern verf\u00FCgbar. Der nicht skalierte Bilddateiname, z.B. image.ext,\n muss immer als Argument an die Option -splash \u00FCbergeben werden.\n Das geeignetste skalierte Bild wird automatisch\n ausgew\u00E4hlt.\n Weitere Informationen finden Sie in der Dokumentation zu SplashScreen-API.\n @<Dateipfad> Liest Optionen aus der angegebenen Datei\nZur Angabe eines Arguments f\u00FCr eine lange Option k\u00F6nnen Sie --<Name>=<Wert> oder\n--<Name> <Wert> verwenden.\n
See Weitere Einzelheiten finden Sie unter http://www.oracle.com/technetwork/java/javase/documentation/index.html.
# Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xmixed Ausf\u00FChrung im gemischten Modus (Standard)\n -Xint Nur Ausf\u00FChrung im interpretierten Modus\n -Xbootclasspath/a:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n H\u00E4ngt an das Ende des Bootstrap Classpath an\n -Xdiag Zeigt zus\u00E4tzliche Diagnosemeldungen an\n -Xdiag:resolver Zeigt Resolver-Diagnosemeldungen an\n -Xnoclassgc Deaktiviert Klassen-Garbage Collection\n -Xincgc Aktiviert inkrementelle Garbage Collection\n -Xloggc:<file> Protokolliert GC-Status in einer Datei mit Zeitstempeln\n -Xbatch Deaktiviert Hintergrundkompilierung\n -Xms<size> Legt anf\u00E4ngliche Java-Heap-Gr\u00F6\u00DFe fest\n -Xmx<size> Legt maximale Java-Heap-Gr\u00F6\u00DFe fest\n -Xss<size> Legt Java-Threadstackgr\u00F6\u00DFe fest\n -Xprof Gibt CPU-Profilingdaten aus\n -Xfuture Aktiviert strengste Pr\u00FCfungen, antizipiert zuk\u00FCnftigen Standardwert\n -Xrs Reduziert Verwendung von BS-Signalen durch Java/VM (siehe Dokumentation)\n -Xcheck:jni F\u00FChrt zus\u00E4tzliche Pr\u00FCfungen f\u00FCr JNI-Funktionen durch\n -Xshare:off Kein Versuch, gemeinsame Klassendaten zu verwenden\n -Xshare:auto Verwendet gemeinsame Klassendaten, wenn m\u00F6glich (Standard)\n -Xshare:on Erfordert die Verwendung gemeinsamer Klassendaten, sonst verl\u00E4uft der Vorgang nicht erfolgreich.\n -XshowSettings Zeigt alle Einstellungen an und f\u00E4hrt fort\n -XshowSettings:all\n Zeigt alle Einstellungen an und f\u00E4hrt fort\n -XshowSettings:vm Zeigt alle VM-bezogenen Einstellungen an und f\u00E4hrt fort\n -XshowSettings:properties\n Zeigt alle Eigenschaftseinstellungen an und f\u00E4hrt fort\n -XshowSettings:locale\n Zeigt alle gebietsschemabezogenen Einstellungen an und f\u00E4hrt fort\n -XaddReads:<module>=<other-module>(,<other-module>)*\n <module> liest andere Module\n unabh\u00E4ngig von der Moduldeklaration\n -XaddExports:<module>/<package>=<other-module>(,<other-module>)*\n <module> exportiert <package> in andere Module\n unabh\u00E4ngig von der Moduldeklaration\n -Xpatch:<module>=<file>({0}<file>)*\n Modul mit Klassen und Ressourcen in JAR-Dateien oder Verzeichnissen\n au\u00DFer Kraft setzen oder erg\u00E4nzen\n -Xdisable-@files Deaktiviert weitere Argumentdateierweiterung\n\nDie -X-Optionen sind keine Standardoptionen und k\u00F6nnen ohne Vorank\u00FCndigung ge\u00E4ndert werden.\n
java.launcher.X.usage=\ -Xbatch Deaktiviert Hintergrundkompilierung\n -Xbootclasspath/a:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n an Ende von Bootstrap-Klassenpfad anh\u00E4ngen\n -Xcheck:jni F\u00FChrt zus\u00E4tzliche Pr\u00FCfungen f\u00FCr JNI-Funktionen aus\n -Xcomp Erzwingt Kompilierung von Methoden beim ersten Aufruf\n -Xdebug Wird zur Abw\u00E4rtskompatiblit\u00E4t bereitgestellt\n -Xdiag Zeigt zus\u00E4tzliche Diagnosemeldungen\n -Xdiag:resolver Zeigt Resolver-Diagnosemeldungen\n -Xdisable-@files Deaktiviert das weitere Einblenden der Argumentdatei\n -Xfuture Aktiviert strengste Pr\u00FCfungen, als m\u00F6glicher zuk\u00FCnftiger Standardwert erwartet\n -Xint Nur Ausf\u00FChrung im interpretierten Modus\n -Xinternalversion\n Zeigt detailliertere JVM-Versionsinformationen an als die\n -version-Option\n -Xloggc:<file> Protokolliert GC-Status in einer Datei mit Zeitstempeln\n -Xmixed Ausf\u00FChrung im gemischten Modus (Standard)\n -Xmn<size> Setzt die anf\u00E4ngliche und maximale Gr\u00F6\u00DFe (in Byte) des Heaps\n f\u00FCr die junge Generation (Nursery)\n -Xms<size> Setzt die anf\u00E4ngliche Java-Heap-Gr\u00F6\u00DFe\n -Xmx<size> Setzt die maximale Java-Heap-Gr\u00F6\u00DFe\n -Xnoclassgc Deaktiviert die Klassen-Garbage Collection\n -Xprof Gibt CPU-Profilierungsdaten aus\n -Xrs Reduziert die Verwendung von BS-Signalen durch Java/VM (siehe Dokumentation)\n -Xshare:auto Verwendet freigegebene Klassendaten, wenn m\u00F6glich (Standard)\n -Xshare:off Versucht nicht, freigegebene Klassendaten zu verwenden\n -Xshare:on Erfordert die Verwendung von freigegebenen Klassendaten, verl\u00E4uft sonst nicht erfolgreich.\n -XshowSettings Zeigt alle Einstellungen und f\u00E4hrt fort\n -XshowSettings:all\n Zeigt alle Einstellungen und f\u00E4hrt fort\n -XshowSettings:locale\n Zeigt alle gebietsschemabezogenen Einstellungen und f\u00E4hrt fort\n -XshowSettings:properties\n Zeigt alle Eigenschaftseinstellungen und f\u00E4hrt fort\n -XshowSettings:vm Zeigt alle VM-bezogenen Einstellungen und f\u00E4hrt fort\n -Xss<size> Setzt Stackgr\u00F6\u00DFe des Java-Threads\n -Xverify Setzt den Modus der Bytecodeverifizierung\n --add-reads <Modul>=<Zielmodul>(,<Zielmodul>)*\n Aktualisiert <Modul>, damit <Zielmodul> gelesen wird, ungeachtet \n der Moduldeklaration. \n <Zielmodul> kann ALL-UNNAMED sein, um alle unbenannten\n Module zu lesen.\n --add-exports <Modul>/<Package>=<Zielmodul>(,<Zielmodul>)*\n Aktualisiert <Modul>, um <Package> in <Zielmodul> zu exportieren,\n ungeachtet der Moduldeklaration.\n <Zielmodul> kann ALL-UNNAMED sein, um in alle \n unbenannten Module zu exportieren.\n --patch-module <Modul>=<Datei>({0}<Datei>)*\n Setzt ein Modul au\u00DFer Kraft oder erweitert ein Modul mit Klassen und Ressourcen\n in JAR-Dateien oder -Verzeichnissen.\n\nDiese Optionen sind Nicht-Standardoptionen und k\u00F6nnen ohne Ank\u00FCndigung ge\u00E4ndert werden.\n
# Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\nDie folgenden Optionen sind f\u00FCr Mac OS X spezifisch:\n -XstartOnFirstThread\n main()-Methode f\u00FCr den ersten (AppKit) Thread ausf\u00FChren\n -Xdock:name=<application name>\n Den im Dock angezeigten Standardanwendungsnamen \u00FCberschreiben\n -Xdock:icon=<Pfad zu Symboldatei>\n Das im Dock angezeigte Standardsymbol \u00FCberschreiben\n\n

View File

@ -24,9 +24,9 @@
#
# Translators please note do not translate the options themselves
java.launcher.opt.header = Sintaxis: {0} [opciones] class [args...]\n (para ejecutar una clase)\n o {0} [opciones] -jar jarfile [args...]\n (para ejecutar un archivo jar)\n o {0} [opciones] -mp <ruta_m\u00F3dulo> -m <nombre_m\u00F3dulo>[/<clase_principal>] [args...]\n (para ejecutar una clase principal en un m\u00F3dulo)\ndonde las opciones incluyen:\n
java.launcher.opt.header = Sintaxis: {0} [opciones] class [argumentos...]\n (para ejecutar una clase)\n o {0} [opciones] -jar jarfile [argumentos...]\n (para ejecutar un archivo jar)\n o {0} [opciones] -p <ruta_m\u00F3dulo> -m <nombre_m\u00F3dulo>[/<clase_principal>] [argumentos...]\n (para ejecutar la clase principal en un m\u00F3dulo)\ndonde las opciones incluyen:\n
java.launcher.opt.datamodel =\ -d{0}\t usar un modelo de datos de {0} bits, si est\u00E1 disponible\n
java.launcher.opt.datamodel =\ -d{0}\t Anticuada, se eliminar\u00E1 en una versi\u00F3n futura\n
java.launcher.opt.vmselect =\ {0}\t para seleccionar la VM "{1}"\n
java.launcher.opt.hotspot =\ {0}\t es un sin\u00F3nimo de la VM "{1}" [anticuada]\n
@ -34,11 +34,12 @@ java.launcher.ergo.message1 =\ La VM por defecto es {0}
java.launcher.ergo.message2 =\ porque la ejecuci\u00F3n se est\u00E1 llevando a cabo en una m\u00E1quina de clase de servidor.\n
# Translators please note do not translate the options themselves
java.launcher.opt.footer =\ -cp <ruta de acceso de b\u00FAsqueda de clases de los directorios y archivos zip/jar>\n -classpath <ruta de acceso de b\u00FAsqueda de clases de los directorios y archivos zip/jar>\n Lista separada por {0} de directorios, archivos JAR\n y archivos ZIP para buscar archivos de clase.\n -mp <ruta_m\u00F3dulo>\n -modulepath <ruta_m\u00F3dulo>...\n Lista separada por {0} de directorios, cada directorio\n es un directorio de m\u00F3dulos.\n -upgrademodulepath <ruta_m\u00F3dulo>...\n Lista separada por {0} de directorios, cada directorio\n es un directorio de m\u00F3dulos que sustituye a los m\u00F3dulos\n actualizables en la imagen de tiempo de ejecuci\u00F3n\n -m <nombre_m\u00F3dulo>[/<clase_principal>]\n m\u00F3dulo inicial que resolver y nombre de la clase principal\n que ejecutar si el m\u00F3dulo no la especifica\n -addmods <nombre_m\u00F3dulo>[,<nombre_modulo>...]\n m\u00F3dulos ra\u00EDz que resolver, adem\u00E1s del m\u00F3dulo inicial\n -limitmods <nombre_m\u00F3dulo>[,<nombre_m\u00F3dulo>...]\n limitar el universo de los m\u00F3dulos observables\n -listmods[:<nombre_m\u00F3dulo>[,<nombre_m\u00F3dulo>...]]\n mostrar los m\u00F3dulos observables y salir\n --dry-run crear VM pero no ejecutar m\u00E9todo principal.\n Esta opci\u00F3n --dry-run puede ser \u00FAtil para validar las\n opciones de l\u00EDnea de comandos como la configuraci\u00F3n del sistema de m\u00F3dulo.\n -D<nombre>=<valor>\n definir una propiedad del sistema\n -verbose:[class|gc|jni]\n activar la salida detallada\n -version imprimir la versi\u00F3n del producto y salir\n -showversion imprimir la versi\u00F3n del producto y continuar\n -? -help imprimir este mensaje de ayuda\n -X imprimir la ayuda de opciones no est\u00E1ndar\n -ea[:<nombre_paquete>...|:<nombre_clase>]\n -enableassertions[:<nombre_paquete>...|:<nombre_clase>]\n activar afirmaciones con la granularidad especificada\n -da[:<nombre_paquete>...|:<nombre_clase>]\n -disableassertions[:<nombre_paquete>...|:<nombre_clase>]\n desactivar afirmaciones con la granularidad especificada\n -esa | -enablesystemassertions\n activar afirmaciones del sistema\n -dsa | -disablesystemassertions\n desactivar afirmaciones del sistema\n -agentlib:<nombre_bib>[=<opciones>]\n cargar biblioteca de agentes nativos <nombre_bib>, por ejemplo, -agentlib:jdwp\n ver tambi\u00E9n -agentlib:jdwp=help\n -agentpath:<nombre_ruta>[=<opciones>]\n cargar biblioteca de agentes nativos por ruta completa\n -javaagent:<ruta_jar>[=<opciones>]\n cargar agente de lenguaje de programaci\u00F3n Java, ver java.lang.instrument\n -splash:<ruta_imagen>\n mostrar pantalla de bienvenida con la imagen especificada\n @<ruta_archivo> leer opciones del archivo especificado\n
java.launcher.opt.footer =\ -cp <ruta de b\u00FAsqueda de clases de los directorios y archivos zip/jar>\n -classpath <ruta de b\u00FAsqueda de clases de los directorios y archivos zip/jar>\n --class-path <ruta de b\u00FAsqueda de clases de los directorios y archivos zip/jar>\n Lista separada por {0} de directorios, archivos JAR\n y archivos ZIP para buscar archivos de clase.\n -p <ruta_m\u00F3dulo>\n --module-path <ruta_m\u00F3dulo>...\n Lista separada por {0} de directorios, cada directorio\n es un directorio de m\u00F3dulos.\n --upgrade-module-path <ruta_m\u00F3dulo>...\n Lista separada por {0} de directorios, cada directorio\n es un directorio de m\u00F3dulos que sustituye a los m\u00F3dulos\n actualizables en la imagen de tiempo de ejecuci\u00F3n\n -m <m\u00F3dulo>[/<clase_principal>]\n --module <nombre_m\u00F3dulo>[/<clase_principal>]\n m\u00F3dulo inicial que resolver y nombre de la clase principal\n que ejecutar si el m\u00F3dulo no la especifica\n --add-modules <nombre_m\u00F3dulo>[,<nombre_m\u00F3dulo>...]\n m\u00F3dulos ra\u00EDz que resolver, adem\u00E1s del m\u00F3dulo inicial.\n <nombre_m\u00F3dulo> tambi\u00E9n puede ser ALL-DEFAULT, ALL-SYSTEM,\n ALL-MODULE-PATH.\n --limit-modules <nombre_m\u00F3dulo>[,<nombre_m\u00F3dulo>...]\n limitar el universo de los m\u00F3dulos observables\n --list-modules [<nombre_m\u00F3dulo>[,<nombre_m\u00F3dulo>...]]\n mostrar los m\u00F3dulos observables y salir\n --dry-run crear VM pero no ejecutar m\u00E9todo principal.\n Esta opci\u00F3n --dry-run puede ser \u00FAtil para validar las\n opciones de l\u00EDnea de comandos como la configuraci\u00F3n del sistema de m\u00F3dulo.\n -D<nombre>=<valor>\n definir una propiedad del sistema\n -verbose:[class|gc|jni]\n activar la salida detallada\n -version imprimir la versi\u00F3n del producto y salir\n -showversion imprimir la versi\u00F3n del producto y continuar\n -? -help --help\n imprimir este mensaje de ayuda\n -X imprimir la ayuda de opciones no est\u00E1ndar\n -ea[:<nombre_paquete>...|:<nombre_clase>]\n -enableassertions[:<nombre_paquete>...|:<nombre_clase>]\n activar afirmaciones con la granularidad especificada\n -da[:<nombre_paquete>...|:<nombre_clase>]\n -disableassertions[:<nombre_paquete>...|:<nombre_clase>]\n desactivar afirmaciones con la granularidad especificada\n -esa | -enablesystemassertions\n activar afirmaciones del sistema\n -dsa | -disablesystemassertions\n desactivar afirmaciones del sistema\n -agentlib:<nombre_bib>[=<opciones>]\n cargar biblioteca de agentes nativos <nombre_bib>, por ejemplo, -agentlib:jdwp\n ver tambi\u00E9n -agentlib:jdwp=help\n -agentpath:<nombre_ruta>[=<opciones>]\n cargar biblioteca de agentes nativos por nombre de ruta completo\n -javaagent:<ruta_jar>[=<opciones>]\n cargar agente de lenguaje de programaci\u00F3n Java, ver java.lang.instrument\n -splash:<ruta_imagen>\n mostrar pantalla de bienvenida con la imagen especificada\n Las im\u00E1genes a escala HiDPI est\u00E1n soportadas y se usan autom\u00E1ticamente\n si est\u00E1n disponibles. El nombre de archivo de la imagen sin escala, por ejemplo, image.ext,\n siempre debe transferirse como el argumento en la opci\u00F3n -splash.\n La imagen a escala m\u00E1s adecuada que se haya proporcionado se escoger\u00E1\n autom\u00E1ticamente.\n Consulte la documentaci\u00F3n de \
la API de la pantalla de bienvenida para obtener m\u00E1s informaci\u00F3n.\n en<ruta_archivo> leer opciones del archivo especificado\nPara especificar un argumento para una opci\u00F3n larga, puede usar --<nombre>=<valor> o\n--<nombre> <valor>.\n
See http://www.oracle.com/technetwork/java/javase/documentation/index.html para obtener m\u00E1s informaci\u00F3n.
# Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xmixed ejecuci\u00F3n de modo mixto (por defecto)\n -Xint solo ejecuci\u00F3n de modo interpretado\n -Xbootclasspath/a:<directorios y archivos zip/jar separados por {0}>\n agregar al final de la ruta de acceso de la clase de inicializaci\u00F3n de datos\n -Xdiag mostrar mensajes de diagn\u00F3stico adicionales\n -Xdiag:resolver mostrar mensajes de diagn\u00F3stico de resoluci\u00F3n\n -Xnoclassgc desactivar la recolecci\u00F3n de basura de clases\n -Xloggc:<archivo> registrar el estado de GC en un archivo con registros de hora\n -Xbatch desactivar compilaci\u00F3n en segundo plano\n -Xms<tama\u00F1o> definir tama\u00F1o de pila Java inicial\n -Xmx<tama\u00F1o> definir tama\u00F1o de pila Java m\u00E1ximo\n -Xss<tama\u00F1o> definir tama\u00F1o de la pila del thread de Java\n -Xprof datos de salida de creaci\u00F3n de perfil de CPU\n -Xfuture activar las comprobaciones m\u00E1s estrictas, anticip\u00E1ndose al futuro valor por defecto\n -Xrs reducir el uso de se\u00F1ales de sistema operativo por parte de Java/VM (consulte la documentaci\u00F3n)\n -Xcheck:jni realizar comprobaciones adicionales para las funciones de JNI\n -Xshare:off no intentar usar datos de clase compartidos\n -Xshare:auto usar datos de clase compartidos si es posible (valor por defecto)\n -Xshare:on es obligatorio el uso de datos de clase compartidos, de lo contrario se emitir\u00E1 un fallo.\n -XshowSettings show all settings and continue\n -XshowSettings:all\n mostrar todos los valores y continuar\n -XshowSettings:vm show all vm related settings and continue\n -XshowSettings:properties\n mostrar todos los valores y continuar\n -XshowSettings:locale\n mostrar todos los valores relacionados con la configuraci\u00F3n regional y continuar\n -XaddReads:<m\u00F3dulo>=<otro_m\u00F3dulo>(,<otro_m\u00F3dulo>)*\n <module> lee otros m\u00F3dulos,\n independientemente de la declaraci\u00F3n del m\u00F3dulo\n -XaddExports:<m\u00F3dulo>/<paquete>=<otro_m\u00F3dulo>(,<otro_m\u00F3dulo>)*\n <m\u00F3dulo> exporta <paquete> a otros m\u00F3dulos,\n independientemente de la declaraci\u00F3n del m\u00F3dulo\n -Xpatch:<m\u00F3dulo>=<archivo>({0}<archivo>)*\n Anular o aumentar un m\u00F3dulo con clases y recursos\n en directorios o archivos JAR\n -Xdisable-@files desactivar la ampliaci\u00F3n de archivos de argumentos\n\nLas opciones -X no son est\u00E1ndar y est\u00E1n sujetas a cambios sin previo aviso.\n
java.launcher.X.usage=\ -Xbatch desactivar compilaci\u00F3n de fondo\n -Xbootclasspath/a:<directorios y archivos zip/jar separados por {0}>\n agregar al final de la ruta de la clase de inicializaci\u00F3n de datos\n -Xcheck:jni realizar comprobaciones adicionales para las funciones de JNI\n -Xcomp fuerza la compilaci\u00F3n de m\u00E9todos en la primera llamada\n -Xdebug se proporciona para ofrecer compatibilidad con versiones anteriores\n -Xdiag mostrar mensajes de diagn\u00F3stico adicionales\n -Xdiag:resolver mostrar mensajes de diagn\u00F3stico de resoluci\u00F3n\n -Xdisable-@files desactivar la ampliaci\u00F3n de archivos de m\u00E1s argumentos\n -Xfuture activar las comprobaciones m\u00E1s estrictas, anticip\u00E1ndose al futuro valor por defecto\n -Xint solo ejecuci\u00F3n de modo interpretado\n -Xinternalversion\n muestra una informaci\u00F3n de la versi\u00F3n de JVM m\u00E1s detallada que la\n opci\u00F3n -version\n -Xloggc:<archivo> registrar el estado de GC en un archivo con registros de hora\n -Xmixed ejecuci\u00F3n de modo mixto (por defecto)\n -Xmn<tama\u00F1o> define el tama\u00F1o inicial y m\u00E1ximo (en bytes) de la pila\n para la generaci\u00F3n m\u00E1s joven (espacio infantil)\n -Xms<size> define el tama\u00F1o inicial de la pila de Java\n -Xmx<size> define el tama\u00F1o m\u00E1ximo de la pila de Java\n -Xnoclassgc desactivar la recolecci\u00F3n de basura de clases\n -Xprof datos de creaci\u00F3n de perfiles de CPU de salida\n -Xrs reducir el uso de se\u00F1ales de sistema operativo por parte de Java/VM (consulte la documentaci\u00F3n)\n -Xshare:auto usar datos de clase compartidos si es posible (valor por defecto)\n -Xshare:off no intentar usar datos de clase compartidos\n -Xshare:on es obligatorio el uso de datos de clase compartidos, de lo contrario se producir\u00E1 un fallo.\n -XshowSettings mostrar toda la configuraci\u00F3n y continuar\n -XshowSettings:all\n mostrar todos los valores y continuar\n -XshowSettings:locale\n mostrar todos los valores relacionados con la configuraci\u00F3n regional y continuar\n -XshowSettings:properties\n mostrar todos los valores de propiedad y continuar\n -XshowSettings:vm mostrar todos los valores relacionados con vm y continuar\n -Xss<tama\u00F1o> definir tama\u00F1o de la pila del thread de Java\n -Xverify define el modo del verificador de c\u00F3digo de bytes\n --add-reads <m\u00F3dulo>=<m\u00F3dulo-destino>(,<m\u00F3dulo-destino>)*\n actualiza <m\u00F3dulo> para leer <m\u00F3dulo-destino>, independientemente\n de la declaraci\u00F3n del m\u00F3dulo. \n <m\u00F3dulo-destino> puede ser ALL-UNNAMED para leer todos los\n m\u00F3dulos sin nombre.\n --add-exports <m\u00F3dulo>/<paquete>=<m\u00F3dulo-destino>(,<m\u00F3dulo-destino>)*\n actualiza <m\u00F3dulo> para exportar <paquete> en <m\u00F3dulo-destino>,\n independientemente de la declaraci\u00F3n del m\u00F3dulo.\n <m\u00F3dulo-destino> puede ser ALL-UNNAMED para exportar a todos los\n m\u00F3dulos sin nombre.\n --patch-module <m\u00F3dulo>=<archivo>({0}<archivo>)*\n Aumentar o anular un m\u00F3dulo con clases y recursos\n en directorios y archivos JAR\n\nEstas opciones no son est\u00E1ndar y est\u00E1n sujetas a cambio sin previo aviso.\n
# Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\nLas siguientes opciones son espec\u00EDficas para Mac OS X:\n -XstartOnFirstThread\n ejecutar el m\u00E9todo main() del primer thread (AppKit)\n -Xdock:name=<application name>\n sustituir al nombre por defecto de la aplicaci\u00F3n que se muestra en el Dock\n -Xdock:icon=<ruta de acceso a archivo de icono>\n sustituir al icono por defecto que se muestra en el Dock\n\n

View File

@ -24,9 +24,9 @@
#
# Translators please note do not translate the options themselves
java.launcher.opt.header = Syntaxe : {0} [options] class [args...]\n (pour l''ex\u00E9cution d''une classe)\n ou {0} [options] -jar jarfile [args...]\n (pour l''ex\u00E9cution d''un fichier JAR)\n ou {0} [options] -mp <modulepath> -m <modulename>[/<mainclass>] [args...]\n (pour l''ex\u00E9cution de la classe principale dans un module)\no\u00F9 options comprend les \u00E9l\u00E9ments suivants :\n
java.launcher.opt.header = Syntaxe : {0} [options] class [args...]\n (pour l''ex\u00E9cution d''une classe)\n ou {0} [options] -jar jarfile [args...]\n (pour l''ex\u00E9cution d''un fichier JAR)\n ou {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n (pour l''ex\u00E9cution de la classe principale dans un module)\no\u00F9 options comprend les \u00E9l\u00E9ments suivants :\n
java.launcher.opt.datamodel =\ -d{0}\t utilisez le mod\u00E8le de donn\u00E9es {0} bits s''il est disponible\n
java.launcher.opt.datamodel =\ -d{0}\t En phase d''abandon, sera enlev\u00E9 dans une version future\n
java.launcher.opt.vmselect =\ {0}\t pour s\u00E9lectionner la machine virtuelle "{1}"\n
java.launcher.opt.hotspot =\ {0}\t est un synonyme pour la machine virtuelle "{1}" [en phase d''abandon]\n
@ -34,11 +34,13 @@ java.launcher.ergo.message1 =\ La machine virtuelle par d\u00E
java.launcher.ergo.message2 =\ car vous ex\u00E9cutez une machine de classe de serveur.\n
# Translators please note do not translate the options themselves
java.launcher.opt.footer =\ -cp <chemin de recherche de classe de r\u00E9pertoires et de fichiers ZIP/JAR>\n -classpath <chemin de recherche de classe de r\u00E9pertoires et de fichiers ZIP/JAR>\n Liste de r\u00E9pertoires, d''archives JAR\n et d''archives ZIP s\u00E9par\u00E9s par des {0} dans laquelle rechercher les fichiers de classe.\n -mp <chemin de module>\n -modulepath <chemin de module>...\n Liste de r\u00E9pertoires s\u00E9par\u00E9s par des {0}, chaque r\u00E9pertoire\n est un r\u00E9pertoire de modules.\n -upgrademodulepath <chemin de module>...\n Liste de r\u00E9pertoires s\u00E9par\u00E9s par des {0}, chaque r\u00E9pertoire\n est un r\u00E9pertoire de modules qui remplace des modules\n pouvant \u00EAtre mis \u00E0 niveau dans l''image d''ex\u00E9cution\n -m <modulename>[/<mainclass>]\n module initial \u00E0 r\u00E9soudre et nom de la classe principale\n \u00E0 ex\u00E9cuter si elle n''est pas indiqu\u00E9e par le module\n -addmods <modulename>[,<modulename>...]\n modules racine \u00E0 r\u00E9soudre en plus du module initial\n -limitmods <modulename>[,<modulename>...]\n limitation de l''univers de modules observables\n -listmods[:<modulename>[,<modulename>...]]\n \u00E9num\u00E9ration des modules observables et fin de l''op\u00E9ration\n --dry-run cr\u00E9e une machine virtuelle mais n''ex\u00E9cute pas la m\u00E9thode principale.\n Cette option --dry-run peut s''av\u00E9rer utile pour la validation des\n options de ligne de commandes telles que la configuration syst\u00E8me de module.\n -D<nom>=<valeur>\n d\u00E9finition d''une propri\u00E9t\u00E9 syst\u00E8me\n -verbose:[class|gc|jni]\n activation de la sortie en mode verbose\n -version affichage de la version du produit et fin de l''op\u00E9ration\n -showversion affichage de la version du produit et poursuite de l''op\u00E9ration\n -? -help affichage du message d''aide\n -X affichage de l''aide sur les options non standard\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n activation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n d\u00E9sactivation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n -esa | -enablesystemassertions\n activation des assertions syst\u00E8me\n -dsa | -disablesystemassertions\n d\u00E9sactivation des assertions syst\u00E8me\n -agentlib:<libname>[=<options>]\n chargement de la biblioth\u00E8que d''agent natif <libname>, par exemple : -agentlib:jdwp\n voir aussi -agentlib:jdwp=help\n -agentpath:<pathname>[=<options>]\n chargement de la biblioth\u00E8que d''agent natif via le chemin d''acc\u00E8s complet\n -javaagent:<jarpath>[=<options>]\n chargement de l''agent du langage de programmation Java, voir java.lang.instrument\n -splash:<imagepath>\n affichage de l''\u00E9cran d''accueil avec l''image indiqu\u00E9e\n @<filepath> lire les options \u00E0 partir du fichier indiqu\u00E9\n
java.launcher.opt.footer =\ -cp <chemin de recherche de classe de r\u00E9pertoires et de fichiers ZIP/JAR>\n -classpath <chemin de recherche de classe de r\u00E9pertoires et de fichiers ZIP/JAR>\n --class-path <chemin de recherche de classe de r\u00E9pertoires et de fichiers ZIP/JAR>\n Liste de r\u00E9pertoires, d''archives JAR\n et d''archives ZIP s\u00E9par\u00E9s par des {0} dans laquelle rechercher les fichiers de classe.\n -p <chemin de module>\n --module-path <chemin de module>...\n Liste de r\u00E9pertoires s\u00E9par\u00E9s par des {0}, chaque r\u00E9pertoire\n est un r\u00E9pertoire de modules.\n --upgrade-module-path <chemin de module>...\n Liste de r\u00E9pertoires s\u00E9par\u00E9s par des {0}, chaque r\u00E9pertoire\n est un r\u00E9pertoire de modules qui remplace des modules\n pouvant \u00EAtre mis \u00E0 niveau dans l''image d''ex\u00E9cution\n -m <module>[/<mainclass>]\n --module <modulename>[/<mainclass>]\n module initial \u00E0 r\u00E9soudre et nom de la classe principale\n \u00E0 ex\u00E9cuter si elle n''est pas indiqu\u00E9e par le module\n --add-modules <modulename>[,<modulename>...]\n modules racine \u00E0 r\u00E9soudre en plus du module initial.\n <modulename> peut \u00E9galement \u00EAtre ALL-DEFAULT, ALL-SYSTEM,\n ALL-MODULE-PATH.\n --limit-modules <modulename>[,<modulename>...]\n limitation de l''univers de modules observables\n --list-modules [<modulename>[,<modulename>...]]\n \u00E9num\u00E9ration des modules observables et fin de l''op\u00E9ration\n --dry-run cr\u00E9e une machine virtuelle mais n''ex\u00E9cute pas la m\u00E9thode principale.\n Cette option --dry-run peut s''av\u00E9rer utile pour la validation des\n options de ligne de commandes telles que la configuration syst\u00E8me de module.\n -D<nom>=<valeur>\n d\u00E9finition d''une propri\u00E9t\u00E9 syst\u00E8me\n -verbose:[class|gc|jni]\n activation de la sortie en mode verbose\n -version affichage de la version du produit et fin de l''op\u00E9ration\n -showversion affichage de la version du produit et poursuite de l''op\u00E9ration\n -? -help --help\n affichage du message d''aide\n -X affichage de l''aide sur les options non standard\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n activation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n d\u00E9sactivation des assertions avec la granularit\u00E9 sp\u00E9cifi\u00E9e\n -esa | -enablesystemassertions\n activation des assertions syst\u00E8me\n -dsa | -disablesystemassertions\n d\u00E9sactivation des assertions syst\u00E8me\n -agentlib:<libname>[=<options>]\n chargement de la biblioth\u00E8que d''agent natif <libname>, par exemple : -agentlib:jdwp\n voir aussi -agentlib:jdwp=help\n -agentpath:<pathname>[=<options>]\n chargement de la biblioth\u00E8que d''agent natif via le chemin d''acc\u00E8s complet\n -javaagent:<jarpath>[=<options>]\n chargement de l''agent du langage de programmation Java, voir java.lang.instrument\n -splash:<imagepath>\n affichage de l''\u00E9cran d''accueil avec l''image indiqu\u00E9e\n Les images redimensionn\u00E9es HiDPI sont automatiquement prises en charge et utilis\u00E9es\n si elles sont disponibles. Le nom de fichier d''une image non redimensionn\u00E9e, par ex. image.ext,\n doit toujours \
\u00EAtre transmis comme argument \u00E0 l''option -splash.\n L''image redimensionn\u00E9e fournie la plus appropri\u00E9e sera automatiquement\n s\u00E9lectionn\u00E9e.\n Pour plus d''informations, reportez-vous \u00E0 la documentation relative \u00E0 l''API SplashScreen.\n @<filepath> lire les options \u00E0 partir du fichier indiqu\u00E9\nPour indiquer un argument pour une option longue, vous pouvez utiliser --<name>=<value> ou\n--<name> <value>.\n
See http://www.oracle.com/technetwork/java/javase/documentation/index.html pour plus de d\u00E9tails.
# Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xmixed ex\u00E9cution en mode mixte (valeur par d\u00E9faut)\n -Xint ex\u00E9cution en mode interpr\u00E9t\u00E9 uniquement\n -Xbootclasspath/a:<r\u00E9pertoires et fichiers ZIP/JAR s\u00E9par\u00E9s par des {0}>\n ajout \u00E0 la fin du chemin de classe bootstrap\n -Xdiag affichage de messages de diagnostic suppl\u00E9mentaires\n -Xdiag:resolver affichage de messages de diagnostic du r\u00E9solveur\n -Xnoclassgc d\u00E9sactivation du nettoyage de la m\u00E9moire de la classe\n -Xloggc:<file> journalisation du statut de nettoyage de la m\u00E9moire dans un fichier avec horodatage\n -Xbatch d\u00E9sactivation de la compilation en arri\u00E8re-plan\n -Xms<size> d\u00E9finition de la taille initiale des portions de m\u00E9moire Java\n -Xmx<size> d\u00E9finition de la taille maximale des portions de m\u00E9moire Java\n -Xss<size> d\u00E9finition de la taille de pile de threads Java\n -Xprof sortie des donn\u00E9es de profilage d''UC\n -Xfuture activation des contr\u00F4les les plus stricts en vue d''anticiper la future valeur par d\u00E9faut\n -Xrs r\u00E9duction de l''utilisation des signaux d''OS par Java/la machine virtuelle (voir documentation)\n -Xcheck:jni ex\u00E9cution de contr\u00F4les suppl\u00E9mentaires pour les fonctions JNI\n -Xshare:off aucune tentative d''utilisation des donn\u00E9es de classe partag\u00E9e\n -Xshare:auto utilisation des donn\u00E9es de classe partag\u00E9e si possible (valeur par d\u00E9faut)\n -Xshare:on utilisation des donn\u00E9es de classe partag\u00E9e obligatoire ou \u00E9chec de l''op\u00E9ration\n -XshowSettings affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:all\n affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:vm affichage de tous les param\u00E8tres de machine virtuelle et poursuite de l''op\u00E9ration\n -XshowSettings:properties\n affichage de tous les param\u00E8tres de propri\u00E9t\u00E9 et poursuite de l''op\u00E9ration\n -XshowSettings:locale\n affichage de tous les param\u00E8tres d''environnement local et poursuite de l''op\u00E9ration\n -XaddReads:<module>=<other-module>(,<other-module>)*\n <module> lecture de tous les modules,\n quelle que soit la d\u00E9claration de module\n -XaddExports:<module>/<package>=<other-module>(,<other-module>)*\n <module> exporte <package> vers d''autres modules,\n quelle que soit la d\u00E9claration de module\n -Xpatch:<module>=<file>({0}<file>)*\n Remplacement ou augmentation d''un module avec des classes et des ressources\n dans des fichiers ou r\u00E9pertoires JAR\n -Xdisable-@files d\u00E9sactivation d''autres d\u00E9veloppements de fichier d''argument\n\nLes options -X ne sont pas standard et sont susceptibles de modification sans pr\u00E9avis.\n
java.launcher.X.usage=\ -Xbatch d\u00E9sactivation de la compilation en arri\u00E8re-plan\n -Xbootclasspath/a:<r\u00E9pertoires et fichiers ZIP/JAR s\u00E9par\u00E9s par des {0}>\n ajout \u00E0 la fin du chemin de classe bootstrap\n -Xcheck:jni ex\u00E9cution de contr\u00F4les suppl\u00E9mentaires pour les fonctions JNI\n -Xcomp force la compilation de m\u00E9thodes au premier appel\n -Xdebug fourni pour la compatibilit\u00E9 amont\n -Xdiag affichage de messages de diagnostic suppl\u00E9mentaires\n -Xdiag:resolver affichage de messages de diagnostic du r\u00E9solveur\n -Xdisable-@files d\u00E9sactivation d''autres d\u00E9veloppements de fichier d''argument\n -Xfuture activation des contr\u00F4les les plus stricts en vue d''anticiper la future valeur par d\u00E9faut\n -Xint ex\u00E9cution en mode interpr\u00E9t\u00E9 uniquement\n -Xinternalversion\n affiche des informations de version JVM plus d\u00E9taill\u00E9es que\n l''option -version\n -Xloggc:<file> journalisation du statut de l''op\u00E9ration de ramasse-miette dans un fichier avec horodatage\n -Xmixed ex\u00E9cution en mode mixte (valeur par d\u00E9faut)\n -Xmn<size> d\u00E9finit les tailles initiale et maximale (en octets) de la portion de m\u00E9moire\n pour la jeune g\u00E9n\u00E9ration (nursery)\n -Xms<size> d\u00E9finition de la taille initiale des portions de m\u00E9moire Java\n -Xmx<size> d\u00E9finition de la taille maximale des portions de m\u00E9moire Java\n -Xnoclassgc d\u00E9sactivation de l''op\u00E9ration de ramasse-miette de la classe\n -Xprof sortie des donn\u00E9es de profilage d''UC\n -Xrs r\u00E9duction de l''utilisation des signaux OS par Java/la machine virtuelle (voir documentation)\n -Xshare:auto utilisation des donn\u00E9es de classe partag\u00E9es si possible (valeur par d\u00E9faut)\n -Xshare:off aucune tentative d''utilisation des donn\u00E9es de classe partag\u00E9es\n -Xshare:on utilisation des donn\u00E9es de classe partag\u00E9es obligatoire ou \u00E9chec de l''op\u00E9ration\n -XshowSettings affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:all\n affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:locale\n affichage de tous les param\u00E8tres d''environnement local et poursuite de l''op\u00E9ration\n -XshowSettings:properties\n affichage de tous les param\u00E8tres de propri\u00E9t\u00E9 et poursuite de l''op\u00E9ration\n -XshowSettings:vm affichage de tous les param\u00E8tres de machine virtuelle et poursuite de l''op\u00E9ration\n -Xss<size> d\u00E9finition de la taille de pile de threads Java\n -Xverify d\u00E9finit le mode du v\u00E9rificateur de code ex\u00E9cutable\n --add-reads <module>=<target-module>(,<target-module>)*\n met \u00E0 jour <module> pour lire <target-module>, sans tenir compte\n de la d\u00E9claration de module. \n <target-module> peut \u00EAtre ALL-UNNAMED pour lire tous les modules\n sans nom.\n --add-exports <module>/<package>=<target-module>(,<target-module>)*\n met \u00E0 jour <module> pour exporter <package> vers <target-module>,\n sans tenir compte de la d\u00E9claration de module.\n <target-module> peut \u00EAtre ALL-UNNAMED pour effectuer un export vers tous\n les modules sans nom.\n --patch-module <module>=<file>({0}<file>)*\n Remplacement ou augmentation d''un module avec des classes et des ressources\n dans des \
fichiers ou des r\u00E9pertoires JAR.\n\nCes options ne sont pas standard et peuvent \u00EAtre modifi\u00E9es sans pr\u00E9avis.\n
# Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\nLes options suivantes sont propres \u00E0 Mac OS X :\n -XstartOnFirstThread\n ex\u00E9cute la m\u00E9thode main() sur le premier thread (AppKit)\n -Xdock:name=<nom d'application>\n remplace le nom d'application par d\u00E9faut affich\u00E9 dans l'ancrage\n -Xdock:icon=<chemin vers le fichier d'ic\u00F4ne>\n remplace l'ic\u00F4ne par d\u00E9faut affich\u00E9e dans l'ancrage\n\n

View File

@ -24,9 +24,9 @@
#
# Translators please note do not translate the options themselves
java.launcher.opt.header = Uso: {0} [options] class [args...]\n (per eseguire una classe)\n oppure {0} [options] -jar jarfile [args...]\n (per eseguire un file jar)\n oppure {0} [options] -mp <percorsomodulo> -m <nomemodulo>[/<classeprincipale>] [args...]\n (per eseguire la classe principale in un modulo)\nin cui options include:\n
java.launcher.opt.header = Uso: {0} [opzioni] class [argomenti...]\n (per eseguire una classe)\n oppure {0} [opzioni] -jar jarfile [argomenti...]\n (per eseguire un file jar)\n oppure {0} [opzioni] -p <percorsomodulo> -m <nomemodulo>[/<classeprincipale>] [argomenti...]\n (per eseguire la classe principale in un modulo)\ndove opzioni include:\n
java.launcher.opt.datamodel =\ -d{0}\t usare un modello di dati {0}-bit se disponibile\n
java.launcher.opt.datamodel =\ -d{0}\t opzione non pi\u00F9 valida; verr\u00E0 rimossa in una release futura\n
java.launcher.opt.vmselect =\ {0}\t per selezionare la VM "{1}"\n
java.launcher.opt.hotspot =\ {0}\t \u00E8 un sinonimo per la VM "{1}" [non valido]\n
@ -34,11 +34,12 @@ java.launcher.ergo.message1 =\ La VM predefinita \u00E8 {0}
java.launcher.ergo.message2 =\ perch\u00E9 si utilizza un computer di classe server.\n
# Translators please note do not translate the options themselves
java.launcher.opt.footer =\ -cp <classpath di ricerca di directory e file zip/jar>\n -classpath <classpath di ricerca di directory e file zip/jar>\n Lista separata da {0} di directory e di archivi JAR\n e ZIP utilizzata per la ricerca di file di classe.\n -mp <percorso modulo>\n -modulepath <percorso modulo>...\n Lista separata da {0} di directory; ciascuna directory\n \u00E8 una directory di moduli.\n -upgrademodulepath <percorso modulo>...\n Lista separata da {0} di directory; ciascuna directory\n \u00E8 una directory dei moduli che sostituiscono i moduli\n aggiornabili nell''immagine in fase di esecuzione.\n -m <nome modulo>[/<classe principale>]\n Il modulo iniziale da risolvere e il nome della classe\n principale da eseguire se non specificata dal modulo.\n -addmods <nome modulo>[,<nome modulo>...]\n Moduli root da risolvere in aggiunta al modulo iniziale.\n -limitmods <nome modulo>[,<nome modulo>...]\n Limita l''universe dei moduli osservabili.\n -listmods[:<nome modulo>[,<nome modulo>...]]\n Elenca i moduli osservabili ed esce.\n --dry-run Crea la VM ma non esegue il metodo principale.\n Pu\u00F2 essere utile, ad esempio, per la convalida delle opzioni della\n riga di comando utilizzate per la configurazione del sistema di moduli.\n -D<nome>=<valore>\n Imposta una propriet\u00E0 di sistema.\n -verbose:[class|gc|jni]\n Abilita l''output descrittivo.\n -version Visualizza la versione del prodotto ed esce.\n -showversion Visualizza la versione del prodotto e continua\n -? -help Visualizza questo messaggio della Guida.\n -X Visualizza la Guida relativa alle opzioni non standard.\n -ea[:<nome package>...|:<nome classe>]\n -enableassertions[:<nome package>...|:<nome classe>]\n Abilita le asserzioni con la granularit\u00E0 specificata.\n -da[:<nome package>...|:<nome classe>]\n -disableassertions[:<nome package>...|:<nome classe>]\n Disabilita le asserzioni con la granularit\u00E0 specificata.\n -esa | -enablesystemassertions\n Abilita le asserzioni di sistema.\n -dsa | -disablesystemassertions\n Disabilita le asserzioni di sistema.\n -agentlib:<nome libreria>[=<opzioni>]\n Carica la libreria agenti nativa <nome libreria>, ad esempio -agentlib:jdwp.\n Vedere anche -agentlib:jdwp=help.\n -agentpath:<nome percorso>[=<opzioni>]\n Carica la libreria agenti nativa con il percorso completo.\n -javaagent:<percorso jar>[=<opzioni>]\n Carica l''agente del linguaggio di programmazione Java. Vedere java.lang.instrument.\n -splash:<percorso immagine>\n Mostra la schermata iniziale con l''immagine specificata.\n @<percorso file> Legge le opzioni dal file specificato.\n
java.launcher.opt.footer =\ -cp <classpath di ricerca di directory e file zip/jar>\n -classpath <classpath di ricerca di directory e file zip/jar>\n --class-path <classpath di ricerca di directory e file zip/jar>\n Lista separata da {0} di directory e di archivi JAR\n e ZIP utilizzata per la ricerca di file di classe.\n -p <percorso modulo>\n -module-path <percorso modulo>...\n Lista separata da {0} di directory; ciascuna directory\n \u00E8 una directory di moduli.\n -upgrade-module-path <percorso modulo>...\n Lista separata da {0} di directory; ciascuna directory\n \u00E8 una directory dei moduli che sostituiscono i moduli\n aggiornabili nell''immagine in fase di esecuzione.\n -m <modulo>[/<classe principale>]\n --module <nome modulo>[/<classe principale>]\n Il modulo iniziale da risolvere e il nome della classe\n principale da eseguire se non specificata dal modulo.\n -add-modules <nome modulo>[,<nome modulo>...]\n Moduli root da risolvere in aggiunta al modulo iniziale.\n <nome modulo> pu\u00F2 essere anche ALL-DEFAULT, ALL-SYSTEM,\n ALL-MODULE-PATH.\n -limit-modules <nome modulo>[,<nome modulo>...]\n Limita l''universe dei moduli osservabili.\n -list-modules[:<nome modulo>[,<nome modulo>...]]\n Elenca i moduli osservabili ed esce.\n --dry-run Crea la VM ma non esegue il metodo principale.\n Pu\u00F2 essere utile, ad esempio, per la convalida delle opzioni della\n riga di comando utilizzate per la configurazione del sistema di moduli.\n -D<nome>=<valore>\n Imposta una propriet\u00E0 di sistema.\n -verbose:[class|gc|jni]\n Abilita l''output descrittivo.\n -version Visualizza la versione del prodotto ed esce.\n -showversion Visualizza la versione del prodotto e continua\n -? -help --help\n Visualizza questo messaggio della Guida.\n -X Visualizza la Guida relativa alle opzioni non standard.\n -ea[:<nome package>...|:<nome classe>]\n -enableassertions[:<nome package>...|:<nome classe>]\n Abilita le asserzioni con la granularit\u00E0 specificata.\n -da[:<nome package>...|:<nome classe>]\n -disableassertions[:<nome package>...|:<nome classe>]\n Disabilita le asserzioni con la granularit\u00E0 specificata.\n -esa | -enablesystemassertions\n Abilita le asserzioni di sistema.\n -dsa | -disablesystemassertions\n Disabilita le asserzioni di sistema.\n -agentlib:<nome libreria>[=<opzioni>]\n Carica la libreria agenti nativa <nome libreria>, ad esempio -agentlib:jdwp.\n Vedere anche -agentlib:jdwp=help.\n -agentpath:<nome percorso>[=<opzioni>]\n Carica la libreria agenti nativa con il percorso completo.\n -javaagent:<percorso jar>[=<opzioni>]\n Carica l''agente del linguaggio di programmazione Java. Vedere java.lang.instrument.\n -splash:<percorso immagine>\n Mostra la schermata iniziale con l''immagine specificata.\n Le immagini ridimensionate HiDPI sono supportate e utilizzate automaticamente\n se disponibili. I nomi file delle immagini non ridimensionate, ad esempio image.ext,\n devono essere sempre passati come argomenti all''opzione -splash.\n Verr\u00E0 scelta automaticamente l''immagine ridimensionata pi\u00F9 appropriata\n fornita.\n Per ulteriori informazioni, vedere la documentazione relativa all''API SplashScreen.\n @<percorso file> legge le opzioni dal file specificato.\nPer specificare un argomento per un''opzione lunga, \u00E8 possibile \
utilizzare --<nome>=<valore> o\n--<nome> <valore>.
See Per ulteriori dettagli, vedere http://www.oracle.com/technetwork/java/javase/documentation/index.html.
# Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xmixed esecuzione in modalit\u00E0 mista (impostazione predefinita)\n -Xint esecuzione solo in modalit\u00E0 convertita\n -Xbootclasspath/a:<directory e file zip/jar separati da {0}>\n aggiunge alla fine del classpath di bootstrap\n -Xdiag mostra messaggi di diagnostica aggiuntivi\n -Xdiag:resolver mostra i messaggi di diagnostica del resolver\n -Xnoclassgc disabilita la garbage collection della classe\n -Xloggc:<file> registra lo stato GC in un file con indicatori orari\n -Xbatch disabilita la compilazione in background\n -Xms<size> imposta la dimensione heap Java iniziale\n -Xmx<size> imposta la dimensione heap Java massima\n -Xss<size> imposta la dimensione dello stack di thread Java\n -Xprof visualizza i dati di profilo della CPU\n -Xfuture abilita i controlli pi\u00F9 limitativi anticipando le impostazioni predefinite future\n -Xrs riduce l''uso di segnali del sistema operativo da Java/VM (vedere la documentazione)\n -Xcheck:jni esegue controlli aggiuntivi per le funzioni JNI\n -Xshare:off non tenta di utilizzare i dati della classe condivisi\n -Xshare:auto utilizza i dati di classe condivisi se possibile (impostazione predefinita)\n -Xshare:on richiede l''uso dei dati di classe condivisi, altrimenti l''esecuzione non riesce.\n -XshowSettings mostra tutte le impostazioni e continua\n -XshowSettings:all\n mostra tutte le impostazioni e continua\n -XshowSettings:vm mostra tutte le impostazioni correlate alla VM e continua\n -XshowSettings:properties\n mostra tutte le impostazioni delle propriet\u00E0 e continua\n -XshowSettings:locale\n mostra tutte le impostazioni correlate alle impostazioni nazionali e continua\n -XaddReads:<module>=<other-module>(,<other-module>)*\n <module> legge altri moduli,\n indipendentemente dalla dichiarazione del modulo\n -XaddExports:<module>/<package>=<other-module>(,<other-module>)*\n <module> esporta il <package> in altri moduli,\n indipendentemente dalla dichiarazione del modulo\n -Xpatch:<module>=<file>({0}<file>)*\n sostituisce o migliora un modulo con classi e risorse\n in file JAR o directory\n -Xdisable-@files disabilita l''ulteriore espansione del file di argomenti\n\nLe opzioni -X non sono opzioni standard e sono soggette a modifiche senza preavviso.\n
java.launcher.X.usage=\ -Xbatch disabilita la compilazione in background\n -Xbootclasspath/a:<directory e file zip/jar separati da {0}>\n aggiunge alla fine del classpath di bootstrap\n -Xcheck:jni esegue controlli aggiuntivi per le funzioni JNI\n -Xcomp forza la compilazione dei metodi al primo richiamo\n -Xdebug fornito per la compatibilit\u00E0 con le versioni precedenti\n -Xdiag mostra ulteriori messaggi diagnostici\n -Xdiag:resolver mostra i messaggi diagnostici del resolver\n -Xdisable-@files disabilita l''ulteriore espansione del file di argomenti\n -Xfuture abilita i controlli pi\u00F9 limitativi anticipando le impostazioni predefinite future\n -Xint esecuzione solo in modalit\u00E0 convertita\n -Xinternalversion\n visualizza informazioni pi\u00F9 dettagliate sulla versione JVM rispetto\n all''opzione -version\n -Xloggc:<file> registra lo stato GC in un file con indicatori orari\n -Xmixed esecuzione in modalit\u00E0 mista (impostazione predefinita)\n -Xmn<size> imposta le dimensioni iniziale e massima (in byte) dell''heap\n per la young generation (nursery)\n -Xms<size> imposta la dimensione heap Java iniziale\n -Xmx<size> imposta la dimensione heap Java massima\n -Xnoclassgc disabilta la garbage collection della classe\n -Xprof visualizza i dati di profilo della CPU\n -Xrs riduce l''uso di segnali del sistema operativo da Java/VM (vedere la documentazione)\n -Xshare:auto utilizza i dati di classe condivisi se possibile (impostazione predefinita)\n -Xshare:off non tenta di utilizzare i dati di classe condivisi\n -Xshare:on richiede l''uso dei dati di classe condivisi, altrimenti l''esecuzione non riesce.\n -XshowSettings mostra tutte le impostazioni e continua\n -XshowSettings:all\n mostra tutte le impostazioni e continua\n -XshowSettings:locale\n mostra tutte le impostazioni correlate alle impostazioni nazionali e continua\n -XshowSettings:properties\n mostra tutte le impostazioni delle propriet\u00E0 e continua\n -XshowSettings:vm mostra tutte le impostazioni correlate alla VM e continua\n -Xss<size> imposta la dimensione dello stack di thread Java\n -Xverify imposta la modalit\u00E0 del verificatore bytecode\n --add-reads:<module>=<target-module>(,<target-module>)*\n aggiorna <module> per leggere <target-module>, indipendentemente\n dalla dichiarazione del modulo.\n <target-module> pu\u00F2 essere ALL-UNNAMED per leggere tutti i\n moduli senza nome.\n -add-exports:<module>/<package>=<target-module>(,<target-module>)*\n aggiorna <module> per esportare <package> in <target-module>,\n indipendentemente dalla dichiarazione del modulo.\n <target-module> pu\u00F2 essere ALL-UNNAMED per esportare tutti i\n moduli senza nome.\n -patch-module <module>=<file>({0}<file>)*\n sostituisce o migliora un modulo con classi e risorse\n in file JAR o directory\n\nQueste opzioni non sono opzioni standard e sono soggette a modifiche senza preavviso.\n
# Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\nLe opzioni riportate di seguito sono specifiche del sistema operativo Mac OS X:\n -XstartOnFirstThread\n Esegue il metodo main() sul primo thread (AppKit).\n -Xdock:name=<nome applicazione>\n Sostituisce il nome applicazione predefinito visualizzato nel dock\n -Xdock:icon=<percorso file icona>\n Sostituisce l'icona predefinita visualizzata nel dock\n\n

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2007, 2016, 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
@ -24,9 +24,9 @@
#
# Translators please note do not translate the options themselves
java.launcher.opt.header = \u4F7F\u7528\u65B9\u6CD5: {0} [options] class [args...]\n (\u30AF\u30E9\u30B9\u3092\u5B9F\u884C\u3059\u308B\u5834\u5408)\n \u307E\u305F\u306F {0} [options] -jar jarfile [args...]\n (jar\u30D5\u30A1\u30A4\u30EB\u3092\u5B9F\u884C\u3059\u308B\u5834\u5408)\n \u307E\u305F\u306F {0} [options] -mp <modulepath> -m <modulename>[/<mainclass>] [args...]\n (\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u3092\u5B9F\u884C\u3059\u308B\u5834\u5408)\n\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n
java.launcher.opt.header = \u4F7F\u7528\u65B9\u6CD5: {0} [options] class [args...]\n (\u30AF\u30E9\u30B9\u3092\u5B9F\u884C\u3059\u308B\u5834\u5408)\n \u307E\u305F\u306F {0} [options] -jar jarfile [args...]\n (jar\u30D5\u30A1\u30A4\u30EB\u3092\u5B9F\u884C\u3059\u308B\u5834\u5408)\n \u307E\u305F\u306F {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n (\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u3092\u5B9F\u884C\u3059\u308B\u5834\u5408)\n\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n
java.launcher.opt.datamodel =\ -d{0}\t \u4F7F\u7528\u53EF\u80FD\u306A\u5834\u5408\u306F{0}\u30D3\u30C3\u30C8\u306E\u30C7\u30FC\u30BF\u30FB\u30E2\u30C7\u30EB\u3092\u4F7F\u7528\u3059\u308B\n
java.launcher.opt.datamodel =\ -d{0}\t \u63A8\u5968\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u4E88\u5B9A\u3067\u3059\n
java.launcher.opt.vmselect =\ {0}\t "{1}" VM\u3092\u9078\u629E\u3059\u308B\u5834\u5408\n
java.launcher.opt.hotspot =\ {0}\t \u306F"{1}" VM\u306E\u30B7\u30CE\u30CB\u30E0\u3067\u3059 [\u975E\u63A8\u5968]\n
@ -34,13 +34,13 @@ java.launcher.ergo.message1 =\ \u30C7\u30D5\u30A9\u30EB\u30C8V
java.launcher.ergo.message2 =\ \u3053\u308C\u306F\u30B5\u30FC\u30D0\u30FC\u30AF\u30E9\u30B9\u306E\u30DE\u30B7\u30F3\u3067\u5B9F\u884C\u3057\u3066\u3044\u308B\u305F\u3081\u3067\u3059\u3002\n
# Translators please note do not translate the options themselves
java.launcher.opt.footer =\ -cp <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n -classpath <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001\n JAR\u30A2\u30FC\u30AB\u30A4\u30D6\u304A\u3088\u3073ZIP\u30A2\u30FC\u30AB\u30A4\u30D6\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3002\n -mp <\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9>\n -modulepath <\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9>...\n \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3002\u5404\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\n \u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u3059\u3002\n -upgrademodulepath <\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9>...\n \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3002\u5404\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\n \u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30A4\u30E1\u30FC\u30B8\u3067\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C9\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u7F6E\u63DB\u3059\u308B\n \u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u3059\n -m <modulename>[/<mainclass>]\n \u89E3\u6C7A\u3059\u308B\u521D\u671F\u30E2\u30B8\u30E5\u30FC\u30EB\u304A\u3088\u3073\u30E2\u30B8\u30E5\u30FC\u30EB\u3067\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u306B\n \u5B9F\u884C\u3059\u308B\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u306E\u540D\u524D\n -addmods <modulename>[,<modulename>...]\n \u521D\u671F\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\u52A0\u3048\u3066\u89E3\u6C7A\u3059\u308B\u30EB\u30FC\u30C8\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\n -limitmods <modulename>[,<modulename>...]\n \u76E3\u8996\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30E6\u30CB\u30D0\u30FC\u30B9\u3092\u5236\u9650\u3059\u308B\n -listmods[:<modulename>[,<modulename>...]]\n \u76E3\u8996\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u30EA\u30B9\u30C8\u3057\u3066\u7D42\u4E86\u3059\u308B\n --dry-run VM\u3092\u4F5C\u6210\u3059\u308B\u304C\u3001\u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u306F\u5B9F\u884C\u3057\u306A\u3044\u3002\n \u3053\u306E--dry-run\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30B7\u30B9\u30C6\u30E0\u69CB\u6210\u306A\u3069\u306E\n \u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u691C\u8A3C\u3059\u308B\u5834\u5408\u306B\u4FBF\u5229\u3067\u3059\u3002\n -D<name>=<value>\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u8A2D\u5B9A\u3059\u308B\n -verbose:[class|gc|jni]\n \u8A73\u7D30\u306A\u51FA\u529B\u3092\u884C\u3046\n -version \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D42\u4E86\u3059\u308B\n -showversion \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D9A\u884C\u3059\u308B\n -? -help \u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B\n -X \u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u95A2\u3059\u308B\u30D8\u30EB\u30D7\u3092\u51FA\u529B\u3059\u308B\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n \
\u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -esa | -enablesystemassertions\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -dsa | -disablesystemassertions\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -agentlib:<libname>[=<options>]\n \u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA<libname>\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002\u4F8B: -agentlib:jdwp\n -agentlib:jdwp=help\u3082\u53C2\u7167\n -agentpath:<pathname>[=<options>]\n \u30D5\u30EB\u30D1\u30B9\u540D\u3067\u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u30ED\u30FC\u30C9\u3059\u308B\n -javaagent:<jarpath>[=<options>]\n Java\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002java.lang.instrument\u3092\u53C2\u7167\n -splash:<imagepath>\n \u6307\u5B9A\u3057\u305F\u30A4\u30E1\u30FC\u30B8\u3067\u30B9\u30D7\u30E9\u30C3\u30B7\u30E5\u753B\u9762\u3092\u8868\u793A\u3059\u308B\n @<filepath> \u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u8AAD\u307F\u53D6\u308B\n
java.launcher.opt.footer =\ -cp <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n -classpath <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n --class-path <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB\u306E\u30AF\u30E9\u30B9\u691C\u7D22\u30D1\u30B9>\n \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3001\n JAR\u30A2\u30FC\u30AB\u30A4\u30D6\u304A\u3088\u3073ZIP\u30A2\u30FC\u30AB\u30A4\u30D6\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3002\n -p <\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9>\n --module-path <\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9>...\n \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3002\u5404\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\n \u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u3059\u3002\n --upgrade-module-path <\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30D1\u30B9>...\n \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30EA\u30B9\u30C8\u3002\u5404\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\n \u30E9\u30F3\u30BF\u30A4\u30E0\u30FB\u30A4\u30E1\u30FC\u30B8\u3067\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C9\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u7F6E\u63DB\u3059\u308B\n \u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u3059\n -m <module>[/<mainclass>]\n --module <modulename>[/<mainclass>]\n \u89E3\u6C7A\u3059\u308B\u521D\u671F\u30E2\u30B8\u30E5\u30FC\u30EB\u304A\u3088\u3073\u30E2\u30B8\u30E5\u30FC\u30EB\u3067\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u306B\n \u5B9F\u884C\u3059\u308B\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u306E\u540D\u524D\n --add-modules <modulename>[,<modulename>...]\n \u521D\u671F\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\u52A0\u3048\u3066\u89E3\u6C7A\u3059\u308B\u30EB\u30FC\u30C8\u30FB\u30E2\u30B8\u30E5\u30FC\u30EB\u3002\n <modulename>\u306FALL-DEFAULT\u3001ALL-SYSTEM\u3001ALL-MODULE-PATH\n \u306B\u3059\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u3059\u3002\n --limit-modules <modulename>[,<modulename>...]\n \u53C2\u7167\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u9818\u57DF\u3092\u5236\u9650\u3059\u308B\n --list-modules [<modulename>[,<modulename>...]]\n \u53C2\u7167\u53EF\u80FD\u306A\u30E2\u30B8\u30E5\u30FC\u30EB\u306E\u4E00\u89A7\u3092\u8868\u793A\u3057\u3066\u7D42\u4E86\u3059\u308B\n --dry-run VM\u3092\u4F5C\u6210\u3059\u308B\u304C\u3001\u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u306F\u5B9F\u884C\u3057\u306A\u3044\u3002\n \u3053\u306E--dry-run\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001\u30E2\u30B8\u30E5\u30FC\u30EB\u30FB\u30B7\u30B9\u30C6\u30E0\u69CB\u6210\u306A\u3069\u306E\n \u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u691C\u8A3C\u3059\u308B\u5834\u5408\u306B\u4FBF\u5229\u3067\u3059\u3002\n -D<name>=<value>\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u8A2D\u5B9A\u3059\u308B\n -verbose:[class|gc|jni]\n \u8A73\u7D30\u306A\u51FA\u529B\u3092\u884C\u3046\n -version \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D42\u4E86\u3059\u308B\n -showversion \u88FD\u54C1\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u51FA\u529B\u3057\u3066\u7D9A\u884C\u3059\u308B\n -? -help --help\n \
\u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B\n -X \u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u95A2\u3059\u308B\u30D8\u30EB\u30D7\u3092\u51FA\u529B\u3059\u308B\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n \u6307\u5B9A\u3057\u305F\u7C92\u5EA6\u3067\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -esa | -enablesystemassertions\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u306B\u3059\u308B\n -dsa | -disablesystemassertions\n \u30B7\u30B9\u30C6\u30E0\u30FB\u30A2\u30B5\u30FC\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -agentlib:<libname>[=<options>]\n \u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA<libname>\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002\u4F8B: -agentlib:jdwp\n -agentlib:jdwp=help\u3082\u53C2\u7167\n -agentpath:<pathname>[=<options>]\n \u30D5\u30EB\u30D1\u30B9\u540D\u3067\u30CD\u30A4\u30C6\u30A3\u30D6\u30FB\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30FB\u30E9\u30A4\u30D6\u30E9\u30EA\u3092\u30ED\u30FC\u30C9\u3059\u308B\n -javaagent:<jarpath>[=<options>]\n Java\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3092\u30ED\u30FC\u30C9\u3059\u308B\u3002java.lang.instrument\u3092\u53C2\u7167\n -splash:<imagepath>\n \u6307\u5B9A\u3057\u305F\u30A4\u30E1\u30FC\u30B8\u3067\u30B9\u30D7\u30E9\u30C3\u30B7\u30E5\u753B\u9762\u3092\u8868\u793A\u3059\u308B\n \u53EF\u80FD\u3067\u3042\u308C\u3070\u3001HiDPI\u30B9\u30B1\u30FC\u30EB\u306E\u30A4\u30E1\u30FC\u30B8\u304C\u81EA\u52D5\u7684\u306B\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002\n \u30B9\u30B1\u30FC\u30EB\u306A\u3057\u306E\u30A4\u30E1\u30FC\u30B8\u306E\u30D5\u30A1\u30A4\u30EB\u540D(image.ext\u306A\u3069)\u306F\u3001\n \u5E38\u306B-splash\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5F15\u6570\u3068\u3057\u3066\u6E21\u3055\u308C\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n \u6307\u5B9A\u3055\u308C\u305F\u6700\u9069\u306A\u30B9\u30B1\u30FC\u30EB\u306E\u30A4\u30E1\u30FC\u30B8\u304C\u81EA\u52D5\u7684\u306B\n \u9078\u629E\u3055\u308C\u307E\u3059\u3002\n \u8A73\u7D30\u306FSplashScreen API\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n @<filepath> \u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u8AAD\u307F\u53D6\u308B\n\u9577\u3044\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5F15\u6570\u3092\u6307\u5B9A\u3059\u308B\u5834\u5408\u3001--<name>=<value>\u307E\u305F\u306F\n--<name> <value>\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002\n
See \u8A73\u7D30\u306F\u3001http://www.oracle.com/technetwork/java/javase/documentation/index.html\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
# Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xmixed \u6DF7\u5408\u30E2\u30FC\u30C9\u306E\u5B9F\u884C(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xint \u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u30FB\u30E2\u30FC\u30C9\u306E\u5B9F\u884C\u306E\u307F\n -Xbootclasspath/a:<{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB>\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u6700\u5F8C\u306B\u8FFD\u52A0\u3059\u308B\n -Xdiag \u8FFD\u52A0\u306E\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n -Xdiag:resolver \u30EA\u30BE\u30EB\u30D0\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n -Xnoclassgc \u30AF\u30E9\u30B9\u306E\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xloggc:<file> \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u4ED8\u3044\u305F\u30D5\u30A1\u30A4\u30EB\u306BGC\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u30ED\u30B0\u3092\u8A18\u9332\u3059\u308B\n -Xbatch \u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xms<size> Java\u306E\u521D\u671F\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xmx<size> Java\u306E\u6700\u5927\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xss<size> Java\u306E\u30B9\u30EC\u30C3\u30C9\u30FB\u30B9\u30BF\u30C3\u30AF\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xprof CPU\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u30FB\u30C7\u30FC\u30BF\u3092\u51FA\u529B\u3059\u308B\n -Xfuture \u5C06\u6765\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u898B\u8D8A\u3057\u3066\u3001\u6700\u3082\u53B3\u5BC6\u306A\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3059\u308B\n -Xrs Java/VM\u306B\u3088\u308BOS\u30B7\u30B0\u30CA\u30EB\u306E\u4F7F\u7528\u3092\u524A\u6E1B\u3059\u308B(\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167)\n -Xcheck:jni JNI\u95A2\u6570\u306B\u5BFE\u3059\u308B\u8FFD\u52A0\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5B9F\u884C\u3059\u308B\n -Xshare:off \u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u306A\u3044\n -Xshare:auto \u53EF\u80FD\u3067\u3042\u308C\u3070\u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xshare:on \u5171\u6709\u30AF\u30E9\u30B9\u30FB\u30C7\u30FC\u30BF\u306E\u4F7F\u7528\u3092\u5FC5\u9808\u306B\u3057\u3001\u3067\u304D\u306A\u3051\u308C\u3070\u5931\u6557\u3059\u308B\u3002\n -XshowSettings \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:all\n \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:vm \u3059\u3079\u3066\u306EVM\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:properties\n \u3059\u3079\u3066\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:locale\n \u3059\u3079\u3066\u306E\u30ED\u30B1\u30FC\u30EB\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XaddReads:<module>=<other-module>(,<other-module>)*\n \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001\n <module>\u306F\u4ED6\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u8AAD\u307F\u53D6\u308B\n -XaddExports:<module>/<package>=<other-module>(,<other-module>)*\n \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001\n \
<module>\u306F<package>\u3092\u4ED6\u306E\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3059\u308B\n -Xpatch:<module>=<file>({0}<file>)*\n JAR\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30EA\u30BD\u30FC\u30B9\u3067\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\n \u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u307E\u305F\u306F\u62E1\u5F35\u3059\u308B\n -Xdisable-@files \u3055\u3089\u306A\u308B\u30D5\u30A1\u30A4\u30EB\u62E1\u5F35\u3092\u7121\u52B9\u306B\u3059\u308B\n\n-X\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u975E\u6A19\u6E96\u306A\u306E\u3067\u3001\u4E88\u544A\u306A\u304F\u5909\u66F4\u3055\u308C\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002\n
java.launcher.X.usage=\ -Xbatch \u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xbootclasspath/a:<{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB>\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u6700\u5F8C\u306B\u8FFD\u52A0\u3059\u308B\n -Xcheck:jni JNI\u95A2\u6570\u306B\u5BFE\u3059\u308B\u8FFD\u52A0\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5B9F\u884C\u3059\u308B\n -Xcomp \u521D\u56DE\u547C\u51FA\u3057\u6642\u306B\u30E1\u30BD\u30C3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u5F37\u5236\u3059\u308B\n -Xdebug \u4E0B\u4F4D\u4E92\u63DB\u6027\u306E\u305F\u3081\u306B\u63D0\u4F9B\n -Xdiag \u8FFD\u52A0\u306E\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n -Xdiag:resolver \u30EA\u30BE\u30EB\u30D0\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n -Xdisable-@files \u3055\u3089\u306A\u308B\u5F15\u6570\u30D5\u30A1\u30A4\u30EB\u62E1\u5F35\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xfuture \u5C06\u6765\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u898B\u8D8A\u3057\u3066\u3001\u6700\u3082\u53B3\u5BC6\u306A\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3059\u308B\n -Xint \u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u30FB\u30E2\u30FC\u30C9\u306E\u5B9F\u884C\u306E\u307F\n -Xinternalversion\n -version\u30AA\u30D7\u30B7\u30E7\u30F3\u3088\u308A\u8A73\u7D30\u306AJVM\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\n \u8868\u793A\u3059\u308B\n -Xloggc:<file> \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u4ED8\u3044\u305F\u30D5\u30A1\u30A4\u30EB\u306BGC\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u30ED\u30B0\u3092\u8A18\u9332\u3059\u308B\n -Xmixed \u6DF7\u5408\u30E2\u30FC\u30C9\u306E\u5B9F\u884C(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xmn<size> \u82E5\u3044\u4E16\u4EE3(\u30CA\u30FC\u30B5\u30EA)\u306E\u30D2\u30FC\u30D7\u306E\u521D\u671F\u304A\u3088\u3073\u6700\u5927\u30B5\u30A4\u30BA(\u30D0\u30A4\u30C8\u5358\u4F4D)\n \u3092\u8A2D\u5B9A\u3059\u308B\n -Xms<size> Java\u306E\u521D\u671F\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xmx<size> Java\u306E\u6700\u5927\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xnoclassgc \u30AF\u30E9\u30B9\u306E\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xprof CPU\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u30FB\u30C7\u30FC\u30BF\u3092\u51FA\u529B\u3059\u308B\n -Xrs Java/VM\u306B\u3088\u308BOS\u30B7\u30B0\u30CA\u30EB\u306E\u4F7F\u7528\u3092\u524A\u6E1B\u3059\u308B(\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167)\n -Xshare:auto \u53EF\u80FD\u3067\u3042\u308C\u3070\u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xshare:off \u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u306A\u3044\n -Xshare:on \u5171\u6709\u30AF\u30E9\u30B9\u30FB\u30C7\u30FC\u30BF\u306E\u4F7F\u7528\u3092\u5FC5\u9808\u306B\u3057\u3001\u3067\u304D\u306A\u3051\u308C\u3070\u5931\u6557\u3059\u308B\u3002\n -XshowSettings \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:all\n \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:locale\n \u3059\u3079\u3066\u306E\u30ED\u30B1\u30FC\u30EB\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:properties\n \
\u3059\u3079\u3066\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:vm \u3059\u3079\u3066\u306EVM\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -Xss<size> Java\u306E\u30B9\u30EC\u30C3\u30C9\u30FB\u30B9\u30BF\u30C3\u30AF\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xverify \u30D0\u30A4\u30C8\u30B3\u30FC\u30C9\u691C\u8A3C\u6A5F\u80FD\u306E\u30E2\u30FC\u30C9\u3092\u8A2D\u5B9A\u3059\u308B\n --add-reads <module>=<target-module>(,<target-module>)*\n \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001<module>\u3092\u66F4\u65B0\u3057\u3066<target-module>\n \u3092\u8AAD\u307F\u53D6\u308A\u307E\u3059\u3002 \n <target-module>\u3092ALL-UNNAMED\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\n \u8AAD\u307F\u53D6\u308C\u307E\u3059\u3002\n --add-exports <module>/<package>=<target-module>(,<target-module>)*\n \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001<module>\u3092\u66F4\u65B0\u3057\u3066<package>\u3092<target-module>\u306B\n \u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002\n <target-module>\u3092ALL-UNNAMED\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\n \u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3067\u304D\u307E\u3059\u3002\n --patch-module <module>=<file>({0}<file>)*\n JAR\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30EA\u30BD\u30FC\u30B9\u3067\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u307E\u305F\u306F\n \u62E1\u5F35\u3057\u307E\u3059\u3002\n\n\u3053\u308C\u3089\u306F\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3042\u308A\u4E88\u544A\u306A\u3057\u306B\u5909\u66F4\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002\n
# Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\n\u6B21\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306FMac OS X\u56FA\u6709\u3067\u3059:\n -XstartOnFirstThread\n main()\u30E1\u30BD\u30C3\u30C9\u3092\u6700\u521D(AppKit)\u306E\u30B9\u30EC\u30C3\u30C9\u3067\u5B9F\u884C\u3059\u308B\n -Xdock:name=<application name>\n Dock\u306B\u8868\u793A\u3055\u308C\u308B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n -Xdock:icon=<path to icon file>\n Dock\u306B\u8868\u793A\u3055\u308C\u308B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n\n

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2007, 2016, 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
@ -24,9 +24,9 @@
#
# Translators please note do not translate the options themselves
java.launcher.opt.header = \uC0AC\uC6A9\uBC95: {0} [options] class [args...]\n (\uD074\uB798\uC2A4 \uC2E4\uD589)\n \uB610\uB294 {0} [options] -jar jarfile [args...]\n (jar \uD30C\uC77C \uC2E4\uD589)\n \uB610\uB294 {0} [options] -mp <modulepath> -m <modulename>[/<mainclass>] [args...]\n (\uBAA8\uB4C8\uC758 \uAE30\uBCF8 \uD074\uB798\uC2A4 \uC2E4\uD589)\n\uC5EC\uAE30\uC11C options\uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n
java.launcher.opt.header = \uC0AC\uC6A9\uBC95: {0} [options] class [args...]\n (\uD074\uB798\uC2A4 \uC2E4\uD589)\n \uB610\uB294 {0} [options] -jar jarfile [args...]\n (jar \uD30C\uC77C \uC2E4\uD589)\n \uB610\uB294 {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n (\uBAA8\uB4C8\uC758 \uAE30\uBCF8 \uD074\uB798\uC2A4 \uC2E4\uD589)\n\uC5EC\uAE30\uC11C options\uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n
java.launcher.opt.datamodel =\ -d{0}\t \uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uACBD\uC6B0 {0}\uBE44\uD2B8 \uB370\uC774\uD130 \uBAA8\uB378\uC744 \uC0AC\uC6A9\uD569\uB2C8\uB2E4.\n
java.launcher.opt.datamodel =\ -d{0}\t \uB354 \uC774\uC0C1 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uC74C. \uC774\uD6C4 \uB9B4\uB9AC\uC2A4\uC5D0\uC11C \uC81C\uAC70\uB429\uB2C8\uB2E4.\n
java.launcher.opt.vmselect =\ {0}\t "{1}" VM\uC744 \uC120\uD0DD\uD569\uB2C8\uB2E4.\n
java.launcher.opt.hotspot =\ {0}\t "{1}" VM\uC758 \uB3D9\uC758\uC5B4\uC785\uB2C8\uB2E4[\uC0AC\uC6A9\uB418\uC9C0 \uC54A\uC74C].\n
@ -34,13 +34,13 @@ java.launcher.ergo.message1 =\ \uAE30\uBCF8 VM\uC740 {0}\uC785
java.launcher.ergo.message2 =\ \uC11C\uBC84\uAE09 \uC2DC\uC2A4\uD15C\uC5D0\uC11C \uC2E4\uD589 \uC911\uC774\uAE30 \uB54C\uBB38\uC785\uB2C8\uB2E4.\n
# Translators please note do not translate the options themselves
java.launcher.opt.footer =\ -cp <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n -classpath <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uAC80\uC0C9\uD560 {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC,\n JAR \uC544\uCE74\uC774\uBE0C \uBC0F ZIP \uC544\uCE74\uC774\uBE0C \uBAA9\uB85D\uC785\uB2C8\uB2E4.\n -mp <\uBAA8\uB4C8 \uACBD\uB85C>\n -modulepath <\uBAA8\uB4C8 \uACBD\uB85C>...\n {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D\uC785\uB2C8\uB2E4. \uAC01 \uB514\uB809\uD1A0\uB9AC\uB294\n \uBAA8\uB4C8\uC758 \uB514\uB809\uD1A0\uB9AC\uC785\uB2C8\uB2E4.\n -upgrademodulepath <\uBAA8\uB4C8 \uACBD\uB85C>...\n {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D\uC785\uB2C8\uB2E4. \uAC01 \uB514\uB809\uD1A0\uB9AC\uB294\n \uBAA8\uB4C8\uC758 \uB514\uB809\uD1A0\uB9AC\uB85C, \uB7F0\uD0C0\uC784 \uC774\uBBF8\uC9C0\uC5D0\uC11C \uC5C5\uADF8\uB808\uC774\uB4DC\n \uAC00\uB2A5\uD55C \uBAA8\uB4C8\uC744 \uB300\uCCB4\uD569\uB2C8\uB2E4.\n -m <\uBAA8\uB4C8 \uC774\uB984>[/<\uAE30\uBCF8 \uD074\uB798\uC2A4>]\n \uBD84\uC11D\uD560 \uCD08\uAE30 \uBAA8\uB4C8 \uBC0F \uBAA8\uB4C8\uC5D0\uC11C \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uACBD\uC6B0 \uC2E4\uD589\uD560\n \uAE30\uBCF8 \uD074\uB798\uC2A4\uC758 \uC774\uB984\uC785\uB2C8\uB2E4.\n -addmods <\uBAA8\uB4C8 \uC774\uB984>[,<\uBAA8\uB4C8 \uC774\uB984>...]\n \uCD08\uAE30 \uBAA8\uB4C8 \uC678\uC5D0 \uBD84\uC11D\uD560 \uB8E8\uD2B8 \uBAA8\uB4C8\uC785\uB2C8\uB2E4.\n -limitmods <\uBAA8\uB4C8 \uC774\uB984>[,<\uBAA8\uB4C8 \uC774\uB984>...]\n \uAD00\uCC30 \uAC00\uB2A5\uD55C \uBAA8\uB4C8\uC758 \uBC94\uC704\uB97C \uC81C\uD55C\uD569\uB2C8\uB2E4.\n -listmods[:<\uBAA8\uB4C8 \uC774\uB984>[,<\uBAA8\uB4C8 \uC774\uB984>...]]\n \uAD00\uCC30 \uAC00\uB2A5\uD55C \uBAA8\uB4C8\uC744 \uB098\uC5F4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\n --dry-run VM\uC744 \uC0DD\uC131\uD558\uC9C0\uB9CC \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uC2E4\uD589\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n \uC774 --dry-run \uC635\uC158\uC740 \uBAA8\uB4C8 \uC2DC\uC2A4\uD15C \uAD6C\uC131\uACFC \uAC19\uC740 \uBA85\uB839\uD589\n \uC635\uC158\uC744 \uAC80\uC99D\uD558\uB294 \uB370 \uC720\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n -D<\uC774\uB984>=<\uAC12>\n \uC2DC\uC2A4\uD15C \uC18D\uC131\uC744 \uC124\uC815\uD569\uB2C8\uB2E4.\n -verbose:[class|gc|jni]\n \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -version \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\n -showversion \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -? -help \uC774 \uB3C4\uC6C0\uB9D0 \uBA54\uC2DC\uC9C0\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4.\n -X \uBE44\uD45C\uC900 \uC635\uC158\uC5D0 \uB300\uD55C \uB3C4\uC6C0\uB9D0\uC744 \uC778\uC1C4\uD569\uB2C8\uB2E4.\n -ea[:<\uD328\uD0A4\uC9C0 \uC774\uB984>...|:<\uD074\uB798\uC2A4 \uC774\uB984>]\n -enableassertions[:<\uD328\uD0A4\uC9C0 \uC774\uB984>...|:<\uD074\uB798\uC2A4 \uC774\uB984>]\n \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -da[:<\uD328\uD0A4\uC9C0 \uC774\uB984>...|:<\uD074\uB798\uC2A4 \uC774\uB984>]\n -disableassertions[:<\uD328\uD0A4\uC9C0 \uC774\uB984>...|:<\uD074\uB798\uC2A4 \uC774\uB984>]\n \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -esa \
| -enablesystemassertions\n \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -dsa | -disablesystemassertions\n \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -agentlib:<\uB77C\uC774\uBE0C\uB7EC\uB9AC \uC774\uB984>[=<\uC635\uC158>]\n \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC <\uB77C\uC774\uBE0C\uB7EC\uB9AC \uC774\uB984>\uC744 \uB85C\uB4DC\uD569\uB2C8\uB2E4(\uC608: -agentlib:jdwp).\n -agentlib:jdwp=help\uB3C4 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n -agentpath:<\uACBD\uB85C \uC774\uB984>[=<\uC635\uC158>]\n \uC804\uCCB4 \uACBD\uB85C \uC774\uB984\uC744 \uC0AC\uC6A9\uD558\uC5EC \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4.\n -javaagent:<jar \uACBD\uB85C>[=<\uC635\uC158>]\n Java \uD504\uB85C\uADF8\uB798\uBC0D \uC5B8\uC5B4 \uC5D0\uC774\uC804\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4. java.lang.instrument\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n -splash:<\uC774\uBBF8\uC9C0 \uACBD\uB85C>\n \uC774\uBBF8\uC9C0\uAC00 \uC9C0\uC815\uB41C \uC2A4\uD50C\uB798\uC2DC \uD654\uBA74\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n @<\uD30C\uC77C \uACBD\uB85C> \uC9C0\uC815\uB41C \uD30C\uC77C\uC5D0\uC11C \uC635\uC158\uC744 \uC77D\uC2B5\uB2C8\uB2E4.\n
java.launcher.opt.footer =\ -cp <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n -classpath <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n --class-path <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C\uC758 \uD074\uB798\uC2A4 \uAC80\uC0C9 \uACBD\uB85C>\n \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uAC80\uC0C9\uD560 {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC,\n JAR \uC544\uCE74\uC774\uBE0C \uBC0F ZIP \uC544\uCE74\uC774\uBE0C \uBAA9\uB85D\uC785\uB2C8\uB2E4.\n -p <\uBAA8\uB4C8 \uACBD\uB85C>\n --module-path <\uBAA8\uB4C8 \uACBD\uB85C>...\n {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D\uC785\uB2C8\uB2E4. \uAC01 \uB514\uB809\uD1A0\uB9AC\uB294\n \uBAA8\uB4C8\uC758 \uB514\uB809\uD1A0\uB9AC\uC785\uB2C8\uB2E4.\n --upgrade-module-path <\uBAA8\uB4C8 \uACBD\uB85C>...\n {0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D\uC785\uB2C8\uB2E4. \uAC01 \uB514\uB809\uD1A0\uB9AC\uB294\n \uBAA8\uB4C8\uC758 \uB514\uB809\uD1A0\uB9AC\uB85C, \uB7F0\uD0C0\uC784 \uC774\uBBF8\uC9C0\uC5D0\uC11C \uC5C5\uADF8\uB808\uC774\uB4DC\n \uAC00\uB2A5\uD55C \uBAA8\uB4C8\uC744 \uB300\uCCB4\uD569\uB2C8\uB2E4.\n -m <\uBAA8\uB4C8>[/<\uAE30\uBCF8 \uD074\uB798\uC2A4>]\n --module <\uBAA8\uB4C8 \uC774\uB984>[/<\uAE30\uBCF8 \uD074\uB798\uC2A4>]\n \uBD84\uC11D\uD560 \uCD08\uAE30 \uBAA8\uB4C8 \uBC0F \uBAA8\uB4C8\uC5D0\uC11C \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uACBD\uC6B0 \uC2E4\uD589\uD560\n \uAE30\uBCF8 \uD074\uB798\uC2A4\uC758 \uC774\uB984\uC785\uB2C8\uB2E4.\n --add-modules <\uBAA8\uB4C8 \uC774\uB984>[,<\uBAA8\uB4C8 \uC774\uB984>...]\n \uCD08\uAE30 \uBAA8\uB4C8 \uC678\uC5D0 \uBD84\uC11D\uD560 \uB8E8\uD2B8 \uBAA8\uB4C8\uC785\uB2C8\uB2E4.\n <\uBAA8\uB4C8 \uC774\uB984>\uC740 ALL-DEFAULT, ALL-SYSTEM,\n ALL-MODULE-PATH\uC77C \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4.\n --limit-modules <\uBAA8\uB4C8 \uC774\uB984>[,<\uBAA8\uB4C8 \uC774\uB984>...]\n \uAD00\uCC30 \uAC00\uB2A5\uD55C \uBAA8\uB4C8\uC758 \uBC94\uC704\uB97C \uC81C\uD55C\uD569\uB2C8\uB2E4.\n --list-modules [<\uBAA8\uB4C8 \uC774\uB984>[,<\uBAA8\uB4C8 \uC774\uB984>...]]\n \uAD00\uCC30 \uAC00\uB2A5\uD55C \uBAA8\uB4C8\uC744 \uB098\uC5F4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\n --dry-run VM\uC744 \uC0DD\uC131\uD558\uC9C0\uB9CC \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uC2E4\uD589\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n \uC774 --dry-run \uC635\uC158\uC740 \uBAA8\uB4C8 \uC2DC\uC2A4\uD15C \uAD6C\uC131\uACFC \uAC19\uC740 \uBA85\uB839\uD589\n \uC635\uC158\uC744 \uAC80\uC99D\uD558\uB294 \uB370 \uC720\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n -D<\uC774\uB984>=<\uAC12>\n \uC2DC\uC2A4\uD15C \uC18D\uC131\uC744 \uC124\uC815\uD569\uB2C8\uB2E4.\n -verbose:[class|gc|jni]\n \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -version \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uC885\uB8CC\uD569\uB2C8\uB2E4.\n -showversion \uC81C\uD488 \uBC84\uC804\uC744 \uC778\uC1C4\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -? -help --help\n \uC774 \uB3C4\uC6C0\uB9D0 \uBA54\uC2DC\uC9C0\uB97C \uC778\uC1C4\uD569\uB2C8\uB2E4.\n -X \uBE44\uD45C\uC900 \uC635\uC158\uC5D0 \uB300\uD55C \uB3C4\uC6C0\uB9D0\uC744 \uC778\uC1C4\uD569\uB2C8\uB2E4.\n -ea[:<\uD328\uD0A4\uC9C0 \uC774\uB984>...|:<\uD074\uB798\uC2A4 \uC774\uB984>]\n -enableassertions[:<\uD328\uD0A4\uC9C0 \uC774\uB984>...|:<\uD074\uB798\uC2A4 \uC774\uB984>]\n \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \
\uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -da[:<\uD328\uD0A4\uC9C0 \uC774\uB984>...|:<\uD074\uB798\uC2A4 \uC774\uB984>]\n -disableassertions[:<\uD328\uD0A4\uC9C0 \uC774\uB984>...|:<\uD074\uB798\uC2A4 \uC774\uB984>]\n \uC138\uBD84\uC131\uC774 \uC9C0\uC815\uB41C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -esa | -enablesystemassertions\n \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -dsa | -disablesystemassertions\n \uC2DC\uC2A4\uD15C \uAC80\uC99D\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -agentlib:<\uB77C\uC774\uBE0C\uB7EC\uB9AC \uC774\uB984>[=<\uC635\uC158>]\n \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC <\uB77C\uC774\uBE0C\uB7EC\uB9AC \uC774\uB984>\uC744 \uB85C\uB4DC\uD569\uB2C8\uB2E4(\uC608: -agentlib:jdwp).\n -agentlib:jdwp=help\uB3C4 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n -agentpath:<\uACBD\uB85C \uC774\uB984>[=<\uC635\uC158>]\n \uC804\uCCB4 \uACBD\uB85C \uC774\uB984\uC744 \uC0AC\uC6A9\uD558\uC5EC \uACE0\uC720 \uC5D0\uC774\uC804\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4.\n -javaagent:<jar \uACBD\uB85C>[=<\uC635\uC158>]\n Java \uD504\uB85C\uADF8\uB798\uBC0D \uC5B8\uC5B4 \uC5D0\uC774\uC804\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4. java.lang.instrument\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n -splash:<\uC774\uBBF8\uC9C0 \uACBD\uB85C>\n \uC774\uBBF8\uC9C0\uAC00 \uC9C0\uC815\uB41C \uC2A4\uD50C\uB798\uC2DC \uD654\uBA74\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n HiDPI\uB85C \uC870\uC815\uB41C \uC774\uBBF8\uC9C0\uAC00 \uC790\uB3D9\uC73C\uB85C \uC9C0\uC6D0\uB418\uACE0 \uAC00\uB2A5\uD55C \uACBD\uC6B0\n \uC0AC\uC6A9\uB429\uB2C8\uB2E4. \uBBF8\uC870\uC815 \uC774\uBBF8\uC9C0 \uD30C\uC77C \uC774\uB984(\uC608: image.ext)\uC740\n \uD56D\uC0C1 -splash \uC635\uC158\uC5D0 \uC778\uC218\uB85C \uC804\uB2EC\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4.\n \uAC00\uC7A5 \uC801\uC808\uD788 \uC870\uC815\uB41C \uC774\uBBF8\uC9C0\uAC00 \uC790\uB3D9\uC73C\uB85C \uCC44\uD0DD\uB429\uB2C8\uB2E4.\n \uC790\uC138\uD55C \uB0B4\uC6A9\uC740 SplashScreen API \uC124\uBA85\uC11C\uB97C \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.\n @<\uD30C\uC77C \uACBD\uB85C> \uC9C0\uC815\uB41C \uD30C\uC77C\uC5D0\uC11C \uC635\uC158\uC744 \uC77D\uC2B5\uB2C8\uB2E4.\nlong \uC635\uC158\uC5D0 \uB300\uD55C \uC778\uC218\uB97C \uC9C0\uC815\uD558\uB824\uBA74 --<\uC774\uB984>=<\uAC12> \uB610\uB294 --<\uC774\uB984> <\uAC12>\uC744\n\uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n
See \uC790\uC138\uD55C \uB0B4\uC6A9\uC740 http://www.oracle.com/technetwork/java/javase/documentation/index.html\uC744 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.
# Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xmixed \uD63C\uD569 \uBAA8\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n -Xint \uD574\uC11D\uB41C \uBAA8\uB4DC\uB9CC \uC2E4\uD589\uD569\uB2C8\uB2E4.\n -Xbootclasspath/a:<{0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C>\n \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uB05D\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n -Xdiag \uCD94\uAC00 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -Xdiag:resolver \uBD84\uC11D\uAE30 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -Xnoclassgc \uD074\uB798\uC2A4\uC758 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xloggc:<file> \uC2DC\uAC04 \uAE30\uB85D\uACFC \uD568\uAED8 \uD30C\uC77C\uC5D0 GC \uC0C1\uD0DC\uB97C \uAE30\uB85D\uD569\uB2C8\uB2E4.\n -Xbatch \uBC31\uADF8\uB77C\uC6B4\uB4DC \uCEF4\uD30C\uC77C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xms<size> \uCD08\uAE30 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xmx<size> \uCD5C\uB300 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xss<size> Java \uC2A4\uB808\uB4DC \uC2A4\uD0DD \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xprof CPU \uD504\uB85C\uD30C\uC77C \uC791\uC131 \uB370\uC774\uD130\uB97C \uCD9C\uB825\uD569\uB2C8\uB2E4.\n -Xfuture \uBBF8\uB798 \uAE30\uBCF8\uAC12\uC744 \uC608\uCE21\uD558\uC5EC \uAC00\uC7A5 \uC5C4\uACA9\uD55C \uAC80\uC0AC\uB97C \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xrs Java/VM\uC5D0 \uC758\uD55C OS \uC2E0\uD638 \uC0AC\uC6A9\uC744 \uC904\uC785\uB2C8\uB2E4(\uC124\uBA85\uC11C \uCC38\uC870).\n -Xcheck:jni JNI \uD568\uC218\uC5D0 \uB300\uD55C \uCD94\uAC00 \uAC80\uC0AC\uB97C \uC218\uD589\uD569\uB2C8\uB2E4.\n -Xshare:off \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130 \uC0AC\uC6A9\uC744 \uC2DC\uB3C4\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n -Xshare:auto \uAC00\uB2A5\uD55C \uACBD\uC6B0 \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n -Xshare:on \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4. \uADF8\uB807\uC9C0 \uC54A\uC744 \uACBD\uC6B0 \uC2E4\uD328\uD569\uB2C8\uB2E4.\n -XshowSettings \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:all\n \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:vm \uBAA8\uB4E0 VM \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:properties\n \uBAA8\uB4E0 \uC18D\uC131 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:locale\n \uBAA8\uB4E0 \uB85C\uCF00\uC77C \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XaddReads:<module>=<other-module>(,<other-module>)*\n <module>\uC740 \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774\n \uB2E4\uB978 \uBAA8\uB4C8\uC744 \uC77D\uC2B5\uB2C8\uB2E4.\n -XaddExports:<module>/<package>=<other-module>(,<other-module>)*\n <module>\uC740 \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774\n <package>\uB97C \uB2E4\uB978 \uBAA8\uB4C8\uB85C \uC775\uC2A4\uD3EC\uD2B8\uD569\uB2C8\uB2E4.\n -Xpatch:<module>=<file>({0}<file>)*\n JAR \uD30C\uC77C/\uB514\uB809\uD1A0\uB9AC\uC758 \uD074\uB798\uC2A4\uC640 \uB9AC\uC18C\uC2A4\uB85C\n \uBAA8\uB4C8\uC744 \
\uBB34\uD6A8\uD654\uD558\uAC70\uB098 \uC778\uC218\uD654\uD569\uB2C8\uB2E4.\n -Xdisable-@files \uCD94\uAC00 \uC778\uC218 \uD30C\uC77C \uD655\uC7A5\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n\n-X \uC635\uC158\uC740 \uBE44\uD45C\uC900 \uC635\uC158\uC774\uBBC0\uB85C \uD1B5\uC9C0 \uC5C6\uC774 \uBCC0\uACBD\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n
java.launcher.X.usage=\ -Xbatch \uBC31\uADF8\uB77C\uC6B4\uB4DC \uCEF4\uD30C\uC77C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xbootclasspath/a:<{0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C>\n \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uB05D\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n -Xcheck:jni JNI \uD568\uC218\uC5D0 \uB300\uD55C \uCD94\uAC00 \uAC80\uC0AC\uB97C \uC218\uD589\uD569\uB2C8\uB2E4.\n -Xcomp \uCCAB\uBC88\uC9F8 \uD638\uCD9C\uC5D0\uC11C \uBA54\uC18C\uB4DC \uCEF4\uD30C\uC77C\uC744 \uAC15\uC81C\uD569\uB2C8\uB2E4.\n -Xdebug \uC5ED \uD638\uD658\uC131\uC744 \uC704\uD574 \uC81C\uACF5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n -Xdiag \uCD94\uAC00 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -Xdiag:resolver \uBD84\uC11D\uAE30 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -Xdisable-@files \uCD94\uAC00 \uC778\uC218 \uD30C\uC77C \uD655\uC7A5\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xfuture \uBBF8\uB798 \uAE30\uBCF8\uAC12\uC744 \uC608\uCE21\uD558\uC5EC \uAC00\uC7A5 \uC5C4\uACA9\uD55C \uAC80\uC0AC\uB97C \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xint \uD574\uC11D\uB41C \uBAA8\uB4DC\uB9CC \uC2E4\uD589\uD569\uB2C8\uB2E4.\n -Xinternalversion\n -version \uC635\uC158\uBCF4\uB2E4 \uC0C1\uC138\uD55C JVM \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -Xloggc:<file> \uC2DC\uAC04 \uAE30\uB85D\uACFC \uD568\uAED8 \uD30C\uC77C\uC5D0 GC \uC0C1\uD0DC\uB97C \uAE30\uB85D\uD569\uB2C8\uB2E4.\n -Xmixed \uD63C\uD569 \uBAA8\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n -Xmn<size> \uC80A\uC740 \uC138\uB300(Nursery)\uB97C \uC704\uD574 \uD799\uC758 \uCD08\uAE30 \uBC0F \uCD5C\uB300\n \uD06C\uAE30(\uBC14\uC774\uD2B8)\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xms<size> \uCD08\uAE30 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xmx<size> \uCD5C\uB300 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xnoclassgc \uD074\uB798\uC2A4\uC758 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xprof CPU \uD504\uB85C\uD30C\uC77C \uC791\uC131 \uB370\uC774\uD130\uB97C \uCD9C\uB825\uD569\uB2C8\uB2E4.\n -Xrs Java/VM\uC5D0 \uC758\uD55C OS \uC2E0\uD638 \uC0AC\uC6A9\uC744 \uC904\uC785\uB2C8\uB2E4(\uC124\uBA85\uC11C \uCC38\uC870).\n -Xshare:auto \uAC00\uB2A5\uD55C \uACBD\uC6B0 \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n -Xshare:off \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130 \uC0AC\uC6A9\uC744 \uC2DC\uB3C4\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n -Xshare:on \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4. \uADF8\uB807\uC9C0 \uC54A\uC744 \uACBD\uC6B0 \uC2E4\uD328\uD569\uB2C8\uB2E4.\n -XshowSettings \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:all\n \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:locale\n \uBAA8\uB4E0 \uB85C\uCF00\uC77C \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:properties\n \uBAA8\uB4E0 \uC18D\uC131 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:vm \uBAA8\uB4E0 VM \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -Xss<size> Java \uC2A4\uB808\uB4DC \uC2A4\uD0DD \
\uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xverify \uBC14\uC774\uD2B8\uCF54\uB4DC \uAC80\uC99D\uC790\uC758 \uBAA8\uB4DC\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n --add-reads <module>=<target-module>(,<target-module>)*\n \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <target-module>\uC744 \uC77D\uB3C4\uB85D\n <module>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n <target-module>\uC740 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB4E0 \uBAA8\uB4C8\uC744 \uC77D\uC744 \uC218 \uC788\uB294\n ALL-UNNAMED\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n --add-exports <module>/<package>=<target-module>(,<target-module>)*\n \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <package>\uB97C <target-module>\uB85C \uC775\uC2A4\uD3EC\uD2B8\uD558\uB3C4\uB85D\n <module>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n <target-module>\uC740 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB4E0 \uBAA8\uB4C8\uB85C \uC775\uC2A4\uD3EC\uD2B8\uD560 \uC218 \uC788\uB294\n ALL-UNNAMED\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n --patch-module <module>=<file>({0}<file>)*\n JAR \uD30C\uC77C/\uB514\uB809\uD1A0\uB9AC\uC758 \uD074\uB798\uC2A4\uC640 \uB9AC\uC18C\uC2A4\uB85C\n \uBAA8\uB4C8\uC744 \uBB34\uD6A8\uD654\uD558\uAC70\uB098 \uC778\uC218\uD654\uD569\uB2C8\uB2E4.\n\n\uC774 \uC635\uC158\uC740 \uBE44\uD45C\uC900 \uC635\uC158\uC774\uBBC0\uB85C \uD1B5\uC9C0 \uC5C6\uC774 \uBCC0\uACBD\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n
# Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\n\uB2E4\uC74C\uC740 Mac OS X\uC5D0 \uD2B9\uC815\uB41C \uC635\uC158\uC785\uB2C8\uB2E4.\n -XstartOnFirstThread\n \uCCAB\uBC88\uC9F8 (AppKit) \uC2A4\uB808\uB4DC\uC5D0 main() \uBA54\uC18C\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4.\n -Xdock:name=<application name>\n \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC560\uD50C\uB9AC\uCF00\uC774\uC158 \uC774\uB984\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n -Xdock:icon=<path to icon file>\n \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC544\uC774\uCF58\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n\n

View File

@ -24,9 +24,9 @@
#
# Translators please note do not translate the options themselves
java.launcher.opt.header = Uso: {0} [options] class [args...]\n (para executar uma classe)\n ou {0} [options] -jar jarfile [args...]\n (para executar um arquivo jar)\n ou {0} [options] -mp <modulepath> -m <modulename>[/<mainclass>] [args...]\n (para executar a classe principal em um m\u00F3dulo)\nem que as op\u00E7\u00F5es incluem:\n
java.launcher.opt.header = Uso: {0} [options] class [args...]\n (para executar uma classe)\n ou {0} [options] -jar jarfile [args...]\n (para executar um arquivo jar)\n or {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n (para executar a classe principal em um m\u00F3dulo)\nem que as op\u00E7\u00F5es incluem:\n
java.launcher.opt.datamodel =\ -d{0}\t usar um modelo de dados de {0} bits, se estiver dispon\u00EDvel\n
java.launcher.opt.datamodel =\ -d{0}\t Obsoleto, ser\u00E1 removido em uma futura release\n
java.launcher.opt.vmselect =\ {0}\t para selecionar a VM "{1}"\n
java.launcher.opt.hotspot =\ {0}\t \u00E9 um sin\u00F4nimo da VM "{1}" [obsoleto]\n
@ -34,11 +34,12 @@ java.launcher.ergo.message1 =\ A VM padr\u00E3o \u00E9 {0}
java.launcher.ergo.message2 =\ porque a execu\u00E7\u00E3o est\u00E1 sendo feita em uma m\u00E1quina de classe de servidor.\n
# Translators please note do not translate the options themselves
java.launcher.opt.footer =\ -cp <caminho de pesquisa de classe de diret\u00F3rios e arquivos zip/jar>\n -classpath <caminho de pesquisa de classe de diret\u00F3rios e arquivos zip/jar>\n Uma lista separada por {0} de diret\u00F3rios, arquivos compactados JAR\n e arquivos compactados ZIP para procurar arquivos de classe.\n -mp <caminho do m\u00F3dulo>\n -modulepath <caminho do m\u00F3dulo>...\n Uma lista separada por {0} de diret\u00F3rios, cada um\n sendo um diret\u00F3rio de m\u00F3dulos.\n -upgrademodulepath <caminho do m\u00F3dulo>...\n Uma lista separada por {0} de diret\u00F3rios, cada um\n sendo um diret\u00F3rio de m\u00F3dulos que substituem m\u00F3dulos\n pass\u00EDveis de upgrade na imagem de runtime\n -m <modulename>[/<mainclass>]\n o m\u00F3dulo inicial a ser resolvido e o nome da classe principal\n a ser executada se n\u00E3o for especificada pelo m\u00F3dulo\n -addmods <modulename>[,<modulename>...]\n m\u00F3dulos raiz a serem resolvidos al\u00E9m do m\u00F3dulo inicial\n -limitmods <modulename>[,<modulename>...]\n limita o universo de m\u00F3dulos observ\u00E1veis\n -listmods[:<modulename>[,<modulename>...]]\n lista os m\u00F3dulos observ\u00E1veis e sai\n --dry-run cria a VM, mas n\u00E3o executa o m\u00E9todo principal.\n Esta op\u00E7\u00E3o -dry-run pode ser \u00FAtil para validar as\n op\u00E7\u00F5es de linha de comando como a configura\u00E7\u00E3o do sistema do m\u00F3dulo\n -D<name>=<value>\n define uma propriedade de sistema\n -verbose:[class|gc|jni]\n ativa sa\u00EDda detalhada\n -version imprime a vers\u00E3o do produto e sai\n -showversion imprime a vers\u00E3o do produto e continua\n -? -help imprime esta mensagem de ajuda\n -X imprime a ajuda em op\u00E7\u00F5es n\u00E3o padronizadas\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n ativa asser\u00E7\u00F5es com granularidade especificada\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n desativa asser\u00E7\u00F5es com granularidade especificada\n -esa | -enablesystemassertions\n ativa asser\u00E7\u00F5es do sistema\n -dsa | -disablesystemassertions\n desativa asser\u00E7\u00F5es do sistema\n -agentlib:<libname>[=<options>]\n carrega a biblioteca de agente nativo <libname>, por exemplo, -agentlib:jdwp\n consulte tamb\u00E9m -agentlib:jdwp=help\n -agentpath:<pathname>[=<options>]\n carrega a biblioteca de agente nativo por nome do caminho completo\n -javaagent:<jarpath>[=<options>]\n carrega o agente de linguagem de programa\u00E7\u00E3o Java; consulte java.lang.instrument\n -splash:<imagepath>\n mostra a tela inicial com a imagem especificada\n @<filepath> op\u00E7\u00F5es de leitura do arquivo especificado\n
java.launcher.opt.footer =\ -cp <caminho da pesquisa de classe de diret\u00F3rios e arquivos zip/jar>\n -classpath <caminho da pesquisa de classe de diret\u00F3rios e arquivos zip/jar>\n --class-path <caminho da pesquisa de classe de diret\u00F3rios e arquivos zip/jar>\n Uma lista separada por {0} de diret\u00F3rios, arquivos compactados JAR\n e ZIP para pesquisa de arquivos de classe.\n -p <caminho do m\u00F3dulo>\n --module-path <caminho do m\u00F3dulo>...\n Uma lista separada por {0} de diret\u00F3rios, cada um\n sendo um diret\u00F3rio de m\u00F3dulos.\n --upgrade-module-path <caminho do m\u00F3dulo>...\n Uma lista separada por {0} de diret\u00F3rios, cada um sendo\n um diret\u00F3rio de m\u00F3dulos que substituem m\u00F3dulos atualiz\u00E1veis\n por upgrade na imagem do runtime\n -m <module>[/<mainclass>]\n --module <modulename>[/<mainclass>]\n o m\u00F3dulo inicial a ser resolvido e o nome da classe principal\n a ser executada se o m\u00F3dulo n\u00E3o especificar\n --add-modules <modulename>[,<modulename>...]\n m\u00F3dulos-raiz a serem resolvidos al\u00E9m do m\u00F3dulo inicial.\n <modulename> tamb\u00E9m pode ser ALL-DEFAULT, ALL-SYSTEM,\n ALL-MODULE-PATH.\n --limit-modules <modulename>[,<modulename>...]\n limitar o universo de m\u00F3dulos observ\u00E1veis\n --list-modules [<modulename>[,<modulename>...]]\n listar os m\u00F3dulos observ\u00E1veis e sair\n --dry-run criar VM, mas n\u00E3o executar o m\u00E9todo principal.\n Esta op\u00E7\u00E3o --dry-run pode ser \u00FAtil para validar as\n op\u00E7\u00F5es da linha de comando, como a configura\u00E7\u00E3o do sistema do m\u00F3dulo.\n -D<name>=<value>\n definir uma propriedade do sistema\n -verbose:[class|gc|jni]\n ativar sa\u00EDda detalhada\n -version imprimir vers\u00E3o do produto e sair\n -showversion imprimir vers\u00E3o do produto e continuar\n -? -help --help\n imprimir esta mensagem de ajuda\n -X imprimir a ajuda em op\u00E7\u00F5es n\u00E3o padr\u00E3o\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n ativar asser\u00E7\u00F5es com granularidade especificada\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n desativar asser\u00E7\u00F5es com granularidade especificada\n -esa | -enablesystemassertions\n ativar asser\u00E7\u00F5es do sistema\n -dsa | -disablesystemassertions\n desativar asser\u00E7\u00F5es do sistema\n -agentlib:<libname>[=<options>]\n carregar biblioteca de agentes nativa <libname>; por exemplo, -agentlib:jdwp\n consulte tamb\u00E9m -agentlib:jdwp=help\n -agentpath:<pathname>[=<options>]\n carregar biblioteca de agentes nativa por nome de caminho completo\n -javaagent:<jarpath>[=<options>]\n carregar agente de linguagem de programa\u00E7\u00E3o Java; consulte java.lang.instrument\n -splash:<imagepath>\n mostrar tela de abertura com imagem especificada\n Imagens HiDPI dimensionadas s\u00E3o suportadas automaticamente e utilizadas\n se dispon\u00EDveis. O nome do arquivo de imagem n\u00E3o dimensionada, por exemplo, image.ext,\n deve ser informado sempre como argumento para a op\u00E7\u00E3o -splash.\n A imagem dimensionada mais apropriada fornecida ser\u00E1 selecionada\n automaticamente.\n Consulte a documenta\u00E7\u00E3o da API de Tela de Abertura para obter mais \
informa\u00E7\u00F5es.\n @<filepath> op\u00E7\u00F5es de leitura do arquivo especificado\nPara especificar um argumento para uma op\u00E7\u00E3o longa, voc\u00EA pode usar --<name>=<value> ou\n--<name> <value>.\n
See http://www.oracle.com/technetwork/java/javase/documentation/index.html para obter mais detalhes.
# Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xmixed execu\u00E7\u00E3o no modo misto (padr\u00E3o)\n -Xint execu\u00E7\u00E3o somente no modo interpretado\n -Xbootclasspath:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n anexos ao final do caminho de classe de inicializa\u00E7\u00E3o\n -Xdiag mostra mensagens de diagn\u00F3stico adicionais\n -Xdiag:resolver mostra mensagens de diagn\u00F3stico do resolvedor\n -Xnoclassgc desativa a coleta de lixo da classe\n -Xloggc:<arquivo> registra o status do GC status em um arquivo com marca\u00E7\u00F5es de data e hor\u00E1rio\n -Xbatch desativa a compila\u00E7\u00E3o em segundo plano\n -Xms<tamanho> define o tamanho inicial do heap Java\n -Xmx<tamanho> define o tamanho m\u00E1ximo do heap Java\n -Xss<tamanho> define o tamanho da pilha de threads java\n -Xprof produz dados de perfil da cpu\n -Xfuture ativa verifica\u00E7\u00F5es de n\u00EDvel m\u00E1ximo de exig\u00EAncia, prevendo o valor padr\u00E3o futuro\n -Xrs reduz o uso de sinais do SO pelo(a) Java/VM (consulte a documenta\u00E7\u00E3o)\n -Xcheck:jni executa verifica\u00E7\u00F5es adicionais de fun\u00E7\u00F5es da JNI\n -Xshare:off n\u00E3o tenta usar dados da classe compartilhada\n -Xshare:auto se poss\u00EDvel, usa dados da classe compartilhada (padr\u00E3o)\n -Xshare:on requer o uso de dados da classe compartilhada, caso contr\u00E1rio haver\u00E1 falha.\n -XshowSettings mostra todas as defini\u00E7\u00F5es e continua\n -XshowSettings:all\n mostra todas as defini\u00E7\u00F5es e continua\n -XshowSettings:vm mostra todas as defini\u00E7\u00F5es relacionadas \u00E0 vm e continua\n -XshowSettings:properties\n mostra todas as defini\u00E7\u00F5es da propriedade e continua\n -XshowSettings:locale\n mostra todas as defini\u00E7\u00F5es relativas \u00E0s configura\u00E7\u00F5es regionais e continua\n -XaddReads:<module>=<other-module>(,<other-module>)*\n <module> l\u00EA outros m\u00F3dulos,\n n\u00E3o importando a declara\u00E7\u00E3o do m\u00F3dulo\n -XaddExports:<module>/<package>=<other-module>(,<other-module>)*\n <module> exporta <package> para outros m\u00F3dulos,\n n\u00E3o importando a declara\u00E7\u00E3o do m\u00F3dulo\n -Xpatch:<module>=<file>({0}<file>)*\n Substitui ou aumenta um m\u00F3dulo com classes e recursos\n em arquivos JAR ou diret\u00F3rios\n -Xdisable-@files desativa uma expans\u00E3o adicional de arquivo de argumentos\n\nAs op\u00E7\u00F5es -X n\u00E3o s\u00E3o padronizadas e est\u00E3o sujeitas a altera\u00E7\u00F5es sem aviso.\n
java.launcher.X.usage=\ -Xbatch desativar compila\u00E7\u00E3o em segundo plano\n -Xbootclasspath/a:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n anexar ao final do caminho de classe bootstrap\n -Xcheck:jni executar verifica\u00E7\u00F5es adicionais de fun\u00E7\u00F5es JNI\n -Xcomp for\u00E7a a compila\u00E7\u00E3o de m\u00E9todos na primeira chamada\n -Xdebug fornecido para fins de compatibilidade reversa\n -Xdiag mostrar mensagens de diagn\u00F3stico adicionais\n -Xdiag:resolver mostrar mensagens de diagn\u00F3stico do resolvedor\n -Xdisable-@files desativar expans\u00E3o de arquivo de argumento adicional\n -Xfuture ativar verifica\u00E7\u00F5es mais rigorosas, antecipando padr\u00E3o futuro\n -Xint somente execu\u00E7\u00E3o em modo interpretado\n -Xinternalversion\n exibe informa\u00E7\u00F5es mais detalhadas de vers\u00E3o da JVM do que a\n op\u00E7\u00E3o -version\n -Xloggc:<file> registrar status de GC em um arquivo com time-stamps\n -Xmixed execu\u00E7\u00E3o em modo misto (padr\u00E3o)\n -Xmn<size> define o tamanho inicial e m\u00E1ximo (em bytes) do heap\n para a gera\u00E7\u00E3o jovem (infantil)\n -Xms<size> definir tamanho do heap Java inicial\n -Xmx<size> definir tamanho do heap Java m\u00E1ximo\n -Xnoclassgc desativar coleta de lixo de classe\n -Xprof emitir dados de perfil de cpu\n -Xrs reduzir uso de sinais do SO por Java/VM (consultar documenta\u00E7\u00E3o)\n -Xshare:auto usar dados de classe compartilhados, se poss\u00EDvel (padr\u00E3o)\n -Xshare:off n\u00E3o tentar usar dados de classe compartilhados\n -Xshare:on exigir o uso de dados de classe compartilhados; caso contr\u00E1rio, falhar\u00E1.\n -XshowSettings mostrar todas as defini\u00E7\u00F5es e continuar\n -XshowSettings:all\n mostrar todas as defini\u00E7\u00F5es e continuar\n -XshowSettings:locale\n mostrar todas as defini\u00E7\u00F5es relativas a localidade e continuar\n -XshowSettings:properties\n mostrar todas as defini\u00E7\u00F5es de propriedade e continuar\n -XshowSettings:vm mostrar todas as defini\u00E7\u00F5es relativas a vm e continuar\n -Xss<size> definir tamanho de pilha de thread java\n -Xverify define o modo do verificador de c\u00F3digo de byte\n --add-reads <module>=<target-module>(,<target-module>)*\n atualiza <module> para ler <target-module>, independentemente\n da declara\u00E7\u00E3o do m\u00F3dulo. \n <target-module> pode ser ALL-UNNAMED para ler todos os m\u00F3dulos\n sem nome.\n --add-exports <module>/<package>=<target-module>(,<target-module>)*\n atualiza <module> para exportar <package> para <target-module>,\n independentemente da declara\u00E7\u00E3o do m\u00F3dulo.\n <target-module> pode ser ALL-UNNAMED para exportar para todos\n os m\u00F3dulos sem nome.\n --patch-module <module>=<file>({0}<file>)*\n Substituir ou aumentar um m\u00F3dulo com classes e recursos\n em arquivo JAR ou diret\u00F3rios.\n\nEssas op\u00E7\u00F5es n\u00E3o s\u00E3o padr\u00E3o e est\u00E3o sujeitas a altera\u00E7\u00E3o sem aviso.\n
# Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\nAs op\u00E7\u00F5es a seguir s\u00E3o espec\u00EDficas para o Mac OS X:\n -XstartOnFirstThread\n executa o m\u00E9todo main() no primeiro thread (AppKit)\n -Xdock:name=<nome do aplicativo>\n substitui o nome do aplicativo padr\u00E3o exibido no encaixe\n -Xdock:icon=<caminho para o arquivo do \u00EDcone>\n substitui o \u00EDcone exibido no encaixe\n\n

View File

@ -24,9 +24,9 @@
#
# Translators please note do not translate the options themselves
java.launcher.opt.header = Syntax: {0} [options] class [args...]\n (f\u00F6r att k\u00F6ra en klass)\n eller {0} [options] -jar jarfile [args...]\n (f\u00F6r att k\u00F6ra en jar-fil)\n eller {0} [options] -mp <moduls\u00F6kv\u00E4g> -m <modulnamn>[/<huvudklass>] [args...]\n (f\u00F6r att k\u00F6ra huvudklassen i en modul)\nmed alternativen:\n
java.launcher.opt.header = Syntax: {0} [options] class [args...]\n (f\u00F6r att k\u00F6ra en klass)\n eller {0} [options] -jar jarfile [args...]\n (f\u00F6r att k\u00F6ra en jar-fil)\n eller {0} [options] -p <moduls\u00F6kv\u00E4g> -m <modulnamn>[/<huvudklass>] [args...]\n (f\u00F6r att k\u00F6ra huvudklassen i en modul)\nmed alternativen:\n
java.launcher.opt.datamodel =\ -d{0}\t anv\u00E4nd en {0}-bitsdatamodell om det finns\n
java.launcher.opt.datamodel =\ -d{0}\t Inaktuellt, tas bort i en framtida utg\u00E5va\n
java.launcher.opt.vmselect =\ {0}\t f\u00F6r att v\u00E4lja "{1}" VM\n
java.launcher.opt.hotspot =\ {0}\t \u00E4r en synonym f\u00F6r "{1}" VM [inaktuell]\n
@ -34,11 +34,12 @@ java.launcher.ergo.message1 =\ Standard-VM \u00E4r {0}
java.launcher.ergo.message2 =\ eftersom du k\u00F6r en serverklassmaskin.\n
# Translators please note do not translate the options themselves
java.launcher.opt.footer =\ -cp <klass\u00F6kv\u00E4g till kataloger och zip-/jar-filer>\n -classpath <klass\u00F6kv\u00E4g till kataloger och zip-/jar-filer>\n En {0}-avgr\u00E4nsad lista \u00F6ver kataloger, JAR-arkiv och\n ZIP-arkiv att s\u00F6ka efter klassfiler i.\n -mp <moduls\u00F6kv\u00E4g>\n -modulepath <moduls\u00F6kv\u00E4g>...\n En {0}-avgr\u00E4nsad lista \u00F6ver kataloger, d\u00E4r varje katalog\n \u00E4r en katalog med moduler.\n -upgrademodulepath <moduls\u00F6kv\u00E4g>...\n En {0}-avgr\u00E4nsad lista \u00F6ver kataloger, d\u00E4r varje katalog\n \u00E4r en katalog med moduler som ers\u00E4tter uppgraderingsbara\n moduler i exekveringsavbilden \n -m <modulnamn>[/<huvudklass>]\n den ursprungliga modulen att l\u00F6sa och namnet p\u00E5 huvudklassen\n att k\u00F6ra om den inte anges av modulen\n -addmods <modulnamn>[,<modulnamn>...]\n rotmoduler att l\u00F6sa f\u00F6rutom den ursprungliga modulen\n -limitmods <modulnamn>[,<modulnamn>...]\n begr\u00E4nsa universumet med observerbara moduler\n -listmods[:<modulnamn>[,<modulnamn>...]]\n lista de observerbara modulerna och avsluta\n --dry-run skapa VM:en men k\u00F6r inte huvudmetoden.\n Det h\u00E4r alternativet kan vara anv\u00E4ndbart f\u00F6r att validera\n kommandoradsalternativen, som modulsystemkonfigurationen.\n -D<name>=<v\u00E4rde>\n ange en systemvariabel\n -verbose:[class|gc|jni]\n aktivera utf\u00F6rliga utdata\n -version skriv ut produktversion och avsluta\n -showversion skriv ut produktversion och forts\u00E4tt\n -? -help skriv ut det h\u00E4r hj\u00E4lpmeddelandet\n -X skriv ut hj\u00E4lp f\u00F6r icke-standardalternativ\n -ea[:<paketnamn>...|:<klassnamn>]\n -enableassertions[:<paketnamn>...|:<klassnamn>]\n aktivera verifieringar med den angivna detaljgraden\n -da[:<paketnamn>...|:<klassnamn>]\n -disableassertions[:<paketnamn>...|:<klassnamn>]\n avaktivera verifieringar med den angivna detaljgraden\n -esa | -enablesystemassertions\n aktivera systemverifieringar\n -dsa | -disablesystemassertions\n avaktivera systemverifieringar\n -agentlib:<biblioteksnamn>[=<alternativ>]\n ladda det ursprungliga agentbiblioteket <biblioteksnamn>, exempel: -agentlib:jdwp\n se \u00E4ven -agentlib:jdwp=help\n -agentpath:<s\u00F6kv\u00E4gsnamn>[=<alternativ>]\n ladda det ursprungliga agentbiblioteket med fullst\u00E4ndigt s\u00F6kv\u00E4gsnamn\n -javaagent:<jar-s\u00F6kv\u00E4g>[=<alternativ>]\n ladda agenten f\u00F6r programmeringsspr\u00E5ket Java, se java.lang.instrument\n -splash:<bilds\u00F6kv\u00E4g>\n visa v\u00E4lkomstsk\u00E4rmen med den angivna bilden\n @<fils\u00F6kv\u00E4g> l\u00E4s alternativ fr\u00E5n den angivna filen\n
java.launcher.opt.footer =\ -cp <klass\u00F6kv\u00E4g till kataloger och zip-/jar-filer>\n -classpath <klass\u00F6kv\u00E4g till kataloger och zip-/jar-filer>\n --class-path <klass\u00F6kv\u00E4g till kataloger och zip-/jar-filer>\n En lista \u00F6ver kataloger, JAR-arkiv och ZIP-arkiv att\n s\u00F6ka efter klassfiler i, avgr\u00E4nsad med {0}.\n -p <moduls\u00F6kv\u00E4g>\n --module-path <moduls\u00F6kv\u00E4g>...\n En lista \u00F6ver kataloger, d\u00E4r varje katalog \u00E4r en katalog\n med moduler, avgr\u00E4nsad med {0}.\n --upgrade-module-path <moduls\u00F6kv\u00E4g>...\n En lista \u00F6ver kataloger, d\u00E4r varje katalog \u00E4r en katalog\n med moduler som ers\u00E4tter uppgraderingsbara moduler\n i exekveringsavbilden, avgr\u00E4nsad med {0} \n -m <modul>[/<huvudklass>]\n --module <modulnamn>[/<huvudklass>]\n den ursprungliga modulen att l\u00F6sa och namnet p\u00E5 huvudklassen\n att k\u00F6ra, om den inte anges av modulen\n --add-modules <modulnamn>[,<modulnamn>...]\n rotmoduler att l\u00F6sa f\u00F6rutom den ursprungliga modulen.\n <modulnamn> kan \u00E4ven vara ALL-DEFAULT, ALL-SYSTEM och\n ALL-MODULE-PATH.\n --limit-modules <modulnamn>[,<modulnamn>...]\n begr\u00E4nsa universumet med observerbara moduler\n --list-modules [<modulnamn>[,<modulnamn>...]]\n lista de observerbara modulerna och avsluta\n --dry-run skapa VM:en men k\u00F6r inte huvudmetoden.\n Det h\u00E4r alternativet kan vara anv\u00E4ndbart f\u00F6r att validera\n kommandoradsalternativen, som modulsystemkonfigurationen.\n -D<namn>=<v\u00E4rde>\n ange en systemegenskap\n -verbose:[class|gc|jni]\n aktivera utf\u00F6rliga utdata\n -version skriv ut produktversion och avsluta\n -showversion skriv ut produktversion och forts\u00E4tt\n -? -help --help\n skriv ut det h\u00E4r hj\u00E4lpmeddelandet\n -X skriv ut hj\u00E4lp f\u00F6r icke-standardalternativ\n -ea[:<paketnamn>...|:<klassnamn>]\n -enableassertions[:<paketnamn>...|:<klassnamn>]\n aktivera verifieringar med den angivna detaljgraden\n -da[:<paketnamn>...|:<klassnamn>]\n -disableassertions[:<paketnamn>...|:<klassnamn>]\n avaktivera verifieringar med den angivna detaljgraden\n -esa | -enablesystemassertions\n aktivera systemverifieringar\n -dsa | -disablesystemassertions\n avaktivera systemverifieringar\n -agentlib:<biblioteksnamn>[=<alternativ>]\n ladda det ursprungliga agentbiblioteket <biblioteksnamn>, exempel: -agentlib:jdwp\n se \u00E4ven -agentlib:jdwp=help\n -agentpath:<s\u00F6kv\u00E4gsnamn>[=<alternativ>]\n ladda det ursprungliga agentbiblioteket med fullst\u00E4ndigt s\u00F6kv\u00E4gsnamn\n -javaagent:<jar-s\u00F6kv\u00E4g>[=<alternativ>]\n ladda agenten f\u00F6r programmeringsspr\u00E5ket Java, se java.lang.instrument\n -splash:<bilds\u00F6kv\u00E4g>\n visa v\u00E4lkomstsk\u00E4rmen med den angivna bilden\n HiDPI-skal\u00E4ndrade bilder st\u00F6ds automatiskt och anv\u00E4nds om de \u00E4r\n tillg\u00E4ngliga. Filnamnet p\u00E5 den oskal\u00E4ndrade bilden, t.ex.\n bild.filtill\u00E4gg, ska alltid \u00F6verf\u00F6ras som argument till\n alternativet -splash.\n Den l\u00E4mpligaste skal\u00E4ndrade bilden v\u00E4ljs automatiskt.\n Mer information finns i dokumentationen f\u00F6r API:t SplashScreen.\n @<fils\u00F6kv\u00E4g> l\u00E4s alternativ fr\u00E5n den angivna filen\nOm du vill ange ett argument f\u00F6r \
ett l\u00E5ngt alternativ kan du anv\u00E4nda --<namn>=<v\u00E4rde>\neller --<namn> <v\u00E4rde>.\n
See Se http://www.oracle.com/technetwork/java/javase/documentation/index.html f\u00F6r mer information.
# Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xmixed exekvering i blandat l\u00E4ge (standard)\n -Xint endast exekvering i tolkat l\u00E4ge\n -Xbootclasspath/a:<kataloger och zip-/jar-filer avgr\u00E4nsade med {0}>\n l\u00E4gg till sist i klass\u00F6kv\u00E4gen f\u00F6r programladdning\n -Xdiag visa fler diagnostiska meddelanden\n -Xdiag:resolver visa diagnostiska meddelanden f\u00F6r matchning\n -Xnoclassgc avaktivera klasskr\u00E4pinsamling\n -Xloggc:<fil> logga GC-status till en fil med tidsst\u00E4mplar\n -Xbatch avaktivera bakgrundskompilering\n -Xms<storlek> ange ursprunglig storlek f\u00F6r Java-heap-utrymmet\n -Xmx<storlek> ange st\u00F6rsta storlek f\u00F6r Java-heap-utrymmet\n -Xss<storlek> ange storlek f\u00F6r java-tr\u00E5dsstacken\n -Xprof utdata f\u00F6r processorprofilering\n -Xfuture aktivera str\u00E4ngaste kontroller, f\u00F6rv\u00E4ntad framtida standard\n -Xrs minska operativsystemssignalanv\u00E4ndning f\u00F6r Java/VM (se dokumentationen)\n -Xcheck:jni utf\u00F6r fler kontroller f\u00F6r JNI-funktioner\n -Xshare:off f\u00F6rs\u00F6k inte anv\u00E4nda delade klassdata\n -Xshare:auto anv\u00E4nd delade klassdata om m\u00F6jligt (standard)\n -Xshare:on kr\u00E4v anv\u00E4ndning av delade klassdata, utf\u00F6r inte i annat fall.\n -XshowSettings visa alla inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:all\n visa alla inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:vm visa alla vm-relaterade inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:properties\n visa alla egenskapsinst\u00E4llningar och forts\u00E4tt\n -XshowSettings:locale\n visa alla spr\u00E5kkonventionsrelaterade inst\u00E4llningar och forts\u00E4tt\n -XaddReads:<modul>=<annan modul>(,<annan modul>)*\n <modul> l\u00E4ser andra moduler,\n oavsett moduldeklarationen\n -XaddExports:<modul>/<paket>=<annan modul>(,<annan modul>)*\n <modul> exporterar <packet> till andra moduler,\n oavsett moduldeklarationen\n -Xpatch:<modul>=<fil>({0}<fil>)*\n \u00C5sidos\u00E4tt eller ut\u00F6ka en modul med klasser och resurser\n i JAR-filer eller kataloger\n -Xdisable-@files avaktivera framtida argumentfilsut\u00F6kning\n\n-X-alternativen \u00E4r inte standard och kan \u00E4ndras utan f\u00F6reg\u00E5ende meddelande.\n
java.launcher.X.usage=\ -Xbatch avaktivera bakgrundskompilering\n -Xbootclasspath/a:<kataloger och zip-/jar-filer avgr\u00E4nsade med {0}>\n l\u00E4gg till sist i klass\u00F6kv\u00E4gen f\u00F6r programladdning\n -Xcheck:jni utf\u00F6r fler kontroller f\u00F6r JNI-funktioner\n -Xcomp tvingar kompilering av metoder vid det f\u00F6rsta anropet\n -Xdebug tillhandah\u00E5lls f\u00F6r bak\u00E5tkompatibilitet\n -Xdiag visa fler diagnostiska meddelanden\n -Xdiag:resolver visa diagnostiska meddelanden f\u00F6r matchning\n -Xdisable-@files avaktivera ytterligare argumentfilsut\u00F6kning\n -Xfuture aktivera str\u00E4ngaste kontroller, f\u00F6rv\u00E4ntad framtida standard\n -Xint endast exekvering i tolkat l\u00E4ge\n -Xinternalversion\n visar mer detaljerad information om JVM-version \u00E4n\n alternativet -version\n -Xloggc:<fil> logga GC-status till en fil med tidsst\u00E4mplar\n -Xmixed exekvering i blandat l\u00E4ge (standard)\n -Xmn<storlek> anger ursprunglig och maximal storlek (i byte) f\u00F6r h\u00F6gen f\u00F6r\n generationen med nyare objekt (h\u00F6gen f\u00F6r tilldelning av nya objekt)\n -Xms<storlek> ange ursprunglig storlek f\u00F6r Java-heap-utrymmet\n -Xmx<storlek> ange st\u00F6rsta storlek f\u00F6r Java-heap-utrymmet\n -Xnoclassgc avaktivera klasskr\u00E4pinsamling\n -Xprof utdata f\u00F6r processorprofilering\n -Xrs minska operativsystemssignalanv\u00E4ndning f\u00F6r Java/VM (se dokumentationen)\n -Xshare:auto anv\u00E4nd delade klassdata om m\u00F6jligt (standard)\n -Xshare:off f\u00F6rs\u00F6k inte anv\u00E4nda delade klassdata\n -Xshare:on kr\u00E4v anv\u00E4ndning av delade klassdata, utf\u00F6r inte i annat fall.\n -XshowSettings visa alla inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:all\n visa alla inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:locale\n visa alla spr\u00E5kkonventionsrelaterade inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:properties\n visa alla egenskapsinst\u00E4llningar och forts\u00E4tt\n -XshowSettings:vm visa alla vm-relaterade inst\u00E4llningar och forts\u00E4tt\n -Xss<storlek> ange storlek f\u00F6r java-tr\u00E5dsstacken\n -Xverify anger l\u00E4ge f\u00F6r bytekodverifieraren\n --add-reads <modul>=<m\u00E5lmodul>(,<m\u00E5lmodul>)*\n uppdaterar <modul> att l\u00E4sa <m\u00E5lmodul>, oavsett\n moduldeklarationen. \n <m\u00E5lmodul> kan vara ALL-UNNAMED f\u00F6r att l\u00E4sa alla\n ej namngivna moduler.\n --add-exports <modul>/<paket>=<m\u00E5lmodul>(,<m\u00E5lmodul>)*\n uppdaterar <modul> att exportera <paket> till <m\u00E5lmodul>,\n oavsett moduldeklarationen.\n <m\u00E5lmodul> kan vara ALL-UNNAMED f\u00F6r att exportera till alla\n ej namngivna moduler.\n --patch-module <modul>=<fil>({0}<fil>)*\n \u00C5sidos\u00E4tt eller ut\u00F6ka en modul med klasser och resurser\n i JAR-filer eller kataloger.\n\nDe h\u00E4r alternativen \u00E4r icke-standardalternativ och kan \u00E4ndras utan f\u00F6reg\u00E5ende meddelande.\n
# Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\nF\u00F6ljande alternativ \u00E4r Mac OS X-specifika:\n -XstartOnFirstThread\n k\u00F6r main()-metoden p\u00E5 den f\u00F6rsta (AppKit)-tr\u00E5den\n -Xdock:name=<applikationsnamn>\n \u00E5sidos\u00E4tt det standardapplikationsnamn som visas i dockan\n -Xdock:icon=<s\u00F6kv\u00E4g till ikonfil>\n \u00E5sidos\u00E4tt den standardikon som visas i dockan\n\n

View File

@ -24,9 +24,9 @@
#
# Translators please note do not translate the options themselves
java.launcher.opt.header = \u7528\u6CD5: {0} [options] class [args...]\n (\u6267\u884C\u7C7B)\n \u6216 {0} [options] -jar jarfile [args...]\n (\u6267\u884C jar \u6587\u4EF6)\n \u6216 {0} [options] -mp <\u6A21\u5757\u8DEF\u5F84> -m <\u6A21\u5757\u540D\u79F0>[/<\u4E3B\u7C7B>] [args...]\n (\u6267\u884C\u6A21\u5757\u4E2D\u7684\u4E3B\u7C7B)\n\u5176\u4E2D\u9009\u9879\u5305\u62EC:\n
java.launcher.opt.header = \u7528\u6CD5: {0} [options] class [args...]\n (\u6267\u884C\u7C7B)\n \u6216 {0} [options] -jar jarfile [args...]\n (\u6267\u884C jar \u6587\u4EF6)\n \u6216 {0} [options] -p <\u6A21\u5757\u8DEF\u5F84> -m <\u6A21\u5757\u540D\u79F0>[/<\u6A21\u5757\u7C7B>] [args...]\n (\u6267\u884C\u6A21\u5757\u4E2D\u7684\u4E3B\u7C7B)\n\u5176\u4E2D\u9009\u9879\u5305\u62EC:\n
java.launcher.opt.datamodel =\ -d{0}\t \u4F7F\u7528 {0} \u4F4D\u6570\u636E\u6A21\u578B (\u5982\u679C\u53EF\u7528)\n
java.launcher.opt.datamodel =\ -d{0}\t \u5DF2\u8FC7\u65F6, \u5728\u4EE5\u540E\u7684\u53D1\u884C\u7248\u4E2D\u5C06\u88AB\u5220\u9664\n
java.launcher.opt.vmselect =\ {0}\t \u9009\u62E9 "{1}" VM\n
java.launcher.opt.hotspot =\ {0}\t \u662F "{1}" VM \u7684\u540C\u4E49\u8BCD [\u5DF2\u8FC7\u65F6]\n
@ -34,12 +34,13 @@ java.launcher.ergo.message1 =\ \u9ED8\u8BA4 VM \u662F {0}
java.launcher.ergo.message2 =\ \u56E0\u4E3A\u60A8\u662F\u5728\u670D\u52A1\u5668\u7C7B\u8BA1\u7B97\u673A\u4E0A\u8FD0\u884C\u3002\n
# Translators please note do not translate the options themselves
java.launcher.opt.footer =\ -cp <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n -classpath <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n \u7528\u4E8E\u641C\u7D22\u7C7B\u6587\u4EF6\u7684\u76EE\u5F55, JAR \u6863\u6848\n \u548C ZIP \u6863\u6848\u7684\u5217\u8868, \u4F7F\u7528 {0} \u5206\u9694\u3002\n -mp <\u6A21\u5757\u8DEF\u5F84>\n -modulepath <\u6A21\u5757\u8DEF\u5F84>...\n \u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u5217\u8868, \u6BCF\u4E2A\u76EE\u5F55\n \u90FD\u662F\u4E00\u4E2A\u5305\u542B\u6A21\u5757\u7684\u76EE\u5F55\u3002\n -upgrademodulepath <\u6A21\u5757\u8DEF\u5F84>...\n \u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u5217\u8868, \u6BCF\u4E2A\u76EE\u5F55\n \u90FD\u662F\u4E00\u4E2A\u5305\u542B\u6A21\u5757\u7684\u76EE\u5F55, \u8FD9\u4E9B\u6A21\u5757\n \u7528\u4E8E\u66FF\u6362\u8FD0\u884C\u65F6\u6620\u50CF\u4E2D\u7684\u53EF\u5347\u7EA7\u6A21\u5757\n -m <\u6A21\u5757\u540D\u79F0>[/<\u4E3B\u7C7B>]\n \u8981\u89E3\u6790\u7684\u521D\u59CB\u6A21\u5757, \u4EE5\u53CA\u5728\u672A\u7531\u6A21\u5757\u6307\u5B9A\u65F6\n \u8981\u6267\u884C\u7684\u4E3B\u7C7B\u540D\u79F0\n -addmods <\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]\n \u9664\u4E86\u521D\u59CB\u6A21\u5757\u4E4B\u5916\u8981\u89E3\u6790\u7684\u6839\u6A21\u5757\n -limitmods <\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]\n \u9650\u5236\u53EF\u89C2\u5BDF\u6A21\u5757\u7684\u9886\u57DF\n -listmods[:<\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]]\n \u5217\u51FA\u53EF\u89C2\u5BDF\u6A21\u5757\u5E76\u9000\u51FA\n --dry-run \u521B\u5EFA VM \u4F46\u4E0D\u6267\u884C\u4E3B\u65B9\u6CD5\u3002\n \u6B64 --dry-run \u9009\u9879\u5BF9\u4E8E\u9A8C\u8BC1\u8BF8\u5982\n \u6A21\u5757\u7CFB\u7EDF\u914D\u7F6E\u8FD9\u6837\u7684\u547D\u4EE4\u884C\u9009\u9879\u53EF\u80FD\u662F\u975E\u5E38\u6709\u7528\u7684\u3002\n -D<\u540D\u79F0>=<\u503C>\n \u8BBE\u7F6E\u7CFB\u7EDF\u5C5E\u6027\n -verbose:[class|gc|jni]\n \u542F\u7528\u8BE6\u7EC6\u8F93\u51FA\n -version \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u9000\u51FA\n -showversion \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u7EE7\u7EED\n -? -help \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F\n -X \u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u5E2E\u52A9\n -ea[:<\u7A0B\u5E8F\u5305\u540D\u79F0>...|:<\u7C7B\u540D>]\n -enableassertions[:<\u7A0B\u5E8F\u5305\u540D\u79F0>...|:<\u7C7B\u540D>]\n \u6309\u6307\u5B9A\u7684\u7C92\u5EA6\u542F\u7528\u65AD\u8A00\n -da[:<\u7A0B\u5E8F\u5305\u540D\u79F0>...|:<\u7A0B\u5E8F\u5305\u540D\u79F0>]\n -disableassertions[:<\u7A0B\u5E8F\u5305\u540D\u79F0>...|:<\u7C7B\u540D>]\n \u7981\u7528\u5177\u6709\u6307\u5B9A\u7C92\u5EA6\u7684\u65AD\u8A00\n -esa | -enablesystemassertions\n \u542F\u7528\u7CFB\u7EDF\u65AD\u8A00\n -dsa | -disablesystemassertions\n \u7981\u7528\u7CFB\u7EDF\u65AD\u8A00\n -agentlib:<\u5E93\u540D>[=<\u9009\u9879>]\n \u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93 <\u5E93\u540D>, \u4F8B\u5982 -agentlib:jdwp\n \u53E6\u8BF7\u53C2\u9605 -agentlib:jdwp=help\n -agentpath:<\u8DEF\u5F84\u540D>[=<\u9009\u9879>]\n \u6309\u5B8C\u6574\u8DEF\u5F84\u540D\u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93\n -javaagent:<jar \u8DEF\u5F84>[=<\u9009\u9879>]\n \u52A0\u8F7D Java \u7F16\u7A0B\u8BED\u8A00\u4EE3\u7406, \u8BF7\u53C2\u9605 java.lang.instrument\n -splash:<\u56FE\u50CF\u8DEF\u5F84>\n \u4F7F\u7528\u6307\u5B9A\u7684\u56FE\u50CF\u663E\u793A\u542F\u52A8\u5C4F\u5E55\n @<\u6587\u4EF6\u8DEF\u5F84> \
\u4ECE\u6307\u5B9A\u6587\u4EF6\u4E2D\u8BFB\u53D6\u9009\u9879\n
java.launcher.opt.footer =\ -cp <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n -classpath <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n --class-path <\u76EE\u5F55\u548C zip/jar \u6587\u4EF6\u7684\u7C7B\u641C\u7D22\u8DEF\u5F84>\n \u7528\u4E8E\u641C\u7D22\u7C7B\u6587\u4EF6\u7684\u76EE\u5F55, JAR \u6863\u6848\n \u548C ZIP \u6863\u6848\u7684\u5217\u8868, \u4F7F\u7528 {0} \u5206\u9694\u3002\n -p <\u6A21\u5757\u8DEF\u5F84>\n --module-path <\u6A21\u5757\u8DEF\u5F84>...\n \u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u5217\u8868, \u6BCF\u4E2A\u76EE\u5F55\n \u90FD\u662F\u4E00\u4E2A\u5305\u542B\u6A21\u5757\u7684\u76EE\u5F55\u3002\n --upgrade-module-path <\u6A21\u5757\u8DEF\u5F84>...\n \u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u5217\u8868, \u6BCF\u4E2A\u76EE\u5F55\n \u90FD\u662F\u4E00\u4E2A\u5305\u542B\u6A21\u5757\u7684\u76EE\u5F55, \u8FD9\u4E9B\u6A21\u5757\n \u7528\u4E8E\u66FF\u6362\u8FD0\u884C\u65F6\u6620\u50CF\u4E2D\u7684\u53EF\u5347\u7EA7\u6A21\u5757\n -m <\u6A21\u5757>[/<\u4E3B\u7C7B>]\n --module <\u6A21\u5757\u540D\u79F0>[/<\u4E3B\u7C7B>]\n \u8981\u89E3\u6790\u7684\u521D\u59CB\u6A21\u5757, \u4EE5\u53CA\u5728\u672A\u7531\u6A21\u5757\u6307\u5B9A\u65F6\n \u8981\u6267\u884C\u7684\u4E3B\u7C7B\u540D\u79F0\n --add-modules <\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]\n \u9664\u4E86\u521D\u59CB\u6A21\u5757\u4E4B\u5916\u8981\u89E3\u6790\u7684\u6839\u6A21\u5757\u3002\n <\u6A21\u5757\u540D\u79F0> \u8FD8\u53EF\u4EE5\u4E3A ALL-DEFAULT, ALL-SYSTEM,\n ALL-MODULE-PATH\u3002\n --limit-modules <\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]\n \u9650\u5236\u53EF\u89C2\u5BDF\u6A21\u5757\u7684\u9886\u57DF\n --list-modules [<\u6A21\u5757\u540D\u79F0>[,<\u6A21\u5757\u540D\u79F0>...]]\n \u5217\u51FA\u53EF\u89C2\u5BDF\u6A21\u5757\u5E76\u9000\u51FA\n --dry-run \u521B\u5EFA VM \u4F46\u4E0D\u6267\u884C\u4E3B\u65B9\u6CD5\u3002\n \u6B64 --dry-run \u9009\u9879\u5BF9\u4E8E\u9A8C\u8BC1\u8BF8\u5982\n \u6A21\u5757\u7CFB\u7EDF\u914D\u7F6E\u8FD9\u6837\u7684\u547D\u4EE4\u884C\u9009\u9879\u53EF\u80FD\u662F\u975E\u5E38\u6709\u7528\u7684\u3002\n -D<\u540D\u79F0>=<\u503C>\n \u8BBE\u7F6E\u7CFB\u7EDF\u5C5E\u6027\n -verbose:[class|gc|jni]\n \u542F\u7528\u8BE6\u7EC6\u8F93\u51FA\n -version \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u9000\u51FA\n -showversion \u8F93\u51FA\u4EA7\u54C1\u7248\u672C\u5E76\u7EE7\u7EED\n -? -help --help\n \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F\n -X \u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u5E2E\u52A9\n -ea[:<\u7A0B\u5E8F\u5305\u540D\u79F0>...|:<\u7C7B\u540D>]\n -enableassertions[:<\u7A0B\u5E8F\u5305\u540D\u79F0>...|:<\u7C7B\u540D>]\n \u6309\u6307\u5B9A\u7684\u7C92\u5EA6\u542F\u7528\u65AD\u8A00\n -da[:<\u7A0B\u5E8F\u5305\u540D\u79F0>...|:<\u7C7B\u540D>]\n -disableassertions[:<\u7A0B\u5E8F\u5305\u540D\u79F0>...|:<\u7C7B\u540D>]\n \u6309\u6307\u5B9A\u7684\u7C92\u5EA6\u7981\u7528\u65AD\u8A00\n -esa | -enablesystemassertions\n \u542F\u7528\u7CFB\u7EDF\u65AD\u8A00\n -dsa | -disablesystemassertions\n \u7981\u7528\u7CFB\u7EDF\u65AD\u8A00\n -agentlib:<\u5E93\u540D>[=<\u9009\u9879>]\n \u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93 <\u5E93\u540D>, \u4F8B\u5982 -agentlib:jdwp\n \u53E6\u8BF7\u53C2\u9605 -agentlib:jdwp=help\n -agentpath:<\u8DEF\u5F84\u540D>[=<\u9009\u9879>]\n \u6309\u5B8C\u6574\u8DEF\u5F84\u540D\u52A0\u8F7D\u672C\u673A\u4EE3\u7406\u5E93\n -javaagent:<jar \u8DEF\u5F84>[=<\u9009\u9879>]\n \u52A0\u8F7D \
Java \u7F16\u7A0B\u8BED\u8A00\u4EE3\u7406, \u8BF7\u53C2\u9605 java.lang.instrument\n -splash:<\u56FE\u50CF\u8DEF\u5F84>\n \u4F7F\u7528\u6307\u5B9A\u7684\u56FE\u50CF\u663E\u793A\u542F\u52A8\u5C4F\u5E55\n \u81EA\u52A8\u652F\u6301\u548C\u4F7F\u7528 HiDPI \u7F29\u653E\u56FE\u50CF\n (\u5982\u679C\u53EF\u7528)\u3002\u672A\u7F29\u653E\u7684\u56FE\u50CF\u6587\u4EF6\u540D (\u4F8B\u5982, image.ext)\n \u5E94\u59CB\u7EC8\u4F5C\u4E3A\u53C2\u6570\u4F20\u9012\u7ED9 -splash \u9009\u9879\u3002\n \u5C06\u81EA\u52A8\u9009\u53D6\u63D0\u4F9B\u7684\u6700\u9002\u5F53\u7684\u7F29\u653E\n \u56FE\u50CF\u3002\n \u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605 SplashScreen API \u6587\u6863\u3002\n @<\u6587\u4EF6\u8DEF\u5F84> \u4ECE\u6307\u5B9A\u6587\u4EF6\u4E2D\u8BFB\u53D6\u9009\u9879\n\u8981\u4E3A\u957F\u9009\u9879\u6307\u5B9A\u53C2\u6570, \u53EF\u4EE5\u4F7F\u7528 --<\u540D\u79F0>=<\u503C> \u6216\n--<\u540D\u79F0> <\u503C>\u3002\n
See \u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605 http://www.oracle.com/technetwork/java/javase/documentation/index.html\u3002
# Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xmixed \u6DF7\u5408\u6A21\u5F0F\u6267\u884C (\u9ED8\u8BA4\u503C)\n -Xint \u4EC5\u89E3\u91CA\u6A21\u5F0F\u6267\u884C\n -Xbootclasspath/a:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n \u9644\u52A0\u5728\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u672B\u5C3E\n -Xdiag \u663E\u793A\u9644\u52A0\u8BCA\u65AD\u6D88\u606F\n -Xdiag:resolver \u663E\u793A\u89E3\u6790\u5668\u8BCA\u65AD\u6D88\u606F\n -Xnoclassgc \u7981\u7528\u7C7B\u5783\u573E\u6536\u96C6\n -Xloggc:<\u6587\u4EF6> \u5C06 GC \u72B6\u6001\u8BB0\u5F55\u5728\u6587\u4EF6\u4E2D (\u5E26\u65F6\u95F4\u6233)\n -Xbatch \u7981\u7528\u540E\u53F0\u7F16\u8BD1\n -Xms<\u5927\u5C0F> \u8BBE\u7F6E\u521D\u59CB Java \u5806\u5927\u5C0F\n -Xmx<\u5927\u5C0F> \u8BBE\u7F6E\u6700\u5927 Java \u5806\u5927\u5C0F\n -Xss<\u5927\u5C0F> \u8BBE\u7F6E Java \u7EBF\u7A0B\u5806\u6808\u5927\u5C0F\n -Xprof \u8F93\u51FA cpu \u5206\u6790\u6570\u636E\n -Xfuture \u542F\u7528\u6700\u4E25\u683C\u7684\u68C0\u67E5, \u9884\u671F\u5C06\u6765\u7684\u9ED8\u8BA4\u503C\n -Xrs \u51CF\u5C11 Java/VM \u5BF9\u64CD\u4F5C\u7CFB\u7EDF\u4FE1\u53F7\u7684\u4F7F\u7528 (\u8BF7\u53C2\u9605\u6587\u6863)\n -Xcheck:jni \u5BF9 JNI \u51FD\u6570\u6267\u884C\u5176\u4ED6\u68C0\u67E5\n -Xshare:off \u4E0D\u5C1D\u8BD5\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E\n -Xshare:auto \u5728\u53EF\u80FD\u7684\u60C5\u51B5\u4E0B\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E (\u9ED8\u8BA4\u503C)\n -Xshare:on \u8981\u6C42\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E, \u5426\u5219\u5C06\u5931\u8D25\u3002\n -XshowSettings \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:all\n \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:vm \u663E\u793A\u6240\u6709\u4E0E vm \u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:properties\n \u663E\u793A\u6240\u6709\u5C5E\u6027\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:locale\n \u663E\u793A\u6240\u6709\u4E0E\u533A\u57DF\u8BBE\u7F6E\u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XaddReads:<\u6A21\u5757>=<\u5176\u4ED6\u6A21\u5757>(,<\u5176\u4ED6\u6A21\u5757>)*\n <\u6A21\u5757> \u8BFB\u53D6\u5176\u4ED6\u6A21\u5757,\n \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\n -XaddExports:<\u6A21\u5757>/<\u7A0B\u5E8F\u5305>=<\u5176\u4ED6\u6A21\u5757>(,<\u5176\u4ED6\u6A21\u5757>)*\n <\u6A21\u5757> \u5C06 <\u7A0B\u5E8F\u5305> \u5BFC\u51FA\u5230\u5176\u4ED6\u6A21\u5757,\n \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\n -Xpatch:<\u6A21\u5757>=<\u6587\u4EF6>({0}<\u6587\u4EF6>)*\n \u4F7F\u7528 JAR \u6587\u4EF6\u6216\u76EE\u5F55\u4E2D\u7684\u7C7B\u548C\u8D44\u6E90\n \u8986\u76D6\u6216\u589E\u5F3A\u6A21\u5757\n -Xdisable-@files \u7981\u6B62\u8FDB\u4E00\u6B65\u6269\u5C55\u53C2\u6570\u6587\u4EF6\n\n-X \u9009\u9879\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
java.launcher.X.usage=\ -Xbatch \u7981\u7528\u540E\u53F0\u7F16\u8BD1\n -Xbootclasspath/a:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n \u9644\u52A0\u5728\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u672B\u5C3E\n -Xcheck:jni \u5BF9 JNI \u51FD\u6570\u6267\u884C\u5176\u4ED6\u68C0\u67E5\n -Xcomp \u5728\u9996\u6B21\u8C03\u7528\u65F6\u5F3A\u5236\u7F16\u8BD1\u65B9\u6CD5\n -Xdebug \u4E3A\u5B9E\u73B0\u5411\u540E\u517C\u5BB9\u800C\u63D0\u4F9B\n -Xdiag \u663E\u793A\u9644\u52A0\u8BCA\u65AD\u6D88\u606F\n -Xdiag:resolver \u663E\u793A\u89E3\u6790\u5668\u8BCA\u65AD\u6D88\u606F\n -Xdisable-@files \u7981\u6B62\u8FDB\u4E00\u6B65\u6269\u5C55\u53C2\u6570\u6587\u4EF6\n -Xfuture \u542F\u7528\u6700\u4E25\u683C\u7684\u68C0\u67E5, \u9884\u671F\u5C06\u6765\u7684\u9ED8\u8BA4\u503C\n -Xint \u4EC5\u89E3\u91CA\u6A21\u5F0F\u6267\u884C\n -Xinternalversion\n \u663E\u793A\u6BD4 -version \u9009\u9879\u66F4\u8BE6\u7EC6\u7684 JVM\n \u7248\u672C\u4FE1\u606F\n -Xloggc:<\u6587\u4EF6> \u5C06 GC \u72B6\u6001\u8BB0\u5F55\u5728\u6587\u4EF6\u4E2D (\u5E26\u65F6\u95F4\u6233)\n -Xmixed \u6DF7\u5408\u6A21\u5F0F\u6267\u884C (\u9ED8\u8BA4\u503C)\n -Xmn<\u5927\u5C0F> \u4E3A\u5E74\u8F7B\u4EE3 (\u65B0\u751F\u4EE3) \u8BBE\u7F6E\u521D\u59CB\u548C\u6700\u5927\u5806\u5927\u5C0F\n (\u4EE5\u5B57\u8282\u4E3A\u5355\u4F4D)\n -Xms<\u5927\u5C0F> \u8BBE\u7F6E\u521D\u59CB Java \u5806\u5927\u5C0F\n -Xmx<\u5927\u5C0F> \u8BBE\u7F6E\u6700\u5927 Java \u5806\u5927\u5C0F\n -Xnoclassgc \u7981\u7528\u7C7B\u5783\u573E\u6536\u96C6\n -Xprof \u8F93\u51FA cpu \u914D\u7F6E\u6587\u4EF6\u6570\u636E\n -Xrs \u51CF\u5C11 Java/VM \u5BF9\u64CD\u4F5C\u7CFB\u7EDF\u4FE1\u53F7\u7684\u4F7F\u7528 (\u8BF7\u53C2\u9605\u6587\u6863)\n -Xshare:auto \u5728\u53EF\u80FD\u7684\u60C5\u51B5\u4E0B\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E (\u9ED8\u8BA4\u503C)\n -Xshare:off \u4E0D\u5C1D\u8BD5\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E\n -Xshare:on \u8981\u6C42\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E, \u5426\u5219\u5C06\u5931\u8D25\u3002\n -XshowSettings \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:all\n \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:locale\n \u663E\u793A\u6240\u6709\u4E0E\u533A\u57DF\u8BBE\u7F6E\u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EEDe\n -XshowSettings:properties\n \u663E\u793A\u6240\u6709\u5C5E\u6027\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:vm \u663E\u793A\u6240\u6709\u4E0E vm \u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -Xss<\u5927\u5C0F> \u8BBE\u7F6E Java \u7EBF\u7A0B\u5806\u6808\u5927\u5C0F\n -Xverify \u8BBE\u7F6E\u5B57\u8282\u7801\u9A8C\u8BC1\u5668\u7684\u6A21\u5F0F\n --add-reads <\u6A21\u5757>=<\u76EE\u6807\u6A21\u5757>(,<\u76EE\u6807\u6A21\u5757>)*\n \u66F4\u65B0 <\u6A21\u5757> \u4EE5\u8BFB\u53D6 <\u76EE\u6807\u6A21\u5757>,\n \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n <\u76EE\u6807\u6A21\u5757> \u53EF\u4EE5\u662F ALL-UNNAMED \u4EE5\u8BFB\u53D6\u6240\u6709\u672A\u547D\u540D\n \u6A21\u5757\u3002\n --add-exports <\u6A21\u5757>/<\u7A0B\u5E8F\u5305>=<\u76EE\u6807\u6A21\u5757>(,<\u76EE\u6807\u6A21\u5757>)*\n \u66F4\u65B0 <\u6A21\u5757> \u4EE5\u5C06 <\u7A0B\u5E8F\u5305> \u5BFC\u51FA\u5230 <\u76EE\u6807\u6A21\u5757>,\n \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n <\u76EE\u6807\u6A21\u5757> \u53EF\u4EE5\u662F ALL-UNNAMED \u4EE5\u5BFC\u51FA\u6240\u6709\n \u672A\u547D\u540D\u6A21\u5757\u3002\n --patch-module \
<\u6A21\u5757>=<\u6587\u4EF6>({0}<\u6587\u4EF6>)*\n \u4F7F\u7528 JAR \u6587\u4EF6\u6216\u76EE\u5F55\u4E2D\u7684\u7C7B\u548C\u8D44\u6E90\n \u8986\u76D6\u6216\u589E\u5F3A\u6A21\u5757\u3002\n\n\u8FD9\u4E9B\u9009\u9879\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
# Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\n\u4EE5\u4E0B\u9009\u9879\u4E3A Mac OS X \u7279\u5B9A\u7684\u9009\u9879:\n -XstartOnFirstThread\n \u5728\u7B2C\u4E00\u4E2A (AppKit) \u7EBF\u7A0B\u4E0A\u8FD0\u884C main() \u65B9\u6CD5\n -Xdock:name=<\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0>\n \u8986\u76D6\u505C\u9760\u680F\u4E2D\u663E\u793A\u7684\u9ED8\u8BA4\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\n -Xdock:icon=<\u56FE\u6807\u6587\u4EF6\u7684\u8DEF\u5F84>\n \u8986\u76D6\u505C\u9760\u680F\u4E2D\u663E\u793A\u7684\u9ED8\u8BA4\u56FE\u6807\n\n

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2007, 2016, 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
@ -24,9 +24,9 @@
#
# Translators please note do not translate the options themselves
java.launcher.opt.header = \u7528\u6CD5: {0} [options] class [args...]\n (\u7528\u65BC\u57F7\u884C\u985E\u5225)\n \u6216 {0} [options] -jar jarfile [args...]\n (\u7528\u65BC\u57F7\u884C jar \u6A94\u6848)\n \u6216 {0} [options] -mp <modulepath> -m <modulename>[/<mainclass>] [args...]\n (\u7528\u65BC\u57F7\u884C\u6A21\u7D44\u4E2D\u7684\u4E3B\u8981\u985E\u5225)\n\u5176\u4E2D\u7684\u9078\u9805\u5305\u62EC:\n
java.launcher.opt.header = \u7528\u6CD5: {0} [options] class [args...]\n (\u7528\u65BC\u57F7\u884C\u985E\u5225)\n \u6216 {0} [options] -jar jarfile [args...]\n (\u7528\u65BC\u57F7\u884C jar \u6A94\u6848)\n \u6216 {0} [options] -p <modulepath> -m <modulename>[/<mainclass>] [args...]\n (\u7528\u65BC\u57F7\u884C\u6A21\u7D44\u4E2D\u7684\u4E3B\u8981\u985E\u5225)\n\u5176\u4E2D\u7684\u9078\u9805\u5305\u62EC:\n
java.launcher.opt.datamodel =\ -d{0}\t \u4F7F\u7528 {0} \u4F4D\u5143\u8CC7\u6599\u6A21\u578B (\u5982\u679C\u6709\u7684\u8A71)\n
java.launcher.opt.datamodel =\ -d{0}\t \u5DF2\u4E0D\u518D\u4F7F\u7528\uFF0C\u5C07\u65BC\u672A\u4F86\u7248\u672C\u4E2D\u79FB\u9664\n
java.launcher.opt.vmselect =\ {0}\t \u9078\u53D6 "{1}" VM\n
java.launcher.opt.hotspot =\ {0}\t \u662F "{1}" VM \u7684\u540C\u7FA9\u5B57 [\u5DF2\u4E0D\u518D\u4F7F\u7528]\n
@ -34,11 +34,13 @@ java.launcher.ergo.message1 =\ \u9810\u8A2D\u7684 VM \u70BA {0
java.launcher.ergo.message2 =\ \u56E0\u70BA\u60A8\u6B63\u5728\u4F3A\u670D\u5668\u985E\u5225\u6A5F\u5668\u4E0A\u57F7\u884C\u3002\n
# Translators please note do not translate the options themselves
java.launcher.opt.footer =\ -cp <\u76EE\u9304\u53CA zip/jar \u6A94\u6848\u7684\u985E\u5225\u641C\u5C0B\u8DEF\u5F91>\n -classpath <\u76EE\u9304\u53CA zip/jar \u6A94\u6848\u7684\u985E\u5225\u641C\u5C0B\u8DEF\u5F91>\n \u5C07\u5728\u5176\u4E2D\u641C\u5C0B\u985E\u5225\u6A94\u6848\u4E4B\u4EE5 {0} \u5340\u9694\u7684\u76EE\u9304\u3001JAR \u5B58\u6A94\u4EE5\u53CA ZIP \u5B58\u6A94\u6E05\u55AE\u3002\n -mp <module path>\n -modulepath <module path>...\n \u4EE5 {0} \u5340\u9694\u7684\u76EE\u9304\u6E05\u55AE\uFF0C\u6BCF\u500B\u76EE\u9304\u90FD\u662F\u4E00\u500B\u6A21\u7D44\u76EE\u9304\u3002\n -upgrademodulepath <module path>...\n \u4EE5 {0} \u5340\u9694\u7684\u76EE\u9304\u6E05\u55AE\uFF0C\u6BCF\u500B\u76EE\u9304\u90FD\u662F\u4E00\u500B\u6A21\u7D44\u76EE\u9304\uFF0C\u7576\u4E2D\u7684\u6A21\u7D44\u53EF\u53D6\u4EE3\u7A0B\u5F0F\u5BE6\u969B\u57F7\u884C\u5F71\u50CF\u4E2D\u7684\u53EF\u5347\u7D1A\u6A21\u7D44\n -m <modulename>[/<mainclass>]\n \u8981\u89E3\u6790\u7684\u8D77\u59CB\u6A21\u7D44\uFF0C\u4EE5\u53CA\u6A21\u7D44\u672A\u6307\u5B9A\u6642\u6240\u8981\u57F7\u884C\u4E4B\u4E3B\u8981\u985E\u5225\u7684\u540D\u7A31\n -addmods <modulename>[,<modulename>...]\n \u9664\u4E86\u8D77\u59CB\u6A21\u7D44\u5916\uFF0C\u8981\u89E3\u6790\u7684\u6839\u6A21\u7D44\n -limitmods <modulename>[,<modulename>...]\n \u9650\u5236\u53EF\u76E3\u6E2C\u6A21\u7D44\u7684\u7BC4\u570D\n -listmods[:<modulename>[,<modulename>...]]\n \u5217\u51FA\u53EF\u76E3\u6E2C\u6A21\u7D44\u4E26\u7D50\u675F\n --dry-run \u5EFA\u7ACB VM \u4F46\u4E0D\u57F7\u884C\u4E3B\u8981\u65B9\u6CD5\u3002\n \u6B64 --dry-run \u9078\u9805\u5C0D\u65BC\u9A57\u8B49\u547D\u4EE4\u884C\u9078\u9805 (\u4F8B\u5982\u6A21\u7D44\u7CFB\u7D71\u7D44\u614B) \u6703\u5F88\u6709\u7528\u3002\n -D<name>=<value>\n \u8A2D\u5B9A\u7CFB\u7D71\u5C6C\u6027\n -verbose:[class|gc|jni]\n \u555F\u7528\u8A73\u7D30\u8CC7\u8A0A\u8F38\u51FA\n -version \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7D50\u675F\n -showversion \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7E7C\u7E8C\n -? -help \u5217\u5370\u672C\u8AAA\u660E\u8A0A\u606F\n -X \u5217\u5370\u975E\u6A19\u6E96\u9078\u9805\u7684\u8AAA\u660E\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n \u555F\u7528\u6307\u5B9A\u4E4B\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n \u505C\u7528\u6307\u5B9A\u4E4B\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n -esa | -enablesystemassertions\n \u555F\u7528\u7CFB\u7D71\u5BA3\u544A\n -dsa | -disablesystemassertions\n \u505C\u7528\u7CFB\u7D71\u5BA3\u544A\n -agentlib:<libname>[=<options>]\n \u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB <libname>\uFF0C\u4F8B\u5982 -agentlib:jdwp\n \u53E6\u8ACB\u53C3\u95B1 -agentlib:jdwp=help\n -agentpath:<pathname>[=<options>]\n \u4F7F\u7528\u5B8C\u6574\u8DEF\u5F91\u540D\u7A31\u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB\n -javaagent:<jarpath>[=<options>]\n \u8F09\u5165 Java \u7A0B\u5F0F\u8A9E\u8A00\u4EE3\u7406\u7A0B\u5F0F\uFF0C\u8ACB\u53C3\u95B1 java.lang.instrument\n -splash:<imagepath>\n \u986F\u793A\u542B\u6307\u5B9A\u5F71\u50CF\u7684\u8EDF\u9AD4\u8CC7\u8A0A\u756B\u9762\n @<filepath> \u5F9E\u6307\u5B9A\u7684\u6A94\u6848\u8B80\u53D6\u9078\u9805\n
java.launcher.opt.footer =\ -cp <class search path of directories and zip/jar files>\n -classpath <class search path of directories and zip/jar files>\n --class-path <class search path of directories and zip/jar files>\n \u5C07\u5728\u5176\u4E2D\u641C\u5C0B\u985E\u5225\u6A94\u6848\u4E4B\u4EE5 {0} \u5340\u9694\u7684\n \u76EE\u9304\u3001JAR \u5B58\u6A94\u4EE5\u53CA ZIP \u5B58\u6A94\u6E05\u55AE\u3002\n -p <module path>\n --module-path <module path>...\n \u4EE5 {0} \u5340\u9694\u7684\u76EE\u9304\u6E05\u55AE\uFF0C\u6BCF\u500B\u76EE\u9304\n \u662F\u4E00\u500B\u6A21\u7D44\u76EE\u9304\u3002\n --upgrade-module-path <module path>...\n \u4EE5 {0} \u5340\u9694\u7684\u76EE\u9304\u6E05\u55AE\uFF0C\u6BCF\u500B\u76EE\u9304\n \u90FD\u662F\u4E00\u500B\u6A21\u7D44\u76EE\u9304\uFF0C\u7576\u4E2D\u7684\u6A21\u7D44\u53EF\u53D6\u4EE3\n \u7A0B\u5F0F\u5BE6\u969B\u57F7\u884C\u5F71\u50CF\u4E2D\u7684\u53EF\u5347\u7D1A\u6A21\u7D44\n -m <module>[/<mainclass>]\n --module <modulename>[/<mainclass>]\n \u8981\u89E3\u6790\u7684\u8D77\u59CB\u6A21\u7D44\uFF0C\u4EE5\u53CA\u6A21\u7D44\u672A\u6307\u5B9A\u6642\n \u6240\u8981\u57F7\u884C\u4E4B\u4E3B\u8981\u985E\u5225\u7684\u540D\u7A31\n --add-modules <modulename>[,<modulename>...]\n \u9664\u4E86\u8D77\u59CB\u6A21\u7D44\u5916\uFF0C\u8981\u89E3\u6790\u7684\u6839\u6A21\u7D44\u3002\n <modulename> \u4E5F\u53EF\u4EE5\u662F ALL-DEFAULT\u3001ALL-SYSTEM\u3001\n ALL-MODULE-PATH\u3002\n --limit-modules <modulename>[,<modulename>...]\n \u9650\u5236\u53EF\u76E3\u6E2C\u6A21\u7D44\u7684\u7BC4\u570D\n --list-modules [<modulename>[,<modulename>...]]\n \u5217\u51FA\u53EF\u76E3\u6E2C\u6A21\u7D44\u4E26\u7D50\u675F\n --dry-run \u5EFA\u7ACB VM \u4F46\u4E0D\u57F7\u884C\u4E3B\u8981\u65B9\u6CD5\u3002\n \u6B64 --dry-run \u9078\u9805\u5C0D\u65BC\u9A57\u8B49\u547D\u4EE4\u884C\u9078\u9805\n (\u4F8B\u5982\u6A21\u7D44\u7CFB\u7D71\u7D44\u614B) \u6703\u5F88\u6709\u7528\u3002\n -D<name>=<value>\n \u8A2D\u5B9A\u7CFB\u7D71\u5C6C\u6027\n -verbose:[class|gc|jni]\n \u555F\u7528\u8A73\u7D30\u8CC7\u8A0A\u8F38\u51FA\n -version \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7D50\u675F\n -showversion \u5217\u5370\u7522\u54C1\u7248\u672C\u4E26\u7E7C\u7E8C\n -? -help --help\n \u5217\u5370\u672C\u8AAA\u660E\u8A0A\u606F\n -X \u5217\u5370\u975E\u6A19\u6E96\u9078\u9805\u7684\u8AAA\u660E\n -ea[:<packagename>...|:<classname>]\n -enableassertions[:<packagename>...|:<classname>]\n \u555F\u7528\u6307\u5B9A\u4E4B\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n -da[:<packagename>...|:<classname>]\n -disableassertions[:<packagename>...|:<classname>]\n \u505C\u7528\u6307\u5B9A\u4E4B\u8A73\u7D30\u7A0B\u5EA6\u7684\u5BA3\u544A\n -esa | -enablesystemassertions\n \u555F\u7528\u7CFB\u7D71\u5BA3\u544A\n -dsa | -disablesystemassertions\n \u505C\u7528\u7CFB\u7D71\u5BA3\u544A\n -agentlib:<libname>[=<options>]\n \u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB <libname>\uFF0C\u4F8B\u5982 -agentlib:jdwp\n \u53E6\u8ACB\u53C3\u95B1 -agentlib:jdwp=help\n -agentpath:<pathname>[=<options>]\n \u4F7F\u7528\u5B8C\u6574\u8DEF\u5F91\u540D\u7A31\u8F09\u5165\u539F\u751F\u4EE3\u7406\u7A0B\u5F0F\u7A0B\u5F0F\u5EAB\n -javaagent:<jarpath>[=<options>]\n \u8F09\u5165 Java \u7A0B\u5F0F\u8A9E\u8A00\u4EE3\u7406\u7A0B\u5F0F\uFF0C\u8ACB\u53C3\u95B1 java.lang.instrument\n -splash:<imagepath>\n \u986F\u793A\u542B\u6307\u5B9A\u5F71\u50CF\u7684\u8EDF\u9AD4\u8CC7\u8A0A\u756B\u9762\n \
\u7CFB\u7D71\u6703\u81EA\u52D5\u652F\u63F4\u4E26\u4F7F\u7528 HiDPI \u5DF2\u7E2E\u653E\u5F71\u50CF\n (\u5982\u679C\u53EF\u7528\u7684\u8A71)\u3002\u672A\u7E2E\u653E\u5F71\u50CF\u6A94\u6848\u540D\u7A31 (\u4F8B\u5982 image.ext)\n \u61C9\u4E00\u5F8B\u4EE5\u5F15\u6578\u7684\u5F62\u5F0F\u50B3\u9001\u5230 -splash \u9078\u9805\u3002\n \u7CFB\u7D71\u6703\u81EA\u52D5\u5F9E\u63D0\u4F9B\u7684\u5DF2\u7E2E\u653E\u5F71\u50CF\u4E2D\u9078\u64C7\u6700\u9069\u5408\u7684\n \u5DF2\u7E2E\u653E\u5F71\u50CF\u3002\n \u8ACB\u53C3\u95B1 SplashScreen API \u6587\u4EF6\uFF0C\u4EE5\u53D6\u5F97\u66F4\u591A\u8CC7\u8A0A\u3002\n @<filepath> \u5F9E\u6307\u5B9A\u7684\u6A94\u6848\u8B80\u53D6\u9078\u9805\n\u82E5\u8981\u6307\u5B9A\u9577\u9078\u9805\u7684\u5F15\u6578\uFF0C\u53EF\u4EE5\u4F7F\u7528 --<name>=<value> \u6216\n--<name> <value>\u3002\n
See \u8ACB\u53C3\u95B1 http://www.oracle.com/technetwork/java/javase/documentation/index.html \u66B8\u89E3\u8A73\u7D30\u8CC7\u8A0A\u3002
# Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xmixed \u6DF7\u5408\u6A21\u5F0F\u57F7\u884C (\u9810\u8A2D)\n -Xint \u50C5\u9650\u89E3\u8B6F\u6A21\u5F0F\u57F7\u884C\n -Xbootclasspath/a:<\u4EE5 {0} \u5206\u9694\u7684\u76EE\u9304\u548C zip/jar \u6A94\u6848>\n \u9644\u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u7D50\u5C3E\n -Xdiag \u986F\u793A\u5176\u4ED6\u7684\u8A3A\u65B7\u8A0A\u606F\n -Xdiag:resolver \u986F\u793A\u89E3\u6790\u5668\u8A3A\u65B7\u8A0A\u606F\n -Xnoclassgc \u505C\u7528\u985E\u5225\u8CC7\u6E90\u56DE\u6536\n -Xloggc:<file> \u5C07 GC \u72C0\u614B\u548C\u6642\u6233\u8A18\u9304\u81F3\u6A94\u6848\n -Xbatch \u505C\u7528\u80CC\u666F\u7DE8\u8B6F\n -Xms<size> \u8A2D\u5B9A\u8D77\u59CB Java \u5806\u96C6\u5927\u5C0F\n -Xmx<size> \u8A2D\u5B9A Java \u5806\u96C6\u5927\u5C0F\u4E0A\u9650\n -Xss<size> \u8A2D\u5B9A Java \u57F7\u884C\u7DD2\u5806\u758A\u5927\u5C0F\n -Xprof \u8F38\u51FA CPU \u5206\u6790\u8CC7\u6599\n -Xfuture \u555F\u7528\u6700\u56B4\u683C\u7684\u6AA2\u67E5\uFF0C\u9810\u5148\u4F5C\u70BA\u5C07\u4F86\u7684\u9810\u8A2D\n -Xrs \u6E1B\u5C11 Java/VM \u4F7F\u7528\u4F5C\u696D\u7CFB\u7D71\u4FE1\u865F (\u8ACB\u53C3\u95B1\u6587\u4EF6)\n -Xcheck:jni \u57F7\u884C\u5176\u4ED6\u7684 JNI \u51FD\u6578\u6AA2\u67E5\n -Xshare:off \u4E0D\u5617\u8A66\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\n -Xshare:auto \u5118\u53EF\u80FD\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599 (\u9810\u8A2D)\n -Xshare:on \u9700\u8981\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\uFF0C\u5426\u5247\u5931\u6557\u3002\n -XshowSettings \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:all\n \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:vm \u986F\u793A\u6240\u6709 VM \u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:properties\n \u986F\u793A\u6240\u6709\u5C6C\u6027\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:locale\n \u986F\u793A\u6240\u6709\u5730\u5340\u8A2D\u5B9A\u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XaddReads:<module>=<other-module>(,<other-module>)*\n \u7121\u8AD6\u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\uFF0C\n <module> \u6703\u8B80\u53D6\u5176\u4ED6\u6A21\u7D44\n -XaddExports:<module>/<package>=<other-module>(,<other-module>)*\n \u7121\u8AD6\u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\uFF0C<module> \u6703\u5C07 <package>\n \u532F\u51FA\u81F3\u5176\u4ED6\u6A21\u7D44\n -Xpatch:<module>=<file>({0}<file>)*\n \u8986\u5BEB\u6216\u52A0\u5F37 JAR \u6A94\u6848\u6216\u76EE\u9304\u4E2D\u7684\n \u6A21\u7D44\u985E\u578B\u548C\u8CC7\u6E90\n -Xdisable-@files \u505C\u7528\u9032\u4E00\u6B65\u7684\u5F15\u6578\u6A94\u6848\u64F4\u5145\n\n-X \u9078\u9805\u4E0D\u662F\u6A19\u6E96\u9078\u9805\uFF0C\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
java.launcher.X.usage=\ -Xbatch \u505C\u7528\u80CC\u666F\u7DE8\u8B6F\n -Xbootclasspath/a:<directories and zip/jar files separated by {0}>\n \u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u7D50\u5C3E\n -Xcheck:jni \u57F7\u884C\u5176\u4ED6\u7684 JNI \u51FD\u6578\u6AA2\u67E5\n -Xcomp \u5F37\u5236\u7DE8\u8B6F\u7B2C\u4E00\u500B\u547C\u53EB\u7684\u65B9\u6CD5\n -Xdebug \u70BA\u56DE\u6EAF\u76F8\u5BB9\u6027\u63D0\u4F9B\n -Xdiag \u986F\u793A\u5176\u4ED6\u8A3A\u65B7\u8A0A\u606F\n -Xdiag:resolver \u986F\u793A\u89E3\u6790\u5668\u8A3A\u65B7\u8A0A\u606F\n -Xdisable-@files \u505C\u7528\u9032\u4E00\u6B65\u7684\u5F15\u6578\u6A94\u6848\u64F4\u5145\n -Xfuture \u555F\u7528\u6700\u56B4\u683C\u7684\u6AA2\u67E5\uFF0C\u9810\u5148\u4F5C\u70BA\u5C07\u4F86\u7684\u9810\u8A2D\n -Xint \u50C5\u9650\u89E3\u8B6F\u6A21\u5F0F\u57F7\u884C\n -Xinternalversion\n \u986F\u793A\u6BD4\u4F7F\u7528 -version \u9078\u9805\u6642\u66F4\u70BA\u8A73\u7D30\u7684\n JVM \u7248\u672C\u8CC7\u8A0A\n -Xloggc:<file> \u5C07 GC \u72C0\u614B\u548C\u6642\u6233\u8A18\u9304\u81F3\u6A94\u6848\n -Xmixed \u6DF7\u5408\u6A21\u5F0F\u57F7\u884C (\u9810\u8A2D)\n -Xmn<size> \u91DD\u5C0D\u65B0\u751F\u4EE3 (\u990A\u6210\u5340) \u8A2D\u5B9A\u5806\u96C6\u7684\u8D77\u59CB\u5927\u5C0F\u548C\n \u5927\u5C0F\u4E0A\u9650 (\u4F4D\u5143\u7D44)\n -Xms<size> \u8A2D\u5B9A\u8D77\u59CB Java \u5806\u96C6\u5927\u5C0F\n -Xmx<size> \u8A2D\u5B9A Java \u5806\u96C6\u5927\u5C0F\u4E0A\u9650\n -Xnoclassgc \u505C\u7528\u985E\u5225\u8CC7\u6E90\u56DE\u6536\n -Xprof \u8F38\u51FA cpu \u5206\u6790\u8CC7\u6599\n -Xrs \u6E1B\u5C11 Java/VM \u4F7F\u7528\u4F5C\u696D\u7CFB\u7D71\u4FE1\u865F (\u8ACB\u53C3\u95B1\u6587\u4EF6)\n -Xshare:auto \u76E1\u53EF\u80FD\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599 (\u9810\u8A2D)\n -Xshare:off \u4E0D\u5617\u8A66\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\n -Xshare:on \u9700\u8981\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\uFF0C\u5426\u5247\u5931\u6557\u3002\n -XshowSettings \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:all\n \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:locale\n \u986F\u793A\u6240\u6709\u5730\u5340\u8A2D\u5B9A\u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:properties\n \u986F\u793A\u6240\u6709\u5C6C\u6027\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:vm \u986F\u793A\u6240\u6709 VM \u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -Xss<size> \u8A2D\u5B9A Java \u57F7\u884C\u7DD2\u5806\u758A\u5927\u5C0F\n -Xverify \u8A2D\u5B9A Bytecode \u9A57\u8B49\u7A0B\u5F0F\u6A21\u5F0F\n --add-reads <module>=<target-module>(,<target-module>)*\n \u7121\u8AD6\u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\uFF0C\u66F4\u65B0 <module> \u4EE5\n \u8B80\u53D6 <target-module>\u3002\n \u53EF\u5C07 <target-module> \u8A2D\u70BA ALL-UNNAMED \u4EE5\u8B80\u53D6\u6240\u6709\u672A\u547D\u540D\u7684\n \u6A21\u7D44\u3002\n --add-exports <module>/<package>=<target-module>(,<target-module>)*\n \u7121\u8AD6\u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\uFF0C\u66F4\u65B0 <module> \u4EE5\u4FBF\u5C07 <package>\n \u532F\u51FA\u81F3 <target-module>\u3002\n \u53EF\u5C07 <target-module> \u8A2D\u70BA ALL-UNNAMED \u4EE5\u532F\u51FA\u81F3\u6240\u6709\n \u672A\u547D\u540D\u7684\u6A21\u7D44\u3002\n --patch-module <module>=<file>({0}<file>)*\n \u8986\u5BEB\u6216\u52A0\u5F37 JAR \u6A94\u6848\u6216\u76EE\u9304\u4E2D\n \
\u542B\u6709\u985E\u5225\u548C\u8CC7\u6E90\u7684\u6A21\u7D44\u3002\n\n\u4E0A\u8FF0\u9078\u9805\u4E0D\u662F\u6A19\u6E96\u9078\u9805\uFF0C\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
# Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\n\u4E0B\u5217\u662F Mac OS X \u7279\u5B9A\u9078\u9805:\n -XstartOnFirstThread\n \u5728\u7B2C\u4E00\u500B (AppKit) \u57F7\u884C\u7DD2\u57F7\u884C main() \u65B9\u6CD5\n -Xdock:name=<application name>\n \u8986\u5BEB\u7D50\u5408\u8AAA\u660E\u756B\u9762\u4E2D\u986F\u793A\u7684\u9810\u8A2D\u61C9\u7528\u7A0B\u5F0F\u540D\u7A31\n -Xdock:icon=<path to icon file>\n \u8986\u5BEB\u7D50\u5408\u8AAA\u660E\u756B\u9762\u4E2D\u986F\u793A\u7684\u9810\u8A2D\u5716\u793A\n\n

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2016, 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
@ -898,57 +898,62 @@ public class FileChannelImpl
if (!isOpen())
return null;
long filesize;
do {
filesize = nd.size(fd);
} while ((filesize == IOStatus.INTERRUPTED) && isOpen());
if (!isOpen())
return null;
if (filesize < position + size) { // Extend file size
if (!writable) {
throw new IOException("Channel not open for writing " +
"- cannot extend file to required size");
}
int rv;
long mapSize;
int pagePosition;
synchronized (positionLock) {
long filesize;
do {
rv = nd.truncate(fd, position + size);
} while ((rv == IOStatus.INTERRUPTED) && isOpen());
filesize = nd.size(fd);
} while ((filesize == IOStatus.INTERRUPTED) && isOpen());
if (!isOpen())
return null;
}
if (size == 0) {
addr = 0;
// a valid file descriptor is not required
FileDescriptor dummy = new FileDescriptor();
if ((!writable) || (imode == MAP_RO))
return Util.newMappedByteBufferR(0, 0, dummy, null);
else
return Util.newMappedByteBuffer(0, 0, dummy, null);
}
int pagePosition = (int)(position % allocationGranularity);
long mapPosition = position - pagePosition;
long mapSize = size + pagePosition;
try {
// If no exception was thrown from map0, the address is valid
addr = map0(imode, mapPosition, mapSize);
} catch (OutOfMemoryError x) {
// An OutOfMemoryError may indicate that we've exhausted memory
// so force gc and re-attempt map
System.gc();
try {
Thread.sleep(100);
} catch (InterruptedException y) {
Thread.currentThread().interrupt();
if (filesize < position + size) { // Extend file size
if (!writable) {
throw new IOException("Channel not open for writing " +
"- cannot extend file to required size");
}
int rv;
do {
rv = nd.allocate(fd, position + size);
} while ((rv == IOStatus.INTERRUPTED) && isOpen());
if (!isOpen())
return null;
}
if (size == 0) {
addr = 0;
// a valid file descriptor is not required
FileDescriptor dummy = new FileDescriptor();
if ((!writable) || (imode == MAP_RO))
return Util.newMappedByteBufferR(0, 0, dummy, null);
else
return Util.newMappedByteBuffer(0, 0, dummy, null);
}
pagePosition = (int)(position % allocationGranularity);
long mapPosition = position - pagePosition;
mapSize = size + pagePosition;
try {
// If map0 did not throw an exception, the address is valid
addr = map0(imode, mapPosition, mapSize);
} catch (OutOfMemoryError y) {
// After a second OOME, fail
throw new IOException("Map failed", y);
} catch (OutOfMemoryError x) {
// An OutOfMemoryError may indicate that we've exhausted
// memory so force gc and re-attempt map
System.gc();
try {
Thread.sleep(100);
} catch (InterruptedException y) {
Thread.currentThread().interrupt();
}
try {
addr = map0(imode, mapPosition, mapSize);
} catch (OutOfMemoryError y) {
// After a second OOME, fail
throw new IOException("Map failed", y);
}
}
}
} // synchronized
// On Windows, and potentially other platforms, we need an open
// file descriptor for some mapping operations.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2016, 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
@ -40,6 +40,8 @@ abstract class FileDispatcher extends NativeDispatcher {
abstract int truncate(FileDescriptor fd, long size) throws IOException;
abstract int allocate(FileDescriptor fd, long size) throws IOException;
abstract long size(FileDescriptor fd) throws IOException;
abstract int lock(FileDescriptor fd, boolean blocking, long pos, long size,

View File

@ -126,16 +126,24 @@ public class Resources_de extends java.util.ListResourceBundle {
"Schl\u00FCsselbitgr\u00F6\u00DFe"}, //-keysize
{"keystore.name",
"Keystore-Name"}, //-keystore
{"access.the.cacerts.keystore",
"Zugriff auf den cacerts Keystore"}, // -cacerts
{"warning.cacerts.option",
"Warnung: Verwenden Sie die Option -cacerts f\u00FCr den Zugriff auf den cacerts Keystore"},
{"new.password",
"Neues Kennwort"}, //-new
{"do.not.prompt",
"Kein Prompt"}, //-noprompt
{"password.through.protected.mechanism",
"Kennwort \u00FCber gesch\u00FCtzten Mechanismus"}, //-protected
{"provider.argument",
"Providerargument"}, //-providerarg
{"provider.class.name",
"Providerklassenname"}, //-providerclass
// The following 2 values should span 2 lines, the first for the
// option itself, the second for its -providerArg value.
{"addprovider.option",
"Sicherheitsprovider nach Name hinzuf\u00FCgen (z.B. SunPKCS11)\nArgument f\u00FCr -addprovider konfigurieren"}, //-addprovider
{"provider.class.option",
"Sicherheitsprovider nach vollst\u00E4ndig angegebenem Klassennamen hinzuf\u00FCgen\nArgument f\u00FCr -providerclass konfigurieren"}, //-providerclass
{"provider.name",
"Providername"}, //-providername
{"provider.classpath",
@ -187,6 +195,8 @@ public class Resources_de extends java.util.ListResourceBundle {
{"Command.option.flag.needs.an.argument.", "Befehlsoption {0} ben\u00F6tigt ein Argument."},
{"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
"Warnung: Keine Unterst\u00FCtzung f\u00FCr unterschiedliche Speicher- und Schl\u00FCsselkennw\u00F6rter bei PKCS12 KeyStores. Der benutzerdefinierte Wert {0} wird ignoriert."},
{"the.keystore.or.storetype.option.cannot.be.used.with.the.cacerts.option",
"Die Option -keystore oder -storetype kann nicht mit der Option -cacerts verwendet werden"},
{".keystore.must.be.NONE.if.storetype.is.{0}",
"-keystore muss NONE sein, wenn -storetype {0} ist"},
{"Too.many.retries.program.terminated",
@ -208,7 +218,9 @@ public class Resources_de extends java.util.ListResourceBundle {
{"Illegal.startdate.value", "Ung\u00FCltiger Wert f\u00FCr Anfangsdatum"},
{"Validity.must.be.greater.than.zero",
"G\u00FCltigkeit muss gr\u00F6\u00DFer als null sein"},
{"provName.not.a.provider", "{0} kein Provider"},
{"provclass.not.a.provider", "%s kein Provider"},
{"provider.name.not.found", "Provider namens \"%s\" nicht gefunden"},
{"provider.class.not.found", "Provider \"%s\" nicht gefunden"},
{"Usage.error.no.command.provided", "Verwendungsfehler: Kein Befehl angegeben"},
{"Source.keystore.file.exists.but.is.empty.", "Quell-Keystore-Datei ist zwar vorhanden, ist aber leer: "},
{"Please.specify.srckeystore", "Geben Sie -srckeystore an"},

View File

@ -126,16 +126,24 @@ public class Resources_es extends java.util.ListResourceBundle {
"tama\u00F1o de bit de clave"}, //-keysize
{"keystore.name",
"nombre de almac\u00E9n de claves"}, //-keystore
{"access.the.cacerts.keystore",
"acceso al almac\u00E9n de claves cacerts"}, // -cacerts
{"warning.cacerts.option",
"Advertencia: Utilice la opci\u00F3n -cacerts para acceder al almac\u00E9n de claves cacerts"},
{"new.password",
"nueva contrase\u00F1a"}, //-new
{"do.not.prompt",
"no solicitar"}, //-noprompt
{"password.through.protected.mechanism",
"contrase\u00F1a a trav\u00E9s de mecanismo protegido"}, //-protected
{"provider.argument",
"argumento del proveedor"}, //-providerarg
{"provider.class.name",
"nombre de clase del proveedor"}, //-providerclass
// The following 2 values should span 2 lines, the first for the
// option itself, the second for its -providerArg value.
{"addprovider.option",
"agregar proveedor de seguridad por nombre (por ejemplo, SunPKCS11)\nconfigurar elemento para -addprovider"}, //-addprovider
{"provider.class.option",
"agregar proveedor de seguridad por nombre de clase totalmente cualificado\nconfigurar argumento para -providerclass"}, //-providerclass
{"provider.name",
"nombre del proveedor"}, //-providername
{"provider.classpath",
@ -187,6 +195,8 @@ public class Resources_es extends java.util.ListResourceBundle {
{"Command.option.flag.needs.an.argument.", "La opci\u00F3n de comando {0} necesita un argumento."},
{"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
"Advertencia: los almacenes de claves en formato PKCS12 no admiten contrase\u00F1as de clave y almacenamiento distintas. Se ignorar\u00E1 el valor especificado por el usuario, {0}."},
{"the.keystore.or.storetype.option.cannot.be.used.with.the.cacerts.option",
"Las opciones -keystore o -storetype no se pueden utilizar con la opci\u00F3n -cacerts"},
{".keystore.must.be.NONE.if.storetype.is.{0}",
"-keystore debe ser NONE si -storetype es {0}"},
{"Too.many.retries.program.terminated",
@ -208,7 +218,9 @@ public class Resources_es extends java.util.ListResourceBundle {
{"Illegal.startdate.value", "Valor de fecha de inicio no permitido"},
{"Validity.must.be.greater.than.zero",
"La validez debe ser mayor que cero"},
{"provName.not.a.provider", "{0} no es un proveedor"},
{"provclass.not.a.provider", "%s no es un proveedor"},
{"provider.name.not.found", "No se ha encontrado el proveedor denominado \"%s\""},
{"provider.class.not.found", "No se ha encontrado el proveedor \"%s\""},
{"Usage.error.no.command.provided", "Error de sintaxis: no se ha proporcionado ning\u00FAn comando"},
{"Source.keystore.file.exists.but.is.empty.", "El archivo de almac\u00E9n de claves de origen existe, pero est\u00E1 vac\u00EDo: "},
{"Please.specify.srckeystore", "Especifique -srckeystore"},

View File

@ -126,16 +126,24 @@ public class Resources_fr extends java.util.ListResourceBundle {
"taille en bits de la cl\u00E9"}, //-keysize
{"keystore.name",
"nom du fichier de cl\u00E9s"}, //-keystore
{"access.the.cacerts.keystore",
"acc\u00E9der au fichier de cl\u00E9s cacerts"}, // -cacerts
{"warning.cacerts.option",
"Avertissement : utiliser l'option -cacerts pour acc\u00E9der au fichier de cl\u00E9s cacerts"},
{"new.password",
"nouveau mot de passe"}, //-new
{"do.not.prompt",
"ne pas inviter"}, //-noprompt
{"password.through.protected.mechanism",
"mot de passe via m\u00E9canisme prot\u00E9g\u00E9"}, //-protected
{"provider.argument",
"argument du fournisseur"}, //-providerarg
{"provider.class.name",
"nom de la classe de fournisseur"}, //-providerclass
// The following 2 values should span 2 lines, the first for the
// option itself, the second for its -providerArg value.
{"addprovider.option",
"ajouter un fournisseur de s\u00E9curit\u00E9 par nom (par ex. SunPKCS11)\nconfigurer l'argument pour -addprovider"}, //-addprovider
{"provider.class.option",
"ajouter un fournisseur de s\u00E9curit\u00E9 par nom de classe qualifi\u00E9 complet\nconfigurer l'argument pour -providerclass"}, //-providerclass
{"provider.name",
"nom du fournisseur"}, //-providername
{"provider.classpath",
@ -187,6 +195,8 @@ public class Resources_fr extends java.util.ListResourceBundle {
{"Command.option.flag.needs.an.argument.", "L''option de commande {0} requiert un argument."},
{"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
"Avertissement\u00A0: les mots de passe de cl\u00E9 et de banque distincts ne sont pas pris en charge pour les fichiers de cl\u00E9s d''acc\u00E8s PKCS12. La valeur {0} sp\u00E9cifi\u00E9e par l''utilisateur est ignor\u00E9e."},
{"the.keystore.or.storetype.option.cannot.be.used.with.the.cacerts.option",
"Les options -keystore ou -storetype ne peuvent pas \u00EAtre utilis\u00E9es avec l'option -cacerts"},
{".keystore.must.be.NONE.if.storetype.is.{0}",
"-keystore doit \u00EAtre d\u00E9fini sur NONE si -storetype est {0}"},
{"Too.many.retries.program.terminated",
@ -208,7 +218,9 @@ public class Resources_fr extends java.util.ListResourceBundle {
{"Illegal.startdate.value", "Valeur de date de d\u00E9but non admise"},
{"Validity.must.be.greater.than.zero",
"La validit\u00E9 doit \u00EAtre sup\u00E9rieure \u00E0 z\u00E9ro"},
{"provName.not.a.provider", "{0} n''est pas un fournisseur"},
{"provclass.not.a.provider", "%s n'est pas un fournisseur"},
{"provider.name.not.found", "Fournisseur nomm\u00E9 \"%s\" introuvable"},
{"provider.class.not.found", "Fournisseur \"%s\" introuvable"},
{"Usage.error.no.command.provided", "Erreur de syntaxe\u00A0: aucune commande fournie"},
{"Source.keystore.file.exists.but.is.empty.", "Le fichier de cl\u00E9s source existe mais il est vide : "},
{"Please.specify.srckeystore", "Indiquez -srckeystore"},

View File

@ -126,16 +126,24 @@ public class Resources_it extends java.util.ListResourceBundle {
"dimensione bit chiave"}, //-keysize
{"keystore.name",
"nome keystore"}, //-keystore
{"access.the.cacerts.keystore",
"accedi al keystore cacerts"}, // -cacerts
{"warning.cacerts.option",
"Avvertenza: utilizzare l'opzione -cacerts per accedere al keystore cacerts"},
{"new.password",
"nuova password"}, //-new
{"do.not.prompt",
"non richiedere"}, //-noprompt
{"password.through.protected.mechanism",
"password mediante meccanismo protetto"}, //-protected
{"provider.argument",
"argomento provider"}, //-providerarg
{"provider.class.name",
"nome classe provider"}, //-providerclass
// The following 2 values should span 2 lines, the first for the
// option itself, the second for its -providerArg value.
{"addprovider.option",
"aggiunge il provider di sicurezza in base al nome (ad esempio SunPKCS11)\nconfigura l'argomento per -addprovider"}, //-addprovider
{"provider.class.option",
"aggiunge il provider di sicurezza in base al nome di classe completamente qualificato\nconfigura l'argomento per -providerclass"}, //-providerclass
{"provider.name",
"nome provider"}, //-providername
{"provider.classpath",
@ -187,6 +195,8 @@ public class Resources_it extends java.util.ListResourceBundle {
{"Command.option.flag.needs.an.argument.", "\u00C8 necessario specificare un argomento per l''opzione di comando {0}."},
{"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
"Avvertenza: non sono supportate password diverse di chiave e di archivio per i keystore PKCS12. Il valore {0} specificato dall''utente verr\u00E0 ignorato."},
{"the.keystore.or.storetype.option.cannot.be.used.with.the.cacerts.option",
"L'opzione -keystore o -storetype non pu\u00F2 essere utilizzata con l'opzione -cacerts"},
{".keystore.must.be.NONE.if.storetype.is.{0}",
"Se -storetype \u00E8 impostato su {0}, -keystore deve essere impostato su NONE"},
{"Too.many.retries.program.terminated",
@ -208,7 +218,9 @@ public class Resources_it extends java.util.ListResourceBundle {
{"Illegal.startdate.value", "Valore di data di inizio non valido"},
{"Validity.must.be.greater.than.zero",
"La validit\u00E0 deve essere maggiore di zero"},
{"provName.not.a.provider", "{0} non \u00E8 un provider"},
{"provclass.not.a.provider", "%s non \u00E8 un provider"},
{"provider.name.not.found", "Provider denominato \"%s\" non trovato"},
{"provider.class.not.found", "Provider \"%s\" non trovato"},
{"Usage.error.no.command.provided", "Errore di utilizzo: nessun comando specificato"},
{"Source.keystore.file.exists.but.is.empty.", "Il file keystore di origine esiste, ma \u00E8 vuoto: "},
{"Please.specify.srckeystore", "Specificare -srckeystore"},

View File

@ -126,16 +126,24 @@ public class Resources_ja extends java.util.ListResourceBundle {
"\u9375\u306E\u30D3\u30C3\u30C8\u30FB\u30B5\u30A4\u30BA"}, //-keysize
{"keystore.name",
"\u30AD\u30FC\u30B9\u30C8\u30A2\u540D"}, //-keystore
{"access.the.cacerts.keystore",
"cacerts\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u30A2\u30AF\u30BB\u30B9\u3059\u308B"}, // -cacerts
{"warning.cacerts.option",
"\u8B66\u544A: cacerts\u30AD\u30FC\u30B9\u30C8\u30A2\u306B\u30A2\u30AF\u30BB\u30B9\u3059\u308B\u306B\u306F-cacerts\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044"},
{"new.password",
"\u65B0\u898F\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-new
{"do.not.prompt",
"\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u8868\u793A\u3057\u306A\u3044"}, //-noprompt
{"password.through.protected.mechanism",
"\u4FDD\u8B77\u30E1\u30AB\u30CB\u30BA\u30E0\u306B\u3088\u308B\u30D1\u30B9\u30EF\u30FC\u30C9"}, //-protected
{"provider.argument",
"\u30D7\u30ED\u30D0\u30A4\u30C0\u5F15\u6570"}, //-providerarg
{"provider.class.name",
"\u30D7\u30ED\u30D0\u30A4\u30C0\u30FB\u30AF\u30E9\u30B9\u540D"}, //-providerclass
// The following 2 values should span 2 lines, the first for the
// option itself, the second for its -providerArg value.
{"addprovider.option",
"\u540D\u524D\u3067\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0\u3092\u8FFD\u52A0\u3059\u308B(SunPKCS11\u306A\u3069)\n-addprovider\u306E\u5F15\u6570\u3092\u69CB\u6210\u3059\u308B"}, //-addprovider
{"provider.class.option",
"\u5B8C\u5168\u4FEE\u98FE\u30AF\u30E9\u30B9\u540D\u3067\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30FB\u30D7\u30ED\u30D0\u30A4\u30C0\u3092\u8FFD\u52A0\u3059\u308B\n-providerclass\u306E\u5F15\u6570\u3092\u69CB\u6210\u3059\u308B"}, //-providerclass
{"provider.name",
"\u30D7\u30ED\u30D0\u30A4\u30C0\u540D"}, //-providername
{"provider.classpath",
@ -187,6 +195,8 @@ public class Resources_ja extends java.util.ListResourceBundle {
{"Command.option.flag.needs.an.argument.", "\u30B3\u30DE\u30F3\u30C9\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3{0}\u306B\u306F\u5F15\u6570\u304C\u5FC5\u8981\u3067\u3059\u3002"},
{"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
"\u8B66\u544A: PKCS12\u30AD\u30FC\u30B9\u30C8\u30A2\u3067\u306F\u3001\u30B9\u30C8\u30A2\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3068\u9375\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u7570\u306A\u308B\u72B6\u6CC1\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093\u3002\u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F{0}\u306E\u5024\u306F\u7121\u8996\u3057\u307E\u3059\u3002"},
{"the.keystore.or.storetype.option.cannot.be.used.with.the.cacerts.option",
"-keystore\u307E\u305F\u306F-storetype\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3001-cacerts\u30AA\u30D7\u30B7\u30E7\u30F3\u3068\u3068\u3082\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093"},
{".keystore.must.be.NONE.if.storetype.is.{0}",
"-storetype\u304C{0}\u306E\u5834\u5408\u3001-keystore\u306FNONE\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
{"Too.many.retries.program.terminated",
@ -208,7 +218,9 @@ public class Resources_ja extends java.util.ListResourceBundle {
{"Illegal.startdate.value", "startdate\u5024\u304C\u7121\u52B9\u3067\u3059"},
{"Validity.must.be.greater.than.zero",
"\u59A5\u5F53\u6027\u306F\u30BC\u30ED\u3088\u308A\u5927\u304D\u3044\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
{"provName.not.a.provider", "{0}\u306F\u30D7\u30ED\u30D0\u30A4\u30C0\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
{"provclass.not.a.provider", "%s\u306F\u30D7\u30ED\u30D0\u30A4\u30C0\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
{"provider.name.not.found", "\u30D7\u30ED\u30D0\u30A4\u30C0\u540D\"%s\"\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},
{"provider.class.not.found", "\u30D7\u30ED\u30D0\u30A4\u30C0\"%s\"\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},
{"Usage.error.no.command.provided", "\u4F7F\u7528\u30A8\u30E9\u30FC: \u30B3\u30DE\u30F3\u30C9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093"},
{"Source.keystore.file.exists.but.is.empty.", "\u30BD\u30FC\u30B9\u30FB\u30AD\u30FC\u30B9\u30C8\u30A2\u30FB\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u5B58\u5728\u3057\u307E\u3059\u304C\u7A7A\u3067\u3059: "},
{"Please.specify.srckeystore", "-srckeystore\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"},

View File

@ -126,16 +126,24 @@ public class Resources_ko extends java.util.ListResourceBundle {
"\uD0A4 \uBE44\uD2B8 \uD06C\uAE30"}, //-keysize
{"keystore.name",
"\uD0A4 \uC800\uC7A5\uC18C \uC774\uB984"}, //-keystore
{"access.the.cacerts.keystore",
"cacerts \uD0A4 \uC800\uC7A5\uC18C \uC561\uC138\uC2A4"}, // -cacerts
{"warning.cacerts.option",
"\uACBD\uACE0: -cacerts \uC635\uC158\uC744 \uC0AC\uC6A9\uD558\uC5EC cacerts \uD0A4 \uC800\uC7A5\uC18C\uC5D0 \uC561\uC138\uC2A4\uD558\uC2ED\uC2DC\uC624."},
{"new.password",
"\uC0C8 \uBE44\uBC00\uBC88\uD638"}, //-new
{"do.not.prompt",
"\uD655\uC778\uD558\uC9C0 \uC54A\uC74C"}, //-noprompt
{"password.through.protected.mechanism",
"\uBCF4\uD638\uB418\uB294 \uBA54\uCEE4\uB2C8\uC998\uC744 \uD1B5\uD55C \uBE44\uBC00\uBC88\uD638"}, //-protected
{"provider.argument",
"\uC81C\uACF5\uC790 \uC778\uC218"}, //-providerarg
{"provider.class.name",
"\uC81C\uACF5\uC790 \uD074\uB798\uC2A4 \uC774\uB984"}, //-providerclass
// The following 2 values should span 2 lines, the first for the
// option itself, the second for its -providerArg value.
{"addprovider.option",
"\uC774\uB984\uBCC4 \uBCF4\uC548 \uC81C\uACF5\uC790 \uCD94\uAC00(\uC608: SunPKCS11)\n-addprovider\uC5D0 \uB300\uD55C \uC778\uC218 \uAD6C\uC131"}, //-addprovider
{"provider.class.option",
"\uC804\uCCB4 \uD074\uB798\uC2A4 \uC774\uB984\uBCC4 \uBCF4\uC548 \uC81C\uACF5\uC790 \uCD94\uAC00\n-providerclass\uC5D0 \uB300\uD55C \uC778\uC218 \uAD6C\uC131"}, //-providerclass
{"provider.name",
"\uC81C\uACF5\uC790 \uC774\uB984"}, //-providername
{"provider.classpath",
@ -187,6 +195,8 @@ public class Resources_ko extends java.util.ListResourceBundle {
{"Command.option.flag.needs.an.argument.", "\uBA85\uB839 \uC635\uC158 {0}\uC5D0 \uC778\uC218\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4."},
{"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
"\uACBD\uACE0: \uB2E4\uB978 \uC800\uC7A5\uC18C \uBC0F \uD0A4 \uBE44\uBC00\uBC88\uD638\uB294 PKCS12 KeyStores\uC5D0 \uB300\uD574 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C {0} \uAC12\uC744 \uBB34\uC2DC\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."},
{"the.keystore.or.storetype.option.cannot.be.used.with.the.cacerts.option",
"-keystore \uB610\uB294 -storetype \uC635\uC158\uC740 -cacerts \uC635\uC158\uACFC \uD568\uAED8 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
{".keystore.must.be.NONE.if.storetype.is.{0}",
"-storetype\uC774 {0}\uC778 \uACBD\uC6B0 -keystore\uB294 NONE\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."},
{"Too.many.retries.program.terminated",
@ -208,7 +218,9 @@ public class Resources_ko extends java.util.ListResourceBundle {
{"Illegal.startdate.value", "startdate \uAC12\uC774 \uC798\uBABB\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
{"Validity.must.be.greater.than.zero",
"\uC720\uD6A8 \uAE30\uAC04\uC740 0\uBCF4\uB2E4 \uCEE4\uC57C \uD569\uB2C8\uB2E4."},
{"provName.not.a.provider", "{0}\uC740(\uB294) \uC81C\uACF5\uC790\uAC00 \uC544\uB2D9\uB2C8\uB2E4."},
{"provclass.not.a.provider", "%s\uC740(\uB294) \uC81C\uACF5\uC790\uAC00 \uC544\uB2D9\uB2C8\uB2E4."},
{"provider.name.not.found", "\"%s\" \uC774\uB984\uC758 \uC81C\uACF5\uC790\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
{"provider.class.not.found", "\"%s\" \uC81C\uACF5\uC790\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
{"Usage.error.no.command.provided", "\uC0AC\uC6A9\uBC95 \uC624\uB958: \uBA85\uB839\uC744 \uC785\uB825\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."},
{"Source.keystore.file.exists.but.is.empty.", "\uC18C\uC2A4 \uD0A4 \uC800\uC7A5\uC18C \uD30C\uC77C\uC774 \uC874\uC7AC\uD558\uC9C0\uB9CC \uBE44\uC5B4 \uC788\uC74C: "},
{"Please.specify.srckeystore", "-srckeystore\uB97C \uC9C0\uC815\uD558\uC2ED\uC2DC\uC624."},

View File

@ -126,16 +126,24 @@ public class Resources_pt_BR extends java.util.ListResourceBundle {
"tamanho do bit da chave"}, //-keysize
{"keystore.name",
"nome da \u00E1rea de armazenamento de chaves"}, //-keystore
{"access.the.cacerts.keystore",
"acessar a \u00E1rea de armazenamento de chaves cacerts"}, // -cacerts
{"warning.cacerts.option",
"Advert\u00EAncia: use a op\u00E7\u00E3o -cacerts para acessar a \u00E1rea de armazenamento de chaves cacerts"},
{"new.password",
"nova senha"}, //-new
{"do.not.prompt",
"n\u00E3o perguntar"}, //-noprompt
{"password.through.protected.mechanism",
"senha por meio de mecanismo protegido"}, //-protected
{"provider.argument",
"argumento do fornecedor"}, //-providerarg
{"provider.class.name",
"nome da classe do fornecedor"}, //-providerclass
// The following 2 values should span 2 lines, the first for the
// option itself, the second for its -providerArg value.
{"addprovider.option",
"adicionar provedor de seguran\u00E7a por nome (por exemplo, SunPKCS11)\nconfigurar argumento para -addprovider"}, //-addprovider
{"provider.class.option",
"adicionar provedor de seguran\u00E7a por nome de classe totalmente qualificado\nconfigurar argumento para -providerclass"}, //-providerclass
{"provider.name",
"nome do fornecedor"}, //-providername
{"provider.classpath",
@ -187,6 +195,8 @@ public class Resources_pt_BR extends java.util.ListResourceBundle {
{"Command.option.flag.needs.an.argument.", "A op\u00E7\u00E3o de comando {0} precisa de um argumento."},
{"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
"Advert\u00EAncia: Senhas de chave e de armazenamento diferentes n\u00E3o suportadas para KeyStores PKCS12. Ignorando valor {0} especificado pelo usu\u00E1rio."},
{"the.keystore.or.storetype.option.cannot.be.used.with.the.cacerts.option",
"A op\u00E7\u00E3o -keystore ou -storetype n\u00E3o pode ser usada com a op\u00E7\u00E3o -cacerts"},
{".keystore.must.be.NONE.if.storetype.is.{0}",
"-keystore deve ser NONE se -storetype for {0}"},
{"Too.many.retries.program.terminated",
@ -208,7 +218,9 @@ public class Resources_pt_BR extends java.util.ListResourceBundle {
{"Illegal.startdate.value", "valor da data inicial inv\u00E1lido"},
{"Validity.must.be.greater.than.zero",
"A validade deve ser maior do que zero"},
{"provName.not.a.provider", "{0} n\u00E3o \u00E9 um fornecedor"},
{"provclass.not.a.provider", "%s n\u00E3o \u00E9 um fornecedor"},
{"provider.name.not.found", "O fornecedor chamado \"%s\" n\u00E3o foi encontrado"},
{"provider.class.not.found", "Fornecedor \"%s\" n\u00E3o encontrado"},
{"Usage.error.no.command.provided", "Erro de uso: nenhum comando fornecido"},
{"Source.keystore.file.exists.but.is.empty.", "O arquivo da \u00E1rea de armazenamento de chaves de origem existe, mas est\u00E1 vazio: "},
{"Please.specify.srckeystore", "Especifique -srckeystore"},

View File

@ -126,16 +126,24 @@ public class Resources_sv extends java.util.ListResourceBundle {
"nyckelbitstorlek"}, //-keysize
{"keystore.name",
"namn p\u00E5 nyckellager"}, //-keystore
{"access.the.cacerts.keystore",
"\u00E5tkomst till nyckellagret cacerts"}, // -cacerts
{"warning.cacerts.option",
"Varning: anv\u00E4nd alternativet -cacerts f\u00F6r att f\u00E5 \u00E5tkomst till nyckellagret cacerts"},
{"new.password",
"nytt l\u00F6senord"}, //-new
{"do.not.prompt",
"fr\u00E5ga inte"}, //-noprompt
{"password.through.protected.mechanism",
"l\u00F6senord med skyddad mekanism"}, //-protected
{"provider.argument",
"leverant\u00F6rsargument"}, //-providerarg
{"provider.class.name",
"namn p\u00E5 leverant\u00F6rsklass"}, //-providerclass
// The following 2 values should span 2 lines, the first for the
// option itself, the second for its -providerArg value.
{"addprovider.option",
"l\u00E4gg till s\u00E4kerhetsleverant\u00F6r per namn (t.ex. SunPKCS11)\nkonfigurera argument f\u00F6r -addprovider"}, //-addprovider
{"provider.class.option",
"l\u00E4gg till s\u00E4kerhetsleverant\u00F6r per fullt kvalificerat klassnamn\nkonfigurera argument f\u00F6r -providerclass"}, //-providerclass
{"provider.name",
"leverant\u00F6rsnamn"}, //-providername
{"provider.classpath",
@ -187,6 +195,8 @@ public class Resources_sv extends java.util.ListResourceBundle {
{"Command.option.flag.needs.an.argument.", "Kommandoalternativet {0} beh\u00F6ver ett argument."},
{"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
"Varning! PKCS12-nyckellager har inte st\u00F6d f\u00F6r olika l\u00F6senord f\u00F6r lagret och nyckeln. Det anv\u00E4ndarspecificerade {0}-v\u00E4rdet ignoreras."},
{"the.keystore.or.storetype.option.cannot.be.used.with.the.cacerts.option",
"Alternativen -keystore och -storetype kan inte anv\u00E4ndas med alternativet -cacerts"},
{".keystore.must.be.NONE.if.storetype.is.{0}",
"-keystore m\u00E5ste vara NONE om -storetype \u00E4r {0}"},
{"Too.many.retries.program.terminated",
@ -208,7 +218,9 @@ public class Resources_sv extends java.util.ListResourceBundle {
{"Illegal.startdate.value", "Otill\u00E5tet v\u00E4rde f\u00F6r startdatum"},
{"Validity.must.be.greater.than.zero",
"Giltigheten m\u00E5ste vara st\u00F6rre \u00E4n noll"},
{"provName.not.a.provider", "{0} \u00E4r inte en leverant\u00F6r"},
{"provclass.not.a.provider", "%s \u00E4r inte en leverant\u00F6r"},
{"provider.name.not.found", "Leverant\u00F6ren med namnet \"%s\" hittades inte"},
{"provider.class.not.found", "Leverant\u00F6ren \"%s\" hittades inte"},
{"Usage.error.no.command.provided", "Syntaxfel: inget kommando angivet"},
{"Source.keystore.file.exists.but.is.empty.", "Nyckellagrets k\u00E4llfil finns, men \u00E4r tom: "},
{"Please.specify.srckeystore", "Ange -srckeystore"},

View File

@ -126,16 +126,24 @@ public class Resources_zh_CN extends java.util.ListResourceBundle {
"\u5BC6\u94A5\u4F4D\u5927\u5C0F"}, //-keysize
{"keystore.name",
"\u5BC6\u94A5\u5E93\u540D\u79F0"}, //-keystore
{"access.the.cacerts.keystore",
"\u8BBF\u95EE cacerts \u5BC6\u94A5\u5E93"}, // -cacerts
{"warning.cacerts.option",
"\u8B66\u544A: \u4F7F\u7528 -cacerts \u9009\u9879\u8BBF\u95EE cacerts \u5BC6\u94A5\u5E93"},
{"new.password",
"\u65B0\u53E3\u4EE4"}, //-new
{"do.not.prompt",
"\u4E0D\u63D0\u793A"}, //-noprompt
{"password.through.protected.mechanism",
"\u901A\u8FC7\u53D7\u4FDD\u62A4\u7684\u673A\u5236\u7684\u53E3\u4EE4"}, //-protected
{"provider.argument",
"\u63D0\u4F9B\u65B9\u53C2\u6570"}, //-providerarg
{"provider.class.name",
"\u63D0\u4F9B\u65B9\u7C7B\u540D"}, //-providerclass
// The following 2 values should span 2 lines, the first for the
// option itself, the second for its -providerArg value.
{"addprovider.option",
"\u6309\u540D\u79F0 (\u4F8B\u5982 SunPKCS11) \u6DFB\u52A0\u5B89\u5168\u63D0\u4F9B\u65B9\n\u914D\u7F6E -addprovider \u7684\u53C2\u6570"}, //-addprovider
{"provider.class.option",
"\u6309\u5168\u9650\u5B9A\u7C7B\u540D\u6DFB\u52A0\u5B89\u5168\u63D0\u4F9B\u65B9\n\u914D\u7F6E -providerclass \u7684\u53C2\u6570"}, //-providerclass
{"provider.name",
"\u63D0\u4F9B\u65B9\u540D\u79F0"}, //-providername
{"provider.classpath",
@ -187,6 +195,8 @@ public class Resources_zh_CN extends java.util.ListResourceBundle {
{"Command.option.flag.needs.an.argument.", "\u547D\u4EE4\u9009\u9879{0}\u9700\u8981\u4E00\u4E2A\u53C2\u6570\u3002"},
{"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
"\u8B66\u544A: PKCS12 \u5BC6\u94A5\u5E93\u4E0D\u652F\u6301\u5176\u4ED6\u5B58\u50A8\u548C\u5BC6\u94A5\u53E3\u4EE4\u3002\u6B63\u5728\u5FFD\u7565\u7528\u6237\u6307\u5B9A\u7684{0}\u503C\u3002"},
{"the.keystore.or.storetype.option.cannot.be.used.with.the.cacerts.option",
"-keystore \u6216 -storetype \u9009\u9879\u4E0D\u80FD\u4E0E -cacerts \u9009\u9879\u4E00\u8D77\u4F7F\u7528"},
{".keystore.must.be.NONE.if.storetype.is.{0}",
"\u5982\u679C -storetype \u4E3A {0}, \u5219 -keystore \u5FC5\u987B\u4E3A NONE"},
{"Too.many.retries.program.terminated",
@ -208,7 +218,9 @@ public class Resources_zh_CN extends java.util.ListResourceBundle {
{"Illegal.startdate.value", "\u975E\u6CD5\u5F00\u59CB\u65E5\u671F\u503C"},
{"Validity.must.be.greater.than.zero",
"\u6709\u6548\u6027\u5FC5\u987B\u5927\u4E8E\u96F6"},
{"provName.not.a.provider", "{0}\u4E0D\u662F\u63D0\u4F9B\u65B9"},
{"provclass.not.a.provider", "%s\u4E0D\u662F\u63D0\u4F9B\u65B9"},
{"provider.name.not.found", "\u672A\u627E\u5230\u540D\u4E3A \"%s\" \u7684\u63D0\u4F9B\u65B9"},
{"provider.class.not.found", "\u672A\u627E\u5230\u63D0\u4F9B\u65B9 \"%s\""},
{"Usage.error.no.command.provided", "\u7528\u6CD5\u9519\u8BEF: \u6CA1\u6709\u63D0\u4F9B\u547D\u4EE4"},
{"Source.keystore.file.exists.but.is.empty.", "\u6E90\u5BC6\u94A5\u5E93\u6587\u4EF6\u5B58\u5728, \u4F46\u4E3A\u7A7A: "},
{"Please.specify.srckeystore", "\u8BF7\u6307\u5B9A -srckeystore"},

View File

@ -126,16 +126,24 @@ public class Resources_zh_TW extends java.util.ListResourceBundle {
"\u91D1\u9470\u4F4D\u5143\u5927\u5C0F"}, //-keysize
{"keystore.name",
"\u91D1\u9470\u5132\u5B58\u5EAB\u540D\u7A31"}, //-keystore
{"access.the.cacerts.keystore",
"\u5B58\u53D6 cacerts \u91D1\u9470\u5132\u5B58\u5EAB"}, // -cacerts
{"warning.cacerts.option",
"\u8B66\u544A: \u4F7F\u7528 -cacerts \u9078\u9805\u5B58\u53D6 cacerts \u91D1\u9470\u5132\u5B58\u5EAB"},
{"new.password",
"\u65B0\u5BC6\u78BC"}, //-new
{"do.not.prompt",
"\u4E0D\u8981\u63D0\u793A"}, //-noprompt
{"password.through.protected.mechanism",
"\u7D93\u7531\u4FDD\u8B77\u6A5F\u5236\u7684\u5BC6\u78BC"}, //-protected
{"provider.argument",
"\u63D0\u4F9B\u8005\u5F15\u6578"}, //-providerarg
{"provider.class.name",
"\u63D0\u4F9B\u8005\u985E\u5225\u540D\u7A31"}, //-providerclass
// The following 2 values should span 2 lines, the first for the
// option itself, the second for its -providerArg value.
{"addprovider.option",
"\u4F7F\u7528\u540D\u7A31\u65B0\u589E\u5B89\u5168\u63D0\u4F9B\u8005 (\u4F8B\u5982 SunPKCS11)\n\u8A2D\u5B9A -addprovider \u5F15\u6578"}, //-addprovider
{"provider.class.option",
"\u4F7F\u7528\u5B8C\u6574\u985E\u5225\u540D\u7A31\u65B0\u589E\u5B89\u5168\u63D0\u4F9B\u8005\n\u8A2D\u5B9A -providerclass \u5F15\u6578"}, //-providerclass
{"provider.name",
"\u63D0\u4F9B\u8005\u540D\u7A31"}, //-providername
{"provider.classpath",
@ -187,6 +195,8 @@ public class Resources_zh_TW extends java.util.ListResourceBundle {
{"Command.option.flag.needs.an.argument.", "\u547D\u4EE4\u9078\u9805 {0} \u9700\u8981\u5F15\u6578\u3002"},
{"Warning.Different.store.and.key.passwords.not.supported.for.PKCS12.KeyStores.Ignoring.user.specified.command.value.",
"\u8B66\u544A: PKCS12 \u91D1\u9470\u5132\u5B58\u5EAB\u4E0D\u652F\u63F4\u4E0D\u540C\u7684\u5132\u5B58\u5EAB\u548C\u91D1\u9470\u5BC6\u78BC\u3002\u5FFD\u7565\u4F7F\u7528\u8005\u6307\u5B9A\u7684 {0} \u503C\u3002"},
{"the.keystore.or.storetype.option.cannot.be.used.with.the.cacerts.option",
"-keystore \u6216 -storetype \u9078\u9805\u4E0D\u80FD\u8207 -cacerts \u9078\u9805\u4E00\u8D77\u4F7F\u7528"},
{".keystore.must.be.NONE.if.storetype.is.{0}",
"\u5982\u679C -storetype \u70BA {0}\uFF0C\u5247 -keystore \u5FC5\u9808\u70BA NONE"},
{"Too.many.retries.program.terminated",
@ -208,7 +218,9 @@ public class Resources_zh_TW extends java.util.ListResourceBundle {
{"Illegal.startdate.value", "\u7121\u6548\u7684 startdate \u503C"},
{"Validity.must.be.greater.than.zero",
"\u6709\u6548\u6027\u5FC5\u9808\u5927\u65BC\u96F6"},
{"provName.not.a.provider", "{0} \u4E0D\u662F\u4E00\u500B\u63D0\u4F9B\u8005"},
{"provclass.not.a.provider", "%s \u4E0D\u662F\u4E00\u500B\u63D0\u4F9B\u8005"},
{"provider.name.not.found", "\u627E\u4E0D\u5230\u540D\u7A31\u70BA \"%s\" \u7684\u63D0\u4F9B\u8005"},
{"provider.class.not.found", "\u627E\u4E0D\u5230\u63D0\u4F9B\u8005 \"%s\""},
{"Usage.error.no.command.provided", "\u7528\u6CD5\u932F\u8AA4: \u672A\u63D0\u4F9B\u547D\u4EE4"},
{"Source.keystore.file.exists.but.is.empty.", "\u4F86\u6E90\u91D1\u9470\u5132\u5B58\u5EAB\u6A94\u6848\u5B58\u5728\uFF0C\u4F46\u70BA\u7A7A: "},
{"Please.specify.srckeystore", "\u8ACB\u6307\u5B9A -srckeystore"},

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2016, 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
@ -34,6 +34,7 @@ import java.security.cert.*;
import javax.security.auth.x500.X500Principal;
import sun.security.x509.X509CertImpl;
import sun.security.x509.KeyIdentifier;
import sun.security.x509.NetscapeCertTypeExtension;
import sun.security.util.DerValue;
import sun.security.util.DerInputStream;
@ -386,8 +387,21 @@ public final class SimpleValidator extends Validator {
X500Principal issuer = cert.getIssuerX500Principal();
List<X509Certificate> list = trustedX500Principals.get(issuer);
if (list != null) {
X509Certificate trustedCert = list.iterator().next();
c.add(trustedCert);
X509Certificate matchedCert = list.get(0);
X509CertImpl certImpl = X509CertImpl.toImpl(cert);
KeyIdentifier akid = certImpl.getAuthKeyId();
if (akid != null) {
for (X509Certificate sup : list) {
// Look for a best match issuer.
X509CertImpl supCert = X509CertImpl.toImpl(sup);
if (akid.equals(supCert.getSubjectKeyId())) {
matchedCert = sup;
break;
}
}
}
c.add(matchedCert);
return c.toArray(CHAIN0);
}

View File

@ -20,6 +20,9 @@ grant codeBase "jrt:/java.corba" {
permission java.security.AllPermission;
};
grant codeBase "jrt:/jdk.incubator.httpclient" {
};
grant codeBase "jrt:/java.scripting" {
permission java.security.AllPermission;
};

View File

@ -201,12 +201,14 @@ JNU_ThrowByNameWithMessageAndLastError
jio_snprintf(str1, messageextlen, " (%s)", message);
s2 = (*env)->NewStringUTF(env, str1);
free(str1);
JNU_CHECK_EXCEPTION(env);
if (s2 != NULL) {
jstring s3 = JNU_CallMethodByName(
env, NULL, s, "concat",
"(Ljava/lang/String;)Ljava/lang/String;",
s2).l;
(*env)->DeleteLocalRef(env, s2);
JNU_CHECK_EXCEPTION(env);
if (s3 != NULL) {
(*env)->DeleteLocalRef(env, s);
s = s3;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2016, 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
@ -76,6 +76,10 @@ class FileDispatcherImpl extends FileDispatcher {
return truncate0(fd, size);
}
int allocate(FileDescriptor fd, long size) throws IOException {
return allocate0(fd, size);
}
long size(FileDescriptor fd) throws IOException {
return size0(fd);
}
@ -138,6 +142,9 @@ class FileDispatcherImpl extends FileDispatcher {
static native int truncate0(FileDescriptor fd, long size)
throws IOException;
static native int allocate0(FileDescriptor fd, long size)
throws IOException;
static native long size0(FileDescriptor fd) throws IOException;
static native int lock0(FileDescriptor fd, boolean blocking, long pos,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2016, 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
@ -215,6 +215,20 @@ jint
handleSetLength(FD fd, jlong length)
{
int result;
#if defined(__linux__)
/*
* On Linux, if the file size is being increased, then ftruncate64()
* will modify the metadata value of the size without actually allocating
* any blocks which can cause a SIGBUS error if the file is subsequently
* memory-mapped.
*/
struct stat64 sb;
if (fstat64(fd, &sb) == 0 && length > sb.st_blocks*512) {
RESTARTABLE(fallocate64(fd, 0, 0, length), result);
return result;
}
#endif
RESTARTABLE(ftruncate64(fd, length), result);
return result;
}

View File

@ -45,6 +45,10 @@
#include <sys/sockio.h>
#endif
#if defined(MACOSX)
#include <sys/sysctl.h>
#endif
#include "net_util.h"
#include "java_net_SocketOptions.h"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2016, 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
@ -186,6 +186,27 @@ Java_sun_nio_ch_FileDispatcherImpl_truncate0(JNIEnv *env, jobject this,
"Truncation failed");
}
JNIEXPORT jint JNICALL
Java_sun_nio_ch_FileDispatcherImpl_allocate0(JNIEnv *env, jobject this,
jobject fdo, jlong size)
{
#if defined(__linux__)
/*
* On Linux, if the file size is being increased, then ftruncate64()
* will modify the metadata value of the size without actually allocating
* any blocks which can cause a SIGBUS error if the file is subsequently
* memory-mapped.
*/
return handle(env,
fallocate64(fdval(env, fdo), 0, 0, size),
"Allocation failed");
#else
return handle(env,
ftruncate64(fdval(env, fdo), size),
"Truncation failed");
#endif
}
JNIEXPORT jlong JNICALL
Java_sun_nio_ch_FileDispatcherImpl_size0(JNIEnv *env, jobject this, jobject fdo)
{

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2016, 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
@ -84,6 +84,11 @@ class FileDispatcherImpl extends FileDispatcher {
return truncate0(fd, size);
}
int allocate(FileDescriptor fd, long size) throws IOException {
// truncate0() works for extending and truncating file size
return truncate0(fd, size);
}
long size(FileDescriptor fd) throws IOException {
return size0(fd);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2016, 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
@ -72,6 +72,7 @@ Java_sun_awt_image_DataBufferNative_getElem(JNIEnv *env, jobject dbn,
unsigned char *pixelPtr;
SurfaceDataRasInfo lockInfo;
SurfaceDataOps *ops;
lockInfo.rasBase = NULL;
ops = SurfaceData_GetOps(env, sd);
JNU_CHECK_EXCEPTION_RETURN(env, -1);
@ -113,7 +114,7 @@ Java_sun_awt_image_DataBufferNative_setElem(JNIEnv *env, jobject dbn,
SurfaceDataRasInfo lockInfo;
SurfaceDataOps *ops;
unsigned char *pixelPtr;
lockInfo.rasBase = NULL;
ops = SurfaceData_GetOps(env, sd);
JNU_CHECK_EXCEPTION(env);

View File

@ -243,8 +243,8 @@ static void AddFontsToX11FontPath ( fDirRecord *fDirP )
appendDirList[index] = 0;
if ( doNotAppend == 0 ) {
strcpy ( fontDirPath, fDirP->name[index] );
strcat ( fontDirPath, "/fonts.dir" );
snprintf(fontDirPath, sizeof(fontDirPath), "%s/fonts.dir", fDirP->name[index]);
fontDirPath[sizeof(fontDirPath) - 1] = '\0';
dirFile = open ( fontDirPath, O_RDONLY, 0 );
if ( dirFile == -1 ) {
doNotAppend = 1;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2016, 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
@ -1235,12 +1235,14 @@ StatusDrawCallback(XIC ic, XPointer client_data,
if (status_draw->type == XIMTextType){
XIMText *text = (status_draw->data).text;
if (text != NULL){
if (text->string.multi_byte != NULL){
strcpy(statusWindow->status, text->string.multi_byte);
if (text->string.multi_byte != NULL) {
strncpy(statusWindow->status, text->string.multi_byte, MAX_STATUS_LEN);
statusWindow->status[MAX_STATUS_LEN - 1] = '\0';
}
else{
else {
char *mbstr = wcstombsdmp(text->string.wide_char, text->length);
strcpy(statusWindow->status, mbstr);
strncpy(statusWindow->status, mbstr, MAX_STATUS_LEN);
statusWindow->status[MAX_STATUS_LEN - 1] = '\0';
}
statusWindow->on = True;
onoffStatusWindow(pX11IMData, statusWindow->parent, True);

View File

@ -2014,9 +2014,7 @@ static gint gtk3_get_ythickness(JNIEnv *env, WidgetType widget_type)
static guint8 recode_color(gdouble channel)
{
guint16 result = (guint16)(channel * 65535);
if (result < 0) {
result = 0;
} else if (result > 65535) {
if (result > 65535) {
result = 65535;
}
return (guint8)( result >> 8);
@ -2218,6 +2216,7 @@ static void gtk3_style_shade (const GdkRGBA *a, GdkRGBA *b, gdouble k) {
static GdkRGBA gtk3_get_color_for_flags(GtkStyleContext* context,
GtkStateFlags flags, ColorType color_type) {
GdkRGBA c, color;
color.alpha = 1;
switch (color_type)
{
@ -2266,7 +2265,6 @@ static gint gtk3_get_color_for_state(JNIEnv *env, WidgetType widget_type,
{
gint result = 0;
GdkRGBA color;
GtkStateFlags flags = gtk3_get_state_flags(state_type);
@ -2285,7 +2283,7 @@ static gint gtk3_get_color_for_state(JNIEnv *env, WidgetType widget_type,
| GTK_STATE_FLAG_INSENSITIVE | GTK_STATE_FLAG_FOCUSED;
}
color = gtk3_get_color_for_flags(context, flags, color_type);
GdkRGBA color = gtk3_get_color_for_flags(context, flags, color_type);
if (recode_color(color.alpha) == 0) {
color = gtk3_get_color_for_flags(

View File

@ -567,7 +567,7 @@ static void update_poll_timeout(int timeout_control) {
*/
static uint32_t get_poll_timeout(jlong nextTaskTime)
{
uint32_t ret_timeout;
uint32_t ret_timeout = 0;
uint32_t timeout;
uint32_t taskTimeout;
uint32_t flushTimeout;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2016, 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
@ -863,10 +863,10 @@ isKPevent(XEvent *event)
}
static void
dumpKeysymArray(XEvent *event) {
printf(" 0x%X\n",keycodeToKeysym(event->xkey.display, event->xkey.keycode, 0));
printf(" 0x%X\n",keycodeToKeysym(event->xkey.display, event->xkey.keycode, 1));
printf(" 0x%X\n",keycodeToKeysym(event->xkey.display, event->xkey.keycode, 2));
printf(" 0x%X\n",keycodeToKeysym(event->xkey.display, event->xkey.keycode, 3));
printf(" 0x%lX\n", (unsigned long)keycodeToKeysym(event->xkey.display, event->xkey.keycode, 0));
printf(" 0x%lX\n", (unsigned long)keycodeToKeysym(event->xkey.display, event->xkey.keycode, 1));
printf(" 0x%lX\n", (unsigned long)keycodeToKeysym(event->xkey.display, event->xkey.keycode, 2));
printf(" 0x%lX\n", (unsigned long)keycodeToKeysym(event->xkey.display, event->xkey.keycode, 3));
}
/*
* In a next redesign, get rid of this code altogether.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2016, 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
@ -809,7 +809,7 @@ SplashGetScaledImageName(const char* jarName, const char* fileName,
#ifndef __linux__
return JNI_FALSE;
#endif
*scaleFactor = getNativeScaleFactor(NULL);
*scaleFactor = (float)getNativeScaleFactor(NULL);
return GetScaledImageName(fileName, scaledImgName, scaleFactor, scaledImageNameLength);
}

View File

@ -1,609 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.io.Closeable;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.LinkedList;
import java.util.concurrent.ExecutorService;
import java.util.function.Consumer;
import static javax.net.ssl.SSLEngineResult.Status.*;
import javax.net.ssl.*;
import static javax.net.ssl.SSLEngineResult.HandshakeStatus.*;
/**
* Asynchronous wrapper around SSLEngine. send and receive is fully non
* blocking. When handshaking is required, a thread is created to perform
* the handshake and application level sends do not take place during this time.
*
* Is implemented using queues and functions operating on the receiving end
* of each queue.
*
* Application writes to:
* ||
* \/
* appOutputQ
* ||
* \/
* appOutputQ read by "upperWrite" method which does SSLEngine.wrap
* and writes to
* ||
* \/
* channelOutputQ
* ||
* \/
* channelOutputQ is read by "lowerWrite" method which is invoked from
* OP_WRITE events on the socket (from selector thread)
*
* Reading side is as follows
* --------------------------
*
* "upperRead" method reads off channelInputQ and calls SSLEngine.unwrap and
* when decrypted data is returned, it is passed to the user's Consumer<ByteBuffer>
* /\
* ||
* channelInputQ
* /\
* ||
* "lowerRead" method puts buffers into channelInputQ. It is invoked from
* OP_READ events from the selector.
*
* Whenever handshaking is required, the doHandshaking() method is called
* which creates a thread to complete the handshake. It takes over the
* channelInputQ from upperRead, and puts outgoing packets on channelOutputQ.
* Selector events are delivered to lowerRead and lowerWrite as normal.
*
* Errors
*
* Any exception thrown by the engine or channel, causes all Queues to be closed
* the channel to be closed, and the error is reported to the user's
* Consumer<Throwable>
*/
class AsyncSSLDelegate implements Closeable, AsyncConnection {
// outgoing buffers put in this queue first and may remain here
// while SSL handshaking happening.
final Queue<ByteBuffer> appOutputQ;
// queue of wrapped ByteBuffers waiting to be sent on socket channel
//final Queue<ByteBuffer> channelOutputQ;
// Bytes read into this queue before being unwrapped. Backup on this
// Q should only happen when the engine is stalled due to delegated tasks
final Queue<ByteBuffer> channelInputQ;
// input occurs through the read() method which is expected to be called
// when the selector signals some data is waiting to be read. All incoming
// handshake data is handled in this method, which means some calls to
// read() may return zero bytes of user data. This is not a sign of spinning,
// just that the handshake mechanics are being executed.
final SSLEngine engine;
final SSLParameters sslParameters;
//final SocketChannel chan;
final HttpConnection lowerOutput;
final HttpClientImpl client;
final ExecutorService executor;
final BufferHandler bufPool;
Consumer<ByteBuffer> receiver;
Consumer<Throwable> errorHandler;
// Locks.
final Object reader = new Object();
final Object writer = new Object();
// synchronizing handshake state
final Object handshaker = new Object();
// flag set when reader or writer is blocked waiting for handshake to finish
boolean writerBlocked;
boolean readerBlocked;
// some thread is currently doing the handshake
boolean handshaking;
// alpn[] may be null. upcall is callback which receives incoming decoded bytes off socket
AsyncSSLDelegate(HttpConnection lowerOutput, HttpClientImpl client, String[] alpn)
{
SSLContext context = client.sslContext();
executor = client.executorService();
bufPool = client;
appOutputQ = new Queue<>();
appOutputQ.registerPutCallback(this::upperWrite);
//channelOutputQ = new Queue<>();
//channelOutputQ.registerPutCallback(this::lowerWrite);
engine = context.createSSLEngine();
engine.setUseClientMode(true);
SSLParameters sslp = client.sslParameters().orElse(null);
if (sslp == null) {
sslp = context.getSupportedSSLParameters();
//sslp = context.getDefaultSSLParameters();
//printParams(sslp);
}
sslParameters = Utils.copySSLParameters(sslp);
if (alpn != null) {
sslParameters.setApplicationProtocols(alpn);
}
logParams(sslParameters);
engine.setSSLParameters(sslParameters);
this.lowerOutput = lowerOutput;
this.client = client;
this.channelInputQ = new Queue<>();
this.channelInputQ.registerPutCallback(this::upperRead);
}
/**
* Put buffers to appOutputQ, and call upperWrite() if q was empty.
*
* @param src
*/
public void write(ByteBuffer[] src) throws IOException {
appOutputQ.putAll(src);
}
public void write(ByteBuffer buf) throws IOException {
ByteBuffer[] a = new ByteBuffer[1];
a[0] = buf;
write(a);
}
@Override
public void close() {
Utils.close(appOutputQ, channelInputQ, lowerOutput);
}
/**
* Attempts to wrap buffers from appOutputQ and place them on the
* channelOutputQ for writing. If handshaking is happening, then the
* process stalls and last buffers taken off the appOutputQ are put back
* into it until handshaking completes.
*
* This same method is called to try and resume output after a blocking
* handshaking operation has completed.
*/
private void upperWrite() {
try {
EngineResult r = null;
ByteBuffer[] buffers = appOutputQ.pollAll(Utils.EMPTY_BB_ARRAY);
int bytes = Utils.remaining(buffers);
while (bytes > 0) {
synchronized (writer) {
r = wrapBuffers(buffers);
int bytesProduced = r.bytesProduced();
int bytesConsumed = r.bytesConsumed();
bytes -= bytesConsumed;
if (bytesProduced > 0) {
// pass destination buffer to channelOutputQ.
lowerOutput.write(r.destBuffer);
}
synchronized (handshaker) {
if (r.handshaking()) {
// handshaking is happening or is needed
// so we put the buffers back on Q to process again
// later. It's possible that some may have already
// been processed, which is ok.
appOutputQ.pushbackAll(buffers);
writerBlocked = true;
if (!handshaking()) {
// execute the handshake in another thread.
// This method will be called again to resume sending
// later
doHandshake(r);
}
return;
}
}
}
}
returnBuffers(buffers);
} catch (Throwable t) {
close();
errorHandler.accept(t);
}
}
private void doHandshake(EngineResult r) {
handshaking = true;
channelInputQ.registerPutCallback(null);
executor.execute(() -> {
try {
doHandshakeImpl(r);
channelInputQ.registerPutCallback(this::upperRead);
} catch (Throwable t) {
close();
errorHandler.accept(t);
}
});
}
private void returnBuffers(ByteBuffer[] bufs) {
for (ByteBuffer buf : bufs)
client.returnBuffer(buf);
}
/**
* Return true if some thread is currently doing the handshake
*
* @return
*/
boolean handshaking() {
synchronized(handshaker) {
return handshaking;
}
}
/**
* Executes entire handshake in calling thread.
* Returns after handshake is completed or error occurs
* @param r
* @throws IOException
*/
private void doHandshakeImpl(EngineResult r) throws IOException {
while (true) {
SSLEngineResult.HandshakeStatus status = r.handshakeStatus();
if (status == NEED_TASK) {
LinkedList<Runnable> tasks = obtainTasks();
for (Runnable task : tasks)
task.run();
r = handshakeWrapAndSend();
} else if (status == NEED_WRAP) {
r = handshakeWrapAndSend();
} else if (status == NEED_UNWRAP) {
r = handshakeReceiveAndUnWrap();
}
if (!r.handshaking())
break;
}
boolean dowrite = false;
boolean doread = false;
// Handshake is finished. Now resume reading and/or writing
synchronized(handshaker) {
handshaking = false;
if (writerBlocked) {
writerBlocked = false;
dowrite = true;
}
if (readerBlocked) {
readerBlocked = false;
doread = true;
}
}
if (dowrite)
upperWrite();
if (doread)
upperRead();
}
// acknowledge a received CLOSE request from peer
void doClosure() throws IOException {
//while (!wrapAndSend(emptyArray))
//;
}
LinkedList<Runnable> obtainTasks() {
LinkedList<Runnable> l = new LinkedList<>();
Runnable r;
while ((r = engine.getDelegatedTask()) != null)
l.add(r);
return l;
}
@Override
public synchronized void setAsyncCallbacks(Consumer<ByteBuffer> asyncReceiver, Consumer<Throwable> errorReceiver) {
this.receiver = asyncReceiver;
this.errorHandler = errorReceiver;
}
@Override
public void startReading() {
// maybe this class does not need to implement AsyncConnection
}
static class EngineResult {
ByteBuffer destBuffer;
ByteBuffer srcBuffer;
SSLEngineResult result;
Throwable t;
boolean handshaking() {
SSLEngineResult.HandshakeStatus s = result.getHandshakeStatus();
return s != FINISHED && s != NOT_HANDSHAKING;
}
int bytesConsumed() {
return result.bytesConsumed();
}
int bytesProduced() {
return result.bytesProduced();
}
Throwable exception() {
return t;
}
SSLEngineResult.HandshakeStatus handshakeStatus() {
return result.getHandshakeStatus();
}
SSLEngineResult.Status status() {
return result.getStatus();
}
}
EngineResult handshakeWrapAndSend() throws IOException {
EngineResult r = wrapBuffer(Utils.EMPTY_BYTEBUFFER);
if (r.bytesProduced() > 0) {
lowerOutput.write(r.destBuffer);
}
return r;
}
// called during handshaking. It blocks until a complete packet
// is available, unwraps it and returns.
EngineResult handshakeReceiveAndUnWrap() throws IOException {
ByteBuffer buf = channelInputQ.take();
while (true) {
// block waiting for input
EngineResult r = unwrapBuffer(buf);
SSLEngineResult.Status status = r.status();
if (status == BUFFER_UNDERFLOW) {
// wait for another buffer to arrive
ByteBuffer buf1 = channelInputQ.take();
buf = combine (buf, buf1);
continue;
}
// OK
// theoretically possible we could receive some user data
if (r.bytesProduced() > 0) {
receiver.accept(r.destBuffer);
}
if (!buf.hasRemaining())
return r;
}
}
EngineResult wrapBuffer(ByteBuffer src) throws SSLException {
ByteBuffer[] bufs = new ByteBuffer[1];
bufs[0] = src;
return wrapBuffers(bufs);
}
EngineResult wrapBuffers(ByteBuffer[] src) throws SSLException {
EngineResult r = new EngineResult();
ByteBuffer dst = bufPool.getBuffer();
while (true) {
r.result = engine.wrap(src, dst);
switch (r.result.getStatus()) {
case BUFFER_OVERFLOW:
dst = getPacketBuffer();
break;
case CLOSED:
case OK:
dst.flip();
r.destBuffer = dst;
return r;
case BUFFER_UNDERFLOW:
// underflow handled externally
bufPool.returnBuffer(dst);
return r;
default:
assert false;
}
}
}
EngineResult unwrapBuffer(ByteBuffer srcbuf) throws IOException {
EngineResult r = new EngineResult();
r.srcBuffer = srcbuf;
ByteBuffer dst = bufPool.getBuffer();
while (true) {
r.result = engine.unwrap(srcbuf, dst);
switch (r.result.getStatus()) {
case BUFFER_OVERFLOW:
// dest buffer not big enough. Reallocate
int oldcap = dst.capacity();
dst = getApplicationBuffer();
assert dst.capacity() > oldcap;
break;
case CLOSED:
doClosure();
throw new IOException("Engine closed");
case BUFFER_UNDERFLOW:
bufPool.returnBuffer(dst);
return r;
case OK:
dst.flip();
r.destBuffer = dst;
return r;
}
}
}
/**
* Asynchronous read input. Call this when selector fires.
* Unwrap done in upperRead because it also happens in
* doHandshake() when handshake taking place
*/
public void lowerRead(ByteBuffer buffer) {
try {
channelInputQ.put(buffer);
} catch (Throwable t) {
close();
errorHandler.accept(t);
}
}
public void upperRead() {
EngineResult r;
ByteBuffer srcbuf;
synchronized (reader) {
try {
srcbuf = channelInputQ.poll();
if (srcbuf == null) {
return;
}
while (true) {
r = unwrapBuffer(srcbuf);
switch (r.result.getStatus()) {
case BUFFER_UNDERFLOW:
// Buffer too small. Need to combine with next buf
ByteBuffer nextBuf = channelInputQ.poll();
if (nextBuf == null) {
// no data available. push buffer back until more data available
channelInputQ.pushback(srcbuf);
return;
} else {
srcbuf = combine(srcbuf, nextBuf);
}
break;
case OK:
// check for any handshaking work
synchronized (handshaker) {
if (r.handshaking()) {
// handshaking is happening or is needed
// so we put the buffer back on Q to process again
// later.
channelInputQ.pushback(srcbuf);
readerBlocked = true;
if (!handshaking()) {
// execute the handshake in another thread.
// This method will be called again to resume sending
// later
doHandshake(r);
}
return;
}
}
ByteBuffer dst = r.destBuffer;
if (dst.hasRemaining()) {
receiver.accept(dst);
}
}
if (srcbuf.hasRemaining()) {
continue;
}
srcbuf = channelInputQ.poll();
if (srcbuf == null) {
return;
}
}
} catch (Throwable t) {
close();
errorHandler.accept(t);
}
}
}
/**
* Get a new buffer that is the right size for application buffers.
*
* @return
*/
ByteBuffer getApplicationBuffer() {
SSLSession session = engine.getSession();
int appBufsize = session.getApplicationBufferSize();
bufPool.setMinBufferSize(appBufsize);
return bufPool.getBuffer(appBufsize);
}
ByteBuffer getPacketBuffer() {
SSLSession session = engine.getSession();
int packetBufSize = session.getPacketBufferSize();
bufPool.setMinBufferSize(packetBufSize);
return bufPool.getBuffer(packetBufSize);
}
ByteBuffer combine(ByteBuffer buf1, ByteBuffer buf2) {
int avail1 = buf1.capacity() - buf1.remaining();
if (buf2.remaining() < avail1) {
buf1.compact();
buf1.put(buf2);
buf1.flip();
return buf1;
}
int newsize = buf1.remaining() + buf2.remaining();
ByteBuffer newbuf = bufPool.getBuffer(newsize);
newbuf.put(buf1);
newbuf.put(buf2);
newbuf.flip();
return newbuf;
}
SSLParameters getSSLParameters() {
return sslParameters;
}
static void logParams(SSLParameters p) {
if (!Log.ssl()) {
return;
}
Log.logSSL("SSLParameters:");
if (p == null) {
Log.logSSL("Null params");
return;
}
if (p.getCipherSuites() != null) {
for (String cipher : p.getCipherSuites()) {
Log.logSSL("cipher: {0}\n", cipher);
}
}
// SSLParameters.getApplicationProtocols() can't return null
for (String approto : p.getApplicationProtocols()) {
Log.logSSL("application protocol: {0}\n", approto);
}
if (p.getProtocols() != null) {
for (String protocol : p.getProtocols()) {
Log.logSSL("protocol: {0}\n", protocol);
}
}
if (p.getServerNames() != null) {
for (SNIServerName sname : p.getServerNames()) {
Log.logSSL("server name: {0}\n", sname.toString());
}
}
}
String getSessionInfo() {
StringBuilder sb = new StringBuilder();
String application = engine.getApplicationProtocol();
SSLSession sess = engine.getSession();
String cipher = sess.getCipherSuite();
String protocol = sess.getProtocol();
sb.append("Handshake complete alpn: ")
.append(application)
.append(", Cipher: ")
.append(cipher)
.append(", Protocol: ")
.append(protocol);
return sb.toString();
}
}

View File

@ -1,189 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.function.Supplier;
/**
* Takes a List<ByteBuffer> which is assumed to contain at least one HTTP/2
* frame and allows it to be processed supplying bytes, ints, shorts, byte[] etc.
* from the list. As each ByteBuffer is consumed it is removed from the List<>.
*
* NOTE. shorts and bytes returned are UNSIGNED ints
*
* When finished processing the frame, the List may be empty or may contain
* partially read or unread ByteBuffers. A new ByteBufferConsumer can be
* created with the List<>
*/
class ByteBufferConsumer {
ByteBuffer currentBuffer;
final List<ByteBuffer> buffers;
final ListIterator<ByteBuffer> iterator;
final Supplier<ByteBuffer> newBufferSupplier;
ByteBufferConsumer(List<ByteBuffer> buffers,
Supplier<ByteBuffer> newBufferSupplier) {
this.buffers = buffers;
this.newBufferSupplier = newBufferSupplier;
this.iterator = buffers.listIterator();
if (!iterator.hasNext()) {
throw new IllegalArgumentException("Empty buffer list");
}
currentBuffer = iterator.next();
}
private void dump() {
int l = 0;
System.err.printf("ByteBufferConsumer:\n");
for (ByteBuffer buf : buffers) {
System.err.printf("\t%s\n", buf.toString());
l+= buf.remaining();
}
System.err.printf("BBC contains %d bytes\n", l);
}
private synchronized ByteBuffer getBuffer(boolean exception) throws IOException {
while (currentBuffer == null || !currentBuffer.hasRemaining()) {
if (currentBuffer != null) {
iterator.remove();
}
if (!iterator.hasNext()) {
currentBuffer = null;
if (exception) {
throw new IOException ("Connection closed unexpectedly");
}
return null;
}
currentBuffer = iterator.next();
}
return currentBuffer;
}
// call this to check if the data has all been consumed
public boolean consumed() {
try {
return getBuffer(false) == null;
} catch (IOException e) {
/* CAN'T HAPPEN */
throw new InternalError();
}
}
public int getByte() throws IOException {
// TODO: what to do if connection is closed. Throw NPE?
ByteBuffer buf = getBuffer(true);
return buf.get() & 0xff;
}
public byte[] getBytes(int n) throws IOException {
return getBytes(n, null);
}
public byte[] getBytes(int n, byte[] buf) throws IOException {
if (buf == null) {
buf = new byte[n];
} else if (buf.length < n) {
throw new IllegalArgumentException("getBytes: buffer too small");
}
int offset = 0;
while (n > 0) {
ByteBuffer b = getBuffer(true);
int length = Math.min(n, b.remaining());
b.get(buf, offset, length);
offset += length;
n -= length;
}
return buf;
}
public int getShort() throws IOException {
ByteBuffer buf = getBuffer(true);
int rem = buf.remaining();
if (rem >= 2) {
return buf.getShort() & 0xffff;
}
// Slow path. Not common
int val = 0;
val = (val << 8) + getByte();
val = (val << 8) + getByte();
return val;
}
public int getInt() throws IOException {
ByteBuffer buf = getBuffer(true);
int rem = buf.remaining();
if (rem >= 4) {
return buf.getInt();
}
// Slow path. Not common
int val = 0;
for (int nbytes = 0; nbytes < 4; nbytes++) {
val = (val << 8) + getByte();
}
return val;
}
private static final ByteBuffer[] EMPTY = new ByteBuffer[0];
/**
* Extracts whatever number of ByteBuffers from list to get required number
* of bytes. Any remaining buffers are 'tidied up' so reading can continue.
*/
public ByteBuffer[] getBuffers(int bytecount) throws IOException {
LinkedList<ByteBuffer> l = new LinkedList<>();
while (bytecount > 0) {
ByteBuffer buffer = getBuffer(true);
int remaining = buffer.remaining();
if (remaining > bytecount) {
int difference = remaining - bytecount;
// split
ByteBuffer newb = newBufferSupplier.get();
newb.clear();
int limit = buffer.limit();
buffer.limit(limit - difference);
newb.put(buffer);
newb.flip();
buffer.limit(limit);
l.add(newb);
bytecount = 0;
} else {
l.add(buffer);
currentBuffer = null;
iterator.remove();
bytecount -= remaining;
}
}
return l.toArray(EMPTY);
}
}

View File

@ -1,137 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.nio.ByteBuffer;
import java.util.ArrayList;
/**
* Manages a ByteBuffer[] for writing frames into for output. The last
* ByteBuffer in the list is always unflipped (able to receive more bytes for
* sending) until getBufferArray() is called, which calls finish().
*
* This allows multiple frames to be written to the same BBG.
*
* Buffers added with addByteBuffer() must be already flipped.
*/
class ByteBufferGenerator {
ByteBuffer currentBuffer;
// source is assumed to always return the same sized buffer
final BufferHandler pool;
final ArrayList<ByteBuffer> buflist;
final int bufsize;
boolean finished;
ByteBufferGenerator(BufferHandler pool) {
this.buflist = new ArrayList<>();
this.pool = pool;
this.currentBuffer = pool.getBuffer();
this.bufsize = currentBuffer.capacity();
}
private static final ByteBuffer[] EMPTY = new ByteBuffer[0];
public ByteBuffer[] getBufferArray() {
finish();
return buflist.toArray(EMPTY);
}
public ArrayList<ByteBuffer> getBufferList() {
finish();
return buflist;
}
private synchronized void finish() {
if (finished) {
return;
}
finished = true;
currentBuffer.flip();
if (currentBuffer.hasRemaining()) {
buflist.add(currentBuffer);
} else {
pool.returnBuffer(currentBuffer);
}
}
// only used for SettingsFrame: offset is number of bytes to
// ignore at start (we only want the payload of the settings frame)
public byte[] asByteArray(int offset) {
ByteBuffer[] bufs = getBufferArray();
int size = 0;
for (ByteBuffer buf : bufs) {
size += buf.remaining();
}
byte[] bytes = new byte[size-offset];
int pos = 0;
for (ByteBuffer buf : bufs) {
int rem = buf.remaining();
int ignore = Math.min(rem, offset);
buf.position(buf.position()+ignore);
rem -= ignore;
offset -= ignore;
buf.get(bytes, pos, rem);
pos += rem;
}
return bytes;
}
ByteBuffer getBuffer(long n) {
if (currentBuffer.remaining() < n) {
getNewBuffer();
if (n > currentBuffer.capacity()) {
throw new IllegalArgumentException("requested buffer too large");
}
}
return currentBuffer;
}
void getNewBuffer() {
currentBuffer.flip();
if (currentBuffer.hasRemaining()) {
buflist.add(currentBuffer);
} else {
pool.returnBuffer(currentBuffer);
}
currentBuffer = pool.getBuffer();
}
void addByteBuffer(ByteBuffer buf) {
getNewBuffer();
buflist.add(buf);
}
void addPadding(int length) {
while (length > 0) {
int n = Math.min(length, bufsize);
ByteBuffer b = getBuffer(n);
// TODO: currently zeroed?
b.position(b.position() + n);
length -= n;
}
}
}

View File

@ -1,161 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import static java.nio.charset.StandardCharsets.UTF_8;
// The purpose of this class is to separate charset-related tasks from the main
// WebSocket logic, simplifying where possible.
//
// * Coders hide the differences between coding and flushing stages on the
// API level
// * Verifier abstracts the way the verification is performed
// (spoiler: it's a decoding into a throw-away buffer)
//
// Coding methods throw exceptions instead of returning coding result denoting
// errors, since any kind of handling and recovery is not expected.
final class CharsetToolkit {
private CharsetToolkit() { }
static final class Verifier {
private final CharsetDecoder decoder = UTF_8.newDecoder();
// A buffer used to check validity of UTF-8 byte stream by decoding it.
// The contents of this buffer are never used.
// The size is arbitrary, though it should probably be chosen from the
// performance perspective since it affects the total number of calls to
// decoder.decode() and amount of work in each of these calls
private final CharBuffer blackHole = CharBuffer.allocate(1024);
void verify(ByteBuffer in, boolean endOfInput)
throws CharacterCodingException {
while (true) {
// Since decoder.flush() cannot produce an error, it's not
// helpful for verification. Therefore this step is skipped.
CoderResult r = decoder.decode(in, blackHole, endOfInput);
if (r.isOverflow()) {
blackHole.clear();
} else if (r.isUnderflow()) {
break;
} else if (r.isError()) {
r.throwException();
} else {
// Should not happen
throw new InternalError();
}
}
}
Verifier reset() {
decoder.reset();
return this;
}
}
static final class Encoder {
private final CharsetEncoder encoder = UTF_8.newEncoder();
private boolean coding = true;
CoderResult encode(CharBuffer in, ByteBuffer out, boolean endOfInput)
throws CharacterCodingException {
if (coding) {
CoderResult r = encoder.encode(in, out, endOfInput);
if (r.isOverflow()) {
return r;
} else if (r.isUnderflow()) {
if (endOfInput) {
coding = false;
} else {
return r;
}
} else if (r.isError()) {
r.throwException();
} else {
// Should not happen
throw new InternalError();
}
}
assert !coding;
return encoder.flush(out);
}
Encoder reset() {
coding = true;
encoder.reset();
return this;
}
}
static CharBuffer decode(ByteBuffer in) throws CharacterCodingException {
return UTF_8.newDecoder().decode(in);
}
static final class Decoder {
private final CharsetDecoder decoder = UTF_8.newDecoder();
private boolean coding = true; // Either coding or flushing
CoderResult decode(ByteBuffer in, CharBuffer out, boolean endOfInput)
throws CharacterCodingException {
if (coding) {
CoderResult r = decoder.decode(in, out, endOfInput);
if (r.isOverflow()) {
return r;
} else if (r.isUnderflow()) {
if (endOfInput) {
coding = false;
} else {
return r;
}
} else if (r.isError()) {
r.throwException();
} else {
// Should not happen
throw new InternalError();
}
}
assert !coding;
return decoder.flush(out);
}
Decoder reset() {
coding = true;
decoder.reset();
return this;
}
}
}

View File

@ -1,67 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.io.IOException;
import java.net.CookieManager;
import java.util.List;
import java.util.Map;
import java.util.Set;
class CookieFilter implements HeaderFilter {
final HttpClientImpl client;
final CookieManager cookieMan;
CookieFilter(HttpClientImpl client) {
this.client = client;
this.cookieMan = client.cookieManager().orElseThrow(
() -> new IllegalArgumentException("no cookie manager"));
}
@Override
public void request(HttpRequestImpl r) throws IOException {
Map<String,List<String>> userheaders, cookies;
userheaders = r.getUserHeaders().map();
cookies = cookieMan.get(r.uri(), userheaders);
// add the returned cookies
HttpHeadersImpl systemHeaders = r.getSystemHeaders();
Set<String> keys = cookies.keySet();
for (String hdrname : keys) {
List<String> vals = cookies.get(hdrname);
for (String val : vals) {
systemHeaders.addHeader(hdrname, val);
}
}
}
@Override
public HttpRequestImpl response(HttpResponseImpl r) throws IOException {
HttpHeaders hdrs = r.headers();
cookieMan.put(r.uri(), hdrs.map());
return null;
}
}

View File

@ -1,135 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.io.IOException;
import java.util.concurrent.CompletableFuture;
import static java.net.http.HttpClient.Version.HTTP_1_1;
/**
* Splits request so that headers and body can be sent separately with optional
* (multiple) responses in between (e.g. 100 Continue). Also request and
* response always sent/received in different calls.
*
* Synchronous and asynchronous versions of each method are provided.
*
* Separate implementations of this class exist for HTTP/1.1 and HTTP/2
* Http1Exchange (HTTP/1.1)
* Stream (HTTP/2)
*
* These implementation classes are where work is allocated to threads.
*/
abstract class ExchangeImpl {
final Exchange exchange;
ExchangeImpl(Exchange e) {
this.exchange = e;
}
/**
* Initiates a new exchange and assigns it to a connection if one exists
* already. connection usually null.
*/
static ExchangeImpl get(Exchange exchange, HttpConnection connection)
throws IOException, InterruptedException
{
HttpRequestImpl req = exchange.request();
if (req.version() == HTTP_1_1) {
return new Http1Exchange(exchange, connection);
} else {
Http2ClientImpl c2 = exchange.request().client().client2(); // TODO: improve
HttpRequestImpl request = exchange.request();
Http2Connection c = c2.getConnectionFor(request);
if (c == null) {
// no existing connection. Send request with HTTP 1 and then
// upgrade if successful
ExchangeImpl ex = new Http1Exchange(exchange, connection);
exchange.h2Upgrade();
return ex;
}
return c.createStream(exchange);
}
}
/* The following methods have separate HTTP/1.1 and HTTP/2 implementations */
/**
* Sends the request headers only. May block until all sent.
*/
abstract void sendHeadersOnly() throws IOException, InterruptedException;
/**
* Gets response headers by blocking if necessary. This may be an
* intermediate response (like 101) or a final response 200 etc.
*/
abstract HttpResponseImpl getResponse() throws IOException;
/**
* Sends a request body after request headers.
*/
abstract void sendBody() throws IOException, InterruptedException;
/**
* Sends the entire request (headers and body) blocking.
*/
abstract void sendRequest() throws IOException, InterruptedException;
/**
* Asynchronous version of sendHeaders().
*/
abstract CompletableFuture<Void> sendHeadersAsync();
/**
* Asynchronous version of getResponse(). Requires void parameter for
* CompletableFuture chaining.
*/
abstract CompletableFuture<HttpResponseImpl> getResponseAsync(Void v);
/**
* Asynchronous version of sendBody().
*/
abstract CompletableFuture<Void> sendBodyAsync();
/**
* Cancels a request. Not currently exposed through API.
*/
abstract void cancel();
/**
* Asynchronous version of sendRequest().
*/
abstract CompletableFuture<Void> sendRequestAsync();
abstract <T> T responseBody(HttpResponse.BodyProcessor<T> processor)
throws IOException;
/**
* Asynchronous version of responseBody().
*/
abstract <T> CompletableFuture<T>
responseBodyAsync(HttpResponse.BodyProcessor<T> processor);
}

View File

@ -1,102 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.function.Supplier;
/**
* Wraps the supplied user ExecutorService.
*
* 1) when a Security manager set, the correct access control context
* is used to execute task
*
* 2) memory fence implemented
*/
class ExecutorWrapper {
final ExecutorService userExecutor; // the actual executor service used
final Executor executor;
public static ExecutorWrapper wrap(ExecutorService userExecutor) {
return new ExecutorWrapper(userExecutor);
}
/**
* Returns a dummy ExecutorWrapper which uses the calling thread
*/
public static ExecutorWrapper callingThread() {
return new ExecutorWrapper();
}
private ExecutorWrapper(ExecutorService userExecutor) {
// used for executing in calling thread
this.userExecutor = userExecutor;
this.executor = userExecutor;
}
private ExecutorWrapper() {
this.userExecutor = null;
this.executor = (Runnable command) -> {
command.run();
};
}
public ExecutorService userExecutor() {
return userExecutor;
}
public synchronized void synchronize() {}
public void execute(Runnable r, Supplier<AccessControlContext> ctxSupplier) {
synchronize();
Runnable r1 = () -> {
try {
r.run();
} catch (Throwable t) {
Log.logError(t);
}
};
if (ctxSupplier != null && System.getSecurityManager() != null) {
AccessControlContext acc = ctxSupplier.get();
if (acc == null) {
throw new InternalError();
}
AccessController.doPrivilegedWithCombiner(
(PrivilegedAction<Void>)() -> {
executor.execute(r1); // all throwables must be caught
return null;
}, acc);
} else {
executor.execute(r1); // all throwables must be caught
}
}
}

View File

@ -1,90 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.nio.ByteBuffer;
import java.util.LinkedList;
import java.util.List;
/**
* Represents one frame. May be initialized with a leftover buffer from previous
* frame. Call {@code haveFrame()} to determine if buffers contains at least one
* frame. If false, the obtain another buffer and call {@code}input(ByteBuffer)}.
* There may be additional bytes at end of the frame list.
*/
class FrameReader {
final List<ByteBuffer> buffers;
FrameReader() {
buffers = new LinkedList<>();
}
FrameReader(FrameReader that) {
this.buffers = that.buffers;
}
FrameReader(ByteBuffer remainder) {
buffers = new LinkedList<>();
if (remainder != null) {
buffers.add(remainder);
}
}
public synchronized void input(ByteBuffer buffer) {
buffers.add(buffer);
}
public synchronized boolean haveFrame() {
//buffers = Utils.superCompact(buffers, () -> ByteBuffer.allocate(Utils.BUFSIZE));
int size = 0;
for (ByteBuffer buffer : buffers) {
size += buffer.remaining();
}
if (size < 3) {
return false; // don't have length yet
}
// we at least have length field
int length = 0;
int j = 0;
ByteBuffer b = buffers.get(j);
b.mark();
for (int i=0; i<3; i++) {
while (!b.hasRemaining()) {
b.reset();
b = buffers.get(++j);
b.mark();
}
length = (length << 8) + (b.get() & 0xff);
}
b.reset();
return (size >= length + 9); // frame length
}
synchronized List<ByteBuffer> frame() {
return buffers;
}
}

View File

@ -1,105 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.io.IOException;
import java.nio.ByteBuffer;
class GoAwayFrame extends ErrorFrame {
GoAwayFrame() {
type = TYPE;
}
int lastStream;
byte[] debugData = new byte[0];
public static final int TYPE = 0x7;
// Flags
public static final int ACK = 0x1;
public void setDebugData(byte[] debugData) {
this.debugData = debugData;
}
@Override
public String toString() {
return super.toString() + " Debugdata: " + new String(debugData);
}
@Override
String flagAsString(int flag) {
switch (flag) {
case ACK:
return "ACK";
}
return super.flagAsString(flag);
}
public void setLastStream(int lastStream) {
this.lastStream = lastStream;
}
public int getLastStream() {
return this.lastStream;
}
public byte[] getDebugData() {
return debugData;
}
@Override
void readIncomingImpl(ByteBufferConsumer bc) throws IOException {
if (length < 8) {
throw new IOException("Invalid GoAway frame");
}
lastStream = bc.getInt() & 0x7fffffff;
errorCode = bc.getInt();
//debugData = bc.getBytes(8);
int datalen = length - 8;
if (datalen > 0) {
debugData = bc.getBytes(datalen);
Log.logError("GoAway debugData " + new String(debugData));
}
}
@Override
void writeOutgoing(ByteBufferGenerator bg) {
super.writeOutgoing(bg);
ByteBuffer buf = bg.getBuffer(length);
buf.putInt(lastStream);
buf.putInt(errorCode);
if (length > 8) {
buf.put(debugData);
}
}
@Override
void computeLength() {
length = 8 + debugData.length;
}
}

View File

@ -1,291 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.URI;
import java.util.concurrent.CompletableFuture;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* Encapsulates one HTTP/1.1 request/responseAsync exchange.
*/
class Http1Exchange extends ExchangeImpl {
final HttpRequestImpl request; // main request
final List<CompletableFuture<?>> operations; // used for cancel
final Http1Request requestAction;
volatile Http1Response response;
final HttpConnection connection;
final HttpClientImpl client;
final ExecutorWrapper executor;
@Override
public String toString() {
return request.toString();
}
HttpRequestImpl request() {
return request;
}
Http1Exchange(Exchange exchange, HttpConnection connection)
throws IOException
{
super(exchange);
this.request = exchange.request();
this.client = request.client();
this.executor = client.executorWrapper();
this.operations = Collections.synchronizedList(new LinkedList<>());
if (connection != null) {
this.connection = connection;
} else {
InetSocketAddress addr = Utils.getAddress(request);
this.connection = HttpConnection.getConnection(addr, request);
}
this.requestAction = new Http1Request(request, this.connection);
}
HttpConnection connection() {
return connection;
}
@Override
<T> T responseBody(HttpResponse.BodyProcessor<T> processor)
throws IOException
{
return responseBody(processor, true);
}
<T> T responseBody(HttpResponse.BodyProcessor<T> processor,
boolean return2Cache)
throws IOException
{
try {
T body = response.readBody(processor, return2Cache);
return body;
} catch (Throwable t) {
connection.close();
throw t;
}
}
@Override
<T> CompletableFuture<T> responseBodyAsync(HttpResponse.BodyProcessor<T> processor) {
CompletableFuture<T> cf = new CompletableFuture<>();
request.client()
.executorWrapper()
.execute(() -> {
try {
T body = responseBody(processor);
cf.complete(body);
} catch (Throwable e) {
cf.completeExceptionally(e);
}
},
() -> response.response.getAccessControlContext()); // TODO: fix
return cf;
}
@Override
void sendHeadersOnly() throws IOException, InterruptedException {
try {
if (!connection.connected()) {
connection.connect();
}
requestAction.sendHeadersOnly();
} catch (Throwable e) {
connection.close();
throw e;
}
}
@Override
void sendBody() throws IOException {
try {
requestAction.continueRequest();
} catch (Throwable e) {
connection.close();
throw e;
}
}
@Override
HttpResponseImpl getResponse() throws IOException {
try {
response = new Http1Response(connection, this);
response.readHeaders();
return response.response();
} catch (Throwable t) {
connection.close();
throw t;
}
}
@Override
void sendRequest() throws IOException, InterruptedException {
try {
if (!connection.connected()) {
connection.connect();
}
requestAction.sendRequest();
} catch (Throwable t) {
connection.close();
throw t;
}
}
private void closeConnection() {
connection.close();
}
@Override
CompletableFuture<Void> sendHeadersAsync() {
if (!connection.connected()) {
CompletableFuture<Void> op = connection.connectAsync()
.thenCompose(this::sendHdrsAsyncImpl)
.whenComplete((Void b, Throwable t) -> {
if (t != null)
closeConnection();
});
operations.add(op);
return op;
} else {
return sendHdrsAsyncImpl(null);
}
}
private CompletableFuture<Void> sendHdrsAsyncImpl(Void v) {
CompletableFuture<Void> cf = new CompletableFuture<>();
executor.execute(() -> {
try {
requestAction.sendHeadersOnly();
cf.complete(null);
} catch (Throwable e) {
cf.completeExceptionally(e);
connection.close();
}
},
request::getAccessControlContext);
operations.add(cf);
return cf;
}
/**
* Cancel checks to see if request and responseAsync finished already.
* If not it closes the connection and completes all pending operations
*/
@Override
synchronized void cancel() {
if (requestAction != null && requestAction.finished()
&& response != null && response.finished()) {
return;
}
connection.close();
IOException e = new IOException("Request cancelled");
int count = 0;
for (CompletableFuture<?> cf : operations) {
cf.completeExceptionally(e);
count++;
}
Log.logError("Http1Exchange.cancel: count=" + count);
}
CompletableFuture<HttpResponseImpl> getResponseAsyncImpl(Void v) {
CompletableFuture<HttpResponseImpl> cf = new CompletableFuture<>();
try {
response = new Http1Response(connection, Http1Exchange.this);
response.readHeaders();
cf.complete(response.response());
} catch (IOException e) {
cf.completeExceptionally(e);
}
return cf;
}
@Override
CompletableFuture<HttpResponseImpl> getResponseAsync(Void v) {
CompletableFuture<HttpResponseImpl> cf =
connection.whenReceivingResponse()
.thenCompose(this::getResponseAsyncImpl);
operations.add(cf);
return cf;
}
@Override
CompletableFuture<Void> sendBodyAsync() {
final CompletableFuture<Void> cf = new CompletableFuture<>();
executor.execute(() -> {
try {
requestAction.continueRequest();
cf.complete(null);
} catch (Throwable e) {
cf.completeExceptionally(e);
connection.close();
}
}, request::getAccessControlContext);
operations.add(cf);
return cf;
}
@Override
CompletableFuture<Void> sendRequestAsync() {
CompletableFuture<Void> op;
if (!connection.connected()) {
op = connection.connectAsync()
.thenCompose(this::sendRequestAsyncImpl)
.whenComplete((Void v, Throwable t) -> {
if (t != null) {
closeConnection();
}
});
} else {
op = sendRequestAsyncImpl(null);
}
operations.add(op);
return op;
}
CompletableFuture<Void> sendRequestAsyncImpl(Void v) {
CompletableFuture<Void> cf = new CompletableFuture<>();
executor.execute(() -> {
try {
requestAction.sendRequest();
cf.complete(null);
} catch (Throwable e) {
cf.completeExceptionally(e);
connection.close();
}
}, request::getAccessControlContext);
operations.add(cf);
return cf;
}
}

View File

@ -1,291 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.LongConsumer;
import static java.net.http.HttpClient.Version.HTTP_1_1;
/**
* Handles a HTTP/1.1 response in two blocking calls. readHeaders() and
* readBody(). There can be more than one of these per Http exchange.
*/
class Http1Response {
private ResponseContent content;
private final HttpRequestImpl request;
HttpResponseImpl response;
private final HttpConnection connection;
private ResponseHeaders headers;
private int responseCode;
private ByteBuffer buffer; // same buffer used for reading status line and headers
private final Http1Exchange exchange;
private final boolean redirecting; // redirecting
private boolean return2Cache; // return connection to cache when finished
Http1Response(HttpConnection conn, Http1Exchange exchange) {
this.request = exchange.request();
this.exchange = exchange;
this.connection = conn;
this.redirecting = false;
buffer = connection.getRemaining();
}
// called when the initial read should come from a buffer left
// over from a previous response.
void setBuffer(ByteBuffer buffer) {
this.buffer = buffer;
}
@SuppressWarnings("unchecked")
public void readHeaders() throws IOException {
String statusline = readStatusLine();
if (statusline == null) {
if (Log.errors()) {
Log.logError("Connection closed. Retry");
}
connection.close();
// connection was closed
throw new IOException("Connection closed");
}
if (!statusline.startsWith("HTTP/1.")) {
throw new IOException("Invalid status line: " + statusline);
}
char c = statusline.charAt(7);
responseCode = Integer.parseInt(statusline.substring(9, 12));
headers = new ResponseHeaders(connection, buffer);
headers.initHeaders();
if (Log.headers()) {
logHeaders(headers);
}
response = new HttpResponseImpl(responseCode,
exchange.exchange,
headers,
null,
connection.sslParameters(),
HTTP_1_1,
connection);
}
private boolean finished;
synchronized void completed() {
finished = true;
}
synchronized boolean finished() {
return finished;
}
// Blocking flow controller implementation. Only works when a
// thread is dedicated to reading response body
static class FlowController implements LongConsumer {
long window ;
@Override
public synchronized void accept(long value) {
window += value;
notifyAll();
}
public synchronized void request(long value) throws InterruptedException {
while (window < value) {
wait();
}
window -= value;
}
}
FlowController flowController;
int fixupContentLen(int clen) {
if (request.method().equalsIgnoreCase("HEAD")) {
return 0;
}
if (clen == -1) {
if (headers.firstValue("Transfer-encoding").orElse("")
.equalsIgnoreCase("chunked")) {
return -1;
}
return 0;
}
return clen;
}
private void returnBuffer(ByteBuffer buf) {
// not currently used, but will be when we change SSL to use fixed
// sized buffers and a single buffer pool for HttpClientImpl
}
@SuppressWarnings("unchecked")
public <T> T readBody(java.net.http.HttpResponse.BodyProcessor<T> p,
boolean return2Cache)
throws IOException
{
T body = null; // TODO: check null case below
this.return2Cache = return2Cache;
final java.net.http.HttpResponse.BodyProcessor<T> pusher = p;
int clen0 = headers.getContentLength();
final int clen = fixupContentLen(clen0);
flowController = new FlowController();
body = pusher.onResponseBodyStart(clen, headers, flowController);
ExecutorWrapper executor;
if (body == null) {
executor = ExecutorWrapper.callingThread();
} else {
executor = request.client().executorWrapper();
}
final ResponseHeaders h = headers;
if (body == null) {
content = new ResponseContent(connection,
clen,
h,
pusher,
flowController);
content.pushBody(headers.getResidue());
body = pusher.onResponseComplete();
completed();
onFinished();
return body;
} else {
executor.execute(() -> {
try {
content = new ResponseContent(connection,
clen,
h,
pusher,
flowController);
content.pushBody(headers.getResidue());
pusher.onResponseComplete();
completed();
onFinished();
} catch (Throwable e) {
pusher.onResponseError(e);
}
},
() -> response.getAccessControlContext());
}
return body;
}
private void onFinished() {
connection.buffer = content.getResidue();
if (return2Cache) {
connection.returnToCache(headers);
}
}
private void logHeaders(ResponseHeaders headers) {
Map<String, List<String>> h = headers.mapInternal();
Set<String> keys = h.keySet();
Set<Map.Entry<String, List<String>>> entries = h.entrySet();
for (Map.Entry<String, List<String>> entry : entries) {
String key = entry.getKey();
StringBuilder sb = new StringBuilder();
sb.append(key).append(": ");
List<String> values = entry.getValue();
if (values != null) {
for (String value : values) {
sb.append(value).append(' ');
}
}
Log.logHeaders(sb.toString());
}
}
HttpResponseImpl response() {
return response;
}
boolean redirecting() {
return redirecting;
}
HttpHeaders responseHeaders() {
return headers;
}
int responseCode() {
return responseCode;
}
static final char CR = '\r';
static final char LF = '\n';
private ByteBuffer getBuffer() throws IOException {
if (buffer == null || !buffer.hasRemaining()) {
buffer = connection.read();
}
return buffer;
}
ByteBuffer buffer() {
return buffer;
}
String readStatusLine() throws IOException {
boolean cr = false;
StringBuilder statusLine = new StringBuilder(128);
ByteBuffer b;
while ((b = getBuffer()) != null) {
byte[] buf = b.array();
int offset = b.position();
int len = b.limit() - offset;
for (int i = 0; i < len; i++) {
char c = (char) buf[i+offset];
if (cr) {
if (c == LF) {
b.position(i + 1 + offset);
return statusLine.toString();
} else {
throw new IOException("invalid status line");
}
}
if (c == CR) {
cr = true;
} else {
statusLine.append(c);
}
}
// unlikely, but possible, that multiple reads required
b.position(b.limit());
}
return null;
}
}

View File

@ -1,791 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.URI;
import java.net.http.HttpConnection.Mode;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import sun.net.httpclient.hpack.Encoder;
import sun.net.httpclient.hpack.Decoder;
import static java.net.http.SettingsFrame.*;
import static java.net.http.Utils.BUFSIZE;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Formatter;
import java.util.stream.Collectors;
import sun.net.httpclient.hpack.DecodingCallback;
/**
* An Http2Connection. Encapsulates the socket(channel) and any SSLEngine used
* over it. Contains an HttpConnection which hides the SocketChannel SSL stuff.
*
* Http2Connections belong to a Http2ClientImpl, (one of) which belongs
* to a HttpClientImpl.
*
* Creation cases:
* 1) upgraded HTTP/1.1 plain tcp connection
* 2) prior knowledge directly created plain tcp connection
* 3) directly created HTTP/2 SSL connection which uses ALPN.
*
* Sending is done by writing directly to underlying HttpConnection object which
* is operating in async mode. No flow control applies on output at this level
* and all writes are just executed as puts to an output Q belonging to HttpConnection
* Flow control is implemented by HTTP/2 protocol itself.
*
* Hpack header compression
* and outgoing stream creation is also done here, because these operations
* must be synchronized at the socket level. Stream objects send frames simply
* by placing them on the connection's output Queue. sendFrame() is called
* from a higher level (Stream) thread.
*
* asyncReceive(ByteBuffer) is always called from the selector thread. It assembles
* incoming Http2Frames, and directs them to the appropriate Stream.incoming()
* or handles them directly itself. This thread performs hpack decompression
* and incoming stream creation (Server push). Incoming frames destined for a
* stream are provided by calling Stream.incoming().
*/
class Http2Connection implements BufferHandler {
final Queue<Http2Frame> outputQ;
volatile boolean closed;
//-------------------------------------
final HttpConnection connection;
HttpClientImpl client;
final Http2ClientImpl client2;
Map<Integer,Stream> streams;
int nextstreamid = 3; // stream 1 is registered separately
int nextPushStream = 2;
Encoder hpackOut;
Decoder hpackIn;
SettingsFrame clientSettings, serverSettings;
ByteBufferConsumer bbc;
final LinkedList<ByteBuffer> freeList;
final String key; // for HttpClientImpl.connections map
FrameReader reader;
// Connection level flow control windows
int sendWindow = INITIAL_WINDOW_SIZE;
final static int DEFAULT_FRAME_SIZE = 16 * 1024;
private static ByteBuffer[] empty = Utils.EMPTY_BB_ARRAY;
final ExecutorWrapper executor;
/**
* This is established by the protocol spec and the peer will update it with
* WINDOW_UPDATEs, which affects the sendWindow.
*/
final static int INITIAL_WINDOW_SIZE = 64 * 1024 - 1;
// TODO: need list of control frames from other threads
// that need to be sent
/**
* Case 1) Create from upgraded HTTP/1.1 connection.
* Is ready to use. Will not be SSL. exchange is the Exchange
* that initiated the connection, whose response will be delivered
* on a Stream.
*/
Http2Connection(HttpConnection connection, Http2ClientImpl client2,
Exchange exchange) throws IOException, InterruptedException {
this.outputQ = new Queue<>();
String msg = "Connection send window size " + Integer.toString(sendWindow);
Log.logTrace(msg);
//this.initialExchange = exchange;
assert !(connection instanceof SSLConnection);
this.connection = connection;
this.client = client2.client();
this.client2 = client2;
this.executor = client.executorWrapper();
this.freeList = new LinkedList<>();
this.key = keyFor(connection);
streams = Collections.synchronizedMap(new HashMap<>());
initCommon();
//sendConnectionPreface();
Stream initialStream = createStream(exchange);
initialStream.registerStream(1);
initialStream.requestSent();
sendConnectionPreface();
connection.configureMode(Mode.ASYNC);
// start reading and writing
// start reading
AsyncConnection asyncConn = (AsyncConnection)connection;
asyncConn.setAsyncCallbacks(this::asyncReceive, this::shutdown);
asyncReceive(connection.getRemaining());
asyncConn.startReading();
}
// async style but completes immediately
static CompletableFuture<Http2Connection> createAsync(HttpConnection connection,
Http2ClientImpl client2, Exchange exchange) {
CompletableFuture<Http2Connection> cf = new CompletableFuture<>();
try {
Http2Connection c = new Http2Connection(connection, client2, exchange);
cf.complete(c);
} catch (IOException | InterruptedException e) {
cf.completeExceptionally(e);
}
return cf;
}
/**
* Cases 2) 3)
*
* request is request to be sent.
*/
Http2Connection(HttpRequestImpl request) throws IOException, InterruptedException {
InetSocketAddress proxy = request.proxy();
URI uri = request.uri();
InetSocketAddress addr = Utils.getAddress(request);
String msg = "Connection send window size " + Integer.toString(sendWindow);
Log.logTrace(msg);
this.key = keyFor(uri, proxy);
this.connection = HttpConnection.getConnection(addr, request, this);
streams = Collections.synchronizedMap(new HashMap<>());
this.client = request.client();
this.client2 = client.client2();
this.executor = client.executorWrapper();
this.freeList = new LinkedList<>();
this.outputQ = new Queue<>();
nextstreamid = 1;
initCommon();
connection.connect();
connection.configureMode(Mode.ASYNC);
// start reading
AsyncConnection asyncConn = (AsyncConnection)connection;
asyncConn.setAsyncCallbacks(this::asyncReceive, this::shutdown);
sendConnectionPreface();
asyncConn.startReading();
}
// NEW
synchronized void obtainSendWindow(int amount) throws InterruptedException {
while (amount > 0) {
int n = Math.min(amount, sendWindow);
sendWindow -= n;
amount -= n;
if (amount > 0)
wait();
}
}
synchronized void updateSendWindow(int amount) {
if (sendWindow == 0) {
sendWindow += amount;
notifyAll();
} else
sendWindow += amount;
}
synchronized int sendWindow() {
return sendWindow;
}
static String keyFor(HttpConnection connection) {
boolean isProxy = connection.isProxied();
boolean isSecure = connection.isSecure();
InetSocketAddress addr = connection.address();
return keyString(isSecure, isProxy, addr.getHostString(), addr.getPort());
}
static String keyFor(URI uri, InetSocketAddress proxy) {
boolean isSecure = uri.getScheme().equalsIgnoreCase("https");
boolean isProxy = proxy != null;
String host;
int port;
if (isProxy) {
host = proxy.getHostString();
port = proxy.getPort();
} else {
host = uri.getHost();
port = uri.getPort();
}
return keyString(isSecure, isProxy, host, port);
}
// {C,S}:{H:P}:host:port
// C indicates clear text connection "http"
// S indicates secure "https"
// H indicates host (direct) connection
// P indicates proxy
// Eg: "S:H:foo.com:80"
static String keyString(boolean secure, boolean proxy, String host, int port) {
char c1 = secure ? 'S' : 'C';
char c2 = proxy ? 'P' : 'H';
StringBuilder sb = new StringBuilder(128);
sb.append(c1).append(':').append(c2).append(':')
.append(host).append(':').append(port);
return sb.toString();
}
String key() {
return this.key;
}
void putConnection() {
client2.putConnection(this);
}
private static String toHexdump1(ByteBuffer bb) {
bb.mark();
StringBuilder sb = new StringBuilder(512);
Formatter f = new Formatter(sb);
while (bb.hasRemaining()) {
int i = Byte.toUnsignedInt(bb.get());
f.format("%02x:", i);
}
sb.deleteCharAt(sb.length()-1);
bb.reset();
return sb.toString();
}
private static String toHexdump(ByteBuffer bb) {
List<String> words = new ArrayList<>();
int i = 0;
bb.mark();
while (bb.hasRemaining()) {
if (i % 2 == 0) {
words.add("");
}
byte b = bb.get();
String hex = Integer.toHexString(256 + Byte.toUnsignedInt(b)).substring(1);
words.set(i / 2, words.get(i / 2) + hex);
i++;
}
bb.reset();
return words.stream().collect(Collectors.joining(" "));
}
private void decodeHeaders(HeaderFrame frame, DecodingCallback decoder) {
boolean endOfHeaders = frame.getFlag(HeaderFrame.END_HEADERS);
ByteBuffer[] buffers = frame.getHeaderBlock();
for (int i = 0; i < buffers.length; i++) {
hpackIn.decode(buffers[i], endOfHeaders && (i == buffers.length - 1), decoder);
}
}
int getInitialSendWindowSize() {
return serverSettings.getParameter(SettingsFrame.INITIAL_WINDOW_SIZE);
}
void close() {
GoAwayFrame f = new GoAwayFrame();
f.setDebugData("Requested by user".getBytes());
// TODO: set last stream. For now zero ok.
sendFrame(f);
}
// BufferHandler methods
@Override
public ByteBuffer getBuffer(int n) {
return client.getBuffer(n);
}
@Override
public void returnBuffer(ByteBuffer buf) {
client.returnBuffer(buf);
}
@Override
public void setMinBufferSize(int n) {
client.setMinBufferSize(n);
}
private final Object readlock = new Object();
void asyncReceive(ByteBuffer buffer) {
synchronized (readlock) {
try {
if (reader == null) {
reader = new FrameReader(buffer);
} else {
reader.input(buffer);
}
while (true) {
if (reader.haveFrame()) {
List<ByteBuffer> buffers = reader.frame();
ByteBufferConsumer bbc = new ByteBufferConsumer(buffers, this::getBuffer);
processFrame(bbc);
if (bbc.consumed()) {
reader = new FrameReader();
return;
} else {
reader = new FrameReader(reader);
}
} else
return;
}
} catch (Throwable e) {
String msg = Utils.stackTrace(e);
Log.logTrace(msg);
shutdown(e);
}
}
}
void shutdown(Throwable t) {
Log.logError(t);
closed = true;
client2.deleteConnection(this);
List<Stream> c = new LinkedList<>(streams.values());
for (Stream s : c) {
s.cancelImpl(t);
}
connection.close();
}
/**
* Handles stream 0 (common) frames that apply to whole connection and passes
* other stream specific frames to that Stream object.
*
* Invokes Stream.incoming() which is expected to process frame without
* blocking.
*/
void processFrame(ByteBufferConsumer bbc) throws IOException, InterruptedException {
Http2Frame frame = Http2Frame.readIncoming(bbc);
Log.logFrames(frame, "IN");
int streamid = frame.streamid();
if (streamid == 0) {
handleCommonFrame(frame);
} else {
Stream stream = getStream(streamid);
if (stream == null) {
// should never receive a frame with unknown stream id
resetStream(streamid, ResetFrame.PROTOCOL_ERROR);
}
if (frame instanceof PushPromiseFrame) {
PushPromiseFrame pp = (PushPromiseFrame)frame;
handlePushPromise(stream, pp);
} else if (frame instanceof HeaderFrame) {
// decode headers (or continuation)
decodeHeaders((HeaderFrame) frame, stream.rspHeadersConsumer());
stream.incoming(frame);
} else
stream.incoming(frame);
}
}
private void handlePushPromise(Stream parent, PushPromiseFrame pp)
throws IOException, InterruptedException {
HttpRequestImpl parentReq = parent.request;
int promisedStreamid = pp.getPromisedStream();
if (promisedStreamid != nextPushStream) {
resetStream(promisedStreamid, ResetFrame.PROTOCOL_ERROR);
return;
} else {
nextPushStream += 2;
}
HeaderDecoder decoder = new HeaderDecoder();
decodeHeaders(pp, decoder);
HttpHeadersImpl headers = decoder.headers();
HttpRequestImpl pushReq = HttpRequestImpl.createPushRequest(parentReq, headers);
Stream.PushedStream pushStream = createPushStream(parent, pushReq);
pushStream.registerStream(promisedStreamid);
parent.incoming_pushPromise(pushReq, pushStream);
}
private void handleCommonFrame(Http2Frame frame)
throws IOException, InterruptedException {
switch (frame.type()) {
case SettingsFrame.TYPE:
{ SettingsFrame f = (SettingsFrame)frame;
handleSettings(f);}
break;
case PingFrame.TYPE:
{ PingFrame f = (PingFrame)frame;
handlePing(f);}
break;
case GoAwayFrame.TYPE:
{ GoAwayFrame f = (GoAwayFrame)frame;
handleGoAway(f);}
break;
case WindowUpdateFrame.TYPE:
{ WindowUpdateFrame f = (WindowUpdateFrame)frame;
handleWindowUpdate(f);}
break;
default:
protocolError(ErrorFrame.PROTOCOL_ERROR);
}
}
void resetStream(int streamid, int code) throws IOException, InterruptedException {
Log.logError(
"Resetting stream {0,number,integer} with error code {1,number,integer}",
streamid, code);
ResetFrame frame = new ResetFrame();
frame.streamid(streamid);
frame.setErrorCode(code);
sendFrame(frame);
streams.remove(streamid);
}
private void handleWindowUpdate(WindowUpdateFrame f)
throws IOException, InterruptedException {
updateSendWindow(f.getUpdate());
}
private void protocolError(int errorCode)
throws IOException, InterruptedException {
GoAwayFrame frame = new GoAwayFrame();
frame.setErrorCode(errorCode);
sendFrame(frame);
String msg = "Error code: " + errorCode;
shutdown(new IOException("protocol error"));
}
private void handleSettings(SettingsFrame frame)
throws IOException, InterruptedException {
if (frame.getFlag(SettingsFrame.ACK)) {
// ignore ack frames for now.
return;
}
serverSettings = frame;
SettingsFrame ack = getAckFrame(frame.streamid());
sendFrame(ack);
}
private void handlePing(PingFrame frame)
throws IOException, InterruptedException {
frame.setFlag(PingFrame.ACK);
sendFrame(frame);
}
private void handleGoAway(GoAwayFrame frame)
throws IOException, InterruptedException {
//System.err.printf("GoAWAY: %s\n", ErrorFrame.stringForCode(frame.getErrorCode()));
shutdown(new IOException("GOAWAY received"));
}
private void initCommon() {
clientSettings = client2.getClientSettings();
// serverSettings will be updated by server
serverSettings = SettingsFrame.getDefaultSettings();
hpackOut = new Encoder(serverSettings.getParameter(HEADER_TABLE_SIZE));
hpackIn = new Decoder(clientSettings.getParameter(HEADER_TABLE_SIZE));
}
/**
* Max frame size we are allowed to send
*/
public int getMaxSendFrameSize() {
int param = serverSettings.getParameter(MAX_FRAME_SIZE);
if (param == -1) {
param = DEFAULT_FRAME_SIZE;
}
return param;
}
/**
* Max frame size we will receive
*/
public int getMaxReceiveFrameSize() {
return clientSettings.getParameter(MAX_FRAME_SIZE);
}
// Not sure how useful this is.
public int getMaxHeadersSize() {
return serverSettings.getParameter(MAX_HEADER_LIST_SIZE);
}
private static final String CLIENT_PREFACE = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n";
private static final byte[] PREFACE_BYTES =
CLIENT_PREFACE.getBytes(StandardCharsets.ISO_8859_1);
/**
* Sends Connection preface and Settings frame with current preferred
* values
*/
private void sendConnectionPreface() throws IOException {
ByteBufferGenerator bg = new ByteBufferGenerator(this);
bg.getBuffer(PREFACE_BYTES.length).put(PREFACE_BYTES);
ByteBuffer[] ba = bg.getBufferArray();
connection.write(ba, 0, ba.length);
bg = new ByteBufferGenerator(this);
SettingsFrame sf = client2.getClientSettings();
Log.logFrames(sf, "OUT");
sf.writeOutgoing(bg);
WindowUpdateFrame wup = new WindowUpdateFrame();
wup.streamid(0);
// send a Window update for the receive buffer we are using
// minus the initial 64 K specified in protocol
wup.setUpdate(client2.client().getReceiveBufferSize() - (64 * 1024 - 1));
wup.computeLength();
wup.writeOutgoing(bg);
Log.logFrames(wup, "OUT");
ba = bg.getBufferArray();
connection.write(ba, 0, ba.length);
}
/**
* Returns an existing Stream with given id, or null if doesn't exist
*/
Stream getStream(int streamid) {
return streams.get(streamid);
}
/**
* Creates Stream with given id.
*/
Stream createStream(Exchange exchange) {
Stream stream = new Stream(client, this, exchange);
return stream;
}
Stream.PushedStream createPushStream(Stream parent, HttpRequestImpl pushReq) {
Stream.PushGroup<?> pg = parent.request.pushGroup();
return new Stream.PushedStream(pg, client, this, parent, pushReq);
}
void putStream(Stream stream, int streamid) {
streams.put(streamid, stream);
}
void deleteStream(Stream stream) {
streams.remove(stream.streamid);
}
static final int MAX_STREAM = Integer.MAX_VALUE - 2;
// Number of header bytes in a Headers Frame
final static int HEADERS_HEADER_SIZE = 15;
// Number of header bytes in a Continuation frame
final static int CONTIN_HEADER_SIZE = 9;
/**
* Encode the headers into a List<ByteBuffer> and then create HEADERS
* and CONTINUATION frames from the list and return the List<Http2Frame>.
*
* @param frame
* @return
*/
private LinkedList<Http2Frame> encodeHeaders(OutgoingHeaders frame) {
LinkedList<ByteBuffer> buffers = new LinkedList<>();
ByteBuffer buf = getBuffer();
buffers.add(buf);
encodeHeadersImpl(frame.stream.getRequestPseudoHeaders(), buffers);
encodeHeadersImpl(frame.getUserHeaders(), buffers);
encodeHeadersImpl(frame.getSystemHeaders(), buffers);
for (ByteBuffer b : buffers) {
b.flip();
}
LinkedList<Http2Frame> frames = new LinkedList<>();
int maxframesize = getMaxSendFrameSize();
HeadersFrame oframe = new HeadersFrame();
oframe.setFlags(frame.getFlags());
oframe.streamid(frame.streamid());
oframe.setHeaderBlock(getBufferArray(buffers, maxframesize));
frames.add(oframe);
// Any buffers left?
boolean done = buffers.isEmpty();
if (done) {
oframe.setFlag(HeaderFrame.END_HEADERS);
} else {
ContinuationFrame cf = null;
while (!done) {
cf = new ContinuationFrame();
cf.streamid(frame.streamid());
cf.setHeaderBlock(getBufferArray(buffers, maxframesize));
frames.add(cf);
done = buffers.isEmpty();
}
cf.setFlag(HeaderFrame.END_HEADERS);
}
return frames;
}
// should always return at least one buffer
private static ByteBuffer[] getBufferArray(LinkedList<ByteBuffer> list, int maxsize) {
assert maxsize >= BUFSIZE;
LinkedList<ByteBuffer> newlist = new LinkedList<>();
int size = list.size();
int nbytes = 0;
for (int i=0; i<size; i++) {
ByteBuffer buf = list.getFirst();
if (nbytes + buf.remaining() <= maxsize) {
nbytes += buf.remaining();
newlist.add(buf);
list.remove();
} else {
break;
}
}
return newlist.toArray(empty);
}
/**
* Encode all the headers from the given HttpHeadersImpl into the given List.
*/
private void encodeHeadersImpl(HttpHeaders hdrs, LinkedList<ByteBuffer> buffers) {
ByteBuffer buffer;
if (!(buffer = buffers.getLast()).hasRemaining()) {
buffer = getBuffer();
buffers.add(buffer);
}
for (Map.Entry<String, List<String>> e : hdrs.map().entrySet()) {
String key = e.getKey();
String lkey = key.toLowerCase();
List<String> values = e.getValue();
for (String value : values) {
hpackOut.header(lkey, value);
boolean encoded = false;
do {
encoded = hpackOut.encode(buffer);
if (!encoded) {
buffer = getBuffer();
buffers.add(buffer);
}
} while (!encoded);
}
}
}
public void sendFrames(List<Http2Frame> frames) throws IOException, InterruptedException {
for (Http2Frame frame : frames) {
sendFrame(frame);
}
}
static Throwable getExceptionFrom(CompletableFuture<?> cf) {
try {
cf.get();
return null;
} catch (Throwable e) {
if (e.getCause() != null)
return e.getCause();
else
return e;
}
}
void execute(Runnable r) {
executor.execute(r, null);
}
private final Object sendlock = new Object();
/**
*
*/
void sendFrame(Http2Frame frame) {
synchronized (sendlock) {
try {
if (frame instanceof OutgoingHeaders) {
OutgoingHeaders oh = (OutgoingHeaders) frame;
Stream stream = oh.getStream();
stream.registerStream(nextstreamid);
oh.streamid(nextstreamid);
nextstreamid += 2;
// set outgoing window here. This allows thread sending
// body to proceed.
stream.updateOutgoingWindow(getInitialSendWindowSize());
LinkedList<Http2Frame> frames = encodeHeaders(oh);
for (Http2Frame f : frames) {
sendOneFrame(f);
}
} else {
sendOneFrame(frame);
}
} catch (IOException e) {
if (!closed) {
Log.logError(e);
shutdown(e);
}
}
}
}
/**
* Send a frame.
*
* @param frame
* @throws IOException
*/
private void sendOneFrame(Http2Frame frame) throws IOException {
ByteBufferGenerator bbg = new ByteBufferGenerator(this);
frame.computeLength();
Log.logFrames(frame, "OUT");
frame.writeOutgoing(bbg);
ByteBuffer[] currentBufs = bbg.getBufferArray();
connection.write(currentBufs, 0, currentBufs.length);
}
private SettingsFrame getAckFrame(int streamid) {
SettingsFrame frame = new SettingsFrame();
frame.setFlag(SettingsFrame.ACK);
frame.streamid(streamid);
return frame;
}
static class HeaderDecoder implements DecodingCallback {
HttpHeadersImpl headers;
HeaderDecoder() {
this.headers = new HttpHeadersImpl();
}
@Override
public void onDecoded(CharSequence name, CharSequence value) {
headers.addHeader(name.toString(), value.toString());
}
HttpHeadersImpl headers() {
return headers;
}
}
}

View File

@ -1,104 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.net.*;
interface HttpRedirectImpl {
static HttpRedirectImpl getRedirects(java.net.http.HttpClient.Redirect redir) {
switch (redir) {
case NEVER:
return HttpRedirectImpl.NEVER;
case ALWAYS:
return HttpRedirectImpl.ALWAYS;
case SECURE:
return HttpRedirectImpl.SECURE;
case SAME_PROTOCOL:
return HttpRedirectImpl.SAME_PROTOCOL;
}
return HttpRedirectImpl.NEVER;
}
static HttpClient.Redirect getRedirects(HttpRedirectImpl redir) {
if (redir == HttpRedirectImpl.NEVER) {
return HttpClient.Redirect.NEVER;
} else if (redir == HttpRedirectImpl.ALWAYS) {
return HttpClient.Redirect.ALWAYS;
} else if (redir == HttpRedirectImpl.SECURE) {
return HttpClient.Redirect.SECURE;
} else {
return HttpClient.Redirect.SAME_PROTOCOL;
}
}
/**
* Called to determine whether the given intermediate response
* with a redirection response code should be redirected. The target URI
* can be obtained from the "Location" header in the given response object.
*
* @param rsp the response from the redirected resource
* @return {@code true} if the redirect should be attempted automatically
* or {@code false} if not.
*/
boolean redirect(HttpResponse rsp);
/**
* Never redirect.
*/
static HttpRedirectImpl NEVER = (HttpResponse rsp) -> false;
/**
* Always redirect.
*/
static HttpRedirectImpl ALWAYS = (HttpResponse rsp) -> true;
/**
* Redirect to same protocol only. Redirection may occur from HTTP URLs to
* other THHP URLs and from HTTPS URLs to other HTTPS URLs.
*/
static HttpRedirectImpl SAME_PROTOCOL = (HttpResponse rsp) -> {
String orig = rsp.request().uri().getScheme().toLowerCase();
String redirect = URI.create(
rsp.headers().firstValue("Location").orElse(""))
.getScheme().toLowerCase();
return orig.equals(redirect);
};
/**
* Redirect always except from HTTPS URLs to HTTP URLs.
*/
static HttpRedirectImpl SECURE = (HttpResponse rsp) -> {
String orig = rsp.request().uri().getScheme().toLowerCase();
String redirect = URI.create(
rsp.headers().firstValue("Location").orElse(""))
.getScheme().toLowerCase();
if (orig.equals("https")) {
return redirect.equals("https");
}
return true;
};
}

View File

@ -1,871 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.net.URI;
import java.net.ProxySelector;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.charset.*;
import java.nio.file.Path;
import java.util.Iterator;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.function.LongConsumer;
/**
* Represents one HTTP request which can be sent to a server. {@code
* HttpRequest}s are built from {@code HttpRequest} {@link HttpRequest.Builder
* builder}s. {@code HttpRequest} builders are obtained from a {@link HttpClient}
* by calling {@link HttpClient#request(java.net.URI) HttpClient.request}, or
* by calling {@link #create(java.net.URI) HttpRequest.create} which returns a
* builder on the <a href="HttpClient.html#defaultclient">default</a> client.
* A request's {@link java.net.URI}, headers and body can be set. Request bodies
* are provided through a {@link BodyProcessor} object. Once all required
* parameters have been set in the builder, one of the builder methods should be
* called, which sets the request method and returns a {@code HttpRequest}.
* These methods are {@link Builder#GET() GET}, {@link HttpRequest.Builder#POST()
* POST} and {@link HttpRequest.Builder#PUT() PUT} which return a GET, POST or
* PUT request respectively. Alternatively, {@link
* HttpRequest.Builder#method(String) method} can be called to set an arbitrary
* method type (and return a {@code HttpRequest}). Builders can also be copied
* and modified multiple times in order to build multiple related requests that
* differ in some parameters.
*
* <p> Two simple, example HTTP interactions are shown below:
* <pre>
* {@code
* // GET
* HttpResponse response = HttpRequest
* .create(new URI("http://www.foo.com"))
* .headers("Foo", "foovalue", "Bar", "barvalue")
* .GET()
* .response();
*
* int statusCode = response.statusCode();
* String responseBody = response.body(asString());
*
* // POST
* response = HttpRequest
* .create(new URI("http://www.foo.com"))
* .body(fromString("param1=foo,param2=bar"))
* .POST()
* .response();}
* </pre>
*
* <p> The request is sent and the response obtained by calling one of the
* following methods.
* <ul><li>{@link #response() response} blocks until the entire request has been
* sent and the response status code and headers have been received.</li>
* <li>{@link #responseAsync() responseAsync} sends the request and receives the
* response asynchronously. Returns immediately with a
* {@link java.util.concurrent.CompletableFuture CompletableFuture}&lt;{@link
* HttpResponse}&gt;.</li>
* <li>{@link #multiResponseAsync(HttpResponse.MultiProcessor) multiResponseAsync}
* sends the request asynchronously, expecting multiple responses. This
* capability is of most relevance to HTTP/2 server push, but can be used for
* single responses (HTTP/1.1 or HTTP/2) also.</li>
* </ul>
*
* <p> Once a request has been sent, it is an error to try and send it again.
*
* <p> Once a {@code HttpResponse} is received, the headers and response code are
* available. The body can then be received by calling one of the body methods
* on {@code HttpResponse}.
*
* <p> See below for discussion of synchronous versus asynchronous usage.
*
* <p> <b>Request bodies</b>
*
* <p> Request bodies are sent using one of the request processor implementations
* below provided in {@code HttpRequest}, or else a custom implementation can be
* used.
* <ul>
* <li>{@link #fromByteArray(byte[]) } from byte array</li>
* <li>{@link #fromByteArrays(java.util.Iterator) fromByteArrays(Iterator)}
* from an iterator of byte arrays</li>
* <li>{@link #fromFile(java.nio.file.Path) fromFile(Path)} from the file located
* at the given Path</li>
* <li>{@link #fromString(java.lang.String) fromString(String)} from a String </li>
* <li>{@link #fromInputStream(java.io.InputStream) fromInputStream(InputStream)}
* request body from InputStream</li>
* <li>{@link #noBody() } no request body is sent</li>
* </ul>
*
* <p> <b>Response bodies</b>
*
* <p> Responses bodies are handled by the {@link HttpResponse.BodyProcessor}
* {@code <T>} supplied to the {@link HttpResponse#body(HttpResponse.BodyProcessor)
* HttpResponse.body} and {@link HttpResponse#bodyAsync(HttpResponse.BodyProcessor)
* HttpResponse.bodyAsync} methods. Some implementations of {@code
* HttpResponse.BodyProcessor} are provided in {@link HttpResponse}:
* <ul>
* <li>{@link HttpResponse#asByteArray() } stores the body in a byte array</li>
* <li>{@link HttpResponse#asString()} stores the body as a String </li>
* <li>{@link HttpResponse#asFile(java.nio.file.Path) } stores the body in a
* named file</li>
* <li>{@link HttpResponse#ignoreBody() } ignores any received response body</li>
* </ul>
*
* <p> The output of a response processor is the response body, and its
* parameterized type {@code T} determines the type of the body object returned
* from {@code HttpResponse.body} and {@code HttpResponse.bodyAsync}. Therefore,
* as an example, the second response processor in the list above has the type
* {@code HttpResponse.BodyProcessor<String>} which means the type returned by
* {@code HttpResponse.body()} is a String. Response processors can be defined
* to return potentially any type as body.
*
* <p> <b>Multi responses</b>
*
* <p> With HTTP/2 it is possible for a server to return a main response and zero
* or more additional responses (known as server pushes) to a client-initiated
* request. These are handled using a special response processor called {@link
* HttpResponse.MultiProcessor}.
*
* <p> <b>Blocking/asynchronous behavior and thread usage</b>
*
* <p> There are two styles of request sending: <i>synchronous</i> and
* <i>asynchronous</i>. {@link #response() response} blocks the calling thread
* until the request has been sent and the response received.
*
* <p> {@link #responseAsync() responseAsync} is asynchronous and returns
* immediately with a {@link java.util.concurrent.CompletableFuture}&lt;{@link
* HttpResponse}&gt; and when this object completes (in a background thread) the
* response has been received.
*
* <p> {@link #multiResponseAsync(HttpResponse.MultiProcessor) multiResponseAsync}
* is the variant for multi responses and is also asynchronous.
*
* <p> CompletableFutures can be combined in different ways to declare the
* dependencies among several asynchronous tasks, while allowing for the maximum
* level of parallelism to be utilized.
*
* <p> <b>Security checks</b>
*
* <p> If a security manager is present then security checks are performed by
* the {@link #response() } and {@link #responseAsync() } methods. A {@link
* java.net.URLPermission} or {@link java.net.SocketPermission} is required to
* access any destination origin server and proxy server utilised. URLPermissions
* should be preferred in policy files over SocketPermissions given the more
* limited scope of URLPermission. Permission is always implicitly granted to a
* system's default proxies. The URLPermission form used to access proxies uses
* a method parameter of "CONNECT" (for all kinds of proxying) and a url string
* of the form "socket://host:port" where host and port specify the proxy's
* address.
*
* <p> <b>Examples</b>
* <pre>
* import static java.net.http.HttpRequest.*;
* import static java.net.http.HttpResponse.*;
*
* //Simple blocking
*
* HttpResponse r1 = HttpRequest.create(new URI("http://www.foo.com/"))
* .GET()
* .response();
* int responseCode = r1.statusCode());
* String body = r1.body(asString());
*
* HttpResponse r2 = HttpRequest.create(new URI("http://www.foo.com/"))
* .GET()
* .response();
*
* System.out.println("Response was " + r1.statusCode());
* Path body1 = r2.body(asFile(Paths.get("/tmp/response.txt")));
* // Content stored in /tmp/response.txt
*
* HttpResponse r3 = HttpRequest.create(new URI("http://www.foo.com/"))
* .body(fromString("param1=1, param2=2"))
* .POST()
* .response();
*
* Void body2 = r3.body(ignoreBody()); // body is Void in this case
* </pre>
*
* <p><b>Asynchronous Example</b>
*
* <p> All of the above examples will work asynchronously, if {@link
* #responseAsync()} is used instead of {@link #response()} in which case the
* returned object is a {@code CompletableFuture<HttpResponse>} instead of
* {@code HttpResponse}. The following example shows how multiple requests can
* be sent asynchronously. It also shows how dependent asynchronous operations
* (receiving response, and receiving response body) can be chained easily using
* one of the many methods in {@code CompletableFuture}.
* <pre>
* {@code
* // fetch a list of target URIs asynchronously and store them in Files.
*
* List<URI> targets = ...
*
* List<CompletableFuture<File>> futures = targets
* .stream()
* .map(target -> {
* return HttpRequest
* .create(target)
* .GET()
* .responseAsync()
* .thenCompose(response -> {
* Path dest = Paths.get("base", target.getPath());
* if (response.statusCode() == 200) {
* return response.bodyAsync(asFile(dest));
* } else {
* return CompletableFuture.completedFuture(dest);
* }
* })
* // convert Path -> File
* .thenApply((Path dest) -> {
* return dest.toFile();
* });
* })
* .collect(Collectors.toList());
*
* // all async operations waited for here
*
* CompletableFuture.allOf(futures.toArray(new CompletableFuture<?>[0]))
* .join();
*
* // all elements of futures have completed and can be examined.
* // Use File.exists() to check whether file was successfully downloaded
* }
* </pre>
*
* @since 9
*/
public abstract class HttpRequest {
HttpRequest() {}
/**
* A builder of {@link HttpRequest}s. {@code HttpRequest.Builder}s are
* created by calling {@link HttpRequest#create(URI)} or {@link
* HttpClient#request(URI)}.
*
* <p> Each of the setter methods in this class modifies the state of the
* builder and returns <i>this</i> (ie. the same instance). The methods are
* not synchronized and should not be called from multiple threads without
* external synchronization.
*
* <p> The build methods return a new {@code HttpRequest} each time they are
* called.
*
* @since 9
*/
public abstract static class Builder {
Builder() {}
/**
* Sets this HttpRequest's request URI.
*
* @param uri the request URI
* @return this request builder
*/
public abstract Builder uri(URI uri);
/**
* Specifies whether this request will automatically follow redirects
* issued by the server. The default value for this setting is the value
* of {@link HttpClient#followRedirects() }
*
* @param policy the redirection policy
* @return this request builder
*/
public abstract Builder followRedirects(HttpClient.Redirect policy);
/**
* Request server to acknowledge request before sending request
* body. This is disabled by default. If enabled, the server is requested
* to send an error response or a 100-Continue response before the client
* sends the request body. This means the request processor for the
* request will not be invoked until this interim response is received.
*
* @param enable {@code true} if Expect continue to be sent
* @return this request builder
*/
public abstract Builder expectContinue(boolean enable);
/**
* Overrides the {@link HttpClient#version() } setting for this
* request.
*
* @param version the HTTP protocol version requested
* @return this request builder
*/
public abstract Builder version(HttpClient.Version version);
/**
* Adds the given name value pair to the set of headers for this request.
*
* @param name the header name
* @param value the header value
* @return this request builder
*/
public abstract Builder header(String name, String value);
/**
* Overrides the ProxySelector set on the request's client for this
* request.
*
* @param proxy the ProxySelector to use
* @return this request builder
*/
public abstract Builder proxy(ProxySelector proxy);
/**
* Adds the given name value pairs to the set of headers for this
* request. The supplied Strings must alternate as names and values.
*
* @param headers the list of String name value pairs
* @return this request builder
* @throws IllegalArgumentException if there is an odd number of
* parameters
*/
public abstract Builder headers(String... headers);
/**
* Sets a timeout for this request. If the response is not received
* within the specified timeout then a {@link HttpTimeoutException} is
* thrown from {@link #response() } or {@link #responseAsync() }
* completes exceptionally with a {@code HttpTimeoutException}.
*
* @param unit the timeout units
* @param timeval the number of units to wait for
* @return this request builder
*/
public abstract Builder timeout(TimeUnit unit, long timeval);
/**
* Sets the given name value pair to the set of headers for this
* request. This overwrites any previously set values for name.
*
* @param name the header name
* @param value the header value
* @return this request builder
*/
public abstract Builder setHeader(String name, String value);
/**
* Sets a request body for this builder. See {@link HttpRequest}
* for example {@code BodyProcessor} implementations.
* If no body is specified, then no body is sent with the request.
*
* @param reqproc the request body processor
* @return this request builder
*/
public abstract Builder body(BodyProcessor reqproc);
/**
* Builds and returns a GET {@link HttpRequest} from this builder.
*
* @return a {@code HttpRequest}
*/
public abstract HttpRequest GET();
/**
* Builds and returns a POST {@link HttpRequest} from this builder.
*
* @return a {@code HttpRequest}
*/
public abstract HttpRequest POST();
/**
* Builds and returns a PUT {@link HttpRequest} from this builder.
*
* @return a {@code HttpRequest}
*/
public abstract HttpRequest PUT();
/**
* Builds and returns a {@link HttpRequest} from this builder using
* the given method String. The method string is case-sensitive, and
* may be rejected if an upper-case string is not used.
*
* @param method the method to use
* @return a {@code HttpRequest}
* @throws IllegalArgumentException if an unrecognised method is used
*/
public abstract HttpRequest method(String method);
/**
* Returns an exact duplicate copy of this Builder based on current
* state. The new builder can then be modified independently of this
* builder.
*
* @return an exact copy of this Builder
*/
public abstract Builder copy();
}
/**
* Creates a HttpRequest builder from the <i>default</i> HttpClient.
*
* @param uri the request URI
* @return a new request builder
*/
public static HttpRequest.Builder create(URI uri) {
return HttpClient.getDefault().request(uri);
}
/**
* Returns the follow-redirects setting for this request.
*
* @return follow redirects setting
*/
public abstract HttpClient.Redirect followRedirects();
/**
* Returns the response to this request, by sending it and blocking if
* necessary to get the response. The {@link HttpResponse} contains the
* response status and headers.
*
* @return a HttpResponse for this request
* @throws IOException if an I/O error occurs
* @throws InterruptedException if the operation was interrupted
* @throws SecurityException if the caller does not have the required
* permission
* @throws IllegalStateException if called more than once or if
* responseAsync() called previously
*/
public abstract HttpResponse response()
throws IOException, InterruptedException;
/**
* Sends the request and returns the response asynchronously. This method
* returns immediately with a {@link CompletableFuture}&lt;{@link
* HttpResponse}&gt;
*
* @return a {@code CompletableFuture<HttpResponse>}
* @throws IllegalStateException if called more than once or if response()
* called previously.
*/
public abstract CompletableFuture<HttpResponse> responseAsync();
/**
* Sends the request asynchronously expecting multiple responses.
*
* <p> This method must be given a {@link HttpResponse.MultiProcessor} to
* handle the multiple responses.
*
* <p> If a security manager is set, the caller must possess a {@link
* java.net.URLPermission} for the request's URI, method and any user set
* headers. The security manager is also checked for each incoming
* additional server generated request/response. Any request that fails the
* security check, is canceled and ignored.
*
* <p> This method can be used for both HTTP/1.1 and HTTP/2, but in cases
* where multiple responses are not supported, the MultiProcessor
* only receives the main response.
*
* <p> The aggregate {@code CompletableFuture} returned from this method
* returns a {@code <U>} defined by the {@link HttpResponse.MultiProcessor}
* implementation supplied. This will typically be a Collection of
* HttpResponses or of some response body type.
*
* @param <U> the aggregate response type
* @param rspproc the MultiProcessor for the request
* @return a {@code CompletableFuture<U>}
* @throws IllegalStateException if the request has already been sent.
*/
public abstract <U> CompletableFuture<U>
multiResponseAsync(HttpResponse.MultiProcessor<U> rspproc);
/**
* Returns the request method for this request. If not set explicitly,
* the default method for any request is "GET".
*
* @return this request's method
*/
public abstract String method();
/**
* Returns this request's {@link HttpRequest.Builder#expectContinue(boolean)
* expect continue } setting.
*
* @return this request's expect continue setting
*/
public abstract boolean expectContinue();
/**
* Returns this request's request URI.
*
* @return this request's URI
*/
public abstract URI uri();
/**
* Returns this request's {@link HttpClient}.
*
* @return this request's HttpClient
*/
public abstract HttpClient client();
/**
* Returns the HTTP protocol version that this request will use or used.
*
* @return HTTP protocol version
*/
public abstract HttpClient.Version version();
/**
* The (user-accessible) request headers that this request was (or will be)
* sent with.
*
* @return this request's HttpHeaders
*/
public abstract HttpHeaders headers();
/**
* Returns a request processor whose body is the given String, converted
* using the {@link java.nio.charset.StandardCharsets#ISO_8859_1 ISO_8859_1}
* character set.
*
* @param body the String containing the body
* @return a BodyProcessor
*/
public static BodyProcessor fromString(String body) {
return fromString(body, StandardCharsets.ISO_8859_1);
}
/**
* A request processor that takes data from the contents of a File.
*
* @param path the path to the file containing the body
* @return a BodyProcessor
*/
public static BodyProcessor fromFile(Path path) {
FileChannel fc;
long size;
try {
fc = FileChannel.open(path);
size = fc.size();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
return new BodyProcessor() {
LongConsumer flow;
@Override
public long onRequestStart(HttpRequest hr, LongConsumer flow) {
// could return exact file length, but for now -1
this.flow = flow;
flow.accept(1);
if (size != 0) {
return size;
} else {
return -1;
}
}
@Override
public boolean onRequestBodyChunk(ByteBuffer buffer) throws IOException {
int n = fc.read(buffer);
if (n == -1) {
fc.close();
return true;
}
flow.accept(1);
return false;
}
@Override
public void onRequestError(Throwable t) {
try {
fc.close();
} catch (IOException ex) {
Log.logError(ex.toString());
}
}
};
}
/**
* Returns a request processor whose body is the given String, converted
* using the given character set.
*
* @param s the String containing the body
* @param charset the character set to convert the string to bytes
* @return a BodyProcessor
*/
public static BodyProcessor fromString(String s, Charset charset) {
return fromByteArray(s.getBytes(charset));
}
/**
* Returns a request processor whose body is the given byte array.
*
* @param buf the byte array containing the body
* @return a BodyProcessor
*/
public static BodyProcessor fromByteArray(byte[] buf) {
return fromByteArray(buf, 0, buf.length);
}
/**
* Returns a request processor whose body is the content of the given byte
* array length bytes starting from the specified offset.
*
* @param buf the byte array containing the body
* @param offset the offset of the first byte
* @param length the number of bytes to use
* @return a BodyProcessor
*/
public static BodyProcessor fromByteArray(byte[] buf, int offset, int length) {
return new BodyProcessor() {
LongConsumer flow;
byte[] barray;
int index;
int sent;
@Override
public long onRequestStart(HttpRequest hr, LongConsumer flow) {
this.flow = flow;
flow.accept(1);
barray = buf;
index = offset;
return length;
}
@Override
public boolean onRequestBodyChunk(ByteBuffer buffer)
throws IOException
{
if (sent == length) {
return true;
}
int remaining = buffer.remaining();
int left = length - sent;
int n = remaining > left ? left : remaining;
buffer.put(barray, index, n);
index += n;
sent += n;
flow.accept(1);
return sent == length;
}
@Override
public void onRequestError(Throwable t) {
Log.logError(t.toString());
}
};
}
/**
* A request processor that takes data from an Iterator of byte arrays.
*
* @param iter an Iterator of byte arrays
* @return a BodyProcessor
*/
public static BodyProcessor fromByteArrays(Iterator<byte[]> iter) {
return new BodyProcessor() {
LongConsumer flow;
byte[] current;
int curIndex;
@Override
public long onRequestStart(HttpRequest hr, LongConsumer flow) {
this.flow = flow;
flow.accept(1);
return -1;
}
@Override
public boolean onRequestBodyChunk(ByteBuffer buffer)
throws IOException
{
int remaining;
while ((remaining = buffer.remaining()) > 0) {
if (current == null) {
if (!iter.hasNext()) {
return true;
}
current = iter.next();
curIndex = 0;
}
int n = Math.min(remaining, current.length - curIndex);
buffer.put(current, curIndex, n);
curIndex += n;
if (curIndex == current.length) {
current = null;
flow.accept(1);
return false;
}
}
flow.accept(1);
return false;
}
@Override
public void onRequestError(Throwable t) {
Log.logError(t.toString());
}
};
}
/**
* A request processor that reads its data from an InputStream.
*
* @param stream an InputStream
* @return a BodyProcessor
*/
public static BodyProcessor fromInputStream(InputStream stream) {
// for now, this blocks. It could be offloaded to a separate thread
// to do reading and guarantee that onRequestBodyChunk() won't block
return new BodyProcessor() {
LongConsumer flow;
@Override
public long onRequestStart(HttpRequest hr, LongConsumer flow) {
this.flow = flow;
flow.accept(1);
return -1;
}
@Override
public boolean onRequestBodyChunk(ByteBuffer buffer)
throws IOException
{
int remaining = buffer.remaining();
int n = stream.read(buffer.array(), buffer.arrayOffset(), remaining);
if (n == -1) {
stream.close();
return true;
}
buffer.position(buffer.position() + n);
flow.accept(1);
return false;
}
@Override
public void onRequestError(Throwable t) {
Log.logError(t.toString());
}
};
}
/**
* A request processor which sends no request body.
*
* @return a BodyProcessor
*/
public static BodyProcessor noBody() {
return new BodyProcessor() {
@Override
public long onRequestStart(HttpRequest hr, LongConsumer flow) {
return 0;
}
@Override
public boolean onRequestBodyChunk(ByteBuffer buffer)
throws IOException
{
throw new InternalError("should never reach here");
}
@Override
public void onRequestError(Throwable t) {
Log.logError(t.toString());
}
};
}
/**
* A request processor which obtains the request body from some source.
* Implementations of this interface are provided which allow request bodies
* to be supplied from standard types, such as {@code String, byte[], File,
* InputStream}. Other implementations can be provided.
*
* <p> The methods of this interface may be called from multiple threads,
* but only one method is invoked at a time, and behaves as if called from
* one thread.
*
* <p> See {@link HttpRequest} for implementations that take request bodies
* from {@code byte arrays, Strings, Paths} etc.
*
* @since 9
*/
public interface BodyProcessor {
/**
* Called before a request is sent. Is expected to return the content
* length of the request body. Zero means no content. Less than zero
* means an unknown positive content-length, and the body will be
* streamed.
*
* <p> The flowController object must be used to manage the flow of
* calls to {@link #onRequestBodyChunk(ByteBuffer)}. The typical usage
* for a non-blocking processor is to call it once inside
* onRequestStart() and once during each call to onRequestBodyChunk().
*
* @param hr the request
* @param flowController the HttpFlowController
* @return the content length
* @throws IOException if an I/O error occurs
*/
long onRequestStart(HttpRequest hr, LongConsumer flowController)
throws IOException;
/**
* Called if sending a request body fails.
*
* @implSpec The default implementation does nothing.
*
* @param t the Throwable that caused the failure
*/
default void onRequestError(Throwable t) { }
/**
* Called to obtain a buffer of data to send. The data must be placed
* in the provided buffer. The implementation should not block. The
* boolean return code notifies the protocol implementation if the
* supplied buffer is the final one (or not).
*
* @param buffer a ByteBuffer to write data into
* @return whether or not this is the last buffer
* @throws IOException if an I/O error occurs
*/
boolean onRequestBodyChunk(ByteBuffer buffer) throws IOException;
/**
* Called when the request body has been completely sent.
*
* @implSpec The default implementation does nothing
*/
default void onComplete() {
// TODO: need to call this
}
}
}

View File

@ -1,985 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.OpenOption;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.LongConsumer;
import javax.net.ssl.SSLParameters;
/**
* Represents a response to a {@link HttpRequest}. A {@code HttpResponse} is
* available when the response status code and headers have been received, but
* before the response body is received.
*
* <p> Methods are provided in this class for accessing the response headers,
* and status code immediately and also methods for retrieving the response body.
* Static methods are provided which implement {@link BodyProcessor} for
* standard body types such as {@code String, byte arrays, files}.
*
* <p> The {@link #body(BodyProcessor) body} or {@link #bodyAsync(BodyProcessor)
* bodyAsync} which retrieve any response body must be called to ensure that the
* TCP connection can be re-used subsequently, and any response trailers
* accessed, if they exist, unless it is known that no response body was received.
*
* @since 9
*/
public abstract class HttpResponse {
HttpResponse() { }
/**
* Returns the status code for this response.
*
* @return the response code
*/
public abstract int statusCode();
/**
* Returns the {@link HttpRequest} for this response.
*
* @return the request
*/
public abstract HttpRequest request();
/**
* Returns the received response headers.
*
* @return the response headers
*/
public abstract HttpHeaders headers();
/**
* Returns the received response trailers, if there are any. This must only
* be called after the response body has been received.
*
* @return the response trailers (may be empty)
* @throws IllegalStateException if the response body has not been received
* yet
*/
public abstract HttpHeaders trailers();
/**
* Returns the body, blocking if necessary. The type T is determined by the
* {@link BodyProcessor} implementation supplied. The body object will be
* returned immediately if it is a type (such as {@link java.io.InputStream}
* which reads the data itself. If the body object represents the fully read
* body then it blocks until it is fully read.
*
* @param <T> the type of the returned body object
* @param processor the processor to handle the response body
* @return the body
* @throws java.io.UncheckedIOException if an I/O error occurs reading the
* response
*/
public abstract <T> T body(BodyProcessor<T> processor);
/**
* Returns a {@link java.util.concurrent.CompletableFuture} of type T. This
* always returns immediately and the future completes when the body object
* is available. The body will be available immediately if it is a type
* (such as {@link java.io.InputStream} which reads the data itself. If the
* body object represents the fully read body then it will not be available
* until it is fully read.
*
* @param <T> the type of the returned body object
* @param processor the processor to handle the response body
* @return a CompletableFuture
*/
public abstract <T> CompletableFuture<T> bodyAsync(BodyProcessor<T> processor);
/**
* Returns the {@link javax.net.ssl.SSLParameters} in effect for this
* response. Returns {@code null} if this is not a https response.
*
* @return the SSLParameters associated with the response
*/
public abstract SSLParameters sslParameters();
/**
* Returns the URI that the response was received from. This may be
* different from the request URI if redirection occurred.
*
* @return the URI of the response
*/
public abstract URI uri();
/**
* Returns the HTTP protocol version that was used for this response.
*
* @return HTTP protocol version
*/
public abstract HttpClient.Version version();
/**
* Returns a {@link BodyProcessor}&lt;{@link java.nio.file.Path}&gt; where
* the file is created if it does not already exist. When the Path object is
* returned, the body has been completely written to the file.
*
* @param file the file to store the body in
* @return a {@code BodyProcessor}
*/
public static BodyProcessor<Path> asFile(Path file) {
return asFile(file, StandardOpenOption.CREATE, StandardOpenOption.WRITE);
}
/**
* Returns a {@link BodyProcessor}&lt;{@link java.nio.file.Path}&gt; where
* the download directory is specified, but the filename is obtained from
* the Content-Disposition response header. The Content-Disposition header
* must specify the <i>attachment</i> type and must also contain a
* <i>filename</i> parameter. If the filename specifies multiple path
* components only the final component is used as the filename (with the
* given directory name). When the Path object is returned, the body has
* been completely written to the file. The returned Path is the combination
* of the supplied directory name and the file name supplied by the server.
* If the destination directory does not exist or cannot be written to, then
* the response will fail with an IOException.
*
* @param directory the directory to store the file in
* @param openOptions open options
* @return a {@code BodyProcessor}
*/
public static BodyProcessor<Path> asFileDownload(Path directory,
OpenOption... openOptions) {
return new AbstractResponseProcessor<Path>() {
FileChannel fc;
Path file;
@Override
public Path onResponseBodyStartImpl(long contentLength,
HttpHeaders headers)
throws IOException
{
String dispoHeader = headers.firstValue("Content-Disposition")
.orElseThrow(() -> new IOException("No Content-Disposition"));
if (!dispoHeader.startsWith("attachment;")) {
throw new IOException("Unknown Content-Disposition type");
}
int n = dispoHeader.indexOf("filename=");
if (n == -1) {
throw new IOException("Bad Content-Disposition type");
}
int lastsemi = dispoHeader.lastIndexOf(';');
String disposition;
if (lastsemi < n)
disposition = dispoHeader.substring(n + 9);
else
disposition = dispoHeader.substring(n + 9, lastsemi);
file = Paths.get(directory.toString(), disposition);
fc = FileChannel.open(file, openOptions);
return null;
}
@Override
public void onResponseBodyChunkImpl(ByteBuffer b) throws IOException {
fc.write(b);
}
@Override
public Path onResponseComplete() throws IOException {
fc.close();
return file;
}
@Override
public void onResponseError(Throwable t) {
try {
if (fc != null) {
fc.close();
}
} catch (IOException e) {
}
}
};
}
/**
* Returns a {@link BodyProcessor}&lt;{@link java.nio.file.Path}&gt;.
*
* <p> {@link HttpResponse}s returned using this response processor complete
* after the entire response, including body has been read.
*
* @param file the filename to store the body in
* @param openOptions any options to use when opening/creating the file
* @return a {@code BodyProcessor}
*/
public static BodyProcessor<Path> asFile(Path file,
OpenOption... openOptions) {
return new AbstractResponseProcessor<Path>() {
FileChannel fc;
@Override
public Path onResponseBodyStartImpl(long contentLength,
HttpHeaders headers)
throws IOException
{
fc = FileChannel.open(file, openOptions);
return null;
}
@Override
public void onResponseBodyChunkImpl(ByteBuffer b)
throws IOException
{
fc.write(b);
}
@Override
public Path onResponseComplete() throws IOException {
fc.close();
return file;
}
@Override
public void onResponseError(Throwable t) {
try {
if (fc != null) {
fc.close();
}
} catch (IOException e) {
}
}
};
}
static class ByteArrayResponseProcessor {
static final int INITIAL_BUFLEN = 1024;
byte[] buffer;
int capacity;
boolean knownLength;
int position;
ByteArrayResponseProcessor() { }
public byte[] onStart(long contentLength) throws IOException {
if (contentLength > Integer.MAX_VALUE) {
throw new IllegalArgumentException(
"byte array response limited to MAX_INT size");
}
capacity = (int) contentLength;
if (capacity != -1) {
buffer = new byte[capacity];
knownLength = true;
} else {
buffer = new byte[INITIAL_BUFLEN];
capacity = INITIAL_BUFLEN;
knownLength = false;
}
position = 0;
return null;
}
public void onBodyContent(ByteBuffer b) throws IOException {
int toCopy = b.remaining();
int size = capacity;
if (toCopy > capacity - position) {
// resize
size += toCopy * 2;
}
if (size != capacity) {
if (knownLength) {
// capacity should have been right from start
throw new IOException("Inconsistent content length");
}
byte[] newbuf = new byte[size];
System.arraycopy(buffer, 0, newbuf, 0, position);
buffer = newbuf;
capacity = size;
}
int srcposition = b.arrayOffset() + b.position();
System.arraycopy(b.array(), srcposition, buffer, position, toCopy);
b.position(b.limit());
position += toCopy;
}
public byte[] onComplete() throws IOException {
if (knownLength) {
if (position != capacity) {
throw new IOException("Wrong number of bytes received");
}
return buffer;
}
byte[] buf1 = new byte[position];
System.arraycopy(buffer, 0, buf1, 0, position);
return buf1;
}
public void onError(Throwable t) {
// TODO:
}
}
static final byte[] EMPTY = new byte[0];
/**
* Returns a response processor which supplies the response body to the
* given Consumer. Each time data is received the consumer is invoked with a
* byte[] containing at least one byte of data. After the final buffer is
* received, the consumer is invoked one last time, with an empty byte
* array.
*
* @param consumer a Consumer to accept the response body
* @return a {@code BodyProcessor}
*/
public static BodyProcessor<Void> asByteArrayConsumer(Consumer<byte[]> consumer) {
return new AbstractResponseProcessor<Void>() {
@Override
public Void onResponseBodyStartImpl(long clen,
HttpHeaders h)
throws IOException
{
return null;
}
@Override
public void onResponseError(Throwable t) {
}
@Override
public void onResponseBodyChunkImpl(ByteBuffer b) throws IOException {
if (!b.hasRemaining()) {
return;
}
byte[] buf = new byte[b.remaining()];
b.get(buf);
consumer.accept(buf);
}
@Override
public Void onResponseComplete() throws IOException {
consumer.accept(EMPTY);
return null;
}
};
}
/**
* Returns a BodyProcessor which delivers the response data to a
* {@link java.util.concurrent.Flow.Subscriber}{@code ByteBuffer}.
* <p>
* The given {@code Supplier<U>} is invoked when the Flow is completed in
* order to convert the flow data into the U object that is returned as the
* response body.
*
* @param <U> the response body type
* @param subscriber the Flow.Subscriber
* @param bufferSize the maximum number of bytes of data to be supplied in
* each ByteBuffer
* @param bodySupplier an object that converts the received data to the body
* type U.
* @return a BodyProcessor
*
* public static <U> BodyProcessor<Flow.Subscriber<ByteBuffer>>
* asFlowSubscriber() {
*
* return new BodyProcessor<U>() { Flow.Subscriber<ByteBuffer> subscriber;
* LongConsumer flowController; FlowSubscription subscription; Supplier<U>
* bodySupplier; int bufferSize; // down-stream Flow window. long
* buffersWindow; // upstream window long bytesWindow;
* LinkedList<ByteBuffer> buffers = new LinkedList<>();
*
* class FlowSubscription implements Subscription { int recurseLevel = 0;
* @Override public void request(long n) { boolean goodToGo = recurseLevel++
* == 0;
*
* while (goodToGo && buffers.size() > 0 && n > 0) { ByteBuffer buf =
* buffers.get(0); subscriber.onNext(buf); n--; } buffersWindow += n;
* flowController.accept(n * bufferSize); recurseLevel--; }
*
* @Override public void cancel() { // ?? set flag and throw exception on
* next receipt of buffer } }
*
* @Override public U onResponseBodyStart(long contentLength, HttpHeaders
* responseHeaders, LongConsumer flowController) throws IOException {
* this.subscriber = subscriber; this.flowController = flowController;
* this.subscription = new FlowSubscription(); this.bufferSize = bufferSize;
* subscriber.onSubscribe(subscription); return null; }
*
* @Override public void onResponseError(Throwable t) {
* subscriber.onError(t); }
*
* @Override public void onResponseBodyChunk(ByteBuffer b) throws
* IOException { if (buffersWindow > 0) { buffersWindow --;
* subscriber.onNext(b); } else { buffers.add(b); // or could combine
* buffers? } }
*
* @Override public U onResponseComplete() throws IOException {
* subscriber.onComplete(); return bodySupplier.get(); } }; }
*/
private static final ByteBuffer EOF = ByteBuffer.allocate(0);
private static final ByteBuffer CLOSED = ByteBuffer.allocate(0);
// prototype using ByteBuffer based flow control. InputStream feeds off a
// BlockingQueue. Size of Q is determined from the the bufsize (bytes) and
// the default ByteBuffer size. bufsize should be a reasonable multiple of
// ByteBuffer size to prevent underflow/starvation. The InputStream updates
// the flowControl window by one as each ByteBuffer is fully consumed.
// Special sentinels are used to indicate stream closed and EOF.
/**
* Returns a response body processor which provides an InputStream to read
* the body.
*
* @implNote This mechanism is provided primarily for backwards
* compatibility for code that expects InputStream. It is recommended for
* better performance to use one of the other response processor
* implementations.
*
* @return a {@code BodyProcessor}
*/
public static BodyProcessor<InputStream> asInputStream() {
return new BodyProcessor<InputStream>() {
int queueSize = 2;
private volatile Throwable throwable;
BlockingQueue<ByteBuffer> queue = new LinkedBlockingQueue<>();
private void closeImpl() {
try {
queue.put(CLOSED);
} catch (InterruptedException e) { }
}
@Override
public InputStream onResponseBodyStart(long contentLength,
HttpHeaders responseHeaders,
LongConsumer flowController)
throws IOException
{
flowController.accept(queueSize);
return new InputStream() {
ByteBuffer buffer;
@Override
public int read() throws IOException {
byte[] bb = new byte[1];
int n = read(bb, 0, 1);
if (n == -1) {
return -1;
} else {
return bb[0];
}
}
@Override
public int read(byte[] bb) throws IOException {
return read(bb, 0, bb.length);
}
@Override
public int read(byte[] bb, int offset, int length)
throws IOException
{
int n;
if (getBuffer()) {
return -1; // EOF
} else {
int remaining = buffer.remaining();
if (length >= remaining) {
buffer.get(bb, offset, remaining);
return remaining;
} else {
buffer.get(bb, offset, length);
return length;
}
}
}
@Override
public void close() {
closeImpl();
}
private boolean getBuffer() throws IOException {
while (buffer == null || (buffer != EOF &&
buffer != CLOSED && !buffer.hasRemaining())) {
try {
buffer = queue.take();
flowController.accept(1);
} catch (InterruptedException e) {
throw new IOException(e);
}
}
if (buffer == CLOSED) {
if (throwable != null) {
if (throwable instanceof IOException) {
throw (IOException) throwable;
} else {
throw new IOException(throwable);
}
}
throw new IOException("Closed");
}
if (buffer == EOF) {
return true; // EOF
}
return false; // not EOF
}
};
}
@Override
public void onResponseError(Throwable t) {
throwable = t;
closeImpl();
}
@Override
public void onResponseBodyChunk(ByteBuffer b) throws IOException {
try {
queue.put(Utils.copy(b));
} catch (InterruptedException e) {
// shouldn't happen as queue should never block
throw new IOException(e);
}
}
@Override
public InputStream onResponseComplete() throws IOException {
try {
queue.put(EOF);
} catch (InterruptedException e) {
throw new IOException(e); // can't happen
}
return null;
}
};
}
/**
* Common super class that takes care of flow control
*
* @param <T>
*/
private static abstract class AbstractResponseProcessor<T>
implements BodyProcessor<T>
{
LongConsumer flowController;
@Override
public final T onResponseBodyStart(long contentLength,
HttpHeaders responseHeaders,
LongConsumer flowController)
throws IOException
{
this.flowController = flowController;
flowController.accept(1);
return onResponseBodyStartImpl(contentLength, responseHeaders);
}
public abstract T onResponseBodyStartImpl(long contentLength,
HttpHeaders responseHeaders)
throws IOException;
public abstract void onResponseBodyChunkImpl(ByteBuffer b)
throws IOException;
@Override
public final void onResponseBodyChunk(ByteBuffer b) throws IOException {
onResponseBodyChunkImpl(b);
flowController.accept(1);
}
}
/**
* Returns a {@link BodyProcessor}&lt;byte[]&gt; which returns the response
* body as a {@code byte array}.
*
* @return a {@code BodyProcessor}
*/
public static BodyProcessor<byte[]> asByteArray() {
ByteArrayResponseProcessor brp = new ByteArrayResponseProcessor();
return new AbstractResponseProcessor<byte[]>() {
@Override
public byte[] onResponseBodyStartImpl(long contentLength,
HttpHeaders h)
throws IOException
{
brp.onStart(contentLength);
return null;
}
@Override
public void onResponseBodyChunkImpl(ByteBuffer b)
throws IOException
{
brp.onBodyContent(b);
}
@Override
public byte[] onResponseComplete() throws IOException {
return brp.onComplete();
}
@Override
public void onResponseError(Throwable t) {
brp.onError(t);
}
};
}
/**
* Returns a response processor which decodes the body using the character
* set specified in the {@code Content-encoding} response header. If there
* is no such header, or the character set is not supported, then
* {@link java.nio.charset.StandardCharsets#ISO_8859_1 ISO_8859_1} is used.
*
* @return a {@code BodyProcessor}
*/
public static BodyProcessor<String> asString() {
return asString(null);
}
/**
* Returns a MultiProcessor that handles multiple responses, writes the
* response bodies to files and which returns an aggregate response object
* that is a {@code Map<URI,Path>}. The keyset of the Map represents the
* URIs of the original request and any additional requests generated by the
* server. The values are the paths of the destination files. Each path uses
* the URI path of the request offset from the destination parent directory
* provided.
*
* <p> All incoming additional requests (push promises) are accepted by this
* multi response processor. Errors are effectively ignored and any failed
* responses are simply omitted from the result Map. Other implementations
* of MultiProcessor can handle these situations
*
* <p><b>Example usage</b>
* <pre>
* {@code
* CompletableFuture<Map<URI,Path>> cf =
* HttpRequest.create(new URI("https://www.foo.com/"))
* .version(Version.HTTP2)
* .GET()
* .sendAsyncMulti(HttpResponse.multiFile("/usr/destination"));
*
* Map<URI,Path> results = cf.join();
* }
* </pre>
*
* @param destination the destination parent directory of all response
* bodies
* @return a MultiProcessor
*/
public static MultiProcessor<Map<URI, Path>> multiFile(Path destination) {
return new MultiProcessor<Map<URI, Path>>() {
Map<URI, CompletableFuture<Path>> bodyCFs = new HashMap<>();
Map<URI, Path> results = new HashMap<>();
@Override
public BiFunction<HttpRequest, CompletableFuture<HttpResponse>, Boolean>
onStart(HttpRequest mainRequest,
CompletableFuture<HttpResponse> response) {
bodyCFs.put(mainRequest.uri(), getBody(mainRequest, response));
return (HttpRequest additional, CompletableFuture<HttpResponse> cf) -> {
CompletableFuture<Path> bcf = getBody(additional, cf);
bodyCFs.put(additional.uri(), bcf);
// we accept all comers
return true;
};
}
private CompletableFuture<Path> getBody(HttpRequest req,
CompletableFuture<? extends HttpResponse> cf) {
URI u = req.uri();
String path = u.getPath();
if (path.startsWith("/"))
path = path.substring(1);
final String fpath = path;
return cf.thenCompose((HttpResponse resp) -> {
return resp.bodyAsync(HttpResponse.asFile(destination.resolve(fpath)));
});
}
@Override
public Map<URI, Path> onComplete() {
// all CFs have completed normally or in error.
Set<Map.Entry<URI, CompletableFuture<Path>>> entries = bodyCFs.entrySet();
for (Map.Entry<URI, CompletableFuture<Path>> entry : entries) {
CompletableFuture<Path> v = entry.getValue();
URI uri = entry.getKey();
if (v.isDone() && !v.isCompletedExceptionally()) {
results.put(uri, v.join());
}
}
return results;
}
};
}
/**
* Returns a {@link BodyProcessor}&lt;{@link String}&gt;.
*
* @param charset the name of the charset to interpret the body as. If
* {@code null} then the processor tries to determine the character set from
* the {@code Content-encoding} header. If that charset is not supported
* then {@link java.nio.charset.StandardCharsets#ISO_8859_1 ISO_8859_1} is
* used.
* @return a {@code BodyProcessor}
*/
public static BodyProcessor<String> asString(Charset charset) {
ByteArrayResponseProcessor brp = new ByteArrayResponseProcessor();
return new AbstractResponseProcessor<String>() {
Charset cs = charset;
HttpHeaders headers;
@Override
public String onResponseBodyStartImpl(long contentLength,
HttpHeaders h)
throws IOException
{
headers = h;
brp.onStart(contentLength);
return null;
}
@Override
public void onResponseBodyChunkImpl(ByteBuffer b) throws IOException {
brp.onBodyContent(b);
}
@Override
public String onResponseComplete() throws IOException {
byte[] buf = brp.onComplete();
if (cs == null) {
cs = headers.firstValue("Content-encoding")
.map((String s) -> Charset.forName(s))
.orElse(StandardCharsets.ISO_8859_1);
}
return new String(buf, cs);
}
@Override
public void onResponseError(Throwable t) {
brp.onError(t);
}
};
}
/**
* Returns a response processor which ignores the response body.
*
* @return a {@code BodyProcessor}
*/
public static BodyProcessor<Void> ignoreBody() {
return asByteArrayConsumer((byte[] buf) -> { /* ignore */ });
}
/**
* A processor for response bodies, which determines the type of the
* response body returned from {@link HttpResponse}. Response processors can
* either return an object that represents the body itself (after it has
* been read) or else an object that is used to read the body (such as an
* {@code InputStream}). The parameterized type {@code <T>} is the type of
* the returned body object from
* {@link HttpResponse#body(BodyProcessor) HttpResponse.body} and
* (indirectly) from {@link HttpResponse#bodyAsync(BodyProcessor)
* HttpResponse.bodyAsync}.
*
* <p> Implementations of this interface are provided in {@link HttpResponse}
* which write responses to {@code String, byte[], File, Consumer<byte[]>}.
* Custom implementations can also be used.
*
* <p> The methods of this interface may be called from multiple threads,
* but only one method is invoked at a time, and behaves as if called from
* one thread.
*
* @param <T> the type of the response body
*
* @since 9
*/
public interface BodyProcessor<T> {
/**
* Called immediately before the response body is read. If {@code <T>}
* is an object used to read or accept the response body, such as a
* {@code Consumer} or {@code InputStream} then it should be returned
* from this method, and the body object will be returned before any
* data is read. If {@code <T>} represents the body itself after being
* read, then this method must return {@code null} and the body will be
* returned from {@link #onResponseComplete()}. In both cases, the
* actual body data is provided by the
* {@link #onResponseBodyChunk(ByteBuffer) onResponseBodyChunk} method
* in exactly the same way.
*
* <p> flowController is a consumer of long values and is used for
* updating a flow control window as follows. The window represents the
* number of times
* {@link #onResponseBodyChunk(java.nio.ByteBuffer) onResponseBodyChunk}
* may be called before receiving further updates to the window. Each
* time it is called, the window is reduced by {@code 1}. When the
* window reaches zero {@code onResponseBodyChunk()} will not be called
* again until the window has opened again with further calls to
* flowController.accept().
* {@link java.util.function.LongConsumer#accept(long) flowcontroller.accept()}
* must be called to open (increase) the window by the specified amount.
* The initial value is zero. This implies that if {@code
* onResponseBodyStart()} does not call {@code flowController.accept()}
* with a positive value no data will ever be delivered.
*
* @param contentLength {@code -1} signifies unknown content length.
* Otherwise, a positive integer, or zero.
* @param responseHeaders the response headers
* @param flowController a LongConsumer used to update the flow control
* window
* @return {@code null} or an object that can be used to read the
* response body.
* @throws IOException if an exception occurs starting the response
* body receive
*/
T onResponseBodyStart(long contentLength,
HttpHeaders responseHeaders,
LongConsumer flowController)
throws IOException;
/**
* Called if an error occurs while reading the response body. This
* terminates the operation and no further calls will occur after this.
*
* @param t the Throwable
*/
void onResponseError(Throwable t);
/**
* Called for each buffer of data received for this response.
* ByteBuffers can be reused as soon as this method returns.
*
* @param b a ByteBuffer whose position is at the first byte that can be
* read, and whose limit is after the last byte that can be read
* @throws IOException in case of I/O error
*/
void onResponseBodyChunk(ByteBuffer b) throws IOException;
/**
* Called after the last time
* {@link #onResponseBodyChunk(java.nio.ByteBuffer)} has been called and
* returned indicating that the entire content has been read. This
* method must return an object that represents or contains the response
* body just received, but only if an object was not returned from
* {@link #onResponseBodyStart(long, HttpHeaders, LongConsumer)
* onResponseBodyStart}.
*
* @return a T, or {@code null} if an object was already returned
* @throws IOException in case of I/O error
*/
T onResponseComplete() throws IOException;
}
/**
* A response processor for a HTTP/2 multi response. A multi response
* comprises a main response, and zero or more additional responses. Each
* additional response is sent by the server in response to requests that
* the server also generates. Additional responses are typically resources
* that the server guesses the client will need which are related to the
* initial request.
*
* <p>The server generated requests are also known as <i>push promises</i>.
* The server is permitted to send any number of these requests up to the
* point where the main response is fully received. Therefore, after
* completion of the main response body, the final number of additional
* responses is known. Additional responses may be cancelled, but given that
* the server does not wait for any acknowledgment before sending the
* response, this must be done quickly to avoid unnecessary data transmission.
*
* <p> {@code MultiProcessor}s are parameterised with a type {@code T} which
* represents some meaningful aggregate of the responses received. This
* would typically be a Collection of response or response body objects. One
* example implementation can be found at {@link
* HttpResponse#multiFile(java.nio.file.Path)}.
*
* @param <T> a type representing the aggregated results
*
* @since 9
*/
public interface MultiProcessor<T> {
/**
* Called before or soon after a multi request is sent. The request that
* initiated the multi response is supplied, as well as a
* CompletableFuture for the main response. The implementation of this
* method must return a BiFunction which is called once for each push
* promise received.
*
* <p> The parameters to the {@code BiFunction} are the {@code HttpRequest}
* for the push promise and a {@code CompletableFuture} for its
* response. The function must return a Boolean indicating whether the
* push promise has been accepted (true) or should be canceled (false).
* The CompletableFutures for any canceled pushes are themselves
* completed exceptionally soon after the function returns.
*
* @param mainRequest the main request
* @param response a CompletableFuture for the main response
* @return a BiFunction that is called for each push promise
*/
BiFunction<HttpRequest, CompletableFuture<HttpResponse>, Boolean>
onStart(HttpRequest mainRequest,
CompletableFuture<HttpResponse> response);
/**
* Called after all responses associated with the multi response have
* been fully processed, including response bodies.
*
* <p> Example types for {@code T} could be Collections of response body
* types or {@code Map}s from request {@code URI} to a response body
* type.
*
* @return the aggregate response object
*/
T onComplete();
}
}

View File

@ -1,185 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.URI;
import java.nio.ByteBuffer;
import java.security.AccessControlContext;
import java.security.AccessController;
import java.util.concurrent.CompletableFuture;
import java.util.function.LongConsumer;
import javax.net.ssl.SSLParameters;
/**
* The implementation class for HttpResponse
*/
class HttpResponseImpl extends HttpResponse {
int responseCode;
Exchange exchange;
HttpRequestImpl request;
HttpHeaders headers;
HttpHeaders trailers;
SSLParameters sslParameters;
URI uri;
HttpClient.Version version;
AccessControlContext acc;
RawChannel rawchan;
HttpConnection connection;
final Stream stream;
public HttpResponseImpl(int responseCode, Exchange exch, HttpHeaders headers,
HttpHeaders trailers, SSLParameters sslParameters,
HttpClient.Version version, HttpConnection connection) {
this.responseCode = responseCode;
this.exchange = exch;
this.request = exchange.request();
this.headers = headers;
this.trailers = trailers;
this.sslParameters = sslParameters;
this.uri = request.uri();
this.version = version;
this.connection = connection;
this.stream = null;
}
// A response to a PUSH_PROMISE
public HttpResponseImpl(int responseCode, HttpRequestImpl pushRequest,
ImmutableHeaders headers,
Stream stream, SSLParameters sslParameters) {
this.responseCode = responseCode;
this.exchange = null;
this.request = pushRequest;
this.headers = headers;
this.trailers = null;
this.sslParameters = sslParameters;
this.uri = request.uri(); // TODO: take from headers
this.version = HttpClient.Version.HTTP_2;
this.connection = null;
this.stream = stream;
}
@Override
public int statusCode() {
return responseCode;
}
@Override
public HttpRequestImpl request() {
return request;
}
@Override
public HttpHeaders headers() {
return headers;
}
@Override
public HttpHeaders trailers() {
return trailers;
}
@Override
public <T> T body(java.net.http.HttpResponse.BodyProcessor<T> processor) {
try {
if (exchange != null) {
return exchange.responseBody(processor);
} else {
return stream.responseBody(processor);
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
@Override
public <T> CompletableFuture<T> bodyAsync(java.net.http.HttpResponse.BodyProcessor<T> processor) {
acc = AccessController.getContext();
if (exchange != null)
return exchange.responseBodyAsync(processor);
else
return stream.responseBodyAsync(processor);
}
@Override
public SSLParameters sslParameters() {
return sslParameters;
}
public AccessControlContext getAccessControlContext() {
return acc;
}
@Override
public URI uri() {
return uri;
}
@Override
public HttpClient.Version version() {
return version;
}
// keepalive flag determines whether connection is closed or kept alive
// by reading/skipping data
public static java.net.http.HttpResponse.BodyProcessor<Void> ignoreBody(boolean keepalive) {
return new java.net.http.HttpResponse.BodyProcessor<Void>() {
@Override
public Void onResponseBodyStart(long clen, HttpHeaders h,
LongConsumer flowController) throws IOException {
return null;
}
@Override
public void onResponseBodyChunk(ByteBuffer b) throws IOException {
}
@Override
public Void onResponseComplete() throws IOException {
return null;
}
@Override
public void onResponseError(Throwable t) {
}
};
}
/**
*
* @return
*/
RawChannel rawChannel() throws IOException {
if (rawchan == null) {
rawchan = new RawChannelImpl(request.client(), connection);
}
return rawchan;
}
}

View File

@ -1,80 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.TreeMap;
import java.util.function.Predicate;
/**
* Immutable HttpHeaders constructed from mutable HttpHeadersImpl.
*/
class ImmutableHeaders implements HttpHeaders {
private final Map<String,List<String>> map;
@SuppressWarnings("unchecked")
ImmutableHeaders() {
map = (Map<String,List<String>>)Collections.EMPTY_MAP;
}
// TODO: fix lower case issue. Must be lc for http/2 compares ignoreCase for http/1
ImmutableHeaders(HttpHeadersImpl h, Predicate<String> keyAllowed) {
Map<String,List<String>> src = h.directMap();
Map<String,List<String>> m = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
src.forEach((key, value) -> {
if (keyAllowed.test(key))
m.put(key, Collections.unmodifiableList(value));
});
map = Collections.unmodifiableMap(m);
}
@Override
public Optional<String> firstValue(String name) {
List<String> l = map.get(name);
String v = l == null ? null : l.get(0);
return Optional.ofNullable(v);
}
@Override
public Optional<Long> firstValueAsLong(String name) {
return firstValue(name).map((v -> Long.parseLong(v)));
}
@Override
public List<String> allValues(String name) {
return map.get(name);
}
@Override
public Map<String, List<String>> map() {
return map;
}
}

View File

@ -1,273 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.ExecutionException;
import java.util.function.BiFunction;
import static java.net.http.Pair.pair;
/**
* Encapsulates multiple Exchanges belonging to one HttpRequestImpl.
* - manages filters
* - retries due to filters.
* - I/O errors and most other exceptions get returned directly to user
*
* Creates a new Exchange for each request/response interaction
*/
class MultiExchange {
final HttpRequestImpl request; // the user request
final HttpClientImpl client;
HttpRequestImpl currentreq; // used for async only
Exchange exchange; // the current exchange
Exchange previous;
int attempts;
// Maximum number of times a request will be retried/redirected
// for any reason
final static int DEFAULT_MAX_ATTEMPTS = 5;
final static int max_attempts = Utils.getIntegerNetProperty(
"java.net.httpclient.redirects.retrylimit", DEFAULT_MAX_ATTEMPTS
);
private final List<HeaderFilter> filters;
TimedEvent td;
boolean cancelled = false;
/**
* Filter fields. These are attached as required by filters
* and only used by the filter implementations. This could be
* generalised into Objects that are passed explicitly to the filters
* (one per MultiExchange object, and one per Exchange object possibly)
*/
volatile AuthenticationFilter.AuthInfo serverauth, proxyauth;
// RedirectHandler
volatile int numberOfRedirects = 0;
/**
*/
MultiExchange(HttpRequestImpl request) {
this.exchange = new Exchange(request);
this.previous = null;
this.request = request;
this.currentreq = request;
this.attempts = 0;
this.client = request.client();
this.filters = client.filterChain();
}
public HttpResponseImpl response() throws IOException, InterruptedException {
HttpRequestImpl r = request;
if (r.timeval() != 0) {
// set timer
td = new TimedEvent(r.timeval());
client.registerTimer(td);
}
while (attempts < max_attempts) {
try {
attempts++;
Exchange currExchange = getExchange();
requestFilters(r);
HttpResponseImpl response = currExchange.response();
Pair<HttpResponse, HttpRequestImpl> filterResult = responseFilters(response);
HttpRequestImpl newreq = filterResult.second;
if (newreq == null) {
if (attempts > 1) {
Log.logError("Succeeded on attempt: " + attempts);
}
cancelTimer();
return response;
}
response.body(HttpResponse.ignoreBody());
setExchange(new Exchange(newreq, currExchange.getAccessControlContext() ));
r = newreq;
} catch (IOException e) {
if (cancelled) {
throw new HttpTimeoutException("Request timed out");
}
throw e;
}
}
cancelTimer();
throw new IOException("Retry limit exceeded");
}
private synchronized Exchange getExchange() {
return exchange;
}
private synchronized void setExchange(Exchange exchange) {
this.exchange = exchange;
}
private void cancelTimer() {
if (td != null) {
client.cancelTimer(td);
}
}
private void requestFilters(HttpRequestImpl r) throws IOException {
for (HeaderFilter filter : filters) {
filter.request(r);
}
}
// Filters are assumed to be non-blocking so the async
// versions of these methods just call the blocking ones
private CompletableFuture<Void> requestFiltersAsync(HttpRequestImpl r) {
CompletableFuture<Void> cf = new CompletableFuture<>();
try {
requestFilters(r);
cf.complete(null);
} catch(Throwable e) {
cf.completeExceptionally(e);
}
return cf;
}
private Pair<HttpResponse,HttpRequestImpl>
responseFilters(HttpResponse response) throws IOException
{
for (HeaderFilter filter : filters) {
HttpRequestImpl newreq = filter.response((HttpResponseImpl)response);
if (newreq != null) {
return pair(null, newreq);
}
}
return pair(response, null);
}
private CompletableFuture<Pair<HttpResponse,HttpRequestImpl>>
responseFiltersAsync(HttpResponse response)
{
CompletableFuture<Pair<HttpResponse,HttpRequestImpl>> cf = new CompletableFuture<>();
try {
Pair<HttpResponse,HttpRequestImpl> n = responseFilters(response); // assumed to be fast
cf.complete(n);
} catch (Throwable e) {
cf.completeExceptionally(e);
}
return cf;
}
public void cancel() {
cancelled = true;
getExchange().cancel();
}
public CompletableFuture<HttpResponseImpl> responseAsync(Void v) {
CompletableFuture<HttpResponseImpl> cf;
if (++attempts > max_attempts) {
cf = CompletableFuture.failedFuture(new IOException("Too many retries"));
} else {
if (currentreq.timeval() != 0) {
// set timer
td = new TimedEvent(currentreq.timeval());
client.registerTimer(td);
}
Exchange exch = getExchange();
cf = requestFiltersAsync(currentreq)
.thenCompose(exch::responseAsync)
.thenCompose(this::responseFiltersAsync)
.thenCompose((Pair<HttpResponse,HttpRequestImpl> pair) -> {
HttpResponseImpl resp = (HttpResponseImpl)pair.first;
if (resp != null) {
if (attempts > 1) {
Log.logError("Succeeded on attempt: " + attempts);
}
return CompletableFuture.completedFuture(resp);
} else {
currentreq = pair.second;
Exchange previous = exch;
setExchange(new Exchange(currentreq,
currentreq.getAccessControlContext()));
//reads body off previous, and then waits for next response
return previous
.responseBodyAsync(HttpResponse.ignoreBody())
.thenCompose(this::responseAsync);
}
})
.handle((BiFunction<HttpResponse, Throwable, Pair<HttpResponse, Throwable>>) Pair::new)
.thenCompose((Pair<HttpResponse,Throwable> obj) -> {
HttpResponseImpl response = (HttpResponseImpl)obj.first;
if (response != null) {
return CompletableFuture.completedFuture(response);
}
// all exceptions thrown are handled here
CompletableFuture<HttpResponseImpl> error = getExceptionalCF(obj.second);
if (error == null) {
cancelTimer();
return responseAsync(null);
} else {
return error;
}
});
}
return cf;
}
/**
* Take a Throwable and return a suitable CompletableFuture that is
* completed exceptionally.
*/
private CompletableFuture<HttpResponseImpl> getExceptionalCF(Throwable t) {
if ((t instanceof CompletionException) || (t instanceof ExecutionException)) {
if (t.getCause() != null) {
t = t.getCause();
}
}
if (cancelled && t instanceof IOException) {
t = new HttpTimeoutException("request timed out");
}
return CompletableFuture.failedFuture(t);
}
<T> T responseBody(HttpResponse.BodyProcessor<T> processor) {
return getExchange().responseBody(processor);
}
<T> CompletableFuture<T> responseBodyAsync(HttpResponse.BodyProcessor<T> processor) {
return getExchange().responseBodyAsync(processor);
}
class TimedEvent extends TimeoutEvent {
TimedEvent(long timeval) {
super(timeval);
}
@Override
public void handle() {
cancel();
}
}
}

View File

@ -1,86 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.io.IOException;
import java.nio.ByteBuffer;
class PingFrame extends Http2Frame {
PingFrame() {
type = TYPE;
}
byte[] data;
public final static int TYPE = 0x6;
// Flags
public static final int ACK = 0x1;
@Override
String flagAsString(int flag) {
switch (flag) {
case ACK:
return "ACK";
}
return super.flagAsString(flag);
}
public void setData(byte[] data) {
if (data.length != 8) {
throw new IllegalArgumentException("Ping data not 8 bytes");
}
this.data = data;
}
public byte[] getData() {
return data;
}
@Override
void readIncomingImpl(ByteBufferConsumer bc) throws IOException {
if (length != 8) {
throw new IOException("Invalid Ping frame");
}
data = bc.getBytes(8);
}
@Override
void writeOutgoing(ByteBufferGenerator bg) {
if (data == null) {
data = new byte[] {0, 0, 0, 0, 0 ,0, 0, 0};
}
super.writeOutgoing(bg);
ByteBuffer buf = bg.getBuffer(8);
buf.put(data);
}
@Override
void computeLength() {
length = 8;
}
}

View File

@ -1,83 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.io.IOException;
import java.nio.ByteBuffer;
class PriorityFrame extends Http2Frame {
int streamDependency;
int weight;
boolean exclusive;
public final static int TYPE = 0x2;
PriorityFrame() {
type = TYPE;
}
public PriorityFrame(int streamDependency, boolean exclusive, int weight) {
this.streamDependency = streamDependency;
this.exclusive = exclusive;
this.weight = weight;
this.type = TYPE;
}
int streamDependency() {
return streamDependency;
}
int weight() {
return weight;
}
boolean exclusive() {
return exclusive;
}
@Override
void readIncomingImpl(ByteBufferConsumer bc) throws IOException {
int x = bc.getInt();
exclusive = (x & 0x80000000) != 0;
streamDependency = x & 0x7fffffff;
weight = bc.getByte();
}
@Override
void writeOutgoing(ByteBufferGenerator bg) {
super.writeOutgoing(bg);
ByteBuffer buf = bg.getBuffer(5);
int x = exclusive ? (1 << 31) + streamDependency : streamDependency;
buf.putInt(x);
buf.put((byte)weight);
}
@Override
void computeLength() {
length = 5;
}
}

View File

@ -1,479 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
/**
* Reads response headers off channel, in blocking mode. Entire header
* block is collected in a byte[]. The offset location of the start of
* each header name is recorded in an array to facilitate later searching.
*
* The location of "Content-length" is recorded explicitly. Similar approach
* could be taken for other common headers.
*
* This class is not thread-safe
*/
class ResponseHeaders implements HttpHeaders {
static final int DATA_SIZE = 16 * 1024; // initial space for headers
static final int NUM_HEADERS = 50; // initial expected max number of headers
final HttpConnection connection;
byte[] data;
int contentlen = -2; // means not initialized
ByteBuffer buffer;
/**
* Following used for scanning the array looking for:
* - well known headers
* - end of header block
*/
int[] headerOffsets; // index into data
int numHeaders;
int count;
ByteBuffer residue; // after headers processed, data may be here
ResponseHeaders(HttpConnection connection, ByteBuffer buffer) {
this.connection = connection;
initOffsets();
this.buffer = buffer;
data = new byte[DATA_SIZE];
}
int getContentLength() throws IOException {
if (contentlen != -2) {
return contentlen;
}
int[] search = findHeaderValue("Content-length");
if (search[0] == -1) {
contentlen = -1;
return -1;
}
int i = search[0];
while (data[i] == ' ' || data[i] == '\t') {
i++;
if (i == data.length || data[i] == CR || data[i] == LF) {
throw new IOException("Bad header");
}
}
contentlen = 0;
int digit = data[i++] - 0x30;
while (digit >= 0 && digit <= 9) {
contentlen = contentlen * 10 + digit;
digit = data[i++] - 0x30;
}
return contentlen;
}
void log() {
populateMap(false);
}
void populateMap(boolean clearOffsets) {
StringBuilder sb;
for (int i = 0; i < numHeaders; i++) {
sb = new StringBuilder(32);
int offset = headerOffsets[i];
if (offset == -1) {
continue;
}
int j;
for (j=0; data[offset+j] != ':'; j++) {
// byte to char promotion ok for US-ASCII
sb.append((char)data[offset+j]);
}
String name = sb.toString();
List<String> l = getOrCreate(name);
addEntry(l, name, offset + j + 1);
// clear the offset
if (clearOffsets)
headerOffsets[i] = -1;
}
}
void addEntry(List<String> l, String name, int j) {
while (data[j] == ' ' || data[j] == '\t') {
j++;
}
int vstart = j;
// TODO: back slash ??
while (data[j] != CR) {
j++;
}
try {
String value = new String(data, vstart, j - vstart, "US-ASCII");
l.add(value);
} catch (UnsupportedEncodingException e) {
// can't happen
throw new InternalError(e);
}
}
// returns an int[2]: [0] = offset of value in data[]
// [1] = offset in headerOffsets. Both are -1 in error
private int[] findHeaderValue(String name) {
int[] result = new int[2];
byte[] namebytes = getBytes(name);
outer: for (int i = 0; i < numHeaders; i++) {
int offset = headerOffsets[i];
if (offset == -1) {
continue;
}
for (int j=0; j<namebytes.length; j++) {
if (namebytes[j] != lowerCase(data[offset+j])) {
continue outer;
}
}
// next char must be ':'
if (data[offset+namebytes.length] != ':') {
continue;
}
result[0] = offset+namebytes.length + 1;
result[1] = i;
return result;
}
result[0] = -1;
result[1] = -1;
return result;
}
/**
* Populates the map for header values with the given name.
* The offsets are cleared for any that are found, so they don't
* get repeatedly searched.
*/
List<String> populateMapEntry(String name) {
List<String> l = getOrCreate(name);
int[] search = findHeaderValue(name);
while (search[0] != -1) {
addEntry(l, name, search[0]);
// clear the offset
headerOffsets[search[1]] = -1;
search = findHeaderValue(name);
}
return l;
}
static final Locale usLocale = Locale.US;
static final Charset ascii = StandardCharsets.US_ASCII;
private byte[] getBytes(String name) {
return name.toLowerCase(usLocale).getBytes(ascii);
}
/*
* We read buffers in a loop until we detect end of headers
* CRLFCRLF. Each byte received is copied into the byte[] data
* The position of the first byte of each header (after a CRLF)
* is recorded in a separate array showing the location of
* each header name.
*/
void initHeaders() throws IOException {
inHeaderName = true;
endOfHeader = true;
for (int numBuffers = 0; true; numBuffers++) {
if (numBuffers > 0) {
buffer = connection.read();
}
if (buffer == null) {
throw new IOException("Error reading headers");
}
if (!buffer.hasRemaining()) {
continue;
}
// Position set to first byte
int start = buffer.position();
byte[] backing = buffer.array();
int len = buffer.limit() - start;
for (int i = 0; i < len; i++) {
byte b = backing[i + start];
if (inHeaderName) {
b = lowerCase(b);
}
if (b == ':') {
inHeaderName = false;
}
data[count++] = b;
checkByte(b);
if (firstChar) {
recordHeaderOffset(count-1);
firstChar = false;
}
if (endOfHeader && numHeaders == 0) {
// empty headers
endOfAllHeaders = true;
}
if (endOfAllHeaders) {
int newposition = i + 1 + start;
if (newposition <= buffer.limit()) {
buffer.position(newposition);
residue = buffer;
} else {
residue = null;
}
return;
}
if (count == data.length) {
resizeData();
}
}
}
}
static final int CR = 13;
static final int LF = 10;
int crlfCount = 0;
// results of checkByte()
boolean endOfHeader; // just seen LF after CR before
boolean endOfAllHeaders; // just seen LF after CRLFCR before
boolean firstChar; //
boolean inHeaderName; // examining header name
void checkByte(byte b) throws IOException {
if (endOfHeader && b != CR && b != LF)
firstChar = true;
endOfHeader = false;
endOfAllHeaders = false;
switch (crlfCount) {
case 0:
crlfCount = b == CR ? 1 : 0;
break;
case 1:
crlfCount = b == LF ? 2 : 0;
endOfHeader = true;
inHeaderName = true;
break;
case 2:
crlfCount = b == CR ? 3 : 0;
break;
case 3:
if (b != LF) {
throw new IOException("Bad header block termination");
}
endOfAllHeaders = true;
break;
}
}
byte lowerCase(byte b) {
if (b >= 0x41 && b <= 0x5A)
b = (byte)(b + 32);
return b;
}
void resizeData() {
int oldlen = data.length;
int newlen = oldlen * 2;
byte[] newdata = new byte[newlen];
System.arraycopy(data, 0, newdata, 0, oldlen);
data = newdata;
}
final void initOffsets() {
headerOffsets = new int[NUM_HEADERS];
numHeaders = 0;
}
ByteBuffer getResidue() {
return residue;
}
void recordHeaderOffset(int index) {
if (numHeaders >= headerOffsets.length) {
int oldlen = headerOffsets.length;
int newlen = oldlen * 2;
int[] new1 = new int[newlen];
System.arraycopy(headerOffsets, 0, new1, 0, oldlen);
headerOffsets = new1;
}
headerOffsets[numHeaders++] = index;
}
/**
* As entries are read from the byte[] they are placed in here
* So we always check this map first
*/
Map<String,List<String>> headers = new HashMap<>();
@Override
public Optional<String> firstValue(String name) {
List<String> l = allValues(name);
if (l == null || l.isEmpty()) {
return Optional.ofNullable(null);
} else {
return Optional.of(l.get(0));
}
}
@Override
public List<String> allValues(String name) {
name = name.toLowerCase(usLocale);
List<String> l = headers.get(name);
if (l == null) {
l = populateMapEntry(name);
}
return Collections.unmodifiableList(l);
}
// Delegates map to HashMap but converts keys to lower case
static class HeaderMap implements Map<String,List<String>> {
Map<String,List<String>> inner;
HeaderMap(Map<String,List<String>> inner) {
this.inner = inner;
}
@Override
public int size() {
return inner.size();
}
@Override
public boolean isEmpty() {
return inner.isEmpty();
}
@Override
public boolean containsKey(Object key) {
if (!(key instanceof String)) {
return false;
}
String s = ((String)key).toLowerCase(usLocale);
return inner.containsKey(s);
}
@Override
public boolean containsValue(Object value) {
return inner.containsValue(value);
}
@Override
public List<String> get(Object key) {
String s = ((String)key).toLowerCase(usLocale);
return inner.get(s);
}
@Override
public List<String> put(String key, List<String> value) {
throw new UnsupportedOperationException("Not supported");
}
@Override
public List<String> remove(Object key) {
throw new UnsupportedOperationException("Not supported");
}
@Override
public void putAll(Map<? extends String, ? extends List<String>> m) {
throw new UnsupportedOperationException("Not supported");
}
@Override
public void clear() {
throw new UnsupportedOperationException("Not supported");
}
@Override
public Set<String> keySet() {
return inner.keySet();
}
@Override
public Collection<List<String>> values() {
return inner.values();
}
@Override
public Set<Entry<String, List<String>>> entrySet() {
return inner.entrySet();
}
}
@Override
public Map<String, List<String>> map() {
populateMap(true);
return new HeaderMap(headers);
}
Map<String, List<String>> mapInternal() {
populateMap(false);
return new HeaderMap(headers);
}
private List<String> getOrCreate(String name) {
List<String> l = headers.get(name);
if (l == null) {
l = new LinkedList<>();
headers.put(name, l);
}
return l;
}
@Override
public Optional<Long> firstValueAsLong(String name) {
List<String> l = allValues(name);
if (l == null) {
return Optional.ofNullable(null);
} else {
String v = l.get(0);
Long lv = Long.parseLong(v);
return Optional.of(lv);
}
}
}

View File

@ -1,856 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import sun.net.httpclient.hpack.DecodingCallback;
import java.io.IOException;
import java.net.URI;
import java.nio.ByteBuffer;
import java.util.LinkedList;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.function.BiFunction;
import java.util.function.LongConsumer;
/**
* Http/2 Stream handling.
*
* REQUESTS
*
* sendHeadersOnly() -- assembles HEADERS frame and puts on connection outbound Q
*
* sendRequest() -- sendHeadersOnly() + sendBody()
*
* sendBody() -- in calling thread: obeys all flow control (so may block)
* obtains data from request body processor and places on connection
* outbound Q.
*
* sendBodyAsync() -- calls sendBody() in an executor thread.
*
* sendHeadersAsync() -- calls sendHeadersOnly() which does not block
*
* sendRequestAsync() -- calls sendRequest() in an executor thread
*
* RESPONSES
*
* Multiple responses can be received per request. Responses are queued up on
* a LinkedList of CF<HttpResponse> and the the first one on the list is completed
* with the next response
*
* getResponseAsync() -- queries list of response CFs and returns first one
* if one exists. Otherwise, creates one and adds it to list
* and returns it. Completion is achieved through the
* incoming() upcall from connection reader thread.
*
* getResponse() -- calls getResponseAsync() and waits for CF to complete
*
* responseBody() -- in calling thread: blocks for incoming DATA frames on
* stream inputQ. Obeys remote and local flow control so may block.
* Calls user response body processor with data buffers.
*
* responseBodyAsync() -- calls responseBody() in an executor thread.
*
* incoming() -- entry point called from connection reader thread. Frames are
* either handled immediately without blocking or for data frames
* placed on the stream's inputQ which is consumed by the stream's
* reader thread.
*
* PushedStream sub class
* ======================
* Sending side methods are not used because the request comes from a PUSH_PROMISE
* frame sent by the server. When a PUSH_PROMISE is received the PushedStream
* is created. PushedStream does not use responseCF list as there can be only
* one response. The CF is created when the object created and when the response
* HEADERS frame is received the object is completed.
*/
class Stream extends ExchangeImpl {
final Queue<Http2Frame> inputQ;
volatile int streamid;
long responseContentLen = -1;
long responseBytesProcessed = 0;
long requestContentLen;
Http2Connection connection;
HttpClientImpl client;
final HttpRequestImpl request;
final DecodingCallback rspHeadersConsumer;
HttpHeadersImpl responseHeaders;
final HttpHeadersImpl requestHeaders;
final HttpHeadersImpl requestPseudoHeaders;
HttpResponse.BodyProcessor<?> responseProcessor;
final HttpRequest.BodyProcessor requestProcessor;
HttpResponse response;
// state flags
boolean requestSent, responseReceived;
final FlowController userRequestFlowController =
new FlowController();
final FlowController remoteRequestFlowController =
new FlowController();
final FlowController responseFlowController =
new FlowController();
final ExecutorWrapper executor;
@Override
@SuppressWarnings("unchecked")
<T> CompletableFuture<T> responseBodyAsync(HttpResponse.BodyProcessor<T> processor) {
this.responseProcessor = processor;
CompletableFuture<T> cf;
try {
T body = processor.onResponseBodyStart(
responseContentLen, responseHeaders,
responseFlowController); // TODO: filter headers
if (body != null) {
cf = CompletableFuture.completedFuture(body);
receiveDataAsync(processor);
} else
cf = receiveDataAsync(processor);
} catch (IOException e) {
cf = CompletableFuture.failedFuture(e);
}
PushGroup<?> pg = request.pushGroup();
if (pg != null) {
// if an error occurs make sure it is recorded in the PushGroup
cf = cf.whenComplete((t,e) -> pg.pushError(e));
}
return cf;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("streamid: ")
.append(streamid);
return sb.toString();
}
// pushes entire response body into response processor
// blocking when required by local or remote flow control
void receiveData() throws IOException {
Http2Frame frame;
DataFrame df = null;
try {
do {
frame = inputQ.take();
if (!(frame instanceof DataFrame)) {
assert false;
continue;
}
df = (DataFrame) frame;
int len = df.getDataLength();
ByteBuffer[] buffers = df.getData();
for (ByteBuffer b : buffers) {
responseFlowController.take();
responseProcessor.onResponseBodyChunk(b);
}
sendWindowUpdate(len);
} while (!df.getFlag(DataFrame.END_STREAM));
} catch (InterruptedException e) {
throw new IOException(e);
}
}
private <T> CompletableFuture<T> receiveDataAsync(HttpResponse.BodyProcessor<T> processor) {
CompletableFuture<T> cf = new CompletableFuture<>();
executor.execute(() -> {
try {
receiveData();
T body = processor.onResponseComplete();
cf.complete(body);
responseReceived();
} catch (Throwable t) {
cf.completeExceptionally(t);
}
}, null);
return cf;
}
private void sendWindowUpdate(int increment)
throws IOException, InterruptedException {
if (increment == 0)
return;
LinkedList<Http2Frame> list = new LinkedList<>();
WindowUpdateFrame frame = new WindowUpdateFrame();
frame.streamid(streamid);
frame.setUpdate(increment);
list.add(frame);
frame = new WindowUpdateFrame();
frame.streamid(0);
frame.setUpdate(increment);
list.add(frame);
connection.sendFrames(list);
}
@Override
CompletableFuture<Void> sendBodyAsync() {
final CompletableFuture<Void> cf = new CompletableFuture<>();
executor.execute(() -> {
try {
sendBodyImpl();
cf.complete(null);
} catch (IOException | InterruptedException e) {
cf.completeExceptionally(e);
}
}, null);
return cf;
}
@SuppressWarnings("unchecked")
Stream(HttpClientImpl client, Http2Connection connection, Exchange e) {
super(e);
this.client = client;
this.connection = connection;
this.request = e.request();
this.requestProcessor = request.requestProcessor();
responseHeaders = new HttpHeadersImpl();
requestHeaders = new HttpHeadersImpl();
rspHeadersConsumer = (name, value) -> {
responseHeaders.addHeader(name.toString(), value.toString());
};
this.executor = client.executorWrapper();
//this.response_cf = new CompletableFuture<HttpResponseImpl>();
this.requestPseudoHeaders = new HttpHeadersImpl();
// NEW
this.inputQ = new Queue<>();
}
@SuppressWarnings("unchecked")
Stream(HttpClientImpl client, Http2Connection connection, HttpRequestImpl req) {
super(null);
this.client = client;
this.connection = connection;
this.request = req;
this.requestProcessor = null;
responseHeaders = new HttpHeadersImpl();
requestHeaders = new HttpHeadersImpl();
rspHeadersConsumer = (name, value) -> {
responseHeaders.addHeader(name.toString(), value.toString());
};
this.executor = client.executorWrapper();
//this.response_cf = new CompletableFuture<HttpResponseImpl>();
this.requestPseudoHeaders = new HttpHeadersImpl();
// NEW
this.inputQ = new Queue<>();
}
/**
* Entry point from Http2Connection reader thread.
*
* Data frames will be removed by response body thread.
*
* @param frame
* @throws IOException
*/
void incoming(Http2Frame frame) throws IOException, InterruptedException {
if ((frame instanceof HeaderFrame) && ((HeaderFrame)frame).endHeaders()) {
// Complete headers accumulated. handle response.
// It's okay if there are multiple HeaderFrames.
handleResponse();
} else if (frame instanceof DataFrame) {
inputQ.put(frame);
} else {
otherFrame(frame);
}
}
void otherFrame(Http2Frame frame) throws IOException {
switch (frame.type()) {
case WindowUpdateFrame.TYPE:
incoming_windowUpdate((WindowUpdateFrame) frame);
break;
case ResetFrame.TYPE:
incoming_reset((ResetFrame) frame);
break;
case PriorityFrame.TYPE:
incoming_priority((PriorityFrame) frame);
break;
default:
String msg = "Unexpected frame: " + frame.toString();
throw new IOException(msg);
}
}
// The Hpack decoder decodes into one of these consumers of name,value pairs
DecodingCallback rspHeadersConsumer() {
return rspHeadersConsumer;
}
// create and return the HttpResponseImpl
protected void handleResponse() throws IOException {
HttpConnection c = connection.connection; // TODO: improve
long statusCode = responseHeaders
.firstValueAsLong(":status")
.orElseThrow(() -> new IOException("no statuscode in response"));
this.response = new HttpResponseImpl((int)statusCode, exchange, responseHeaders, null,
c.sslParameters(), HttpClient.Version.HTTP_2, c);
this.responseContentLen = responseHeaders
.firstValueAsLong("content-length")
.orElse(-1L);
// different implementations for normal streams and pushed streams
completeResponse(response);
}
void incoming_reset(ResetFrame frame) {
// TODO: implement reset
int error = frame.getErrorCode();
IOException e = new IOException(ErrorFrame.stringForCode(error));
completeResponseExceptionally(e);
throw new UnsupportedOperationException("Not implemented");
}
void incoming_priority(PriorityFrame frame) {
// TODO: implement priority
throw new UnsupportedOperationException("Not implemented");
}
void incoming_windowUpdate(WindowUpdateFrame frame) {
int amount = frame.getUpdate();
if (amount > 0)
remoteRequestFlowController.accept(amount);
}
void incoming_pushPromise(HttpRequestImpl pushReq, PushedStream pushStream) throws IOException {
if (Log.requests()) {
Log.logRequest("PUSH_PROMISE: " + pushReq.toString());
}
PushGroup<?> pushGroup = request.pushGroup();
if (pushGroup == null) {
cancelImpl(new IllegalStateException("unexpected push promise"));
}
// get the handler and call it.
BiFunction<HttpRequest,CompletableFuture<HttpResponse>,Boolean> ph =
pushGroup.pushHandler();
CompletableFuture<HttpResponse> pushCF = pushStream
.getResponseAsync(null)
.thenApply(r -> (HttpResponse)r);
boolean accept = ph.apply(pushReq, pushCF);
if (!accept) {
IOException ex = new IOException("Stream cancelled by user");
cancelImpl(ex);
pushCF.completeExceptionally(ex);
} else {
pushStream.requestSent();
pushGroup.addPush();
}
}
private OutgoingHeaders headerFrame(long contentLength) {
HttpHeadersImpl h = request.getSystemHeaders();
if (contentLength > 0) {
h.setHeader("content-length", Long.toString(contentLength));
}
setPseudoHeaderFields();
OutgoingHeaders f = new OutgoingHeaders(h, request.getUserHeaders(), this);
if (contentLength == 0) {
f.setFlag(HeadersFrame.END_STREAM);
}
return f;
}
private void setPseudoHeaderFields() {
HttpHeadersImpl hdrs = requestPseudoHeaders;
String method = request.method();
hdrs.setHeader(":method", method);
URI uri = request.uri();
hdrs.setHeader(":scheme", uri.getScheme());
// TODO: userinfo deprecated. Needs to be removed
hdrs.setHeader(":authority", uri.getAuthority());
// TODO: ensure header names beginning with : not in user headers
String query = uri.getQuery();
String path = uri.getPath();
if (path == null) {
if (method.equalsIgnoreCase("OPTIONS")) {
path = "*";
} else {
path = "/";
}
}
if (query != null) {
path += "?" + query;
}
hdrs.setHeader(":path", path);
}
HttpHeadersImpl getRequestPseudoHeaders() {
return requestPseudoHeaders;
}
@Override
HttpResponseImpl getResponse() throws IOException {
try {
if (request.timeval() > 0) {
return getResponseAsync(null).get(
request.timeval(), TimeUnit.MILLISECONDS);
} else {
return getResponseAsync(null).join();
}
} catch (TimeoutException e) {
throw new HttpTimeoutException("Response timed out");
} catch (InterruptedException | ExecutionException | CompletionException e) {
Throwable t = e.getCause();
if (t instanceof IOException) {
throw (IOException)t;
}
throw new IOException(e);
}
}
@Override
void sendRequest() throws IOException, InterruptedException {
sendHeadersOnly();
sendBody();
}
/**
* A simple general purpose blocking flow controller
*/
class FlowController implements LongConsumer {
int permits;
FlowController() {
this.permits = 0;
}
@Override
public synchronized void accept(long n) {
if (n < 1) {
throw new InternalError("FlowController.accept called with " + n);
}
if (permits == 0) {
permits += n;
notifyAll();
} else {
permits += n;
}
}
public synchronized void take() throws InterruptedException {
take(1);
}
public synchronized void take(int amount) throws InterruptedException {
assert permits >= 0;
while (amount > 0) {
int n = Math.min(amount, permits);
permits -= n;
amount -= n;
if (amount > 0)
wait();
}
}
}
@Override
void sendHeadersOnly() throws IOException, InterruptedException {
if (Log.requests() && request != null) {
Log.logRequest(request.toString());
}
requestContentLen = requestProcessor.onRequestStart(request, userRequestFlowController);
OutgoingHeaders f = headerFrame(requestContentLen);
connection.sendFrame(f);
}
@Override
void sendBody() throws IOException, InterruptedException {
sendBodyImpl();
}
void registerStream(int id) {
this.streamid = id;
connection.putStream(this, streamid);
}
DataFrame getDataFrame() throws IOException, InterruptedException {
userRequestFlowController.take();
int maxpayloadLen = connection.getMaxSendFrameSize();
ByteBuffer buffer = connection.getBuffer();
buffer.limit(maxpayloadLen);
boolean complete = requestProcessor.onRequestBodyChunk(buffer);
buffer.flip();
int amount = buffer.remaining();
// wait for flow control if necessary. Following method will block
// until after headers frame is sent, so correct streamid is set.
remoteRequestFlowController.take(amount);
connection.obtainSendWindow(amount);
DataFrame df = new DataFrame();
df.streamid(streamid);
if (complete) {
df.setFlag(DataFrame.END_STREAM);
}
df.setData(buffer);
df.computeLength();
return df;
}
@Override
CompletableFuture<Void> sendHeadersAsync() {
try {
sendHeadersOnly();
return CompletableFuture.completedFuture(null);
} catch (IOException | InterruptedException ex) {
return CompletableFuture.failedFuture(ex);
}
}
/**
* A List of responses relating to this stream. Normally there is only
* one response, but intermediate responses like 100 are allowed
* and must be passed up to higher level before continuing. Deals with races
* such as if responses are returned before the CFs get created by
* getResponseAsync()
*/
final List<CompletableFuture<HttpResponseImpl>> response_cfs = new ArrayList<>(5);
@Override
CompletableFuture<HttpResponseImpl> getResponseAsync(Void v) {
CompletableFuture<HttpResponseImpl> cf;
synchronized (response_cfs) {
if (!response_cfs.isEmpty()) {
cf = response_cfs.remove(0);
} else {
cf = new CompletableFuture<>();
response_cfs.add(cf);
}
}
PushGroup<?> pg = request.pushGroup();
if (pg != null) {
// if an error occurs make sure it is recorded in the PushGroup
cf = cf.whenComplete((t,e) -> pg.pushError(e));
}
return cf;
}
/**
* Completes the first uncompleted CF on list, and removes it. If there is no
* uncompleted CF then creates one (completes it) and adds to list
*/
void completeResponse(HttpResponse r) {
HttpResponseImpl resp = (HttpResponseImpl)r;
synchronized (response_cfs) {
int cfs_len = response_cfs.size();
for (int i=0; i<cfs_len; i++) {
CompletableFuture<HttpResponseImpl> cf = response_cfs.get(i);
if (!cf.isDone()) {
cf.complete(resp);
response_cfs.remove(cf);
return;
}
}
response_cfs.add(CompletableFuture.completedFuture(resp));
}
}
// methods to update state and remove stream when finished
synchronized void requestSent() {
requestSent = true;
if (responseReceived)
connection.deleteStream(this);
}
synchronized void responseReceived() {
responseReceived = true;
if (requestSent)
connection.deleteStream(this);
PushGroup<?> pg = request.pushGroup();
if (pg != null)
pg.noMorePushes();
}
/**
* same as above but for errors
*
* @param t
*/
void completeResponseExceptionally(Throwable t) {
synchronized (response_cfs) {
for (CompletableFuture<HttpResponseImpl> cf : response_cfs) {
if (!cf.isDone()) {
cf.completeExceptionally(t);
response_cfs.remove(cf);
return;
}
}
response_cfs.add(CompletableFuture.failedFuture(t));
}
}
void sendBodyImpl() throws IOException, InterruptedException {
if (requestContentLen == 0) {
// no body
requestSent();
return;
}
DataFrame df;
do {
df = getDataFrame();
// TODO: check accumulated content length (if not checked below)
connection.sendFrame(df);
} while (!df.getFlag(DataFrame.END_STREAM));
requestSent();
}
@Override
void cancel() {
cancelImpl(new Exception("Cancelled"));
}
void cancelImpl(Throwable e) {
Log.logTrace("cancelling stream: {0}\n", e.toString());
inputQ.close();
completeResponseExceptionally(e);
try {
connection.resetStream(streamid, ResetFrame.CANCEL);
} catch (IOException | InterruptedException ex) {
Log.logError(ex);
}
}
@Override
CompletableFuture<Void> sendRequestAsync() {
CompletableFuture<Void> cf = new CompletableFuture<>();
executor.execute(() -> {
try {
sendRequest();
cf.complete(null);
} catch (IOException |InterruptedException e) {
cf.completeExceptionally(e);
}
}, null);
return cf;
}
@Override
<T> T responseBody(HttpResponse.BodyProcessor<T> processor) throws IOException {
this.responseProcessor = processor;
T body = processor.onResponseBodyStart(
responseContentLen, responseHeaders,
responseFlowController); // TODO: filter headers
if (body == null) {
receiveData();
body = processor.onResponseComplete();
} else
receiveDataAsync(processor);
responseReceived();
return body;
}
// called from Http2Connection reader thread
synchronized void updateOutgoingWindow(int update) {
remoteRequestFlowController.accept(update);
}
void close(String msg) {
cancel();
}
static class PushedStream extends Stream {
final PushGroup<?> pushGroup;
final private Stream parent; // used by server push streams
// push streams need the response CF allocated up front as it is
// given directly to user via the multi handler callback function.
final CompletableFuture<HttpResponseImpl> pushCF;
final HttpRequestImpl pushReq;
PushedStream(PushGroup<?> pushGroup, HttpClientImpl client,
Http2Connection connection, Stream parent,
HttpRequestImpl pushReq) {
super(client, connection, pushReq);
this.pushGroup = pushGroup;
this.pushReq = pushReq;
this.pushCF = new CompletableFuture<>();
this.parent = parent;
}
// Following methods call the super class but in case of
// error record it in the PushGroup. The error method is called
// with a null value when no error occurred (is a no-op)
@Override
CompletableFuture<Void> sendBodyAsync() {
return super.sendBodyAsync()
.whenComplete((v, t) -> pushGroup.pushError(t));
}
@Override
CompletableFuture<Void> sendHeadersAsync() {
return super.sendHeadersAsync()
.whenComplete((v, t) -> pushGroup.pushError(t));
}
@Override
CompletableFuture<Void> sendRequestAsync() {
return super.sendRequestAsync()
.whenComplete((v, t) -> pushGroup.pushError(t));
}
@Override
CompletableFuture<HttpResponseImpl> getResponseAsync(Void vo) {
return pushCF.whenComplete((v, t) -> pushGroup.pushError(t));
}
@Override
<T> CompletableFuture<T> responseBodyAsync(HttpResponse.BodyProcessor<T> processor) {
return super.responseBodyAsync(processor)
.whenComplete((v, t) -> pushGroup.pushError(t));
}
@Override
void completeResponse(HttpResponse r) {
HttpResponseImpl resp = (HttpResponseImpl)r;
Utils.logResponse(resp);
pushCF.complete(resp);
}
@Override
void completeResponseExceptionally(Throwable t) {
pushCF.completeExceptionally(t);
}
@Override
synchronized void responseReceived() {
super.responseReceived();
pushGroup.pushCompleted();
}
// create and return the PushResponseImpl
@Override
protected void handleResponse() {
HttpConnection c = connection.connection; // TODO: improve
long statusCode = responseHeaders
.firstValueAsLong(":status")
.orElse(-1L);
if (statusCode == -1L)
completeResponseExceptionally(new IOException("No status code"));
ImmutableHeaders h = new ImmutableHeaders(responseHeaders, Utils.ALL_HEADERS);
this.response = new HttpResponseImpl((int)statusCode, pushReq, h, this,
c.sslParameters());
this.responseContentLen = responseHeaders
.firstValueAsLong("content-length")
.orElse(-1L);
// different implementations for normal streams and pushed streams
completeResponse(response);
}
}
/**
* One PushGroup object is associated with the parent Stream of
* the pushed Streams. This keeps track of all common state associated
* with the pushes.
*/
static class PushGroup<T> {
// the overall completion object, completed when all pushes are done.
final CompletableFuture<T> resultCF;
Throwable error; // any exception that occured during pushes
// CF for main response
final CompletableFuture<HttpResponse> mainResponse;
// user's processor object
final HttpResponse.MultiProcessor<T> multiProcessor;
// per push handler function provided by processor
final private BiFunction<HttpRequest,
CompletableFuture<HttpResponse>,
Boolean> pushHandler;
int numberOfPushes;
int remainingPushes;
boolean noMorePushes = false;
PushGroup(HttpResponse.MultiProcessor<T> multiProcessor, HttpRequestImpl req) {
this.resultCF = new CompletableFuture<>();
this.mainResponse = new CompletableFuture<>();
this.multiProcessor = multiProcessor;
this.pushHandler = multiProcessor.onStart(req, mainResponse);
}
CompletableFuture<T> groupResult() {
return resultCF;
}
CompletableFuture<HttpResponse> mainResponse() {
return mainResponse;
}
private BiFunction<HttpRequest,
CompletableFuture<HttpResponse>, Boolean> pushHandler()
{
return pushHandler;
}
synchronized void addPush() {
numberOfPushes++;
remainingPushes++;
}
synchronized int numberOfPushes() {
return numberOfPushes;
}
// This is called when the main body response completes because it means
// no more PUSH_PROMISEs are possible
synchronized void noMorePushes() {
noMorePushes = true;
checkIfCompleted();
}
synchronized void pushCompleted() {
remainingPushes--;
checkIfCompleted();
}
synchronized void checkIfCompleted() {
if (remainingPushes == 0 && error == null && noMorePushes) {
T overallResult = multiProcessor.onComplete();
resultCF.complete(overallResult);
}
}
synchronized void pushError(Throwable t) {
if (t == null)
return;
this.error = t;
resultCF.completeExceptionally(t);
}
}
}

View File

@ -1,351 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import sun.net.NetProperties;
import javax.net.ssl.SSLParameters;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.IOException;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.net.InetSocketAddress;
import java.net.NetPermission;
import java.net.URI;
import java.net.URLPermission;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.function.LongBinaryOperator;
import java.util.function.Predicate;
/**
* Miscellaneous utilities
*/
final class Utils {
/**
* Allocated buffer size. Must never be higher than 16K. But can be lower
* if smaller allocation units preferred. HTTP/2 mandates that all
* implementations support frame payloads of at least 16K.
*/
public static final int BUFSIZE = 16 * 1024;
private static final Set<String> DISALLOWED_HEADERS_SET = Set.of(
"authorization", "connection", "cookie", "content-length",
"date", "expect", "from", "host", "origin", "proxy-authorization",
"referer", "user-agent", "upgrade", "via", "warning");
static final Predicate<String>
ALLOWED_HEADERS = header -> !Utils.DISALLOWED_HEADERS_SET.contains(header);
static final Predicate<String>
ALL_HEADERS = header -> true;
static InetSocketAddress getAddress(HttpRequestImpl req) {
URI uri = req.uri();
if (uri == null) {
return req.authority();
}
int port = uri.getPort();
if (port == -1) {
if (uri.getScheme().equalsIgnoreCase("https")) {
port = 443;
} else {
port = 80;
}
}
String host = uri.getHost();
if (req.proxy() == null) {
return new InetSocketAddress(host, port);
} else {
return InetSocketAddress.createUnresolved(host, port);
}
}
/**
* Puts position to limit and limit to capacity so we can resume reading
* into this buffer, but if required > 0 then limit may be reduced so that
* no more than required bytes are read next time.
*/
static void resumeChannelRead(ByteBuffer buf, int required) {
int limit = buf.limit();
buf.position(limit);
int capacity = buf.capacity() - limit;
if (required > 0 && required < capacity) {
buf.limit(limit + required);
} else {
buf.limit(buf.capacity());
}
}
private Utils() { }
/**
* Validates a RFC7230 token
*/
static void validateToken(String token, String errormsg) {
int length = token.length();
for (int i = 0; i < length; i++) {
int c = token.codePointAt(i);
if (c >= 0x30 && c <= 0x39 // 0 - 9
|| (c >= 0x61 && c <= 0x7a) // a - z
|| (c >= 0x41 && c <= 0x5a) // A - Z
|| (c >= 0x21 && c <= 0x2e && c != 0x22 && c != 0x27 && c != 0x2c)
|| (c >= 0x5e && c <= 0x60)
|| (c == 0x7c) || (c == 0x7e)) {
} else {
throw new IllegalArgumentException(errormsg);
}
}
}
/**
* Returns the security permission required for the given details.
* If method is CONNECT, then uri must be of form "scheme://host:port"
*/
static URLPermission getPermission(URI uri,
String method,
Map<String, List<String>> headers) {
StringBuilder sb = new StringBuilder();
String urlstring, actionstring;
if (method.equals("CONNECT")) {
urlstring = uri.toString();
actionstring = "CONNECT";
} else {
sb.append(uri.getScheme())
.append("://")
.append(uri.getAuthority())
.append(uri.getPath());
urlstring = sb.toString();
sb = new StringBuilder();
sb.append(method);
if (headers != null && !headers.isEmpty()) {
sb.append(':');
Set<String> keys = headers.keySet();
boolean first = true;
for (String key : keys) {
if (!first) {
sb.append(',');
}
sb.append(key);
first = false;
}
}
actionstring = sb.toString();
}
return new URLPermission(urlstring, actionstring);
}
static void checkNetPermission(String target) {
SecurityManager sm = System.getSecurityManager();
if (sm == null)
return;
NetPermission np = new NetPermission(target);
sm.checkPermission(np);
}
static int getIntegerNetProperty(String name, int defaultValue) {
return AccessController.doPrivileged((PrivilegedAction<Integer>) () ->
NetProperties.getInteger(name, defaultValue));
}
static String getNetProperty(String name) {
return AccessController.doPrivileged((PrivilegedAction<String>) () ->
NetProperties.get(name));
}
static SSLParameters copySSLParameters(SSLParameters p) {
SSLParameters p1 = new SSLParameters();
p1.setAlgorithmConstraints(p.getAlgorithmConstraints());
p1.setCipherSuites(p.getCipherSuites());
p1.setEnableRetransmissions(p.getEnableRetransmissions());
p1.setEndpointIdentificationAlgorithm(p.getEndpointIdentificationAlgorithm());
p1.setMaximumPacketSize(p.getMaximumPacketSize());
p1.setNeedClientAuth(p.getNeedClientAuth());
String[] protocols = p.getProtocols();
if (protocols != null)
p1.setProtocols(protocols.clone());
p1.setSNIMatchers(p.getSNIMatchers());
p1.setServerNames(p.getServerNames());
p1.setUseCipherSuitesOrder(p.getUseCipherSuitesOrder());
p1.setWantClientAuth(p.getWantClientAuth());
return p1;
}
/**
* Set limit to position, and position to mark.
*/
static void flipToMark(ByteBuffer buffer, int mark) {
buffer.limit(buffer.position());
buffer.position(mark);
}
static String stackTrace(Throwable t) {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
String s = null;
try {
PrintStream p = new PrintStream(bos, true, "US-ASCII");
t.printStackTrace(p);
s = bos.toString("US-ASCII");
} catch (UnsupportedEncodingException ex) {
// can't happen
}
return s;
}
/**
* Copies as much of src to dst as possible.
*/
static void copy(ByteBuffer src, ByteBuffer dst) {
int srcLen = src.remaining();
int dstLen = dst.remaining();
if (srcLen > dstLen) {
int diff = srcLen - dstLen;
int limit = src.limit();
src.limit(limit - diff);
dst.put(src);
src.limit(limit);
} else {
dst.put(src);
}
}
static ByteBuffer copy(ByteBuffer src) {
ByteBuffer dst = ByteBuffer.allocate(src.remaining());
dst.put(src);
dst.flip();
return dst;
}
//
// Helps to trim long names (packages, nested/inner types) in logs/toString
//
static String toStringSimple(Object o) {
return o.getClass().getSimpleName() + "@" +
Integer.toHexString(System.identityHashCode(o));
}
//
// 1. It adds a number of remaining bytes;
// 2. Standard Buffer-type toString for CharBuffer (since it adheres to the
// contract of java.lang.CharSequence.toString() which is both not too
// useful and not too private)
//
static String toString(Buffer b) {
return toStringSimple(b)
+ "[pos=" + b.position()
+ " lim=" + b.limit()
+ " cap=" + b.capacity()
+ " rem=" + b.remaining() + "]";
}
static String toString(CharSequence s) {
return s == null
? "null"
: toStringSimple(s) + "[len=" + s.length() + "]";
}
static String dump(Object... objects) {
return Arrays.toString(objects);
}
static final System.Logger logger = System.getLogger("java.net.http.WebSocket");
static final ByteBuffer EMPTY_BYTE_BUFFER = ByteBuffer.allocate(0);
static String webSocketSpecViolation(String section, String detail) {
return "RFC 6455 " + section + " " + detail;
}
static void logResponse(HttpResponseImpl r) {
if (!Log.requests()) {
return;
}
StringBuilder sb = new StringBuilder();
String method = r.request().method();
URI uri = r.uri();
String uristring = uri == null ? "" : uri.toString();
sb.append('(').append(method).append(" ").append(uristring).append(") ").append(Integer.toString(r.statusCode()));
Log.logResponse(sb.toString());
}
static int remaining(ByteBuffer[] bufs) {
int remain = 0;
for (ByteBuffer buf : bufs)
remain += buf.remaining();
return remain;
}
// assumes buffer was written into starting at position zero
static void unflip(ByteBuffer buf) {
buf.position(buf.limit());
buf.limit(buf.capacity());
}
static void close(Closeable... chans) {
for (Closeable chan : chans) {
try {
chan.close();
} catch (IOException e) {
}
}
}
static ByteBuffer[] reduce(ByteBuffer[] bufs, int start, int number) {
if (start == 0 && number == bufs.length)
return bufs;
ByteBuffer[] nbufs = new ByteBuffer[number];
int j = 0;
for (int i=start; i<start+number; i++)
nbufs[j++] = bufs[i];
return nbufs;
}
static String asString(ByteBuffer buf) {
byte[] b = new byte[buf.remaining()];
buf.get(b);
return new String(b, StandardCharsets.US_ASCII);
}
// Put all these static 'empty' singletons here
@SuppressWarnings("rawtypes")
static CompletableFuture[] EMPTY_CFARRAY = new CompletableFuture[0];
static ByteBuffer EMPTY_BYTEBUFFER = ByteBuffer.allocate(0);
static ByteBuffer[] EMPTY_BB_ARRAY = new ByteBuffer[0];
}

View File

@ -1,376 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.io.IOException;
import java.net.ProtocolException;
import java.net.http.WSOpeningHandshake.Result;
import java.nio.ByteBuffer;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
import java.util.function.Supplier;
import static java.lang.System.Logger.Level.ERROR;
import static java.lang.System.Logger.Level.WARNING;
import static java.net.http.WSUtils.logger;
import static java.util.Objects.requireNonNull;
/*
* A WebSocket client.
*
* Consists of two independent parts; a transmitter responsible for sending
* messages, and a receiver which notifies the listener of incoming messages.
*/
final class WS implements WebSocket {
private final String subprotocol;
private final RawChannel channel;
private final WSTransmitter transmitter;
private final WSReceiver receiver;
private final Listener listener;
private final Object stateLock = new Object();
private volatile State state = State.CONNECTED;
private final CompletableFuture<Void> whenClosed = new CompletableFuture<>();
static CompletableFuture<WebSocket> newInstanceAsync(WSBuilder b) {
CompletableFuture<Result> result = new WSOpeningHandshake(b).performAsync();
Listener listener = b.getListener();
Executor executor = b.getClient().executorService();
return result.thenApply(r -> {
WS ws = new WS(listener, r.subprotocol, r.channel, executor);
ws.start();
return ws;
});
}
private WS(Listener listener, String subprotocol, RawChannel channel,
Executor executor) {
this.listener = wrapListener(listener);
this.channel = channel;
this.subprotocol = subprotocol;
Consumer<Throwable> errorHandler = error -> {
if (error == null) {
throw new InternalError();
}
// If the channel is closed, we need to update the state, to denote
// there's no point in trying to continue using WebSocket
if (!channel.isOpen()) {
synchronized (stateLock) {
tryChangeState(State.ERROR);
}
}
};
transmitter = new WSTransmitter(this, executor, channel, errorHandler);
receiver = new WSReceiver(this.listener, this, executor, channel);
}
private void start() {
receiver.start();
}
@Override
public CompletableFuture<WebSocket> sendText(CharSequence message, boolean isLast) {
requireNonNull(message, "message");
synchronized (stateLock) {
checkState();
return transmitter.sendText(message, isLast);
}
}
@Override
public CompletableFuture<WebSocket> sendBinary(ByteBuffer message, boolean isLast) {
requireNonNull(message, "message");
synchronized (stateLock) {
checkState();
return transmitter.sendBinary(message, isLast);
}
}
@Override
public CompletableFuture<WebSocket> sendPing(ByteBuffer message) {
requireNonNull(message, "message");
synchronized (stateLock) {
checkState();
return transmitter.sendPing(message);
}
}
@Override
public CompletableFuture<WebSocket> sendPong(ByteBuffer message) {
requireNonNull(message, "message");
synchronized (stateLock) {
checkState();
return transmitter.sendPong(message);
}
}
@Override
public CompletableFuture<WebSocket> sendClose(CloseCode code, CharSequence reason) {
requireNonNull(code, "code");
requireNonNull(reason, "reason");
synchronized (stateLock) {
return doSendClose(() -> transmitter.sendClose(code, reason));
}
}
@Override
public CompletableFuture<WebSocket> sendClose() {
synchronized (stateLock) {
return doSendClose(() -> transmitter.sendClose());
}
}
private CompletableFuture<WebSocket> doSendClose(Supplier<CompletableFuture<WebSocket>> s) {
checkState();
boolean closeChannel = false;
synchronized (stateLock) {
if (state == State.CLOSED_REMOTELY) {
closeChannel = tryChangeState(State.CLOSED);
} else {
tryChangeState(State.CLOSED_LOCALLY);
}
}
CompletableFuture<WebSocket> sent = s.get();
if (closeChannel) {
sent.whenComplete((v, t) -> {
try {
channel.close();
} catch (IOException e) {
logger.log(ERROR, "Error transitioning to state " + State.CLOSED, e);
}
});
}
return sent;
}
@Override
public void request(long n) {
if (n < 0L) {
throw new IllegalArgumentException("The number must not be negative: " + n);
}
receiver.request(n);
}
@Override
public String getSubprotocol() {
return subprotocol;
}
@Override
public boolean isClosed() {
return state.isTerminal();
}
@Override
public void abort() throws IOException {
synchronized (stateLock) {
tryChangeState(State.ABORTED);
}
channel.close();
}
@Override
public String toString() {
return super.toString() + "[" + state + "]";
}
private void checkState() {
if (state.isTerminal() || state == State.CLOSED_LOCALLY) {
throw new IllegalStateException("WebSocket is closed [" + state + "]");
}
}
/*
* Wraps the user's listener passed to the constructor into own listener to
* intercept transitions to terminal states (onClose and onError) and to act
* upon exceptions and values from the user's listener.
*/
private Listener wrapListener(Listener listener) {
return new Listener() {
// Listener's method MUST be invoked in a happen-before order
private final Object visibilityLock = new Object();
@Override
public void onOpen(WebSocket webSocket) {
synchronized (visibilityLock) {
listener.onOpen(webSocket);
}
}
@Override
public CompletionStage<?> onText(WebSocket webSocket, CharSequence message,
MessagePart part) {
synchronized (visibilityLock) {
return listener.onText(webSocket, message, part);
}
}
@Override
public CompletionStage<?> onBinary(WebSocket webSocket, ByteBuffer message,
MessagePart part) {
synchronized (visibilityLock) {
return listener.onBinary(webSocket, message, part);
}
}
@Override
public CompletionStage<?> onPing(WebSocket webSocket, ByteBuffer message) {
synchronized (visibilityLock) {
return listener.onPing(webSocket, message);
}
}
@Override
public CompletionStage<?> onPong(WebSocket webSocket, ByteBuffer message) {
synchronized (visibilityLock) {
return listener.onPong(webSocket, message);
}
}
@Override
public void onClose(WebSocket webSocket, Optional<CloseCode> code, String reason) {
synchronized (stateLock) {
if (state == State.CLOSED_REMOTELY || state.isTerminal()) {
throw new InternalError("Unexpected onClose in state " + state);
} else if (state == State.CLOSED_LOCALLY) {
try {
channel.close();
} catch (IOException e) {
logger.log(ERROR, "Error transitioning to state " + State.CLOSED, e);
}
tryChangeState(State.CLOSED);
} else if (state == State.CONNECTED) {
tryChangeState(State.CLOSED_REMOTELY);
}
}
synchronized (visibilityLock) {
listener.onClose(webSocket, code, reason);
}
}
@Override
public void onError(WebSocket webSocket, Throwable error) {
// An error doesn't necessarily mean the connection must be
// closed automatically
if (!channel.isOpen()) {
synchronized (stateLock) {
tryChangeState(State.ERROR);
}
} else if (error instanceof ProtocolException
&& error.getCause() instanceof WSProtocolException) {
WSProtocolException cause = (WSProtocolException) error.getCause();
logger.log(WARNING, "Failing connection {0}, reason: ''{1}''",
webSocket, cause.getMessage());
CloseCode cc = cause.getCloseCode();
transmitter.sendClose(cc, "").whenComplete((v, t) -> {
synchronized (stateLock) {
tryChangeState(State.ERROR);
}
try {
channel.close();
} catch (IOException e) {
logger.log(ERROR, e);
}
});
}
synchronized (visibilityLock) {
listener.onError(webSocket, error);
}
}
};
}
private boolean tryChangeState(State newState) {
assert Thread.holdsLock(stateLock);
if (state.isTerminal()) {
return false;
}
state = newState;
if (newState.isTerminal()) {
whenClosed.complete(null);
}
return true;
}
CompletionStage<Void> whenClosed() {
return whenClosed;
}
/*
* WebSocket connection internal state.
*/
private enum State {
/*
* Initial WebSocket state. The WebSocket is connected (i.e. remains in
* this state) unless proven otherwise. For example, by reading or
* writing operations on the channel.
*/
CONNECTED,
/*
* A Close message has been received by the client. No more messages
* will be received.
*/
CLOSED_REMOTELY,
/*
* A Close message has been sent by the client. No more messages can be
* sent.
*/
CLOSED_LOCALLY,
/*
* Close messages has been both sent and received (closing handshake)
* and TCP connection closed. Closed _cleanly_ in terms of RFC 6455.
*/
CLOSED,
/*
* The connection has been aborted by the client. Closed not _cleanly_
* in terms of RFC 6455.
*/
ABORTED,
/*
* The connection has been terminated due to a protocol or I/O error.
* Might happen during sending or receiving.
*/
ERROR;
/*
* Returns `true` if this state is terminal. If WebSocket has transited
* to such a state, if remains in it forever.
*/
boolean isTerminal() {
return this == CLOSED || this == ABORTED || this == ERROR;
}
}
}

View File

@ -1,169 +0,0 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net.http;
import java.net.URI;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import static java.lang.String.format;
import static java.util.Objects.requireNonNull;
final class WSBuilder implements WebSocket.Builder {
private static final Set<String> FORBIDDEN_HEADERS =
new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
static {
List<String> headers = List.of("Connection", "Upgrade",
"Sec-WebSocket-Accept", "Sec-WebSocket-Extensions",
"Sec-WebSocket-Key", "Sec-WebSocket-Protocol",
"Sec-WebSocket-Version");
FORBIDDEN_HEADERS.addAll(headers);
}
private final URI uri;
private final HttpClient client;
private final LinkedHashMap<String, List<String>> headers = new LinkedHashMap<>();
private final WebSocket.Listener listener;
private Collection<String> subprotocols = Collections.emptyList();
private Duration timeout;
WSBuilder(URI uri, HttpClient client, WebSocket.Listener listener) {
checkURI(requireNonNull(uri, "uri"));
requireNonNull(client, "client");
requireNonNull(listener, "listener");
this.uri = uri;
this.listener = listener;
this.client = client;
}
@Override
public WebSocket.Builder header(String name, String value) {
requireNonNull(name, "name");
requireNonNull(value, "value");
if (FORBIDDEN_HEADERS.contains(name)) {
throw new IllegalArgumentException(
format("Header '%s' is used in the WebSocket Protocol", name));
}
List<String> values = headers.computeIfAbsent(name, n -> new LinkedList<>());
values.add(value);
return this;
}
@Override
public WebSocket.Builder subprotocols(String mostPreferred, String... lesserPreferred) {
requireNonNull(mostPreferred, "mostPreferred");
requireNonNull(lesserPreferred, "lesserPreferred");
this.subprotocols = checkSubprotocols(mostPreferred, lesserPreferred);
return this;
}
@Override
public WebSocket.Builder connectTimeout(Duration timeout) {
this.timeout = requireNonNull(timeout, "timeout");
return this;
}
@Override
public CompletableFuture<WebSocket> buildAsync() {
return WS.newInstanceAsync(this);
}
private static URI checkURI(URI uri) {
String s = uri.getScheme();
if (!("ws".equalsIgnoreCase(s) || "wss".equalsIgnoreCase(s))) {
throw new IllegalArgumentException
("URI scheme not ws or wss (RFC 6455 3.): " + s);
}
String fragment = uri.getFragment();
if (fragment != null) {
throw new IllegalArgumentException(format
("Fragment not allowed in a WebSocket URI (RFC 6455 3.): '%s'",
fragment));
}
return uri;
}
URI getUri() { return uri; }
HttpClient getClient() { return client; }
Map<String, List<String>> getHeaders() {
LinkedHashMap<String, List<String>> copy = new LinkedHashMap<>(headers.size());
headers.forEach((name, values) -> copy.put(name, new LinkedList<>(values)));
return copy;
}
WebSocket.Listener getListener() { return listener; }
Collection<String> getSubprotocols() {
return new ArrayList<>(subprotocols);
}
Duration getConnectTimeout() { return timeout; }
private static Collection<String> checkSubprotocols(String mostPreferred,
String... lesserPreferred) {
checkSubprotocolSyntax(mostPreferred, "mostPreferred");
LinkedHashSet<String> sp = new LinkedHashSet<>(1 + lesserPreferred.length);
sp.add(mostPreferred);
for (int i = 0; i < lesserPreferred.length; i++) {
String p = lesserPreferred[i];
String location = format("lesserPreferred[%s]", i);
requireNonNull(p, location);
checkSubprotocolSyntax(p, location);
if (!sp.add(p)) {
throw new IllegalArgumentException(format(
"Duplicate subprotocols (RFC 6455 4.1.): '%s'", p));
}
}
return sp;
}
private static void checkSubprotocolSyntax(String subprotocol, String location) {
if (subprotocol.isEmpty()) {
throw new IllegalArgumentException
("Subprotocol name is empty (RFC 6455 4.1.): " + location);
}
if (!subprotocol.chars().allMatch(c -> 0x21 <= c && c <= 0x7e)) {
throw new IllegalArgumentException
("Subprotocol name contains illegal characters (RFC 6455 4.1.): "
+ location);
}
}
}

Some files were not shown because too many files have changed in this diff Show More