--- a/make/Help.gmk Tue Oct 16 09:54:28 2018 -0400
+++ b/make/Help.gmk Tue Oct 16 09:55:30 2018 -0400
@@ -119,7 +119,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 09:54:28 2018 -0400
+++ b/make/RunTests.gmk Tue Oct 16 09:55:30 2018 -0400
@@ -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,22 +104,50 @@
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
################################################################################
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,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,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, \
))
@@ -129,8 +157,8 @@
endif
$(eval $(call ParseKeywordVariable, GTEST, \
- KEYWORDS := REPEAT, \
- STRING_KEYWORDS := OPTIONS VM_OPTIONS, \
+ SINGLE_KEYWORDS := REPEAT, \
+ STRING_KEYWORDS := OPTIONS VM_OPTIONS JAVA_OPTIONS, \
))
ifneq ($(GTEST), )
@@ -143,17 +171,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
@@ -165,6 +182,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
#
@@ -368,15 +387,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) \
@@ -447,12 +467,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
@@ -475,11 +494,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
@@ -487,7 +507,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
@@ -498,10 +518,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
@@ -531,6 +551,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
@@ -541,10 +569,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))
@@ -631,7 +670,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 09:54:28 2018 -0400
+++ b/make/RunTestsPrebuilt.gmk Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/make/RunTestsPrebuiltSpec.gmk Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/make/common/MakeBase.gmk Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/make/common/NativeCompilation.gmk Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/make/conf/jib-profiles.js Tue Oct 16 09:55:30 2018 -0400
@@ -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"
)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/cpu/aarch64/gc/shared/barrierSetNMethod_aarch64.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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/ppc/gc/shared/barrierSetNMethod_ppc.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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/x86/c1_MacroAssembler_x86.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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/macroAssembler_x86.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/stubRoutines_x86.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/stubRoutines_x86_64.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/cpu/x86/x86_64.ad Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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/share/classfile/classLoaderData.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/classfile/classLoaderData.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/classfile/classLoaderData.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/classfile/classLoaderDataGraph.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/code/codeBlob.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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/cmsOopClosures.inline.hpp Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/cms/cmsOopClosures.inline.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/epsilon/epsilonBarrierSet.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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/g1/g1FullGCAdjustTask.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1FullGCMarker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1HeapVerifier.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1OopClosures.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1OopClosures.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1RootClosures.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/g1/g1SharedClosures.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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/pcTasks.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/parallel/pcTasks.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -110,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;
--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -2213,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
--- a/src/hotspot/share/gc/serial/defNewGeneration.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/serial/defNewGeneration.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/serial/markSweep.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/barrierSet.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/collectedHeap.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/collectedHeap.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/memAllocator.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/modRefBarrierSet.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/plab.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/taskqueue.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zBarrierSet.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zCollectedHeap.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zCollectedHeap.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zDriver.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zHeap.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zHeap.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zHeapIterator.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zHeapIterator.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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/zMark.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zMark.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zMark.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zRootsIterator.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/gc/z/zRootsIterator.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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/jfr/leakprofiler/chains/rootSetClosure.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/jfr/leakprofiler/utilities/saveRestore.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/memory/filemap.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/memory/iterator.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/memory/iterator.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/memory/iterator.inline.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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/opto/cfgnode.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/opto/cfgnode.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/opto/cfgnode.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/opto/subnode.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/opto/subnode.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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/jvmtiEnv.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/prims/jvmtiEnv.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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.
--- a/src/hotspot/share/runtime/mutexLocker.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/runtime/mutexLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/runtime/mutexLocker.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -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/threadHeapSampler.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/src/hotspot/share/runtime/threadHeapSampler.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/src/hotspot/share/runtime/threadHeapSampler.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -30,16 +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;
- 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) {
@@ -54,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/java.base/share/classes/java/util/Locale.java Tue Oct 16 09:54:28 2018 -0400
+++ b/src/java.base/share/classes/java/util/Locale.java Tue Oct 16 09:55:30 2018 -0400
@@ -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.logging/share/classes/java/util/logging/SimpleFormatter.java Tue Oct 16 09:54:28 2018 -0400
+++ b/src/java.logging/share/classes/java/util/logging/SimpleFormatter.java Tue Oct 16 09:55:30 2018 -0400
@@ -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.security.jgss/share/native/libj2gss/NativeUtil.c Tue Oct 16 09:54:28 2018 -0400
+++ b/src/java.security.jgss/share/native/libj2gss/NativeUtil.c Tue Oct 16 09:55:30 2018 -0400
@@ -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/xml/internal/stream/util/ThreadLocalBufferAllocator.java Tue Oct 16 09:54:28 2018 -0400
+++ b/src/java.xml/share/classes/com/sun/xml/internal/stream/util/ThreadLocalBufferAllocator.java Tue Oct 16 09:55:30 2018 -0400
@@ -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.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java Tue Oct 16 09:54:28 2018 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java Tue Oct 16 09:55:30 2018 -0400
@@ -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;
@@ -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;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/codegen/TestTrichotomyExpressions.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/compiler/escapeAnalysis/TestArrayCopy.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/compiler/graalunit/JttLangMathALTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/compiler/graalunit/JttLangMathMZTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java Tue Oct 16 09:55:30 2018 -0400
@@ -25,7 +25,7 @@
* @test
* @library /test/lib /
*
- * @run driver compiler.jsr292.ContinuousCallSiteTargetChange
+ * @run driver/timeout=300 compiler.jsr292.ContinuousCallSiteTargetChange
*/
package compiler.jsr292;
--- a/test/hotspot/jtreg/runtime/appcds/jvmti/InstrumentationApp.java Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jvmti/InstrumentationApp.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/runtime/appcds/jvmti/InstrumentationTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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/vmTestbase/nsk/share/gc/lock/jni/BooleanArrayCriticalLocker.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/BooleanArrayCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/ByteArrayCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/CharArrayCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/DoubleArrayCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/FloatArrayCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/IntArrayCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/LongArrayCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/ShortArrayCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/StringCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libBooleanArrayCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libByteArrayCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libCharArrayCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libDoubleArrayCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libFloatArrayCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libIntArrayCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libLongArrayCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libShortArrayCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/libStringCriticalLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIGlobalRefLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -24,8 +24,8 @@
#include <jni.h>
#include <stdio.h>
#include <time.h>
+#include "ExceptionCheckingJniEnv.hpp"
#include "jni_tools.h"
-#include "ExceptionCheckingJniEnv.hpp"
extern "C" {
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNILocalRefLocker.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNILocalRefLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIRefLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIWeakGlobalRefLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIGlobalRefLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -21,7 +21,7 @@
* questions.
*/
+#include "ExceptionCheckingJniEnv.cpp"
#include "JNIGlobalRefLocker.cpp"
#include "jni_tools.cpp"
#include "nsk_tools.cpp"
-#include "ExceptionCheckingJniEnv.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNILocalRefLocker.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNILocalRefLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIRefLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIWeakGlobalRefLocker.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -21,6 +21,7 @@
* questions.
*/
+#include "ExceptionCheckingJniEnv.cpp"
#include "JNIWeakGlobalRefLocker.cpp"
#include "jni_tools.cpp"
#include "nsk_tools.cpp"
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/jni/ExceptionCheckingJniEnv.cpp Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jni/ExceptionCheckingJniEnv.cpp Tue Oct 16 09:55:30 2018 -0400
@@ -22,6 +22,8 @@
* questions.
*/
+#include <stdlib.h>
+
#include "ExceptionCheckingJniEnv.hpp"
namespace {
@@ -86,7 +88,7 @@
}
jfieldID ExceptionCheckingJniEnv::GetFieldID(jclass klass, const char *name, const char* type) {
- JNIVerifier<jfieldID> marker(this, "GetObjectClass");
+ JNIVerifier<jfieldID> marker(this, "GetFieldID");
return marker.ResultNotNull(_jni_env->GetFieldID(klass, name, type));
}
@@ -101,7 +103,7 @@
}
jobject ExceptionCheckingJniEnv::NewGlobalRef(jobject obj) {
- JNIVerifier<jobject> marker(this, "GetObjectField");
+ JNIVerifier<jobject> marker(this, "NewGlobalRef");
return marker.ResultNotNull(_jni_env->NewGlobalRef(obj));
}
@@ -109,3 +111,53 @@
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);
+}
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/jni/ExceptionCheckingJniEnv.hpp Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jni/ExceptionCheckingJniEnv.hpp Tue Oct 16 09:55:30 2018 -0400
@@ -66,8 +66,20 @@
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() {
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/correctBootstrap/TestDescription.java Tue Oct 16 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/correctBootstrap/TestDescription.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/incorrectBootstrap/TestDescription.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/mh/TestDescription.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/mt/TestDescription.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/meth/stress/gc/createLotsOfMHConsts/Test.java Tue Oct 16 09:55:30 2018 -0400
@@ -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/com/sun/net/httpserver/SelCacheTest.java Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/SelCacheTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/Test1.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/Test12.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/Test13.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/Test6a.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/Test7a.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/Test8a.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/Test9.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/com/sun/net/httpserver/Test9a.java Tue Oct 16 09:55:30 2018 -0400
@@ -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/lang/management/ManagementFactory/ThreadMXBeanProxy.java Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java Tue Oct 16 09:55:30 2018 -0400
@@ -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/net/HttpURLConnection/SetAuthenticator/HTTPSetAuthenticatorTest.java Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPSetAuthenticatorTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/HttpURLConnection/SetAuthenticator/HTTPTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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/URLPermission/URLTest.java Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/URLPermission/URLTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/AbstractNoBody.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/AbstractThrowingPublishers.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/AbstractThrowingPushPromises.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/AbstractThrowingSubscribers.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/AsFileDownloadTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/AsFileDownloadTest.policy Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/BasicRedirectTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/CancelledResponse.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ConcurrentResponses.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/CookieHeaderTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/CustomRequestPublisher.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/CustomResponseSubscriber.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/DependentActionsTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/DependentPromiseActionsTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/DigestEchoClient.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/DigestEchoClientSSL.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/EchoHandler.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/EncodedCharsInURI.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/EscapedOctetsInURI.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ExpectContinue.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/FlowAdapterPublisherTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/FlowAdapterSubscriberTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/HeadTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/HttpClientBuilderTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/HttpEchoHandler.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/HttpsTunnelTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ImmutableFlowItems.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/InvalidInputStreamSubscriptionRequest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/InvalidSSLContextTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/InvalidSubscriptionRequest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/LightWeightHttpServer.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/LineBodyHandlerTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ManyRequests.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ManyRequests2.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ManyRequestsLegacy.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/MappingResponseSubscriber.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/MaxStreams.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/NoBodyPartOne.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/NoBodyPartTwo.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/NonAsciiCharsInURI.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemes.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ProxyAuthDisabledSchemesSSL.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ProxyTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/RedirectMethodChange.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/RedirectWithCookie.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/RequestBodyTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/RequestBodyTest.policy Tue Oct 16 09:55:30 2018 -0400
@@ -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/ResponseBodyBeforeError.java Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ResponseBodyBeforeError.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ResponsePublisher.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/RetryWithCookie.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ServerCloseTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ShortResponseBody.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ShortResponseBodyWithRetry.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SmokeTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SpecialHeadersTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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;
--- a/test/jdk/java/net/httpclient/SplitResponse.java Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SplitResponse.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SplitResponseAsync.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SplitResponseKeepAlive.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SplitResponseKeepAliveAsync.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SplitResponseSSL.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SplitResponseSSLAsync.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SplitResponseSSLKeepAlive.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/SplitResponseSSLKeepAliveAsync.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/StreamingBody.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersCustomAfterCancel.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersCustomBeforeCancel.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersIOAfterCancel.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersIOBeforeCancel.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersInNextRequest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersInRequest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersInSubscribe.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPublishersSanity.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamCustom.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsInputStreamIO.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesCustom.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsLinesIO.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringCustom.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesAsStringIO.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingPushPromisesSanity.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStream.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsInputStreamAsync.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsLines.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsLinesAsync.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsString.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersAsStringAsync.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/ThrowingSubscribersSanity.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/TimeoutBasic.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/UnauthorizedTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/UnknownBodyLengthTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/dependent.policy Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/BadHeadersTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/BasicTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/ContinuationFrameTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/ErrorTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/ImplicitPushCancel.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/ProxyTest2.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/RedirectTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/ServerPush.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/http2/ServerPushWithDiffTypes.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/security/Driver.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/security/Security.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/websocket/WSHandshakeExceptionTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/AbstractSSLTubeTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/FlowTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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/javax/net/ssl/HttpsURLConnection/Equals.java Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/javax/net/ssl/HttpsURLConnection/Equals.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ /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 09:54:28 2018 -0400
+++ /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/jdk/testlibrary/SimpleSSLContext.java Tue Oct 16 09:54:28 2018 -0400
+++ /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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/ButtonDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/ComboBoxDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/DialogDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/FrameDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/GridBagLayoutDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/ListDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/OptionPaneDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/ProgressBarDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/ScrollPaneDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/SpinnerDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/TabbedPaneDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/TableDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/TextFieldDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/ToggleButtonDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/ToolTipDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/TreeDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/WindowDemoTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/sanity/client/lib/Extensions/src/org/jemmy2ext/JemmyExt.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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/net/www/protocol/http/RedirectOnPost.java Tue Oct 16 09:54:28 2018 -0400
+++ b/test/jdk/sun/net/www/protocol/http/RedirectOnPost.java Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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 Tue Oct 16 09:55:30 2018 -0400
@@ -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 09:54:28 2018 -0400
+++ b/test/jdk/tools/jimage/JImageExtractTest.java Tue Oct 16 09:55:30 2018 -0400
@@ -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/lib/jdk/test/lib/net/SimpleSSLContext.java Tue Oct 16 09:55:30 2018 -0400
@@ -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