diff --git a/.hgtags b/.hgtags
index 4a83ab47054..e0932dbadf5 100644
--- a/.hgtags
+++ b/.hgtags
@@ -240,3 +240,5 @@ dfa34ab293faad9b543a24646dbb381bc3ab5586 jdk8-b114
aaf663f591aba43ec942263b15ba62759ce26a1e jdk8-b116
31b0e03fcad73d7886b306b4c2e57ad270780d0d jdk8-b117
f5b521ade7a35cea18df78ee86322207729f5611 jdk8-b118
+87b743b2263cc53955266411b7797b365a0fb050 jdk8-b119
+a1ee9743f4ee165eae59389a020f2552f895dac8 jdk8-b120
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index acd76c443c5..c697daef07b 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -240,3 +240,5 @@ d086227bfc45d124f09b3bd72a07956b4073bf71 jdk8-b111
cbfe5da942c63ef865cab4a7159e01eff7d7fcf5 jdk8-b116
a4afb0a8d55ef75aef5b0d77b434070468fb89f8 jdk8-b117
0a6db1aac998cdc88e52f9adb97d40ca5b0f1da6 jdk8-b118
+9e90215673be68a3e77a9e444e4232076373734d jdk8-b119
+cd3825b2983045784d6fc6d1729c799b08215752 jdk8-b120
diff --git a/Makefile b/Makefile
index c0210786d59..cd5f66b50cc 100644
--- a/Makefile
+++ b/Makefile
@@ -66,12 +66,12 @@ else
# First, find out the valid targets
# Run the makefile with an arbitrary SPEC using -p -q (quiet dry-run and dump rules) to find
# available PHONY targets. Use this list as valid targets to pass on to the repeated calls.
- all_phony_targets=$(filter-out $(global_targets) bundles-only, $(strip $(shell \
- $(MAKE) -p -q -f make/Main.gmk FRC SPEC=$(firstword $(SPEC)) | \
+ all_phony_targets=$(filter-out $(global_targets) bundles bundles-only final-images-only, $(strip $(shell \
+ cd $(root_dir) && $(MAKE) -p -q FRC SPEC=$(firstword $(SPEC)) | \
grep ^.PHONY: | head -n 1 | cut -d " " -f 2-)))
$(all_phony_targets):
- @$(foreach spec,$(SPEC),($(MAKE) -f NewMakefile.gmk SPEC=$(spec) \
+ @$(foreach spec,$(SPEC),(cd $(root_dir) && $(MAKE) SPEC=$(spec) \
$(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $@) &&) true
.PHONY: $(all_phony_targets)
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index 08412bc4861..e8649ddbee5 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -236,7 +236,6 @@ HOTSPOT_OUTPUTDIR=$(BUILD_OUTPUT)/hotspot
JDK_OUTPUTDIR=$(BUILD_OUTPUT)/jdk
NASHORN_OUTPUTDIR=$(BUILD_OUTPUT)/nashorn
IMAGES_OUTPUTDIR=$(BUILD_OUTPUT)/images
-JCE_OUTPUTDIR=$(BUILD_OUTPUT)/jce-release
LANGTOOLS_DIST=$(LANGTOOLS_OUTPUTDIR)/dist
CORBA_DIST=$(CORBA_OUTPUTDIR)/dist
diff --git a/corba/.hgtags b/corba/.hgtags
index 17aa59f8d9d..23c23467b4d 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -240,3 +240,5 @@ a259ff3e42d91da68f4d4f09d7eb9dc22bc024fc jdk8-b113
5fdc4465208933ba704825b2b05e1afd062235fb jdk8-b116
e53d1ee4d2ae898f1cf58688d45a5afe7c482173 jdk8-b117
d6820a414f182a011a53a29a52370c696cd58dab jdk8-b118
+379fc7609beb7a3d85ebc0cc21a8a51c60d3c7d3 jdk8-b119
+53fd772d28c8a9f0f43adfc06f75f6b3cfa93cb5 jdk8-b120
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index 613bfa66fe7..88a3a61d941 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -400,3 +400,5 @@ abad3b2d905d9e1ad767c94baa94aba6ed5b207b hs25-b60
c9f439732b18ea16f7e65815327d5ea7092cc258 jdk8-b118
b2426da30009cd3069d03de073f351e6432c7682 hs25-b61
ce42d815dd2130250acf6132b51b624001638f0d jdk8-b119
+05fedd51e40da22c9460bf17c7185889e435db3d hs25-b62
+fca262db9c4309f99d2f5542ab0780e45c2f1578 jdk8-b120
diff --git a/hotspot/agent/make/jsdbproc64.sh b/hotspot/agent/make/jsdbproc64.sh
index 9f8007e3db9..ac7d9c3b6ba 100644
--- a/hotspot/agent/make/jsdbproc64.sh
+++ b/hotspot/agent/make/jsdbproc64.sh
@@ -1,7 +1,7 @@
-#!/bin/sh
+#!/bin/sh
#
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2013, 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
@@ -21,10 +21,10 @@
# 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.
-#
+#
#
-
-. `dirname $0`/saenv64.sh
-
-$SA_JAVA_CMD sun.jvm.hotspot.tools.JSDB $*
+
+. `dirname $0`/saenv64.sh
+
+$SA_JAVA_CMD sun.jvm.hotspot.tools.soql.JSDB $*
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1HeapRegionTable.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1HeapRegionTable.java
index 11657ce31da..cfbea40435c 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1HeapRegionTable.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1HeapRegionTable.java
@@ -103,14 +103,14 @@ public class G1HeapRegionTable extends VMObject {
@Override
public void remove() { /* not supported */ }
- HeapRegionIterator(Address addr) {
+ HeapRegionIterator(long committedLength) {
index = 0;
- length = length();
+ length = committedLength;
}
}
- public Iterator
* Note that this is a new method that replaces the deprecated
* {@link #newInstance(java.lang.String, java.lang.ClassLoader)
diff --git a/jaxws/.hgtags b/jaxws/.hgtags
index 35658087999..d381b7e2242 100644
--- a/jaxws/.hgtags
+++ b/jaxws/.hgtags
@@ -240,3 +240,5 @@ e126d8eca69b83a1cc159c2375b7c33140346d2b jdk8-b115
587560c222a2476066852224ed02d39b5090a299 jdk8-b116
fe56ba456fd32758c72db629938d69067468d89c jdk8-b117
76a598cf50c4e1dc1fc8adc08b451943aa1a3179 jdk8-b118
+172b8e056ff259044ca48c5425d643dc8e2e05c8 jdk8-b119
+6c152deb600d8a11bc46149ace317b1c9fce1482 jdk8-b120
diff --git a/jdk/.hgtags b/jdk/.hgtags
index 5cda4edd811..21452df959c 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -240,3 +240,5 @@ f82b730c798b6bf38946baaba8a7d80fd5efaa70 jdk8-b115
0dc0067f3b8efb299a4c23f76ee26ea64df9e1d7 jdk8-b116
fc4ac66aa657e09de5f8257c3174f240ed0cbaf7 jdk8-b117
28ca338366ff2774ac9002f9f6eaff4101a3ea3b jdk8-b118
+e4499a6529e8c3e762ba86f45cdd774c92a8e7bc jdk8-b119
+d31cd980e1da31fa496a359caaf1a165aeb5791a jdk8-b120
diff --git a/jdk/make/CreateSecurityJars.gmk b/jdk/make/CreateSecurityJars.gmk
index 337ea5f40a4..d5b3b8ea54b 100644
--- a/jdk/make/CreateSecurityJars.gmk
+++ b/jdk/make/CreateSecurityJars.gmk
@@ -54,7 +54,7 @@ $(JCE_MANIFEST): $(MAINMANIFEST)
##########################################################################################
# For security and crypto jars, always build the jar, but for closed, install the prebuilt
# signed version instead of the newly built jar. Unsigned jars are treated as intermediate
-# targets and explicitly added to the JARS list. For open, signing is not needed. See
+# targets and explicitly added to the TARGETS list. For open, signing is not needed. See
# SignJars.gmk for more information.
#
# The source for the crypto jars is not available for all licensees. The BUILD_CRYPTO
@@ -63,7 +63,7 @@ $(JCE_MANIFEST): $(MAINMANIFEST)
# other way to get the jars than to build them.
SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar
-SUNPKCS11_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunpkcs11.jar
+SUNPKCS11_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunpkcs11.jar
$(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR, , \
SRCS := $(JDK_OUTPUTDIR)/classes_security, \
@@ -78,19 +78,19 @@ $(SUNPKCS11_JAR_UNSIGNED): $(JCE_MANIFEST)
ifndef OPENJDK
SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar
$(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_SRC)
- @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunPKCS11 provider..."
+ @$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
$(install-file)
else
$(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_UNSIGNED)
$(install-file)
endif
-JARS += $(SUNPKCS11_JAR_UNSIGNED) $(SUNPKCS11_JAR_DST)
+TARGETS += $(SUNPKCS11_JAR_UNSIGNED) $(SUNPKCS11_JAR_DST)
##########################################################################################
SUNEC_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunec.jar
-SUNEC_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunec.jar
+SUNEC_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunec.jar
$(eval $(call SetupArchive,BUILD_SUNEC_JAR, , \
SRCS := $(JDK_OUTPUTDIR)/classes_security, \
@@ -105,19 +105,19 @@ $(SUNEC_JAR_UNSIGNED): $(JCE_MANIFEST)
ifndef OPENJDK
SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
$(SUNEC_JAR_DST): $(SUNEC_JAR_SRC)
- @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunEC provider..."
+ @$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
$(install-file)
else
$(SUNEC_JAR_DST): $(SUNEC_JAR_UNSIGNED)
$(install-file)
endif
-JARS += $(SUNEC_JAR_UNSIGNED) $(SUNEC_JAR_DST)
+TARGETS += $(SUNEC_JAR_UNSIGNED) $(SUNEC_JAR_DST)
##########################################################################################
SUNJCE_PROVIDER_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunjce_provider.jar
-SUNJCE_PROVIDER_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunjce_provider.jar
+SUNJCE_PROVIDER_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunjce_provider.jar
ifneq ($(BUILD_CRYPTO), no)
$(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR, , \
@@ -130,25 +130,25 @@ ifneq ($(BUILD_CRYPTO), no)
$(SUNJCE_PROVIDER_JAR_UNSIGNED): $(JCE_MANIFEST)
- JARS += $(SUNJCE_PROVIDER_JAR_UNSIGNED)
+ TARGETS += $(SUNJCE_PROVIDER_JAR_UNSIGNED)
endif
ifndef OPENJDK
SUNJCE_PROVIDER_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/sunjce_provider.jar
$(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_SRC)
- @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunJCE provider..."
+ @$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
$(install-file)
else
$(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_UNSIGNED)
$(install-file)
endif
-JARS += $(SUNJCE_PROVIDER_JAR_DST)
+TARGETS += $(SUNJCE_PROVIDER_JAR_DST)
##########################################################################################
JCE_JAR_DST := $(JDK_OUTPUTDIR)/lib/jce.jar
-JCE_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/jce.jar
+JCE_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/jce.jar
ifneq ($(BUILD_CRYPTO), no)
$(eval $(call SetupArchive,BUILD_JCE_JAR, , \
@@ -161,36 +161,43 @@ ifneq ($(BUILD_CRYPTO), no)
$(JCE_JAR_UNSIGNED): $(JCE_MANIFEST)
- JARS += $(JCE_JAR_UNSIGNED)
+ TARGETS += $(JCE_JAR_UNSIGNED)
endif
ifndef OPENJDK
JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
$(JCE_JAR_DST): $(JCE_JAR_SRC)
- @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt jce.jar..."
+ @$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
$(install-file)
else
$(JCE_JAR_DST): $(JCE_JAR_UNSIGNED)
$(install-file)
endif
-JARS += $(JCE_JAR_DST)
+TARGETS += $(JCE_JAR_DST)
##########################################################################################
US_EXPORT_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/US_export_policy.jar
-US_EXPORT_POLICY_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/US_export_policy.jar
ifneq ($(BUILD_CRYPTO), no)
+
+ US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED := \
+ $(JDK_OUTPUTDIR)/jce/unsigned/policy/limited/US_export_policy.jar
+ US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED := \
+ $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/US_export_policy.jar
+
#
# TODO fix so that SetupArchive does not write files into SRCS
# then we don't need this extra copying
#
# NOTE: We currently do not place restrictions on our limited export
- # policy. This was not a typo.
+ # policy. This was not a typo. This means we are shipping the same file
+ # for both limimted and unlimited US_export_policy.jar.
#
US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited
- US_EXPORT_POLICY_JAR_TMP := $(JDK_OUTPUTDIR)/US_export_policy_jar.tmp
+ US_EXPORT_POLICY_JAR_TMP := \
+ $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/US_export_policy_jar.tmp
$(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
$(install-file)
@@ -200,77 +207,113 @@ ifneq ($(BUILD_CRYPTO), no)
$(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, $(US_EXPORT_POLICY_JAR_DEPS), \
SRCS := $(US_EXPORT_POLICY_JAR_TMP), \
SUFFIXES := .policy, \
- JAR := $(US_EXPORT_POLICY_JAR_UNSIGNED), \
+ JAR := $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED), \
EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
SKIP_METAINF := true))
- JARS += $(US_EXPORT_POLICY_JAR_UNSIGNED)
+ $(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED): $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
+ $(ECHO) $(LOG_INFO) Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+ $(install-file)
+
+ TARGETS += $(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED) \
+ $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
endif
ifndef OPENJDK
+ ifeq ($(UNLIMITED_CRYPTO), true)
+ $(error No prebuilt unlimited crypto jars available)
+ endif
$(US_EXPORT_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar
- $(ECHO) $(LOG_INFO) Copying $(@F)
+ $(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
$(install-file)
else
- $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNSIGNED)
+ ifeq ($(UNLIMITED_CRYPTO), true)
+ $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
$(install-file)
+ else
+ $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED)
+ $(install-file)
+ endif
endif
-JARS += $(US_EXPORT_POLICY_JAR_DST)
+TARGETS += $(US_EXPORT_POLICY_JAR_DST)
##########################################################################################
LOCAL_POLICY_JAR_DST := $(JDK_OUTPUTDIR)/lib/security/local_policy.jar
-LOCAL_POLICY_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/local_policy.jar
ifneq ($(BUILD_CRYPTO), no)
+
+ LOCAL_POLICY_JAR_LIMITED_UNSIGNED := \
+ $(JDK_OUTPUTDIR)/jce/unsigned/policy/limited/local_policy.jar
+ LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED := \
+ $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/local_policy.jar
+
#
# TODO fix so that SetupArchive does not write files into SRCS
# then we don't need this extra copying
#
- LOCAL_POLICY_JAR_TMP := $(JDK_OUTPUTDIR)/local_policy_jar.tmp
+ LOCAL_POLICY_JAR_LIMITED_TMP := \
+ $(JDK_OUTPUTDIR)/jce/unsigned/policy/limited/local_policy_jar.tmp
+ LOCAL_POLICY_JAR_UNLIMITED_TMP := \
+ $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/local_policy_jar.tmp
- ifeq ($(UNLIMITED_CRYPTO), true)
- LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited
- LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/default_local.policy
- LOCAL_POLICY_JAR_ATTR := Crypto-Strength: unlimited
- else
- LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/data/cryptopolicy/limited
- LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy \
- $(LOCAL_POLICY_JAR_TMP)/default_local.policy
- LOCAL_POLICY_JAR_ATTR := Crypto-Strength: limited
- endif
-
- $(LOCAL_POLICY_JAR_TMP)/%: $(LOCAL_POLICY_JAR_SRC_DIR)/%
+ $(LOCAL_POLICY_JAR_LIMITED_TMP)/%: $(JDK_TOPDIR)/make/data/cryptopolicy/limited/%
$(install-file)
- $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR, $(LOCAL_POLICY_JAR_DEPS), \
- SRCS := $(LOCAL_POLICY_JAR_TMP), \
+ $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/%: $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited/%
+ $(install-file)
+
+ $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_LIMITED, \
+ $(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \
+ $(LOCAL_POLICY_JAR_LIMITED_TMP)/default_local.policy, \
+ SRCS := $(LOCAL_POLICY_JAR_LIMITED_TMP), \
SUFFIXES := .policy, \
- JAR := $(LOCAL_POLICY_JAR_UNSIGNED), \
- EXTRA_MANIFEST_ATTR := $(LOCAL_POLICY_JAR_ATTR), \
+ JAR := $(LOCAL_POLICY_JAR_LIMITED_UNSIGNED), \
+ EXTRA_MANIFEST_ATTR := Crypto-Strength: limited, \
SKIP_METAINF := true))
- JARS += $(LOCAL_POLICY_JAR_UNSIGNED)
+ $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_UNLIMITED, \
+ $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/default_local.policy, \
+ SRCS := $(LOCAL_POLICY_JAR_UNLIMITED_TMP), \
+ SUFFIXES := .policy, \
+ JAR := $(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED), \
+ EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
+ SKIP_METAINF := true))
+
+ TARGETS += $(LOCAL_POLICY_JAR_LIMITED_UNSIGNED) $(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED)
+
+ ifndef OPENJDK
+ $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/README.txt: \
+ $(JDK_TOPDIR)/make/closed/javax/crypto/doc/README.txt
+ $(install-file)
+
+ TARGETS += $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/README.txt
+ endif
endif
ifndef OPENJDK
$(LOCAL_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar
- $(ECHO) $(LOG_INFO) Copying $(@F)
+ $(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
$(install-file)
else
- $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNSIGNED)
+ ifeq ($(UNLIMITED_CRYPTO), true)
+ $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED)
$(install-file)
+ else
+ $(LOCAL_POLICY_JAR_DST): $(LOCAL_POLICY_JAR_LIMITED_UNSIGNED)
+ $(install-file)
+ endif
endif
-JARS += $(LOCAL_POLICY_JAR_DST)
+TARGETS += $(LOCAL_POLICY_JAR_DST)
##########################################################################################
ifeq ($(OPENJDK_TARGET_OS), windows)
SUNMSCAPI_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunmscapi.jar
- SUNMSCAPI_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/sunmscapi.jar
+ SUNMSCAPI_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunmscapi.jar
$(eval $(call SetupArchive,BUILD_SUNMSCAPI_JAR, , \
SRCS := $(JDK_OUTPUTDIR)/classes_security, \
@@ -285,14 +328,14 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
ifndef OPENJDK
SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar
$(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_SRC)
- @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunMSCAPI provider..."
+ @$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
$(install-file)
else
$(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_UNSIGNED)
$(install-file)
endif
- JARS += $(SUNMSCAPI_JAR_UNSIGNED) $(SUNMSCAPI_JAR_DST)
+ TARGETS += $(SUNMSCAPI_JAR_UNSIGNED) $(SUNMSCAPI_JAR_DST)
endif
@@ -302,7 +345,7 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
ifndef OPENJDK
UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/ucrypto.jar
- UCRYPTO_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/unsigned/ucrypto.jar
+ UCRYPTO_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/ucrypto.jar
UCRYPTO_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ucrypto/ucrypto.jar
$(eval $(call SetupArchive,BUILD_UCRYPTO_JAR, , \
@@ -316,14 +359,14 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
$(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST)
$(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_SRC)
- @$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..."
+ @$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
$(install-file)
- JARS += $(UCRYPTO_JAR_UNSIGNED) $(UCRYPTO_JAR_DST)
+ TARGETS += $(UCRYPTO_JAR_UNSIGNED) $(UCRYPTO_JAR_DST)
endif
endif
-all: $(JARS)
+all: $(TARGETS)
.PHONY: default all
diff --git a/jdk/make/SignJars.gmk b/jdk/make/SignJars.gmk
index 5365bb8312c..21647889201 100644
--- a/jdk/make/SignJars.gmk
+++ b/jdk/make/SignJars.gmk
@@ -80,7 +80,7 @@ check-keystore:
exit 2; \
fi
-$(JCE_OUTPUTDIR)/%: $(JDK_OUTPUTDIR)/unsigned/%
+$(JDK_OUTPUTDIR)/jce/signed/%: $(JDK_OUTPUTDIR)/jce/unsigned/%
$(call install-file)
$(JARSIGNER) -keystore $(SIGNING_KEYSTORE) \
$@ $(SIGNING_ALIAS) < $(SIGNING_PASSPHRASE)
@@ -88,26 +88,33 @@ $(JCE_OUTPUTDIR)/%: $(JDK_OUTPUTDIR)/unsigned/%
JAR_LIST := \
jce.jar \
- local_policy.jar \
+ policy/limited/local_policy.jar \
+ policy/limited/US_export_policy.jar \
+ policy/unlimited/local_policy.jar \
+ policy/unlimited/US_export_policy.jar \
sunec.jar \
sunjce_provider.jar \
sunpkcs11.jar \
- US_export_policy.jar \
sunmscapi.jar \
ucrypto.jar \
#
-UNSIGNED_JARS := $(wildcard $(addprefix $(JDK_OUTPUTDIR)/unsigned/, $(JAR_LIST)))
+UNSIGNED_JARS := $(wildcard $(addprefix $(JDK_OUTPUTDIR)/jce/unsigned/, $(JAR_LIST)))
ifeq ($(UNSIGNED_JARS), )
- $(error No jars found in $(JDK_OUTPUTDIR)/unsigned/)
+ $(error No jars found in $(JDK_OUTPUTDIR)/jce/unsigned/)
endif
-SIGNED_JARS := $(patsubst $(JDK_OUTPUTDIR)/unsigned/%,$(JCE_OUTPUTDIR)/%, $(UNSIGNED_JARS))
+SIGNED_JARS := $(patsubst $(JDK_OUTPUTDIR)/jce/unsigned/%,$(JDK_OUTPUTDIR)/jce/signed/%, \
+ $(UNSIGNED_JARS))
$(SIGNED_JARS): check-keystore
-all: $(SIGNED_JARS)
+$(JDK_OUTPUTDIR)/jce/signed/policy/unlimited/README.txt: \
+ $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/README.txt
+ $(install-file)
+
+all: $(SIGNED_JARS) $(JDK_OUTPUTDIR)/jce/signed/policy/unlimited/README.txt
@$(PRINTF) "\n*** The jar files built by the 'sign-jars' target are developer ***"
@$(PRINTF) "\n*** builds only and *MUST NOT* be checked into the closed workspace. ***"
@$(PRINTF) "\n*** ***"
diff --git a/jdk/make/data/cryptopolicy/limited/LIMITED b/jdk/make/data/cryptopolicy/limited/LIMITED
deleted file mode 100644
index b58f7acd930..00000000000
--- a/jdk/make/data/cryptopolicy/limited/LIMITED
+++ /dev/null
@@ -1 +0,0 @@
-Crypto-Strength: limited
diff --git a/jdk/make/data/cryptopolicy/unlimited/UNLIMITED b/jdk/make/data/cryptopolicy/unlimited/UNLIMITED
deleted file mode 100644
index 7fc7743c416..00000000000
--- a/jdk/make/data/cryptopolicy/unlimited/UNLIMITED
+++ /dev/null
@@ -1 +0,0 @@
-Crypto-Strength: unlimited
diff --git a/jdk/src/bsd/doc/man/jdeps.1 b/jdk/src/bsd/doc/man/jdeps.1
index 9b8f698f6a2..c3884aa6c0e 100644
--- a/jdk/src/bsd/doc/man/jdeps.1
+++ b/jdk/src/bsd/doc/man/jdeps.1
@@ -62,7 +62,7 @@ jdeps \- Java class dependency analyzer\&.
\fIoptions\fR
Command-line options\&. See Options\&.
.TP
-\fIclass\fR\fIes\fR
+\fIclasses\fR
Name of the classes to analyze\&. You can specify a class that can be found in the class path, by its file name, a directory, or a JAR file\&.
.SH DESCRIPTION
The \fI\fR\f3jdeps\fR command shows the package-level or class-level dependencies of Java class files\&. The input class can be a path name to a \f3\&.class\fR file, a directory, a JAR file, or it can be a fully qualified class name to analyze all class files\&. The options determine the output\&. By default, \f3jdeps\fR outputs the dependencies to the system output\&. It can generate the dependencies in DOT language (see the \f3-dotoutput\fR option)\&.
@@ -106,6 +106,12 @@ Finds dependencies in packages matching the specified regular expression pattern
.br
Restricts analysis to classes matching pattern\&. This option filters the list of classes to be analyzed\&. It can be used together with \f3-p\fR and \f3-e\fR which apply pattern to the dependencies\&.
.TP
+-jdkinternals
+.br
+Finds class-level dependences in JDK internal APIs\&. By default, it analyzes all classes specified in the \f3-classpath\fR option and in input files unless you specified the \f3-include\fR option\&. You cannot use this option with the \f3-p\fR, \f3-e\fR, and \f3-s\fR options\&.
+
+\fIWarning\fR: JDK internal APIs may not be accessible in upcoming releases\&.
+.TP
-P, -profile
.br
Shows profile or the file containing a package\&.
diff --git a/jdk/src/linux/doc/man/jdeps.1 b/jdk/src/linux/doc/man/jdeps.1
index 9b8f698f6a2..c3884aa6c0e 100644
--- a/jdk/src/linux/doc/man/jdeps.1
+++ b/jdk/src/linux/doc/man/jdeps.1
@@ -62,7 +62,7 @@ jdeps \- Java class dependency analyzer\&.
\fIoptions\fR
Command-line options\&. See Options\&.
.TP
-\fIclass\fR\fIes\fR
+\fIclasses\fR
Name of the classes to analyze\&. You can specify a class that can be found in the class path, by its file name, a directory, or a JAR file\&.
.SH DESCRIPTION
The \fI\fR\f3jdeps\fR command shows the package-level or class-level dependencies of Java class files\&. The input class can be a path name to a \f3\&.class\fR file, a directory, a JAR file, or it can be a fully qualified class name to analyze all class files\&. The options determine the output\&. By default, \f3jdeps\fR outputs the dependencies to the system output\&. It can generate the dependencies in DOT language (see the \f3-dotoutput\fR option)\&.
@@ -106,6 +106,12 @@ Finds dependencies in packages matching the specified regular expression pattern
.br
Restricts analysis to classes matching pattern\&. This option filters the list of classes to be analyzed\&. It can be used together with \f3-p\fR and \f3-e\fR which apply pattern to the dependencies\&.
.TP
+-jdkinternals
+.br
+Finds class-level dependences in JDK internal APIs\&. By default, it analyzes all classes specified in the \f3-classpath\fR option and in input files unless you specified the \f3-include\fR option\&. You cannot use this option with the \f3-p\fR, \f3-e\fR, and \f3-s\fR options\&.
+
+\fIWarning\fR: JDK internal APIs may not be accessible in upcoming releases\&.
+.TP
-P, -profile
.br
Shows profile or the file containing a package\&.
diff --git a/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java
index c5b26892073..9a598171986 100644
--- a/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java
+++ b/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java
@@ -916,8 +916,7 @@ public class Krb5LoginModule implements LoginModule {
char[] tmpPassword = ((PasswordCallback)
callbacks[0]).getPassword();
if (tmpPassword == null) {
- // treat a NULL password as an empty password
- tmpPassword = new char[0];
+ throw new LoginException("No password provided");
}
password = new char[tmpPassword.length];
System.arraycopy(tmpPassword, 0,
diff --git a/jdk/src/share/classes/java/applet/Applet.java b/jdk/src/share/classes/java/applet/Applet.java
index 2e8e39a19ff..63d3f0a9f3c 100644
--- a/jdk/src/share/classes/java/applet/Applet.java
+++ b/jdk/src/share/classes/java/applet/Applet.java
@@ -392,7 +392,7 @@ public class Applet extends Panel {
* Each element of the array should be a set of three
* Strings
containing the name, the type, and a
* description. For example:
- *
+ ** String pinfo[][] = { * {"fps", "1-10", "frames per second"}, * {"repeat", "boolean", "repeat image loop"}, diff --git a/jdk/src/share/classes/java/applet/AppletContext.java b/jdk/src/share/classes/java/applet/AppletContext.java index f28308cfb11..c031686acc0 100644 --- a/jdk/src/share/classes/java/applet/AppletContext.java +++ b/jdk/src/share/classes/java/applet/AppletContext.java @@ -107,7 +107,7 @@ public interface AppletContext { *target
argument indicates in which HTML frame the * document is to be displayed. * The target argument is interpreted as follows: - *+ * *
*
* Target Argument Description "_self"
Show in the window and frame that diff --git a/jdk/src/share/classes/java/awt/AWTPermission.java b/jdk/src/share/classes/java/awt/AWTPermission.java index 2b371bce714..0859872cb7a 100644 --- a/jdk/src/share/classes/java/awt/AWTPermission.java +++ b/jdk/src/share/classes/java/awt/AWTPermission.java @@ -43,7 +43,6 @@ import java.security.BasicPermission; * target names, and for each provides a description of what the * permission allows and a discussion of the risks of granting code * the permission. - * * *
*
diff --git a/jdk/src/share/classes/java/awt/AlphaComposite.java b/jdk/src/share/classes/java/awt/AlphaComposite.java index 9f8b64f2684..f08ea2b47bf 100644 --- a/jdk/src/share/classes/java/awt/AlphaComposite.java +++ b/jdk/src/share/classes/java/awt/AlphaComposite.java @@ -175,7 +175,6 @@ import sun.java2d.SunCompositeContext; * Fs and Fd and then the resulting * premultiplied components Ar and Cr. * - * *
Preparing Results
* *@@ -193,7 +192,6 @@ import sun.java2d.SunCompositeContext; * by zero" and the color components are left as * all zeros. * - *
*
Performance Considerations
* *@@ -216,7 +214,6 @@ import sun.java2d.SunCompositeContext; * for their pixels. Such sources supply an alpha of 1.0 for * all of their pixels. * - *
*
* Many destinations also have no place to store the alpha values * that result from the blending calculations performed by this class. @@ -227,7 +224,6 @@ import sun.java2d.SunCompositeContext; * values by the resulting alpha value before storing the color * values and discarding the alpha value. * - * *
* The accuracy of the results depends on the manner in which pixels * are stored in the destination. @@ -248,7 +244,6 @@ import sun.java2d.SunCompositeContext; * the need to choose a pixel from a limited palette to match the * results of the blending equations. * - * *
* Nearly all formats store pixels as discrete integers rather than * the floating point values used in the reference equations above. @@ -268,7 +263,6 @@ import sun.java2d.SunCompositeContext; * represents 0.0 and 0xff represents * 1.0. * - * *
* The internal implementation can approximate some of the equations * and it can also eliminate some steps to avoid unnecessary operations. @@ -332,7 +326,6 @@ import sun.java2d.SunCompositeContext; * * and thus they would all match. * - *
*
* Because of the technique of simplifying the equations for * calculation efficiency, some implementations might perform diff --git a/jdk/src/share/classes/java/awt/BasicStroke.java b/jdk/src/share/classes/java/awt/BasicStroke.java index 5cc466640c2..80b4a3d3eb3 100644 --- a/jdk/src/share/classes/java/awt/BasicStroke.java +++ b/jdk/src/share/classes/java/awt/BasicStroke.java @@ -39,7 +39,7 @@ import java.lang.annotation.Native; * {@link Shape} and the decorations applied at the ends and joins of * path segments of the Shape
. * These rendering attributes include: - *+ *
*
- width *
- The pen width, measured perpendicularly to the pen trajectory. *
- end caps diff --git a/jdk/src/share/classes/java/awt/BorderLayout.java b/jdk/src/share/classes/java/awt/BorderLayout.java index 8b131c485d3..52f56ed8bf2 100644 --- a/jdk/src/share/classes/java/awt/BorderLayout.java +++ b/jdk/src/share/classes/java/awt/BorderLayout.java @@ -99,7 +99,7 @@ import java.util.Hashtable; * style="float:center; margin: 7px 10px;"> *
* The code for this applet is as follows: - *
+ * *
* import java.awt.*; * import java.applet.Applet; diff --git a/jdk/src/share/classes/java/awt/Button.java b/jdk/src/share/classes/java/awt/Button.java index 83506b6fdb1..da7a01f8535 100644 --- a/jdk/src/share/classes/java/awt/Button.java +++ b/jdk/src/share/classes/java/awt/Button.java @@ -388,7 +388,7 @@ public class Button extends Component implements Accessible { * This method is not called unless action events are * enabled for this button. Action events are enabled * when one of the following occurs: - *+ *
*
- An
ActionListener
object is registered * viaaddActionListener
. *- Action events are enabled via
enableEvents
. diff --git a/jdk/src/share/classes/java/awt/Checkbox.java b/jdk/src/share/classes/java/awt/Checkbox.java index 7568b0c5aee..0215382df3e 100644 --- a/jdk/src/share/classes/java/awt/Checkbox.java +++ b/jdk/src/share/classes/java/awt/Checkbox.java @@ -41,7 +41,7 @@ import javax.accessibility.*; ** The following code example creates a set of check boxes in * a grid layout: - *
+ * *
* setLayout(new GridLayout(3, 1)); * add(new Checkbox("one", null, true)); @@ -558,7 +558,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * This method is not called unless item events are * enabled for this component. Item events are enabled * when one of the following occurs: - *+ *
*
- An
ItemListener
object is registered * viaaddItemListener
. *- Item events are enabled via
enableEvents
. diff --git a/jdk/src/share/classes/java/awt/CheckboxGroup.java b/jdk/src/share/classes/java/awt/CheckboxGroup.java index 25b0697f117..90994f4a72d 100644 --- a/jdk/src/share/classes/java/awt/CheckboxGroup.java +++ b/jdk/src/share/classes/java/awt/CheckboxGroup.java @@ -35,7 +35,7 @@ package java.awt; ** The following code example produces a new check box group, * with three check boxes: - *
+ * *
* setLayout(new GridLayout(3, 1)); * CheckboxGroup cbg = new CheckboxGroup(); diff --git a/jdk/src/share/classes/java/awt/CheckboxMenuItem.java b/jdk/src/share/classes/java/awt/CheckboxMenuItem.java index 20265c7ad12..424a53102e8 100644 --- a/jdk/src/share/classes/java/awt/CheckboxMenuItem.java +++ b/jdk/src/share/classes/java/awt/CheckboxMenuItem.java @@ -367,7 +367,7 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access * This method is not called unless item events are * enabled for this menu item. Item events are enabled * when one of the following occurs: - *+ *
*
- An
ItemListener
object is registered * viaaddItemListener
. *- Item events are enabled via
enableEvents
. diff --git a/jdk/src/share/classes/java/awt/Choice.java b/jdk/src/share/classes/java/awt/Choice.java index b50746205d9..1a75f903c3d 100644 --- a/jdk/src/share/classes/java/awt/Choice.java +++ b/jdk/src/share/classes/java/awt/Choice.java @@ -40,7 +40,7 @@ import javax.accessibility.*; * The current choice is displayed as the title of the menu. ** The following code example produces a pop-up menu: - *
+ * *
* Choice ColorChooser = new Choice(); * ColorChooser.add("Green"); @@ -609,7 +609,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { * This method is not called unless item events are * enabled for this component. Item events are enabled * when one of the following occurs: - *+ *
*
- An
ItemListener
object is registered * viaaddItemListener
. *- Item events are enabled via
enableEvents
. diff --git a/jdk/src/share/classes/java/awt/Component.java b/jdk/src/share/classes/java/awt/Component.java index bd913cbd50e..87c8879d0b6 100644 --- a/jdk/src/share/classes/java/awt/Component.java +++ b/jdk/src/share/classes/java/awt/Component.java @@ -106,7 +106,7 @@ import sun.util.logging.PlatformLogger; * adding/removing components to/from containers, the whole hierarchy must be * validated afterwards by means of the {@link Container#validate()} method * invoked on the top-most invalid container of the hierarchy. - *+ * *
Serialization
* It is important to note that only AWT listeners which conform * to theSerializable
protocol will be saved when @@ -3859,7 +3859,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * This is a proxy capabilities class used when a FlipBufferStrategy * is created instead of the requested Blit strategy. * - * @see sun.awt.SunGraphicsEnvironment#isFlipStrategyPreferred(ComponentPeer) + * @see sun.java2d.SunGraphicsEnvironment#isFlipStrategyPreferred(ComponentPeer) */ private class ProxyCapabilities extends ExtendedBufferCapabilities { private BufferCapabilities orig; @@ -4515,7 +4515,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Private class to perform sub-region blitting. Swing will use * this subclass via the SubRegionShowable interface in order to * copy only the area changed during a repaint. - * @see javax.swing.BufferStrategyPaintManager + * See javax.swing.BufferStrategyPaintManager. */ private class BltSubRegionBufferStrategy extends BltBufferStrategy implements SubRegionShowable @@ -6328,7 +6328,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * This method is not called unless component events are * enabled for this component. Component events are enabled * when one of the following occurs: - *+ *
*
- A
ComponentListener
object is registered * viaaddComponentListener
. *- Component events are enabled via
enableEvents
. @@ -6373,7 +6373,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * This method is not called unless focus events are * enabled for this component. Focus events are enabled * when one of the following occurs: - *+ *
*
- A
FocusListener
object is registered * viaaddFocusListener
. *- Focus events are enabled via
enableEvents
. @@ -6393,7 +6393,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * with aFocusEvent
as the argument will result in a * call to theComponent
'sprocessFocusEvent
* method regardless of the currentKeyboardFocusManager
. - *+ * *
Note that if the event parameter is
null
* the behavior is unspecified and may result in an * exception. @@ -6430,7 +6430,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * This method is not called unless key events are * enabled for this component. Key events are enabled * when one of the following occurs: - *+ *
*
- A
KeyListener
object is registered * viaaddKeyListener
. *- Key events are enabled via
enableEvents
. @@ -6499,7 +6499,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * This method is not called unless mouse events are * enabled for this component. Mouse events are enabled * when one of the following occurs: - *+ *
*
- A
MouseListener
object is registered * viaaddMouseListener
. *- Mouse events are enabled via
enableEvents
. @@ -6547,7 +6547,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * This method is not called unless mouse motion events are * enabled for this component. Mouse motion events are enabled * when one of the following occurs: - *+ *
*
- A
MouseMotionListener
object is registered * viaaddMouseMotionListener
. *- Mouse motion events are enabled via
enableEvents
. @@ -6586,7 +6586,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * This method is not called unless mouse wheel events are * enabled for this component. Mouse wheel events are enabled * when one of the following occurs: - *+ *
*
- A
MouseWheelListener
object is registered * viaaddMouseWheelListener
. *- Mouse wheel events are enabled via
enableEvents
. @@ -6630,7 +6630,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * This method is not called unless input method events * are enabled for this component. Input method events are enabled * when one of the following occurs: - *+ *
*
- An
InputMethodListener
object is registered * viaaddInputMethodListener
. *- Input method events are enabled via
enableEvents
. @@ -6669,7 +6669,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * This method is not called unless hierarchy events * are enabled for this component. Hierarchy events are enabled * when one of the following occurs: - *+ *
*
- An
HierarchyListener
object is registered * viaaddHierarchyListener
. *- Hierarchy events are enabled via
enableEvents
. @@ -6705,7 +6705,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * This method is not called unless hierarchy bounds events * are enabled for this component. Hierarchy bounds events are enabled * when one of the following occurs: - *+ *
*
- An
HierarchyBoundsListener
object is registered * viaaddHierarchyBoundsListener
. *- Hierarchy bounds events are enabled via
enableEvents
. diff --git a/jdk/src/share/classes/java/awt/Container.java b/jdk/src/share/classes/java/awt/Container.java index 7bb4da9bb56..deca54fca51 100644 --- a/jdk/src/share/classes/java/awt/Container.java +++ b/jdk/src/share/classes/java/awt/Container.java @@ -185,7 +185,7 @@ public class Container extends Component { * the method can return the Container on which it is originally called * in case if none of its children are the current mouse event targets. * - * @see #getMouseEventTarget(int, int, boolean, boolean, boolean) + * @see #getMouseEventTarget(int, int, boolean) */ static final boolean INCLUDE_SELF = true; @@ -194,7 +194,7 @@ public class Container extends Component { * ofgetMouseEventTarget
. It is used to specify whether * the method should search only lightweight components. * - * @see #getMouseEventTarget(int, int, boolean, boolean, boolean) + * @see #getMouseEventTarget(int, int, boolean) */ static final boolean SEARCH_HEAVYWEIGHTS = true; @@ -1036,7 +1036,7 @@ public class Container extends Component { * every add request to a container as all other add methods defer * to this one. An overriding method should * usually include a call to the superclass's version of the method: - *+ * *
*diff --git a/jdk/src/share/classes/java/awt/EventFilter.java b/jdk/src/share/classes/java/awt/EventFilter.java index 56c69dd050c..1c38467f010 100644 --- a/jdk/src/share/classes/java/awt/EventFilter.java +++ b/jdk/src/share/classes/java/awt/EventFilter.java @@ -28,20 +28,20 @@ interface EventFilter { /** * Enumeration for possible values forsuper.addImpl(comp, constraints, index)
*acceptEvent(AWTEvent ev)
method. - * @see EventDispatchThread#pumpEventsForFilters(EventFilter) + * @see EventDispatchThread#pumpEventsForFilter */ static enum FilterAction { /** * ACCEPT means that this filter do not filter the event and allowes other * active filters to proceed it. If all the active filters accept the event, it * is dispatched by theEventDispatchThread
- * @see EventDispatchThread#pumpEventsForFilters(EventFilter) + * @see EventDispatchThread#pumpEventsForFilter */ ACCEPT, /** * REJECT means that this filter filter the event. No other filters are queried, * and the event is not dispatched by theEventDispatchedThread
- * @see EventDispatchThread#pumpEventsForFilters(EventFilter) + * @see EventDispatchThread#pumpEventsForFilter */ REJECT, /** @@ -51,7 +51,7 @@ interface EventFilter { * It is not recommended to use ACCEPT_IMMEDIATELY as there may be some active * filters not queried yet that do not accept this event. It is primarily used * by modal filters. - * @see EventDispatchThread#pumpEventsForFilters(EventFilter) + * @see EventDispatchThread#pumpEventsForFilter * @see ModalEventFilter */ ACCEPT_IMMEDIATELY diff --git a/jdk/src/share/classes/java/awt/EventQueue.java b/jdk/src/share/classes/java/awt/EventQueue.java index af9e1bf08f3..efe0421f711 100644 --- a/jdk/src/share/classes/java/awt/EventQueue.java +++ b/jdk/src/share/classes/java/awt/EventQueue.java @@ -652,7 +652,7 @@ public class EventQueue { * Dispatches an event. The manner in which the event is * dispatched depends upon the type of the event and the * type of the event's source object: - *+ * *
*
* Event Type diff --git a/jdk/src/share/classes/java/awt/FileDialog.java b/jdk/src/share/classes/java/awt/FileDialog.java index 0fc63c7fde4..b693b9b8788 100644 --- a/jdk/src/share/classes/java/awt/FileDialog.java +++ b/jdk/src/share/classes/java/awt/FileDialog.java @@ -439,7 +439,6 @@ public class FileDialog extends Dialog { * Note that the method is private and it's intended to be used * by the peers through the AWTAccessor API. * - * @param directory the current directory * @param files the array that contains the short names of * all the files that the user selects. * diff --git a/jdk/src/share/classes/java/awt/FlowLayout.java b/jdk/src/share/classes/java/awt/FlowLayout.java index 4675bbc573e..9961c9bfdbb 100644 --- a/jdk/src/share/classes/java/awt/FlowLayout.java +++ b/jdk/src/share/classes/java/awt/FlowLayout.java @@ -57,7 +57,7 @@ import java.io.IOException; * style="float:center; margin: 7px 10px;"> ** Here is the code for this applet: - *
+ * *
* import java.awt.*; * import java.applet.Applet; @@ -129,9 +129,9 @@ public class FlowLayout implements LayoutManager, java.io.Serializable { * how each row distributes empty space. * It can be one of the following values: *- *
* * @serial @@ -146,11 +146,11 @@ public class FlowLayout implements LayoutManager, java.io.Serializable { * v1.2 and greater. * It can be one of the following three values: *LEFT
- *RIGHT
- *CENTER
+ *LEFT
+ *RIGHT
+ *CENTER
*- *
* * @serial diff --git a/jdk/src/share/classes/java/awt/Font.java b/jdk/src/share/classes/java/awt/Font.java index e6363c8c5b7..7f3657c4950 100644 --- a/jdk/src/share/classes/java/awt/Font.java +++ b/jdk/src/share/classes/java/awt/Font.java @@ -75,13 +75,13 @@ import static sun.font.EAttribute.*; * * A character is a symbol that represents an item such as a letter, * a digit, or punctuation in an abstract way. For example,LEFT
- *RIGHT
- *CENTER
- *LEADING
- *TRAILING
+ *LEFT
+ *RIGHT
+ *CENTER
+ *LEADING
+ *TRAILING
*'g'
, - * LATIN SMALL LETTER G, is a character. + * LATIN SMALL LETTER G, is a character. ** A glyph is a shape used to render a character or a sequence of * characters. In simple writing systems, such as Latin, typically one glyph * represents one character. In general, however, characters and glyphs do not * have one-to-one correspondence. For example, the character 'á' - * LATIN SMALL LETTER A WITH ACUTE, can be represented by + * LATIN SMALL LETTER A WITH ACUTE, can be represented by * two glyphs: one for 'a' and one for '´'. On the other hand, the * two-character string "fi" can be represented by a single glyph, an * "fi" ligature. In complex writing systems, such as Arabic or the South @@ -93,7 +93,7 @@ import static sun.font.EAttribute.*; * of characters as well as the tables needed to map sequences of characters to * corresponding sequences of glyphs. * - *
Physical and Logical Fonts
+ *Physical and Logical Fonts
* * The Java Platform distinguishes between two kinds of fonts: * physical fonts and logical fonts. @@ -130,7 +130,7 @@ import static sun.font.EAttribute.*; * Internationalization FAQ * document. * - *Font Faces and Names
+ *Font Faces and Names
* * AFont
* can have many faces, such as heavy, medium, oblique, gothic and @@ -160,7 +160,7 @@ import static sun.font.EAttribute.*; * with varying sizes, styles, transforms and font features via the *deriveFont
methods in this class. * - *Font and TextAttribute
+ *Font and TextAttribute
* *+ * a workaround. * *
Font
supports most *TextAttribute
s. This makes some operations, such as @@ -197,7 +197,7 @@ import static sun.font.EAttribute.*; * avoid this problem. Clients who use input method highlights can * convert these to the platform-specific attributes for that * highlight on the current platform and set them on the Font as - * a workaround.The
Map
-based constructor and *deriveFont
APIs ignore the FONT attribute, and it is @@ -1419,7 +1419,7 @@ public class Font implements java.io.Serializable * To ensure that this method returns the desired Font, * format thestr
parameter in * one of these ways - *+ * *
*
- fontname-style-pointsize *
- fontname-pointsize diff --git a/jdk/src/share/classes/java/awt/Graphics.java b/jdk/src/share/classes/java/awt/Graphics.java index 3e2dcb55008..c440b0a8fa1 100644 --- a/jdk/src/share/classes/java/awt/Graphics.java +++ b/jdk/src/share/classes/java/awt/Graphics.java @@ -39,7 +39,7 @@ import java.text.AttributedCharacterIterator; * A
Graphics
object encapsulates state information needed * for the basic rendering operations that Java supports. This * state information includes the following properties: - *+ * *
*
- The
Component
object on which to draw. *- A translation origin for rendering and clipping coordinates. @@ -63,7 +63,7 @@ import java.text.AttributedCharacterIterator; *
* The graphics pen hangs down and to the right from the path it traverses. * This has the following implications: - *
+ *
*
- If you draw a figure that covers a given rectangle, that * figure occupies one extra row of pixels on the right and bottom edges * as compared to filling a figure that is bounded by that same rectangle. @@ -136,7 +136,7 @@ public abstract class Graphics { * interpreted in the coordinate system of the original *
Graphics
object. The new graphics context is * identical to the original, except in two respects: - *+ * *
*
- * The new graphics context is translated by (x, y). diff --git a/jdk/src/share/classes/java/awt/GridBagConstraints.java b/jdk/src/share/classes/java/awt/GridBagConstraints.java index 3651b39be92..bf53b39b21f 100644 --- a/jdk/src/share/classes/java/awt/GridBagConstraints.java +++ b/jdk/src/share/classes/java/awt/GridBagConstraints.java @@ -457,7 +457,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * resize the component, and if so, how. *
* The following values are valid for
fill
: - *+ * *
*
- *
NONE
: Do not resize the component. diff --git a/jdk/src/share/classes/java/awt/GridBagLayout.java b/jdk/src/share/classes/java/awt/GridBagLayout.java index 8ac290a7a42..0b0f2bc5dea 100644 --- a/jdk/src/share/classes/java/awt/GridBagLayout.java +++ b/jdk/src/share/classes/java/awt/GridBagLayout.java @@ -55,7 +55,7 @@ import java.util.Arrays; * of theGridBagConstraints
objects that are associated * with its components. You customize aGridBagConstraints
* object by setting one or more of its instance variables: - *+ * *
*
- {@link GridBagConstraints#gridx}, * {@link GridBagConstraints#gridy} @@ -121,7 +121,7 @@ import java.util.Arrays; *
ComponentOrientation
property while absolute values * are not. Baseline relative values are calculated relative to the * baseline. Valid values are: - *+ * *
*
@@ -251,7 +251,7 @@ import java.util.Arrays; * managed by a grid bag layout. Figure 2 shows the layout for a horizontal, * left-to-right container and Figure 3 shows the layout for a horizontal, * right-to-left container. - * + * *
*
* @@ -270,7 +270,7 @@ import java.util.Arrays; * of its associated GridBagConstraints
object * set toGridBagConstraints.BOTH
. * In addition, the components have the following non-default constraints: - *+ * *
*
*- Button1, Button2, Button3:
weightx = 1.0
*- Button4:
weightx = 1.0
, @@ -285,7 +285,7 @@ import java.util.Arrays; ** Here is the code that implements the example shown above: - *
+ * *
* import java.awt.*; * import java.util.*; diff --git a/jdk/src/share/classes/java/awt/GridLayout.java b/jdk/src/share/classes/java/awt/GridLayout.java index 596208c3e65..ef506b025ef 100644 --- a/jdk/src/share/classes/java/awt/GridLayout.java +++ b/jdk/src/share/classes/java/awt/GridLayout.java @@ -32,7 +32,7 @@ package java.awt; * and one component is placed in each rectangle. * For example, the following is an applet that lays out six buttons * into three rows and two columns: - *+ * *
** import java.awt.*; @@ -54,7 +54,7 @@ package java.awt; * and left-to-right, the above example produces the output shown in Figure 1. * If the container'sComponentOrientation
property is horizontal * and right-to-left, the example produces the output shown in Figure 2. - *+ * *
*
* * For example, the code . . . - * + * *
* setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10)); * add(new Label("Hi There!")); diff --git a/jdk/src/share/classes/java/awt/LinearGradientPaint.java b/jdk/src/share/classes/java/awt/LinearGradientPaint.java index f4af6026da2..eed1f34333c 100644 --- a/jdk/src/share/classes/java/awt/LinearGradientPaint.java +++ b/jdk/src/share/classes/java/awt/LinearGradientPaint.java @@ -75,7 +75,6 @@ import java.beans.ConstructorProperties; ** The following code demonstrates typical usage of * {@code LinearGradientPaint}: - *
*
* Point2D start = new Point2D.Float(0, 0); * Point2D end = new Point2D.Float(50, 50); @@ -92,7 +91,6 @@ import java.beans.ConstructorProperties; ** This image demonstrates the example code above for each * of the three cycle methods: - *
*
* diff --git a/jdk/src/share/classes/java/awt/LinearGradientPaintContext.java b/jdk/src/share/classes/java/awt/LinearGradientPaintContext.java index c0da02bffa2..965e1484ec4 100644 --- a/jdk/src/share/classes/java/awt/LinearGradientPaintContext.java +++ b/jdk/src/share/classes/java/awt/LinearGradientPaintContext.java @@ -66,8 +66,8 @@ final class LinearGradientPaintContext extends MultipleGradientPaintContext { * concatenated with this) * @param hints the hints that the context object uses to choose * between rendering alternatives - * @param dStart gradient start point, in user space - * @param dEnd gradient end point, in user space + * @param start gradient start point, in user space + * @param end gradient end point, in user space * @param fractions the fractions specifying the gradient distribution * @param colors the gradient colors * @param cycleMethod either NO_CYCLE, REFLECT, or REPEAT diff --git a/jdk/src/share/classes/java/awt/List.java b/jdk/src/share/classes/java/awt/List.java index b3be9aeaf2e..754291809e6 100644 --- a/jdk/src/share/classes/java/awt/List.java +++ b/jdk/src/share/classes/java/awt/List.java @@ -41,7 +41,7 @@ import javax.accessibility.*; * the user can choose either one item or multiple items. * * For example, the code . . . - *
+ * *
* List lst = new List(4, false); * lst.add("Mercury"); @@ -1082,7 +1082,7 @@ public class List extends Component implements ItemSelectable, Accessible { * This method is not called unless item events are * enabled for this component. Item events are enabled * when one of the following occurs: - *+ *
*
- An
ItemListener
object is registered * viaaddItemListener
. *- Item events are enabled via
enableEvents
. @@ -1113,7 +1113,7 @@ public class List extends Component implements ItemSelectable, Accessible { * This method is not called unless action events are * enabled for this component. Action events are enabled * when one of the following occurs: - *+ *
*
- An
ActionListener
object is registered * viaaddActionListener
. *- Action events are enabled via
enableEvents
. diff --git a/jdk/src/share/classes/java/awt/MenuItem.java b/jdk/src/share/classes/java/awt/MenuItem.java index b660e20d96d..134469106a7 100644 --- a/jdk/src/share/classes/java/awt/MenuItem.java +++ b/jdk/src/share/classes/java/awt/MenuItem.java @@ -648,7 +648,7 @@ public class MenuItem extends MenuComponent implements Accessible { * This method is not called unless action events are * enabled for this component. Action events are enabled * when one of the following occurs: - *+ *
*
- An
ActionListener
object is registered * viaaddActionListener
. *- Action events are enabled via
enableEvents
. diff --git a/jdk/src/share/classes/java/awt/RadialGradientPaint.java b/jdk/src/share/classes/java/awt/RadialGradientPaint.java index 5fd08734f14..9f569f4f023 100644 --- a/jdk/src/share/classes/java/awt/RadialGradientPaint.java +++ b/jdk/src/share/classes/java/awt/RadialGradientPaint.java @@ -104,7 +104,6 @@ import java.beans.ConstructorProperties; * The following code demonstrates typical usage of * {@code RadialGradientPaint}, where the center and focus points are * the same: - **
* Point2D center = new Point2D.Float(50, 50); * float radius = 25; @@ -117,7 +116,6 @@ import java.beans.ConstructorProperties; ** This image demonstrates the example code above, with default * (centered) focus for each of the three cycle methods: - *
*
* @@ -126,7 +124,6 @@ import java.beans.ConstructorProperties; * * It is also possible to specify a non-centered focus point, as * in the following code: - *
*
* Point2D center = new Point2D.Float(50, 50); * float radius = 25; @@ -142,7 +139,6 @@ import java.beans.ConstructorProperties; ** This image demonstrates the previous example code, with non-centered * focus for each of the three cycle methods: - *
*
* diff --git a/jdk/src/share/classes/java/awt/Scrollbar.java b/jdk/src/share/classes/java/awt/Scrollbar.java index 9849480719d..0c980b3bf4b 100644 --- a/jdk/src/share/classes/java/awt/Scrollbar.java +++ b/jdk/src/share/classes/java/awt/Scrollbar.java @@ -46,7 +46,7 @@ import javax.accessibility.*; * * Each scroll bar in this example could be created with * code similar to the following: - *
+ * *
* redSlider=new Scrollbar(Scrollbar.VERTICAL, 0, 1, 0, 255); * add(redSlider); @@ -65,7 +65,7 @@ import javax.accessibility.*; * The value range represented by the bubble in this example * is the visible amount. The horizontal scroll bar * in this example could be created with code like the following: - *+ * *
* ranger = new Scrollbar(Scrollbar.HORIZONTAL, 0, 60, 0, 300); * add(ranger); @@ -103,7 +103,7 @@ import javax.accessibility.*; ** The
AdjustmentEvent
class defines five types * of adjustment event, listed here: - *+ * *
*
AdjustmentEvent.TRACK
is sent out when the * user drags the scroll bar's bubble. @@ -136,7 +136,7 @@ import javax.accessibility.*; * that are associated with scroll bars in previous platform versions. * The following list gives the adjustment event type, * and the corresponding JDK 1.0 event type it replaces. - *+ * *
*
AdjustmentEvent.TRACK
replaces *Event.SCROLL_ABSOLUTE
@@ -295,7 +295,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * Constructs a new vertical scroll bar. * The default properties of the scroll bar are listed in * the following table: - *+ * *
*
* Property @@ -1104,11 +1104,11 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * This method is not called unless adjustment events are * enabled for this component. Adjustment events are enabled * when one of the following occurs: - *+ *
**
- An
AdjustmentListener
object is registered * viaaddAdjustmentListener
. *- Adjustment events are enabled via
enableEvents
. - *+ *
Note that if the event parameter is
null
* the behavior is unspecified and may result in an * exception. diff --git a/jdk/src/share/classes/java/awt/SystemColor.java b/jdk/src/share/classes/java/awt/SystemColor.java index 931cf326fb5..ed5a26b4947 100644 --- a/jdk/src/share/classes/java/awt/SystemColor.java +++ b/jdk/src/share/classes/java/awt/SystemColor.java @@ -463,7 +463,7 @@ public final class SystemColor extends Color implements java.io.Serializable { } /** - * Called from& toolkit to update the above systemColors cache. + * Called from {@code } and toolkit to update the above systemColors cache. */ private static void updateSystemColors() { if (!GraphicsEnvironment.isHeadless()) { diff --git a/jdk/src/share/classes/java/awt/SystemTray.java b/jdk/src/share/classes/java/awt/SystemTray.java index 20ba912870c..58f3a0b2686 100644 --- a/jdk/src/share/classes/java/awt/SystemTray.java +++ b/jdk/src/share/classes/java/awt/SystemTray.java @@ -361,7 +361,7 @@ public class SystemTray { /** * Adds a {@code PropertyChangeListener} to the list of listeners for the * specific property. The following properties are currently supported: - * + * *
*
* Property diff --git a/jdk/src/share/classes/java/awt/TextArea.java b/jdk/src/share/classes/java/awt/TextArea.java index 6fc979f2835..0528c0addfe 100644 --- a/jdk/src/share/classes/java/awt/TextArea.java +++ b/jdk/src/share/classes/java/awt/TextArea.java @@ -45,7 +45,7 @@ import javax.accessibility.*; * style="float:center; margin: 7px 10px;"> ** This text area could be created by the following line of code: - *
+ * *
* new TextArea("Hello", 5, 40); *
diff --git a/jdk/src/share/classes/java/awt/TextField.java b/jdk/src/share/classes/java/awt/TextField.java index 85eaba2d17b..e7088218180 100644 --- a/jdk/src/share/classes/java/awt/TextField.java +++ b/jdk/src/share/classes/java/awt/TextField.java @@ -45,7 +45,7 @@ import javax.accessibility.*; * style="float:center; margin: 7px 10px;"> ** Here is the code that produces these four text fields: - *
+ * *
+ * + ** TextField tf1, tf2, tf3, tf4; * // a blank text field @@ -596,7 +596,7 @@ public class TextField extends TextComponent { * This method is not called unless action events are * enabled for this component. Action events are enabled * when one of the following occurs: - *+ *
*
- An
ActionListener
object is registered * viaaddActionListener
. *- Action events are enabled via
enableEvents
. diff --git a/jdk/src/share/classes/java/awt/Toolkit.java b/jdk/src/share/classes/java/awt/Toolkit.java index dcc1fa15b4e..e1f86f22e53 100644 --- a/jdk/src/share/classes/java/awt/Toolkit.java +++ b/jdk/src/share/classes/java/awt/Toolkit.java @@ -80,19 +80,19 @@ import sun.util.CoreResourceBundleControl; *
For example, callingScrollPane.setScrollPosition
* and thengetScrollPosition
may return an incorrect * value if the original request has not yet been processed. - *+ * *
- Moving the focus from one component to another. *
For more information, see * Timing * Focus Transfers, a section in * The Swing * Tutorial. - *+ * *
- Making a top-level container visible. *
CallingsetVisible(true)
on aWindow
, *Frame
orDialog
may occur * asynchronously. - *+ * *
- Setting the size or location of a top-level container. *
Calls tosetSize
,setBounds
or *setLocation
on aWindow
, diff --git a/jdk/src/share/classes/java/awt/WaitDispatchSupport.java b/jdk/src/share/classes/java/awt/WaitDispatchSupport.java index c9a671838a9..ac59d77855c 100644 --- a/jdk/src/share/classes/java/awt/WaitDispatchSupport.java +++ b/jdk/src/share/classes/java/awt/WaitDispatchSupport.java @@ -91,7 +91,7 @@ class WaitDispatchSupport implements SecondaryLoop { * * @param dispatchThread An event dispatch thread that * should not stop dispatching events while waiting - * @param extCondition A conditional object used to determine + * @param extCond A conditional object used to determine * if the loop should be terminated * * @since 1.7 @@ -161,7 +161,7 @@ class WaitDispatchSupport implements SecondaryLoop { } /** - * @inheritDoc + * {@inheritDoc} */ @Override public boolean enter() { @@ -281,7 +281,7 @@ class WaitDispatchSupport implements SecondaryLoop { } /** - * @inheritDoc + * {@inheritDoc} */ public boolean exit() { if (log.isLoggable(PlatformLogger.Level.FINE)) { diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java index ceb901a3c4b..13779fd4129 100644 --- a/jdk/src/share/classes/java/awt/Window.java +++ b/jdk/src/share/classes/java/awt/Window.java @@ -212,7 +212,7 @@ public class Window extends Container implements Accessible { * * @serial * @see #getIconImages - * @see #setIconImages(List extends Image>) + * @see #setIconImages */ transient java.util.Listicons; diff --git a/jdk/src/share/classes/java/awt/color/CMMException.java b/jdk/src/share/classes/java/awt/color/CMMException.java index 9aca938a307..04497f69cc4 100644 --- a/jdk/src/share/classes/java/awt/color/CMMException.java +++ b/jdk/src/share/classes/java/awt/color/CMMException.java @@ -27,7 +27,8 @@ * */ -/********************************************************************** +/* + ********************************************************************** ********************************************************************** ********************************************************************** *** COPYRIGHT (c) Eastman Kodak Company, 1997 *** diff --git a/jdk/src/share/classes/java/awt/color/ColorSpace.java b/jdk/src/share/classes/java/awt/color/ColorSpace.java index c0bcb4938c3..ac21273d415 100644 --- a/jdk/src/share/classes/java/awt/color/ColorSpace.java +++ b/jdk/src/share/classes/java/awt/color/ColorSpace.java @@ -23,7 +23,8 @@ * questions. */ -/********************************************************************** +/* + ********************************************************************** ********************************************************************** ********************************************************************** *** COPYRIGHT (c) Eastman Kodak Company, 1997 *** @@ -91,7 +92,6 @@ import sun.java2d.cmm.CMSManager; * - * * @see ICC_ColorSpace */ diff --git a/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java b/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java index ace7f3db3a9..53edefb5992 100644 --- a/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java +++ b/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java @@ -23,7 +23,8 @@ * questions. */ -/********************************************************************** +/* + ********************************************************************** ********************************************************************** ********************************************************************** *** COPYRIGHT (c) Eastman Kodak Company, 1997 *** @@ -77,7 +78,6 @@ import sun.java2d.cmm.PCMM; * imported images with a known color space. At most, such applets * would need to get one of the default color spaces via * ColorSpace.getInstance(). - *
* @see ColorSpace * @see ICC_Profile */ @@ -481,7 +481,6 @@ public class ICC_ColorSpace extends ColorSpace { * be the same as the media white point tag XYZ value in the ICC * profile for an sRGB device. *
- *
* @param colorvalue a float array with length of at least 3. * @return a float array with length equal to the number of * components in this ColorSpace. diff --git a/jdk/src/share/classes/java/awt/color/ICC_Profile.java b/jdk/src/share/classes/java/awt/color/ICC_Profile.java index 7e44947477d..89abeca03d6 100644 --- a/jdk/src/share/classes/java/awt/color/ICC_Profile.java +++ b/jdk/src/share/classes/java/awt/color/ICC_Profile.java @@ -23,7 +23,8 @@ * questions. */ -/********************************************************************** +/* + ********************************************************************** ********************************************************************** ********************************************************************** *** COPYRIGHT (c) Eastman Kodak Company, 1997 *** @@ -86,7 +87,6 @@ import java.security.PrivilegedAction; * ICC Profile Format Specification. Most profiles of interest * either have invertible transformations or explicitly specify * transformations going both directions. - *
* @see ICC_ColorSpace */ diff --git a/jdk/src/share/classes/java/awt/color/ICC_ProfileGray.java b/jdk/src/share/classes/java/awt/color/ICC_ProfileGray.java index a868a6f50fc..1b076a6f81a 100644 --- a/jdk/src/share/classes/java/awt/color/ICC_ProfileGray.java +++ b/jdk/src/share/classes/java/awt/color/ICC_ProfileGray.java @@ -23,7 +23,8 @@ * questions. */ -/********************************************************************** +/* + ********************************************************************** ********************************************************************** ********************************************************************** *** COPYRIGHT (c) Eastman Kodak Company, 1997 *** @@ -63,7 +64,6 @@ import sun.java2d.cmm.ProfileDeferralInfo; * The inverse transform is done by converting the PCS Y components to * device Gray via the inverse of the grayTRC. - *
*/ diff --git a/jdk/src/share/classes/java/awt/color/ICC_ProfileRGB.java b/jdk/src/share/classes/java/awt/color/ICC_ProfileRGB.java index dcf65828650..c26697a85d4 100644 --- a/jdk/src/share/classes/java/awt/color/ICC_ProfileRGB.java +++ b/jdk/src/share/classes/java/awt/color/ICC_ProfileRGB.java @@ -23,7 +23,8 @@ * questions. */ -/********************************************************************** +/* + ********************************************************************** ********************************************************************** ********************************************************************** *** COPYRIGHT (c) Eastman Kodak Company, 1997 *** @@ -82,7 +83,6 @@ import sun.java2d.cmm.ProfileDeferralInfo; * The inverse transform is performed by converting PCS XYZ components to linear * RGB components through the inverse of the above 3x3 matrix, and then converting * linear RGB to device RGB through inverses of the TRCs. - *
*/ @@ -111,7 +111,7 @@ extends ICC_Profile { /** * Constructs an new
ICC_ProfileRGB
from a CMM ID. * - * @param ID The CMM ID for the profile. + * @param p The CMM ID for the profile. * */ ICC_ProfileRGB(Profile p) { diff --git a/jdk/src/share/classes/java/awt/dnd/DnDEventMulticaster.java b/jdk/src/share/classes/java/awt/dnd/DnDEventMulticaster.java index 2e6c13a0551..a9d9e6587ff 100644 --- a/jdk/src/share/classes/java/awt/dnd/DnDEventMulticaster.java +++ b/jdk/src/share/classes/java/awt/dnd/DnDEventMulticaster.java @@ -71,7 +71,7 @@ class DnDEventMulticaster extends AWTEventMulticaster * Handles theDragSourceDragEvent
by invoking *dragOver
on listener-a and listener-b. * - * @param e theDragSourceDragEvent
+ * @param dsde theDragSourceDragEvent
*/ public void dragOver(DragSourceDragEvent dsde) { ((DragSourceListener)a).dragOver(dsde); diff --git a/jdk/src/share/classes/java/awt/dnd/DragSourceDropEvent.java b/jdk/src/share/classes/java/awt/dnd/DragSourceDropEvent.java index e1116bc68d5..25f7630dd76 100644 --- a/jdk/src/share/classes/java/awt/dnd/DragSourceDropEvent.java +++ b/jdk/src/share/classes/java/awt/dnd/DragSourceDropEvent.java @@ -37,7 +37,6 @@ package java.awt.dnd; * to provide appropriate feedback to the end user * when the operation completes. *- *
* @since 1.2 */ diff --git a/jdk/src/share/classes/java/awt/dnd/DropTarget.java b/jdk/src/share/classes/java/awt/dnd/DropTarget.java index 0480ba5f67e..ad672936078 100644 --- a/jdk/src/share/classes/java/awt/dnd/DropTarget.java +++ b/jdk/src/share/classes/java/awt/dnd/DropTarget.java @@ -197,7 +197,7 @@ public class DropTarget implements DropTargetListener, Serializable { *
* The Component will receive drops only if it is enabled. * @param c The new
Component
thisDropTarget
- * is to be associated with.+ * is to be associated with. */ public synchronized void setComponent(Component c) { @@ -246,7 +246,6 @@ public class DropTarget implements DropTargetListener, Serializable { * Sets the default acceptable actions for this
DropTarget
** @param ops the default actions - *
* @see java.awt.dnd.DnDConstants */ diff --git a/jdk/src/share/classes/java/awt/event/MouseAdapter.java b/jdk/src/share/classes/java/awt/event/MouseAdapter.java index b908a6626df..dfc16d9c8be 100644 --- a/jdk/src/share/classes/java/awt/event/MouseAdapter.java +++ b/jdk/src/share/classes/java/awt/event/MouseAdapter.java @@ -49,7 +49,7 @@ package java.awt.event; * methods. * The relevant method in the listener object is invoked and the {@code MouseEvent} * or {@code MouseWheelEvent} is passed to it in following cases: - *
+ *
*
- when a mouse button is pressed, released, or clicked (pressed and released) *
- when the mouse cursor enters or exits the component *
- when the mouse wheel rotated, or mouse moved or dragged diff --git a/jdk/src/share/classes/java/awt/font/FontRenderContext.java b/jdk/src/share/classes/java/awt/font/FontRenderContext.java index f9f5f1eec79..240ea895320 100644 --- a/jdk/src/share/classes/java/awt/font/FontRenderContext.java +++ b/jdk/src/share/classes/java/awt/font/FontRenderContext.java @@ -57,7 +57,6 @@ import java.awt.geom.AffineTransform; *
FontRenderContext
which is directly constructed will * most likely not represent any actual graphics device, and may lead * to unexpected or incorrect results. -** @see java.awt.RenderingHints#KEY_TEXT_ANTIALIASING * @see java.awt.RenderingHints#KEY_FRACTIONALMETRICS * @see java.awt.Graphics2D#getFontRenderContext() diff --git a/jdk/src/share/classes/java/awt/font/StyledParagraph.java b/jdk/src/share/classes/java/awt/font/StyledParagraph.java index df231bf5300..e0447dfcf3b 100644 --- a/jdk/src/share/classes/java/awt/font/StyledParagraph.java +++ b/jdk/src/share/classes/java/awt/font/StyledParagraph.java @@ -322,7 +322,7 @@ final class StyledParagraph { } /** - * Return i such that starts[i] <= index < starts[i+1]. starts + * Return i such that starts[i] <= index < starts[i+1]. starts * must be in increasing order, with at least one element greater * than index. */ diff --git a/jdk/src/share/classes/java/awt/geom/AffineTransform.java b/jdk/src/share/classes/java/awt/geom/AffineTransform.java index d3c27ffa87e..494e3c8e31f 100644 --- a/jdk/src/share/classes/java/awt/geom/AffineTransform.java +++ b/jdk/src/share/classes/java/awt/geom/AffineTransform.java @@ -46,8 +46,7 @@ import java.beans.ConstructorProperties; * [ y'] = [ m10 m11 m12 ] [ y ] = [ m10x + m11y + m12 ] * [ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ] * - *
- *
Handling 90-Degree Rotations
+ *Handling 90-Degree Rotations
** In some variations of the
rotate
methods in the *AffineTransform
class, a double-precision argument diff --git a/jdk/src/share/classes/java/awt/geom/QuadCurve2D.java b/jdk/src/share/classes/java/awt/geom/QuadCurve2D.java index a2c41d91fae..56d435f0f5d 100644 --- a/jdk/src/share/classes/java/awt/geom/QuadCurve2D.java +++ b/jdk/src/share/classes/java/awt/geom/QuadCurve2D.java @@ -1047,7 +1047,7 @@ public abstract class QuadCurve2D implements Shape, Cloneable { /** * Evaluate the t values in the first num slots of the vals[] array * and place the evaluated values back into the same array. Only - * evaluate t values that are within the range <0, 1>, including + * evaluate t values that are within the range <0, 1>, including * the 0 and 1 ends of the range iff the include0 or include1 * booleans are true. If an "inflection" equation is handed in, * then any points which represent a point of inflection for that @@ -1081,7 +1081,7 @@ public abstract class QuadCurve2D implements Shape, Cloneable { /** * Determine where coord lies with respect to the range from - * low to high. It is assumed that low <= high. The return + * low to high. It is assumed that low <= high. The return * value is one of the 5 values BELOW, LOWEDGE, INSIDE, HIGHEDGE, * or ABOVE. */ diff --git a/jdk/src/share/classes/java/awt/image/BufferStrategy.java b/jdk/src/share/classes/java/awt/image/BufferStrategy.java index 7a4f793b791..1bd882c1573 100644 --- a/jdk/src/share/classes/java/awt/image/BufferStrategy.java +++ b/jdk/src/share/classes/java/awt/image/BufferStrategy.java @@ -54,7 +54,6 @@ import java.awt.Image; ** Alternatively, the contents of the back buffer can be copied, or * blitted forward in a chain instead of moving the video pointer. - *
*
{@code * Double buffering: * diff --git a/jdk/src/share/classes/java/awt/image/BufferedImage.java b/jdk/src/share/classes/java/awt/image/BufferedImage.java index 811c209a983..df968838d7c 100644 --- a/jdk/src/share/classes/java/awt/image/BufferedImage.java +++ b/jdk/src/share/classes/java/awt/image/BufferedImage.java @@ -927,7 +927,6 @@ public class BufferedImage extends java.awt.Image * each color component in the returned data when * using this method. With a specified coordinate (x, y) in the * image, the ARGB pixel can be accessed in this way: - *** *
* pixel = rgbArray[offset + (y-startY)*scansize + (x-startX)];diff --git a/jdk/src/share/classes/java/awt/image/ColorConvertOp.java b/jdk/src/share/classes/java/awt/image/ColorConvertOp.java index 7ba11582be9..712eae48269 100644 --- a/jdk/src/share/classes/java/awt/image/ColorConvertOp.java +++ b/jdk/src/share/classes/java/awt/image/ColorConvertOp.java @@ -23,7 +23,8 @@ * questions. */ -/********************************************************************** +/* + ********************************************************************** ********************************************************************** ********************************************************************** *** COPYRIGHT (c) Eastman Kodak Company, 1997 *** @@ -64,7 +65,6 @@ import java.awt.RenderingHints; * color conversion. ** Note that Source and Destination may be the same object. - *
* @see java.awt.RenderingHints#KEY_COLOR_RENDERING * @see java.awt.RenderingHints#KEY_DITHERING */ diff --git a/jdk/src/share/classes/java/awt/peer/CheckboxPeer.java b/jdk/src/share/classes/java/awt/peer/CheckboxPeer.java index fb4c4e6608a..abdbec9fa68 100644 --- a/jdk/src/share/classes/java/awt/peer/CheckboxPeer.java +++ b/jdk/src/share/classes/java/awt/peer/CheckboxPeer.java @@ -41,7 +41,7 @@ public interface CheckboxPeer extends ComponentPeer { * Sets the state of the checkbox to be checked ({@code true}) or * unchecked ({@code false}). * - * @param t the state to set on the checkbox + * @param state the state to set on the checkbox * * @see Checkbox#setState(boolean) */ diff --git a/jdk/src/share/classes/java/awt/peer/DesktopPeer.java b/jdk/src/share/classes/java/awt/peer/DesktopPeer.java index 72a87eccea8..48603d6c517 100644 --- a/jdk/src/share/classes/java/awt/peer/DesktopPeer.java +++ b/jdk/src/share/classes/java/awt/peer/DesktopPeer.java @@ -87,7 +87,7 @@ public interface DesktopPeer { * filling the message fields including to, cc, etc, with the values * specified by the given mailto URL. * - * @param uri represents a mailto URL with specified values of the message. + * @param mailtoURL represents a mailto URL with specified values of the message. * The syntax of mailto URL is defined by * RFC2368: The mailto * URL scheme @@ -103,5 +103,5 @@ public interface DesktopPeer { * @throws IOException If the user default browser is not found, * or it fails to be launched. */ - void browse(URI url) throws IOException; + void browse(URI uri) throws IOException; } diff --git a/jdk/src/share/classes/java/io/BufferedReader.java b/jdk/src/share/classes/java/io/BufferedReader.java index 98fe47c7a59..ee9f66a4231 100644 --- a/jdk/src/share/classes/java/io/BufferedReader.java +++ b/jdk/src/share/classes/java/io/BufferedReader.java @@ -533,7 +533,7 @@ public class BufferedReader extends Reader { /** * Returns a {@code Stream}, the elements of which are lines read from * this {@code BufferedReader}. The {@link Stream} is lazily populated, - * i.e, read only occurs during the + * i.e., read only occurs during the * terminal * stream operation. * @@ -550,8 +550,8 @@ public class BufferedReader extends Reader { * UncheckedIOException} which will be thrown from the {@code Stream} * method that caused the read to take place. This method will return a * Stream if invoked on a BufferedReader that is closed. Any operation on - * that stream requires reading from the BufferedReader after is it closed - * will cause an UncheckedIOException to be thrown. + * that stream that requires reading from the BufferedReader after it is + * closed, will cause an UncheckedIOException to be thrown. * * @return a {@code Stream
} providing the lines of text * described by this {@code BufferedReader} @@ -587,6 +587,7 @@ public class BufferedReader extends Reader { } } }; - return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iter, Spliterator.ORDERED), false); + return StreamSupport.stream(Spliterators.spliteratorUnknownSize( + iter, Spliterator.ORDERED | Spliterator.NONNULL), false); } } diff --git a/jdk/src/share/classes/java/lang/CharSequence.java b/jdk/src/share/classes/java/lang/CharSequence.java index a74a9d0d424..4d9ab3f7bc1 100644 --- a/jdk/src/share/classes/java/lang/CharSequence.java +++ b/jdk/src/share/classes/java/lang/CharSequence.java @@ -87,7 +87,7 @@ public interface CharSequence { char charAt(int index); /** - * Returns a new CharSequence
that is a subsequence of this sequence. + * Returns aCharSequence
that is a subsequence of this sequence. * The subsequence starts with thechar
value at the specified index and * ends with thechar
value at index end - 1. The length * (inchar
s) of the diff --git a/jdk/src/share/classes/java/lang/Class.java b/jdk/src/share/classes/java/lang/Class.java index 45c00913f6c..ea47cca2fca 100644 --- a/jdk/src/share/classes/java/lang/Class.java +++ b/jdk/src/share/classes/java/lang/Class.java @@ -1565,8 +1565,12 @@ public final class Classimplements java.io.Serializable, * methods inherited by the array type from {@code Object}. It does not * contain a {@code Method} object for {@code clone()}. * - * If this {@code Class} object represents a class or interface with no - * public methods, then the returned array has length 0. + *
If this {@code Class} object represents an interface then the + * returned array does not contain any implicitly declared methods from + * {@code Object}. Therefore, if no methods are explicitly declared in + * this interface or any of its superinterfaces then the returned array + * has length 0. (Note that a {@code Class} object which represents a class + * always has public methods, inherited from {@code Object}.) * *
If this {@code Class} object represents a primitive type or void, * then the returned array has length 0. @@ -1699,25 +1703,29 @@ public final class Class
implements java.io.Serializable, * order. If {@code parameterTypes} is {@code null}, it is * treated as if it were an empty array. * - * If the {@code name} is "{@code
};"or "{@code }" a + * If the {@code name} is "{@code
}" or "{@code }" a * {@code NoSuchMethodException} is raised. Otherwise, the method to * be reflected is determined by the algorithm that follows. Let C be the - * class represented by this object: + * class or interface represented by this object: * - *
* - * To find a matching method in a class C: If C declares exactly one - * public method with the specified name and exactly the same formal - * parameter types, that is the method reflected. If more than one such - * method is found in C, and one of these methods has a return type that is - * more specific than any of the others, that method is reflected; - * otherwise one of the methods is chosen arbitrarily. + *- C is searched for any matching methods. If no matching - * method is found, the algorithm of step 1 is invoked recursively on - * the superclass of C.
- *- If no method was found in step 1 above, the superinterfaces of C - * are searched for a matching method. If any such method is found, it - * is reflected.
+ *- C is searched for a matching method, as defined below. If a + * matching method is found, it is reflected.
+ *- If no matching method is found by step 1 then: + *
*+ *
- If C is a class other than {@code Object}, then this algorithm is + * invoked recursively on the superclass of C.
+ *- If C is the class {@code Object}, or if C is an interface, then + * the superinterfaces of C (if any) are searched for a matching + * method. If any such method is found, it is reflected.
+ *To find a matching method in a class or interface C: If C + * declares exactly one public method with the specified name and exactly + * the same formal parameter types, that is the method reflected. If more + * than one such method is found in C, and one of these methods has a + * return type that is more specific than any of the others, that method is + * reflected; otherwise one of the methods is chosen arbitrarily. * *
Note that there may be more than one matching method in a * class because while the Java language forbids a class to diff --git a/jdk/src/share/classes/java/lang/String.java b/jdk/src/share/classes/java/lang/String.java index 4efec83389a..6565f6434e8 100644 --- a/jdk/src/share/classes/java/lang/String.java +++ b/jdk/src/share/classes/java/lang/String.java @@ -1958,7 +1958,7 @@ public final class String } /** - * Returns a new character sequence that is a subsequence of this sequence. + * Returns a character sequence that is a subsequence of this sequence. * *
An invocation of this method of the form * diff --git a/jdk/src/share/classes/java/lang/doc-files/ValueBased.html b/jdk/src/share/classes/java/lang/doc-files/ValueBased.html new file mode 100644 index 00000000000..7e1ee8bbf2c --- /dev/null +++ b/jdk/src/share/classes/java/lang/doc-files/ValueBased.html @@ -0,0 +1,42 @@ + + +
+Value-based Classes + + + +Value-based Classes
+ +Some classes, such asjava.util.Optional
and +java.time.LocalDateTime
, are value-based. Instances of a +value-based class: ++
+ +- are final and immutable (though may contain references to mutable + objects);
+- have implementations of
+equals
, +hashCode
, andtoString
which are computed + solely from the instance's state and not from its identity or the state + of any other object or variable;- make no use of identity-sensitive operations such as reference + equality (
+==
) between instances, identity hash code of + instances, or synchronization on an instances's intrinsic lock;- are considered equal solely based on
+equals()
, not + based on reference equality (==
);- do not have accessible constructors, but are instead instantiated + through factory methods which make no committment as to the identity + of returned instances;
+- are freely substitutable when equal, meaning that interchanging + any two instances
+x
andy
that are equal + according toequals()
in any computation or method + invocation should produce no visible change in behavior. +A program may produce unpredictable results if it attempts to distinguish two + references to equal values of a value-based class, whether directly via reference + equality or indirectly via an appeal to synchronization, identity hashing, + serialization, or any other identity-sensitive mechanism. Use of such + identity-sensitive operations on instances of value-based classes may have + unpredictable effects and should be avoided.
+ + diff --git a/jdk/src/share/classes/java/math/BigInteger.java b/jdk/src/share/classes/java/math/BigInteger.java index 5fab7443295..79291ee34d2 100644 --- a/jdk/src/share/classes/java/math/BigInteger.java +++ b/jdk/src/share/classes/java/math/BigInteger.java @@ -215,7 +215,7 @@ public class BigInteger extends Number implements Comparable{ * Karatsuba multiplication will be used. This value is found * experimentally to work well. */ - private static final int KARATSUBA_THRESHOLD = 50; + private static final int KARATSUBA_THRESHOLD = 80; /** * The threshold value for using 3-way Toom-Cook multiplication. @@ -224,7 +224,7 @@ public class BigInteger extends Number implements Comparable { * the mag arrays is greater than this threshold, then Toom-Cook * multiplication will be used. */ - private static final int TOOM_COOK_THRESHOLD = 75; + private static final int TOOM_COOK_THRESHOLD = 240; /** * The threshold value for using Karatsuba squaring. If the number @@ -232,7 +232,7 @@ public class BigInteger extends Number implements Comparable { * Karatsuba squaring will be used. This value is found * experimentally to work well. */ - private static final int KARATSUBA_SQUARE_THRESHOLD = 90; + private static final int KARATSUBA_SQUARE_THRESHOLD = 128; /** * The threshold value for using Toom-Cook squaring. If the number @@ -240,15 +240,23 @@ public class BigInteger extends Number implements Comparable { * Toom-Cook squaring will be used. This value is found * experimentally to work well. */ - private static final int TOOM_COOK_SQUARE_THRESHOLD = 140; + private static final int TOOM_COOK_SQUARE_THRESHOLD = 216; /** * The threshold value for using Burnikel-Ziegler division. If the number - * of ints in the number are larger than this value, - * Burnikel-Ziegler division will be used. This value is found - * experimentally to work well. + * of ints in the divisor are larger than this value, Burnikel-Ziegler + * division may be used. This value is found experimentally to work well. */ - static final int BURNIKEL_ZIEGLER_THRESHOLD = 50; + static final int BURNIKEL_ZIEGLER_THRESHOLD = 80; + + /** + * The offset value for using Burnikel-Ziegler division. If the number + * of ints in the divisor exceeds the Burnikel-Ziegler threshold, and the + * number of ints in the dividend is greater than the number of ints in the + * divisor plus this value, Burnikel-Ziegler division will be used. This + * value is found experimentally to work well. + */ + static final int BURNIKEL_ZIEGLER_OFFSET = 40; /** * The threshold value for using Schoenhage recursive base conversion. If @@ -258,7 +266,7 @@ public class BigInteger extends Number implements Comparable { * relatively flat for thresholds between 2-25, so this choice may be * varied within this range for very small effect. */ - private static final int SCHOENHAGE_BASE_CONVERSION_THRESHOLD = 8; + private static final int SCHOENHAGE_BASE_CONVERSION_THRESHOLD = 20; //Constructors @@ -1815,7 +1823,7 @@ public class BigInteger extends Number implements Comparable { int len = mag.length; if (len <= n) { - return this; + return abs(); } int lowerInts[] = new int[n]; @@ -2017,8 +2025,8 @@ public class BigInteger extends Number implements Comparable { * @throws ArithmeticException if {@code val} is zero. */ public BigInteger divide(BigInteger val) { - if (mag.length < BURNIKEL_ZIEGLER_THRESHOLD || - val.mag.length < BURNIKEL_ZIEGLER_THRESHOLD) { + if (val.mag.length < BURNIKEL_ZIEGLER_THRESHOLD || + mag.length - val.mag.length < BURNIKEL_ZIEGLER_OFFSET) { return divideKnuth(val); } else { return divideBurnikelZiegler(val); @@ -2054,8 +2062,8 @@ public class BigInteger extends Number implements Comparable { * @throws ArithmeticException if {@code val} is zero. */ public BigInteger[] divideAndRemainder(BigInteger val) { - if (mag.length < BURNIKEL_ZIEGLER_THRESHOLD || - val.mag.length < BURNIKEL_ZIEGLER_THRESHOLD) { + if (val.mag.length < BURNIKEL_ZIEGLER_THRESHOLD || + mag.length - val.mag.length < BURNIKEL_ZIEGLER_OFFSET) { return divideAndRemainderKnuth(val); } else { return divideAndRemainderBurnikelZiegler(val); @@ -2083,8 +2091,8 @@ public class BigInteger extends Number implements Comparable { * @throws ArithmeticException if {@code val} is zero. */ public BigInteger remainder(BigInteger val) { - if (mag.length < BURNIKEL_ZIEGLER_THRESHOLD || - val.mag.length < BURNIKEL_ZIEGLER_THRESHOLD) { + if (val.mag.length < BURNIKEL_ZIEGLER_THRESHOLD || + mag.length - val.mag.length < BURNIKEL_ZIEGLER_OFFSET) { return remainderKnuth(val); } else { return remainderBurnikelZiegler(val); diff --git a/jdk/src/share/classes/java/math/MutableBigInteger.java b/jdk/src/share/classes/java/math/MutableBigInteger.java index bc4e4841344..5bb5c37d9d7 100644 --- a/jdk/src/share/classes/java/math/MutableBigInteger.java +++ b/jdk/src/share/classes/java/math/MutableBigInteger.java @@ -1148,8 +1148,8 @@ class MutableBigInteger { } MutableBigInteger divide(MutableBigInteger b, MutableBigInteger quotient, boolean needRemainder) { - if (intLen < BigInteger.BURNIKEL_ZIEGLER_THRESHOLD || - b.intLen < BigInteger.BURNIKEL_ZIEGLER_THRESHOLD) { + if (b.intLen < BigInteger.BURNIKEL_ZIEGLER_THRESHOLD || + intLen - b.intLen < BigInteger.BURNIKEL_ZIEGLER_OFFSET) { return divideKnuth(b, quotient, needRemainder); } else { return divideAndRemainderBurnikelZiegler(b, quotient); diff --git a/jdk/src/share/classes/java/security/Provider.java b/jdk/src/share/classes/java/security/Provider.java index 0d5309ca32e..7e3def8f516 100644 --- a/jdk/src/share/classes/java/security/Provider.java +++ b/jdk/src/share/classes/java/security/Provider.java @@ -336,6 +336,8 @@ public abstract class Provider extends Properties { * if a security manager exists and its {@link * java.lang.SecurityManager#checkSecurityAccess} method * denies access to set property values. + * + * @since 1.8 */ @Override public synchronized Object putIfAbsent(Object key, Object value) { @@ -385,6 +387,8 @@ public abstract class Provider extends Properties { * if a security manager exists and its {@link * java.lang.SecurityManager#checkSecurityAccess} method * denies access to remove this provider's properties. + * + * @since 1.8 */ @Override public synchronized boolean remove(Object key, Object value) { @@ -408,6 +412,8 @@ public abstract class Provider extends Properties { * if a security manager exists and its {@link * java.lang.SecurityManager#checkSecurityAccess} method * denies access to set property values. + * + * @since 1.8 */ @Override public synchronized boolean replace(Object key, Object oldValue, @@ -433,6 +439,8 @@ public abstract class Provider extends Properties { * if a security manager exists and its {@link * java.lang.SecurityManager#checkSecurityAccess} method * denies access to set property values. + * + * @since 1.8 */ @Override public synchronized Object replace(Object key, Object value) { @@ -459,6 +467,8 @@ public abstract class Provider extends Properties { * if a security manager exists and its {@link * java.lang.SecurityManager#checkSecurityAccess} method * denies access to set property values. + * + * @since 1.8 */ @Override public synchronized void replaceAll(BiFunction super Object, ? super Object, ? extends Object> function) { @@ -485,6 +495,8 @@ public abstract class Provider extends Properties { * if a security manager exists and its {@link * java.lang.SecurityManager#checkSecurityAccess} method * denies access to set property values or remove properties. + * + * @since 1.8 */ @Override public synchronized Object compute(Object key, @@ -514,6 +526,8 @@ public abstract class Provider extends Properties { * if a security manager exists and its {@link * java.lang.SecurityManager#checkSecurityAccess} method * denies access to set property values and remove properties. + * + * @since 1.8 */ @Override public synchronized Object computeIfAbsent(Object key, Function super Object, ? extends Object> mappingFunction) { @@ -541,6 +555,8 @@ public abstract class Provider extends Properties { * if a security manager exists and its {@link * java.lang.SecurityManager#checkSecurityAccess} method * denies access to set property values or remove properties. + * + * @since 1.8 */ @Override public synchronized Object computeIfPresent(Object key, BiFunction super Object, ? super Object, ? extends Object> remappingFunction) { @@ -571,6 +587,8 @@ public abstract class Provider extends Properties { * if a security manager exists and its {@link * java.lang.SecurityManager#checkSecurityAccess} method * denies access to set property values or remove properties. + * + * @since 1.8 */ @Override public synchronized Object merge(Object key, Object value, BiFunction super Object, ? super Object, ? extends Object> remappingFunction) { @@ -589,13 +607,18 @@ public abstract class Provider extends Properties { checkInitialized(); return super.get(key); } - + /** + * @since 1.8 + */ @Override public synchronized Object getOrDefault(Object key, Object defaultValue) { checkInitialized(); return super.getOrDefault(key, defaultValue); } + /** + * @since 1.8 + */ @Override public synchronized void forEach(BiConsumer super Object, ? super Object> action) { checkInitialized(); diff --git a/jdk/src/share/classes/java/sql/CallableStatement.java b/jdk/src/share/classes/java/sql/CallableStatement.java index 9e593ae32db..a830b63ea8b 100644 --- a/jdk/src/share/classes/java/sql/CallableStatement.java +++ b/jdk/src/share/classes/java/sql/CallableStatement.java @@ -1108,7 +1108,7 @@ public interface CallableStatement extends PreparedStatement { * parameter; if a database access error occurs or * this method is called on a closed CallableStatement
* @exception SQLFeatureNotSupportedException if - * the JDBC driver does not support this data type + * the JDBC driver does not support the specified targetSqlType * @see Types * @see #getObject * @since 1.4 @@ -1131,7 +1131,7 @@ public interface CallableStatement extends PreparedStatement { * parameter; if a database access error occurs or * this method is called on a closedCallableStatement
* @exception SQLFeatureNotSupportedException if - * the JDBC driver does not support this data type + * the JDBC driver does not support the specified targetSqlType * @see #getObject * @since 1.4 */ @@ -2536,7 +2536,7 @@ public interface CallableStatement extends PreparedStatement { * or Reader object and the value of the scale parameter is less * than zero * @exception SQLFeatureNotSupportedException if - * the JDBC driver does not support this data type + * the JDBC driver does not support the specified targetSqlType * @see JDBCType * @see SQLType * @@ -2562,7 +2562,7 @@ public interface CallableStatement extends PreparedStatement { * parameter; if a database access error occurs * or this method is called on a closed {@code CallableStatement} * @exception SQLFeatureNotSupportedException if - * the JDBC driver does not support this data type + * the JDBC driver does not support the specified targetSqlType * @see JDBCType * @see SQLType * @since 1.8 @@ -2603,7 +2603,7 @@ public interface CallableStatement extends PreparedStatement { * if a database access error occurs or * this method is called on a closed {@code CallableStatement} * @exception SQLFeatureNotSupportedException if - * the JDBC driver does not support this data type + * the JDBC driver does not support the specified sqlType * @see JDBCType * @see SQLType * @since 1.8 @@ -2639,7 +2639,7 @@ public interface CallableStatement extends PreparedStatement { * if a database access error occurs or * this method is called on a closed {@code CallableStatement} * @exception SQLFeatureNotSupportedException if - * the JDBC driver does not support this data type + * the JDBC driver does not support the specified sqlType * @see JDBCType * @see SQLType * @since 1.8 @@ -2686,7 +2686,7 @@ public interface CallableStatement extends PreparedStatement { * if a database access error occurs or * this method is called on a closed {@code CallableStatement} * @exception SQLFeatureNotSupportedException if - * the JDBC driver does not support this data type + * the JDBC driver does not support the specified sqlType * @see JDBCType * @see SQLType * @since 1.8 @@ -2725,7 +2725,7 @@ public interface CallableStatement extends PreparedStatement { * parameter; if a database access error occurs or * this method is called on a closed {@code CallableStatement} * @exception SQLFeatureNotSupportedException if - * the JDBC driver does not support this data type + * the JDBC driver does not support the specified sqlType * or if the JDBC driver does not support * this method * @since 1.8 @@ -2762,7 +2762,7 @@ public interface CallableStatement extends PreparedStatement { * parameter; if a database access error occurs or * this method is called on a closed {@code CallableStatement} * @exception SQLFeatureNotSupportedException if - * the JDBC driver does not support this data type + * the JDBC driver does not support the specified sqlType * or if the JDBC driver does not support * this method * @since 1.8 @@ -2811,7 +2811,7 @@ public interface CallableStatement extends PreparedStatement { * parameter; if a database access error occurs or * this method is called on a closed {@code CallableStatement} * @exception SQLFeatureNotSupportedException if - * the JDBC driver does not support this data type + * the JDBC driver does not support the specified sqlType * or if the JDBC driver does not support this method * @see JDBCType * @see SQLType diff --git a/jdk/src/share/classes/java/sql/DriverManager.java b/jdk/src/share/classes/java/sql/DriverManager.java index 53b4762d562..a9190a4851e 100644 --- a/jdk/src/share/classes/java/sql/DriverManager.java +++ b/jdk/src/share/classes/java/sql/DriverManager.java @@ -213,8 +213,8 @@ public class DriverManager { * TheDriverManager
attempts to select an appropriate driver from * the set of registered JDBC drivers. *- * Note: If a property is specified as part of the {@code url} and - * is also specified in the {@code Properties} object, it is + * Note: If the {@code user} or {@code password} property are + * also specified as part of the {@code url}, it is * implementation-defined as to which value will take precedence. * For maximum portability, an application should only specify a * property once. @@ -320,7 +320,7 @@ public class DriverManager { * Registers the given driver with the {@code DriverManager}. * A newly-loaded driver class should call * the method {@code registerDriver} to make itself - * known to the {@code DriverManager}. If the driver had previously been + * known to the {@code DriverManager}. If the driver is currently * registered, no action is taken. * * @param driver the new JDBC Driver that is to be registered with the @@ -338,7 +338,7 @@ public class DriverManager { * Registers the given driver with the {@code DriverManager}. * A newly-loaded driver class should call * the method {@code registerDriver} to make itself - * known to the {@code DriverManager}. If the driver had previously been + * known to the {@code DriverManager}. If the driver is currently * registered, no action is taken. * * @param driver the new JDBC Driver that is to be registered with the @@ -347,6 +347,7 @@ public class DriverManager { * {@code DriverManager#deregisterDriver} is called * @exception SQLException if a database access error occurs * @exception NullPointerException if {@code driver} is null + * @since 1.8 */ public static synchronized void registerDriver(java.sql.Driver driver, DriverAction da) diff --git a/jdk/src/share/classes/java/sql/JDBCType.java b/jdk/src/share/classes/java/sql/JDBCType.java index 74ee8e01682..89db37bbf59 100644 --- a/jdk/src/share/classes/java/sql/JDBCType.java +++ b/jdk/src/share/classes/java/sql/JDBCType.java @@ -218,8 +218,8 @@ public enum JDBCType implements SQLType { } /** - * Returns the name of the data type. - * @return The name of the data type. + *{@inheritDoc } + * @return The name of this {@code SQLType}. */ public String getName() { return name(); diff --git a/jdk/src/share/classes/java/sql/PreparedStatement.java b/jdk/src/share/classes/java/sql/PreparedStatement.java index 20cde7fb985..2b2e7f3374b 100644 --- a/jdk/src/share/classes/java/sql/PreparedStatement.java +++ b/jdk/src/share/classes/java/sql/PreparedStatement.java @@ -401,7 +401,7 @@ public interface PreparedStatement extends Statement { * marker in the SQL statement; if a database access error occurs or this * method is called on a closed PreparedStatement * @exception SQLFeatureNotSupportedException if - * the JDBC driver does not support this data type + * the JDBC driver does not support the specified targetSqlType * @see Types */ void setObject(int parameterIndex, Object x, int targetSqlType) @@ -951,7 +951,7 @@ public interface PreparedStatement extends Statement { * or Reader object and the value of the scale parameter is less * than zero * @exception SQLFeatureNotSupportedException if - * the JDBC driver does not support this data type + * the JDBC driver does not support the specified targetSqlType * @see Types * */ @@ -1255,7 +1255,7 @@ public interface PreparedStatement extends Statement { * or Reader object and the value of the scale parameter is less * than zero * @exception SQLFeatureNotSupportedException if - * the JDBC driver does not support this data type + * the JDBC driver does not support the specified targetSqlType * @see JDBCType * @see SQLType * @since 1.8 @@ -1281,7 +1281,7 @@ public interface PreparedStatement extends Statement { * parameter marker in the SQL statement; if a database access error occurs * or this method is called on a closed {@code PreparedStatement} * @exception SQLFeatureNotSupportedException if - * the JDBC driver does not support this data type + * the JDBC driver does not support the specified targetSqlType * @see JDBCType * @see SQLType * @since 1.8 diff --git a/jdk/src/share/classes/java/sql/ResultSet.java b/jdk/src/share/classes/java/sql/ResultSet.java index 5ac61d1d4c1..d939a9a582e 100644 --- a/jdk/src/share/classes/java/sql/ResultSet.java +++ b/jdk/src/share/classes/java/sql/ResultSet.java @@ -4178,7 +4178,7 @@ public interface ResultSet extends Wrapper, AutoCloseable { * the result set concurrency is {@code CONCUR_READ_ONLY} * or this method is called on a closed result set * @exception SQLFeatureNotSupportedException if the JDBC driver does not - * support this method; if the JDBC driver does not support this data type + * support this method; if the JDBC driver does not support the specified targetSqlType * @see JDBCType * @see SQLType * @since 1.8 @@ -4221,7 +4221,7 @@ public interface ResultSet extends Wrapper, AutoCloseable { * the result set concurrency is {@code CONCUR_READ_ONLY} * or this method is called on a closed result set * @exception SQLFeatureNotSupportedException if the JDBC driver does not - * support this method; if the JDBC driver does not support this data type + * support this method; if the JDBC driver does not support the specified targetSqlType * @see JDBCType * @see SQLType * @since 1.8 @@ -4249,7 +4249,7 @@ public interface ResultSet extends Wrapper, AutoCloseable { * the result set concurrency is {@code CONCUR_READ_ONLY} * or this method is called on a closed result set * @exception SQLFeatureNotSupportedException if the JDBC driver does not - * support this method; if the JDBC driver does not support this data type + * support this method; if the JDBC driver does not support the specified targetSqlType * @see JDBCType * @see SQLType * @since 1.8 @@ -4279,7 +4279,7 @@ public interface ResultSet extends Wrapper, AutoCloseable { * the result set concurrency is {@code CONCUR_READ_ONLY} * or this method is called on a closed result set * @exception SQLFeatureNotSupportedException if the JDBC driver does not - * support this method; if the JDBC driver does not support this data type + * support this method; if the JDBC driver does not support the specified targetSqlType * @see JDBCType * @see SQLType * @since 1.8 diff --git a/jdk/src/share/classes/java/sql/SQLPermission.java b/jdk/src/share/classes/java/sql/SQLPermission.java index e3a24225fec..951430d90cc 100644 --- a/jdk/src/share/classes/java/sql/SQLPermission.java +++ b/jdk/src/share/classes/java/sql/SQLPermission.java @@ -122,7 +122,7 @@ public final class SQLPermission extends BasicPermission { * * @param name the name of this
SQLPermission
object, which must * be either {@code setLog}, {@code callAbort}, {@code setSyncFactory}, - * or {@code setNetworkTimeout} + * {@code deregisterDriver}, or {@code setNetworkTimeout} * @throws NullPointerException ifname
isnull
. * @throws IllegalArgumentException ifname
is empty. @@ -140,7 +140,7 @@ public final class SQLPermission extends BasicPermission { * * @param name the name of thisSQLPermission
object, which must * be either {@code setLog}, {@code callAbort}, {@code setSyncFactory}, - * or {@code setNetworkTimeout} + * {@code deregisterDriver}, or {@code setNetworkTimeout} * @param actions should benull
* @throws NullPointerException ifname
isnull
. * @throws IllegalArgumentException ifname
is empty. diff --git a/jdk/src/share/classes/java/util/Base64.java b/jdk/src/share/classes/java/util/Base64.java index ac5a5d6be92..172acbeab58 100644 --- a/jdk/src/share/classes/java/util/Base64.java +++ b/jdk/src/share/classes/java/util/Base64.java @@ -350,62 +350,6 @@ public class Base64 { return ByteBuffer.wrap(dst); } - /** - * Encodes as many bytes as possible from the input byte buffer - * using the {@link Base64} encoding scheme, writing the resulting - * bytes to the given output byte buffer. - * - *The buffers are read from, and written to, starting at their - * current positions. Upon return, the input and output buffers' - * positions will be advanced to reflect the bytes read and written, - * but their limits will not be modified. - * - *
The encoding operation will stop and return if either all - * remaining bytes in the input buffer have been encoded and written - * to the output buffer, or the output buffer has insufficient space - * to encode any more input bytes. The encoding operation can be - * continued, if there is more bytes in input buffer to be encoded, - * by invoking this method again with an output buffer that has more - * {@linkplain java.nio.Buffer#remaining remaining} bytes. This is - * typically done by draining any encoded bytes from the output buffer. - * The value returned from last invocation needs to be passed in as the - * third parameter {@code bytesOut} if it is to continue an unfinished - * encoding, 0 otherwise. - * - *
Recommended Usage Example - *
- * ByteBuffer src = ...; - * ByteBuffer dst = ...; - * Base64.Encoder enc = Base64.getMimeDecoder(); - * - * int bytesOut = 0; - * while (src.hasRemaining()) { - * // clear output buffer for decoding - * dst.clear(); - * bytesOut = enc.encode(src, dst, bytesOut); - * - * // read encoded bytes out of "dst" - * dst.flip(); - * ... - * } - *- * - * @param src - * the input byte buffer to encode - * @param dst - * the output byte buffer - * @param bytesOut - * the return value of last invocation if this is to continue - * an unfinished encoding operation, 0 otherwise - * @return The sum total of {@code bytesOut} and the number of bytes - * written to the output ByteBuffer during this invocation. - */ - public int encode(ByteBuffer src, ByteBuffer dst, int bytesOut) { - if (src.hasArray() && dst.hasArray()) - return encodeArray(src, dst, bytesOut); - return encodeBuffer(src, dst, bytesOut); - } - /** * Wraps an output stream for encoding byte data using the {@link Base64} * encoding scheme. @@ -444,160 +388,6 @@ public class Base64 { return new Encoder(isURL, newline, linemax, false); } - private int encodeArray(ByteBuffer src, ByteBuffer dst, int bytesOut) { - char[] base64 = isURL? toBase64URL : toBase64; - byte[] sa = src.array(); - int sp = src.arrayOffset() + src.position(); - int sl = src.arrayOffset() + src.limit(); - byte[] da = dst.array(); - int dp = dst.arrayOffset() + dst.position(); - int dl = dst.arrayOffset() + dst.limit(); - int dp00 = dp; - int dpos = 0; // dp of each line - if (linemax > 0 && bytesOut > 0) - dpos = bytesOut % (linemax + newline.length); - try { - if (dpos == linemax && sp < src.limit()) { - if (dp + newline.length > dl) - return dp - dp00 + bytesOut; - for (byte b : newline){ - dst.put(dp++, b); - } - dpos = 0; - } - sl = sp + (sl - sp) / 3 * 3; - while (sp < sl) { - int slen = (linemax > 0) ? (linemax - dpos) / 4 * 3 - : sl - sp; - int sl0 = Math.min(sp + slen, sl); - for (int sp0 = sp, dp0 = dp ; sp0 < sl0; ) { - if (dp0 + 4 > dl) { - sp = sp0; dp = dp0; - return dp0 - dp00 + bytesOut; - } - int bits = (sa[sp0++] & 0xff) << 16 | - (sa[sp0++] & 0xff) << 8 | - (sa[sp0++] & 0xff); - da[dp0++] = (byte)base64[(bits >>> 18) & 0x3f]; - da[dp0++] = (byte)base64[(bits >>> 12) & 0x3f]; - da[dp0++] = (byte)base64[(bits >>> 6) & 0x3f]; - da[dp0++] = (byte)base64[bits & 0x3f]; - } - int n = (sl0 - sp) / 3 * 4; - dpos += n; - dp += n; - sp = sl0; - if (dpos == linemax && sp < src.limit()) { - if (dp + newline.length > dl) - return dp - dp00 + bytesOut; - for (byte b : newline){ - da[dp++] = b; - } - dpos = 0; - } - } - sl = src.arrayOffset() + src.limit(); - if (sp < sl && dl >= dp + 4) { // 1 or 2 leftover bytes - int b0 = sa[sp++] & 0xff; - da[dp++] = (byte)base64[b0 >> 2]; - if (sp == sl) { - da[dp++] = (byte)base64[(b0 << 4) & 0x3f]; - if (doPadding) { - da[dp++] = '='; - da[dp++] = '='; - } - } else { - int b1 = sa[sp++] & 0xff; - da[dp++] = (byte)base64[(b0 << 4) & 0x3f | (b1 >> 4)]; - da[dp++] = (byte)base64[(b1 << 2) & 0x3f]; - if (doPadding) { - da[dp++] = '='; - } - } - } - return dp - dp00 + bytesOut; - } finally { - src.position(sp - src.arrayOffset()); - dst.position(dp - dst.arrayOffset()); - } - } - - private int encodeBuffer(ByteBuffer src, ByteBuffer dst, int bytesOut) { - char[] base64 = isURL? toBase64URL : toBase64; - int sp = src.position(); - int sl = src.limit(); - int dp = dst.position(); - int dl = dst.limit(); - int dp00 = dp; - - int dpos = 0; // dp of each line - if (linemax > 0 && bytesOut > 0) - dpos = bytesOut % (linemax + newline.length); - try { - if (dpos == linemax && sp < src.limit()) { - if (dp + newline.length > dl) - return dp - dp00 + bytesOut; - for (byte b : newline){ - dst.put(dp++, b); - } - dpos = 0; - } - sl = sp + (sl - sp) / 3 * 3; - while (sp < sl) { - int slen = (linemax > 0) ? (linemax - dpos) / 4 * 3 - : sl - sp; - int sl0 = Math.min(sp + slen, sl); - for (int sp0 = sp, dp0 = dp ; sp0 < sl0; ) { - if (dp0 + 4 > dl) { - sp = sp0; dp = dp0; - return dp0 - dp00 + bytesOut; - } - int bits = (src.get(sp0++) & 0xff) << 16 | - (src.get(sp0++) & 0xff) << 8 | - (src.get(sp0++) & 0xff); - dst.put(dp0++, (byte)base64[(bits >>> 18) & 0x3f]); - dst.put(dp0++, (byte)base64[(bits >>> 12) & 0x3f]); - dst.put(dp0++, (byte)base64[(bits >>> 6) & 0x3f]); - dst.put(dp0++, (byte)base64[bits & 0x3f]); - } - int n = (sl0 - sp) / 3 * 4; - dpos += n; - dp += n; - sp = sl0; - if (dpos == linemax && sp < src.limit()) { - if (dp + newline.length > dl) - return dp - dp00 + bytesOut; - for (byte b : newline){ - dst.put(dp++, b); - } - dpos = 0; - } - } - if (sp < src.limit() && dl >= dp + 4) { // 1 or 2 leftover bytes - int b0 = src.get(sp++) & 0xff; - dst.put(dp++, (byte)base64[b0 >> 2]); - if (sp == src.limit()) { - dst.put(dp++, (byte)base64[(b0 << 4) & 0x3f]); - if (doPadding) { - dst.put(dp++, (byte)'='); - dst.put(dp++, (byte)'='); - } - } else { - int b1 = src.get(sp++) & 0xff; - dst.put(dp++, (byte)base64[(b0 << 4) & 0x3f | (b1 >> 4)]); - dst.put(dp++, (byte)base64[(b1 << 2) & 0x3f]); - if (doPadding) { - dst.put(dp++, (byte)'='); - } - } - } - return dp - dp00 + bytesOut; - } finally { - src.position(sp); - dst.position(dp); - } - } - private int encode0(byte[] src, int off, int end, byte[] dst) { char[] base64 = isURL ? toBase64URL : toBase64; int sp = off; @@ -657,20 +447,11 @@ public class Base64 { * required. So if the final unit of the encoded byte data only has * two or three Base64 characters (without the corresponding padding * character(s) padded), they are decoded as if followed by padding - * character(s). - *- * For decoders that use the Basic and - * URL and Filename safe type base64 scheme, and - * if there is padding character present in the final unit, the - * correct number of padding character(s) must be present, otherwise - * {@code IllegalArgumentException} ({@code IOException} when reading - * from a Base64 stream) is thrown during decoding. - *
- * Decoders that use the MIME type base64 scheme - * are more lenient when decoding the padding character(s). If the - * padding character(s) is incorrectly encoded, the first padding - * character encountered is interpreted as the end of the encoded byte - * data, the decoding operation will then end and return normally. + * character(s). If there is a padding character present in the + * final unit, the correct number of padding character(s) must be + * present, otherwise {@code IllegalArgumentException} ( + * {@code IOException} when reading from a Base64 stream) is thrown + * during decoding. * *
Instances of {@link Decoder} class are safe for use by * multiple concurrent threads. @@ -810,6 +591,10 @@ public class Base64 { * output buffer's position will be zero and its limit will be the * number of resulting decoded bytes * + *
{@code IllegalArgumentException} is thrown if the input buffer + * is not in valid Base64 encoding scheme. The position of the input + * buffer will not be advanced in this case. + * * @param buffer * the ByteBuffer to decode * @@ -842,76 +627,6 @@ public class Base64 { } } - /** - * Decodes as many bytes as possible from the input byte buffer - * using the {@link Base64} encoding scheme, writing the resulting - * bytes to the given output byte buffer. - * - *
The buffers are read from, and written to, starting at their - * current positions. Upon return, the input and output buffers' - * positions will be advanced to reflect the bytes read and written, - * but their limits will not be modified. - * - *
If the input buffer is not in valid Base64 encoding scheme - * then some bytes may have been written to the output buffer - * before IllegalArgumentException is thrown. The positions of - * both input and output buffer will not be advanced in this case. - * - *
The decoding operation will end and return if all remaining - * bytes in the input buffer have been decoded and written to the - * output buffer. - * - *
The decoding operation will stop and return if the output - * buffer has insufficient space to decode any more input bytes. - * The decoding operation can be continued, if there is more bytes - * in input buffer to be decoded, by invoking this method again with - * an output buffer that has more {@linkplain java.nio.Buffer#remaining - * remaining} bytes. This is typically done by draining any decoded - * bytes from the output buffer. - * - *
Recommended Usage Example - *
- * ByteBuffer src = ...; - * ByteBuffer dst = ...; - * Base64.Decoder dec = Base64.getDecoder(); - * - * while (src.hasRemaining()) { - * - * // prepare the output byte buffer - * dst.clear(); - * dec.decode(src, dst); - * - * // read bytes from the output buffer - * dst.flip(); - * ... - * } - *- * - * @param src - * the input byte buffer to decode - * @param dst - * the output byte buffer - * - * @return The number of bytes written to the output byte buffer during - * this decoding invocation - * - * @throws IllegalArgumentException - * if {@code src} is not in valid Base64 scheme. - */ - public int decode(ByteBuffer src, ByteBuffer dst) { - int sp0 = src.position(); - int dp0 = dst.position(); - try { - if (src.hasArray() && dst.hasArray()) - return decodeArray(src, dst); - return decodeBuffer(src, dst); - } catch (IllegalArgumentException iae) { - src.position(sp0); - dst.position(dp0); - throw iae; - } - } - /** * Returns an input stream for decoding {@link Base64} encoded byte stream. * @@ -932,150 +647,6 @@ public class Base64 { return new DecInputStream(is, isURL ? fromBase64URL : fromBase64, isMIME); } - private int decodeArray(ByteBuffer src, ByteBuffer dst) { - int[] base64 = isURL ? fromBase64URL : fromBase64; - int bits = 0; - int shiftto = 18; // pos of first byte of 4-byte atom - byte[] sa = src.array(); - int sp = src.arrayOffset() + src.position(); - int sl = src.arrayOffset() + src.limit(); - byte[] da = dst.array(); - int dp = dst.arrayOffset() + dst.position(); - int dl = dst.arrayOffset() + dst.limit(); - int dp0 = dp; - int mark = sp; - try { - while (sp < sl) { - int b = sa[sp++] & 0xff; - if ((b = base64[b]) < 0) { - if (b == -2) { // padding byte - if (!isMIME && - (shiftto == 6 && (sp == sl || sa[sp++] != '=') || - shiftto == 18)) { - throw new IllegalArgumentException( - "Input byte array has wrong 4-byte ending unit"); - } - break; - } - if (isMIME) // skip if for rfc2045 - continue; - else - throw new IllegalArgumentException( - "Illegal base64 character " + - Integer.toString(sa[sp - 1], 16)); - } - bits |= (b << shiftto); - shiftto -= 6; - if (shiftto < 0) { - if (dl < dp + 3) - return dp - dp0; - da[dp++] = (byte)(bits >> 16); - da[dp++] = (byte)(bits >> 8); - da[dp++] = (byte)(bits); - shiftto = 18; - bits = 0; - mark = sp; - } - } - if (shiftto == 6) { - if (dl - dp < 1) - return dp - dp0; - da[dp++] = (byte)(bits >> 16); - } else if (shiftto == 0) { - if (dl - dp < 2) - return dp - dp0; - da[dp++] = (byte)(bits >> 16); - da[dp++] = (byte)(bits >> 8); - } else if (shiftto == 12) { - throw new IllegalArgumentException( - "Last unit does not have enough valid bits"); - } - if (sp < sl) { - if (isMIME) - sp = sl; - else - throw new IllegalArgumentException( - "Input byte array has incorrect ending byte at " + sp); - } - mark = sp; - return dp - dp0; - } finally { - src.position(mark); - dst.position(dp); - } - } - - private int decodeBuffer(ByteBuffer src, ByteBuffer dst) { - int[] base64 = isURL ? fromBase64URL : fromBase64; - int bits = 0; - int shiftto = 18; // pos of first byte of 4-byte atom - int sp = src.position(); - int sl = src.limit(); - int dp = dst.position(); - int dl = dst.limit(); - int dp0 = dp; - int mark = sp; - try { - while (sp < sl) { - int b = src.get(sp++) & 0xff; - if ((b = base64[b]) < 0) { - if (b == -2) { // padding byte - if (!isMIME && - (shiftto == 6 && (sp == sl || src.get(sp++) != '=') || - shiftto == 18)) { - throw new IllegalArgumentException( - "Input byte array has wrong 4-byte ending unit"); - } - break; - } - if (isMIME) // skip if for rfc2045 - continue; - else - throw new IllegalArgumentException( - "Illegal base64 character " + - Integer.toString(src.get(sp - 1), 16)); - } - bits |= (b << shiftto); - shiftto -= 6; - if (shiftto < 0) { - if (dl < dp + 3) - return dp - dp0; - dst.put(dp++, (byte)(bits >> 16)); - dst.put(dp++, (byte)(bits >> 8)); - dst.put(dp++, (byte)(bits)); - shiftto = 18; - bits = 0; - mark = sp; - } - } - if (shiftto == 6) { - if (dl - dp < 1) - return dp - dp0; - dst.put(dp++, (byte)(bits >> 16)); - } else if (shiftto == 0) { - if (dl - dp < 2) - return dp - dp0; - dst.put(dp++, (byte)(bits >> 16)); - dst.put(dp++, (byte)(bits >> 8)); - } else if (shiftto == 12) { - throw new IllegalArgumentException( - "Last unit does not have enough valid bits"); - } - if (sp < sl) { - if (isMIME) - sp = sl; - else - throw new IllegalArgumentException( - "Input byte array has incorrect ending byte at " + sp); - } - mark = sp; - return dp - dp0; - } finally { - src.position(mark); - dst.position(dp); - } - } - private int outLength(byte[] src, int sp, int sl) { int[] base64 = isURL ? fromBase64URL : fromBase64; int paddings = 0; @@ -1123,14 +694,13 @@ public class Base64 { int b = src[sp++] & 0xff; if ((b = base64[b]) < 0) { if (b == -2) { // padding byte '=' - if (!isMIME && // be lenient for rfc2045 - // = shiftto==18 unnecessary padding - // x= shiftto==12 a dangling single x - // x to be handled together with non-padding case - // xx= shiftto==6&&sp==sl missing last = - // xx=y shiftto==6 last is not = - (shiftto == 6 && (sp == sl || src[sp++] != '=') || - shiftto == 18)) { + // = shiftto==18 unnecessary padding + // x= shiftto==12 a dangling single x + // x to be handled together with non-padding case + // xx= shiftto==6&&sp==sl missing last = + // xx=y shiftto==6 last is not = + if (shiftto == 6 && (sp == sl || src[sp++] != '=') || + shiftto == 18) { throw new IllegalArgumentException( "Input byte array has wrong 4-byte ending unit"); } @@ -1160,14 +730,15 @@ public class Base64 { dst[dp++] = (byte)(bits >> 16); dst[dp++] = (byte)(bits >> 8); } else if (shiftto == 12) { - // dangling single "x", throw exception even in lenient mode, - // it's incorrectly encoded. + // dangling single "x", incorrectly encoded. throw new IllegalArgumentException( "Last unit does not have enough valid bits"); } // anything left is invalid, if is not MIME. - // if MIME (lenient), just ignore all leftover - if (sp < sl && !isMIME) { + // if MIME, ignore all non-base64 character + while (sp < sl) { + if (isMIME && base64[src[sp++]] < 0) + continue; throw new IllegalArgumentException( "Input byte array has incorrect ending byte at " + sp); } @@ -1367,26 +938,16 @@ public class Base64 { // xx=y or last is not '=' if (nextin == 18 || nextin == 12 || nextin == 6 && is.read() != '=') { - if (!isMIME || nextin == 12) { - throw new IOException("Illegal base64 ending sequence:" + nextin); - } else if (nextin != 18) { - // lenient mode for mime - // (1) handle the "unnecessary padding in "xxxx =" - // case as the eof (nextin == 18) - // (2) decode "xx=" and "xx=y" normally - b[off++] = (byte)(bits >> (16)); - len--; - } - } else { - b[off++] = (byte)(bits >> (16)); - len--; - if (nextin == 0) { // only one padding byte - if (len == 0) { // no enough output space - bits >>= 8; // shift to lowest byte - nextout = 0; - } else { - b[off++] = (byte) (bits >> 8); - } + throw new IOException("Illegal base64 ending sequence:" + nextin); + } + b[off++] = (byte)(bits >> (16)); + len--; + if (nextin == 0) { // only one padding byte + if (len == 0) { // no enough output space + bits >>= 8; // shift to lowest byte + nextout = 0; + } else { + b[off++] = (byte) (bits >> 8); } } eof = true; diff --git a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java index be9d4b5ae56..8a4a0f49f18 100644 --- a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java +++ b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java @@ -63,6 +63,7 @@ import java.util.stream.Collector; public class DoubleSummaryStatistics implements DoubleConsumer { private long count; private double sum; + private double sumCompensation; // Low order bits of sum private double min = Double.POSITIVE_INFINITY; private double max = Double.NEGATIVE_INFINITY; @@ -81,7 +82,7 @@ public class DoubleSummaryStatistics implements DoubleConsumer { @Override public void accept(double value) { ++count; - sum += value; + sumWithCompensation(value); min = Math.min(min, value); max = Math.max(max, value); } @@ -95,11 +96,23 @@ public class DoubleSummaryStatistics implements DoubleConsumer { */ public void combine(DoubleSummaryStatistics other) { count += other.count; - sum += other.sum; + sumWithCompensation(other.sum); + sumWithCompensation(other.sumCompensation); min = Math.min(min, other.min); max = Math.max(max, other.max); } + /** + * Incorporate a new double value using Kahan summation / + * compensated summation. + */ + private void sumWithCompensation(double value) { + double tmp = value - sumCompensation; + double velvel = sum + tmp; // Little wolf of rounding error + sumCompensation = (velvel - sum) - tmp; + sum = velvel; + } + /** * Return the count of values recorded. * @@ -133,7 +146,8 @@ public class DoubleSummaryStatistics implements DoubleConsumer { * @return the sum of values, or zero if none */ public final double getSum() { - return sum; + // Better error bounds to add both terms as the final sum + return sum + sumCompensation; } /** diff --git a/jdk/src/share/classes/java/util/ListResourceBundle.java b/jdk/src/share/classes/java/util/ListResourceBundle.java index 9aa7fdba550..1c1e5f04e89 100644 --- a/jdk/src/share/classes/java/util/ListResourceBundle.java +++ b/jdk/src/share/classes/java/util/ListResourceBundle.java @@ -105,6 +105,12 @@ import sun.util.ResourceBundleEnumeration; * } *+ * The implementation of a {@code ListResourceBundle} subclass must be thread-safe + * if it's simultaneously used by multiple threads. The default implementations + * of the methods in this class are thread-safe. + * * @see ResourceBundle * @see PropertyResourceBundle * @since JDK1.1 diff --git a/jdk/src/share/classes/java/util/Optional.java b/jdk/src/share/classes/java/util/Optional.java index 10b79234b18..d471058ec16 100644 --- a/jdk/src/share/classes/java/util/Optional.java +++ b/jdk/src/share/classes/java/util/Optional.java @@ -40,6 +40,11 @@ import java.util.function.Supplier; * {@link #ifPresent(java.util.function.Consumer) ifPresent()} (execute a block * of code if the value is present). * + *
This is a value-based + * class; use of identity-sensitive operations (including reference equality + * ({@code ==}), identity hash code, or synchronization) on instances of + * {@code Optional} may have unpredictable results and should be avoided. + * * @since 1.8 */ public final class Optional
{ diff --git a/jdk/src/share/classes/java/util/OptionalDouble.java b/jdk/src/share/classes/java/util/OptionalDouble.java index eda306cf7d4..0efc770fa03 100644 --- a/jdk/src/share/classes/java/util/OptionalDouble.java +++ b/jdk/src/share/classes/java/util/OptionalDouble.java @@ -31,7 +31,7 @@ import java.util.function.Supplier; /** * A container object which may or may not contain a {@code double} value. * If a value is present, {@code isPresent()} will return {@code true} and - * {@code get()} will return the value. + * {@code getAsDouble()} will return the value. * * Additional methods that depend on the presence or absence of a contained * value are provided, such as {@link #orElse(double) orElse()} @@ -39,6 +39,11 @@ import java.util.function.Supplier; * {@link #ifPresent(java.util.function.DoubleConsumer) ifPresent()} (execute a block * of code if the value is present). * + *
This is a value-based + * class; use of identity-sensitive operations (including reference equality + * ({@code ==}), identity hash code, or synchronization) on instances of + * {@code OptionalDouble} may have unpredictable results and should be avoided. + * * @since 1.8 */ public final class OptionalDouble { diff --git a/jdk/src/share/classes/java/util/OptionalInt.java b/jdk/src/share/classes/java/util/OptionalInt.java index 66478ce4713..5cb9275242b 100644 --- a/jdk/src/share/classes/java/util/OptionalInt.java +++ b/jdk/src/share/classes/java/util/OptionalInt.java @@ -31,7 +31,7 @@ import java.util.function.Supplier; /** * A container object which may or may not contain a {@code int} value. * If a value is present, {@code isPresent()} will return {@code true} and - * {@code get()} will return the value. + * {@code getAsInt()} will return the value. * *
Additional methods that depend on the presence or absence of a contained * value are provided, such as {@link #orElse(int) orElse()} @@ -39,6 +39,11 @@ import java.util.function.Supplier; * {@link #ifPresent(java.util.function.IntConsumer) ifPresent()} (execute a block * of code if the value is present). * + *
This is a value-based + * class; use of identity-sensitive operations (including reference equality + * ({@code ==}), identity hash code, or synchronization) on instances of + * {@code OptionalInt} may have unpredictable results and should be avoided. + * * @since 1.8 */ public final class OptionalInt { diff --git a/jdk/src/share/classes/java/util/OptionalLong.java b/jdk/src/share/classes/java/util/OptionalLong.java index f07cc0d3d3a..589a59fd3ae 100644 --- a/jdk/src/share/classes/java/util/OptionalLong.java +++ b/jdk/src/share/classes/java/util/OptionalLong.java @@ -31,7 +31,7 @@ import java.util.function.Supplier; /** * A container object which may or may not contain a {@code long} value. * If a value is present, {@code isPresent()} will return {@code true} and - * {@code get()} will return the value. + * {@code getAsLong()} will return the value. * *
Additional methods that depend on the presence or absence of a contained * value are provided, such as {@link #orElse(long) orElse()} @@ -39,6 +39,11 @@ import java.util.function.Supplier; * {@link #ifPresent(java.util.function.LongConsumer) ifPresent()} (execute a block * of code if the value is present). * + *
This is a value-based + * class; use of identity-sensitive operations (including reference equality + * ({@code ==}), identity hash code, or synchronization) on instances of + * {@code OptionalLong} may have unpredictable results and should be avoided. + * * @since 1.8 */ public final class OptionalLong { diff --git a/jdk/src/share/classes/java/util/PropertyResourceBundle.java b/jdk/src/share/classes/java/util/PropertyResourceBundle.java index 841d7d759a2..3d784d3ac10 100644 --- a/jdk/src/share/classes/java/util/PropertyResourceBundle.java +++ b/jdk/src/share/classes/java/util/PropertyResourceBundle.java @@ -100,6 +100,11 @@ import sun.util.ResourceBundleEnumeration; * * *
+ * The implementation of a {@code PropertyResourceBundle} subclass must be + * thread-safe if it's simultaneously used by multiple threads. The default + * implementations of the non-abstract methods in this class are thread-safe. + * + *
* Note: PropertyResourceBundle can be constructed either * from an InputStream or a Reader, which represents a property file. * Constructing a PropertyResourceBundle instance from an InputStream requires diff --git a/jdk/src/share/classes/java/util/ResourceBundle.java b/jdk/src/share/classes/java/util/ResourceBundle.java index 95948c5abcc..9e041f24aa7 100644 --- a/jdk/src/share/classes/java/util/ResourceBundle.java +++ b/jdk/src/share/classes/java/util/ResourceBundle.java @@ -184,6 +184,13 @@ import sun.util.locale.LocaleObjectCache; * subclass. Your subclasses must override two methods:
handleGetObject
* andgetKeys()
. * + *+ * The implementation of a {@code ResourceBundle} subclass must be thread-safe + * if it's simultaneously used by multiple threads. The default implementations + * of the non-abstract methods in this class, and the methods in the direct + * known concrete subclasses {@code ListResourceBundle} and + * {@code PropertyResourceBundle} are thread-safe. + * *
ResourceBundle.Control
* * The {@link ResourceBundle.Control} class provides information necessary diff --git a/jdk/src/share/classes/java/util/StringJoiner.java b/jdk/src/share/classes/java/util/StringJoiner.java index d4050a4afd5..b6ba84c5df8 100644 --- a/jdk/src/share/classes/java/util/StringJoiner.java +++ b/jdk/src/share/classes/java/util/StringJoiner.java @@ -131,7 +131,7 @@ public final class StringJoiner { /** * Sets the sequence of characters to be used when determining the string * representation of this {@code StringJoiner} and no elements have been - * added yet, i.e. when it is empty. A copy of the {@code emptyValue} + * added yet, that is, when it is empty. A copy of the {@code emptyValue} * parameter is made for this purpose. Note that once an add method has been * called, the {@code StringJoiner} is no longer considered empty, even if * the element(s) added correspond to the empty {@code String}. @@ -228,8 +228,8 @@ public final class StringJoiner { } /** - * The length of the {@code StringJoiner} value, i.e. the length of - * {@code String} representation of the {@code StringJoiner}. Note that if + * Returns the length of the {@code String} representation + * of this {@code StringJoiner}. Note that if * no add methods have been called, then the length of the {@code String} * representation (either {@code prefix + suffix} or {@code emptyValue}) * will be returned. The value should be equivalent to diff --git a/jdk/src/share/classes/java/util/concurrent/Callable.java b/jdk/src/share/classes/java/util/concurrent/Callable.java index 53bde82bebd..04bc6075063 100644 --- a/jdk/src/share/classes/java/util/concurrent/Callable.java +++ b/jdk/src/share/classes/java/util/concurrent/Callable.java @@ -54,6 +54,7 @@ package java.util.concurrent; * @author Doug Lea * @paramthe result type of method {@code call} */ +@FunctionalInterface public interface Callable { /** * Computes a result, or throws an exception if unable to do so. diff --git a/jdk/src/share/classes/java/util/concurrent/CompletableFuture.java b/jdk/src/share/classes/java/util/concurrent/CompletableFuture.java index 8f2354cd1f8..9e89169e15f 100644 --- a/jdk/src/share/classes/java/util/concurrent/CompletableFuture.java +++ b/jdk/src/share/classes/java/util/concurrent/CompletableFuture.java @@ -2004,7 +2004,7 @@ public class CompletableFuture implements Future , CompletionStage { } if (dst == null) dst = new CompletableFuture(); - if (e == null || ex != null) + if (ex != null) dst.internalComplete(null, ex); } helpPostComplete(); diff --git a/jdk/src/share/classes/java/util/concurrent/ConcurrentHashMap.java b/jdk/src/share/classes/java/util/concurrent/ConcurrentHashMap.java index c8c52a76ffd..880ecb2bbdd 100644 --- a/jdk/src/share/classes/java/util/concurrent/ConcurrentHashMap.java +++ b/jdk/src/share/classes/java/util/concurrent/ConcurrentHashMap.java @@ -49,7 +49,6 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.Map; import java.util.NoSuchElementException; -import java.util.Objects; import java.util.Set; import java.util.Spliterator; import java.util.concurrent.ConcurrentMap; @@ -381,19 +380,21 @@ public class ConcurrentHashMap extends AbstractMap * progress. Resizing proceeds by transferring bins, one by one, * from the table to the next table. However, threads claim small * blocks of indices to transfer (via field transferIndex) before - * doing so, reducing contention. Because we are using - * power-of-two expansion, the elements from each bin must either - * stay at same index, or move with a power of two offset. We - * eliminate unnecessary node creation by catching cases where old - * nodes can be reused because their next fields won't change. On - * average, only about one-sixth of them need cloning when a table - * doubles. The nodes they replace will be garbage collectable as - * soon as they are no longer referenced by any reader thread that - * may be in the midst of concurrently traversing table. Upon - * transfer, the old table bin contains only a special forwarding - * node (with hash field "MOVED") that contains the next table as - * its key. On encountering a forwarding node, access and update - * operations restart, using the new table. + * doing so, reducing contention. A generation stamp in field + * sizeCtl ensures that resizings do not overlap. Because we are + * using power-of-two expansion, the elements from each bin must + * either stay at same index, or move with a power of two + * offset. We eliminate unnecessary node creation by catching + * cases where old nodes can be reused because their next fields + * won't change. On average, only about one-sixth of them need + * cloning when a table doubles. The nodes they replace will be + * garbage collectable as soon as they are no longer referenced by + * any reader thread that may be in the midst of concurrently + * traversing table. Upon transfer, the old table bin contains + * only a special forwarding node (with hash field "MOVED") that + * contains the next table as its key. On encountering a + * forwarding node, access and update operations restart, using + * the new table. * * Each bin transfer requires its bin lock, which can stall * waiting for locks while resizing. However, because other @@ -570,6 +571,23 @@ public class ConcurrentHashMap extends AbstractMap */ private static final int MIN_TRANSFER_STRIDE = 16; + /** + * The number of bits used for generation stamp in sizeCtl. + * Must be at least 6 for 32bit arrays. + */ + private static int RESIZE_STAMP_BITS = 16; + + /** + * The maximum number of threads that can help resize. + * Must fit in 32 - RESIZE_STAMP_BITS bits. + */ + private static final int MAX_RESIZERS = (1 << (32 - RESIZE_STAMP_BITS)) - 1; + + /** + * The bit shift for recording size stamp in sizeCtl. + */ + private static final int RESIZE_STAMP_SHIFT = 32 - RESIZE_STAMP_BITS; + /* * Encodings for Node hash fields. See above for explanation. */ @@ -727,7 +745,7 @@ public class ConcurrentHashMap extends AbstractMap * errors by users, these checks must operate on local variables, * which accounts for some odd-looking inline assignments below. * Note that calls to setTabAt always occur within locked regions, - * and so in principle require only release ordering, not need + * and so in principle require only release ordering, not * full volatile semantics, but are currently coded as volatile * writes to be conservative. */ @@ -2191,6 +2209,14 @@ public class ConcurrentHashMap extends AbstractMap /* ---------------- Table Initialization and Resizing -------------- */ + /** + * Returns the stamp bits for resizing a table of size n. + * Must be negative when shifted left by RESIZE_STAMP_SHIFT. + */ + static final int resizeStamp(int n) { + return Integer.numberOfLeadingZeros(n) | (1 << (RESIZE_STAMP_BITS - 1)); + } + /** * Initializes table, using the size recorded in sizeCtl. */ @@ -2245,17 +2271,20 @@ public class ConcurrentHashMap extends AbstractMap s = sumCount(); } if (check >= 0) { - Node [] tab, nt; int sc; + Node [] tab, nt; int n, sc; while (s >= (long)(sc = sizeCtl) && (tab = table) != null && - tab.length < MAXIMUM_CAPACITY) { + (n = tab.length) < MAXIMUM_CAPACITY) { + int rs = resizeStamp(n); if (sc < 0) { - if (sc == -1 || transferIndex <= 0 || - (nt = nextTable) == null) + if ((sc >>> RESIZE_STAMP_SHIFT) != rs || sc == rs + 1 || + sc == rs + MAX_RESIZERS || (nt = nextTable) == null || + transferIndex <= 0) break; - if (U.compareAndSwapInt(this, SIZECTL, sc, sc - 1)) + if (U.compareAndSwapInt(this, SIZECTL, sc, sc + 1)) transfer(tab, nt); } - else if (U.compareAndSwapInt(this, SIZECTL, sc, -2)) + else if (U.compareAndSwapInt(this, SIZECTL, sc, + (rs << RESIZE_STAMP_SHIFT) + 2)) transfer(tab, null); s = sumCount(); } @@ -2267,11 +2296,15 @@ public class ConcurrentHashMap extends AbstractMap */ final Node [] helpTransfer(Node [] tab, Node f) { Node [] nextTab; int sc; - if ((f instanceof ForwardingNode) && + if (tab != null && (f instanceof ForwardingNode) && (nextTab = ((ForwardingNode )f).nextTable) != null) { - while (transferIndex > 0 && nextTab == nextTable && - (sc = sizeCtl) < -1) { - if (U.compareAndSwapInt(this, SIZECTL, sc, sc - 1)) { + int rs = resizeStamp(tab.length); + while (nextTab == nextTable && table == tab && + (sc = sizeCtl) < 0) { + if ((sc >>> RESIZE_STAMP_SHIFT) != rs || sc == rs + 1 || + sc == rs + MAX_RESIZERS || transferIndex <= 0) + break; + if (U.compareAndSwapInt(this, SIZECTL, sc, sc + 1)) { transfer(tab, nextTab); break; } @@ -2309,9 +2342,21 @@ public class ConcurrentHashMap extends AbstractMap } else if (c <= sc || n >= MAXIMUM_CAPACITY) break; - else if (tab == table && - U.compareAndSwapInt(this, SIZECTL, sc, -2)) - transfer(tab, null); + else if (tab == table) { + int rs = resizeStamp(n); + if (sc < 0) { + Node [] nt; + if ((sc >>> RESIZE_STAMP_SHIFT) != rs || sc == rs + 1 || + sc == rs + MAX_RESIZERS || (nt = nextTable) == null || + transferIndex <= 0) + break; + if (U.compareAndSwapInt(this, SIZECTL, sc, sc + 1)) + transfer(tab, nt); + } + else if (U.compareAndSwapInt(this, SIZECTL, sc, + (rs << RESIZE_STAMP_SHIFT) + 2)) + transfer(tab, null); + } } } @@ -2366,8 +2411,8 @@ public class ConcurrentHashMap extends AbstractMap sizeCtl = (n << 1) - (n >>> 1); return; } - if (U.compareAndSwapInt(this, SIZECTL, sc = sizeCtl, ++sc)) { - if (sc != -1) + if (U.compareAndSwapInt(this, SIZECTL, sc = sizeCtl, sc - 1)) { + if ((sc - 2) != resizeStamp(n) << RESIZE_STAMP_SHIFT) return; finishing = advance = true; i = n; // recheck before commit @@ -2566,11 +2611,8 @@ public class ConcurrentHashMap extends AbstractMap private final void treeifyBin(Node [] tab, int index) { Node b; int n, sc; if (tab != null) { - if ((n = tab.length) < MIN_TREEIFY_CAPACITY) { - if (tab == table && (sc = sizeCtl) >= 0 && - U.compareAndSwapInt(this, SIZECTL, sc, -2)) - transfer(tab, null); - } + if ((n = tab.length) < MIN_TREEIFY_CAPACITY) + tryPresize(n << 1); else if ((b = tabAt(tab, index)) != null && b.hash >= 0) { synchronized (b) { if (tabAt(tab, index) == b) { @@ -2768,7 +2810,7 @@ public class ConcurrentHashMap extends AbstractMap private final void contendedLock() { boolean waiting = false; for (int s;;) { - if (((s = lockState) & WRITER) == 0) { + if (((s = lockState) & ~WAITER) == 0) { if (U.compareAndSwapInt(this, LOCKSTATE, s, WRITER)) { if (waiting) waiter = null; @@ -2793,12 +2835,13 @@ public class ConcurrentHashMap extends AbstractMap */ final Node find(int h, Object k) { if (k != null) { - for (Node e = first; e != null; e = e.next) { + for (Node e = first; e != null; ) { int s; K ek; if (((s = lockState) & (WAITER|WRITER)) != 0) { if (e.hash == h && ((ek = e.key) == k || (ek != null && k.equals(ek)))) return e; + e = e.next; } else if (U.compareAndSwapInt(this, LOCKSTATE, s, s + READER)) { @@ -4454,7 +4497,7 @@ public class ConcurrentHashMap extends AbstractMap } public final boolean removeAll(Collection> c) { - Objects.requireNonNull(c); + if (c == null) throw new NullPointerException(); boolean modified = false; for (Iterator it = iterator(); it.hasNext();) { if (c.contains(it.next())) { @@ -4466,7 +4509,7 @@ public class ConcurrentHashMap extends AbstractMap } public final boolean retainAll(Collection> c) { - Objects.requireNonNull(c); + if (c == null) throw new NullPointerException(); boolean modified = false; for (Iterator it = iterator(); it.hasNext();) { if (!c.contains(it.next())) { diff --git a/jdk/src/share/classes/java/util/logging/LogManager.java b/jdk/src/share/classes/java/util/logging/LogManager.java index 9a5e9518f7d..733eeefdb8b 100644 --- a/jdk/src/share/classes/java/util/logging/LogManager.java +++ b/jdk/src/share/classes/java/util/logging/LogManager.java @@ -146,7 +146,14 @@ public class LogManager { // The global LogManager object private static final LogManager manager; - private Properties props = new Properties(); + // 'props' is assigned within a lock but accessed without it. + // Declaring it volatile makes sure that another thread will not + // be able to see a partially constructed 'props' object. + // (seeing a partially constructed 'props' object can result in + // NPE being thrown in Hashtable.get(), because it leaves the door + // open for props.getProperties() to be called before the construcor + // of Hashtable is actually completed). + private volatile Properties props = new Properties(); private final static Level defaultLevel = Level.INFO; // The map of the registered listeners. The map value is the registration @@ -670,7 +677,7 @@ public class LogManager { if (logger == null) { // Hashtable holds stale weak reference // to a logger which has been GC-ed. - removeLogger(name); + ref.dispose(); } return logger; } @@ -756,7 +763,7 @@ public class LogManager { // It's possible that the Logger was GC'ed after a // drainLoggerRefQueueBounded() call above so allow // a new one to be registered. - removeLogger(name); + ref.dispose(); } else { // We already have a registered logger with the given name. return false; @@ -808,10 +815,8 @@ public class LogManager { return true; } - // note: all calls to removeLogger are synchronized on LogManager's - // intrinsic lock - void removeLogger(String name) { - namedLoggers.remove(name); + synchronized void removeLoggerRef(String name, LoggerWeakRef ref) { + namedLoggers.remove(name, ref); } synchronized Enumeration getLoggerNames() { @@ -993,6 +998,7 @@ public class LogManager { private String name; // for namedLoggers cleanup private LogNode node; // for loggerRef cleanup private WeakReference parentRef; // for kids cleanup + private boolean disposed = false; // avoid calling dispose twice LoggerWeakRef(Logger logger) { super(logger, loggerRefQueue); @@ -1002,14 +1008,45 @@ public class LogManager { // dispose of this LoggerWeakRef object void dispose() { - if (node != null) { - // if we have a LogNode, then we were a named Logger - // so clear namedLoggers weak ref to us - node.context.removeLogger(name); - name = null; // clear our ref to the Logger's name + // Avoid calling dispose twice. When a Logger is gc'ed, its + // LoggerWeakRef will be enqueued. + // However, a new logger of the same name may be added (or looked + // up) before the queue is drained. When that happens, dispose() + // will be called by addLocalLogger() or findLogger(). + // Later when the queue is drained, dispose() will be called again + // for the same LoggerWeakRef. Marking LoggerWeakRef as disposed + // avoids processing the data twice (even though the code should + // now be reentrant). + synchronized(this) { + // Note to maintainers: + // Be careful not to call any method that tries to acquire + // another lock from within this block - as this would surely + // lead to deadlocks, given that dispose() can be called by + // multiple threads, and from within different synchronized + // methods/blocks. + if (disposed) return; + disposed = true; + } - node.loggerRef = null; // clear LogNode's weak ref to us - node = null; // clear our ref to LogNode + final LogNode n = node; + if (n != null) { + // n.loggerRef can only be safely modified from within + // a lock on LoggerContext. removeLoggerRef is already + // synchronized on LoggerContext so calling + // n.context.removeLoggerRef from within this lock is safe. + synchronized (n.context) { + // if we have a LogNode, then we were a named Logger + // so clear namedLoggers weak ref to us + n.context.removeLoggerRef(name, this); + name = null; // clear our ref to the Logger's name + + // LogNode may have been reused - so only clear + // LogNode.loggerRef if LogNode.loggerRef == this + if (n.loggerRef == this) { + n.loggerRef = null; // clear LogNode's weak ref to us + } + node = null; // clear our ref to LogNode + } } if (parentRef != null) { @@ -1062,7 +1099,7 @@ public class LogManager { // - maximum: 10.9 ms // private final static int MAX_ITERATIONS = 400; - final synchronized void drainLoggerRefQueueBounded() { + final void drainLoggerRefQueueBounded() { for (int i = 0; i < MAX_ITERATIONS; i++) { if (loggerRefQueue == null) { // haven't finished loading LogManager yet diff --git a/jdk/src/share/classes/java/util/logging/Logger.java b/jdk/src/share/classes/java/util/logging/Logger.java index 1976512cac8..21d6e393e05 100644 --- a/jdk/src/share/classes/java/util/logging/Logger.java +++ b/jdk/src/share/classes/java/util/logging/Logger.java @@ -218,12 +218,46 @@ import sun.reflect.Reflection; public class Logger { private static final Handler emptyHandlers[] = new Handler[0]; private static final int offValue = Level.OFF.intValue(); - private LogManager manager; + + static final String SYSTEM_LOGGER_RB_NAME = "sun.util.logging.resources.logging"; + + // This class is immutable and it is important that it remains so. + private static final class LoggerBundle { + final String resourceBundleName; // Base name of the bundle. + final ResourceBundle userBundle; // Bundle set through setResourceBundle. + private LoggerBundle(String resourceBundleName, ResourceBundle bundle) { + this.resourceBundleName = resourceBundleName; + this.userBundle = bundle; + } + boolean isSystemBundle() { + return SYSTEM_LOGGER_RB_NAME.equals(resourceBundleName); + } + static LoggerBundle get(String name, ResourceBundle bundle) { + if (name == null && bundle == null) { + return NO_RESOURCE_BUNDLE; + } else if (SYSTEM_LOGGER_RB_NAME.equals(name) && bundle == null) { + return SYSTEM_BUNDLE; + } else { + return new LoggerBundle(name, bundle); + } + } + } + + // This instance will be shared by all loggers created by the system + // code + private static final LoggerBundle SYSTEM_BUNDLE = + new LoggerBundle(SYSTEM_LOGGER_RB_NAME, null); + + // This instance indicates that no resource bundle has been specified yet, + // and it will be shared by all loggers which have no resource bundle. + private static final LoggerBundle NO_RESOURCE_BUNDLE = + new LoggerBundle(null, null); + + private volatile LogManager manager; private String name; private final CopyOnWriteArrayList handlers = new CopyOnWriteArrayList<>(); - private String resourceBundleName; // Base name of the bundle. - private ResourceBundle userBundle; // Bundle set through setResourceBundle. + private volatile LoggerBundle loggerBundle = NO_RESOURCE_BUNDLE; private volatile boolean useParentHandlers = true; private volatile Filter filter; private boolean anonymous; @@ -641,7 +675,7 @@ public class Logger { * @return localization bundle name (may be {@code null}) */ public String getResourceBundleName() { - return resourceBundleName; + return loggerBundle.resourceBundleName; } /** @@ -710,8 +744,9 @@ public class Logger { // resource bundle and then call "void log(LogRecord)". private void doLog(LogRecord lr) { lr.setLoggerName(name); - final ResourceBundle bundle = getEffectiveResourceBundle(); - final String ebname = getEffectiveResourceBundleName(); + final LoggerBundle lb = getEffectiveLoggerBundle(); + final ResourceBundle bundle = lb.userBundle; + final String ebname = lb.resourceBundleName; if (ebname != null && bundle != null) { lr.setResourceBundleName(ebname); lr.setResourceBundle(bundle); @@ -1757,8 +1792,6 @@ public class Logger { return useParentHandlers; } - static final String SYSTEM_LOGGER_RB_NAME = "sun.util.logging.resources.logging"; - private static ResourceBundle findSystemResourceBundle(final Locale locale) { // the resource bundle is in a restricted package return AccessController.doPrivileged(new PrivilegedAction () { @@ -1801,11 +1834,12 @@ public class Logger { } Locale currentLocale = Locale.getDefault(); + final LoggerBundle lb = loggerBundle; // Normally we should hit on our simple one entry cache. - if (userBundle != null && - name.equals(resourceBundleName)) { - return userBundle; + if (lb.userBundle != null && + name.equals(lb.resourceBundleName)) { + return lb.userBundle; } else if (catalog != null && currentLocale.equals(catalogLocale) && name.equals(catalogName)) { return catalog; @@ -1864,17 +1898,18 @@ public class Logger { // Synchronized to prevent races in setting the fields. private synchronized void setupResourceInfo(String name, Class> callersClass) { - if (resourceBundleName != null) { + final LoggerBundle lb = loggerBundle; + if (lb.resourceBundleName != null) { // this Logger already has a ResourceBundle - if (resourceBundleName.equals(name)) { + if (lb.resourceBundleName.equals(name)) { // the names match so there is nothing more to do return; } // cannot change ResourceBundles once they are set throw new IllegalArgumentException( - resourceBundleName + " != " + name); + lb.resourceBundleName + " != " + name); } if (name == null) { @@ -1890,7 +1925,10 @@ public class Logger { throw new MissingResourceException("Can't find " + name + " bundle", name, ""); } - resourceBundleName = name; + + // if lb.userBundle is not null we won't reach this line. + assert lb.userBundle == null; + loggerBundle = LoggerBundle.get(name, null); } /** @@ -1920,16 +1958,16 @@ public class Logger { } synchronized (this) { - final boolean canReplaceResourceBundle = resourceBundleName == null - || resourceBundleName.equals(baseName); + LoggerBundle lb = loggerBundle; + final boolean canReplaceResourceBundle = lb.resourceBundleName == null + || lb.resourceBundleName.equals(baseName); if (!canReplaceResourceBundle) { throw new IllegalArgumentException("can't replace resource bundle"); } - userBundle = bundle; - resourceBundleName = baseName; + loggerBundle = LoggerBundle.get(baseName, bundle); } } @@ -2082,45 +2120,44 @@ public class Logger { // Private method to get the potentially inherited - // resource bundle name for this Logger. - // May return null - private String getEffectiveResourceBundleName() { - Logger target = this; + // resource bundle and resource bundle name for this Logger. + // This method never returns null. + private LoggerBundle getEffectiveLoggerBundle() { + final LoggerBundle lb = loggerBundle; + if (lb.isSystemBundle()) { + return SYSTEM_BUNDLE; + } + + // first take care of this logger + final ResourceBundle b = getResourceBundle(); + if (b != null && b == lb.userBundle) { + return lb; + } else if (b != null) { + // either lb.userBundle is null or getResourceBundle() is + // overriden + final String rbName = getResourceBundleName(); + return LoggerBundle.get(rbName, b); + } + + // no resource bundle was specified on this logger, look up the + // parent stack. + Logger target = this.parent; while (target != null) { - String rbn = target.getResourceBundleName(); - if (rbn != null) { - return rbn; + final LoggerBundle trb = target.loggerBundle; + if (trb.isSystemBundle()) { + return SYSTEM_BUNDLE; + } + if (trb.userBundle != null) { + return trb; + } + final String rbName = target.getResourceBundleName(); + if (rbName != null) { + return LoggerBundle.get(rbName, + findResourceBundle(rbName, true)); } target = target.getParent(); } - return null; - } - - - private ResourceBundle getEffectiveResourceBundle() { - Logger target = this; - if (SYSTEM_LOGGER_RB_NAME.equals(resourceBundleName)) return null; - ResourceBundle localRB = getResourceBundle(); - if (localRB != null) { - return localRB; - } - - while (target != null) { - final ResourceBundle rb = target.userBundle; - if (rb != null) { - return rb; - } - final String rbn = target.getResourceBundleName(); - if (rbn != null) { - if (!SYSTEM_LOGGER_RB_NAME.equals(rbn)) { - return findResourceBundle(rbn, true); - } else { - return null; - } - } - target = target.getParent(); - } - return null; + return NO_RESOURCE_BUNDLE; } } diff --git a/jdk/src/share/classes/java/util/stream/Collectors.java b/jdk/src/share/classes/java/util/stream/Collectors.java index 93ffb0113c6..f52ccba57ad 100644 --- a/jdk/src/share/classes/java/util/stream/Collectors.java +++ b/jdk/src/share/classes/java/util/stream/Collectors.java @@ -505,13 +505,42 @@ public final class Collectors { */ public static Collector summingDouble(ToDoubleFunction super T> mapper) { + /* + * In the arrays allocated for the collect operation, index 0 + * holds the high-order bits of the running sum and index 1 + * holds the low-order bits of the sum computed via + * compensated summation. + */ return new CollectorImpl<>( - () -> new double[1], - (a, t) -> { a[0] += mapper.applyAsDouble(t); }, - (a, b) -> { a[0] += b[0]; return a; }, - a -> a[0], CH_NOID); + () -> new double[2], + (a, t) -> { sumWithCompensation(a, mapper.applyAsDouble(t)); }, + (a, b) -> { sumWithCompensation(a, b[0]); return sumWithCompensation(a, b[1]); }, + // Better error bounds to add both terms as the final sum + a -> a[0] + a[1], + CH_NOID); } + /** + * Incorporate a new double value using Kahan summation / + * compensation summation. + * + * High-order bits of the sum are in intermediateSum[0], low-order + * bits of the sum are in intermediateSum[1], any additional + * elements are application-specific. + * + * @param intermediateSum the high-order and low-order words of the intermediate sum + * @param value the name value to be included in the running sum + */ + static double[] sumWithCompensation(double[] intermediateSum, double value) { + double tmp = value - intermediateSum[1]; + double sum = intermediateSum[0]; + double velvel = sum + tmp; // Little wolf of rounding error + intermediateSum[1] = (velvel - sum) - tmp; + intermediateSum[0] = velvel; + return intermediateSum; + } + + /** * Returns a {@code Collector} that produces the arithmetic mean of an integer-valued * function applied to the input elements. If no elements are present, @@ -560,17 +589,31 @@ public final class Collectors { * value is a {@code NaN} or the sum is at any point a {@code NaN} then the * average will be {@code NaN}. * + * @implNote The {@code double} format can represent all + * consecutive integers in the range -253 to + * 253. If the pipeline has more than 253 + * values, the divisor in the average computation will saturate at + * 253, leading to additional numerical errors. + * * @param the type of the input elements * @param mapper a function extracting the property to be summed * @return a {@code Collector} that produces the sum of a derived property */ public static Collector averagingDouble(ToDoubleFunction super T> mapper) { + /* + * In the arrays allocated for the collect operation, index 0 + * holds the high-order bits of the running sum, index 1 holds + * the low-order bits of the sum computed via compensated + * summation, and index 2 holds the number of values seen. + */ return new CollectorImpl<>( - () -> new double[2], - (a, t) -> { a[0] += mapper.applyAsDouble(t); a[1]++; }, - (a, b) -> { a[0] += b[0]; a[1] += b[1]; return a; }, - a -> (a[1] == 0) ? 0.0d : a[0] / a[1], CH_NOID); + () -> new double[3], + (a, t) -> { sumWithCompensation(a, mapper.applyAsDouble(t)); a[2]++; }, + (a, b) -> { sumWithCompensation(a, b[0]); sumWithCompensation(a, b[1]); a[2] += b[2]; return a; }, + // Better error bounds to add both terms as the final sum to compute average + a -> (a[2] == 0) ? 0.0d : ((a[0] + a[1]) / a[2]), + CH_NOID); } /** diff --git a/jdk/src/share/classes/java/util/stream/DoublePipeline.java b/jdk/src/share/classes/java/util/stream/DoublePipeline.java index 6af346c56b1..ad9c0563824 100644 --- a/jdk/src/share/classes/java/util/stream/DoublePipeline.java +++ b/jdk/src/share/classes/java/util/stream/DoublePipeline.java @@ -377,8 +377,23 @@ abstract class DoublePipeline @Override public final double sum() { - // TODO: better algorithm to compensate for errors - return reduce(0.0, Double::sum); + /* + * In the arrays allocated for the collect operation, index 0 + * holds the high-order bits of the running sum and index 1 + * holds the low-order bits of the sum computed via + * compensated summation. + */ + double[] summation = collect(() -> new double[2], + (ll, d) -> { + Collectors.sumWithCompensation(ll, d); + }, + (ll, rr) -> { + Collectors.sumWithCompensation(ll, rr[0]); + Collectors.sumWithCompensation(ll, rr[1]); + }); + + // Better error bounds to add both terms as the final sum + return summation[0] + summation[1]; } @Override @@ -391,20 +406,37 @@ abstract class DoublePipeline return reduce(Math::max); } + /** + * {@inheritDoc} + * + * @implNote The {@code double} format can represent all + * consecutive integers in the range -253 to + * 253. If the pipeline has more than 253 + * values, the divisor in the average computation will saturate at + * 253, leading to additional numerical errors. + */ @Override public final OptionalDouble average() { - double[] avg = collect(() -> new double[2], - (ll, i) -> { - ll[0]++; - ll[1] += i; + /* + * In the arrays allocated for the collect operation, index 0 + * holds the high-order bits of the running sum, index 1 holds + * the low-order bits of the sum computed via compensated + * summation, and index 2 holds the number of values seen. + */ + double[] avg = collect(() -> new double[3], + (ll, d) -> { + ll[2]++; + Collectors.sumWithCompensation(ll, d); }, (ll, rr) -> { - ll[0] += rr[0]; - ll[1] += rr[1]; + Collectors.sumWithCompensation(ll, rr[0]); + Collectors.sumWithCompensation(ll, rr[1]); + ll[2] += rr[2]; }); - return avg[0] > 0 - ? OptionalDouble.of(avg[1] / avg[0]) - : OptionalDouble.empty(); + return avg[2] > 0 + // Better error bounds to add both terms as the final sum to compute average + ? OptionalDouble.of((avg[0] + avg[1]) / avg[2]) + : OptionalDouble.empty(); } @Override diff --git a/jdk/src/share/classes/javax/crypto/Cipher.java b/jdk/src/share/classes/javax/crypto/Cipher.java index d16c579469c..ffcc7cf329c 100644 --- a/jdk/src/share/classes/javax/crypto/Cipher.java +++ b/jdk/src/share/classes/javax/crypto/Cipher.java @@ -62,17 +62,17 @@ import sun.security.jca.*; * algorithm (e.g., DES), and may be followed by a feedback mode and * padding scheme. * - * A transformation is of the form:
+ *
A transformation is of the form: * *
*
* *- "algorithm/mode/padding" or - *
+ * *
- "algorithm" *
(in the latter case, * provider-specific default values for the mode and padding scheme are used). - * For example, the following is a valid transformation:
+ * For example, the following is a valid transformation: * *
* Cipher c = Cipher.getInstance("DES/CBC/PKCS5Padding"); diff --git a/jdk/src/share/classes/javax/crypto/CipherSpi.java b/jdk/src/share/classes/javax/crypto/CipherSpi.java index aae33318d1c..ce7258157d5 100644 --- a/jdk/src/share/classes/javax/crypto/CipherSpi.java +++ b/jdk/src/share/classes/javax/crypto/CipherSpi.java @@ -62,17 +62,17 @@ import java.nio.ByteBuffer; * algorithm (e.g., DES), and may be followed by a feedback mode and * padding scheme. * - *A transformation is of the form:
+ *
A transformation is of the form: * *
*
* *- "algorithm/mode/padding" or - *
+ * *
- "algorithm" *
(in the latter case, * provider-specific default values for the mode and padding scheme are used). - * For example, the following is a valid transformation:
+ * For example, the following is a valid transformation: * *
* Cipher c = Cipher.getInstance("DES/CBC/PKCS5Padding"); @@ -129,7 +129,7 @@ import java.nio.ByteBuffer; * DES/CBC/PKCS5Padding, one that implements * DES/CFB/PKCS5Padding, and yet another one that implements * DES/OFB/PKCS5Padding. That provider would have the following - *Cipher
properties in its master class:+ *
Cipher
properties in its master class: * ** @@ -160,7 +160,7 @@ import java.nio.ByteBuffer; * and one for OFB), one class for PKCS5Padding, * and a generic DES class that subclasses from
CipherSpi
. * That provider would have the following - *Cipher
properties in its master class:+ *
Cipher
properties in its master class: * ** @@ -197,20 +197,20 @@ import java.nio.ByteBuffer; * Check if the provider has registered a subclass of
CipherSpi
* for the specified "algorithm/mode/padding" transformation. *If the answer is YES, instantiate it. - *
If the answer is NO, go to the next step.
+ *
If the answer is NO, go to the next step. *
- * Check if the provider has registered a subclass of
CipherSpi
* for the sub-transformation "algorithm/mode". *If the answer is YES, instantiate it, and call *
engineSetPadding(padding)
on the new instance. - *If the answer is NO, go to the next step.
+ *
If the answer is NO, go to the next step. *
- * Check if the provider has registered a subclass of
CipherSpi
* for the sub-transformation "algorithm//padding" (note the double * slashes). *If the answer is YES, instantiate it, and call *
engineSetMode(mode)
on the new instance. - *If the answer is NO, go to the next step.
+ *
If the answer is NO, go to the next step. *
- * Check if the provider has registered a subclass of
CipherSpi
* for the sub-transformation "algorithm". diff --git a/jdk/src/share/classes/javax/crypto/KeyGenerator.java b/jdk/src/share/classes/javax/crypto/KeyGenerator.java index 961f0ea9eb3..030207eab51 100644 --- a/jdk/src/share/classes/javax/crypto/KeyGenerator.java +++ b/jdk/src/share/classes/javax/crypto/KeyGenerator.java @@ -66,7 +66,6 @@ import sun.security.jca.GetInstance.Instance; * algorithm-independentinit
methods, it is up to the * provider what to do about the algorithm-specific parameters (if any) to be * associated with each of the keys. - ** *
- Algorithm-Specific Initialization *
For situations where a set of algorithm-specific parameters already diff --git a/jdk/src/share/classes/javax/crypto/SealedObject.java b/jdk/src/share/classes/javax/crypto/SealedObject.java index 9166c28d10c..9cee4d070f1 100644 --- a/jdk/src/share/classes/javax/crypto/SealedObject.java +++ b/jdk/src/share/classes/javax/crypto/SealedObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, 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 @@ -50,7 +50,7 @@ import java.security.NoSuchProviderException; * to a SealedObject. * *
The original object that was sealed can be recovered in two different - * ways:
+ * ways: * *
* @@ -68,8 +68,6 @@ import java.security.NoSuchProviderException; * decryption key, it could hand over the cipher object to * another party who then unseals the sealed object. * - *
- * *
- by using one of the * {@link #getObject(java.security.Key) getObject} methods * that take a
Key
object. diff --git a/jdk/src/share/classes/javax/net/ssl/SSLEngine.java b/jdk/src/share/classes/javax/net/ssl/SSLEngine.java index 92e838623f4..64110880258 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLEngine.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLEngine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, 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 @@ -329,7 +329,7 @@ import java.nio.ReadOnlyBufferException; * is saved. All future delegated tasks will be processed using this * context: that is, all access control decisions will be made using the * context captured at engine creation. - *+ * *
* * Concurrency Notes: @@ -345,7 +345,7 @@ import java.nio.ReadOnlyBufferException; * out-of-order, unexpected or fatal results may occur. ** For example: - *
+ * *
* synchronized (outboundLock) { * sslEngine.wrap(src, dst); diff --git a/jdk/src/share/classes/javax/net/ssl/SSLPermission.java b/jdk/src/share/classes/javax/net/ssl/SSLPermission.java index bac011d6579..b27142128ae 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLPermission.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLPermission.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, 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 @@ -43,7 +43,6 @@ import java.security.*; * The following table lists all the possible SSLPermission target names, * and for each provides a description of what the permission allows * and a discussion of the risks of granting code the permission. - ** *
diff --git a/jdk/src/share/classes/javax/script/ScriptEngineFactory.java b/jdk/src/share/classes/javax/script/ScriptEngineFactory.java index 38c665df5bd..87d931570b2 100644 --- a/jdk/src/share/classes/javax/script/ScriptEngineFactory.java +++ b/jdk/src/share/classes/javax/script/ScriptEngineFactory.java @@ -144,7 +144,7 @@ public interface ScriptEngineFactory { * Returns a String which can be used to invoke a method of a Java object using the syntax * of the supported scripting language. For instance, an implementation for a Javascript * engine might be; - *
+ * *
{@code * public String getMethodCallSyntax(String obj, * String m, String... args) { @@ -180,7 +180,7 @@ public interface ScriptEngineFactory { * Returns a String that can be used as a statement to display the specified String using * the syntax of the supported scripting language. For instance, the implementation for a Perl * engine might be; - *+ * *
* public String getOutputStatement(String toDisplay) { * return "print(" + toDisplay + ")"; @@ -198,7 +198,7 @@ public interface ScriptEngineFactory { /** * Returns a valid scripting language executable program with given statements. * For instance an implementation for a PHP engine might be: - *
+ * *
{@code * public String getProgram(String... statements) { * String retval = "\n"; diff --git a/jdk/src/share/classes/javax/security/auth/PrivateCredentialPermission.java b/jdk/src/share/classes/javax/security/auth/PrivateCredentialPermission.java index 810cff2228a..37a2660cb03 100644 --- a/jdk/src/share/classes/javax/security/auth/PrivateCredentialPermission.java +++ b/jdk/src/share/classes/javax/security/auth/PrivateCredentialPermission.java @@ -228,8 +228,8 @@ public final class PrivateCredentialPermission extends Permission { ** * This method returns true if: - *
- *
- p is an instanceof PrivateCredentialPermission and
+ *
+ *
- p is an instanceof PrivateCredentialPermission and *
- the target name for p is implied by this object's * target name. For example: *
diff --git a/jdk/src/share/classes/javax/security/auth/kerberos/DelegationPermission.java b/jdk/src/share/classes/javax/security/auth/kerberos/DelegationPermission.java index 77aabb8b9d6..bdd3ff9c4a9 100644 --- a/jdk/src/share/classes/javax/security/auth/kerberos/DelegationPermission.java +++ b/jdk/src/share/classes/javax/security/auth/kerberos/DelegationPermission.java @@ -48,14 +48,14 @@ import java.io.IOException; ** For example, to specify the "host" service use of a forwardable TGT the * target permission is specified as follows: - *
+ * *
* DelegationPermission("\"host/foo.example.com@EXAMPLE.COM\" \"krbtgt/EXAMPLE.COM@EXAMPLE.COM\""); *** To give the "backup" service a proxiable nfs service ticket the target permission * might be specified: - *
+ * *
* DelegationPermission("\"backup/bar.example.com@EXAMPLE.COM\" \"nfs/home.EXAMPLE.COM@EXAMPLE.COM\""); *diff --git a/jdk/src/share/classes/javax/security/auth/kerberos/ServicePermission.java b/jdk/src/share/classes/javax/security/auth/kerberos/ServicePermission.java index 50a0517fa44..893284e548c 100644 --- a/jdk/src/share/classes/javax/security/auth/kerberos/ServicePermission.java +++ b/jdk/src/share/classes/javax/security/auth/kerberos/ServicePermission.java @@ -62,7 +62,7 @@ import java.io.IOException; * Authentication Service exchange. ** The possible actions are: - *
+ * *
* initiate - allow the caller to use the credential to * initiate a security context with a service @@ -75,7 +75,7 @@ import java.io.IOException; * * For example, to specify the permission to access to the TGT to * initiate a security context the permission is constructed as follows: - *+ * *
* ServicePermission("krbtgt/EXAMPLE.COM@EXAMPLE.COM", "initiate"); *@@ -89,7 +89,7 @@ import java.io.IOException; * For a Kerberized server the action is "accept". For example, the permission * necessary to access and use the secret key of the Kerberized "host" * service (telnet and the likes) would be constructed as follows: - *+ * *
* ServicePermission("host/foo.example.com@EXAMPLE.COM", "accept"); *diff --git a/jdk/src/share/classes/javax/security/auth/login/LoginContext.java b/jdk/src/share/classes/javax/security/auth/login/LoginContext.java index a9685bca811..ba18e5ce6a0 100644 --- a/jdk/src/share/classes/javax/security/auth/login/LoginContext.java +++ b/jdk/src/share/classes/javax/security/auth/login/LoginContext.java @@ -101,11 +101,11 @@ import sun.security.util.ResourcesMgr; *- If the constructor has a Subject * input parameter, the LoginContext uses the caller-specified * Subject object. - *
+ * *
- If the caller specifies a {@code null} Subject * and a {@code null} value is permitted, * the LoginContext instantiates a new Subject. - *
+ * *
- If the constructor does not have a Subject * input parameter, the LoginContext instantiates a new Subject. *
@@ -132,7 +132,7 @@ import sun.security.util.ResourcesMgr; * {@code getAppConfigurationEntry} with the name, "other" * (the default entry name). If there is no entry for "other", * then a {@code LoginException} is thrown. - *
+ * *
- When LoginContext uses the installed Configuration, the caller * requires the createLoginContext.name and possibly * createLoginContext.other AuthPermissions. Furthermore, the @@ -141,7 +141,7 @@ import sun.security.util.ResourcesMgr; * perform security-sensitive tasks (such as connecting to remote hosts, * and updating the Subject) will require the respective permissions, but * the callers of the LoginContext will not require those permissions. - *
+ * *
- When LoginContext uses a caller-specified Configuration, the caller * does not require any createLoginContext AuthPermission. The LoginContext * saves the {@code AccessControlContext} for the caller, @@ -158,7 +158,7 @@ import sun.security.util.ResourcesMgr; *
- If the constructor has a CallbackHandler * input parameter, the LoginContext uses the caller-specified * CallbackHandler object. - *
+ * *
- If the constructor does not have a CallbackHandler * input parameter, or if the caller specifies a {@code null} * CallbackHandler object (and a {@code null} value is permitted), @@ -171,7 +171,7 @@ import sun.security.util.ResourcesMgr; * with users. The caller thus assumes that the configured * modules have alternative means for authenticating the user. * - *
+ * *
- When the LoginContext uses the installed Configuration (instead of * a caller-specified Configuration, see above), * then this LoginContext must wrap any diff --git a/jdk/src/share/classes/javax/security/auth/x500/X500Principal.java b/jdk/src/share/classes/javax/security/auth/x500/X500Principal.java index 5c0a5621261..77292b0be22 100644 --- a/jdk/src/share/classes/javax/security/auth/x500/X500Principal.java +++ b/jdk/src/share/classes/javax/security/auth/x500/X500Principal.java @@ -314,7 +314,7 @@ public final class X500Principal implements Principal, java.io.Serializable { * this method returns an RFC 2253 conformant string representation * with the following additional canonicalizations: * - *
+ *
*
- Leading zeros are removed from attribute types * that are encoded as dotted decimal OIDs *
- DirectoryString attribute values of type diff --git a/jdk/src/share/classes/javax/swing/Action.java b/jdk/src/share/classes/javax/swing/Action.java index 7223d819681..66fcf836d59 100644 --- a/jdk/src/share/classes/javax/swing/Action.java +++ b/jdk/src/share/classes/javax/swing/Action.java @@ -67,7 +67,7 @@ import java.beans.*; * functionality and broadcast of property changes. For this reason, * you should take care to only use
Action
s where their benefits * are desired, and use simpleActionListener
s elsewhere. - *+ *
* *Swing Components Supporting
*Action
@@ -93,7 +93,7 @@ import java.beans.*; *
null
property value in anAction
(or a *Action
that isnull
) results in the * button's corresponding property being set tonull
. - *+ * *
*
diff --git a/jdk/src/share/classes/javax/swing/DefaultComboBoxModel.java b/jdk/src/share/classes/javax/swing/DefaultComboBoxModel.java index 6e35b6156f0..3cb3c6f22d5 100644 --- a/jdk/src/share/classes/javax/swing/DefaultComboBoxModel.java +++ b/jdk/src/share/classes/javax/swing/DefaultComboBoxModel.java @@ -83,7 +83,7 @@ public class DefaultComboBoxModel extends AbstractListModel implements Mut // implements javax.swing.ComboBoxModel /** * Set the value of the selected item. The selected item may be null. - * + * * @param anObject The combo box value or null for no selection. */ public void setSelectedItem(Object anObject) { diff --git a/jdk/src/share/classes/javax/swing/GroupLayout.java b/jdk/src/share/classes/javax/swing/GroupLayout.java index e3be1ddfdd5..582c96116ca 100644 --- a/jdk/src/share/classes/javax/swing/GroupLayout.java +++ b/jdk/src/share/classes/javax/swing/GroupLayout.java @@ -100,7 +100,7 @@ import static javax.swing.SwingConstants.VERTICAL; * The following diagram shows the same three components, but with the * parallel group along the horizontal axis and the sequential group along * the vertical axis. - *
+ * *
* *
diff --git a/jdk/src/share/classes/javax/swing/InputVerifier.java b/jdk/src/share/classes/javax/swing/InputVerifier.java index aa2a0eeba1f..2cf4ddcaae6 100644 --- a/jdk/src/share/classes/javax/swing/InputVerifier.java +++ b/jdk/src/share/classes/javax/swing/InputVerifier.java @@ -47,7 +47,7 @@ import java.util.*; * either by clicking in it or by pressing TAB. However, if another string * is entered in the first text field, then the user will be unable to * transfer focus to the second text field. - *
+ * *
* import java.awt.*; * import java.util.*; diff --git a/jdk/src/share/classes/javax/swing/JComponent.java b/jdk/src/share/classes/javax/swing/JComponent.java index 3f4d3f25606..d6f35ac3fea 100644 --- a/jdk/src/share/classes/javax/swing/JComponent.java +++ b/jdk/src/share/classes/javax/swing/JComponent.java @@ -4827,7 +4827,6 @@ public abstract class JComponent extends Container implements Serializable, * updating differs from the AWT because programs generally no * longer need to invokevalidate
to get the contents of the * GUI to update. - ** * @see java.awt.Component#invalidate * @see java.awt.Container#validate diff --git a/jdk/src/share/classes/javax/swing/JDialog.java b/jdk/src/share/classes/javax/swing/JDialog.java index 92febed0843..2d8980e3056 100644 --- a/jdk/src/share/classes/javax/swing/JDialog.java +++ b/jdk/src/share/classes/javax/swing/JDialog.java @@ -701,7 +701,7 @@ public class JDialog extends Dialog implements WindowConstants, * Sets the operation that will happen by default when * the user initiates a "close" on this dialog. * You must specify one of the following choices: - *
+ *
**
- {@code DO_NOTHING_ON_CLOSE} * (defined in {@code WindowConstants}): diff --git a/jdk/src/share/classes/javax/swing/JFrame.java b/jdk/src/share/classes/javax/swing/JFrame.java index 27a5a04e276..308320c8ecc 100644 --- a/jdk/src/share/classes/javax/swing/JFrame.java +++ b/jdk/src/share/classes/javax/swing/JFrame.java @@ -324,7 +324,7 @@ public class JFrame extends Frame implements WindowConstants, * Sets the operation that will happen by default when * the user initiates a "close" on this frame. * You must specify one of the following choices: - *
+ *
**
DO_NOTHING_ON_CLOSE
* (defined inWindowConstants
): diff --git a/jdk/src/share/classes/javax/swing/JInternalFrame.java b/jdk/src/share/classes/javax/swing/JInternalFrame.java index 901f1371b81..3183d5c4e90 100644 --- a/jdk/src/share/classes/javax/swing/JInternalFrame.java +++ b/jdk/src/share/classes/javax/swing/JInternalFrame.java @@ -1645,7 +1645,7 @@ public class JInternalFrame extends JComponent implements * Sets the operation that will happen by default when * the user initiates a "close" on this internal frame. * The possible choices are: - *+ *
**
DO_NOTHING_ON_CLOSE
*- Do nothing. diff --git a/jdk/src/share/classes/javax/swing/JLayeredPane.java b/jdk/src/share/classes/javax/swing/JLayeredPane.java index 052fcf34c31..71d57bdabb8 100644 --- a/jdk/src/share/classes/javax/swing/JLayeredPane.java +++ b/jdk/src/share/classes/javax/swing/JLayeredPane.java @@ -43,7 +43,7 @@ import javax.accessibility.*; * For task-oriented documentation and examples of using layered panes see * How to Use a Layered Pane, * a section in The Java Tutorial. - *
+ * *
*
* diff --git a/jdk/src/share/classes/javax/swing/JList.java b/jdk/src/share/classes/javax/swing/JList.java index e62bc80135b..1aae62e861f 100644 --- a/jdk/src/share/classes/javax/swing/JList.java +++ b/jdk/src/share/classes/javax/swing/JList.java @@ -950,7 +950,7 @@ public class JList extends JComponent implements Scrollable, Accessible /** * Defines the way list cells are layed out. Consider a {@code JList} * with five cells. Cells can be layed out in one of the following ways: - * + * *
* VERTICAL: 0 * 1 diff --git a/jdk/src/share/classes/javax/swing/JOptionPane.java b/jdk/src/share/classes/javax/swing/JOptionPane.java index 8bbd49db63a..a2dbf810a1d 100644 --- a/jdk/src/share/classes/javax/swing/JOptionPane.java +++ b/jdk/src/share/classes/javax/swing/JOptionPane.java @@ -106,7 +106,6 @@ import static javax.swing.ClientPropertyKey.PopupFactory_FORCE_HEAVYWEIGHT_POPUP ** All dialogs are modal. Each
showXxxDialog
method blocks * the caller until the user's interaction is complete. - ** *
*
@@ -143,7 +142,7 @@ import static javax.swing.ClientPropertyKey.PopupFactory_FORCE_HEAVYWEIGHT_POPUP * just below the component. This parameter may be null
, * in which case a defaultFrame
is used as the parent, * and the dialog will be - * centered on the screen (depending on the L&F). + * centered on the screen (depending on the {@literal L&F}). *- message
- * A descriptive message to be placed in the dialog box. * In the most common usage, message is just a
String
or @@ -225,42 +224,42 @@ import static javax.swing.ClientPropertyKey.PopupFactory_FORCE_HEAVYWEIGHT_POPUP *- Show an error dialog that displays the message, 'alert': *
* JOptionPane.showMessageDialog(null, "alert", "alert", JOptionPane.ERROR_MESSAGE); - *
+ * *
- Show an internal information dialog with the message, 'information': - *
- * JOptionPane.showInternalMessageDialog(frame, "information",
- *- *
"information", JOptionPane.INFORMATION_MESSAGE);
+ *
+ * JOptionPane.showInternalMessageDialog(frame, "information", + * "information", JOptionPane.INFORMATION_MESSAGE); + **- Show an information panel with the options yes/no and message 'choose one': - *
JOptionPane.showConfirmDialog(null, - *
- *
"choose one", "choose one", JOptionPane.YES_NO_OPTION);
+ *
JOptionPane.showConfirmDialog(null, + * "choose one", "choose one", JOptionPane.YES_NO_OPTION); + **- Show an internal information dialog with the options yes/no/cancel and * message 'please choose one' and title information: - *
JOptionPane.showInternalConfirmDialog(frame, - *
- *
"please choose one", "information",
- *
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);
+ *
JOptionPane.showInternalConfirmDialog(frame, + * "please choose one", "information", + * JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE); + **- Show a warning dialog with the options OK, CANCEL, title 'Warning', and * message 'Click OK to continue': - *
- * Object[] options = { "OK", "CANCEL" };
+ * + * Object[] options = { "OK", "CANCEL" }; * JOptionPane.showOptionDialog(null, "Click OK to continue", "Warning", - *- *
JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE,
- *
null, options, options[0]);
+ * JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, + * null, options, options[0]); + * *
- Show a dialog asking the user to type in a String: *
* String inputValue = JOptionPane.showInputDialog("Please input a value"); - *
+ * *
- Show a dialog asking the user to select a String: - *
+ *
* Object[] possibleValues = { "First", "Second", "Third" };
* Object selectedValue = JOptionPane.showInputDialog(null, - *- *
"Choose one", "Input",
- *
JOptionPane.INFORMATION_MESSAGE, null,
- *
possibleValues, possibleValues[0]);
+ * "Choose one", "Input", + * JOptionPane.INFORMATION_MESSAGE, null, + * possibleValues, possibleValues[0]); + *
* * Direct Use:
* To create and use anJOptionPane
directly, the @@ -281,7 +280,7 @@ import static javax.swing.ClientPropertyKey.PopupFactory_FORCE_HEAVYWEIGHT_POPUP * } * //If there is an array of option buttons: * for(int counter = 0, maxCounter = options.length; - * counter < maxCounter; counter++) { + * counter < maxCounter; counter++) { * if(options[counter].equals(selectedValue)) * return counter; * } @@ -1847,9 +1846,9 @@ public class JOptionPane extends JComponent implements Accessible } /** - * Sets the UI object which implements the L&F for this component. + * Sets the UI object which implements the {@literal L&F} for this component. * - * @param ui theOptionPaneUI
L&F object + * @param ui theOptionPaneUI
{@literal L&F} object * @see UIDefaults#getUI * @beaninfo * bound: true @@ -1864,7 +1863,7 @@ public class JOptionPane extends JComponent implements Accessible } /** - * Returns the UI object which implements the L&F for this component. + * Returns the UI object which implements the {@literal L&F} for this component. * * @return theOptionPaneUI
object */ @@ -1873,7 +1872,7 @@ public class JOptionPane extends JComponent implements Accessible } /** - * Notification from theUIManager
that the L&F has changed. + * Notification from theUIManager
that the {@literal L&F} has changed. * Replaces the current UI object with the latest version from the *UIManager
. * @@ -1886,7 +1885,7 @@ public class JOptionPane extends JComponent implements Accessible /** * Returns the name of the UI class that implements the - * L&F for this component. + * {@literal L&F} for this component. * * @return the string "OptionPaneUI" * @see JComponent#getUIClassID @@ -2103,7 +2102,7 @@ public class JOptionPane extends JComponent implements Accessible * Sets the options to display. * The option type is used by the Look and Feel to * determine what buttons to show (unless options are supplied). - * @param newType an integer specifying the options the L&F is to display: + * @param newType an integer specifying the options the {@literal L&F} is to display: *DEFAULT_OPTION
, *YES_NO_OPTION
, *YES_NO_CANCEL_OPTION
, diff --git a/jdk/src/share/classes/javax/swing/JScrollBar.java b/jdk/src/share/classes/javax/swing/JScrollBar.java index efcac811546..1c0eac1af7f 100644 --- a/jdk/src/share/classes/javax/swing/JScrollBar.java +++ b/jdk/src/share/classes/javax/swing/JScrollBar.java @@ -192,9 +192,9 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible /** - * Sets the L&F object that renders this component. + * Sets the {@literal L&F} object that renders this component. * - * @param ui theScrollBarUI
L&F object + * @param ui theScrollBarUI
{@literal L&F} object * @see UIDefaults#getUI * @since 1.4 * @beaninfo @@ -606,9 +606,9 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible * Sets the four BoundedRangeModel properties after forcing * the arguments to obey the usual constraints: *- * minimum <= value <= value+extent <= maximum + * minimum ≤ value ≤ value+extent ≤ maximum *- *+ * * * @see BoundedRangeModel#setRangeProperties * @see #setValue diff --git a/jdk/src/share/classes/javax/swing/JScrollPane.java b/jdk/src/share/classes/javax/swing/JScrollPane.java index 4c5f1e88823..ecb3d8f34d9 100644 --- a/jdk/src/share/classes/javax/swing/JScrollPane.java +++ b/jdk/src/share/classes/javax/swing/JScrollPane.java @@ -53,7 +53,7 @@ import java.beans.Transient; * How to Use Scroll Panes, * a section in The Java Tutorial. Note that *
JScrollPane
does not support heavyweight components. - *+ * *
*
* diff --git a/jdk/src/share/classes/javax/swing/JTable.java b/jdk/src/share/classes/javax/swing/JTable.java index bdcb27b1b17..526afcf66bf 100644 --- a/jdk/src/share/classes/javax/swing/JTable.java +++ b/jdk/src/share/classes/javax/swing/JTable.java @@ -73,7 +73,7 @@ import sun.swing.SwingLazyValue; * but provides defaults for these features so that simple tables can be * set up easily. For example, to set up a table with 10 rows and 10 * columns of numbers: - * + * *
* TableModel dataModel = new AbstractTableModel() { * public int getColumnCount() { return 10; } @@ -659,7 +659,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable * should contain the values for that row. In other words, * the value of the cell at row 1, column 5 can be obtained * with the following code: - *+ * *
((Vector)rowData.elementAt(1)).elementAt(5);** @param rowData the data for the new table @@ -674,7 +674,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable *
rowData
, with column names,columnNames
. *rowData
is an array of rows, so the value of the cell at row 1, * column 5 can be obtained with the following code: - *+ * *
rowData[1][5];** All rows must be of the same length as
columnNames
. @@ -3062,9 +3062,9 @@ public class JTable extends JComponent implements TableModelListener, Scrollable * interface that allows any data structure containing a collection * of elements with a size, preferred size, maximum size and minimum size * to have its elements manipulated by the algorithm. - *+ * *
Distributing the delta
- *+ * *
Overview
** Call "DELTA" the difference between the target size and the @@ -3073,7 +3073,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable * sizes and adding a share of the DELTA - that share being based on * how far each preferred size is from its limiting bound (minimum or * maximum). - *
+ * *
Definition
** Call the individual constraints min[i], max[i], and pref[i]. @@ -3081,21 +3081,21 @@ public class JTable extends JComponent implements TableModelListener, Scrollable * Call their respective sums: MIN, MAX, and PREF. *
* Each new size will be calculated using: - *
+ * *
* size[i] = pref[i] + delta[i] ** where each individual delta[i] is calculated according to: ** If (DELTA < 0) we are in shrink mode where: - *
+ * *
* DELTA * delta[i] = ------------ * (pref[i] - min[i]) * (PREF - MIN) ** If (DELTA > 0) we are in expand mode where: - *+ * *
* DELTA * delta[i] = ------------ * (max[i] - pref[i]) @@ -6373,7 +6373,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable ** Here's an example of creating a
MessageFormat
that can be * used to print "Duke's Table: Page - " and the current page number: - *+ * *
* // notice the escaping of the single quote * // notice how the page number is included with "{0}" @@ -7686,7 +7686,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable * Returns a boolean value indicating whether the specified column * is selected. * - * @param r zero-based column of the table + * @param c zero-based column of the table * @return the boolean value true if the specified column is selected. * Otherwise, false. * @since 1.3 diff --git a/jdk/src/share/classes/javax/swing/JTextArea.java b/jdk/src/share/classes/javax/swing/JTextArea.java index 80b2bb729e3..06b6ea593b7 100644 --- a/jdk/src/share/classes/javax/swing/JTextArea.java +++ b/jdk/src/share/classes/javax/swing/JTextArea.java @@ -93,7 +93,7 @@ import java.io.IOException; * JTextArea myArea = ??; * myArea.getDocument().addDocumentListener(myListener); *- *+ * *
*
- Newlines *
- diff --git a/jdk/src/share/classes/javax/swing/JTextPane.java b/jdk/src/share/classes/javax/swing/JTextPane.java index a6a76edcf32..b2ca7fc89a4 100644 --- a/jdk/src/share/classes/javax/swing/JTextPane.java +++ b/jdk/src/share/classes/javax/swing/JTextPane.java @@ -49,7 +49,7 @@ import javax.swing.plaf.*; * the default attributes to use if not overridden by attributes set * on the paragraph or character run. Components and images may * be embedded in the flow of text. - *
+ * *
*
- Newlines *
- diff --git a/jdk/src/share/classes/javax/swing/JTree.java b/jdk/src/share/classes/javax/swing/JTree.java index fdacb72aa3c..196cde453ab 100644 --- a/jdk/src/share/classes/javax/swing/JTree.java +++ b/jdk/src/share/classes/javax/swing/JTree.java @@ -3956,7 +3956,7 @@ public class JTree extends JComponent implements Scrollable, Accessible * allows children depends on how it was created. * * @return true if this node allows children, false otherwise - * @see #JTree.DynamicUtilTreeNode + * @see JTree.DynamicUtilTreeNode */ public boolean isLeaf() { return !getAllowsChildren(); diff --git a/jdk/src/share/classes/javax/swing/LookAndFeel.java b/jdk/src/share/classes/javax/swing/LookAndFeel.java index 024162cfa50..2aad9290fc9 100644 --- a/jdk/src/share/classes/javax/swing/LookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/LookAndFeel.java @@ -91,7 +91,7 @@ import java.util.StringTokenizer; * to provide a specific set of defaults. These are documented in the * classes that require the specific default. * - *
ComponentUIs and defaults
+ *ComponentUIs and defaults
* * All {@code ComponentUIs} typically need to set various properties * on the {@code JComponent} the {@code ComponentUI} is providing the @@ -120,7 +120,7 @@ import java.util.StringTokenizer; * {@code ComponentUI} implementations should use the various install methods * provided by this class as they handle the necessary checking and install * the property using the recommended guidelines. - *+ * *
Exceptions
* * All of the install methods provided by {@code LookAndFeel} need to diff --git a/jdk/src/share/classes/javax/swing/Painter.java b/jdk/src/share/classes/javax/swing/Painter.java index 7b2e3ef11ef..57ac21fb1e4 100644 --- a/jdk/src/share/classes/javax/swing/Painter.java +++ b/jdk/src/share/classes/javax/swing/Painter.java @@ -54,7 +54,7 @@ import java.awt.Graphics2D; * } * } * } - * + * * *This interface makes no guarantees of threadsafety.
* diff --git a/jdk/src/share/classes/javax/swing/RowFilter.java b/jdk/src/share/classes/javax/swing/RowFilter.java index 6d9fc7f33f8..ccf779cf137 100644 --- a/jdk/src/share/classes/javax/swing/RowFilter.java +++ b/jdk/src/share/classes/javax/swing/RowFilter.java @@ -31,6 +31,7 @@ import java.util.Date; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; /** *RowFilter
is used to filter out entries from the @@ -129,7 +130,7 @@ public abstract class RowFilter{ /** * Throws an IllegalArgumentException if any of the values in - * columns are < 0. + * columns are {@literal <} 0. */ private static void checkIndices(int[] columns) { for (int i = columns.length - 1; i >= 0; i--) { diff --git a/jdk/src/share/classes/javax/swing/SizeSequence.java b/jdk/src/share/classes/javax/swing/SizeSequence.java index a04fe2cb867..4d8d65e13a8 100644 --- a/jdk/src/share/classes/javax/swing/SizeSequence.java +++ b/jdk/src/share/classes/javax/swing/SizeSequence.java @@ -52,7 +52,7 @@ package javax.swing; * * The following figure shows the relationship between size and position data * for a multi-column component. - *
+ * *
* min * in terms of negation: - * + * *
* X - Y = X + (-Y) * diff --git a/jdk/src/share/classes/javax/swing/SpringLayout.java b/jdk/src/share/classes/javax/swing/SpringLayout.java index dc85b2c1dcd..95444bfed59 100644 --- a/jdk/src/share/classes/javax/swing/SpringLayout.java +++ b/jdk/src/share/classes/javax/swing/SpringLayout.java @@ -297,7 +297,7 @@ public class SpringLayout implements LayoutManager2 { * and "a - b" is equal to *Spring.sum(a, Spring.minus(b))
. * See the - * {@link SpringSpring
API documentation} + * {@link Spring Spring API documentation} * for further details * of spring arithmetic. * diff --git a/jdk/src/share/classes/javax/swing/SwingWorker.java b/jdk/src/share/classes/javax/swing/SwingWorker.java index 5775bcb4ea9..746b78aa7d2 100644 --- a/jdk/src/share/classes/javax/swing/SwingWorker.java +++ b/jdk/src/share/classes/javax/swing/SwingWorker.java @@ -62,7 +62,6 @@ import sun.swing.AccumulativeRunnable; * * * - ** *
* These constraints mean that a GUI application with time intensive diff --git a/jdk/src/share/classes/javax/swing/border/CompoundBorder.java b/jdk/src/share/classes/javax/swing/border/CompoundBorder.java index f1a6d8538e6..6a28c1a3893 100644 --- a/jdk/src/share/classes/javax/swing/border/CompoundBorder.java +++ b/jdk/src/share/classes/javax/swing/border/CompoundBorder.java @@ -36,7 +36,7 @@ import java.beans.ConstructorProperties; * * For example, this class may be used to add blank margin space * to a component with an existing decorative border: - *
+ * *
* Border border = comp.getBorder(); * Border margin = new EmptyBorder(10,10,10,10); diff --git a/jdk/src/share/classes/javax/swing/event/TableModelEvent.java b/jdk/src/share/classes/javax/swing/event/TableModelEvent.java index 05c5c7bdc76..ab450cbd72d 100644 --- a/jdk/src/share/classes/javax/swing/event/TableModelEvent.java +++ b/jdk/src/share/classes/javax/swing/event/TableModelEvent.java @@ -34,7 +34,7 @@ import javax.swing.table.*; * and all references to rows and columns are in the co-ordinate * system of the model. * Depending on the parameters used in the constructors, the TableModelevent - * can be used to specify the following types of changes:+ * can be used to specify the following types of changes: * *
* TableModelEvent(source); // The data, ie. all rows changed diff --git a/jdk/src/share/classes/javax/swing/event/TreeModelListener.java b/jdk/src/share/classes/javax/swing/event/TreeModelListener.java index b48fdfb2548..48a945f116f 100644 --- a/jdk/src/share/classes/javax/swing/event/TreeModelListener.java +++ b/jdk/src/share/classes/javax/swing/event/TreeModelListener.java @@ -86,7 +86,7 @@ public interface TreeModelListener extends EventListener { *Invoked after the tree has drastically changed structure from a * given node down. If the path returned by e.getPath() is of length * one and the first element does not identify the current root node - * the first element should become the new root of the tree.
+ * the first element should become the new root of the tree. * *
Use
e.getPath()
* to get the path to the node. diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java index 28b1d0a09bb..b55f8ab0fbc 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java @@ -48,7 +48,7 @@ import sun.security.action.GetPropertyAction; * Provides the basic look and feel for aJOptionPane
. *BasicMessagePaneUI
provides a means to place an icon, * message and buttons into aContainer
. - * Generally, the layout will look like:+ * Generally, the layout will look like: *
* ------------------ * | i | message | diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java index 9a56bd7b3b8..9704705b2f5 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java @@ -521,7 +521,7 @@ public class BasicSplitPaneDivider extends Container * MouseHandler is responsible for converting mouse events * (released, dragged...) into the appropriate DragController * methods. - *+ * */ protected class MouseHandler extends MouseAdapter implements MouseMotionListener @@ -890,7 +890,7 @@ public class BasicSplitPaneDivider extends Container * Used to layout a
BasicSplitPaneDivider
. * Layout for the divider * involves appropriately moving the left/right buttons around. - *+ * */ protected class DividerLayout implements LayoutManager { diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java index 0f47e8965c5..1ec9921426f 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java @@ -2015,7 +2015,7 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * LayoutManager used for JSplitPanes with an orientation of * VERTICAL_SPLIT. - *
+ * */ public class BasicVerticalLayoutManager extends BasicHorizontalLayoutManager diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java index 821483049f0..cd41f852715 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java @@ -1398,7 +1398,7 @@ public class BasicTreeUI extends TreeUI /** * Paints the vertical part of the leg. The receiver should - * NOT modify
clipBounds
,insets
.+ * NOT modify
clipBounds
,insets
. */ protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path) { diff --git a/jdk/src/share/classes/javax/swing/table/DefaultTableModel.java b/jdk/src/share/classes/javax/swing/table/DefaultTableModel.java index 5abf1e82aa1..6bf39981d3d 100644 --- a/jdk/src/share/classes/javax/swing/table/DefaultTableModel.java +++ b/jdk/src/share/classes/javax/swing/table/DefaultTableModel.java @@ -182,7 +182,7 @@ public class DefaultTableModel extends AbstractTableModel implements Serializabl * each a single row of values. In other words, to get to the cell * at row 1, column 5:* - *
((Vector)getDataVector().elementAt(1)).elementAt(5);
+ *
((Vector)getDataVector().elementAt(1)).elementAt(5);
* * @return the vector of vectors containing the tables data values * @@ -306,7 +306,7 @@ public class DefaultTableModel extends AbstractTableModel implements Serializabl * Sets the number of rows in the model. If the new size is greater * than the current size, new rows are added to the end of the model * If the new size is less than the current size, all - * rows at indexrowCount
and greater are discarded.+ * rows at index
rowCount
and greater are discarded. * * @param rowCount the new number of rows * @see #setRowCount @@ -330,7 +330,7 @@ public class DefaultTableModel extends AbstractTableModel implements Serializabl * Sets the number of rows in the model. If the new size is greater * than the current size, new rows are added to the end of the model * If the new size is less than the current size, all - * rows at indexrowCount
and greater are discarded.+ * rows at index
rowCount
and greater are discarded. * * @see #setColumnCount * @since 1.3 @@ -414,7 +414,7 @@ public class DefaultTableModel extends AbstractTableModel implements Serializabl * After the move, the row that was at indexstart
* will be at indexto
. * This method will send atableChanged
notification - * message to all the listeners.+ message to all the listeners. * *
* Examples of moves: @@ -473,7 +473,7 @@ public class DefaultTableModel extends AbstractTableModel implements Serializabl * of columns, new columns are added to the end of each row in the model. * If the number ofnewIdentifier
s is less than the current * number of columns, all the extra columns at the end of a row are - * discarded.+ * discarded. * * @param columnIdentifiers vector of column identifiers. If *
null
, set the model @@ -490,7 +490,7 @@ public class DefaultTableModel extends AbstractTableModel implements Serializabl * of columns, new columns are added to the end of each row in the model. * If the number ofnewIdentifier
s is less than the current * number of columns, all the extra columns at the end of a row are - * discarded.+ * discarded. * * @param newIdentifiers array of column identifiers. * If
null
, set diff --git a/jdk/src/share/classes/javax/swing/table/TableModel.java b/jdk/src/share/classes/javax/swing/table/TableModel.java index 2c4794bc980..5b13fc1aede 100644 --- a/jdk/src/share/classes/javax/swing/table/TableModel.java +++ b/jdk/src/share/classes/javax/swing/table/TableModel.java @@ -34,7 +34,7 @@ import javax.swing.event.*; * * TheJTable
can be set up to display any data * model which implements the - *TableModel
interface with a couple of lines of code:+ *
TableModel
interface with a couple of lines of code: ** TableModel myData = new MyTableModel(); * JTable table = new JTable(myData); @@ -42,7 +42,7 @@ import javax.swing.event.*; * * For further documentation, see Creating a Table Model * in The Java Tutorial. - *+ * * @author Philip Milne * @see JTable */ diff --git a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java index 71e9d5d8c60..f8a4332a839 100644 --- a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java +++ b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java @@ -804,7 +804,7 @@ public abstract class AbstractDocument implements Document, Serializable { * returns will give better performance for situations where large * parts of the document are being scanned. The following is an example * of using the partial return to access the entire document: - *
+ * *
* int nleft = doc.getDocumentLength(); * Segment text = new Segment(); diff --git a/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java b/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java index f47a1c62c62..139615bdf0e 100644 --- a/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java +++ b/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java @@ -41,7 +41,7 @@ import javax.swing.UIManager; * of text document. This implementation provides a default * implementation which treats text as plain text and * provides a minimal set of actions for a simple editor. - *+ * *
*
- Newlines *
- diff --git a/jdk/src/share/classes/javax/swing/text/Document.java b/jdk/src/share/classes/javax/swing/text/Document.java index 5b79ac41a28..946e18ae222 100644 --- a/jdk/src/share/classes/javax/swing/text/Document.java +++ b/jdk/src/share/classes/javax/swing/text/Document.java @@ -354,7 +354,7 @@ public interface Document { * returns will give better performance for situations where large * parts of the document are being scanned. The following is an example * of using the partial return to access the entire document: - *
+ * *
* * int nleft = doc.getDocumentLength(); diff --git a/jdk/src/share/classes/javax/swing/text/JTextComponent.java b/jdk/src/share/classes/javax/swing/text/JTextComponent.java index 2ec12639cfb..5f4fd2021be 100644 --- a/jdk/src/share/classes/javax/swing/text/JTextComponent.java +++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java @@ -87,7 +87,6 @@ import sun.swing.SwingAccessor; * General Rules for Using Text Components, * a section in The Java Tutorial. * - *
*
*
- Caret Changes *
- @@ -108,7 +107,6 @@ import sun.swing.SwingAccessor; * Note: Non-editable text components also have a caret though * it may not be painted. * - *
*
- Commands *
- * Text components provide a number of commands that can be used @@ -120,7 +118,6 @@ import sun.swing.SwingAccessor; * found with the {@link #getActions} method. These actions * can be bound to key events, fired from buttons, etc. * - *
*
- Text Input *
- * The text components support flexible and internationalized text input, using @@ -206,7 +203,6 @@ import sun.swing.SwingAccessor; *
- caret movement forward and backward * * - *
*
- Model/View Split *
- * The text components have a model-view split. A text component pulls @@ -231,14 +227,12 @@ import sun.swing.SwingAccessor; * {@link DocumentListener} * interface and registered interest with the model being observed. * - *
*
- Location Information *
- * The capability of determining the location of text in * the view is provided. There are two methods, {@link #modelToView} * and {@link #viewToModel} for determining this information. * - *
*
- Undo/Redo support *
- * Support for an edit history mechanism is provided to allow @@ -249,7 +243,6 @@ import sun.swing.SwingAccessor; * The support is provided by the Document model, which allows * one to attach UndoableEditListener implementations. * - *
*
- Thread Safety *
- * The swing text components provide some support of thread @@ -261,13 +254,12 @@ import sun.swing.SwingAccessor; * The methods that are safe to call asynchronously are marked * with comments. * - *
*
- Newlines *
- * For a discussion on how newlines are handled, see * DefaultEditorKit. * - *
+ * *
- Printing support *
- * Several {@link #print print} methods are provided for basic diff --git a/jdk/src/share/classes/javax/swing/text/View.java b/jdk/src/share/classes/javax/swing/text/View.java index 675aad55530..2b49055ab59 100644 --- a/jdk/src/share/classes/javax/swing/text/View.java +++ b/jdk/src/share/classes/javax/swing/text/View.java @@ -144,7 +144,6 @@ A view has the following responsibilities:
-
- {@link #paint(java.awt.Graphics, java.awt.Shape) paint}
- Translate between the model and view coordinate systems.
- diff --git a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java index 8b84bf73ba5..852776e61c7 100644 --- a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java +++ b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java @@ -2089,7 +2089,7 @@ public class HTMLDocument extends DefaultStyledDocument { * *
* The assignment of the actions described is shown in the - * following table for the tags defined in
HTML.Tag
.+ * following table for the tags defined in
HTML.Tag
. **
* Tag Action HTML.Tag.A
CharacterAction @@ -3968,7 +3968,7 @@ public class HTMLDocument extends DefaultStyledDocument { } /** - * This is set to true when and end is invoked for . + * This is set to true when and end is invoked for {@literal }. */ private boolean receivedEndHTML; /** Number of times flushBuffer
has been invoked. */ @@ -3990,7 +3990,7 @@ public class HTMLDocument extends DefaultStyledDocument { boolean inTitle = false; boolean lastWasNewline = true; boolean emptyAnchor; - /** True if (!emptyDocument && insertTag == null), this is used so + /** True if (!emptyDocument && insertTag == null), this is used so * much it is cached. */ boolean midInsert; /** True when the body has been encountered. */ diff --git a/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java b/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java index 9cca8f95313..468f8626d2f 100644 --- a/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java +++ b/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java @@ -71,7 +71,7 @@ import java.lang.ref.*; * The modeling of HTML is provided by the classHTMLDocument
. * Its documentation describes the details of how the HTML is modeled. * The editing support leverages heavily off of the text package. - *+ * *
- * Extendable/Scalable *
- @@ -114,7 +114,7 @@ import java.lang.ref.*; * attributes for display. This helps make the View implementations * more general purpose * - *
+ * *
- * Asynchronous Loading *
- @@ -127,7 +127,7 @@ import java.lang.ref.*; * by the
HTMLDocument.HTMLReader
class. The actual * work is done by theDefaultStyledDocument
and *AbstractDocument
classes in the text package. - *+ * *
- * Customization from current LAF *
- @@ -141,7 +141,7 @@ import java.lang.ref.*; * The support for this is provided by the
StyleSheet
* class. The presentation of the HTML can be heavily influenced * by the setting of the StyleSheet property on the EditorKit. - *+ * *
- * Not lossy *
- @@ -839,7 +839,7 @@ public class HTMLEditorKit extends StyledEditorKit implements Accessible { * if the given position represents a link. If this was the result * of a mouse click,
x
and *y
will give the location of the mouse, otherwise - * they will be < 0. + * they will be {@literal <} 0. * * @param pos the position * @param html the editor pane @@ -2027,8 +2027,8 @@ public class HTMLEditorKit extends StyledEditorKit implements Accessible { * Paints a portion of a highlight. * * @param g the graphics context - * @param offs0 the starting model offset >= 0 - * @param offs1 the ending model offset >= offs1 + * @param offs0 the starting model offset ≥ 0 + * @param offs1 the ending model offset ≥ offs1 * @param bounds the bounding box of the view, which is not * necessarily the region to paint. * @param c the editor diff --git a/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java b/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java index c31a96e2f79..0cd55cb843d 100644 --- a/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java +++ b/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java @@ -469,7 +469,7 @@ public class FixedHeightLayoutCache extends AbstractLayoutCache { *Invoked after the tree has drastically changed structure from a * given node down. If the path returned by e.getPath() is of length * one and the first element does not identify the current root node - * the first element should become the new root of the tree.
+ * the first element should become the new root of the tree. * *
e.path() holds the path to the node.
*e.childIndices() returns null.
@@ -677,7 +677,7 @@ public class FixedHeightLayoutCache extends AbstractLayoutCache { /** * Messages getTreeNodeForPage(path, onlyIfVisible, shouldCreate, - * path.length) as long as path is non-null and the length is > 0. + * path.length) as long as path is non-null and the length is {@literal >} 0. * Otherwise returns null. */ private FHTreeStateNode getNodeForPath(TreePath path, @@ -1283,7 +1283,7 @@ public class FixedHeightLayoutCache extends AbstractLayoutCache { /** * Messaged when a child has been inserted at index. For all the - * children that have a childIndex >= index their index is incremented + * children that have a childIndex ≥ index their index is incremented * by one. */ protected void childInsertedAtModelIndex(int index, diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java index e12abb17a70..5b332243dfb 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java @@ -2594,7 +2594,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { requests = new MessageHeader(); setRequests = false; - setRequestMethod("GET"); + super.setRequestMethod("GET"); // avoid the connecting check poster = null; if (!checkReuseConnection()) connect(); diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_de.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_de.properties index 4dd5d5f9129..23f986c9797 100644 --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_de.properties +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_de.properties @@ -33,6 +33,7 @@ error.nosuch.fileordir={0}: Datei oder Verzeichnis nicht vorhanden error.write.file=Fehler beim Schreiben in vorhandener JAR-Datei error.create.dir={0}: Verzeichnis konnte nicht erstellt werden error.incorrect.length=Falsche L\u00E4nge bei der Verarbeitung: {0} +error.create.tempfile=Es konnte keine tempor\u00E4re Datei erstellt werden out.added.manifest=Manifest wurde hinzugef\u00FCgt out.update.manifest=Manifest wurde aktualisiert out.ignore.entry=Eintrag {0} wird ignoriert @@ -44,4 +45,4 @@ out.extracted=extrahiert: {0} out.inflated=\ vergr\u00F6\u00DFert: {0} out.size=(ein = {0}) (aus = {1}) -usage=Verwendung: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] Dateien...\nOptionen:\n -c Neues Archiv erstellen\n -t Inhaltsverzeichnis f\u00FCr Archiv auflisten\n -x Genannte (oder alle) Dateien aus Archiv extrahieren\n -u Vorhandenes Archiv aktualisieren\n -v Verbose-Ausgabe f\u00FCr Standardausgabe generieren\n -f Namen der Archivdatei angeben\n -m Manifest-Informationen von angegebener Manifest-Datei einschlie\u00DFen\n -e Anwendungs-Einstiegspunkt f\u00FCr die \n in einer ausf\u00FChrbaren JAR-Datei geb\u00FCndelte Standalone-Anwendung angeben\n -0 Nur speichern (keine ZIP-Komprimierung)\n -M Keine Manifest-Datei f\u00FCr die Eintr\u00E4ge erstellen\n -i Indexinformationen f\u00FCr angegebenen JAR-Dateien erstellen\n -C zum angegebenen Verzeichnis wechseln und folgende Datei einschlie\u00DFen\nFalls eine Datei ein Verzeichnis ist, wird dieses rekursiv verarbeitet.\nDer Name der Manifest-Datei, der Name der Archivdatei und der Name des Einstiegspunkts werden\nin derselben Reihenfolge wie die Kennzeichen "m", "f" und "e" angegeben.\n\nBeispiel 1: Archivieren Sie zwei Klassendateien in ein Archiv mit Namen "classes.jar": \n jar cvf classes.jar Foo.class Bar.class \nBeispiel 2: Verwenden Sie die vorhandenen Manifest-Datei "mymanifest", und archivieren Sie\n alle Dateien im Verzeichnis foo/ in "classes.jar": \n jar cvfm classes.jar mymanifest -C foo/ .\n +usage=Verwendung: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] Dateien ...\nOptionen:\n -c Neues Archiv erstellen\n -t Inhaltsverzeichnis f\u00FCr Archiv anzeigen\n -x Benannte (oder alle) Dateien aus dem Archiv extrahieren\n -u Vorhandenes Archiv aktualisieren\n -v Ausgabe im Verbose-Modus aus Standard-Ausgabe generieren\n -f Dateinamen f\u00FCr Archiv angeben\n -m Manifest-Informationen aus angegebener Manifest-Datei einschlie\u00DFen\n -n Pack200-Normalisierung nach Erstellung eines neuen Archivs ausf\u00FChren\n -e Anwendungs-Einstiegspunkt f\u00FCr alleinstehende Anwendung angeben\n in einer ausf\u00FChrbaren JAR-Datei geb\u00FCndelt\n -0 nur speichern; keine ZIP-Komprimierung verwenden\n -M keine Manifest-Datei f\u00FCr die Eintr\u00E4ge erstellen\n -i Index-Informationen f\u00FCr die angegebenen JAR-Dateien generieren\n -C zu angegebenem Verzeichnis wechseln und die folgende Datei einschlie\u00DFen\nDateien, die Verzeichnisse sind, werden rekursiv verarbeitet.\nDie Namen der Manifest-Datei, der Archiv-Datei und des Einstiegspunkts sind\nin derselben Reihenfolge wie die Kennzeichen f\u00FCr "m", "f" und "e" angegeben.\n\nBeispiel 1: Archivieren von zwei Klassendateien in einem Archiv mit dem Namen "classes.jar": \n jar cvf classes.jar Foo.class Bar.class \nBeispiel 2: Verwenden einer vorhandenen Manifest-Datei mit dem Namen "mymanifest" und Archivieren aller\n Dateien im Verzeichnis mit dem Namen "foo/" in die Archiv-Datei "classes.jar": \n jar cvfm classes.jar mymanifest -C foo/ .\n diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_es.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_es.properties index 39e71f8825b..7a8645067ca 100644 --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_es.properties +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_es.properties @@ -33,6 +33,7 @@ error.nosuch.fileordir={0} : no existe tal archivo o directorio error.write.file=Error al escribir un archivo jar existente error.create.dir={0} : no se ha podido crear el directorio error.incorrect.length=longitud incorrecta al procesar: {0} +error.create.tempfile=No se ha podido crear el archivo temporal out.added.manifest=manifiesto agregado out.update.manifest=manifiesto actualizado out.ignore.entry=ignorando entrada {0} @@ -44,4 +45,4 @@ out.extracted=extra\u00EDdo: {0} out.inflated=\ inflado: {0} out.size=(entrada = {0}) (salida = {1}) -usage=Sintaxis: jar {ctxui}[vfm0Me] [archive-jar] [archive-manifiesto] [punto-entrada] [-C dir] archivos...\nOpciones:\n -c crear nuevo archivo\n -t crear la tabla de contenido del archivo\n -x extraer el archive mencionado (o todos) del archivo\n -u actualizar archive existente\n -v generar salida detallada de los datos de salida est\u00E1ndar\n -f especificar nombre de archive de almacenamiento\n -m incluir informaci\u00F3n de manifiesto del archive de manifiesto especificado\n -e especificar punto de entrada de la aplicaci\u00F3n para la aplicaci\u00F3n aut\u00F3noma \n que se incluye dentro de un archive jar ejecutable\n -0 s\u00F3lo almacenar; no utilizar compresi\u00F3n ZIP\n -M no crear un archive de manifiesto para las entradas\n -i generar informaci\u00F3n de \u00EDndice para los archives jar especificados\n -C cambiar al directorio especificado e incluir el archivo siguiente\nSi alg\u00FAn archivo es un directorio, se procesar\u00E1 de forma recurrente.\nEl nombre del archivo de manifiesto, el nombre del archivo de almacenamiento y el nombre del punto de entrada se\nespecifican en el mismo orden que los indicadores 'm', 'f' y 'e'.\n\nEjemplo 1: para archivar archivos de dos clases en un archivo llamado classes.jar: \n jar cvf classes.jar Foo.class Bar.class \nEjemplo 2: utilice un archivo de manifiesto existente 'mymanifest' y archive todos los\n archivos del directorio foo/ en 'classes.jar': \n jar cvfm classes.jar mymanifest -C foo/ .\n +usage=Sintaxis: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] archivos...\nOpciones:\n -c crear nuevo archivo\n -t crear la tabla de contenido del archivo\n -x extraer el archive mencionado (o todos) del archivo\n -u actualizar archive existente\n -v generar salida detallada de los datos de salida est\u00E1ndar\n -f especificar nombre de archive de almacenamiento\n -m incluir informaci\u00F3n de manifiesto del archive de manifiesto especificado\n -n realizar normalizaci\u00F3n de Pack200 despu\u00E9s de crear un nuevo archivo\n -e especificar punto de entrada de la aplicaci\u00F3n para la aplicaci\u00F3n aut\u00F3noma \n que se incluye dentro de un archive jar ejecutable\n -0 s\u00F3lo almacenar; no utilizar compresi\u00F3n ZIP\n -M no crear un archive de manifiesto para las entradas\n -i generar informaci\u00F3n de \u00EDndice para los archives jar especificados\n -C cambiar al directorio especificado e incluir el archivo siguiente\nSi alg\u00FAn archivo es un directorio, se procesar\u00E1 de forma recurrente.\nEl nombre del archivo de manifiesto, el nombre del archivo de almacenamiento y el nombre del punto de entrada se\nespecifican en el mismo orden que los indicadores 'm', 'f' y 'e'.\n\nEjemplo 1: para archivar archivos de dos clases en un archivo llamado classes.jar: \n jar cvf classes.jar Foo.class Bar.class \nEjemplo 2: utilice un archivo de manifiesto existente 'mymanifest' y archive todos los\n archivos del directorio foo/ en 'classes.jar': \n jar cvfm classes.jar mymanifest -C foo/ .\n diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_fr.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_fr.properties index c7cae813be4..8f41319f0f6 100644 --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_fr.properties +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_fr.properties @@ -33,6 +33,7 @@ error.nosuch.fileordir={0} : fichier ou r\u00E9pertoire introuvable error.write.file=Erreur lors de l'\u00E9criture d'un fichier JAR existant error.create.dir={0} : impossible de cr\u00E9er le r\u00E9pertoire error.incorrect.length=longueur incorrecte lors du traitement de : {0} +error.create.tempfile=Impossible de cr\u00E9er un fichier temporaire out.added.manifest=manifeste ajout\u00E9 out.update.manifest=manifeste mis \u00E0 jour out.ignore.entry=entr\u00E9e {0} ignor\u00E9e @@ -44,4 +45,4 @@ out.extracted=extrait : {0} out.inflated=\ d\u00E9compress\u00E9 : {0} out.size=(entr\u00E9e = {0}) (sortie = {1}) -usage=Syntaxe : jar {ctxui}[vfm0Me] [fichier-jar] [fichier-manifeste] [point-entr\u00E9e] [-C r\u00E9p] fichiers...\nOptions :\n -c cr\u00E9e une archive\n -t affiche la table des mati\u00E8res de l'archive\n -x extrait les fichiers nomm\u00E9s (ou tous les fichiers) de l'archive\n -u met \u00E0 jour l'archive existante\n -v g\u00E9n\u00E8re une version d\u00E9taill\u00E9e d'une sortie standard\n -f sp\u00E9cifie le nom du fichier archive\n -m inclut les informations de manifeste \u00E0 partir du fichier de manifeste sp\u00E9cifi\u00E9\n -e sp\u00E9cifie le point d'entr\u00E9e d'une application en mode autonome \n int\u00E9gr\u00E9e \u00E0 un fichier JAR ex\u00E9cutable\n -0 stockage uniquement, pas de compression ZIP\n -M ne cr\u00E9e pas de fichier manifeste pour les entr\u00E9es\n -i g\u00E9n\u00E8re les informations d'index des fichiers JAR sp\u00E9cifi\u00E9s\n -C passe au r\u00E9pertoire sp\u00E9cifi\u00E9 et inclut le fichier suivant\nSi l'un des fichiers est un r\u00E9pertoire, celui-ci est trait\u00E9 r\u00E9cursivement.\nLes noms du fichier manifeste, du fichier archive et du point d'entr\u00E9e sont\nsp\u00E9cifi\u00E9s dans le m\u00EAme ordre que celui des indicateurs m, f et e.\n\nExemple 1 : pour archiver deux fichiers de classe dans une archive intitul\u00E9e classes.jar : \n jar cvf classes.jar Foo.class Bar.class \nExemple 2 : pour utiliser un fichier manifeste existant 'monmanifeste', puis archiver tous les\n fichiers du r\u00E9pertoire foo/ dans 'classes.jar' : \n jar cvfm classes.jar monmanifeste -C foo/ .\n +usage=Syntaxe : jar {ctxui}[vfmn0Me] [fichier-jar] [fichier-manifeste] [point-entr\u00E9e] [-C r\u00E9p] fichiers...\nOptions :\n -c cr\u00E9e une archive\n -t affiche la table des mati\u00E8res de l'archive\n -x extrait les fichiers nomm\u00E9s (ou tous les fichiers) de l'archive\n -u met \u00E0 jour l'archive existante\n -v g\u00E9n\u00E8re une version d\u00E9taill\u00E9e d'une sortie standard\n -f sp\u00E9cifie le nom du fichier archive\n -m inclut les informations de manifeste \u00E0 partir du fichier manifeste sp\u00E9cifi\u00E9\n -n effectue une normalisation Pack200 apr\u00E8s la cr\u00E9ation d'une archive\n -e sp\u00E9cifie le point d'entr\u00E9e d'une application en mode autonome \n int\u00E9gr\u00E9e \u00E0 un fichier JAR ex\u00E9cutable\n -0 stockage uniquement, pas de compression ZIP\n -M ne cr\u00E9e pas de fichier manifeste pour les entr\u00E9es\n -i g\u00E9n\u00E8re les informations d'index des fichiers JAR sp\u00E9cifi\u00E9s\n -C passe au r\u00E9pertoire sp\u00E9cifi\u00E9 et inclut le fichier suivant\nSi l'un des fichiers est un r\u00E9pertoire, celui-ci est trait\u00E9 r\u00E9cursivement.\nLes noms du fichier manifeste, du fichier d'archive et du point d'entr\u00E9e sont\nsp\u00E9cifi\u00E9s dans le m\u00EAme ordre que celui des indicateurs m, f et e.\n\nExemple 1 : pour archiver deux fichiers de classe dans une archive intitul\u00E9e classes.jar : \n jar cvf classes.jar Foo.class Bar.class \nExemple 2 : pour utiliser un fichier manifeste existant 'monmanifeste', puis archiver tous les\n fichiers du r\u00E9pertoire foo/ dans 'classes.jar' : \n jar cvfm classes.jar monmanifeste -C foo/ .\n diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_it.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_it.properties index 54099b7fd6a..74bc9b7f836 100644 --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_it.properties +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_it.properties @@ -33,6 +33,7 @@ error.nosuch.fileordir={0} : file o directory inesistente error.write.file=Errore durante la scrittura del file jar esistente error.create.dir={0} : impossibile creare la directory error.incorrect.length=lunghezza non valida durante l''elaborazione: {0} +error.create.tempfile=Impossibile creare il file temporaneo. out.added.manifest=aggiunto manifest out.update.manifest=aggiornato manifest out.ignore.entry=la voce {0} sar\u00E0 ignorata @@ -44,4 +45,4 @@ out.extracted=estratto: {0} out.inflated=\ decompresso: {0} out.size=(in = {0}) (out = {1}) -usage=Uso: jar {ctxui}[vfm0Me] [file-jar] [file-manifest] [punto di ingresso] [-C dir] file ...\nOpzioni:\n -c crea un nuovo archivio\n -t visualizza l'indice dell'archivio\n -x estrae i file con nome (o tutti i file) dall'archivio\n -u aggiorna l'archivio esistente\n -v genera output commentato dall'output standard\n -f specifica il nome file dell'archivio\n -m include informazioni manifest dal file manifest specificato\n -e specifica il punto di ingresso per l'applicazione stand-alone \n inclusa nel file jar eseguibile\n -0 solo memorizzazione; senza compressione ZIP\n -M consente di non creare un file manifest per le voci\n -i genera informazioni sull'indice per i file jar specificati\n -C imposta la directory specificata e include il file seguente\nSe un file \u00E8 una directory, verr\u00E0 elaborato in modo ricorsivo.\nIl nome del file manifest, del file di archivio e del punto di ingresso devono\nessere specificati nello stesso ordine dei flag 'm', 'f' ed 'e'.\n\nEsempio 1: archiviazione di due file di classe in un archivio con il nome classes.jar: \n jar cvf classes.jar Foo.class Bar.class \nEsempio 2: utilizzo del file manifest esistente 'mymanifest' e archiviazione di tutti i\n file della directory foo/ in 'classes.jar': \n jar cvfm classes.jar mymanifest -C foo/ .\n +usage=Uso: jar {ctxui}[vfmn0Me] [file-jar] [file-manifest] [punto di ingresso] [-C dir] file ...\nOpzioni:\n -c crea un nuovo archivio\n -t visualizza l'indice dell'archivio\n -x estrae i file con nome (o tutti i file) dall'archivio\n -u aggiorna l'archivio esistente\n -v genera output commentato dall'output standard\n -f specifica il nome file dell'archivio\n -m include informazioni manifest dal file manifest specificato\n -n esegue la normalizzazione Pack200 dopo la creazione di un nuovo archivio\n -e specifica il punto di ingresso per l'applicazione standalone \n inclusa nel file jar eseguibile\n -0 solo memorizzazione; senza compressione ZIP\n -M consente di non creare un file manifest per le voci\n -i genera informazioni sull'indice per i file jar specificati\n -C imposta la directory specificata e include il file seguente\nSe un file \u00E8 una directory, verr\u00E0 elaborato in modo ricorsivo.\nIl nome del file manifest, del file di archivio e del punto di ingresso devono\nessere specificati nello stesso ordine dei flag 'm', 'f' ed 'e'.\n\nEsempio 1: archiviazione di due file di classe in un archivio con il nome classes.jar: \n jar cvf classes.jar Foo.class Bar.class \nEsempio 2: utilizzo del file manifest esistente 'mymanifest' e archiviazione di tutti i\n file della directory foo/ in 'classes.jar': \n jar cvfm classes.jar mymanifest -C foo/ .\n diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_ja.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_ja.properties index 0a1457eb1b3..1705543b3be 100644 --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_ja.properties +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_ja.properties @@ -33,6 +33,7 @@ error.nosuch.fileordir={0}\u3068\u3044\u3046\u30D5\u30A1\u30A4\u30EB\u307E\u305F error.write.file=\u65E2\u5B58jar\u30D5\u30A1\u30A4\u30EB\u306E\u66F8\u8FBC\u307F\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F error.create.dir=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F error.incorrect.length={0}\u306E\u51E6\u7406\u4E2D\u306B\u4E0D\u6B63\u306A\u9577\u3055\u304C\u3042\u308A\u307E\u3057\u305F +error.create.tempfile=\u4E00\u6642\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F out.added.manifest=\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u304C\u8FFD\u52A0\u3055\u308C\u307E\u3057\u305F out.update.manifest=\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F out.ignore.entry=\u30A8\u30F3\u30C8\u30EA{0}\u3092\u7121\u8996\u3057\u307E\u3059 @@ -44,4 +45,4 @@ out.extracted={0}\u304C\u62BD\u51FA\u3055\u308C\u307E\u3057\u305F out.inflated=\ {0}\u304C\u5C55\u958B\u3055\u308C\u307E\u3057\u305F out.size=(\u5165={0})(\u51FA={1}) -usage=\u4F7F\u7528\u65B9\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u30AA\u30D7\u30B7\u30E7\u30F3:\n -c \u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u65B0\u898F\u4F5C\u6210\u3059\u308B\n -t \u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u5185\u5BB9\u3092\u4E00\u89A7\u8868\u793A\u3059\u308B\n -x \u6307\u5B9A\u306E(\u307E\u305F\u306F\u3059\u3079\u3066\u306E)\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6\u304B\u3089\u62BD\u51FA\u3059\u308B\n -u \u65E2\u5B58\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u66F4\u65B0\u3059\u308B\n -v \u6A19\u6E96\u51FA\u529B\u306B\u8A73\u7D30\u306A\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n -f \u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3059\u308B\n -m \u6307\u5B9A\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u60C5\u5831\u3092\u53D6\u308A\u8FBC\u3080\n -e \u5B9F\u884C\u53EF\u80FDjar\u30D5\u30A1\u30A4\u30EB\u306B\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u305F\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\n \u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u3092\u6307\u5B9A\u3059\u308B\n -0 \u683C\u7D0D\u306E\u307F\u3002ZIP\u5727\u7E2E\u3092\u4F7F\u7528\u3057\u306A\u3044\n -M \u30A8\u30F3\u30C8\u30EA\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u306A\u3044\n -i \u6307\u5B9A\u306Ejar\u30D5\u30A1\u30A4\u30EB\u306E\u7D22\u5F15\u60C5\u5831\u3092\u751F\u6210\u3059\u308B\n -C \u6307\u5B9A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u5909\u66F4\u3057\u3001\u4EE5\u4E0B\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53D6\u308A\u8FBC\u3080\n\u30D5\u30A1\u30A4\u30EB\u304C\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u5834\u5408\u306F\u518D\u5E30\u7684\u306B\u51E6\u7406\u3055\u308C\u307E\u3059\u3002\n\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3001\u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u304A\u3088\u3073\u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u540D\u306F\u3001\n\u30D5\u30E9\u30B0'm'\u3001'f'\u3001'e'\u306E\u6307\u5B9A\u3068\u540C\u3058\u9806\u756A\u3067\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\n\u4F8B1: 2\u3064\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6classes.jar\u306B\u4FDD\u5B58\u3059\u308B:\n jar cvf classes.jar Foo.class Bar.class\n\u4F8B2: \u65E2\u5B58\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB'mymanifest'\u3092\u4F7F\u7528\u3057\u3001foo/\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\n \u5168\u30D5\u30A1\u30A4\u30EB\u3092'classes.jar'\u306B\u30A2\u30FC\u30AB\u30A4\u30D6\u3059\u308B:\n jar cvfm classes.jar mymanifest -C foo/ .\n +usage=\u4F7F\u7528\u65B9\u6CD5: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u30AA\u30D7\u30B7\u30E7\u30F3:\n -c \u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u65B0\u898F\u4F5C\u6210\u3059\u308B\n -t \u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u5185\u5BB9\u3092\u4E00\u89A7\u8868\u793A\u3059\u308B\n -x \u6307\u5B9A\u306E(\u307E\u305F\u306F\u3059\u3079\u3066\u306E)\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6\u304B\u3089\u62BD\u51FA\u3059\u308B\n -u \u65E2\u5B58\u30A2\u30FC\u30AB\u30A4\u30D6\u3092\u66F4\u65B0\u3059\u308B\n -v \u6A19\u6E96\u51FA\u529B\u306B\u8A73\u7D30\u306A\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n -f \u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3059\u308B\n -m \u6307\u5B9A\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u60C5\u5831\u3092\u53D6\u308A\u8FBC\u3080\n -n \u65B0\u898F\u30A2\u30FC\u30AB\u30A4\u30D6\u306E\u4F5C\u6210\u5F8C\u306BPack200\u6B63\u898F\u5316\u3092\u5B9F\u884C\u3059\u308B\n -e \u5B9F\u884C\u53EF\u80FDjar\u30D5\u30A1\u30A4\u30EB\u306B\u30D0\u30F3\u30C9\u30EB\u3055\u308C\u305F\u30B9\u30BF\u30F3\u30C9\u30A2\u30ED\u30F3\u30FB\n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u3092\u6307\u5B9A\u3059\u308B\n -0 \u683C\u7D0D\u306E\u307F\u3002ZIP\u5727\u7E2E\u3092\u4F7F\u7528\u3057\u306A\u3044\n -M \u30A8\u30F3\u30C8\u30EA\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u306A\u3044\n -i \u6307\u5B9A\u306Ejar\u30D5\u30A1\u30A4\u30EB\u306E\u7D22\u5F15\u60C5\u5831\u3092\u751F\u6210\u3059\u308B\n -C \u6307\u5B9A\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u5909\u66F4\u3057\u3001\u6B21\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u53D6\u308A\u8FBC\u3080\n\u30D5\u30A1\u30A4\u30EB\u304C\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u5834\u5408\u306F\u518D\u5E30\u7684\u306B\u51E6\u7406\u3055\u308C\u307E\u3059\u3002\n\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u3001\u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u30D5\u30A1\u30A4\u30EB\u540D\u304A\u3088\u3073\u30A8\u30F3\u30C8\u30EA\u30FB\u30DD\u30A4\u30F3\u30C8\u540D\u306F\u3001\n\u30D5\u30E9\u30B0'm'\u3001'f'\u3001'e'\u306E\u6307\u5B9A\u3068\u540C\u3058\u9806\u756A\u3067\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\n\u4F8B1: 2\u3064\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30FC\u30AB\u30A4\u30D6classes.jar\u306B\u4FDD\u5B58\u3059\u308B: \n jar cvf classes.jar Foo.class Bar.class \n\u4F8B2: \u65E2\u5B58\u306E\u30DE\u30CB\u30D5\u30A7\u30B9\u30C8\u30FB\u30D5\u30A1\u30A4\u30EB'mymanifest'\u3092\u4F7F\u7528\u3057\u3001foo/\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\n \u5168\u30D5\u30A1\u30A4\u30EB\u3092'classes.jar'\u306B\u30A2\u30FC\u30AB\u30A4\u30D6\u3059\u308B: \n jar cvfm classes.jar mymanifest -C foo/ .\n diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_ko.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_ko.properties index 2b414a0369d..079dee84ab2 100644 --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_ko.properties +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_ko.properties @@ -33,6 +33,7 @@ error.nosuch.fileordir={0}: \uD574\uB2F9 \uD30C\uC77C \uB610\uB294 \uB514\uB809\ error.write.file=\uAE30\uC874 jar \uD30C\uC77C\uC5D0 \uC4F0\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. error.create.dir={0}: \uB514\uB809\uD1A0\uB9AC\uB97C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. error.incorrect.length=\uCC98\uB9AC \uC911 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC740 \uAE38\uC774\uAC00 \uBC1C\uACAC\uB428: {0} +error.create.tempfile=\uC784\uC2DC \uD30C\uC77C\uC744 \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. out.added.manifest=Manifest\uB97C \uCD94\uAC00\uD568 out.update.manifest=Manifest\uB97C \uC5C5\uB370\uC774\uD2B8\uD568 out.ignore.entry={0} \uD56D\uBAA9\uC744 \uBB34\uC2DC\uD558\uB294 \uC911 @@ -44,4 +45,4 @@ out.extracted=\uCD94\uCD9C\uB428: {0} out.inflated=\ \uC99D\uAC00\uB428: {0} out.size=(\uC785\uB825 = {0}) (\uCD9C\uB825 = {1}) -usage=\uC0AC\uC6A9\uBC95: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\uC635\uC158:\n -c \uC0C8 \uC544\uCE74\uC774\uBE0C\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n -t \uC544\uCE74\uC774\uBE0C\uC5D0 \uB300\uD55C \uBAA9\uCC28\uB97C \uB098\uC5F4\uD569\uB2C8\uB2E4.\n -x \uBA85\uBA85\uB41C(\uB610\uB294 \uBAA8\uB4E0) \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uC5D0\uC11C \uCD94\uCD9C\uD569\uB2C8\uB2E4.\n -u \uAE30\uC874 \uC544\uCE74\uC774\uBE0C\uB97C \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n -v \uD45C\uC900 \uCD9C\uB825\uC5D0 \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n -f \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n -m \uC9C0\uC815\uB41C Manifest \uD30C\uC77C\uC758 Manifest \uC815\uBCF4\uB97C \uD3EC\uD568\uD569\uB2C8\uB2E4.\n -e jar \uC2E4\uD589 \uD30C\uC77C\uC5D0 \uBC88\uB4E4\uB85C \uC81C\uACF5\uB41C \uB3C5\uB9BD\uD615 \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8\uC758 \n \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8 \uC2DC\uC791 \uC9C0\uC810\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n -0 \uC800\uC7A5 \uC804\uC6A9: ZIP \uC555\uCD95\uC744 \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n -M \uD56D\uBAA9\uC5D0 \uB300\uD574 Manifest \uD30C\uC77C\uC744 \uC0DD\uC131\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n -i \uC9C0\uC815\uB41C jar \uD30C\uC77C\uC5D0 \uB300\uD55C \uC778\uB371\uC2A4 \uC815\uBCF4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n -C \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uB85C \uBCC0\uACBD\uD558\uACE0 \uB2E4\uC74C \uD30C\uC77C\uC744 \uD3EC\uD568\uD569\uB2C8\uB2E4.\n\uD2B9\uC815 \uD30C\uC77C\uC774 \uB514\uB809\uD1A0\uB9AC\uC77C \uACBD\uC6B0 \uC21C\uD658\uC801\uC73C\uB85C \uCC98\uB9AC\uB429\uB2C8\uB2E4.\nManifest \uD30C\uC77C \uC774\uB984, \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984 \uBC0F \uC2DC\uC791 \uC9C0\uC810 \uC774\uB984\uC740\n'm', 'f' \uBC0F 'e' \uD50C\uB798\uADF8\uC640 \uB3D9\uC77C\uD55C \uC21C\uC11C\uB85C \uC9C0\uC815\uB429\uB2C8\uB2E4.\n\n\uC608 1: classes.jar\uB77C\uB294 \uC544\uCE74\uC774\uBE0C\uC5D0 \uB450 \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n jar cvf classes.jar Foo.class Bar.class \n\uC608 2: \uAE30\uC874 Manifest \uD30C\uC77C 'mymanifest'\uB97C \uC0AC\uC6A9\uD558\uC5EC\n foo/ \uB514\uB809\uD1A0\uB9AC\uC758 \uBAA8\uB4E0 \uD30C\uC77C\uC744 'classes.jar'\uB85C \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n jar cvfm classes.jar mymanifest -C foo/ .\n +usage=\uC0AC\uC6A9\uBC95: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\uC635\uC158:\n -c \uC0C8 \uC544\uCE74\uC774\uBE0C\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n -t \uC544\uCE74\uC774\uBE0C\uC5D0 \uB300\uD55C \uBAA9\uCC28\uB97C \uB098\uC5F4\uD569\uB2C8\uB2E4.\n -x \uBA85\uBA85\uB41C(\uB610\uB294 \uBAA8\uB4E0) \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uC5D0\uC11C \uCD94\uCD9C\uD569\uB2C8\uB2E4.\n -u \uAE30\uC874 \uC544\uCE74\uC774\uBE0C\uB97C \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n -v \uD45C\uC900 \uCD9C\uB825\uC5D0 \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n -f \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n -m \uC9C0\uC815\uB41C Manifest \uD30C\uC77C\uC758 Manifest \uC815\uBCF4\uB97C \uD3EC\uD568\uD569\uB2C8\uB2E4.\n -n \uC0C8 \uC544\uCE74\uC774\uBE0C\uB97C \uC0DD\uC131\uD55C \uD6C4 Pack200 \uC815\uADDC\uD654\uB97C \uC218\uD589\uD569\uB2C8\uB2E4.\n -e jar \uC2E4\uD589 \uD30C\uC77C\uC5D0 \uBC88\uB4E4\uB85C \uC81C\uACF5\uB41C \uB3C5\uB9BD\uD615 \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8\uC758 \n \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8 \uC2DC\uC791 \uC9C0\uC810\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n -0 \uC800\uC7A5 \uC804\uC6A9: ZIP \uC555\uCD95\uC744 \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n -M \uD56D\uBAA9\uC5D0 \uB300\uD574 Manifest \uD30C\uC77C\uC744 \uC0DD\uC131\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n -i \uC9C0\uC815\uB41C jar \uD30C\uC77C\uC5D0 \uB300\uD55C \uC778\uB371\uC2A4 \uC815\uBCF4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n -C \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uB85C \uBCC0\uACBD\uD558\uACE0 \uB2E4\uC74C \uD30C\uC77C\uC744 \uD3EC\uD568\uD569\uB2C8\uB2E4.\n\uD2B9\uC815 \uD30C\uC77C\uC774 \uB514\uB809\uD1A0\uB9AC\uC77C \uACBD\uC6B0 \uC21C\uD658\uC801\uC73C\uB85C \uCC98\uB9AC\uB429\uB2C8\uB2E4.\nManifest \uD30C\uC77C \uC774\uB984, \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984 \uBC0F \uC2DC\uC791 \uC9C0\uC810 \uC774\uB984\uC740\n'm', 'f' \uBC0F 'e' \uD50C\uB798\uADF8\uC640 \uB3D9\uC77C\uD55C \uC21C\uC11C\uB85C \uC9C0\uC815\uB429\uB2C8\uB2E4.\n\n\uC608 1: classes.jar\uB77C\uB294 \uC544\uCE74\uC774\uBE0C\uC5D0 \uB450 \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n jar cvf classes.jar Foo.class Bar.class \n\uC608 2: \uAE30\uC874 Manifest \uD30C\uC77C 'mymanifest'\uB97C \uC0AC\uC6A9\uD558\uC5EC\n foo/ \uB514\uB809\uD1A0\uB9AC\uC758 \uBAA8\uB4E0 \uD30C\uC77C\uC744 'classes.jar'\uB85C \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n jar cvfm classes.jar mymanifest -C foo/ . diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_pt_BR.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_pt_BR.properties index db6bd74b1e3..c2d31475e7b 100644 --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_pt_BR.properties +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_pt_BR.properties @@ -33,6 +33,7 @@ error.nosuch.fileordir={0} : n\u00E3o h\u00E1 tal arquivo ou diret\u00F3rio error.write.file=Erro ao gravar o arquivo jar existente error.create.dir={0} : n\u00E3o foi poss\u00EDvel criar o diret\u00F3rio error.incorrect.length=largura incorreta durante o processamento: {0} +error.create.tempfile=N\u00E3o foi poss\u00EDvel criar um arquivo tempor\u00E1rio out.added.manifest=manifesto adicionado out.update.manifest=manifesto atualizado out.ignore.entry=ignorando entrada {0} @@ -44,4 +45,4 @@ out.extracted=extra\u00EDdo: {0} out.inflated=\ inflado: {0} out.size=(entrada = {0}) (sa\u00EDda= {1}) -usage=Uso: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] arquivos ...\nOp\u00E7\u00F5es:\n -c cria novo arquivo compactado\n -t lista o sum\u00E1rio do arquivo compactado\n -x extrai arquivos com o nome (ou todos) do arquivo compactado\n -u atualizar o arquivo compactado existente\n -v gera sa\u00EDda detalhada na sa\u00EDda padr\u00E3o\n -f especifica o nome do arquivo do arquivo compactado\n -m inclui as informa\u00E7\u00F5es do manifesto do arquivo de manifesto especificado\n -e especifica o ponto de entrada da aplica\u00E7\u00E3o para aplica\u00E7\u00E3o independente \n empacotando em um arquivo jar execut\u00E1vel\n -0 armazena somente; n\u00E3o usa compacta\u00E7\u00E3o ZIP\n -M n\u00E3o cria um arquivo de manifesto para as entradas\n -i gera informa\u00E7\u00F5es de \u00EDndice para os arquivos especificados\n -C altera para o diret\u00F3rio e inclui o arquivo seguinte\nSe nenhum arquivo for um diret\u00F3rio, ent\u00E3o ser\u00E1 processado repetidamente.\nO nome do arquivo de manifesto, o nome do arquivo compactado e o nome do ponto de entrada s\u00E3o\nespecificados na mesma ordem dos flags 'm', 'f' e 'e'.\n\nExemplo 1: para arquivar dois arquivos de classe em um arquivo compactado com o nome classes.jar: \n jar cvf classes.jar Foo.class Bar.class \nExemplo 2: use um arquivo de manifesto existente 'mymanifest' e arquive todos os\n arquivos no diret\u00F3rio foo/ na 'classes.jar': \n jar cvfm classes.jar mymanifest -C foo/ .\n +usage=Uso: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] arquivos ...\nOp\u00E7\u00F5es:\n -c cria novo archive\n -t lista o sum\u00E1rio do archive\n -x extrai arquivos com o nome (ou todos) do arquivo compactado\n -u atualiza o archive existente\n -v gera sa\u00EDda detalhada na sa\u00EDda padr\u00E3o\n -f especifica o nome do archive\n -m inclui as informa\u00E7\u00F5es do manifesto do arquivo de manifesto especificado\n -n executa a normaliza\u00E7\u00E3o Pack200 ap\u00F3s a cria\u00E7\u00E3o de um novo archive\n -e especifica o ponto de entrada da aplica\u00E7\u00E3o para aplica\u00E7\u00E3o independente \n empacotada em um arquivo jar execut\u00E1vel\n -0 armazena somente; n\u00E3o usa compacta\u00E7\u00E3o ZIP\n -M n\u00E3o cria um arquivo de manifesto para as entradas\n -i gera informa\u00E7\u00F5es de \u00EDndice para os arquivos jar especificados\n -C altera para o diret\u00F3rio especificado e inclui o arquivo seguinte\nSe algum arquivo for um diret\u00F3rio, ent\u00E3o ser\u00E1 processado repetidamente.\nO nome do arquivo de manifesto, o nome do archive e o nome do ponto de entrada s\u00E3o\nespecificados na mesma ordem dos flags 'm', 'f' e 'e'.\n\nExemplo 1: para arquivar dois arquivos de classe em um archive chamado classes.jar: \n jar cvf classes.jar Foo.class Bar.class \nExemplo 2: use um arquivo de manifesto existente 'mymanifest' e arquive todos os\n arquivos no diret\u00F3rio foo/ na 'classes.jar': \n jar cvfm classes.jar mymanifest -C foo/ .\n diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_sv.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_sv.properties index 90ca52ac999..b88532fa330 100644 --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_sv.properties +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_sv.properties @@ -33,6 +33,7 @@ error.nosuch.fileordir={0} : det finns ingen s\u00E5dan fil eller katalog error.write.file=Det uppstod ett fel vid skrivning till befintlig jar-fil. error.create.dir={0} : kunde inte skapa n\u00E5gon katalog error.incorrect.length=ogiltig l\u00E4ngd vid bearbetning: {0} +error.create.tempfile=Kunde inte skapa en tillf\u00E4llig fil out.added.manifest=tillagt manifestfil out.update.manifest=uppdaterat manifest out.ignore.entry=ignorerar posten {0} @@ -44,4 +45,4 @@ out.extracted=extraherat: {0} out.inflated=\ uppackat: {0} out.size=(in = {0}) (ut = {1}) -usage=Syntax: jar {ctxui}[vfm0Me] [jar-fil] [manifestfil] [startpunkt] [-C katalog] filer...\nAlternativ:\n -c skapa nytt arkiv\n -t lista inneh\u00E5llsf\u00F6rteckning f\u00F6r arkiv\n -x extrahera namngivna (eller alla) filer fr\u00E5n arkiv\n -u uppdatera befintligt arkiv\n -v generera utf\u00F6rliga utdata vid standardutmatning\n -f ange arkivfilens namn\n -m inkludera manifestinformation fr\u00E5n angivet manifest\n -e ange programstartpunkt f\u00F6r frist\u00E5ende applikation \n som medf\u00F6ljer i en jar-programfil\n -0 endast lagra (ingen zip-komprimering)\n -M skapa inte n\u00E5gon manifestfil f\u00F6r posterna\n -i generera indexinformation f\u00F6r de angivna jar-filerna\n -C \u00E4ndra till den angivna katalogen och inkludera f\u00F6ljande fil\nOm en fil \u00E4r en katalog bearbetas den rekursivt.\nNamnen p\u00E5 manifestfilen, arkivfilen och startpunkten anges i samma\nordning som m-, f- och e-flaggorna.\n\nExempel 1: S\u00E5 h\u00E4r arkiverar du tv\u00E5 klassfiler i ett arkiv med namnet classes.jar: \n jar cvf classes.jar Foo.class Bar.class \nExempel 2: Anv\u00E4nd en befintlig manifestfil (mymanifest) och arkivera alla\n filer fr\u00E5n katalogen foo/ i classes.jar: \n jar cvfm classes.jar mymanifest -C foo/ .\n +usage=Syntax: jar {ctxui}[vfmn0Me] [jar-fil] [manifestfil] [startpunkt] [-C katalog] filer ...\nAlternativ:\n -c skapa nytt arkiv\n -t lista inneh\u00E5llsf\u00F6rteckning f\u00F6r arkiv\n -x extrahera namngivna (eller alla) filer fr\u00E5n arkiv\n -u uppdatera befintligt arkiv\n -v generera utf\u00F6rliga utdata vid standardutmatning\n -f ange arkivfilens namn\n -m inkludera manifestinformation fr\u00E5n angivet manifest\n -n utf\u00F6r Pack200-normalisering efter att ha skapat ett nytt arkiv\n -e ange programstartpunkt f\u00F6r frist\u00E5ende applikation \n som medf\u00F6ljer i en jar-programfil\n -0 endast lagra (ingen zip-komprimering)\n -M skapa inte n\u00E5gon manifestfil f\u00F6r posterna\n -i generera indexinformation f\u00F6r de angivna jar-filerna\n -C \u00E4ndra till den angivna katalogen och inkludera f\u00F6ljande fil\nOm en fil \u00E4r en katalog bearbetas den rekursivt.\nNamnen p\u00E5 manifestfilen, arkivfilen och startpunkten anges\ni samma ordning som m-, f- och e-flaggorna.\n\nExempel 1: S\u00E5 h\u00E4r arkiverar du tv\u00E5 klassfiler i ett arkiv med namnet classes.jar: \n jar cvf classes.jar Foo.class Bar.class \nExempel 2: Anv\u00E4nd en befintlig manifestfil (mymanifest) och arkivera alla\n filer fr\u00E5n katalogen foo/ i classes.jar: \n jar cvfm classes.jar mymanifest -C foo/ .\n diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_CN.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_CN.properties index 146e06c3cdf..08607cce375 100644 --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_CN.properties +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_CN.properties @@ -33,6 +33,7 @@ error.nosuch.fileordir={0}: \u6CA1\u6709\u8FD9\u4E2A\u6587\u4EF6\u6216\u76EE\u5F error.write.file=\u5199\u5165\u73B0\u6709\u7684 jar \u6587\u4EF6\u65F6\u51FA\u9519 error.create.dir={0}: \u65E0\u6CD5\u521B\u5EFA\u76EE\u5F55 error.incorrect.length=\u5904\u7406\u65F6\u9047\u5230\u4E0D\u6B63\u786E\u7684\u957F\u5EA6: {0} +error.create.tempfile=\u65E0\u6CD5\u521B\u5EFA\u4E34\u65F6\u6587\u4EF6 out.added.manifest=\u5DF2\u6DFB\u52A0\u6E05\u5355 out.update.manifest=\u5DF2\u66F4\u65B0\u6E05\u5355 out.ignore.entry=\u6B63\u5728\u5FFD\u7565\u6761\u76EE{0} @@ -44,4 +45,4 @@ out.extracted=\u5DF2\u63D0\u53D6: {0} out.inflated=\ \u5DF2\u89E3\u538B: {0} out.size=(\u8F93\u5165 = {0}) (\u8F93\u51FA = {1}) -usage=\u7528\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u9009\u9879\u5305\u62EC: \n -c \u521B\u5EFA\u65B0\u7684\u5F52\u6863\u6587\u4EF6\n -t \u5217\u51FA\u5F52\u6863\u76EE\u5F55\n -x \u4ECE\u6863\u6848\u4E2D\u63D0\u53D6\u6307\u5B9A\u7684 (\u6216\u6240\u6709) \u6587\u4EF6\n -u \u66F4\u65B0\u73B0\u6709\u7684\u5F52\u6863\u6587\u4EF6\n -v \u5728\u6807\u51C6\u8F93\u51FA\u4E2D\u751F\u6210\u8BE6\u7EC6\u8F93\u51FA\n -f \u6307\u5B9A\u5F52\u6863\u6587\u4EF6\u540D\n -m \u5305\u542B\u6307\u5B9A\u6E05\u5355\u6587\u4EF6\u4E2D\u7684\u6E05\u5355\u4FE1\u606F\n -e \u4E3A\u6346\u7ED1\u5230\u53EF\u6267\u884C jar \u6587\u4EF6\u7684\u72EC\u7ACB\u5E94\u7528\u7A0B\u5E8F\n \u6307\u5B9A\u5E94\u7528\u7A0B\u5E8F\u5165\u53E3\u70B9\n -0 \u4EC5\u5B58\u50A8; \u4E0D\u4F7F\u7528\u60C5\u51B5\u4EFB\u4F55 ZIP \u538B\u7F29\n -M \u4E0D\u521B\u5EFA\u6761\u76EE\u7684\u6E05\u5355\u6587\u4EF6\n -i \u4E3A\u6307\u5B9A\u7684 jar \u6587\u4EF6\u751F\u6210\u7D22\u5F15\u4FE1\u606F\n -C \u66F4\u6539\u4E3A\u6307\u5B9A\u7684\u76EE\u5F55\u5E76\u5305\u542B\u5176\u4E2D\u7684\u6587\u4EF6\n\u5982\u679C\u6709\u4EFB\u4F55\u76EE\u5F55\u6587\u4EF6, \u5219\u5BF9\u5176\u8FDB\u884C\u9012\u5F52\u5904\u7406\u3002\n\u6E05\u5355\u6587\u4EF6\u540D, \u5F52\u6863\u6587\u4EF6\u540D\u548C\u5165\u53E3\u70B9\u540D\u79F0\u7684\u6307\u5B9A\u987A\u5E8F\n\u4E0E 'm', 'f' \u548C 'e' \u6807\u8BB0\u7684\u6307\u5B9A\u987A\u5E8F\u76F8\u540C\u3002\n\n\u793A\u4F8B 1: \u5C06\u4E24\u4E2A\u7C7B\u6587\u4EF6\u5F52\u6863\u5230\u4E00\u4E2A\u540D\u4E3A classes.jar \u7684\u5F52\u6863\u6587\u4EF6\u4E2D: \n jar cvf classes.jar Foo.class Bar.class \n\u793A\u4F8B 2: \u4F7F\u7528\u73B0\u6709\u7684\u6E05\u5355\u6587\u4EF6 'mymanifest' \u5E76\n \u5C06 foo/ \u76EE\u5F55\u4E2D\u7684\u6240\u6709\u6587\u4EF6\u5F52\u6863\u5230 'classes.jar' \u4E2D: \n jar cvfm classes.jar mymanifest -C foo/ .\n +usage=\u7528\u6CD5: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\u9009\u9879:\n -c \u521B\u5EFA\u65B0\u6863\u6848\n -t \u5217\u51FA\u6863\u6848\u76EE\u5F55\n -x \u4ECE\u6863\u6848\u4E2D\u63D0\u53D6\u6307\u5B9A\u7684 (\u6216\u6240\u6709) \u6587\u4EF6\n -u \u66F4\u65B0\u73B0\u6709\u6863\u6848\n -v \u5728\u6807\u51C6\u8F93\u51FA\u4E2D\u751F\u6210\u8BE6\u7EC6\u8F93\u51FA\n -f \u6307\u5B9A\u6863\u6848\u6587\u4EF6\u540D\n -m \u5305\u542B\u6307\u5B9A\u6E05\u5355\u6587\u4EF6\u4E2D\u7684\u6E05\u5355\u4FE1\u606F\n -n \u521B\u5EFA\u65B0\u6863\u6848\u540E\u6267\u884C Pack200 \u89C4\u8303\u5316\n -e \u4E3A\u7ED1\u5B9A\u5230\u53EF\u6267\u884C jar \u6587\u4EF6\u7684\u72EC\u7ACB\u5E94\u7528\u7A0B\u5E8F\n \u6307\u5B9A\u5E94\u7528\u7A0B\u5E8F\u5165\u53E3\u70B9\n -0 \u4EC5\u5B58\u50A8; \u4E0D\u4F7F\u7528\u4EFB\u4F55 ZIP \u538B\u7F29\n -M \u4E0D\u521B\u5EFA\u6761\u76EE\u7684\u6E05\u5355\u6587\u4EF6\n -i \u4E3A\u6307\u5B9A\u7684 jar \u6587\u4EF6\u751F\u6210\u7D22\u5F15\u4FE1\u606F\n -C \u66F4\u6539\u4E3A\u6307\u5B9A\u7684\u76EE\u5F55\u5E76\u5305\u542B\u4EE5\u4E0B\u6587\u4EF6\n\u5982\u679C\u4EFB\u4F55\u6587\u4EF6\u4E3A\u76EE\u5F55, \u5219\u5BF9\u5176\u8FDB\u884C\u9012\u5F52\u5904\u7406\u3002\n\u6E05\u5355\u6587\u4EF6\u540D, \u6863\u6848\u6587\u4EF6\u540D\u548C\u5165\u53E3\u70B9\u540D\u79F0\u7684\u6307\u5B9A\u987A\u5E8F\n\u4E0E 'm', 'f' \u548C 'e' \u6807\u8BB0\u7684\u6307\u5B9A\u987A\u5E8F\u76F8\u540C\u3002\n\n\u793A\u4F8B 1: \u5C06\u4E24\u4E2A\u7C7B\u6587\u4EF6\u5F52\u6863\u5230\u4E00\u4E2A\u540D\u4E3A classes.jar \u7684\u6863\u6848\u4E2D: \n jar cvf classes.jar Foo.class Bar.class \n\u793A\u4F8B 2: \u4F7F\u7528\u73B0\u6709\u7684\u6E05\u5355\u6587\u4EF6 'mymanifest' \u5E76\n \u5C06 foo/ \u76EE\u5F55\u4E2D\u7684\u6240\u6709\u6587\u4EF6\u5F52\u6863\u5230 'classes.jar' \u4E2D: \n jar cvfm classes.jar mymanifest -C foo/ .\n diff --git a/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_TW.properties b/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_TW.properties index 7dd4f65390b..76ce56184cf 100644 --- a/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_TW.properties +++ b/jdk/src/share/classes/sun/tools/jar/resources/jar_zh_TW.properties @@ -33,6 +33,7 @@ error.nosuch.fileordir={0} : \u6C92\u6709\u9019\u985E\u6A94\u6848\u6216\u76EE\u9 error.write.file=\u5BEB\u5165\u73FE\u6709\u7684 jar \u6A94\u6848\u6642\u767C\u751F\u932F\u8AA4 error.create.dir={0} : \u7121\u6CD5\u5EFA\u7ACB\u76EE\u9304 error.incorrect.length=\u8655\u7406 {0} \u6642\u9577\u5EA6\u4E0D\u6B63\u78BA +error.create.tempfile=\u7121\u6CD5\u5EFA\u7ACB\u66AB\u5B58\u6A94\u6848 out.added.manifest=\u5DF2\u65B0\u589E\u8CC7\u8A0A\u6E05\u55AE out.update.manifest=\u5DF2\u66F4\u65B0\u8CC7\u8A0A\u6E05\u55AE out.ignore.entry=\u5FFD\u7565\u9805\u76EE {0} @@ -44,4 +45,4 @@ out.extracted=\u64F7\u53D6: {0} out.inflated=\ \u64F4\u5C55: {0} out.size=\ (\u8B80={0})(\u5BEB={1}) -usage=\u7528\u6CD5: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] \u6A94\u6848 ...\n\u9078\u9805:\n -c \u5EFA\u7ACB\u65B0\u7684\u6B78\u6A94\n -t \u5217\u51FA\u6B78\u6A94\u7684\u76EE\u9304\n -x \u5F9E\u6B78\u6A94\u4E2D\u64F7\u53D6\u5DF2\u547D\u540D\u7684 (\u6216\u6240\u6709) \u6A94\u6848\n -u \u66F4\u65B0\u73FE\u6709\u6B78\u6A94\n -v \u5728\u6A19\u6E96\u8F38\u51FA\u4E2D\u7522\u751F\u8A73\u7D30\u8F38\u51FA\n -f \u6307\u5B9A\u6B78\u6A94\u6A94\u6848\u540D\u7A31\n -m \u5305\u542B\u6307\u5B9A\u8CC7\u8A0A\u6E05\u55AE\u4E2D\u7684\u8CC7\u8A0A\u6E05\u55AE\u8CC7\u8A0A\n -e \u70BA\u7368\u7ACB\u61C9\u7528\u7A0B\u5F0F\u6307\u5B9A\u61C9\u7528\u7A0B\u5F0F\u9032\u5165\u9EDE\n \u5DF2\u96A8\u9644\u65BC\u53EF\u57F7\u884C jar \u6A94\u6848\u4E2D\n -0 \u50C5\u5132\u5B58; \u4E0D\u4F7F\u7528 ZIP \u58D3\u7E2E\u65B9\u5F0F\n -M \u4E0D\u70BA\u9805\u76EE\u5EFA\u7ACB\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848\n -i \u70BA\u6307\u5B9A\u7684 jar \u6A94\u6848\u7522\u751F\u7D22\u5F15\u8CC7\u8A0A\n -C \u8B8A\u66F4\u81F3\u6307\u5B9A\u76EE\u9304\u4E26\u5305\u542B\u5F8C\u9762\u6240\u5217\u7684\u6A94\u6848\n\u5982\u679C\u6709\u4EFB\u4F55\u6A94\u6848\u662F\u76EE\u9304\uFF0C\u5247\u6703\u5C0D\u5176\u9032\u884C\u905E\u8FF4\u8655\u7406\u3002\n\u6E05\u55AE\u6A94\u6848\u540D\u7A31\u3001\u6B78\u6A94\u6A94\u6848\u540D\u7A31\u548C\u9032\u5165\u9EDE\u540D\u7A31\n\u7684\u6307\u5B9A\u9806\u5E8F\u8207\u6307\u5B9A 'm' \u65D7\u6A19\u3001'f' \u65D7\u6A19\u548C 'e' \u65D7\u6A19\u7684\u9806\u5E8F\u76F8\u540C\u3002\n\n\u7BC4\u4F8B 1: \u5C07\u5169\u500B\u985E\u5225\u6A94\u6848\u6B78\u6A94\u81F3\u540D\u70BA classes.jar \u7684\u6B78\u6A94\u4E2D: \n jar cvf classes.jar Foo.class Bar.class\n\u7BC4\u4F8B 2: \u4F7F\u7528\u73FE\u6709\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848 'mymanifest' \u4E26\u5C07\n foo/ \u76EE\u9304\u4E2D\u7684\u6240\u6709\u6A94\u6848\u6B78\u6A94\u81F3 'classes.jar' \u4E2D: \n jar cvfm classes.jar mymanifest -C foo/ .\n +usage=\u7528\u6CD5: jar {ctxui}[vfmn0Me] [jar-file] [manifest-file] [entry-point] [-C dir] \u6A94\u6848 ...\n\u9078\u9805:\n -c \u5EFA\u7ACB\u65B0\u7684\u6B78\u6A94\n -t \u5217\u51FA\u6B78\u6A94\u7684\u76EE\u9304\n -x \u5F9E\u6B78\u6A94\u4E2D\u64F7\u53D6\u5DF2\u547D\u540D\u7684 (\u6216\u6240\u6709) \u6A94\u6848\n -u \u66F4\u65B0\u73FE\u6709\u6B78\u6A94\n -v \u5728\u6A19\u6E96\u8F38\u51FA\u4E2D\u7522\u751F\u8A73\u7D30\u8F38\u51FA\n -f \u6307\u5B9A\u6B78\u6A94\u6A94\u6848\u540D\u7A31\n -m \u5305\u542B\u6307\u5B9A\u8CC7\u8A0A\u6E05\u55AE\u4E2D\u7684\u8CC7\u8A0A\u6E05\u55AE\u8CC7\u8A0A\n -n \u5728\u5EFA\u7ACB\u65B0\u6B78\u6A94\u4E4B\u5F8C\u57F7\u884C Pack200 \u6B63\u898F\u5316\n -e \u70BA\u5DF2\u96A8\u9644\u65BC\u53EF\u57F7\u884C jar \u6A94\u6848\u4E2D\u7684\u7368\u7ACB\u61C9\u7528\u7A0B\u5F0F\n \u6307\u5B9A\u61C9\u7528\u7A0B\u5F0F\u9032\u5165\u9EDE\n -0 \u50C5\u5132\u5B58; \u4E0D\u4F7F\u7528 ZIP \u58D3\u7E2E\u65B9\u5F0F\n -M \u4E0D\u70BA\u9805\u76EE\u5EFA\u7ACB\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848\n -i \u70BA\u6307\u5B9A\u7684 jar \u6A94\u6848\u7522\u751F\u7D22\u5F15\u8CC7\u8A0A\n -C \u8B8A\u66F4\u81F3\u6307\u5B9A\u76EE\u9304\u4E26\u5305\u542B\u5F8C\u9762\u6240\u5217\u7684\u6A94\u6848\n\u5982\u679C\u6709\u4EFB\u4F55\u6A94\u6848\u662F\u76EE\u9304\uFF0C\u5247\u6703\u5C0D\u5176\u9032\u884C\u905E\u8FF4\u8655\u7406\u3002\n\u6E05\u55AE\u6A94\u6848\u540D\u7A31\u3001\u6B78\u6A94\u6A94\u6848\u540D\u7A31\u548C\u9032\u5165\u9EDE\u540D\u7A31\n\u7684\u6307\u5B9A\u9806\u5E8F\u8207\u6307\u5B9A 'm' \u65D7\u6A19\u3001'f' \u65D7\u6A19\u548C 'e' \u65D7\u6A19\u7684\u9806\u5E8F\u76F8\u540C\u3002\n\n\u7BC4\u4F8B 1: \u5C07\u5169\u500B\u985E\u5225\u6A94\u6848\u6B78\u6A94\u81F3\u540D\u70BA classes.jar \u7684\u6B78\u6A94\u4E2D: \n jar cvf classes.jar Foo.class Bar.class\n\u7BC4\u4F8B 2: \u4F7F\u7528\u73FE\u6709\u8CC7\u8A0A\u6E05\u55AE\u6A94\u6848 'mymanifest' \u4E26\u5C07\n foo/ \u76EE\u9304\u4E2D\u7684\u6240\u6709\u6A94\u6848\u6B78\u6A94\u81F3 'classes.jar' \u4E2D: \n jar cvfm classes.jar mymanifest -C foo/ .\n diff --git a/jdk/src/solaris/classes/sun/awt/X11/XConstants.java b/jdk/src/solaris/classes/sun/awt/X11/XConstants.java index e1903d81f40..91c533898b8 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XConstants.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XConstants.java @@ -674,9 +674,4 @@ final public class XConstants { public static final long XkbModifierMapMask = (1L<<2); public static final long XkbVirtualModsMask = (1L<<6); //server map - /***************************************************************** - * X SHARED MEMORY EXTENSION FUNCTIONS - *****************************************************************/ - - public static final int X_ShmAttach = 1; } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XErrorHandler.java b/jdk/src/solaris/classes/sun/awt/X11/XErrorHandler.java index ec09cea5198..4fc6bd84249 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XErrorHandler.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XErrorHandler.java @@ -42,29 +42,6 @@ public abstract class XErrorHandler { } } - /** - * This is a base synthetic error handler containing a boolean flag which allows - * to show that an error is handled or not. - */ - public static class XErrorHandlerWithFlag extends XBaseErrorHandler { - private volatile boolean errorOccurred = false; - - public boolean getErrorOccurredFlag() { - return errorOccurred; - } - - /** - * Sets an internal boolean flag to a particular value. Should be always called with - *false
value of the parametererrorOccurred
before this - * error handler is set as current. - * @param errorOccurredtrue
to indicate that an error was handled, - *false
to reset the internal boolean flag - */ - public void setErrorOccurredFlag(boolean errorOccurred) { - this.errorOccurred = errorOccurred; - } - } - /* * Instead of validating window id, we simply call XGetWindowProperty, * but temporary install this function as the error handler to ignore @@ -99,51 +76,4 @@ public abstract class XErrorHandler { return theInstance; } } - - /** - * This is a synthetic error handler for errors generated by the native function - *XShmAttach
. If an error is handled, an internal boolean flag of the - * handler is set totrue
. - */ - public static final class XShmAttachHandler extends XErrorHandlerWithFlag { - private XShmAttachHandler() {} - - @Override - public int handleError(long display, XErrorEvent err) { - if (err.get_minor_code() == XConstants.X_ShmAttach) { - setErrorOccurredFlag(true); - return 0; - } - return super.handleError(display, err); - } - - // Shared instance - private static XShmAttachHandler theInstance = new XShmAttachHandler(); - public static XShmAttachHandler getInstance() { - return theInstance; - } - } - - /** - * This is a synthetic error handler forBadAlloc
errors generated by the - * nativeglX*
functions. Its internal boolean flag is set totrue
, - * if an error is handled. - */ - public static final class GLXBadAllocHandler extends XErrorHandlerWithFlag { - private GLXBadAllocHandler() {} - - @Override - public int handleError(long display, XErrorEvent err) { - if (err.get_error_code() == XConstants.BadAlloc) { - setErrorOccurredFlag(true); - return 0; - } - return super.handleError(display, err); - } - - private static GLXBadAllocHandler theInstance = new GLXBadAllocHandler(); - public static GLXBadAllocHandler getInstance() { - return theInstance; - } - } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java b/jdk/src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java index da12cd9ef89..4bdf0ecb0dc 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XErrorHandlerUtil.java @@ -42,7 +42,7 @@ public final class XErrorHandlerUtil { private static long display; /** - * Error handler at the moment ofXErrorHandlerUtil
initialization. + * Error handler at the moment of {@code XErrorHandlerUtil} initialization. */ private static long saved_error_handler; @@ -63,7 +63,7 @@ public final class XErrorHandlerUtil { new GetBooleanAction("sun.awt.noisyerrorhandler")); /** - * The flag indicating thatinit
was called already. + * The flag indicating that {@code init} was called already. */ private static boolean initPassed; @@ -73,9 +73,9 @@ public final class XErrorHandlerUtil { private XErrorHandlerUtil() {} /** - * Sets the toolkit global error handler, stores the connection to X11 server, which - * will be used during an error handling process. This method is called once from - *awt_init_Display
function defined inawt_GraphicsEnv.c
+ * Sets the toolkit global error handler, stores the connection to X11 server, + * which will be used during an error handling process. This method is called + * once from {@code awt_init_Display} function defined in {@code awt_GraphicsEnv.c} * file immediately after the connection to X11 window server is opened. * @param display the connection to X11 server which should be stored */ @@ -109,9 +109,9 @@ public final class XErrorHandlerUtil { } private static void RESTORE_XERROR_HANDLER(boolean doXSync) { - // Wait until all requests are processed by the X server - // and only then uninstall the error handler. if (doXSync) { + // Wait until all requests are processed by the X server + // and only then uninstall the error handler. XSync(); } current_error_handler = null; diff --git a/jdk/src/solaris/doc/sun/man/man1/jdeps.1 b/jdk/src/solaris/doc/sun/man/man1/jdeps.1 index 9b8f698f6a2..c3884aa6c0e 100644 --- a/jdk/src/solaris/doc/sun/man/man1/jdeps.1 +++ b/jdk/src/solaris/doc/sun/man/man1/jdeps.1 @@ -62,7 +62,7 @@ jdeps \- Java class dependency analyzer\&. \fIoptions\fR Command-line options\&. See Options\&. .TP -\fIclass\fR\fIes\fR +\fIclasses\fR Name of the classes to analyze\&. You can specify a class that can be found in the class path, by its file name, a directory, or a JAR file\&. .SH DESCRIPTION The \fI\fR\f3jdeps\fR command shows the package-level or class-level dependencies of Java class files\&. The input class can be a path name to a \f3\&.class\fR file, a directory, a JAR file, or it can be a fully qualified class name to analyze all class files\&. The options determine the output\&. By default, \f3jdeps\fR outputs the dependencies to the system output\&. It can generate the dependencies in DOT language (see the \f3-dotoutput\fR option)\&. @@ -106,6 +106,12 @@ Finds dependencies in packages matching the specified regular expression pattern .br Restricts analysis to classes matching pattern\&. This option filters the list of classes to be analyzed\&. It can be used together with \f3-p\fR and \f3-e\fR which apply pattern to the dependencies\&. .TP +-jdkinternals +.br +Finds class-level dependences in JDK internal APIs\&. By default, it analyzes all classes specified in the \f3-classpath\fR option and in input files unless you specified the \f3-include\fR option\&. You cannot use this option with the \f3-p\fR, \f3-e\fR, and \f3-s\fR options\&. + +\fIWarning\fR: JDK internal APIs may not be accessible in upcoming releases\&. +.TP -P, -profile .br Shows profile or the file containing a package\&. diff --git a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c index 4b6e2c685df..bb042d0648f 100644 --- a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c +++ b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c @@ -906,6 +906,20 @@ Java_sun_awt_X11GraphicsDevice_getDisplay(JNIEnv *env, jobject this) static jint canUseShmExt = UNSET_MITSHM; static jint canUseShmExtPixmaps = UNSET_MITSHM; +static jboolean xshmAttachFailed = JNI_FALSE; + +int XShmAttachXErrHandler(Display *display, XErrorEvent *xerr) { + if (xerr->minor_code == X_ShmAttach) { + xshmAttachFailed = JNI_TRUE; + } + return 0; +} +jboolean isXShmAttachFailed() { + return xshmAttachFailed; +} +void resetXShmAttachFailed() { + xshmAttachFailed = JNI_FALSE; +} extern int mitShmPermissionMask; @@ -913,7 +927,6 @@ void TryInitMITShm(JNIEnv *env, jint *shmExt, jint *shmPixmaps) { XShmSegmentInfo shminfo; int XShmMajor, XShmMinor; int a, b, c; - jboolean xShmAttachResult; AWT_LOCK(); if (canUseShmExt != UNSET_MITSHM) { @@ -957,14 +970,21 @@ void TryInitMITShm(JNIEnv *env, jint *shmExt, jint *shmPixmaps) { } shminfo.readOnly = True; - xShmAttachResult = TryXShmAttach(env, awt_display, &shminfo); + resetXShmAttachFailed(); + /** + * The J2DXErrHandler handler will set xshmAttachFailed + * to JNI_TRUE if any Shm error has occured. + */ + EXEC_WITH_XERROR_HANDLER(XShmAttachXErrHandler, + XShmAttach(awt_display, &shminfo)); + /** * Get rid of the id now to reduce chances of leaking * system resources. */ shmctl(shminfo.shmid, IPC_RMID, 0); - if (xShmAttachResult == JNI_TRUE) { + if (isXShmAttachFailed() == JNI_FALSE) { canUseShmExt = CAN_USE_MITSHM; /* check if we can use shared pixmaps */ XShmQueryVersion(awt_display, &XShmMajor, &XShmMinor, @@ -979,23 +999,6 @@ void TryInitMITShm(JNIEnv *env, jint *shmExt, jint *shmPixmaps) { } AWT_UNLOCK(); } - -/* - * Must be called with the acquired AWT lock. - */ -jboolean TryXShmAttach(JNIEnv *env, Display *display, XShmSegmentInfo *shminfo) { - jboolean errorOccurredFlag = JNI_FALSE; - jobject errorHandlerRef; - - /* - * XShmAttachHandler will set its internal flag to JNI_TRUE, if any Shm error occurs. - */ - EXEC_WITH_XERROR_HANDLER(env, "sun/awt/X11/XErrorHandler$XShmAttachHandler", - "()Lsun/awt/X11/XErrorHandler$XShmAttachHandler;", JNI_TRUE, - errorHandlerRef, errorOccurredFlag, - XShmAttach(display, shminfo)); - return errorOccurredFlag == JNI_FALSE ? JNI_TRUE : JNI_FALSE; -} #endif /* MITSHM */ /* diff --git a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.h b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.h index 0ca5a329f75..1675c68287b 100644 --- a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.h +++ b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.h @@ -53,7 +53,8 @@ extern int XShmQueryExtension(); void TryInitMITShm(JNIEnv *env, jint *shmExt, jint *shmPixmaps); -jboolean TryXShmAttach(JNIEnv *env, Display *display, XShmSegmentInfo *shminfo); +void resetXShmAttachFailed(); +jboolean isXShmAttachFailed(); #endif /* MITSHM */ diff --git a/jdk/src/solaris/native/sun/awt/awt_util.c b/jdk/src/solaris/native/sun/awt/awt_util.c index d92c96e5e92..76953f9e973 100644 --- a/jdk/src/solaris/native/sun/awt/awt_util.c +++ b/jdk/src/solaris/native/sun/awt/awt_util.c @@ -41,6 +41,11 @@ #include "java_awt_event_MouseWheelEvent.h" +/* + * Called by "ToolkitErrorHandler" function in "XlibWrapper.c" file. + */ +XErrorHandler current_native_xerror_handler = NULL; + extern jint getModifiers(uint32_t state, jint button, jint keyCode); extern jint getButton(uint32_t button); diff --git a/jdk/src/solaris/native/sun/awt/awt_util.h b/jdk/src/solaris/native/sun/awt/awt_util.h index b93f7744cd6..56781f5ecbd 100644 --- a/jdk/src/solaris/native/sun/awt/awt_util.h +++ b/jdk/src/solaris/native/sun/awt/awt_util.h @@ -29,57 +29,29 @@ #ifndef HEADLESS #include "gdefs.h" -/* - * Expected types of arguments of the macro. - * (JNIEnv*, const char*, const char*, jboolean, jobject) - */ -#define WITH_XERROR_HANDLER(env, handlerClassName, getInstanceSignature, \ - handlerHasFlag, handlerRef) do { \ - handlerRef = JNU_CallStaticMethodByName(env, NULL, handlerClassName, "getInstance", \ - getInstanceSignature).l; \ - if (handlerHasFlag == JNI_TRUE) { \ - JNU_CallMethodByName(env, NULL, handlerRef, "setErrorOccurredFlag", "(Z)V", JNI_FALSE); \ - } \ - JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XErrorHandlerUtil", "WITH_XERROR_HANDLER", \ - "(Lsun/awt/X11/XErrorHandler;)V", handlerRef); \ +#define WITH_XERROR_HANDLER(f) do { \ + XSync(awt_display, False); \ + current_native_xerror_handler = (f); \ +} while (0) + +#define RESTORE_XERROR_HANDLER do { \ + XSync(awt_display, False); \ + current_native_xerror_handler = NULL; \ +} while (0) + +#define EXEC_WITH_XERROR_HANDLER(f, code) do { \ + WITH_XERROR_HANDLER(f); \ + do { \ + code; \ + } while (0); \ + RESTORE_XERROR_HANDLER; \ } while (0) /* - * Expected types of arguments of the macro. - * (JNIEnv*, jboolean) + * Called by "ToolkitErrorHandler" function in "XlibWrapper.c" file. */ -#define RESTORE_XERROR_HANDLER(env, doXSync) do { \ - JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XErrorHandlerUtil", \ - "RESTORE_XERROR_HANDLER", "(Z)V", doXSync); \ -} while (0) +extern XErrorHandler current_native_xerror_handler; -/* - * Expected types of arguments of the macro. - * (JNIEnv*, const char*, const char*, jboolean, jobject, jboolean, No type - C expression) - */ -#define EXEC_WITH_XERROR_HANDLER(env, handlerClassName, getInstanceSignature, handlerHasFlag, \ - handlerRef, errorOccurredFlag, code) do { \ - handlerRef = NULL; \ - WITH_XERROR_HANDLER(env, handlerClassName, getInstanceSignature, handlerHasFlag, handlerRef); \ - do { \ - code; \ - } while (0); \ - RESTORE_XERROR_HANDLER(env, JNI_TRUE); \ - if (handlerHasFlag == JNI_TRUE) { \ - GET_HANDLER_ERROR_OCCURRED_FLAG(env, handlerRef, errorOccurredFlag); \ - } \ -} while (0) - -/* - * Expected types of arguments of the macro. - * (JNIEnv*, jobject, jboolean) - */ -#define GET_HANDLER_ERROR_OCCURRED_FLAG(env, handlerRef, errorOccurredFlag) do { \ - if (handlerRef != NULL) { \ - errorOccurredFlag = JNU_CallMethodByName(env, NULL, handlerRef, "getErrorOccurredFlag", \ - "()Z").z; \ - } \ -} while (0) #endif /* !HEADLESS */ #ifndef INTERSECTS diff --git a/jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c b/jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c index e1cf2c57501..1bdd08827f9 100644 --- a/jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c +++ b/jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c @@ -48,6 +48,8 @@ extern DisposeFunc OGLSD_Dispose; extern void OGLSD_SetNativeDimensions(JNIEnv *env, OGLSDOps *oglsdo, jint w, jint h); +jboolean surfaceCreationFailed = JNI_FALSE; + #endif /* !HEADLESS */ JNIEXPORT void JNICALL @@ -347,6 +349,15 @@ OGLSD_InitOGLWindow(JNIEnv *env, OGLSDOps *oglsdo) return JNI_TRUE; } +static int +GLXSD_BadAllocXErrHandler(Display *display, XErrorEvent *xerr) +{ + if (xerr->error_code == BadAlloc) { + surfaceCreationFailed = JNI_TRUE; + } + return 0; +} + JNIEXPORT jboolean JNICALL Java_sun_java2d_opengl_GLXSurfaceData_initPbuffer (JNIEnv *env, jobject glxsd, @@ -362,8 +373,6 @@ Java_sun_java2d_opengl_GLXSurfaceData_initPbuffer int attrlist[] = {GLX_PBUFFER_WIDTH, 0, GLX_PBUFFER_HEIGHT, 0, GLX_PRESERVED_CONTENTS, GL_FALSE, 0}; - jboolean errorOccurredFlag; - jobject errorHandlerRef; J2dTraceLn3(J2D_TRACE_INFO, "GLXSurfaceData_initPbuffer: w=%d h=%d opq=%d", @@ -391,15 +400,12 @@ Java_sun_java2d_opengl_GLXSurfaceData_initPbuffer attrlist[1] = width; attrlist[3] = height; - errorOccurredFlag = JNI_FALSE; - WITH_XERROR_HANDLER(env, "sun/awt/X11/XErrorHandler$GLXBadAllocHandler", - "()Lsun/awt/X11/XErrorHandler$GLXBadAllocHandler;", JNI_TRUE, errorHandlerRef); - pbuffer = j2d_glXCreatePbuffer(awt_display, glxinfo->fbconfig, attrlist); - XSync(awt_display, False); - RESTORE_XERROR_HANDLER(env, JNI_FALSE); - GET_HANDLER_ERROR_OCCURRED_FLAG(env, errorHandlerRef, errorOccurredFlag); - - if ((pbuffer == 0) || errorOccurredFlag) { + surfaceCreationFailed = JNI_FALSE; + EXEC_WITH_XERROR_HANDLER( + GLXSD_BadAllocXErrHandler, + pbuffer = j2d_glXCreatePbuffer(awt_display, + glxinfo->fbconfig, attrlist)); + if ((pbuffer == 0) || surfaceCreationFailed) { J2dRlsTraceLn(J2D_TRACE_ERROR, "GLXSurfaceData_initPbuffer: could not create glx pbuffer"); return JNI_FALSE; diff --git a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c index a35d6fd3065..79e3be488a6 100644 --- a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c +++ b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c @@ -65,6 +65,7 @@ static UnlockFunc X11SD_Unlock; static DisposeFunc X11SD_Dispose; static GetPixmapBgFunc X11SD_GetPixmapWithBg; static ReleasePixmapBgFunc X11SD_ReleasePixmapWithBg; +extern int XShmAttachXErrHandler(Display *display, XErrorEvent *xerr); extern AwtGraphicsConfigDataPtr getGraphicsConfigFromComponentPeer(JNIEnv *env, jobject this); extern struct X11GraphicsConfigIDs x11GraphicsConfigIDs; @@ -532,8 +533,6 @@ XImage* X11SD_CreateSharedImage(X11SDOps *xsdo, { XImage *img = NULL; XShmSegmentInfo *shminfo; - JNIEnv* env; - jboolean xShmAttachResult; shminfo = malloc(sizeof(XShmSegmentInfo)); if (shminfo == NULL) { @@ -573,8 +572,9 @@ XImage* X11SD_CreateSharedImage(X11SDOps *xsdo, shminfo->readOnly = False; - env = (JNIEnv*)JNU_GetEnv(jvm, JNI_VERSION_1_2); - xShmAttachResult = TryXShmAttach(env, awt_display, shminfo); + resetXShmAttachFailed(); + EXEC_WITH_XERROR_HANDLER(XShmAttachXErrHandler, + XShmAttach(awt_display, shminfo)); /* * Once the XSync round trip has finished then we @@ -583,7 +583,7 @@ XImage* X11SD_CreateSharedImage(X11SDOps *xsdo, */ shmctl(shminfo->shmid, IPC_RMID, 0); - if (xShmAttachResult == JNI_FALSE) { + if (isXShmAttachFailed() == JNI_TRUE) { J2dRlsTraceLn1(J2D_TRACE_ERROR, "X11SD_SetupSharedSegment XShmAttach has failed: %s", strerror(errno)); diff --git a/jdk/src/solaris/native/sun/xawt/XlibWrapper.c b/jdk/src/solaris/native/sun/xawt/XlibWrapper.c index 3e75f291c94..cf3474d0e5d 100644 --- a/jdk/src/solaris/native/sun/xawt/XlibWrapper.c +++ b/jdk/src/solaris/native/sun/xawt/XlibWrapper.c @@ -41,6 +41,7 @@ #include#include +#include #include #include @@ -1266,6 +1267,10 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XlibWrapper_IsKanaKeyboard JavaVM* jvm = NULL; static int ToolkitErrorHandler(Display * dpy, XErrorEvent * event) { JNIEnv * env; + // First call the native synthetic error handler declared in "awt_util.h" file. + if (current_native_xerror_handler != NULL) { + current_native_xerror_handler(dpy, event); + } if (jvm != NULL) { env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); if (env) { diff --git a/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java b/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java index 3a1a56d1928..80042a15150 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java +++ b/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java @@ -570,6 +570,10 @@ class WPathGraphics extends PathGraphics { return false; } + if (gv.getNumGlyphs() == 0) { + return true; // nothing to do. + } + AffineTransform deviceTransform = getTransform(); AffineTransform fontTransform = new AffineTransform(deviceTransform); Font font = gv.getFont(); @@ -599,6 +603,10 @@ class WPathGraphics extends PathGraphics { * device space. */ Point2D.Float userpos = new Point2D.Float(x, y); + /* Add the position of the first glyph - its not always 0,0 */ + Point2D g0pos = gv.getGlyphPosition(0); + userpos.x += (float)g0pos.getX(); + userpos.y += (float)g0pos.getY(); Point2D.Float devpos = new Point2D.Float(); /* Already have the translate from the deviceTransform, diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index ec7f3d6ffb9..7c83f52f75c 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -120,9 +120,6 @@ # jdk_lang -# 7067973 -java/lang/management/MemoryMXBean/CollectionUsageThreshold.java generic-all - # 8029415 java/lang/reflect/Method/invoke/TestPrivateInterfaceMethodReflect.java generic-all @@ -208,9 +205,6 @@ java/nio/file/WatchService/LotsOfEvents.java solaris-all # 7146541 java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java linux-all -# 7190106 -java/rmi/reliability/benchmark/runRmiBench.sh generic-all - # 7191877 java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java generic-all @@ -269,9 +263,6 @@ sun/security/krb5/auto/BadKdc4.java solaris-sparcv9 # jdk_tools -# 6461635 -com/sun/tools/attach/BasicTests.sh generic-all - # 7132203 sun/jvmstat/monitor/MonitoredVm/CR6672135.java generic-all @@ -299,9 +290,6 @@ com/sun/jdi/RedefineCrossEvent.java generic-all # jdk_util -# Filed 6933803 -java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java generic-all - # Filed 6772009 java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java generic-all diff --git a/jdk/test/com/sun/jmx/snmp/NoInfoLeakTest.java b/jdk/test/com/sun/jmx/snmp/NoInfoLeakTest.java deleted file mode 100644 index dcf54416a08..00000000000 --- a/jdk/test/com/sun/jmx/snmp/NoInfoLeakTest.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2013, 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 8026028 - * @summary Tests no leak of internal info - * @author Shanliang JIANG - * @run clean NoInfoLeakTest - * @run build NoInfoLeakTest - * @run main NoInfoLeakTest - */ - -import com.sun.jmx.snmp.SnmpString; -import com.sun.jmx.snmp.agent.SnmpMib; -import com.sun.jmx.snmp.agent.SnmpMibTable; -import com.sun.jmx.snmp.daemon.CommunicatorServer; -import com.sun.jmx.snmp.daemon.SnmpAdaptorServer; -import javax.management.MBeanNotificationInfo; -import javax.management.MBeanServer; -import javax.management.ObjectName; - -public class NoInfoLeakTest { - public static void main(String[] args) throws Exception { - boolean ok = true; - ok &= snmpStringTest(); - ok &= snmpMibTest(); - ok &= communicatorServerTest(); - - if (!ok) { - throw new RuntimeException("Some tests are failed!"); - } - } - - private static boolean snmpStringTest() { - System.out.println("\n---NoInfoLeakTest-snmpStringTest: testing the method byteValue()..."); - boolean passed = true; - - byte[] mine = new byte[]{1,1,1,}; - SnmpString ss = new SnmpString(mine); - byte[] got = ss.byteValue(); - got[0]=0; - - if (ss.byteValue()[0] == 0) { - System.err.println("Failed: SnmpString.byteValue() returns an internal mutable object value"); - passed = false; - } else { - System.out.println("---NoInfoLeakTest-snmpStringTest done."); - } - return passed; - } - - private static boolean snmpMibTest() { - boolean passed = true; - System.out.println("\n---NoInfoLeakTest-snmpMibTest: testing the method " - + "SnmpMib.getRootOid()..."); - SnmpMib mib = new MySnmpMib(); - - if (mib.getRootOid() == mib.getRootOid()) { - System.err.println("Failed: SnmpMib.getRootOid() returns an internal" - + " mutable object value "+mib.getRootOid()); - } else { - System.out.println("---NoInfoLeakTest-snmpMibTest done."); - } - return passed; - } - - private static boolean communicatorServerTest() { - boolean passed = true; - System.out.println("\n---NoInfoLeakTest-communicatorServerTest: testing the method CommunicatorServer.getNotificationInfo()..."); - CommunicatorServer server = new SnmpAdaptorServer(); - MBeanNotificationInfo[] notifs = server.getNotificationInfo(); - - assert notifs.length > 0 && notifs[0] != null; // the current implementation ensures this - notifs[0] = null; - if (server.getNotificationInfo()[0] == null) { - System.err.println("Failed: CommunicatorServer.getNotificationInfo()" - + " returns an internal mutable object value"); - passed = false; - } else { - System.out.println("---NoInfoLeakTest-communicatorServerTest done."); - } - return passed; - } - - private static class MySnmpMib extends SnmpMib { - @Override - public void registerTableMeta(String name, SnmpMibTable table) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public SnmpMibTable getRegisteredTableMeta(String name) { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void init() throws IllegalAccessException { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { - throw new UnsupportedOperationException("Not supported yet."); - } - } -} diff --git a/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java b/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java index fe06d0a7fcf..a60ae8a4d3b 100644 --- a/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java +++ b/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013 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,11 @@ * @summary Sanity Test for GarbageCollectorMXBean.getLastGcInfo(). * @author Mandy Chung * - * @run main LastGCInfo + * @run main/othervm -XX:-ExplicitGCInvokesConcurrent LastGCInfo */ +// Passing "-XX:-ExplicitGCInvokesConcurrent" to force System.gc() +// run on foreground when CMS is used and prevent situations when "GcInfo" +// is missing even though System.gc() was successfuly processed. import java.lang.management.ManagementFactory; import java.lang.management.MemoryUsage; diff --git a/jdk/test/com/sun/tools/attach/AgentSetup.sh b/jdk/test/com/sun/tools/attach/AgentSetup.sh deleted file mode 100644 index dee69a3133e..00000000000 --- a/jdk/test/com/sun/tools/attach/AgentSetup.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2005, 2006, 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. -# - - -# -# -# Agent set - creates Agent.jar, BadAgent.jar and RedefineAgent.jar in ${TESTCLASSES} - -$JAVAC -d "${TESTCLASSES}" "${TESTSRC}"/Agent.java "${TESTSRC}"/BadAgent.java "${TESTSRC}"/RedefineAgent.java - -$JAR -cfm "${TESTCLASSES}"/Agent.jar "${TESTSRC}"/agent.mf \ - -C "${TESTCLASSES}" Agent.class - -$JAR -cfm "${TESTCLASSES}"/BadAgent.jar "${TESTSRC}"/badagent.mf \ - -C "${TESTCLASSES}" BadAgent.class - -$JAR -cfm "${TESTCLASSES}"/RedefineAgent.jar "${TESTSRC}"/redefineagent.mf \ - -C "${TESTCLASSES}" RedefineAgent.class - -agent="${TESTCLASSES}${FS}Agent.jar" -badagent="${TESTCLASSES}${FS}BadAgent.jar" -redefineagent="${TESTCLASSES}${FS}RedefineAgent.jar" - diff --git a/jdk/test/com/sun/tools/attach/Application.java b/jdk/test/com/sun/tools/attach/Application.java index 5db6c8a6260..d29b1381dfb 100644 --- a/jdk/test/com/sun/tools/attach/Application.java +++ b/jdk/test/com/sun/tools/attach/Application.java @@ -22,25 +22,39 @@ */ /* - * - * * A simple "Application" used by the Attach API unit tests. This application is * launched by the test. It binds to a random port and shuts down when somebody * connects to that port. + * Used port and pid are written both to stdout and to a specified file. */ import java.net.Socket; import java.net.ServerSocket; +import java.io.PrintWriter; +import jdk.testlibrary.ProcessTools; public class Application { public static void main(String args[]) throws Exception { // bind to a random port + if (args.length < 1) { + System.err.println("First argument should be path to output file."); + } + String outFileName = args[0]; + ServerSocket ss = new ServerSocket(0); int port = ss.getLocalPort(); + int pid = ProcessTools.getProcessId(); - // signal test that we are started - do not remove this line!! - System.out.println(port); + System.out.println("shutdownPort=" + port); + System.out.println("pid=" + pid); System.out.flush(); + try (PrintWriter writer = new PrintWriter(outFileName)) { + writer.println("shutdownPort=" + port); + writer.println("pid=" + pid); + writer.println("done"); + writer.flush(); + } + // wait for test harness to connect Socket s = ss.accept(); s.close(); diff --git a/jdk/test/com/sun/tools/attach/ApplicationSetup.sh b/jdk/test/com/sun/tools/attach/ApplicationSetup.sh deleted file mode 100644 index e8296df6300..00000000000 --- a/jdk/test/com/sun/tools/attach/ApplicationSetup.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2005, 2011, 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. -# - - -# -# -# Application Setup - creates ${TESTCLASSES}/Application.jar and the following -# procedures: -# startApplication - starts target application -# stopApplication $1 - stops application via TCP shutdown port $1 - -$JAVAC -d "${TESTCLASSES}" "${TESTSRC}"/Application.java "${TESTSRC}"/Shutdown.java -$JAR -cfm "${TESTCLASSES}"/Application.jar "${TESTSRC}"/application.mf \ - -C "${TESTCLASSES}" Application.class - -OUTPUTFILE=${TESTCLASSES}/Application.out -rm -f ${OUTPUTFILE} - -startApplication() -{ - # put all output from the app into ${OUTPUTFILE} - ${JAVA} ${TESTVMOPTS} $1 $2 $3 -jar "${TESTCLASSES}"/Application.jar > ${OUTPUTFILE} 2>&1 & - pid="$!" - - # MKS creates an intermediate shell to launch ${JAVA} so - # ${pid} is not the actual pid. We have put in a small sleep - # to give the intermediate shell process time to launch the - # "java" process. - if [ "$OS" = "Windows" ]; then - sleep 2 - if [ "${isCygwin}" = "true" ] ; then - realpid=`ps -p ${pid} | tail -1 | awk '{print $4;}'` - else - realpid=`ps -o pid,ppid,comm|grep ${pid}|grep "java"|cut -c1-6` - fi - pid=${realpid} - fi - - echo "Waiting for Application to initialize..." - attempts=0 - while true; do - sleep 1 - port=`tail -1 ${OUTPUTFILE} | sed -e 's@\\r@@g' ` - if [ ! -z "$port" ]; then - # In case of errors wait time for output to be flushed - sleep 1 - cat ${OUTPUTFILE} - break - fi - attempts=`expr $attempts + 1` - echo "Waiting $attempts second(s) ..." - done - echo "Application is process $pid, shutdown port is $port" - return $port -} - -stopApplication() -{ - $JAVA ${TESTVMOPTS} -classpath "${TESTCLASSES}" Shutdown $1 -} - diff --git a/jdk/test/com/sun/tools/attach/BasicTests.java b/jdk/test/com/sun/tools/attach/BasicTests.java index 79056e614b3..51f202becdb 100644 --- a/jdk/test/com/sun/tools/attach/BasicTests.java +++ b/jdk/test/com/sun/tools/attach/BasicTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, 2013 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 @@ -21,160 +21,257 @@ * questions. */ -/* - * - * - * Unit test for Attach API. Attaches to the given VM and performs a number - * unit tests. - */ import com.sun.tools.attach.*; import java.net.ServerSocket; import java.net.Socket; import java.io.IOException; import java.util.Properties; import java.util.List; +import java.io.File; +import jdk.testlibrary.OutputAnalyzer; +import jdk.testlibrary.JDKToolLauncher; +import jdk.testlibrary.ProcessTools; +import jdk.testlibrary.ProcessThread; +/* + * @test + * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757 + * @summary Basic unit tests for the VM attach mechanism. + * @library /lib/testlibrary + * @run build Agent BadAgent RedefineAgent Application Shutdown RedefineDummy + * @run main BasicTests + * + * This test will perform a number of basic attach tests. + */ public class BasicTests { - public static void main(String args[]) throws Exception { - String pid = args[0]; - String agent = args[1]; - String badagent = args[2]; - String redefineagent = args[3]; - System.out.println(" - Attaching to application ..."); - VirtualMachine vm = VirtualMachine.attach(pid); - - // Test 1 - read the system properties from the target VM and - // check that property is set - System.out.println(" - Test: system properties in target VM"); - Properties props = vm.getSystemProperties(); - String value = props.getProperty("attach.test"); - if (value == null || !value.equals("true")) { - throw new RuntimeException("attach.test property not set"); - } - System.out.println(" - attach.test property set as expected"); - - // Test 1a - read the agent properties from the target VM. - // By default, the agent property contains "sun.java.command", - // "sun.jvm.flags", and "sun.jvm.args". - // Just sanity check - make sure not empty. - System.out.println(" - Test: agent properties in target VM"); - props = vm.getAgentProperties(); - if (props == null || props.size() == 0) { - throw new RuntimeException("Agent properties is empty"); - } - System.out.println(" - agent properties non-empty as expected"); - - // Test 2 - attempt to load an agent that does not exist - System.out.println(" - Test: Load an agent that does not exist"); + /* + * The actual test is in the nested class TestMain. + * The responsibility of this class is to: + * 1. Build all needed jars. + * 2. Start the Application class in a separate process. + * 3. Find the pid and shutdown port of the running Application. + * 4. Launches the tests in nested class TestMain that will attach to the Application. + * 5. Shut down the Application. + */ + public static void main(String args[]) throws Throwable { + final String pidFile = "TestsBasic.Application.pid"; + ProcessThread processThread = null; + RunnerUtil.ProcessInfo info = null; try { - vm.loadAgent("SilverBullet.jar"); - } catch (AgentLoadException x) { - System.out.println(" - AgentLoadException thrown as expected!"); + buildJars(); + processThread = RunnerUtil.startApplication(pidFile); + info = RunnerUtil.readProcessInfo(pidFile); + runTests(info.pid); + } catch (Throwable t) { + System.out.println("TestBasic got unexpected exception: " + t); + t.printStackTrace(); + throw t; + } finally { + // Make sure the Application process is stopped. + RunnerUtil.stopApplication(info.shutdownPort, processThread); } + } - // Test 3 - load an "bad" agent (agentmain throws an exception) - System.out.println(" - Test: Load a bad agent"); - System.out.println("INFO: This test will cause error messages " - + "to appear in the application log about SilverBullet.jar " - + "not being found and an agent failing to start."); - try { - vm.loadAgent(badagent); - throw new RuntimeException( - "AgentInitializationException not thrown as expected!"); - } catch (AgentInitializationException x) { - System.out.println( - " - AgentInitializationException thrown as expected!"); + /** + * Runs the actual tests in nested class TestMain. + * The reason for running the tests in a separate process + * is that we need to modify the class path. + */ + private static void runTests(int pid) throws Throwable { + final String sep = File.separator; + + // Need to add jdk/lib/tools.jar to classpath. + String classpath = + System.getProperty("test.class.path", "") + File.pathSeparator + + System.getProperty("test.jdk", ".") + sep + "lib" + sep + "tools.jar"; + String testClassDir = System.getProperty("test.classes", "") + sep; + + // Argumenta : -classpath cp BasicTests$TestMain pid agent badagent redefineagent + String[] args = { + "-classpath", + classpath, + "BasicTests$TestMain", + Integer.toString(pid), + testClassDir + "Agent.jar", + testClassDir + "BadAgent.jar", + testClassDir + "RedefineAgent.jar" }; + OutputAnalyzer output = ProcessTools.executeTestJvm(args); + output.shouldHaveExitValue(0); + } + + /** + * Will build all jars needed by the tests. + */ + private static void buildJars() throws Throwable { + String[] jars = {"Agent", "BadAgent", "RedefineAgent", "Application" }; + for (String jar : jars) { + buildJar(jar); } + } - // Test 4 - detach from the VM and attempt a load (should throw IOE) - System.out.println(" - Test: Detach from VM"); - System.out.println("INFO: This test will cause error messages " - + "to appear in the application log about a BadAgent including " - + "a RuntimeException and an InvocationTargetException."); - vm.detach(); - try { - vm.loadAgent(agent); - throw new RuntimeException("loadAgent did not throw an exception!!"); - } catch (IOException ioe) { - System.out.println(" - IOException as expected"); - } + /** + * Will build a jar with the given name. + * Class file and manifest must already exist. + * @param jarName Name of the jar. + */ + private static void buildJar(String jarName) throws Throwable { + String testClasses = System.getProperty("test.classes", "?"); + String testSrc = System.getProperty("test.src", "?"); + String jar = String.format("%s/%s.jar", testClasses, jarName); + String manifest = String.format("%s/%s.mf", testSrc, jarName.toLowerCase()); + String clazz = String.format("%s.class", jarName); - // Test 5 - functional "end-to-end" test. - // Create a listener socket. Load Agent.jar into the target VM passing - // it the port number of our listener. When agent loads it should connect - // back to the tool. + // Arguments to the jar command has this format: + // "-cfm TESTCLASSES/Agent.jar TESTSRC/agent.mf -C TESTCLASSES Agent.class" + RunnerUtil.createJar("-cfm", jar, manifest, "-C", testClasses, clazz); + } - System.out.println(" - Re-attaching to application ..."); - vm = VirtualMachine.attach(pid); + /** + * This is the actual test. It will attach to the running Application + * and perform a number of basic attach tests. + */ + public static class TestMain { + public static void main(String args[]) throws Exception { + String pid = args[0]; + String agent = args[1]; + String badagent = args[2]; + String redefineagent = args[3]; - System.out.println(" - Test: End-to-end connection with agent"); + System.out.println(" - Attaching to application ..."); + VirtualMachine vm = VirtualMachine.attach(pid); - ServerSocket ss = new ServerSocket(0); - int port = ss.getLocalPort(); + // Test 1 - read the system properties from the target VM and + // check that property is set + System.out.println(" - Test: system properties in target VM"); + Properties props = vm.getSystemProperties(); + String value = props.getProperty("attach.test"); + if (value == null || !value.equals("true")) { + throw new RuntimeException("attach.test property not set"); + } + System.out.println(" - attach.test property set as expected"); - System.out.println(" - Loading Agent.jar into target VM ..."); - vm.loadAgent(agent, Integer.toString(port)); + // Test 1a - read the agent properties from the target VM. + // By default, the agent property contains "sun.java.command", + // "sun.jvm.flags", and "sun.jvm.args". + // Just sanity check - make sure not empty. + System.out.println(" - Test: agent properties in target VM"); + props = vm.getAgentProperties(); + if (props == null || props.size() == 0) { + throw new RuntimeException("Agent properties is empty"); + } + System.out.println(" - agent properties non-empty as expected"); - System.out.println(" - Waiting for agent to connect back to tool ..."); - Socket s = ss.accept(); - System.out.println(" - Connected to agent."); + // Test 2 - attempt to load an agent that does not exist + System.out.println(" - Test: Load an agent that does not exist"); + try { + vm.loadAgent("SilverBullet.jar"); + } catch (AgentLoadException x) { + System.out.println(" - AgentLoadException thrown as expected!"); + } - // Test 5b - functional "end-to-end" test. - // Now with an agent that does redefine. + // Test 3 - load an "bad" agent (agentmain throws an exception) + System.out.println(" - Test: Load a bad agent"); + System.out.println("INFO: This test will cause error messages " + + "to appear in the application log about SilverBullet.jar " + + "not being found and an agent failing to start."); + try { + vm.loadAgent(badagent); + throw new RuntimeException( + "AgentInitializationException not thrown as expected!"); + } catch (AgentInitializationException x) { + System.out.println( + " - AgentInitializationException thrown as expected!"); + } - System.out.println(" - Re-attaching to application ..."); - vm = VirtualMachine.attach(pid); + // Test 4 - detach from the VM and attempt a load (should throw IOE) + System.out.println(" - Test: Detach from VM"); + System.out.println("INFO: This test will cause error messages " + + "to appear in the application log about a BadAgent including " + + "a RuntimeException and an InvocationTargetException."); + vm.detach(); + try { + vm.loadAgent(agent); + throw new RuntimeException("loadAgent did not throw an exception!!"); + } catch (IOException ioe) { + System.out.println(" - IOException as expected"); + } - System.out.println(" - Test: End-to-end connection with RedefineAgent"); + // Test 5 - functional "end-to-end" test. + // Create a listener socket. Load Agent.jar into the target VM passing + // it the port number of our listener. When agent loads it should connect + // back to the tool. - ServerSocket ss2 = new ServerSocket(0); - int port2 = ss2.getLocalPort(); + System.out.println(" - Re-attaching to application ..."); + vm = VirtualMachine.attach(pid); - System.out.println(" - Loading RedefineAgent.jar into target VM ..."); - vm.loadAgent(redefineagent, Integer.toString(port2)); + System.out.println(" - Test: End-to-end connection with agent"); - System.out.println(" - Waiting for RedefineAgent to connect back to tool ..."); - Socket s2 = ss2.accept(); - System.out.println(" - Connected to RedefineAgent."); + ServerSocket ss = new ServerSocket(0); + int port = ss.getLocalPort(); - // Test 6 - list method should list the target VM - System.out.println(" - Test: VirtualMachine.list"); - List l = VirtualMachine.list(); - if (!l.isEmpty()) { - boolean found = false; - for (VirtualMachineDescriptor vmd: l) { - if (vmd.id().equals(pid)) { - found = true; - break; + System.out.println(" - Loading Agent.jar into target VM ..."); + vm.loadAgent(agent, Integer.toString(port)); + + System.out.println(" - Waiting for agent to connect back to tool ..."); + Socket s = ss.accept(); + System.out.println(" - Connected to agent."); + + // Test 5b - functional "end-to-end" test. + // Now with an agent that does redefine. + + System.out.println(" - Re-attaching to application ..."); + vm = VirtualMachine.attach(pid); + + System.out.println(" - Test: End-to-end connection with RedefineAgent"); + + ServerSocket ss2 = new ServerSocket(0); + int port2 = ss2.getLocalPort(); + + System.out.println(" - Loading RedefineAgent.jar into target VM ..."); + vm.loadAgent(redefineagent, Integer.toString(port2)); + + System.out.println(" - Waiting for RedefineAgent to connect back to tool ..."); + Socket s2 = ss2.accept(); + System.out.println(" - Connected to RedefineAgent."); + + // Test 6 - list method should list the target VM + System.out.println(" - Test: VirtualMachine.list"); + List l = VirtualMachine.list(); + if (!l.isEmpty()) { + boolean found = false; + for (VirtualMachineDescriptor vmd: l) { + if (vmd.id().equals(pid)) { + found = true; + break; + } + } + if (found) { + System.out.println(" - " + pid + " found."); + } else { + throw new RuntimeException(pid + " not found in VM list"); } } - if (found) { - System.out.println(" - " + pid + " found."); - } else { - throw new RuntimeException(pid + " not found in VM list"); + + // test 7 - basic hashCode/equals tests + System.out.println(" - Test: hashCode/equals"); + + VirtualMachine vm1 = VirtualMachine.attach(pid); + VirtualMachine vm2 = VirtualMachine.attach(pid); + if (!vm1.equals(vm2)) { + throw new RuntimeException("virtual machines are not equal"); } + if (vm.hashCode() != vm.hashCode()) { + throw new RuntimeException("virtual machine hashCodes not equal"); + } + System.out.println(" - hashCode/equals okay"); + + // --- + System.out.println(" - Cleaning up..."); + s.close(); + ss.close(); + s2.close(); + ss2.close(); } - - // test 7 - basic hashCode/equals tests - System.out.println(" - Test: hashCode/equals"); - - VirtualMachine vm1 = VirtualMachine.attach(pid); - VirtualMachine vm2 = VirtualMachine.attach(pid); - if (!vm1.equals(vm2)) { - throw new RuntimeException("virtual machines are not equal"); - } - if (vm.hashCode() != vm.hashCode()) { - throw new RuntimeException("virtual machine hashCodes not equal"); - } - System.out.println(" - hashCode/equals okay"); - - - // --- - System.out.println(" - Cleaning up..."); - s.close(); - ss.close(); - s2.close(); - ss2.close(); } } diff --git a/jdk/test/com/sun/tools/attach/BasicTests.sh b/jdk/test/com/sun/tools/attach/BasicTests.sh deleted file mode 100644 index fc5a7fb245f..00000000000 --- a/jdk/test/com/sun/tools/attach/BasicTests.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2005, 2011, 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 6173612 6273707 6277253 6335921 6348630 6342019 6381757 -# @summary Basic unit tests for the VM attach mechanism. -# -# @build BasicTests -# @run shell BasicTests.sh - -if [ "${TESTSRC}" = "" ] -then - echo "TESTSRC not set. Test cannot execute. Failed." - exit 1 -fi - -# Windows 2000 is a problem here, so we skip it, see 6962615 -osrev=`uname -a` -if [ "`echo ${osrev} | grep 'CYGWIN[^ ]*-5\.0'`" != "" ] ; then - echo "Treating as a pass, not testing Windows 2000" - exit 0 -fi -if [ "`echo ${osrev} | grep 'Windows'`" != "" ] ; then - if [ "`echo ${osrev} | grep '5 00'`" != "" ] ; then - echo "Treating as a pass, not testing Windows 2000" - exit 0 - fi -fi - -. ${TESTSRC}/CommonSetup.sh -. ${TESTSRC}/ApplicationSetup.sh -. ${TESTSRC}/AgentSetup.sh - -startApplication -Dattach.test=true -# pid = process-id, port = shutdown port - -failures=0 - -echo "Running tests ..." - -$JAVA ${TESTVMOPTS} -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \ - BasicTests $pid $agent $badagent $redefineagent 2>&1 -if [ $? != 0 ]; then failures=`expr $failures + 1`; fi - -stopApplication $port - -# Add these info messages to $OUTPUTFILE just in case someone -# looks at it and wonders about the failures. We have to do -# this after the application is stopped because it is writing -# to $OUTPUTFILE. -( -echo "" -echo "INFO: Test 2 will cause error messages about SilverBullet.jar" \ - "and an agent failing to start." -echo "INFO: Test 3 will cause error messages about BadAgent" \ - "including a RuntimeException and an InvocationTargetException." -) >> ${OUTPUTFILE} - -if [ $failures = 0 ]; - then echo "All tests passed."; - else echo "$failures test(s) failed:"; cat ${OUTPUTFILE}; -fi -exit $failures diff --git a/jdk/test/com/sun/tools/attach/CommonSetup.sh b/jdk/test/com/sun/tools/attach/CommonSetup.sh deleted file mode 100644 index 13554918178..00000000000 --- a/jdk/test/com/sun/tools/attach/CommonSetup.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - - -# -# -# Common setup for the Attach API unit tests. Setups up the following variables: -# -# PS - path sep. -# FS - file sep. -# JAVA - java cmd. -# JAVAC - javac cmd. -# JAR - jar cmd. - -OS=`uname -s` -case "$OS" in - SunOS | Linux | Darwin ) - PS=":" - FS="/" - ;; - Windows* ) - PS=";" - OS="Windows" - FS="\\" - ;; - CYGWIN* ) - PS=";" - OS="Windows" - FS="\\" - isCygwin=true - ;; - * ) - echo "Unrecognized system!" - exit 1; - ;; -esac - -if [ "${TESTJAVA}" = "" ] -then - echo "TESTJAVA not set. Test cannot execute. Failed." - exit 1 -fi - -if [ "${TESTSRC}" = "" ] -then - echo "TESTSRC not set. Test cannot execute. Failed." - exit 1 -fi - -if [ "${TESTCLASSES}" = "" ] -then - echo "TESTCLASSES not set. Test cannot execute. Failed." - exit 1 -fi - -JAVA="${TESTJAVA}/bin/java" -JAVAC="${TESTJAVA}/bin/javac" -JAR="${TESTJAVA}/bin/jar" - diff --git a/jdk/test/com/sun/tools/attach/PermissionTest.java b/jdk/test/com/sun/tools/attach/PermissionTest.java index 5be6c05099a..933ec2c23e8 100644 --- a/jdk/test/com/sun/tools/attach/PermissionTest.java +++ b/jdk/test/com/sun/tools/attach/PermissionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013 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 @@ -21,39 +21,119 @@ * questions. */ -/* - * - * - * Unit test for Attach API - this checks that a SecurityException is thrown as - * expected. - */ import com.sun.tools.attach.VirtualMachine; import com.sun.tools.attach.AttachNotSupportedException; import java.util.Properties; +import java.io.File; +import jdk.testlibrary.OutputAnalyzer; +import jdk.testlibrary.ProcessTools; +import jdk.testlibrary.ProcessThread; +/* + * @test + * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757 + * @summary Basic unit tests for the VM attach mechanism. + * @library /lib/testlibrary + * @run build Application Shutdown + * @run main PermissionTest + * + * Unit test for Attach API - + * this checks that a SecurityException is thrown as expected. + */ public class PermissionTest { - public static void main(String args[]) throws Exception { - SecurityManager sm = System.getSecurityManager(); - if (sm == null) { - throw new RuntimeException("Test configuration error - no security manager set"); - } - - String pid = args[0]; - boolean shouldFail = Boolean.parseBoolean(args[1]); + /* + * The actual test is in the nested class TestMain. + * The responsibility of this class is to: + * 1. Start the Application class in a separate process. + * 2. Find the pid and shutdown port of the running Application. + * 3. Run the tests in TstMain that will attach to the Application. + * 4. Shut down the Application. + */ + public static void main(String args[]) throws Throwable { + final String pidFile ="TestPermission.Application.pid"; + ProcessThread processThread = null; + RunnerUtil.ProcessInfo info = null; try { - VirtualMachine.attach(pid).detach(); - if (shouldFail) { - throw new RuntimeException("SecurityException should be thrown"); + processThread = RunnerUtil.startApplication(pidFile); + info = RunnerUtil.readProcessInfo(pidFile); + runTests(info.pid); + } catch (Throwable t) { + System.out.println("TestPermission got unexpected exception: " + t); + t.printStackTrace(); + throw t; + } finally { + // Make sure the Application process is stopped. + RunnerUtil.stopApplication(info.shutdownPort, processThread); + } + } + + /** + * Runs the actual test the nested class TestMain. + * The test is run in a separate process because we need to add to the classpath. + */ + private static void runTests(int pid) throws Throwable { + final String sep = File.separator; + + // Need to add jdk/lib/tools.jar to classpath. + String classpath = + System.getProperty("test.class.path", "") + File.pathSeparator + + System.getProperty("test.jdk", ".") + sep + "lib" + sep + "tools.jar"; + String testSrc = System.getProperty("test.src", "") + sep; + + // Use a policy that will NOT allow attach. Test will verify exception. + String[] args = { + "-classpath", + classpath, + "-Djava.security.manager", + String.format("-Djava.security.policy=%sjava.policy.deny", testSrc), + "PermissionTest$TestMain", + Integer.toString(pid), + "true" }; + OutputAnalyzer output = ProcessTools.executeTestJvm(args); + output.shouldHaveExitValue(0); + + // Use a policy that will allow attach. + args = new String[] { + "-classpath", + classpath, + "-Djava.security.manager", + String.format("-Djava.security.policy=%sjava.policy.allow", testSrc), + "PermissionTest$TestMain", + Integer.toString(pid), + "false" }; + output = ProcessTools.executeTestJvm(args); + output.shouldHaveExitValue(0); + } + + /** + * This is the actual test code. It will attach to the Application and verify + * that we get a SecurityException when that is expected. + */ + public static class TestMain { + public static void main(String args[]) throws Exception { + SecurityManager sm = System.getSecurityManager(); + if (sm == null) { + throw new RuntimeException("Test configuration error - no security manager set"); } - System.out.println(" - attached to target VM as expected."); - } catch (Exception x) { - // AttachNotSupportedException thrown when no providers can be loaded - if (shouldFail && ((x instanceof AttachNotSupportedException) || - (x instanceof SecurityException))) { - System.out.println(" - exception thrown as expected."); - } else { - throw x; + + String pid = args[0]; + boolean shouldFail = Boolean.parseBoolean(args[1]); + + try { + VirtualMachine.attach(pid).detach(); + if (shouldFail) { + throw new RuntimeException("SecurityException should be thrown"); + } + System.out.println(" - attached to target VM as expected."); + } catch (Exception x) { + // AttachNotSupportedException thrown when no providers can be loaded + if (shouldFail && ((x instanceof AttachNotSupportedException) || + (x instanceof SecurityException))) { + System.out.println(" - exception thrown as expected."); + } else { + throw x; + } } } } diff --git a/jdk/test/com/sun/tools/attach/PermissionTests.sh b/jdk/test/com/sun/tools/attach/PermissionTests.sh deleted file mode 100644 index d1cfb3cccaa..00000000000 --- a/jdk/test/com/sun/tools/attach/PermissionTests.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2005, 2010, 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 6173612 -# @summary Security manager and permission tests for Attach API -# -# @build PermissionTest -# @run shell PermissionTests.sh - -if [ "${TESTSRC}" = "" ] -then - echo "TESTSRC not set. Test cannot execute. Failed." - exit 1 -fi - -. ${TESTSRC}/CommonSetup.sh -. ${TESTSRC}/ApplicationSetup.sh - -failures=0 - -# Start target VM -startApplication -# pid = process-id, port = shutdown port - -echo "Deny test" -# deny -$JAVA ${TESTVMOPTS} -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \ - -Djava.security.manager \ - -Djava.security.policy=${TESTSRC}/java.policy.deny \ - PermissionTest $pid true 2>&1 -if [ $? != 0 ]; then failures=`expr $failures + 1`; fi - -# allow -echo "Allow test" -$JAVA ${TESTVMOPTS} -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \ - -Djava.security.manager \ - -Djava.security.policy=${TESTSRC}/java.policy.allow \ - PermissionTest $pid false 2>&1 -if [ $? != 0 ]; then failures=`expr $failures + 1`; fi - -# Stop target VM -stopApplication $port - -if [ $failures = 0 ]; - then echo "All tests passed."; - else echo "$failures test(s) failed:"; cat ${OUTPUTFILE}; -fi -exit $failures diff --git a/jdk/test/com/sun/tools/attach/ProviderTest.java b/jdk/test/com/sun/tools/attach/ProviderTest.java index 5391209e041..58ea6d5e75a 100644 --- a/jdk/test/com/sun/tools/attach/ProviderTest.java +++ b/jdk/test/com/sun/tools/attach/ProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013 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 @@ -21,24 +21,98 @@ * questions. */ -/* - * - * - * Unit test for Attach API. Attaches to the given VM and performs a number - * unit tests. - */ +import java.io.File; +import jdk.testlibrary.OutputAnalyzer; +import jdk.testlibrary.JDKToolLauncher; +import jdk.testlibrary.ProcessTools; import com.sun.tools.attach.VirtualMachine; import com.sun.tools.attach.spi.AttachProvider; +/* + * @test + * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757 + * @summary Basic unit tests for the VM attach mechanism. + * @library /lib/testlibrary + * @run build SimpleProvider + * @run main ProviderTest + * + * The test will attach and detach to/from the running Application. + */ public class ProviderTest { - public static void main(String args[]) throws Exception { - // deal with internal builds where classes are loaded from the - // 'classes' directory rather than rt.jar - ClassLoader cl = AttachProvider.class.getClassLoader(); - if (cl != ClassLoader.getSystemClassLoader()) { - System.out.println("Attach API not loaded by system class loader - test skipped"); - return; + + /* + * The actual tests are in the nested class TestMain below. + * The responsibility of this class is to: + * 1. Build the needed jar. + * 2. Run tests in ProviderTest.TestMain. + */ + public static void main(String args[]) throws Throwable { + try { + buildJar(); + runTests(); + } catch (Throwable t) { + System.out.println("TestProvider got unexpected exception: " + t); + t.printStackTrace(); + throw t; + } + } + + /** + * Runs the actual tests in the nested class TestMain. + * We need to run the tests in a separate process, + * because we need to add to the classpath. + */ + private static void runTests() throws Throwable { + final String sep = File.separator; + String testClassPath = System.getProperty("test.class.path", ""); + String testClasses = System.getProperty("test.classes", "") + sep; + String jdkLib = System.getProperty("test.jdk", ".") + sep + "lib" + sep; + + // Need to add SimpleProvider.jar and tools.jar to classpath. + String classpath = + testClassPath + File.pathSeparator + + testClasses + "SimpleProvider.jar" + File.pathSeparator + + jdkLib + "tools.jar"; + + String[] args = { + "-classpath", + classpath, + "ProviderTest$TestMain" }; + OutputAnalyzer output = ProcessTools.executeTestJvm(args); + output.shouldHaveExitValue(0); + } + + /** + * Will build the SimpleProvider.jar. + */ + private static void buildJar() throws Throwable { + final String sep = File.separator; + String testClasses = System.getProperty("test.classes", "?") + sep; + String testSrc = System.getProperty("test.src", "?") + sep; + String serviceDir = "META-INF" + sep + "services" + sep; + + RunnerUtil.createJar( + "-cf", testClasses + "SimpleProvider.jar", + "-C", testClasses, "SimpleProvider.class", + "-C", testClasses, "SimpleVirtualMachine.class", + "-C", testSrc, + serviceDir + "com.sun.tools.attach.spi.AttachProvider"); + } + + /** + * This is the actual test code that attaches to the running Application. + * This class is run in a separate process. + */ + public static class TestMain { + public static void main(String args[]) throws Exception { + // deal with internal builds where classes are loaded from the + // 'classes' directory rather than rt.jar + ClassLoader cl = AttachProvider.class.getClassLoader(); + if (cl != ClassLoader.getSystemClassLoader()) { + System.out.println("Attach API not loaded by system class loader - test skipped"); + return; + } + VirtualMachine.attach("simple:1234").detach(); } - VirtualMachine.attach("simple:1234").detach(); } } diff --git a/jdk/test/com/sun/tools/attach/ProviderTests.sh b/jdk/test/com/sun/tools/attach/ProviderTests.sh deleted file mode 100644 index f5d6411931f..00000000000 --- a/jdk/test/com/sun/tools/attach/ProviderTests.sh +++ /dev/null @@ -1,51 +0,0 @@ -# -# Copyright (c) 2005, 2010, 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 6173612 -# @summary AttachProvider unit tests -# -# @build ProviderTest SimpleProvider -# @run shell ProviderTests.sh - -if [ "${TESTSRC}" = "" ] -then - echo "TESTSRC not set. Test cannot execute. Failed." - exit 1 -fi - -. ${TESTSRC}/CommonSetup.sh - -echo "Creating JAR file ..." - -$JAR -cf ${TESTCLASSES}/SimpleProvider.jar \ - -C ${TESTCLASSES} SimpleProvider.class \ - -C ${TESTCLASSES} SimpleVirtualMachine.class \ - -C "${TESTSRC}" META-INF/services/com.sun.tools.attach.spi.AttachProvider - -echo "Running test ..." - -$JAVA ${TESTVMOPTS} -classpath \ - "${TESTCLASSES}${PS}${TESTCLASSES}/SimpleProvider.jar${PS}${TESTJAVA}/lib/tools.jar" \ - ProviderTest - diff --git a/jdk/test/com/sun/tools/attach/RedefineAgent.java b/jdk/test/com/sun/tools/attach/RedefineAgent.java index fc514b7d613..1650b354be6 100644 --- a/jdk/test/com/sun/tools/attach/RedefineAgent.java +++ b/jdk/test/com/sun/tools/attach/RedefineAgent.java @@ -43,15 +43,15 @@ import java.lang.instrument.ClassDefinition; public class RedefineAgent implements ClassFileTransformer { static byte[] classfilebytes; - static final String targetName = "java.math.BigInteger"; - static final String targetNameSlashes = "java/math/BigInteger"; + static final String targetName = "RedefineDummy"; + static final String targetNameSlashes = "RedefineDummy"; static boolean gotRedefineTransform = false; // test transform and capture class bytes for redefine public byte[] transform(ClassLoader loader, String className, Class> classBeingRedefined, - ProtectionDomain protectionDomain, + ProtectionDomain protectionDomain, byte[] classfileBuffer) { if (className.equals(targetNameSlashes)) { if (classBeingRedefined == null) { diff --git a/jdk/test/com/sun/tools/attach/RedefineDummy.java b/jdk/test/com/sun/tools/attach/RedefineDummy.java new file mode 100644 index 00000000000..44204a525ff --- /dev/null +++ b/jdk/test/com/sun/tools/attach/RedefineDummy.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2013, 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. + */ + +/* + * Simple dummy class used to test class retransform. + */ +public class RedefineDummy { + public String toString() { + return "RedefineDummy"; + } +} diff --git a/jdk/test/com/sun/tools/attach/RunnerUtil.java b/jdk/test/com/sun/tools/attach/RunnerUtil.java new file mode 100644 index 00000000000..0adbbbf3586 --- /dev/null +++ b/jdk/test/com/sun/tools/attach/RunnerUtil.java @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.IOException; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.regex.Pattern; +import java.util.regex.Matcher; +import jdk.testlibrary.OutputAnalyzer; +import jdk.testlibrary.JDKToolLauncher; +import jdk.testlibrary.ProcessTools; +import jdk.testlibrary.Utils; +import jdk.testlibrary.ProcessThread; + +/* + * Utility functions for test runners. + * (Test runner = class that launch a test) + */ +public class RunnerUtil { + /** + * The Application process must be run concurrently with our tests since + * the tests will attach to the Application. + * We will run the Application process in a separate thread. + * + * The Application must be started with flag "-Xshare:off" for the Retransform + * test in TestBasics to pass on all platforms. + * + * The Application will write its pid and shutdownPort in the given outFile. + */ + public static ProcessThread startApplication(String outFile) throws Throwable { + String classpath = System.getProperty("test.class.path", "."); + String[] args = Utils.addTestJavaOpts( + "-Dattach.test=true", "-classpath", classpath, "Application", outFile); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); + ProcessThread pt = new ProcessThread("runApplication", pb); + pt.start(); + return pt; + } + + /** + * Will stop the running Application. + * First tries to shutdown nicely by connecting to the shut down port. + * If that fails, the process will be killed hard with stopProcess(). + * + * If the nice shutdown fails, then an Exception is thrown and the test should fail. + * + * @param port The shut down port. + * @param processThread The process to stop. + */ + public static void stopApplication(int port, ProcessThread processThread) throws Throwable { + if (processThread == null) { + System.out.println("RunnerUtil.stopApplication ignored since proc is null"); + return; + } + try { + System.out.println("RunnerUtil.stopApplication waiting to for shutdown"); + OutputAnalyzer output = ProcessTools.executeTestJvm( + "-classpath", + System.getProperty("test.class.path", "."), + "Shutdown", + Integer.toString(port)); + // Verify that both the Shutdown command and the Application finished ok. + output.shouldHaveExitValue(0); + processThread.joinAndThrow(); + processThread.getOutput().shouldHaveExitValue(0); + } catch (Throwable t) { + System.out.println("RunnerUtil.stopApplication failed. Will kill it hard: " + t); + processThread.stopProcess(); + throw t; + } + } + + /** + * Creates a jar file. + * @param args Command to the jar tool. + */ + public static void createJar(String... args) { + System.out.println("Running: jar " + Arrays.toString(args)); + sun.tools.jar.Main jar = new sun.tools.jar.Main(System.out, System.err, "jar"); + if (!jar.run(args)) { + throw new RuntimeException("jar failed: args=" + Arrays.toString(args)); + } + } + + /** + * Read process info for the running Application. + * The Application writes its info to a file with this format: + * shutdownPort=42994 + * pid=19597 + * done + * + * The final "done" is used to make sure the complete file has been written + * before we try to read it. + * This function will wait until the file is available. + * + * @param filename Path to file to read. + * @return The ProcessInfo containing pid and shutdownPort. + */ + public static ProcessInfo readProcessInfo(String filename) throws Throwable { + System.out.println("Reading port and pid from file: " + filename); + File file = new File(filename); + String content = null; + + // Read file or wait for it to be created. + while (true) { + content = readFile(file); + if (content != null && content.indexOf("done") >= 0) { + break; + } + Thread.sleep(100); + } + + ProcessInfo info = new ProcessInfo(); + // search for a line with format: key=nnn + Pattern pattern = Pattern.compile("(\\w*)=([0-9]+)\\r?\\n"); + Matcher matcher = pattern.matcher(content); + while (matcher.find()) { + String key = matcher.group(1); + int value = Integer.parseInt(matcher.group(2)); + if ("pid".equals(key)) { + info.pid = value; + } else if ("shutdownPort".equals(key)) { + info.shutdownPort = value; + } + } + System.out.println("processInfo.pid:" + info.pid); + System.out.println("processInfo.shutdownPort:" + info.shutdownPort); + return info; + } + + /** + * Read the content of a file. + * @param file The file to read. + * @return The file content or null if file does not exists. + */ + public static String readFile(File file) throws IOException { + if (!file.exists()) { + return null; + } + try { + byte[] bytes = Files.readAllBytes(file.toPath()); + String content = new String(bytes); + return content; + } catch (IOException e) { + e.printStackTrace(); + throw e; + } + } + + /** + * Helper class with info of the running Application. + */ + public static class ProcessInfo { + public int pid = -1; + public int shutdownPort = -1; + } + +} diff --git a/jdk/test/java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java b/jdk/test/java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java index e545b08fea0..a63e6c13175 100644 --- a/jdk/test/java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java +++ b/jdk/test/java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java @@ -25,7 +25,9 @@ @test @bug 7050935 @summary closed/java/awt/Choice/WheelEventsConsumed/WheelEventsConsumed.html fails on win32 + @library ../../regtesthelpers @author Oleg Pekhovskiy: area=awt-choice + @build Util @run main ChoiceMouseWheelTest */ @@ -142,8 +144,7 @@ public class ChoiceMouseWheelTest extends Frame { throw new RuntimeException("Mouse Wheel scroll position error!"); } - System.exit(0); - + dispose(); } catch (AWTException e) { throw new RuntimeException("AWTException occurred - problem creating robot!"); } diff --git a/jdk/test/java/awt/FileDialog/FileDialogForDirectories/FileDialogForDirectories.html b/jdk/test/java/awt/FileDialog/FileDialogForDirectories/FileDialogForDirectories.html new file mode 100644 index 00000000000..f2179443031 --- /dev/null +++ b/jdk/test/java/awt/FileDialog/FileDialogForDirectories/FileDialogForDirectories.html @@ -0,0 +1,45 @@ + + + + + + FileDialogForDirectories + + + +FileDialogForDirectories
+ +
Bug ID: 7161437See the dialog box (usually in upper left corner) for instructions
+ + + + diff --git a/jdk/test/java/awt/FileDialog/FileDialogForDirectories/FileDialogForDirectories.java b/jdk/test/java/awt/FileDialog/FileDialogForDirectories/FileDialogForDirectories.java new file mode 100644 index 00000000000..71dcaea0c79 --- /dev/null +++ b/jdk/test/java/awt/FileDialog/FileDialogForDirectories/FileDialogForDirectories.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2013, 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 sun.awt.OSInfo; +import test.java.awt.regtesthelpers.Sysout; + +import java.applet.Applet; +import java.awt.Button; +import java.awt.FileDialog; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +public class FileDialogForDirectories extends Applet implements ActionListener { + private volatile Button showBtn; + private volatile FileDialog fd; + + @Override + public void init() { + if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) { + Sysout.createDialogWithInstructions(new String[]{ + "Press PASS, this test is for MacOS X only."}); + return; + } + + System.setProperty("apple.awt.fileDialogForDirectories", "true"); + + setLayout(new GridLayout(1, 1)); + + fd = new FileDialog(new Frame(), "Open"); + + showBtn = new Button("Show File Dialog"); + showBtn.addActionListener(this); + add(showBtn); + String[] instructions = { + "1) Click on 'Show File Dialog' button. A file dialog will come up.", + "2) Check that files can't be selected.", + "3) Check that directories can be selected.", + "4) Repeat steps 1 - 3 a few times for different files and directories.", + "5) If it's true then the test passed, otherwise it failed."}; + Sysout.createDialogWithInstructions(instructions); + }//End init() + + @Override + public void start() { + setSize(200, 200); + show(); + }// start() + + @Override + public void actionPerformed(ActionEvent e) { + if (e.getSource() == showBtn) { + fd.setVisible(true); + String output = fd.getFile(); + if (output != null) { + Sysout.println(output + " is selected"); + } + } + } +}// class ManualYesNoTest diff --git a/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Extra.java b/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Extra.java index 1ef1474b5ee..b5d59d0d7af 100644 --- a/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Extra.java +++ b/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Extra.java @@ -29,6 +29,8 @@ @run main MouseModifiersUnitTest_Extra */ +import sun.awt.OSInfo; + import java.awt.*; import java.awt.event.*; import java.util.Arrays; @@ -61,6 +63,17 @@ public class MouseModifiersUnitTest_Extra extends Frame { static int [] modifiersExStandardCTRL; static int [] modifiersExStandardALT; + private final static String SHIFT_MODIFIER = OSInfo.getOSType().equals(OSInfo.OSType.MACOSX) ? + "\u21e7" : "Shift"; + + private final static String ALT_MODIFIER = OSInfo.getOSType().equals(OSInfo.OSType.MACOSX) ? + "\u2325" : "Alt"; + + + private final static String CTRL_MODIFIER = OSInfo.getOSType().equals(OSInfo.OSType.MACOSX) ? + "\u2303" : "Ctrl"; + + // BUTTON1, 2, 3 press-release. final static int modifiersStandard = 0; //InputEvent.BUTTON_DOWN_MASK; @@ -77,7 +90,8 @@ public class MouseModifiersUnitTest_Extra extends Frame { if (modifiersEx != curStandardExModifiers[index]){ // System.out.println(">>>>>>>>>>>>>>> Pressed. modifiersEx "+modifiersEx +" : "+!= curStandardExModifiers"); - MessageLogger.reportError("Test failed : Pressed. modifiersEx != curStandardExModifiers. Got: " + modifiersEx + " , Expected: " + curStandardExModifiers[index]); + MessageLogger.reportError("Test failed : Pressed. modifiersEx != curStandardExModifiers. Got: " + + modifiersEx + " , Expected: " + curStandardExModifiers[index]); } //check event.paramString() output @@ -88,51 +102,54 @@ public class MouseModifiersUnitTest_Extra extends Frame { checkExtModifiersOnPress(testModifier, paramStringElements, button); } - public static void checkExtModifiersOnReleaseClick(int testModifier, HashMap h, int button){ + public static void checkExtModifiersOnReleaseClick(int testModifier, HashMaph, int button){ String ethalon = ""; switch (testModifier){ case SHIFT:{ - ethalon = "Shift"; + ethalon = SHIFT_MODIFIER; break; } case ALT:{ - ethalon = "Alt"; + ethalon = ALT_MODIFIER; break; } case CTRL:{ - ethalon = "Ctrl"; + ethalon = CTRL_MODIFIER; break; } } - // + if (h.get("extModifiers") == null){ h.put("extModifiers", ""); } + if (!ethalon.equals(h.get("extModifiers"))) { - MessageLogger.reportError("Test failed : Released/Clicked. extModifiers = " +h.get("extModifiers")+" instead of : "+ethalon); + MessageLogger.reportError("Test failed : Released/Clicked. extModifiers = " + + h.get("extModifiers") + " instead of : " + ethalon); } } - public static void checkExtModifiersOnPress(int testModifier, HashMap h, int button){ + public static void checkExtModifiersOnPress(int testModifier, HashMap h, int button){ String ethalon = ""; switch (testModifier){ case SHIFT:{ - ethalon = "Shift+"; + ethalon = SHIFT_MODIFIER + "+"; break; } case ALT:{ - ethalon = "Alt+"; + ethalon = ALT_MODIFIER + "+"; break; } case CTRL:{ - ethalon = "Ctrl+"; + ethalon = CTRL_MODIFIER + "+"; break; } } ethalon = ethalon + "Button" +button; if (!h.get("extModifiers").equals(ethalon)) { - MessageLogger.reportError("Test failed : Pressed. extModifiers = " +h.get("extModifiers")+" instead of : "+ethalon); + MessageLogger.reportError("Test failed : Pressed. extModifiers = " +h.get("extModifiers")+" instead of : " + + ethalon); } } @@ -152,7 +169,7 @@ public class MouseModifiersUnitTest_Extra extends Frame { } } public static HashMap tokenizeParamString(String param){ - HashMap params = new HashMap (); + HashMap params = new HashMap<>(); StringTokenizer st = new StringTokenizer(param, ",="); while (st.hasMoreTokens()){ String tmp = st.nextToken(); @@ -167,7 +184,7 @@ public class MouseModifiersUnitTest_Extra extends Frame { } public static Vector tokenizeModifiers(String modifierList){ - Vector modifiers = new Vector (); + Vector modifiers = new Vector<>(); StringTokenizer st = new StringTokenizer(modifierList, "+"); while (st.hasMoreTokens()){ String tmp = st.nextToken(); @@ -189,7 +206,8 @@ public class MouseModifiersUnitTest_Extra extends Frame { } if (modifiersEx != curStandardExModifiers[index]){ - MessageLogger.reportError("Test failed : Released. modifiersEx != curStandardExModifiers. Got: " + modifiersEx + " , Expected: " + curStandardExModifiers[index]); + MessageLogger.reportError("Test failed : Released. modifiersEx != curStandardExModifiers. Got: " + + modifiersEx + " , Expected: " + curStandardExModifiers[index]); } //check event.paramString() output @@ -212,7 +230,8 @@ public class MouseModifiersUnitTest_Extra extends Frame { } if (modifiersEx != curStandardExModifiers[index]){ - MessageLogger.reportError("Test failed : Clicked. modifiersEx != curStandardExModifiers. Got: " + modifiersEx + " , Expected: " + curStandardExModifiers[index]); + MessageLogger.reportError("Test failed : Clicked. modifiersEx != curStandardExModifiers. Got: " + + modifiersEx + " , Expected: " + curStandardExModifiers[index]); } //check event.paramString() output @@ -243,22 +262,10 @@ public class MouseModifiersUnitTest_Extra extends Frame { static Robot robot; public void init() { this.setLayout(new BorderLayout()); - - String[] instructions = - { - "This test should be used with the mouse having more then three buttons.", - "Currently, " + MouseInfo.getNumberOfButtons() +" buttons are available.", - "If there are less then three buttons, press PASS.", - "1. Press each extra mouse button.", - "2. For each mouse event its modifiers and ExModifiers will be printed.", - "3. Verify that they are correct.", - "4. Press Pass or Fail accordingly." - }; -// Sysout.createDialogWithInstructions( instructions ); - -// addMouseListener(adapterTest1); try { robot = new Robot(); + robot.setAutoDelay(100); + robot.setAutoWaitForIdle(true); } catch (Exception e) { MessageLogger.reportError("Test failed. "+e); } @@ -297,9 +304,8 @@ public class MouseModifiersUnitTest_Extra extends Frame { robot.delay(1000); robot.mouseMove(getLocationOnScreen().x + getWidth()/2, getLocationOnScreen().y + getHeight()/2); for (int i = 3; i< mouseButtonDownMasks.length; i++){ - System.out.println("testNONE() => " +mouseButtonDownMasks[i] ); + System.out.println("testNONE() => " + mouseButtonDownMasks[i]); robot.mousePress(mouseButtonDownMasks[i]); - robot.delay(100); robot.mouseRelease(mouseButtonDownMasks[i]); } robot.delay(1000); @@ -312,9 +318,8 @@ public class MouseModifiersUnitTest_Extra extends Frame { robot.mouseMove(getLocationOnScreen().x + getWidth()/2, getLocationOnScreen().y + getHeight()/2); for (int i = 3; i< mouseButtonDownMasks.length; i++){ robot.keyPress(KeyEvent.VK_SHIFT); - System.out.println("testSHIFT() => " +mouseButtonDownMasks[i] ); + System.out.println("testSHIFT() => " + mouseButtonDownMasks[i]); robot.mousePress(mouseButtonDownMasks[i]); - robot.delay(100); robot.mouseRelease(mouseButtonDownMasks[i]); robot.keyRelease(KeyEvent.VK_SHIFT); } @@ -328,9 +333,8 @@ public class MouseModifiersUnitTest_Extra extends Frame { robot.mouseMove(getLocationOnScreen().x + getWidth()/2, getLocationOnScreen().y + getHeight()/2); for (int i = 3; i< mouseButtonDownMasks.length; i++){ robot.keyPress(KeyEvent.VK_CONTROL); - System.out.println("testCTRL() => " +mouseButtonDownMasks[i] ); + System.out.println("testCTRL() => " + mouseButtonDownMasks[i]); robot.mousePress(mouseButtonDownMasks[i]); - robot.delay(100); robot.mouseRelease(mouseButtonDownMasks[i]); robot.keyRelease(KeyEvent.VK_CONTROL); } @@ -344,9 +348,8 @@ public class MouseModifiersUnitTest_Extra extends Frame { robot.mouseMove(getLocationOnScreen().x + getWidth()/2, getLocationOnScreen().y + getHeight()/2); for (int i = 3; i< mouseButtonDownMasks.length; i++){ robot.keyPress(KeyEvent.VK_ALT); - System.out.println("testALT() => " +mouseButtonDownMasks[i] ); + System.out.println("testALT() => " + mouseButtonDownMasks[i]); robot.mousePress(mouseButtonDownMasks[i]); - robot.delay(100); robot.mouseRelease(mouseButtonDownMasks[i]); robot.keyRelease(KeyEvent.VK_ALT); } diff --git a/jdk/test/java/awt/MouseInfo/JContainerMousePositionTest.java b/jdk/test/java/awt/MouseInfo/JContainerMousePositionTest.java new file mode 100644 index 00000000000..028d2e180cb --- /dev/null +++ b/jdk/test/java/awt/MouseInfo/JContainerMousePositionTest.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2013, 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 + @summary unit test for a new method in Container class: getMousePosition(boolean) + @author dav@sparc.spb.su: area= + @bug 4009555 + @run main JContainerMousePositionTest +*/ + +import javax.swing.*; +import java.awt.*; +import java.util.concurrent.atomic.AtomicReference; + +// this test looks at mouse pointer when it +// 1 over component +// 2 over Container, but not over one of its child Components. +// out of bounds of Container +// two values of paramater allowChildren are considered. + +public class JContainerMousePositionTest { + //Declare things used in the test, like buttons and labels here + private static JButton jButton1; + private static JButton jButton4; + private static JFrame frame1; + private static Container contentPane; + + public static void main(final String[] args) throws Exception { + Robot robot = new Robot(); + robot.setAutoDelay(200); + robot.setAutoWaitForIdle(true); + + SwingUtilities.invokeAndWait(JContainerMousePositionTest::init); + + robot.delay(500); + robot.waitForIdle(); + + AtomicReference centerC4 = new AtomicReference<>(); + SwingUtilities.invokeAndWait(() -> { + centerC4.set(jButton4.getLocation()); + contentPane.remove(jButton4); + contentPane.validate(); + contentPane.repaint(); + }); + robot.waitForIdle(); + + AtomicReference frameBounds = new AtomicReference<>(); + AtomicReference button1Size = new AtomicReference<>(); + SwingUtilities.invokeAndWait(() -> { + frameBounds.set(frame1.getBounds()); + button1Size.set(jButton1.getSize()); + }); + +//point mouse to center of top-left Component (button1) + robot.mouseMove(frameBounds.get().x + button1Size.get().width / 2, + frameBounds.get().y + button1Size.get().height / 2); + + AtomicReference pFalse = new AtomicReference<>(); + AtomicReference pTrue = new AtomicReference<>(); + SwingUtilities.invokeAndWait(() -> { + pFalse.set(frame1.getMousePosition(false)); + pTrue.set(frame1.getMousePosition(true)); + }); + robot.waitForIdle(); + if (pFalse.get() != null) { + throw new RuntimeException("Test failed: Container.getMousePosition(false) returned non-null over one of children."); + } + System.out.println("Test stage completed: Container.getMousePosition(false) returned null result over child Component. Passed."); + + if (pTrue.get() == null) { + throw new RuntimeException("Test failed: Container.getMousePosition(true) returned null result over child Component"); + } + System.out.println("Test stage compelted: Container.getMousePosition(true) returned non-null result over child Component. Passed."); + +//point mouse out from Container's area + robot.mouseMove(frameBounds.get().x + frameBounds.get().width + 10, + frameBounds.get().y + frameBounds.get().height + 10); + SwingUtilities.invokeAndWait(() -> { + pFalse.set(frame1.getMousePosition(false)); + pTrue.set(frame1.getMousePosition(true)); + }); + robot.waitForIdle(); + if (pFalse.get() != null || pTrue.get() != null) { + throw new RuntimeException("Test failed: Container.getMousePosition(boolean) returned incorrect result outside Container"); + } + System.out.println("Test stage completed: Container.getMousePosition(boolean) returned null result outside Container. Passed."); + +//point mouse in place free from child components (right-botton component) + robot.mouseMove(frameBounds.get().x + centerC4.get().x, + frameBounds.get().y + centerC4.get().y); + + robot.delay(3000); + SwingUtilities.invokeAndWait(() -> { + pFalse.set(contentPane.getMousePosition(false)); + pTrue.set(frame1.getMousePosition(true)); + }); + robot.waitForIdle(); + + if (pFalse.get() == null || pTrue.get() == null) { + throw new RuntimeException("Test failed: Container.getMousePosition(boolean) returned null result inside Container."); + } + System.out.println("Test stage completed: Container.getMousePosition(boolean) returned non-null results inside Container. Passed."); + + if (pTrue.get().x != centerC4.get().x || pTrue.get().y != centerC4.get().y) { + throw new RuntimeException("Test failed: Container.getMousePosition(true) returned incorrect result inside Container."); + } + System.out.println("Test stage completed: Container.getMousePosition(true) returned correct result inside Container. Passed."); + + System.out.println("TEST PASSED"); + } + + private static void init() { + frame1 = new JFrame("Testing getMousePosition() on LWs"); + jButton1 = new JButton("C1"); + jButton4 = new JButton("C4"); + contentPane = frame1.getContentPane(); + contentPane.setLayout(new GridLayout(2, 2, 25, 25)); + contentPane.add(jButton1); + contentPane.add(new JButton("C2")); + contentPane.add(new JButton("C3")); + contentPane.add(jButton4); + frame1.setSize(200, 200); + frame1.setVisible(true); + } +} + + diff --git a/jdk/test/java/awt/datatransfer/HTMLDataFlavors/ManualHTMLDataFlavorTest.java b/jdk/test/java/awt/datatransfer/HTMLDataFlavors/ManualHTMLDataFlavorTest.java index 156bbe4cb51..015d46f03b2 100644 --- a/jdk/test/java/awt/datatransfer/HTMLDataFlavors/ManualHTMLDataFlavorTest.java +++ b/jdk/test/java/awt/datatransfer/HTMLDataFlavors/ManualHTMLDataFlavorTest.java @@ -96,9 +96,7 @@ public class ManualHTMLDataFlavorTest extends Applet { Sysout.println(t.getTransferData(DataFlavor.fragmentHtmlFlavor).toString()); Sysout.println("SELECTION:"); Sysout.println(t.getTransferData(DataFlavor.selectionHtmlFlavor).toString()); - } catch (UnsupportedFlavorException e) { - e.printStackTrace(); - } catch (IOException e) { + } catch (UnsupportedFlavorException | IOException e) { e.printStackTrace(); } @@ -116,6 +114,7 @@ public class ManualHTMLDataFlavorTest extends Applet { " otherwise for instance iexplore can prohibit drag and drop from", " the browser to other applications because of", " the protected mode restrictions.", + " On Mac OS X do NOT use Safari, it does not provide the needed DataFlavor", "3) Check the data in the output area of this dialog", "5) The output should not contain information that any of", " flavors is not present in the system clipboard", diff --git a/jdk/test/java/awt/event/MouseEvent/DisabledComponents/DisabledComponentsTest.java b/jdk/test/java/awt/event/MouseEvent/DisabledComponents/DisabledComponentsTest.java new file mode 100644 index 00000000000..3da25c6d9c0 --- /dev/null +++ b/jdk/test/java/awt/event/MouseEvent/DisabledComponents/DisabledComponentsTest.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2013 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 4173714 + @summary java.awt.button behaves differently under Win32/Solaris + @author tdv@sparc.spb.su + @library ../../../regtesthelpers + @build Util + @run main DisabledComponentsTest +*/ + +/** + * DisabledComponentsTest.java + * + * summary: java.awt.button behaves differently under Win32/Solaris + * Disabled component should not receive events. This is what this + * test checks out. + */ + +import java.awt.*; +import java.awt.event.*; +import java.util.concurrent.atomic.AtomicBoolean; + +import test.java.awt.regtesthelpers.Util; + +import javax.swing.*; + +public class DisabledComponentsTest { + + private static Frame frame; + private static Button b = new Button("Button"); + private static final AtomicBoolean pressed = new AtomicBoolean(false); + private static final AtomicBoolean entered = new AtomicBoolean(false); + + private static void init() { + frame = new Frame("Test"); + frame.setBounds(100, 100, 100, 100); + b = new Button("Test"); + b.setEnabled(false); + b.addMouseListener(new MouseAdapter() { + public void mousePressed(MouseEvent e) { + System.err.println("Mouse pressed. target=" + e.getSource()); + if (!b.isEnabled()) { + System.err.println("TEST FAILED: BUTTON RECEIVED AN EVENT WHEN DISABLED!"); + pressed.set(true); + } + } + public void mouseEntered(MouseEvent e) { + System.out.println("Mouse entered. target=" + e.getSource()); + if (!b.isEnabled()) + System.err.println("TEST FAILED: BUTTON RECEIVED AN EVENT WHEN DISABLED!"); + entered.set(true); + } + }); + frame.add(b); + frame.setVisible(true); + } + + public static void main(String[] args) throws Exception { + try { + Robot r = Util.createRobot(); + r.setAutoDelay(200); + r.setAutoWaitForIdle(true); + r.mouseMove(0, 0); + SwingUtilities.invokeAndWait(DisabledComponentsTest::init); + Util.waitForIdle(r); + Util.pointOnComp(b, r); + if (entered.get()) { + throw new RuntimeException("TEST FAILED: disabled button received MouseEntered event"); + } + Util.clickOnComp(b, r); + if (pressed.get()) { + throw new RuntimeException("TEST FAILED: disabled button received MousePressed event"); + } + } finally { + if (frame != null) { + frame.dispose(); + } + } + } +} diff --git a/jdk/test/java/awt/event/MouseEvent/EnterAsGrabbedEvent/EnterAsGrabbedEvent.java b/jdk/test/java/awt/event/MouseEvent/EnterAsGrabbedEvent/EnterAsGrabbedEvent.java new file mode 100644 index 00000000000..8f62e4ffd8a --- /dev/null +++ b/jdk/test/java/awt/event/MouseEvent/EnterAsGrabbedEvent/EnterAsGrabbedEvent.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2013, 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 6317481 8012325 + @summary REG:Pressing the mouse, dragging and releasing it outside the button triggers ActionEvent, XAWT + @author Dmitry.Cherepanov@SUN.COM area=awt.event + @run main EnterAsGrabbedEvent +*/ + +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class EnterAsGrabbedEvent +{ + //Declare things used in the test, like buttons and labels here + private static Frame frame; + private static Button button; + private static volatile boolean enterTriggered = false; + private static volatile boolean actionTriggered = false; + + private static void init() + { + frame = new Frame(); + frame.setLayout(new FlowLayout()); + button = new Button("button"); + button.addActionListener(actionEvent -> { + actionTriggered = true; + }); + frame.add(button); + frame.setBounds(100, 100, 200, 200); + frame.setVisible(true); + frame.validate(); + } + + public static void main(String[] args) throws Exception { + try { + Robot r = new Robot(); + r.setAutoDelay(200); + r.setAutoWaitForIdle(true); + SwingUtilities.invokeAndWait(EnterAsGrabbedEvent::init); + r.waitForIdle(); + + Point loc = button.getLocationOnScreen(); + r.mouseMove(loc.x+button.getWidth()/2, loc.y+button.getHeight()/2); + r.mousePress(InputEvent.BUTTON1_MASK); + + // in this case (drag mouse outside the button): + // NotifyEnter (->MouseEnter) should be dispatched to the top-level + // event if the grabbed window is the component (button) + frame.addMouseListener( + new MouseAdapter() { + public void mouseEntered(MouseEvent me) { + System.out.println(me); + enterTriggered = true; + } + + // Just for tracing + public void mouseExited(MouseEvent me) { + System.out.println(me); + } + }); + + // Just for tracing + button.addMouseListener( + new MouseAdapter(){ + public void mouseEntered(MouseEvent me){ + System.out.println(me); + } + public void mouseExited(MouseEvent me){ + System.out.println(me); + } + }); + + r.mouseMove(loc.x+button.getWidth() + 1, loc.y+button.getHeight()/2); + + r.mouseRelease(InputEvent.BUTTON1_MASK); + + if (!enterTriggered) { + throw new RuntimeException("Test failed. MouseEntered was not triggered"); + } + + if (actionTriggered) { + throw new RuntimeException("Test failed. ActionEvent triggered"); + } + } finally { + if (frame != null) { + frame.dispose(); + } + } + } +} diff --git a/jdk/test/java/awt/print/PrinterJob/PrintGlyphVectorTest.java b/jdk/test/java/awt/print/PrinterJob/PrintGlyphVectorTest.java new file mode 100644 index 00000000000..12a7dca02b2 --- /dev/null +++ b/jdk/test/java/awt/print/PrinterJob/PrintGlyphVectorTest.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 1999, 2003, 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 8029204 + * @summary Tests GlyphVector is printed in the correct location + * @run main/manual=yesno PrintGlyphVectorTest + */ + +import java.io.*; +import java.awt.*; +import java.awt.event.*; +import java.awt.font.*; +import java.awt.geom.*; +import java.awt.print.*; + +public class PrintGlyphVectorTest extends Component implements Printable { + + public void drawGVs(Graphics g) { + + String testString = "0123456789abcdefghijklm"; + Graphics2D g2d = (Graphics2D)g; + g2d.setColor(Color.black); + Font font = new Font("SansSerif", Font.PLAIN, 30); + FontRenderContext frc = g2d.getFontRenderContext(); + GlyphVector v = font.createGlyphVector(frc, testString); + + + float x = 50f, + y = 50f; + + g2d.drawGlyphVector(v, x, y); + Rectangle2D r = v.getVisualBounds(); + r.setRect(r.getX()+x, r.getY()+y, r.getWidth(), r.getHeight()); + g2d.draw(r); + + Point2D p; // .Float p = new Point2D.Float(); + for (int i = 0; i < v.getNumGlyphs(); i++) { + p = v.getGlyphPosition(i); + p.setLocation(p.getX()+50, p.getY()); + v.setGlyphPosition(i, p); + } + + x = 0; + y+= 50; + + g2d.drawGlyphVector(v, x, y); + r = v.getVisualBounds(); + r.setRect(r.getX()+x, r.getY()+y, r.getWidth(), r.getHeight()); + g2d.draw(r); + + + + } + + public void paint(Graphics g) { + g.setColor(Color.white); + g.fillRect(0,0,getSize().width, getSize().height); + drawGVs(g); + } + + public Dimension getPreferredSize() { + return new Dimension(600,200); + } + + public int print(Graphics g, PageFormat pf, int pageIndex) { + + if (pageIndex > 0) { + return Printable.NO_SUCH_PAGE; + } + + Graphics2D g2d = (Graphics2D)g; + g2d.translate(pf.getImageableX(), pf.getImageableY()); + drawGVs(g2d); + + return Printable.PAGE_EXISTS; + } + + + public static void main(String arg[]) throws Exception { + + Frame f = new Frame(); + PrintGlyphVectorTest pvt = new PrintGlyphVectorTest(); + f.add("Center", pvt); + f.add("South", new PrintInstructions()); + f.pack(); + f.show(); + + + } +} + +class PrintInstructions extends Panel implements ActionListener { + + static final String INSTRUCTIONS = + "You must have a printer installed for this test.\n" + + "Press the PRINT button below and OK the print dialog\n" + + "Retrieve the output and compare the printed and on-screen text\n" + + " to confirm that in both cases the text is aligned and the boxes\n" + + "are around the text, not offset from the text."; + + PrintInstructions() { + + setLayout(new GridLayout(2,1)); + TextArea t = new TextArea(INSTRUCTIONS, 8, 80); + add(t); + Button b = new Button("PRINT"); + b.setFont(new Font("Dialog", Font.BOLD, 30)); + b.addActionListener(this); + add(b); + } + + public void actionPerformed(ActionEvent e) { + PrinterJob pj = PrinterJob.getPrinterJob(); + if (pj == null || + pj.getPrintService() == null || + !pj.printDialog()) { + return; + } + + pj.setPrintable(new PrintGlyphVectorTest()); + try { + pj.print(); + } catch (PrinterException ex) { + System.err.println(ex); + } + } + +} diff --git a/jdk/test/java/io/BufferedReader/Lines.java b/jdk/test/java/io/BufferedReader/Lines.java index 2e83e1afc70..2e35f75887d 100644 --- a/jdk/test/java/io/BufferedReader/Lines.java +++ b/jdk/test/java/io/BufferedReader/Lines.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8003258 + * @bug 8003258 8029434 * @run testng Lines */ @@ -38,6 +38,7 @@ import java.util.Map; import java.util.ArrayList; import java.util.Iterator; import java.util.NoSuchElementException; +import java.util.Spliterator; import java.util.stream.Stream; import java.util.concurrent.atomic.AtomicInteger; import org.testng.annotations.Test; @@ -281,4 +282,15 @@ public class Lines { // Read after EOL assertFalse(it.hasNext()); } + + public void testCharacteristics() { + try (BufferedReader br = new BufferedReader( + new StringReader(""))) { + Spliterator instance = br.lines().spliterator(); + assertTrue(instance.hasCharacteristics(Spliterator.NONNULL)); + assertTrue(instance.hasCharacteristics(Spliterator.ORDERED)); + } catch (IOException ioe) { + fail("Should not have any exception."); + } + } } diff --git a/jdk/test/java/lang/ProcessBuilder/Basic.java b/jdk/test/java/lang/ProcessBuilder/Basic.java index 4434e9b1ae5..ff4c3744321 100644 --- a/jdk/test/java/lang/ProcessBuilder/Basic.java +++ b/jdk/test/java/lang/ProcessBuilder/Basic.java @@ -2239,24 +2239,33 @@ public class Basic { childArgs.add("sleep"); final Process p = new ProcessBuilder(childArgs).start(); final long start = System.nanoTime(); - final CountDownLatch latch = new CountDownLatch(1); + final CountDownLatch ready = new CountDownLatch(1); + final CountDownLatch done = new CountDownLatch(1); final Thread thread = new Thread() { public void run() { try { + final boolean result; try { - latch.countDown(); - p.waitFor(30000, TimeUnit.MILLISECONDS); + ready.countDown(); + result = p.waitFor(30000, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { return; } - fail("waitFor() wasn't interrupted"); - } catch (Throwable t) { unexpected(t); }}}; + fail("waitFor() wasn't interrupted, its return value was: " + result); + } catch (Throwable t) { + unexpected(t); + } finally { + done.countDown(); + } + } + }; thread.start(); - latch.await(); + ready.await(); Thread.sleep(1000); thread.interrupt(); + done.await(); p.destroy(); } catch (Throwable t) { unexpected(t); } diff --git a/jdk/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java b/jdk/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java index 73488d9f955..0c4a4804153 100644 --- a/jdk/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java +++ b/jdk/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2013 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,11 @@ * @bug 6396794 * @summary Check that LastGcInfo contents are reasonable * @author Eamonn McManus - * @run main/othervm GcInfoCompositeType + * @run main/othervm -XX:-ExplicitGCInvokesConcurrent GcInfoCompositeType */ +// Passing "-XX:-ExplicitGCInvokesConcurrent" to force System.gc() +// run on foreground when CMS is used and prevent situations when "GcInfo" +// is missing even though System.gc() was successfuly processed. import java.util.*; import java.lang.management.*; diff --git a/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java b/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java index 62dc211d913..42ae7d05ab1 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java +++ b/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, 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 @@ -31,44 +31,45 @@ * @author Mandy Chung * * @build CollectionUsageThreshold MemoryUtil - * @run main/timeout=300 CollectionUsageThreshold + * @run main/othervm/timeout=300 -XX:+PrintGCDetails -XX:+UseSerialGC CollectionUsageThreshold + * @run main/othervm/timeout=300 -XX:+PrintGCDetails -XX:+UseParallelGC CollectionUsageThreshold + * @run main/othervm/timeout=300 -XX:+PrintGCDetails -XX:+UseG1GC CollectionUsageThreshold + * @run main/othervm/timeout=300 -XX:+PrintGCDetails -XX:+UseConcMarkSweepGC CollectionUsageThreshold */ -import java.lang.Thread.*; -import java.lang.management.*; import java.util.*; import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicInteger; import javax.management.*; import javax.management.openmbean.CompositeData; +import java.lang.management.*; +import static java.lang.management.MemoryNotificationInfo.*;; +import static java.lang.management.ManagementFactory.*; public class CollectionUsageThreshold { - private static MemoryMXBean mm = ManagementFactory.getMemoryMXBean(); - private static List