--- a/make/CompileToolsJdk.gmk Tue Oct 16 15:45:19 2018 +0200
+++ b/make/CompileToolsJdk.gmk Wed Oct 17 08:09:46 2018 -0700
@@ -46,6 +46,7 @@
SETUP := GENERATE_OLDBYTECODE, \
SRC := $(BUILD_TOOLS_SRC_DIRS), \
EXCLUDES := \
+ build/tools/classlist \
build/tools/deps \
build/tools/docs \
build/tools/jigsaw \
--- a/make/GenerateLinkOptData.gmk Tue Oct 16 15:45:19 2018 +0200
+++ b/make/GenerateLinkOptData.gmk Wed Oct 17 08:09:46 2018 -0700
@@ -31,15 +31,17 @@
include $(SPEC)
include MakeBase.gmk
-include JarArchive.gmk
+include SetupJavaCompilers.gmk
################################################################################
# Create a jar with our generator class. Using a jar is intentional since it
# will load more classes
-$(eval $(call SetupJarArchive, CLASSLIST_JAR, \
- SRCS := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \
+$(eval $(call SetupJavaCompilation, CLASSLIST_JAR, \
+ SETUP := GENERATE_JDKBYTECODE, \
+ SRC := $(TOPDIR)/make/jdk/src/classes, \
INCLUDES := build/tools/classlist, \
+ BIN := $(BUILDTOOLS_OUTPUTDIR)/classlist_classes, \
JAR := $(SUPPORT_OUTPUTDIR)/classlist.jar, \
))
--- a/make/Help.gmk Tue Oct 16 15:45:19 2018 +0200
+++ b/make/Help.gmk Wed Oct 17 08:09:46 2018 -0700
@@ -120,7 +120,7 @@
run-test-prebuilt:
@( cd $(topdir) && \
$(MAKE) --no-print-directory -r -R -I make/common/ -f make/RunTestsPrebuilt.gmk \
- run-test-prebuilt TEST="$(TEST)" )
+ run-test-prebuilt CUSTOM_MAKE_DIR=$(CUSTOM_MAKE_DIR) TEST="$(TEST)" )
ALL_GLOBAL_TARGETS := help print-configurations run-test-prebuilt
--- a/make/RunTests.gmk Tue Oct 16 15:45:19 2018 +0200
+++ b/make/RunTests.gmk Wed Oct 17 08:09:46 2018 -0700
@@ -45,8 +45,8 @@
endif
$(eval $(call ParseKeywordVariable, TEST_OPTS, \
- KEYWORDS := JOBS TIMEOUT, \
- STRING_KEYWORDS := VM_OPTIONS, \
+ SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR, \
+ STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS, \
))
# Helper function to propagate TEST_OPTS values.
@@ -104,6 +104,31 @@
GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, $(GTEST_LAUNCHER_DIRS)))
################################################################################
+# Setup global test running parameters
+################################################################################
+
+# Each factor variable comes in 3 variants. The first one is reserved for users
+# to use on command line. The other two are for predifined configurations in JDL
+# and for machine specific configurations respectively.
+TEST_JOBS_FACTOR ?= 1
+TEST_JOBS_FACTOR_JDL ?= 1
+TEST_JOBS_FACTOR_MACHINE ?= 1
+
+ifeq ($(TEST_JOBS), 0)
+ # Concurrency based on min(cores / 2, 12) * TEST_JOBS_FACTOR
+ TEST_JOBS := $(shell $(AWK) \
+ 'BEGIN { \
+ c = $(NUM_CORES) / 2; \
+ if (c > 12) c = 12; \
+ c = c * $(TEST_JOBS_FACTOR); \
+ c = c * $(TEST_JOBS_FACTOR_JDL); \
+ c = c * $(TEST_JOBS_FACTOR_MACHINE); \
+ if (c < 1) c = 1; \
+ printf "%.0f", c; \
+ }')
+endif
+
+################################################################################
# Parse control variables
################################################################################
@@ -112,17 +137,21 @@
ifneq ($(TEST_OPTS), )
# Inform the user
$(info Running tests using TEST_OPTS control variable '$(TEST_OPTS)')
-
- $(eval $(call SetTestOpt,VM_OPTIONS,JTREG))
- $(eval $(call SetTestOpt,VM_OPTIONS,GTEST))
- $(eval $(call SetTestOpt,VM_OPTIONS,MICRO))
-
- $(eval $(call SetTestOpt,JOBS,JTREG))
- $(eval $(call SetTestOpt,TIMEOUT,JTREG))
endif
+$(eval $(call SetTestOpt,VM_OPTIONS,JTREG))
+$(eval $(call SetTestOpt,JAVA_OPTIONS,JTREG))
+$(eval $(call SetTestOpt,VM_OPTIONS,GTEST))
+$(eval $(call SetTestOpt,JAVA_OPTIONS,GTEST))
+$(eval $(call SetTestOpt,VM_OPTIONS,MICRO))
+$(eval $(call SetTestOpt,JAVA_OPTIONS,MICRO))
+
+$(eval $(call SetTestOpt,JOBS,JTREG))
+$(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG))
+
$(eval $(call ParseKeywordVariable, JTREG, \
- KEYWORDS := JOBS TIMEOUT TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM, \
+ SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM \
+ EXTRA_PROBLEM_LISTS KEYWORDS, \
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS, \
))
@@ -134,8 +163,8 @@
### Gtest
$(eval $(call ParseKeywordVariable, GTEST, \
- KEYWORDS := REPEAT, \
- STRING_KEYWORDS := OPTIONS VM_OPTIONS, \
+ SINGLE_KEYWORDS := REPEAT, \
+ STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS, \
))
ifneq ($(GTEST), )
@@ -160,17 +189,6 @@
# Component-specific Jtreg settings
################################################################################
-ifeq ($(TEST_JOBS), 0)
- # If TEST_JOBS is not specified, hotspot fallback default is
- # min(num_cores / 2, 12).
- hotspot_JTREG_JOBS := $(shell $(EXPR) $(NUM_CORES) / 2)
- ifeq ($(hotspot_JTREG_JOBS), 0)
- hotspot_JTREG_JOBS := 1
- else ifeq ($(shell $(EXPR) $(hotspot_JTREG_JOBS) \> 12), 1)
- hotspot_JTREG_JOBS := 12
- endif
-endif
-
hotspot_JTREG_MAX_MEM := 0
hotspot_JTREG_ASSERT := false
hotspot_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/hotspot/jtreg/native
@@ -182,6 +200,8 @@
nashorn_JTREG_PROBLEM_LIST += $(TOPDIR)/test/nashorn/ProblemList.txt
hotspot_JTREG_PROBLEM_LIST += $(TOPDIR)/test/hotspot/jtreg/ProblemList.txt
+langtools_JTREG_MAX_MEM := 768m
+
################################################################################
# Parse test selection
#
@@ -406,15 +426,16 @@
$1_GTEST_REPEAT :=--gtest_repeat=$$(GTEST_REPEAT)
endif
- run-test-$1:
+ run-test-$1: $(TEST_PREREQS)
$$(call LogWarn)
$$(call LogWarn, Running test '$$($1_TEST)')
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/gtest, \
$$(FIXPATH) $$(TEST_IMAGE_DIR)/hotspot/gtest/$$($1_VARIANT)/gtestLauncher \
- -jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \
- --gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
- $$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) $$(GTEST_VM_OPTIONS) \
+ -jdk $(JDK_IMAGE_DIR) $$($1_GTEST_FILTER) \
+ --gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
+ $$($1_GTEST_REPEAT) $$(GTEST_OPTIONS) $$(GTEST_VM_OPTIONS) \
+ $$($1_GTEST_JAVA_OPTIONS) \
> >($(TEE) $$($1_TEST_RESULTS_DIR)/gtest.txt) \
&& $$(ECHO) $$$$? > $$($1_EXITCODE) \
|| $$(ECHO) $$$$? > $$($1_EXITCODE) \
@@ -492,8 +513,8 @@
$1_MICRO_BASIC_OPTIONS += -rf $$(MICRO_RESULTS_FORMAT) -rff $$($1_TEST_RESULTS_DIR)/jmh-result.$(MICRO_RESULTS_FORMAT)
endif
- ifneq ($$(MICRO_VM_OPTIONS), )
- $1_MICRO_VM_OPTIONS := -jvmArgs $$(MICRO_VM_OPTIONS)
+ ifneq ($$(MICRO_VM_OPTIONS)$$(MICRO_JAVA_OPTIONS), )
+ $1_MICRO_VM_OPTIONS := -jvmArgs $$(MICRO_VM_OPTIONS) $$(MICRO_JAVA_OPTIONS)
endif
ifneq ($$(MICRO_ITER), )
@@ -592,12 +613,11 @@
$1_TEST_NAME := $$(strip $$(patsubst jtreg:%, %, $$($1_TEST)))
- $1_COMPONENT := \
+ $1_TEST_ROOT := \
$$(strip $$(foreach root, $$(JTREG_TESTROOTS), \
- $$(if $$(filter $$(root)%, $$(JTREG_TOPDIR)/$$($1_TEST_NAME)), \
- $$(lastword $$(subst /, $$(SPACE), $$(root))) \
- ) \
+ $$(if $$(filter $$(root)%, $$(JTREG_TOPDIR)/$$($1_TEST_NAME)), $$(root)) \
))
+ $1_COMPONENT := $$(lastword $$(subst /, $$(SPACE), $$($1_TEST_ROOT)))
# This will work only as long as just hotspot has the additional "jtreg" directory
ifeq ($$($1_COMPONENT), jtreg)
$1_COMPONENT := hotspot
@@ -620,11 +640,12 @@
$$(eval $$(call SetJtregValue,$1,JTREG_BASIC_OPTIONS))
$$(eval $$(call SetJtregValue,$1,JTREG_PROBLEM_LIST))
+ # Only the problem list for the current test root should be used.
+ $1_JTREG_PROBLEM_LIST := $$(filter $$($1_TEST_ROOT)%, $$($1_JTREG_PROBLEM_LIST))
+
ifneq ($(TEST_JOBS), 0)
- # User has specified TEST_JOBS, use that as fallback default
$$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(TEST_JOBS)))
else
- # Use JOBS as default (except for hotspot)
$$(eval $$(call SetJtregValue,$1,JTREG_JOBS,$$(JOBS)))
endif
@@ -632,7 +653,7 @@
# we may end up with a lot of JVM's
$1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $$(EXPR) 25 / $$($1_JTREG_JOBS))
- JTREG_TIMEOUT ?= 4
+ JTREG_TIMEOUT_FACTOR ?= 4
JTREG_VERBOSE ?= fail,error,summary
JTREG_RETAIN ?= fail,error
@@ -643,10 +664,10 @@
$1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \
-verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \
- -concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT) \
+ -concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT_FACTOR) \
-vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE)
- $1_JTREG_BASIC_OPTIONS += -automatic -keywords:\!ignore -ignore:quiet
+ $1_JTREG_BASIC_OPTIONS += -automatic -ignore:quiet
# Make it possible to specify the JIB_DATA_DIR for tests using the
# JIB Artifact resolver
@@ -676,6 +697,14 @@
$1_JTREG_BASIC_OPTIONS += $$(addprefix -exclude:, $$($1_JTREG_PROBLEM_LIST))
endif
+ ifneq ($$(JTREG_EXTRA_PROBLEM_LISTS), )
+ # Accept both absolute paths as well as relative to the current test root.
+ $1_JTREG_BASIC_OPTIONS += $$(addprefix -exclude:, $$(wildcard \
+ $$(JTREG_EXTRA_PROBLEM_LISTS) \
+ $$(addprefix $$($1_TEST_ROOT)/, $$(JTREG_EXTRA_PROBLEM_LISTS)) \
+ ))
+ endif
+
ifneq ($$(JIB_HOME), )
$1_JTREG_BASIC_OPTIONS += -e:JIB_HOME=$$(JIB_HOME)
endif
@@ -686,10 +715,21 @@
$1_JTREG_LAUNCHER_OPTIONS += -Djava.library.path="$(JTREG_FAILURE_HANDLER_DIR)"
endif
+ ifneq ($$(JTREG_KEYWORDS), )
+ # The keywords string may contain problematic characters and may be quoted
+ # already when it arrives here. Remove any existing quotes and replace them
+ # with one set of single quotes.
+ $1_JTREG_KEYWORDS := \
+ $$(strip $$(subst $$(SQUOTE),,$$(subst $$(DQUOTE),,$$(JTREG_KEYWORDS))))
+ ifneq ($$($1_JTREG_KEYWORDS), )
+ $1_JTREG_BASIC_OPTIONS += -k:'$$($1_JTREG_KEYWORDS)'
+ endif
+ endif
+
clean-workdir-$1:
$$(RM) -r $$($1_TEST_SUPPORT_DIR)
- run-test-$1: clean-workdir-$1
+ run-test-$1: clean-workdir-$1 $(TEST_PREREQS)
$$(call LogWarn)
$$(call LogWarn, Running test '$$($1_TEST)')
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
@@ -776,7 +816,7 @@
$$(error Invalid special test specification: $$($1_TEST_NAME))
endif
- run-test-$1:
+ run-test-$1: $(TEST_PREREQS)
$$(call LogWarn)
$$(call LogWarn, Running test '$$($1_TEST)')
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
--- a/make/RunTestsPrebuilt.gmk Tue Oct 16 15:45:19 2018 +0200
+++ b/make/RunTestsPrebuilt.gmk Wed Oct 17 08:09:46 2018 -0700
@@ -49,10 +49,11 @@
# given.
# Note: No spaces are allowed around the arguments.
#
-# $1: The name of the argument
+# $1: The name of the variable
# $2: The default value, if any, or OPTIONAL (do not provide a default but
# do not exit if it is missing)
# $3: If NO_CHECK, disable checking for target file/directory existence
+# If MKDIR, create the default directory
define SetupVariable
ifeq ($$($1), )
ifeq ($2, )
@@ -75,10 +76,17 @@
endif
# If $1 has a value (is not optional), and $3 is not set (to NO_CHECK),
# and if wildcard is empty, then complain that the file is missing.
- ifeq ($$(strip $$(if $$($1), , OPTIONAL) $$(wildcard $$($1)) $3), )
- $$(info Error: Prebuilt variable $1 points to missing file/directory:)
- $$(info '$$($1)')
- $$(error Cannot continue.)
+ ifeq ($3, MKDIR)
+ ifneq ($$(findstring $$(LOG), info debug trace), )
+ $$(info Creating directory for $1)
+ endif
+ $$(shell mkdir -p $$($1))
+ else ifneq ($3, NO_CHECK)
+ ifeq ($$(strip $$(if $$($1), , OPTIONAL) $$(wildcard $$($1))), )
+ $$(info Error: Prebuilt variable $1 points to missing file/directory:)
+ $$(info '$$($1)')
+ $$(error Cannot continue.)
+ endif
endif
endef
@@ -106,14 +114,14 @@
# Verify that user has given correct additional input.
# These variables are absolutely necessary
-$(eval $(call SetupVariable,OUTPUTDIR))
+$(eval $(call SetupVariable,OUTPUTDIR,$(TOPDIR)/build/run-test-prebuilt,MKDIR))
$(eval $(call SetupVariable,BOOT_JDK))
$(eval $(call SetupVariable,JT_HOME))
# These can have default values based on the ones above
$(eval $(call SetupVariable,JDK_IMAGE_DIR,$(OUTPUTDIR)/images/jdk))
$(eval $(call SetupVariable,TEST_IMAGE_DIR,$(OUTPUTDIR)/images/test))
-$(eval $(call SetupVariable,SYMBOLS_IMAGE_DIR,$(OUTPUTDIR)/images/symbols))
+$(eval $(call SetupVariable,SYMBOLS_IMAGE_DIR,$(OUTPUTDIR)/images/symbols,NO_CHECK))
# Provide default values for tools that we need
$(eval $(call SetupVariable,MAKE,make,NO_CHECK))
@@ -202,8 +210,8 @@
ifeq ($(OPENJDK_TARGET_OS), windows)
ifeq ($(wildcard $(TEST_IMAGE_DIR)/bin/fixpath.exe), )
- $$(info Error: fixpath is missing from test image '$(TEST_IMAGE_DIR)')
- $$(error Cannot continue.)
+ $(info Error: fixpath is missing from test image '$(TEST_IMAGE_DIR)')
+ $(error Cannot continue.)
endif
FIXPATH := $(TEST_IMAGE_DIR)/bin/fixpath.exe -c
PATH_SEP:=;
@@ -214,15 +222,17 @@
# Check number of cores
ifeq ($(OPENJDK_TARGET_OS), linux)
- NUM_CORES := $(shell $(CAT) /proc/cpuinfo | $(GREP) -c processor)
+ NUM_CORES := $(shell $(CAT) /proc/cpuinfo | $(GREP) -c processor)
else ifeq ($(OPENJDK_TARGET_OS), macosx)
- NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
+ NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
else ifeq ($(OPENJDK_TARGET_OS), solaris)
- NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | $(GREP) -c on-line)
+ NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | $(GREP) -c on-line)
else ifeq ($(OPENJDK_TARGET_OS), windows)
- NUM_CORES := $(NUMBER_OF_PROCESSORS)
-else
- NUM_CORES := 1
+ NUM_CORES := $(NUMBER_OF_PROCESSORS)
+endif
+ifeq ($(NUM_CORES), )
+ $(warn Could not find number of CPUs, assuming 1)
+ NUM_CORES := 1
endif
################################################################################
@@ -276,9 +286,6 @@
@$(RM) -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error
@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
TEST="$(TEST)"
- @if test -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error ; then \
- exit 1 ; \
- fi
all: run-test-prebuilt
--- a/make/RunTestsPrebuiltSpec.gmk Tue Oct 16 15:45:19 2018 +0200
+++ b/make/RunTestsPrebuiltSpec.gmk Wed Oct 17 08:09:46 2018 -0700
@@ -124,7 +124,7 @@
JMOD := $(FIXPATH) $(JMOD_CMD)
JARSIGNER := $(FIXPATH) $(JARSIGNER_CMD)
-BUILD_JAVA := $(JAVA)
+BUILD_JAVA := $(JDK_IMAGE_DIR)/bin/JAVA
################################################################################
# Some common tools. Assume most common name and no path.
AWK := awk
@@ -172,3 +172,13 @@
EXPR := expr
FILE := file
HG := hg
+
+# On Solaris gnu versions of some tools are required.
+ifeq ($(OPENJDK_BUILD_OS), solaris)
+ AWK := gawk
+ GREP := ggrep
+ EGREP := ggrep -E
+ FGREP := grep -F
+ SED := gsed
+ TAR := gtar
+endif
--- a/make/common/MakeBase.gmk Tue Oct 16 15:45:19 2018 +0200
+++ b/make/common/MakeBase.gmk Wed Oct 17 08:09:46 2018 -0700
@@ -842,7 +842,7 @@
# Parameter 1 is the name of the rule, and is also the name of the variable.
#
# Remaining parameters are named arguments. These include:
-# KEYWORDS A list of valid keywords
+# SINGLE_KEYWORDS A list of valid keywords with single string values
# STRING_KEYWORDS A list of valid keywords, processed as string. This means
# that '%20' will be replaced by ' ' to allow for multi-word strings.
#
@@ -856,7 +856,7 @@
$$(eval mangled_part_eval := $$(call DoubleDollar, $$(mangled_part))) \
$$(eval part := $$$$(subst ||||,$$$$(SPACE),$$$$(mangled_part_eval))) \
$$(eval $1_NO_MATCH := true) \
- $$(foreach keyword, $$($1_KEYWORDS), \
+ $$(foreach keyword, $$($1_SINGLE_KEYWORDS), \
$$(eval keyword_eval := $$(call DoubleDollar, $$(keyword))) \
$$(if $$(filter $$(keyword)=%, $$(part)), \
$$(eval $(strip $1)_$$$$(keyword_eval) := $$$$(strip $$$$(patsubst $$$$(keyword_eval)=%, %, $$$$(part)))) \
@@ -871,11 +871,11 @@
) \
) \
$$(if $$($1_NO_MATCH), \
- $$(if $$(filter $$(part), $$($1_KEYWORDS) $$($1_STRING_KEYWORDS)), \
+ $$(if $$(filter $$(part), $$($1_SINGLE_KEYWORDS) $$($1_STRING_KEYWORDS)), \
$$(info Keyword $$(part) for $1 needs to be assigned a value.) \
, \
$$(info $$(part) is not a valid keyword for $1.) \
- $$(info Valid keywords: $$($1_KEYWORDS) $$($1_STRING_KEYWORDS).) \
+ $$(info Valid keywords: $$($1_SINGLE_KEYWORDS) $$($1_STRING_KEYWORDS).) \
) \
$$(error Cannot continue) \
) \
--- a/make/common/NativeCompilation.gmk Tue Oct 16 15:45:19 2018 +0200
+++ b/make/common/NativeCompilation.gmk Wed Oct 17 08:09:46 2018 -0700
@@ -67,7 +67,6 @@
# Param 2: Working directory
# Param 3: Source file
# Param 4: Compile command
-# Param 5: Object name
################################################################################
define WriteCompileCommandsFragment
$(call LogInfo, Creating compile commands fragment for $(notdir $3))
@@ -76,8 +75,7 @@
"directory": "$(strip $2)"$(COMMA) \
"file": "$(strip $3)"$(COMMA) \
"command": "$(strip $(subst $(DQUOTE),\$(DQUOTE),$(subst \,\\,\
- $(subst $(FIXPATH),,$4))))"$(COMMA) \
- "output": "$(strip $5)" \
+ $(subst $(FIXPATH),,$4))))" \
}$(COMMA), \
$1)
endef
@@ -331,7 +329,7 @@
$$($1_OBJ_JSON): $$($1_OBJ_DEPS)
$$(call WriteCompileCommandsFragment, $$@, $$(PWD), $$($1_SRC_FILE), \
- $$($1_COMPILER) $$($1_COMPILE_OPTIONS), $$($1_OBJ))
+ $$($1_COMPILER) $$($1_COMPILE_OPTIONS))
$$($1_OBJ): $$($1_OBJ_DEPS) | $$($$($1_BASE)_BUILD_INFO)
$$(call LogInfo, Compiling $$($1_FILENAME) (for $$($$($1_BASE)_BASENAME)))
@@ -744,7 +742,7 @@
$$($1_PCH_FILE_JSON): $$($1_PRECOMPILED_HEADER) $$($1_COMPILE_VARDEPS_FILE)
$$(call WriteCompileCommandsFragment, $$@, $$(PWD), $$<, \
- $$($1_PCH_COMMAND) $$< -o $$($1_PCH_FILE), $$($1_PCH_FILE))
+ $$($1_PCH_COMMAND) $$< -o $$($1_PCH_FILE))
endif
endif
endif
--- a/make/conf/jib-profiles.js Tue Oct 16 15:45:19 2018 +0200
+++ b/make/conf/jib-profiles.js Wed Oct 17 08:09:46 2018 -0700
@@ -755,16 +755,15 @@
"run-test-prebuilt": {
target_os: input.build_os,
target_cpu: input.build_cpu,
- src: "src.conf",
dependencies: [ "jtreg", "gnumake", "boot_jdk", "jib", testedProfile + ".jdk",
- testedProfile + ".test", "src.full"
+ testedProfile + ".test"
],
- work_dir: input.get("src.full", "install_path") + "/test",
+ src: "src.conf",
+ make_args: [ "run-test-prebuilt", "LOG_CMDLINES=true" ],
environment: {
- "JT_JAVA": common.boot_jdk_home,
- "PRODUCT_HOME": input.get(testedProfile + ".jdk", "home_path"),
- "TEST_IMAGE_DIR": input.get(testedProfile + ".test", "home_path"),
- "TEST_OUTPUT_DIR": input.src_top_dir
+ "BOOT_JDK": common.boot_jdk_home,
+ "JDK_IMAGE_DIR": input.get(testedProfile + ".jdk", "home_path"),
+ "TEST_IMAGE_DIR": input.get(testedProfile + ".test", "home_path")
},
labels: "test"
}
@@ -802,13 +801,34 @@
windowsRunTestPrebuiltExtra = {
dependencies: [ testedProfile + ".jdk_symbols" ],
environment: {
- "PRODUCT_SYMBOLS_HOME": input.get(testedProfile + ".jdk_symbols", "home_path"),
+ "SYMBOLS_IMAGE_DIR": input.get(testedProfile + ".jdk_symbols", "home_path"),
}
};
profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"],
windowsRunTestPrebuiltExtra);
}
+ // The profile run-test-prebuilt defines src.conf as the src bundle. When
+ // running in Mach 5, this reduces the time it takes to populate the
+ // considerably. But with just src.conf, we cannot actually run any tests,
+ // so if running from a workspace with just src.conf in it, we need to also
+ // get src.full as a dependency, and define the work_dir (where make gets
+ // run) to be in the src.full install path. By running in the install path,
+ // the same cached installation of the full src can be reused for multiple
+ // test tasks. Care must however be taken not to polute that work dir by
+ // setting the appropriate make variables to control output directories.
+ //
+ // Use the existance of the top level README as indication of if this is
+ // the full source or just src.conf.
+ if (!new java.io.File(__DIR__, "../../README").exists()) {
+ var runTestPrebuiltSrcFullExtra = {
+ dependencies: "src.full",
+ work_dir: input.get("src.full", "install_path"),
+ }
+ profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"],
+ runTestPrebuiltSrcFullExtra);
+ }
+
// Generate the missing platform attributes
profiles = generatePlatformAttributes(profiles);
profiles = generateDefaultMakeTargetsConfigureArg(common, profiles);
@@ -835,7 +855,7 @@
: "gcc7.3.0-Fedora27+1.0"),
linux_arm: (input.profile != null && input.profile.indexOf("hflt") >= 0
? "gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux+1.0"
- : (input.profile.indexOf("arm32") >= 0
+ : (input.profile != null && input.profile.indexOf("arm32") >= 0
? "gcc7.3.0-Fedora27+1.0"
: "arm-linaro-4.7+1.0"
)
--- a/make/lib/Lib-jdk.hotspot.agent.gmk Tue Oct 16 15:45:19 2018 +0200
+++ b/make/lib/Lib-jdk.hotspot.agent.gmk Wed Oct 17 08:09:46 2018 -0700
@@ -44,7 +44,12 @@
ifeq ($(OPENJDK_TARGET_CPU), x86_64)
SA_CXXFLAGS := -DWIN64
else
- SA_CXXFLAGS := -RTC1
+ # Only add /RTC1 flag for debug builds as it's
+ # incompatible with release type builds. See
+ # https://msdn.microsoft.com/en-us/library/8wtf2dfz.aspx
+ ifeq ($(DEBUG_LEVEL),slowdebug)
+ SA_CXXFLAGS := -RTC1
+ endif
endif
endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/aarch64/gc/shared/barrierSetNMethod_aarch64.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
+#include "utilities/debug.hpp"
+
+void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
+ ShouldNotReachHere();
+}
+
+void BarrierSetNMethod::disarm(nmethod* nm) {
+ ShouldNotReachHere();
+}
+
+bool BarrierSetNMethod::is_armed(nmethod* nm) {
+ ShouldNotReachHere();
+ return false;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/arm/gc/shared/barrierSetNMethod_arm.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
+#include "utilities/debug.hpp"
+
+void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
+ ShouldNotReachHere();
+}
+
+void BarrierSetNMethod::disarm(nmethod* nm) {
+ ShouldNotReachHere();
+}
+
+bool BarrierSetNMethod::is_armed(nmethod* nm) {
+ ShouldNotReachHere();
+ return false;
+}
--- a/src/hotspot/cpu/arm/vm_version_arm_32.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/cpu/arm/vm_version_arm_32.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -318,20 +318,3 @@
//
return (!os::is_MP() && (arm_arch() > 5)) ? false : true;
}
-
-#define EXP
-
-// Temporary override for experimental features
-// Copied from Abstract_VM_Version
-const char* VM_Version::vm_info_string() {
- switch (Arguments::mode()) {
- case Arguments::_int:
- return UseSharedSpaces ? "interpreted mode, sharing" EXP : "interpreted mode" EXP;
- case Arguments::_mixed:
- return UseSharedSpaces ? "mixed mode, sharing" EXP : "mixed mode" EXP;
- case Arguments::_comp:
- return UseSharedSpaces ? "compiled mode, sharing" EXP : "compiled mode" EXP;
- };
- ShouldNotReachHere();
- return "";
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/ppc/gc/shared/barrierSetNMethod_ppc.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
+#include "utilities/debug.hpp"
+
+void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
+ ShouldNotReachHere();
+}
+
+void BarrierSetNMethod::disarm(nmethod* nm) {
+ ShouldNotReachHere();
+}
+
+bool BarrierSetNMethod::is_armed(nmethod* nm) {
+ ShouldNotReachHere();
+ return false;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/s390/gc/shared/barrierSetNMethod_s390.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
+#include "utilities/debug.hpp"
+
+void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
+ ShouldNotReachHere();
+}
+
+void BarrierSetNMethod::disarm(nmethod* nm) {
+ ShouldNotReachHere();
+}
+
+bool BarrierSetNMethod::is_armed(nmethod* nm) {
+ ShouldNotReachHere();
+ return false;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/sparc/gc/shared/barrierSetNMethod_sparc.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
+#include "utilities/debug.hpp"
+
+void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
+ ShouldNotReachHere();
+}
+
+void BarrierSetNMethod::disarm(nmethod* nm) {
+ ShouldNotReachHere();
+}
+
+bool BarrierSetNMethod::is_armed(nmethod* nm) {
+ ShouldNotReachHere();
+ return false;
+}
--- a/src/hotspot/cpu/sparc/nativeInst_sparc.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/cpu/sparc/nativeInst_sparc.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -205,9 +205,9 @@
uint idx;
int offsets[] = {
0x0,
- 0xfffffff0,
- 0x7ffffff0,
- 0x80000000,
+ (int)0xfffffff0,
+ (int)0x7ffffff0,
+ (int)0x80000000,
0x20,
0x4000,
};
@@ -361,9 +361,9 @@
uint idx;
int offsets[] = {
0x0,
- 0x7fffffff,
- 0x80000000,
- 0xffffffff,
+ (int)0x7fffffff,
+ (int)0x80000000,
+ (int)0xffffffff,
0x20,
4096,
4097,
@@ -534,9 +534,9 @@
uint idx;
int offsets[] = {
0x0,
- 0x7fffffff,
- 0x80000000,
- 0xffffffff,
+ (int)0x7fffffff,
+ (int)0x80000000,
+ (int)0xffffffff,
0x20,
4096,
4097,
@@ -630,9 +630,9 @@
uint idx1;
int offsets[] = {
0x0,
- 0xffffffff,
- 0x7fffffff,
- 0x80000000,
+ (int)0xffffffff,
+ (int)0x7fffffff,
+ (int)0x80000000,
4096,
4097,
0x20,
@@ -751,9 +751,9 @@
uint idx;
int offsets[] = {
0x0,
- 0xffffffff,
- 0x7fffffff,
- 0x80000000,
+ (int)0xffffffff,
+ (int)0x7fffffff,
+ (int)0x80000000,
4096,
4097,
0x20,
--- a/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -26,6 +26,8 @@
#include "c1/c1_MacroAssembler.hpp"
#include "c1/c1_Runtime1.hpp"
#include "classfile/systemDictionary.hpp"
+#include "gc/shared/barrierSet.hpp"
+#include "gc/shared/barrierSetAssembler.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "interpreter/interpreter.hpp"
#include "oops/arrayOop.hpp"
@@ -330,6 +332,9 @@
}
#endif // TIERED
decrement(rsp, frame_size_in_bytes); // does not emit code for frame_size == 0
+
+ BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+ bs->nmethod_entry_barrier(this);
}
--- a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -23,7 +23,9 @@
*/
#include "precompiled.hpp"
+#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "interpreter/interp_masm.hpp"
#include "runtime/jniHandles.hpp"
@@ -322,3 +324,22 @@
__ adcl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())+4), 0);
#endif
}
+
+void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm) {
+ BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
+ if (bs_nm == NULL) {
+ return;
+ }
+#ifndef _LP64
+ ShouldNotReachHere();
+#else
+ Label continuation;
+ Register thread = LP64_ONLY(r15_thread);
+ Address disarmed_addr(thread, in_bytes(bs_nm->thread_disarmed_offset()));
+ __ align(8);
+ __ cmpl(disarmed_addr, 0);
+ __ jcc(Assembler::equal, continuation);
+ __ call(RuntimeAddress(StubRoutines::x86::method_entry_barrier()));
+ __ bind(continuation);
+#endif
+}
--- a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -83,6 +83,8 @@
Label& slow_case);
virtual void barrier_stubs_init() {}
+
+ virtual void nmethod_entry_barrier(MacroAssembler* masm);
};
#endif // CPU_X86_GC_SHARED_BARRIERSETASSEMBLER_X86_HPP
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/x86/gc/shared/barrierSetNMethod_x86.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "code/codeCache.hpp"
+#include "code/nativeInst.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
+#include "logging/log.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/sharedRuntime.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/align.hpp"
+#include "utilities/debug.hpp"
+
+class NativeNMethodCmpBarrier: public NativeInstruction {
+public:
+ enum Intel_specific_constants {
+ instruction_code = 0x81,
+ instruction_size = 8,
+ imm_offset = 4,
+ instruction_rex_prefix = Assembler::REX | Assembler::REX_B,
+ instruction_modrm = 0x7f // [r15 + offset]
+ };
+
+ address instruction_address() const { return addr_at(0); }
+ address immediate_address() const { return addr_at(imm_offset); }
+
+ jint get_immedate() const { return int_at(imm_offset); }
+ void set_immediate(jint imm) { set_int_at(imm_offset, imm); }
+ void verify() const;
+};
+
+void NativeNMethodCmpBarrier::verify() const {
+ if (((uintptr_t) instruction_address()) & 0x7) {
+ fatal("Not properly aligned");
+ }
+
+ int prefix = ubyte_at(0);
+ if (prefix != instruction_rex_prefix) {
+ tty->print_cr("Addr: " INTPTR_FORMAT " Prefix: 0x%x", p2i(instruction_address()),
+ prefix);
+ fatal("not a cmp barrier");
+ }
+
+ int inst = ubyte_at(1);
+ if (inst != instruction_code) {
+ tty->print_cr("Addr: " INTPTR_FORMAT " Code: 0x%x", p2i(instruction_address()),
+ inst);
+ fatal("not a cmp barrier");
+ }
+
+ int modrm = ubyte_at(2);
+ if (modrm != instruction_modrm) {
+ tty->print_cr("Addr: " INTPTR_FORMAT " mod/rm: 0x%x", p2i(instruction_address()),
+ modrm);
+ fatal("not a cmp barrier");
+ }
+}
+
+void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
+ /*
+ * [ callers frame ]
+ * [ callers return address ] <- callers rsp
+ * [ callers rbp ] <- callers rbp
+ * [ callers frame slots ]
+ * [ return_address ] <- return_address_ptr
+ * [ cookie ] <- used to write the new rsp (callers rsp)
+ * [ stub rbp ]
+ * [ stub stuff ]
+ */
+
+ address* stub_rbp = return_address_ptr - 2;
+ address* callers_rsp = return_address_ptr + nm->frame_size(); /* points to callers return_address now */
+ address* callers_rbp = callers_rsp - 1; // 1 to move to the callers return address, 1 more to move to the rbp
+ address* cookie = return_address_ptr - 1;
+
+ LogTarget(Trace, nmethod, barrier) out;
+ if (out.is_enabled()) {
+ Thread* thread = Thread::current();
+ assert(thread->is_Java_thread(), "must be JavaThread");
+ JavaThread* jth = (JavaThread*) thread;
+ ResourceMark mark;
+ log_trace(nmethod, barrier)("deoptimize(nmethod: %p, return_addr: %p, osr: %d, thread: %p(%s), making rsp: %p) -> %p",
+ nm, (address *) return_address_ptr, nm->is_osr_method(), jth,
+ jth->get_thread_name(), callers_rsp, nm->verified_entry_point());
+ }
+
+ assert(nm->frame_size() >= 3, "invariant");
+ assert(*cookie == (address) -1, "invariant");
+
+ // Preserve caller rbp.
+ *stub_rbp = *callers_rbp;
+
+ // At the cookie address put the callers rsp.
+ *cookie = (address) callers_rsp; // should point to the return address
+
+ // In the slot that used to be the callers rbp we put the address that our stub needs to jump to at the end.
+ // Overwriting the caller rbp should be okay since our stub rbp has the same value.
+ address* jmp_addr_ptr = callers_rbp;
+ *jmp_addr_ptr = SharedRuntime::get_handle_wrong_method_stub();
+}
+
+// This is the offset of the entry barrier from where the frame is completed.
+// If any code changes between the end of the verified entry where the entry
+// barrier resides, and the completion of the frame, then
+// NativeNMethodCmpBarrier::verify() will immediately complain when it does
+// not find the expected native instruction at this offset, which needs updating.
+// Note that this offset is invariant of PreserveFramePointer.
+static const int entry_barrier_offset = -19;
+
+static NativeNMethodCmpBarrier* native_nmethod_barrier(nmethod* nm) {
+ address barrier_address = nm->code_begin() + nm->frame_complete_offset() + entry_barrier_offset;
+ NativeNMethodCmpBarrier* barrier = reinterpret_cast<NativeNMethodCmpBarrier*>(barrier_address);
+ debug_only(barrier->verify());
+ return barrier;
+}
+
+void BarrierSetNMethod::disarm(nmethod* nm) {
+ if (!supports_entry_barrier(nm)) {
+ return;
+ }
+
+ NativeNMethodCmpBarrier* cmp = native_nmethod_barrier(nm);
+ cmp->set_immediate(disarmed_value());
+}
+
+bool BarrierSetNMethod::is_armed(nmethod* nm) {
+ if (!supports_entry_barrier(nm)) {
+ return false;
+ }
+
+ NativeNMethodCmpBarrier* cmp = native_nmethod_barrier(nm);
+ return (disarmed_value() != cmp->get_immedate());
+}
--- a/src/hotspot/cpu/x86/jniFastGetField_x86_64.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/cpu/x86/jniFastGetField_x86_64.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -35,9 +35,6 @@
#define BUFFER_SIZE 30*wordSize
-// Instead of issuing lfence for LoadLoad barrier, we create data dependency
-// between loads, which is more efficient than lfence.
-
// Common register usage:
// rax/xmm0: result
// c_rarg0: jni env
@@ -77,12 +74,6 @@
__ mov (robj, c_rarg1);
__ testb (rcounter, 1);
__ jcc (Assembler::notZero, slow);
-
- __ xorptr(robj, rcounter);
- __ xorptr(robj, rcounter); // obj, since
- // robj ^ rcounter ^ rcounter == robj
- // robj is data dependent on rcounter.
-
__ mov (roffset, c_rarg2);
__ shrptr(roffset, 2); // offset
@@ -103,12 +94,7 @@
default: ShouldNotReachHere();
}
- // create data dependency on rax
- __ lea(rcounter_addr, counter);
- __ xorptr(rcounter_addr, rax);
- __ xorptr(rcounter_addr, rax);
- __ cmpl (rcounter, Address(rcounter_addr, 0));
-
+ __ cmp32 (rcounter, counter);
__ jcc (Assembler::notEqual, slow);
__ ret (0);
@@ -178,11 +164,6 @@
__ testb (rcounter, 1);
__ jcc (Assembler::notZero, slow);
- __ xorptr(robj, rcounter);
- __ xorptr(robj, rcounter); // obj, since
- // robj ^ rcounter ^ rcounter == robj
- // robj is data dependent on rcounter.
-
// Both robj and rtmp are clobbered by try_resolve_jobject_in_native.
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
bs->try_resolve_jobject_in_native(masm, /* jni_env */ c_rarg0, robj, rtmp, slow);
@@ -198,13 +179,7 @@
case T_DOUBLE: __ movdbl (xmm0, Address(robj, roffset, Address::times_1)); break;
default: ShouldNotReachHere();
}
-
- __ lea(rcounter_addr, counter);
- __ movdq (rax, xmm0);
- // counter address is data dependent on xmm0.
- __ xorptr(rcounter_addr, rax);
- __ xorptr(rcounter_addr, rax);
- __ cmpl (rcounter, Address(rcounter_addr, 0));
+ __ cmp32 (rcounter, counter);
__ jcc (Assembler::notEqual, slow);
__ ret (0);
--- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -5453,7 +5453,7 @@
#endif // _LP64
// C2 compiled method's prolog code.
-void MacroAssembler::verified_entry(int framesize, int stack_bang_size, bool fp_mode_24b) {
+void MacroAssembler::verified_entry(int framesize, int stack_bang_size, bool fp_mode_24b, bool is_stub) {
// WARNING: Initial instruction MUST be 5 bytes or longer so that
// NativeJump::patch_verified_entry will be able to patch out the entry
@@ -5535,6 +5535,10 @@
}
#endif
+ if (!is_stub) {
+ BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+ bs->nmethod_entry_barrier(this);
+ }
}
// clear memory of size 'cnt' qwords, starting at 'base' using XMM/YMM registers
--- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -1588,7 +1588,7 @@
void movl2ptr(Register dst, Register src) { LP64_ONLY(movslq(dst, src)) NOT_LP64(if (dst != src) movl(dst, src)); }
// C2 compiled method's prolog code.
- void verified_entry(int framesize, int stack_bang_size, bool fp_mode_24b);
+ void verified_entry(int framesize, int stack_bang_size, bool fp_mode_24b, bool is_stub);
// clear memory of size 'cnt' qwords, starting at 'base';
// if 'is_large' is set, do not try to produce short loop
--- a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -2160,6 +2160,9 @@
// -2 because return address is already present and so is saved rbp
__ subptr(rsp, stack_size - 2*wordSize);
+ BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+ bs->nmethod_entry_barrier(masm);
+
// Frame is now completed as far as size and linkage.
int frame_complete = ((intptr_t)__ pc()) - start;
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -28,6 +28,7 @@
#include "ci/ciUtilities.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
#include "interpreter/interpreter.hpp"
#include "nativeInst_x86.hpp"
#include "oops/instanceOop.hpp"
@@ -5194,6 +5195,83 @@
return start;
}
+ address generate_method_entry_barrier() {
+ __ align(CodeEntryAlignment);
+ StubCodeMark mark(this, "StubRoutines", "nmethod_entry_barrier");
+
+ Label deoptimize_label;
+
+ address start = __ pc();
+
+ __ push(-1); // cookie, this is used for writing the new rsp when deoptimizing
+
+ BLOCK_COMMENT("Entry:");
+ __ enter(); // save rbp
+
+ // save c_rarg0, because we want to use that value.
+ // We could do without it but then we depend on the number of slots used by pusha
+ __ push(c_rarg0);
+
+ __ lea(c_rarg0, Address(rsp, wordSize * 3)); // 1 for cookie, 1 for rbp, 1 for c_rarg0 - this should be the return address
+
+ __ pusha();
+
+ // The method may have floats as arguments, and we must spill them before calling
+ // the VM runtime.
+ assert(Argument::n_float_register_parameters_j == 8, "Assumption");
+ const int xmm_size = wordSize * 2;
+ const int xmm_spill_size = xmm_size * Argument::n_float_register_parameters_j;
+ __ subptr(rsp, xmm_spill_size);
+ __ movdqu(Address(rsp, xmm_size * 7), xmm7);
+ __ movdqu(Address(rsp, xmm_size * 6), xmm6);
+ __ movdqu(Address(rsp, xmm_size * 5), xmm5);
+ __ movdqu(Address(rsp, xmm_size * 4), xmm4);
+ __ movdqu(Address(rsp, xmm_size * 3), xmm3);
+ __ movdqu(Address(rsp, xmm_size * 2), xmm2);
+ __ movdqu(Address(rsp, xmm_size * 1), xmm1);
+ __ movdqu(Address(rsp, xmm_size * 0), xmm0);
+
+ __ call_VM_leaf(CAST_FROM_FN_PTR(address, static_cast<int (*)(address*)>(BarrierSetNMethod::nmethod_stub_entry_barrier)), 1);
+
+ __ movdqu(xmm0, Address(rsp, xmm_size * 0));
+ __ movdqu(xmm1, Address(rsp, xmm_size * 1));
+ __ movdqu(xmm2, Address(rsp, xmm_size * 2));
+ __ movdqu(xmm3, Address(rsp, xmm_size * 3));
+ __ movdqu(xmm4, Address(rsp, xmm_size * 4));
+ __ movdqu(xmm5, Address(rsp, xmm_size * 5));
+ __ movdqu(xmm6, Address(rsp, xmm_size * 6));
+ __ movdqu(xmm7, Address(rsp, xmm_size * 7));
+ __ addptr(rsp, xmm_spill_size);
+
+ __ cmpl(rax, 1); // 1 means deoptimize
+ __ jcc(Assembler::equal, deoptimize_label);
+
+ __ popa();
+ __ pop(c_rarg0);
+
+ __ leave();
+
+ __ addptr(rsp, 1 * wordSize); // cookie
+ __ ret(0);
+
+
+ __ BIND(deoptimize_label);
+
+ __ popa();
+ __ pop(c_rarg0);
+
+ __ leave();
+
+ // this can be taken out, but is good for verification purposes. getting a SIGSEGV
+ // here while still having a correct stack is valuable
+ __ testptr(rsp, Address(rsp, 0));
+
+ __ movptr(rsp, Address(rsp, 0)); // new rsp was written in the barrier
+ __ jmp(Address(rsp, -1 * wordSize)); // jmp target should be callers verified_entry_point
+
+ return start;
+ }
+
/**
* Arguments:
*
@@ -5831,6 +5909,11 @@
generate_safefetch("SafeFetchN", sizeof(intptr_t), &StubRoutines::_safefetchN_entry,
&StubRoutines::_safefetchN_fault_pc,
&StubRoutines::_safefetchN_continuation_pc);
+
+ BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
+ if (bs_nm != NULL) {
+ StubRoutines::x86::_method_entry_barrier = generate_method_entry_barrier();
+ }
#ifdef COMPILER2
if (UseMultiplyToLenIntrinsic) {
StubRoutines::_multiplyToLen = generate_multiplyToLen();
--- a/src/hotspot/cpu/x86/stubRoutines_x86.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/cpu/x86/stubRoutines_x86.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -55,8 +55,14 @@
static address _double_sign_mask;
static address _double_sign_flip;
+ static address _method_entry_barrier;
+
public:
+ static address method_entry_barrier() {
+ return _method_entry_barrier;
+ }
+
static address get_previous_fp_entry() {
return _get_previous_fp_entry;
}
--- a/src/hotspot/cpu/x86/stubRoutines_x86_64.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/cpu/x86/stubRoutines_x86_64.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -42,3 +42,4 @@
address StubRoutines::x86::_float_sign_flip = NULL;
address StubRoutines::x86::_double_sign_mask = NULL;
address StubRoutines::x86::_double_sign_flip = NULL;
+address StubRoutines::x86::_method_entry_barrier = NULL;
--- a/src/hotspot/cpu/x86/x86_64.ad Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/cpu/x86/x86_64.ad Wed Oct 17 08:09:46 2018 -0700
@@ -890,6 +890,15 @@
st->print("# stack alignment check");
#endif
}
+ if (C->stub_function() != NULL && BarrierSet::barrier_set()->barrier_set_nmethod() != NULL) {
+ st->print("\n\t");
+ st->print("cmpl [r15_thread + #disarmed_offset], #disarmed_value\t");
+ st->print("\n\t");
+ st->print("je fast_entry\t");
+ st->print("\n\t");
+ st->print("call #nmethod_entry_barrier_stub\t");
+ st->print("\n\tfast_entry:");
+ }
st->cr();
}
#endif
@@ -901,7 +910,7 @@
int framesize = C->frame_size_in_bytes();
int bangsize = C->bang_size_in_bytes();
- __ verified_entry(framesize, C->need_stack_bang(bangsize)?bangsize:0, false);
+ __ verified_entry(framesize, C->need_stack_bang(bangsize)?bangsize:0, false, C->stub_function() != NULL);
C->set_frame_complete(cbuf.insts_size());
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/zero/gc/shared/barrierSetNMethod_zero.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
+#include "utilities/debug.hpp"
+
+void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
+ ShouldNotReachHere();
+}
+
+void BarrierSetNMethod::disarm(nmethod* nm) {
+ ShouldNotReachHere();
+}
+
+bool BarrierSetNMethod::is_armed(nmethod* nm) {
+ ShouldNotReachHere();
+ return false;
+}
--- a/src/hotspot/os/aix/os_aix.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/os/aix/os_aix.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -4259,7 +4259,7 @@
// or -1 on failure (e.g. can't fork a new process).
// Unlike system(), this function can be called from signal handler. It
// doesn't block SIGINT et al.
-int os::fork_and_exec(char* cmd) {
+int os::fork_and_exec(char* cmd, bool use_vfork_if_available) {
char * argv[4] = {"sh", "-c", cmd, NULL};
pid_t pid = fork();
--- a/src/hotspot/os/bsd/os_bsd.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/os/bsd/os_bsd.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -3785,7 +3785,7 @@
// or -1 on failure (e.g. can't fork a new process).
// Unlike system(), this function can be called from signal handler. It
// doesn't block SIGINT et al.
-int os::fork_and_exec(char* cmd) {
+int os::fork_and_exec(char* cmd, bool use_vfork_if_available) {
const char * argv[4] = {"sh", "-c", cmd, NULL};
// fork() in BsdThreads/NPTL is not async-safe. It needs to run
--- a/src/hotspot/os/linux/os_linux.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/os/linux/os_linux.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -5676,10 +5676,16 @@
// or -1 on failure (e.g. can't fork a new process).
// Unlike system(), this function can be called from signal handler. It
// doesn't block SIGINT et al.
-int os::fork_and_exec(char* cmd) {
+int os::fork_and_exec(char* cmd, bool use_vfork_if_available) {
const char * argv[4] = {"sh", "-c", cmd, NULL};
- pid_t pid = fork();
+ pid_t pid ;
+
+ if (use_vfork_if_available) {
+ pid = vfork();
+ } else {
+ pid = fork();
+ }
if (pid < 0) {
// fork failed
--- a/src/hotspot/os/solaris/os_solaris.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/os/solaris/os_solaris.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -1567,11 +1567,11 @@
}
typedef struct {
- Elf32_Half code; // Actual value as defined in elf.h
- Elf32_Half compat_class; // Compatibility of archs at VM's sense
- char elf_class; // 32 or 64 bit
- char endianess; // MSB or LSB
- char* name; // String representation
+ Elf32_Half code; // Actual value as defined in elf.h
+ Elf32_Half compat_class; // Compatibility of archs at VM's sense
+ unsigned char elf_class; // 32 or 64 bit
+ unsigned char endianess; // MSB or LSB
+ char* name; // String representation
} arch_t;
static const arch_t arch_array[]={
@@ -5252,7 +5252,7 @@
// or -1 on failure (e.g. can't fork a new process).
// Unlike system(), this function can be called from signal handler. It
// doesn't block SIGINT et al.
-int os::fork_and_exec(char* cmd) {
+int os::fork_and_exec(char* cmd, bool use_vfork_if_available) {
char * argv[4];
argv[0] = (char *)"sh";
argv[1] = (char *)"-c";
--- a/src/hotspot/os/windows/os_windows.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/os/windows/os_windows.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -5254,7 +5254,7 @@
// Run the specified command in a separate process. Return its exit value,
// or -1 on failure (e.g. can't create a new process).
-int os::fork_and_exec(char* cmd) {
+int os::fork_and_exec(char* cmd, bool use_vfork_if_available) {
STARTUPINFO si;
PROCESS_INFORMATION pi;
DWORD exit_code;
--- a/src/hotspot/share/aot/aotLoader.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/aot/aotLoader.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -137,6 +137,12 @@
return;
}
+#ifdef _WINDOWS
+ const char pathSep = ';';
+#else
+ const char pathSep = ':';
+#endif
+
// Scan the AOTLibrary option.
if (AOTLibrary != NULL) {
const int len = (int)strlen(AOTLibrary);
@@ -147,7 +153,7 @@
char* end = cp + len;
while (cp < end) {
const char* name = cp;
- while ((*cp) != '\0' && (*cp) != '\n' && (*cp) != ',' && (*cp) != ':' && (*cp) != ';') cp++;
+ while ((*cp) != '\0' && (*cp) != '\n' && (*cp) != ',' && (*cp) != pathSep) cp++;
cp[0] = '\0'; // Terminate name
cp++;
load_library(name, true);
--- a/src/hotspot/share/classfile/classLoader.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/classfile/classLoader.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -163,7 +163,7 @@
static char version_string[10] = "";
if (version_string[0] == '\0') {
jio_snprintf(version_string, sizeof(version_string), "%d.%d",
- Abstract_VM_Version::vm_major_version(), Abstract_VM_Version::vm_minor_version());
+ VM_Version::vm_major_version(), VM_Version::vm_minor_version());
}
return (const char*)version_string;
}
--- a/src/hotspot/share/classfile/classLoaderData.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/classfile/classLoaderData.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -139,7 +139,7 @@
// it from being unloaded during parsing of the unsafe anonymous class.
// The null-class-loader should always be kept alive.
_keep_alive((is_unsafe_anonymous || h_class_loader.is_null()) ? 1 : 0),
- _claimed(0),
+ _claim(0),
_handles(),
_klasses(NULL), _packages(NULL), _modules(NULL), _unnamed_module(NULL), _dictionary(NULL),
_jmethod_ids(NULL),
@@ -268,12 +268,17 @@
}
#endif // PRODUCT
-bool ClassLoaderData::claim() {
- if (_claimed == 1) {
- return false;
+bool ClassLoaderData::try_claim(int claim) {
+ for (;;) {
+ int old_claim = Atomic::load(&_claim);
+ if ((old_claim & claim) == claim) {
+ return false;
+ }
+ int new_claim = old_claim | claim;
+ if (Atomic::cmpxchg(new_claim, &_claim, old_claim) == old_claim) {
+ return true;
+ }
}
-
- return (int) Atomic::cmpxchg(1, &_claimed, 0) == 0;
}
// Unsafe anonymous classes have their own ClassLoaderData that is marked to keep alive
@@ -295,8 +300,8 @@
}
}
-void ClassLoaderData::oops_do(OopClosure* f, bool must_claim, bool clear_mod_oops) {
- if (must_claim && !claim()) {
+void ClassLoaderData::oops_do(OopClosure* f, int claim_value, bool clear_mod_oops) {
+ if (claim_value != ClassLoaderData::_claim_none && !try_claim(claim_value)) {
return;
}
--- a/src/hotspot/share/classfile/classLoaderData.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/classfile/classLoaderData.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -128,9 +128,8 @@
// loader. _keep_alive does not need to be volatile or
// atomic since there is one unique CLD per unsafe anonymous class.
- volatile int _claimed; // true if claimed, for example during GC traces.
- // To avoid applying oop closure more than once.
- // Has to be an int because we cas it.
+ volatile int _claim; // non-zero if claimed, for example during GC traces.
+ // To avoid applying oop closure more than once.
ChunkedHandleList _handles; // Handles to constant pool arrays, Modules, etc, which
// have the same life cycle of the corresponding ClassLoader.
@@ -200,11 +199,22 @@
Dictionary* create_dictionary();
void initialize_name(Handle class_loader);
+
public:
// GC interface.
- void clear_claimed() { _claimed = 0; }
- bool claimed() const { return _claimed == 1; }
- bool claim();
+
+ // The "claim" is typically used to check if oops_do needs to be applied on
+ // the CLD or not. Most GCs only perform strong marking during the marking phase.
+ enum {
+ _claim_none = 0,
+ _claim_finalizable = 2,
+ _claim_strong = 3
+ };
+ void clear_claim() { _claim = 0; }
+ bool claimed() const { return _claim != 0; }
+ bool try_claim(int claim);
+ int get_claim() const { return _claim; }
+ void set_claim(int claim) { _claim = claim; }
// Computes if the CLD is alive or not. This is safe to call in concurrent
// contexts.
@@ -264,7 +274,7 @@
void initialize_holder(Handle holder);
- void oops_do(OopClosure* f, bool must_claim, bool clear_modified_oops = false);
+ void oops_do(OopClosure* f, int claim_value, bool clear_modified_oops = false);
void classes_do(KlassClosure* klass_closure);
Klass* klasses() { return _klasses; }
--- a/src/hotspot/share/classfile/classLoaderDataGraph.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -48,7 +48,7 @@
void ClassLoaderDataGraph::clear_claimed_marks() {
for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
- cld->clear_claimed();
+ cld->clear_claim();
}
}
@@ -231,14 +231,14 @@
}
void ClassLoaderDataGraph::cld_do(CLDClosure* cl) {
- assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
+ assert_locked_or_safepoint_weak(ClassLoaderDataGraph_lock);
for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->_next) {
cl->do_cld(cld);
}
}
void ClassLoaderDataGraph::cld_unloading_do(CLDClosure* cl) {
- assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
+ assert_locked_or_safepoint_weak(ClassLoaderDataGraph_lock);
// Only walk the head until any clds not purged from prior unloading
// (CMS doesn't purge right away).
for (ClassLoaderData* cld = _unloading; cld != _saved_unloading; cld = cld->next()) {
@@ -248,7 +248,7 @@
}
void ClassLoaderDataGraph::roots_cld_do(CLDClosure* strong, CLDClosure* weak) {
- assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
+ assert_locked_or_safepoint_weak(ClassLoaderDataGraph_lock);
for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->_next) {
CLDClosure* closure = cld->keep_alive() ? strong : weak;
if (closure != NULL) {
@@ -258,7 +258,7 @@
}
void ClassLoaderDataGraph::always_strong_cld_do(CLDClosure* cl) {
- assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
+ assert_locked_or_safepoint_weak(ClassLoaderDataGraph_lock);
if (ClassUnloading) {
roots_cld_do(cl, NULL);
} else {
--- a/src/hotspot/share/code/codeBlob.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/code/codeBlob.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -186,6 +186,7 @@
bool contains(address addr) const { return content_begin() <= addr && addr < content_end(); }
bool is_frame_complete_at(address addr) const { return _frame_complete_offset != CodeOffsets::frame_never_safe &&
code_contains(addr) && addr >= code_begin() + _frame_complete_offset; }
+ int frame_complete_offset() const { return _frame_complete_offset; }
// CodeCache support: really only used by the nmethods, but in order to get
// asserts and certain bookkeeping to work in the CodeCache they are defined
--- a/src/hotspot/share/gc/cms/cmsArguments.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/cms/cmsArguments.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -45,7 +46,7 @@
assert(UseConcMarkSweepGC, "CMS is expected to be on here");
if (FLAG_IS_DEFAULT(ParallelGCThreads)) {
- FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads());
+ FLAG_SET_DEFAULT(ParallelGCThreads, VM_Version::parallel_worker_threads());
assert(ParallelGCThreads > 0, "We should always have at least one thread by default");
} else if (ParallelGCThreads == 0) {
jio_fprintf(defaultStream::error_stream(),
--- a/src/hotspot/share/gc/cms/cmsOopClosures.inline.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/cms/cmsOopClosures.inline.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -41,8 +41,7 @@
}
inline void MetadataVisitingOopsInGenClosure::do_cld(ClassLoaderData* cld) {
- bool claim = true; // Must claim the class loader data before processing.
- cld->oops_do(this, claim);
+ cld->oops_do(this, ClassLoaderData::_claim_strong);
}
// Decode the oop and call do_oop on it.
--- a/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -2398,7 +2398,7 @@
public:
VerifyCLDOopsCLDClosure(CMSBitMap* bitmap) : _oop_closure(bitmap) {}
void do_cld(ClassLoaderData* cld) {
- cld->oops_do(&_oop_closure, false, false);
+ cld->oops_do(&_oop_closure, ClassLoaderData::_claim_none, false);
}
};
@@ -2413,7 +2413,7 @@
// Mark from roots one level into CMS
MarkRefsIntoVerifyClosure notOlder(_span, verification_mark_bm(),
markBitMap());
- CLDToOopClosure cld_closure(¬Older, true);
+ CLDToOopClosure cld_closure(¬Older, ClassLoaderData::_claim_strong);
heap->rem_set()->prepare_for_younger_refs_iterate(false); // Not parallel.
@@ -2886,7 +2886,7 @@
}
} else {
// The serial version.
- CLDToOopClosure cld_closure(¬Older, true);
+ CLDToOopClosure cld_closure(¬Older, ClassLoaderData::_claim_strong);
heap->rem_set()->prepare_for_younger_refs_iterate(false); // Not parallel.
StrongRootsScope srs(1);
@@ -4269,7 +4269,7 @@
_timer.reset();
_timer.start();
- CLDToOopClosure cld_closure(&par_mri_cl, true);
+ CLDToOopClosure cld_closure(&par_mri_cl, ClassLoaderData::_claim_strong);
heap->cms_process_roots(_strong_roots_scope,
false, // yg was scanned above
@@ -4331,7 +4331,7 @@
class RemarkCLDClosure : public CLDClosure {
CLDToOopClosure _cm_closure;
public:
- RemarkCLDClosure(OopClosure* oop_closure) : _cm_closure(oop_closure) {}
+ RemarkCLDClosure(OopClosure* oop_closure) : _cm_closure(oop_closure, ClassLoaderData::_claim_strong) {}
void do_cld(ClassLoaderData* cld) {
// Check if we have modified any oops in the CLD during the concurrent marking.
if (cld->has_accumulated_modified_oops()) {
--- a/src/hotspot/share/gc/epsilon/epsilonBarrierSet.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/epsilon/epsilonBarrierSet.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -40,6 +40,7 @@
make_barrier_set_assembler<BarrierSetAssembler>(),
make_barrier_set_c1<BarrierSetC1>(),
make_barrier_set_c2<BarrierSetC2>(),
+ NULL /* barrier_set_nmethod */,
BarrierSet::FakeRtti(BarrierSet::EpsilonBarrierSet)) {};
void EpsilonBarrierSet::on_thread_create(Thread *thread) {
--- a/src/hotspot/share/gc/epsilon/epsilonHeap.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/epsilon/epsilonHeap.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -47,7 +47,7 @@
_space->initialize(committed_region, /* clear_space = */ true, /* mangle_space = */ true);
// Precompute hot fields
- _max_tlab_size = MIN2(CollectedHeap::max_tlab_size(), EpsilonMaxTLABSize / HeapWordSize);
+ _max_tlab_size = MIN2(CollectedHeap::max_tlab_size(), align_object_size(EpsilonMaxTLABSize / HeapWordSize));
_step_counter_update = MIN2<size_t>(max_byte_size / 16, EpsilonUpdateCountersStep);
_step_heap_print = (EpsilonPrintHeapSteps == 0) ? SIZE_MAX : (max_byte_size / EpsilonPrintHeapSteps);
_decay_time_ns = (int64_t) EpsilonTLABDecayTime * NANOSECS_PER_MILLISEC;
@@ -217,6 +217,16 @@
// Always honor alignment
size = align_up(size, MinObjAlignment);
+ // Check that adjustments did not break local and global invariants
+ assert(is_object_aligned(size),
+ "Size honors object alignment: " SIZE_FORMAT, size);
+ assert(min_size <= size,
+ "Size honors min size: " SIZE_FORMAT " <= " SIZE_FORMAT, min_size, size);
+ assert(size <= _max_tlab_size,
+ "Size honors max size: " SIZE_FORMAT " <= " SIZE_FORMAT, size, _max_tlab_size);
+ assert(size <= CollectedHeap::max_tlab_size(),
+ "Size honors global max size: " SIZE_FORMAT " <= " SIZE_FORMAT, size, CollectedHeap::max_tlab_size());
+
if (log_is_enabled(Trace, gc)) {
ResourceMark rm;
log_trace(gc)("TLAB size for \"%s\" (Requested: " SIZE_FORMAT "K, Min: " SIZE_FORMAT
--- a/src/hotspot/share/gc/g1/g1Arguments.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1Arguments.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -75,7 +75,7 @@
void G1Arguments::initialize() {
GCArguments::initialize();
assert(UseG1GC, "Error");
- FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads());
+ FLAG_SET_DEFAULT(ParallelGCThreads, VM_Version::parallel_worker_threads());
if (ParallelGCThreads == 0) {
assert(!FLAG_IS_DEFAULT(ParallelGCThreads), "The default value for ParallelGCThreads should not be 0.");
vm_exit_during_initialization("The flag -XX:+UseG1GC can not be combined with -XX:ParallelGCThreads=0", NULL);
--- a/src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -108,7 +108,7 @@
AlwaysTrueClosure always_alive;
_weak_proc_task.work(worker_id, &always_alive, &_adjust);
- CLDToOopClosure adjust_cld(&_adjust);
+ CLDToOopClosure adjust_cld(&_adjust, ClassLoaderData::_claim_strong);
CodeBlobToOopClosure adjust_code(&_adjust, CodeBlobToOopClosure::FixRelocations);
_root_processor.process_all_roots(
&_adjust,
--- a/src/hotspot/share/gc/g1/g1FullGCMarker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1FullGCMarker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -23,6 +23,7 @@
*/
#include "precompiled.hpp"
+#include "classfile/classLoaderData.hpp"
#include "gc/g1/g1FullGCMarker.inline.hpp"
#include "gc/shared/referenceProcessor.hpp"
#include "memory/iterator.inline.hpp"
@@ -36,7 +37,7 @@
_mark_closure(worker_id, this, G1CollectedHeap::heap()->ref_processor_stw()),
_verify_closure(VerifyOption_G1UseFullMarking),
_stack_closure(this),
- _cld_closure(mark_closure()) {
+ _cld_closure(mark_closure(), ClassLoaderData::_claim_strong) {
_oop_stack.initialize();
_objarray_stack.initialize();
}
--- a/src/hotspot/share/gc/g1/g1HeapVerifier.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1HeapVerifier.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -170,10 +170,10 @@
public:
VerifyCLDClosure(G1CollectedHeap* g1h, OopClosure* cl) : _young_ref_counter_closure(g1h), _oop_closure(cl) {}
void do_cld(ClassLoaderData* cld) {
- cld->oops_do(_oop_closure, false);
+ cld->oops_do(_oop_closure, ClassLoaderData::_claim_none);
_young_ref_counter_closure.reset_count();
- cld->oops_do(&_young_ref_counter_closure, false);
+ cld->oops_do(&_young_ref_counter_closure, ClassLoaderData::_claim_none);
if (_young_ref_counter_closure.count() > 0) {
guarantee(cld->has_modified_oops(), "CLD " PTR_FORMAT ", has young %d refs but is not dirty.", p2i(cld), _young_ref_counter_closure.count());
}
--- a/src/hotspot/share/gc/g1/g1OopClosures.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1OopClosures.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -52,7 +52,7 @@
// Clean the cld since we're going to scavenge all the metadata.
// Clear modified oops only if this cld is claimed.
- cld->oops_do(_closure, _must_claim, /*clear_modified_oops*/true);
+ cld->oops_do(_closure, _claim, /*clear_modified_oops*/true);
_closure->set_scanned_cld(NULL);
--- a/src/hotspot/share/gc/g1/g1OopClosures.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1OopClosures.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -160,12 +160,12 @@
class G1CLDScanClosure : public CLDClosure {
G1ParCopyHelper* _closure;
bool _process_only_dirty;
- bool _must_claim;
+ int _claim;
int _count;
public:
G1CLDScanClosure(G1ParCopyHelper* closure,
- bool process_only_dirty, bool must_claim)
- : _closure(closure), _process_only_dirty(process_only_dirty), _must_claim(must_claim), _count(0) {}
+ bool process_only_dirty, int claim_value)
+ : _closure(closure), _process_only_dirty(process_only_dirty), _claim(claim_value), _count(0) {}
void do_cld(ClassLoaderData* cld);
};
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -201,11 +201,11 @@
HeapWord * const obj_ptr) const {
PLAB* alloc_buf = _plab_allocator->alloc_buffer(dest_state);
if (alloc_buf->contains(obj_ptr)) {
- _g1h->_gc_tracer_stw->report_promotion_in_new_plab_event(old->klass(), word_sz, age,
+ _g1h->_gc_tracer_stw->report_promotion_in_new_plab_event(old->klass(), word_sz * HeapWordSize, age,
dest_state.value() == InCSetState::Old,
alloc_buf->word_sz());
} else {
- _g1h->_gc_tracer_stw->report_promotion_outside_plab_event(old->klass(), word_sz, age,
+ _g1h->_gc_tracer_stw->report_promotion_outside_plab_event(old->klass(), word_sz * HeapWordSize, age,
dest_state.value() == InCSetState::Old);
}
}
--- a/src/hotspot/share/gc/g1/g1RootClosures.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1RootClosures.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -35,7 +35,7 @@
G1EvacuationClosures(G1CollectedHeap* g1h,
G1ParScanThreadState* pss,
bool in_young_gc) :
- _closures(g1h, pss, in_young_gc, /* must_claim_cld */ false) {}
+ _closures(g1h, pss, in_young_gc, /* cld_claim */ ClassLoaderData::_claim_none) {}
OopClosure* weak_oops() { return &_closures._oops; }
OopClosure* strong_oops() { return &_closures._oops; }
@@ -73,8 +73,8 @@
public:
G1InitialMarkClosures(G1CollectedHeap* g1h,
G1ParScanThreadState* pss) :
- _strong(g1h, pss, /* process_only_dirty_klasses */ false, /* must_claim_cld */ true),
- _weak(g1h, pss, /* process_only_dirty_klasses */ false, /* must_claim_cld */ true) {}
+ _strong(g1h, pss, /* process_only_dirty_klasses */ false, /* cld_claim */ ClassLoaderData::_claim_strong),
+ _weak(g1h, pss, /* process_only_dirty_klasses */ false, /* cld_claim */ ClassLoaderData::_claim_strong) {}
OopClosure* weak_oops() { return &_weak._oops; }
OopClosure* strong_oops() { return &_strong._oops; }
--- a/src/hotspot/share/gc/g1/g1SharedClosures.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1SharedClosures.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -39,9 +39,9 @@
G1CLDScanClosure _clds;
G1CodeBlobClosure _codeblobs;
- G1SharedClosures(G1CollectedHeap* g1h, G1ParScanThreadState* pss, bool process_only_dirty, bool must_claim_cld) :
+ G1SharedClosures(G1CollectedHeap* g1h, G1ParScanThreadState* pss, bool process_only_dirty, int cld_claim) :
_oops(g1h, pss),
_oops_in_cld(g1h, pss),
- _clds(&_oops_in_cld, process_only_dirty, must_claim_cld),
+ _clds(&_oops_in_cld, process_only_dirty, cld_claim),
_codeblobs(&_oops) {}
};
--- a/src/hotspot/share/gc/parallel/parallelArguments.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/parallel/parallelArguments.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -50,7 +51,7 @@
// If no heap maximum was requested explicitly, use some reasonable fraction
// of the physical memory, up to a maximum of 1GB.
FLAG_SET_DEFAULT(ParallelGCThreads,
- Abstract_VM_Version::parallel_worker_threads());
+ VM_Version::parallel_worker_threads());
if (ParallelGCThreads == 0) {
jio_fprintf(defaultStream::error_stream(),
"The Parallel GC can not be combined with -XX:ParallelGCThreads=0\n");
--- a/src/hotspot/share/gc/parallel/pcTasks.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/parallel/pcTasks.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -35,6 +35,7 @@
#include "gc/shared/gcTimer.hpp"
#include "gc/shared/gcTraceTime.inline.hpp"
#include "logging/log.hpp"
+#include "memory/iterator.inline.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/objArrayKlass.inline.hpp"
@@ -58,7 +59,7 @@
ParCompactionManager* cm =
ParCompactionManager::gc_thread_compaction_manager(which);
- ParCompactionManager::MarkAndPushClosure mark_and_push_closure(cm);
+ PCMarkAndPushClosure mark_and_push_closure(cm);
MarkingCodeBlobClosure mark_and_push_in_blobs(&mark_and_push_closure, !CodeBlobToOopClosure::FixRelocations);
_thread->oops_do(&mark_and_push_closure, &mark_and_push_in_blobs);
@@ -73,7 +74,7 @@
ParCompactionManager* cm =
ParCompactionManager::gc_thread_compaction_manager(which);
- ParCompactionManager::MarkAndPushClosure mark_and_push_closure(cm);
+ PCMarkAndPushClosure mark_and_push_closure(cm);
switch (_root_type) {
case universe:
@@ -109,7 +110,7 @@
break;
case class_loader_data: {
- CLDToOopClosure cld_closure(&mark_and_push_closure);
+ CLDToOopClosure cld_closure(&mark_and_push_closure, ClassLoaderData::_claim_strong);
ClassLoaderDataGraph::always_strong_cld_do(&cld_closure);
}
break;
@@ -139,7 +140,7 @@
ParCompactionManager* cm =
ParCompactionManager::gc_thread_compaction_manager(which);
- ParCompactionManager::MarkAndPushClosure mark_and_push_closure(cm);
+ PCMarkAndPushClosure mark_and_push_closure(cm);
ParCompactionManager::FollowStackClosure follow_stack_closure(cm);
_rp_task.work(_work_id, *PSParallelCompact::is_alive_closure(),
mark_and_push_closure, follow_stack_closure);
@@ -182,13 +183,12 @@
ParCompactionManager* cm =
ParCompactionManager::gc_thread_compaction_manager(which);
- ParCompactionManager::MarkAndPushClosure mark_and_push_closure(cm);
oop obj = NULL;
ObjArrayTask task;
do {
while (ParCompactionManager::steal_objarray(which, task)) {
- cm->follow_contents((objArrayOop)task.obj(), task.index());
+ cm->follow_array((objArrayOop)task.obj(), task.index());
cm->follow_marking_stacks();
}
while (ParCompactionManager::steal(which, obj)) {
--- a/src/hotspot/share/gc/parallel/psCardTable.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/parallel/psCardTable.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -28,7 +28,7 @@
#include "gc/parallel/parallelScavengeHeap.inline.hpp"
#include "gc/parallel/psCardTable.hpp"
#include "gc/parallel/psPromotionManager.inline.hpp"
-#include "gc/parallel/psScavenge.hpp"
+#include "gc/parallel/psScavenge.inline.hpp"
#include "gc/parallel/psTasks.hpp"
#include "gc/parallel/psYoungGen.hpp"
#include "memory/iterator.inline.hpp"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/parallel/psClosure.inline.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_PARALLEL_PSCLOSURE_INLINE_HPP
+#define SHARE_VM_GC_PARALLEL_PSCLOSURE_INLINE_HPP
+
+#include "gc/parallel/psPromotionManager.inline.hpp"
+#include "gc/parallel/psScavenge.inline.hpp"
+#include "memory/iterator.hpp"
+#include "oops/access.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "utilities/globalDefinitions.hpp"
+
+template <bool promote_immediately>
+class PSRootsClosure: public OopClosure {
+private:
+ PSPromotionManager* _promotion_manager;
+
+ template <class T> void do_oop_work(T *p) {
+ if (PSScavenge::should_scavenge(p)) {
+ // We never card mark roots, maybe call a func without test?
+ _promotion_manager->copy_and_push_safe_barrier<T, promote_immediately>(p);
+ }
+ }
+public:
+ PSRootsClosure(PSPromotionManager* pm) : _promotion_manager(pm) { }
+ void do_oop(oop* p) { PSRootsClosure::do_oop_work(p); }
+ void do_oop(narrowOop* p) { PSRootsClosure::do_oop_work(p); }
+};
+
+typedef PSRootsClosure</*promote_immediately=*/false> PSScavengeRootsClosure;
+typedef PSRootsClosure</*promote_immediately=*/true> PSPromoteRootsClosure;
+
+// Scavenges a single oop in a ClassLoaderData.
+class PSScavengeFromCLDClosure: public OopClosure {
+private:
+ PSPromotionManager* _pm;
+ // Used to redirty a scanned cld if it has oops
+ // pointing to the young generation after being scanned.
+ ClassLoaderData* _scanned_cld;
+public:
+ PSScavengeFromCLDClosure(PSPromotionManager* pm) : _pm(pm), _scanned_cld(NULL) { }
+ void do_oop(narrowOop* p) { ShouldNotReachHere(); }
+ void do_oop(oop* p) {
+ ParallelScavengeHeap* psh = ParallelScavengeHeap::heap();
+ assert(!psh->is_in_reserved(p), "GC barrier needed");
+ if (PSScavenge::should_scavenge(p)) {
+ assert(PSScavenge::should_scavenge(p, true), "revisiting object?");
+
+ oop o = *p;
+ oop new_obj;
+ if (o->is_forwarded()) {
+ new_obj = o->forwardee();
+ } else {
+ new_obj = _pm->copy_to_survivor_space</*promote_immediately=*/false>(o);
+ }
+ RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
+
+ if (PSScavenge::is_obj_in_young(new_obj)) {
+ do_cld_barrier();
+ }
+ }
+ }
+
+ void set_scanned_cld(ClassLoaderData* cld) {
+ assert(_scanned_cld == NULL || cld == NULL, "Should always only handling one cld at a time");
+ _scanned_cld = cld;
+ }
+
+private:
+ void do_cld_barrier() {
+ assert(_scanned_cld != NULL, "Should not be called without having a scanned cld");
+ _scanned_cld->record_modified_oops();
+ }
+};
+
+// Scavenges the oop in a ClassLoaderData.
+class PSScavengeCLDClosure: public CLDClosure {
+private:
+ PSScavengeFromCLDClosure _oop_closure;
+public:
+ PSScavengeCLDClosure(PSPromotionManager* pm) : _oop_closure(pm) { }
+ void do_cld(ClassLoaderData* cld) {
+ // If the cld has not been dirtied we know that there's
+ // no references into the young gen and we can skip it.
+
+ if (cld->has_modified_oops()) {
+ // Setup the promotion manager to redirty this cld
+ // if references are left in the young gen.
+ _oop_closure.set_scanned_cld(cld);
+
+ // Clean the cld since we're going to scavenge all the metadata.
+ cld->oops_do(&_oop_closure, false, /*clear_modified_oops*/true);
+
+ _oop_closure.set_scanned_cld(NULL);
+ }
+ }
+};
+
+#endif
--- a/src/hotspot/share/gc/parallel/psCompactionManager.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -132,113 +132,6 @@
return _manager_array[index];
}
-void InstanceKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) {
- assert(obj != NULL, "can't follow the content of NULL object");
-
- cm->follow_klass(this);
- // Only mark the header and let the scan of the meta-data mark
- // everything else.
-
- ParCompactionManager::MarkAndPushClosure cl(cm);
- if (UseCompressedOops) {
- InstanceKlass::oop_oop_iterate_oop_maps<narrowOop>(obj, &cl);
- } else {
- InstanceKlass::oop_oop_iterate_oop_maps<oop>(obj, &cl);
- }
-}
-
-void InstanceMirrorKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) {
- InstanceKlass::oop_pc_follow_contents(obj, cm);
-
- // Follow the klass field in the mirror.
- Klass* klass = java_lang_Class::as_Klass(obj);
- if (klass != NULL) {
- // An unsafe anonymous class doesn't have its own class loader,
- // so the call to follow_klass will mark and push its java mirror instead of the
- // class loader. When handling the java mirror for an unsafe anonymous
- // class we need to make sure its class loader data is claimed, this is done
- // by calling follow_class_loader explicitly. For non-anonymous classes the
- // call to follow_class_loader is made when the class loader itself is handled.
- if (klass->is_instance_klass() &&
- InstanceKlass::cast(klass)->is_unsafe_anonymous()) {
- cm->follow_class_loader(klass->class_loader_data());
- } else {
- cm->follow_klass(klass);
- }
- } else {
- // If klass is NULL then this a mirror for a primitive type.
- // We don't have to follow them, since they are handled as strong
- // roots in Universe::oops_do.
- assert(java_lang_Class::is_primitive(obj), "Sanity check");
- }
-
- ParCompactionManager::MarkAndPushClosure cl(cm);
- if (UseCompressedOops) {
- oop_oop_iterate_statics<narrowOop>(obj, &cl);
- } else {
- oop_oop_iterate_statics<oop>(obj, &cl);
- }
-}
-
-void InstanceClassLoaderKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) {
- InstanceKlass::oop_pc_follow_contents(obj, cm);
-
- ClassLoaderData * const loader_data = java_lang_ClassLoader::loader_data_acquire(obj);
- if (loader_data != NULL) {
- cm->follow_class_loader(loader_data);
- }
-}
-
-template <class T>
-static void oop_pc_follow_contents_specialized(InstanceRefKlass* klass, oop obj, ParCompactionManager* cm) {
- T* referent_addr = (T*)java_lang_ref_Reference::referent_addr_raw(obj);
- T heap_oop = RawAccess<>::oop_load(referent_addr);
- log_develop_trace(gc, ref)("InstanceRefKlass::oop_pc_follow_contents " PTR_FORMAT, p2i(obj));
- if (!CompressedOops::is_null(heap_oop)) {
- oop referent = CompressedOops::decode_not_null(heap_oop);
- if (PSParallelCompact::mark_bitmap()->is_unmarked(referent) &&
- PSParallelCompact::ref_processor()->discover_reference(obj, klass->reference_type())) {
- // reference already enqueued, referent will be traversed later
- klass->InstanceKlass::oop_pc_follow_contents(obj, cm);
- log_develop_trace(gc, ref)(" Non NULL enqueued " PTR_FORMAT, p2i(obj));
- return;
- } else {
- // treat referent as normal oop
- log_develop_trace(gc, ref)(" Non NULL normal " PTR_FORMAT, p2i(obj));
- cm->mark_and_push(referent_addr);
- }
- }
- // Treat discovered as normal oop.
- T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr_raw(obj);
- cm->mark_and_push(discovered_addr);
- klass->InstanceKlass::oop_pc_follow_contents(obj, cm);
-}
-
-
-void InstanceRefKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) {
- if (UseCompressedOops) {
- oop_pc_follow_contents_specialized<narrowOop>(this, obj, cm);
- } else {
- oop_pc_follow_contents_specialized<oop>(this, obj, cm);
- }
-}
-
-void ObjArrayKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) {
- cm->follow_klass(this);
-
- if (UseCompressedOops) {
- oop_pc_follow_contents_specialized<narrowOop>(objArrayOop(obj), 0, cm);
- } else {
- oop_pc_follow_contents_specialized<oop>(objArrayOop(obj), 0, cm);
- }
-}
-
-void TypeArrayKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) {
- assert(obj->is_typeArray(),"must be a type array");
- // Performance tweak: We skip iterating over the klass pointer since we
- // know that Universe::TypeArrayKlass never moves.
-}
-
void ParCompactionManager::follow_marking_stacks() {
do {
// Drain the overflow stack first, to allow stealing from the marking stack.
@@ -253,7 +146,7 @@
// Process ObjArrays one at a time to avoid marking stack bloat.
ObjArrayTask task;
if (_objarray_stack.pop_overflow(task) || _objarray_stack.pop_local(task)) {
- follow_contents((objArrayOop)task.obj(), task.index());
+ follow_array((objArrayOop)task.obj(), task.index());
}
} while (!marking_stacks_empty());
--- a/src/hotspot/share/gc/parallel/psCompactionManager.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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
@@ -171,24 +171,10 @@
void drain_region_stacks();
void follow_contents(oop obj);
- void follow_contents(objArrayOop array, int index);
+ void follow_array(objArrayOop array, int index);
void update_contents(oop obj);
- class MarkAndPushClosure: public BasicOopIterateClosure {
- private:
- ParCompactionManager* _compaction_manager;
- public:
- MarkAndPushClosure(ParCompactionManager* cm) : _compaction_manager(cm) { }
-
- template <typename T> void do_oop_work(T* p);
- virtual void do_oop(oop* p);
- virtual void do_oop(narrowOop* p);
-
- // This closure provides its own oop verification code.
- debug_only(virtual bool should_verify_oops() { return false; })
- };
-
class FollowStackClosure: public VoidClosure {
private:
ParCompactionManager* _compaction_manager;
--- a/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -25,6 +25,7 @@
#ifndef SHARE_VM_GC_PARALLEL_PSCOMPACTIONMANAGER_INLINE_HPP
#define SHARE_VM_GC_PARALLEL_PSCOMPACTIONMANAGER_INLINE_HPP
+#include "classfile/javaClasses.inline.hpp"
#include "gc/parallel/parMarkBitMap.hpp"
#include "gc/parallel/psCompactionManager.hpp"
#include "gc/parallel/psParallelCompact.inline.hpp"
@@ -37,6 +38,37 @@
#include "utilities/debug.hpp"
#include "utilities/globalDefinitions.hpp"
+class PCMarkAndPushClosure: public OopClosure {
+private:
+ ParCompactionManager* _compaction_manager;
+public:
+ PCMarkAndPushClosure(ParCompactionManager* cm) : _compaction_manager(cm) { }
+
+ template <typename T> void do_oop_nv(T* p) { _compaction_manager->mark_and_push(p); }
+ virtual void do_oop(oop* p) { do_oop_nv(p); }
+ virtual void do_oop(narrowOop* p) { do_oop_nv(p); }
+
+ // This closure provides its own oop verification code.
+ debug_only(virtual bool should_verify_oops() { return false; })
+};
+
+class PCIterateMarkAndPushClosure: public MetadataVisitingOopIterateClosure {
+private:
+ ParCompactionManager* _compaction_manager;
+public:
+ PCIterateMarkAndPushClosure(ParCompactionManager* cm, ReferenceProcessor* rp) : MetadataVisitingOopIterateClosure(rp), _compaction_manager(cm) { }
+
+ template <typename T> void do_oop_nv(T* p) { _compaction_manager->mark_and_push(p); }
+ virtual void do_oop(oop* p) { do_oop_nv(p); }
+ virtual void do_oop(narrowOop* p) { do_oop_nv(p); }
+
+ void do_klass_nv(Klass* k) { _compaction_manager->follow_klass(k); }
+ void do_cld_nv(ClassLoaderData* cld) { _compaction_manager->follow_class_loader(cld); }
+
+ // This closure provides its own oop verification code.
+ debug_only(virtual bool should_verify_oops() { return false; })
+};
+
inline bool ParCompactionManager::steal(int queue_num, oop& t) {
return stack_array()->steal(queue_num, t);
}
@@ -84,14 +116,6 @@
}
}
-template <typename T>
-inline void ParCompactionManager::MarkAndPushClosure::do_oop_work(T* p) {
- _compaction_manager->mark_and_push(p);
-}
-
-inline void ParCompactionManager::MarkAndPushClosure::do_oop(oop* p) { do_oop_work(p); }
-inline void ParCompactionManager::MarkAndPushClosure::do_oop(narrowOop* p) { do_oop_work(p); }
-
inline void ParCompactionManager::follow_klass(Klass* klass) {
oop holder = klass->klass_holder();
mark_and_push(&holder);
@@ -101,19 +125,8 @@
_compaction_manager->follow_marking_stacks();
}
-inline void ParCompactionManager::follow_class_loader(ClassLoaderData* cld) {
- MarkAndPushClosure mark_and_push_closure(this);
-
- cld->oops_do(&mark_and_push_closure, true);
-}
-
-inline void ParCompactionManager::follow_contents(oop obj) {
- assert(PSParallelCompact::mark_bitmap()->is_marked(obj), "should be marked");
- obj->pc_follow_contents(this);
-}
-
-template <class T>
-inline void oop_pc_follow_contents_specialized(objArrayOop obj, int index, ParCompactionManager* cm) {
+template <typename T>
+inline void follow_array_specialized(objArrayOop obj, int index, ParCompactionManager* cm) {
const size_t len = size_t(obj->length());
const size_t beg_index = size_t(index);
assert(beg_index < len || len == 0, "index too large");
@@ -134,16 +147,34 @@
}
}
-inline void ParCompactionManager::follow_contents(objArrayOop obj, int index) {
+inline void ParCompactionManager::follow_array(objArrayOop obj, int index) {
if (UseCompressedOops) {
- oop_pc_follow_contents_specialized<narrowOop>(obj, index, this);
+ follow_array_specialized<narrowOop>(obj, index, this);
} else {
- oop_pc_follow_contents_specialized<oop>(obj, index, this);
+ follow_array_specialized<oop>(obj, index, this);
}
}
inline void ParCompactionManager::update_contents(oop obj) {
- obj->pc_update_contents(this);
+ if (!obj->klass()->is_typeArray_klass()) {
+ PCAdjustPointerClosure apc(this);
+ obj->oop_iterate(&apc);
+ }
+}
+
+inline void ParCompactionManager::follow_class_loader(ClassLoaderData* cld) {
+ PCMarkAndPushClosure mark_and_push_closure(this);
+ cld->oops_do(&mark_and_push_closure, true);
+}
+
+inline void ParCompactionManager::follow_contents(oop obj) {
+ assert(PSParallelCompact::mark_bitmap()->is_marked(obj), "should be marked");
+ if (obj->is_objArray()) {
+ follow_array(objArrayOop(obj), 0);
+ } else {
+ PCIterateMarkAndPushClosure cl(this, PSParallelCompact::ref_processor());
+ obj->oop_iterate(&cl);
+ }
}
#endif // SHARE_VM_GC_PARALLEL_PSCOMPACTIONMANAGER_INLINE_HPP
--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -846,18 +846,43 @@
bool PSParallelCompact::IsAliveClosure::do_object_b(oop p) { return mark_bitmap()->is_marked(p); }
+class PCReferenceProcessor: public ReferenceProcessor {
+public:
+ PCReferenceProcessor(
+ BoolObjectClosure* is_subject_to_discovery,
+ BoolObjectClosure* is_alive_non_header) :
+ ReferenceProcessor(is_subject_to_discovery,
+ ParallelRefProcEnabled && (ParallelGCThreads > 1), // mt processing
+ ParallelGCThreads, // mt processing degree
+ true, // mt discovery
+ ParallelGCThreads, // mt discovery degree
+ true, // atomic_discovery
+ is_alive_non_header) {
+ }
+
+ template<typename T> bool discover(oop obj, ReferenceType type) {
+ T* referent_addr = (T*) java_lang_ref_Reference::referent_addr_raw(obj);
+ T heap_oop = RawAccess<>::oop_load(referent_addr);
+ oop referent = CompressedOops::decode_not_null(heap_oop);
+ return PSParallelCompact::mark_bitmap()->is_unmarked(referent)
+ && ReferenceProcessor::discover_reference(obj, type);
+ }
+ virtual bool discover_reference(oop obj, ReferenceType type) {
+ if (UseCompressedOops) {
+ return discover<narrowOop>(obj, type);
+ } else {
+ return discover<oop>(obj, type);
+ }
+ }
+};
+
void PSParallelCompact::post_initialize() {
ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
_span_based_discoverer.set_span(heap->reserved_region());
_ref_processor =
- new ReferenceProcessor(&_span_based_discoverer,
- ParallelRefProcEnabled && (ParallelGCThreads > 1), // mt processing
- ParallelGCThreads, // mt processing degree
- true, // mt discovery
- ParallelGCThreads, // mt discovery degree
- true, // atomic_discovery
- &_is_alive_closure, // non-header is alive closure
- false); // disable adjusting number of processing threads
+ new PCReferenceProcessor(&_span_based_discoverer,
+ &_is_alive_closure); // non-header is alive closure
+
_counters = new CollectorCounters("PSParallelCompact", 1);
// Initialize static fields in ParCompactionManager.
@@ -2077,7 +2102,7 @@
TaskQueueSetSuper* qset = ParCompactionManager::stack_array();
ParallelTaskTerminator terminator(active_gc_threads, qset);
- ParCompactionManager::MarkAndPushClosure mark_and_push_closure(cm);
+ PCMarkAndPushClosure mark_and_push_closure(cm);
ParCompactionManager::FollowStackClosure follow_stack_closure(cm);
// Need new claim bits before marking starts.
@@ -2178,7 +2203,7 @@
// Need new claim bits when tracing through and adjusting pointers.
ClassLoaderDataGraph::clear_claimed_marks();
- PSParallelCompact::AdjustPointerClosure oop_closure(cm);
+ PCAdjustPointerClosure oop_closure(cm);
// General strong roots.
Universe::oops_do(&oop_closure);
@@ -2188,7 +2213,7 @@
Management::oops_do(&oop_closure);
JvmtiExport::oops_do(&oop_closure);
SystemDictionary::oops_do(&oop_closure);
- CLDToOopClosure cld_closure(&oop_closure);
+ CLDToOopClosure cld_closure(&oop_closure, ClassLoaderData::_claim_strong);
ClassLoaderDataGraph::cld_do(&cld_closure);
// Now adjust pointers in remaining weak roots. (All of which should
@@ -3071,76 +3096,6 @@
update_state(words);
}
-void InstanceKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) {
- PSParallelCompact::AdjustPointerClosure closure(cm);
- if (UseCompressedOops) {
- oop_oop_iterate_oop_maps<narrowOop>(obj, &closure);
- } else {
- oop_oop_iterate_oop_maps<oop>(obj, &closure);
- }
-}
-
-void InstanceMirrorKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) {
- InstanceKlass::oop_pc_update_pointers(obj, cm);
-
- PSParallelCompact::AdjustPointerClosure closure(cm);
- if (UseCompressedOops) {
- oop_oop_iterate_statics<narrowOop>(obj, &closure);
- } else {
- oop_oop_iterate_statics<oop>(obj, &closure);
- }
-}
-
-void InstanceClassLoaderKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) {
- InstanceKlass::oop_pc_update_pointers(obj, cm);
-}
-
-#ifdef ASSERT
-template <class T> static void trace_reference_gc(const char *s, oop obj,
- T* referent_addr,
- T* discovered_addr) {
- log_develop_trace(gc, ref)("%s obj " PTR_FORMAT, s, p2i(obj));
- log_develop_trace(gc, ref)(" referent_addr/* " PTR_FORMAT " / " PTR_FORMAT,
- p2i(referent_addr), referent_addr ? p2i((oop)RawAccess<>::oop_load(referent_addr)) : NULL);
- log_develop_trace(gc, ref)(" discovered_addr/* " PTR_FORMAT " / " PTR_FORMAT,
- p2i(discovered_addr), discovered_addr ? p2i((oop)RawAccess<>::oop_load(discovered_addr)) : NULL);
-}
-#endif
-
-template <class T>
-static void oop_pc_update_pointers_specialized(oop obj, ParCompactionManager* cm) {
- T* referent_addr = (T*)java_lang_ref_Reference::referent_addr_raw(obj);
- PSParallelCompact::adjust_pointer(referent_addr, cm);
- T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr_raw(obj);
- PSParallelCompact::adjust_pointer(discovered_addr, cm);
- debug_only(trace_reference_gc("InstanceRefKlass::oop_update_ptrs", obj,
- referent_addr, discovered_addr);)
-}
-
-void InstanceRefKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) {
- InstanceKlass::oop_pc_update_pointers(obj, cm);
-
- if (UseCompressedOops) {
- oop_pc_update_pointers_specialized<narrowOop>(obj, cm);
- } else {
- oop_pc_update_pointers_specialized<oop>(obj, cm);
- }
-}
-
-void ObjArrayKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) {
- assert(obj->is_objArray(), "obj must be obj array");
- PSParallelCompact::AdjustPointerClosure closure(cm);
- if (UseCompressedOops) {
- oop_oop_iterate_elements<narrowOop>(objArrayOop(obj), &closure);
- } else {
- oop_oop_iterate_elements<oop>(objArrayOop(obj), &closure);
- }
-}
-
-void TypeArrayKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) {
- assert(obj->is_typeArray(),"must be a type array");
-}
-
ParMarkBitMapClosure::IterationStatus
MoveAndUpdateClosure::do_addr(HeapWord* addr, size_t words) {
assert(destination() != NULL, "sanity");
--- a/src/hotspot/share/gc/parallel/psParallelCompact.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -934,23 +934,6 @@
virtual bool do_object_b(oop p);
};
- class AdjustPointerClosure: public BasicOopIterateClosure {
- public:
- AdjustPointerClosure(ParCompactionManager* cm) {
- assert(cm != NULL, "associate ParCompactionManage should not be NULL");
- _cm = cm;
- }
- template <typename T> void do_oop_work(T* p);
- virtual void do_oop(oop* p);
- virtual void do_oop(narrowOop* p);
-
- // This closure provides its own oop verification code.
- debug_only(virtual bool should_verify_oops() { return false; })
- private:
- ParCompactionManager* _cm;
- };
-
- friend class AdjustPointerClosure;
friend class RefProcTaskProxy;
friend class PSParallelCompactTest;
--- a/src/hotspot/share/gc/parallel/psParallelCompact.inline.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.inline.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -124,12 +124,21 @@
}
}
-template <typename T>
-void PSParallelCompact::AdjustPointerClosure::do_oop_work(T* p) {
- adjust_pointer(p, _cm);
-}
+class PCAdjustPointerClosure: public BasicOopIterateClosure {
+public:
+ PCAdjustPointerClosure(ParCompactionManager* cm) {
+ assert(cm != NULL, "associate ParCompactionManage should not be NULL");
+ _cm = cm;
+ }
+ template <typename T> void do_oop_nv(T* p) { PSParallelCompact::adjust_pointer(p, _cm); }
+ virtual void do_oop(oop* p) { do_oop_nv(p); }
+ virtual void do_oop(narrowOop* p) { do_oop_nv(p); }
-inline void PSParallelCompact::AdjustPointerClosure::do_oop(oop* p) { do_oop_work(p); }
-inline void PSParallelCompact::AdjustPointerClosure::do_oop(narrowOop* p) { do_oop_work(p); }
+ // This closure provides its own oop verification code.
+ debug_only(virtual bool should_verify_oops() { return false; })
+ virtual ReferenceIterationMode reference_iteration_mode() { return DO_FIELDS; }
+private:
+ ParCompactionManager* _cm;
+};
#endif // SHARE_VM_GC_PARALLEL_PSPARALLELCOMPACT_INLINE_HPP
--- a/src/hotspot/share/gc/parallel/psPromotionManager.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/parallel/psPromotionManager.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -41,14 +41,7 @@
#include "memory/padded.inline.hpp"
#include "memory/resourceArea.hpp"
#include "oops/access.inline.hpp"
-#include "oops/arrayOop.inline.hpp"
#include "oops/compressedOops.inline.hpp"
-#include "oops/instanceClassLoaderKlass.inline.hpp"
-#include "oops/instanceKlass.inline.hpp"
-#include "oops/instanceMirrorKlass.inline.hpp"
-#include "oops/objArrayKlass.inline.hpp"
-#include "oops/objArrayOop.inline.hpp"
-#include "oops/oop.inline.hpp"
PaddedEnd<PSPromotionManager>* PSPromotionManager::_manager_array = NULL;
OopStarTaskQueueSet* PSPromotionManager::_stack_array_depth = NULL;
@@ -397,101 +390,6 @@
}
}
-class PushContentsClosure : public BasicOopIterateClosure {
- PSPromotionManager* _pm;
- public:
- PushContentsClosure(PSPromotionManager* pm) : _pm(pm) {}
-
- template <typename T> void do_oop_work(T* p) {
- if (PSScavenge::should_scavenge(p)) {
- _pm->claim_or_forward_depth(p);
- }
- }
-
- virtual void do_oop(oop* p) { do_oop_work(p); }
- virtual void do_oop(narrowOop* p) { do_oop_work(p); }
-
- // Don't use the oop verification code in the oop_oop_iterate framework.
- debug_only(virtual bool should_verify_oops() { return false; })
-};
-
-void InstanceKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) {
- PushContentsClosure cl(pm);
- if (UseCompressedOops) {
- oop_oop_iterate_oop_maps_reverse<narrowOop>(obj, &cl);
- } else {
- oop_oop_iterate_oop_maps_reverse<oop>(obj, &cl);
- }
-}
-
-void InstanceMirrorKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) {
- // Note that we don't have to follow the mirror -> klass pointer, since all
- // klasses that are dirty will be scavenged when we iterate over the
- // ClassLoaderData objects.
-
- InstanceKlass::oop_ps_push_contents(obj, pm);
-
- PushContentsClosure cl(pm);
- if (UseCompressedOops) {
- oop_oop_iterate_statics<narrowOop>(obj, &cl);
- } else {
- oop_oop_iterate_statics<oop>(obj, &cl);
- }
-}
-
-void InstanceClassLoaderKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) {
- InstanceKlass::oop_ps_push_contents(obj, pm);
-
- // This is called by the young collector. It will already have taken care of
- // all class loader data. So, we don't have to follow the class loader ->
- // class loader data link.
-}
-
-template <class T>
-static void oop_ps_push_contents_specialized(oop obj, InstanceRefKlass *klass, PSPromotionManager* pm) {
- T* referent_addr = (T*)java_lang_ref_Reference::referent_addr_raw(obj);
- if (PSScavenge::should_scavenge(referent_addr)) {
- ReferenceProcessor* rp = PSScavenge::reference_processor();
- if (rp->discover_reference(obj, klass->reference_type())) {
- // reference discovered, referent will be traversed later.
- klass->InstanceKlass::oop_ps_push_contents(obj, pm);
- return;
- } else {
- // treat referent as normal oop
- pm->claim_or_forward_depth(referent_addr);
- }
- }
- // Treat discovered as normal oop
- T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr_raw(obj);
- if (PSScavenge::should_scavenge(discovered_addr)) {
- pm->claim_or_forward_depth(discovered_addr);
- }
- klass->InstanceKlass::oop_ps_push_contents(obj, pm);
-}
-
-void InstanceRefKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) {
- if (UseCompressedOops) {
- oop_ps_push_contents_specialized<narrowOop>(obj, this, pm);
- } else {
- oop_ps_push_contents_specialized<oop>(obj, this, pm);
- }
-}
-
-void ObjArrayKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) {
- assert(obj->is_objArray(), "obj must be obj array");
- PushContentsClosure cl(pm);
- if (UseCompressedOops) {
- oop_oop_iterate_elements<narrowOop>(objArrayOop(obj), &cl);
- } else {
- oop_oop_iterate_elements<oop>(objArrayOop(obj), &cl);
- }
-}
-
-void TypeArrayKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) {
- assert(obj->is_typeArray(),"must be a type array");
- ShouldNotReachHere();
-}
-
oop PSPromotionManager::oop_promotion_failed(oop obj, markOop obj_mark) {
assert(_old_gen_is_full || PromotionFailureALot, "Sanity");
--- a/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -30,9 +30,10 @@
#include "gc/parallel/psOldGen.hpp"
#include "gc/parallel/psPromotionLAB.inline.hpp"
#include "gc/parallel/psPromotionManager.hpp"
-#include "gc/parallel/psScavenge.hpp"
+#include "gc/parallel/psScavenge.inline.hpp"
#include "gc/shared/taskqueue.inline.hpp"
#include "logging/log.hpp"
+#include "memory/iterator.inline.hpp"
#include "oops/access.inline.hpp"
#include "oops/oop.inline.hpp"
@@ -99,8 +100,48 @@
}
}
+class PSPushContentsClosure: public BasicOopIterateClosure {
+ PSPromotionManager* _pm;
+ public:
+ PSPushContentsClosure(PSPromotionManager* pm) : BasicOopIterateClosure(PSScavenge::reference_processor()), _pm(pm) {}
+
+ template <typename T> void do_oop_nv(T* p) {
+ if (PSScavenge::should_scavenge(p)) {
+ _pm->claim_or_forward_depth(p);
+ }
+ }
+
+ virtual void do_oop(oop* p) { do_oop_nv(p); }
+ virtual void do_oop(narrowOop* p) { do_oop_nv(p); }
+
+ // Don't use the oop verification code in the oop_oop_iterate framework.
+ debug_only(virtual bool should_verify_oops() { return false; })
+};
+
+//
+// This closure specialization will override the one that is defined in
+// instanceRefKlass.inline.cpp. It swaps the order of oop_oop_iterate and
+// oop_oop_iterate_ref_processing. Unfortunately G1 and Parallel behaves
+// significantly better (especially in the Derby benchmark) using opposite
+// order of these function calls.
+//
+template <>
+inline void InstanceRefKlass::oop_oop_iterate_reverse<oop, PSPushContentsClosure>(oop obj, PSPushContentsClosure* closure) {
+ oop_oop_iterate_ref_processing<oop>(obj, closure);
+ InstanceKlass::oop_oop_iterate_reverse<oop>(obj, closure);
+}
+
+template <>
+inline void InstanceRefKlass::oop_oop_iterate_reverse<narrowOop, PSPushContentsClosure>(oop obj, PSPushContentsClosure* closure) {
+ oop_oop_iterate_ref_processing<narrowOop>(obj, closure);
+ InstanceKlass::oop_oop_iterate_reverse<narrowOop>(obj, closure);
+}
+
inline void PSPromotionManager::push_contents(oop obj) {
- obj->ps_push_contents(this);
+ if (!obj->klass()->is_typeArray_klass()) {
+ PSPushContentsClosure pcc(this);
+ obj->oop_iterate_backwards(&pcc);
+ }
}
//
// This method is pretty bulky. It would be nice to split it up
--- a/src/hotspot/share/gc/parallel/psScavenge.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/parallel/psScavenge.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -28,8 +28,10 @@
#include "gc/parallel/gcTaskManager.hpp"
#include "gc/parallel/parallelScavengeHeap.hpp"
#include "gc/parallel/psAdaptiveSizePolicy.hpp"
+#include "gc/parallel/psClosure.inline.hpp"
#include "gc/parallel/psMarkSweepProxy.hpp"
#include "gc/parallel/psParallelCompact.inline.hpp"
+#include "gc/parallel/psPromotionManager.inline.hpp"
#include "gc/parallel/psScavenge.inline.hpp"
#include "gc/parallel/psTasks.hpp"
#include "gc/shared/collectorPolicy.hpp"
--- a/src/hotspot/share/gc/parallel/psScavenge.inline.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/parallel/psScavenge.inline.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -26,7 +26,6 @@
#define SHARE_VM_GC_PARALLEL_PSSCAVENGE_INLINE_HPP
#include "gc/parallel/parallelScavengeHeap.hpp"
-#include "gc/parallel/psPromotionManager.inline.hpp"
#include "gc/parallel/psScavenge.hpp"
#include "logging/log.hpp"
#include "memory/iterator.hpp"
@@ -65,93 +64,4 @@
return should_scavenge(p);
}
-template<bool promote_immediately>
-class PSRootsClosure: public OopClosure {
- private:
- PSPromotionManager* _promotion_manager;
-
- protected:
- template <class T> void do_oop_work(T *p) {
- if (PSScavenge::should_scavenge(p)) {
- // We never card mark roots, maybe call a func without test?
- _promotion_manager->copy_and_push_safe_barrier<T, promote_immediately>(p);
- }
- }
- public:
- PSRootsClosure(PSPromotionManager* pm) : _promotion_manager(pm) { }
- void do_oop(oop* p) { PSRootsClosure::do_oop_work(p); }
- void do_oop(narrowOop* p) { PSRootsClosure::do_oop_work(p); }
-};
-
-typedef PSRootsClosure</*promote_immediately=*/false> PSScavengeRootsClosure;
-typedef PSRootsClosure</*promote_immediately=*/true> PSPromoteRootsClosure;
-
-// Scavenges a single oop in a ClassLoaderData.
-class PSScavengeFromCLDClosure: public OopClosure {
- private:
- PSPromotionManager* _pm;
- // Used to redirty a scanned cld if it has oops
- // pointing to the young generation after being scanned.
- ClassLoaderData* _scanned_cld;
- public:
- PSScavengeFromCLDClosure(PSPromotionManager* pm) : _pm(pm), _scanned_cld(NULL) { }
- void do_oop(narrowOop* p) { ShouldNotReachHere(); }
- void do_oop(oop* p) {
- ParallelScavengeHeap* psh = ParallelScavengeHeap::heap();
- assert(!psh->is_in_reserved(p), "GC barrier needed");
- if (PSScavenge::should_scavenge(p)) {
- assert(PSScavenge::should_scavenge(p, true), "revisiting object?");
-
- oop o = *p;
- oop new_obj;
- if (o->is_forwarded()) {
- new_obj = o->forwardee();
- } else {
- new_obj = _pm->copy_to_survivor_space</*promote_immediately=*/false>(o);
- }
- RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
-
- if (PSScavenge::is_obj_in_young(new_obj)) {
- do_cld_barrier();
- }
- }
- }
-
- void set_scanned_cld(ClassLoaderData* cld) {
- assert(_scanned_cld == NULL || cld == NULL, "Should always only handling one cld at a time");
- _scanned_cld = cld;
- }
-
- private:
- void do_cld_barrier() {
- assert(_scanned_cld != NULL, "Should not be called without having a scanned cld");
- _scanned_cld->record_modified_oops();
- }
-};
-
-// Scavenges the oop in a ClassLoaderData.
-class PSScavengeCLDClosure: public CLDClosure {
- private:
- PSScavengeFromCLDClosure _oop_closure;
- protected:
- public:
- PSScavengeCLDClosure(PSPromotionManager* pm) : _oop_closure(pm) { }
- void do_cld(ClassLoaderData* cld) {
- // If the cld has not been dirtied we know that there's
- // no references into the young gen and we can skip it.
-
- if (cld->has_modified_oops()) {
- // Setup the promotion manager to redirty this cld
- // if references are left in the young gen.
- _oop_closure.set_scanned_cld(cld);
-
- // Clean the cld since we're going to scavenge all the metadata.
- cld->oops_do(&_oop_closure, false, /*clear_modified_oops*/true);
-
- _oop_closure.set_scanned_cld(NULL);
- }
- }
-};
-
-
#endif // SHARE_VM_GC_PARALLEL_PSSCAVENGE_INLINE_HPP
--- a/src/hotspot/share/gc/parallel/psTasks.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/parallel/psTasks.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -29,6 +29,7 @@
#include "code/codeCache.hpp"
#include "gc/parallel/gcTaskManager.hpp"
#include "gc/parallel/psCardTable.hpp"
+#include "gc/parallel/psClosure.inline.hpp"
#include "gc/parallel/psPromotionManager.hpp"
#include "gc/parallel/psPromotionManager.inline.hpp"
#include "gc/parallel/psScavenge.inline.hpp"
--- a/src/hotspot/share/gc/serial/defNewGeneration.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/serial/defNewGeneration.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -137,7 +137,7 @@
_scavenge_closure->set_scanned_cld(cld);
// Clean the cld since we're going to scavenge all the metadata.
- cld->oops_do(_scavenge_closure, false, /*clear_modified_oops*/true);
+ cld->oops_do(_scavenge_closure, ClassLoaderData::_claim_none, /*clear_modified_oops*/true);
_scavenge_closure->set_scanned_cld(NULL);
}
--- a/src/hotspot/share/gc/serial/markSweep.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/serial/markSweep.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -58,9 +58,9 @@
MarkSweep::FollowRootClosure MarkSweep::follow_root_closure;
-MarkAndPushClosure MarkSweep::mark_and_push_closure;
-CLDToOopClosure MarkSweep::follow_cld_closure(&mark_and_push_closure);
-CLDToOopClosure MarkSweep::adjust_cld_closure(&adjust_pointer_closure);
+MarkAndPushClosure MarkSweep::mark_and_push_closure;
+CLDToOopClosure MarkSweep::follow_cld_closure(&mark_and_push_closure, ClassLoaderData::_claim_strong);
+CLDToOopClosure MarkSweep::adjust_cld_closure(&adjust_pointer_closure, ClassLoaderData::_claim_strong);
template <class T> inline void MarkSweep::KeepAliveClosure::do_oop_work(T* p) {
mark_and_push(p);
--- a/src/hotspot/share/gc/shared/barrierSet.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/shared/barrierSet.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -36,6 +36,7 @@
class BarrierSetAssembler;
class BarrierSetC1;
class BarrierSetC2;
+class BarrierSetNMethod;
class JavaThread;
// This class provides the interface between a barrier implementation and
@@ -72,6 +73,7 @@
BarrierSetAssembler* _barrier_set_assembler;
BarrierSetC1* _barrier_set_c1;
BarrierSetC2* _barrier_set_c2;
+ BarrierSetNMethod* _barrier_set_nmethod;
public:
// Metafunction mapping a class derived from BarrierSet to the
@@ -95,11 +97,13 @@
BarrierSet(BarrierSetAssembler* barrier_set_assembler,
BarrierSetC1* barrier_set_c1,
BarrierSetC2* barrier_set_c2,
+ BarrierSetNMethod* barrier_set_nmethod,
const FakeRtti& fake_rtti) :
_fake_rtti(fake_rtti),
_barrier_set_assembler(barrier_set_assembler),
_barrier_set_c1(barrier_set_c1),
- _barrier_set_c2(barrier_set_c2) {}
+ _barrier_set_c2(barrier_set_c2),
+ _barrier_set_nmethod(barrier_set_nmethod) {}
~BarrierSet() { }
template <class BarrierSetAssemblerT>
@@ -156,6 +160,10 @@
return _barrier_set_c2;
}
+ BarrierSetNMethod* barrier_set_nmethod() {
+ return _barrier_set_nmethod;
+ }
+
// The AccessBarrier of a BarrierSet subclass is called by the Access API
// (cf. oops/access.hpp) to perform decorated accesses. GC implementations
// may override these default access operations by declaring an
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/shared/barrierSetNMethod.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "code/codeCache.hpp"
+#include "code/nmethod.hpp"
+#include "gc/shared/barrierSet.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
+#include "logging/log.hpp"
+#include "runtime/thread.hpp"
+#include "utilities/debug.hpp"
+
+int BarrierSetNMethod::disarmed_value() const {
+ char* disarmed_addr = reinterpret_cast<char*>(Thread::current());
+ disarmed_addr += in_bytes(thread_disarmed_offset());
+ return *reinterpret_cast<int*>(disarmed_addr);
+}
+
+bool BarrierSetNMethod::supports_entry_barrier(nmethod* nm) {
+ if (nm->method()->is_method_handle_intrinsic()) {
+ return false;
+ }
+
+ if (!nm->is_native_method() && !nm->is_compiled_by_c2() && !nm->is_compiled_by_c1()) {
+ return false;
+ }
+
+ return true;
+}
+
+int BarrierSetNMethod::nmethod_stub_entry_barrier(address* return_address_ptr) {
+ address return_address = *return_address_ptr;
+ CodeBlob* cb = CodeCache::find_blob(return_address);
+ assert(cb != NULL, "invariant");
+
+ nmethod* nm = cb->as_nmethod();
+ BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
+
+ if (!bs_nm->is_armed(nm)) {
+ return 0;
+ }
+
+ assert(!nm->is_osr_method(), "Should not reach here");
+ // Called upon first entry after being armed
+ bool may_enter = bs_nm->nmethod_entry_barrier(nm);
+ if (!may_enter) {
+ log_trace(nmethod, barrier)("Deoptimizing nmethod: " PTR_FORMAT, p2i(nm));
+ bs_nm->deoptimize(nm, return_address_ptr);
+ }
+ return may_enter ? 0 : 1;
+}
+
+bool BarrierSetNMethod::nmethod_osr_entry_barrier(nmethod* nm) {
+ // This check depends on the invariant that all nmethods that are deoptimized / made not entrant
+ // are NOT disarmed.
+ // This invariant is important because a method can be deoptimized after the method have been
+ // resolved / looked up by OSR by another thread. By not deoptimizing them we guarantee that
+ // a deoptimized method will always hit the barrier and come to the same conclusion - deoptimize
+ if (!is_armed(nm)) {
+ return true;
+ }
+
+ assert(nm->is_osr_method(), "Should not reach here");
+ log_trace(nmethod, barrier)("Running osr nmethod entry barrier: " PTR_FORMAT, p2i(nm));
+ return nmethod_entry_barrier(nm);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/shared/barrierSetNMethod.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_CODE_NMETHOD_BARRIER_HPP
+#define SHARE_CODE_NMETHOD_BARRIER_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/sizes.hpp"
+
+class nmethod;
+
+class BarrierSetNMethod: public CHeapObj<mtGC> {
+ bool supports_entry_barrier(nmethod* nm);
+ void deoptimize(nmethod* nm, address* return_addr_ptr);
+
+protected:
+ virtual int disarmed_value() const;
+ virtual bool nmethod_entry_barrier(nmethod* nm) = 0;
+
+public:
+ virtual ByteSize thread_disarmed_offset() const = 0;
+
+ static int nmethod_stub_entry_barrier(address* return_address_ptr);
+ bool nmethod_osr_entry_barrier(nmethod* nm);
+ bool is_armed(nmethod* nm);
+ void disarm(nmethod* nm);
+};
+
+
+#endif // SHARE_CODE_NMETHOD_BARRIER_HPP
--- a/src/hotspot/share/gc/shared/collectedHeap.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/shared/collectedHeap.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -445,6 +445,15 @@
CollectedHeap::fill_with_object(start, end, zap);
}
+size_t CollectedHeap::min_dummy_object_size() const {
+ return oopDesc::header_size();
+}
+
+size_t CollectedHeap::tlab_alloc_reserve() const {
+ size_t min_size = min_dummy_object_size();
+ return min_size > (size_t)MinObjAlignment ? align_object_size(min_size) : 0;
+}
+
HeapWord* CollectedHeap::allocate_new_tlab(size_t min_size,
size_t requested_size,
size_t* actual_size) {
--- a/src/hotspot/share/gc/shared/collectedHeap.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/shared/collectedHeap.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -309,6 +309,8 @@
}
virtual void fill_with_dummy_object(HeapWord* start, HeapWord* end, bool zap);
+ virtual size_t min_dummy_object_size() const;
+ size_t tlab_alloc_reserve() const;
// Return the address "addr" aligned by "alignment_in_bytes" if such
// an address is below "end". Return NULL otherwise.
--- a/src/hotspot/share/gc/shared/memAllocator.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/shared/memAllocator.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -187,7 +187,7 @@
// support for JVMTI VMObjectAlloc event (no-op if not enabled)
JvmtiExport::vm_object_alloc_event_collector(obj());
- if (!ThreadHeapSampler::enabled()) {
+ if (!JvmtiExport::should_post_sampled_object_alloc()) {
// Sampling disabled
return;
}
@@ -282,7 +282,7 @@
HeapWord* mem = NULL;
ThreadLocalAllocBuffer& tlab = _thread->tlab();
- if (ThreadHeapSampler::enabled()) {
+ if (JvmtiExport::should_post_sampled_object_alloc()) {
// Try to allocate the sampled object from TLAB, it is possible a sample
// point was put and the TLAB still has space.
tlab.set_back_allocation_end();
--- a/src/hotspot/share/gc/shared/modRefBarrierSet.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/shared/modRefBarrierSet.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -39,6 +39,7 @@
: BarrierSet(barrier_set_assembler,
barrier_set_c1,
barrier_set_c2,
+ NULL /* barrier_set_nmethod */,
fake_rtti.add_tag(BarrierSet::ModRef)) { }
~ModRefBarrierSet() { }
--- a/src/hotspot/share/gc/shared/plab.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/shared/plab.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -27,7 +27,6 @@
#include "gc/shared/plab.inline.hpp"
#include "gc/shared/threadLocalAllocBuffer.hpp"
#include "logging/log.hpp"
-#include "oops/arrayOop.hpp"
#include "oops/oop.inline.hpp"
size_t PLAB::min_size() {
@@ -43,8 +42,7 @@
_word_sz(desired_plab_sz_), _bottom(NULL), _top(NULL),
_end(NULL), _hard_end(NULL), _allocated(0), _wasted(0), _undo_wasted(0)
{
- // ArrayOopDesc::header_size depends on command line initialization.
- AlignmentReserve = oopDesc::header_size() > MinObjAlignment ? align_object_size(arrayOopDesc::header_size(T_INT)) : 0;
+ AlignmentReserve = Universe::heap()->tlab_alloc_reserve();
assert(min_size() > AlignmentReserve,
"Minimum PLAB size " SIZE_FORMAT " must be larger than alignment reserve " SIZE_FORMAT " "
"to be able to contain objects", min_size(), AlignmentReserve);
--- a/src/hotspot/share/gc/shared/taskqueue.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/shared/taskqueue.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -370,6 +370,8 @@
public:
// Returns "true" if some TaskQueue in the set contains a task.
virtual bool peek() = 0;
+ // Tasks in queue
+ virtual uint tasks() const = 0;
};
template <MEMFLAGS F> class TaskQueueSetSuperImpl: public CHeapObj<F>, public TaskQueueSetSuper {
@@ -399,6 +401,7 @@
bool steal(uint queue_num, E& t);
bool peek();
+ uint tasks() const;
uint size() const { return _n; }
};
@@ -424,6 +427,15 @@
return false;
}
+template<class T, MEMFLAGS F>
+uint GenericTaskQueueSet<T, F>::tasks() const {
+ uint n = 0;
+ for (uint j = 0; j < _n; j++) {
+ n += _queues[j]->size();
+ }
+ return n;
+}
+
// When to terminate from the termination protocol.
class TerminatorTerminator: public CHeapObj<mtInternal> {
public:
--- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -23,6 +23,7 @@
*/
#include "precompiled.hpp"
+#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/threadLocalAllocBuffer.inline.hpp"
#include "logging/log.hpp"
#include "memory/resourceArea.hpp"
@@ -461,3 +462,8 @@
_perf_max_slow_allocations ->set_value(_max_slow_allocations);
}
}
+
+size_t ThreadLocalAllocBuffer::end_reserve() {
+ size_t reserve_size = Universe::heap()->tlab_alloc_reserve();
+ return MAX2(reserve_size, (size_t)_reserve_for_allocation_prefetch);
+}
--- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -26,7 +26,6 @@
#define SHARE_VM_GC_SHARED_THREADLOCALALLOCBUFFER_HPP
#include "gc/shared/gcUtil.hpp"
-#include "oops/typeArrayOop.hpp"
#include "runtime/perfData.hpp"
#include "runtime/vm_version.hpp"
@@ -138,10 +137,7 @@
inline HeapWord* allocate(size_t size);
// Reserve space at the end of TLAB
- static size_t end_reserve() {
- int reserve_size = typeArrayOopDesc::header_size(T_INT);
- return MAX2(reserve_size, _reserve_for_allocation_prefetch);
- }
+ static size_t end_reserve();
static size_t alignment_reserve() { return align_object_size(end_reserve()); }
static size_t alignment_reserve_in_bytes() { return alignment_reserve() * HeapWordSize; }
--- a/src/hotspot/share/gc/z/zBarrierSet.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/z/zBarrierSet.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -43,6 +43,7 @@
BarrierSet(make_barrier_set_assembler<ZBarrierSetAssembler>(),
make_barrier_set_c1<ZBarrierSetC1>(),
make_barrier_set_c2<ZBarrierSetC2>(),
+ NULL /* barrier_set_nmethod */,
BarrierSet::FakeRtti(BarrierSet::ZBarrierSet)) {}
ZBarrierSetAssembler* ZBarrierSet::assembler() {
--- a/src/hotspot/share/gc/z/zCollectedHeap.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/z/zCollectedHeap.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -23,6 +23,7 @@
#include "precompiled.hpp"
#include "gc/shared/gcHeapSummary.hpp"
+#include "gc/shared/suspendibleThreadSet.hpp"
#include "gc/z/zCollectedHeap.hpp"
#include "gc/z/zGlobals.hpp"
#include "gc/z/zHeap.inline.hpp"
@@ -295,6 +296,14 @@
reserved_region().start() + max_capacity_in_words);
}
+void ZCollectedHeap::safepoint_synchronize_begin() {
+ SuspendibleThreadSet::synchronize();
+}
+
+void ZCollectedHeap::safepoint_synchronize_end() {
+ SuspendibleThreadSet::desynchronize();
+}
+
void ZCollectedHeap::prepare_for_verify() {
// Does nothing
}
--- a/src/hotspot/share/gc/z/zCollectedHeap.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/z/zCollectedHeap.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -117,6 +117,9 @@
virtual VirtualSpaceSummary create_heap_space_summary();
+ virtual void safepoint_synchronize_begin();
+ virtual void safepoint_synchronize_end();
+
virtual void print_on(outputStream* st) const;
virtual void print_on_error(outputStream* st) const;
virtual void print_extended_on(outputStream* st) const;
--- a/src/hotspot/share/gc/z/zDriver.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/z/zDriver.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -336,7 +336,7 @@
// Phase 2: Concurrent Mark
{
ZStatTimer timer(ZPhaseConcurrentMark);
- ZHeap::heap()->mark();
+ ZHeap::heap()->mark(true /* initial */);
}
// Phase 3: Pause Mark End
@@ -345,7 +345,7 @@
while (!vm_operation(&cl)) {
// Phase 3.5: Concurrent Mark Continue
ZStatTimer timer(ZPhaseConcurrentMarkContinue);
- ZHeap::heap()->mark();
+ ZHeap::heap()->mark(false /* initial */);
}
}
--- a/src/hotspot/share/gc/z/zHeap.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/z/zHeap.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -296,8 +296,8 @@
ZStatHeap::set_at_mark_start(capacity(), used());
}
-void ZHeap::mark() {
- _mark.mark();
+void ZHeap::mark(bool initial) {
+ _mark.mark(initial);
}
void ZHeap::mark_flush_and_free(Thread* thread) {
--- a/src/hotspot/share/gc/z/zHeap.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/z/zHeap.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -133,7 +133,7 @@
bool is_object_strongly_live(uintptr_t addr) const;
template <bool finalizable, bool publish> void mark_object(uintptr_t addr);
void mark_start();
- void mark();
+ void mark(bool initial);
void mark_flush_and_free(Thread* thread);
bool mark_end();
--- a/src/hotspot/share/gc/z/zHeapIterator.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/z/zHeapIterator.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -29,7 +29,6 @@
#include "gc/z/zOop.inline.hpp"
#include "gc/z/zRootsIterator.hpp"
#include "memory/iterator.inline.hpp"
-#include "oops/oop.inline.hpp"
#include "utilities/bitMap.inline.hpp"
#include "utilities/stack.inline.hpp"
@@ -54,19 +53,18 @@
class ZHeapIteratorRootOopClosure : public ZRootsIteratorClosure {
private:
ZHeapIterator* const _iter;
- ObjectClosure* const _cl;
public:
- ZHeapIteratorRootOopClosure(ZHeapIterator* iter, ObjectClosure* cl) :
- _iter(iter),
- _cl(cl) {}
+ ZHeapIteratorRootOopClosure(ZHeapIterator* iter) :
+ _iter(iter) {}
virtual void do_oop(oop* p) {
// Load barrier needed here for the same reason we
- // need fixup_partial_loads() in ZHeap::mark_end()
+ // need fixup_partial_loads() in ZHeap::mark_end().
+ // This barrier is also needed here in case we're
+ // treating the JVMTI weak tag map as strong roots.
const oop obj = ZBarrier::load_barrier_on_oop_field(p);
_iter->push(obj);
- _iter->drain(_cl);
}
virtual void do_oop(narrowOop* p) {
@@ -74,19 +72,13 @@
}
};
-class ZHeapIteratorPushOopClosure : public BasicOopIterateClosure {
+class ZHeapIteratorOopClosure : public BasicOopIterateClosure {
private:
ZHeapIterator* const _iter;
const oop _base;
const bool _visit_referents;
-public:
- ZHeapIteratorPushOopClosure(ZHeapIterator* iter, oop base) :
- _iter(iter),
- _base(base),
- _visit_referents(iter->visit_referents()) {}
-
- oop load_oop(oop* p) {
+ oop load_oop(oop* p) const {
if (_visit_referents) {
return HeapAccess<ON_UNKNOWN_OOP_REF>::oop_load_at(_base, _base->field_offset(p));
} else {
@@ -94,6 +86,12 @@
}
}
+public:
+ ZHeapIteratorOopClosure(ZHeapIterator* iter, oop base, bool visit_referents) :
+ _iter(iter),
+ _base(base),
+ _visit_referents(visit_referents) {}
+
virtual ReferenceIterationMode reference_iteration_mode() {
return _visit_referents ? DO_FIELDS : DO_FIELDS_EXCEPT_REFERENT;
}
@@ -126,11 +124,11 @@
}
}
-size_t ZHeapIterator::object_index_max() const {
+static size_t object_index_max() {
return ZPageSizeMin >> ZObjectAlignmentSmallShift;
}
-size_t ZHeapIterator::object_index(oop obj) const {
+static size_t object_index(oop obj) {
const uintptr_t addr = ZOop::to_address(obj);
const uintptr_t offset = ZAddress::offset(addr);
const uintptr_t mask = (1 << ZPageSizeMinShift) - 1;
@@ -165,7 +163,22 @@
_visit_stack.push(obj);
}
-void ZHeapIterator::drain(ObjectClosure* cl) {
+void ZHeapIterator::objects_do(ObjectClosure* cl) {
+ // Push roots onto stack
+ {
+ // Note that we also visit the JVMTI weak tag map as if they were
+ // strong roots to make sure we visit all tagged objects, even
+ // those that might now have become unreachable. If we didn't do
+ // this the user would have expected to see ObjectFree events for
+ // unreachable objects in the tag map.
+ ZRootsIterator roots;
+ ZConcurrentRootsIterator concurrent_roots(false /* marking */);
+ ZHeapIteratorRootOopClosure root_cl(this);
+ roots.oops_do(&root_cl, true /* visit_jvmti_weak_export */);
+ concurrent_roots.oops_do(&root_cl);
+ }
+
+ // Drain stack
while (!_visit_stack.is_empty()) {
const oop obj = _visit_stack.pop();
@@ -173,23 +186,7 @@
cl->do_object(obj);
// Push members to visit
- ZHeapIteratorPushOopClosure push_cl(this, obj);
+ ZHeapIteratorOopClosure push_cl(this, obj, _visit_referents);
obj->oop_iterate(&push_cl);
}
}
-
-bool ZHeapIterator::visit_referents() const {
- return _visit_referents;
-}
-
-void ZHeapIterator::objects_do(ObjectClosure* cl) {
- ZHeapIteratorRootOopClosure root_cl(this, cl);
- ZRootsIterator roots;
-
- // Follow roots. Note that we also visit the JVMTI weak tag map
- // as if they were strong roots to make sure we visit all tagged
- // objects, even those that might now have become unreachable.
- // If we didn't do this the user would have expected to see
- // ObjectFree events for unreachable objects in the tag map.
- roots.oops_do(&root_cl, true /* visit_jvmti_weak_export */);
-}
--- a/src/hotspot/share/gc/z/zHeapIterator.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/z/zHeapIterator.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -33,7 +33,7 @@
class ZHeapIterator : public StackObj {
friend class ZHeapIteratorRootOopClosure;
- friend class ZHeapIteratorPushOopClosure;
+ friend class ZHeapIteratorOopClosure;
private:
typedef ZAddressRangeMap<ZHeapIteratorBitMap*, ZPageSizeMinShift> ZVisitMap;
@@ -44,14 +44,8 @@
ZVisitMap _visit_map;
const bool _visit_referents;
- size_t object_index_max() const;
- size_t object_index(oop obj) const;
ZHeapIteratorBitMap* object_map(oop obj);
-
void push(oop obj);
- void drain(ObjectClosure* cl);
-
- bool visit_referents() const;
public:
ZHeapIterator(bool visit_referents);
--- a/src/hotspot/share/gc/z/zInitialize.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/z/zInitialize.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -38,8 +38,8 @@
ZInitialize::ZInitialize(ZBarrierSet* barrier_set) {
log_info(gc, init)("Initializing %s", ZGCName);
log_info(gc, init)("Version: %s (%s)",
- Abstract_VM_Version::vm_release(),
- Abstract_VM_Version::jdk_debug_level());
+ VM_Version::vm_release(),
+ VM_Version::jdk_debug_level());
// Early initialization
ZAddressMasks::initialize();
--- a/src/hotspot/share/gc/z/zMark.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/z/zMark.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -615,6 +615,34 @@
stacks->free(&_allocator);
}
+class ZMarkConcurrentRootsIteratorClosure : public ZRootsIteratorClosure {
+public:
+ virtual void do_oop(oop* p) {
+ ZBarrier::mark_barrier_on_oop_field(p, false /* finalizable */);
+ }
+
+ virtual void do_oop(narrowOop* p) {
+ ShouldNotReachHere();
+ }
+};
+
+
+class ZMarkConcurrentRootsTask : public ZTask {
+private:
+ ZConcurrentRootsIterator _roots;
+ ZMarkConcurrentRootsIteratorClosure _cl;
+
+public:
+ ZMarkConcurrentRootsTask(ZMark* mark) :
+ ZTask("ZMarkConcurrentRootsTask"),
+ _roots(true /* marking */),
+ _cl() {}
+
+ virtual void work() {
+ _roots.oops_do(&_cl);
+ }
+};
+
class ZMarkTask : public ZTask {
private:
ZMark* const _mark;
@@ -637,7 +665,12 @@
}
};
-void ZMark::mark() {
+void ZMark::mark(bool initial) {
+ if (initial) {
+ ZMarkConcurrentRootsTask task(this);
+ _workers->run_concurrent(&task);
+ }
+
ZMarkTask task(this);
_workers->run_concurrent(&task);
}
--- a/src/hotspot/share/gc/z/zMark.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/z/zMark.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -108,7 +108,7 @@
template <bool finalizable, bool publish> void mark_object(uintptr_t addr);
void start();
- void mark();
+ void mark(bool initial);
bool end();
void flush_and_free();
--- a/src/hotspot/share/gc/z/zRootsIterator.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/z/zRootsIterator.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -28,6 +28,7 @@
#include "code/codeCache.hpp"
#include "compiler/oopMap.hpp"
#include "gc/shared/oopStorageParState.inline.hpp"
+#include "gc/shared/suspendibleThreadSet.hpp"
#include "gc/z/zGlobals.hpp"
#include "gc/z/zNMethodTable.hpp"
#include "gc/z/zOopClosures.inline.hpp"
@@ -52,16 +53,20 @@
static const ZStatSubPhase ZSubPhasePauseRoots("Pause Roots");
static const ZStatSubPhase ZSubPhasePauseRootsTeardown("Pause Roots Teardown");
static const ZStatSubPhase ZSubPhasePauseRootsUniverse("Pause Roots Universe");
-static const ZStatSubPhase ZSubPhasePauseRootsJNIHandles("Pause Roots JNIHandles");
static const ZStatSubPhase ZSubPhasePauseRootsObjectSynchronizer("Pause Roots ObjectSynchronizer");
static const ZStatSubPhase ZSubPhasePauseRootsManagement("Pause Roots Management");
static const ZStatSubPhase ZSubPhasePauseRootsJVMTIExport("Pause Roots JVMTIExport");
static const ZStatSubPhase ZSubPhasePauseRootsJVMTIWeakExport("Pause Roots JVMTIWeakExport");
static const ZStatSubPhase ZSubPhasePauseRootsSystemDictionary("Pause Roots SystemDictionary");
-static const ZStatSubPhase ZSubPhasePauseRootsClassLoaderDataGraph("Pause Roots ClassLoaderDataGraph");
static const ZStatSubPhase ZSubPhasePauseRootsThreads("Pause Roots Threads");
static const ZStatSubPhase ZSubPhasePauseRootsCodeCache("Pause Roots CodeCache");
+static const ZStatSubPhase ZSubPhaseConcurrentRootsSetup("Concurrent Roots Setup");
+static const ZStatSubPhase ZSubPhaseConcurrentRoots("Concurrent Roots");
+static const ZStatSubPhase ZSubPhaseConcurrentRootsTeardown("Concurrent Roots Teardown");
+static const ZStatSubPhase ZSubPhaseConcurrentRootsJNIHandles("Concurrent Roots JNIHandles");
+static const ZStatSubPhase ZSubPhaseConcurrentRootsClassLoaderDataGraph("Concurrent Roots ClassLoaderDataGraph");
+
static const ZStatSubPhase ZSubPhasePauseWeakRootsSetup("Pause Weak Roots Setup");
static const ZStatSubPhase ZSubPhasePauseWeakRoots("Pause Weak Roots");
static const ZStatSubPhase ZSubPhasePauseWeakRootsTeardown("Pause Weak Roots Teardown");
@@ -128,21 +133,17 @@
}
ZRootsIterator::ZRootsIterator() :
- _jni_handles_iter(JNIHandles::global_handles()),
_universe(this),
_object_synchronizer(this),
_management(this),
_jvmti_export(this),
_jvmti_weak_export(this),
_system_dictionary(this),
- _jni_handles(this),
- _class_loader_data_graph(this),
_threads(this),
_code_cache(this) {
assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
ZStatTimer timer(ZSubPhasePauseRootsSetup);
Threads::change_thread_claim_parity();
- ClassLoaderDataGraph::clear_claimed_marks();
COMPILER2_PRESENT(DerivedPointerTable::clear());
CodeCache::gc_prologue();
ZNMethodTable::gc_prologue();
@@ -163,11 +164,6 @@
Universe::oops_do(cl);
}
-void ZRootsIterator::do_jni_handles(ZRootsIteratorClosure* cl) {
- ZStatTimer timer(ZSubPhasePauseRootsJNIHandles);
- _jni_handles_iter.oops_do(cl);
-}
-
void ZRootsIterator::do_object_synchronizer(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRootsObjectSynchronizer);
ObjectSynchronizer::oops_do(cl);
@@ -194,12 +190,6 @@
SystemDictionary::oops_do(cl);
}
-void ZRootsIterator::do_class_loader_data_graph(ZRootsIteratorClosure* cl) {
- ZStatTimer timer(ZSubPhasePauseRootsClassLoaderDataGraph);
- CLDToOopClosure cld_cl(cl);
- ClassLoaderDataGraph::cld_do(&cld_cl);
-}
-
void ZRootsIterator::do_threads(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRootsThreads);
ResourceMark rm;
@@ -218,8 +208,6 @@
_management.oops_do(cl);
_jvmti_export.oops_do(cl);
_system_dictionary.oops_do(cl);
- _jni_handles.oops_do(cl);
- _class_loader_data_graph.oops_do(cl);
_threads.oops_do(cl);
_code_cache.oops_do(cl);
if (visit_jvmti_weak_export) {
@@ -227,6 +215,43 @@
}
}
+ZConcurrentRootsIterator::ZConcurrentRootsIterator(bool marking) :
+ _marking(marking),
+ _sts_joiner(marking /* active */),
+ _jni_handles_iter(JNIHandles::global_handles()),
+ _jni_handles(this),
+ _class_loader_data_graph(this) {
+ ZStatTimer timer(ZSubPhaseConcurrentRootsSetup);
+ if (_marking) {
+ ClassLoaderDataGraph_lock->lock();
+ ClassLoaderDataGraph::clear_claimed_marks();
+ }
+}
+
+ZConcurrentRootsIterator::~ZConcurrentRootsIterator() {
+ ZStatTimer timer(ZSubPhaseConcurrentRootsTeardown);
+ if (_marking) {
+ ClassLoaderDataGraph_lock->unlock();
+ }
+}
+
+void ZConcurrentRootsIterator::do_jni_handles(ZRootsIteratorClosure* cl) {
+ ZStatTimer timer(ZSubPhaseConcurrentRootsJNIHandles);
+ _jni_handles_iter.oops_do(cl);
+}
+
+void ZConcurrentRootsIterator::do_class_loader_data_graph(ZRootsIteratorClosure* cl) {
+ ZStatTimer timer(ZSubPhaseConcurrentRootsClassLoaderDataGraph);
+ CLDToOopClosure cld_cl(cl, _marking ? ClassLoaderData::_claim_strong : ClassLoaderData::_claim_none);
+ ClassLoaderDataGraph::cld_do(&cld_cl);
+}
+
+void ZConcurrentRootsIterator::oops_do(ZRootsIteratorClosure* cl) {
+ ZStatTimer timer(ZSubPhaseConcurrentRoots);
+ _jni_handles.oops_do(cl);
+ _class_loader_data_graph.oops_do(cl);
+}
+
ZWeakRootsIterator::ZWeakRootsIterator() :
_jvmti_weak_export(this),
_jfr_weak(this) {
--- a/src/hotspot/share/gc/z/zRootsIterator.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/gc/z/zRootsIterator.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -25,6 +25,7 @@
#define SHARE_GC_Z_ZROOTSITERATOR_HPP
#include "gc/shared/oopStorageParState.hpp"
+#include "gc/shared/suspendibleThreadSet.hpp"
#include "memory/allocation.hpp"
#include "memory/iterator.hpp"
#include "runtime/thread.hpp"
@@ -37,8 +38,7 @@
}
};
-typedef OopStorage::ParState<false /* concurrent */, false /* is_const */> ZOopStorageIterator;
-typedef OopStorage::ParState<true /* concurrent */, false /* is_const */> ZConcurrentOopStorageIterator;
+typedef OopStorage::ParState<true /* concurrent */, false /* is_const */> ZOopStorageIterator;
template <typename T, void (T::*F)(ZRootsIteratorClosure*)>
class ZSerialOopsDo {
@@ -86,29 +86,23 @@
class ZRootsIterator {
private:
- ZOopStorageIterator _jni_handles_iter;
-
void do_universe(ZRootsIteratorClosure* cl);
- void do_jni_handles(ZRootsIteratorClosure* cl);
void do_object_synchronizer(ZRootsIteratorClosure* cl);
void do_management(ZRootsIteratorClosure* cl);
void do_jvmti_export(ZRootsIteratorClosure* cl);
void do_jvmti_weak_export(ZRootsIteratorClosure* cl);
void do_system_dictionary(ZRootsIteratorClosure* cl);
- void do_class_loader_data_graph(ZRootsIteratorClosure* cl);
void do_threads(ZRootsIteratorClosure* cl);
void do_code_cache(ZRootsIteratorClosure* cl);
- ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_universe> _universe;
- ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_object_synchronizer> _object_synchronizer;
- ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_management> _management;
- ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_jvmti_export> _jvmti_export;
- ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_jvmti_weak_export> _jvmti_weak_export;
- ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_system_dictionary> _system_dictionary;
- ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_jni_handles> _jni_handles;
- ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_class_loader_data_graph> _class_loader_data_graph;
- ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_threads> _threads;
- ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_code_cache> _code_cache;
+ ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_universe> _universe;
+ ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_object_synchronizer> _object_synchronizer;
+ ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_management> _management;
+ ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_jvmti_export> _jvmti_export;
+ ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_jvmti_weak_export> _jvmti_weak_export;
+ ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_system_dictionary> _system_dictionary;
+ ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_threads> _threads;
+ ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_code_cache> _code_cache;
public:
ZRootsIterator();
@@ -117,6 +111,25 @@
void oops_do(ZRootsIteratorClosure* cl, bool visit_jvmti_weak_export = false);
};
+class ZConcurrentRootsIterator {
+private:
+ const bool _marking;
+ SuspendibleThreadSetJoiner _sts_joiner;
+ ZOopStorageIterator _jni_handles_iter;
+
+ void do_jni_handles(ZRootsIteratorClosure* cl);
+ void do_class_loader_data_graph(ZRootsIteratorClosure* cl);
+
+ ZParallelOopsDo<ZConcurrentRootsIterator, &ZConcurrentRootsIterator::do_jni_handles> _jni_handles;
+ ZParallelOopsDo<ZConcurrentRootsIterator, &ZConcurrentRootsIterator::do_class_loader_data_graph> _class_loader_data_graph;
+
+public:
+ ZConcurrentRootsIterator(bool marking);
+ ~ZConcurrentRootsIterator();
+
+ void oops_do(ZRootsIteratorClosure* cl);
+};
+
class ZWeakRootsIterator {
private:
void do_jvmti_weak_export(BoolObjectClosure* is_alive, ZRootsIteratorClosure* cl);
@@ -135,9 +148,9 @@
class ZConcurrentWeakRootsIterator {
private:
- ZConcurrentOopStorageIterator _vm_weak_handles_iter;
- ZConcurrentOopStorageIterator _jni_weak_handles_iter;
- ZConcurrentOopStorageIterator _string_table_iter;
+ ZOopStorageIterator _vm_weak_handles_iter;
+ ZOopStorageIterator _jni_weak_handles_iter;
+ ZOopStorageIterator _string_table_iter;
void do_vm_weak_handles(ZRootsIteratorClosure* cl);
void do_jni_weak_handles(ZRootsIteratorClosure* cl);
--- a/src/hotspot/share/interpreter/interpreterRuntime.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -29,6 +29,7 @@
#include "code/codeCache.hpp"
#include "compiler/compileBroker.hpp"
#include "compiler/disassembler.hpp"
+#include "gc/shared/barrierSetNMethod.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interpreterRuntime.hpp"
@@ -1045,6 +1046,13 @@
Method* method = last_frame.method();
int bci = method->bci_from(last_frame.bcp());
nm = method->lookup_osr_nmethod_for(bci, CompLevel_none, false);
+ BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
+ if (nm != NULL && bs_nm != NULL) {
+ // in case the transition passed a safepoint we need to barrier this again
+ if (!bs_nm->nmethod_osr_entry_barrier(nm)) {
+ nm = NULL;
+ }
+ }
}
if (nm != NULL && thread->is_interp_only_mode()) {
// Normally we never get an nm if is_interp_only_mode() is true, because
@@ -1081,6 +1089,13 @@
nmethod* osr_nm = CompilationPolicy::policy()->event(method, method, branch_bci, bci, CompLevel_none, NULL, thread);
assert(!HAS_PENDING_EXCEPTION, "Event handler should not throw any exceptions");
+ BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
+ if (osr_nm != NULL && bs_nm != NULL) {
+ if (!bs_nm->nmethod_osr_entry_barrier(osr_nm)) {
+ osr_nm = NULL;
+ }
+ }
+
if (osr_nm != NULL) {
// We may need to do on-stack replacement which requires that no
// monitors in the activation are biased because their
--- a/src/hotspot/share/interpreter/linkResolver.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/interpreter/linkResolver.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -974,68 +974,68 @@
THROW_MSG(vmSymbols::java_lang_NoSuchFieldError(), field->as_C_string());
}
- if (!link_info.check_access())
- // Access checking may be turned off when calling from within the VM.
- return;
+ // Access checking may be turned off when calling from within the VM.
+ Klass* current_klass = link_info.current_klass();
+ if (link_info.check_access()) {
- // check access
- Klass* current_klass = link_info.current_klass();
- check_field_accessability(current_klass, resolved_klass, sel_klass, fd, CHECK);
+ // check access
+ check_field_accessability(current_klass, resolved_klass, sel_klass, fd, CHECK);
- // check for errors
- if (is_static != fd.is_static()) {
- ResourceMark rm(THREAD);
- char msg[200];
- jio_snprintf(msg, sizeof(msg), "Expected %s field %s.%s", is_static ? "static" : "non-static", resolved_klass->external_name(), fd.name()->as_C_string());
- THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), msg);
- }
-
- // A final field can be modified only
- // (1) by methods declared in the class declaring the field and
- // (2) by the <clinit> method (in case of a static field)
- // or by the <init> method (in case of an instance field).
- if (is_put && fd.access_flags().is_final()) {
- ResourceMark rm(THREAD);
- stringStream ss;
-
- if (sel_klass != current_klass) {
- ss.print("Update to %s final field %s.%s attempted from a different class (%s) than the field's declaring class",
- is_static ? "static" : "non-static", resolved_klass->external_name(), fd.name()->as_C_string(),
- current_klass->external_name());
- THROW_MSG(vmSymbols::java_lang_IllegalAccessError(), ss.as_string());
+ // check for errors
+ if (is_static != fd.is_static()) {
+ ResourceMark rm(THREAD);
+ char msg[200];
+ jio_snprintf(msg, sizeof(msg), "Expected %s field %s.%s", is_static ? "static" : "non-static", resolved_klass->external_name(), fd.name()->as_C_string());
+ THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), msg);
}
- if (fd.constants()->pool_holder()->major_version() >= 53) {
- methodHandle m = link_info.current_method();
- assert(!m.is_null(), "information about the current method must be available for 'put' bytecodes");
- bool is_initialized_static_final_update = (byte == Bytecodes::_putstatic &&
- fd.is_static() &&
- !m()->is_static_initializer());
- bool is_initialized_instance_final_update = ((byte == Bytecodes::_putfield || byte == Bytecodes::_nofast_putfield) &&
- !fd.is_static() &&
- !m->is_object_initializer());
+ // A final field can be modified only
+ // (1) by methods declared in the class declaring the field and
+ // (2) by the <clinit> method (in case of a static field)
+ // or by the <init> method (in case of an instance field).
+ if (is_put && fd.access_flags().is_final()) {
+ ResourceMark rm(THREAD);
+ stringStream ss;
- if (is_initialized_static_final_update || is_initialized_instance_final_update) {
- ss.print("Update to %s final field %s.%s attempted from a different method (%s) than the initializer method %s ",
+ if (sel_klass != current_klass) {
+ ss.print("Update to %s final field %s.%s attempted from a different class (%s) than the field's declaring class",
is_static ? "static" : "non-static", resolved_klass->external_name(), fd.name()->as_C_string(),
- m()->name()->as_C_string(),
- is_static ? "<clinit>" : "<init>");
+ current_klass->external_name());
THROW_MSG(vmSymbols::java_lang_IllegalAccessError(), ss.as_string());
}
+
+ if (fd.constants()->pool_holder()->major_version() >= 53) {
+ methodHandle m = link_info.current_method();
+ assert(!m.is_null(), "information about the current method must be available for 'put' bytecodes");
+ bool is_initialized_static_final_update = (byte == Bytecodes::_putstatic &&
+ fd.is_static() &&
+ !m()->is_static_initializer());
+ bool is_initialized_instance_final_update = ((byte == Bytecodes::_putfield || byte == Bytecodes::_nofast_putfield) &&
+ !fd.is_static() &&
+ !m->is_object_initializer());
+
+ if (is_initialized_static_final_update || is_initialized_instance_final_update) {
+ ss.print("Update to %s final field %s.%s attempted from a different method (%s) than the initializer method %s ",
+ is_static ? "static" : "non-static", resolved_klass->external_name(), fd.name()->as_C_string(),
+ m()->name()->as_C_string(),
+ is_static ? "<clinit>" : "<init>");
+ THROW_MSG(vmSymbols::java_lang_IllegalAccessError(), ss.as_string());
+ }
+ }
+ }
+
+ // initialize resolved_klass if necessary
+ // note 1: the klass which declared the field must be initialized (i.e, sel_klass)
+ // according to the newest JVM spec (5.5, p.170) - was bug (gri 7/28/99)
+ //
+ // note 2: we don't want to force initialization if we are just checking
+ // if the field access is legal; e.g., during compilation
+ if (is_static && initialize_class) {
+ sel_klass->initialize(CHECK);
}
}
- // initialize resolved_klass if necessary
- // note 1: the klass which declared the field must be initialized (i.e, sel_klass)
- // according to the newest JVM spec (5.5, p.170) - was bug (gri 7/28/99)
- //
- // note 2: we don't want to force initialization if we are just checking
- // if the field access is legal; e.g., during compilation
- if (is_static && initialize_class) {
- sel_klass->initialize(CHECK);
- }
-
- if (sel_klass != current_klass) {
+ if ((sel_klass != current_klass) && (current_klass != NULL)) {
check_field_loader_constraints(field, sig, current_klass, sel_klass, CHECK);
}
--- a/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -92,7 +92,7 @@
SaveRestoreCLDClaimBits save_restore_cld_claim_bits;
RootSetClosureMarkScope mark_scope;
- CLDToOopClosure cldt_closure(closure);
+ CLDToOopClosure cldt_closure(closure, ClassLoaderData::_claim_strong);
ClassLoaderDataGraph::always_strong_cld_do(&cldt_closure);
CodeBlobToOopClosure blobs(closure, false);
Threads::oops_do(closure, &blobs);
--- a/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -128,7 +128,7 @@
bool ReferenceToRootClosure::do_cldg_roots() {
assert(!complete(), "invariant");
ReferenceLocateClosure rlc(_callback, OldObjectRoot::_class_loader_data, OldObjectRoot::_type_undetermined, NULL);
- CLDToOopClosure cldt_closure(&rlc);
+ CLDToOopClosure cldt_closure(&rlc, ClassLoaderData::_claim_strong);
ClassLoaderDataGraph::always_strong_cld_do(&cldt_closure);
return rlc.complete();
}
--- a/src/hotspot/share/jfr/leakprofiler/utilities/saveRestore.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/jfr/leakprofiler/utilities/saveRestore.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -69,12 +69,12 @@
CLDClaimContext::CLDClaimContext(ClassLoaderData* cld) : _cld(cld) {
assert(_cld->claimed(), "invariant");
- _cld->clear_claimed();
+ _cld->clear_claim();
}
CLDClaimContext::~CLDClaimContext() {
if (_cld != NULL) {
- _cld->claim();
+ _cld->try_claim(ClassLoaderData::_claim_strong);
assert(_cld->claimed(), "invariant");
}
}
--- a/src/hotspot/share/memory/filemap.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/memory/filemap.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -1088,8 +1088,8 @@
}
bool FileMapInfo::verify_mapped_heap_regions(int first, int num) {
- for (int i = first;
- i <= first + num; i++) {
+ assert(num > 0, "sanity");
+ for (int i = first; i < first + num; i++) {
if (!verify_region_checksum(i)) {
return false;
}
--- a/src/hotspot/share/memory/iterator.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/memory/iterator.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -32,7 +32,7 @@
DoNothingClosure do_nothing_cl;
void CLDToOopClosure::do_cld(ClassLoaderData* cld) {
- cld->oops_do(_oop_closure, _must_claim_cld);
+ cld->oops_do(_oop_closure, _cld_claim);
}
void ObjectToOopClosure::do_object(oop obj) {
--- a/src/hotspot/share/memory/iterator.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/memory/iterator.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -127,12 +127,13 @@
class CLDToOopClosure : public CLDClosure {
OopClosure* _oop_closure;
- bool _must_claim_cld;
+ int _cld_claim;
public:
- CLDToOopClosure(OopClosure* oop_closure, bool must_claim_cld = true) :
+ CLDToOopClosure(OopClosure* oop_closure,
+ int cld_claim) :
_oop_closure(oop_closure),
- _must_claim_cld(must_claim_cld) {}
+ _cld_claim(cld_claim) {}
void do_cld(ClassLoaderData* cld);
};
--- a/src/hotspot/share/memory/iterator.inline.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/memory/iterator.inline.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -39,8 +39,7 @@
#include "utilities/debug.hpp"
inline void MetadataVisitingOopIterateClosure::do_cld(ClassLoaderData* cld) {
- bool claim = true; // Must claim the class loader data before processing.
- cld->oops_do(this, claim);
+ cld->oops_do(this, ClassLoaderData::_claim_strong);
}
inline void MetadataVisitingOopIterateClosure::do_klass(Klass* k) {
--- a/src/hotspot/share/oops/accessBackend.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/oops/accessBackend.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -998,7 +998,7 @@
template <DecoratorSet decorators>
inline static typename EnableIf<
- HasDecorator<decorators, INTERNAL_BT_TO_SPACE_INVARIANT>::value, bool>::type
+ HasDecorator<decorators, AS_RAW>::value || HasDecorator<decorators, INTERNAL_BT_TO_SPACE_INVARIANT>::value, bool>::type
equals(oop o1, oop o2) {
typedef RawAccessBarrier<decorators & RAW_DECORATOR_MASK> Raw;
return Raw::equals(o1, o2);
@@ -1006,7 +1006,7 @@
template <DecoratorSet decorators>
inline static typename EnableIf<
- !HasDecorator<decorators, INTERNAL_BT_TO_SPACE_INVARIANT>::value, bool>::type
+ !HasDecorator<decorators, AS_RAW>::value && !HasDecorator<decorators, INTERNAL_BT_TO_SPACE_INVARIANT>::value, bool>::type
equals(oop o1, oop o2) {
return RuntimeDispatch<decorators, oop, BARRIER_EQUALS>::equals(o1, o2);
}
--- a/src/hotspot/share/oops/compressedOops.inline.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/oops/compressedOops.inline.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -66,7 +66,7 @@
assert(OopEncodingHeapMax > pd, "change encoding max if new encoding");
uint64_t result = pd >> shift;
assert((result & CONST64(0xffffffff00000000)) == 0, "narrow oop overflow");
- assert(decode(result) == v, "reversibility");
+ assert(oopDesc::equals_raw(decode(result), v), "reversibility");
return (narrowOop)result;
}
--- a/src/hotspot/share/oops/instanceClassLoaderKlass.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/oops/instanceClassLoaderKlass.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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
@@ -33,7 +33,7 @@
// An InstanceClassLoaderKlass is a specialization of the InstanceKlass. It does
// not add any field. It is added to walk the dependencies for the class loader
// key that this class loader points to. This is how the loader_data graph is
-// walked and dependant class loaders are kept alive. I thought we walked
+// walked and dependent class loaders are kept alive. I thought we walked
// the list later?
class InstanceClassLoaderKlass: public InstanceKlass {
@@ -48,21 +48,10 @@
public:
InstanceClassLoaderKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
- // GC specific object visitors
- //
-#if INCLUDE_PARALLELGC
- // Parallel Scavenge
- void oop_ps_push_contents( oop obj, PSPromotionManager* pm);
- // Parallel Compact
- void oop_pc_follow_contents(oop obj, ParCompactionManager* cm);
- void oop_pc_update_pointers(oop obj, ParCompactionManager* cm);
-#endif
-
// Oop fields (and metadata) iterators
//
// The InstanceClassLoaderKlass iterators also visit the CLD pointer (or mirror of anonymous klasses.)
- public:
// Forward iteration
// Iterate over the oop fields and metadata.
template <typename T, class OopClosureType>
--- a/src/hotspot/share/oops/instanceKlass.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/oops/instanceKlass.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -1183,16 +1183,6 @@
const char* signature_name() const;
static Symbol* package_from_name(const Symbol* name, TRAPS);
- // GC specific object visitors
- //
-#if INCLUDE_PARALLELGC
- // Parallel Scavenge
- void oop_ps_push_contents( oop obj, PSPromotionManager* pm);
- // Parallel Compact
- void oop_pc_follow_contents(oop obj, ParCompactionManager* cm);
- void oop_pc_update_pointers(oop obj, ParCompactionManager* cm);
-#endif
-
// Oop fields (and metadata) iterators
//
// The InstanceKlass iterators also visits the Object's klass.
--- a/src/hotspot/share/oops/instanceMirrorKlass.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/oops/instanceMirrorKlass.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -89,16 +89,6 @@
// allocation
instanceOop allocate_instance(Klass* k, TRAPS);
- // GC specific object visitors
- //
-#if INCLUDE_PARALLELGC
- // Parallel Scavenge
- void oop_ps_push_contents( oop obj, PSPromotionManager* pm);
- // Parallel Compact
- void oop_pc_follow_contents(oop obj, ParCompactionManager* cm);
- void oop_pc_update_pointers(oop obj, ParCompactionManager* cm);
-#endif
-
static void serialize_offsets(class SerializeClosure* f) NOT_CDS_RETURN;
// Oop fields (and metadata) iterators
--- a/src/hotspot/share/oops/instanceRefKlass.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/oops/instanceRefKlass.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -58,16 +58,6 @@
public:
InstanceRefKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
- // GC specific object visitors
- //
-#if INCLUDE_PARALLELGC
- // Parallel Scavenge
- void oop_ps_push_contents( oop obj, PSPromotionManager* pm);
- // Parallel Compact
- void oop_pc_follow_contents(oop obj, ParCompactionManager* cm);
- void oop_pc_update_pointers(oop obj, ParCompactionManager* cm);
-#endif
-
// Oop fields (and metadata) iterators
//
// The InstanceRefKlass iterators also support reference processing.
--- a/src/hotspot/share/oops/klass.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/oops/klass.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -673,16 +673,6 @@
clean_weak_klass_links(/*unloading_occurred*/ true , /* clean_alive_klasses */ false);
}
- // GC specific object visitors
- //
-#if INCLUDE_PARALLELGC
- // Parallel Scavenge
- virtual void oop_ps_push_contents( oop obj, PSPromotionManager* pm) = 0;
- // Parallel Compact
- virtual void oop_pc_follow_contents(oop obj, ParCompactionManager* cm) = 0;
- virtual void oop_pc_update_pointers(oop obj, ParCompactionManager* cm) = 0;
-#endif
-
virtual void array_klasses_do(void f(Klass* k)) {}
// Return self, except for abstract classes with exactly 1
--- a/src/hotspot/share/oops/objArrayKlass.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/oops/objArrayKlass.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -120,16 +120,6 @@
// Initialization (virtual from Klass)
void initialize(TRAPS);
- // GC specific object visitors
- //
-#if INCLUDE_PARALLELGC
- // Parallel Scavenge
- void oop_ps_push_contents( oop obj, PSPromotionManager* pm);
- // Parallel Compact
- void oop_pc_follow_contents(oop obj, ParCompactionManager* cm);
- void oop_pc_update_pointers(oop obj, ParCompactionManager* cm);
-#endif
-
// Oop fields (and metadata) iterators
//
// The ObjArrayKlass iterators also visits the Object's klass.
--- a/src/hotspot/share/oops/oop.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/oops/oop.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -285,16 +285,6 @@
// mark-sweep support
void follow_body(int begin, int end);
- // Garbage Collection support
-
-#if INCLUDE_PARALLELGC
- // Parallel Compact
- inline void pc_follow_contents(ParCompactionManager* cm);
- inline void pc_update_contents(ParCompactionManager* cm);
- // Parallel Scavenge
- inline void ps_push_contents(PSPromotionManager* pm);
-#endif
-
template <typename OopClosureType>
inline void oop_iterate(OopClosureType* cl);
--- a/src/hotspot/share/oops/oop.inline.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/oops/oop.inline.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -426,30 +426,6 @@
}
}
-#if INCLUDE_PARALLELGC
-void oopDesc::pc_follow_contents(ParCompactionManager* cm) {
- klass()->oop_pc_follow_contents(this, cm);
-}
-
-void oopDesc::pc_update_contents(ParCompactionManager* cm) {
- Klass* k = klass();
- if (!k->is_typeArray_klass()) {
- // It might contain oops beyond the header, so take the virtual call.
- k->oop_pc_update_pointers(this, cm);
- }
- // Else skip it. The TypeArrayKlass in the header never needs scavenging.
-}
-
-void oopDesc::ps_push_contents(PSPromotionManager* pm) {
- Klass* k = klass();
- if (!k->is_typeArray_klass()) {
- // It might contain oops beyond the header, so take the virtual call.
- k->oop_ps_push_contents(this, pm);
- }
- // Else skip it. The TypeArrayKlass in the header never needs scavenging.
-}
-#endif // INCLUDE_PARALLELGC
-
template <typename OopClosureType>
void oopDesc::oop_iterate(OopClosureType* cl) {
OopIteratorClosureDispatch::oop_oop_iterate(cl, this, klass());
--- a/src/hotspot/share/oops/typeArrayKlass.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/oops/typeArrayKlass.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -74,16 +74,6 @@
// Copying
void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS);
- // GC specific object visitors
- //
-#if INCLUDE_PARALLELGC
- // Parallel Scavenge
- void oop_ps_push_contents( oop obj, PSPromotionManager* pm);
- // Parallel Compact
- void oop_pc_follow_contents(oop obj, ParCompactionManager* cm);
- void oop_pc_update_pointers(oop obj, ParCompactionManager* cm);
-#endif
-
// Oop iterators. Since there are no oops in TypeArrayKlasses,
// these functions only return the size of the object.
--- a/src/hotspot/share/opto/cfgnode.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/opto/cfgnode.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -714,10 +714,151 @@
}
}
+ if (can_reshape) {
+ modified |= optimize_trichotomy(phase->is_IterGVN());
+ }
+
return modified ? this : NULL;
}
-
+//------------------------------optimize_trichotomy--------------------------
+// Optimize nested comparisons of the following kind:
+//
+// int compare(int a, int b) {
+// return (a < b) ? -1 : (a == b) ? 0 : 1;
+// }
+//
+// Shape 1:
+// if (compare(a, b) == 1) { ... } -> if (a > b) { ... }
+//
+// Shape 2:
+// if (compare(a, b) == 0) { ... } -> if (a == b) { ... }
+//
+// Above code leads to the following IR shapes where both Ifs compare the
+// same value and two out of three region inputs idx1 and idx2 map to
+// the same value and control flow.
+//
+// (1) If (2) If
+// / \ / \
+// Proj Proj Proj Proj
+// | \ | \
+// | If | If If
+// | / \ | / \ / \
+// | Proj Proj | Proj Proj ==> Proj Proj
+// | / / \ | / | /
+// Region / \ | / | /
+// \ / \ | / | /
+// Region Region Region
+//
+// The method returns true if 'this' is modified and false otherwise.
+bool RegionNode::optimize_trichotomy(PhaseIterGVN* igvn) {
+ int idx1 = 1, idx2 = 2;
+ Node* region = NULL;
+ if (req() == 3 && in(1) != NULL && in(2) != NULL) {
+ // Shape 1: Check if one of the inputs is a region that merges two control
+ // inputs and has no other users (especially no Phi users).
+ region = in(1)->isa_Region() ? in(1) : in(2)->isa_Region();
+ if (region == NULL || region->outcnt() != 2 || region->req() != 3) {
+ return false; // No suitable region input found
+ }
+ } else if (req() == 4) {
+ // Shape 2: Check if two control inputs map to the same value of the unique phi
+ // user and treat these as if they would come from another region (shape (1)).
+ PhiNode* phi = has_unique_phi();
+ if (phi == NULL) {
+ return false; // No unique phi user
+ }
+ if (phi->in(idx1) != phi->in(idx2)) {
+ idx2 = 3;
+ if (phi->in(idx1) != phi->in(idx2)) {
+ idx1 = 2;
+ if (phi->in(idx1) != phi->in(idx2)) {
+ return false; // No equal phi inputs found
+ }
+ }
+ }
+ assert(phi->in(idx1) == phi->in(idx2), "must be"); // Region is merging same value
+ region = this;
+ }
+ if (region == NULL || region->in(idx1) == NULL || region->in(idx2) == NULL) {
+ return false; // Region does not merge two control inputs
+ }
+ // At this point we know that region->in(idx1) and region->(idx2) map to the same
+ // value and control flow. Now search for ifs that feed into these region inputs.
+ ProjNode* proj1 = region->in(idx1)->isa_Proj();
+ ProjNode* proj2 = region->in(idx2)->isa_Proj();
+ if (proj1 == NULL || proj1->outcnt() != 1 ||
+ proj2 == NULL || proj2->outcnt() != 1) {
+ return false; // No projection inputs with region as unique user found
+ }
+ assert(proj1 != proj2, "should be different projections");
+ IfNode* iff1 = proj1->in(0)->isa_If();
+ IfNode* iff2 = proj2->in(0)->isa_If();
+ if (iff1 == NULL || iff1->outcnt() != 2 ||
+ iff2 == NULL || iff2->outcnt() != 2) {
+ return false; // No ifs found
+ }
+ if (iff1 == iff2) {
+ igvn->add_users_to_worklist(iff1); // Make sure dead if is eliminated
+ igvn->replace_input_of(region, idx1, iff1->in(0));
+ igvn->replace_input_of(region, idx2, igvn->C->top());
+ return (region == this); // Remove useless if (both projections map to the same control/value)
+ }
+ BoolNode* bol1 = iff1->in(1)->isa_Bool();
+ BoolNode* bol2 = iff2->in(1)->isa_Bool();
+ if (bol1 == NULL || bol2 == NULL) {
+ return false; // No bool inputs found
+ }
+ Node* cmp1 = bol1->in(1);
+ Node* cmp2 = bol2->in(1);
+ bool commute = false;
+ if (!cmp1->is_Cmp() || !cmp2->is_Cmp()) {
+ return false; // No comparison
+ } else if (cmp1->Opcode() == Op_CmpF || cmp1->Opcode() == Op_CmpD ||
+ cmp2->Opcode() == Op_CmpF || cmp2->Opcode() == Op_CmpD ||
+ cmp1->Opcode() == Op_CmpP || cmp1->Opcode() == Op_CmpN ||
+ cmp2->Opcode() == Op_CmpP || cmp2->Opcode() == Op_CmpN) {
+ // Floats and pointers don't exactly obey trichotomy. To be on the safe side, don't transform their tests.
+ return false;
+ } else if (cmp1 != cmp2) {
+ if (cmp1->in(1) == cmp2->in(2) &&
+ cmp1->in(2) == cmp2->in(1)) {
+ commute = true; // Same but swapped inputs, commute the test
+ } else {
+ return false; // Ifs are not comparing the same values
+ }
+ }
+ proj1 = proj1->other_if_proj();
+ proj2 = proj2->other_if_proj();
+ if (!((proj1->unique_ctrl_out() == iff2 &&
+ proj2->unique_ctrl_out() == this) ||
+ (proj2->unique_ctrl_out() == iff1 &&
+ proj1->unique_ctrl_out() == this))) {
+ return false; // Ifs are not connected through other projs
+ }
+ // Found 'iff -> proj -> iff -> proj -> this' shape where all other projs are merged
+ // through 'region' and map to the same value. Merge the boolean tests and replace
+ // the ifs by a single comparison.
+ BoolTest test1 = (proj1->_con == 1) ? bol1->_test : bol1->_test.negate();
+ BoolTest test2 = (proj2->_con == 1) ? bol2->_test : bol2->_test.negate();
+ test1 = commute ? test1.commute() : test1;
+ // After possibly commuting test1, if we can merge test1 & test2, then proj2/iff2/bol2 are the nodes to refine.
+ BoolTest::mask res = test1.merge(test2);
+ if (res == BoolTest::illegal) {
+ return false; // Unable to merge tests
+ }
+ // Adjust iff1 to always pass (only iff2 will remain)
+ igvn->replace_input_of(iff1, 1, igvn->intcon(proj1->_con));
+ if (res == BoolTest::never) {
+ // Merged test is always false, adjust iff2 to always fail
+ igvn->replace_input_of(iff2, 1, igvn->intcon(1 - proj2->_con));
+ } else {
+ // Replace bool input of iff2 with merged test
+ BoolNode* new_bol = new BoolNode(bol2->in(1), res);
+ igvn->replace_input_of(iff2, 1, igvn->transform((proj2->_con == 1) ? new_bol : new_bol->negate(igvn)));
+ }
+ return false;
+}
const RegMask &RegionNode::out_RegMask() const {
return RegMask::Empty;
--- a/src/hotspot/share/opto/cfgnode.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/opto/cfgnode.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -96,6 +96,7 @@
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const RegMask &out_RegMask() const;
bool try_clean_mem_phi(PhaseGVN *phase);
+ bool optimize_trichotomy(PhaseIterGVN* igvn);
};
//------------------------------JProjNode--------------------------------------
--- a/src/hotspot/share/opto/subnode.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/opto/subnode.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -1252,6 +1252,24 @@
st->print("%s", msg[_test]);
}
+// Returns the logical AND of two tests (or 'never' if both tests can never be true).
+// For example, a test for 'le' followed by a test for 'lt' is equivalent with 'lt'.
+BoolTest::mask BoolTest::merge(BoolTest other) const {
+ const mask res[illegal+1][illegal+1] = {
+ // eq, gt, of, lt, ne, le, nof, ge, never, illegal
+ {eq, never, illegal, never, never, eq, illegal, eq, never, illegal}, // eq
+ {never, gt, illegal, never, gt, never, illegal, gt, never, illegal}, // gt
+ {illegal, illegal, illegal, illegal, illegal, illegal, illegal, illegal, never, illegal}, // of
+ {never, never, illegal, lt, lt, lt, illegal, never, never, illegal}, // lt
+ {never, gt, illegal, lt, ne, lt, illegal, gt, never, illegal}, // ne
+ {eq, never, illegal, lt, lt, le, illegal, eq, never, illegal}, // le
+ {illegal, illegal, illegal, illegal, illegal, illegal, illegal, illegal, never, illegal}, // nof
+ {eq, gt, illegal, never, gt, eq, illegal, ge, never, illegal}, // ge
+ {never, never, never, never, never, never, never, never, never, illegal}, // never
+ {illegal, illegal, illegal, illegal, illegal, illegal, illegal, illegal, illegal, illegal}}; // illegal
+ return res[_test][other._test];
+}
+
//=============================================================================
uint BoolNode::hash() const { return (Node::hash() << 3)|(_test._test+1); }
uint BoolNode::size_of() const { return sizeof(BoolNode); }
--- a/src/hotspot/share/opto/subnode.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/opto/subnode.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -280,7 +280,7 @@
// We pick the values as 3 bits; the low order 2 bits we compare against the
// condition codes, the high bit flips the sense of the result.
struct BoolTest {
- enum mask { eq = 0, ne = 4, le = 5, ge = 7, lt = 3, gt = 1, overflow = 2, no_overflow = 6, illegal = 8 };
+ enum mask { eq = 0, ne = 4, le = 5, ge = 7, lt = 3, gt = 1, overflow = 2, no_overflow = 6, never = 8, illegal = 9 };
mask _test;
BoolTest( mask btm ) : _test(btm) {}
const Type *cc2logical( const Type *CC ) const;
@@ -293,6 +293,7 @@
bool is_less( ) const { return _test == BoolTest::lt || _test == BoolTest::le; }
bool is_greater( ) const { return _test == BoolTest::gt || _test == BoolTest::ge; }
void dump_on(outputStream *st) const;
+ mask merge(BoolTest other) const;
};
//------------------------------BoolNode---------------------------------------
--- a/src/hotspot/share/prims/jvm.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/prims/jvm.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -3736,8 +3736,8 @@
{
memset(info, 0, info_size);
- info->jvm_version = Abstract_VM_Version::jvm_version();
- info->patch_version = Abstract_VM_Version::vm_patch_version();
+ info->jvm_version = VM_Version::jvm_version();
+ info->patch_version = VM_Version::vm_patch_version();
// when we add a new capability in the jvm_version_info struct, we should also
// consider to expose this new capability in the sun.rt.jvmCapabilities jvmstat
--- a/src/hotspot/share/prims/jvmtiEnv.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/prims/jvmtiEnv.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -540,13 +540,6 @@
record_class_file_load_hook_enabled();
}
- if (event_type == JVMTI_EVENT_SAMPLED_OBJECT_ALLOC) {
- if (enabled) {
- ThreadHeapSampler::enable();
- } else {
- ThreadHeapSampler::disable();
- }
- }
JvmtiEventController::set_user_enabled(this, (JavaThread*) NULL, event_type, enabled);
} else {
// We have a specified event_thread.
@@ -926,7 +919,7 @@
thread_objs = NEW_RESOURCE_ARRAY(Handle, nthreads);
NULL_CHECK(thread_objs, JVMTI_ERROR_OUT_OF_MEMORY);
- for (int i=0; i < nthreads; i++) {
+ for (int i = 0; i < nthreads; i++) {
thread_objs[i] = Handle(tle.get_threadObj(i));
}
@@ -1151,16 +1144,14 @@
Handle context_class_loader;
bool is_daemon;
- { MutexLocker mu(Threads_lock);
-
- name = Handle(current_thread, java_lang_Thread::name(thread_obj()));
- priority = java_lang_Thread::priority(thread_obj());
- thread_group = Handle(current_thread, java_lang_Thread::threadGroup(thread_obj()));
- is_daemon = java_lang_Thread::is_daemon(thread_obj());
-
- oop loader = java_lang_Thread::context_class_loader(thread_obj());
- context_class_loader = Handle(current_thread, loader);
- }
+ name = Handle(current_thread, java_lang_Thread::name(thread_obj()));
+ priority = java_lang_Thread::priority(thread_obj());
+ thread_group = Handle(current_thread, java_lang_Thread::threadGroup(thread_obj()));
+ is_daemon = java_lang_Thread::is_daemon(thread_obj());
+
+ oop loader = java_lang_Thread::context_class_loader(thread_obj());
+ context_class_loader = Handle(current_thread, loader);
+
{ const char *n;
if (name() != NULL) {
@@ -1409,13 +1400,10 @@
bool is_daemon;
ThreadPriority max_priority;
- { MutexLocker mu(Threads_lock);
-
- name = java_lang_ThreadGroup::name(group_obj());
- parent_group = Handle(current_thread, java_lang_ThreadGroup::parent(group_obj()));
- is_daemon = java_lang_ThreadGroup::is_daemon(group_obj());
- max_priority = java_lang_ThreadGroup::maxPriority(group_obj());
- }
+ name = java_lang_ThreadGroup::name(group_obj());
+ parent_group = Handle(current_thread, java_lang_ThreadGroup::parent(group_obj()));
+ is_daemon = java_lang_ThreadGroup::is_daemon(group_obj());
+ max_priority = java_lang_ThreadGroup::maxPriority(group_obj());
info_ptr->is_daemon = is_daemon;
info_ptr->max_priority = max_priority;
@@ -1455,7 +1443,7 @@
Handle group_hdl(current_thread, group_obj);
{ // Cannot allow thread or group counts to change.
- MutexLocker mu(Threads_lock);
+ ObjectLocker ol(group_hdl, current_thread);
nthreads = java_lang_ThreadGroup::nthreads(group_hdl());
ngroups = java_lang_ThreadGroup::ngroups(group_hdl());
@@ -1465,7 +1453,7 @@
objArrayOop threads = java_lang_ThreadGroup::threads(group_hdl());
assert(nthreads <= threads->length(), "too many threads");
thread_objs = NEW_RESOURCE_ARRAY(Handle,nthreads);
- for (int i=0, j=0; i<nthreads; i++) {
+ for (int i = 0, j = 0; i < nthreads; i++) {
oop thread_obj = threads->obj_at(i);
assert(thread_obj != NULL, "thread_obj is NULL");
JavaThread *java_thread = NULL;
@@ -1497,15 +1485,14 @@
objArrayOop groups = java_lang_ThreadGroup::groups(group_hdl());
assert(ngroups <= groups->length(), "too many groups");
group_objs = NEW_RESOURCE_ARRAY(Handle,ngroups);
- for (int i=0; i<ngroups; i++) {
+ for (int i = 0; i < ngroups; i++) {
oop group_obj = groups->obj_at(i);
assert(group_obj != NULL, "group_obj != NULL");
group_objs[i] = Handle(current_thread, group_obj);
}
}
- }
-
- // have to make global handles outside of Threads_lock
+ } // ThreadGroup unlocked here
+
*group_count_ptr = ngroups;
*thread_count_ptr = nthreads;
*threads_ptr = new_jthreadArray(nthreads, thread_objs);
@@ -3253,7 +3240,7 @@
// objects that are locked.
int r;
intptr_t recursion = rmonitor->recursions();
- for (intptr_t i=0; i <= recursion; i++) {
+ for (intptr_t i = 0; i <= recursion; i++) {
r = rmonitor->raw_exit(thread);
assert(r == ObjectMonitor::OM_OK, "raw_exit should have worked");
if (r != ObjectMonitor::OM_OK) { // robustness
@@ -3683,7 +3670,7 @@
strcpy(*tmp_value, key);
} else {
// clean up previously allocated memory.
- for (int j=0; j<readable_count; j++) {
+ for (int j = 0; j < readable_count; j++) {
Deallocate((unsigned char*)*property_ptr+j);
}
Deallocate((unsigned char*)property_ptr);
--- a/src/hotspot/share/runtime/mutexLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/runtime/mutexLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -133,8 +133,6 @@
Monitor* PeriodicTask_lock = NULL;
Monitor* RedefineClasses_lock = NULL;
-Mutex* ThreadHeapSampler_lock = NULL;
-
#if INCLUDE_JFR
Mutex* JfrStacktrace_lock = NULL;
Monitor* JfrMsg_lock = NULL;
@@ -168,6 +166,16 @@
fatal("must own lock %s", lock->name());
}
+// a weaker assertion than the above
+void assert_locked_or_safepoint_weak(const Monitor * lock) {
+ if (IgnoreLockingAssertions) return;
+ assert(lock != NULL, "Need non-NULL lock");
+ if (lock->is_locked()) return;
+ if (SafepointSynchronize::is_at_safepoint()) return;
+ if (!Universe::is_fully_initialized()) return;
+ fatal("must own lock %s", lock->name());
+}
+
// a stronger assertion than the above
void assert_lock_strong(const Monitor * lock) {
if (IgnoreLockingAssertions) return;
@@ -301,8 +309,6 @@
def(PeriodicTask_lock , PaddedMonitor, nonleaf+5, true, Monitor::_safepoint_check_sometimes);
def(RedefineClasses_lock , PaddedMonitor, nonleaf+5, true, Monitor::_safepoint_check_always);
- def(ThreadHeapSampler_lock , PaddedMutex, nonleaf, false, Monitor::_safepoint_check_never);
-
if (WhiteBoxAPI) {
def(Compilation_lock , PaddedMonitor, leaf, false, Monitor::_safepoint_check_never);
}
--- a/src/hotspot/share/runtime/mutexLocker.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/runtime/mutexLocker.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -132,7 +132,6 @@
extern Monitor* Service_lock; // a lock used for service thread operation
extern Monitor* PeriodicTask_lock; // protects the periodic task structure
extern Monitor* RedefineClasses_lock; // locks classes from parallel redefinition
-extern Mutex* ThreadHeapSampler_lock; // protects the static data for initialization.
#if INCLUDE_JFR
extern Mutex* JfrStacktrace_lock; // used to guard access to the JFR stacktrace table
@@ -200,9 +199,11 @@
// for debugging: check that we're already owning this lock (or are at a safepoint)
#ifdef ASSERT
void assert_locked_or_safepoint(const Monitor * lock);
+void assert_locked_or_safepoint_weak(const Monitor * lock);
void assert_lock_strong(const Monitor * lock);
#else
#define assert_locked_or_safepoint(lock)
+#define assert_locked_or_safepoint_weak(lock)
#define assert_lock_strong(lock)
#endif
--- a/src/hotspot/share/runtime/os.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/runtime/os.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -1153,7 +1153,11 @@
}
if (accessible) {
- st->print_cr(INTPTR_FORMAT " points into unknown readable memory", p2i(addr));
+ st->print(INTPTR_FORMAT " points into unknown readable memory:", p2i(addr));
+ for (address p = addr; p < align_up(addr + 1, sizeof(intptr_t)); ++p) {
+ st->print(" %02x", *(u1*)p);
+ }
+ st->cr();
return;
}
--- a/src/hotspot/share/runtime/os.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/runtime/os.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -543,7 +543,7 @@
static char* do_you_want_to_debug(const char* message);
// run cmd in a separate process and return its exit code; or -1 on failures
- static int fork_and_exec(char *cmd);
+ static int fork_and_exec(char *cmd, bool use_vfork_if_available = false);
// Call ::exit() on all platforms but Windows
static void exit(int num);
--- a/src/hotspot/share/runtime/thread.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/runtime/thread.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -4569,9 +4569,9 @@
st->print_raw_cr(os::local_time_string(buf, sizeof(buf)));
st->print_cr("Full thread dump %s (%s %s):",
- Abstract_VM_Version::vm_name(),
- Abstract_VM_Version::vm_release(),
- Abstract_VM_Version::vm_info_string());
+ VM_Version::vm_name(),
+ VM_Version::vm_release(),
+ VM_Version::vm_info_string());
st->cr();
#if INCLUDE_SERVICES
--- a/src/hotspot/share/runtime/threadHeapSampler.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/runtime/threadHeapSampler.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -29,22 +29,29 @@
#include "runtime/sharedRuntime.hpp"
#include "runtime/threadHeapSampler.hpp"
-// Cheap random number generator
+// Cheap random number generator.
uint64_t ThreadHeapSampler::_rnd;
// Default is 512kb.
-int ThreadHeapSampler::_sampling_interval = 512 * 1024;
-int ThreadHeapSampler::_enabled;
+volatile int ThreadHeapSampler::_sampling_interval = 512 * 1024;
+
+// Ordering here is important: _log_table first, _log_table_initialized second.
+double ThreadHeapSampler::_log_table[1 << ThreadHeapSampler::FastLogNumBits] = {};
+
+// Force initialization of the log_table.
+bool ThreadHeapSampler::_log_table_initialized = init_log_table();
-// Statics for the fast log
-static const int FastLogNumBits = 10;
-static const int FastLogMask = (1 << FastLogNumBits) - 1;
-static double log_table[1<<FastLogNumBits]; // Constant
-static bool log_table_initialized;
+bool ThreadHeapSampler::init_log_table() {
+ for (int i = 0; i < (1 << FastLogNumBits); i++) {
+ _log_table[i] = (log(1.0 + static_cast<double>(i+0.5) / (1 << FastLogNumBits))
+ / log(2.0));
+ }
+ return true;
+}
// Returns the next prng value.
// pRNG is: aX+b mod c with a = 0x5DEECE66D, b = 0xB, c = 1<<48
// This is the lrand64 generator.
-static uint64_t next_random(uint64_t rnd) {
+uint64_t ThreadHeapSampler::next_random(uint64_t rnd) {
const uint64_t PrngMult = 0x5DEECE66DLL;
const uint64_t PrngAdd = 0xB;
const uint64_t PrngModPower = 48;
@@ -54,7 +61,7 @@
return (PrngMult * rnd + PrngAdd) & PrngModMask;
}
-static double fast_log2(const double & d) {
+double ThreadHeapSampler::fast_log2(const double& d) {
assert(d>0, "bad value passed to assert");
uint64_t x = 0;
assert(sizeof(d) == sizeof(x),
@@ -64,7 +71,9 @@
assert(FastLogNumBits <= 20, "FastLogNumBits should be less than 20.");
const uint32_t y = x_high >> (20 - FastLogNumBits) & FastLogMask;
const int32_t exponent = ((x_high >> 20) & 0x7FF) - 1023;
- return exponent + log_table[y];
+
+ assert(_log_table_initialized, "log table should be initialized");
+ return exponent + _log_table[y];
}
// Generates a geometric variable with the specified mean (512K by default).
@@ -134,36 +143,6 @@
pick_next_sample(overflow_bytes);
}
-void ThreadHeapSampler::init_log_table() {
- MutexLockerEx mu(ThreadHeapSampler_lock, Mutex::_no_safepoint_check_flag);
-
- if (log_table_initialized) {
- return;
- }
-
- for (int i = 0; i < (1 << FastLogNumBits); i++) {
- log_table[i] = (log(1.0 + static_cast<double>(i+0.5) / (1 << FastLogNumBits))
- / log(2.0));
- }
-
- log_table_initialized = true;
-}
-
-void ThreadHeapSampler::enable() {
- // Done here to be done when things have settled. This adds a mutex lock but
- // presumably, users won't be enabling and disabling all the time.
- init_log_table();
- OrderAccess::release_store(&_enabled, 1);
-}
-
-int ThreadHeapSampler::enabled() {
- return OrderAccess::load_acquire(&_enabled);
-}
-
-void ThreadHeapSampler::disable() {
- OrderAccess::release_store(&_enabled, 0);
-}
-
int ThreadHeapSampler::get_sampling_interval() {
return OrderAccess::load_acquire(&_sampling_interval);
}
--- a/src/hotspot/share/runtime/threadHeapSampler.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/runtime/threadHeapSampler.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -30,20 +30,24 @@
class ThreadHeapSampler {
private:
+ // Statics for the fast log
+ static const int FastLogNumBits = 10;
+ static const int FastLogMask = (1 << FastLogNumBits) - 1;
+
size_t _bytes_until_sample;
// Cheap random number generator
static uint64_t _rnd;
+ static bool _log_table_initialized;
+
+ static double _log_table[1<<FastLogNumBits]; // Constant
+ static volatile int _sampling_interval;
void pick_next_geometric_sample();
void pick_next_sample(size_t overflowed_bytes = 0);
- static int _enabled;
- static int _sampling_interval;
- // Used for assertion mode to determine if there is a path to a TLAB slow path
- // without a collector present.
- size_t _collectors_present;
-
- static void init_log_table();
+ static double fast_log2(const double& d);
+ static bool init_log_table();
+ uint64_t next_random(uint64_t rnd);
public:
ThreadHeapSampler() : _bytes_until_sample(0) {
@@ -51,8 +55,6 @@
if (_rnd == 0) {
_rnd = 1;
}
-
- _collectors_present = 0;
}
size_t bytes_until_sample() { return _bytes_until_sample; }
@@ -60,10 +62,6 @@
void check_for_sampling(oop obj, size_t size_in_bytes, size_t bytes_allocated_before);
- static int enabled();
- static void enable();
- static void disable();
-
static void set_sampling_interval(int sampling_interval);
static int get_sampling_interval();
};
--- a/src/hotspot/share/runtime/vframe.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/runtime/vframe.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -134,7 +134,7 @@
//
// Skip the monitor that the thread is blocked to enter or waiting on
//
- if (!found_first_monitor && (obj == pending_obj || obj == waiting_obj)) {
+ if (!found_first_monitor && (oopDesc::equals(obj, pending_obj) || oopDesc::equals(obj, waiting_obj))) {
continue;
}
found_first_monitor = true;
--- a/src/hotspot/share/runtime/vm_version.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/runtime/vm_version.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -218,10 +218,16 @@
#define HOTSPOT_BUILD_COMPILER "MS VC++ 12.0 (VS2013)"
#elif _MSC_VER == 1900
#define HOTSPOT_BUILD_COMPILER "MS VC++ 14.0 (VS2015)"
+ #elif _MSC_VER == 1911
+ #define HOTSPOT_BUILD_COMPILER "MS VC++ 15.3 (VS2017)"
#elif _MSC_VER == 1912
#define HOTSPOT_BUILD_COMPILER "MS VC++ 15.5 (VS2017)"
#elif _MSC_VER == 1913
#define HOTSPOT_BUILD_COMPILER "MS VC++ 15.6 (VS2017)"
+ #elif _MSC_VER == 1914
+ #define HOTSPOT_BUILD_COMPILER "MS VC++ 15.7 (VS2017)"
+ #elif _MSC_VER == 1915
+ #define HOTSPOT_BUILD_COMPILER "MS VC++ 15.8 (VS2017)"
#else
#define HOTSPOT_BUILD_COMPILER "unknown MS VC++:" XSTR(_MSC_VER)
#endif
--- a/src/hotspot/share/runtime/vm_version.hpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/runtime/vm_version.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -69,7 +69,7 @@
// occurred. Examines a variety of the hardware capabilities of
// the platform to determine which features can be used to execute the
// program.
- static void initialize();
+ static void initialize() { }
// This allows for early initialization of VM_Version information
// that may be needed later in the initialization sequence but before
--- a/src/hotspot/share/services/diagnosticCommand.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/services/diagnosticCommand.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -213,8 +213,8 @@
}
void VersionDCmd::execute(DCmdSource source, TRAPS) {
- output()->print_cr("%s version %s", Abstract_VM_Version::vm_name(),
- Abstract_VM_Version::vm_release());
+ output()->print_cr("%s version %s", VM_Version::vm_name(),
+ VM_Version::vm_release());
JDK_Version jdk_version = JDK_Version::current();
if (jdk_version.patch_version() > 0) {
output()->print_cr("JDK %d.%d.%d.%d", jdk_version.major_version(),
--- a/src/hotspot/share/services/runtimeService.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/services/runtimeService.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -66,7 +66,7 @@
// create performance counters for jvm_version and its capabilities
PerfDataManager::create_constant(SUN_RT, "jvmVersion", PerfData::U_None,
- (jlong) Abstract_VM_Version::jvm_version(), CHECK);
+ (jlong) VM_Version::jvm_version(), CHECK);
// The capabilities counter is a binary representation of the VM capabilities in string.
// This string respresentation simplifies the implementation of the client side
--- a/src/hotspot/share/utilities/vmError.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/hotspot/share/utilities/vmError.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -319,18 +319,18 @@
JDK_Version::runtime_name() : "";
const char* runtime_version = JDK_Version::runtime_version() != NULL ?
JDK_Version::runtime_version() : "";
- const char* jdk_debug_level = Abstract_VM_Version::printable_jdk_debug_level() != NULL ?
- Abstract_VM_Version::printable_jdk_debug_level() : "";
+ const char* jdk_debug_level = VM_Version::printable_jdk_debug_level() != NULL ?
+ VM_Version::printable_jdk_debug_level() : "";
st->print_cr("# JRE version: %s (%s) (%sbuild %s)", runtime_name, buf,
jdk_debug_level, runtime_version);
// This is the long version with some default settings added
st->print_cr("# Java VM: %s (%s%s, %s%s%s%s%s, %s, %s)",
- Abstract_VM_Version::vm_name(),
+ VM_Version::vm_name(),
jdk_debug_level,
- Abstract_VM_Version::vm_release(),
- Abstract_VM_Version::vm_info_string(),
+ VM_Version::vm_release(),
+ VM_Version::vm_info_string(),
TieredCompilation ? ", tiered" : "",
#if INCLUDE_JVMCI
EnableJVMCI ? ", jvmci" : "",
@@ -340,7 +340,7 @@
#endif
UseCompressedOops ? ", compressed oops" : "",
GCConfig::hs_err_name(),
- Abstract_VM_Version::vm_platform_string()
+ VM_Version::vm_platform_string()
);
}
@@ -756,6 +756,24 @@
st->cr();
}
+ STEP("inspecting top of stack")
+
+ // decode stack contents if possible
+ if (_verbose && _context && Universe::is_fully_initialized()) {
+ frame fr = os::fetch_frame_from_context(_context);
+ const int slots = 8;
+ const intptr_t *start = fr.sp();
+ const intptr_t *end = start + slots;
+ if (is_aligned(start, sizeof(intptr_t)) && os::is_readable_range(start, end)) {
+ st->print_cr("Stack slot to memory mapping:");
+ for (int i = 0; i < slots; ++i) {
+ st->print("stack at sp + %d slots: ", i);
+ os::print_location(st, *(start + i));
+ }
+ }
+ st->cr();
+ }
+
STEP("printing code blob if possible")
if (_verbose && _context) {
@@ -989,7 +1007,7 @@
STEP("printing internal vm info")
if (_verbose) {
- st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string());
+ st->print_cr("vm_info: %s", VM_Version::internal_vm_info_string());
st->cr();
}
@@ -1152,7 +1170,7 @@
// STEP("printing internal vm info")
- st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string());
+ st->print_cr("vm_info: %s", VM_Version::internal_vm_info_string());
st->cr();
// print a defined marker to show that error handling finished correctly.
@@ -1565,7 +1583,7 @@
#endif
tty->print_cr("\"%s\"...", cmd);
- if (os::fork_and_exec(cmd) < 0) {
+ if (os::fork_and_exec(cmd, true) < 0) {
tty->print_cr("os::fork_and_exec failed: %s (%s=%d)",
os::strerror(errno), os::errno_name(errno), errno);
}
--- a/src/java.base/share/classes/com/sun/crypto/provider/CipherCore.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/com/sun/crypto/provider/CipherCore.java Wed Oct 17 08:09:46 2018 -0700
@@ -253,11 +253,10 @@
return result;
}
-
/**
* Sets the padding mechanism of this cipher.
*
- * @param padding the padding mechanism
+ * @param paddingScheme the padding mechanism
*
* @exception NoSuchPaddingException if the requested padding mechanism
* does not exist
@@ -660,10 +659,7 @@
* (e.g., has not been initialized)
*/
byte[] update(byte[] input, int inputOffset, int inputLen) {
- if (requireReinit) {
- throw new IllegalStateException
- ("Must use either different key or iv for GCM encryption");
- }
+ checkReinit();
byte[] output = null;
try {
@@ -711,10 +707,7 @@
*/
int update(byte[] input, int inputOffset, int inputLen, byte[] output,
int outputOffset) throws ShortBufferException {
- if (requireReinit) {
- throw new IllegalStateException
- ("Must use either different key or iv for GCM encryption");
- }
+ checkReinit();
// figure out how much can be sent to crypto function
int len = Math.addExact(buffered, inputLen);
@@ -849,12 +842,20 @@
*/
byte[] doFinal(byte[] input, int inputOffset, int inputLen)
throws IllegalBlockSizeException, BadPaddingException {
- byte[] output = null;
try {
- output = new byte[getOutputSizeByOperation(inputLen, true)];
- int len = doFinal(input, inputOffset, inputLen, output, 0);
- if (len < output.length) {
- byte[] copy = Arrays.copyOf(output, len);
+ checkReinit();
+ byte[] output = new byte[getOutputSizeByOperation(inputLen, true)];
+ byte[] finalBuf = prepareInputBuffer(input, inputOffset,
+ inputLen, output, 0);
+ int finalOffset = (finalBuf == input) ? inputOffset : 0;
+ int finalBufLen = (finalBuf == input) ? inputLen : finalBuf.length;
+
+ int outLen = fillOutputBuffer(finalBuf, finalOffset, output, 0,
+ finalBufLen, input);
+
+ endDoFinal();
+ if (outLen < output.length) {
+ byte[] copy = Arrays.copyOf(output, outLen);
if (decrypting) {
// Zero out internal (ouput) array
Arrays.fill(output, (byte) 0x00);
@@ -909,26 +910,81 @@
int outputOffset)
throws IllegalBlockSizeException, ShortBufferException,
BadPaddingException {
- if (requireReinit) {
- throw new IllegalStateException
- ("Must use either different key or iv for GCM encryption");
- }
+ checkReinit();
int estOutSize = getOutputSizeByOperation(inputLen, true);
- // check output buffer capacity.
- // if we are decrypting with padding applied, we can perform this
- // check only after we have determined how many padding bytes there
- // are.
- int outputCapacity = output.length - outputOffset;
- int minOutSize = (decrypting? (estOutSize - blockSize):estOutSize);
- if ((output == null) || (outputCapacity < minOutSize)) {
- throw new ShortBufferException("Output buffer must be "
- + "(at least) " + minOutSize + " bytes long");
+ int outputCapacity = checkOutputCapacity(output, outputOffset,
+ estOutSize);
+ int offset = decrypting ? 0 : outputOffset; // 0 for decrypting
+ byte[] finalBuf = prepareInputBuffer(input, inputOffset,
+ inputLen, output, outputOffset);
+ byte[] outWithPadding = null; // for decrypting only
+
+ int finalOffset = (finalBuf == input) ? inputOffset : 0;
+ int finalBufLen = (finalBuf == input) ? inputLen : finalBuf.length;
+
+ if (decrypting) {
+ // if the size of specified output buffer is less than
+ // the length of the cipher text, then the current
+ // content of cipher has to be preserved in order for
+ // users to retry the call with a larger buffer in the
+ // case of ShortBufferException.
+ if (outputCapacity < estOutSize) {
+ cipher.save();
+ }
+ // create temporary output buffer so that only "real"
+ // data bytes are passed to user's output buffer.
+ outWithPadding = new byte[estOutSize];
}
+ byte[] outBuffer = decrypting ? outWithPadding : output;
+ int outLen = fillOutputBuffer(finalBuf, finalOffset, outBuffer,
+ offset, finalBufLen, input);
+
+ if (decrypting) {
+
+ if (outputCapacity < outLen) {
+ // restore so users can retry with a larger buffer
+ cipher.restore();
+ throw new ShortBufferException("Output buffer too short: "
+ + (outputCapacity)
+ + " bytes given, " + outLen
+ + " bytes needed");
+ }
+ // copy the result into user-supplied output buffer
+ System.arraycopy(outWithPadding, 0, output, outputOffset, outLen);
+ // decrypt mode. Zero out output data that's not required
+ Arrays.fill(outWithPadding, (byte) 0x00);
+ }
+ endDoFinal();
+ return outLen;
+ }
+
+ private void endDoFinal() {
+ buffered = 0;
+ diffBlocksize = blockSize;
+ if (cipherMode != ECB_MODE) {
+ cipher.reset();
+ }
+ }
+
+ private int unpad(int outLen, byte[] outWithPadding)
+ throws BadPaddingException {
+ int padStart = padding.unpad(outWithPadding, 0, outLen);
+ if (padStart < 0) {
+ throw new BadPaddingException("Given final block not " +
+ "properly padded. Such issues can arise if a bad key " +
+ "is used during decryption.");
+ }
+ outLen = padStart;
+ return outLen;
+ }
+
+ private byte[] prepareInputBuffer(byte[] input, int inputOffset,
+ int inputLen, byte[] output, int outputOffset)
+ throws IllegalBlockSizeException, ShortBufferException {
// calculate total input length
int len = Math.addExact(buffered, inputLen);
-
// calculate padding length
int totalLen = Math.addExact(len, cipher.getBufferedLength());
int paddingLen = 0;
@@ -958,18 +1014,15 @@
* - there are internally buffered bytes
* - doing encryption and padding is needed
*/
- byte[] finalBuf = input;
- int finalOffset = inputOffset;
- int finalBufLen = inputLen;
if ((buffered != 0) || (!decrypting && padding != null) ||
((input == output)
&& (outputOffset - inputOffset < inputLen)
&& (inputOffset - outputOffset < buffer.length))) {
+ byte[] finalBuf;
if (decrypting || padding == null) {
paddingLen = 0;
}
finalBuf = new byte[Math.addExact(len, paddingLen)];
- finalOffset = 0;
if (buffered != 0) {
System.arraycopy(buffer, 0, finalBuf, 0, buffered);
if (!decrypting) {
@@ -980,56 +1033,31 @@
}
if (inputLen != 0) {
System.arraycopy(input, inputOffset, finalBuf,
- buffered, inputLen);
+ buffered, inputLen);
}
if (paddingLen != 0) {
padding.padWithLen(finalBuf, Math.addExact(buffered, inputLen), paddingLen);
}
- finalBufLen = finalBuf.length;
+ return finalBuf;
}
- int outLen = 0;
- if (decrypting) {
- // if the size of specified output buffer is less than
- // the length of the cipher text, then the current
- // content of cipher has to be preserved in order for
- // users to retry the call with a larger buffer in the
- // case of ShortBufferException.
- if (outputCapacity < estOutSize) {
- cipher.save();
- }
- // create temporary output buffer so that only "real"
- // data bytes are passed to user's output buffer.
- byte[] outWithPadding = new byte[estOutSize];
- outLen = finalNoPadding(finalBuf, finalOffset, outWithPadding,
- 0, finalBufLen);
+ return input;
+ }
- if (padding != null) {
- int padStart = padding.unpad(outWithPadding, 0, outLen);
- if (padStart < 0) {
- throw new BadPaddingException("Given final block not " +
- "properly padded. Such issues can arise if a bad key " +
- "is used during decryption.");
- }
- outLen = padStart;
+ private int fillOutputBuffer(byte[] finalBuf, int finalOffset,
+ byte[] output, int outOfs, int finalBufLen,
+ byte[] input)
+ throws ShortBufferException, BadPaddingException,
+ IllegalBlockSizeException {
+ int len;
+ try {
+ len = finalNoPadding(finalBuf, finalOffset, output,
+ outOfs, finalBufLen);
+ if (decrypting && padding != null) {
+ len = unpad(len, output);
}
-
- if (outputCapacity < outLen) {
- // restore so users can retry with a larger buffer
- cipher.restore();
- throw new ShortBufferException("Output buffer too short: "
- + (outputCapacity)
- + " bytes given, " + outLen
- + " bytes needed");
- }
- // copy the result into user-supplied output buffer
- System.arraycopy(outWithPadding, 0, output, outputOffset, outLen);
- // decrypt mode. Zero out output data that's not required
- Arrays.fill(outWithPadding, (byte) 0x00);
- } else { // encrypting
- try {
- outLen = finalNoPadding(finalBuf, finalOffset, output,
- outputOffset, finalBufLen);
- } finally {
+ return len;
+ } finally {
+ if (!decrypting) {
// reset after doFinal() for GCM encryption
requireReinit = (cipherMode == GCM_MODE);
if (finalBuf != input) {
@@ -1038,13 +1066,28 @@
}
}
}
+ }
- buffered = 0;
- diffBlocksize = blockSize;
- if (cipherMode != ECB_MODE) {
- cipher.reset();
+ private int checkOutputCapacity(byte[] output, int outputOffset,
+ int estOutSize) throws ShortBufferException {
+ // check output buffer capacity.
+ // if we are decrypting with padding applied, we can perform this
+ // check only after we have determined how many padding bytes there
+ // are.
+ int outputCapacity = output.length - outputOffset;
+ int minOutSize = decrypting ? (estOutSize - blockSize) : estOutSize;
+ if ((output == null) || (outputCapacity < minOutSize)) {
+ throw new ShortBufferException("Output buffer must be "
+ + "(at least) " + minOutSize + " bytes long");
}
- return outLen;
+ return outputCapacity;
+ }
+
+ private void checkReinit() {
+ if (requireReinit) {
+ throw new IllegalStateException
+ ("Must use either different key or iv for GCM encryption");
+ }
}
private int finalNoPadding(byte[] in, int inOfs, byte[] out, int outOfs,
@@ -1177,10 +1220,7 @@
* @since 1.8
*/
void updateAAD(byte[] src, int offset, int len) {
- if (requireReinit) {
- throw new IllegalStateException
- ("Must use either different key or iv for GCM encryption");
- }
+ checkReinit();
cipher.updateAAD(src, offset, len);
}
}
--- a/src/java.base/share/classes/java/io/FileInputStream.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/java/io/FileInputStream.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2018, 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
@@ -79,8 +79,6 @@
private volatile boolean closed;
- private final Object altFinalizer;
-
/**
* Creates a <code>FileInputStream</code> by
* opening a connection to an actual file,
@@ -155,10 +153,7 @@
fd.attach(this);
path = name;
open(name);
- altFinalizer = getFinalizer(this);
- if (altFinalizer == null) {
- FileCleanable.register(fd); // open set the fd, register the cleanup
- }
+ FileCleanable.register(fd); // open set the fd, register the cleanup
}
/**
@@ -195,7 +190,6 @@
}
fd = fdObj;
path = null;
- altFinalizer = null;
/*
* FileDescriptor is being shared by streams.
@@ -438,85 +432,4 @@
static {
initIDs();
}
-
- /**
- * Ensures that the {@link #close} method of this file input stream is
- * called when there are no more references to it.
- * The {@link #finalize} method does not call {@link #close} directly.
- *
- * @apiNote
- * To release resources used by this stream {@link #close} should be called
- * directly or by try-with-resources.
- *
- * @implSpec
- * If this FileInputStream has been subclassed and the {@link #close}
- * method has been overridden, the {@link #close} method will be
- * called when the FileInputStream is unreachable.
- * Otherwise, it is implementation specific how the resource cleanup described in
- * {@link #close} is performed.
- *
- * @deprecated The {@code finalize} method has been deprecated and will be removed.
- * Subclasses that override {@code finalize} in order to perform cleanup
- * should be modified to use alternative cleanup mechanisms and
- * to remove the overriding {@code finalize} method.
- * When overriding the {@code finalize} method, its implementation must explicitly
- * ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
- * See the specification for {@link Object#finalize()} for further
- * information about migration options.
- *
- * @exception IOException if an I/O error occurs.
- * @see java.io.FileInputStream#close()
- */
- @Deprecated(since="9", forRemoval = true)
- protected void finalize() throws IOException {
- }
-
- /*
- * Returns a finalizer object if the FIS needs a finalizer; otherwise null.
- * If the FIS has a close method; it needs an AltFinalizer.
- */
- private static Object getFinalizer(FileInputStream fis) {
- Class<?> clazz = fis.getClass();
- while (clazz != FileInputStream.class) {
- try {
- clazz.getDeclaredMethod("close");
- return new AltFinalizer(fis);
- } catch (NoSuchMethodException nsme) {
- // ignore
- }
- clazz = clazz.getSuperclass();
- }
- return null;
- }
- /**
- * Class to call {@code FileInputStream.close} when finalized.
- * If finalization of the stream is needed, an instance is created
- * in its constructor(s). When the set of instances
- * related to the stream is unreachable, the AltFinalizer performs
- * the needed call to the stream's {@code close} method.
- */
- static class AltFinalizer {
- private final FileInputStream fis;
-
- AltFinalizer(FileInputStream fis) {
- this.fis = fis;
- }
-
- @Override
- @SuppressWarnings("deprecation")
- protected final void finalize() {
- try {
- if ((fis.fd != null) && (fis.fd != FileDescriptor.in)) {
- /* if fd is shared, the references in FileDescriptor
- * will ensure that finalizer is only called when
- * safe to do so. All references using the fd have
- * become unreachable. We can call close()
- */
- fis.close();
- }
- } catch (IOException ioe) {
- // ignore
- }
- }
- }
}
--- a/src/java.base/share/classes/java/io/FileOutputStream.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/java/io/FileOutputStream.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2018, 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
@@ -95,8 +95,6 @@
private volatile boolean closed;
- private final Object altFinalizer;
-
/**
* Creates a file output stream to write to the file with the
* specified name. A new <code>FileDescriptor</code> object is
@@ -235,10 +233,7 @@
this.path = name;
open(name, append);
- altFinalizer = getFinalizer(this);
- if (altFinalizer == null) {
- FileCleanable.register(fd); // open sets the fd, register the cleanup
- }
+ FileCleanable.register(fd); // open sets the fd, register the cleanup
}
/**
@@ -274,7 +269,6 @@
}
this.fd = fdObj;
this.path = null;
- this.altFinalizer = null;
fd.attach(this);
}
@@ -457,98 +451,9 @@
return fc;
}
- /**
- * Cleans up the connection to the file, and ensures that the
- * {@link #close} method of this file output stream is
- * called when there are no more references to this stream.
- * The {@link #finalize} method does not call {@link #close} directly.
- *
- * @apiNote
- * To release resources used by this stream {@link #close} should be called
- * directly or by try-with-resources.
- *
- * @implSpec
- * If this FileOutputStream has been subclassed and the {@link #close}
- * method has been overridden, the {@link #close} method will be
- * called when the FileOutputStream is unreachable.
- * Otherwise, it is implementation specific how the resource cleanup described in
- * {@link #close} is performed.
- *
- * @deprecated The {@code finalize} method has been deprecated and will be removed.
- * Subclasses that override {@code finalize} in order to perform cleanup
- * should be modified to use alternative cleanup mechanisms and
- * to remove the overriding {@code finalize} method.
- * When overriding the {@code finalize} method, its implementation must explicitly
- * ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
- * See the specification for {@link Object#finalize()} for further
- * information about migration options.
- *
- * @exception IOException if an I/O error occurs.
- * @see java.io.FileInputStream#close()
- */
- @Deprecated(since="9", forRemoval = true)
- protected void finalize() throws IOException {
- }
-
private static native void initIDs();
static {
initIDs();
}
-
- /*
- * Returns a finalizer object if the FOS needs a finalizer; otherwise null.
- * If the FOS has a close method; it needs an AltFinalizer.
- */
- private static Object getFinalizer(FileOutputStream fos) {
- Class<?> clazz = fos.getClass();
- while (clazz != FileOutputStream.class) {
- try {
- clazz.getDeclaredMethod("close");
- return new AltFinalizer(fos);
- } catch (NoSuchMethodException nsme) {
- // ignore
- }
- clazz = clazz.getSuperclass();
- }
- return null;
- }
-
- /**
- * Class to call {@code FileOutputStream.close} when finalized.
- * If finalization of the stream is needed, an instance is created
- * in its constructor(s). When the set of instances
- * related to the stream is unreachable, the AltFinalizer performs
- * the needed call to the stream's {@code close} method.
- */
- static class AltFinalizer {
- private final FileOutputStream fos;
-
- AltFinalizer(FileOutputStream fos) {
- this.fos = fos;
- }
-
- @Override
- @SuppressWarnings("deprecation")
- protected final void finalize() {
- try {
- if (fos.fd != null) {
- if (fos.fd == FileDescriptor.out || fos.fd == FileDescriptor.err) {
- // Subclass may override flush; otherwise it is no-op
- fos.flush();
- } else {
- /* if fd is shared, the references in FileDescriptor
- * will ensure that finalizer is only called when
- * safe to do so. All references using the fd have
- * become unreachable. We can call close()
- */
- fos.close();
- }
- }
- } catch (IOException ioe) {
- // ignore
- }
- }
- }
-
}
--- a/src/java.base/share/classes/java/lang/AbstractStringBuilder.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/java/lang/AbstractStringBuilder.java Wed Oct 17 08:09:46 2018 -0700
@@ -69,10 +69,13 @@
*/
int count;
+ private static final byte[] EMPTYVALUE = new byte[0];
+
/**
* This no-arg constructor is necessary for serialization of subclasses.
*/
AbstractStringBuilder() {
+ value = EMPTYVALUE;
}
/**
--- a/src/java.base/share/classes/java/lang/doc-files/ValueBased.html Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/java/lang/doc-files/ValueBased.html Wed Oct 17 08:09:46 2018 -0700
@@ -2,7 +2,7 @@
<html lang="en">
<head>
<title>Value-based Classes</title>
- <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
+ <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<h2 id="ValueBased">Value-based Classes</h2>
--- a/src/java.base/share/classes/java/lang/doc-files/threadPrimitiveDeprecation.html Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/java/lang/doc-files/threadPrimitiveDeprecation.html Wed Oct 17 08:09:46 2018 -0700
@@ -26,7 +26,7 @@
<html lang="en">
<head>
<title>Java Thread Primitive Deprecation</title>
- <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
+ <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<h2>Java Thread Primitive Deprecation</h2>
--- a/src/java.base/share/classes/java/net/InetAddress.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/java/net/InetAddress.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2018, 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
@@ -35,6 +35,7 @@
import java.io.ObjectStreamException;
import java.io.ObjectStreamField;
import java.io.IOException;
+import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.ObjectInputStream.GetField;
import java.io.ObjectOutputStream;
@@ -1727,8 +1728,11 @@
}
GetField gf = s.readFields();
String host = (String)gf.get("hostName", null);
- int address= gf.get("address", 0);
- int family= gf.get("family", 0);
+ int address = gf.get("address", 0);
+ int family = gf.get("family", 0);
+ if (family != IPv4 && family != IPv6) {
+ throw new InvalidObjectException("invalid address family type: " + family);
+ }
InetAddressHolder h = new InetAddressHolder(host, address, family);
UNSAFE.putObject(this, FIELDS_OFFSET, h);
}
--- a/src/java.base/share/classes/java/net/NetworkInterface.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/java/net/NetworkInterface.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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
@@ -321,8 +321,20 @@
if (addr == null) {
throw new NullPointerException();
}
- if (!(addr instanceof Inet4Address || addr instanceof Inet6Address)) {
- throw new IllegalArgumentException ("invalid address type");
+ if (addr instanceof Inet4Address) {
+ Inet4Address inet4Address = (Inet4Address) addr;
+ if (inet4Address.holder.family != InetAddress.IPv4) {
+ throw new IllegalArgumentException("invalid family type: "
+ + inet4Address.holder.family);
+ }
+ } else if (addr instanceof Inet6Address) {
+ Inet6Address inet6Address = (Inet6Address) addr;
+ if (inet6Address.holder.family != InetAddress.IPv6) {
+ throw new IllegalArgumentException("invalid family type: "
+ + inet6Address.holder.family);
+ }
+ } else {
+ throw new IllegalArgumentException("invalid address type: " + addr);
}
return getByInetAddress0(addr);
}
--- a/src/java.base/share/classes/java/net/SocketInputStream.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/java/net/SocketInputStream.java Wed Oct 17 08:09:46 2018 -0700
@@ -232,7 +232,11 @@
* @return the number of immediately available bytes
*/
public int available() throws IOException {
- return impl.available();
+ if (eof) {
+ return 0;
+ } else {
+ return impl.available();
+ }
}
/**
--- a/src/java.base/share/classes/java/net/URLClassLoader.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/java/net/URLClassLoader.java Wed Oct 17 08:09:46 2018 -0700
@@ -535,13 +535,13 @@
* @spec JPMS
*/
protected Package definePackage(String name, Manifest man, URL url) {
- String path = name.replace('.', '/').concat("/");
String specTitle = null, specVersion = null, specVendor = null;
String implTitle = null, implVersion = null, implVendor = null;
String sealed = null;
URL sealBase = null;
- Attributes attr = man.getAttributes(path);
+ Attributes attr = SharedSecrets.javaUtilJarAccess()
+ .getTrustedAttributes(man, name.replace('.', '/').concat("/"));
if (attr != null) {
specTitle = attr.getValue(Name.SPECIFICATION_TITLE);
specVersion = attr.getValue(Name.SPECIFICATION_VERSION);
@@ -585,10 +585,12 @@
/*
* Returns true if the specified package name is sealed according to the
* given manifest.
+ *
+ * @throws SecurityException if the package name is untrusted in the manifest
*/
private boolean isSealed(String name, Manifest man) {
- String path = name.replace('.', '/').concat("/");
- Attributes attr = man.getAttributes(path);
+ Attributes attr = SharedSecrets.javaUtilJarAccess()
+ .getTrustedAttributes(man, name.replace('.', '/').concat("/"));
String sealed = null;
if (attr != null) {
sealed = attr.getValue(Name.SEALED);
--- a/src/java.base/share/classes/java/util/Locale.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/java/util/Locale.java Wed Oct 17 08:09:46 2018 -0700
@@ -2246,22 +2246,26 @@
/**
* @serialField language String
- * language subtag in lower case. (See <a href="java/util/Locale.html#getLanguage()">getLanguage()</a>)
+ * language subtag in lower case.
+ * (See <a href="java.base/java/util/Locale.html#getLanguage()">getLanguage()</a>)
* @serialField country String
- * country subtag in upper case. (See <a href="java/util/Locale.html#getCountry()">getCountry()</a>)
+ * country subtag in upper case.
+ * (See <a href="java.base/java/util/Locale.html#getCountry()">getCountry()</a>)
* @serialField variant String
- * variant subtags separated by LOWLINE characters. (See <a href="java/util/Locale.html#getVariant()">getVariant()</a>)
+ * variant subtags separated by LOWLINE characters.
+ * (See <a href="java.base/java/util/Locale.html#getVariant()">getVariant()</a>)
* @serialField hashcode int
* deprecated, for forward compatibility only
* @serialField script String
- * script subtag in title case (See <a href="java/util/Locale.html#getScript()">getScript()</a>)
+ * script subtag in title case
+ * (See <a href="java.base/java/util/Locale.html#getScript()">getScript()</a>)
* @serialField extensions String
* canonical representation of extensions, that is,
* BCP47 extensions in alphabetical order followed by
* BCP47 private use subtags, all in lower case letters
* separated by HYPHEN-MINUS characters.
- * (See <a href="java/util/Locale.html#getExtensionKeys()">getExtensionKeys()</a>,
- * <a href="java/util/Locale.html#getExtension(char)">getExtension(char)</a>)
+ * (See <a href="java.base/java/util/Locale.html#getExtensionKeys()">getExtensionKeys()</a>,
+ * <a href="java.base/java/util/Locale.html#getExtension(char)">getExtension(char)</a>)
*/
private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("language", String.class),
--- a/src/java.base/share/classes/java/util/jar/JarFile.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/java/util/jar/JarFile.java Wed Oct 17 08:09:46 2018 -0700
@@ -417,10 +417,10 @@
if (manEntry != null) {
if (verify) {
byte[] b = getBytes(manEntry);
- man = new Manifest(new ByteArrayInputStream(b), getName());
if (!jvInitialized) {
jv = new JarVerifier(b);
}
+ man = new Manifest(jv, new ByteArrayInputStream(b), getName());
} else {
man = new Manifest(super.getInputStream(manEntry), getName());
}
@@ -1011,29 +1011,13 @@
int i = match(MULTIRELEASE_CHARS, b, MULTIRELEASE_LASTOCC,
MULTIRELEASE_OPTOSFT);
if (i != -1) {
- i += MULTIRELEASE_CHARS.length;
- if (i < b.length) {
- byte c = b[i++];
- // Check that the value is followed by a newline
- // and does not have a continuation
- if (c == '\n' &&
- (i == b.length || b[i] != ' ')) {
- isMultiRelease = true;
- } else if (c == '\r') {
- if (i == b.length) {
- isMultiRelease = true;
- } else {
- c = b[i++];
- if (c == '\n') {
- if (i == b.length || b[i] != ' ') {
- isMultiRelease = true;
- }
- } else if (c != ' ') {
- isMultiRelease = true;
- }
- }
- }
- }
+ // Read the main attributes of the manifest
+ byte[] lbuf = new byte[512];
+ Attributes attr = new Attributes();
+ attr.read(new Manifest.FastInputStream(
+ new ByteArrayInputStream(b)), lbuf);
+ isMultiRelease = Boolean.parseBoolean(
+ attr.getValue(Attributes.Name.MULTI_RELEASE));
}
}
}
@@ -1041,7 +1025,7 @@
}
}
- private synchronized void ensureInitialization() {
+ synchronized void ensureInitialization() {
try {
maybeInstantiateVerifier();
} catch (IOException e) {
--- a/src/java.base/share/classes/java/util/jar/JarVerifier.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/java/util/jar/JarVerifier.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -866,4 +866,24 @@
static CodeSource getUnsignedCS(URL url) {
return new VerifierCodeSource(null, url, (java.security.cert.Certificate[]) null);
}
+
+ /**
+ * Returns whether the name is trusted. Used by
+ * {@link Manifest#getTrustedAttributes(String)}.
+ */
+ boolean isTrustedManifestEntry(String name) {
+ // How many signers? MANIFEST.MF is always verified
+ CodeSigner[] forMan = verifiedSigners.get(JarFile.MANIFEST_NAME);
+ if (forMan == null) {
+ return true;
+ }
+ // Check sigFileSigners first, because we are mainly dealing with
+ // non-file entries which will stay in sigFileSigners forever.
+ CodeSigner[] forName = sigFileSigners.get(name);
+ if (forName == null) {
+ forName = verifiedSigners.get(name);
+ }
+ // Returns trusted if all signers sign the entry
+ return forName != null && forName.length == forMan.length;
+ }
}
--- a/src/java.base/share/classes/java/util/jar/JavaUtilJarAccessImpl.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/java/util/jar/JavaUtilJarAccessImpl.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -60,4 +60,12 @@
public List<Object> getManifestDigests(JarFile jar) {
return jar.getManifestDigests();
}
+
+ public Attributes getTrustedAttributes(Manifest man, String name) {
+ return man.getTrustedAttributes(name);
+ }
+
+ public void ensureInitialization(JarFile jar) {
+ jar.ensureInitialization();
+ }
}
--- a/src/java.base/share/classes/java/util/jar/Manifest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/java/util/jar/Manifest.java Wed Oct 17 08:09:46 2018 -0700
@@ -50,10 +50,13 @@
public class Manifest implements Cloneable {
// manifest main attributes
- private Attributes attr = new Attributes();
+ private final Attributes attr = new Attributes();
// manifest entries
- private Map<String, Attributes> entries = new HashMap<>();
+ private final Map<String, Attributes> entries = new HashMap<>();
+
+ // associated JarVerifier, not null when called by JarFile::getManifest.
+ private final JarVerifier jv;
// name of the corresponding jar archive if available.
private final String jarFilename;
@@ -63,6 +66,7 @@
*/
public Manifest() {
jarFilename = null;
+ jv = null;
}
/**
@@ -72,8 +76,7 @@
* @throws IOException if an I/O error has occurred
*/
public Manifest(InputStream is) throws IOException {
- this();
- read(is);
+ this(null, is, null);
}
/**
@@ -84,8 +87,17 @@
* @throws IOException if an I/O error has occured
*/
Manifest(InputStream is, String jarFilename) throws IOException {
+ this(null, is, jarFilename);
+ }
+
+ /**
+ * Constructs a new Manifest from the specified input stream
+ * and associates it with a JarVerifier.
+ */
+ Manifest(JarVerifier jv, InputStream is, String jarFilename) throws IOException {
read(is);
this.jarFilename = jarFilename;
+ this.jv = jv;
}
/**
@@ -94,9 +106,10 @@
* @param man the Manifest to copy
*/
public Manifest(Manifest man) {
- this();
attr.putAll(man.getMainAttributes());
entries.putAll(man.getEntries());
+ jarFilename = null;
+ jv = man.jv;
}
/**
@@ -147,6 +160,27 @@
}
/**
+ * Returns the Attributes for the specified entry name, if trusted.
+ *
+ * @param name entry name
+ * @return returns the same result as {@link #getAttributes(String)}
+ * @throws SecurityException if the associated jar is signed but this entry
+ * has been modified after signing (i.e. the section in the manifest
+ * does not exist in SF files of all signers).
+ */
+ Attributes getTrustedAttributes(String name) {
+ // Note: Before the verification of MANIFEST.MF/.SF/.RSA files is done,
+ // jv.isTrustedManifestEntry() isn't able to detect MANIFEST.MF change.
+ // Users of this method should call SharedSecrets.javaUtilJarAccess()
+ // .ensureInitialization() first.
+ Attributes result = getAttributes(name);
+ if (result != null && jv != null && ! jv.isTrustedManifestEntry(name)) {
+ throw new SecurityException("Untrusted manifest entry: " + name);
+ }
+ return result;
+ }
+
+ /**
* Clears the main Attributes as well as the entries in this Manifest.
*/
public void clear() {
--- a/src/java.base/share/classes/javax/crypto/CipherInputStream.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/javax/crypto/CipherInputStream.java Wed Oct 17 08:09:46 2018 -0700
@@ -50,6 +50,13 @@
* that are not thrown by its ancestor classes. In particular, the
* <code>skip</code> method skips, and the <code>available</code>
* method counts only data that have been processed by the encapsulated Cipher.
+ * This class may catch BadPaddingException and other exceptions thrown by
+ * failed integrity checks during decryption. These exceptions are not
+ * re-thrown, so the client may not be informed that integrity checks
+ * failed. Because of this behavior, this class may not be suitable
+ * for use with decryption in an authenticated mode of operation (e.g. GCM).
+ * Applications that require authenticated encryption can use the Cipher API
+ * directly as an alternative to using this class.
*
* <p> It is crucial for a programmer using this class not to use
* methods that are not defined or overridden in this class (such as a
--- a/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -60,6 +60,7 @@
import java.util.jar.Manifest;
import java.util.stream.Stream;
+import jdk.internal.misc.SharedSecrets;
import jdk.internal.misc.VM;
import jdk.internal.module.ModulePatcher.PatchedModuleReader;
import jdk.internal.module.Resources;
@@ -862,7 +863,8 @@
* Manifest are used to get the package version and sealing information.
*
* @throws IllegalArgumentException if the package name duplicates an
- * existing package either in this class loader or one of its ancestors
+ * existing package either in this class loader or one of its ancestors
+ * @throws SecurityException if the package name is untrusted in the manifest
*/
private Package definePackage(String pn, Manifest man, URL url) {
String specTitle = null;
@@ -875,7 +877,8 @@
URL sealBase = null;
if (man != null) {
- Attributes attr = man.getAttributes(pn.replace('.', '/').concat("/"));
+ Attributes attr = SharedSecrets.javaUtilJarAccess()
+ .getTrustedAttributes(man, pn.replace('.', '/').concat("/"));
if (attr != null) {
specTitle = attr.getValue(Attributes.Name.SPECIFICATION_TITLE);
specVersion = attr.getValue(Attributes.Name.SPECIFICATION_VERSION);
@@ -921,10 +924,12 @@
/**
* Returns {@code true} if the specified package name is sealed according to
* the given manifest.
+ *
+ * @throws SecurityException if the package name is untrusted in the manifest
*/
private boolean isSealed(String pn, Manifest man) {
- String path = pn.replace('.', '/').concat("/");
- Attributes attr = man.getAttributes(path);
+ Attributes attr = SharedSecrets.javaUtilJarAccess()
+ .getTrustedAttributes(man, pn.replace('.', '/').concat("/"));
String sealed = null;
if (attr != null)
sealed = attr.getValue(Attributes.Name.SEALED);
--- a/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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.net.HttpURLConnection;
import java.net.JarURLConnection;
import java.net.MalformedURLException;
+import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;
@@ -88,6 +89,8 @@
private static final boolean DEBUG;
private static final boolean DISABLE_JAR_CHECKING;
private static final boolean DISABLE_ACC_CHECKING;
+ private static final boolean DISABLE_CP_URL_CHECK;
+ private static final boolean DEBUG_CP_URL_CHECK;
static {
Properties props = GetPropertyAction.privilegedGetProperties();
@@ -98,6 +101,12 @@
p = props.getProperty("jdk.net.URLClassPath.disableRestrictedPermissions");
DISABLE_ACC_CHECKING = p != null ? p.equals("true") || p.equals("") : false;
+
+ // This property will be removed in a later release
+ p = props.getProperty("jdk.net.URLClassPath.disableClassPathURLCheck", "true");
+
+ DISABLE_CP_URL_CHECK = p != null ? p.equals("true") || p.isEmpty() : false;
+ DEBUG_CP_URL_CHECK = "debug".equals(p);
}
/* The original search path of URLs. */
@@ -857,8 +866,10 @@
{ return jar.getInputStream(entry); }
public int getContentLength()
{ return (int)entry.getSize(); }
- public Manifest getManifest() throws IOException
- { return jar.getManifest(); };
+ public Manifest getManifest() throws IOException {
+ SharedSecrets.javaUtilJarAccess().ensureInitialization(jar);
+ return jar.getManifest();
+ }
public Certificate[] getCertificates()
{ return entry.getCertificates(); };
public CodeSigner[] getCodeSigners()
@@ -1081,11 +1092,51 @@
int i = 0;
while (st.hasMoreTokens()) {
String path = st.nextToken();
- urls[i] = new URL(base, path);
- i++;
+ URL url = DISABLE_CP_URL_CHECK ? new URL(base, path) : safeResolve(base, path);
+ if (url != null) {
+ urls[i] = url;
+ i++;
+ }
+ }
+ if (i == 0) {
+ urls = null;
+ } else if (i != urls.length) {
+ // Truncate nulls from end of array
+ urls = Arrays.copyOf(urls, i);
}
return urls;
}
+
+ /*
+ * Return a URL for the given path resolved against the base URL, or
+ * null if the resulting URL is invalid.
+ */
+ static URL safeResolve(URL base, String path) {
+ String child = path.replace(File.separatorChar, '/');
+ try {
+ if (!URI.create(child).isAbsolute()) {
+ URL url = new URL(base, child);
+ if (base.getProtocol().equalsIgnoreCase("file")) {
+ return url;
+ } else {
+ String bp = base.getPath();
+ String urlp = url.getPath();
+ int pos = bp.lastIndexOf('/');
+ if (pos == -1) {
+ pos = bp.length() - 1;
+ }
+ if (urlp.regionMatches(0, bp, 0, pos + 1)
+ && urlp.indexOf("..", pos) == -1) {
+ return url;
+ }
+ }
+ }
+ } catch (MalformedURLException | IllegalArgumentException e) {}
+ if (DEBUG_CP_URL_CHECK) {
+ System.err.println("Class-Path entry: \"" + path + "\" ignored in JAR file " + base);
+ }
+ return null;
+ }
}
/*
--- a/src/java.base/share/classes/jdk/internal/misc/JavaUtilJarAccess.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaUtilJarAccess.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -30,8 +30,10 @@
import java.security.CodeSource;
import java.util.Enumeration;
import java.util.List;
+import java.util.jar.Attributes;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
+import java.util.jar.Manifest;
public interface JavaUtilJarAccess {
public boolean jarFileHasClassPathAttribute(JarFile jar) throws IOException;
@@ -41,4 +43,6 @@
public Enumeration<JarEntry> entries2(JarFile jar);
public void setEagerValidation(JarFile jar, boolean eager);
public List<Object> getManifestDigests(JarFile jar);
+ public Attributes getTrustedAttributes(Manifest man, String name);
+ public void ensureInitialization(JarFile jar);
}
--- a/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2018, 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
@@ -2725,6 +2725,8 @@
// doesn't know about proxy.
useProxyResponseCode = true;
} else {
+ final URL prevURL = url;
+
// maintain previous headers, just change the name
// of the file we're getting
url = locUrl;
@@ -2753,6 +2755,14 @@
poster = null;
if (!checkReuseConnection())
connect();
+
+ if (!sameDestination(prevURL, url)) {
+ // Ensures pre-redirect user-set cookie will not be reset.
+ // CookieHandler, if any, will be queried to determine
+ // cookies for redirected URL, if any.
+ userCookies = null;
+ userCookies2 = null;
+ }
} else {
if (!checkReuseConnection())
connect();
@@ -2775,11 +2785,52 @@
}
requests.set("Host", host);
}
+
+ if (!sameDestination(prevURL, url)) {
+ // Redirecting to a different destination will drop any
+ // security-sensitive headers, regardless of whether
+ // they are user-set or not. CookieHandler, if any, will be
+ // queried to determine cookies for redirected URL, if any.
+ userCookies = null;
+ userCookies2 = null;
+ requests.remove("Cookie");
+ requests.remove("Cookie2");
+ requests.remove("Authorization");
+
+ // check for preemptive authorization
+ AuthenticationInfo sauth =
+ AuthenticationInfo.getServerAuth(url, getAuthenticatorKey());
+ if (sauth != null && sauth.supportsPreemptiveAuthorization() ) {
+ // Sets "Authorization"
+ requests.setIfNotSet(sauth.getHeaderName(), sauth.getHeaderValue(url,method));
+ currentServerCredentials = sauth;
+ }
+ }
}
}
return true;
}
+ /* Returns true iff the given URLs have the same host and effective port. */
+ private static boolean sameDestination(URL firstURL, URL secondURL) {
+ assert firstURL.getProtocol().equalsIgnoreCase(secondURL.getProtocol()):
+ "protocols not equal: " + firstURL + " - " + secondURL;
+
+ if (!firstURL.getHost().equalsIgnoreCase(secondURL.getHost()))
+ return false;
+
+ int firstPort = firstURL.getPort();
+ if (firstPort == -1)
+ firstPort = firstURL.getDefaultPort();
+ int secondPort = secondURL.getPort();
+ if (secondPort == -1)
+ secondPort = secondURL.getDefaultPort();
+ if (firstPort != secondPort)
+ return false;
+
+ return true;
+ }
+
/* dummy byte buffer for reading off socket prior to closing */
byte[] cdata = new byte [128];
--- a/src/java.base/share/classes/sun/security/ssl/CertSignAlgsExtension.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/sun/security/ssl/CertSignAlgsExtension.java Wed Oct 17 08:09:46 2018 -0700
@@ -243,18 +243,16 @@
}
// Produce the extension.
- if (shc.localSupportedSignAlgs == null) {
- shc.localSupportedSignAlgs =
+ List<SignatureScheme> sigAlgs =
SignatureScheme.getSupportedAlgorithms(
- shc.algorithmConstraints, shc.activeProtocols);
- }
+ shc.algorithmConstraints,
+ List.of(shc.negotiatedProtocol));
- int vectorLen = SignatureScheme.sizeInRecord() *
- shc.localSupportedSignAlgs.size();
+ int vectorLen = SignatureScheme.sizeInRecord() * sigAlgs.size();
byte[] extData = new byte[vectorLen + 2];
ByteBuffer m = ByteBuffer.wrap(extData);
Record.putInt16(m, vectorLen);
- for (SignatureScheme ss : shc.localSupportedSignAlgs) {
+ for (SignatureScheme ss : sigAlgs) {
Record.putInt16(m, ss.id);
}
--- a/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java Wed Oct 17 08:09:46 2018 -0700
@@ -31,7 +31,9 @@
import java.security.cert.X509Certificate;
import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
+import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
@@ -675,44 +677,85 @@
chc.peerRequestedSignatureSchemes = sss;
chc.peerRequestedCertSignSchemes = sss; // use the same schemes
chc.handshakeSession.setPeerSupportedSignatureAlgorithms(sss);
+ chc.peerSupportedAuthorities = crm.getAuthorities();
- X509ExtendedKeyManager km = chc.sslContext.getX509KeyManager();
- String clientAlias = null;
- if (chc.conContext.transport instanceof SSLSocketImpl) {
- clientAlias = km.chooseClientAlias(crm.getKeyTypes(),
- crm.getAuthorities(), (SSLSocket)chc.conContext.transport);
- } else if (chc.conContext.transport instanceof SSLEngineImpl) {
- clientAlias = km.chooseEngineClientAlias(crm.getKeyTypes(),
- crm.getAuthorities(), (SSLEngine)chc.conContext.transport);
- }
-
- if (clientAlias == null) {
- if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
- SSLLogger.warning("No available client authentication");
- }
+ // For TLS 1.2, we no longer use the certificate_types field
+ // from the CertificateRequest message to directly determine
+ // the SSLPossession. Instead, the choosePossession method
+ // will use the accepted signature schemes in the message to
+ // determine the set of acceptable certificate types to select from.
+ SSLPossession pos = choosePossession(chc);
+ if (pos == null) {
return;
}
- PrivateKey clientPrivateKey = km.getPrivateKey(clientAlias);
- if (clientPrivateKey == null) {
+ chc.handshakePossessions.add(pos);
+ chc.handshakeProducers.put(SSLHandshake.CERTIFICATE_VERIFY.id,
+ SSLHandshake.CERTIFICATE_VERIFY);
+ }
+
+ private static SSLPossession choosePossession(HandshakeContext hc)
+ throws IOException {
+ if (hc.peerRequestedCertSignSchemes == null ||
+ hc.peerRequestedCertSignSchemes.isEmpty()) {
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
- SSLLogger.warning("No available client private key");
+ SSLLogger.warning("No signature and hash algorithms " +
+ "in CertificateRequest");
}
- return;
+ return null;
}
- X509Certificate[] clientCerts = km.getCertificateChain(clientAlias);
- if ((clientCerts == null) || (clientCerts.length == 0)) {
- if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
- SSLLogger.warning("No available client certificate");
+ Collection<String> checkedKeyTypes = new HashSet<>();
+ for (SignatureScheme ss : hc.peerRequestedCertSignSchemes) {
+ if (checkedKeyTypes.contains(ss.keyAlgorithm)) {
+ if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
+ SSLLogger.warning(
+ "Unsupported authentication scheme: " + ss.name);
+ }
+ continue;
}
- return;
+
+ // Don't select a signature scheme unless we will be able to
+ // produce a CertificateVerify message later
+ if (SignatureScheme.getPreferableAlgorithm(
+ hc.peerRequestedSignatureSchemes,
+ ss, hc.negotiatedProtocol) == null) {
+
+ if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
+ SSLLogger.warning(
+ "Unable to produce CertificateVerify for " +
+ "signature scheme: " + ss.name);
+ }
+ checkedKeyTypes.add(ss.keyAlgorithm);
+ continue;
+ }
+
+ SSLAuthentication ka = X509Authentication.valueOf(ss);
+ if (ka == null) {
+ if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
+ SSLLogger.warning(
+ "Unsupported authentication scheme: " + ss.name);
+ }
+ checkedKeyTypes.add(ss.keyAlgorithm);
+ continue;
+ }
+
+ SSLPossession pos = ka.createPossession(hc);
+ if (pos == null) {
+ if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
+ SSLLogger.warning(
+ "Unavailable authentication scheme: " + ss.name);
+ }
+ continue;
+ }
+
+ return pos;
}
- chc.handshakePossessions.add(
- new X509Possession(clientPrivateKey, clientCerts));
- chc.handshakeProducers.put(SSLHandshake.CERTIFICATE_VERIFY.id,
- SSLHandshake.CERTIFICATE_VERIFY);
+ if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
+ SSLLogger.warning("No available authentication scheme");
+ }
+ return null;
}
}
--- a/src/java.base/share/classes/sun/security/ssl/ClientHello.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/sun/security/ssl/ClientHello.java Wed Oct 17 08:09:46 2018 -0700
@@ -35,6 +35,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
+import java.util.Objects;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.SSLPeerUnverifiedException;
@@ -510,6 +511,23 @@
}
}
+ // ensure that the endpoint identification algorithm matches the
+ // one in the session
+ String identityAlg = chc.sslConfig.identificationProtocol;
+ if (session != null && identityAlg != null) {
+ String sessionIdentityAlg =
+ session.getIdentificationProtocol();
+ if (!Objects.equals(identityAlg, sessionIdentityAlg)) {
+ if (SSLLogger.isOn &&
+ SSLLogger.isOn("ssl,handshake,verbose")) {
+ SSLLogger.finest("Can't resume, endpoint id" +
+ " algorithm does not match, requested: " +
+ identityAlg + ", cached: " + sessionIdentityAlg);
+ }
+ session = null;
+ }
+ }
+
if (session != null) {
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake,verbose")) {
SSLLogger.finest("Try resuming session", session);
@@ -1011,6 +1029,23 @@
}
}
+ // ensure that the endpoint identification algorithm matches the
+ // one in the session
+ String identityAlg = shc.sslConfig.identificationProtocol;
+ if (resumingSession && identityAlg != null) {
+ String sessionIdentityAlg =
+ previous.getIdentificationProtocol();
+ if (!Objects.equals(identityAlg, sessionIdentityAlg)) {
+ if (SSLLogger.isOn &&
+ SSLLogger.isOn("ssl,handshake,verbose")) {
+ SSLLogger.finest("Can't resume, endpoint id" +
+ " algorithm does not match, requested: " +
+ identityAlg + ", cached: " + sessionIdentityAlg);
+ }
+ resumingSession = false;
+ }
+ }
+
// So far so good. Note that the handshake extensions may reset
// the resuming options later.
shc.isResumption = resumingSession;
--- a/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java Wed Oct 17 08:09:46 2018 -0700
@@ -43,6 +43,7 @@
import javax.crypto.SecretKey;
import javax.net.ssl.SNIServerName;
import javax.net.ssl.SSLHandshakeException;
+import javax.security.auth.x500.X500Principal;
import sun.security.ssl.SupportedGroupsExtension.NamedGroup;
import sun.security.ssl.SupportedGroupsExtension.NamedGroupType;
import static sun.security.ssl.SupportedGroupsExtension.NamedGroupType.*;
@@ -136,6 +137,9 @@
List<SignatureScheme> peerRequestedSignatureSchemes;
List<SignatureScheme> peerRequestedCertSignSchemes;
+ // Known authorities
+ X500Principal[] peerSupportedAuthorities = null;
+
// SupportedGroups
List<NamedGroup> clientRequestedNamedGroups;
--- a/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java Wed Oct 17 08:09:46 2018 -0700
@@ -32,6 +32,7 @@
import java.util.ArrayList;
import java.util.Locale;
import java.util.Arrays;
+import java.util.Objects;
import java.util.Optional;
import java.util.Collection;
import javax.crypto.Mac;
@@ -170,7 +171,7 @@
int getIdsEncodedLength() {
int idEncodedLength = 0;
- for (PskIdentity curId : identities) {
+ for(PskIdentity curId : identities) {
idEncodedLength += curId.getEncodedLength();
}
@@ -193,7 +194,7 @@
byte[] buffer = new byte[encodedLength];
ByteBuffer m = ByteBuffer.wrap(buffer);
Record.putInt16(m, idsEncodedLength);
- for (PskIdentity curId : identities) {
+ for(PskIdentity curId : identities) {
curId.writeEncoded(m);
}
Record.putInt16(m, bindersEncodedLength);
@@ -443,6 +444,23 @@
}
}
+ // ensure that the endpoint identification algorithm matches the
+ // one in the session
+ String identityAlg = shc.sslConfig.identificationProtocol;
+ if (result && identityAlg != null) {
+ String sessionIdentityAlg = s.getIdentificationProtocol();
+ if (!Objects.equals(identityAlg, sessionIdentityAlg)) {
+ if (SSLLogger.isOn &&
+ SSLLogger.isOn("ssl,handshake,verbose")) {
+
+ SSLLogger.finest("Can't resume, endpoint id" +
+ " algorithm does not match, requested: " +
+ identityAlg + ", cached: " + sessionIdentityAlg);
+ }
+ result = false;
+ }
+ }
+
// Ensure cipher suite can be negotiated
if (result && (!shc.isNegotiable(s.getSuite()) ||
!clientHello.cipherSuites.contains(s.getSuite()))) {
--- a/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java Wed Oct 17 08:09:46 2018 -0700
@@ -132,6 +132,10 @@
// Counter used to create unique nonces in NewSessionTicket
private BigInteger ticketNonceCounter = BigInteger.ONE;
+ // The endpoint identification algorithm used to check certificates
+ // in this session.
+ private final String identificationProtocol;
+
/*
* Create a new non-rejoinable session, using the default (null)
* cipher spec. This constructor returns a session which could
@@ -149,6 +153,7 @@
this.requestedServerNames = Collections.<SNIServerName>emptyList();
this.useExtendedMasterSecret = false;
this.creationTime = System.currentTimeMillis();
+ this.identificationProtocol = null;
}
/*
@@ -198,6 +203,7 @@
(!hc.negotiatedProtocol.useTLS13PlusSpec());
}
this.creationTime = creationTime;
+ this.identificationProtocol = hc.sslConfig.identificationProtocol;
if (SSLLogger.isOn && SSLLogger.isOn("session")) {
SSLLogger.finest("Session initialized: " + this);
@@ -259,6 +265,10 @@
return ticketAgeAdd;
}
+ String getIdentificationProtocol() {
+ return this.identificationProtocol;
+ }
+
/*
* Get the PSK identity. Take care not to use it in multiple connections.
*/
--- a/src/java.base/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java Wed Oct 17 08:09:46 2018 -0700
@@ -410,18 +410,16 @@
}
// Produce the extension.
- if (shc.localSupportedSignAlgs == null) {
- shc.localSupportedSignAlgs =
+ List<SignatureScheme> sigAlgs =
SignatureScheme.getSupportedAlgorithms(
- shc.algorithmConstraints, shc.activeProtocols);
- }
+ shc.algorithmConstraints,
+ List.of(shc.negotiatedProtocol));
- int vectorLen = SignatureScheme.sizeInRecord() *
- shc.localSupportedSignAlgs.size();
+ int vectorLen = SignatureScheme.sizeInRecord() * sigAlgs.size();
byte[] extData = new byte[vectorLen + 2];
ByteBuffer m = ByteBuffer.wrap(extData);
Record.putInt16(m, vectorLen);
- for (SignatureScheme ss : shc.localSupportedSignAlgs) {
+ for (SignatureScheme ss : sigAlgs) {
Record.putInt16(m, ss.id);
}
--- a/src/java.base/share/classes/sun/security/ssl/X509Authentication.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/share/classes/sun/security/ssl/X509Authentication.java Wed Oct 17 08:09:46 2018 -0700
@@ -170,7 +170,7 @@
return null;
}
- // Used by TLS 1.3 only.
+ // Used by TLS 1.2 and TLS 1.3.
private SSLPossession createClientPossession(
ClientHandshakeContext chc, String keyType) {
X509ExtendedKeyManager km = chc.sslContext.getX509KeyManager();
@@ -178,11 +178,13 @@
if (chc.conContext.transport instanceof SSLSocketImpl) {
clientAlias = km.chooseClientAlias(
new String[] { keyType },
- null, (SSLSocket)chc.conContext.transport);
+ chc.peerSupportedAuthorities,
+ (SSLSocket)chc.conContext.transport);
} else if (chc.conContext.transport instanceof SSLEngineImpl) {
clientAlias = km.chooseEngineClientAlias(
new String[] { keyType },
- null, (SSLEngine)chc.conContext.transport);
+ chc.peerSupportedAuthorities,
+ (SSLEngine)chc.conContext.transport);
}
if (clientAlias == null) {
--- a/src/java.base/unix/native/libnet/NetworkInterface.c Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/unix/native/libnet/NetworkInterface.c Wed Oct 17 08:09:46 2018 -0700
@@ -331,9 +331,16 @@
netif *ifs, *curr;
jobject obj = NULL;
jboolean match = JNI_FALSE;
- int family = (getInetAddress_family(env, iaObj) == java_net_InetAddress_IPv4) ?
- AF_INET : AF_INET6;
+ int family = getInetAddress_family(env, iaObj);
JNU_CHECK_EXCEPTION_RETURN(env, NULL);
+
+ if (family == java_net_InetAddress_IPv4) {
+ family = AF_INET;
+ } else if (family == java_net_InetAddress_IPv6) {
+ family = AF_INET6;
+ } else {
+ return NULL; // Invalid family
+ }
ifs = enumInterfaces(env);
if (ifs == NULL) {
return NULL;
@@ -351,7 +358,9 @@
int address1 = htonl(
((struct sockaddr_in *)addrP->addr)->sin_addr.s_addr);
int address2 = getInetAddress_addr(env, iaObj);
- JNU_CHECK_EXCEPTION_RETURN(env, NULL);
+ if ((*env)->ExceptionCheck(env)) {
+ goto cleanup;
+ }
if (address1 == address2) {
match = JNI_TRUE;
break;
@@ -397,6 +406,7 @@
obj = createNetworkInterface(env, curr);
}
+cleanup:
// release the interface list
freeif(ifs);
--- a/src/java.base/windows/native/libnet/NetworkInterface.c Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/windows/native/libnet/NetworkInterface.c Wed Oct 17 08:09:46 2018 -0700
@@ -280,6 +280,7 @@
if (curr->name == NULL || curr->displayName == NULL) {
if (curr->name) free(curr->name);
if (curr->displayName) free(curr->displayName);
+ free(curr);
curr = NULL;
}
}
@@ -586,7 +587,10 @@
/* default ctor will set family to AF_INET */
setInetAddress_addr(env, iaObj, ntohl(addrs->addr.sa4.sin_addr.s_addr));
- JNU_CHECK_EXCEPTION_RETURN(env, NULL);
+ if ((*env)->ExceptionCheck(env)) {
+ free_netaddr(netaddrP);
+ return NULL;
+ }
if (addrs->mask != -1) {
ibObj = (*env)->NewObject(env, ni_ibcls, ni_ibctrID);
if (ibObj == NULL) {
@@ -600,7 +604,10 @@
return NULL;
}
setInetAddress_addr(env, ia2Obj, ntohl(addrs->brdcast.sa4.sin_addr.s_addr));
- JNU_CHECK_EXCEPTION_RETURN(env, NULL);
+ if ((*env)->ExceptionCheck(env)) {
+ free_netaddr(netaddrP);
+ return NULL;
+ }
(*env)->SetObjectField(env, ibObj, ni_ibbroadcastID, ia2Obj);
(*env)->SetShortField(env, ibObj, ni_ibmaskID, addrs->mask);
(*env)->SetObjectArrayElement(env, bindsArr, bind_index++, ibObj);
@@ -611,6 +618,7 @@
if (iaObj) {
jboolean ret = setInet6Address_ipaddress(env, iaObj, (jbyte *)&(addrs->addr.sa6.sin6_addr.s6_addr));
if (ret == JNI_FALSE) {
+ free_netaddr(netaddrP);
return NULL;
}
--- a/src/java.base/windows/native/libnet/NetworkInterface_winXP.c Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.base/windows/native/libnet/NetworkInterface_winXP.c Wed Oct 17 08:09:46 2018 -0700
@@ -521,8 +521,9 @@
jobjectArray addrArr, bindsArr, childArr;
netaddr *addrs;
jint addr_index;
- int netaddrCount=ifs->naddrs;
- netaddr *netaddrP=ifs->addrs;
+ int netaddrCount = ifs->naddrs;
+ netaddr *netaddrP = ifs->addrs;
+ netaddr *netaddrPToFree = NULL;
jint bind_index;
/*
@@ -553,21 +554,23 @@
* Note that 0 is a valid number of addresses.
*/
if (netaddrCount < 0) {
- netaddrCount = enumAddresses_win(env, ifs, &netaddrP);
+ netaddrCount = enumAddresses_win(env, ifs, &netaddrPToFree);
if (netaddrCount == -1) {
return NULL;
}
+ netaddrP = netaddrPToFree;
}
addrArr = (*env)->NewObjectArray(env, netaddrCount, ia_class, NULL);
if (addrArr == NULL) {
+ free_netaddr(netaddrPToFree);
return NULL;
}
bindsArr = (*env)->NewObjectArray(env, netaddrCount, ni_ibcls, NULL);
if (bindsArr == NULL) {
- free_netaddr(netaddrP);
- return NULL;
+ free_netaddr(netaddrPToFree);
+ return NULL;
}
addrs = netaddrP;
@@ -579,25 +582,32 @@
if (addrs->addr.sa.sa_family == AF_INET) {
iaObj = (*env)->NewObject(env, ia4_class, ia4_ctrID);
if (iaObj == NULL) {
+ free_netaddr(netaddrPToFree);
return NULL;
}
/* default ctor will set family to AF_INET */
setInetAddress_addr(env, iaObj, ntohl(addrs->addr.sa4.sin_addr.s_addr));
- JNU_CHECK_EXCEPTION_RETURN(env, NULL);
+ if ((*env)->ExceptionCheck(env)) {
+ free_netaddr(netaddrPToFree);
+ return NULL;
+ }
ibObj = (*env)->NewObject(env, ni_ibcls, ni_ibctrID);
if (ibObj == NULL) {
- free_netaddr(netaddrP);
- return NULL;
+ free_netaddr(netaddrPToFree);
+ return NULL;
}
(*env)->SetObjectField(env, ibObj, ni_ibaddressID, iaObj);
ia2Obj = (*env)->NewObject(env, ia4_class, ia4_ctrID);
if (ia2Obj == NULL) {
- free_netaddr(netaddrP);
- return NULL;
+ free_netaddr(netaddrPToFree);
+ return NULL;
}
setInetAddress_addr(env, ia2Obj, ntohl(addrs->brdcast.sa4.sin_addr.s_addr));
- JNU_CHECK_EXCEPTION_RETURN(env, NULL);
+ if ((*env)->ExceptionCheck(env)) {
+ free_netaddr(netaddrPToFree);
+ return NULL;
+ }
(*env)->SetObjectField(env, ibObj, ni_ibbroadcastID, ia2Obj);
(*env)->SetShortField(env, ibObj, ni_ibmaskID, addrs->mask);
(*env)->SetObjectArrayElement(env, bindsArr, bind_index++, ibObj);
@@ -606,10 +616,12 @@
jboolean ret;
iaObj = (*env)->NewObject(env, ia6_class, ia6_ctrID);
if (iaObj == NULL) {
+ free_netaddr(netaddrPToFree);
return NULL;
}
ret = setInet6Address_ipaddress(env, iaObj, (jbyte *)&(addrs->addr.sa6.sin6_addr.s6_addr));
if (ret == JNI_FALSE) {
+ free_netaddr(netaddrPToFree);
return NULL;
}
scope = addrs->addr.sa6.sin6_scope_id;
@@ -619,8 +631,8 @@
}
ibObj = (*env)->NewObject(env, ni_ibcls, ni_ibctrID);
if (ibObj == NULL) {
- free_netaddr(netaddrP);
- return NULL;
+ free_netaddr(netaddrPToFree);
+ return NULL;
}
(*env)->SetObjectField(env, ibObj, ni_ibaddressID, iaObj);
(*env)->SetShortField(env, ibObj, ni_ibmaskID, addrs->mask);
@@ -633,6 +645,8 @@
(*env)->SetObjectField(env, netifObj, ni_addrsID, addrArr);
(*env)->SetObjectField(env, netifObj, ni_bindsID, bindsArr);
+ free_netaddr(netaddrPToFree);
+
/*
* Windows doesn't have virtual interfaces, so child array
* is always empty.
@@ -672,7 +686,7 @@
}
/* if found create a NetworkInterface */
- if (curr != NULL) {;
+ if (curr != NULL) {
netifObj = createNetworkInterfaceXP(env, curr);
}
--- a/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java Wed Oct 17 08:09:46 2018 -0700
@@ -736,7 +736,7 @@
}
try {
- return invoke(new Callable<File[]>() {
+ File[] files = invoke(new Callable<File[]>() {
public File[] call() throws InterruptedException {
if (!isDirectory()) {
return null;
@@ -791,6 +791,8 @@
: list.toArray(new ShellFolder[list.size()]);
}
}, InterruptedException.class);
+
+ return Win32ShellFolderManager2.checkFiles(files);
} catch (InterruptedException e) {
return new File[0];
}
--- a/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -387,21 +387,30 @@
return null;
}
- private File checkFile(File file) {
+ private static File checkFile(File file) {
SecurityManager sm = System.getSecurityManager();
return (sm == null || file == null) ? file : checkFile(file, sm);
}
- private File checkFile(File file, SecurityManager sm) {
+ private static File checkFile(File file, SecurityManager sm) {
try {
sm.checkRead(file.getPath());
+
+ if (file instanceof Win32ShellFolder2) {
+ Win32ShellFolder2 f = (Win32ShellFolder2)file;
+ if (f.isLink()) {
+ Win32ShellFolder2 link = (Win32ShellFolder2)f.getLinkLocation();
+ if (link != null)
+ sm.checkRead(link.getPath());
+ }
+ }
return file;
} catch (SecurityException se) {
return null;
}
}
- private File[] checkFiles(File[] files) {
+ static File[] checkFiles(File[] files) {
SecurityManager sm = System.getSecurityManager();
if (sm == null || files == null || files.length == 0) {
return files;
@@ -409,7 +418,7 @@
return checkFiles(Arrays.stream(files), sm);
}
- private File[] checkFiles(List<File> files) {
+ private static File[] checkFiles(List<File> files) {
SecurityManager sm = System.getSecurityManager();
if (sm == null || files.isEmpty()) {
return files.toArray(new File[files.size()]);
@@ -417,7 +426,7 @@
return checkFiles(files.stream(), sm);
}
- private File[] checkFiles(Stream<File> filesStream, SecurityManager sm) {
+ private static File[] checkFiles(Stream<File> filesStream, SecurityManager sm) {
return filesStream.filter((file) -> checkFile(file, sm) != null)
.toArray(File[]::new);
}
--- a/src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_MidiIn.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_MidiIn.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -252,7 +252,7 @@
}
INT32 getMidiInCaps(INT32 deviceID, MIDIINCAPSW* caps, INT32* err) {
- (*err) = midiInGetDevCapsW(deviceID, caps, sizeof(MIDIINCAPS));
+ (*err) = midiInGetDevCapsW(deviceID, caps, sizeof(MIDIINCAPSW));
return ((*err) == MMSYSERR_NOERROR);
}
@@ -260,6 +260,7 @@
MIDIINCAPSW midiInCaps;
INT32 err;
+ memset(&midiInCaps, 0, sizeof(midiInCaps));
if (getMidiInCaps(deviceID, &midiInCaps, &err)) {
UnicodeToUTF8AndCopy(name, midiInCaps.szPname, nameLength);
return MIDI_SUCCESS;
@@ -284,6 +285,7 @@
MIDIINCAPSW midiInCaps;
INT32 err = MIDI_NOT_SUPPORTED;
+ memset(&midiInCaps, 0, sizeof(midiInCaps));
if (getMidiInCaps(deviceID, &midiInCaps, &err) && (nameLength>7)) {
sprintf(name, "%d.%d", (midiInCaps.vDriverVersion & 0xFF00) >> 8, midiInCaps.vDriverVersion & 0xFF);
return MIDI_SUCCESS;
--- a/src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_MidiOut.c Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_MidiOut.c Wed Oct 17 08:09:46 2018 -0700
@@ -70,12 +70,13 @@
INT32 getMidiOutCaps(INT32 deviceID, MIDIOUTCAPSW* caps, INT32* err) {
+ UINT_PTR id;
if (deviceID == 0) {
- deviceID = MIDI_MAPPER;
+ id = MIDI_MAPPER;
} else {
- deviceID--;
+ id = (UINT_PTR)(deviceID-1);
}
- (*err) = (INT32) midiOutGetDevCapsW(deviceID, caps, sizeof(MIDIOUTCAPS));
+ (*err) = (INT32) midiOutGetDevCapsW(id, caps, sizeof(MIDIOUTCAPSW));
return ((*err) == MMSYSERR_NOERROR);
}
@@ -84,6 +85,7 @@
MIDIOUTCAPSW midiOutCaps;
INT32 err;
+ memset(&midiOutCaps, 0, sizeof(midiOutCaps));
if (getMidiOutCaps(deviceID, &midiOutCaps, &err)) {
UnicodeToUTF8AndCopy(name, midiOutCaps.szPname, nameLength);
return MIDI_SUCCESS;
@@ -103,6 +105,7 @@
char *desc;
INT32 err;
+ memset(&midiOutCaps, 0, sizeof(midiOutCaps));
if (getMidiOutCaps(deviceID, &midiOutCaps, &err)) {
int tech = (int)midiOutCaps.wTechnology;
switch(tech) {
@@ -139,6 +142,7 @@
MIDIOUTCAPSW midiOutCaps;
INT32 err;
+ memset(&midiOutCaps, 0, sizeof(midiOutCaps));
if (getMidiOutCaps(deviceID, &midiOutCaps, &err) && nameLength>7) {
sprintf(name, "%d.%d", (midiOutCaps.vDriverVersion & 0xFF00) >> 8, midiOutCaps.vDriverVersion & 0xFF);
return MIDI_SUCCESS;
--- a/src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_Ports.c Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_Ports.c Wed Oct 17 08:09:46 2018 -0700
@@ -357,7 +357,7 @@
INT32 PORT_GetPortMixerDescription(INT32 mixerIndex, PortMixerDescription* description) {
MIXERCAPSW mixerCaps;
- if (mixerGetDevCapsW(mixerIndex, &mixerCaps, sizeof(MIXERCAPS)) == MMSYSERR_NOERROR) {
+ if (mixerGetDevCapsW(mixerIndex, &mixerCaps, sizeof(MIXERCAPSW)) == MMSYSERR_NOERROR) {
UnicodeToUTF8AndCopy(description->name, mixerCaps.szPname, PORT_STRING_LENGTH);
sprintf(description->version, "%d.%d", (mixerCaps.vDriverVersion & 0xFF00) >> 8, mixerCaps.vDriverVersion & 0xFF);
strncpy(description->description, "Port Mixer", PORT_STRING_LENGTH-1);
@@ -368,9 +368,9 @@
int getDestinationCount(HMIXER handle) {
int ret = 0;
- MIXERCAPS mixerCaps;
+ MIXERCAPSW mixerCaps;
- if (mixerGetDevCaps((UINT_PTR) handle, &mixerCaps, sizeof(MIXERCAPS)) == MMSYSERR_NOERROR) {
+ if (mixerGetDevCapsW((UINT_PTR) handle, &mixerCaps, sizeof(MIXERCAPSW)) == MMSYSERR_NOERROR) {
ret = mixerCaps.cDestinations;
}
return ret;
--- a/src/java.logging/share/classes/java/util/logging/SimpleFormatter.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.logging/share/classes/java/util/logging/SimpleFormatter.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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,8 +38,7 @@
* <p>
* <a id="formatting">
* <b>Configuration:</b></a>
- * The {@code SimpleFormatter} is initialized with the
- * <a href="../Formatter.html#syntax">format string</a>
+ * The {@code SimpleFormatter} is initialized with the format string
* specified in the {@code java.util.logging.SimpleFormatter.format}
* property to {@linkplain #format(LogRecord) format} the log messages.
* This property can be defined
@@ -69,8 +68,7 @@
/**
* Format the given LogRecord.
* <p>
- * The formatting can be customized by specifying the
- * <a href="../Formatter.html#syntax">format string</a>
+ * The formatting can be customized by specifying the format string
* in the <a href="#formatting">
* {@code java.util.logging.SimpleFormatter.format}</a> property.
* The given {@code LogRecord} will be formatted as if by calling:
--- a/src/java.management/share/classes/sun/management/StackTraceElementCompositeData.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.management/share/classes/sun/management/StackTraceElementCompositeData.java Wed Oct 17 08:09:46 2018 -0700
@@ -78,14 +78,16 @@
// CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
// STACK_TRACE_ELEMENT_ATTRIBUTES!
final Object[] stackTraceElementItemValues = {
- ste.getClassLoaderName(),
- ste.getModuleName(),
- ste.getModuleVersion(),
+ // JDK 5 attributes
ste.getClassName(),
ste.getMethodName(),
ste.getFileName(),
ste.getLineNumber(),
ste.isNativeMethod(),
+ // JDK 9 attributes
+ ste.getClassLoaderName(),
+ ste.getModuleName(),
+ ste.getModuleVersion(),
};
try {
return new CompositeDataSupport(STACK_TRACE_ELEMENT_COMPOSITE_TYPE,
--- a/src/java.naming/share/classes/com/sun/naming/internal/VersionHelper.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.naming/share/classes/com/sun/naming/internal/VersionHelper.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, 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
@@ -53,6 +53,20 @@
public final class VersionHelper {
private static final VersionHelper helper = new VersionHelper();
+ /**
+ * Determines whether classes may be loaded from an arbitrary URL code base.
+ */
+ private static final boolean TRUST_URL_CODE_BASE;
+
+ static {
+ // System property to control whether classes may be loaded from an
+ // arbitrary URL code base
+ PrivilegedAction<String> act
+ = () -> System.getProperty("com.sun.jndi.ldap.object.trustURLCodebase", "false");
+ String trust = AccessController.doPrivileged(act);
+ TRUST_URL_CODE_BASE = "true".equalsIgnoreCase(trust);
+ }
+
final static String[] PROPS = new String[]{
javax.naming.Context.INITIAL_CONTEXT_FACTORY,
javax.naming.Context.OBJECT_FACTORIES,
@@ -88,12 +102,14 @@
*/
public Class<?> loadClass(String className, String codebase)
throws ClassNotFoundException, MalformedURLException {
-
- ClassLoader parent = getContextClassLoader();
- ClassLoader cl =
- URLClassLoader.newInstance(getUrlArray(codebase), parent);
-
- return loadClass(className, cl);
+ if (TRUST_URL_CODE_BASE) {
+ ClassLoader parent = getContextClassLoader();
+ ClassLoader cl
+ = URLClassLoader.newInstance(getUrlArray(codebase), parent);
+ return loadClass(className, cl);
+ } else {
+ return null;
+ }
}
/**
--- a/src/java.net.http/share/classes/jdk/internal/net/http/common/Utils.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.net.http/share/classes/jdk/internal/net/http/common/Utils.java Wed Oct 17 08:09:46 2018 -0700
@@ -133,9 +133,7 @@
// A case insensitive TreeSet of strings.
TreeSet<String> treeSet = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
treeSet.addAll(Set.of("connection", "content-length",
- "date", "expect", "from", "host", "origin",
- "referer", "upgrade",
- "via", "warning"));
+ "date", "expect", "from", "host", "upgrade", "via", "warning"));
DISALLOWED_HEADERS_SET = Collections.unmodifiableSet(treeSet);
}
--- a/src/java.security.jgss/share/native/libj2gss/NativeUtil.c Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.security.jgss/share/native/libj2gss/NativeUtil.c Wed Oct 17 08:09:46 2018 -0700
@@ -145,7 +145,7 @@
return JNI_ERR;
}
CLS_GSSNameElement = (*env)->NewGlobalRef(env, cls);
- if (CLS_GSSException == NULL) {
+ if (CLS_GSSNameElement == NULL) {
return JNI_ERR;
}
cls = (*env)->FindClass(env, "sun/security/jgss/wrapper/GSSCredElement");
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, 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
@@ -190,6 +190,7 @@
* @author Sunitha Reddy
* @see javax.xml.datatype.Duration
* @since 1.5
+ * @LastModified: June 2018
*/
public class XMLGregorianCalendarImpl
@@ -2755,7 +2756,7 @@
if ((fractional.compareTo(DECIMAL_ZERO) < 0) ||
(fractional.compareTo(DECIMAL_ONE) > 0)) {
throw new IllegalArgumentException(DatatypeMessageFormatter.formatMessage(null,
- "InvalidFractional", new Object[]{fractional}));
+ "InvalidFractional", new Object[]{fractional.toString()}));
}
}
this.fractionalSecond = fractional;
--- a/src/java.xml/share/classes/com/sun/xml/internal/stream/util/ThreadLocalBufferAllocator.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/java.xml/share/classes/com/sun/xml/internal/stream/util/ThreadLocalBufferAllocator.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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
@@ -39,15 +39,19 @@
* @author Santiago PericasGeertsen
*/
public class ThreadLocalBufferAllocator {
- private static ThreadLocal<SoftReference<BufferAllocator>> tlba = new ThreadLocal<>();
+ private static final ThreadLocal<SoftReference<BufferAllocator>> TL = new ThreadLocal<>();
- public static BufferAllocator getBufferAllocator() {
- SoftReference<BufferAllocator> bAllocatorRef = tlba.get();
- if (bAllocatorRef == null || bAllocatorRef.get() == null) {
- bAllocatorRef = new SoftReference<>(new BufferAllocator());
- tlba.set(bAllocatorRef);
+ public static BufferAllocator getBufferAllocator() {
+ BufferAllocator ba = null;
+ SoftReference<BufferAllocator> sr = TL.get();
+ if (sr != null) {
+ ba = sr.get();
}
-
- return bAllocatorRef.get();
- }
+ if (ba == null) {
+ ba = new BufferAllocator();
+ sr = new SoftReference<>(ba);
+ TL.set(sr);
+ }
+ return ba;
+ }
}
--- a/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -311,6 +311,9 @@
}
result = env->NewByteArray(length);
+ if (result == NULL) {
+ __leave;
+ }
env->SetByteArrayRegion(result, 0, length, (jbyte*) pbData);
} else { // length == 0
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java Wed Oct 17 08:09:46 2018 -0700
@@ -30,6 +30,8 @@
import java.net.URI;
import java.text.CollationKey;
import java.text.Collator;
+import java.text.ParseException;
+import java.text.RuleBasedCollator;
import java.util.*;
import java.util.AbstractMap.SimpleEntry;
import java.util.Map.Entry;
@@ -1483,7 +1485,7 @@
return false;
}
- if (!getBlockTags(m).isEmpty())
+ if (!getBlockTags(m).isEmpty() || isDeprecated(m))
return false;
List<? extends DocTree> fullBody = getFullBody(m);
@@ -1588,7 +1590,7 @@
private final Collator instance;
private final int MAX_SIZE = 1000;
private DocCollator(Locale locale, int strength) {
- instance = Collator.getInstance(locale);
+ instance = createCollator(locale);
instance.setStrength(strength);
keys = new LinkedHashMap<String, CollationKey>(MAX_SIZE + 1, 0.75f, true) {
@@ -1607,6 +1609,21 @@
public int compare(String s1, String s2) {
return getKey(s1).compareTo(getKey(s2));
}
+
+ private Collator createCollator(Locale locale) {
+ Collator baseCollator = Collator.getInstance(locale);
+ if (baseCollator instanceof RuleBasedCollator) {
+ // Extend collator to sort signatures with additional args and var-args in a well-defined order:
+ // () < (int) < (int, int) < (int...)
+ try {
+ return new RuleBasedCollator(((RuleBasedCollator) baseCollator).getRules()
+ + "& ')' < ',' < '.','['");
+ } catch (ParseException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ return baseCollator;
+ }
}
private Comparator<Element> moduleComparator = null;
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/VisibleMemberTable.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/VisibleMemberTable.java Wed Oct 17 08:09:46 2018 -0700
@@ -248,7 +248,7 @@
* @param e the method to check
* @return the overridden method or null
*/
- public ExecutableElement getsimplyOverriddenMethod(ExecutableElement e) {
+ public ExecutableElement getSimplyOverriddenMethod(ExecutableElement e) {
ensureInitialized();
OverridingMethodInfo found = overriddenMethodTable.get(e);
@@ -869,7 +869,7 @@
public List<ExecutableElement> getImplementedMethods(ExecutableElement method) {
ImplementedMethods imf = getImplementedMethodsFinder(method);
return imf.getImplementedMethods().stream()
- .filter(m -> getsimplyOverriddenMethod(m) == null)
+ .filter(m -> getSimplyOverriddenMethod(m) == null)
.collect(Collectors.toList());
}
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java Tue Oct 16 15:45:19 2018 +0200
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, 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
@@ -1601,13 +1601,14 @@
}
}
- switch (nameStr) {
- case "context":
+ if ("context".equals(nameStr)) {
return sctxt;
- case "engine":
- return global.engine;
- default:
- break;
+ } else if ("engine".equals(nameStr)) {
+ // expose "engine" variable only when there is no security manager
+ // or when no class filter is set.
+ if (System.getSecurityManager() == null || global.getClassFilter() == null) {
+ return global.engine;
+ }
}
if (self == UNDEFINED) {
--- a/test/hotspot/jtreg/compiler/aot/cli/MultipleAOTLibraryTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/compiler/aot/cli/MultipleAOTLibraryTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -54,6 +54,7 @@
package compiler.aot.cli;
import compiler.aot.HelloWorldPrinter;
+import java.io.File;
import java.util.Arrays;
import jdk.test.lib.process.ExitCode;
import jdk.test.lib.cli.CommandLineOptionTest;
@@ -75,8 +76,11 @@
boolean addTestVMOptions = true;
String[] allArgs = Arrays.copyOf(args, args.length + 4);
allArgs[args.length] = "-XX:AOTLibrary="
- + "./libMultipleAOTLibraryTest1.so:"
- + "./libMultipleAOTLibraryTest2.so";
+ + "." + File.separator
+ + "libMultipleAOTLibraryTest1.so"
+ + File.pathSeparator
+ + "." + File.separator
+ + "libMultipleAOTLibraryTest2.so";
allArgs[args.length + 1] = "-XX:+PrintAOT";
allArgs[args.length + 2] = "-XX:+UseAOT";
allArgs[args.length + 3] = HelloWorldPrinter.class.getName();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/codegen/TestTrichotomyExpressions.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,2519 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8210215
+ * @summary Test that C2 correctly optimizes trichotomy expressions.
+ * @library /test/lib
+ * @run main/othervm -XX:-TieredCompilation -Xbatch
+ * -XX:CompileCommand=dontinline,compiler.codegen.TestTrichotomyExpressions::test*
+ * compiler.codegen.TestTrichotomyExpressions
+ * @run main/othervm -XX:-TieredCompilation -Xcomp
+ * -XX:CompileCommand=dontinline,compiler.codegen.TestTrichotomyExpressions::test*
+ * compiler.codegen.TestTrichotomyExpressions
+ */
+
+package compiler.codegen;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.reflect.Method;
+import java.util.Random;
+
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Utils;
+
+enum Operation { SMALLER, SMALLER_EQUAL, EQUAL, GREATER_EQUAL, GREATER, ALWAYS_FALSE }
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+@interface Test {
+ Operation op();
+}
+
+public class TestTrichotomyExpressions {
+
+ public static int compare1(int a, int b) {
+ return (a < b) ? -1 : (a == b) ? 0 : 1;
+ }
+
+ public static int compare2(int a, int b) {
+ return (a < b) ? -1 : (a <= b) ? 0 : 1;
+ }
+
+ public static int compare3(int a, int b) {
+ return (a < b) ? -1 : (a > b) ? 1 : 0;
+ }
+
+ public static int compare4(int a, int b) {
+ return (a < b) ? -1 : (a != b) ? 1 : 0;
+ }
+
+ public static int compare5(int a, int b) {
+ return (a > b) ? 1 : (a < b) ? -1 : 0;
+ }
+
+ public static int compare6(int a, int b) {
+ return (a > b) ? 1 : (a == b) ? 0 : -1;
+ }
+
+ public static int compare7(int a, int b) {
+ return (a > b) ? 1 : (a >= b) ? 0 : -1;
+ }
+
+ public static int compare8(int a, int b) {
+ return (a > b) ? 1 : (a != b) ? -1 : 0;
+ }
+
+ public static int compare9(int a, int b) {
+ return (a == b) ? 0 : (a < b) ? -1 : 1;
+ }
+
+ public static int compare10(int a, int b) {
+ return (a == b) ? 0 : (a <= b) ? -1 : 1;
+ }
+
+ public static int compare11(int a, int b) {
+ return (a == b) ? 0 : (a > b) ? 1 : -1;
+ }
+
+ public static int compare12(int a, int b) {
+ return (a == b) ? 0 : (a >= b) ? 1 : -1;
+ }
+
+ public static int compare13(int a, int b) {
+ return (a <= b) ? ((a == b) ? 0 : -1) : 1;
+ }
+
+ public static int compare14(int a, int b) {
+ return (a <= b) ? ((a < b) ? -1 : 0) : 1;
+ }
+
+ public static int compare15(int a, int b) {
+ return (a <= b) ? ((a >= b) ? 0 : -1) : 1;
+ }
+
+ public static int compare16(int a, int b) {
+ return (a <= b) ? ((a != b) ? -1 : 0) : 1;
+ }
+
+ public static int compare17(int a, int b) {
+ return (a >= b) ? ((a <= b) ? 0 : 1) : -1;
+ }
+
+ public static int compare18(int a, int b) {
+ return (a >= b) ? ((a == b) ? 0 : 1) : -1;
+ }
+
+ public static int compare19(int a, int b) {
+ return (a >= b) ? ((a > b) ? 1 : 0) : -1;
+ }
+
+ public static int compare20(int a, int b) {
+ return (a >= b) ? ((a != b) ? 1 : 0) : -1;
+ }
+
+ public static int compare21(int a, int b) {
+ return (a != b) ? ((a < b) ? -1 : 1) : 0;
+ }
+
+ public static int compare22(int a, int b) {
+ return (a != b) ? ((a <= b) ? -1 : 1) : 0;
+ }
+
+ public static int compare23(int a, int b) {
+ return (a != b) ? ((a > b) ? 1 : -1) : 0;
+ }
+
+ public static int compare24(int a, int b) {
+ return (a != b) ? ((a >= b) ? 1 : -1) : 0;
+ }
+
+ public static int compare25(int a, int b) {
+ return (a < b) ? -1 : (b == a) ? 0 : 1;
+ }
+
+ public static int compare26(int a, int b) {
+ return (a < b) ? -1 : (b >= a) ? 0 : 1;
+ }
+
+ public static int compare27(int a, int b) {
+ return (a < b) ? -1 : (b < a) ? 1 : 0;
+ }
+
+ public static int compare28(int a, int b) {
+ return (a < b) ? -1 : (b != a) ? 1 : 0;
+ }
+
+ public static int compare29(int a, int b) {
+ return (a > b) ? 1 : (b > a) ? -1 : 0;
+ }
+
+ public static int compare30(int a, int b) {
+ return (a > b) ? 1 : (b == a) ? 0 : -1;
+ }
+
+ public static int compare31(int a, int b) {
+ return (a > b) ? 1 : (b <= a) ? 0 : -1;
+ }
+
+ public static int compare32(int a, int b) {
+ return (a > b) ? 1 : (b != a) ? -1 : 0;
+ }
+
+ public static int compare33(int a, int b) {
+ return (a == b) ? 0 : (b > a) ? -1 : 1;
+ }
+
+ public static int compare34(int a, int b) {
+ return (a == b) ? 0 : (b >= a) ? -1 : 1;
+ }
+
+ public static int compare35(int a, int b) {
+ return (a == b) ? 0 : (b < a) ? 1 : -1;
+ }
+
+ public static int compare36(int a, int b) {
+ return (a == b) ? 0 : (b <= a) ? 1 : -1;
+ }
+
+ public static int compare37(int a, int b) {
+ return (a <= b) ? ((b == a) ? 0 : -1) : 1;
+ }
+
+ public static int compare38(int a, int b) {
+ return (a <= b) ? ((b > a) ? -1 : 0) : 1;
+ }
+
+ public static int compare39(int a, int b) {
+ return (a <= b) ? ((b <= a) ? 0 : -1) : 1;
+ }
+
+ public static int compare40(int a, int b) {
+ return (a <= b) ? ((b != a) ? -1 : 0) : 1;
+ }
+
+ public static int compare41(int a, int b) {
+ return (a >= b) ? ((b >= a) ? 0 : 1) : -1;
+ }
+
+ public static int compare42(int a, int b) {
+ return (a >= b) ? ((b == a) ? 0 : 1) : -1;
+ }
+
+ public static int compare43(int a, int b) {
+ return (a >= b) ? ((b < a) ? 1 : 0) : -1;
+ }
+
+ public static int compare44(int a, int b) {
+ return (a >= b) ? ((b != a) ? 1 : 0) : -1;
+ }
+
+ public static int compare45(int a, int b) {
+ return (a != b) ? ((b > a) ? -1 : 1) : 0;
+ }
+
+ public static int compare46(int a, int b) {
+ return (a != b) ? ((b >= a) ? -1 : 1) : 0;
+ }
+
+ public static int compare47(int a, int b) {
+ return (a != b) ? ((b < a) ? 1 : -1) : 0;
+ }
+
+ public static int compare48(int a, int b) {
+ return (a != b) ? ((b <= a) ? 1 : -1) : 0;
+ }
+
+
+ public static int compareAlwaysFalse1(int a, int b) {
+ return (a >= b) ? 1 : (a > b) ? 2 : -1;
+ }
+
+ public static int compareAlwaysFalse2(int a, int b) {
+ return (a <= b) ? 1 : (a < b) ? 2 : -1;
+ }
+
+ public static int compareAlwaysFalse3(int a, int b) {
+ return (a == b) ? 1 : (a == b) ? 2 : -1;
+ }
+
+ public static int compareAlwaysFalse4(int a, int b) {
+ return (a != b) ? 1 : (a < b) ? 2 : -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller1(int a, int b) {
+ return compare1(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller2(int a, int b) {
+ return compare1(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller3(int a, int b) {
+ return compare1(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller4(int a, int b) {
+ return compare2(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller5(int a, int b) {
+ return compare2(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller6(int a, int b) {
+ return compare2(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller7(int a, int b) {
+ return compare3(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller8(int a, int b) {
+ return compare3(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller9(int a, int b) {
+ return compare3(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller10(int a, int b) {
+ return compare4(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller11(int a, int b) {
+ return compare4(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller12(int a, int b) {
+ return compare4(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller13(int a, int b) {
+ return compare5(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller14(int a, int b) {
+ return compare5(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller15(int a, int b) {
+ return compare5(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller16(int a, int b) {
+ return compare6(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller17(int a, int b) {
+ return compare6(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller18(int a, int b) {
+ return compare6(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller19(int a, int b) {
+ return compare7(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller20(int a, int b) {
+ return compare7(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller21(int a, int b) {
+ return compare7(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller22(int a, int b) {
+ return compare8(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller23(int a, int b) {
+ return compare8(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller24(int a, int b) {
+ return compare8(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller25(int a, int b) {
+ return compare9(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller26(int a, int b) {
+ return compare9(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller27(int a, int b) {
+ return compare9(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller28(int a, int b) {
+ return compare10(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller29(int a, int b) {
+ return compare10(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller30(int a, int b) {
+ return compare10(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller31(int a, int b) {
+ return compare11(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller32(int a, int b) {
+ return compare11(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller33(int a, int b) {
+ return compare11(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller34(int a, int b) {
+ return compare12(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller35(int a, int b) {
+ return compare12(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller36(int a, int b) {
+ return compare12(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller37(int a, int b) {
+ return compare13(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller38(int a, int b) {
+ return compare13(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller39(int a, int b) {
+ return compare13(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller40(int a, int b) {
+ return compare14(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller41(int a, int b) {
+ return compare14(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller42(int a, int b) {
+ return compare14(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller43(int a, int b) {
+ return compare15(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller44(int a, int b) {
+ return compare15(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller45(int a, int b) {
+ return compare15(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller46(int a, int b) {
+ return compare16(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller47(int a, int b) {
+ return compare16(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller48(int a, int b) {
+ return compare16(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller49(int a, int b) {
+ return compare17(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller50(int a, int b) {
+ return compare17(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller51(int a, int b) {
+ return compare17(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller52(int a, int b) {
+ return compare18(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller53(int a, int b) {
+ return compare18(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller54(int a, int b) {
+ return compare18(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller55(int a, int b) {
+ return compare19(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller56(int a, int b) {
+ return compare19(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller57(int a, int b) {
+ return compare19(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller58(int a, int b) {
+ return compare20(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller59(int a, int b) {
+ return compare20(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller60(int a, int b) {
+ return compare20(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller61(int a, int b) {
+ return compare21(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller62(int a, int b) {
+ return compare21(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller63(int a, int b) {
+ return compare21(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller64(int a, int b) {
+ return compare22(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller65(int a, int b) {
+ return compare22(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller66(int a, int b) {
+ return compare22(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller67(int a, int b) {
+ return compare23(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller68(int a, int b) {
+ return compare23(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller69(int a, int b) {
+ return compare23(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller70(int a, int b) {
+ return compare24(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller71(int a, int b) {
+ return compare24(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller72(int a, int b) {
+ return compare24(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller73(int a, int b) {
+ return compare25(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller74(int a, int b) {
+ return compare25(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller75(int a, int b) {
+ return compare25(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller76(int a, int b) {
+ return compare26(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller77(int a, int b) {
+ return compare26(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller78(int a, int b) {
+ return compare26(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller79(int a, int b) {
+ return compare27(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller80(int a, int b) {
+ return compare27(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller81(int a, int b) {
+ return compare27(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller82(int a, int b) {
+ return compare28(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller83(int a, int b) {
+ return compare28(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller84(int a, int b) {
+ return compare28(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller85(int a, int b) {
+ return compare29(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller86(int a, int b) {
+ return compare29(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller87(int a, int b) {
+ return compare29(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller88(int a, int b) {
+ return compare30(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller89(int a, int b) {
+ return compare30(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller90(int a, int b) {
+ return compare30(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller91(int a, int b) {
+ return compare31(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller92(int a, int b) {
+ return compare31(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller93(int a, int b) {
+ return compare31(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller94(int a, int b) {
+ return compare32(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller95(int a, int b) {
+ return compare32(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller96(int a, int b) {
+ return compare32(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller97(int a, int b) {
+ return compare33(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller98(int a, int b) {
+ return compare33(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller99(int a, int b) {
+ return compare33(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller100(int a, int b) {
+ return compare34(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller101(int a, int b) {
+ return compare34(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller102(int a, int b) {
+ return compare34(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller103(int a, int b) {
+ return compare35(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller104(int a, int b) {
+ return compare35(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller105(int a, int b) {
+ return compare35(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller106(int a, int b) {
+ return compare36(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller107(int a, int b) {
+ return compare36(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller108(int a, int b) {
+ return compare36(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller109(int a, int b) {
+ return compare37(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller110(int a, int b) {
+ return compare37(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller111(int a, int b) {
+ return compare37(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller112(int a, int b) {
+ return compare38(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller113(int a, int b) {
+ return compare38(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller114(int a, int b) {
+ return compare38(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller115(int a, int b) {
+ return compare39(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller116(int a, int b) {
+ return compare39(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller117(int a, int b) {
+ return compare39(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller118(int a, int b) {
+ return compare40(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller119(int a, int b) {
+ return compare40(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller120(int a, int b) {
+ return compare40(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller121(int a, int b) {
+ return compare41(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller122(int a, int b) {
+ return compare41(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller123(int a, int b) {
+ return compare41(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller124(int a, int b) {
+ return compare42(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller125(int a, int b) {
+ return compare42(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller126(int a, int b) {
+ return compare42(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller127(int a, int b) {
+ return compare43(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller128(int a, int b) {
+ return compare43(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller129(int a, int b) {
+ return compare43(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller130(int a, int b) {
+ return compare44(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller131(int a, int b) {
+ return compare44(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller132(int a, int b) {
+ return compare44(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller133(int a, int b) {
+ return compare45(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller134(int a, int b) {
+ return compare45(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller135(int a, int b) {
+ return compare45(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller136(int a, int b) {
+ return compare46(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller137(int a, int b) {
+ return compare46(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller138(int a, int b) {
+ return compare46(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller139(int a, int b) {
+ return compare47(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller140(int a, int b) {
+ return compare47(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller141(int a, int b) {
+ return compare47(a, b) <= -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller142(int a, int b) {
+ return compare48(a, b) == -1;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller143(int a, int b) {
+ return compare48(a, b) < 0;
+ }
+
+ @Test(op = Operation.SMALLER)
+ public static boolean testSmaller144(int a, int b) {
+ return compare48(a, b) <= -1;
+ }
+
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual1(int a, int b) {
+ return compare1(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual2(int a, int b) {
+ return compare2(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual3(int a, int b) {
+ return compare3(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual4(int a, int b) {
+ return compare4(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual5(int a, int b) {
+ return compare5(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual6(int a, int b) {
+ return compare6(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual7(int a, int b) {
+ return compare7(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual8(int a, int b) {
+ return compare8(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual9(int a, int b) {
+ return compare9(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual10(int a, int b) {
+ return compare10(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual11(int a, int b) {
+ return compare11(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual12(int a, int b) {
+ return compare12(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual13(int a, int b) {
+ return compare13(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual14(int a, int b) {
+ return compare14(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual15(int a, int b) {
+ return compare15(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual16(int a, int b) {
+ return compare16(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual17(int a, int b) {
+ return compare17(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual18(int a, int b) {
+ return compare18(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual19(int a, int b) {
+ return compare19(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual20(int a, int b) {
+ return compare20(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual21(int a, int b) {
+ return compare21(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual22(int a, int b) {
+ return compare22(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual23(int a, int b) {
+ return compare23(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual24(int a, int b) {
+ return compare24(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual25(int a, int b) {
+ return compare2(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual26(int a, int b) {
+ return compare26(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual27(int a, int b) {
+ return compare27(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual28(int a, int b) {
+ return compare28(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual29(int a, int b) {
+ return compare29(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual30(int a, int b) {
+ return compare30(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual31(int a, int b) {
+ return compare31(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual32(int a, int b) {
+ return compare32(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual33(int a, int b) {
+ return compare33(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual34(int a, int b) {
+ return compare34(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual35(int a, int b) {
+ return compare35(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual36(int a, int b) {
+ return compare36(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual37(int a, int b) {
+ return compare37(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual38(int a, int b) {
+ return compare38(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual39(int a, int b) {
+ return compare39(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual40(int a, int b) {
+ return compare40(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual41(int a, int b) {
+ return compare41(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual42(int a, int b) {
+ return compare42(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual43(int a, int b) {
+ return compare43(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual44(int a, int b) {
+ return compare44(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual45(int a, int b) {
+ return compare45(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual46(int a, int b) {
+ return compare46(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual47(int a, int b) {
+ return compare47(a, b) <= 0;
+ }
+
+ @Test(op = Operation.SMALLER_EQUAL)
+ public static boolean testSmallerEqual48(int a, int b) {
+ return compare48(a, b) <= 0;
+ }
+
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual1(int a, int b) {
+ return compare1(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual2(int a, int b) {
+ return compare2(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual3(int a, int b) {
+ return compare3(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual4(int a, int b) {
+ return compare4(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual5(int a, int b) {
+ return compare5(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual6(int a, int b) {
+ return compare6(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual7(int a, int b) {
+ return compare7(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual8(int a, int b) {
+ return compare8(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual9(int a, int b) {
+ return compare9(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual10(int a, int b) {
+ return compare10(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual11(int a, int b) {
+ return compare11(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual12(int a, int b) {
+ return compare12(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual13(int a, int b) {
+ return compare13(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual14(int a, int b) {
+ return compare14(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual15(int a, int b) {
+ return compare15(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual16(int a, int b) {
+ return compare16(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual17(int a, int b) {
+ return compare17(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual18(int a, int b) {
+ return compare18(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual19(int a, int b) {
+ return compare19(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual20(int a, int b) {
+ return compare20(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual21(int a, int b) {
+ return compare21(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual22(int a, int b) {
+ return compare22(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual23(int a, int b) {
+ return compare23(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual24(int a, int b) {
+ return compare24(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual25(int a, int b) {
+ return compare25(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual26(int a, int b) {
+ return compare26(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual27(int a, int b) {
+ return compare27(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual28(int a, int b) {
+ return compare28(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual29(int a, int b) {
+ return compare29(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual30(int a, int b) {
+ return compare30(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual31(int a, int b) {
+ return compare31(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual32(int a, int b) {
+ return compare32(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual33(int a, int b) {
+ return compare33(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual34(int a, int b) {
+ return compare34(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual35(int a, int b) {
+ return compare35(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual36(int a, int b) {
+ return compare36(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual37(int a, int b) {
+ return compare37(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual38(int a, int b) {
+ return compare38(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual39(int a, int b) {
+ return compare39(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual40(int a, int b) {
+ return compare40(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual41(int a, int b) {
+ return compare41(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual42(int a, int b) {
+ return compare42(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual43(int a, int b) {
+ return compare43(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual44(int a, int b) {
+ return compare44(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual45(int a, int b) {
+ return compare45(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual46(int a, int b) {
+ return compare46(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual47(int a, int b) {
+ return compare47(a, b) == 0;
+ }
+
+ @Test(op = Operation.EQUAL)
+ public static boolean testEqual48(int a, int b) {
+ return compare48(a, b) == 0;
+ }
+
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual1(int a, int b) {
+ return compare1(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual2(int a, int b) {
+ return compare2(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual3(int a, int b) {
+ return compare3(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual4(int a, int b) {
+ return compare4(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual5(int a, int b) {
+ return compare5(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual6(int a, int b) {
+ return compare6(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual7(int a, int b) {
+ return compare7(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual8(int a, int b) {
+ return compare8(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual9(int a, int b) {
+ return compare9(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual10(int a, int b) {
+ return compare10(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual11(int a, int b) {
+ return compare11(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual12(int a, int b) {
+ return compare12(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual13(int a, int b) {
+ return compare13(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual14(int a, int b) {
+ return compare14(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual15(int a, int b) {
+ return compare15(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual16(int a, int b) {
+ return compare16(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual17(int a, int b) {
+ return compare17(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual18(int a, int b) {
+ return compare18(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual19(int a, int b) {
+ return compare19(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual20(int a, int b) {
+ return compare20(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual21(int a, int b) {
+ return compare21(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual22(int a, int b) {
+ return compare22(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual23(int a, int b) {
+ return compare23(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual24(int a, int b) {
+ return compare24(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual25(int a, int b) {
+ return compare25(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual26(int a, int b) {
+ return compare26(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual27(int a, int b) {
+ return compare27(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual28(int a, int b) {
+ return compare28(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual29(int a, int b) {
+ return compare29(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual30(int a, int b) {
+ return compare30(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual31(int a, int b) {
+ return compare31(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual32(int a, int b) {
+ return compare32(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual33(int a, int b) {
+ return compare33(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual34(int a, int b) {
+ return compare34(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual35(int a, int b) {
+ return compare35(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual36(int a, int b) {
+ return compare36(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual37(int a, int b) {
+ return compare37(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual38(int a, int b) {
+ return compare38(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual39(int a, int b) {
+ return compare39(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual40(int a, int b) {
+ return compare40(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual41(int a, int b) {
+ return compare41(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual42(int a, int b) {
+ return compare42(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual43(int a, int b) {
+ return compare43(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual44(int a, int b) {
+ return compare44(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual45(int a, int b) {
+ return compare45(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual46(int a, int b) {
+ return compare46(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual47(int a, int b) {
+ return compare47(a, b) >= 0;
+ }
+
+ @Test(op = Operation.GREATER_EQUAL)
+ public static boolean testGreaterEqual48(int a, int b) {
+ return compare48(a, b) >= 0;
+ }
+
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater1(int a, int b) {
+ return compare1(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater2(int a, int b) {
+ return compare1(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater3(int a, int b) {
+ return compare1(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater4(int a, int b) {
+ return compare2(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater5(int a, int b) {
+ return compare2(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater6(int a, int b) {
+ return compare2(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater7(int a, int b) {
+ return compare3(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater8(int a, int b) {
+ return compare3(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater9(int a, int b) {
+ return compare3(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater10(int a, int b) {
+ return compare4(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater11(int a, int b) {
+ return compare4(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater12(int a, int b) {
+ return compare4(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater13(int a, int b) {
+ return compare5(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater14(int a, int b) {
+ return compare5(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater15(int a, int b) {
+ return compare5(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater16(int a, int b) {
+ return compare6(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater17(int a, int b) {
+ return compare6(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater18(int a, int b) {
+ return compare6(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater19(int a, int b) {
+ return compare7(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater20(int a, int b) {
+ return compare7(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater21(int a, int b) {
+ return compare7(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater22(int a, int b) {
+ return compare8(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater23(int a, int b) {
+ return compare8(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater24(int a, int b) {
+ return compare8(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater25(int a, int b) {
+ return compare9(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater26(int a, int b) {
+ return compare9(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater27(int a, int b) {
+ return compare9(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater28(int a, int b) {
+ return compare10(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater29(int a, int b) {
+ return compare10(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater30(int a, int b) {
+ return compare10(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater31(int a, int b) {
+ return compare11(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater32(int a, int b) {
+ return compare11(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater33(int a, int b) {
+ return compare11(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater34(int a, int b) {
+ return compare12(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater35(int a, int b) {
+ return compare12(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater36(int a, int b) {
+ return compare12(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater37(int a, int b) {
+ return compare13(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater38(int a, int b) {
+ return compare13(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater39(int a, int b) {
+ return compare13(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater40(int a, int b) {
+ return compare14(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater41(int a, int b) {
+ return compare14(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater42(int a, int b) {
+ return compare14(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater43(int a, int b) {
+ return compare15(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater44(int a, int b) {
+ return compare15(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater45(int a, int b) {
+ return compare15(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater46(int a, int b) {
+ return compare16(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater47(int a, int b) {
+ return compare16(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater48(int a, int b) {
+ return compare16(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater49(int a, int b) {
+ return compare17(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater50(int a, int b) {
+ return compare17(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater51(int a, int b) {
+ return compare17(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater52(int a, int b) {
+ return compare18(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater53(int a, int b) {
+ return compare18(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater54(int a, int b) {
+ return compare18(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater55(int a, int b) {
+ return compare19(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater56(int a, int b) {
+ return compare19(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater57(int a, int b) {
+ return compare19(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater58(int a, int b) {
+ return compare20(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater59(int a, int b) {
+ return compare20(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater60(int a, int b) {
+ return compare20(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater61(int a, int b) {
+ return compare21(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater62(int a, int b) {
+ return compare21(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater63(int a, int b) {
+ return compare21(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater64(int a, int b) {
+ return compare22(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater65(int a, int b) {
+ return compare22(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater66(int a, int b) {
+ return compare22(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater67(int a, int b) {
+ return compare23(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater68(int a, int b) {
+ return compare23(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater69(int a, int b) {
+ return compare23(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater70(int a, int b) {
+ return compare24(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater71(int a, int b) {
+ return compare24(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater72(int a, int b) {
+ return compare24(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater73(int a, int b) {
+ return compare25(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater74(int a, int b) {
+ return compare25(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater75(int a, int b) {
+ return compare25(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater76(int a, int b) {
+ return compare26(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater77(int a, int b) {
+ return compare26(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater78(int a, int b) {
+ return compare26(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater79(int a, int b) {
+ return compare27(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater80(int a, int b) {
+ return compare27(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater81(int a, int b) {
+ return compare27(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater82(int a, int b) {
+ return compare28(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater83(int a, int b) {
+ return compare28(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater84(int a, int b) {
+ return compare28(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater85(int a, int b) {
+ return compare29(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater86(int a, int b) {
+ return compare29(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater87(int a, int b) {
+ return compare29(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater88(int a, int b) {
+ return compare30(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater89(int a, int b) {
+ return compare30(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater90(int a, int b) {
+ return compare30(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater91(int a, int b) {
+ return compare31(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater92(int a, int b) {
+ return compare31(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater93(int a, int b) {
+ return compare31(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater94(int a, int b) {
+ return compare32(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater95(int a, int b) {
+ return compare32(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater96(int a, int b) {
+ return compare32(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater97(int a, int b) {
+ return compare33(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater98(int a, int b) {
+ return compare33(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater99(int a, int b) {
+ return compare33(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater100(int a, int b) {
+ return compare34(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater101(int a, int b) {
+ return compare34(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater102(int a, int b) {
+ return compare34(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater103(int a, int b) {
+ return compare35(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater104(int a, int b) {
+ return compare35(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater105(int a, int b) {
+ return compare35(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater106(int a, int b) {
+ return compare36(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater107(int a, int b) {
+ return compare36(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater108(int a, int b) {
+ return compare36(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater109(int a, int b) {
+ return compare37(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater110(int a, int b) {
+ return compare37(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater111(int a, int b) {
+ return compare37(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater112(int a, int b) {
+ return compare38(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater113(int a, int b) {
+ return compare38(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater114(int a, int b) {
+ return compare38(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater115(int a, int b) {
+ return compare39(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater116(int a, int b) {
+ return compare39(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater117(int a, int b) {
+ return compare39(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater118(int a, int b) {
+ return compare40(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater119(int a, int b) {
+ return compare40(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater120(int a, int b) {
+ return compare40(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater121(int a, int b) {
+ return compare41(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater122(int a, int b) {
+ return compare41(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater123(int a, int b) {
+ return compare41(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater124(int a, int b) {
+ return compare42(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater125(int a, int b) {
+ return compare42(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater126(int a, int b) {
+ return compare42(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater127(int a, int b) {
+ return compare43(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater128(int a, int b) {
+ return compare43(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater129(int a, int b) {
+ return compare43(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater130(int a, int b) {
+ return compare44(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater131(int a, int b) {
+ return compare44(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater132(int a, int b) {
+ return compare44(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater133(int a, int b) {
+ return compare45(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater134(int a, int b) {
+ return compare45(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater135(int a, int b) {
+ return compare45(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater136(int a, int b) {
+ return compare46(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater137(int a, int b) {
+ return compare46(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater138(int a, int b) {
+ return compare46(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater139(int a, int b) {
+ return compare47(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater140(int a, int b) {
+ return compare47(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater141(int a, int b) {
+ return compare47(a, b) >= 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater142(int a, int b) {
+ return compare48(a, b) == 1;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater143(int a, int b) {
+ return compare48(a, b) > 0;
+ }
+
+ @Test(op = Operation.GREATER)
+ public static boolean testGreater144(int a, int b) {
+ return compare48(a, b) >= 1;
+ }
+
+
+ @Test(op = Operation.ALWAYS_FALSE)
+ public static boolean testAlwaysFalse1(int a, int b) {
+ return compareAlwaysFalse1(a, b) == 2;
+ }
+
+ @Test(op = Operation.ALWAYS_FALSE)
+ public static boolean testAlwaysFalse2(int a, int b) {
+ return compareAlwaysFalse1(a, b) > 1;
+ }
+
+ @Test(op = Operation.ALWAYS_FALSE)
+ public static boolean testAlwaysFalse3(int a, int b) {
+ return compareAlwaysFalse1(a, b) >= 2;
+ }
+
+ @Test(op = Operation.ALWAYS_FALSE)
+ public static boolean testAlwaysFalse4(int a, int b) {
+ return compareAlwaysFalse2(a, b) == 2;
+ }
+
+ @Test(op = Operation.ALWAYS_FALSE)
+ public static boolean testAlwaysFalse5(int a, int b) {
+ return compareAlwaysFalse2(a, b) > 1;
+ }
+
+ @Test(op = Operation.ALWAYS_FALSE)
+ public static boolean testAlwaysFalse6(int a, int b) {
+ return compareAlwaysFalse2(a, b) >= 2;
+ }
+
+ @Test(op = Operation.ALWAYS_FALSE)
+ public static boolean testAlwaysFalse7(int a, int b) {
+ return compareAlwaysFalse3(a, b) == 2;
+ }
+
+ @Test(op = Operation.ALWAYS_FALSE)
+ public static boolean testAlwaysFalse8(int a, int b) {
+ return compareAlwaysFalse3(a, b) > 1;
+ }
+
+ @Test(op = Operation.ALWAYS_FALSE)
+ public static boolean testAlwaysFalse9(int a, int b) {
+ return compareAlwaysFalse3(a, b) >= 2;
+ }
+
+ @Test(op = Operation.ALWAYS_FALSE)
+ public static boolean testAlwaysFalse10(int a, int b) {
+ return compareAlwaysFalse4(a, b) == 2;
+ }
+
+ @Test(op = Operation.ALWAYS_FALSE)
+ public static boolean testAlwaysFalse11(int a, int b) {
+ return compareAlwaysFalse4(a, b) > 1;
+ }
+
+ @Test(op = Operation.ALWAYS_FALSE)
+ public static boolean testAlwaysFalse12(int a, int b) {
+ return compareAlwaysFalse4(a, b) >= 2;
+ }
+
+ public static void main(String[] args) throws Exception {
+ Random rand = Utils.getRandomInstance();
+ for (int i = 0; i < 20_000; ++i) {
+ int low = rand.nextInt();
+ int high = rand.nextInt();
+ if (low == high) {
+ --low;
+ }
+ if (low > high) {
+ int tmp = low;
+ low = high;
+ high = tmp;
+ }
+ for (Method m : TestTrichotomyExpressions.class.getMethods()) {
+ if (m.isAnnotationPresent(Test.class)) {
+ Operation op = m.getAnnotation(Test.class).op();
+ boolean result = (boolean)m.invoke(null, low, low);
+ Asserts.assertEquals(result, (op == Operation.EQUAL || op == Operation.SMALLER_EQUAL || op == Operation.GREATER_EQUAL) ? true : false, m + " failed");
+ result = (boolean)m.invoke(null, low, high);
+ Asserts.assertEquals(result, (op == Operation.SMALLER || op == Operation.SMALLER_EQUAL) ? true : false, m + " failed");
+ result = (boolean)m.invoke(null, high, low);
+ Asserts.assertEquals(result, (op == Operation.GREATER || op == Operation.GREATER_EQUAL) ? true : false, m + " failed");
+ }
+ }
+ }
+ }
+}
--- a/test/hotspot/jtreg/compiler/escapeAnalysis/TestArrayCopy.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/compiler/escapeAnalysis/TestArrayCopy.java Wed Oct 17 08:09:46 2018 -0700
@@ -33,7 +33,7 @@
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
*
- * @run main/othervm
+ * @run main/othervm/timeout=300
* -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI
--- a/test/hotspot/jtreg/compiler/graalunit/JttLangMathALTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/compiler/graalunit/JttLangMathALTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -34,5 +34,6 @@
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
- * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.lang.Math_[a-lA-L] -exclude ExcludeList.txt
+ * @run main/othervm/timeout=300 compiler.graalunit.common.GraalUnitTestLauncher
+ * -prefix org.graalvm.compiler.jtt.lang.Math_[a-lA-L] -exclude ExcludeList.txt
*/
--- a/test/hotspot/jtreg/compiler/graalunit/JttLangMathMZTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/compiler/graalunit/JttLangMathMZTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -34,5 +34,6 @@
*
* @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt
*
- * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.lang.Math_[m-zM-Z] -exclude ExcludeList.txt
+ * @run main/othervm/timeout=300 compiler.graalunit.common.GraalUnitTestLauncher
+ * -prefix org.graalvm.compiler.jtt.lang.Math_[m-zM-Z] -exclude ExcludeList.txt
*/
--- a/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,7 +25,7 @@
* @test
* @library /test/lib /
*
- * @run driver compiler.jsr292.ContinuousCallSiteTargetChange
+ * @run driver/timeout=300 compiler.jsr292.ContinuousCallSiteTargetChange
*/
package compiler.jsr292;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/gc/epsilon/TestMaxTLAB.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test TestMaxTLAB
+ * @key gc
+ * @requires vm.gc.Epsilon & !vm.graal.enabled
+ * @summary Check EpsilonMaxTLAB options
+ * @bug 8212177
+ *
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -Xmx128m -XX:+UseEpsilonGC -XX:EpsilonMaxTLABSize=1 TestMaxTLAB
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -Xmx128m -XX:+UseEpsilonGC -XX:EpsilonMaxTLABSize=1K TestMaxTLAB
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -Xmx128m -XX:+UseEpsilonGC -XX:EpsilonMaxTLABSize=1M TestMaxTLAB
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -Xmx128m -XX:+UseEpsilonGC -XX:EpsilonMaxTLABSize=12345 TestMaxTLAB
+ *
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -Xmx128m -XX:+UseEpsilonGC -XX:EpsilonMaxTLABSize=1 -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16 TestMaxTLAB
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -Xmx128m -XX:+UseEpsilonGC -XX:EpsilonMaxTLABSize=1K -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16 TestMaxTLAB
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -Xmx128m -XX:+UseEpsilonGC -XX:EpsilonMaxTLABSize=1M -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16 TestMaxTLAB
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -Xmx128m -XX:+UseEpsilonGC -XX:EpsilonMaxTLABSize=12345 -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16 TestMaxTLAB
+ */
+
+public class TestMaxTLAB {
+ static Object sink;
+
+ public static void main(String[] args) throws Exception {
+ for (int c = 0; c < 1000; c++) {
+ sink = new byte[c];
+ }
+ }
+}
--- a/test/hotspot/jtreg/runtime/appcds/jvmti/InstrumentationApp.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/jvmti/InstrumentationApp.java Wed Oct 17 08:09:46 2018 -0700
@@ -116,10 +116,10 @@
System.out.println("INFO: AppCDSv1 " + (wb.isSharedClass(InstrumentationApp.class) ? "enabled" :"disabled"));
System.out.println("INFO: AppCDSv2 " + (isAppCDSV2Enabled() ? "enabled" : "disabled"));
- File bootJar = new File(args[0]);
- File appJar = new File(args[1]);
- File custJar = new File(args[2]);
- String flagFile = args[3];
+ String flagFile = args[0];
+ File bootJar = new File(args[1]);
+ File appJar = new File(args[2]);
+ File custJar = new File(args[3]);
waitAttach(flagFile);
instrumentation = InstrumentationRegisterClassFileTransformer.getInstrumentation();
--- a/test/hotspot/jtreg/runtime/appcds/jvmti/InstrumentationTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/jvmti/InstrumentationTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -120,7 +120,7 @@
"-XX:+WhiteBoxAPI",
"-Xshare:off",
agentCmdArg,
- "InstrumentationApp", bootJar, appJar, custJar, flagFile);
+ "InstrumentationApp", flagFile, bootJar, appJar, custJar);
TestCommon.executeAndLog(pb, "no-sharing").shouldHaveExitValue(0);
checkAttach(t);
@@ -155,7 +155,7 @@
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+WhiteBoxAPI",
agentCmdArg,
- "InstrumentationApp", bootJar, appJar, custJar, flagFile);
+ "InstrumentationApp", flagFile, bootJar, appJar, custJar);
CDSOptions opts = (new CDSOptions()).setXShareMode("auto");
TestCommon.checkExec(out, opts);
--- a/test/hotspot/jtreg/runtime/jni/terminatedThread/TestTerminatedThread.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/runtime/jni/terminatedThread/TestTerminatedThread.java Wed Oct 17 08:09:46 2018 -0700
@@ -85,10 +85,14 @@
System.out.println("Calling getThreadCpuTime ...");
long t1 = mbean.getThreadCpuTime(t.getId());
if (t1 != -1) {
- throw new RuntimeException("Invalid ThreadCpuTime returned = " +
- t1 + " expected = -1");
+ // At least on PPC, we know threads can still be around a short
+ // instant. In some stress scenarios we seem to grab times of
+ // new threads started with the same thread id. In these cases
+ // we get here.
+ System.out.println("Unexpected: thread still reports CPU time: " + t1);
+ } else {
+ System.out.println("Okay: getThreadCpuTime() reported -1 as expected");
}
- System.out.println("Okay: getThreadCpuTime() reported -1 as expected");
} else {
System.out.println("Skipping Thread CPU time test as it's not supported");
}
@@ -96,10 +100,14 @@
System.out.println("Calling getThreadUserTime ...");
long t1 = mbean.getThreadUserTime(t.getId());
if (t1 != -1) {
- throw new RuntimeException("Invalid ThreadUserTime returned = " +
- t1 + " expected = -1");
+ // At least on PPC, we know threads can still be around a short
+ // instant. In some stress scenarios we seem to grab times of
+ // new threads started with the same thread id. In these cases
+ // we get here.
+ System.out.println("Unexpected: thread still reports User time: " + t1);
+ } else {
+ System.out.println("Okay: getThreadUserTime() reported -1 as expected");
}
- System.out.println("Okay: getThreadUserTime() reported -1 as expected");
System.out.println("Calling getThreadInfo ...");
ThreadInfo info = mbean.getThreadInfo(t.getId());
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetEnvironmentLocalStorage/setenvstor001/setenvstor001.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetEnvironmentLocalStorage/setenvstor001/setenvstor001.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -73,8 +73,7 @@
static int setEnvStorage(jvmtiEnv* jvmti, StorageStructure* storage, const char where[]) {
NSK_DISPLAY1("Set local storage for current JVMTI env: 0x%p\n", (void*)storage);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SetEnvironmentLocalStorage, jvmti, storage))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEnvironmentLocalStorage(storage))) {
return NSK_FALSE;
}
NSK_DISPLAY0(" ... ok\n");
@@ -89,8 +88,7 @@
StorageStructure* storage = NULL;
NSK_DISPLAY0("Get local storage for current JVMTI env\n");
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(GetEnvironmentLocalStorage, jvmti, (void**)&storage))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetEnvironmentLocalStorage((void**)&storage))) {
return NSK_FALSE;
}
NSK_DISPLAY1(" ... got storage: 0x%p\n", (void*)storage);
@@ -216,9 +214,7 @@
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
eventCallbacks.VMInit = callbackVMInit;
eventCallbacks.VMDeath = callbackVMDeath;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti,
- &eventCallbacks, sizeof(eventCallbacks)))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetEnvironmentLocalStorage/setenvstor002/setenvstor002.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetEnvironmentLocalStorage/setenvstor002/setenvstor002.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -73,8 +73,7 @@
static int setEnvStorage(jvmtiEnv* jvmti, StorageStructure* storage, const char where[]) {
NSK_DISPLAY1("Set local storage for current JVMTI env: 0x%p\n", (void*)storage);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SetEnvironmentLocalStorage, jvmti, storage))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEnvironmentLocalStorage(storage))) {
return NSK_FALSE;
}
NSK_DISPLAY0(" ... ok\n");
@@ -89,8 +88,7 @@
StorageStructure* storage = NULL;
NSK_DISPLAY0("Get local storage for current JVMTI env\n");
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(GetEnvironmentLocalStorage, jvmti, (void**)&storage))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetEnvironmentLocalStorage((void**)&storage))) {
return NSK_FALSE;
}
NSK_DISPLAY1(" ... got storage: 0x%p\n", (void*)storage);
@@ -221,9 +219,7 @@
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
eventCallbacks.VMInit = callbackVMInit;
eventCallbacks.VMDeath = callbackVMDeath;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti,
- &eventCallbacks, sizeof(eventCallbacks)))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetEnvironmentLocalStorage/setenvstor003/setenvstor003.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetEnvironmentLocalStorage/setenvstor003/setenvstor003.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -73,8 +73,7 @@
static int setEnvStorage(jvmtiEnv* jvmti, StorageStructure* storage, const char where[]) {
NSK_DISPLAY1("Set local storage for current JVMTI env: 0x%p\n", (void*)storage);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SetEnvironmentLocalStorage, jvmti, storage))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEnvironmentLocalStorage(storage))) {
return NSK_FALSE;
}
NSK_DISPLAY0(" ... ok\n");
@@ -89,8 +88,7 @@
StorageStructure* storage = NULL;
NSK_DISPLAY0("Get local storage for current JVMTI env\n");
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(GetEnvironmentLocalStorage, jvmti, (void**)&storage))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetEnvironmentLocalStorage((void**)&storage))) {
return NSK_FALSE;
}
NSK_DISPLAY1(" ... got storage: 0x%p\n", (void*)storage);
@@ -224,9 +222,7 @@
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
eventCallbacks.VMInit = callbackVMInit;
eventCallbacks.VMDeath = callbackVMDeath;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti,
- &eventCallbacks, sizeof(eventCallbacks)))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetEventCallbacks/setevntcallb001/setevntcallb001.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetEventCallbacks/setevntcallb001/setevntcallb001.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -143,9 +143,7 @@
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
eventCallbacks.ThreadStart = callbackThreadStart;
eventCallbacks.ThreadEnd = callbackThreadEnd;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti,
- &eventCallbacks, sizeof(eventCallbacks)))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
nsk_jvmti_setFailStatus();
} else {
nsk_jvmti_enableEvents(JVMTI_ENABLE, EVENTS_COUNT - 1, eventsList + 1, NULL);
@@ -190,9 +188,7 @@
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
eventCallbacks.VMInit = callbackVMInit;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti,
- &eventCallbacks, sizeof(eventCallbacks)))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
nsk_jvmti_setFailStatus();
} else {
nsk_jvmti_enableEvents(JVMTI_ENABLE, 1, eventsList, NULL);
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetEventCallbacks/setevntcallb002/setevntcallb002.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetEventCallbacks/setevntcallb002/setevntcallb002.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -145,8 +145,7 @@
NSK_DISPLAY0(">>> Testcase #2: Set NULL for events callbacks\n");
{
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti, NULL, 0))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(NULL, 0))) {
nsk_jvmti_setFailStatus();
}
@@ -193,9 +192,7 @@
eventCallbacks.VMInit = callbackVMInit;
eventCallbacks.ThreadStart = callbackThreadStart;
eventCallbacks.ThreadEnd = callbackThreadEnd;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti,
- &eventCallbacks, sizeof(eventCallbacks)))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
nsk_jvmti_setFailStatus();
} else {
nsk_jvmti_enableEvents(JVMTI_ENABLE, 1, eventsList, NULL);
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetEventCallbacks/setevntcallb003/setevntcallb003.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetEventCallbacks/setevntcallb003/setevntcallb003.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -151,9 +151,7 @@
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
eventCallbacks.ThreadStart = callbackThreadStart;
eventCallbacks.ThreadEnd = callbackThreadEnd;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti,
- &eventCallbacks, size))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, size))) {
nsk_jvmti_setFailStatus();
}
@@ -198,9 +196,7 @@
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
eventCallbacks.VMInit = callbackVMInit;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti,
- &eventCallbacks, sizeof(eventCallbacks)))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
nsk_jvmti_setFailStatus();
} else {
nsk_jvmti_enableEvents(JVMTI_ENABLE, 1, eventsList, NULL);
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetExtensionEventCallback/setextevent001/setextevent001.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetExtensionEventCallback/setextevent001/setextevent001.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -48,8 +48,7 @@
int i;
NSK_DISPLAY0("Get extension events list\n");
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetExtensionEvents, jvmti, &extCount, &extList))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetExtensionEvents(&extCount, &extList))) {
return NSK_FALSE;
}
NSK_DISPLAY1(" ... got count: %d\n", (int)extCount);
@@ -72,18 +71,14 @@
NSK_DISPLAY1(" ... setting callback: 0x%p\n", (void*)callbackExtensionEvent);
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetExtensionEventCallback, jvmti,
- extList[i].extension_event_index,
- callbackExtensionEvent))) {
+ jvmti->SetExtensionEventCallback(extList[i].extension_event_index, callbackExtensionEvent))) {
success = NSK_FALSE;
}
NSK_DISPLAY0(" ... done\n");
NSK_DISPLAY1(" ... clearing callback: 0x%p\n", (void*)NULL);
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetExtensionEventCallback, jvmti,
- extList[i].extension_event_index,
- NULL))) {
+ jvmti->SetExtensionEventCallback(extList[i].extension_event_index, NULL))) {
success = NSK_FALSE;
}
NSK_DISPLAY0(" ... done\n");
@@ -91,8 +86,7 @@
}
NSK_DISPLAY1("Deallocate extension events list: 0x%p\n", (void*)extList);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)extList))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)extList))) {
return NSK_FALSE;
}
NSK_DISPLAY0(" ... deallocated\n");
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix001/SetNativeMethodPrefix001.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix001/SetNativeMethodPrefix001.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -123,27 +123,11 @@
char *str = NULL;
if (prefix != NULL) {
- if (!NSK_VERIFY(
- (str = (char *) NSK_CPP_STUB3(
- GetStringUTFChars
- , jni
- , prefix
- , 0
- )
- ) != NULL
- )
- )
+ if (!NSK_VERIFY((str = (char *) jni->GetStringUTFChars(prefix, 0)) != NULL))
{ result = JNI_FALSE; goto finally; }
}
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(
- SetNativeMethodPrefix
- , jvmti
- , str
- )
- )
- )
+ if (!NSK_JVMTI_VERIFY(jvmti->SetNativeMethodPrefix(str)))
{ result = JNI_FALSE; goto finally; }
if (str != NULL) {
@@ -175,27 +159,10 @@
char *str = NULL;
if (prefix != NULL) {
- if (!NSK_VERIFY(
- (str = (char *) NSK_CPP_STUB3(
- GetStringUTFChars
- , jni
- , prefix
- , 0
- )
- ) != NULL
- )
- )
+ if (!NSK_VERIFY((str = (char *) jni->GetStringUTFChars(prefix, 0)) != NULL))
{ result = JNI_FALSE; goto finally; }
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(
- SetNativeMethodPrefixes
- , jvmti
- , 1
- , (char **) &str
- )
- )
- )
+ if (!NSK_JVMTI_VERIFY(jvmti->SetNativeMethodPrefixes(1, (char **) &str)))
{ result = JNI_FALSE; goto finally; }
NSK_DISPLAY1("MultiplePrefixes: New PREFIX is set: %s\n"
@@ -205,15 +172,7 @@
char* prefixes[1];
prefixes[0] = NULL;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(
- SetNativeMethodPrefixes
- , jvmti
- , 0
- , (char **)&prefixes
- )
- )
- )
+ if (!NSK_JVMTI_VERIFY(jvmti->SetNativeMethodPrefixes(0, (char **)&prefixes)))
{ result = JNI_FALSE; goto finally; }
NSK_DISPLAY0("Old PREFIX is reset\n");
@@ -250,33 +209,11 @@
return JNI_FALSE;
}
- if (!NSK_VERIFY(
- (method.name =
- (char *) NSK_CPP_STUB3(
- GetStringUTFChars
- , jni
- , method_name_obj
- , 0
- )
- ) != NULL
- )
- )
- {
+ if (!NSK_VERIFY((method.name = (char *) jni->GetStringUTFChars(method_name_obj, 0)) != NULL)) {
goto finally;
}
- if (!NSK_VERIFY(
- (method.signature =
- (char *) NSK_CPP_STUB3(
- GetStringUTFChars
- , jni
- , method_sig_obj
- , 0
- )
- ) != NULL
- )
- )
- {
+ if (!NSK_VERIFY((method.signature = (char *) jni->GetStringUTFChars(method_sig_obj, 0)) != NULL)) {
goto finally;
}
@@ -341,25 +278,13 @@
)
return JNI_ERR;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(
- GetCapabilities
- , jvmti
- , &caps)
- )
- )
+ if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
return JNI_ERR;
// Register all necessary JVM capabilities
caps.can_set_native_method_prefix = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(
- AddCapabilities
- , jvmti
- , &caps)
- )
- )
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
return JNI_ERR;
return JNI_OK;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/SetNativeMethodPrefix002.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/SetNativeMethodPrefix002.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -60,13 +60,7 @@
static jboolean setMethodPrefix (char *prefix)
{
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(
- SetNativeMethodPrefix
- , jvmti
- , prefix)
- )
- )
+ if (!NSK_JVMTI_VERIFY(jvmti->SetNativeMethodPrefix(prefix)))
return JNI_FALSE;
return JNI_TRUE;
@@ -114,25 +108,13 @@
)
return JNI_ERR;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(
- GetCapabilities
- , jvmti
- , &caps)
- )
- )
+ if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
return JNI_ERR;
// Register all necessary JVM capabilities
caps.can_set_native_method_prefix = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(
- AddCapabilities
- , jvmti
- , &caps)
- )
- )
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
return JNI_ERR;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetSystemProperty/setsysprop002/setsysprop002.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetSystemProperty/setsysprop002/setsysprop002.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -76,8 +76,7 @@
char* value = NULL;
NSK_DISPLAY1(" property: %s\n", name);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetSystemProperty, jvmti, name, &value))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetSystemProperty(name, &value))) {
return NSK_FALSE;
}
NSK_DISPLAY1(" value: \"%s\"\n", nsk_null_string(value));
@@ -93,8 +92,7 @@
success = NSK_FALSE;
}
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)value))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)value))) {
success = NSK_FALSE;
}
@@ -120,14 +118,12 @@
NSK_DISPLAY1(" value: \"%s\"\n", propDescList[i].values[step]);
if (step > 1) {
if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_WRONG_PHASE,
- NSK_CPP_STUB3(SetSystemProperty, jvmti,
- propDescList[i].name, propDescList[i].values[step]))) {
+ jvmti->SetSystemProperty(propDescList[i].name, propDescList[i].values[step]))) {
success = NSK_FALSE;
}
} else {
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetSystemProperty, jvmti,
- propDescList[i].name, propDescList[i].values[step]))) {
+ jvmti->SetSystemProperty(propDescList[i].name, propDescList[i].values[step]))) {
success = NSK_FALSE;
}
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetSystemProperty/setsysprop003/setsysprop003.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetSystemProperty/setsysprop003/setsysprop003.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -56,8 +56,7 @@
NSK_DISPLAY1(" property: %s\n", propDescList[i].name);
NSK_DISPLAY1(" value: \"%s\"\n", propDescList[i].value);
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetSystemProperty, jvmti,
- propDescList[i].name, propDescList[i].value))) {
+ jvmti->SetSystemProperty(propDescList[i].name, propDescList[i].value))) {
success = NSK_FALSE;
}
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetTag/settag001/settag001.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetTag/settag001/settag001.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -61,7 +61,7 @@
NSK_DISPLAY1("Find debugee class: %s\n", DEBUGEE_CLASS_NAME);
if (!NSK_JNI_VERIFY(jni, (debugeeClass =
- NSK_CPP_STUB2(FindClass, jni, DEBUGEE_CLASS_NAME)) != NULL)) {
+ jni->FindClass(DEBUGEE_CLASS_NAME)) != NULL)) {
nsk_jvmti_setFailStatus();
return;
}
@@ -69,8 +69,7 @@
NSK_DISPLAY1("Find static field: %s\n", OBJECT_FIELD_NAME);
if (!NSK_JNI_VERIFY(jni, (objectField =
- NSK_CPP_STUB4(GetStaticFieldID, jni, debugeeClass,
- OBJECT_FIELD_NAME, OBJECT_CLASS_SIG)) != NULL)) {
+ jni->GetStaticFieldID(debugeeClass, OBJECT_FIELD_NAME, OBJECT_CLASS_SIG)) != NULL)) {
nsk_jvmti_setFailStatus();
return;
}
@@ -78,16 +77,14 @@
NSK_DISPLAY1("Get object from static field: %s\n", OBJECT_FIELD_NAME);
if (!NSK_JNI_VERIFY(jni, (testedObject =
- NSK_CPP_STUB3(GetStaticObjectField, jni, debugeeClass,
- objectField)) != NULL)) {
+ jni->GetStaticObjectField(debugeeClass, objectField)) != NULL)) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY1(" ... got object: 0x%p\n", (void*)testedObject);
NSK_DISPLAY1("Create global reference for object: 0x%p\n", (void*)testedObject);
- if (!NSK_JNI_VERIFY(jni, (testedObject =
- NSK_CPP_STUB2(NewGlobalRef, jni, testedObject)) != NULL)) {
+ if (!NSK_JNI_VERIFY(jni, (testedObject = jni->NewGlobalRef(testedObject)) != NULL)) {
nsk_jvmti_setFailStatus();
return;
}
@@ -97,8 +94,7 @@
NSK_DISPLAY0(">>> Testcase #1: set tag for the tested object\n");
{
NSK_DISPLAY1("Set tag for object: 0x%p\n", (void*)testedObject);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetTag, jvmti, testedObject, objectTag))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetTag(testedObject, objectTag))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -110,8 +106,7 @@
jlong tag = 222;
NSK_DISPLAY1("Get tag for object: 0x%p\n", (void*)testedObject);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetTag, jvmti, testedObject, &tag))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetTag(testedObject, &tag))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -140,8 +135,7 @@
return;
NSK_DISPLAY1("Get tag for object: 0x%p\n", (void*)testedObject);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetTag, jvmti, testedObject, &tag))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetTag(testedObject, &tag))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -162,7 +156,7 @@
NSK_DISPLAY0(">>> Clean used data\n");
{
NSK_DISPLAY1("Delete object reference: 0x%p\n", (void*)testedObject);
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, testedObject));
+ NSK_TRACE(jni->DeleteGlobalRef(testedObject));
}
}
@@ -205,8 +199,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_tag_objects = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetThreadLocalStorage/setthrdstor001/setthrdstor001.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetThreadLocalStorage/setthrdstor001/setthrdstor001.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -73,9 +73,7 @@
NSK_DISPLAY1("SetThreadLocalStorage() for tested thread with pointer: %p\n",
(void*)initialStorage);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetThreadLocalStorage, jvmti,
- testedThread, (void*)initialStorage))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetThreadLocalStorage(testedThread, (void*)initialStorage))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -90,8 +88,7 @@
NSK_DISPLAY0("GetThreadLocalStorage() for tested thread\n");
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadLocalStorage, jvmti,
- testedThread, (void**)&obtainedStorage))) {
+ jvmti->GetThreadLocalStorage(testedThread, (void**)&obtainedStorage))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -128,7 +125,7 @@
}
NSK_DISPLAY0("Delete thread reference\n");
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, testedThread));
+ NSK_TRACE(jni->DeleteGlobalRef(testedThread));
}
NSK_DISPLAY0("Let debugee to finish\n");
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetThreadLocalStorage/setthrdstor002/setthrdstor002.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetThreadLocalStorage/setthrdstor002/setthrdstor002.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -66,9 +66,7 @@
NSK_DISPLAY1("SetThreadLocalStorage() for current agent thread with pointer: %p\n",
(void*)initialStorage);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetThreadLocalStorage, jvmti,
- NULL, (void*)initialStorage))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetThreadLocalStorage(NULL, (void*)initialStorage))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -82,9 +80,7 @@
return;
NSK_DISPLAY0("GetThreadLocalStorage() for current agent thread\n");
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadLocalStorage, jvmti,
- NULL, (void**)&obtainedStorage))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadLocalStorage(NULL, (void**)&obtainedStorage))) {
nsk_jvmti_setFailStatus();
return;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetThreadLocalStorage/setthrdstor003/setthrdstor003.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetThreadLocalStorage/setthrdstor003/setthrdstor003.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -120,8 +120,7 @@
if (thread != NULL) {
jvmtiThreadInfo info;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, thread, &info))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(thread, &info))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -133,9 +132,7 @@
NSK_DISPLAY1("SetThreadLocalStorage() for current thread with pointer: %p\n",
(void*)initialStorage);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetThreadLocalStorage, jvmti,
- NULL, (void*)initialStorage))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetThreadLocalStorage(NULL, (void*)initialStorage))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -151,8 +148,7 @@
if (thread != NULL) {
jvmtiThreadInfo info;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, thread, &info))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(thread, &info))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -168,8 +164,7 @@
NSK_DISPLAY0("GetThreadLocalStorage() for current thread\n");
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadLocalStorage, jvmti,
- NULL, (void**)&obtainedStorage))) {
+ jvmti->GetThreadLocalStorage(NULL, (void**)&obtainedStorage))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -243,8 +238,7 @@
memset(&callbacks, 0, sizeof(callbacks));
callbacks.ThreadStart = callbackThreadStart;
callbacks.ThreadEnd = callbackThreadEnd;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti, &callbacks, sizeof(callbacks))))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA08/ma08t001/ma08t001.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA08/ma08t001/ma08t001.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -60,8 +60,7 @@
NSK_DISPLAY0("Prepare: find tested thread\n");
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &threads_count, &threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&threads_count, &threads)))
return NSK_FALSE;
if (!NSK_VERIFY(threads_count > 0 && threads != NULL))
@@ -73,8 +72,7 @@
return NSK_FALSE;
/* get thread information */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, threads[i], &info)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(threads[i], &info)))
return NSK_FALSE;
NSK_DISPLAY3(" thread #%d (%s): %p\n", i, info.name, threads[i]);
@@ -90,8 +88,7 @@
}
/* deallocate threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
return NSK_FALSE;
if (threadForStop == NULL) {
@@ -106,17 +103,14 @@
NSK_DISPLAY0("Prepare: create new instance of ThreadDeath exception\n");
- if (!NSK_JNI_VERIFY(jni, (cls =
- NSK_CPP_STUB2(FindClass, jni, THREAD_DEATH_CLASS_NAME)) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (cls = jni->FindClass(THREAD_DEATH_CLASS_NAME)) != NULL))
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (ctor =
- NSK_CPP_STUB4(GetMethodID, jni, cls,
- THREAD_DEATH_CTOR_NAME, THREAD_DEATH_CTOR_SIGNATURE)) != NULL))
+ jni->GetMethodID(cls, THREAD_DEATH_CTOR_NAME, THREAD_DEATH_CTOR_SIGNATURE)) != NULL))
return NSK_FALSE;
- if (!NSK_JNI_VERIFY(jni, (threadDeath =
- NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (threadDeath = jni->NewObject(cls, ctor)) != NULL))
return NSK_FALSE;
return NSK_TRUE;
@@ -140,8 +134,7 @@
if (!NSK_VERIFY(threadForStop != NULL)) {
nsk_jvmti_setFailStatus();
} else {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(StopThread, jvmti, threadForStop, threadDeath)))
+ if (!NSK_JVMTI_VERIFY(jvmti->StopThread(threadForStop, threadDeath)))
nsk_jvmti_setFailStatus();
}
@@ -149,8 +142,7 @@
if (!NSK_VERIFY(threadForInterrupt != NULL)) {
nsk_jvmti_setFailStatus();
} else {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(InterruptThread, jvmti, threadForInterrupt)))
+ if (!NSK_JVMTI_VERIFY(jvmti->InterruptThread(threadForInterrupt)))
nsk_jvmti_setFailStatus();
}
@@ -199,7 +191,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_signal_thread = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA08/ma08t001/ma08t001a.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA08/ma08t001/ma08t001a.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -56,14 +56,12 @@
jclass klass = NULL;
char *signature = NULL;
- if (!NSK_JNI_VERIFY(jni_env, (klass =
- NSK_CPP_STUB2(GetObjectClass, jni_env, exception)) != NULL)) {
+ if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(exception)) != NULL)) {
nsk_jvmti_setFailStatus();
return;
}
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, jvmti_env,
- klass, &signature, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -75,7 +73,7 @@
NSK_DISPLAY1("Exception event: %s\n", signature);
- if (NSK_CPP_STUB3(IsSameObject, jni_env, threadForInterrupt, thread)) {
+ if (jni_env->IsSameObject(threadForInterrupt, thread)) {
if (strcmp(signature, INTERRUPTED_EXCEPTION_CLASS_SIG) == 0) {
InterruptedExceptionFlag++;
} else {
@@ -83,7 +81,7 @@
signature);
nsk_jvmti_setFailStatus();
}
- } else if (NSK_CPP_STUB3(IsSameObject, jni_env, threadForStop, thread)) {
+ } else if (jni_env->IsSameObject(threadForStop, thread)) {
if (strcmp(signature, THREAD_DEATH_CLASS_SIG) == 0) {
ThreadDeathFlag++;
} else {
@@ -93,7 +91,7 @@
}
}
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+ jvmti_env->Deallocate((unsigned char*)signature);
}
/* ========================================================================== */
@@ -109,8 +107,7 @@
NSK_DISPLAY0("Prepare: find tested thread\n");
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &threads_count, &threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&threads_count, &threads)))
return NSK_FALSE;
if (!NSK_VERIFY(threads_count > 0 && threads != NULL))
@@ -122,8 +119,7 @@
return NSK_FALSE;
/* get thread information */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, threads[i], &info)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(threads[i], &info)))
return NSK_FALSE;
NSK_DISPLAY3(" thread #%d (%s): %p\n", i, info.name, threads[i]);
@@ -139,8 +135,7 @@
}
/* deallocate threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
return NSK_FALSE;
if (threadForStop == NULL) {
@@ -153,17 +148,14 @@
return NSK_FALSE;
}
- if (!NSK_JNI_VERIFY(jni, (threadForStop =
- NSK_CPP_STUB2(NewGlobalRef, jni, threadForStop)) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (threadForStop = jni->NewGlobalRef(threadForStop)) != NULL))
return NSK_FALSE;
- if (!NSK_JNI_VERIFY(jni, (threadForInterrupt =
- NSK_CPP_STUB2(NewGlobalRef, jni, threadForInterrupt)) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (threadForInterrupt = jni->NewGlobalRef(threadForInterrupt)) != NULL))
return NSK_FALSE;
/* enable event */
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_ENABLE, JVMTI_EVENT_EXCEPTION, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_EXCEPTION, NULL)))
return NSK_FALSE;
return NSK_TRUE;
@@ -199,12 +191,11 @@
nsk_jvmti_setFailStatus();
/* disable event */
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_DISABLE, JVMTI_EVENT_EXCEPTION, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_EXCEPTION, NULL)))
nsk_jvmti_setFailStatus();
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadForStop));
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadForInterrupt));
+ NSK_TRACE(jni->DeleteGlobalRef(threadForStop));
+ NSK_TRACE(jni->DeleteGlobalRef(threadForInterrupt));
if (!nsk_jvmti_resumeSync())
return;
@@ -245,7 +236,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_exception_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t001/ma10t001.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t001/ma10t001.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -58,19 +58,17 @@
ExceptionEventsCount++;
- if (!NSK_JNI_VERIFY(jni_env, (klass =
- NSK_CPP_STUB2(GetObjectClass, jni_env, exception)) != NULL)) {
+ if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(exception)) != NULL)) {
nsk_jvmti_setFailStatus();
return;
}
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, jvmti_env,
- klass, &signature, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY1("Exception event: %s\n", signature);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+ jvmti_env->Deallocate((unsigned char*)signature);
}
void JNICALL
@@ -85,19 +83,17 @@
ExceptionCatchEventsCount++;
- if (!NSK_JNI_VERIFY(jni_env, (klass =
- NSK_CPP_STUB2(GetObjectClass, jni_env, exception)) != NULL)) {
+ if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(exception)) != NULL)) {
nsk_jvmti_setFailStatus();
return;
}
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, jvmti_env,
- klass, &signature, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY1("ExceptionCatch event: %s\n", signature);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+ jvmti_env->Deallocate((unsigned char*)signature);
}
/* ========================================================================== */
@@ -109,11 +105,9 @@
if (!nsk_jvmti_waitForSync(timeout))
return;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_ENABLE, JVMTI_EVENT_EXCEPTION, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_EXCEPTION, NULL)))
nsk_jvmti_setFailStatus();
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_ENABLE, JVMTI_EVENT_EXCEPTION_CATCH, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_EXCEPTION_CATCH, NULL)))
nsk_jvmti_setFailStatus();
/* resume debugee and wait for sync */
@@ -122,11 +116,9 @@
if (!nsk_jvmti_waitForSync(timeout))
return;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_DISABLE, JVMTI_EVENT_EXCEPTION, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_EXCEPTION, NULL)))
nsk_jvmti_setFailStatus();
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_DISABLE, JVMTI_EVENT_EXCEPTION_CATCH, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_EXCEPTION_CATCH, NULL)))
nsk_jvmti_setFailStatus();
NSK_DISPLAY1("Exception events received: %d\n",
@@ -178,7 +170,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_exception_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t001/ma10t001a.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t001/ma10t001a.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -54,19 +54,17 @@
ExceptionEventsCount++;
- if (!NSK_JNI_VERIFY(jni_env, (klass =
- NSK_CPP_STUB2(GetObjectClass, jni_env, exception)) != NULL)) {
+ if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(exception)) != NULL)) {
nsk_jvmti_setFailStatus();
return;
}
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, jvmti_env,
- klass, &signature, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY1("Exception event: %s\n", signature);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+ jvmti_env->Deallocate((unsigned char*)signature);
}
void JNICALL
@@ -77,19 +75,17 @@
ExceptionCatchEventsCount++;
- if (!NSK_JNI_VERIFY(jni_env, (klass =
- NSK_CPP_STUB2(GetObjectClass, jni_env, exception)) != NULL)) {
+ if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(exception)) != NULL)) {
nsk_jvmti_setFailStatus();
return;
}
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, jvmti_env,
- klass, &signature, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY1("ExceptionCatch event: %s\n", signature);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+ jvmti_env->Deallocate((unsigned char*)signature);
}
/* ========================================================================== */
@@ -156,7 +152,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_exception_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t002/ma10t002.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t002/ma10t002.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -54,16 +54,15 @@
char *signature = NULL;
MethodEntryEventsCount++;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
- jvmti_env, method, &name, &signature, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY2("MethodEntry event: %s%s\n", name, signature);
if (name != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+ jvmti_env->Deallocate((unsigned char*)name);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+ jvmti_env->Deallocate((unsigned char*)signature);
}
/* ========================================================================== */
@@ -78,8 +77,7 @@
NSK_DISPLAY0("Prepare: find tested thread\n");
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &threads_count, &threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&threads_count, &threads)))
return NSK_FALSE;
if (!NSK_VERIFY(threads_count > 0 && threads != NULL))
@@ -91,8 +89,7 @@
return NSK_FALSE;
/* get thread information */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, threads[i], &info)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(threads[i], &info)))
return NSK_FALSE;
NSK_DISPLAY3(" thread #%d (%s): %p\n", i, info.name, threads[i]);
@@ -103,13 +100,11 @@
}
}
- if (!NSK_JNI_VERIFY(jni, (thread =
- NSK_CPP_STUB2(NewGlobalRef, jni, thread)) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (thread = jni->NewGlobalRef(thread)) != NULL))
return NSK_FALSE;
/* deallocate threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
return NSK_FALSE;
return NSK_TRUE;
@@ -129,8 +124,7 @@
return;
}
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_ENABLE, JVMTI_EVENT_METHOD_ENTRY, thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_METHOD_ENTRY, thread)))
nsk_jvmti_setFailStatus();
/* resume debugee and wait for sync */
@@ -144,7 +138,7 @@
if (!NSK_VERIFY(MethodEntryEventsCount != 0))
nsk_jvmti_setFailStatus();
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, thread));
+ NSK_TRACE(jni->DeleteGlobalRef(thread));
if (!nsk_jvmti_resumeSync())
return;
@@ -185,7 +179,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_method_entry_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t002/ma10t002a.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t002/ma10t002a.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -51,16 +51,15 @@
char *signature = NULL;
MethodEntryEventsCount++;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
- jvmti_env, method, &name, &signature, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY2("MethodEntry event: %s%s\n", name, signature);
if (name != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+ jvmti_env->Deallocate((unsigned char*)name);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+ jvmti_env->Deallocate((unsigned char*)signature);
}
/* ========================================================================== */
@@ -122,7 +121,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_method_entry_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t003/ma10t003.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t003/ma10t003.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -55,16 +55,15 @@
char *signature = NULL;
MethodExitEventsCount++;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
- jvmti_env, method, &name, &signature, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY2("MethodExit event: %s%s\n", name, signature);
if (name != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+ jvmti_env->Deallocate((unsigned char*)name);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+ jvmti_env->Deallocate((unsigned char*)signature);
}
/* ========================================================================== */
@@ -79,8 +78,7 @@
NSK_DISPLAY0("Prepare: find tested thread\n");
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &threads_count, &threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&threads_count, &threads)))
return NSK_FALSE;
if (!NSK_VERIFY(threads_count > 0 && threads != NULL))
@@ -92,8 +90,7 @@
return NSK_FALSE;
/* get thread information */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, threads[i], &info)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(threads[i], &info)))
return NSK_FALSE;
NSK_DISPLAY3(" thread #%d (%s): %p\n", i, info.name, threads[i]);
@@ -104,13 +101,11 @@
}
}
- if (!NSK_JNI_VERIFY(jni, (thread =
- NSK_CPP_STUB2(NewGlobalRef, jni, thread)) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (thread = jni->NewGlobalRef(thread)) != NULL))
return NSK_FALSE;
/* deallocate threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
return NSK_FALSE;
return NSK_TRUE;
@@ -130,8 +125,7 @@
return;
}
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_ENABLE, JVMTI_EVENT_METHOD_EXIT, thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_METHOD_EXIT, thread)))
nsk_jvmti_setFailStatus();
/* resume debugee and wait for sync */
@@ -145,7 +139,7 @@
if (!NSK_VERIFY(MethodExitEventsCount != 0))
nsk_jvmti_setFailStatus();
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, thread));
+ NSK_TRACE(jni->DeleteGlobalRef(thread));
if (!nsk_jvmti_resumeSync())
return;
@@ -186,7 +180,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_method_exit_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t003/ma10t003a.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t003/ma10t003a.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -52,16 +52,15 @@
char *signature = NULL;
MethodExitEventsCount++;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
- jvmti_env, method, &name, &signature, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY2("MethodExit event: %s%s\n", name, signature);
if (name != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+ jvmti_env->Deallocate((unsigned char*)name);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+ jvmti_env->Deallocate((unsigned char*)signature);
}
/* ========================================================================== */
@@ -123,7 +122,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_method_exit_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t004/ma10t004.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t004/ma10t004.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -56,20 +56,18 @@
SingleStepEventsCount++;
- NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti_env, JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, NULL));
+ NSK_JVMTI_VERIFY(jvmti_env->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, NULL));
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
- jvmti_env, method, &name, &signature, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY3("SingleStep event: %s%s, location=%s\n", name, signature,
jlong_to_string(location, buffer));
if (name != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+ jvmti_env->Deallocate((unsigned char*)name);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+ jvmti_env->Deallocate((unsigned char*)signature);
}
/* ========================================================================== */
@@ -84,8 +82,7 @@
NSK_DISPLAY0("Prepare: find tested thread\n");
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &threads_count, &threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&threads_count, &threads)))
return NSK_FALSE;
if (!NSK_VERIFY(threads_count > 0 && threads != NULL))
@@ -97,8 +94,7 @@
return NSK_FALSE;
/* get thread information */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, threads[i], &info)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(threads[i], &info)))
return NSK_FALSE;
NSK_DISPLAY3(" thread #%d (%s): %p\n", i, info.name, threads[i]);
@@ -109,13 +105,11 @@
}
}
- if (!NSK_JNI_VERIFY(jni, (thread =
- NSK_CPP_STUB2(NewGlobalRef, jni, thread)) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (thread = jni->NewGlobalRef(thread)) != NULL))
return NSK_FALSE;
/* deallocate threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
return NSK_FALSE;
return NSK_TRUE;
@@ -135,8 +129,7 @@
return;
}
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, thread)))
nsk_jvmti_setFailStatus();
/* resume debugee and wait for sync */
@@ -150,7 +143,7 @@
if (!NSK_VERIFY(SingleStepEventsCount != 0))
nsk_jvmti_setFailStatus();
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, thread));
+ NSK_TRACE(jni->DeleteGlobalRef(thread));
if (!nsk_jvmti_resumeSync())
return;
@@ -191,7 +184,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_single_step_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t004/ma10t004a.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t004/ma10t004a.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -53,20 +53,18 @@
SingleStepEventsCount++;
- NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti_env, JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, NULL));
+ NSK_JVMTI_VERIFY(jvmti_env->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, NULL));
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
- jvmti_env, method, &name, &signature, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY3("SingleStep event: %s%s, location=%s\n", name, signature,
jlong_to_string(location, buffer));
if (name != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+ jvmti_env->Deallocate((unsigned char*)name);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+ jvmti_env->Deallocate((unsigned char*)signature);
}
/* ========================================================================== */
@@ -128,7 +126,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_single_step_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t005/ma10t005.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t005/ma10t005.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -52,14 +52,13 @@
VMObjectAllocEventsCount++;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, jvmti_env,
- object_klass, &signature, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(object_klass, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY2("VMObjectAlloc: \"%s\", size=%d\n", signature, size);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+ jvmti_env->Deallocate((unsigned char*)signature);
}
/* ========================================================================== */
@@ -115,7 +114,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_vm_object_alloc_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
@@ -124,8 +123,7 @@
if (!NSK_VERIFY(nsk_jvmti_init_MA(&callbacks)))
return JNI_ERR;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_ENABLE, JVMTI_EVENT_VM_OBJECT_ALLOC, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_OBJECT_ALLOC, NULL)))
return JNI_ERR;
return JNI_OK;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t005/ma10t005a.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t005/ma10t005a.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -52,14 +52,13 @@
VMObjectAllocEventsCount++;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, jvmti_env,
- object_klass, &signature, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(object_klass, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY2("VMObjectAlloc: \"%s\", size=%d\n", signature, size);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+ jvmti_env->Deallocate((unsigned char*)signature);
}
/* ========================================================================== */
@@ -115,7 +114,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_vm_object_alloc_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t006/ma10t006.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t006/ma10t006.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -54,17 +54,16 @@
CompiledMethodLoadEventsCount++;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
- jvmti_env, method, &name, &signature, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY3("CompiledMethodLoad event: %s%s (0x%p)\n",
name, signature, code_addr);
if (name != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+ jvmti_env->Deallocate((unsigned char*)name);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+ jvmti_env->Deallocate((unsigned char*)signature);
}
static void JNICALL
@@ -81,8 +80,8 @@
if (err == JVMTI_ERROR_NONE) {
NSK_DISPLAY3("for: \tmethod: name=\"%s\" signature=\"%s\"\n\tnative address=0x%p\n",
name, sig, code_addr);
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)sig);
+ jvmti_env->Deallocate((unsigned char*)name);
+ jvmti_env->Deallocate((unsigned char*)sig);
}
}
@@ -148,7 +147,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_compiled_method_load_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
@@ -158,11 +157,9 @@
if (!NSK_VERIFY(nsk_jvmti_init_MA(&callbacks)))
return JNI_ERR;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_ENABLE, JVMTI_EVENT_COMPILED_METHOD_LOAD, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_COMPILED_METHOD_LOAD, NULL)))
return JNI_ERR;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_ENABLE, JVMTI_EVENT_COMPILED_METHOD_UNLOAD, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_COMPILED_METHOD_UNLOAD, NULL)))
return JNI_ERR;
return JNI_OK;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t006/ma10t006a.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t006/ma10t006a.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -54,17 +54,16 @@
CompiledMethodLoadEventsCount++;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
- jvmti_env, method, &name, &signature, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY3("CompiledMethodLoad event: %s%s (0x%p)\n",
name, signature, code_addr);
if (name != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+ jvmti_env->Deallocate((unsigned char*)name);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+ jvmti_env->Deallocate((unsigned char*)signature);
}
static void JNICALL
@@ -82,8 +81,8 @@
if (err == JVMTI_ERROR_NONE) {
NSK_DISPLAY3("for: \tmethod: name=\"%s\" signature=\"%s\"\n\tnative address=0x%p\n",
name, sig, code_addr);
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)sig);
+ jvmti_env->Deallocate((unsigned char*)name);
+ jvmti_env->Deallocate((unsigned char*)sig);
}
}
@@ -145,7 +144,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_compiled_method_load_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t007/ma10t007.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t007/ma10t007.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -115,7 +115,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_garbage_collection_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
@@ -125,11 +125,9 @@
if (!NSK_VERIFY(nsk_jvmti_init_MA(&callbacks)))
return JNI_ERR;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_ENABLE, JVMTI_EVENT_GARBAGE_COLLECTION_START, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_GARBAGE_COLLECTION_START, NULL)))
return JNI_ERR;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_ENABLE, JVMTI_EVENT_GARBAGE_COLLECTION_FINISH, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_GARBAGE_COLLECTION_FINISH, NULL)))
return JNI_ERR;
return JNI_OK;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t007/ma10t007a.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t007/ma10t007a.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -115,7 +115,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_garbage_collection_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t008/ma10t008.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t008/ma10t008.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -55,8 +55,7 @@
MonitorContendedEnterEventsCount++;
/* get thread information */
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadInfo, jvmti_env,
- thread, &info))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -72,8 +71,7 @@
MonitorContendedEnteredEventsCount++;
/* get thread information */
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadInfo, jvmti_env,
- thread, &info))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -89,8 +87,7 @@
MonitorWaitEventsCount++;
/* get thread information */
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadInfo, jvmti_env,
- thread, &info))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -106,8 +103,7 @@
MonitorWaitedEventsCount++;
/* get thread information */
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadInfo, jvmti_env,
- thread, &info))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -189,7 +185,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_monitor_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
@@ -202,17 +198,13 @@
return JNI_ERR;
/* enable events */
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_ENABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTER, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTER, NULL)))
return JNI_ERR;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_ENABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, NULL)))
return JNI_ERR;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_ENABLE, JVMTI_EVENT_MONITOR_WAIT, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_MONITOR_WAIT, NULL)))
return JNI_ERR;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_ENABLE, JVMTI_EVENT_MONITOR_WAITED, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_MONITOR_WAITED, NULL)))
return JNI_ERR;
return JNI_OK;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t008/ma10t008a.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t008/ma10t008a.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -55,8 +55,7 @@
MonitorContendedEnterEventsCount++;
/* get thread information */
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadInfo, jvmti_env,
- thread, &info))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -72,8 +71,7 @@
MonitorContendedEnteredEventsCount++;
/* get thread information */
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadInfo, jvmti_env,
- thread, &info))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -89,8 +87,7 @@
MonitorWaitEventsCount++;
/* get thread information */
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadInfo, jvmti_env,
- thread, &info))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -106,8 +103,7 @@
MonitorWaitedEventsCount++;
/* get thread information */
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadInfo, jvmti_env,
- thread, &info))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -189,7 +185,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_generate_monitor_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t001/sp01t001.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t001/sp01t001.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -121,37 +121,35 @@
jsize i;
/* find debugee class */
- if (!NSK_JNI_VERIFY(jni, (debugeeClass =
- NSK_CPP_STUB2(FindClass, jni, DEBUGEE_CLASS_NAME)) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (debugeeClass = jni->FindClass(DEBUGEE_CLASS_NAME)) != NULL))
return NSK_FALSE;
/* find static field with threads array */
if (!NSK_JNI_VERIFY(jni, (threadsFieldID =
- NSK_CPP_STUB4(GetStaticFieldID, jni, debugeeClass,
- THREADS_FIELD_NAME, THREADS_FIELD_SIG)) != NULL))
+ jni->GetStaticFieldID(debugeeClass, THREADS_FIELD_NAME, THREADS_FIELD_SIG)) != NULL))
return NSK_FALSE;
/* get threads array from static field */
if (!NSK_JNI_VERIFY(jni, (threadsArray = (jobjectArray)
- NSK_CPP_STUB3(GetStaticObjectField, jni, debugeeClass, threadsFieldID)) != NULL))
+ jni->GetStaticObjectField(debugeeClass, threadsFieldID)) != NULL))
return NSK_FALSE;
/* check array length */
if (!NSK_JNI_VERIFY(jni, (threadsArrayLength =
- NSK_CPP_STUB2(GetArrayLength, jni, threadsArray)) == THREADS_COUNT))
+ jni->GetArrayLength(threadsArray)) == THREADS_COUNT))
return NSK_FALSE;
/* get each thread from array */
for (i = 0; i < THREADS_COUNT; i++) {
if (!NSK_JNI_VERIFY(jni, (threadsList[i] = (jthread)
- NSK_CPP_STUB3(GetObjectArrayElement, jni, threadsArray, i)) != NULL))
+ jni->GetObjectArrayElement(threadsArray, i)) != NULL))
return NSK_FALSE;
}
/* make global references to threads */
for (i = 0; i < THREADS_COUNT; i++) {
if (!NSK_JNI_VERIFY(jni, (threadsList[i] = (jthread)
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsList[i])) != NULL))
+ jni->NewGlobalRef(threadsList[i])) != NULL))
return NSK_FALSE;
}
@@ -174,8 +172,7 @@
NSK_DISPLAY2(" thread #%d (%s):\n", i, threadsName[i]);
/* get thread state */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadState, jvmti, threadsList[i], &state))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(threadsList[i], &state))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -233,7 +230,7 @@
/* dispose global references to threads */
for (i = 0; i < THREADS_COUNT; i++) {
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsList[i]));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsList[i]));
}
return NSK_TRUE;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t002/sp01t002.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t002/sp01t002.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -155,8 +155,7 @@
}
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &allThreadsCount, &allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&allThreadsCount, &allThreadsList)))
return NSK_FALSE;
if (!NSK_VERIFY(allThreadsCount > 0 && allThreadsList != NULL))
@@ -170,8 +169,7 @@
return NSK_FALSE;
/* get thread name (info) */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, allThreadsList[i], &threadInfo)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(allThreadsList[i], &threadInfo)))
return NSK_FALSE;
/* find by name */
@@ -189,8 +187,7 @@
}
/* deallocate all threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)allThreadsList)))
return NSK_FALSE;
/* check if all tested threads found */
@@ -208,8 +205,7 @@
/* make global refs */
for (i = 0; i < THREADS_COUNT; i++) {
- if (!NSK_JNI_VERIFY(jni, (threadsList[i] =
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsList[i])) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (threadsList[i] = jni->NewGlobalRef(threadsList[i])) != NULL))
return NSK_FALSE;
}
@@ -225,13 +221,11 @@
for (i = 0; i < THREADS_COUNT; i++) {
if (suspend) {
NSK_DISPLAY2(" suspend thread #%d (%s)\n", i, threadsName[i]);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SuspendThread, jvmti, threadsList[i])))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(threadsList[i])))
nsk_jvmti_setFailStatus();
} else {
NSK_DISPLAY2(" resume thread #%d (%s)\n", i, threadsName[i]);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(ResumeThread, jvmti, threadsList[i])))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(threadsList[i])))
nsk_jvmti_setFailStatus();
}
}
@@ -260,8 +254,7 @@
/* wait for WAITTIME for thread to reach expected state */
do {
/* get thread state */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadState, jvmti, threadsList[i], &state))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(threadsList[i], &state))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -371,7 +364,7 @@
/* dispose global references to threads */
for (i = 0; i < THREADS_COUNT; i++) {
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsList[i]));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsList[i]));
}
return NSK_TRUE;
@@ -449,8 +442,7 @@
jvmtiCapabilities suspendCaps;
memset(&suspendCaps, 0, sizeof(suspendCaps));
suspendCaps.can_suspend = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t003/sp01t003.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t003/sp01t003.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -155,8 +155,7 @@
}
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &allThreadsCount, &allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&allThreadsCount, &allThreadsList)))
return NSK_FALSE;
if (!NSK_VERIFY(allThreadsCount > 0 && allThreadsList != NULL))
@@ -170,8 +169,7 @@
return NSK_FALSE;
/* get thread name (info) */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, allThreadsList[i], &threadInfo)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(allThreadsList[i], &threadInfo)))
return NSK_FALSE;
/* find by name */
@@ -189,8 +187,7 @@
}
/* deallocate all threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)allThreadsList)))
return NSK_FALSE;
/* check if all tested threads found */
@@ -208,8 +205,7 @@
/* make global refs */
for (i = 0; i < THREADS_COUNT; i++) {
- if (!NSK_JNI_VERIFY(jni, (threadsList[i] =
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsList[i])) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (threadsList[i] = jni->NewGlobalRef(threadsList[i])) != NULL))
return NSK_FALSE;
}
@@ -226,14 +222,10 @@
/* suspend or resume threads list */
if (suspend) {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(SuspendThreadList, jvmti, THREADS_COUNT,
- threadsList, results)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThreadList(THREADS_COUNT, threadsList, results)))
nsk_jvmti_setFailStatus();
} else {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(ResumeThreadList, jvmti, THREADS_COUNT,
- threadsList, results)))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThreadList(THREADS_COUNT, threadsList, results)))
nsk_jvmti_setFailStatus();
}
@@ -273,8 +265,7 @@
/* wait for WAITTIME for thread to reach expected state */
do {
/* get thread status */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadState, jvmti, threadsList[i], &state))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(threadsList[i], &state))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -384,7 +375,7 @@
/* dispose global references to threads */
for (i = 0; i < THREADS_COUNT; i++) {
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsList[i]));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsList[i]));
}
return NSK_TRUE;
@@ -462,8 +453,7 @@
jvmtiCapabilities suspendCaps;
memset(&suspendCaps, 0, sizeof(suspendCaps));
suspendCaps.can_suspend = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP02/sp02t001/sp02t001.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP02/sp02t001/sp02t001.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -136,8 +136,7 @@
}
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &allThreadsCount, &allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&allThreadsCount, &allThreadsList)))
return NSK_FALSE;
if (!NSK_VERIFY(allThreadsCount > 0 && allThreadsList != NULL))
@@ -151,8 +150,7 @@
return NSK_FALSE;
/* get thread name (info) */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, allThreadsList[i], &threadInfo)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(allThreadsList[i], &threadInfo)))
return NSK_FALSE;
/* find by name */
@@ -170,8 +168,7 @@
}
/* deallocate all threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)allThreadsList)))
return NSK_FALSE;
/* check if all tested threads found */
@@ -190,7 +187,7 @@
/* make global refs */
for (i = 0; i < THREADS_COUNT; i++) {
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].thread = (jthread)
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsDesc[i].thread)) != NULL))
+ jni->NewGlobalRef(threadsDesc[i].thread)) != NULL))
return NSK_FALSE;
}
@@ -206,13 +203,11 @@
for (i = 0; i < THREADS_COUNT; i++) {
if (suspend) {
NSK_DISPLAY2(" suspend thread #%d (%s)\n", i, threadsDesc[i].threadName);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SuspendThread, jvmti, threadsDesc[i].thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(threadsDesc[i].thread)))
nsk_jvmti_setFailStatus();
} else {
NSK_DISPLAY2(" resume thread #%d (%s)\n", i, threadsDesc[i].threadName);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(ResumeThread, jvmti, threadsDesc[i].thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(threadsDesc[i].thread)))
nsk_jvmti_setFailStatus();
}
}
@@ -241,9 +236,7 @@
NSK_DISPLAY2(" thread #%d (%s):\n", i, threadsDesc[i].threadName);
/* get frame count */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetFrameCount, jvmti,
- threadsDesc[i].thread, &frameCount))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetFrameCount(threadsDesc[i].thread, &frameCount))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -252,8 +245,7 @@
/* get stack trace */
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB6(GetStackTrace, jvmti, threadsDesc[i].thread,
- 0, MAX_STACK_SIZE, frameStack, &frameStackSize))) {
+ jvmti->GetStackTrace(threadsDesc[i].thread, 0, MAX_STACK_SIZE, frameStack, &frameStackSize))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -294,7 +286,7 @@
/* dispose global references to threads */
for (i = 0; i < THREADS_COUNT; i++) {
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsDesc[i].thread));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsDesc[i].thread));
}
return NSK_TRUE;
@@ -372,8 +364,7 @@
jvmtiCapabilities suspendCaps;
memset(&suspendCaps, 0, sizeof(suspendCaps));
suspendCaps.can_suspend = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP02/sp02t002/sp02t002.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP02/sp02t002/sp02t002.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -158,8 +158,7 @@
}
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &allThreadsCount, &allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&allThreadsCount, &allThreadsList)))
return NSK_FALSE;
if (!NSK_VERIFY(allThreadsCount > 0 && allThreadsList != NULL))
@@ -173,8 +172,7 @@
return NSK_FALSE;
/* get thread name (info) */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, allThreadsList[i], &threadInfo)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(allThreadsList[i], &threadInfo)))
return NSK_FALSE;
/* find by name */
@@ -192,8 +190,7 @@
}
/* deallocate all threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)allThreadsList)))
return NSK_FALSE;
/* check if all tested threads found */
@@ -214,12 +211,11 @@
for (i = 0; i < THREADS_COUNT; i++) {
/* get thread class */
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].cls =
- NSK_CPP_STUB2(GetObjectClass, jni, threadsDesc[i].thread)) != NULL))
+ jni->GetObjectClass(threadsDesc[i].thread)) != NULL))
return NSK_FALSE;
/* get frame method */
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].method =
- NSK_CPP_STUB4(GetMethodID, jni, threadsDesc[i].cls,
- threadsDesc[i].methodName, threadsDesc[i].methodSig)) != NULL))
+ jni->GetMethodID(threadsDesc[i].cls, threadsDesc[i].methodName, threadsDesc[i].methodSig)) != NULL))
return NSK_FALSE;
NSK_DISPLAY4(" thread #%d (%s): %p (%s)\n",
@@ -231,10 +227,10 @@
/* make global refs */
for (i = 0; i < THREADS_COUNT; i++) {
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].thread = (jthread)
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsDesc[i].thread)) != NULL))
+ jni->NewGlobalRef(threadsDesc[i].thread)) != NULL))
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].cls = (jclass)
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsDesc[i].cls)) != NULL))
+ jni->NewGlobalRef(threadsDesc[i].cls)) != NULL))
return NSK_FALSE;
}
@@ -250,13 +246,11 @@
for (i = 0; i < THREADS_COUNT; i++) {
if (suspend) {
NSK_DISPLAY2(" suspend thread #%d (%s)\n", i, threadsDesc[i].threadName);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SuspendThread, jvmti, threadsDesc[i].thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(threadsDesc[i].thread)))
nsk_jvmti_setFailStatus();
} else {
NSK_DISPLAY2(" resume thread #%d (%s)\n", i, threadsDesc[i].threadName);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(ResumeThread, jvmti, threadsDesc[i].thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(threadsDesc[i].thread)))
nsk_jvmti_setFailStatus();
}
}
@@ -285,9 +279,7 @@
NSK_DISPLAY2(" thread #%d (%s):\n", i, threadsDesc[i].threadName);
/* get frame count */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetFrameCount, jvmti,
- threadsDesc[i].thread, &frameCount))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetFrameCount(threadsDesc[i].thread, &frameCount))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -296,8 +288,7 @@
/* get stack trace */
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB6(GetStackTrace, jvmti, threadsDesc[i].thread,
- 0, MAX_STACK_SIZE, frameStack, &frameStackSize))) {
+ jvmti->GetStackTrace(threadsDesc[i].thread, 0, MAX_STACK_SIZE, frameStack, &frameStackSize))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -357,8 +348,8 @@
/* dispose global references to threads */
for (i = 0; i < THREADS_COUNT; i++) {
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsDesc[i].thread));
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsDesc[i].cls));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsDesc[i].thread));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsDesc[i].cls));
}
return NSK_TRUE;
@@ -436,8 +427,7 @@
jvmtiCapabilities suspendCaps;
memset(&suspendCaps, 0, sizeof(suspendCaps));
suspendCaps.can_suspend = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP02/sp02t003/sp02t003.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP02/sp02t003/sp02t003.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -159,8 +159,7 @@
}
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &allThreadsCount, &allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&allThreadsCount, &allThreadsList)))
return NSK_FALSE;
if (!NSK_VERIFY(allThreadsCount > 0 && allThreadsList != NULL))
@@ -174,8 +173,7 @@
return NSK_FALSE;
/* get thread name (info) */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, allThreadsList[i], &threadInfo)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(allThreadsList[i], &threadInfo)))
return NSK_FALSE;
/* find by name */
@@ -193,8 +191,7 @@
}
/* deallocate all threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)allThreadsList)))
return NSK_FALSE;
/* check if all tested threads found */
@@ -215,12 +212,11 @@
for (i = 0; i < THREADS_COUNT; i++) {
/* get thread class */
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].cls =
- NSK_CPP_STUB2(GetObjectClass, jni, threadsDesc[i].thread)) != NULL))
+ jni->GetObjectClass(threadsDesc[i].thread)) != NULL))
return NSK_FALSE;
/* get frame method */
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].method =
- NSK_CPP_STUB4(GetMethodID, jni, threadsDesc[i].cls,
- threadsDesc[i].methodName, threadsDesc[i].methodSig)) != NULL))
+ jni->GetMethodID(threadsDesc[i].cls, threadsDesc[i].methodName, threadsDesc[i].methodSig)) != NULL))
return NSK_FALSE;
NSK_DISPLAY4(" thread #%d (%s): %p (%s)\n",
@@ -232,10 +228,10 @@
/* make global refs */
for (i = 0; i < THREADS_COUNT; i++) {
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].thread = (jthread)
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsDesc[i].thread)) != NULL))
+ jni->NewGlobalRef(threadsDesc[i].thread)) != NULL))
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].cls = (jclass)
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsDesc[i].cls)) != NULL))
+ jni->NewGlobalRef(threadsDesc[i].cls)) != NULL))
return NSK_FALSE;
}
@@ -251,13 +247,11 @@
for (i = 0; i < THREADS_COUNT; i++) {
if (suspend) {
NSK_DISPLAY2(" suspend thread #%d (%s)\n", i, threadsDesc[i].threadName);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SuspendThread, jvmti, threadsDesc[i].thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(threadsDesc[i].thread)))
nsk_jvmti_setFailStatus();
} else {
NSK_DISPLAY2(" resume thread #%d (%s)\n", i, threadsDesc[i].threadName);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(ResumeThread, jvmti, threadsDesc[i].thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(threadsDesc[i].thread)))
nsk_jvmti_setFailStatus();
}
}
@@ -288,9 +282,7 @@
NSK_DISPLAY2(" thread #%d (%s):\n", i, threadsDesc[i].threadName);
/* get frame count */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetFrameCount, jvmti,
- threadsDesc[i].thread, &frameCount))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetFrameCount(threadsDesc[i].thread, &frameCount))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -298,8 +290,7 @@
/* get stack trace */
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB6(GetStackTrace, jvmti, threadsDesc[i].thread,
- 0, MAX_STACK_SIZE, frameStack, &frameStackSize))) {
+ jvmti->GetStackTrace(threadsDesc[i].thread, 0, MAX_STACK_SIZE, frameStack, &frameStackSize))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -319,8 +310,7 @@
(long)frameStack[j].location);
/* query frame location */
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB5(GetFrameLocation, jvmti, threadsDesc[i].thread,
- j, &qMethod, &qLocation))) {
+ jvmti->GetFrameLocation(threadsDesc[i].thread, j, &qMethod, &qLocation))) {
nsk_jvmti_setFailStatus();
continue;
}
@@ -375,8 +365,8 @@
/* dispose global references to threads */
for (i = 0; i < THREADS_COUNT; i++) {
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsDesc[i].thread));
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsDesc[i].cls));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsDesc[i].thread));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsDesc[i].cls));
}
return NSK_TRUE;
@@ -453,8 +443,7 @@
jvmtiCapabilities suspendCaps;
memset(&suspendCaps, 0, sizeof(suspendCaps));
suspendCaps.can_suspend = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP03/sp03t001/sp03t001.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP03/sp03t001/sp03t001.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -158,9 +158,8 @@
threadsCounts[i] = 0;
threadsList[i] = NULL;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(Allocate, jvmti, (threadsCount * sizeof(jthread)),
- (unsigned char**)&threadsList[i])))
+ if (!NSK_JVMTI_VERIFY(jvmti->Allocate(threadsCount * sizeof(jthread),
+ (unsigned char**)&threadsList[i])))
return NSK_FALSE;
for (j = 0; j < threadsCount; j++) {
@@ -169,8 +168,7 @@
}
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &allThreadsCount, &allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&allThreadsCount, &allThreadsList)))
return NSK_FALSE;
if (!NSK_VERIFY(allThreadsCount > 0 && allThreadsList != NULL))
@@ -184,8 +182,7 @@
return NSK_FALSE;
/* get thread name (info) */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, allThreadsList[i], &threadInfo)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(allThreadsList[i], &threadInfo)))
return NSK_FALSE;
/* find by name */
@@ -202,8 +199,7 @@
}
/* deallocate all threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)allThreadsList)))
return NSK_FALSE;
/* check if all tested threads found */
@@ -226,7 +222,7 @@
for (i = 0; i < THREADS_KINDS; i++) {
for (j = 0; j < threadsCount; j++) {
if (!NSK_JNI_VERIFY(jni, (threadsList[i][j] =
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsList[i][j])) != NULL))
+ jni->NewGlobalRef(threadsList[i][j])) != NULL))
return NSK_FALSE;
}
}
@@ -244,8 +240,7 @@
int i, j;
/* allocate results array */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(Allocate, jvmti, resultsSize, (unsigned char**)&results))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->Allocate(resultsSize, (unsigned char**)&results))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
@@ -253,14 +248,10 @@
for (i = 0; i < THREADS_KINDS; i++) {
/* suspend or resume threads list */
if (suspend) {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(SuspendThreadList, jvmti, threadsCount,
- threadsList[i], results)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThreadList(threadsCount, threadsList[i], results)))
nsk_jvmti_setFailStatus();
} else {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(ResumeThreadList, jvmti, threadsCount,
- threadsList[i], results)))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThreadList(threadsCount, threadsList[i], results)))
nsk_jvmti_setFailStatus();
}
@@ -277,8 +268,7 @@
}
/* deallocate results array */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)results))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)results))) {
nsk_jvmti_setFailStatus();
}
@@ -295,13 +285,11 @@
for (j = 0; j < threadsCount; j++) {
if (suspend) {
NSK_DISPLAY2(" suspend thread #%d (%s)\n", j, threadsName[i]);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SuspendThread, jvmti, threadsList[i][j])))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(threadsList[i][j])))
nsk_jvmti_setFailStatus();
} else {
NSK_DISPLAY2(" resume thread #%d (%s)\n", j, threadsName[i]);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(ResumeThread, jvmti, threadsList[i][j])))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(threadsList[i][j])))
nsk_jvmti_setFailStatus();
}
}
@@ -329,8 +317,7 @@
NSK_DISPLAY2(" thread #%d (%s):\n", j, threadsName[i]);
/* get thread state */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadState, jvmti, threadsList[i][j], &state))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(threadsList[i][j], &state))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
@@ -373,14 +360,13 @@
/* dispose global references to threads */
for (i = 0; i < THREADS_KINDS; i++) {
for (j = 0; j < threadsCount; j++) {
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsList[i][j]));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsList[i][j]));
}
}
/* deallocate memory */
for (i = 0; i < THREADS_KINDS; i++) {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threadsList[i])))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threadsList[i])))
return NSK_FALSE;
threadsList[i] = NULL;
}
@@ -465,8 +451,7 @@
jvmtiCapabilities suspendCaps;
memset(&suspendCaps, 0, sizeof(suspendCaps));
suspendCaps.can_suspend = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP03/sp03t002/sp03t002.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP03/sp03t002/sp03t002.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -161,9 +161,8 @@
threadsCounts[i] = 0;
threadsList[i] = NULL;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(Allocate, jvmti, (threadsCount * sizeof(jthread)),
- (unsigned char**)&threadsList[i])))
+ if (!NSK_JVMTI_VERIFY(jvmti->Allocate(threadsCount * sizeof(jthread),
+ (unsigned char**)&threadsList[i])))
return NSK_FALSE;
for (j = 0; j < threadsCount; j++) {
@@ -172,8 +171,7 @@
}
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &allThreadsCount, &allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&allThreadsCount, &allThreadsList)))
return NSK_FALSE;
if (!NSK_VERIFY(allThreadsCount > 0 && allThreadsList != NULL))
@@ -187,8 +185,7 @@
return NSK_FALSE;
/* get thread name (info) */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, allThreadsList[i], &threadInfo)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(allThreadsList[i], &threadInfo)))
return NSK_FALSE;
/* find by name */
@@ -205,8 +202,7 @@
}
/* deallocate all threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)allThreadsList)))
return NSK_FALSE;
/* check if all tested threads found */
@@ -229,7 +225,7 @@
for (i = 0; i < THREADS_KINDS; i++) {
for (j = 0; j < threadsCount; j++) {
if (!NSK_JNI_VERIFY(jni, (threadsList[i][j] =
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsList[i][j])) != NULL))
+ jni->NewGlobalRef(threadsList[i][j])) != NULL))
return NSK_FALSE;
}
}
@@ -247,8 +243,7 @@
int i, j;
/* allocate results array */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(Allocate, jvmti, resultsSize, (unsigned char**)&results))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->Allocate(resultsSize, (unsigned char**)&results))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
@@ -256,14 +251,10 @@
for (i = 0; i < THREADS_KINDS; i++) {
/* suspend or resume threads list */
if (suspend) {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(SuspendThreadList, jvmti, threadsCount,
- threadsList[i], results)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThreadList(threadsCount, threadsList[i], results)))
nsk_jvmti_setFailStatus();
} else {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(ResumeThreadList, jvmti, threadsCount,
- threadsList[i], results)))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThreadList(threadsCount, threadsList[i], results)))
nsk_jvmti_setFailStatus();
}
@@ -280,8 +271,7 @@
}
/* deallocate results array */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)results))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)results))) {
nsk_jvmti_setFailStatus();
}
@@ -298,13 +288,11 @@
for (j = 0; j < threadsCount; j++) {
if (suspend) {
NSK_DISPLAY2(" suspend thread #%d (%s)\n", j, threadsName[i]);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SuspendThread, jvmti, threadsList[i][j])))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(threadsList[i][j])))
nsk_jvmti_setFailStatus();
} else {
NSK_DISPLAY2(" resume thread #%d (%s)\n", j, threadsName[i]);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(ResumeThread, jvmti, threadsList[i][j])))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(threadsList[i][j])))
nsk_jvmti_setFailStatus();
}
}
@@ -332,8 +320,7 @@
NSK_DISPLAY2(" thread #%d (%s):\n", j, threadsName[i]);
/* get thread state */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadState, jvmti, threadsList[i][j], &state))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(threadsList[i][j], &state))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
@@ -376,14 +363,13 @@
/* dispose global references to threads */
for (i = 0; i < THREADS_KINDS; i++) {
for (j = 0; j < threadsCount; j++) {
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsList[i][j]));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsList[i][j]));
}
}
/* deallocate memory */
for (i = 0; i < THREADS_KINDS; i++) {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threadsList[i])))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threadsList[i])))
return NSK_FALSE;
threadsList[i] = NULL;
}
@@ -468,8 +454,7 @@
jvmtiCapabilities suspendCaps;
memset(&suspendCaps, 0, sizeof(suspendCaps));
suspendCaps.can_suspend = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP04/sp04t001/sp04t001.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP04/sp04t001/sp04t001.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -158,9 +158,8 @@
threadsCounts[i] = 0;
threadsList[i] = NULL;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(Allocate, jvmti, (threadsCount * sizeof(jthread)),
- (unsigned char**)&threadsList[i])))
+ if (!NSK_JVMTI_VERIFY(jvmti->Allocate(threadsCount * sizeof(jthread),
+ (unsigned char**)&threadsList[i])))
return NSK_FALSE;
for (j = 0; j < threadsCount; j++) {
@@ -169,8 +168,7 @@
}
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &allThreadsCount, &allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&allThreadsCount, &allThreadsList)))
return NSK_FALSE;
if (!NSK_VERIFY(allThreadsCount > 0 && allThreadsList != NULL))
@@ -184,8 +182,7 @@
return NSK_FALSE;
/* get thread name (info) */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, allThreadsList[i], &threadInfo)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(allThreadsList[i], &threadInfo)))
return NSK_FALSE;
/* find by name */
@@ -202,8 +199,7 @@
}
/* deallocate all threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)allThreadsList)))
return NSK_FALSE;
/* check if all tested threads found */
@@ -226,7 +222,7 @@
for (i = 0; i < THREADS_KINDS; i++) {
for (j = 0; j < threadsCount; j++) {
if (!NSK_JNI_VERIFY(jni, (threadsList[i][j] =
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsList[i][j])) != NULL))
+ jni->NewGlobalRef(threadsList[i][j])) != NULL))
return NSK_FALSE;
}
}
@@ -244,8 +240,7 @@
int i, j;
/* allocate results array */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(Allocate, jvmti, resultsSize, (unsigned char**)&results))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->Allocate(resultsSize, (unsigned char**)&results))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
@@ -253,14 +248,10 @@
for (i = 0; i < THREADS_KINDS; i++) {
/* suspend or resume threads list */
if (suspend) {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(SuspendThreadList, jvmti, threadsCount,
- threadsList[i], results)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThreadList(threadsCount, threadsList[i], results)))
nsk_jvmti_setFailStatus();
} else {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(ResumeThreadList, jvmti, threadsCount,
- threadsList[i], results)))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThreadList(threadsCount, threadsList[i], results)))
nsk_jvmti_setFailStatus();
}
@@ -277,8 +268,7 @@
}
/* deallocate results array */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)results))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)results))) {
nsk_jvmti_setFailStatus();
}
@@ -295,13 +285,11 @@
for (j = 0; j < threadsCount; j++) {
if (suspend) {
NSK_DISPLAY2(" suspend thread #%d (%s)\n", j, threadsName[i]);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SuspendThread, jvmti, threadsList[i][j])))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(threadsList[i][j])))
nsk_jvmti_setFailStatus();
} else {
NSK_DISPLAY2(" resume thread #%d (%s)\n", j, threadsName[i]);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(ResumeThread, jvmti, threadsList[i][j])))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(threadsList[i][j])))
nsk_jvmti_setFailStatus();
}
}
@@ -329,8 +317,7 @@
NSK_DISPLAY2(" thread #%d (%s):\n", j, threadsName[i]);
/* get thread state */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadState, jvmti, threadsList[i][j], &state))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(threadsList[i][j], &state))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
@@ -373,14 +360,13 @@
/* dispose global references to threads */
for (i = 0; i < THREADS_KINDS; i++) {
for (j = 0; j < threadsCount; j++) {
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsList[i][j]));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsList[i][j]));
}
}
/* deallocate memory */
for (i = 0; i < THREADS_KINDS; i++) {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threadsList[i])))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threadsList[i])))
return NSK_FALSE;
threadsList[i] = NULL;
}
@@ -465,8 +451,7 @@
jvmtiCapabilities suspendCaps;
memset(&suspendCaps, 0, sizeof(suspendCaps));
suspendCaps.can_suspend = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP04/sp04t002/sp04t002.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP04/sp04t002/sp04t002.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -158,9 +158,8 @@
threadsCounts[i] = 0;
threadsList[i] = NULL;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(Allocate, jvmti, (threadsCount * sizeof(jthread)),
- (unsigned char**)&threadsList[i])))
+ if (!NSK_JVMTI_VERIFY(jvmti->Allocate(threadsCount * sizeof(jthread),
+ (unsigned char**)&threadsList[i])))
return NSK_FALSE;
for (j = 0; j < threadsCount; j++) {
@@ -169,8 +168,7 @@
}
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &allThreadsCount, &allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&allThreadsCount, &allThreadsList)))
return NSK_FALSE;
if (!NSK_VERIFY(allThreadsCount > 0 && allThreadsList != NULL))
@@ -184,8 +182,7 @@
return NSK_FALSE;
/* get thread name (info) */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, allThreadsList[i], &threadInfo)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(allThreadsList[i], &threadInfo)))
return NSK_FALSE;
/* find by name */
@@ -202,8 +199,7 @@
}
/* deallocate all threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)allThreadsList)))
return NSK_FALSE;
/* check if all tested threads found */
@@ -226,7 +222,7 @@
for (i = 0; i < THREADS_KINDS; i++) {
for (j = 0; j < threadsCount; j++) {
if (!NSK_JNI_VERIFY(jni, (threadsList[i][j] =
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsList[i][j])) != NULL))
+ jni->NewGlobalRef(threadsList[i][j])) != NULL))
return NSK_FALSE;
}
}
@@ -244,8 +240,7 @@
int i, j;
/* allocate results array */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(Allocate, jvmti, resultsSize, (unsigned char**)&results))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->Allocate(resultsSize, (unsigned char**)&results))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
@@ -253,14 +248,10 @@
for (i = 0; i < THREADS_KINDS; i++) {
/* suspend or resume threads list */
if (suspend) {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(SuspendThreadList, jvmti, threadsCount,
- threadsList[i], results)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThreadList(threadsCount, threadsList[i], results)))
nsk_jvmti_setFailStatus();
} else {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(ResumeThreadList, jvmti, threadsCount,
- threadsList[i], results)))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThreadList(threadsCount, threadsList[i], results)))
nsk_jvmti_setFailStatus();
}
@@ -277,8 +268,7 @@
}
/* deallocate results array */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)results))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)results))) {
nsk_jvmti_setFailStatus();
}
@@ -295,13 +285,11 @@
for (j = 0; j < threadsCount; j++) {
if (suspend) {
NSK_DISPLAY2(" suspend thread #%d (%s)\n", j, threadsName[i]);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SuspendThread, jvmti, threadsList[i][j])))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(threadsList[i][j])))
nsk_jvmti_setFailStatus();
} else {
NSK_DISPLAY2(" resume thread #%d (%s)\n", j, threadsName[i]);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(ResumeThread, jvmti, threadsList[i][j])))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(threadsList[i][j])))
nsk_jvmti_setFailStatus();
}
}
@@ -329,8 +317,7 @@
NSK_DISPLAY2(" thread #%d (%s):\n", j, threadsName[i]);
/* get thread state */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadState, jvmti, threadsList[i][j], &state))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(threadsList[i][j], &state))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
@@ -373,14 +360,13 @@
/* dispose global references to threads */
for (i = 0; i < THREADS_KINDS; i++) {
for (j = 0; j < threadsCount; j++) {
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsList[i][j]));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsList[i][j]));
}
}
/* deallocate memory */
for (i = 0; i < THREADS_KINDS; i++) {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threadsList[i])))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threadsList[i])))
return NSK_FALSE;
threadsList[i] = NULL;
}
@@ -465,8 +451,7 @@
jvmtiCapabilities suspendCaps;
memset(&suspendCaps, 0, sizeof(suspendCaps));
suspendCaps.can_suspend = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP05/sp05t002/sp05t002.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP05/sp05t002/sp05t002.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -143,9 +143,7 @@
int i;
for (i = 0; i < EVENTS_COUNT; i++) {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(SetEventNotificationMode, jvmti, enable,
- eventsList[i], NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(enable, eventsList[i], NULL))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
@@ -168,37 +166,35 @@
jsize i;
/* find debugee class */
- if (!NSK_JNI_VERIFY(jni, (debugeeClass =
- NSK_CPP_STUB2(FindClass, jni, DEBUGEE_CLASS_NAME)) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (debugeeClass = jni->FindClass(DEBUGEE_CLASS_NAME)) != NULL))
return NSK_FALSE;
/* find static field with threads array */
if (!NSK_JNI_VERIFY(jni, (threadsFieldID =
- NSK_CPP_STUB4(GetStaticFieldID, jni, debugeeClass,
- THREADS_FIELD_NAME, THREADS_FIELD_SIG)) != NULL))
+ jni->GetStaticFieldID(debugeeClass, THREADS_FIELD_NAME, THREADS_FIELD_SIG)) != NULL))
return NSK_FALSE;
/* get threads array from static field */
if (!NSK_JNI_VERIFY(jni, (threadsArray = (jobjectArray)
- NSK_CPP_STUB3(GetStaticObjectField, jni, debugeeClass, threadsFieldID)) != NULL))
+ jni->GetStaticObjectField(debugeeClass, threadsFieldID)) != NULL))
return NSK_FALSE;
/* check array length */
if (!NSK_JNI_VERIFY(jni, (threadsArrayLength =
- NSK_CPP_STUB2(GetArrayLength, jni, threadsArray)) == THREADS_COUNT))
+ jni->GetArrayLength(threadsArray)) == THREADS_COUNT))
return NSK_FALSE;
/* get each thread from array */
for (i = 0; i < THREADS_COUNT; i++) {
if (!NSK_JNI_VERIFY(jni, (threadsList[i] = (jthread)
- NSK_CPP_STUB3(GetObjectArrayElement, jni, threadsArray, i)) != NULL))
+ jni->GetObjectArrayElement(threadsArray, i)) != NULL))
return NSK_FALSE;
}
/* make global references to threads */
for (i = 0; i < THREADS_COUNT; i++) {
if (!NSK_JNI_VERIFY(jni, (threadsList[i] = (jthread)
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsList[i])) != NULL))
+ jni->NewGlobalRef(threadsList[i])) != NULL))
return NSK_FALSE;
}
@@ -218,8 +214,7 @@
NSK_DISPLAY3(" thread #%d (%s): %p\n", i, threadsName[i], (void*)thread);
/* get frames count */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetFrameCount, jvmti, thread, &framesCount))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetFrameCount(thread, &framesCount))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -227,8 +222,7 @@
/* get stack frames */
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB6(GetStackTrace, jvmti, thread, 0, MAX_STACK_DEPTH,
- stackFrames, &stackDepth))) {
+ jvmti->GetStackTrace(thread, 0, MAX_STACK_DEPTH, stackFrames, &stackDepth))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -269,7 +263,7 @@
/* dispose global references to threads */
for (i = 0; i < THREADS_COUNT; i++) {
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsList[i]));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsList[i]));
}
return NSK_TRUE;
@@ -293,7 +287,7 @@
/* check if event is for tested thread */
for (i = 0; i < THREADS_COUNT; i++) {
- if (NSK_CPP_STUB3(IsSameObject, jni, threadsList[i], thread)) {
+ if (jni->IsSameObject(threadsList[i], thread)) {
NSK_DISPLAY0("SUCCESS: expected THREAD_START event\n");
eventsStart++;
@@ -320,7 +314,7 @@
/* check if event is for tested thread */
for (i = 0; i < THREADS_COUNT; i++) {
- if (NSK_CPP_STUB3(IsSameObject, jni, threadsList[i], thread)) {
+ if (jni->IsSameObject(threadsList[i], thread)) {
NSK_DISPLAY0("SUCCESS: expected THREAD_START event\n");
eventsEnd++;
@@ -403,9 +397,7 @@
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
eventCallbacks.ThreadStart = callbackThreadStart;
eventCallbacks.ThreadEnd = callbackThreadEnd;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti,
- &eventCallbacks, sizeof(eventCallbacks))))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))))
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP05/sp05t003/sp05t003.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP05/sp05t003/sp05t003.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -100,8 +100,7 @@
{
eventsStart = 0;
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_ENABLE,
- JVMTI_EVENT_THREAD_START, NULL))) {
+ jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_THREAD_START, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -122,8 +121,7 @@
}
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_DISABLE,
- JVMTI_EVENT_THREAD_START, NULL))) {
+ jvmti->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_THREAD_START, NULL))) {
nsk_jvmti_setFailStatus();
}
@@ -152,8 +150,7 @@
{
eventsEnd = 0;
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_ENABLE,
- JVMTI_EVENT_THREAD_END, NULL))) {
+ jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_THREAD_END, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -174,8 +171,7 @@
}
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_DISABLE,
- JVMTI_EVENT_THREAD_END, NULL))) {
+ jvmti->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_THREAD_END, NULL))) {
nsk_jvmti_setFailStatus();
}
@@ -221,8 +217,7 @@
int i;
for (i = 0; i < THREADS_COUNT; i++) {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(ResumeThread, jvmti, threadsList[i]))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(threadsList[i]))) {
nsk_jvmti_setFailStatus();
}
}
@@ -243,37 +238,35 @@
jsize i;
/* find debugee class */
- if (!NSK_JNI_VERIFY(jni, (debugeeClass =
- NSK_CPP_STUB2(FindClass, jni, DEBUGEE_CLASS_NAME)) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (debugeeClass = jni->FindClass(DEBUGEE_CLASS_NAME)) != NULL))
return NSK_FALSE;
/* find static field with threads array */
if (!NSK_JNI_VERIFY(jni, (threadsFieldID =
- NSK_CPP_STUB4(GetStaticFieldID, jni, debugeeClass,
- THREADS_FIELD_NAME, THREADS_FIELD_SIG)) != NULL))
+ jni->GetStaticFieldID(debugeeClass, THREADS_FIELD_NAME, THREADS_FIELD_SIG)) != NULL))
return NSK_FALSE;
/* get threads array from static field */
if (!NSK_JNI_VERIFY(jni, (threadsArray = (jobjectArray)
- NSK_CPP_STUB3(GetStaticObjectField, jni, debugeeClass, threadsFieldID)) != NULL))
+ jni->GetStaticObjectField(debugeeClass, threadsFieldID)) != NULL))
return NSK_FALSE;
/* check array length */
if (!NSK_JNI_VERIFY(jni, (threadsArrayLength =
- NSK_CPP_STUB2(GetArrayLength, jni, threadsArray)) == THREADS_COUNT))
+ jni->GetArrayLength(threadsArray)) == THREADS_COUNT))
return NSK_FALSE;
/* get each thread from array */
for (i = 0; i < THREADS_COUNT; i++) {
if (!NSK_JNI_VERIFY(jni, (threadsList[i] = (jthread)
- NSK_CPP_STUB3(GetObjectArrayElement, jni, threadsArray, i)) != NULL))
+ jni->GetObjectArrayElement(threadsArray, i)) != NULL))
return NSK_FALSE;
}
/* make global references to threads */
for (i = 0; i < THREADS_COUNT; i++) {
if (!NSK_JNI_VERIFY(jni, (threadsList[i] = (jthread)
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsList[i])) != NULL))
+ jni->NewGlobalRef(threadsList[i])) != NULL))
return NSK_FALSE;
}
@@ -293,8 +286,7 @@
NSK_DISPLAY3(" thread #%d (%s): %p\n", i, threadsName[i], (void*)thread);
/* get frames count */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetFrameCount, jvmti, thread, &framesCount))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetFrameCount(thread, &framesCount))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -302,8 +294,7 @@
/* get stack frames */
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB6(GetStackTrace, jvmti, thread, 0, MAX_STACK_DEPTH,
- stackFrames, &stackDepth))) {
+ jvmti->GetStackTrace(thread, 0, MAX_STACK_DEPTH, stackFrames, &stackDepth))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -355,7 +346,7 @@
/* dispose global references to threads */
for (i = 0; i < THREADS_COUNT; i++) {
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsList[i]));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsList[i]));
}
return NSK_TRUE;
@@ -379,15 +370,14 @@
/* check if event is for tested thread */
for (i = 0; i < THREADS_COUNT; i++) {
- if (NSK_CPP_STUB3(IsSameObject, jni, threadsList[i], thread)) {
+ if (jni->IsSameObject(threadsList[i], thread)) {
NSK_DISPLAY0("SUCCESS: expected THREAD_START event\n");
/* suspend thread */
NSK_DISPLAY3(" suspend starting thread #%d (%s): %p\n",
i, threadsName[i], (void*)thread);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SuspendThread, jvmti, thread))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(thread))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -414,15 +404,14 @@
/* check if event is for tested thread */
for (i = 0; i < THREADS_COUNT; i++) {
- if (NSK_CPP_STUB3(IsSameObject, jni, threadsList[i], thread)) {
+ if (jni->IsSameObject(threadsList[i], thread)) {
NSK_DISPLAY0("SUCCESS: expected THREAD_END event\n");
/* suspend thread */
NSK_DISPLAY3(" suspend finishing thread #%d (%s): %p\n",
i, threadsName[i], (void*)thread);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SuspendThread, jvmti, thread))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(thread))) {
nsk_jvmti_setFailStatus();
return;
}
@@ -504,8 +493,7 @@
jvmtiCapabilities suspendCaps;
memset(&suspendCaps, 0, sizeof(suspendCaps));
suspendCaps.can_suspend = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
return JNI_ERR;
}
@@ -515,9 +503,7 @@
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
eventCallbacks.ThreadStart = callbackThreadStart;
eventCallbacks.ThreadEnd = callbackThreadEnd;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti,
- &eventCallbacks, sizeof(eventCallbacks))))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))))
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP06/sp06t001/sp06t001.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP06/sp06t001/sp06t001.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -135,8 +135,7 @@
* Generate missed events (COMPILED_METHOD_LOAD only).
*/
static int generateEvents() {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(GenerateEvents, jvmti, JVMTI_EVENT_COMPILED_METHOD_LOAD))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GenerateEvents(JVMTI_EVENT_COMPILED_METHOD_LOAD))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
@@ -168,8 +167,7 @@
}
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &allThreadsCount, &allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&allThreadsCount, &allThreadsList)))
return NSK_FALSE;
if (!NSK_VERIFY(allThreadsCount > 0 && allThreadsList != NULL))
@@ -182,8 +180,7 @@
if (!NSK_VERIFY(allThreadsList[i] != NULL))
return NSK_FALSE;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, allThreadsList[i], &threadInfo)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(allThreadsList[i], &threadInfo)))
return NSK_FALSE;
if (threadInfo.name != NULL) {
@@ -200,8 +197,7 @@
}
/* deallocate all threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)allThreadsList)))
return NSK_FALSE;
/* check if all tested threads found */
@@ -222,12 +218,11 @@
for (i = 0; i < THREADS_COUNT; i++) {
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].cls =
- NSK_CPP_STUB2(GetObjectClass, jni, threadsDesc[i].thread)) != NULL))
+ jni->GetObjectClass(threadsDesc[i].thread)) != NULL))
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].method =
- NSK_CPP_STUB4(GetMethodID, jni, threadsDesc[i].cls,
- threadsDesc[i].methodName, threadsDesc[i].methodSig)) != NULL))
+ jni->GetMethodID(threadsDesc[i].cls, threadsDesc[i].methodName, threadsDesc[i].methodSig)) != NULL))
return NSK_FALSE;
NSK_DISPLAY4(" thread #%d (%s): 0x%p (%s)\n",
@@ -239,10 +234,10 @@
/* make global refs */
for (i = 0; i < THREADS_COUNT; i++) {
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].thread = (jthread)
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsDesc[i].thread)) != NULL))
+ jni->NewGlobalRef(threadsDesc[i].thread)) != NULL))
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].cls = (jclass)
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsDesc[i].cls)) != NULL))
+ jni->NewGlobalRef(threadsDesc[i].cls)) != NULL))
return NSK_FALSE;
}
@@ -262,13 +257,11 @@
for (i = 0; i < THREADS_COUNT; i++) {
if (suspend) {
NSK_DISPLAY2(" suspend thread #%d (%s)\n", i, threadsDesc[i].threadName);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SuspendThread, jvmti, threadsDesc[i].thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(threadsDesc[i].thread)))
nsk_jvmti_setFailStatus();
} else {
NSK_DISPLAY2(" resume thread #%d (%s)\n", i, threadsDesc[i].threadName);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(ResumeThread, jvmti, threadsDesc[i].thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(threadsDesc[i].thread)))
nsk_jvmti_setFailStatus();
}
}
@@ -300,9 +293,7 @@
NSK_DISPLAY2(" thread #%d (%s):\n", i, threadsDesc[i].threadName);
/* get frame count */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetFrameCount, jvmti,
- threadsDesc[i].thread, &frameCount))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetFrameCount(threadsDesc[i].thread, &frameCount))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -311,8 +302,7 @@
/* get stack trace */
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB6(GetStackTrace, jvmti, threadsDesc[i].thread,
- 0, MAX_STACK_SIZE, frameStack, &frameStackSize))) {
+ jvmti->GetStackTrace(threadsDesc[i].thread, 0, MAX_STACK_SIZE, frameStack, &frameStackSize))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -358,8 +348,8 @@
NSK_DISPLAY0("Dispose global references to threads\n");
for (i = 0; i < THREADS_COUNT; i++) {
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsDesc[i].thread));
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsDesc[i].cls));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsDesc[i].thread));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsDesc[i].cls));
}
return NSK_TRUE;
@@ -492,8 +482,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_suspend = 1;
caps.can_generate_compiled_method_load_events = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
return JNI_ERR;
}
@@ -502,9 +491,7 @@
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
eventCallbacks.CompiledMethodLoad = callbackCompiledMethodLoad;
eventCallbacks.CompiledMethodUnload = callbackCompiledMethodUnload;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti,
- &eventCallbacks, sizeof(eventCallbacks))))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))))
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP06/sp06t002/sp06t002.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP06/sp06t002/sp06t002.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -143,8 +143,7 @@
* Generate missed events (COMPILED_METHOD_LOAD only).
*/
static int generateEvents() {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(GenerateEvents, jvmti, JVMTI_EVENT_COMPILED_METHOD_LOAD))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GenerateEvents(JVMTI_EVENT_COMPILED_METHOD_LOAD))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
@@ -177,8 +176,7 @@
}
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &allThreadsCount, &allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&allThreadsCount, &allThreadsList)))
return NSK_FALSE;
if (!NSK_VERIFY(allThreadsCount > 0 && allThreadsList != NULL))
@@ -191,8 +189,7 @@
if (!NSK_VERIFY(allThreadsList[i] != NULL))
return NSK_FALSE;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, allThreadsList[i], &threadInfo)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(allThreadsList[i], &threadInfo)))
return NSK_FALSE;
if (threadInfo.name != NULL) {
@@ -209,8 +206,7 @@
}
/* deallocate all threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)allThreadsList)))
return NSK_FALSE;
/* check if all tested threads found */
@@ -231,12 +227,11 @@
for (i = 0; i < THREADS_COUNT; i++) {
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].cls =
- NSK_CPP_STUB2(GetObjectClass, jni, threadsDesc[i].thread)) != NULL))
+ jni->GetObjectClass(threadsDesc[i].thread)) != NULL))
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].method =
- NSK_CPP_STUB4(GetMethodID, jni, threadsDesc[i].cls,
- threadsDesc[i].methodName, threadsDesc[i].methodSig)) != NULL))
+ jni->GetMethodID(threadsDesc[i].cls, threadsDesc[i].methodName, threadsDesc[i].methodSig)) != NULL))
return NSK_FALSE;
NSK_DISPLAY4(" thread #%d (%s): 0x%p (%s)\n",
@@ -248,10 +243,10 @@
/* make global refs */
for (i = 0; i < THREADS_COUNT; i++) {
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].thread = (jthread)
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsDesc[i].thread)) != NULL))
+ jni->NewGlobalRef(threadsDesc[i].thread)) != NULL))
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].cls = (jclass)
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsDesc[i].cls)) != NULL))
+ jni->NewGlobalRef(threadsDesc[i].cls)) != NULL))
return NSK_FALSE;
}
@@ -271,13 +266,11 @@
for (i = 0; i < THREADS_COUNT; i++) {
if (suspend) {
NSK_DISPLAY2(" suspend thread #%d (%s)\n", i, threadsDesc[i].threadName);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SuspendThread, jvmti, threadsDesc[i].thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(threadsDesc[i].thread)))
nsk_jvmti_setFailStatus();
} else {
NSK_DISPLAY2(" resume thread #%d (%s)\n", i, threadsDesc[i].threadName);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(ResumeThread, jvmti, threadsDesc[i].thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(threadsDesc[i].thread)))
nsk_jvmti_setFailStatus();
}
}
@@ -310,9 +303,7 @@
NSK_DISPLAY2(" thread #%d (%s):\n", i, threadsDesc[i].threadName);
/* get frame count */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetFrameCount, jvmti,
- threadsDesc[i].thread, &frameCount))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetFrameCount(threadsDesc[i].thread, &frameCount))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -321,8 +312,7 @@
/* get stack trace */
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB6(GetStackTrace, jvmti, threadsDesc[i].thread,
- 0, MAX_STACK_SIZE, frameStack, &frameStackSize))) {
+ jvmti->GetStackTrace(threadsDesc[i].thread, 0, MAX_STACK_SIZE, frameStack, &frameStackSize))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -387,8 +377,8 @@
NSK_DISPLAY0("Dispose global references to threads\n");
for (i = 0; i < THREADS_COUNT; i++) {
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsDesc[i].thread));
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsDesc[i].cls));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsDesc[i].thread));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsDesc[i].cls));
}
return NSK_TRUE;
@@ -521,8 +511,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_suspend = 1;
caps.can_generate_compiled_method_load_events = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
return JNI_ERR;
}
@@ -531,9 +520,7 @@
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
eventCallbacks.CompiledMethodLoad = callbackCompiledMethodLoad;
eventCallbacks.CompiledMethodUnload = callbackCompiledMethodUnload;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti,
- &eventCallbacks, sizeof(eventCallbacks))))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))))
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP06/sp06t003/sp06t003.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP06/sp06t003/sp06t003.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -143,8 +143,7 @@
* Generate missed events (COMPILED_METHOD_LOAD only).
*/
static int generateEvents() {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(GenerateEvents, jvmti, JVMTI_EVENT_COMPILED_METHOD_LOAD))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GenerateEvents(JVMTI_EVENT_COMPILED_METHOD_LOAD))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
@@ -177,8 +176,7 @@
}
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &allThreadsCount, &allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&allThreadsCount, &allThreadsList)))
return NSK_FALSE;
if (!NSK_VERIFY(allThreadsCount > 0 && allThreadsList != NULL))
@@ -191,8 +189,7 @@
if (!NSK_VERIFY(allThreadsList[i] != NULL))
return NSK_FALSE;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, allThreadsList[i], &threadInfo)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(allThreadsList[i], &threadInfo)))
return NSK_FALSE;
if (threadInfo.name != NULL) {
@@ -209,8 +206,7 @@
}
/* deallocate all threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)allThreadsList)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)allThreadsList)))
return NSK_FALSE;
/* check if all tested threads found */
@@ -231,12 +227,11 @@
for (i = 0; i < THREADS_COUNT; i++) {
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].cls =
- NSK_CPP_STUB2(GetObjectClass, jni, threadsDesc[i].thread)) != NULL))
+ jni->GetObjectClass(threadsDesc[i].thread)) != NULL))
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].method =
- NSK_CPP_STUB4(GetMethodID, jni, threadsDesc[i].cls,
- threadsDesc[i].methodName, threadsDesc[i].methodSig)) != NULL))
+ jni->GetMethodID(threadsDesc[i].cls, threadsDesc[i].methodName, threadsDesc[i].methodSig)) != NULL))
return NSK_FALSE;
NSK_DISPLAY4(" thread #%d (%s): 0x%p (%s)\n",
@@ -248,10 +243,10 @@
/* make global refs */
for (i = 0; i < THREADS_COUNT; i++) {
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].thread = (jthread)
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsDesc[i].thread)) != NULL))
+ jni->NewGlobalRef(threadsDesc[i].thread)) != NULL))
return NSK_FALSE;
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].cls = (jclass)
- NSK_CPP_STUB2(NewGlobalRef, jni, threadsDesc[i].cls)) != NULL))
+ jni->NewGlobalRef(threadsDesc[i].cls)) != NULL))
return NSK_FALSE;
}
@@ -271,13 +266,11 @@
for (i = 0; i < THREADS_COUNT; i++) {
if (suspend) {
NSK_DISPLAY2(" suspend thread #%d (%s)\n", i, threadsDesc[i].threadName);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(SuspendThread, jvmti, threadsDesc[i].thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(threadsDesc[i].thread)))
nsk_jvmti_setFailStatus();
} else {
NSK_DISPLAY2(" resume thread #%d (%s)\n", i, threadsDesc[i].threadName);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(ResumeThread, jvmti, threadsDesc[i].thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(threadsDesc[i].thread)))
nsk_jvmti_setFailStatus();
}
}
@@ -312,9 +305,7 @@
NSK_DISPLAY2(" thread #%d (%s):\n", i, threadsDesc[i].threadName);
/* get frame count */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetFrameCount, jvmti,
- threadsDesc[i].thread, &frameCount))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetFrameCount(threadsDesc[i].thread, &frameCount))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -322,8 +313,7 @@
/* get stack trace */
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB6(GetStackTrace, jvmti, threadsDesc[i].thread,
- 0, MAX_STACK_SIZE, frameStack, &frameStackSize))) {
+ jvmti->GetStackTrace(threadsDesc[i].thread, 0, MAX_STACK_SIZE, frameStack, &frameStackSize))) {
nsk_jvmti_setFailStatus();
return NSK_TRUE;
}
@@ -343,8 +333,7 @@
(long)frameStack[j].location);
/* query frame location */
if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB5(GetFrameLocation, jvmti, threadsDesc[i].thread,
- j, &qMethod, &qLocation))) {
+ jvmti->GetFrameLocation(threadsDesc[i].thread, j, &qMethod, &qLocation))) {
nsk_jvmti_setFailStatus();
continue;
}
@@ -404,8 +393,8 @@
NSK_DISPLAY0("Dispose global references to threads\n");
for (i = 0; i < THREADS_COUNT; i++) {
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsDesc[i].thread));
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsDesc[i].cls));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsDesc[i].thread));
+ NSK_TRACE(jni->DeleteGlobalRef(threadsDesc[i].cls));
}
return NSK_TRUE;
@@ -538,8 +527,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_suspend = 1;
caps.can_generate_compiled_method_load_events = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
return JNI_ERR;
}
@@ -548,9 +536,7 @@
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
eventCallbacks.CompiledMethodLoad = callbackCompiledMethodLoad;
eventCallbacks.CompiledMethodUnload = callbackCompiledMethodUnload;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti,
- &eventCallbacks, sizeof(eventCallbacks))))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))))
return JNI_ERR;
}
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t001/sp07t001.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t001/sp07t001.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -62,8 +62,7 @@
NSK_DISPLAY0("Prepare: find tested thread\n");
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &threads_count, &threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&threads_count, &threads)))
return NSK_FALSE;
if (!NSK_VERIFY(threads_count > 0 && threads != NULL))
@@ -75,8 +74,7 @@
return NSK_FALSE;
/* get thread information */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, threads[i], &info)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(threads[i], &info)))
return NSK_FALSE;
NSK_DISPLAY3(" thread #%d (%s): %p\n", i, info.name, threads[i]);
@@ -87,15 +85,13 @@
}
if (info.name != NULL) {
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(
- Deallocate, jvmti, (unsigned char*)info.name)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)info.name)))
return NSK_FALSE;
}
}
/* deallocate threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
return NSK_FALSE;
if (thread == NULL) {
@@ -103,8 +99,7 @@
return NSK_FALSE;
}
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(CreateRawMonitor, jvmti, "waitLock", &waitLock)))
+ if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("waitLock", &waitLock)))
return NSK_FALSE;
return NSK_TRUE;
@@ -114,14 +109,13 @@
static int wait_for(jvmtiEnv* jvmti, jlong millis) {
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, waitLock)))
+ if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(waitLock)))
return NSK_FALSE;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(RawMonitorWait, jvmti, waitLock, millis)))
+ if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorWait(waitLock, millis)))
nsk_jvmti_setFailStatus();
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, waitLock)))
+ if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(waitLock)))
return NSK_FALSE;
return NSK_TRUE;
@@ -132,27 +126,25 @@
char *name = NULL;
char *signature = NULL;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName, jvmti,
- frameBuffer[frameCount-1-i].method, &name, &signature, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetMethodName(frameBuffer[frameCount-1-i].method, &name, &signature, NULL)))
return NSK_FALSE;
NSK_DISPLAY4(" got[%d] method: %s%s, location: %s\n", i, name,
signature, jlong_to_string(frameBuffer[frameCount-1-i].location, buffer));
if (name != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)name);
+ jvmti->Deallocate((unsigned char*)name);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)signature);
+ jvmti->Deallocate((unsigned char*)signature);
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName, jvmti,
- sampleStack[i].method, &name, &signature, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetMethodName(sampleStack[i].method, &name, &signature, NULL)))
return NSK_FALSE;
NSK_DISPLAY4(" exp[%d] method: %s%s, location: %s\n", i, name,
signature, jlong_to_string(sampleStack[i].location, buffer));
if (name != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)name);
+ jvmti->Deallocate((unsigned char*)name);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)signature);
+ jvmti->Deallocate((unsigned char*)signature);
return NSK_TRUE;
}
@@ -162,27 +154,25 @@
char *name = NULL;
char *signature = NULL;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName, jvmti,
- frameBuffer[frameCount-1-i].method, &name, &signature, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetMethodName(frameBuffer[frameCount-1-i].method, &name, &signature, NULL)))
return NSK_FALSE;
NSK_COMPLAIN3(" got: method=%s%s, location=%s\n", name, signature,
jlong_to_string(frameBuffer[frameCount-1-i].location, buffer));
if (name != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)name);
+ jvmti->Deallocate((unsigned char*)name);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)signature);
+ jvmti->Deallocate((unsigned char*)signature);
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName, jvmti,
- sampleStack[i].method, &name, &signature, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetMethodName(sampleStack[i].method, &name, &signature, NULL)))
return NSK_FALSE;
NSK_COMPLAIN3(" expected: method=%s%s, location=%s\n", name, signature,
jlong_to_string(sampleStack[i].location, buffer));
if (name != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)name);
+ jvmti->Deallocate((unsigned char*)name);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)signature);
+ jvmti->Deallocate((unsigned char*)signature);
return NSK_TRUE;
}
@@ -193,13 +183,11 @@
int displayFlag =
(nsk_getVerboseMode() && (sampleCount % DISPLAYING_FREQUENCY) == 0);
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, frameLock)))
+ if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(frameLock)))
return NSK_FALSE;
/* get stack trace */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB6(GetStackTrace, jvmti, thread,
- 0, MAX_DEPTH, frameBuffer, &frameCount))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetStackTrace(thread, 0, MAX_DEPTH, frameBuffer, &frameCount))) {
res = NSK_FALSE;
} else {
if (displayFlag) {
@@ -228,7 +216,7 @@
}
}
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, frameLock)))
+ if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(frameLock)))
return NSK_FALSE;
return res;
@@ -278,49 +266,45 @@
return 0;
}
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, frameLock)))
+ if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(frameLock)))
return NSK_FALSE;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetFrameLocation, jvmti, NULL, 1,
- &sampleStack[depth].method, &sampleStack[depth].location))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetFrameLocation(NULL, 1, &sampleStack[depth].method, &sampleStack[depth].location))) {
nsk_jvmti_setFailStatus();
return 0;
}
depth++;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetFrameLocation, jvmti, NULL, 0,
- &sampleStack[depth].method, &sampleStack[depth].location))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetFrameLocation(NULL, 0, &sampleStack[depth].method, &sampleStack[depth].location))) {
nsk_jvmti_setFailStatus();
return 0;
}
depth++;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, frameLock)))
+ if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(frameLock)))
return NSK_FALSE;
- if (!NSK_JNI_VERIFY(jni, (klass = NSK_CPP_STUB2(GetObjectClass,
- jni, obj)) != NULL)) {
+ if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(obj)) != NULL)) {
nsk_jvmti_setFailStatus();
return 0;
}
- if (!NSK_JNI_VERIFY(jni, (method = NSK_CPP_STUB4(GetMethodID,
- jni, klass, "fibonacci", "(I)I")) != NULL)) {
+ if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "fibonacci", "(I)I")) != NULL)) {
nsk_jvmti_setFailStatus();
return 0;
}
- result = NSK_CPP_STUB4(CallIntMethod, jni, obj, method, i);
+ result = jni->CallIntMethod(obj, method, i);
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, frameLock)))
+ if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(frameLock)))
return NSK_FALSE;
depth--;
depth--;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, frameLock)))
+ if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(frameLock)))
return NSK_FALSE;
return result;
@@ -355,8 +339,7 @@
nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
return JNI_ERR;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(CreateRawMonitor, jvmti, "frameLock", &frameLock)))
+ if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("frameLock", &frameLock)))
return NSK_FALSE;
/* register agent proc and arg */
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t002/sp07t002.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t002/sp07t002.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -66,8 +66,7 @@
NSK_DISPLAY0("Prepare: find tested thread\n");
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &threads_count, &threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&threads_count, &threads)))
return NSK_FALSE;
if (!NSK_VERIFY(threads_count > 0 && threads != NULL))
@@ -79,8 +78,7 @@
return NSK_FALSE;
/* get thread information */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, threads[i], &info)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(threads[i], &info)))
return NSK_FALSE;
NSK_DISPLAY3(" thread #%d (%s): %p\n", i, info.name, threads[i]);
@@ -91,15 +89,13 @@
}
if (info.name != NULL) {
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(
- Deallocate, jvmti, (unsigned char*)info.name)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)info.name)))
return NSK_FALSE;
}
}
/* deallocate threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
return NSK_FALSE;
if (thread == NULL) {
@@ -108,41 +104,34 @@
}
/* get tested thread class */
- if (!NSK_JNI_VERIFY(jni, (klass =
- NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
return NSK_FALSE;
/* get tested thread field 'MAX_LADDER' */
- if (!NSK_JNI_VERIFY(jni, (fid =
- NSK_CPP_STUB4(GetStaticFieldID, jni, klass,
- "MAX_LADDER", "I")) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (fid = jni->GetStaticFieldID(klass, "MAX_LADDER", "I")) != NULL))
return NSK_FALSE;
- MAX_LADDER = NSK_CPP_STUB3(GetStaticIntField, jni, klass, fid);
+ MAX_LADDER = jni->GetStaticIntField(klass, fid);
NSK_DISPLAY1("MAX_LADDER: %d\n", MAX_LADDER);
/* get tested thread field 'depth' */
- if (!NSK_JNI_VERIFY(jni, (field =
- NSK_CPP_STUB4(GetFieldID, jni, klass, "depth", "I")) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (field = jni->GetFieldID(klass, "depth", "I")) != NULL))
return NSK_FALSE;
/* get tested thread method 'run' */
- if (!NSK_JNI_VERIFY(jni, (methodRun =
- NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (methodRun = jni->GetMethodID(klass, "run", "()V")) != NULL))
return NSK_FALSE;
/* get tested thread method 'catcher' */
if (!NSK_JNI_VERIFY(jni, (methodCatcher =
- NSK_CPP_STUB4(GetMethodID, jni, klass, "catcher", "(II)V")) != NULL))
+ jni->GetMethodID(klass, "catcher", "(II)V")) != NULL))
return NSK_FALSE;
/* get tested thread method 'thrower' */
- if (!NSK_JNI_VERIFY(jni, (methodThrower=
- NSK_CPP_STUB4(GetMethodID, jni, klass, "thrower", "(I)V")) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (methodThrower= jni->GetMethodID(klass, "thrower", "(I)V")) != NULL))
return NSK_FALSE;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(CreateRawMonitor, jvmti, "waitLock", &waitLock)))
+ if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("waitLock", &waitLock)))
return NSK_FALSE;
return NSK_TRUE;
@@ -152,14 +141,13 @@
static int wait_for(jvmtiEnv* jvmti, jlong millis) {
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, waitLock)))
+ if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(waitLock)))
return NSK_FALSE;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(RawMonitorWait, jvmti, waitLock, millis)))
+ if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorWait(waitLock, millis)))
nsk_jvmti_setFailStatus();
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, waitLock)))
+ if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(waitLock)))
return NSK_FALSE;
return NSK_TRUE;
@@ -170,16 +158,15 @@
char *name = NULL;
char *signature = NULL;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName, jvmti,
- frameBuffer[frameCount-1-i].method, &name, &signature, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetMethodName(frameBuffer[frameCount-1-i].method, &name, &signature, NULL)))
return NSK_FALSE;
NSK_DISPLAY4(" [%d] method: %s%s, location: %s\n", i, name,
signature, jlong_to_string(frameBuffer[frameCount-1-i].location, buffer));
if (name != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)name);
+ jvmti->Deallocate((unsigned char*)name);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)signature);
+ jvmti->Deallocate((unsigned char*)signature);
return NSK_TRUE;
}
@@ -189,19 +176,17 @@
char *name = NULL;
char *signature = NULL;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName, jvmti,
- frameBuffer[frameCount-1-i].method, &name, &signature, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetMethodName(frameBuffer[frameCount-1-i].method, &name, &signature, NULL)))
return NSK_FALSE;
NSK_COMPLAIN3(" got method: %s%s, location: %s\n", name, signature,
jlong_to_string(frameBuffer[frameCount-1-i].location, buffer));
if (name != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)name);
+ jvmti->Deallocate((unsigned char*)name);
if (signature != NULL)
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)signature);
+ jvmti->Deallocate((unsigned char*)signature);
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName, jvmti,
- method, &name, &signature, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetMethodName(method, &name, &signature, NULL)))
return NSK_FALSE;
NSK_COMPLAIN2(" expected method: %s%s\n", name, signature);
@@ -217,19 +202,17 @@
int displayFlag =
(nsk_getVerboseMode() && (sampleCount % DISPLAYING_FREQUENCY) == 0);
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(thread)))
return NSK_FALSE;
- depth = NSK_CPP_STUB3(GetIntField, jni, thread, field);
+ depth = jni->GetIntField(thread, field);
/* get stack trace */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB6(GetStackTrace, jvmti, thread,
- 0, MAX_DEPTH, frameBuffer, &frameCount))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetStackTrace(thread, 0, MAX_DEPTH, frameBuffer, &frameCount))) {
res = NSK_FALSE;
}
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(thread)))
res = NSK_FALSE;
if (res) {
@@ -322,7 +305,7 @@
memset(&caps, 0, sizeof(caps));
caps.can_suspend = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
return JNI_ERR;
/* register agent proc and arg */
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/BooleanArrayCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/BooleanArrayCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -23,6 +23,7 @@
#include <jni.h>
#include <stdio.h>
#include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
#include "jni_tools.h"
extern "C" {
@@ -35,7 +36,9 @@
* Signature: ([Z)Z
*/
JNIEXPORT jboolean JNICALL Java_nsk_share_gc_lock_jni_BooleanArrayCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+ ExceptionCheckingJniEnvPtr env(jni_env);
+
jsize size, i;
jbooleanArray arr;
jboolean *pa;
@@ -44,22 +47,11 @@
if (objFieldId == NULL) {
jclass klass = env->GetObjectClass(o);
- if (klass == NULL) {
- printf("Error: GetObjectClass returned NULL\n");
- return JNI_FALSE;
- }
objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
- if (objFieldId == NULL) {
- printf("Error: GetFieldID returned NULL\n");
- return JNI_FALSE;
- }
}
arr = (jbooleanArray) env->GetObjectField(o, objFieldId);
- if (arr == NULL) {
- printf("Error: GetObjectField returned NULL\n");
- return JNI_FALSE;
- }
env->SetObjectField(o, objFieldId, NULL);
+
size = env->GetArrayLength(arr);
start_time = time(NULL);
enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/ByteArrayCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/ByteArrayCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -23,6 +23,7 @@
#include <jni.h>
#include <stdio.h>
#include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
#include "jni_tools.h"
extern "C" {
@@ -34,7 +35,9 @@
* Method: criticalNative
*/
JNIEXPORT jbyte JNICALL Java_nsk_share_gc_lock_jni_ByteArrayCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+ ExceptionCheckingJniEnvPtr env(jni_env);
+
jsize size, i;
jbyteArray arr;
jbyte *pa;
@@ -43,22 +46,11 @@
if (objFieldId == NULL) {
jclass klass = env->GetObjectClass(o);
- if (klass == NULL) {
- printf("Error: GetObjectClass returned NULL\n");
- return 0;
- }
objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
- if (objFieldId == NULL) {
- printf("Error: GetFieldID returned NULL\n");
- return 0;
- }
}
arr = (jbyteArray) env->GetObjectField(o, objFieldId);
- if (arr == NULL) {
- printf("Error: GetObjectField returned NULL\n");
- return 0;
- }
env->SetObjectField(o, objFieldId, NULL);
+
size = env->GetArrayLength(arr);
start_time = time(NULL);
enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/CharArrayCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/CharArrayCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -23,6 +23,7 @@
#include <jni.h>
#include <stdio.h>
#include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
#include "jni_tools.h"
extern "C" {
@@ -35,7 +36,9 @@
* Signature: ([Z)Z
*/
JNIEXPORT jchar JNICALL Java_nsk_share_gc_lock_jni_CharArrayCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+ ExceptionCheckingJniEnvPtr env(jni_env);
+
jsize size, i;
jcharArray arr;
jchar *pa;
@@ -44,22 +47,11 @@
if (objFieldId == NULL) {
jclass klass = env->GetObjectClass(o);
- if (klass == NULL) {
- printf("Error: GetObjectClass returned NULL\n");
- return 0;
- }
objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
- if (objFieldId == NULL) {
- printf("Error: GetFieldID returned NULL\n");
- return 0;
- }
}
arr = (jcharArray) env->GetObjectField(o, objFieldId);
- if (arr == NULL) {
- printf("Error: GetObjectField returned NULL\n");
- return JNI_FALSE;
- }
env->SetObjectField(o, objFieldId, NULL);
+
size = env->GetArrayLength(arr);
start_time = time(NULL);
current_time = 0;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/DoubleArrayCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/DoubleArrayCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -23,6 +23,7 @@
#include <jni.h>
#include <stdio.h>
#include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
#include "jni_tools.h"
extern "C" {
@@ -35,7 +36,9 @@
* Signature: ([Z)Z
*/
JNIEXPORT jdouble JNICALL Java_nsk_share_gc_lock_jni_DoubleArrayCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+ ExceptionCheckingJniEnvPtr env(jni_env);
+
jsize size, i;
jdoubleArray arr;
jdouble *pa;
@@ -44,22 +47,11 @@
if (objFieldId == NULL) {
jclass klass = env->GetObjectClass(o);
- if (klass == NULL) {
- printf("Error: GetObjectClass returned NULL\n");
- return 0;
- }
objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
- if (objFieldId == NULL) {
- printf("Error: GetFieldID returned NULL\n");
- return 0;
- }
}
arr = (jdoubleArray) env->GetObjectField(o, objFieldId);
- if (arr == NULL) {
- printf("Error: GetObjectField returned NULL\n");
- return JNI_FALSE;
- }
env->SetObjectField(o, objFieldId, NULL);
+
size = env->GetArrayLength(arr);
start_time = time(NULL);
enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/FloatArrayCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/FloatArrayCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -23,6 +23,7 @@
#include <jni.h>
#include <stdio.h>
#include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
#include "jni_tools.h"
extern "C" {
@@ -35,7 +36,9 @@
* Signature: ([Z)Z
*/
JNIEXPORT jfloat JNICALL Java_nsk_share_gc_lock_jni_FloatArrayCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+ ExceptionCheckingJniEnvPtr env(jni_env);
+
jsize size, i;
jfloatArray arr;
jfloat *pa;
@@ -44,22 +47,11 @@
if (objFieldId == NULL) {
jclass klass = env->GetObjectClass(o);
- if (klass == NULL) {
- printf("Error: GetObjectClass returned NULL\n");
- return 0;
- }
objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
- if (objFieldId == NULL) {
- printf("Error: GetFieldID returned NULL\n");
- return 0;
- }
}
arr = (jfloatArray) env->GetObjectField(o, objFieldId);
- if (arr == NULL) {
- printf("Error: GetObjectField returned NULL\n");
- return JNI_FALSE;
- }
env->SetObjectField(o, objFieldId, NULL);
+
size = env->GetArrayLength(arr);
start_time = time(NULL);
enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/IntArrayCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/IntArrayCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -23,6 +23,7 @@
#include <jni.h>
#include <stdio.h>
#include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
#include "jni_tools.h"
extern "C" {
@@ -35,7 +36,9 @@
* Signature: ([Z)Z
*/
JNIEXPORT jint JNICALL Java_nsk_share_gc_lock_jni_IntArrayCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+ ExceptionCheckingJniEnvPtr env(jni_env);
+
jsize size, i;
jintArray arr;
jint *pa;
@@ -44,22 +47,11 @@
if (objFieldId == NULL) {
jclass klass = env->GetObjectClass(o);
- if (klass == NULL) {
- printf("Error: GetObjectClass returned NULL\n");
- return 0;
- }
objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
- if (objFieldId == NULL) {
- printf("Error: GetFieldID returned NULL\n");
- return 0;
- }
}
arr = (jintArray) env->GetObjectField(o, objFieldId);
- if (arr == NULL) {
- printf("Error: GetObjectField returned NULL\n");
- return JNI_FALSE;
- }
env->SetObjectField(o, objFieldId, NULL);
+
size = env->GetArrayLength(arr);
start_time = time(NULL);
enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/LongArrayCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/LongArrayCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -23,6 +23,7 @@
#include <jni.h>
#include <stdio.h>
#include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
#include "jni_tools.h"
extern "C" {
@@ -35,7 +36,9 @@
* Signature: ([Z)Z
*/
JNIEXPORT jlong JNICALL Java_nsk_share_gc_lock_jni_LongArrayCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+ ExceptionCheckingJniEnvPtr env(jni_env);
+
jsize size, i;
jlongArray arr;
jlong *pa;
@@ -44,22 +47,11 @@
if (objFieldId == NULL) {
jclass klass = env->GetObjectClass(o);
- if (klass == NULL) {
- printf("Error: GetObjectClass returned NULL\n");
- return 0;
- }
objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
- if (objFieldId == NULL) {
- printf("Error: GetFieldID returned NULL\n");
- return 0;
- }
}
arr = (jlongArray) env->GetObjectField(o, objFieldId);
- if (arr == NULL) {
- printf("Error: GetObjectField returned NULL\n");
- return JNI_FALSE;
- }
env->SetObjectField(o, objFieldId, NULL);
+
size = env->GetArrayLength(arr);
start_time = time(NULL);
enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/ShortArrayCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/ShortArrayCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -23,6 +23,7 @@
#include <jni.h>
#include <stdio.h>
#include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
#include "jni_tools.h"
extern "C" {
@@ -35,7 +36,9 @@
* Signature: ([Z)Z
*/
JNIEXPORT jshort JNICALL Java_nsk_share_gc_lock_jni_ShortArrayCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+ ExceptionCheckingJniEnvPtr env(jni_env);
+
jsize size, i;
jshortArray arr;
jshort *pa;
@@ -44,22 +47,11 @@
if (objFieldId == NULL) {
jclass klass = env->GetObjectClass(o);
- if (klass == NULL) {
- printf("Error: GetObjectClass returned NULL\n");
- return 0;
- }
objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
- if (objFieldId == NULL) {
- printf("Error: GetFieldID returned NULL\n");
- return 0;
- }
}
arr = (jshortArray) env->GetObjectField(o, objFieldId);
- if (arr == NULL) {
- printf("Error: GetObjectField returned NULL\n");
- return JNI_FALSE;
- }
env->SetObjectField(o, objFieldId, NULL);
+
size = env->GetArrayLength(arr);
start_time = time(NULL);
enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/StringCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/StringCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -23,6 +23,7 @@
#include <jni.h>
#include <stdio.h>
#include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
#include "jni_tools.h"
extern "C" {
@@ -35,7 +36,9 @@
* Signature: ([Z)Z
*/
JNIEXPORT jchar JNICALL Java_nsk_share_gc_lock_jni_StringCriticalLocker_criticalNative
-(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+(JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+ ExceptionCheckingJniEnvPtr env(jni_env);
+
jsize size, i;
jstring str;
const jchar *pa;
@@ -44,22 +47,11 @@
if (objFieldId == NULL) {
jclass klass = env->GetObjectClass(o);
- if (klass == NULL) {
- printf("Error: GetObjectClass returned NULL\n");
- return JNI_FALSE;
- }
objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
- if (objFieldId == NULL) {
- printf("Error: GetFieldID returned NULL\n");
- return JNI_FALSE;
- }
}
str = (jstring) env->GetObjectField(o, objFieldId);
- if (str == NULL) {
- printf("Error: GetObjectField returned NULL\n");
- return JNI_FALSE;
- }
env->SetObjectField(o, objFieldId, NULL);
+
size = env->GetStringLength(str);
start_time = time(NULL);
enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libBooleanArrayCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libBooleanArrayCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -22,5 +22,6 @@
*/
#include "BooleanArrayCriticalLocker.cpp"
+#include "ExceptionCheckingJniEnv.cpp"
#include "jni_tools.cpp"
#include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libByteArrayCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libByteArrayCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -22,5 +22,6 @@
*/
#include "ByteArrayCriticalLocker.cpp"
+#include "ExceptionCheckingJniEnv.cpp"
#include "jni_tools.cpp"
#include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libCharArrayCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libCharArrayCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -22,5 +22,6 @@
*/
#include "CharArrayCriticalLocker.cpp"
+#include "ExceptionCheckingJniEnv.cpp"
#include "jni_tools.cpp"
#include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libDoubleArrayCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libDoubleArrayCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -22,5 +22,6 @@
*/
#include "DoubleArrayCriticalLocker.cpp"
+#include "ExceptionCheckingJniEnv.cpp"
#include "jni_tools.cpp"
#include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libFloatArrayCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libFloatArrayCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -21,6 +21,7 @@
* questions.
*/
+#include "ExceptionCheckingJniEnv.cpp"
#include "FloatArrayCriticalLocker.cpp"
#include "jni_tools.cpp"
#include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libIntArrayCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libIntArrayCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -21,6 +21,7 @@
* questions.
*/
+#include "ExceptionCheckingJniEnv.cpp"
#include "IntArrayCriticalLocker.cpp"
#include "jni_tools.cpp"
#include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libLongArrayCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libLongArrayCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -21,6 +21,7 @@
* questions.
*/
+#include "ExceptionCheckingJniEnv.cpp"
#include "LongArrayCriticalLocker.cpp"
#include "jni_tools.cpp"
#include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libShortArrayCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libShortArrayCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -21,6 +21,7 @@
* questions.
*/
+#include "ExceptionCheckingJniEnv.cpp"
#include "ShortArrayCriticalLocker.cpp"
#include "jni_tools.cpp"
#include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libStringCriticalLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libStringCriticalLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -21,6 +21,7 @@
* questions.
*/
+#include "ExceptionCheckingJniEnv.cpp"
#include "StringCriticalLocker.cpp"
#include "jni_tools.cpp"
#include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIGlobalRefLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIGlobalRefLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -20,9 +20,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
#include <jni.h>
#include <stdio.h>
#include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
#include "jni_tools.h"
extern "C" {
@@ -35,28 +37,18 @@
* Signature: (JJ)V
*/
JNIEXPORT void JNICALL Java_nsk_share_gc_lock_jniref_JNIGlobalRefLocker_criticalNative
- (JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+ (JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+ ExceptionCheckingJniEnvPtr env(jni_env);
+
jobject obj;
jobject gref;
time_t start_time, current_time;
if (objFieldId == NULL) {
jclass klass = env->GetObjectClass(o);
- if (klass == NULL) {
- printf("Error: GetObjectClass returned NULL\n");
- return;
- }
objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
- if (objFieldId == NULL) {
- printf("Error: GetFieldID returned NULL\n");
- return;
- }
}
obj = env->GetObjectField(o, objFieldId);
- if (obj == NULL) {
- printf("Error: GetObjectField returned NULL\n");
- return;
- }
env->SetObjectField(o, objFieldId, NULL);
start_time = time(NULL);
enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNILocalRefLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNILocalRefLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -23,6 +23,7 @@
#include <jni.h>
#include <stdio.h>
#include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
#include "jni_tools.h"
extern "C" {
@@ -35,28 +36,18 @@
* Signature: (JJ)V
*/
JNIEXPORT void JNICALL Java_nsk_share_gc_lock_jniref_JNILocalRefLocker_criticalNative
- (JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+ (JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+ ExceptionCheckingJniEnvPtr env(jni_env);
+
jobject obj;
jobject gref;
time_t start_time, current_time;
if (objFieldId == NULL) {
jclass klass = env->GetObjectClass(o);
- if (klass == NULL) {
- printf("Error: GetObjectClass returned NULL\n");
- return;
- }
objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
- if (objFieldId == NULL) {
- printf("Error: GetFieldID returned NULL\n");
- return;
- }
}
obj = env->GetObjectField(o, objFieldId);
- if (obj == NULL) {
- printf("Error: GetObjectField returned NULL\n");
- return;
- }
env->SetObjectField(o, objFieldId, NULL);
start_time = time(NULL);
enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIRefLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIRefLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -23,6 +23,7 @@
#include <jni.h>
#include <stdio.h>
#include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
#include "jni_tools.h"
extern "C" {
@@ -35,29 +36,21 @@
* Signature: (JJ)V
*/
JNIEXPORT void JNICALL Java_nsk_share_gc_lock_jniref_JNIRefLocker_criticalNative
- (JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+ (JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+ ExceptionCheckingJniEnvPtr env(jni_env);
+
jobject obj;
jobject gref, lref, gwref;
time_t start_time, current_time;
if (objFieldId == NULL) {
jclass klass = env->GetObjectClass(o);
- if (klass == NULL) {
- printf("Error: GetObjectClass returned NULL\n");
- return;
- }
objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
- if (objFieldId == NULL) {
- printf("Error: GetFieldID returned NULL\n");
- return;
- }
}
+
obj = env->GetObjectField(o, objFieldId);
- if (obj == NULL) {
- printf("Error: GetObjectField returned NULL\n");
- return;
- }
env->SetObjectField(o, objFieldId, NULL);
+
start_time = time(NULL);
enterTime /= 1000;
current_time = 0;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIWeakGlobalRefLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIWeakGlobalRefLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -23,6 +23,7 @@
#include <jni.h>
#include <stdio.h>
#include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
#include "jni_tools.h"
extern "C" {
@@ -35,29 +36,20 @@
* Signature: (JJ)V
*/
JNIEXPORT void JNICALL Java_nsk_share_gc_lock_jniref_JNIWeakGlobalRefLocker_criticalNative
- (JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+ (JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+ ExceptionCheckingJniEnvPtr env(jni_env);
+
jobject obj;
jobject gref;
time_t start_time, current_time;
if (objFieldId == NULL) {
jclass klass = env->GetObjectClass(o);
- if (klass == NULL) {
- printf("Error: GetObjectClass returned NULL\n");
- return;
- }
objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
- if (objFieldId == NULL) {
- printf("Error: GetFieldID returned NULL\n");
- return;
- }
}
obj = env->GetObjectField(o, objFieldId);
- if (obj == NULL) {
- printf("Error: GetObjectField returned NULL\n");
- return;
- }
env->SetObjectField(o, objFieldId, NULL);
+
start_time = time(NULL);
enterTime /= 1000;
current_time = 0;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIGlobalRefLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIGlobalRefLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -21,6 +21,7 @@
* questions.
*/
+#include "ExceptionCheckingJniEnv.cpp"
#include "JNIGlobalRefLocker.cpp"
#include "jni_tools.cpp"
#include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNILocalRefLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNILocalRefLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -21,6 +21,7 @@
* questions.
*/
+#include "ExceptionCheckingJniEnv.cpp"
#include "JNILocalRefLocker.cpp"
#include "jni_tools.cpp"
#include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIRefLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIRefLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -21,6 +21,7 @@
* questions.
*/
+#include "ExceptionCheckingJniEnv.cpp"
#include "JNIRefLocker.cpp"
#include "jni_tools.cpp"
#include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIWeakGlobalRefLocker.cpp Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIWeakGlobalRefLocker.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -21,6 +21,7 @@
* questions.
*/
+#include "ExceptionCheckingJniEnv.cpp"
#include "JNIWeakGlobalRefLocker.cpp"
#include "jni_tools.cpp"
#include "nsk_tools.cpp"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jni/ExceptionCheckingJniEnv.cpp Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, Google and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include <stdlib.h>
+
+#include "ExceptionCheckingJniEnv.hpp"
+
+namespace {
+
+template<class T = void*>
+class JNIVerifier {
+ public:
+ JNIVerifier(ExceptionCheckingJniEnv *env, const char* base_msg)
+ : _env(env), _base_msg(base_msg), _return_error(NULL) {
+ }
+
+ ~JNIVerifier() {
+ JNIEnv* jni_env = _env->GetJNIEnv();
+ if (jni_env->ExceptionCheck()) {
+ _env->HandleError(_base_msg);
+ return;
+ }
+
+ if (_return_error != NULL) {
+ ProcessReturnError();
+ }
+ }
+
+ void ProcessReturnError() {
+ int len = snprintf(NULL, 0, "%s : %s", _base_msg, _return_error) + 1;
+
+ if (len <= 0) {
+ _env->HandleError(_return_error);
+ return;
+ }
+
+ char* full_message = (char*) malloc(len);
+ if (full_message == NULL) {
+ _env->HandleError(_return_error);
+ return;
+ }
+
+ snprintf(full_message, len, "%s : %s", _base_msg, _return_error);
+
+ _env->HandleError(full_message);
+ free(full_message);
+ }
+
+ T ResultNotNull(T ptr) {
+ if (ptr == NULL) {
+ _return_error = "Return is NULL";
+ }
+ return ptr;
+ }
+
+ private:
+ ExceptionCheckingJniEnv* _env;
+ const char* const _base_msg;
+ const char* _return_error;
+};
+
+}
+
+jclass ExceptionCheckingJniEnv::GetObjectClass(jobject obj) {
+ JNIVerifier<jclass> marker(this, "GetObjectClass");
+ return marker.ResultNotNull(_jni_env->GetObjectClass(obj));
+}
+
+jfieldID ExceptionCheckingJniEnv::GetFieldID(jclass klass, const char *name, const char* type) {
+ JNIVerifier<jfieldID> marker(this, "GetFieldID");
+ return marker.ResultNotNull(_jni_env->GetFieldID(klass, name, type));
+}
+
+jobject ExceptionCheckingJniEnv::GetObjectField(jobject obj, jfieldID field) {
+ JNIVerifier<jobject> marker(this, "GetObjectField");
+ return marker.ResultNotNull(_jni_env->GetObjectField(obj, field));
+}
+
+void ExceptionCheckingJniEnv::SetObjectField(jobject obj, jfieldID field, jobject value) {
+ JNIVerifier<> marker(this, "SetObjectField");
+ _jni_env->SetObjectField(obj, field, value);
+}
+
+jobject ExceptionCheckingJniEnv::NewGlobalRef(jobject obj) {
+ JNIVerifier<jobject> marker(this, "NewGlobalRef");
+ return marker.ResultNotNull(_jni_env->NewGlobalRef(obj));
+}
+
+void ExceptionCheckingJniEnv::DeleteGlobalRef(jobject obj) {
+ JNIVerifier<> marker(this, "DeleteGlobalRef");
+ _jni_env->DeleteGlobalRef(obj);
+}
+
+jobject ExceptionCheckingJniEnv::NewLocalRef(jobject obj) {
+ JNIVerifier<jobject> marker(this, "NewLocalRef");
+ return marker.ResultNotNull(_jni_env->NewLocalRef(obj));
+}
+
+void ExceptionCheckingJniEnv::DeleteLocalRef(jobject obj) {
+ JNIVerifier<> marker(this, "DeleteLocalRef");
+ _jni_env->DeleteLocalRef(obj);
+}
+
+jweak ExceptionCheckingJniEnv::NewWeakGlobalRef(jobject obj) {
+ JNIVerifier<jweak> marker(this, "NewWeakGlobalRef");
+ return marker.ResultNotNull(_jni_env->NewWeakGlobalRef(obj));
+}
+
+void ExceptionCheckingJniEnv::DeleteWeakGlobalRef(jweak weak_ref) {
+ JNIVerifier<> marker(this, "DeleteWeakGlobalRef");
+ _jni_env->DeleteWeakGlobalRef(weak_ref);
+}
+
+jsize ExceptionCheckingJniEnv::GetArrayLength(jarray array) {
+ JNIVerifier<> marker(this, "GetArrayLength");
+ return _jni_env->GetArrayLength(array);
+}
+
+jsize ExceptionCheckingJniEnv::GetStringLength(jstring str) {
+ JNIVerifier<> marker(this, "GetStringLength");
+ return _jni_env->GetStringLength(str);
+}
+
+void* ExceptionCheckingJniEnv::GetPrimitiveArrayCritical(jarray array, jboolean* isCopy) {
+ JNIVerifier<> marker(this, "GetPrimitiveArrayCritical");
+ return marker.ResultNotNull(_jni_env->GetPrimitiveArrayCritical(array, isCopy));
+}
+
+void ExceptionCheckingJniEnv::ReleasePrimitiveArrayCritical(jarray array, void* carray, jint mode) {
+ JNIVerifier<> marker(this, "ReleasePrimitiveArrayCritical");
+ _jni_env->ReleasePrimitiveArrayCritical(array, carray, mode);
+}
+
+const jchar* ExceptionCheckingJniEnv::GetStringCritical(jstring str, jboolean* isCopy) {
+ JNIVerifier<const jchar*> marker(this, "GetPrimitiveArrayCritical");
+ return marker.ResultNotNull(_jni_env->GetStringCritical(str, isCopy));
+}
+
+void ExceptionCheckingJniEnv::ReleaseStringCritical(jstring str, const jchar* carray) {
+ JNIVerifier<> marker(this, "ReleaseStringCritical");
+ _jni_env->ReleaseStringCritical(str, carray);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jni/ExceptionCheckingJniEnv.hpp Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, Google and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+#ifndef NSK_EXCEPTIONCHECKINGJNIENV_DEFINED
+#define NSK_EXCEPTIONCHECKINGJNIENV_DEFINED
+
+#include <jni.h>
+
+/**
+ * ExceptionCheckingJniEnv wraps around the JNIEnv data structure and
+ * methods to enable automatic exception checking. This allows test writers
+ * and readers to concentrate on what the test is to do and leave the
+ * error checking and throwing to this data structure and subsystem.
+ *
+ * For example:
+ *
+ * ... JNIEnv* env ...
+ * jclass klass = env->GetObjectClass(o);
+ * if (klass == NULL) {
+ * printf("Error: GetObjectClass returned NULL\n");
+ * return;
+ * }
+ * if (env->ExceptionCheck()) {
+ * ...
+ * }
+ *
+ * Can be simplified to:
+ * ... ExceptionCheckingJniEnv* env ...
+ * jclass klass = env->GetObjectClass(o);
+ *
+ * Where now the JNI Exception checking and the NULL return checking are done
+ * internally and will perform whatever action the ErrorHandler requires.
+ *
+ * By default, the error handler describes the exception via the JNI
+ * ExceptionDescribe method and calls FatalError.
+ *
+ * Note: at a future date, this will also include the tracing mechanism done in
+ * NSK_VERIFY, which will thus embed its logic into the ExceptionCheckingJniEnv
+ * and clearing that up for the code readers and writers.
+ */
+class ExceptionCheckingJniEnv {
+ public:
+ // JNIEnv API redefinitions.
+ jfieldID GetFieldID(jclass klass, const char *name, const char* type);
+ jclass GetObjectClass(jobject obj);
+ jobject GetObjectField(jobject obj, jfieldID field);
+ void SetObjectField(jobject obj, jfieldID field, jobject value);
+
+ jsize GetArrayLength(jarray array);
+ jsize GetStringLength(jstring str);
+
+ void* GetPrimitiveArrayCritical(jarray array, jboolean* isCopy);
+ void ReleasePrimitiveArrayCritical(jarray array, void* carray, jint mode);
+ const jchar* GetStringCritical(jstring str, jboolean* isCopy);
+ void ReleaseStringCritical(jstring str, const jchar* carray);
+
+ jobject NewGlobalRef(jobject obj);
+ void DeleteGlobalRef(jobject obj);
+ jobject NewLocalRef(jobject ref);
+ void DeleteLocalRef(jobject ref);
+ jweak NewWeakGlobalRef(jobject obj);
+ void DeleteWeakGlobalRef(jweak obj);
+
+ // ExceptionCheckingJniEnv methods.
+ JNIEnv* GetJNIEnv() {
+ return _jni_env;
+ }
+
+ void HandleError(const char* msg) {
+ if (_error_handler) {
+ _error_handler(_jni_env, msg);
+ }
+ }
+
+ typedef void (*ErrorHandler)(JNIEnv* env, const char* error_message);
+
+ static void FatalError(JNIEnv* env, const char* message) {
+ if (env->ExceptionCheck()) {
+ env->ExceptionDescribe();
+ }
+ env->FatalError(message);
+ }
+
+ ExceptionCheckingJniEnv(JNIEnv* jni_env, ErrorHandler error_handler) :
+ _jni_env(jni_env), _error_handler(error_handler) {}
+
+ private:
+ JNIEnv* _jni_env;
+ ErrorHandler _error_handler;
+};
+
+// We cannot use unique_ptr due to this being gnu98++, so use this instead:
+class ExceptionCheckingJniEnvPtr {
+ private:
+ ExceptionCheckingJniEnv _env;
+
+ public:
+ ExceptionCheckingJniEnv* operator->() {
+ return &_env;
+ }
+
+ ExceptionCheckingJniEnvPtr(
+ JNIEnv* jni_env,
+ ExceptionCheckingJniEnv::ErrorHandler error_handler = ExceptionCheckingJniEnv::FatalError) :
+ _env(jni_env, error_handler) {
+ }
+};
+
+#endif
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/correctBootstrap/TestDescription.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/correctBootstrap/TestDescription.java Wed Oct 17 08:09:46 2018 -0700
@@ -50,7 +50,7 @@
* @build vm.mlvm.share.ClassfileGeneratorTest
* @run driver vm.mlvm.share.IndifiedClassesBuilder
*
- * @run main/othervm
+ * @run main/othervm/timeout=300
* vm.mlvm.share.ClassfileGeneratorTest
* -generator vm.mlvm.cp.share.GenManyIndyCorrectBootstrap
*/
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/incorrectBootstrap/TestDescription.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/incorrectBootstrap/TestDescription.java Wed Oct 17 08:09:46 2018 -0700
@@ -51,7 +51,7 @@
* @build vm.mlvm.share.ClassfileGeneratorTest
* @run driver vm.mlvm.share.IndifiedClassesBuilder
*
- * @run main/othervm
+ * @run main/othervm/timeout=300
* vm.mlvm.share.ClassfileGeneratorTest
* -generator vm.mlvm.cp.share.GenManyIndyIncorrectBootstrap
*/
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/mh/TestDescription.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/mh/TestDescription.java Wed Oct 17 08:09:46 2018 -0700
@@ -50,6 +50,6 @@
* @build vm.mlvm.share.ClassfileGeneratorTest
* @run driver vm.mlvm.share.IndifiedClassesBuilder
*
- * @run main/othervm vm.mlvm.share.ClassfileGeneratorTest -generator vm.mlvm.cp.share.GenCPFullOfMH
+ * @run main/othervm/timeout=300 vm.mlvm.share.ClassfileGeneratorTest -generator vm.mlvm.cp.share.GenCPFullOfMH
*/
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/mt/TestDescription.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/mt/TestDescription.java Wed Oct 17 08:09:46 2018 -0700
@@ -50,6 +50,6 @@
* @build vm.mlvm.share.ClassfileGeneratorTest
* @run driver vm.mlvm.share.IndifiedClassesBuilder
*
- * @run main/othervm vm.mlvm.share.ClassfileGeneratorTest -generator vm.mlvm.cp.share.GenCPFullOfMT
+ * @run main/othervm/timeout=300 vm.mlvm.share.ClassfileGeneratorTest -generator vm.mlvm.cp.share.GenCPFullOfMT
*/
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/meth/stress/gc/createLotsOfMHConsts/Test.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/meth/stress/gc/createLotsOfMHConsts/Test.java Wed Oct 17 08:09:46 2018 -0700
@@ -50,7 +50,7 @@
* @build vm.mlvm.meth.stress.gc.createLotsOfMHConsts.Test
* @run driver vm.mlvm.share.IndifiedClassesBuilder
*
- * @run main/othervm
+ * @run main/othervm/timeout=300
* vm.mlvm.meth.stress.gc.createLotsOfMHConsts.Test
* -stressIterationsFactor 100000
* -generator vm.mlvm.cp.share.GenCPFullOfMH
--- a/test/jdk/ProblemList.txt Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/ProblemList.txt Wed Oct 17 08:09:46 2018 -0700
@@ -835,8 +835,6 @@
# jdk_jdi
-com/sun/jdi/BasicJDWPConnectionTest.java 8195703 generic-all
-
com/sun/jdi/RepStep.java 8043571 generic-all
com/sun/jdi/sde/SourceDebugExtensionTest.java 8158066 windows-all
--- a/test/jdk/TEST.groups Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/TEST.groups Wed Oct 17 08:09:46 2018 -0700
@@ -218,8 +218,7 @@
-sun/security/krb5 \
-sun/security/jgss \
javax/net \
- com/sun/net/ssl \
- lib/security
+ com/sun/net/ssl
jdk_security4 = \
com/sun/security/jgss \
--- a/test/jdk/com/sun/jdi/BasicJDWPConnectionTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/com/sun/jdi/BasicJDWPConnectionTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -29,17 +29,15 @@
*/
import java.io.IOException;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
import java.net.Socket;
import java.net.SocketException;
import jdk.test.lib.apps.LingeredApp;
-import jdk.test.lib.Utils;
import java.util.ArrayList;
-import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
public class BasicJDWPConnectionTest {
@@ -64,25 +62,37 @@
return res;
}
- public static ArrayList<String> prepareCmd(int port, String allowOpt) {
- String address = "*:" + String.valueOf(port);
+ public static ArrayList<String> prepareCmd(String allowOpt) {
ArrayList<String> cmd = new ArrayList<>();
String jdwpArgs = "-agentlib:jdwp=transport=dt_socket,server=y," +
- "suspend=n,address=" + address + allowOpt;
+ "suspend=n,address=*:0" + allowOpt;
cmd.add(jdwpArgs);
return cmd;
}
+ private static Pattern listenRegexp = Pattern.compile("Listening for transport \\b(.+)\\b at address: \\b(\\d+)\\b");
+ private static int detectPort(String s) {
+ Matcher m = listenRegexp.matcher(s);
+ if (!m.find()) {
+ throw new RuntimeException("Could not detect port from '" + s + "'");
+ }
+ // m.group(1) is transport, m.group(2) is port
+ return Integer.parseInt(m.group(2));
+ }
+
public static void positiveTest(String testName, String allowOpt)
throws InterruptedException, IOException {
System.err.println("\nStarting " + testName);
- int port = Utils.getFreePort();
- ArrayList<String> cmd = prepareCmd(port, allowOpt);
+ ArrayList<String> cmd = prepareCmd(allowOpt);
LingeredApp a = LingeredApp.startApp(cmd);
- int res = handshake(port);
- a.stopApp();
+ int res;
+ try {
+ res = handshake(detectPort(a.getProcessStdout()));
+ } finally {
+ a.stopApp();
+ }
if (res < 0) {
throw new RuntimeException(testName + " FAILED");
}
@@ -92,12 +102,15 @@
public static void negativeTest(String testName, String allowOpt)
throws InterruptedException, IOException {
System.err.println("\nStarting " + testName);
- int port = Utils.getFreePort();
- ArrayList<String> cmd = prepareCmd(port, allowOpt);
+ ArrayList<String> cmd = prepareCmd(allowOpt);
LingeredApp a = LingeredApp.startApp(cmd);
- int res = handshake(port);
- a.stopApp();
+ int res;
+ try {
+ res = handshake(detectPort(a.getProcessStdout()));
+ } finally {
+ a.stopApp();
+ }
if (res > 0) {
System.err.println(testName + ": res=" + res);
throw new RuntimeException(testName + " FAILED");
@@ -109,16 +122,18 @@
public static void badAllowOptionTest(String testName, String allowOpt)
throws InterruptedException, IOException {
System.err.println("\nStarting " + testName);
- int port = Utils.getFreePort();
- ArrayList<String> cmd = prepareCmd(port, allowOpt);
+ ArrayList<String> cmd = prepareCmd(allowOpt);
+ LingeredApp a;
try {
- LingeredApp a = LingeredApp.startApp(cmd);
+ a = LingeredApp.startApp(cmd);
} catch (IOException ex) {
System.err.println(testName + ": caught expected IOException");
System.err.println(testName + " PASSED");
return;
}
+ // LingeredApp.startApp is expected to fail, but if not, terminate the app
+ a.stopApp();
throw new RuntimeException(testName + " FAILED");
}
@@ -174,26 +189,16 @@
badAllowOptionTest("ExplicitMultiDefault2Test", allowOpt);
}
- public static void main(String[] args) {
- try {
- DefaultTest();
- ExplicitDefaultTest();
- AllowTest();
- MultiAllowTest();
- DenyTest();
- MultiDenyTest();
- EmptyAllowOptionTest();
- ExplicitMultiDefault1Test();
- ExplicitMultiDefault2Test();
- System.err.println("\nTest PASSED");
- } catch (InterruptedException ex) {
- System.err.println("\nTest ERROR, getFreePort");
- ex.printStackTrace();
- System.exit(3);
- } catch (IOException ex) {
- System.err.println("\nTest ERROR");
- ex.printStackTrace();
- System.exit(3);
- }
+ public static void main(String[] args) throws Exception {
+ DefaultTest();
+ ExplicitDefaultTest();
+ AllowTest();
+ MultiAllowTest();
+ DenyTest();
+ MultiDenyTest();
+ EmptyAllowOptionTest();
+ ExplicitMultiDefault1Test();
+ ExplicitMultiDefault2Test();
+ System.err.println("\nTest PASSED");
}
}
--- a/test/jdk/com/sun/jdi/DoubleAgentTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/com/sun/jdi/DoubleAgentTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -41,10 +41,8 @@
"test.classes", ".");
public static void main(String[] args) throws Throwable {
- int port = Utils.getFreePort();
-
String jdwpOption = "-agentlib:jdwp=transport=dt_socket"
- + ",server=y" + ",suspend=n" + ",address=*:" + String.valueOf(port);
+ + ",server=y" + ",suspend=n" + ",address=*:0";
OutputAnalyzer output = ProcessTools.executeTestJvm("-classpath",
TEST_CLASSES,
--- a/test/jdk/com/sun/net/httpserver/SelCacheTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/com/sun/net/httpserver/SelCacheTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2018, 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,14 +24,14 @@
/**
* @test
* @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run main/othervm -Dsun.net.httpserver.selCacheTimeout=2 SelCacheTest
* @summary Light weight HTTP server
*/
import com.sun.net.httpserver.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import java.util.*;
import java.util.concurrent.*;
--- a/test/jdk/com/sun/net/httpserver/Test1.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/com/sun/net/httpserver/Test1.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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,8 +24,8 @@
/**
* @test
* @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run main/othervm Test1
* @run main/othervm -Dsun.net.httpserver.maxReqTime=10 Test1
* @run main/othervm -Dsun.net.httpserver.nodelay=true Test1
@@ -38,7 +38,7 @@
import java.io.*;
import java.net.*;
import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
/* basic http/s connectivity test
* Tests:
--- a/test/jdk/com/sun/net/httpserver/Test12.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/com/sun/net/httpserver/Test12.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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,10 +24,10 @@
/**
* @test
* @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run main/othervm Test12
- * @summary Light weight HTTP server
+ * @summary Light weight HTTP server
*/
import com.sun.net.httpserver.*;
@@ -36,7 +36,7 @@
import java.io.*;
import java.net.*;
import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
/* basic http/s connectivity test
* Tests:
--- a/test/jdk/com/sun/net/httpserver/Test13.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/com/sun/net/httpserver/Test13.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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,10 +24,10 @@
/**
* @test
* @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run main/othervm Test13
- * @summary Light weight HTTP server
+ * @summary Light weight HTTP server
*/
import com.sun.net.httpserver.*;
@@ -37,7 +37,7 @@
import java.io.*;
import java.net.*;
import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
/* basic http/s connectivity test
* Tests:
--- a/test/jdk/com/sun/net/httpserver/Test6a.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/com/sun/net/httpserver/Test6a.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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,10 +24,10 @@
/**
* @test
* @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run main/othervm Test6a
- * @summary Light weight HTTP server
+ * @summary Light weight HTTP server
*/
import com.sun.net.httpserver.*;
@@ -36,7 +36,7 @@
import java.io.*;
import java.net.*;
import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
/**
* Test https POST large file via chunked encoding (unusually small chunks)
--- a/test/jdk/com/sun/net/httpserver/Test7a.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/com/sun/net/httpserver/Test7a.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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,10 +24,10 @@
/**
* @test
* @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run main/othervm Test7a
- * @summary Light weight HTTP server
+ * @summary Light weight HTTP server
*/
import com.sun.net.httpserver.*;
@@ -36,7 +36,7 @@
import java.io.*;
import java.net.*;
import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
/**
* Test POST large file via chunked encoding (large chunks)
--- a/test/jdk/com/sun/net/httpserver/Test8a.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/com/sun/net/httpserver/Test8a.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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,10 +24,10 @@
/**
* @test
* @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run main/othervm Test8a
- * @summary Light weight HTTP server
+ * @summary Light weight HTTP server
*/
import com.sun.net.httpserver.*;
@@ -36,7 +36,7 @@
import java.io.*;
import java.net.*;
import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
/**
* Test POST large file via fixed len encoding
--- a/test/jdk/com/sun/net/httpserver/Test9.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/com/sun/net/httpserver/Test9.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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,10 +24,10 @@
/**
* @test
* @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run main/othervm Test9
- * @summary Light weight HTTP server
+ * @summary Light weight HTTP server
*/
import com.sun.net.httpserver.*;
@@ -36,7 +36,7 @@
import java.io.*;
import java.net.*;
import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
/* Same as Test1 but requests run in parallel.
*/
--- a/test/jdk/com/sun/net/httpserver/Test9a.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/com/sun/net/httpserver/Test9a.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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,10 +24,10 @@
/**
* @test
* @bug 6270015
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run main/othervm Test9a
- * @summary Light weight HTTP server
+ * @summary Light weight HTTP server
*/
import com.sun.net.httpserver.*;
@@ -36,7 +36,7 @@
import java.io.*;
import java.net.*;
import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
/* Same as Test1 but requests run in parallel.
*/
--- a/test/jdk/java/io/FileInputStream/UnreferencedFISClosesFd.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/io/FileInputStream/UnreferencedFISClosesFd.java Wed Oct 17 08:09:46 2018 -0700
@@ -62,15 +62,11 @@
*/
public class UnreferencedFISClosesFd {
- enum CleanupType {
- CLOSE, // Cleanup is handled via calling close
- CLEANER} // Cleanup is handled via Cleaner
-
static final String FILE_NAME = "empty.txt";
/**
* Subclass w/ no overrides; not finalize or close.
- * Cleanup should be via the Cleaner (not close).
+ * Cleanup should be via the Cleaner.
*/
public static class StreamOverrides extends FileInputStream {
@@ -88,7 +84,7 @@
/**
* Subclass overrides close.
- * Cleanup should be via AltFinalizer calling close().
+ * Cleanup should be via the Cleaner.
*/
public static class StreamOverridesClose extends StreamOverrides {
@@ -104,7 +100,7 @@
/**
* Subclass overrides finalize.
- * Cleanup should be via the Cleaner (not close).
+ * Cleanup should be via the Cleaner.
*/
public static class StreamOverridesFinalize extends StreamOverrides {
@@ -113,7 +109,7 @@
}
@SuppressWarnings({"deprecation","removal"})
- protected void finalize() throws IOException {
+ protected void finalize() throws IOException, Throwable {
super.finalize();
}
}
@@ -129,7 +125,7 @@
}
@SuppressWarnings({"deprecation","removal"})
- protected void finalize() throws IOException {
+ protected void finalize() throws IOException, Throwable {
super.finalize();
}
}
@@ -149,15 +145,15 @@
long fdCount0 = getFdCount();
int failCount = 0;
- failCount += test(new FileInputStream(name), CleanupType.CLEANER);
+ failCount += test(new FileInputStream(name));
- failCount += test(new StreamOverrides(name), CleanupType.CLEANER);
+ failCount += test(new StreamOverrides(name));
- failCount += test(new StreamOverridesClose(name), CleanupType.CLOSE);
+ failCount += test(new StreamOverridesClose(name));
- failCount += test(new StreamOverridesFinalize(name), CleanupType.CLEANER);
+ failCount += test(new StreamOverridesFinalize(name));
- failCount += test(new StreamOverridesFinalizeClose(name), CleanupType.CLOSE);
+ failCount += test(new StreamOverridesFinalizeClose(name));
if (failCount > 0) {
throw new AssertionError("Failed test count: " + failCount);
@@ -180,7 +176,7 @@
: -1L;
}
- private static int test(FileInputStream fis, CleanupType cleanType) throws Exception {
+ private static int test(FileInputStream fis) throws Exception {
try {
System.out.printf("%nTesting %s%n", fis.getClass().getName());
@@ -199,35 +195,18 @@
fdField.setAccessible(true);
int ffd = fdField.getInt(fd);
- Field altFinalizerField = FileInputStream.class.getDeclaredField("altFinalizer");
- altFinalizerField.setAccessible(true);
- Object altFinalizer = altFinalizerField.get(fis);
- if ((altFinalizer != null) ^ (cleanType == CleanupType.CLOSE)) {
- throw new RuntimeException("Unexpected AltFinalizer: " + altFinalizer
- + ", for " + cleanType);
- }
-
Field cleanupField = FileDescriptor.class.getDeclaredField("cleanup");
cleanupField.setAccessible(true);
Object cleanup = cleanupField.get(fd);
- System.out.printf(" cleanup: %s, alt: %s, ffd: %d, cf: %s%n",
- cleanup, altFinalizer, ffd, cleanupField);
- if ((cleanup != null) ^ (cleanType == CleanupType.CLEANER)) {
- throw new Exception("unexpected cleanup: "
- + cleanup + ", for " + cleanType);
+ System.out.printf(" cleanup: %s, ffd: %d, cf: %s%n", cleanup, ffd, cleanupField);
+ if (cleanup == null) {
+ throw new RuntimeException("cleanup should not be null");
}
- if (cleanup != null) {
- WeakReference<Object> cleanupWeak = new WeakReference<>(cleanup, queue);
- pending.add(cleanupWeak);
- System.out.printf(" fdWeak: %s%n msWeak: %s%n cleanupWeak: %s%n",
- fdWeak, msWeak, cleanupWeak);
- }
- if (altFinalizer != null) {
- WeakReference<Object> altFinalizerWeak = new WeakReference<>(altFinalizer, queue);
- pending.add(altFinalizerWeak);
- System.out.printf(" fdWeak: %s%n msWeak: %s%n altFinalizerWeak: %s%n",
- fdWeak, msWeak, altFinalizerWeak);
- }
+
+ WeakReference<Object> cleanupWeak = new WeakReference<>(cleanup, queue);
+ pending.add(cleanupWeak);
+ System.out.printf(" fdWeak: %s%n msWeak: %s%n cleanupWeak: %s%n",
+ fdWeak, msWeak, cleanupWeak);
AtomicInteger closeCounter = fis instanceof StreamOverrides
? ((StreamOverrides)fis).closeCounter() : null;
@@ -243,28 +222,16 @@
fis = null;
fd = null;
cleanup = null;
- altFinalizer = null;
System.gc(); // attempt to reclaim them
}
}
Reference.reachabilityFence(fd);
Reference.reachabilityFence(fis);
Reference.reachabilityFence(cleanup);
- Reference.reachabilityFence(altFinalizer);
// Confirm the correct number of calls to close depending on the cleanup type
- switch (cleanType) {
- case CLEANER:
- if (closeCounter != null && closeCounter.get() > 0) {
- throw new RuntimeException("Close should not have been called: count: "
- + closeCounter);
- }
- break;
- case CLOSE:
- if (closeCounter == null || closeCounter.get() == 0) {
- throw new RuntimeException("Close should have been called: count: 0");
- }
- break;
+ if (closeCounter != null && closeCounter.get() > 0) {
+ throw new RuntimeException("Close should not have been called: count: " + closeCounter);
}
} catch (Exception ex) {
ex.printStackTrace(System.out);
--- a/test/jdk/java/io/FileOutputStream/UnreferencedFOSClosesFd.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/io/FileOutputStream/UnreferencedFOSClosesFd.java Wed Oct 17 08:09:46 2018 -0700
@@ -28,8 +28,7 @@
* @library /test/lib
* @build jdk.test.lib.util.FileUtils UnreferencedFOSClosesFd
* @bug 6524062
- * @summary Test to ensure that FOS.finalize() invokes the close() method as per
- * the specification.
+ * @summary Test to ensure that the fd is closed if left unreferenced
* @run main/othervm UnreferencedFOSClosesFd
*/
import java.io.File;
@@ -54,15 +53,11 @@
public class UnreferencedFOSClosesFd {
- enum CleanupType {
- CLOSE, // Cleanup is handled via calling close
- CLEANER} // Cleanup is handled via Cleaner
-
static final String FILE_NAME = "empty.txt";
/**
- * Subclass w/ no overrides; not finalize or close.
- * Cleanup should be via the Cleaner (not close).
+ * Subclass w/ no overrides; not close.
+ * Cleanup should be via the Cleaner.
*/
public static class StreamOverrides extends FileOutputStream {
@@ -96,7 +91,7 @@
/**
* Subclass overrides finalize and close.
- * Cleanup should be via the Cleaner (not close).
+ * Cleanup should be via the Cleaner.
*/
public static class StreamOverridesFinalize extends StreamOverrides {
@@ -105,14 +100,14 @@
}
@SuppressWarnings({"deprecation","removal"})
- protected void finalize() throws IOException {
+ protected void finalize() throws IOException, Throwable {
super.finalize();
}
}
/**
* Subclass overrides finalize and close.
- * Cleanup should be via AltFinalizer calling close().
+ * Cleanup should be via the Cleaner.
*/
public static class StreamOverridesFinalizeClose extends StreamOverridesClose {
@@ -121,7 +116,7 @@
}
@SuppressWarnings({"deprecation","removal"})
- protected void finalize() throws IOException {
+ protected void finalize() throws IOException, Throwable {
super.finalize();
}
}
@@ -131,8 +126,6 @@
*/
public static void main(String argv[]) throws Exception {
-
-
File inFile = new File(System.getProperty("test.dir", "."), FILE_NAME);
inFile.createNewFile();
inFile.deleteOnExit();
@@ -143,15 +136,15 @@
long fdCount0 = getFdCount();
int failCount = 0;
- failCount += test(new FileOutputStream(name), CleanupType.CLEANER);
+ failCount += test(new FileOutputStream(name));
- failCount += test(new StreamOverrides(name), CleanupType.CLEANER);
+ failCount += test(new StreamOverrides(name));
- failCount += test(new StreamOverridesClose(name), CleanupType.CLOSE);
+ failCount += test(new StreamOverridesClose(name));
- failCount += test(new StreamOverridesFinalize(name), CleanupType.CLEANER);
+ failCount += test(new StreamOverridesFinalize(name));
- failCount += test(new StreamOverridesFinalizeClose(name), CleanupType.CLOSE);
+ failCount += test(new StreamOverridesFinalizeClose(name));
if (failCount > 0) {
throw new AssertionError("Failed test count: " + failCount);
@@ -174,7 +167,7 @@
: -1L;
}
- private static int test(FileOutputStream fos, CleanupType cleanType) throws Exception {
+ private static int test(FileOutputStream fos) throws Exception {
try {
System.out.printf("%nTesting %s%n", fos.getClass().getName());
@@ -193,35 +186,18 @@
fdField.setAccessible(true);
int ffd = fdField.getInt(fd);
- Field altFinalizerField = FileOutputStream.class.getDeclaredField("altFinalizer");
- altFinalizerField.setAccessible(true);
- Object altFinalizer = altFinalizerField.get(fos);
- if ((altFinalizer != null) ^ (cleanType == CleanupType.CLOSE)) {
- throw new RuntimeException("Unexpected AltFinalizer: " + altFinalizer
- + ", for " + cleanType);
- }
-
Field cleanupField = FileDescriptor.class.getDeclaredField("cleanup");
cleanupField.setAccessible(true);
Object cleanup = cleanupField.get(fd);
- System.out.printf(" cleanup: %s, alt: %s, ffd: %d, cf: %s%n",
- cleanup, altFinalizer, ffd, cleanupField);
- if ((cleanup != null) ^ (cleanType == CleanupType.CLEANER)) {
- throw new Exception("unexpected cleanup: "
- + cleanup + ", for " + cleanType);
+ System.out.printf(" cleanup: %s, ffd: %d, cf: %s%n", cleanup, ffd, cleanupField);
+ if (cleanup == null) {
+ throw new RuntimeException("cleanup should not be null");
}
- if (cleanup != null) {
- WeakReference<Object> cleanupWeak = new WeakReference<>(cleanup, queue);
- pending.add(cleanupWeak);
- System.out.printf(" fdWeak: %s%n msWeak: %s%n cleanupWeak: %s%n",
- fdWeak, msWeak, cleanupWeak);
- }
- if (altFinalizer != null) {
- WeakReference<Object> altFinalizerWeak = new WeakReference<>(altFinalizer, queue);
- pending.add(altFinalizerWeak);
- System.out.printf(" fdWeak: %s%n msWeak: %s%n altFinalizerWeak: %s%n",
- fdWeak, msWeak, altFinalizerWeak);
- }
+
+ WeakReference<Object> cleanupWeak = new WeakReference<>(cleanup, queue);
+ pending.add(cleanupWeak);
+ System.out.printf(" fdWeak: %s%n msWeak: %s%n cleanupWeak: %s%n",
+ fdWeak, msWeak, cleanupWeak);
AtomicInteger closeCounter = fos instanceof StreamOverrides
? ((StreamOverrides) fos).closeCounter() : null;
@@ -237,28 +213,16 @@
fos = null;
fd = null;
cleanup = null;
- altFinalizer = null;
System.gc(); // attempt to reclaim them
}
}
Reference.reachabilityFence(fd);
Reference.reachabilityFence(fos);
Reference.reachabilityFence(cleanup);
- Reference.reachabilityFence(altFinalizer);
// Confirm the correct number of calls to close depending on the cleanup type
- switch (cleanType) {
- case CLEANER:
- if (closeCounter != null && closeCounter.get() > 0) {
- throw new RuntimeException("Close should not have been called: count: "
- + closeCounter);
- }
- break;
- case CLOSE:
- if (closeCounter == null || closeCounter.get() == 0) {
- throw new RuntimeException("Close should have been called: count: 0");
- }
- break;
+ if (closeCounter != null && closeCounter.get() > 0) {
+ throw new RuntimeException("Close should not have been called: count: " + closeCounter);
}
} catch (Exception ex) {
ex.printStackTrace(System.out);
--- a/test/jdk/java/lang/ModuleLayer/BasicLayerTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/lang/ModuleLayer/BasicLayerTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -23,9 +23,10 @@
/**
* @test
- * @library /lib/testlibrary
+ * @library /test/lib
* @modules java.base/jdk.internal.misc
- * @build BasicLayerTest ModuleUtils
+ * @build BasicLayerTest
+ * jdk.test.lib.util.ModuleUtils
* @compile layertest/Test.java
* @run testng BasicLayerTest
* @summary Basic tests for java.lang.ModuleLayer
@@ -41,6 +42,8 @@
import java.util.Set;
import java.util.stream.Collectors;
+import jdk.test.lib.util.ModuleUtils;
+
import jdk.internal.misc.SharedSecrets;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/lang/ModuleLayer/LayerAndLoadersTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/lang/ModuleLayer/LayerAndLoadersTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -23,9 +23,11 @@
/**
* @test
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
* @modules jdk.compiler
- * @build LayerAndLoadersTest jdk.test.lib.compiler.CompilerUtils ModuleUtils
+ * @build LayerAndLoadersTest
+ * jdk.test.lib.compiler.CompilerUtils
+ * jdk.test.lib.util.ModuleUtils
* @run testng LayerAndLoadersTest
* @summary Tests for java.lang.ModuleLayer@defineModulesWithXXX methods
*/
@@ -54,6 +56,7 @@
import java.util.stream.Collectors;
import jdk.test.lib.compiler.CompilerUtils;
+import jdk.test.lib.util.ModuleUtils;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
--- a/test/jdk/java/lang/ModuleLayer/LayerControllerTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/lang/ModuleLayer/LayerControllerTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -23,8 +23,9 @@
/**
* @test
- * @library /lib/testlibrary
- * @build LayerControllerTest ModuleUtils
+ * @library /test/lib
+ * @build LayerControllerTest
+ * jdk.test.lib.util.ModuleUtils
* @run testng LayerControllerTest
* @summary Basic tests for java.lang.ModuleLayer.Controller
*/
@@ -35,6 +36,8 @@
import java.util.List;
import java.util.Set;
+import jdk.test.lib.util.ModuleUtils;
+
import org.testng.annotations.Test;
import static org.testng.Assert.*;
--- a/test/jdk/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 5086470 6358247 7193302
+ * @bug 5086470 6358247 7193302 8048215
* @summary Test type conversion when invoking ThreadMXBean.dumpAllThreads
* through proxy.
* @author Mandy Chung
@@ -45,6 +45,7 @@
private static ThreadMXBean mbean;
static Mutex mutex = new Mutex();
static Object lock = new Object();
+ static Object waiter = new Object();
static MyThread thread = new MyThread();
public static void main(String[] argv) throws Exception {
mbean = newPlatformMXBeanProxy(server,
@@ -68,6 +69,12 @@
}
}
+ // 'thread' holds the mutex, which means it must also have the monitor of
+ // 'waiter' at least until it does the wait(). So we acquire the monitor of
+ // 'waiter' here, which ensures that 'thread' must be in wait()
+ synchronized(waiter) {
+ }
+
long[] ids = new long[] { thread.getId() };
// validate the local access
@@ -108,11 +115,10 @@
}
public void run() {
synchronized (lock) {
- mutex.lock();
- Object o = new Object();
- synchronized(o) {
+ synchronized(waiter) {
+ mutex.lock();
try {
- o.wait();
+ waiter.wait();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
--- a/test/jdk/java/lang/module/AutomaticModulesTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/lang/module/AutomaticModulesTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -23,9 +23,10 @@
/**
* @test
- * @library /lib/testlibrary /test/lib
- * @build AutomaticModulesTest ModuleUtils
+ * @library /test/lib
+ * @build AutomaticModulesTest
* jdk.test.lib.util.JarUtils
+ * jdk.test.lib.util.ModuleUtils
* @run testng AutomaticModulesTest
* @summary Basic tests for automatic modules
*/
@@ -50,6 +51,7 @@
import java.util.stream.Stream;
import jdk.test.lib.util.JarUtils;
+import jdk.test.lib.util.ModuleUtils;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
--- a/test/jdk/java/lang/module/ConfigurationTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/lang/module/ConfigurationTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -23,10 +23,11 @@
/**
* @test
- * @library /lib/testlibrary
+ * @library /test/lib
* @modules java.base/jdk.internal.misc
* java.base/jdk.internal.module
- * @build ConfigurationTest ModuleUtils
+ * @build ConfigurationTest
+ * jdk.test.lib.util.ModuleUtils
* @run testng ConfigurationTest
* @summary Basic tests for java.lang.module.Configuration
*/
@@ -47,6 +48,8 @@
import java.util.Optional;
import java.util.Set;
+import jdk.test.lib.util.ModuleUtils;
+
import jdk.internal.misc.SharedSecrets;
import jdk.internal.module.ModuleInfoWriter;
import jdk.internal.module.ModuleTarget;
--- a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPSetAuthenticatorTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPSetAuthenticatorTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -35,12 +35,12 @@
/*
* @test
* @bug 8169415
- * @library /lib/testlibrary/
+ * @library /test/lib
* @modules java.logging
* java.base/sun.net.www
* java.base/sun.net.www.protocol.http
* jdk.httpserver/sun.net.httpserver
- * @build jdk.testlibrary.SimpleSSLContext HTTPTest HTTPTestServer HTTPTestClient HTTPSetAuthenticatorTest
+ * @build jdk.test.lib.net.SimpleSSLContext HTTPTest HTTPTestServer HTTPTestClient HTTPSetAuthenticatorTest
* @summary A simple HTTP test that starts an echo server supporting the given
* authentication scheme, then starts a regular HTTP client to invoke it.
* The client first does a GET request on "/", then follows on
--- a/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -41,16 +41,16 @@
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
/*
* @test
* @bug 8169415
- * @library /lib/testlibrary/
+ * @library /test/lib
* @modules java.logging
* java.base/sun.net.www
* jdk.httpserver/sun.net.httpserver
- * @build jdk.testlibrary.SimpleSSLContext HTTPTest HTTPTestServer HTTPTestClient
+ * @build jdk.test.lib.net.SimpleSSLContext HTTPTest HTTPTestServer HTTPTestClient
* @summary A simple HTTP test that starts an echo server supporting Digest
* authentication, then starts a regular HTTP client to invoke it.
* The client first does a GET request on "/", then follows on
--- a/test/jdk/java/net/Socket/CloseAvailable.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/Socket/CloseAvailable.java Wed Oct 17 08:09:46 2018 -0700
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4091859
+ * @bug 4091859 8189366
* @summary Test Socket.available()
* @run main CloseAvailable
* @run main/othervm -Djava.net.preferIPv4Stack=true CloseAvailable
@@ -33,18 +33,32 @@
import java.io.*;
-public class CloseAvailable implements Runnable {
- static ServerSocket ss;
- static InetAddress addr;
- static int port;
+public class CloseAvailable {
public static void main(String[] args) throws Exception {
+ testClose();
+
+ testEOF(true);
+ testEOF(false);
+ }
+
+ static void testClose() throws IOException {
boolean error = true;
- addr = InetAddress.getLocalHost();
- ss = new ServerSocket(0);
- port = ss.getLocalPort();
+ InetAddress addr = InetAddress.getLocalHost();
+ ServerSocket ss = new ServerSocket(0);
+ int port = ss.getLocalPort();
- Thread t = new Thread(new CloseAvailable());
+ Thread t = new Thread(new Thread("Close-Available-1") {
+ public void run() {
+ try {
+ Socket s = new Socket(addr, port);
+ s.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
t.start();
Socket soc = ss.accept();
@@ -63,13 +77,42 @@
throw new RuntimeException("Available() can be called after stream closed.");
}
- public void run() {
- try {
- Socket s = new Socket(addr, port);
- s.close();
- } catch (Exception e) {
- e.printStackTrace();
+ // Verifies consistency of `available` behaviour when EOF reached, both
+ // explicitly and implicitly.
+ static void testEOF(boolean readUntilEOF) throws IOException {
+ System.out.println("testEOF, readUntilEOF: " + readUntilEOF);
+ InetAddress addr = InetAddress.getLoopbackAddress();
+ ServerSocket ss = new ServerSocket();
+ ss.bind(new InetSocketAddress(addr, 0), 0);
+ int port = ss.getLocalPort();
+
+ try (Socket s = new Socket(addr, port)) {
+ s.getOutputStream().write(0x42);
+ s.shutdownOutput();
+
+ try (Socket soc = ss.accept()) {
+ ss.close();
+
+ InputStream is = soc.getInputStream();
+ int b = is.read();
+ assert b == 0x42;
+ assert !s.isClosed();
+ if (readUntilEOF) {
+ b = is.read();
+ assert b == -1;
+ }
+
+ int a;
+ for (int i = 0; i < 100; i++) {
+ a = is.available();
+ System.out.print(a + ", ");
+ if (a != 0)
+ throw new RuntimeException("Unexpected non-zero available: " + a);
+ }
+ assert !s.isClosed();
+ assert is.read() == -1;
+ }
}
+ System.out.println("\ncomplete");
}
-
}
--- a/test/jdk/java/net/URLPermission/URLTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/URLPermission/URLTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -26,8 +26,8 @@
* @test
* @bug 8010464
* @modules jdk.httpserver
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run main/othervm URLTest
* @summary check URLPermission with Http(s)URLConnection
*/
@@ -38,7 +38,7 @@
import java.util.concurrent.*;
import com.sun.net.httpserver.*;
import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
public class URLTest {
--- a/test/jdk/java/net/httpclient/AbstractNoBody.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/AbstractNoBody.java Wed Oct 17 08:09:46 2018 -0700
@@ -35,7 +35,7 @@
import com.sun.net.httpserver.HttpsServer;
import java.net.http.HttpClient;
import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/AbstractThrowingPublishers.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/AbstractThrowingPublishers.java Wed Oct 17 08:09:46 2018 -0700
@@ -24,7 +24,7 @@
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/AbstractThrowingPushPromises.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/AbstractThrowingPushPromises.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when push promise handlers and their
* response body handlers and subscribers throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker AbstractThrowingPushPromises
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
@@ -35,7 +35,7 @@
* @run testng/othervm -Djdk.internal.httpclient.debug=true AbstractThrowingPushPromises
*/
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/AbstractThrowingSubscribers.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/AbstractThrowingSubscribers.java Wed Oct 17 08:09:46 2018 -0700
@@ -24,7 +24,7 @@
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/AsFileDownloadTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/AsFileDownloadTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -31,9 +31,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @build jdk.test.lib.Platform
* @build jdk.test.lib.util.FileUtils
* @run testng/othervm AsFileDownloadTest
@@ -67,7 +67,7 @@
import java.util.Locale;
import java.util.Map;
import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import jdk.test.lib.util.FileUtils;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/AsFileDownloadTest.policy Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/AsFileDownloadTest.policy Wed Oct 17 08:09:46 2018 -0700
@@ -21,10 +21,10 @@
// questions.
//
-// for JTwork/classes/0/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.class
-grant codeBase "file:${test.classes}/../../../../lib/testlibrary/-" {
+// for JTwork/classes/0/test/lib/jdk/test/lib/net/SimpleSSLContext.class
+grant codeBase "file:${test.classes}/../../../../test/lib/-" {
permission java.util.PropertyPermission "test.src.path", "read";
- permission java.io.FilePermission "${test.src}/../../../lib/testlibrary/jdk/testlibrary/testkeys", "read";
+ permission java.io.FilePermission "${test.src}/../../../../lib/jdk/test/lib/net/testkeys", "read";
};
// for JTwork//classes/0/java/net/httpclient/http2/server/*
--- a/test/jdk/java/net/httpclient/BasicRedirectTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/BasicRedirectTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -30,9 +30,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm
* -Djdk.httpclient.HttpClient.log=trace,headers,requests
* BasicRedirectTest
@@ -53,7 +53,7 @@
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/CancelledResponse.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/CancelledResponse.java Wed Oct 17 08:09:46 2018 -0700
@@ -26,7 +26,7 @@
import java.net.http.HttpHeaders;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import javax.net.ServerSocketFactory;
import javax.net.ssl.SSLContext;
@@ -55,9 +55,9 @@
/**
* @test
* @bug 8087112
- * @library /lib/testlibrary
+ * @library /test/lib
* @modules java.net.http/jdk.internal.net.http.common
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @build MockServer ReferenceTracker
* @run main/othervm CancelledResponse
* @run main/othervm CancelledResponse SSL
--- a/test/jdk/java/net/httpclient/ConcurrentResponses.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ConcurrentResponses.java Wed Oct 17 08:09:46 2018 -0700
@@ -32,9 +32,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm
* -Djdk.httpclient.HttpClient.log=headers,errors,channel
* ConcurrentResponses
@@ -67,7 +67,7 @@
import java.net.http.HttpResponse.BodyHandlers;
import java.net.http.HttpResponse.BodySubscriber;
import java.net.http.HttpResponse.BodySubscribers;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/CookieHeaderTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/CookieHeaderTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -31,9 +31,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm
* -Djdk.tls.acknowledgeCloseNotify=true
* -Djdk.httpclient.HttpClient.log=trace,headers,requests
@@ -43,7 +43,7 @@
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/CustomRequestPublisher.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/CustomRequestPublisher.java Wed Oct 17 08:09:46 2018 -0700
@@ -30,9 +30,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm CustomRequestPublisher
*/
@@ -62,7 +62,7 @@
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/CustomResponseSubscriber.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/CustomResponseSubscriber.java Wed Oct 17 08:09:46 2018 -0700
@@ -24,8 +24,8 @@
/*
* @test
* @summary Tests response body subscribers's onComplete is not invoked before onSubscribe
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
@@ -57,7 +57,7 @@
import java.net.http.HttpResponse.BodySubscriber;
import java.net.http.HttpResponse.BodySubscribers;
import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/DependentActionsTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/DependentActionsTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -26,8 +26,8 @@
* @summary Verify that dependent synchronous actions added before the CF
* completes are executed either asynchronously in an executor when the
* CF later completes, or in the user thread that joins.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters DependentActionsTest
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters DependentActionsTest
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
@@ -43,7 +43,7 @@
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/DependentPromiseActionsTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/DependentPromiseActionsTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -26,8 +26,8 @@
* @summary Verify that dependent synchronous actions added before the promise CF
* completes are executed either asynchronously in an executor when the
* CF later completes, or in the user thread that joins.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters DependentPromiseActionsTest
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters DependentPromiseActionsTest
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
@@ -40,7 +40,7 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.StackWalker.StackFrame;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/DigestEchoClient.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/DigestEchoClient.java Wed Oct 17 08:09:46 2018 -0700
@@ -51,7 +51,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import sun.net.NetProperties;
import sun.net.www.HeaderParser;
import static java.lang.System.out;
@@ -62,8 +62,8 @@
* @summary this test verifies that a client may provides authorization
* headers directly when connecting with a server.
* @bug 8087112
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters DigestEchoServer
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters DigestEchoServer
* ReferenceTracker DigestEchoClient
* @modules java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/DigestEchoClientSSL.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/DigestEchoClientSSL.java Wed Oct 17 08:09:46 2018 -0700
@@ -26,8 +26,8 @@
* @bug 8087112
* @summary this test verifies that a client may provides authorization
* headers directly when connecting with a server over SSL.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext DigestEchoServer
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext DigestEchoServer
* DigestEchoClient ReferenceTracker DigestEchoClientSSL
* @modules java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/EchoHandler.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/EchoHandler.java Wed Oct 17 08:09:46 2018 -0700
@@ -32,7 +32,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import static java.net.http.HttpRequest.*;
import static java.net.http.HttpResponse.*;
import java.util.logging.ConsoleHandler;
--- a/test/jdk/java/net/httpclient/EncodedCharsInURI.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/EncodedCharsInURI.java Wed Oct 17 08:09:46 2018 -0700
@@ -26,8 +26,8 @@
* @bug 8199683
* @summary Tests that escaped characters in URI are correctly
* handled (not re-escaped and not unescaped)
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters EncodedCharsInURI
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters EncodedCharsInURI
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
@@ -42,7 +42,7 @@
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/EscapedOctetsInURI.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/EscapedOctetsInURI.java Wed Oct 17 08:09:46 2018 -0700
@@ -31,9 +31,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm
* -Djdk.httpclient.HttpClient.log=reqeusts,headers
* EscapedOctetsInURI
@@ -58,7 +58,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/ExpectContinue.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ExpectContinue.java Wed Oct 17 08:09:46 2018 -0700
@@ -26,8 +26,8 @@
* @summary Basic test for Expect 100-Continue ( HTTP/1.1 only )
* @modules java.net.http
* jdk.httpserver
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm ExpectContinue
*/
@@ -49,7 +49,7 @@
import java.net.http.HttpResponse.BodyHandlers;
import java.util.List;
import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/FlowAdapterPublisherTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/FlowAdapterPublisherTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -43,7 +43,7 @@
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
@@ -67,9 +67,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm FlowAdapterPublisherTest
*/
--- a/test/jdk/java/net/httpclient/FlowAdapterSubscriberTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/FlowAdapterSubscriberTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -48,7 +48,7 @@
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.net.http.HttpResponse.BodySubscribers;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
@@ -68,9 +68,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm -Djdk.internal.httpclient.debug=true FlowAdapterSubscriberTest
*/
--- a/test/jdk/java/net/httpclient/HeadTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/HeadTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -31,9 +31,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm
* -Djdk.httpclient.HttpClient.log=trace,headers,requests
* HeadTest
@@ -42,7 +42,7 @@
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/HttpClientBuilderTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/HttpClientBuilderTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -48,7 +48,7 @@
import java.net.http.HttpClient;
import java.net.http.HttpClient.Redirect;
import java.net.http.HttpClient.Version;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.Test;
import static java.time.Duration.*;
import static org.testng.Assert.*;
@@ -56,8 +56,8 @@
/*
* @test
* @summary HttpClient[.Builder] API and behaviour checks
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng HttpClientBuilderTest
*/
--- a/test/jdk/java/net/httpclient/HttpEchoHandler.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/HttpEchoHandler.java Wed Oct 17 08:09:46 2018 -0700
@@ -32,7 +32,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import static java.net.http.HttpRequest.*;
import static java.net.http.HttpResponse.*;
import java.util.logging.ConsoleHandler;
--- a/test/jdk/java/net/httpclient/HttpsTunnelTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/HttpsTunnelTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -23,7 +23,7 @@
import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import javax.net.ssl.SSLContext;
import java.net.InetAddress;
import java.net.InetSocketAddress;
@@ -49,8 +49,8 @@
* be preemptively downgraded. That, is the stack should attempt
* a new h2 connection to the new host.
* @bug 8196967
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters DigestEchoServer HttpsTunnelTest
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters DigestEchoServer HttpsTunnelTest
* @modules java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
* java.net.http/jdk.internal.net.http.hpack
--- a/test/jdk/java/net/httpclient/ImmutableFlowItems.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ImmutableFlowItems.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests response body subscribers's onNext's Lists are unmodifiable,
* and that the buffers are read-only
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
@@ -57,7 +57,7 @@
import java.net.http.HttpResponse.BodySubscriber;
import java.net.http.HttpResponse.BodySubscribers;
import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/InvalidInputStreamSubscriptionRequest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/InvalidInputStreamSubscriptionRequest.java Wed Oct 17 08:09:46 2018 -0700
@@ -26,8 +26,8 @@
* @summary Tests an asynchronous BodySubscriber that completes
* immediately with an InputStream which issues bad
* requests
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext ReferenceTracker
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext ReferenceTracker
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
@@ -38,7 +38,7 @@
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/InvalidSSLContextTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/InvalidSSLContextTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Test to ensure the HTTP client throws an appropriate SSL exception
* when SSL context is not valid.
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm -Djdk.internal.httpclient.debug=true InvalidSSLContextTest
*/
@@ -47,7 +47,7 @@
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/InvalidSubscriptionRequest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/InvalidSubscriptionRequest.java Wed Oct 17 08:09:46 2018 -0700
@@ -27,8 +27,8 @@
* @summary Tests an asynchronous BodySubscriber that completes
* immediately with a Publisher<List<ByteBuffer>> whose
* subscriber issues bad requests
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext ReferenceTracker
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext ReferenceTracker
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
@@ -39,7 +39,7 @@
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/LightWeightHttpServer.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/LightWeightHttpServer.java Wed Oct 17 08:09:46 2018 -0700
@@ -22,8 +22,8 @@
*/
/**
- * library /lib/testlibrary/ /
- * build jdk.testlibrary.SimpleSSLContext ProxyServer
+ * library /test/lib /
+ * build jdk.test.lib.net.SimpleSSLContext ProxyServer
* compile ../../../com/sun/net/httpserver/LogFilter.java
* compile ../../../com/sun/net/httpserver/EchoHandler.java
* compile ../../../com/sun/net/httpserver/FileServerHandler.java
@@ -50,7 +50,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
public class LightWeightHttpServer {
--- a/test/jdk/java/net/httpclient/LineBodyHandlerTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/LineBodyHandlerTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -52,7 +52,7 @@
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
@@ -77,9 +77,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer LineBodyHandlerTest HttpServerAdapters
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm LineBodyHandlerTest
*/
--- a/test/jdk/java/net/httpclient/ManyRequests.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ManyRequests.java Wed Oct 17 08:09:46 2018 -0700
@@ -27,8 +27,8 @@
* @modules java.net.http
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary/ /
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @compile ../../../com/sun/net/httpserver/LogFilter.java
* @compile ../../../com/sun/net/httpserver/EchoHandler.java
* @compile ../../../com/sun/net/httpserver/FileServerHandler.java
@@ -63,7 +63,7 @@
import java.util.logging.Level;
import java.util.concurrent.CompletableFuture;
import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
public class ManyRequests {
--- a/test/jdk/java/net/httpclient/ManyRequests2.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ManyRequests2.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -27,8 +27,8 @@
* @modules java.net.http
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary/ /
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @compile ../../../com/sun/net/httpserver/LogFilter.java
* @compile ../../../com/sun/net/httpserver/EchoHandler.java
* @compile ../../../com/sun/net/httpserver/FileServerHandler.java
@@ -36,8 +36,11 @@
* @run main/othervm/timeout=40 -Dtest.XFixed=true ManyRequests2
* @run main/othervm/timeout=40 -Dtest.XFixed=true -Dtest.insertDelay=true ManyRequests2
* @run main/othervm/timeout=40 -Dtest.XFixed=true -Dtest.chunkSize=64 ManyRequests2
- * @run main/othervm/timeout=40 -Djdk.internal.httpclient.debug=true -Dtest.XFixed=true -Dtest.insertDelay=true -Dtest.chunkSize=64 ManyRequests2
- * @summary Send a large number of requests asynchronously. The server echoes back using known content length.
+ * @run main/othervm/timeout=40 -Djdk.internal.httpclient.debug=true
+ * -Dtest.XFixed=true -Dtest.insertDelay=true
+ * -Dtest.chunkSize=64 ManyRequests2
+ * @summary Send a large number of requests asynchronously.
+ * The server echoes back using known content length.
*/
// * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=ssl ManyRequests
--- a/test/jdk/java/net/httpclient/ManyRequestsLegacy.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ManyRequestsLegacy.java Wed Oct 17 08:09:46 2018 -0700
@@ -26,16 +26,19 @@
* @modules java.net.http
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary/ /
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @compile ../../../com/sun/net/httpserver/LogFilter.java
* @compile ../../../com/sun/net/httpserver/EchoHandler.java
* @compile ../../../com/sun/net/httpserver/FileServerHandler.java
* @run main/othervm/timeout=40 ManyRequestsLegacy
* @run main/othervm/timeout=40 -Dtest.insertDelay=true ManyRequestsLegacy
* @run main/othervm/timeout=40 -Dtest.chunkSize=64 ManyRequestsLegacy
- * @run main/othervm/timeout=40 -Dtest.insertDelay=true -Dtest.chunkSize=64 ManyRequestsLegacy
- * @summary Send a large number of requests asynchronously using the legacy URL.openConnection(), to help sanitize results of the test ManyRequest.java.
+ * @run main/othervm/timeout=40 -Dtest.insertDelay=true
+ * -Dtest.chunkSize=64 ManyRequestsLegacy
+ * @summary Send a large number of requests asynchronously using the legacy
+ * URL.openConnection(), to help sanitize results of the test
+ * ManyRequest.java.
*/
import javax.net.ssl.HttpsURLConnection;
@@ -70,7 +73,7 @@
import java.util.Random;
import java.util.logging.Logger;
import java.util.logging.Level;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
public class ManyRequestsLegacy {
--- a/test/jdk/java/net/httpclient/MappingResponseSubscriber.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/MappingResponseSubscriber.java Wed Oct 17 08:09:46 2018 -0700
@@ -24,8 +24,8 @@
/*
* @test
* @summary Tests mapped response subscriber
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
@@ -62,7 +62,7 @@
import java.net.http.HttpResponse.BodySubscriber;
import java.util.function.Function;
import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/MaxStreams.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/MaxStreams.java Wed Oct 17 08:09:46 2018 -0700
@@ -32,9 +32,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm -ea -esa MaxStreams
*/
@@ -60,7 +60,7 @@
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandler;
import java.net.http.HttpResponse.BodyHandlers;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/NoBodyPartOne.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/NoBodyPartOne.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @bug 8161157
* @summary Test response body handlers/subscribers when there is no body
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/NoBodyPartTwo.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/NoBodyPartTwo.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @bug 8161157
* @summary Test response body handlers/subscribers when there is no body
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/NonAsciiCharsInURI.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/NonAsciiCharsInURI.java Wed Oct 17 08:09:46 2018 -0700
@@ -32,9 +32,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @compile -encoding utf-8 NonAsciiCharsInURI.java
* @run testng/othervm
* -Djdk.httpclient.HttpClient.log=reqeusts,headers
@@ -58,7 +58,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemes.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemes.java Wed Oct 17 08:09:46 2018 -0700
@@ -28,8 +28,8 @@
* it verifies that the client honor the jdk.http.auth.*.disabledSchemes
* net properties.
* @bug 8087112
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext DigestEchoServer DigestEchoClient
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext DigestEchoServer DigestEchoClient
* ReferenceTracker ProxyAuthDisabledSchemes
* @modules java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemesSSL.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemesSSL.java Wed Oct 17 08:09:46 2018 -0700
@@ -28,8 +28,8 @@
* headers directly when connecting with a server over SSL, and
* it verifies that the client honor the jdk.http.auth.*.disabledSchemes
* net properties.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext DigestEchoServer DigestEchoClient
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext DigestEchoServer DigestEchoClient
* ReferenceTracker ProxyAuthDisabledSchemesSSL
* @modules java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/ProxyTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ProxyTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -56,7 +56,7 @@
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
/**
* @test
@@ -67,8 +67,8 @@
* an SSL Tunnel connection when the client is HTTP/2 and the server
* and proxy are HTTP/1.1
* @modules java.net.http
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext ProxyTest
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext ProxyTest
* @run main/othervm ProxyTest
* @author danielfuchs
*/
--- a/test/jdk/java/net/httpclient/RedirectMethodChange.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/RedirectMethodChange.java Wed Oct 17 08:09:46 2018 -0700
@@ -29,9 +29,9 @@
* java.net.http/jdk.internal.net.http.frame
* java.net.http/jdk.internal.net.http.hpack
* jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm RedirectMethodChange
*/
@@ -50,7 +50,7 @@
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/RedirectWithCookie.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/RedirectWithCookie.java Wed Oct 17 08:09:46 2018 -0700
@@ -30,9 +30,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm
* -Djdk.httpclient.HttpClient.log=trace,headers,requests
* RedirectWithCookie
@@ -55,7 +55,7 @@
import java.net.http.HttpResponse.BodyHandlers;
import java.util.List;
import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/RequestBodyTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/RequestBodyTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -27,11 +27,11 @@
* @modules java.net.http
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary/ /test/lib
+ * @library /test/lib
* @compile ../../../com/sun/net/httpserver/LogFilter.java
* @compile ../../../com/sun/net/httpserver/EchoHandler.java
* @compile ../../../com/sun/net/httpserver/FileServerHandler.java
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @build LightWeightHttpServer
* @build jdk.test.lib.Platform
* @build jdk.test.lib.util.FileUtils
--- a/test/jdk/java/net/httpclient/RequestBodyTest.policy Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/RequestBodyTest.policy Wed Oct 17 08:09:46 2018 -0700
@@ -27,10 +27,10 @@
permission java.io.FilePermission "RequestBodyTest.tmp", "read,delete";
};
-// for JTwork/classes/0/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.class
-grant codeBase "file:${test.classes}/../../../../lib/testlibrary/-" {
+// for JTwork/classes/0/test/lib/jdk/test/lib/net/SimpleSSLContext.class
+grant codeBase "file:${test.classes}/../../../../test/lib/-" {
permission java.util.PropertyPermission "test.src.path", "read";
- permission java.io.FilePermission "${test.src}/../../../lib/testlibrary/jdk/testlibrary/testkeys", "read";
+ permission java.io.FilePermission "${test.src}/../../../../lib/jdk/test/lib/net/testkeys", "read";
};
grant codeBase "file:${test.classes}/*" {
--- a/test/jdk/java/net/httpclient/RequestBuilderTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/RequestBuilderTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -337,15 +337,31 @@
}
}
+ // headers that are allowed now, but weren't before
+ private static final Set<String> FORMERLY_RESTRICTED = Set.of("referer", "origin",
+ "OriGin", "Referer");
+
+ @Test
+ public void testFormerlyRestricted() throws URISyntaxException {
+ URI uri = new URI("http://localhost:80/test/");
+ URI otherURI = new URI("http://www.foo.com/test/");
+ for (String header : FORMERLY_RESTRICTED) {
+ HttpRequest req = HttpRequest.newBuilder(uri)
+ .header(header, otherURI.toString())
+ .GET()
+ .build();
+ }
+ }
+
private static final Set<String> RESTRICTED = Set.of("connection", "content-length",
- "date", "expect", "from", "host", "origin",
- "referer", "upgrade", "via", "warning",
+ "date", "expect", "from", "host",
+ "upgrade", "via", "warning",
"Connection", "Content-Length",
- "DATE", "eXpect", "frOm", "hosT", "origIN",
- "ReFerer", "upgradE", "vIa", "Warning",
+ "DATE", "eXpect", "frOm", "hosT",
+ "upgradE", "vIa", "Warning",
"CONNection", "CONTENT-LENGTH",
- "Date", "EXPECT", "From", "Host", "Origin",
- "Referer", "Upgrade", "Via", "WARNING");
+ "Date", "EXPECT", "From", "Host",
+ "Upgrade", "Via", "WARNING");
interface WithHeader {
HttpRequest.Builder withHeader(HttpRequest.Builder builder, String name, String value);
--- a/test/jdk/java/net/httpclient/ResponseBodyBeforeError.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ResponseBodyBeforeError.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests that all response body is delivered to the BodySubscriber
* before an abortive error terminates the flow
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm ResponseBodyBeforeError
*/
@@ -52,7 +52,7 @@
import java.util.concurrent.CompletionStage;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Flow;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/ResponsePublisher.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ResponsePublisher.java Wed Oct 17 08:09:46 2018 -0700
@@ -26,8 +26,8 @@
* @bug 8201186
* @summary Tests an asynchronous BodySubscriber that completes
* immediately with a Publisher<List<ByteBuffer>>
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
@@ -40,7 +40,7 @@
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/RetryWithCookie.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/RetryWithCookie.java Wed Oct 17 08:09:46 2018 -0700
@@ -31,9 +31,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext ReferenceTracker
+ * @build jdk.test.lib.net.SimpleSSLContext ReferenceTracker
* @run testng/othervm
* -Djdk.httpclient.HttpClient.log=trace,headers,requests
* RetryWithCookie
@@ -42,7 +42,7 @@
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/ServerCloseTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ServerCloseTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests that our client deals correctly with servers that
* close the connection right after sending the last byte.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters EncodedCharsInURI
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters EncodedCharsInURI
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
@@ -35,7 +35,7 @@
*/
//* -Djdk.internal.httpclient.debug=true
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/net/httpclient/ShortResponseBody.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ShortResponseBody.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests Exception detail message when too few response bytes are
* received before a socket exception or eof.
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm
* -Djdk.httpclient.HttpClient.log=headers,errors,channel
* ShortResponseBody
@@ -55,7 +55,7 @@
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Stream;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/ShortResponseBodyWithRetry.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ShortResponseBodyWithRetry.java Wed Oct 17 08:09:46 2018 -0700
@@ -24,8 +24,8 @@
/*
* @test
* @summary Run of ShortResponseBody with -Djdk.httpclient.enableAllMethodRetry
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @build ShortResponseBody
* @run testng/othervm
* -Djdk.httpclient.HttpClient.log=headers,errors,channel
--- a/test/jdk/java/net/httpclient/SmokeTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/SmokeTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -27,8 +27,8 @@
* @modules java.net.http
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary/ /
- * @build jdk.testlibrary.SimpleSSLContext ProxyServer
+ * @library /test/lib /
+ * @build jdk.test.lib.net.SimpleSSLContext ProxyServer
* @compile ../../../com/sun/net/httpserver/LogFilter.java
* @compile ../../../com/sun/net/httpserver/EchoHandler.java
* @compile ../../../com/sun/net/httpserver/FileServerHandler.java
@@ -88,7 +88,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;
import static java.nio.file.StandardOpenOption.WRITE;
--- a/test/jdk/java/net/httpclient/SpecialHeadersTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/SpecialHeadersTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -32,9 +32,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer HttpServerAdapters SpecialHeadersTest
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm
* -Djdk.httpclient.HttpClient.log=requests,headers,errors
* SpecialHeadersTest
@@ -43,7 +43,7 @@
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
@@ -57,21 +57,25 @@
import java.net.InetSocketAddress;
import java.net.URI;
import java.net.http.HttpClient;
+import java.net.http.HttpHeaders;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.Optional;
import static java.lang.System.err;
import static java.lang.System.out;
import static java.net.http.HttpClient.Builder.NO_PROXY;
import static java.nio.charset.StandardCharsets.US_ASCII;
+import org.testng.Assert;
import static org.testng.Assert.assertEquals;
public class SpecialHeadersTest implements HttpServerAdapters {
@@ -91,6 +95,13 @@
{"User-Agent: camel-cased"},
{"user-agent: all-lower-case"},
{"user-Agent: mixed"},
+ // headers which were restricted before and are now allowable
+ {"referer: lower"},
+ {"Referer: normal"},
+ {"REFERER: upper"},
+ {"origin: lower"},
+ {"Origin: normal"},
+ {"ORIGIN: upper"},
};
@DataProvider(name = "variants")
@@ -169,6 +180,50 @@
}
@Test(dataProvider = "variants")
+ void testHomeMadeIllegalHeader(String uriString, String headerNameAndValue, boolean sameClient) throws Exception {
+ out.println("\n--- Starting ");
+ final URI uri = URI.create(uriString);
+
+ HttpClient client = HttpClient.newBuilder()
+ .proxy(NO_PROXY)
+ .sslContext(sslContext)
+ .build();
+
+ // Test a request which contains an illegal header created
+ HttpRequest req = new HttpRequest() {
+ @Override public Optional<BodyPublisher> bodyPublisher() {
+ return Optional.of(BodyPublishers.noBody());
+ }
+ @Override public String method() {
+ return "GET";
+ }
+ @Override public Optional<Duration> timeout() {
+ return Optional.empty();
+ }
+ @Override public boolean expectContinue() {
+ return false;
+ }
+ @Override public URI uri() {
+ return uri;
+ }
+ @Override public Optional<HttpClient.Version> version() {
+ return Optional.empty();
+ }
+ @Override public HttpHeaders headers() {
+ Map<String, List<String>> map = Map.of("via", List.of("http://foo.com"));
+ return HttpHeaders.of(map, (x, y) -> true);
+ }
+ };
+
+ try {
+ HttpResponse<String> response = client.send(req, BodyHandlers.ofString());
+ Assert.fail("Unexpected reply: " + response);
+ } catch (IllegalArgumentException ee) {
+ out.println("Got IAE as expected");
+ }
+ }
+
+ @Test(dataProvider = "variants")
void testAsync(String uriString, String headerNameAndValue, boolean sameClient) {
out.println("\n--- Starting ");
int index = headerNameAndValue.indexOf(":");
@@ -259,7 +314,10 @@
https2TestServer.stop();
}
- /** A handler that returns, as its body, the exact received request URI. */
+ /** A handler that returns, as its body, the exact received request URI.
+ * The header whose name is in the URI query and is set in the request is
+ * returned in the response with its name prefixed by X-
+ */
static class HttpUriStringHandler implements HttpTestHandler {
@Override
public void handle(HttpTestExchange t) throws IOException {
--- a/test/jdk/java/net/httpclient/SplitResponse.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/SplitResponse.java Wed Oct 17 08:09:46 2018 -0700
@@ -40,7 +40,7 @@
import java.net.http.HttpResponse;
import java.util.stream.Stream;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import static java.lang.System.out;
import static java.lang.String.format;
import static java.nio.charset.StandardCharsets.ISO_8859_1;
@@ -49,8 +49,8 @@
/**
* @test
* @bug 8087112
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @build MockServer
* @run main/othervm
* -Djdk.internal.httpclient.debug=true
--- a/test/jdk/java/net/httpclient/SplitResponseAsync.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/SplitResponseAsync.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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,8 +24,8 @@
/**
* @test
* @bug 8087112
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @build MockServer SplitResponse
* @run main/othervm
* -Djdk.internal.httpclient.debug=true
--- a/test/jdk/java/net/httpclient/SplitResponseKeepAlive.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/SplitResponseKeepAlive.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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,8 +24,8 @@
/**
* @test
* @bug 8087112
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @build MockServer SplitResponse
* @run main/othervm
* -Djdk.internal.httpclient.debug=true
--- a/test/jdk/java/net/httpclient/SplitResponseKeepAliveAsync.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/SplitResponseKeepAliveAsync.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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,8 +24,8 @@
/**
* @test
* @bug 8087112
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @build MockServer SplitResponse
* @run main/othervm
* -Djdk.internal.httpclient.debug=true
--- a/test/jdk/java/net/httpclient/SplitResponseSSL.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/SplitResponseSSL.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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,8 +24,8 @@
/**
* @test
* @bug 8087112
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @build MockServer SplitResponse
* @run main/othervm
* -Djdk.internal.httpclient.debug=true
--- a/test/jdk/java/net/httpclient/SplitResponseSSLAsync.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/SplitResponseSSLAsync.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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,8 +24,8 @@
/**
* @test
* @bug 8087112
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @build MockServer SplitResponse
* @run main/othervm
* -Djdk.internal.httpclient.debug=true
--- a/test/jdk/java/net/httpclient/SplitResponseSSLKeepAlive.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/SplitResponseSSLKeepAlive.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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,8 +24,8 @@
/**
* @test
* @bug 8087112
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @build MockServer SplitResponse
* @run main/othervm
* -Djdk.internal.httpclient.debug=true
--- a/test/jdk/java/net/httpclient/SplitResponseSSLKeepAliveAsync.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/SplitResponseSSLKeepAliveAsync.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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,8 +24,8 @@
/**
* @test
* @bug 8087112
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @build MockServer SplitResponse
* @run main/othervm
* -Djdk.internal.httpclient.debug=true
--- a/test/jdk/java/net/httpclient/StreamingBody.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/StreamingBody.java Wed Oct 17 08:09:46 2018 -0700
@@ -31,9 +31,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm
* -Djdk.httpclient.HttpClient.log=trace,headers,requests
* StreamingBody
@@ -53,7 +53,7 @@
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import javax.net.ssl.SSLContext;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/ThrowingPublishersCustomAfterCancel.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersCustomAfterCancel.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when request publishers
* throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker AbstractThrowingPublishers ThrowingPublishersCustomAfterCancel
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPublishersCustomBeforeCancel.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersCustomBeforeCancel.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when request publishers
* throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker AbstractThrowingPublishers ThrowingPublishersCustomBeforeCancel
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPublishersIOAfterCancel.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersIOAfterCancel.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when request publishers
* throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker AbstractThrowingPublishers ThrowingPublishersIOAfterCancel
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPublishersIOBeforeCancel.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersIOBeforeCancel.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when request publishers
* throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker AbstractThrowingPublishers ThrowingPublishersIOBeforeCancel
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPublishersInNextRequest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersInNextRequest.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when request publishers
* throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker AbstractThrowingPublishers ThrowingPublishersInNextRequest
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPublishersInRequest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersInRequest.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when request publishers
* throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker AbstractThrowingPublishers ThrowingPublishersInRequest
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPublishersInSubscribe.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersInSubscribe.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when request publishers
* throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker AbstractThrowingPublishers ThrowingPublishersInSubscribe
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPublishersSanity.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersSanity.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when request publishers
* throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker AbstractThrowingPublishers ThrowingPublishersSanity
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamCustom.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamCustom.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when push promise handlers and their
* response body handlers and subscribers throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsInputStreamCustom
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamIO.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamIO.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when push promise handlers and their
* response body handlers and subscribers throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsInputStreamIO
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesCustom.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesCustom.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when push promise handlers and their
* response body handlers and subscribers throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsLinesCustom
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesIO.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesIO.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when push promise handlers and their
* response body handlers and subscribers throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsLinesIO
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringCustom.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringCustom.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when push promise handlers and their
* response body handlers and subscribers throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsStringCustom
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringIO.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringIO.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when push promise handlers and their
* response body handlers and subscribers throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesAsStringIO
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingPushPromisesSanity.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesSanity.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when push promise handlers and their
* response body handlers and subscribers throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker AbstractThrowingPushPromises ThrowingPushPromisesSanity
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStream.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStream.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when response body handlers and subscribers
* throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker ThrowingSubscribersAsInputStream AbstractThrowingSubscribers
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStreamAsync.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStreamAsync.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when response body handlers and subscribers
* throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker ThrowingSubscribersAsInputStreamAsync AbstractThrowingSubscribers
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsLines.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsLines.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when response body handlers and subscribers
* throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker ThrowingSubscribersAsLines AbstractThrowingSubscribers
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsLinesAsync.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsLinesAsync.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when response body handlers and subscribers
* throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker ThrowingSubscribersAsLinesAsync AbstractThrowingSubscribers
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsString.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsString.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when response body handlers and subscribers
* throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker ThrowingSubscribersAsString AbstractThrowingSubscribers
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingSubscribersAsStringAsync.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsStringAsync.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when response body handlers and subscribers
* throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker ThrowingSubscribersAsStringAsync AbstractThrowingSubscribers
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/ThrowingSubscribersSanity.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersSanity.java Wed Oct 17 08:09:46 2018 -0700
@@ -25,8 +25,8 @@
* @test
* @summary Tests what happens when response body handlers and subscribers
* throw unexpected exceptions.
- * @library /lib/testlibrary http2/server
- * @build jdk.testlibrary.SimpleSSLContext HttpServerAdapters
+ * @library /test/lib http2/server
+ * @build jdk.test.lib.net.SimpleSSLContext HttpServerAdapters
* ReferenceTracker ThrowingSubscribersSanity AbstractThrowingSubscribers
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
--- a/test/jdk/java/net/httpclient/TimeoutBasic.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/TimeoutBasic.java Wed Oct 17 08:09:46 2018 -0700
@@ -31,7 +31,7 @@
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.net.http.HttpTimeoutException;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import javax.net.ServerSocketFactory;
import javax.net.ssl.SSLContext;
@@ -46,8 +46,8 @@
/**
* @test
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @summary Basic tests for response timeouts
* @run main/othervm TimeoutBasic
*/
--- a/test/jdk/java/net/httpclient/UnauthorizedTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/UnauthorizedTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -35,9 +35,9 @@
* java.net.http/jdk.internal.net.http.hpack
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary /test/lib http2/server
+ * @library /test/lib http2/server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm
* -Djdk.httpclient.HttpClient.log=headers
* UnauthorizedTest
@@ -46,7 +46,7 @@
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsServer;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -35,13 +35,13 @@
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
/**
* @test
* @bug 8207966
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run main/othervm -Djdk.tls.acknowledgeCloseNotify=true UnknownBodyLengthTest plain false
* @run main/othervm -Djdk.tls.acknowledgeCloseNotify=true UnknownBodyLengthTest SSL false
* @run main/othervm -Djdk.tls.acknowledgeCloseNotify=true UnknownBodyLengthTest plain true
--- a/test/jdk/java/net/httpclient/dependent.policy Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/dependent.policy Wed Oct 17 08:09:46 2018 -0700
@@ -21,10 +21,10 @@
// questions.
//
-// for JTwork/classes/0/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.class
-grant codeBase "file:${test.classes}/../../../../lib/testlibrary/-" {
+// for JTwork/classes/0/test/lib/jdk/test/lib/net/SimpleSSLContext.class
+grant codeBase "file:${test.classes}/../../../../test/lib/-" {
permission java.util.PropertyPermission "test.src.path", "read";
- permission java.io.FilePermission "${test.src}/../../../lib/testlibrary/jdk/testlibrary/testkeys", "read";
+ permission java.io.FilePermission "${test.src}/../../../../lib/jdk/test/lib/net/testkeys", "read";
};
// for JTwork//classes/0/java/net/httpclient/http2/server/*
--- a/test/jdk/java/net/httpclient/http2/BadHeadersTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/http2/BadHeadersTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -27,9 +27,9 @@
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
* java.net.http/jdk.internal.net.http.hpack
- * @library /lib/testlibrary server
+ * @library /test/lib server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm -Djdk.internal.httpclient.debug=true BadHeadersTest
*/
@@ -38,7 +38,7 @@
import jdk.internal.net.http.frame.HeaderFrame;
import jdk.internal.net.http.frame.HeadersFrame;
import jdk.internal.net.http.frame.Http2Frame;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/http2/BasicTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/http2/BasicTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -24,8 +24,8 @@
/*
* @test
* @bug 8087112
- * @library /lib/testlibrary server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib server
+ * @build jdk.test.lib.net.SimpleSSLContext
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
@@ -47,7 +47,7 @@
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.Test;
import static java.net.http.HttpClient.Version.HTTP_2;
--- a/test/jdk/java/net/httpclient/http2/ContinuationFrameTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/http2/ContinuationFrameTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -28,9 +28,9 @@
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
* java.net.http/jdk.internal.net.http.hpack
- * @library /lib/testlibrary server
+ * @library /test/lib server
* @build Http2TestServer
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run testng/othervm ContinuationFrameTest
*/
@@ -55,7 +55,7 @@
import jdk.internal.net.http.frame.HeaderFrame;
import jdk.internal.net.http.frame.HeadersFrame;
import jdk.internal.net.http.frame.Http2Frame;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/http2/ErrorTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/http2/ErrorTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -24,8 +24,8 @@
/*
* @test
* @bug 8157105
- * @library /lib/testlibrary server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib server
+ * @build jdk.test.lib.net.SimpleSSLContext
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
@@ -46,7 +46,7 @@
import javax.net.ssl.SSLParameters;
import java.util.concurrent.Executors;
import java.util.concurrent.ExecutorService;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import static java.net.http.HttpClient.Version.HTTP_2;
import org.testng.annotations.Test;
--- a/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -24,8 +24,8 @@
/*
* @test
* @bug 8087112 8177935
- * @library /lib/testlibrary server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib server
+ * @build jdk.test.lib.net.SimpleSSLContext
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
@@ -40,7 +40,7 @@
import javax.net.ssl.*;
import java.nio.file.*;
import java.util.concurrent.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import static java.net.http.HttpClient.Version.HTTP_2;
import org.testng.annotations.Test;
--- a/test/jdk/java/net/httpclient/http2/ImplicitPushCancel.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/http2/ImplicitPushCancel.java Wed Oct 17 08:09:46 2018 -0700
@@ -23,8 +23,8 @@
/*
* @test
- * @library /lib/testlibrary server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib server
+ * @build jdk.test.lib.net.SimpleSSLContext
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/http2/ProxyTest2.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/http2/ProxyTest2.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -52,7 +52,7 @@
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import java.util.concurrent.*;
/**
@@ -61,12 +61,12 @@
* @summary Verifies that you can access an HTTP/2 server over HTTPS by
* tunnelling through an HTTP/1.1 proxy.
* @modules java.net.http
- * @library /lib/testlibrary server
+ * @library /test/lib server
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
* java.net.http/jdk.internal.net.http.hpack
- * @build jdk.testlibrary.SimpleSSLContext ProxyTest2
+ * @build jdk.test.lib.net.SimpleSSLContext ProxyTest2
* @run main/othervm ProxyTest2
* @author danielfuchs
*/
--- a/test/jdk/java/net/httpclient/http2/RedirectTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/http2/RedirectTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -24,8 +24,8 @@
/*
* @test
* @bug 8156514
- * @library /lib/testlibrary server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib server
+ * @build jdk.test.lib.net.SimpleSSLContext
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/http2/ServerPush.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/http2/ServerPush.java Wed Oct 17 08:09:46 2018 -0700
@@ -24,8 +24,8 @@
/*
* @test
* @bug 8087112 8159814
- * @library /lib/testlibrary server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib server
+ * @build jdk.test.lib.net.SimpleSSLContext
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/http2/ServerPushWithDiffTypes.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/http2/ServerPushWithDiffTypes.java Wed Oct 17 08:09:46 2018 -0700
@@ -23,8 +23,8 @@
/*
* @test
- * @library /lib/testlibrary server
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib server
+ * @build jdk.test.lib.net.SimpleSSLContext
* @modules java.base/sun.net.www.http
* java.net.http/jdk.internal.net.http.common
* java.net.http/jdk.internal.net.http.frame
--- a/test/jdk/java/net/httpclient/security/Driver.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/security/Driver.java Wed Oct 17 08:09:46 2018 -0700
@@ -24,12 +24,11 @@
/*
* @test
* @bug 8087112
- * @library /lib/testlibrary/
* @library /test/lib
* @modules java.net.http
* java.logging
* jdk.httpserver
- * @build jdk.testlibrary.SimpleSSLContext jdk.test.lib.Utils
+ * @build jdk.test.lib.net.SimpleSSLContext jdk.test.lib.Utils
* @compile ../../../../com/sun/net/httpserver/LogFilter.java
* @compile ../../../../com/sun/net/httpserver/FileServerHandler.java
* @compile ../ProxyServer.java
--- a/test/jdk/java/net/httpclient/security/Security.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/security/Security.java Wed Oct 17 08:09:46 2018 -0700
@@ -27,8 +27,8 @@
* @modules java.net.http
* java.logging
* jdk.httpserver
- * @library /lib/testlibrary/
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @compile ../../../../com/sun/net/httpserver/LogFilter.java
* @compile ../../../../com/sun/net/httpserver/FileServerHandler.java
* @compile ../ProxyServer.java
--- a/test/jdk/java/net/httpclient/websocket/WSHandshakeExceptionTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/websocket/WSHandshakeExceptionTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -24,8 +24,8 @@
/*
* @test
* @summary Basic test for WebSocketHandshakeException
- * @library /lib/testlibrary
- * @build jdk.testlibrary.SimpleSSLContext
+ * @library /test/lib
+ * @build jdk.test.lib.net.SimpleSSLContext
* @modules java.net.http
* jdk.httpserver
* @run testng/othervm -Djdk.internal.httpclient.debug=true WSHandshakeExceptionTest
@@ -39,7 +39,7 @@
import java.net.http.HttpClient;
import java.net.http.WebSocket;
import java.net.http.WebSocketHandshakeException;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
--- a/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/AbstractSSLTubeTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/AbstractSSLTubeTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -28,22 +28,13 @@
import jdk.internal.net.http.common.Utils;
import org.testng.annotations.Test;
-import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLParameters;
-import javax.net.ssl.TrustManagerFactory;
-import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
-import java.security.KeyManagementException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.CertificateException;
import java.util.List;
import java.util.StringTokenizer;
import java.util.concurrent.CompletableFuture;
@@ -244,76 +235,4 @@
engine.setUseClientMode(client);
return engine;
}
-
- /**
- * Creates a simple usable SSLContext for SSLSocketFactory or a HttpsServer
- * using either a given keystore or a default one in the test tree.
- *
- * Using this class with a security manager requires the following
- * permissions to be granted:
- *
- * permission "java.util.PropertyPermission" "test.src.path", "read";
- * permission java.io.FilePermission "${test.src}/../../../../lib/testlibrary/jdk/testlibrary/testkeys",
- * "read"; The exact path above depends on the location of the test.
- */
- protected static class SimpleSSLContext {
-
- private final SSLContext ssl;
-
- /**
- * Loads default keystore from SimpleSSLContext source directory
- */
- public SimpleSSLContext() throws IOException {
- String paths = System.getProperty("test.src.path");
- StringTokenizer st = new StringTokenizer(paths, File.pathSeparator);
- boolean securityExceptions = false;
- SSLContext sslContext = null;
- while (st.hasMoreTokens()) {
- String path = st.nextToken();
- try {
- File f = new File(path, "../../../../lib/testlibrary/jdk/testlibrary/testkeys");
- if (f.exists()) {
- try (FileInputStream fis = new FileInputStream(f)) {
- sslContext = init(fis);
- break;
- }
- }
- } catch (SecurityException e) {
- // catch and ignore because permission only required
- // for one entry on path (at most)
- securityExceptions = true;
- }
- }
- if (securityExceptions) {
- System.err.println("SecurityExceptions thrown on loading testkeys");
- }
- ssl = sslContext;
- }
-
- private SSLContext init(InputStream i) throws IOException {
- try {
- char[] passphrase = "passphrase".toCharArray();
- KeyStore ks = KeyStore.getInstance("JKS");
- ks.load(i, passphrase);
-
- KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
- kmf.init(ks, passphrase);
-
- TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
- tmf.init(ks);
-
- SSLContext ssl = SSLContext.getInstance("TLS");
- ssl.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
- return ssl;
- } catch (KeyManagementException | KeyStoreException |
- UnrecoverableKeyException | CertificateException |
- NoSuchAlgorithmException e) {
- throw new RuntimeException(e.getMessage());
- }
- }
-
- public SSLContext get() {
- return ssl;
- }
- }
}
--- a/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/FlowTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/FlowTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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,8 +24,6 @@
package jdk.internal.net.http;
import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -33,12 +31,6 @@
import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.ByteBuffer;
-import java.security.KeyManagementException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.CertificateException;
import java.util.List;
import java.util.Random;
import java.util.StringTokenizer;
@@ -53,9 +45,7 @@
import java.util.concurrent.SubmissionPublisher;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
-import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.*;
-import javax.net.ssl.TrustManagerFactory;
import jdk.internal.net.http.common.Utils;
import org.testng.annotations.Test;
import jdk.internal.net.http.common.SSLFlowDelegate;
@@ -467,80 +457,6 @@
}
}
- /**
- * Creates a simple usable SSLContext for SSLSocketFactory
- * or a HttpsServer using either a given keystore or a default
- * one in the test tree.
- * <p>
- * Using this class with a security manager requires the following
- * permissions to be granted:
- * <p>
- * permission "java.util.PropertyPermission" "test.src.path", "read";
- * permission java.io.FilePermission
- * "${test.src}/../../../../lib/testlibrary/jdk/testlibrary/testkeys", "read";
- * The exact path above depends on the location of the test.
- */
- static class SimpleSSLContext {
-
- private final SSLContext ssl;
-
- /**
- * Loads default keystore from SimpleSSLContext source directory
- */
- public SimpleSSLContext() throws IOException {
- String paths = System.getProperty("test.src.path");
- StringTokenizer st = new StringTokenizer(paths, File.pathSeparator);
- boolean securityExceptions = false;
- SSLContext sslContext = null;
- while (st.hasMoreTokens()) {
- String path = st.nextToken();
- try {
- File f = new File(path, "../../../../lib/testlibrary/jdk/testlibrary/testkeys");
- if (f.exists()) {
- try (FileInputStream fis = new FileInputStream(f)) {
- sslContext = init(fis);
- break;
- }
- }
- } catch (SecurityException e) {
- // catch and ignore because permission only required
- // for one entry on path (at most)
- securityExceptions = true;
- }
- }
- if (securityExceptions) {
- System.out.println("SecurityExceptions thrown on loading testkeys");
- }
- ssl = sslContext;
- }
-
- private SSLContext init(InputStream i) throws IOException {
- try {
- char[] passphrase = "passphrase".toCharArray();
- KeyStore ks = KeyStore.getInstance("JKS");
- ks.load(i, passphrase);
-
- KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
- kmf.init(ks, passphrase);
-
- TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
- tmf.init(ks);
-
- SSLContext ssl = SSLContext.getInstance("TLS");
- ssl.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
- return ssl;
- } catch (KeyManagementException | KeyStoreException |
- UnrecoverableKeyException | CertificateException |
- NoSuchAlgorithmException e) {
- throw new RuntimeException(e.getMessage());
- }
- }
-
- public SSLContext get() {
- return ssl;
- }
- }
-
private static void sleep(int millis) {
try {
Thread.sleep(millis);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/SimpleSSLContext.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.internal.net.http;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateException;
+import java.util.StringTokenizer;
+
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManagerFactory;
+
+/**
+ * Creates a simple usable SSLContext for SSLSocketFactory
+ * or a HttpsServer using a default keystore in the test tree.
+ * <p>
+ * Using this class with a security manager requires the following
+ * permissions to be granted:
+ * <p>
+ * permission "java.util.PropertyPermission" "test.src.path", "read";
+ * permission java.io.FilePermission "/path/to/test/lib/jdk/test/lib/testkeys", "read";
+ * The exact path above depends on the location of the test.
+ */
+public class SimpleSSLContext {
+
+ private final SSLContext ssl;
+
+ /**
+ * Loads default keystore from SimpleSSLContext source directory
+ */
+ public SimpleSSLContext() throws IOException {
+ String paths = System.getProperty("test.src.path");
+ StringTokenizer st = new StringTokenizer(paths, File.pathSeparator);
+ boolean securityExceptions = false;
+ SSLContext sslContext = null;
+ while (st.hasMoreTokens()) {
+ String path = st.nextToken();
+ try {
+ File f = new File(path, "../../../../../lib/jdk/test/lib/net/testkeys");
+ if (f.exists()) {
+ try (FileInputStream fis = new FileInputStream(f)) {
+ sslContext = init(fis);
+ break;
+ }
+ }
+ } catch (SecurityException e) {
+ // catch and ignore because permission only required
+ // for one entry on path (at most)
+ securityExceptions = true;
+ }
+ }
+ if (securityExceptions) {
+ System.out.println("SecurityExceptions thrown on loading testkeys");
+ }
+ ssl = sslContext;
+ }
+
+ private SSLContext init(InputStream i) throws IOException {
+ try {
+ char[] passphrase = "passphrase".toCharArray();
+ KeyStore ks = KeyStore.getInstance("PKCS12");
+ ks.load(i, passphrase);
+
+ KeyManagerFactory kmf = KeyManagerFactory.getInstance("PKIX");
+ kmf.init(ks, passphrase);
+
+ TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX");
+ tmf.init(ks);
+
+ SSLContext ssl = SSLContext.getInstance("TLS");
+ ssl.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
+ return ssl;
+ } catch (KeyManagementException | KeyStoreException |
+ UnrecoverableKeyException | CertificateException |
+ NoSuchAlgorithmException e) {
+ throw new RuntimeException(e.getMessage());
+ }
+ }
+
+ public SSLContext get() {
+ return ssl;
+ }
+}
\ No newline at end of file
--- a/test/jdk/java/nio/Buffer/genBasic.sh Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/nio/Buffer/genBasic.sh Wed Oct 17 08:09:46 2018 -0700
@@ -1,7 +1,7 @@
#! /bin/sh
#
-# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2018, 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
@@ -23,7 +23,7 @@
# questions.
#
-javac -d . ../../../../make/src/classes/build/tools/spp/Spp.java
+javac -d . ../../../../../make/jdk/src/classes/build/tools/spp/Spp.java
gen() {
java build.tools.spp.Spp -K$1 -Dtype=$1 -DType=$2 -DFulltype=$3 <Basic-X.java.template >Basic$2.java
--- a/test/jdk/java/nio/Buffer/genCopyDirectMemory.sh Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/nio/Buffer/genCopyDirectMemory.sh Wed Oct 17 08:09:46 2018 -0700
@@ -1,7 +1,7 @@
#! /bin/sh
#
-# Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2018, 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
@@ -23,7 +23,7 @@
# questions.
#
-javac -d . ../../../../make/src/classes/build/tools/spp/Spp.java > Spp.java
+javac -d . ../../../../../make/jdk/src/classes/build/tools/spp/Spp.java > Spp.java
gen() {
java build.tools.spp.Spp -K$1 -Dtype=$1 -DType=$2 -DFulltype=$3<CopyDirect-X-Memory.java.template >CopyDirect$2Memory.java
--- a/test/jdk/java/nio/Buffer/genOrder.sh Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/nio/Buffer/genOrder.sh Wed Oct 17 08:09:46 2018 -0700
@@ -1,7 +1,7 @@
#! /bin/sh
#
-# Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2018, 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
@@ -23,8 +23,7 @@
# questions.
#
-javac -d . ../../../../make/src/classes/build/tools/spp/Spp.java > Spp.java
-
+javac -d . ../../../../../make/jdk/src/classes/build/tools/spp/Spp.java > Spp.java
gen() {
java build.tools.spp.Spp -K$1 -Dtype=$1 -DType=$2 -DFulltype=$3<Order-X.java.template >Order$2.java
}
--- a/test/jdk/java/util/Locale/LocaleCategory.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/util/Locale/LocaleCategory.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, 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
@@ -20,13 +20,29 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+
+/*
+ * @test
+ * @bug 4700857 6997928 7079486
+ * @summary tests for Locale.getDefault(Locale.Category) and
+ * Locale.setDefault(Locale.Category, Locale)
+ * @library /java/text/testlib
+ * @build TestUtils LocaleCategory
+ * @comment test user.xxx.display user.xxx.format properties
+ * @run main/othervm -Duser.language.display=ja
+ * -Duser.language.format=zh LocaleCategory
+ * @comment test user.xxx properties overriding user.xxx.display/format
+ * @run main/othervm -Duser.language=en
+ * -Duser.language.display=ja
+ * -Duser.language.format=zh LocaleCategory
+ */
+
import java.util.Locale;
public class LocaleCategory {
private static Locale base = null;
private static Locale disp = null;
private static Locale fmt = null;
- private static String enc = null;
public static void main(String[] args) {
Locale reservedLocale = Locale.getDefault();
@@ -37,7 +53,6 @@
try {
Locale.Builder builder = new Locale.Builder();
-
base = builder.setLanguage(System.getProperty("user.language", ""))
.setScript(System.getProperty("user.script", ""))
.setRegion(System.getProperty("user.country", ""))
@@ -68,32 +83,37 @@
}
}
- static void checkDefault() {
+ private static void checkDefault() {
if (!base.equals(Locale.getDefault()) ||
!disp.equals(Locale.getDefault(Locale.Category.DISPLAY)) ||
!fmt.equals(Locale.getDefault(Locale.Category.FORMAT))) {
- throw new RuntimeException("Some of the return values from getDefault() do not agree with the locale derived from \"user.xxxx\" system properties");
+ throw new RuntimeException("Some of the return values from "
+ + "getDefault() do not agree with the locale derived "
+ + "from \"user.xxxx\" system properties");
}
}
- static void testGetSetDefault() {
+ private static void testGetSetDefault() {
try {
Locale.setDefault(null, null);
- throw new RuntimeException("setDefault(null, null) should throw a NullPointerException");
+ throw new RuntimeException("setDefault(null, null) should throw a "
+ + "NullPointerException");
} catch (NullPointerException npe) {}
Locale.setDefault(Locale.CHINA);
if (!Locale.CHINA.equals(Locale.getDefault(Locale.Category.DISPLAY)) ||
!Locale.CHINA.equals(Locale.getDefault(Locale.Category.FORMAT))) {
- throw new RuntimeException("setDefault() should set all default locales for all categories");
+ throw new RuntimeException("setDefault() should set all default "
+ + "locales for all categories");
}
}
- static void testBug7079486() {
+ private static void testBug7079486() {
Locale zh_Hans_CN = Locale.forLanguageTag("zh-Hans-CN");
// make sure JRE has zh_Hans_CN localized string
- if (zh_Hans_CN.getDisplayScript(Locale.US).equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
+ if (zh_Hans_CN.getDisplayScript(Locale.US)
+ .equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
return;
}
@@ -104,7 +124,8 @@
String zh_script = zh_Hans_CN.getDisplayScript();
if (en_script.equals(zh_script)) {
- throw new RuntimeException("Locale.getDisplayScript() (no args) does not honor default DISPLAY locale");
+ throw new RuntimeException("Locale.getDisplayScript() (no args) "
+ + "does not honor default DISPLAY locale");
}
}
}
--- a/test/jdk/java/util/Locale/LocaleCategory.sh Tue Oct 16 15:45:19 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-#
-# @test
-# @bug 4700857 6997928 7079486
-# @summary tests for Locale.getDefault(Locale.Category) and
-# Locale.setDefault(Locale.Category, Locale)
-# @library /java/text/testlib
-# @build LocaleCategory TestUtils
-# @run shell/timeout=600 LocaleCategory.sh
-
-if [ "${TESTSRC}" = "" ]
-then
- echo "TESTSRC not set. Test cannot execute. Failed."
- exit 1
-fi
-echo "TESTSRC=${TESTSRC}"
-if [ "${TESTJAVA}" = "" ]
-then
- echo "TESTJAVA not set. Test cannot execute. Failed."
- exit 1
-fi
-echo "TESTJAVA=${TESTJAVA}"
-if [ "${TESTCLASSES}" = "" ]
-then
- echo "TESTCLASSES not set. Test cannot execute. Failed."
- exit 1
-fi
-
-echo "TESTCLASSES=${TESTCLASSES}"
-echo "TESTCLASSPATH=${TESTCLASSPATH}"
-echo "CLASSPATH=${CLASSPATH}"
-
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
- SunOS | Linux | *BSD | Darwin | AIX )
- PS=":"
- FS="/"
- ;;
- Windows* | CYGWIN* )
- PS=";"
- FS="\\"
- ;;
- * )
- echo "Unrecognized system!"
- exit 1;
- ;;
-esac
-
-# test user.xxx.display user.xxx.format properties
-
-# run
-RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSPATH} -Duser.language.display=ja -Duser.language.format=zh LocaleCategory"
-
-echo ${RUNCMD}
-${RUNCMD}
-result=$?
-
-if [ $result -eq 0 ]
-then
- echo "Execution successful"
-else
- echo "Execution of the test case failed."
-fi
-
-# test user.xxx properties overriding user.xxx.display/format
-
-# run
-RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSPATH} -Duser.language=en -Duser.language.display=ja -Duser.language.format=zh LocaleCategory"
-
-echo ${RUNCMD}
-${RUNCMD}
-result=$?
-
-if [ $result -eq 0 ]
-then
- echo "Execution successful"
-else
- echo "Execution of the test case failed."
-fi
-
-exit $result
--- a/test/jdk/java/util/Locale/LocaleProviders.sh Tue Oct 16 15:45:19 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,370 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2012, 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.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-#
-# @test
-# @bug 6336885 7196799 7197573 7198834 8000245 8000615 8001440 8008577
-# 8010666 8013086 8013233 8013903 8015960 8028771 8054482 8062006
-# 8150432
-# @summary tests for "java.locale.providers" system property
-# @modules java.base/sun.util.locale
-# java.base/sun.util.locale.provider
-# @compile LocaleProviders.java
-# @run shell/timeout=600 LocaleProviders.sh
-
-if [ "${TESTSRC}" = "" ]
-then
- echo "TESTSRC not set. Test cannot execute. Failed."
- exit 1
-fi
-echo "TESTSRC=${TESTSRC}"
-if [ "${TESTJAVA}" = "" ]
-then
- echo "TESTJAVA not set. Test cannot execute. Failed."
- exit 1
-fi
-if [ "${COMPILEJAVA}" = "" ]
-then
- COMPILEJAVA="${TESTJAVA}"
-fi
-echo "TESTJAVA=${TESTJAVA}"
-if [ "${TESTCLASSES}" = "" ]
-then
- echo "TESTCLASSES not set. Test cannot execute. Failed."
- exit 1
-fi
-echo "TESTCLASSES=${TESTCLASSES}"
-echo "CLASSPATH=${CLASSPATH}"
-
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
- SunOS | Linux | *BSD | Darwin | AIX )
- PS=":"
- FS="/"
- ;;
- Windows* | CYGWIN* )
- PS=";"
- FS="\\"
- ;;
- * )
- echo "Unrecognized system!"
- exit 1;
- ;;
-esac
-
-# create SPI implementations
-mk() {
- d=`dirname $1`
- if [ ! -d $d ]; then mkdir -p $d; fi
- cat - >$1
-}
-
-SPIDIR=${TESTCLASSES}${FS}spi
-rm -rf ${SPIDIR}
-mk ${SPIDIR}${FS}src${FS}tznp.java << EOF
-import java.util.spi.TimeZoneNameProvider;
-import java.util.Locale;
-
-public class tznp extends TimeZoneNameProvider {
- public String getDisplayName(String ID, boolean daylight, int style, Locale locale) {
- return "tznp";
- }
-
- public Locale[] getAvailableLocales() {
- Locale[] locales = {Locale.US};
- return locales;
- }
-}
-EOF
-mk ${SPIDIR}${FS}src${FS}tznp8013086.java << EOF
-import java.util.spi.TimeZoneNameProvider;
-import java.util.Locale;
-import java.util.TimeZone;
-
-public class tznp8013086 extends TimeZoneNameProvider {
- public String getDisplayName(String ID, boolean daylight, int style, Locale locale) {
- if (!daylight && style==TimeZone.LONG) {
- return "tznp8013086";
- } else {
- return null;
- }
- }
-
- public Locale[] getAvailableLocales() {
- Locale[] locales = {Locale.JAPAN};
- return locales;
- }
-}
-EOF
-mk ${SPIDIR}${FS}dest${FS}META-INF${FS}services${FS}java.util.spi.TimeZoneNameProvider << EOF
-tznp
-tznp8013086
-EOF
-
-EXTRAOPTS="--add-exports java.base/sun.util.locale=ALL-UNNAMED \
- --add-exports java.base/sun.util.locale.provider=ALL-UNNAMED"
-
-${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d ${SPIDIR}${FS}dest \
- ${SPIDIR}${FS}src${FS}tznp.java \
- ${SPIDIR}${FS}src${FS}tznp8013086.java
-${COMPILEJAVA}${FS}bin${FS}jar ${TESTTOOLVMOPTS} cvf ${SPIDIR}${FS}tznp.jar -C ${SPIDIR}${FS}dest .
-
-# get the platform default locales
-PLATDEF=`${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} ${EXTRAOPTS} -classpath ${TESTCLASSES} LocaleProviders getPlatformLocale display`
-DEFLANG=`echo ${PLATDEF} | sed -e "s/,.*//"`
-DEFCTRY=`echo ${PLATDEF} | sed -e "s/.*,//"`
-echo "DEFLANG=${DEFLANG}"
-echo "DEFCTRY=${DEFCTRY}"
-PLATDEF=`${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} ${EXTRAOPTS} -classpath ${TESTCLASSES} LocaleProviders getPlatformLocale format`
-DEFFMTLANG=`echo ${PLATDEF} | sed -e "s/,.*//"`
-DEFFMTCTRY=`echo ${PLATDEF} | sed -e "s/.*,//"`
-echo "DEFFMTLANG=${DEFFMTLANG}"
-echo "DEFFMTCTRY=${DEFFMTCTRY}"
-
-runTest()
-{
- RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} ${EXTRAOPTS} -classpath ${TESTCLASSES}${PS}${SPICLASSES} -Djava.locale.providers=$PREFLIST LocaleProviders $METHODNAME $PARAM1 $PARAM2 $PARAM3"
- echo ${RUNCMD}
- ${RUNCMD}
- result=$?
- if [ $result -eq 0 ]
- then
- echo "Execution successful"
- else
- echo "Execution of the test case failed."
- exit $result
- fi
-}
-
-# testing HOST is selected for the default locale, if specified on Windows or MacOSX
-METHODNAME=adapterTest
-PREFLIST=HOST,JRE
-case "$OS" in
- Windows_NT* )
- WINVER=`uname -r`
- if [ "${WINVER}" = "5" ]
- then
- PARAM1=JRE
- else
- PARAM1=HOST
- fi
- ;;
- CYGWIN_NT-6* | CYGWIN_NT-10* | Darwin )
- PARAM1=HOST
- ;;
- * )
- PARAM1=JRE
- ;;
-esac
-PARAM2=${DEFLANG}
-PARAM3=${DEFCTRY}
-runTest
-
-# testing HOST is NOT selected for the non-default locale, if specified
-METHODNAME=adapterTest
-PREFLIST=HOST,JRE
-PARAM1=JRE
-# Try to find the locale JRE supports which is not the platform default (HOST supports that one)
-if [ "${DEFLANG}" != "en" ] && [ "${DEFFMTLANG}" != "en" ]; then
- PARAM2=en
- PARAM3=US
-elif [ "${DEFLANG}" != "ja" ] && [ "${DEFFMTLANG}" != "ja" ]; then
- PARAM2=ja
- PARAM3=JP
-else
- PARAM2=zh
- PARAM3=CN
-fi
-SPICLASSES=
-runTest
-
-# testing SPI is NOT selected, as there is none.
-METHODNAME=adapterTest
-PREFLIST=SPI,JRE
-PARAM1=JRE
-PARAM2=en
-PARAM3=US
-SPICLASSES=
-runTest
-PREFLIST=SPI,COMPAT
-runTest
-
-# testing the order, variaton #1. This assumes en_GB DateFormat data are available both in JRE & CLDR
-METHODNAME=adapterTest
-PREFLIST=CLDR,JRE
-PARAM1=CLDR
-PARAM2=en
-PARAM3=GB
-SPICLASSES=
-runTest
-PREFLIST=CLDR,COMPAT
-runTest
-
-# testing the order, variaton #2. This assumes en_GB DateFormat data are available both in JRE & CLDR
-METHODNAME=adapterTest
-PREFLIST=JRE,CLDR
-PARAM1=JRE
-PARAM2=en
-PARAM3=GB
-SPICLASSES=
-runTest
-PREFLIST=COMPAT,CLDR
-runTest
-
-# testing the order, variaton #3 for non-existent locale in JRE assuming "haw" is not in JRE.
-METHODNAME=adapterTest
-PREFLIST=JRE,CLDR
-PARAM1=CLDR
-PARAM2=haw
-PARAM3=
-SPICLASSES=
-runTest
-PREFLIST=COMPAT,CLDR
-runTest
-
-# testing the order, variaton #4 for the bug 7196799. CLDR's "zh" data should be used in "zh_CN"
-METHODNAME=adapterTest
-PREFLIST=CLDR
-PARAM1=CLDR
-PARAM2=zh
-PARAM3=CN
-SPICLASSES=
-runTest
-
-# testing FALLBACK provider. SPI and invalid one cases.
-METHODNAME=adapterTest
-PREFLIST=SPI
-PARAM1=FALLBACK
-PARAM2=en
-PARAM3=US
-SPICLASSES=
-runTest
-PREFLIST=FOO
-PARAM1=CLDR
-PARAM2=en
-PARAM3=US
-SPICLASSES=
-runTest
-PREFLIST=BAR,SPI
-PARAM1=FALLBACK
-PARAM2=en
-PARAM3=US
-SPICLASSES=
-runTest
-
-# testing 7198834 fix. Only works on Windows Vista or upper.
-METHODNAME=bug7198834Test
-PREFLIST=HOST
-PARAM1=
-PARAM2=
-PARAM3=
-SPICLASSES=
-runTest
-
-# testing 8000245 fix.
-METHODNAME=tzNameTest
-PREFLIST=JRE
-PARAM1=Europe/Moscow
-PARAM2=
-PARAM3=
-SPICLASSES=${SPIDIR}
-runTest
-PREFLIST=COMPAT
-runTest
-
-# testing 8000615 fix.
-METHODNAME=tzNameTest
-PREFLIST=JRE
-PARAM1=America/Los_Angeles
-PARAM2=
-PARAM3=
-SPICLASSES=${SPIDIR}
-runTest
-PREFLIST=COMPAT
-runTest
-
-# testing 8001440 fix.
-METHODNAME=bug8001440Test
-PREFLIST=CLDR
-PARAM1=
-PARAM2=
-PARAM3=
-SPICLASSES=
-runTest
-
-# testing 8010666 fix.
-if [ "${DEFLANG}" = "en" ]
-then
- METHODNAME=bug8010666Test
- PREFLIST=HOST
- PARAM1=
- PARAM2=
- PARAM3=
- SPICLASSES=
- runTest
-fi
-
-# testing 8013086 fix.
-METHODNAME=bug8013086Test
-PREFLIST=JRE,SPI
-PARAM1=ja
-PARAM2=JP
-PARAM3=
-SPICLASSES=${SPIDIR}
-runTest
-PREFLIST=COMPAT,SPI
-runTest
-
-# testing 8013903 fix. (Windows only)
-METHODNAME=bug8013903Test
-PREFLIST=HOST,JRE
-PARAM1=
-PARAM2=
-PARAM3=
-SPICLASSES=
-runTest
-PREFLIST=HOST
-runTest
-PREFLIST=HOST,COMPAT
-runTest
-
-# testing 8027289 fix, if the platform format default is zh_CN
-# this assumes Windows' currency symbol for zh_CN is \u00A5, the yen
-# (yuan) sign.
-if [ "${DEFFMTLANG}" = "zh" ] && [ "${DEFFMTCTRY}" = "CN" ]; then
- METHODNAME=bug8027289Test
- PREFLIST=JRE,HOST
- PARAM1=FFE5
- PARAM2=
- PARAM3=
- SPICLASSES=
- runTest
- PREFLIST=COMPAT,HOST
- runTest
- PREFLIST=HOST
- PARAM1=00A5
- runTest
-fi
-
-exit $result
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Locale/LocaleProvidersRun.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6336885 7196799 7197573 7198834 8000245 8000615 8001440 8008577
+ * 8010666 8013086 8013233 8013903 8015960 8028771 8054482 8062006
+ * 8150432
+ * @summary tests for "java.locale.providers" system property
+ * @library /test/lib
+ * @build LocaleProviders
+ * providersrc.spi.src.tznp
+ * providersrc.spi.src.tznp8013086
+ * @modules java.base/sun.util.locale
+ * java.base/sun.util.locale.provider
+ * @run main LocaleProvidersRun
+ */
+
+import java.util.Locale;
+
+import jdk.test.lib.JDKToolLauncher;
+import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.Utils;
+
+public class LocaleProvidersRun {
+ public static void main(String[] args) throws Throwable {
+ //get the platform default locales
+ Locale platDefLoc = Locale.getDefault(Locale.Category.DISPLAY);
+ String defLang = platDefLoc.getLanguage();
+ String defCtry = platDefLoc.getCountry();
+ System.out.println("DEFLANG = " + defLang);
+ System.out.println("DEFCTRY = " + defCtry);
+
+ Locale platDefFormat = Locale.getDefault(Locale.Category.FORMAT);
+ String defFmtLang = platDefFormat.getLanguage();
+ String defFmtCtry = platDefFormat.getCountry();
+ System.out.println("DEFFMTLANG = " + defFmtLang);
+ System.out.println("DEFFMTCTRY = " + defFmtCtry);
+
+ //Run Test
+ //testing HOST is selected for the default locale,
+ // if specified on Windows or MacOSX
+ String osName = System.getProperty("os.name");
+ String param1 = "JRE";
+ if(osName.startsWith("Windows") || osName.startsWith("Mac")) {
+ param1 = "HOST";
+ }
+ testRun("HOST,JRE", "adapterTest", param1, defLang, defCtry);
+
+ //testing HOST is NOT selected for the non-default locale, if specified
+ //Try to find the locale JRE supports which is not the platform default
+ // (HOST supports that one)
+ String param2;
+ String param3;
+ if (!defLang.equals("en") && !defFmtLang.equals("en")){
+ param2 = "en";
+ param3 = "US";
+ } else if(!defLang.equals("ja") && !defFmtLang.equals("ja")){
+ param2 = "ja";
+ param3 = "JP";
+ } else {
+ param2 = "zh";
+ param3 = "CN";
+ }
+ testRun("HOST,JRE", "adapterTest", "JRE", param2, param3);
+
+ //testing SPI is NOT selected, as there is none.
+ testRun("SPI,JRE", "adapterTest", "JRE", "en", "US");
+ testRun("SPI,COMPAT", "adapterTest", "JRE", "en", "US");
+
+ //testing the order, variant #1. This assumes en_GB DateFormat data are
+ // available both in JRE & CLDR
+ testRun("CLDR,JRE", "adapterTest", "CLDR", "en", "GB");
+ testRun("CLDR,COMPAT", "adapterTest", "CLDR", "en", "GB");
+
+ //testing the order, variant #2. This assumes en_GB DateFormat data are
+ // available both in JRE & CLDR
+ testRun("JRE,CLDR", "adapterTest", "JRE", "en", "GB");
+ testRun("COMPAT,CLDR", "adapterTest", "JRE", "en", "GB");
+
+ //testing the order, variant #3 for non-existent locale in JRE
+ // assuming "haw" is not in JRE.
+ testRun("JRE,CLDR", "adapterTest", "CLDR", "haw", "");
+ testRun("COMPAT,CLDR", "adapterTest", "CLDR", "haw", "");
+
+ //testing the order, variant #4 for the bug 7196799. CLDR's "zh" data
+ // should be used in "zh_CN"
+ testRun("CLDR", "adapterTest", "CLDR", "zh", "CN");
+
+ //testing FALLBACK provider. SPI and invalid one cases.
+ testRun("SPI", "adapterTest", "FALLBACK", "en", "US");
+ testRun("FOO", "adapterTest", "CLDR", "en", "US");
+ testRun("BAR,SPI", "adapterTest", "FALLBACK", "en", "US");
+
+ //testing 7198834 fix.
+ testRun("HOST", "bug7198834Test", "", "", "");
+
+ //testing 8000245 fix.
+ testRun("JRE", "tzNameTest", "Europe/Moscow", "", "");
+ testRun("COMPAT", "tzNameTest", "Europe/Moscow", "", "");
+
+ //testing 8000615 fix.
+ testRun("JRE", "tzNameTest", "America/Los_Angeles", "", "");
+ testRun("COMPAT", "tzNameTest", "America/Los_Angeles", "", "");
+
+ //testing 8001440 fix.
+ testRun("CLDR", "bug8001440Test", "", "", "");
+
+ //testing 8010666 fix.
+ if (defLang.equals("en")) {
+ testRun("HOST", "bug8010666Test", "", "", "");
+ }
+
+ //testing 8013086 fix.
+ testRun("JRE,SPI", "bug8013086Test", "ja", "JP", "");
+ testRun("COMPAT,SPI", "bug8013086Test", "ja", "JP", "");
+
+ //testing 8013903 fix. (Windows only)
+ testRun("HOST,JRE", "bug8013903Test", "", "", "");
+ testRun("HOST", "bug8013903Test", "", "", "");
+ testRun("HOST,COMPAT", "bug8013903Test", "", "", "");
+
+ //testing 8027289 fix, if the platform format default is zh_CN
+ // this assumes Windows' currency symbol for zh_CN is \u00A5, the yen
+ // (yuan) sign.
+ if (!defLang.equals("en") && !defCtry.equals("CN")){
+ testRun("JRE,HOST", "bug8027289Test", "FFE5", "", "");
+ testRun("COMPAT,HOST", "bug8027289Test", "FFE5", "", "");
+ testRun("HOST", "bug8027289Test", "00A5", "", "");
+ }
+ }
+
+ private static void testRun(String prefList, String methodName,
+ String param1, String param2, String param3) throws Throwable{
+ JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("java");
+ launcher.addToolArg("-cp")
+ .addToolArg(Utils.TEST_CLASS_PATH)
+ .addToolArg("-Djava.locale.providers=" + prefList)
+ .addToolArg("LocaleProviders")
+ .addToolArg(methodName)
+ .addToolArg(param1)
+ .addToolArg(param2)
+ .addToolArg(param3);
+ int exitCode = ProcessTools.executeCommand(launcher.getCommand())
+ .getExitValue();
+ if (exitCode != 0) {
+ throw new RuntimeException("Unexpected exit code: " + exitCode);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Locale/providersrc/spi/dest/META-INF/services/java.util.spi.TimeZoneNameProvider Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,2 @@
+tznp
+tznp8013086
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Locale/providersrc/spi/src/tznp.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package providersrc.spi.src;
+
+import java.util.spi.TimeZoneNameProvider;
+import java.util.Locale;
+
+public class tznp extends TimeZoneNameProvider {
+ public String getDisplayName(String ID, boolean daylight, int style,
+ Locale locale) {
+ return "tznp";
+ }
+
+ public Locale[] getAvailableLocales() {
+ Locale[] locales = {Locale.US};
+ return locales;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/util/Locale/providersrc/spi/src/tznp8013086.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package providersrc.spi.src;
+import java.util.spi.TimeZoneNameProvider;
+import java.util.Locale;
+import java.util.TimeZone;
+
+public class tznp8013086 extends TimeZoneNameProvider {
+ public String getDisplayName(String ID, boolean daylight, int style,
+ Locale locale) {
+ if (!daylight && style == TimeZone.LONG) {
+ return "tznp8013086";
+ } else {
+ return null;
+ }
+ }
+
+ public Locale[] getAvailableLocales() {
+ Locale[] locales = {Locale.JAPAN};
+ return locales;
+ }
+}
--- a/test/jdk/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 8132734 8144062 8165723
+ * @bug 8132734 8144062 8165723 8199172
* @summary Test the extended API and the aliasing additions in JarFile that
* support multi-release jar files
* @library /lib/testlibrary/java/util/jar /test/lib
@@ -100,16 +100,30 @@
testCustomMultiReleaseValue("true", true);
testCustomMultiReleaseValue("true\r\nOther: value", true);
testCustomMultiReleaseValue("true\nOther: value", true);
- testCustomMultiReleaseValue("true\rOther: value", true);
+ // JDK-8200530: '\r' support in Manifest/Attributes will be addressed separately
+ // testCustomMultiReleaseValue("true\rOther: value", true);
testCustomMultiReleaseValue("false", false);
testCustomMultiReleaseValue(" true", false);
testCustomMultiReleaseValue("true ", false);
- testCustomMultiReleaseValue("true\n ", false);
- testCustomMultiReleaseValue("true\r ", false);
testCustomMultiReleaseValue("true\n true", false);
+
+ // JDK-8200530: '\r' support in Manifest/Attributes will be addressed separately
+ testCustomMultiReleaseValue("true\r true", false);
testCustomMultiReleaseValue("true\r\n true", false);
+ // "Multi-Release: true/false" not in main attributes
+ testCustomMultiReleaseValue("\r\n\r\nName: test\r\nMulti-Release: true\r\n",
+ false);
+ testCustomMultiReleaseValue("\n\nName: entryname\nMulti-Release: true\n",
+ false);
+ testCustomMultiReleaseValue("EndOfMainAttr: whatever\r\n" +
+ "\r\nName: entryname\r\nMulti-Release: true\r\n",
+ false);
+ testCustomMultiReleaseValue("EndOfMainAttr: whatever\r\n" +
+ "\nName: entryname\nMulti-Release: true\n",
+ false);
+
// generate "random" Strings to use as extra attributes, and
// verify that Multi-Release: true is always properly matched
for (int i = 0; i < 100; i++) {
--- a/test/jdk/javax/net/ssl/HttpsURLConnection/Equals.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/javax/net/ssl/HttpsURLConnection/Equals.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, 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 @@
/**
* @test
* @bug 8055299
- * @library /lib/testlibrary
+ * @library /test/lib
* @modules jdk.httpserver
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @run main/othervm -Djavax.net.debug=ssl,handshake,record Equals
*/
import com.sun.net.httpserver.*;
@@ -34,7 +34,7 @@
import java.io.*;
import javax.net.ssl.*;
import java.util.concurrent.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
public class Equals {
--- a/test/jdk/lib/security/CheckBlacklistedCerts.java Tue Oct 16 15:45:19 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 8011402 8211969
- * @summary Move blacklisting certificate logic from hard code to data
- * @modules java.base/sun.security.util
- */
-
-import sun.security.util.UntrustedCertificates;
-
-import java.io.*;
-import java.security.KeyStore;
-import java.security.cert.*;
-import java.util.*;
-
-public class CheckBlacklistedCerts {
- public static void main(String[] args) throws Exception {
-
- String home = System.getProperty("java.home");
- boolean failed = false;
-
- // Root CAs should always be trusted
- File file = new File(home, "lib/security/cacerts");
- KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
- try (FileInputStream fis = new FileInputStream(file)) {
- ks.load(fis, null);
- }
- System.out.println("Check for cacerts: " + ks.size());
- for (String alias: Collections.list(ks.aliases())) {
- X509Certificate cert = (X509Certificate)ks.getCertificate(alias);
- if (UntrustedCertificates.isUntrusted(cert)) {
- System.out.print(alias + " is untrusted");
- failed = true;
- }
- }
-
- // All certs in the pem files
- Set<Certificate> blacklisted = new HashSet<>();
-
- // Assumes the full src is available
- File blacklist = new File(System.getProperty("test.src"),
- "../../../../make/data/blacklistedcertsconverter/blacklisted.certs.pem");
-
- CertificateFactory cf = CertificateFactory.getInstance("X.509");
- try (FileInputStream fis = new FileInputStream(blacklist)) {
- Collection<? extends Certificate> certs
- = cf.generateCertificates(fis);
- System.out.println(certs.size());
- for (Certificate c: certs) {
- blacklisted.add(c);
- X509Certificate cert = ((X509Certificate)c);
- if (!UntrustedCertificates.isUntrusted(cert)) {
- System.out.println(cert.getSubjectDN() + " is trusted");
- failed = true;
- }
- }
- }
-
- // Check the blacklisted.certs file itself
- file = new File(home, "lib/security/blacklisted.certs");
- System.out.print("Check for " + file + ": ");
- try (BufferedReader reader = new BufferedReader(
- new InputStreamReader(new FileInputStream(file)))) {
- int acount = 0;
- int ccount = 0;
- while (true) {
- String line = reader.readLine();
- if (line == null) break;
- if (line.startsWith("Algorithm")) {
- acount++;
- } else if (!line.isEmpty() && !line.startsWith("#")) {
- ccount++;
- }
- }
- System.out.println(acount + " algs, " + ccount + " certs" );
- if (acount != 1) {
- System.out.println("There are " + acount + " algorithms");
- failed = true;
- }
- if (ccount != blacklisted.size()
- && !blacklisted.isEmpty()) {
- System.out.println("Wrong blacklisted.certs size: "
- + ccount + " fingerprints, "
- + blacklisted.size() + " certs");
- failed = true;
- }
- }
-
- if (failed) {
- throw new Exception("Failed");
- }
- }
-}
--- a/test/jdk/lib/security/cacerts/VerifyCACerts.java Tue Oct 16 15:45:19 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,353 +0,0 @@
-/*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-/**
- * @test
- * @bug 8189131 8198240 8191844 8189949 8191031 8196141 8204923 8195774 8199779 8209452
- * 8209506 8210432
- * @summary Check root CA entries in cacerts file
- */
-import java.io.File;
-import java.io.FileInputStream;
-import java.security.KeyStore;
-import java.security.MessageDigest;
-import java.security.cert.*;
-import java.util.*;
-
-public class VerifyCACerts {
-
- private static final String CACERTS
- = System.getProperty("java.home") + File.separator + "lib"
- + File.separator + "security" + File.separator + "cacerts";
-
- // The numbers of certs now.
- private static final int COUNT = 93;
-
- // map of cert alias to SHA-256 fingerprint
- private static final Map<String, String> FINGERPRINT_MAP
- = new HashMap<String, String>() {
- {
- put("actalisauthenticationrootca [jdk]",
- "55:92:60:84:EC:96:3A:64:B9:6E:2A:BE:01:CE:0B:A8:6A:64:FB:FE:BC:C7:AA:B5:AF:C1:55:B3:7F:D7:60:66");
- put("buypassclass2ca [jdk]",
- "9A:11:40:25:19:7C:5B:B9:5D:94:E6:3D:55:CD:43:79:08:47:B6:46:B2:3C:DF:11:AD:A4:A0:0E:FF:15:FB:48");
- put("buypassclass3ca [jdk]",
- "ED:F7:EB:BC:A2:7A:2A:38:4D:38:7B:7D:40:10:C6:66:E2:ED:B4:84:3E:4C:29:B4:AE:1D:5B:93:32:E6:B2:4D");
- put("camerfirmachambersca [jdk]",
- "06:3E:4A:FA:C4:91:DF:D3:32:F3:08:9B:85:42:E9:46:17:D8:93:D7:FE:94:4E:10:A7:93:7E:E2:9D:96:93:C0");
- put("camerfirmachambersignca [jdk]",
- "13:63:35:43:93:34:A7:69:80:16:A0:D3:24:DE:72:28:4E:07:9D:7B:52:20:BB:8F:BD:74:78:16:EE:BE:BA:CA");
- put("camerfirmachamberscommerceca [jdk]",
- "0C:25:8A:12:A5:67:4A:EF:25:F2:8B:A7:DC:FA:EC:EE:A3:48:E5:41:E6:F5:CC:4E:E6:3B:71:B3:61:60:6A:C3");
- put("certumca [jdk]",
- "D8:E0:FE:BC:1D:B2:E3:8D:00:94:0F:37:D2:7D:41:34:4D:99:3E:73:4B:99:D5:65:6D:97:78:D4:D8:14:36:24");
- put("certumtrustednetworkca [jdk]",
- "5C:58:46:8D:55:F5:8E:49:7E:74:39:82:D2:B5:00:10:B6:D1:65:37:4A:CF:83:A7:D4:A3:2D:B7:68:C4:40:8E");
- put("chunghwaepkirootca [jdk]",
- "C0:A6:F4:DC:63:A2:4B:FD:CF:54:EF:2A:6A:08:2A:0A:72:DE:35:80:3E:2F:F5:FF:52:7A:E5:D8:72:06:DF:D5");
- put("comodorsaca [jdk]",
- "52:F0:E1:C4:E5:8E:C6:29:29:1B:60:31:7F:07:46:71:B8:5D:7E:A8:0D:5B:07:27:34:63:53:4B:32:B4:02:34");
- put("comodoaaaca [jdk]",
- "D7:A7:A0:FB:5D:7E:27:31:D7:71:E9:48:4E:BC:DE:F7:1D:5F:0C:3E:0A:29:48:78:2B:C8:3E:E0:EA:69:9E:F4");
- put("comodoeccca [jdk]",
- "17:93:92:7A:06:14:54:97:89:AD:CE:2F:8F:34:F7:F0:B6:6D:0F:3A:E3:A3:B8:4D:21:EC:15:DB:BA:4F:AD:C7");
- put("usertrustrsaca [jdk]",
- "E7:93:C9:B0:2F:D8:AA:13:E2:1C:31:22:8A:CC:B0:81:19:64:3B:74:9C:89:89:64:B1:74:6D:46:C3:D4:CB:D2");
- put("usertrusteccca [jdk]",
- "4F:F4:60:D5:4B:9C:86:DA:BF:BC:FC:57:12:E0:40:0D:2B:ED:3F:BC:4D:4F:BD:AA:86:E0:6A:DC:D2:A9:AD:7A");
- put("utnuserfirstobjectca [jdk]",
- "6F:FF:78:E4:00:A7:0C:11:01:1C:D8:59:77:C4:59:FB:5A:F9:6A:3D:F0:54:08:20:D0:F4:B8:60:78:75:E5:8F");
- put("utnuserfirstclientauthemailca [jdk]",
- "43:F2:57:41:2D:44:0D:62:74:76:97:4F:87:7D:A8:F1:FC:24:44:56:5A:36:7A:E6:0E:DD:C2:7A:41:25:31:AE");
- put("utnuserfirsthardwareca [jdk]",
- "6E:A5:47:41:D0:04:66:7E:ED:1B:48:16:63:4A:A3:A7:9E:6E:4B:96:95:0F:82:79:DA:FC:8D:9B:D8:81:21:37");
- put("addtrustclass1ca [jdk]",
- "8C:72:09:27:9A:C0:4E:27:5E:16:D0:7F:D3:B7:75:E8:01:54:B5:96:80:46:E3:1F:52:DD:25:76:63:24:E9:A7");
- put("addtrustexternalca [jdk]",
- "68:7F:A4:51:38:22:78:FF:F0:C8:B1:1F:8D:43:D5:76:67:1C:6E:B2:BC:EA:B4:13:FB:83:D9:65:D0:6D:2F:F2");
- put("addtrustqualifiedca [jdk]",
- "80:95:21:08:05:DB:4B:BC:35:5E:44:28:D8:FD:6E:C2:CD:E3:AB:5F:B9:7A:99:42:98:8E:B8:F4:DC:D0:60:16");
- put("baltimorecybertrustca [jdk]",
- "16:AF:57:A9:F6:76:B0:AB:12:60:95:AA:5E:BA:DE:F2:2A:B3:11:19:D6:44:AC:95:CD:4B:93:DB:F3:F2:6A:EB");
- put("digicertglobalrootca [jdk]",
- "43:48:A0:E9:44:4C:78:CB:26:5E:05:8D:5E:89:44:B4:D8:4F:96:62:BD:26:DB:25:7F:89:34:A4:43:C7:01:61");
- put("digicertglobalrootg2 [jdk]",
- "CB:3C:CB:B7:60:31:E5:E0:13:8F:8D:D3:9A:23:F9:DE:47:FF:C3:5E:43:C1:14:4C:EA:27:D4:6A:5A:B1:CB:5F");
- put("digicertglobalrootg3 [jdk]",
- "31:AD:66:48:F8:10:41:38:C7:38:F3:9E:A4:32:01:33:39:3E:3A:18:CC:02:29:6E:F9:7C:2A:C9:EF:67:31:D0");
- put("digicerttrustedrootg4 [jdk]",
- "55:2F:7B:DC:F1:A7:AF:9E:6C:E6:72:01:7F:4F:12:AB:F7:72:40:C7:8E:76:1A:C2:03:D1:D9:D2:0A:C8:99:88");
- put("digicertassuredidrootca [jdk]",
- "3E:90:99:B5:01:5E:8F:48:6C:00:BC:EA:9D:11:1E:E7:21:FA:BA:35:5A:89:BC:F1:DF:69:56:1E:3D:C6:32:5C");
- put("digicertassuredidg2 [jdk]",
- "7D:05:EB:B6:82:33:9F:8C:94:51:EE:09:4E:EB:FE:FA:79:53:A1:14:ED:B2:F4:49:49:45:2F:AB:7D:2F:C1:85");
- put("digicertassuredidg3 [jdk]",
- "7E:37:CB:8B:4C:47:09:0C:AB:36:55:1B:A6:F4:5D:B8:40:68:0F:BA:16:6A:95:2D:B1:00:71:7F:43:05:3F:C2");
- put("digicerthighassuranceevrootca [jdk]",
- "74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF");
- put("geotrustglobalca [jdk]",
- "FF:85:6A:2D:25:1D:CD:88:D3:66:56:F4:50:12:67:98:CF:AB:AA:DE:40:79:9C:72:2D:E4:D2:B5:DB:36:A7:3A");
- put("geotrustprimaryca [jdk]",
- "37:D5:10:06:C5:12:EA:AB:62:64:21:F1:EC:8C:92:01:3F:C5:F8:2A:E9:8E:E5:33:EB:46:19:B8:DE:B4:D0:6C");
- put("geotrustprimarycag2 [jdk]",
- "5E:DB:7A:C4:3B:82:A0:6A:87:61:E8:D7:BE:49:79:EB:F2:61:1F:7D:D7:9B:F9:1C:1C:6B:56:6A:21:9E:D7:66");
- put("geotrustprimarycag3 [jdk]",
- "B4:78:B8:12:25:0D:F8:78:63:5C:2A:A7:EC:7D:15:5E:AA:62:5E:E8:29:16:E2:CD:29:43:61:88:6C:D1:FB:D4");
- put("geotrustuniversalca [jdk]",
- "A0:45:9B:9F:63:B2:25:59:F5:FA:5D:4C:6D:B3:F9:F7:2F:F1:93:42:03:35:78:F0:73:BF:1D:1B:46:CB:B9:12");
- put("gtecybertrustglobalca [jdk]",
- "A5:31:25:18:8D:21:10:AA:96:4B:02:C7:B7:C6:DA:32:03:17:08:94:E5:FB:71:FF:FB:66:67:D5:E6:81:0A:36");
- put("thawteprimaryrootca [jdk]",
- "8D:72:2F:81:A9:C1:13:C0:79:1D:F1:36:A2:96:6D:B2:6C:95:0A:97:1D:B4:6B:41:99:F4:EA:54:B7:8B:FB:9F");
- put("thawteprimaryrootcag2 [jdk]",
- "A4:31:0D:50:AF:18:A6:44:71:90:37:2A:86:AF:AF:8B:95:1F:FB:43:1D:83:7F:1E:56:88:B4:59:71:ED:15:57");
- put("thawteprimaryrootcag3 [jdk]",
- "4B:03:F4:58:07:AD:70:F2:1B:FC:2C:AE:71:C9:FD:E4:60:4C:06:4C:F5:FF:B6:86:BA:E5:DB:AA:D7:FD:D3:4C");
- put("thawtepremiumserverca [jdk]",
- "3F:9F:27:D5:83:20:4B:9E:09:C8:A3:D2:06:6C:4B:57:D3:A2:47:9C:36:93:65:08:80:50:56:98:10:5D:BC:E9");
- put("verisigntsaca [jdk]",
- "CB:6B:05:D9:E8:E5:7C:D8:82:B1:0B:4D:B7:0D:E4:BB:1D:E4:2B:A4:8A:7B:D0:31:8B:63:5B:F6:E7:78:1A:9D");
- put("verisignclass2g2ca [jdk]",
- "3A:43:E2:20:FE:7F:3E:A9:65:3D:1E:21:74:2E:AC:2B:75:C2:0F:D8:98:03:05:BC:50:2C:AF:8C:2D:9B:41:A1");
- put("verisignclass3ca [jdk]",
- "A4:B6:B3:99:6F:C2:F3:06:B3:FD:86:81:BD:63:41:3D:8C:50:09:CC:4F:A3:29:C2:CC:F0:E2:FA:1B:14:03:05");
- put("verisignclass3g2ca [jdk]",
- "83:CE:3C:12:29:68:8A:59:3D:48:5F:81:97:3C:0F:91:95:43:1E:DA:37:CC:5E:36:43:0E:79:C7:A8:88:63:8B");
- put("verisignuniversalrootca [jdk]",
- "23:99:56:11:27:A5:71:25:DE:8C:EF:EA:61:0D:DF:2F:A0:78:B5:C8:06:7F:4E:82:82:90:BF:B8:60:E8:4B:3C");
- put("verisignclass3g3ca [jdk]",
- "EB:04:CF:5E:B1:F3:9A:FA:76:2F:2B:B1:20:F2:96:CB:A5:20:C1:B9:7D:B1:58:95:65:B8:1C:B9:A1:7B:72:44");
- put("verisignclass3g4ca [jdk]",
- "69:DD:D7:EA:90:BB:57:C9:3E:13:5D:C8:5E:A6:FC:D5:48:0B:60:32:39:BD:C4:54:FC:75:8B:2A:26:CF:7F:79");
- put("verisignclass3g5ca [jdk]",
- "9A:CF:AB:7E:43:C8:D8:80:D0:6B:26:2A:94:DE:EE:E4:B4:65:99:89:C3:D0:CA:F1:9B:AF:64:05:E4:1A:B7:DF");
- put("certplusclass2primaryca [jdk]",
- "0F:99:3C:8A:EF:97:BA:AF:56:87:14:0E:D5:9A:D1:82:1B:B4:AF:AC:F0:AA:9A:58:B5:D5:7A:33:8A:3A:FB:CB");
- put("certplusclass3pprimaryca [jdk]",
- "CC:C8:94:89:37:1B:AD:11:1C:90:61:9B:EA:24:0A:2E:6D:AD:D9:9F:9F:6E:1D:4D:41:E5:8E:D6:DE:3D:02:85");
- put("keynectisrootca [jdk]",
- "42:10:F1:99:49:9A:9A:C3:3C:8D:E0:2B:A6:DB:AA:14:40:8B:DD:8A:6E:32:46:89:C1:92:2D:06:97:15:A3:32");
- put("dtrustclass3ca2 [jdk]",
- "49:E7:A4:42:AC:F0:EA:62:87:05:00:54:B5:25:64:B6:50:E4:F4:9E:42:E3:48:D6:AA:38:E0:39:E9:57:B1:C1");
- put("dtrustclass3ca2ev [jdk]",
- "EE:C5:49:6B:98:8C:E9:86:25:B9:34:09:2E:EC:29:08:BE:D0:B0:F3:16:C2:D4:73:0C:84:EA:F1:F3:D3:48:81");
- put("identrustdstx3 [jdk]",
- "06:87:26:03:31:A7:24:03:D9:09:F1:05:E6:9B:CF:0D:32:E1:BD:24:93:FF:C6:D9:20:6D:11:BC:D6:77:07:39");
- put("identrustpublicca [jdk]",
- "30:D0:89:5A:9A:44:8A:26:20:91:63:55:22:D1:F5:20:10:B5:86:7A:CA:E1:2C:78:EF:95:8F:D4:F4:38:9F:2F");
- put("identrustcommercial [jdk]",
- "5D:56:49:9B:E4:D2:E0:8B:CF:CA:D0:8A:3E:38:72:3D:50:50:3B:DE:70:69:48:E4:2F:55:60:30:19:E5:28:AE");
- put("letsencryptisrgx1 [jdk]",
- "96:BC:EC:06:26:49:76:F3:74:60:77:9A:CF:28:C5:A7:CF:E8:A3:C0:AA:E1:1A:8F:FC:EE:05:C0:BD:DF:08:C6");
- put("luxtrustglobalrootca [jdk]",
- "A1:B2:DB:EB:64:E7:06:C6:16:9E:3C:41:18:B2:3B:AA:09:01:8A:84:27:66:6D:8B:F0:E2:88:91:EC:05:19:50");
- put("quovadisrootca [jdk]",
- "A4:5E:DE:3B:BB:F0:9C:8A:E1:5C:72:EF:C0:72:68:D6:93:A2:1C:99:6F:D5:1E:67:CA:07:94:60:FD:6D:88:73");
- put("quovadisrootca1g3 [jdk]",
- "8A:86:6F:D1:B2:76:B5:7E:57:8E:92:1C:65:82:8A:2B:ED:58:E9:F2:F2:88:05:41:34:B7:F1:F4:BF:C9:CC:74");
- put("quovadisrootca2 [jdk]",
- "85:A0:DD:7D:D7:20:AD:B7:FF:05:F8:3D:54:2B:20:9D:C7:FF:45:28:F7:D6:77:B1:83:89:FE:A5:E5:C4:9E:86");
- put("quovadisrootca2g3 [jdk]",
- "8F:E4:FB:0A:F9:3A:4D:0D:67:DB:0B:EB:B2:3E:37:C7:1B:F3:25:DC:BC:DD:24:0E:A0:4D:AF:58:B4:7E:18:40");
- put("quovadisrootca3 [jdk]",
- "18:F1:FC:7F:20:5D:F8:AD:DD:EB:7F:E0:07:DD:57:E3:AF:37:5A:9C:4D:8D:73:54:6B:F4:F1:FE:D1:E1:8D:35");
- put("quovadisrootca3g3 [jdk]",
- "88:EF:81:DE:20:2E:B0:18:45:2E:43:F8:64:72:5C:EA:5F:BD:1F:C2:D9:D2:05:73:07:09:C5:D8:B8:69:0F:46");
- put("secomscrootca1 [jdk]",
- "E7:5E:72:ED:9F:56:0E:EC:6E:B4:80:00:73:A4:3F:C3:AD:19:19:5A:39:22:82:01:78:95:97:4A:99:02:6B:6C");
- put("secomscrootca2 [jdk]",
- "51:3B:2C:EC:B8:10:D4:CD:E5:DD:85:39:1A:DF:C6:C2:DD:60:D8:7B:B7:36:D2:B5:21:48:4A:A4:7A:0E:BE:F6");
- put("swisssigngoldg2ca [jdk]",
- "62:DD:0B:E9:B9:F5:0A:16:3E:A0:F8:E7:5C:05:3B:1E:CA:57:EA:55:C8:68:8F:64:7C:68:81:F2:C8:35:7B:95");
- put("swisssignplatinumg2ca [jdk]",
- "3B:22:2E:56:67:11:E9:92:30:0D:C0:B1:5A:B9:47:3D:AF:DE:F8:C8:4D:0C:EF:7D:33:17:B4:C1:82:1D:14:36");
- put("swisssignsilverg2ca [jdk]",
- "BE:6C:4D:A2:BB:B9:BA:59:B6:F3:93:97:68:37:42:46:C3:C0:05:99:3F:A9:8F:02:0D:1D:ED:BE:D4:8A:81:D5");
- put("soneraclass2ca [jdk]",
- "79:08:B4:03:14:C1:38:10:0B:51:8D:07:35:80:7F:FB:FC:F8:51:8A:00:95:33:71:05:BA:38:6B:15:3D:D9:27");
- put("securetrustca [jdk]",
- "F1:C1:B5:0A:E5:A2:0D:D8:03:0E:C9:F6:BC:24:82:3D:D3:67:B5:25:57:59:B4:E7:1B:61:FC:E9:F7:37:5D:73");
- put("xrampglobalca [jdk]",
- "CE:CD:DC:90:50:99:D8:DA:DF:C5:B1:D2:09:B7:37:CB:E2:C1:8C:FB:2C:10:C0:FF:0B:CF:0D:32:86:FC:1A:A2");
- put("godaddyrootg2ca [jdk]",
- "45:14:0B:32:47:EB:9C:C8:C5:B4:F0:D7:B5:30:91:F7:32:92:08:9E:6E:5A:63:E2:74:9D:D3:AC:A9:19:8E:DA");
- put("godaddyclass2ca [jdk]",
- "C3:84:6B:F2:4B:9E:93:CA:64:27:4C:0E:C6:7C:1E:CC:5E:02:4F:FC:AC:D2:D7:40:19:35:0E:81:FE:54:6A:E4");
- put("starfieldclass2ca [jdk]",
- "14:65:FA:20:53:97:B8:76:FA:A6:F0:A9:95:8E:55:90:E4:0F:CC:7F:AA:4F:B7:C2:C8:67:75:21:FB:5F:B6:58");
- put("starfieldrootg2ca [jdk]",
- "2C:E1:CB:0B:F9:D2:F9:E1:02:99:3F:BE:21:51:52:C3:B2:DD:0C:AB:DE:1C:68:E5:31:9B:83:91:54:DB:B7:F5");
- put("entrustrootcaec1 [jdk]",
- "02:ED:0E:B2:8C:14:DA:45:16:5C:56:67:91:70:0D:64:51:D7:FB:56:F0:B2:AB:1D:3B:8E:B0:70:E5:6E:DF:F5");
- put("entrust2048ca [jdk]",
- "6D:C4:71:72:E0:1C:BC:B0:BF:62:58:0D:89:5F:E2:B8:AC:9A:D4:F8:73:80:1E:0C:10:B9:C8:37:D2:1E:B1:77");
- put("entrustrootcag2 [jdk]",
- "43:DF:57:74:B0:3E:7F:EF:5F:E4:0D:93:1A:7B:ED:F1:BB:2E:6B:42:73:8C:4E:6D:38:41:10:3D:3A:A7:F3:39");
- put("entrustevca [jdk]",
- "73:C1:76:43:4F:1B:C6:D5:AD:F4:5B:0E:76:E7:27:28:7C:8D:E5:76:16:C1:E6:E6:14:1A:2B:2C:BC:7D:8E:4C");
- put("affirmtrustnetworkingca [jdk]",
- "0A:81:EC:5A:92:97:77:F1:45:90:4A:F3:8D:5D:50:9F:66:B5:E2:C5:8F:CD:B5:31:05:8B:0E:17:F3:F0:B4:1B");
- put("affirmtrustpremiumca [jdk]",
- "70:A7:3F:7F:37:6B:60:07:42:48:90:45:34:B1:14:82:D5:BF:0E:69:8E:CC:49:8D:F5:25:77:EB:F2:E9:3B:9A");
- put("affirmtrustcommercialca [jdk]",
- "03:76:AB:1D:54:C5:F9:80:3C:E4:B2:E2:01:A0:EE:7E:EF:7B:57:B6:36:E8:A9:3C:9B:8D:48:60:C9:6F:5F:A7");
- put("affirmtrustpremiumeccca [jdk]",
- "BD:71:FD:F6:DA:97:E4:CF:62:D1:64:7A:DD:25:81:B0:7D:79:AD:F8:39:7E:B4:EC:BA:9C:5E:84:88:82:14:23");
- put("deutschetelekomrootca2 [jdk]",
- "B6:19:1A:50:D0:C3:97:7F:7D:A9:9B:CD:AA:C8:6A:22:7D:AE:B9:67:9E:C7:0B:A3:B0:C9:D9:22:71:C1:70:D3");
- put("ttelesecglobalrootclass3ca [jdk]",
- "FD:73:DA:D3:1C:64:4F:F1:B4:3B:EF:0C:CD:DA:96:71:0B:9C:D9:87:5E:CA:7E:31:70:7A:F3:E9:6D:52:2B:BD");
- put("ttelesecglobalrootclass2ca [jdk]",
- "91:E2:F5:78:8D:58:10:EB:A7:BA:58:73:7D:E1:54:8A:8E:CA:CD:01:45:98:BC:0B:14:3E:04:1B:17:05:25:52");
- put("starfieldservicesrootg2ca [jdk]",
- "56:8D:69:05:A2:C8:87:08:A4:B3:02:51:90:ED:CF:ED:B1:97:4A:60:6A:13:C6:E5:29:0F:CB:2A:E6:3E:DA:B5");
- put("globalsignca [jdk]",
- "EB:D4:10:40:E4:BB:3E:C7:42:C9:E3:81:D3:1E:F2:A4:1A:48:B6:68:5C:96:E7:CE:F3:C1:DF:6C:D4:33:1C:99");
- put("globalsignr3ca [jdk]",
- "CB:B5:22:D7:B7:F1:27:AD:6A:01:13:86:5B:DF:1C:D4:10:2E:7D:07:59:AF:63:5A:7C:F4:72:0D:C9:63:C5:3B");
- put("globalsigneccrootcar5 [jdk]",
- "17:9F:BC:14:8A:3D:D0:0F:D2:4E:A1:34:58:CC:43:BF:A7:F5:9C:81:82:D7:83:A5:13:F6:EB:EC:10:0C:89:24");
- put("globalsigneccrootcar4 [jdk]",
- "BE:C9:49:11:C2:95:56:76:DB:6C:0A:55:09:86:D7:6E:3B:A0:05:66:7C:44:2C:97:62:B4:FB:B7:73:DE:22:8C");
- put("globalsignr2ca [jdk]",
- "CA:42:DD:41:74:5F:D0:B8:1E:B9:02:36:2C:F9:D8:BF:71:9D:A1:BD:1B:1E:FC:94:6F:5B:4C:99:F4:2C:1B:9E");
- put("teliasonerarootcav1 [jdk]",
- "DD:69:36:FE:21:F8:F0:77:C1:23:A1:A5:21:C1:22:24:F7:22:55:B7:3E:03:A7:26:06:93:E8:A2:4B:0F:A3:89");
- }
- };
-
- // Exception list to 90 days expiry policy
- // No error will be reported if certificate in this list expires
- private static final HashSet<String> EXPIRY_EXC_ENTRIES
- = new HashSet<String>(Arrays.asList(
- "gtecybertrustglobalca [jdk]"
- ));
-
- // Ninety days in milliseconds
- private static final long NINETY_DAYS = 7776000000L;
-
- private static boolean atLeastOneFailed = false;
-
- private static MessageDigest md;
-
- public static void main(String[] args) throws Exception {
- System.out.println("cacerts file: " + CACERTS);
- md = MessageDigest.getInstance("SHA-256");
- KeyStore ks = KeyStore.getInstance("JKS");
- ks.load(new FileInputStream(CACERTS), "changeit".toCharArray());
-
- // check the count of certs inside
- if (ks.size() != COUNT) {
- atLeastOneFailed = true;
- System.err.println("ERROR: " + ks.size() + " entries, should be "
- + COUNT);
- }
-
- // check that all entries in the map are in the keystore
- for (String alias : FINGERPRINT_MAP.keySet()) {
- if (!ks.isCertificateEntry(alias)) {
- atLeastOneFailed = true;
- System.err.println("ERROR: " + alias + " is not in cacerts");
- }
- }
-
- // pull all the trusted self-signed CA certs out of the cacerts file
- // and verify their signatures
- Enumeration<String> aliases = ks.aliases();
- while (aliases.hasMoreElements()) {
- String alias = aliases.nextElement();
- System.out.println("\nVerifying " + alias);
- if (!ks.isCertificateEntry(alias)) {
- atLeastOneFailed = true;
- System.err.println("ERROR: " + alias
- + " is not a trusted cert entry");
- }
- X509Certificate cert = (X509Certificate) ks.getCertificate(alias);
- if (!checkFingerprint(alias, cert)) {
- atLeastOneFailed = true;
- System.err.println("ERROR: " + alias + " SHA-256 fingerprint is incorrect");
- }
- // Make sure cert can be self-verified
- try {
- cert.verify(cert.getPublicKey());
- } catch (Exception e) {
- atLeastOneFailed = true;
- System.err.println("ERROR: cert cannot be verified:"
- + e.getMessage());
- }
-
- // Make sure cert is not expired or not yet valid
- try {
- cert.checkValidity();
- } catch (CertificateExpiredException cee) {
- if (!EXPIRY_EXC_ENTRIES.contains(alias)) {
- atLeastOneFailed = true;
- System.err.println("ERROR: cert is expired");
- }
- } catch (CertificateNotYetValidException cne) {
- atLeastOneFailed = true;
- System.err.println("ERROR: cert is not yet valid");
- }
-
- // If cert is within 90 days of expiring, mark as failure so
- // that cert can be scheduled to be removed/renewed.
- Date notAfter = cert.getNotAfter();
- if (notAfter.getTime() - System.currentTimeMillis() < NINETY_DAYS) {
- if (!EXPIRY_EXC_ENTRIES.contains(alias)) {
- atLeastOneFailed = true;
- System.err.println("ERROR: cert \"" + alias + "\" expiry \""
- + notAfter.toString() + "\" will expire within 90 days");
- }
- }
- }
-
- if (atLeastOneFailed) {
- throw new Exception("At least one cacert test failed");
- }
- }
-
- private static boolean checkFingerprint(String alias, Certificate cert)
- throws Exception {
- String fingerprint = FINGERPRINT_MAP.get(alias);
- if (fingerprint == null) {
- // no entry for alias
- return true;
- }
- System.out.println("Checking fingerprint of " + alias);
- byte[] digest = md.digest(cert.getEncoded());
- return fingerprint.equals(toHexString(digest));
- }
-
- private static String toHexString(byte[] block) {
- StringBuilder buf = new StringBuilder();
- int len = block.length;
- for (int i = 0; i < len; i++) {
- buf.append(String.format("%02X", block[i]));
- if (i < len - 1) {
- buf.append(":");
- }
- }
- return buf.toString();
- }
-}
--- a/test/jdk/lib/testlibrary/ModuleTargetHelper.java Tue Oct 16 15:45:19 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.lang.module.ModuleReader;
-import java.lang.module.ModuleReference;
-import java.net.URI;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-import jdk.internal.module.ModuleInfo;
-import jdk.internal.module.ModuleInfo.Attributes;
-
-public class ModuleTargetHelper {
- private ModuleTargetHelper() {}
-
- public static final class ModuleTarget {
- private String targetPlatform;
-
- public ModuleTarget(String targetPlatform) {
- this.targetPlatform = targetPlatform;
- }
-
- public String targetPlatform() {
- return targetPlatform;
- }
- }
-
- public static ModuleTarget getJavaBaseTarget() throws IOException {
- Path p = Paths.get(URI.create("jrt:/modules/java.base/module-info.class"));
- try (InputStream in = Files.newInputStream(p)) {
- return read(in);
- }
- }
-
- public static ModuleTarget read(InputStream in) throws IOException {
- ModuleInfo.Attributes attrs = ModuleInfo.read(in, null);
- if (attrs.target() != null) {
- return new ModuleTarget(attrs.target().targetPlatform());
- } else {
- return null;
- }
- }
-
- public static ModuleTarget read(ModuleReference modRef) throws IOException {
- ModuleReader reader = modRef.open();
- try (InputStream in = reader.open("module-info.class").get()) {
- return read(in);
- } finally {
- reader.close();
- }
- }
-}
--- a/test/jdk/lib/testlibrary/ModuleUtils.java Tue Oct 16 15:45:19 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.lang.module.ModuleDescriptor;
-import java.lang.module.ModuleFinder;
-import java.lang.module.ModuleReader;
-import java.lang.module.ModuleReference;
-import java.net.URI;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-
-
-/**
- * This class consists exclusively of static utility methods that are useful
- * for creating tests for modules.
- */
-
-public final class ModuleUtils {
- private ModuleUtils() { }
-
-
- /**
- * Returns a ModuleFinder that finds modules with the given module
- * descriptors.
- */
- static ModuleFinder finderOf(ModuleDescriptor... descriptors) {
-
- // Create a ModuleReference for each module
- Map<String, ModuleReference> namesToReference = new HashMap<>();
-
- for (ModuleDescriptor descriptor : descriptors) {
- String name = descriptor.name();
-
- URI uri = URI.create("module:/" + name);
-
- ModuleReference mref = new ModuleReference(descriptor, uri) {
- @Override
- public ModuleReader open() {
- throw new UnsupportedOperationException();
- }
- };
-
- namesToReference.put(name, mref);
- }
-
- return new ModuleFinder() {
- @Override
- public Optional<ModuleReference> find(String name) {
- Objects.requireNonNull(name);
- return Optional.ofNullable(namesToReference.get(name));
- }
- @Override
- public Set<ModuleReference> findAll() {
- return new HashSet<>(namesToReference.values());
- }
- };
- }
-
-}
--- a/test/jdk/lib/testlibrary/java/util/jar/CreateMultiReleaseTestJars.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/lib/testlibrary/java/util/jar/CreateMultiReleaseTestJars.java Wed Oct 17 08:09:46 2018 -0700
@@ -142,6 +142,12 @@
}
public void buildSignedMultiReleaseJar() throws Exception {
+ buildSignedMultiReleaseJar("multi-release.jar", "signed-multi-release.jar");
+ }
+
+ public void buildSignedMultiReleaseJar(String multiReleaseJar,
+ String signedMultiReleaseJar) throws Exception
+ {
String testsrc = System.getProperty("test.src",".");
String testdir = findTestDir(testsrc);
String keystore = testdir + "/sun/security/tools/jarsigner/JarSigning.keystore";
@@ -155,8 +161,8 @@
CertPath cp = CertificateFactory.getInstance("X.509")
.generateCertPath(Arrays.asList(ks.getCertificateChain("b")));
JarSigner js = new JarSigner.Builder(pkb, cp).build();
- try (ZipFile in = new ZipFile("multi-release.jar");
- FileOutputStream os = new FileOutputStream("signed-multi-release.jar"))
+ try (ZipFile in = new ZipFile(multiReleaseJar);
+ FileOutputStream os = new FileOutputStream(signedMultiReleaseJar))
{
js.sign(in, os);
}
--- a/test/jdk/lib/testlibrary/jdk/testlibrary/SimpleSSLContext.java Tue Oct 16 15:45:19 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.testlibrary;
-
-import java.util.*;
-import java.util.concurrent.*;
-import java.io.*;
-import java.net.*;
-import java.security.*;
-import java.security.cert.*;
-import javax.net.ssl.*;
-
-/**
- * Creates a simple usable SSLContext for SSLSocketFactory
- * or a HttpsServer using either a given keystore or a default
- * one in the test tree.
- *
- * Using this class with a security manager requires the following
- * permissions to be granted:
- *
- * permission "java.util.PropertyPermission" "test.src.path", "read";
- * permission java.io.FilePermission
- * "${test.src}/../../../lib/testlibrary/jdk/testlibrary/testkeys", "read";
- * The exact path above depends on the location of the test.
- */
-public class SimpleSSLContext {
-
- SSLContext ssl;
-
- /**
- * loads default keystore from SimpleSSLContext
- * source directory
- */
- public SimpleSSLContext() throws IOException {
- try {
- AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
- @Override
- public Void run() throws Exception {
- String paths = System.getProperty("test.src.path");
- StringTokenizer st = new StringTokenizer(paths, File.pathSeparator);
- boolean securityExceptions = false;
- while (st.hasMoreTokens()) {
- String path = st.nextToken();
- try {
- File f = new File(path, "jdk/testlibrary/testkeys");
- if (f.exists()) {
- try (FileInputStream fis = new FileInputStream(f)) {
- init(fis);
- return null;
- }
- }
- } catch (SecurityException e) {
- // catch and ignore because permission only required
- // for one entry on path (at most)
- securityExceptions = true;
- }
- }
- if (securityExceptions) {
- System.err.println("SecurityExceptions thrown on loading testkeys");
- }
- return null;
- }
- });
- } catch (PrivilegedActionException pae) {
- Throwable t = pae.getCause() != null ? pae.getCause() : pae;
- if (t instanceof IOException)
- throw (IOException)t;
- if (t instanceof RuntimeException)
- throw (RuntimeException)t;
- if (t instanceof Error)
- throw (Error)t;
- throw new RuntimeException(t);
- }
- }
-
- /**
- * loads default keystore from given directory
- */
- public SimpleSSLContext(String dir) throws IOException {
- String file = dir+"/testkeys";
- try (FileInputStream fis = new FileInputStream(file)) {
- init(fis);
- }
- }
-
- private void init(InputStream i) throws IOException {
- try {
- char[] passphrase = "passphrase".toCharArray();
- KeyStore ks = KeyStore.getInstance("JKS");
- ks.load(i, passphrase);
-
- KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
- kmf.init(ks, passphrase);
-
- TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
- tmf.init(ks);
-
- ssl = SSLContext.getInstance("TLS");
- ssl.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
- } catch (KeyManagementException e) {
- throw new RuntimeException(e.getMessage());
- } catch (KeyStoreException e) {
- throw new RuntimeException(e.getMessage());
- } catch (UnrecoverableKeyException e) {
- throw new RuntimeException(e.getMessage());
- } catch (CertificateException e) {
- throw new RuntimeException(e.getMessage());
- } catch (NoSuchAlgorithmException e) {
- throw new RuntimeException(e.getMessage());
- }
- }
-
- public SSLContext get() {
- return ssl;
- }
-}
Binary file test/jdk/lib/testlibrary/jdk/testlibrary/testkeys has changed
--- a/test/jdk/sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -54,7 +54,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.button.ButtonDemo
- * @run testng ButtonDemoScreenshotTest
+ * @run testng/timeout=600 ButtonDemoScreenshotTest
*/
@Listeners(GuiTestListener.class)
public class ButtonDemoScreenshotTest {
--- a/test/jdk/sanity/client/SwingSet/src/ButtonDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/ButtonDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -56,7 +56,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.button.ButtonDemo
- * @run testng ButtonDemoTest
+ * @run testng/timeout=600 ButtonDemoTest
*/
@Listeners(GuiTestListener.class)
public class ButtonDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/ComboBoxDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/ComboBoxDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -45,7 +45,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.combobox.ComboBoxDemo
- * @run testng ComboBoxDemoTest
+ * @run testng/timeout=600 ComboBoxDemoTest
*/
@Listeners(GuiTestListener.class)
public class ComboBoxDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/DialogDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/DialogDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -55,7 +55,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.dialog.DialogDemo
- * @run testng DialogDemoTest
+ * @run testng/timeout=600 DialogDemoTest
*/
@Listeners(GuiTestListener.class)
public class DialogDemoTest {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/SwingSet/src/EditorPaneDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,184 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import static com.sun.swingset3.demos.editorpane.EditorPaneDemo.DEMO_TITLE;
+import static com.sun.swingset3.demos.editorpane.EditorPaneDemo.SOURCE_FILES;
+import static org.jemmy2ext.JemmyExt.EXACT_STRING_COMPARATOR;
+
+import java.awt.Dimension;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.image.BufferedImage;
+import java.beans.PropertyChangeListener;
+import java.net.URL;
+import java.util.concurrent.atomic.AtomicReference;
+
+import javax.swing.UIManager;
+
+import org.jemmy2ext.JemmyExt;
+import org.jtregext.GuiTestListener;
+import org.netbeans.jemmy.ClassReference;
+import org.netbeans.jemmy.image.ImageTool;
+import org.netbeans.jemmy.operators.JEditorPaneOperator;
+import org.netbeans.jemmy.operators.JFrameOperator;
+import org.testng.annotations.Listeners;
+import org.testng.annotations.Test;
+
+import com.sun.swingset3.demos.editorpane.EditorPaneDemo;
+
+/*
+ * @test
+ * @key headful
+ * @summary Verifies SwingSet3 EditorPaneDemo by navigating and and validating
+ * the page contents in all pages
+ *
+ * @library /sanity/client/lib/jemmy/src
+ * @library /sanity/client/lib/Extensions/src
+ * @library /sanity/client/lib/SwingSet3/src
+ * @modules java.desktop
+ * java.logging
+ * @build org.jemmy2ext.JemmyExt
+ * @build com.sun.swingset3.demos.editorpane.EditorPaneDemo
+ * @run testng/timeout=600 EditorPaneDemoTest
+ */
+@Listeners(GuiTestListener.class)
+public class EditorPaneDemoTest {
+
+ private final static String PROPERTY_NAME_PAGE = "page";
+ private final static String INDEX_PAGE_NAME = "index.html";
+ private final static String TEXT_IN_INDEX_PAGE = "Octavo Corporation";
+ private final static Dimension INDEX_IMAGE_DIMENSION = new Dimension(550, 428);
+ private final static Dimension imageDimensions[] = {new Dimension(320, 342),
+ new Dimension(420, 290), new Dimension(381, 384),
+ new Dimension(316, 498), new Dimension(481 ,325),
+ new Dimension(516, 445)};
+ private final static String REFERENCE_NAMES[] =
+ {"title", "king", "preface", "seaweed", "ant", "bug"};
+ private final static String TEXTS_IN_PAGES[] =
+ {"Physiological Descriptions", "ROBERT HOOKE",
+ "Mankind above other Creatures", "Area A B C D",
+ "Observ. XLIX", "Cylinder F F F"};
+ private final AtomicReference<URL> newPageURL = new AtomicReference<>();
+
+ /**
+ * Testing the navigation through all html pages in EditorPaneDemo by
+ * clicking on different references and validating the page contents.
+ *
+ * @throws Exception
+ */
+ @Test(dataProvider = "availableLookAndFeels", dataProviderClass = TestHelpers.class)
+ public void test(String lookAndFeel) throws Exception {
+ UIManager.setLookAndFeel(lookAndFeel);
+ new ClassReference(EditorPaneDemo.class.getCanonicalName()).startApplication();
+
+ JFrameOperator frameOperator = new JFrameOperator(DEMO_TITLE);
+ frameOperator.setComparator(EXACT_STRING_COMPARATOR);
+ PropertyChangeListener pageChangeListener =
+ event -> newPageURL.set((URL) event.getNewValue());
+ JEditorPaneOperator editorPaneOperator = new JEditorPaneOperator(frameOperator);
+
+ try {
+ editorPaneOperator.addPropertyChangeListener(
+ PROPERTY_NAME_PAGE, pageChangeListener);
+ // Validation of initial or index page
+ URL indexURL = getPageURL(INDEX_PAGE_NAME);
+ editorPaneOperator.waitStateOnQueue(comp
+ -> indexURL.equals(editorPaneOperator.getPage()));
+ checkImage(editorPaneOperator, INDEX_IMAGE_DIMENSION, INDEX_PAGE_NAME);
+ checkTextPresence(editorPaneOperator, TEXT_IN_INDEX_PAGE);
+
+ // Clicking on different references and validating pages by selecting
+ // unique texts in each page
+ for (int i = 0; i < REFERENCE_NAMES.length; i++) {
+ editorPaneOperator.clickOnReference(REFERENCE_NAMES[i]);
+ validatePage(editorPaneOperator, i);
+ }
+ } finally {
+ editorPaneOperator.removePropertyChangeListener(
+ PROPERTY_NAME_PAGE, pageChangeListener);
+ }
+ }
+
+ private void checkTextPresence(
+ JEditorPaneOperator editorPaneOperator, String text) {
+ editorPaneOperator.selectText(text);
+ editorPaneOperator.waitStateOnQueue(comp
+ -> text.equals(editorPaneOperator.getSelectedText()));
+ }
+
+ private void validatePage(JEditorPaneOperator editorPaneOperator,
+ int i) throws Exception {
+ URL expectedPageURL = getPageURL(REFERENCE_NAMES[i] + ".html");
+ editorPaneOperator.waitStateOnQueue(comp
+ -> expectedPageURL.equals(newPageURL.get()));
+ checkImage(editorPaneOperator, imageDimensions[i], REFERENCE_NAMES[i]);
+ checkTextPresence(editorPaneOperator, TEXTS_IN_PAGES[i]);
+ }
+
+ private void checkImage(JEditorPaneOperator editorPaneOperator,
+ Dimension imageDim, String pageName) throws Exception {
+ // Captures image screen shot and checking some 10 pixels from inner
+ // area of the image are not default background color
+ Point compLoc = editorPaneOperator.getLocationOnScreen();
+ Insets insets = editorPaneOperator.getInsets();
+ Rectangle imageRect = new Rectangle(new Point(compLoc.x + insets.left,
+ compLoc.y + insets.top), imageDim);
+ final int xGap = 100, yGap = 40, columns = 2, rows = 5;
+ editorPaneOperator.waitState(comp -> {
+ BufferedImage capturedImage = ImageTool.getImage(imageRect);
+ int x = 0, y = 0, i = 0, j;
+ for (; i < columns; i++) {
+ x += xGap;
+ y = 0;
+ for (j = 0; j < rows; j++) {
+ y += yGap;
+ if(capturedImage.getRGB(x, y) ==
+ editorPaneOperator.getBackground().getRGB()) {
+ // saving image for failure case
+ JemmyExt.save(capturedImage, "capturedimage_" + pageName + "_" +
+ UIManager.getLookAndFeel().getClass().getSimpleName() + ".png");
+ return false;
+ }
+ }
+ }
+ return true;
+ });
+ }
+
+ /**
+ * Gets the URL corresponding to a page name
+ *
+ * @param pageName : name of the page
+ * @return : URL corresponding to page
+ */
+ private URL getPageURL(String pageName) {
+ String url = null;
+ for (String sourceFile : SOURCE_FILES) {
+ if(sourceFile.endsWith(pageName)) {
+ url = sourceFile;
+ }
+ }
+ return getClass().getResource(url);
+ }
+}
--- a/test/jdk/sanity/client/SwingSet/src/FrameDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/FrameDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -86,7 +86,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.frame.FrameDemo
- * @run testng FrameDemoTest
+ * @run testng/timeout=600 FrameDemoTest
*/
@Listeners(GuiTestListener.class)
public class FrameDemoTest {
@@ -293,4 +293,4 @@
});
}
-}
\ No newline at end of file
+}
--- a/test/jdk/sanity/client/SwingSet/src/GridBagLayoutDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/GridBagLayoutDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -51,7 +51,7 @@
* @modules java.desktop
* java.logging
* @build com.sun.swingset3.demos.gridbaglayout.GridBagLayoutDemo
- * @run testng GridBagLayoutDemoTest
+ * @run testng/timeout=600 GridBagLayoutDemoTest
*/
@Listeners(GuiTestListener.class)
--- a/test/jdk/sanity/client/SwingSet/src/ListDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/ListDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -56,7 +56,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.list.ListDemo
- * @run testng ListDemoTest
+ * @run testng/timeout=600 ListDemoTest
*/
@Listeners(GuiTestListener.class)
public class ListDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/OptionPaneDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/OptionPaneDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -55,7 +55,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.optionpane.OptionPaneDemo
- * @run testng OptionPaneDemoTest
+ * @run testng/timeout=600 OptionPaneDemoTest
*/
@Listeners(GuiTestListener.class)
public class OptionPaneDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/ProgressBarDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/ProgressBarDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -49,7 +49,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.progressbar.ProgressBarDemo
- * @run testng/timeout=240 ProgressBarDemoTest
+ * @run testng/timeout=1200 ProgressBarDemoTest
*/
@Listeners(GuiTestListener.class)
public class ProgressBarDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/ScrollPaneDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/ScrollPaneDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -45,7 +45,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.scrollpane.ScrollPaneDemo
- * @run testng ScrollPaneDemoTest
+ * @run testng/timeout=600 ScrollPaneDemoTest
*/
@Listeners(GuiTestListener.class)
public class ScrollPaneDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/SpinnerDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/SpinnerDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -47,7 +47,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.spinner.SpinnerDemo
- * @run testng SpinnerDemoTest
+ * @run testng/timeout=600 SpinnerDemoTest
*/
@Listeners(GuiTestListener.class)
public class SpinnerDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/TabbedPaneDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/TabbedPaneDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -48,7 +48,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.tabbedpane.TabbedPaneDemo
- * @run testng TabbedPaneDemoTest
+ * @run testng/timeout=600 TabbedPaneDemoTest
*/
@Listeners(GuiTestListener.class)
public class TabbedPaneDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/TableDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/TableDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -64,7 +64,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.table.TableDemo
- * @run testng TableDemoTest
+ * @run testng/timeout=600 TableDemoTest
*/
@Listeners(GuiTestListener.class)
public class TableDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/TextFieldDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/TextFieldDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -65,7 +65,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.textfield.TextFieldDemo
- * @run testng TextFieldDemoTest
+ * @run testng/timeout=600 TextFieldDemoTest
*/
@Listeners(GuiTestListener.class)
public class TextFieldDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/ToggleButtonDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/ToggleButtonDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -61,7 +61,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.togglebutton.ToggleButtonDemo
- * @run testng ToggleButtonDemoTest
+ * @run testng/timeout=600 ToggleButtonDemoTest
*/
@Listeners(GuiTestListener.class)
public class ToggleButtonDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/ToolTipDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/ToolTipDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -61,7 +61,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.tooltip.ToolTipDemo
- * @run testng ToolTipDemoTest
+ * @run testng/timeout=600 ToolTipDemoTest
*/
@Listeners(GuiTestListener.class)
public class ToolTipDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/TreeDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/TreeDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -56,7 +56,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.tree.TreeDemo
- * @run testng TreeDemoTest
+ * @run testng/timeout=600 TreeDemoTest
*/
@Listeners(GuiTestListener.class)
public class TreeDemoTest {
--- a/test/jdk/sanity/client/SwingSet/src/WindowDemoTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/SwingSet/src/WindowDemoTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -49,7 +49,7 @@
* java.logging
* @build org.jemmy2ext.JemmyExt
* @build com.sun.swingset3.demos.window.WindowDemo
- * @run testng WindowDemoTest
+ * @run testng/timeout=600 WindowDemoTest
*/
@Listeners(GuiTestListener.class)
public class WindowDemoTest {
--- a/test/jdk/sanity/client/lib/Extensions/src/org/jemmy2ext/JemmyExt.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sanity/client/lib/Extensions/src/org/jemmy2ext/JemmyExt.java Wed Oct 17 08:09:46 2018 -0700
@@ -48,6 +48,7 @@
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JWindow;
+import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.CompoundBorder;
import javax.swing.border.TitledBorder;
@@ -340,19 +341,21 @@
* full dump and a screenshot of the whole screen.
*/
public static void captureAll() {
- PNGEncoder.captureScreen("failure.png", PNGEncoder.COLOR_MODE);
+ String lookAndFeelClassName = UIManager.getLookAndFeel().getClass().getSimpleName();
+ PNGEncoder.captureScreen("failure_" + lookAndFeelClassName + ".png", PNGEncoder.COLOR_MODE);
try {
- Dumper.dumpAll("dumpAll.xml");
+ Dumper.dumpAll("dumpAll_" + lookAndFeelClassName + ".xml");
} catch (FileNotFoundException ex) {
Logger.getLogger(JemmyExt.class.getName()).log(Level.SEVERE, null, ex);
}
- captureWindows();
+ captureWindows(lookAndFeelClassName);
}
/**
* Captures each showing window image using Window.paint() method.
+ * @param lookAndFeelClassName
*/
- private static void captureWindows() {
+ private static void captureWindows(String lookAndFeelClassName) {
try {
EventQueue.invokeAndWait(() -> {
Window[] windows = Window.getWindows();
@@ -367,7 +370,8 @@
g.dispose();
try {
- ImageIO.write(img, "png", new File("window" + index++ + ".png"));
+ ImageIO.write(img, "png", new File("window_" + lookAndFeelClassName
+ + "_" + index++ + ".png"));
} catch (IOException e) {
e.printStackTrace();
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/EditorPaneDemo.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.swingset3.demos.editorpane;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.swing.JEditorPane;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JViewport;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+import javax.swing.text.html.HTMLDocument;
+import javax.swing.text.html.HTMLFrameHyperlinkEvent;
+
+import com.sun.swingset3.DemoProperties;
+
+/**
+ * EditorPane Demo (was HTMLDemo in SwingSet2)
+ */
+@DemoProperties(
+ value = "JEditorPane Demo",
+ category = "Text",
+ description = "Demonstrates JEditorPane, a text component which supports display and editing of rich text formats (such as HTML)",
+ sourceFiles = {
+ "com/sun/swingset3/demos/editorpane/EditorPaneDemo.java",
+ "com/sun/swingset3/demos/editorpane/book/ant.html",
+ "com/sun/swingset3/demos/editorpane/book/bug.html",
+ "com/sun/swingset3/demos/editorpane/book/index.html",
+ "com/sun/swingset3/demos/editorpane/book/king.html",
+ "com/sun/swingset3/demos/editorpane/book/preface.html",
+ "com/sun/swingset3/demos/editorpane/book/seaweed.html",
+ "com/sun/swingset3/demos/editorpane/book/title.html",
+ "com/sun/swingset3/demos/editorpane/book/editorpane/back.jpg",
+ "com/sun/swingset3/demos/editorpane/book/editorpane/forward.jpg",
+ "com/sun/swingset3/demos/editorpane/book/editorpane/header.jpg",
+ "com/sun/swingset3/demos/editorpane/book/Octavo/ant.jpg",
+ "com/sun/swingset3/demos/editorpane/book/Octavo/book.jpg",
+ "com/sun/swingset3/demos/editorpane/book/Octavo/bug.jpg",
+ "com/sun/swingset3/demos/editorpane/book/Octavo/bug2.jpg",
+ "com/sun/swingset3/demos/editorpane/book/Octavo/COPYRIGHT",
+ "com/sun/swingset3/demos/editorpane/book/Octavo/crest.jpg",
+ "com/sun/swingset3/demos/editorpane/book/Octavo/king.jpg",
+ "com/sun/swingset3/demos/editorpane/book/Octavo/micro.jpg",
+ "com/sun/swingset3/demos/editorpane/book/Octavo/seaweed.jpg",
+ "com/sun/swingset3/demos/editorpane/resources/EditorPaneDemo.properties",
+ "com/sun/swingset3/demos/editorpane/resources/images/EditorPaneDemo.gif"
+ }
+)
+public class EditorPaneDemo extends JPanel {
+
+ public static final String DEMO_TITLE = EditorPaneDemo.class.getAnnotation(DemoProperties.class).value();
+ public static final String[] SOURCE_FILES = EditorPaneDemo.class.getAnnotation(DemoProperties.class).sourceFiles();
+ private JEditorPane html;
+
+ /**
+ * main method allows us to run as a standalone demo.
+ */
+ public static void main(String[] args) {
+ JFrame frame = new JFrame(EditorPaneDemo.class.getAnnotation(DemoProperties.class).value());
+
+ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ frame.getContentPane().add(new EditorPaneDemo());
+ frame.setPreferredSize(new Dimension(800, 600));
+ frame.pack();
+ frame.setLocationRelativeTo(null);
+ frame.setVisible(true);
+ }
+
+ /**
+ * EditorPaneDemo Constructor
+ */
+ public EditorPaneDemo() {
+ setLayout(new BorderLayout());
+
+ try {
+ URL url;
+ // System.getProperty("user.dir") +
+ // System.getProperty("file.separator");
+ String path = null;
+ try {
+ path = "book/index.html";
+ url = getClass().getResource(path);
+ } catch (Exception e) {
+ System.err.println("Failed to open " + path);
+ url = null;
+ }
+
+ if (url != null) {
+ html = new JEditorPane(url);
+ html.setEditable(false);
+ html.addHyperlinkListener(createHyperLinkListener());
+
+ JScrollPane scroller = new JScrollPane();
+ JViewport vp = scroller.getViewport();
+ vp.add(html);
+ add(scroller, BorderLayout.CENTER);
+ }
+ } catch (MalformedURLException e) {
+ System.out.println("Malformed URL: " + e);
+ } catch (IOException e) {
+ System.out.println("IOException: " + e);
+ }
+ }
+
+ private HyperlinkListener createHyperLinkListener() {
+ return new HyperlinkListener() {
+ public void hyperlinkUpdate(HyperlinkEvent e) {
+ if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
+ if (e instanceof HTMLFrameHyperlinkEvent) {
+ ((HTMLDocument) html.getDocument()).processHTMLFrameHyperlinkEvent(
+ (HTMLFrameHyperlinkEvent) e);
+ } else {
+ try {
+ html.setPage(e.getURL());
+ } catch (IOException ioe) {
+ System.out.println("IOE: " + ioe);
+ }
+ }
+ }
+ }
+ };
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/CREDITS Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,2 @@
+Images and text in the SwingSet3 EditorPane demo are used by permission of Octavo
+Corporation and are sourced from Rare Book Room (rarebookroom.org).
\ No newline at end of file
Binary file test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/Octavo/ant.jpg has changed
Binary file test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/Octavo/book.jpg has changed
Binary file test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/Octavo/bug.jpg has changed
Binary file test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/Octavo/bug2.jpg has changed
Binary file test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/Octavo/crest.jpg has changed
Binary file test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/Octavo/king.jpg has changed
Binary file test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/Octavo/micro.jpg has changed
Binary file test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/Octavo/seaweed.jpg has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/ant.html Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,121 @@
+<html>
+<head>
+<title>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<img src="Octavo/ant.jpg" width="481" height="325">
+<h1 align="center"><br>
+ Observ. XLIX. Of an Ant or Pismire.<br>
+</h1>
+<p align="center"> </p>
+<blockquote>
+ <blockquote>
+ <p><font size="4">This was a creature, more troublesom to be drawn, then any
+ of the rest, for I could not, for a good while, think of a way to make it
+ suffer its body to ly quiet in a natural posture; but whil'st it was alive,
+ if its feet were fetter'd in Wax or Glew, it would so twist and wind its body,
+ that I could not any wayes get a good view of it; and if I killed it, its
+ body was so little, that I did often spoile the shape of it, before I could
+ throughly view it: for this is the nature of these minute Bodies, that as
+ soon, almost, as ever their life is destroy'd, their parts immediately shrivel,
+ and lose their beauty; and so is it also with small Plants, as I instanced
+ before, in the description of Moss. </font></p>
+ <p><font size="4">And thence also is the reason of the variations in the beards
+ of wild Oats, and in those of Muskgrass seed, that their bodies, being exceeding
+ small, those small variations which are made in the surfaces of all bodies,
+ almost upon every change of Air, especially if the body be porous, do here
+ become sensible, where the whole body is so small, that it is almost nothing
+ but surface; for as in vegetable substances, I see no great reason to think,
+ that the moisture of the Aire (that, sticking to a wreath'd beard, does make
+ it untwist) should evaporate, or exhale away, any faster then the moisture
+ of other bodies, but rather that the avolation from, or access of moisture
+ to, the surfaces of bodies being much the same, those bodies become most
+ sensible of it, which have the least proportion of body to their surface.
+ </font></p>
+ <p><font size="4">So is it also with Animal substances; the dead body of an
+ Ant, or such little creature, does almost instantly shrivel and dry, and
+ your object shall be quite another thing, before you can half delineate
+ it, which proceeds not from the extraordinary exhalation, but from the small
+ proportion of body and juices, to the usual drying of bodies in the Air,
+ especially if warm. </font></p>
+ <p><font size="4">For which inconvenience, where I could not otherwise remove
+ it, I thought of this expedient. I took the creature, I had design'd to delineate,
+ and put it into a drop of very well rectified spirit of Wine, this I found
+ would presently dispatch, as it were, the Animal, and being taken out of
+ it, and lay'd on a paper,the spirit of Wine would immediately fly away,
+ and leave the Animal dry, in its natural posture, or at least, in a constitution,
+ that it might easily with a pin be plac'd, in what posture you desired to
+ draw it, and the limbs would so remain, without either moving, or shriveling.
+ </font></p>
+ <p><font size="4">And thus I dealt with this Ant, which I have here delineated,
+ which was one of many, of a very large kind, that inhabited under the Roots
+ of a Tree, from whence they would sally out in great parties, and make most
+ grievous havock of the Flowers and Fruits, in the ambient Garden, and return back
+ again very expertly, by the same wayes and paths they went. </font></p>
+ <p><font size="4">It was more then half the bigness of an Earwig, of a dark
+ brown, or reddish colour, with long legs, on the hinder of which it would
+ stand up, and raise its head as high as it could above the ground, that it
+ might stare the further about it, just after the same manner as I have also
+ observ'd a hunting Spider to do: and putting my finger towards them, they
+ have at first all run towards it, till almost at it; and then they would stand
+ round about it, at a certain distance, and smell, as it were, and consider
+ whether they should any of them venture any further, till one more bold then
+ the rest venturing to climb it, all the rest, if I would have suffered them,
+ would have immediately followed : much such other seemingly rational actions
+ I have observ'd in this little Vermine with much pleasure, which would be
+ too long to be here related; those that desire more of them may satisfie
+ their curiosity in Ligons History of the Barbadoes. </font></p>
+ <p><font size="4">Having insnar'd several of these into a small Box, I made
+ choice of the tallest grown among them, and separating it from the rest,
+ I gave it a Gill of Brandy, or Spirit of Wine, which after a while e'en knock'd
+ him down dead drunk, so that he became moveless, though at first putting
+ in he struggled for a pretty while very much, till at last, certain bubbles
+ issuing out of his mouth, it ceased to move; this (because I had before found
+ them quickly to recover again, if they were taken out presently) I suffered
+ to lye above an hour in the Spirit; and after I had taken it out, and put
+ its body and legs into a natural posture, remained moveless about an hour;
+ but then, upon a sudden, as if it had been awaken out of a drunken sleep,
+ it suddenly reviv'd and ran away; being caught, and serv'd as before, he
+ for a while continued struggling and striving, till at last there issued
+ several bubbles out of its mouth, and then, tanquam animam expirasset, he
+ remained moveless for a good while ; but at length again recovering, it was
+ again redipt, and suffered to lye some hours in the Spirit; notwithstanding
+ which, after it had layen dry some three or four hours, it again recovered
+ life and motion: Which kind of Experiments, if prosecuted, which they highly
+ deserve, seem to me of no inconsiderable use towards the invention of the
+ Latent Scheme, (as the Noble Ve rulam calls it) or the hidden, unknown Texture
+ of Bodies. </font></p>
+ <p><font size="4">Of what Figure this Creature appear'd through the Microscope,
+ the 32. Scheme (though not so carefully graven as it ought) will represent
+ to the eye, namely, That it had a large head A A, at the upper end of which
+ were two protuberant eyes, pearl'd like those of a Fly, but smaller B B;
+ of the Nose, or foremost part, issued two horns C C, of a shape sufficiently
+ differing from those of a blew Fly, though indeed they seem to be both the
+ same kind of Organ, and to serve for a kind of smelling; beyond these were
+ two indented jaws D D, which he open'd sideways, and was able to gape them
+ asunder very wide; and the ends of them being armed with teeth, which meeting
+ went between each other, it was able to grasp and hold a heavy body, three
+ or four times the bulk and weight of its own body: It had only six legs,
+ shap'd like those of a Fly, which, as I shewed before, is an Argument that
+ it is a winged Insect, and though I could not perceive any sign of them in
+ the middle part of its body (which seem'd to consist of three joints or pieces
+ E F G, out of which sprung two legs, yet 'tis known that there are of them
+ that have long wings, and fly up and down in the air. </font></p>
+ <p><font size="4">The third and last part of its body I I I was bigger and
+ larger then the other two, unto which it was joyn'd by a very small middle,
+ and had a kind of loose shell, or another distinct part of its body H, which
+ seem'd to be interpos'd, and to keep the thorax and belly from touching.
+ The whole body was cas'd over with a very strong armour, and the belly I
+ I I was covered likewise with multitudes of small white shining brisles;
+ the legs, horns, head, and middle parts of its body were bestruck with hairs
+ also, but smaller and darker. </font></p>
+ </blockquote>
+ <p> </p>
+ <p><a href="seaweed.html"><img src="editorpane/back.jpg" width="146" height="40" align="left" border="0"></a><a href="bug.html" name="bug"><img src="editorpane/forward.jpg" width="196" height="40" align="right" border="0"></a></p>
+ <p> </p>
+ <p> </p>
+</blockquote>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/bug.html Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,128 @@
+<html>
+<head>
+<title>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<img src="Octavo/bug.jpg" width="516" height="445">
+<br>
+<h1 align="center">Observ. LIV. Of a Louse.<br>
+</h1>
+<p align="center"> </p>
+<blockquote>
+ <blockquote>
+ <p><font size="4">This is a Creature so officious, that 'twill be known to
+ every one at one time or other, so busie, and so impudent, that it will
+ be intruding it self in every ones company, and so proud and aspiring withall,
+ that it fears not to trample on the best, and affects nothing so much as
+ a Crown; feeds and lives very high, and that makes it so saucy, as to pull
+ any one by the ears that comes in its way, and will never be quiet till
+ it has drawn blood: it is troubled at nothing so much as at a man that scratches
+ his head, as knowing that man is plotting and contriving some mischief against
+ it, and that makes it oftentime sculk into some meaner and lower place, and
+ run behind a mans back, though it go very much against the hair; which ill
+ conditions of it having made it better known then trusted, would exempt me
+ from making any further description of it, did not my faithful Mercury, my
+ Microscope, bring me other information of it. </font></p>
+ <p><font size="4">For this has discovered to me, by means of a very bright light
+ cast on it, that it is a Creature of a very odd shape ; it has a head shap'd
+ like that exprest in 35. Scheme marked with A, which seems almost Conical,
+ but is a little flatted on the upper and under sides, at the biggest part
+ of which, on either side behind the head (as it were, being the place where
+ other Creatures ears stand) are placed its two black shining goggle eyes
+ B B, looking backwards, and fenced round with several small cilia or hairs
+ that incompass it, so that it seems this Creature has no very good foresight:
+ It does not seem to have any eyelids, and therefore perhaps its eyes were
+ so placed, that it might the better cleanse them with its forelegs; and perhaps
+ this may be the reason, why they so much avoid and run from the light behind
+ them, for being made to live in the shady and dark recesses of the hair,
+ and thence probably their eye having a great aperture, the open and clear
+ light, especially that of the Sun, must needs very much offend them; to secure
+ these eyes from receiving any injury from the hairs through which it passes,
+ it has two horns that grow before it, in the place where one would have thought
+ the eyes should be; each of these C C have four joynts, which are fringed,
+ as 'twere, with small brisles, from which to the tip of its snout D, the
+ head seems very round and tapering, ending in a very sharp nose D, which
+ seems to have a small hole, and to be the passage through which he sucks
+ the blood. </font></p>
+ <p> </p>
+ <p><img src="Octavo/bug2.jpg" width="537" height="348"></p>
+ <p><font size="4">Now whereas it if be plac'd on its back, with its belly
+ upwards, as it is in the 35. Scheme, it seems in several Positions to have
+ a resemblance of chaps, or jaws, as is represented in the Figure by E E,
+ yet in other postures those dark strokes disappear; and having kept several
+ of them in a box for two or three dayes, so that for all that time they had
+ nothing to feed on, I found, upon letting onecreep on my hand, that it immediately
+ fell to sucking, and did neither seem to thrust its nose very deep into the
+ skin, nor to open any kind of mouth, but I could plainly perceive a small
+ current of blood, which came directly from its snout, and past into its belly;
+ and about A there seem'd a contrivance, somewhat resembling a Pump, pair
+ of Bellows, or Heart, for by a very swift systole and diastole the blood
+ seem'd drawn from the nose, and forced into the body. </font></p>
+ <p><font size="4">It did not seem at all, though I viewed it a good while as
+ it was sucking, to thrust more of its nose into the skin then the very snout
+ D, nor did it cause the least discernable pain, and yet the blood seem'd
+ to run through its head very quick and freely, so that it seems there is
+ no part of the skin but the blood is dispers'd into, nay, even into the
+ cuticula; for had it thrust its whole nose in from D to C C, it would not
+ have amounted to the supposed thickness of that tegument, the length of
+ the nose being not more then a three hundredth part of an inch. </font></p>
+ <p><font size="4">It has six legs, covered with a very transparent shell,
+ and joynted exactly like a Crab's, or Lobster's; each leg is divided into
+ six parts by these joynts, and those have here and there several small hairs;
+ and at the end of each leg it has two claws, very properly adapted for its
+ peculiar use, being thereby inabled to walk very securely both on the skin
+ and hair; and indeed this contrivance of the feet is very curious, and could
+ not be made more commodiously and compendiously, for performing both these
+ requisite motions, of walking and climbing up the hair of a mans head, then
+ it is : for, by having the lesser claw (a) set so much short of the bigger
+ (b) when it walks on the skin the shorter touches not, and then the feet
+ are the same with those of a Mite, and several other small Insects, but by
+ means of the small joynts of the longer claw it can bend it round, and so
+ with both claws take hold of a hair, in the manner represented in the Figure,
+ the long transparent Cylinder F F F, being a Man's hair held by it. </font></p>
+ <p><font size="4">The Thorax seem'd cas'd with another kind of substance then
+ the belly, namely, with a thin transparent horny substance, which upon the fasting
+ of the Creature did not grow flaccid; through this I could plainly see the
+ blood, suck'd from my hand, to be variously distributed, and mov'd to and
+ fro; and about G there seem'd a pretty big white substance, which seem'd
+ to be moved within its thorax; besides, there appear'd very many small milk-white
+ vessels, which crost over the breast between the legs, out of which, on
+ either side, are many small branchings, these seem'd to be the veins and
+ arteries, for that which is analogus to blood in all Insects is milk-white.
+ </font></p>
+ <p><font size="4">The belly is covered with a transparent substance likewise,
+ but more resembling a skin then a shell, for 'tis grain'd all over the belly
+ just like the skin in the palms of a man's hand, and when the belly is empty,
+ grows very flaccid and wrinkled ; at the upper end of this is placed the
+ stomach H H, and perhaps also the white spot I I may be the liver, or pancreas,
+ which by the peristaltick motion of the guts, is a little mov'd to and fro,
+ not with a systole and diastole, but rather with a thronging or justling
+ motion. </font></p>
+ <p><font size="4">Viewing one of these Creatures, after it had fasted two
+ dayes, all the hinder part was lank and flaccid, and the white spot I I
+ hardly mov'd, most of the white branchings disappear'd, and most also of
+ the redness or sucked blood in the guts, the peristaltick motion of which
+ was scarce discernable; but upon the suffering it to suck, it presently
+ fill'd the skin of the belly, and of the six scolop'd embosments on either side,
+ as full as it could be stuft ; the stomach and guts were as full as they
+ could hold; the peristaltick motion of the gut grew quick, and the justling
+ motion of I I accordingly ; multitudes of milk-white vessels seem'd quickly
+ filled, and turgid, which were perhaps the veins and arteries, and the Creature
+ was so greedy, that though it could not contain more, yet it continued sucking
+ as fast as ever, and as fast emptying it self behind : the digestion of this
+ Creature must needs be very quick, for though I perceiv'd the blood thicker
+ and blacker when suck'd, yet, when in the guts, it was of a very lovely
+ ruby colour, and that part of it, which was digested into the veins, seemed
+ white; whence it appears, that a further digestion of blood may make it
+ milk, at least of a resembling colour : What is else observable in the figure
+ of this Creature, maybe seen by the 35. Scheme.</font></p>
+ </blockquote>
+ <p> </p>
+ <p><a href="ant.html"><img src="editorpane/back.jpg" width="146" height="40" align="left" border="0"></a><a href="index.html" name="index"><img src="editorpane/forward.jpg" width="196" height="40" align="right" border="0"></a></p>
+ <p> </p>
+ <p> </p>
+</blockquote>
+</body>
+</html>
Binary file test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/editorpane/back.jpg has changed
Binary file test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/editorpane/forward.jpg has changed
Binary file test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/editorpane/header.jpg has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/index.html Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,41 @@
+<html>
+<head>
+<title>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+<body bgcolor="#FFFFFF">
+<img src="Octavo/book.jpg" width="550" height="428">
+<p> </p>
+<p align="center"><img src="editorpane/header.jpg" width="363" height="171"></p>
+<p align="center"> </p>
+<p align="center"> </p>
+<blockquote>
+ <h3><b><a href="title.html" name="title">Title Page</a></b></h3>
+ <h3><b><a href="king.html">To The King</a></b></h3>
+ <h3><b><a href="preface.html">The Preface</a></b></h3>
+ <h3><a href="seaweed.html">Of the curious texture of Sea-weeds</a></h3>
+ <h3><a href="ant.html">Of an Ant or Pismire</a></h3>
+ <h3><a href="bug.html">Of a Louse</a> <br>
+ <br>
+ <br>
+ </h3>
+ <p><font color="#990000" size="4">Images and text used by permission of Octavo
+ Corporation (www.octavo.com),<br>
+ </font><font color="#990000" size="4">(c) 1999 Octavo Corporation. All
+ rights reserved.</font> <br>
+ <br>
+ <br>
+ <font size="2">Octavo Corporation is a publisher of rare
+ books and manuscripts with digital tools and formats through partnerships
+ with libraries, museums, and individuals. Using high-resolution digital imaging
+ technology, Octavo releases digital rare books on CD-ROM as Adobe PDF files
+ which can be viewed on and printed from almost any computing platform. You
+ can view each page and the binding on your computer screen, zoom in to view
+ detail up to 800% in some cases, and search, copy and paste the "live" text
+ placed invisibly behind the page images which is available for selected Editions.
+ Also included in each edition is the work's collation and provenance, as well
+ as commentary by a noted expert in its field. </font></p>
+</blockquote>
+<p> </p>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/king.html Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,44 @@
+<html>
+<head>
+<title>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<img src="Octavo/king.jpg" width="420" height="290">
+<p align="center"> </p>
+<blockquote> <font size="4">Do here most humbly lay this small Present at Your
+ Majesties Royal feet. And though it comes accompany'd with two disadvantages,
+ the meanness of the Author, and of the Subject; yet in both I am incouraged
+ by the greatness of your Mercy and your Knowledge. </font>
+<p><font size="4">By the one I am taught , that you can forgive the most presumptuous
+ Offendors: And by the other, that you will not esteem the least work of Nature,
+ or Art, unworthy your Observation. </font></p>
+ <p><font size="4">Amidst the many felicities that have accompani'd your Majesties
+ happy Restauration and Government, it is none of the least considerable, that
+ Philosophy and Experimental Learning have prosper'd under your Royal Patronage.</font></p>
+ <p><font size="4">And as the calm prosperity of your Reign has given us the
+ leisure to follow these Studies of quiet and retirement, so it is just, that
+ the Fruits of them should, by way of acknowledgement, be return'd to your
+ Majesty. There are, Sir, several other of your Subjects, of your Royal Society,
+ now busie about Nobler matters: The Improvement of Manufactures and Agriculture,
+ the Increase of Commerce, the Advantage of Navigation: In all which they are
+ assisted by your Majesties Incouragement and Example. </font></p>
+ <p><font size="4">Amidst all those greater Designs, I here presume to bring
+ in that which is more proportionable to the smalness of my Abilities, and
+ to offer some of the least of all visible things, to that Mighty King, that
+ has establisht an Empire over the best of all Invisible things of this World,
+ the Minds o f Men.</font></p>
+ <blockquote>
+ <p align="right"> </p>
+ </blockquote>
+ <p align="right"><i><font size="5">Your Majesties most humble</font></i></p>
+ <p align="right"><font size="5"><i> and most obedient</i></font></p>
+ <p align="right"><font size="5"><i> Subject and Servant,</i></font></p>
+ <p align="right"> </p>
+ <p align="right"><b><font size="5">ROBERT HOOKE .</font></b></p>
+ <p align="right"> </p>
+ <p align="right"><a href="title.html"><img src="editorpane/back.jpg" width="146" height="40" align="left" border="0"></a><a href="preface.html" name="preface"><img src="editorpane/forward.jpg" width="196" height="40" align="right" border="0"></a></p>
+</blockquote>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/preface.html Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,116 @@
+<html>
+<head>
+<title>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<img src="Octavo/micro.jpg" width="381" height="384">
+<div align="center">
+ <p> </p>
+ <h1 align="center">THE PREFACE</h1>
+ </div>
+<div align="right">
+ <p align="left"> </p>
+ <p> </p>
+</div>
+<blockquote>
+ <div align="left">
+ <p><font size="5"> <font size="4">It is the great prerogative of Mankind above
+ other Creatures, that we are not only able to behold the works of Nature,
+ or barely to sustein our lives by them, but we have also the power of considering,
+ comparing, altering, assisting, and improving them to various uses. </font></font></p>
+ <p><font size="4">And as this is the peculiar priviledge of humane Nature
+ in general, so is it capable of being so far advanced by the helps of Art,
+ and Experience, as to make some Men excel others in their Observations,
+ and Deductions, almost as much as they do Beasts. </font></p>
+ <p><font size="4">By the addition of such artificial Instruments and methods,
+ there may be, in some manner, a reparation made for the mischiefs, and imperfection,
+ mankind has drawn upon itself, by negligence, and intemperance, and a wilful
+ and superstitious deserting the Prescripts and Rules of Nature, whereby
+ every man, both from a deriv'd corruption, innate and born with him, and
+ from his breeding and converse with men, is very subject to slip into all
+ sorts of errors. </font></p>
+ <p><font size="4">The only way which now remains for us to recover some degree
+ of those former perfections, seems to be, by rectifying the operations of
+ the Sense, the Memory, and Reason, since upon the evidence, the strength,
+ the integrity, and the right correspondence of all these, all the light,
+ by which our actions are to be guided, is to be renewed, and all our command
+ over things is to be establisht.</font></p>
+ <p><font size="4"> It is therefore most worthy of our consideration, to recollect
+ their several defects, that so we may the better understand how to supply
+ them, and by what assistances we may inlarge their power, and secure them
+ in performing their particular duties.</font></p>
+ <p><font size="4">As for the actions of our Senses, we cannot but observe
+ them to be in many particulars much outdone by those of other Creatures,
+ and when at best, to be far short of the perfection they seem capable of
+ : And these infirmities of the Senses arise from a double cause, either
+ from the disproportion of the Object to the Organ, whereby an infinite number
+ of things can never enter into them, or else from error in the Perception,
+ that many things, which come within their reach, are not received in a right
+ manner. </font></p>
+ <p><font size="4">The like frailties are to be found in the Memory; we often
+ let many things slip away from us, which deserve to be retain'd; and of
+ those which we treasure up, a great part is either frivolous or false ;
+ and if good, and substantial, either in tract of time obliterated, or at
+ best so overwhelmed and buried under more frothy notions, that when there
+ is need of them, they are in vain sought for. </font></p>
+ <p><font size="4">The two main foundations being so deceivable, it is no wonder,
+ that all the succeeding works which we build upon them, of arguing, concluding,
+ defining, judging, and all the other degrees of Reason, are lyable to the
+ same imperfection, being, at best, either vain, or uncertain: So that the
+ errors of the understanding are answerable to the two other, being defective
+ both in the quantity and goodness of its knowledge; for the limits, to which
+ our thoughts are confind, are small in respect of the vast extent of Nature
+ it self; some parts of it are too large to be comprehended, and some too
+ little to be perceived. </font></p>
+ <p><font size="4">And from thence it must follow, that not having a full sensation
+ of the Object, we must be very lame and imperfect in our conceptions about
+ it, and in all the propositions which we build upon it; hence we often take
+ the shadow of things for the substance, small appearances for good similitudes,
+ similitudes for definitions; and even many of those, which we think to be
+ the most solid definitions, are rather expressions of our own misguided
+ apprehensions then of the true nature of the things themselves. </font></p>
+ <p><font size="4">The effects of these imperfections are manifested in different
+ ways, according to the temper and disposition of the several minds of men,
+ some they incline to gross ignorance and stupidity, and others to a presumptuous
+ imposing on other mens Opinions, and a confident dogmatizing on matters,
+ whereof there is no assurance to be given. </font></p>
+ <p><font size="4">Thus all the uncertainty, and mistakes of humane actions,
+ proceed either from the narrowness and wandring of our Senses, from the
+ slipperiness or delusion of our Memory, from the confinement or rashness
+ of our Understanding, so that 'tis no wonder, that our power over natural
+ causes and effects is so slowly improvd, seeing we are not only to contend
+ with the obscurity and difficulty of the things whereon we work and think,
+ but even the forces of our own minds conspire to betray us. </font></p>
+ <p><font size="4">These being the dangers in the process of humane Reason,
+ the remedies of them all can only proceed from the real, the mechanical,
+ the experimental Philosophy, which has this advantage over the Philosophy
+ of discourse and disputation, that whereas that chiefly aims at the subtilty
+ of its Deductions and Conclusions, without much regard to the first groundwork,
+ which ought to be well laid on the Sense and Memory ; so this intends the
+ right ordering of them all, and the making them serviceable to each other.
+ </font></p>
+ <p><font size="4">The first thing to be undertaken in this weighty work, is
+ a watchfulness over the failings and an inlargement of the dominion, of
+ the Senses. To which end it is requisite, first, That there should be a
+ scrupulous choice, and a strict examination, of the reality, constancy,
+ and certainty of the Particulars that we admit: This is the first rise whereon
+ truth is to begin, and here the most severe, and most impartial diligence,
+ must be imployed ; the storing up of all, without any regard to evidence
+ or use, will only tend to darkness and confusion. </font></p>
+ <p><font size="4">We must not therefore esteem the riches of our Philosophical
+ treasure by the number only, but chiefly by the weight; the most vulgar
+ Instances are not to be neglected, but above all, the most instructive are
+ to be entertain'd: the footsteps of Nature are to be trac'd, not only in
+ her ordinary course,but when she seems to be put to her shifts, to make
+ many doublings and turnings, and to use some kind of art in indeavouring
+ to avoid our discovery. </font></p>
+ <p> </p>
+ <p><a href="king.html"><img src="editorpane/back.jpg" width="146" height="40" align="left" border="0"></a><a href="seaweed.html" name="seaweed"><img src="editorpane/forward.jpg" width="196" height="40" align="right" border="0"></a></p>
+ <p> </p>
+ <p> </p>
+ </div>
+</blockquote>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/seaweed.html Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,62 @@
+<html>
+<head>
+<title>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<img src="Octavo/seaweed.jpg" width="316" height="498">
+<h1 align="center"><br>
+ Observ. XXIII. Of the curious texture of Sea-weeds.<br>
+</h1>
+<p align="center"> </p>
+<blockquote>
+ <p><font size="4">For curiosity and beauty, I have not among all the Plants
+ or Vegetables I have yet observ'd, seen any one comparable to this Sea-weed
+ I have here describ'd, of which I am able to say very little more then what
+ is represented by the second Figure of the ninth Scheme: Namely, that it is
+ a Plant which grows upon the Rocks under the water, and increases and spreads
+ it self into a great tuft, which is not onely handsomely branch'd into several
+ leaves, but the whole surface of the Plant is cover'd over with a most curious
+ kind of carv'd work, which consists of a texture much resembling a Honeycomb;
+ for the whole surface on both sides is cover'd over with a multitude of very
+ small holes, being no bigger then so many holes made with the point of a small
+ Pinn, and rang'd in the neatest and most delicate order imaginable, they being
+ plac'd in the manner of a Quincunx, or very much like the rows of the eyes
+ of a Fly, the rows or orders being very regular, which way soever they are
+ observ'd: what the texture was, as it appear'd through a pretty bigg Magnifying
+ Microscope, I have here adjoin'd in the first Figure of the 14. Scheme. which
+ round Area A B C D represents a part of the surface about one eighth part
+ of an Inch in Diameter: Those little holes, which to the eye look'd round,
+ like so many little spots, here appear'd very regularly shap'd holes, representing
+ almost the shape of the sole of a round toed shoe, the hinder part of which,
+ is, as it were, trod on or cover'd by the toe of that next below it; these
+ holes seem'd wall'd about with a very thin and transparent substance, looking
+ of a pale straw-colour; from the edge of which, against the middle of each
+ hole, were sprouted out four small transparent straw-colour'd Thorns, which
+ seem'd to protect and cover those cavities, from either side two; neer the
+ root of this Plant, were sprouted out several small branches of a kind of
+ bastard Coralline, curiously branch'd, though small. </font></p>
+ <p><font size="4">And to confirm this, having lately the opportunity of viewing
+ the large Plant (if I may so call it) of a Sponge petrify'd, of which I made
+ mention in the last Observation, I found, that each of the Branches or Figures
+ of it, did, by the range of its pores, exhibit just such a texture, the rows
+ of pores crossing one another, much after the manner as the rows of eyes do
+ which are describ'd in the 26. Scheme : Coralline also, and several sorts of
+ white Coral, I have with a Microscope observ'd very curiously shap'd. And
+ I doubt not, but that he that shall observe these several kinds of Plants that
+ grow upon Rocks, which the Sea sometimes overflows, and those heaps of others
+ which are vomited out of it upon the shore, may find multitudes of little
+ Plants, and other bodies, which like this will afford very beautifull objects
+ for the Microscope ; and this Specimen here is adjoin'd onely to excite their
+ curiosities who have opportunity of observing to examine and collect what
+ they find worthy their notice; for the Sea, among terrestrial bodies, is also
+ a prolifick mother, and affords as many Instances of spontaneous generations
+ as either the Air or Earth.</font></p>
+ <p> </p>
+ <p><a href="preface.html"><img src="editorpane/back.jpg" width="146" height="40" align="left" border="0"></a><a href="ant.html" name="ant"><img src="editorpane/forward.jpg" width="196" height="40" align="right" border="0"></a></p>
+ <p> </p>
+ <p> </p>
+</blockquote>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/book/title.html Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,37 @@
+<html>
+<head>
+<title>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<img src="Octavo/crest.jpg" width="320" height="342">
+<h1 align="center"><font size="+1"><b><font size="+4" color="#990033"><br>
+ MICROGRAPHIA:</font><font size="+4"> </font></b></font></h1>
+<p align="center"><b>OR SOME </b></p>
+<p align="center"><font size="5">Physiological Descriptions </font></p>
+<p align="center"><b>O F</b></p>
+<p align="center"> <font size="6"><b><font color="#9F1040">MINUTE BODIES</font></b></font></p>
+<p align="center"> <b>MADE BY </b></p>
+<p align="center"><font size="5" color="#9F1040">MAGNIFYING GLASSES. </font></p>
+<p align="center"><b>WITH </b></p>
+<p align="center"><b><font color="#990033">OBSERVATIONS</font></b> and <b><font color="#9F1040">INQUIRIES</font></b>
+ thereupon.</p>
+<p align="center"> By <font color="#990033"><i><b>R. HOOKE</b></i></font><b><i>
+ ,</i></b> Fellow of the <font color="#990033">ROYAL SOCIETY</font> .</p>
+<blockquote>
+ <blockquote>
+ <blockquote>
+ <p align="center"><i>LONDON</i>, Printed by <font color="#990033"><i>Jo.
+ Martyn</i>,</font> and <font color="#990033"><i>Ja. Allestry,</i></font>
+ Printers to the <font color="#990033">ROYAL SOCIETY </font>, and are to
+ be sold at their Shop at the Bell in S. Paul's Church-yard. <font color="#990000">M
+ D C L X V.</font></p>
+ <p align="center"><font color="#990000"><br>
+ </font></p>
+ </blockquote>
+ <p><a href="index.html"><img src="editorpane/back.jpg" width="146" height="40" align="left" border="0"></a><a href="king.html" name="king"><img src="editorpane/forward.jpg" width="196" height="40" align="right" border="0"></a></p>
+ </blockquote>
+</blockquote>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/resources/EditorPaneDemo.properties Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,6 @@
+### Html Demo ###
+
+EditorPaneDemo.accessible_description=This demo shows how to display html text using the JEditorPane component.
+EditorPaneDemo.tooltip=JEditorPane HTML demo
+EditorPaneDemo.name=JEditorPane HTML Demo
+EditorPaneDemo.filename=swing.html
Binary file test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/editorpane/resources/images/EditorPaneDemo.gif has changed
--- a/test/jdk/sun/management/StackTraceElementCompositeData/CompatibilityTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sun/management/StackTraceElementCompositeData/CompatibilityTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -36,7 +36,7 @@
/*
* @test
- * @bug 8139587
+ * @bug 8139587 8212197
* @modules java.management/sun.management
* @summary Check backward compatibility of StackTraceElementCompositeData
* @author Jaroslav Bachorik
@@ -154,5 +154,16 @@
assertEquals(ste.isNativeMethod(), false);
assertEquals(ste.getLineNumber(), 123);
}
+
+ @Test
+ public void testCompositeData() throws Exception {
+ StackTraceElement ste = new StackTraceElement("app",
+ "m", "1.0",
+ "p.MyClass", "myMethod",
+ "MyClass.java", 123);
+ CompositeData cd = StackTraceElementCompositeData.toCompositeData(ste);
+ StackTraceElement ste1 = StackTraceElementCompositeData.from(cd);
+ assertEquals(ste, ste1);
+ }
}
--- a/test/jdk/sun/net/ftp/FtpURLConnectionLeak.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sun/net/ftp/FtpURLConnectionLeak.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -30,7 +30,6 @@
* @run main FtpURLConnectionLeak
*/
import java.io.FileNotFoundException;
-import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
@@ -44,27 +43,26 @@
int port = server.getLocalPort();
server.start();
URL url = new URL("ftp://localhost:" + port + "/filedoesNotExist.txt");
- for (int i = 0; i < 3; i++) {
- try {
- InputStream stream = url.openStream();
- } catch (FileNotFoundException expectedFirstTimeAround) {
- // should always reach this point since the path does not exist
- } catch (IOException expected) {
- System.out.println("caught expected " + expected);
- int times = 1;
- do {
- // give some time to close the connection...
- System.out.println("sleeping... " + times);
- Thread.sleep(times * 1000);
- } while (server.activeClientsCount() > 0 && times++ < 5);
+ try (server) {
+ for (int i = 0; i < 3; i++) {
+ try {
+ InputStream stream = url.openStream();
+ } catch (FileNotFoundException expected) {
+ // should always reach this point since the path does not exist
+ System.out.println("caught expected " + expected);
+ int times = 1;
+ do {
+ // give some time to close the connection...
+ System.out.println("sleeping... " + times);
+ Thread.sleep(times * 1000);
+ } while (server.activeClientsCount() > 0 && times++ < 5);
- if (server.activeClientsCount() > 0) {
- server.killClients();
- throw new RuntimeException("URLConnection didn't close the" +
- " FTP connection on FileNotFoundException");
+ if (server.activeClientsCount() > 0) {
+ server.killClients();
+ throw new RuntimeException("URLConnection didn't close the" +
+ " FTP connection on FileNotFoundException");
+ }
}
- } finally {
- server.terminate();
}
}
}
--- a/test/jdk/sun/net/www/ftptest/FtpCommandHandler.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sun/net/www/ftptest/FtpCommandHandler.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2018, 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
@@ -442,8 +442,14 @@
// cmd.setSoTimeout(2000);
in = new BufferedReader(new InputStreamReader(cmd.getInputStream()));
out = new PrintStream(cmd.getOutputStream(), true, "ISO8859_1");
+ // Below corrupted message style was intentional to test 8151586, please
+ // make sure each message line not broken ftp communication (such as for
+ // message line lenght >=4, the 4th char required '-' to allow
+ // implementation thinks that it has seen multi-line reply '###-'
+ // sequence), otherwise it will affect normal ftp tests which depends
+ // on this.
out.println("---------------------------------\n220 Java FTP test server"
- + " (j2se 6.0) ready.\n \n Please send commands\n"
+ + " (j2se 6.0) ready.\n \n - Please send commands\n"
+ "-----------------------------\n\n\n");
out.flush();
if (auth.authType() == 0) // No auth needed
--- a/test/jdk/sun/net/www/ftptest/FtpServer.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sun/net/www/ftptest/FtpServer.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2018, 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
@@ -47,7 +47,7 @@
*
*/
-public class FtpServer extends Thread {
+public class FtpServer extends Thread implements AutoCloseable {
private ServerSocket listener = null;
private FtpFileSystemHandler fsh = null;
private FtpAuthHandler auth = null;
@@ -134,4 +134,13 @@
}
}
+
+ @Override
+ public void close() throws Exception {
+ terminate();
+ listener.close();
+ if (activeClientsCount() > 0) {
+ killClients();
+ }
+ }
}
--- a/test/jdk/sun/net/www/protocol/http/RedirectOnPost.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/sun/net/www/protocol/http/RedirectOnPost.java Wed Oct 17 08:09:46 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -23,9 +23,9 @@
/**
* @test
- * @library /lib/testlibrary/
+ * @library /test/lib
* @modules jdk.httpserver
- * @build jdk.testlibrary.SimpleSSLContext
+ * @build jdk.test.lib.net.SimpleSSLContext
* @compile RedirectOnPost.java
* @run main/othervm RedirectOnPost
* @bug 8029127
@@ -38,7 +38,7 @@
import com.sun.net.httpserver.*;
import java.util.concurrent.*;
import javax.net.ssl.*;
-import jdk.testlibrary.SimpleSSLContext;
+import jdk.test.lib.net.SimpleSSLContext;
public class RedirectOnPost {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sun/security/lib/CheckBlacklistedCerts.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8011402 8211969
+ * @summary Move blacklisting certificate logic from hard code to data
+ * @modules java.base/sun.security.util
+ */
+
+import sun.security.util.UntrustedCertificates;
+
+import java.io.*;
+import java.security.KeyStore;
+import java.security.cert.*;
+import java.util.*;
+
+public class CheckBlacklistedCerts {
+ public static void main(String[] args) throws Exception {
+
+ String home = System.getProperty("java.home");
+ boolean failed = false;
+
+ // Root CAs should always be trusted
+ File file = new File(home, "lib/security/cacerts");
+ KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
+ try (FileInputStream fis = new FileInputStream(file)) {
+ ks.load(fis, null);
+ }
+ System.out.println("Check for cacerts: " + ks.size());
+ for (String alias: Collections.list(ks.aliases())) {
+ X509Certificate cert = (X509Certificate)ks.getCertificate(alias);
+ if (UntrustedCertificates.isUntrusted(cert)) {
+ System.out.print(alias + " is untrusted");
+ failed = true;
+ }
+ }
+
+ // All certs in the pem files
+ Set<Certificate> blacklisted = new HashSet<>();
+
+ // Assumes the full src is available
+ File blacklist = new File(System.getProperty("test.src"),
+ "../../../../../make/data/blacklistedcertsconverter/blacklisted.certs.pem");
+
+ CertificateFactory cf = CertificateFactory.getInstance("X.509");
+ try (FileInputStream fis = new FileInputStream(blacklist)) {
+ Collection<? extends Certificate> certs
+ = cf.generateCertificates(fis);
+ System.out.println(certs.size());
+ for (Certificate c: certs) {
+ blacklisted.add(c);
+ X509Certificate cert = ((X509Certificate)c);
+ if (!UntrustedCertificates.isUntrusted(cert)) {
+ System.out.println(cert.getSubjectDN() + " is trusted");
+ failed = true;
+ }
+ }
+ }
+
+ // Check the blacklisted.certs file itself
+ file = new File(home, "lib/security/blacklisted.certs");
+ System.out.print("Check for " + file + ": ");
+ try (BufferedReader reader = new BufferedReader(
+ new InputStreamReader(new FileInputStream(file)))) {
+ int acount = 0;
+ int ccount = 0;
+ while (true) {
+ String line = reader.readLine();
+ if (line == null) break;
+ if (line.startsWith("Algorithm")) {
+ acount++;
+ } else if (!line.isEmpty() && !line.startsWith("#")) {
+ ccount++;
+ }
+ }
+ System.out.println(acount + " algs, " + ccount + " certs" );
+ if (acount != 1) {
+ System.out.println("There are " + acount + " algorithms");
+ failed = true;
+ }
+ if (ccount != blacklisted.size()
+ && !blacklisted.isEmpty()) {
+ System.out.println("Wrong blacklisted.certs size: "
+ + ccount + " fingerprints, "
+ + blacklisted.size() + " certs");
+ failed = true;
+ }
+ }
+
+ if (failed) {
+ throw new Exception("Failed");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,353 @@
+/*
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8189131 8198240 8191844 8189949 8191031 8196141 8204923 8195774 8199779 8209452
+ * 8209506 8210432
+ * @summary Check root CA entries in cacerts file
+ */
+import java.io.File;
+import java.io.FileInputStream;
+import java.security.KeyStore;
+import java.security.MessageDigest;
+import java.security.cert.*;
+import java.util.*;
+
+public class VerifyCACerts {
+
+ private static final String CACERTS
+ = System.getProperty("java.home") + File.separator + "lib"
+ + File.separator + "security" + File.separator + "cacerts";
+
+ // The numbers of certs now.
+ private static final int COUNT = 93;
+
+ // map of cert alias to SHA-256 fingerprint
+ private static final Map<String, String> FINGERPRINT_MAP
+ = new HashMap<String, String>() {
+ {
+ put("actalisauthenticationrootca [jdk]",
+ "55:92:60:84:EC:96:3A:64:B9:6E:2A:BE:01:CE:0B:A8:6A:64:FB:FE:BC:C7:AA:B5:AF:C1:55:B3:7F:D7:60:66");
+ put("buypassclass2ca [jdk]",
+ "9A:11:40:25:19:7C:5B:B9:5D:94:E6:3D:55:CD:43:79:08:47:B6:46:B2:3C:DF:11:AD:A4:A0:0E:FF:15:FB:48");
+ put("buypassclass3ca [jdk]",
+ "ED:F7:EB:BC:A2:7A:2A:38:4D:38:7B:7D:40:10:C6:66:E2:ED:B4:84:3E:4C:29:B4:AE:1D:5B:93:32:E6:B2:4D");
+ put("camerfirmachambersca [jdk]",
+ "06:3E:4A:FA:C4:91:DF:D3:32:F3:08:9B:85:42:E9:46:17:D8:93:D7:FE:94:4E:10:A7:93:7E:E2:9D:96:93:C0");
+ put("camerfirmachambersignca [jdk]",
+ "13:63:35:43:93:34:A7:69:80:16:A0:D3:24:DE:72:28:4E:07:9D:7B:52:20:BB:8F:BD:74:78:16:EE:BE:BA:CA");
+ put("camerfirmachamberscommerceca [jdk]",
+ "0C:25:8A:12:A5:67:4A:EF:25:F2:8B:A7:DC:FA:EC:EE:A3:48:E5:41:E6:F5:CC:4E:E6:3B:71:B3:61:60:6A:C3");
+ put("certumca [jdk]",
+ "D8:E0:FE:BC:1D:B2:E3:8D:00:94:0F:37:D2:7D:41:34:4D:99:3E:73:4B:99:D5:65:6D:97:78:D4:D8:14:36:24");
+ put("certumtrustednetworkca [jdk]",
+ "5C:58:46:8D:55:F5:8E:49:7E:74:39:82:D2:B5:00:10:B6:D1:65:37:4A:CF:83:A7:D4:A3:2D:B7:68:C4:40:8E");
+ put("chunghwaepkirootca [jdk]",
+ "C0:A6:F4:DC:63:A2:4B:FD:CF:54:EF:2A:6A:08:2A:0A:72:DE:35:80:3E:2F:F5:FF:52:7A:E5:D8:72:06:DF:D5");
+ put("comodorsaca [jdk]",
+ "52:F0:E1:C4:E5:8E:C6:29:29:1B:60:31:7F:07:46:71:B8:5D:7E:A8:0D:5B:07:27:34:63:53:4B:32:B4:02:34");
+ put("comodoaaaca [jdk]",
+ "D7:A7:A0:FB:5D:7E:27:31:D7:71:E9:48:4E:BC:DE:F7:1D:5F:0C:3E:0A:29:48:78:2B:C8:3E:E0:EA:69:9E:F4");
+ put("comodoeccca [jdk]",
+ "17:93:92:7A:06:14:54:97:89:AD:CE:2F:8F:34:F7:F0:B6:6D:0F:3A:E3:A3:B8:4D:21:EC:15:DB:BA:4F:AD:C7");
+ put("usertrustrsaca [jdk]",
+ "E7:93:C9:B0:2F:D8:AA:13:E2:1C:31:22:8A:CC:B0:81:19:64:3B:74:9C:89:89:64:B1:74:6D:46:C3:D4:CB:D2");
+ put("usertrusteccca [jdk]",
+ "4F:F4:60:D5:4B:9C:86:DA:BF:BC:FC:57:12:E0:40:0D:2B:ED:3F:BC:4D:4F:BD:AA:86:E0:6A:DC:D2:A9:AD:7A");
+ put("utnuserfirstobjectca [jdk]",
+ "6F:FF:78:E4:00:A7:0C:11:01:1C:D8:59:77:C4:59:FB:5A:F9:6A:3D:F0:54:08:20:D0:F4:B8:60:78:75:E5:8F");
+ put("utnuserfirstclientauthemailca [jdk]",
+ "43:F2:57:41:2D:44:0D:62:74:76:97:4F:87:7D:A8:F1:FC:24:44:56:5A:36:7A:E6:0E:DD:C2:7A:41:25:31:AE");
+ put("utnuserfirsthardwareca [jdk]",
+ "6E:A5:47:41:D0:04:66:7E:ED:1B:48:16:63:4A:A3:A7:9E:6E:4B:96:95:0F:82:79:DA:FC:8D:9B:D8:81:21:37");
+ put("addtrustclass1ca [jdk]",
+ "8C:72:09:27:9A:C0:4E:27:5E:16:D0:7F:D3:B7:75:E8:01:54:B5:96:80:46:E3:1F:52:DD:25:76:63:24:E9:A7");
+ put("addtrustexternalca [jdk]",
+ "68:7F:A4:51:38:22:78:FF:F0:C8:B1:1F:8D:43:D5:76:67:1C:6E:B2:BC:EA:B4:13:FB:83:D9:65:D0:6D:2F:F2");
+ put("addtrustqualifiedca [jdk]",
+ "80:95:21:08:05:DB:4B:BC:35:5E:44:28:D8:FD:6E:C2:CD:E3:AB:5F:B9:7A:99:42:98:8E:B8:F4:DC:D0:60:16");
+ put("baltimorecybertrustca [jdk]",
+ "16:AF:57:A9:F6:76:B0:AB:12:60:95:AA:5E:BA:DE:F2:2A:B3:11:19:D6:44:AC:95:CD:4B:93:DB:F3:F2:6A:EB");
+ put("digicertglobalrootca [jdk]",
+ "43:48:A0:E9:44:4C:78:CB:26:5E:05:8D:5E:89:44:B4:D8:4F:96:62:BD:26:DB:25:7F:89:34:A4:43:C7:01:61");
+ put("digicertglobalrootg2 [jdk]",
+ "CB:3C:CB:B7:60:31:E5:E0:13:8F:8D:D3:9A:23:F9:DE:47:FF:C3:5E:43:C1:14:4C:EA:27:D4:6A:5A:B1:CB:5F");
+ put("digicertglobalrootg3 [jdk]",
+ "31:AD:66:48:F8:10:41:38:C7:38:F3:9E:A4:32:01:33:39:3E:3A:18:CC:02:29:6E:F9:7C:2A:C9:EF:67:31:D0");
+ put("digicerttrustedrootg4 [jdk]",
+ "55:2F:7B:DC:F1:A7:AF:9E:6C:E6:72:01:7F:4F:12:AB:F7:72:40:C7:8E:76:1A:C2:03:D1:D9:D2:0A:C8:99:88");
+ put("digicertassuredidrootca [jdk]",
+ "3E:90:99:B5:01:5E:8F:48:6C:00:BC:EA:9D:11:1E:E7:21:FA:BA:35:5A:89:BC:F1:DF:69:56:1E:3D:C6:32:5C");
+ put("digicertassuredidg2 [jdk]",
+ "7D:05:EB:B6:82:33:9F:8C:94:51:EE:09:4E:EB:FE:FA:79:53:A1:14:ED:B2:F4:49:49:45:2F:AB:7D:2F:C1:85");
+ put("digicertassuredidg3 [jdk]",
+ "7E:37:CB:8B:4C:47:09:0C:AB:36:55:1B:A6:F4:5D:B8:40:68:0F:BA:16:6A:95:2D:B1:00:71:7F:43:05:3F:C2");
+ put("digicerthighassuranceevrootca [jdk]",
+ "74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF");
+ put("geotrustglobalca [jdk]",
+ "FF:85:6A:2D:25:1D:CD:88:D3:66:56:F4:50:12:67:98:CF:AB:AA:DE:40:79:9C:72:2D:E4:D2:B5:DB:36:A7:3A");
+ put("geotrustprimaryca [jdk]",
+ "37:D5:10:06:C5:12:EA:AB:62:64:21:F1:EC:8C:92:01:3F:C5:F8:2A:E9:8E:E5:33:EB:46:19:B8:DE:B4:D0:6C");
+ put("geotrustprimarycag2 [jdk]",
+ "5E:DB:7A:C4:3B:82:A0:6A:87:61:E8:D7:BE:49:79:EB:F2:61:1F:7D:D7:9B:F9:1C:1C:6B:56:6A:21:9E:D7:66");
+ put("geotrustprimarycag3 [jdk]",
+ "B4:78:B8:12:25:0D:F8:78:63:5C:2A:A7:EC:7D:15:5E:AA:62:5E:E8:29:16:E2:CD:29:43:61:88:6C:D1:FB:D4");
+ put("geotrustuniversalca [jdk]",
+ "A0:45:9B:9F:63:B2:25:59:F5:FA:5D:4C:6D:B3:F9:F7:2F:F1:93:42:03:35:78:F0:73:BF:1D:1B:46:CB:B9:12");
+ put("gtecybertrustglobalca [jdk]",
+ "A5:31:25:18:8D:21:10:AA:96:4B:02:C7:B7:C6:DA:32:03:17:08:94:E5:FB:71:FF:FB:66:67:D5:E6:81:0A:36");
+ put("thawteprimaryrootca [jdk]",
+ "8D:72:2F:81:A9:C1:13:C0:79:1D:F1:36:A2:96:6D:B2:6C:95:0A:97:1D:B4:6B:41:99:F4:EA:54:B7:8B:FB:9F");
+ put("thawteprimaryrootcag2 [jdk]",
+ "A4:31:0D:50:AF:18:A6:44:71:90:37:2A:86:AF:AF:8B:95:1F:FB:43:1D:83:7F:1E:56:88:B4:59:71:ED:15:57");
+ put("thawteprimaryrootcag3 [jdk]",
+ "4B:03:F4:58:07:AD:70:F2:1B:FC:2C:AE:71:C9:FD:E4:60:4C:06:4C:F5:FF:B6:86:BA:E5:DB:AA:D7:FD:D3:4C");
+ put("thawtepremiumserverca [jdk]",
+ "3F:9F:27:D5:83:20:4B:9E:09:C8:A3:D2:06:6C:4B:57:D3:A2:47:9C:36:93:65:08:80:50:56:98:10:5D:BC:E9");
+ put("verisigntsaca [jdk]",
+ "CB:6B:05:D9:E8:E5:7C:D8:82:B1:0B:4D:B7:0D:E4:BB:1D:E4:2B:A4:8A:7B:D0:31:8B:63:5B:F6:E7:78:1A:9D");
+ put("verisignclass2g2ca [jdk]",
+ "3A:43:E2:20:FE:7F:3E:A9:65:3D:1E:21:74:2E:AC:2B:75:C2:0F:D8:98:03:05:BC:50:2C:AF:8C:2D:9B:41:A1");
+ put("verisignclass3ca [jdk]",
+ "A4:B6:B3:99:6F:C2:F3:06:B3:FD:86:81:BD:63:41:3D:8C:50:09:CC:4F:A3:29:C2:CC:F0:E2:FA:1B:14:03:05");
+ put("verisignclass3g2ca [jdk]",
+ "83:CE:3C:12:29:68:8A:59:3D:48:5F:81:97:3C:0F:91:95:43:1E:DA:37:CC:5E:36:43:0E:79:C7:A8:88:63:8B");
+ put("verisignuniversalrootca [jdk]",
+ "23:99:56:11:27:A5:71:25:DE:8C:EF:EA:61:0D:DF:2F:A0:78:B5:C8:06:7F:4E:82:82:90:BF:B8:60:E8:4B:3C");
+ put("verisignclass3g3ca [jdk]",
+ "EB:04:CF:5E:B1:F3:9A:FA:76:2F:2B:B1:20:F2:96:CB:A5:20:C1:B9:7D:B1:58:95:65:B8:1C:B9:A1:7B:72:44");
+ put("verisignclass3g4ca [jdk]",
+ "69:DD:D7:EA:90:BB:57:C9:3E:13:5D:C8:5E:A6:FC:D5:48:0B:60:32:39:BD:C4:54:FC:75:8B:2A:26:CF:7F:79");
+ put("verisignclass3g5ca [jdk]",
+ "9A:CF:AB:7E:43:C8:D8:80:D0:6B:26:2A:94:DE:EE:E4:B4:65:99:89:C3:D0:CA:F1:9B:AF:64:05:E4:1A:B7:DF");
+ put("certplusclass2primaryca [jdk]",
+ "0F:99:3C:8A:EF:97:BA:AF:56:87:14:0E:D5:9A:D1:82:1B:B4:AF:AC:F0:AA:9A:58:B5:D5:7A:33:8A:3A:FB:CB");
+ put("certplusclass3pprimaryca [jdk]",
+ "CC:C8:94:89:37:1B:AD:11:1C:90:61:9B:EA:24:0A:2E:6D:AD:D9:9F:9F:6E:1D:4D:41:E5:8E:D6:DE:3D:02:85");
+ put("keynectisrootca [jdk]",
+ "42:10:F1:99:49:9A:9A:C3:3C:8D:E0:2B:A6:DB:AA:14:40:8B:DD:8A:6E:32:46:89:C1:92:2D:06:97:15:A3:32");
+ put("dtrustclass3ca2 [jdk]",
+ "49:E7:A4:42:AC:F0:EA:62:87:05:00:54:B5:25:64:B6:50:E4:F4:9E:42:E3:48:D6:AA:38:E0:39:E9:57:B1:C1");
+ put("dtrustclass3ca2ev [jdk]",
+ "EE:C5:49:6B:98:8C:E9:86:25:B9:34:09:2E:EC:29:08:BE:D0:B0:F3:16:C2:D4:73:0C:84:EA:F1:F3:D3:48:81");
+ put("identrustdstx3 [jdk]",
+ "06:87:26:03:31:A7:24:03:D9:09:F1:05:E6:9B:CF:0D:32:E1:BD:24:93:FF:C6:D9:20:6D:11:BC:D6:77:07:39");
+ put("identrustpublicca [jdk]",
+ "30:D0:89:5A:9A:44:8A:26:20:91:63:55:22:D1:F5:20:10:B5:86:7A:CA:E1:2C:78:EF:95:8F:D4:F4:38:9F:2F");
+ put("identrustcommercial [jdk]",
+ "5D:56:49:9B:E4:D2:E0:8B:CF:CA:D0:8A:3E:38:72:3D:50:50:3B:DE:70:69:48:E4:2F:55:60:30:19:E5:28:AE");
+ put("letsencryptisrgx1 [jdk]",
+ "96:BC:EC:06:26:49:76:F3:74:60:77:9A:CF:28:C5:A7:CF:E8:A3:C0:AA:E1:1A:8F:FC:EE:05:C0:BD:DF:08:C6");
+ put("luxtrustglobalrootca [jdk]",
+ "A1:B2:DB:EB:64:E7:06:C6:16:9E:3C:41:18:B2:3B:AA:09:01:8A:84:27:66:6D:8B:F0:E2:88:91:EC:05:19:50");
+ put("quovadisrootca [jdk]",
+ "A4:5E:DE:3B:BB:F0:9C:8A:E1:5C:72:EF:C0:72:68:D6:93:A2:1C:99:6F:D5:1E:67:CA:07:94:60:FD:6D:88:73");
+ put("quovadisrootca1g3 [jdk]",
+ "8A:86:6F:D1:B2:76:B5:7E:57:8E:92:1C:65:82:8A:2B:ED:58:E9:F2:F2:88:05:41:34:B7:F1:F4:BF:C9:CC:74");
+ put("quovadisrootca2 [jdk]",
+ "85:A0:DD:7D:D7:20:AD:B7:FF:05:F8:3D:54:2B:20:9D:C7:FF:45:28:F7:D6:77:B1:83:89:FE:A5:E5:C4:9E:86");
+ put("quovadisrootca2g3 [jdk]",
+ "8F:E4:FB:0A:F9:3A:4D:0D:67:DB:0B:EB:B2:3E:37:C7:1B:F3:25:DC:BC:DD:24:0E:A0:4D:AF:58:B4:7E:18:40");
+ put("quovadisrootca3 [jdk]",
+ "18:F1:FC:7F:20:5D:F8:AD:DD:EB:7F:E0:07:DD:57:E3:AF:37:5A:9C:4D:8D:73:54:6B:F4:F1:FE:D1:E1:8D:35");
+ put("quovadisrootca3g3 [jdk]",
+ "88:EF:81:DE:20:2E:B0:18:45:2E:43:F8:64:72:5C:EA:5F:BD:1F:C2:D9:D2:05:73:07:09:C5:D8:B8:69:0F:46");
+ put("secomscrootca1 [jdk]",
+ "E7:5E:72:ED:9F:56:0E:EC:6E:B4:80:00:73:A4:3F:C3:AD:19:19:5A:39:22:82:01:78:95:97:4A:99:02:6B:6C");
+ put("secomscrootca2 [jdk]",
+ "51:3B:2C:EC:B8:10:D4:CD:E5:DD:85:39:1A:DF:C6:C2:DD:60:D8:7B:B7:36:D2:B5:21:48:4A:A4:7A:0E:BE:F6");
+ put("swisssigngoldg2ca [jdk]",
+ "62:DD:0B:E9:B9:F5:0A:16:3E:A0:F8:E7:5C:05:3B:1E:CA:57:EA:55:C8:68:8F:64:7C:68:81:F2:C8:35:7B:95");
+ put("swisssignplatinumg2ca [jdk]",
+ "3B:22:2E:56:67:11:E9:92:30:0D:C0:B1:5A:B9:47:3D:AF:DE:F8:C8:4D:0C:EF:7D:33:17:B4:C1:82:1D:14:36");
+ put("swisssignsilverg2ca [jdk]",
+ "BE:6C:4D:A2:BB:B9:BA:59:B6:F3:93:97:68:37:42:46:C3:C0:05:99:3F:A9:8F:02:0D:1D:ED:BE:D4:8A:81:D5");
+ put("soneraclass2ca [jdk]",
+ "79:08:B4:03:14:C1:38:10:0B:51:8D:07:35:80:7F:FB:FC:F8:51:8A:00:95:33:71:05:BA:38:6B:15:3D:D9:27");
+ put("securetrustca [jdk]",
+ "F1:C1:B5:0A:E5:A2:0D:D8:03:0E:C9:F6:BC:24:82:3D:D3:67:B5:25:57:59:B4:E7:1B:61:FC:E9:F7:37:5D:73");
+ put("xrampglobalca [jdk]",
+ "CE:CD:DC:90:50:99:D8:DA:DF:C5:B1:D2:09:B7:37:CB:E2:C1:8C:FB:2C:10:C0:FF:0B:CF:0D:32:86:FC:1A:A2");
+ put("godaddyrootg2ca [jdk]",
+ "45:14:0B:32:47:EB:9C:C8:C5:B4:F0:D7:B5:30:91:F7:32:92:08:9E:6E:5A:63:E2:74:9D:D3:AC:A9:19:8E:DA");
+ put("godaddyclass2ca [jdk]",
+ "C3:84:6B:F2:4B:9E:93:CA:64:27:4C:0E:C6:7C:1E:CC:5E:02:4F:FC:AC:D2:D7:40:19:35:0E:81:FE:54:6A:E4");
+ put("starfieldclass2ca [jdk]",
+ "14:65:FA:20:53:97:B8:76:FA:A6:F0:A9:95:8E:55:90:E4:0F:CC:7F:AA:4F:B7:C2:C8:67:75:21:FB:5F:B6:58");
+ put("starfieldrootg2ca [jdk]",
+ "2C:E1:CB:0B:F9:D2:F9:E1:02:99:3F:BE:21:51:52:C3:B2:DD:0C:AB:DE:1C:68:E5:31:9B:83:91:54:DB:B7:F5");
+ put("entrustrootcaec1 [jdk]",
+ "02:ED:0E:B2:8C:14:DA:45:16:5C:56:67:91:70:0D:64:51:D7:FB:56:F0:B2:AB:1D:3B:8E:B0:70:E5:6E:DF:F5");
+ put("entrust2048ca [jdk]",
+ "6D:C4:71:72:E0:1C:BC:B0:BF:62:58:0D:89:5F:E2:B8:AC:9A:D4:F8:73:80:1E:0C:10:B9:C8:37:D2:1E:B1:77");
+ put("entrustrootcag2 [jdk]",
+ "43:DF:57:74:B0:3E:7F:EF:5F:E4:0D:93:1A:7B:ED:F1:BB:2E:6B:42:73:8C:4E:6D:38:41:10:3D:3A:A7:F3:39");
+ put("entrustevca [jdk]",
+ "73:C1:76:43:4F:1B:C6:D5:AD:F4:5B:0E:76:E7:27:28:7C:8D:E5:76:16:C1:E6:E6:14:1A:2B:2C:BC:7D:8E:4C");
+ put("affirmtrustnetworkingca [jdk]",
+ "0A:81:EC:5A:92:97:77:F1:45:90:4A:F3:8D:5D:50:9F:66:B5:E2:C5:8F:CD:B5:31:05:8B:0E:17:F3:F0:B4:1B");
+ put("affirmtrustpremiumca [jdk]",
+ "70:A7:3F:7F:37:6B:60:07:42:48:90:45:34:B1:14:82:D5:BF:0E:69:8E:CC:49:8D:F5:25:77:EB:F2:E9:3B:9A");
+ put("affirmtrustcommercialca [jdk]",
+ "03:76:AB:1D:54:C5:F9:80:3C:E4:B2:E2:01:A0:EE:7E:EF:7B:57:B6:36:E8:A9:3C:9B:8D:48:60:C9:6F:5F:A7");
+ put("affirmtrustpremiumeccca [jdk]",
+ "BD:71:FD:F6:DA:97:E4:CF:62:D1:64:7A:DD:25:81:B0:7D:79:AD:F8:39:7E:B4:EC:BA:9C:5E:84:88:82:14:23");
+ put("deutschetelekomrootca2 [jdk]",
+ "B6:19:1A:50:D0:C3:97:7F:7D:A9:9B:CD:AA:C8:6A:22:7D:AE:B9:67:9E:C7:0B:A3:B0:C9:D9:22:71:C1:70:D3");
+ put("ttelesecglobalrootclass3ca [jdk]",
+ "FD:73:DA:D3:1C:64:4F:F1:B4:3B:EF:0C:CD:DA:96:71:0B:9C:D9:87:5E:CA:7E:31:70:7A:F3:E9:6D:52:2B:BD");
+ put("ttelesecglobalrootclass2ca [jdk]",
+ "91:E2:F5:78:8D:58:10:EB:A7:BA:58:73:7D:E1:54:8A:8E:CA:CD:01:45:98:BC:0B:14:3E:04:1B:17:05:25:52");
+ put("starfieldservicesrootg2ca [jdk]",
+ "56:8D:69:05:A2:C8:87:08:A4:B3:02:51:90:ED:CF:ED:B1:97:4A:60:6A:13:C6:E5:29:0F:CB:2A:E6:3E:DA:B5");
+ put("globalsignca [jdk]",
+ "EB:D4:10:40:E4:BB:3E:C7:42:C9:E3:81:D3:1E:F2:A4:1A:48:B6:68:5C:96:E7:CE:F3:C1:DF:6C:D4:33:1C:99");
+ put("globalsignr3ca [jdk]",
+ "CB:B5:22:D7:B7:F1:27:AD:6A:01:13:86:5B:DF:1C:D4:10:2E:7D:07:59:AF:63:5A:7C:F4:72:0D:C9:63:C5:3B");
+ put("globalsigneccrootcar5 [jdk]",
+ "17:9F:BC:14:8A:3D:D0:0F:D2:4E:A1:34:58:CC:43:BF:A7:F5:9C:81:82:D7:83:A5:13:F6:EB:EC:10:0C:89:24");
+ put("globalsigneccrootcar4 [jdk]",
+ "BE:C9:49:11:C2:95:56:76:DB:6C:0A:55:09:86:D7:6E:3B:A0:05:66:7C:44:2C:97:62:B4:FB:B7:73:DE:22:8C");
+ put("globalsignr2ca [jdk]",
+ "CA:42:DD:41:74:5F:D0:B8:1E:B9:02:36:2C:F9:D8:BF:71:9D:A1:BD:1B:1E:FC:94:6F:5B:4C:99:F4:2C:1B:9E");
+ put("teliasonerarootcav1 [jdk]",
+ "DD:69:36:FE:21:F8:F0:77:C1:23:A1:A5:21:C1:22:24:F7:22:55:B7:3E:03:A7:26:06:93:E8:A2:4B:0F:A3:89");
+ }
+ };
+
+ // Exception list to 90 days expiry policy
+ // No error will be reported if certificate in this list expires
+ private static final HashSet<String> EXPIRY_EXC_ENTRIES
+ = new HashSet<String>(Arrays.asList(
+ "gtecybertrustglobalca [jdk]"
+ ));
+
+ // Ninety days in milliseconds
+ private static final long NINETY_DAYS = 7776000000L;
+
+ private static boolean atLeastOneFailed = false;
+
+ private static MessageDigest md;
+
+ public static void main(String[] args) throws Exception {
+ System.out.println("cacerts file: " + CACERTS);
+ md = MessageDigest.getInstance("SHA-256");
+ KeyStore ks = KeyStore.getInstance("JKS");
+ ks.load(new FileInputStream(CACERTS), "changeit".toCharArray());
+
+ // check the count of certs inside
+ if (ks.size() != COUNT) {
+ atLeastOneFailed = true;
+ System.err.println("ERROR: " + ks.size() + " entries, should be "
+ + COUNT);
+ }
+
+ // check that all entries in the map are in the keystore
+ for (String alias : FINGERPRINT_MAP.keySet()) {
+ if (!ks.isCertificateEntry(alias)) {
+ atLeastOneFailed = true;
+ System.err.println("ERROR: " + alias + " is not in cacerts");
+ }
+ }
+
+ // pull all the trusted self-signed CA certs out of the cacerts file
+ // and verify their signatures
+ Enumeration<String> aliases = ks.aliases();
+ while (aliases.hasMoreElements()) {
+ String alias = aliases.nextElement();
+ System.out.println("\nVerifying " + alias);
+ if (!ks.isCertificateEntry(alias)) {
+ atLeastOneFailed = true;
+ System.err.println("ERROR: " + alias
+ + " is not a trusted cert entry");
+ }
+ X509Certificate cert = (X509Certificate) ks.getCertificate(alias);
+ if (!checkFingerprint(alias, cert)) {
+ atLeastOneFailed = true;
+ System.err.println("ERROR: " + alias + " SHA-256 fingerprint is incorrect");
+ }
+ // Make sure cert can be self-verified
+ try {
+ cert.verify(cert.getPublicKey());
+ } catch (Exception e) {
+ atLeastOneFailed = true;
+ System.err.println("ERROR: cert cannot be verified:"
+ + e.getMessage());
+ }
+
+ // Make sure cert is not expired or not yet valid
+ try {
+ cert.checkValidity();
+ } catch (CertificateExpiredException cee) {
+ if (!EXPIRY_EXC_ENTRIES.contains(alias)) {
+ atLeastOneFailed = true;
+ System.err.println("ERROR: cert is expired");
+ }
+ } catch (CertificateNotYetValidException cne) {
+ atLeastOneFailed = true;
+ System.err.println("ERROR: cert is not yet valid");
+ }
+
+ // If cert is within 90 days of expiring, mark as failure so
+ // that cert can be scheduled to be removed/renewed.
+ Date notAfter = cert.getNotAfter();
+ if (notAfter.getTime() - System.currentTimeMillis() < NINETY_DAYS) {
+ if (!EXPIRY_EXC_ENTRIES.contains(alias)) {
+ atLeastOneFailed = true;
+ System.err.println("ERROR: cert \"" + alias + "\" expiry \""
+ + notAfter.toString() + "\" will expire within 90 days");
+ }
+ }
+ }
+
+ if (atLeastOneFailed) {
+ throw new Exception("At least one cacert test failed");
+ }
+ }
+
+ private static boolean checkFingerprint(String alias, Certificate cert)
+ throws Exception {
+ String fingerprint = FINGERPRINT_MAP.get(alias);
+ if (fingerprint == null) {
+ // no entry for alias
+ return true;
+ }
+ System.out.println("Checking fingerprint of " + alias);
+ byte[] digest = md.digest(cert.getEncoded());
+ return fingerprint.equals(toHexString(digest));
+ }
+
+ private static String toHexString(byte[] block) {
+ StringBuilder buf = new StringBuilder();
+ int len = block.length;
+ for (int i = 0; i < len; i++) {
+ buf.append(String.format("%02X", block[i]));
+ if (i < len - 1) {
+ buf.append(":");
+ }
+ }
+ return buf.toString();
+ }
+}
--- a/test/jdk/tools/jimage/JImageExtractTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/tools/jimage/JImageExtractTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -27,7 +27,7 @@
* @library /test/lib
* @modules jdk.jlink/jdk.tools.jimage
* @build jdk.test.lib.Asserts
- * @run main/othervm JImageExtractTest
+ * @run main/othervm/timeout=300 JImageExtractTest
*/
import java.io.IOException;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/ModuleTargetHelper.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.lang.module.ModuleReader;
+import java.lang.module.ModuleReference;
+import java.net.URI;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import jdk.internal.module.ModuleInfo;
+import jdk.internal.module.ModuleInfo.Attributes;
+
+public class ModuleTargetHelper {
+ private ModuleTargetHelper() {}
+
+ public static final class ModuleTarget {
+ private String targetPlatform;
+
+ public ModuleTarget(String targetPlatform) {
+ this.targetPlatform = targetPlatform;
+ }
+
+ public String targetPlatform() {
+ return targetPlatform;
+ }
+ }
+
+ public static ModuleTarget getJavaBaseTarget() throws IOException {
+ Path p = Paths.get(URI.create("jrt:/modules/java.base/module-info.class"));
+ try (InputStream in = Files.newInputStream(p)) {
+ return read(in);
+ }
+ }
+
+ public static ModuleTarget read(InputStream in) throws IOException {
+ ModuleInfo.Attributes attrs = ModuleInfo.read(in, null);
+ if (attrs.target() != null) {
+ return new ModuleTarget(attrs.target().targetPlatform());
+ } else {
+ return null;
+ }
+ }
+
+ public static ModuleTarget read(ModuleReference modRef) throws IOException {
+ ModuleReader reader = modRef.open();
+ try (InputStream in = reader.open("module-info.class").get()) {
+ return read(in);
+ } finally {
+ reader.close();
+ }
+ }
+}
--- a/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/SystemModulesTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/SystemModulesTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -42,7 +42,6 @@
/**
* @test
* @bug 8142968 8173381
- * @library /lib/testlibrary
* @modules java.base/jdk.internal.misc
* @modules java.base/jdk.internal.module
* @modules java.base/jdk.internal.org.objectweb.asm
--- a/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -44,7 +44,7 @@
/**
* @test
* @bug 8142968 8173381 8174740
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
* @modules jdk.compiler jdk.jlink
* @modules java.base/jdk.internal.module
* @modules java.base/jdk.internal.org.objectweb.asm
--- a/test/jdk/tools/jmod/hashes/HashesTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/tools/jmod/hashes/HashesTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -237,6 +237,28 @@
.forEach(mn -> assertTrue(ht.hashes(mn) == null));
}
+ @Test
+ public static void upgradeableModule() throws IOException {
+ Path mpath = Paths.get(System.getProperty("java.home"), "jmods");
+ if (!Files.exists(mpath)) {
+ return;
+ }
+
+ Path dest = Paths.get("test4");
+ HashesTest ht = new HashesTest(dest);
+ ht.makeModule("m1");
+ ht.makeModule("java.compiler", "m1");
+ ht.makeModule("m2", "java.compiler");
+
+ ht.makeJmod("m1");
+ ht.makeJmod("m2");
+ ht.makeJmod("java.compiler",
+ "--module-path",
+ ht.lib.toString() + File.pathSeparator + mpath,
+ "--hash-modules", "java\\.(?!se)|^m.*");
+
+ ht.checkHashes("java.compiler", "m2");
+ }
@Test
public static void testImageJmods() throws IOException {
--- a/test/jdk/tools/launcher/modules/addexports/AddExportsTest.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/jdk/tools/launcher/modules/addexports/AddExportsTest.java Wed Oct 17 08:09:46 2018 -0700
@@ -24,7 +24,8 @@
/**
* @test
* @library /test/lib
- * @modules jdk.compiler
+ * @modules java.compiler
+ * jdk.compiler
* @build AddExportsTest jdk.test.lib.compiler.CompilerUtils
* @run testng AddExportsTest
* @summary Basic tests for java --add-exports
@@ -51,12 +52,15 @@
private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
private static final Path MODS_DIR = Paths.get("mods");
+ private static final Path UPGRADE_MODS_DIRS = Paths.get("upgrademods");
// test module m1 that uses Unsafe
private static final String TEST1_MODULE = "m1";
private static final String TEST1_MAIN_CLASS = "jdk.test1.Main";
-
+ // test module m2 uses java.compiler internals
+ private static final String TEST2_MODULE = "m2";
+ private static final String TEST2_MAIN_CLASS = "jdk.test2.Main";
// test module m3 uses m4 internals
private static final String TEST3_MODULE = "m3";
@@ -74,7 +78,19 @@
"--add-exports", "java.base/jdk.internal.misc=m1");
assertTrue(compiled, "module " + TEST1_MODULE + " did not compile");
+ // javac -d upgrademods/java.compiler src/java.compiler/**
+ compiled = CompilerUtils.compile(
+ SRC_DIR.resolve("java.compiler"),
+ UPGRADE_MODS_DIRS.resolve("java.compiler"));
+ assertTrue(compiled, "module java.compiler did not compile");
+ // javac --upgrade-module-path upgrademods -d mods/m2 src/m2/**
+ compiled = CompilerUtils.compile(
+ SRC_DIR.resolve(TEST2_MODULE),
+ MODS_DIR.resolve(TEST2_MODULE),
+ "--upgrade-module-path", UPGRADE_MODS_DIRS.toString(),
+ "--add-exports", "java.compiler/javax.tools.internal=m2");
+ assertTrue(compiled, "module " + TEST2_MODULE + " did not compile");
// javac -d mods/m3 src/m3/**
compiled = CompilerUtils.compile(
@@ -146,7 +162,25 @@
assertTrue(exitValue == 0);
}
+ /**
+ * Test --add-exports with upgraded module
+ */
+ public void testWithUpgradedModule() throws Exception {
+ // java --add-exports java.compiler/javax.tools.internal=m2
+ // --upgrade-module-path upgrademods --module-path mods -m ...
+ String mid = TEST2_MODULE + "/" + TEST2_MAIN_CLASS;
+ int exitValue = executeTestJava(
+ "--add-exports", "java.compiler/javax.tools.internal=m2",
+ "--upgrade-module-path", UPGRADE_MODS_DIRS.toString(),
+ "--module-path", MODS_DIR.toString(),
+ "-m", mid)
+ .outputTo(System.out)
+ .errorTo(System.out)
+ .getExitValue();
+
+ assertTrue(exitValue == 0);
+ }
/**
* Test --add-exports with module that is added to the set of root modules
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/launcher/modules/addexports/src/java.compiler/javax/annotation/processing/Generated.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2018, 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 javax.annotation.processing;
+
+public interface Generated {
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/launcher/modules/addexports/src/java.compiler/javax/tools/ToolsHelper.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.tools;
+
+public class ToolsHelper {
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/launcher/modules/addexports/src/java.compiler/javax/tools/internal/Helper.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.tools.internal;
+
+public class Helper {
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/launcher/modules/addexports/src/java.compiler/module-info.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module java.compiler {
+ exports javax.tools;
+ exports javax.annotation.processing;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/launcher/modules/addexports/src/m2/jdk/test2/Main.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.test2;
+
+import javax.tools.internal.Helper;
+
+public class Main {
+ public static void main(String[] args) {
+ Helper h = new Helper();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/launcher/modules/addexports/src/m2/module-info.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+module m2 {
+ requires java.compiler;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenDeprecatedMethods.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8211901
+ * @summary javadoc generates broken links on deprecated items page
+ * @library ../lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @build JavadocTester
+ * @run main TestOverriddenDeprecatedMethods
+ */
+
+public class TestOverriddenDeprecatedMethods extends JavadocTester {
+
+ public static void main(String args[]) throws Exception {
+ TestOverriddenDeprecatedMethods tester = new TestOverriddenDeprecatedMethods();
+ tester.runTests();
+ }
+
+ @Test
+ void test() {
+ javadoc("-d", "out-deprecated",
+ "-sourcepath", testSrc,
+ "--override-methods","summary",
+ "pkg1");
+
+ checkExit(Exit.OK);
+
+ checkOrder("pkg1/SubClass.html",
+ "Method Summary",
+ "Methods declared in class pkg1.<a href=\"BaseClass.html\" title=\"class in pkg1\">"
+ + "BaseClass</a>",
+ "<a href=\"BaseClass.html#func3()\">func3</a>");
+
+ checkOrder("pkg1/SubClass.html",
+ "Method Detail",
+ "@Deprecated\npublic void func1()",
+ "<div class=\"deprecationBlock\"><span class=\"deprecatedLabel\">Deprecated.</span></div>",
+ "@Deprecated\npublic void func2()",
+ "<div class=\"deprecationBlock\"><span class=\"deprecatedLabel\">Deprecated.</span></div>",
+ "<div class=\"block\">deprecated with comments</div>");
+ }
+}
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/pkg1/BaseClass.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/pkg1/BaseClass.java Wed Oct 17 08:09:46 2018 -0700
@@ -50,4 +50,22 @@
*/
public void overridenMethodWithDocsToCopy() {}
+ /**
+ * @deprecated func1 deprecated
+ */
+ @Deprecated
+ public void func1() {}
+
+ /**
+ * @deprecated func2 deprecated
+ */
+ @Deprecated
+ public void func2() {}
+
+ /**
+ * @deprecated func3 deprecated
+ */
+ @Deprecated
+ public void func3() {}
+
}
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/pkg1/SubClass.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/pkg1/SubClass.java Wed Oct 17 08:09:46 2018 -0700
@@ -48,4 +48,22 @@
public void privateMethod() {}
public void overridenMethodWithDocsToCopy() {}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Deprecated
+ public void func1() {}
+
+ /**
+ * deprecated with comments
+ */
+ @Deprecated
+ public void func2() {}
+
+ /**
+ * {@inheritDoc}
+ */
+ public void func3() {}
+
}
--- a/test/lib/jdk/test/lib/apps/LingeredApp.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/lib/jdk/test/lib/apps/LingeredApp.java Wed Oct 17 08:09:46 2018 -0700
@@ -26,9 +26,6 @@
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
import java.io.StringReader;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
@@ -43,7 +40,6 @@
import java.util.stream.Collectors;
import java.util.UUID;
import jdk.test.lib.process.OutputBuffer;
-import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.process.StreamPumper;
/**
@@ -137,6 +133,14 @@
}
/**
+ * @return the LingeredApp's output.
+ * Can be called after the app is run.
+ */
+ public String getProcessStdout() {
+ return stdoutBuffer.toString();
+ }
+
+ /**
*
* @return OutputBuffer object for the LingeredApp's output. Can only be called
* after LingeredApp has exited.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/net/SimpleSSLContext.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.test.lib.net;
+
+import java.util.*;
+import java.io.*;
+import java.security.*;
+import java.security.cert.*;
+import javax.net.ssl.*;
+
+/**
+ * Creates a simple usable SSLContext for SSLSocketFactory
+ * or a HttpsServer using either a given keystore or a default
+ * one in the test tree.
+ *
+ * Using this class with a security manager requires the following
+ * permissions to be granted:
+ *
+ * permission "java.util.PropertyPermission" "test.src.path", "read";
+ * permission java.io.FilePermission "/path/to/test/lib/jdk/test/lib/testkeys", "read";
+ * The exact path above depends on the location of the test.
+ */
+public class SimpleSSLContext {
+
+ SSLContext ssl;
+
+ /**
+ * loads default keystore from SimpleSSLContext
+ * source directory
+ */
+ public SimpleSSLContext() throws IOException {
+ try {
+ AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
+ @Override
+ public Void run() throws Exception {
+ String paths = System.getProperty("test.src.path");
+ StringTokenizer st = new StringTokenizer(paths, File.pathSeparator);
+ boolean securityExceptions = false;
+ while (st.hasMoreTokens()) {
+ String path = st.nextToken();
+ try {
+ File f = new File(path, "jdk/test/lib/net/testkeys");
+ if (f.exists()) {
+ try (FileInputStream fis = new FileInputStream(f)) {
+ init(fis);
+ return null;
+ }
+ }
+ } catch (SecurityException e) {
+ // catch and ignore because permission only required
+ // for one entry on path (at most)
+ securityExceptions = true;
+ }
+ }
+ if (securityExceptions) {
+ System.err.println("SecurityExceptions thrown on loading testkeys");
+ }
+ return null;
+ }
+ });
+ } catch (PrivilegedActionException pae) {
+ Throwable t = pae.getCause() != null ? pae.getCause() : pae;
+ if (t instanceof IOException)
+ throw (IOException)t;
+ if (t instanceof RuntimeException)
+ throw (RuntimeException)t;
+ if (t instanceof Error)
+ throw (Error)t;
+ throw new RuntimeException(t);
+ }
+ }
+
+ /**
+ * loads default keystore from given directory
+ */
+ public SimpleSSLContext(String dir) throws IOException {
+ String file = dir + "/testkeys";
+ try (FileInputStream fis = new FileInputStream(file)) {
+ init(fis);
+ }
+ }
+
+ private void init(InputStream i) throws IOException {
+ try {
+ char[] passphrase = "passphrase".toCharArray();
+ KeyStore ks = KeyStore.getInstance("PKCS12");
+ ks.load(i, passphrase);
+
+ KeyManagerFactory kmf = KeyManagerFactory.getInstance("PKIX");
+ kmf.init(ks, passphrase);
+
+ TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX");
+ tmf.init(ks);
+
+ ssl = SSLContext.getInstance("TLS");
+ ssl.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
+ } catch (KeyManagementException | KeyStoreException |
+ UnrecoverableKeyException | CertificateException |
+ NoSuchAlgorithmException e) {
+ throw new RuntimeException(e.getMessage());
+ }
+ }
+
+ public SSLContext get() {
+ return ssl;
+ }
+}
Binary file test/lib/jdk/test/lib/net/testkeys has changed
--- a/test/lib/jdk/test/lib/util/JarUtils.java Tue Oct 16 15:45:19 2018 +0200
+++ b/test/lib/jdk/test/lib/util/JarUtils.java Wed Oct 17 08:09:46 2018 -0700
@@ -23,6 +23,7 @@
package jdk.test.lib.util;
+import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -271,6 +272,11 @@
changes = new HashMap<>(changes);
System.out.printf("Creating %s from %s...\n", dest, src);
+
+ if (dest.equals(src)) {
+ throw new IOException("src and dest cannot be the same");
+ }
+
try (JarOutputStream jos = new JarOutputStream(
new FileOutputStream(dest))) {
@@ -298,6 +304,22 @@
System.out.println();
}
+ /**
+ * Update the Manifest inside a jar.
+ *
+ * @param src the original jar file name
+ * @param dest the new jar file name
+ * @param man the Manifest
+ *
+ * @throws IOException
+ */
+ public static void updateManifest(String src, String dest, Manifest man)
+ throws IOException {
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ man.write(bout);
+ updateJar(src, dest, Map.of(JarFile.MANIFEST_NAME, bout.toByteArray()));
+ }
+
private static void updateEntry(JarOutputStream jos, String name, Object content)
throws IOException {
if (content instanceof Boolean) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/jdk/test/lib/util/ModuleUtils.java Wed Oct 17 08:09:46 2018 -0700
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.test.lib.util;
+
+import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleFinder;
+import java.lang.module.ModuleReader;
+import java.lang.module.ModuleReference;
+import java.net.URI;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
+
+
+/**
+ * This class consists exclusively of static utility methods that are useful
+ * for creating tests for modules.
+ */
+
+public final class ModuleUtils {
+ private ModuleUtils() { }
+
+
+ /**
+ * Returns a ModuleFinder that finds modules with the given module
+ * descriptors.
+ */
+ public static ModuleFinder finderOf(ModuleDescriptor... descriptors) {
+
+ // Create a ModuleReference for each module
+ Map<String, ModuleReference> namesToReference = new HashMap<>();
+
+ for (ModuleDescriptor descriptor : descriptors) {
+ String name = descriptor.name();
+
+ URI uri = URI.create("module:/" + name);
+
+ ModuleReference mref = new ModuleReference(descriptor, uri) {
+ @Override
+ public ModuleReader open() {
+ throw new UnsupportedOperationException();
+ }
+ };
+
+ namesToReference.put(name, mref);
+ }
+
+ return new ModuleFinder() {
+ @Override
+ public Optional<ModuleReference> find(String name) {
+ Objects.requireNonNull(name);
+ return Optional.ofNullable(namesToReference.get(name));
+ }
+ @Override
+ public Set<ModuleReference> findAll() {
+ return new HashSet<>(namesToReference.values());
+ }
+ };
+ }
+
+}