--- a/.hgtags Fri Oct 03 13:00:21 2014 +0200
+++ b/.hgtags Tue Oct 07 15:44:11 2014 -0700
@@ -275,3 +275,4 @@
b2287cac7813c70ed7f679d9a46fe774bd4005f8 jdk9-b30
9d0e6639a4d71b63507dd94b1a028e963b27e798 jdk9-b31
1b1ec4291abc0ba6da7bf79b754f08dd759a4a0c jdk9-b32
+f0c5e4b732da823bdaa4184133675f384e7cd68d jdk9-b33
--- a/.hgtags-top-repo Fri Oct 03 13:00:21 2014 +0200
+++ b/.hgtags-top-repo Tue Oct 07 15:44:11 2014 -0700
@@ -275,3 +275,4 @@
36e9bc875325813ac9c44ac0c617a463091fa9f5 jdk9-b30
69a84c16d9c28e0e3d504b9c8766c24bafcd58f6 jdk9-b31
7e3512dae8e020d44399c0f1c579ff1fe3090ed6 jdk9-b32
+e4ba01b726e263953ae129be37c94de6ed145b1d jdk9-b33
--- a/corba/.hgtags Fri Oct 03 13:00:21 2014 +0200
+++ b/corba/.hgtags Tue Oct 07 15:44:11 2014 -0700
@@ -275,3 +275,4 @@
98967ae6ae53ebf15615e07cd5a6b1ae04dfd84c jdk9-b30
c432b80aadd0cb2b2361b02add4d671957d4cec9 jdk9-b31
b5b139354630edb2d06190bf31653acbdcea63a8 jdk9-b32
+cfdac5887952c2dd73c73a1d8d9aa880d0539bbf jdk9-b33
--- a/corba/make/CompileCorba.gmk Fri Oct 03 13:00:21 2014 +0200
+++ b/corba/make/CompileCorba.gmk Tue Oct 07 15:44:11 2014 -0700
@@ -51,13 +51,11 @@
JAR := $(INTERIM_CORBA_JAR)))
################################################################################
-# Copy idl files straight to jdk/lib. Not sure if this is the right way to do
-# it, but we are moving away from the one repo at a time build. Perhaps we should
-# scrap the 'jdk' prefix to bin, lib etc?
-$(JDK_OUTPUTDIR)/lib/%: $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl/%
+# Copy idl files straight to jdk/include.
+$(JDK_OUTPUTDIR)/include/%: $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl/%
$(install-file)
-IDL_TARGET_FILES := $(JDK_OUTPUTDIR)/lib/orb.idl $(JDK_OUTPUTDIR)/lib/ir.idl
+IDL_TARGET_FILES := $(JDK_OUTPUTDIR)/include/orb.idl $(JDK_OUTPUTDIR)/include/ir.idl
################################################################################
--- a/hotspot/.hgtags Fri Oct 03 13:00:21 2014 +0200
+++ b/hotspot/.hgtags Tue Oct 07 15:44:11 2014 -0700
@@ -435,3 +435,4 @@
5c722dffbc0f34eb8d903dca7b261e52248fa17e jdk9-b30
9f7d155d28e519f3e4645dc21cf185c25f3176ed jdk9-b31
af46576a8d7cb4003028b8ee8bf408cfe227315b jdk9-b32
+9b3f5e4f33725f7c1d9b8e523133fe8383a54d9f jdk9-b33
--- a/jaxp/.hgtags Fri Oct 03 13:00:21 2014 +0200
+++ b/jaxp/.hgtags Tue Oct 07 15:44:11 2014 -0700
@@ -275,3 +275,4 @@
d181d4002214e4914d5525bd5ee13369311c765c jdk9-b30
292317ebc7dbaca6b3965f0bc7b38a2cee733b7a jdk9-b31
b940ca3d2c7e8a279ca850706b89c2ad3a841e82 jdk9-b32
+46b360454dadbb329d42c59bb8192daeb9d59875 jdk9-b33
--- a/jaxws/.hgtags Fri Oct 03 13:00:21 2014 +0200
+++ b/jaxws/.hgtags Tue Oct 07 15:44:11 2014 -0700
@@ -278,3 +278,4 @@
e58d3ea638c3824f01547596b2a98aa5f77c4a5c jdk9-b30
7af228ae847f3c02aaafb7b01cdbb3bdc2e89e77 jdk9-b31
838a2f693e51b869e7bc26a20afffdde1300394e jdk9-b32
+77a45995dd3b6e57805475ae3111ac6f7db7749e jdk9-b33
--- a/jdk/.hgtags Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/.hgtags Tue Oct 07 15:44:11 2014 -0700
@@ -275,3 +275,4 @@
8d24fb4493f13d380a2adf62d444e1e5a4451f37 jdk9-b30
71e99dae28f9791287b88d46e16a266b564f22be jdk9-b31
8bdf7083b5bd02aa330ba622895e586dd3378d37 jdk9-b32
+60fe681c30bc3821545a2506d4d3c2e04073f67c jdk9-b33
--- a/jdk/make/CreateJars.gmk Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/make/CreateJars.gmk Tue Oct 07 15:44:11 2014 -0700
@@ -709,7 +709,18 @@
#
$(eval $(call SetupZipArchive,BUILD_SEC_BIN_ZIP, \
SRC := $(JDK_OUTPUTDIR), \
- INCLUDES := modules/java.base/javax/net \
+ INCLUDES := \
+ modules/java.base/javax/crypto \
+ modules/java.base/javax/crypto/spec \
+ modules/java.base/sun/security/internal/interfaces \
+ modules/java.base/sun/security/internal/spec \
+ modules/java.base/com/sun/crypto/provider \
+ modules/jdk.crypto.ec/sun/security/ec \
+ modules/jdk.crypto.mscapi/sun/security/mscapi \
+ modules/jdk.crypto.pkcs11/sun/security/pkcs11 \
+ modules/jdk.crypto.pkcs11/sun/security/pkcs11/wrapper \
+ modules/jdk.crypto.ucrypto/com/oracle/security/ucrypto \
+ modules/java.base/javax/net \
modules/java.base/javax/security/cert \
modules/java.base/com/sun/net/ssl \
modules/java.base/com/sun/security/cert \
--- a/jdk/make/CreatePolicyJars.gmk Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/make/CreatePolicyJars.gmk Tue Oct 07 15:44:11 2014 -0700
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -41,52 +41,73 @@
US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED := \
$(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/US_export_policy.jar
+ ifndef OPENJDK
+ #
+ # In past releases, Oracle JDK has had a separately downloadable set of
+ # policy files which has been a nightmare for deployment.
+ #
+ # Now if we're closed and limited (default for Oracle JDK), create
+ # an "unlimited_policy" directory that contains the unlimited policy
+ # files. It will be up to the user/deployer to make an informed choice
+ # as to whether they are legally entitled to use the unlimited policy
+ # file in their environment. Users/deployers simply need to overwrite
+ # the files. Consult README.txt (below) for more info.
+ #
+ UNLIMITED_POLICY_DIR := $(JDK_OUTPUTDIR)/lib/security/unlimited_policy
+ endif
+
#
# 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. This means we are shipping the same file
- # for both limimted and unlimited US_export_policy.jar.
+ # for both limited and unlimited US_export_policy.jar. Only the local
+ # policy file currently has restrictions.
#
- US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited
+ US_EXPORT_POLICY_JAR_SRC_DIR := \
+ $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited
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)
- US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
+ US_EXPORT_POLICY_JAR_DEPS := \
+ $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
- $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, $(US_EXPORT_POLICY_JAR_DEPS), \
+ $(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_UNLIMITED_UNSIGNED), \
EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
SKIP_METAINF := true))
- $(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED): $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
- $(ECHO) $(LOG_INFO) Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@)
- $(install-file)
+ $(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 prebuilt $(@F)
+ifeq ($(UNLIMITED_CRYPTO), true)
+ $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
$(install-file)
else
- ifeq ($(UNLIMITED_CRYPTO), true)
- $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
+ $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED)
$(install-file)
- else
- $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_LIMITED_UNSIGNED)
- $(install-file)
+endif
+
+ifndef OPENJDK
+ ifneq ($(UNLIMITED_CRYPTO), true)
+ $(UNLIMITED_POLICY_DIR)/US_export_policy.jar: \
+ $(US_EXPORT_POLICY_JAR_UNLIMITED_UNSIGNED)
+ $(install-file)
+ TARGETS += $(UNLIMITED_POLICY_DIR)/US_export_policy.jar
endif
endif
@@ -112,11 +133,13 @@
LOCAL_POLICY_JAR_UNLIMITED_TMP := \
$(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/local_policy_jar.tmp
- $(LOCAL_POLICY_JAR_LIMITED_TMP)/%: $(JDK_TOPDIR)/make/data/cryptopolicy/limited/%
- $(install-file)
+ $(LOCAL_POLICY_JAR_LIMITED_TMP)/%: \
+ $(JDK_TOPDIR)/make/data/cryptopolicy/limited/%
+ $(install-file)
- $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/%: $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited/%
- $(install-file)
+ $(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 \
@@ -135,28 +158,34 @@
EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
SKIP_METAINF := true))
- TARGETS += $(LOCAL_POLICY_JAR_LIMITED_UNSIGNED) $(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED)
+ 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
+ ifneq ($(UNLIMITED_CRYPTO), true)
+ $(UNLIMITED_POLICY_DIR)/README.txt: \
+ $(JDK_TOPDIR)/make/closed/data/cryptopolicy/README.txt
$(install-file)
- TARGETS += $(JDK_OUTPUTDIR)/jce/unsigned/policy/unlimited/README.txt
+ TARGETS += $(UNLIMITED_POLICY_DIR)/README.txt
+ endif
endif
endif
-ifndef OPENJDK
- $(LOCAL_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar
- $(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
+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)
-else
- 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
+
+ifndef OPENJDK
+ ifneq ($(UNLIMITED_CRYPTO), true)
+ $(UNLIMITED_POLICY_DIR)/local_policy.jar: \
+ $(LOCAL_POLICY_JAR_UNLIMITED_UNSIGNED)
+ $(install-file)
+ TARGETS += $(UNLIMITED_POLICY_DIR)/local_policy.jar
endif
endif
--- a/jdk/make/CreateSecurityJars.gmk Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/make/CreateSecurityJars.gmk Tue Oct 07 15:44:11 2014 -0700
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2014, 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
@@ -29,16 +29,13 @@
include MakeBase.gmk
include JavaCompilation.gmk
-# The jars created in this file are required for the exploded jdk image to function and
-# cannot wait to be built in the images target.
-
##########################################################################################
# Create manifest for security jars
#
# Include these extra attributes for now, should probably take out.
#
MAINMANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf
-JCE_MANIFEST := $(JDK_OUTPUTDIR)/lib/_the.security.manifest.mf
+JCE_MANIFEST := $(JDK_OUTPUTDIR)/jce/unsigned/_the.security.manifest.mf
$(JCE_MANIFEST): $(MAINMANIFEST)
$(MKDIR) -p $(@D)
@@ -48,18 +45,15 @@
$(MAINMANIFEST) >> $@.tmp
$(ECHO) "Extension-Name: javax.crypto" >> $@.tmp
$(ECHO) "Implementation-Vendor-Id: com.sun" >> $@.tmp
+ $(ECHO) "Release-Version: $(RELEASE)" >> $@.tmp
$(MV) $@.tmp $@
##########################################################################################
-# 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 TARGETS list. For open, signing is not needed. See
-# SignJars.gmk for more information.
+# For crypto jars, always build the jar.
#
-# The source for the crypto jars is not available for all licensees. The BUILD_CRYPTO
-# variable is set to no if these jars can't be built to skip that step of the build.
-# Note that for OPENJDK, the build will fail if BUILD_CRYPTO=no since then there is no
-# other way to get the jars than to build them.
+# The source for the crypto jars is not available for all licensees.
+# The BUILD_CRYPTO variable is set to no if these jars can't be built
+# to skip that step of the build.
SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar
SUNPKCS11_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/unsigned/sunpkcs11.jar
@@ -74,15 +68,8 @@
$(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) Copying prebuilt $(@F)
+$(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_UNSIGNED)
$(install-file)
-else
- $(SUNPKCS11_JAR_DST): $(SUNPKCS11_JAR_UNSIGNED)
- $(install-file)
-endif
TARGETS += $(SUNPKCS11_JAR_UNSIGNED) $(SUNPKCS11_JAR_DST)
@@ -101,22 +88,16 @@
$(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) Copying prebuilt $(@F)
+$(SUNEC_JAR_DST): $(SUNEC_JAR_UNSIGNED)
$(install-file)
-else
- $(SUNEC_JAR_DST): $(SUNEC_JAR_UNSIGNED)
- $(install-file)
-endif
TARGETS += $(SUNEC_JAR_UNSIGNED) $(SUNEC_JAR_DST)
##########################################################################################
SUNJCE_PROVIDER_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunjce_provider.jar
-SUNJCE_PROVIDER_JAR_UNSIGNED := $(JDK_OUTPUTDIR)/jce/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, , \
@@ -132,15 +113,8 @@
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) Copying prebuilt $(@F)
+$(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_UNSIGNED)
$(install-file)
-else
- $(SUNJCE_PROVIDER_JAR_DST): $(SUNJCE_PROVIDER_JAR_UNSIGNED)
- $(install-file)
-endif
TARGETS += $(SUNJCE_PROVIDER_JAR_DST)
@@ -163,15 +137,8 @@
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) Copying prebuilt $(@F)
+$(JCE_JAR_DST): $(JCE_JAR_UNSIGNED)
$(install-file)
-else
- $(JCE_JAR_DST): $(JCE_JAR_UNSIGNED)
- $(install-file)
-endif
TARGETS += $(JCE_JAR_DST)
@@ -192,15 +159,8 @@
$(SUNMSCAPI_JAR_UNSIGNED): $(JCE_MANIFEST)
- ifndef OPENJDK
- SUNMSCAPI_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/mscapi/sunmscapi.jar
- $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_SRC)
- @$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
+ $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_UNSIGNED)
$(install-file)
- else
- $(SUNMSCAPI_JAR_DST): $(SUNMSCAPI_JAR_UNSIGNED)
- $(install-file)
- endif
TARGETS += $(SUNMSCAPI_JAR_UNSIGNED) $(SUNMSCAPI_JAR_DST)
@@ -213,7 +173,6 @@
UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/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, , \
SRCS := $(JDK_OUTPUTDIR)/modules/jdk.crypto.ucrypto, \
@@ -225,8 +184,7 @@
$(UCRYPTO_JAR_UNSIGNED): $(JCE_MANIFEST)
- $(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_SRC)
- @$(ECHO) $(LOG_INFO) Copying prebuilt $(@F)
+ $(UCRYPTO_JAR_DST): $(UCRYPTO_JAR_UNSIGNED)
$(install-file)
TARGETS += $(UCRYPTO_JAR_UNSIGNED) $(UCRYPTO_JAR_DST)
--- a/jdk/make/Images.gmk Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/make/Images.gmk Tue Oct 07 15:44:11 2014 -0700
@@ -203,8 +203,6 @@
jconsole.jar \
sa-jdi.jar \
dt.jar \
- orb.idl \
- ir.idl \
ct.sym
ifeq ($(OPENJDK_TARGET_OS), windows)
--- a/jdk/make/SignJars.gmk Fri Oct 03 13:00:21 2014 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-#
-# Copyright (c) 2012, 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. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-include $(SPEC)
-include MakeBase.gmk
-
-# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Oracle JDK
-# builds respectively.)
-#
-# JCE builds are very different between OpenJDK and JDK. The OpenJDK JCE
-# jar files do not require signing, but those for JDK do. If an unsigned
-# jar file is installed into JDK, things will break when the crypto
-# routines are called.
-#
-# All jars are created in CreateJars.gmk. This Makefile does the signing
-# of the jars for JDK.
-#
-# For JDK, the binaries use pre-built/pre-signed binary files stored in
-# the closed workspace that are not shipped in the OpenJDK workspaces.
-# We still build the JDK files to verify the files compile, and in
-# preparation for possible signing. Developers working on JCE in JDK
-# must sign the JCE files before testing. The JCE signing key is kept
-# separate from the JDK workspace to prevent its disclosure.
-#
-# SPECIAL NOTE TO JCE/JDK developers: The source files must eventually
-# be built, signed, and then the resulting jar files MUST BE CHECKED
-# INTO THE CLOSED PART OF THE WORKSPACE*. This separate step *MUST NOT
-# BE FORGOTTEN*, otherwise a bug fixed in the source code will not be
-# reflected in the shipped binaries.
-#
-# Please consult with Release Engineering, which is responsible for
-# creating the final JCE builds suitable for checkin.
-#
-
-# Default target
-all:
-
-ifndef OPENJDK
-
-README-MAKEFILE_WARNING := \
- "\nPlease read jdk/make/SignJars.gmk for further build instructions.\n"
-
-#
-# Location for JCE codesigning key.
-#
-SIGNING_KEY_DIR := /security/ws/JCE-signing/src
-SIGNING_KEYSTORE := $(SIGNING_KEY_DIR)/KeyStore.jks
-SIGNING_PASSPHRASE := $(SIGNING_KEY_DIR)/passphrase.txt
-SIGNING_ALIAS := oracle_jce_rsa
-
-#
-# Defines for signing the various jar files.
-#
-check-keystore:
- @if [ ! -f $(SIGNING_KEYSTORE) -o ! -f $(SIGNING_PASSPHRASE) ]; then \
- $(PRINTF) "\n$(SIGNING_KEYSTORE): Signing mechanism *NOT* available..."; \
- $(PRINTF) $(README-MAKEFILE_WARNING); \
- exit 2; \
- fi
-
-$(JDK_OUTPUTDIR)/jce/signed/%: $(JDK_OUTPUTDIR)/jce/unsigned/%
- $(call install-file)
- $(JARSIGNER) -keystore $(SIGNING_KEYSTORE) \
- $@ $(SIGNING_ALIAS) < $(SIGNING_PASSPHRASE)
- @$(PRINTF) "\nJar codesigning finished.\n"
-
-JAR_LIST := \
- jce.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 \
- sunmscapi.jar \
- ucrypto.jar \
- #
-
-UNSIGNED_JARS := $(wildcard $(addprefix $(JDK_OUTPUTDIR)/jce/unsigned/, $(JAR_LIST)))
-
-ifeq ($(UNSIGNED_JARS), )
- $(error No jars found in $(JDK_OUTPUTDIR)/jce/unsigned/)
-endif
-
-SIGNED_JARS := $(patsubst $(JDK_OUTPUTDIR)/jce/unsigned/%,$(JDK_OUTPUTDIR)/jce/signed/%, \
- $(UNSIGNED_JARS))
-
-$(SIGNED_JARS): check-keystore
-
-$(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*** ***"
- @$(PRINTF) "\n*** Please consult with Release Engineering: they will generate ***"
- @$(PRINTF) "\n*** the proper binaries for the closed workspace. ***"
- @$(PRINTF) "\n"
- @$(PRINTF) $(README-MAKEFILE_WARNING)
-
-endif # !OPENJDK
--- a/jdk/make/lib/Lib-java.management.gmk Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/make/lib/Lib-java.management.gmk Tue Oct 07 15:44:11 2014 -0700
@@ -25,9 +25,12 @@
include LibCommon.gmk
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, jdk, lib/Lib-java.management.gmk))
+
################################################################################
-BUILD_LIBMANAGEMENT_SRC := $(JDK_TOPDIR)/src/java.management/share/native/libmanagement \
+BUILD_LIBMANAGEMENT_SRC += $(JDK_TOPDIR)/src/java.management/share/native/libmanagement \
$(JDK_TOPDIR)/src/java.management/$(OPENJDK_TARGET_OS_API_DIR)/native/libmanagement
BUILD_LIBMANAGEMENT_CFLAGS := -I$(JDK_TOPDIR)/src/java.management/share/native/include \
$(addprefix -I,$(BUILD_LIBMANAGEMENT_SRC)) \
@@ -56,6 +59,9 @@
endif
endif
+# Make it possible to override this variable
+LIBMANAGEMENT_MAPFILE ?= $(JDK_TOPDIR)/make/mapfiles/libmanagement/mapfile-vers
+
$(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT, \
LIBRARY := management, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
@@ -64,7 +70,7 @@
LANG := C, \
OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) $(BUILD_LIBMANAGEMENT_CFLAGS), \
- MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libmanagement/mapfile-vers, \
+ MAPFILE := $(LIBMANAGEMENT_MAPFILE), \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_solaris := -lkstat, \
--- a/jdk/make/profile-includes.txt Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/make/profile-includes.txt Tue Oct 07 15:44:11 2014 -0700
@@ -79,6 +79,13 @@
security/trusted.libraries \
tzdb.dat
+ifndef OPENJDK
+PROFILE_1_JRE_LIB_FILES += \
+ security/unlimited_policy/README.txt \
+ security/unlimited_policy/US_export_policy.jar \
+ security/unlimited_policy/local_policy.jar
+endif
+
PROFILE_1_JRE_OTHER_FILES := \
COPYRIGHT \
LICENSE \
@@ -99,6 +106,11 @@
security/US_export_policy.jar \
security/local_policy.jar
+ifndef OPENJDK
+PROFILE_1_JRE_JAR_FILES += \
+ security/unlimited_policy/US_export_policy.jar \
+ security/unlimited_policy/local_policy.jar
+endif
PROFILE_2_JRE_BIN_FILES := \
rmid$(EXE_SUFFIX) \
--- a/jdk/src/java.base/share/classes/java/net/URI.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/java/net/URI.java Tue Oct 07 15:44:11 2014 -0700
@@ -397,7 +397,7 @@
* in all cases,
* <pre>
* new URI(<i>u</i>.getScheme(),
- * <i>u</i>.getUserInfo(), <i>u</i>.getAuthority(),
+ * <i>u</i>.getAuthority(),
* <i>u</i>.getPath(), <i>u</i>.getQuery(),
* <i>u</i>.getFragment())
* .equals(<i>u</i>)</pre>
--- a/jdk/src/java.base/share/classes/javax/crypto/Cipher.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/javax/crypto/Cipher.java Tue Oct 07 15:44:11 2014 -0700
@@ -263,9 +263,9 @@
Provider provider,
String transformation) {
// See bug 4341369 & 4334690 for more info.
- // If the caller is trusted, then okey.
+ // If the caller is trusted, then okay.
// Otherwise throw a NullPointerException.
- if (!JceSecurityManager.INSTANCE.isCallerTrusted()) {
+ if (!JceSecurityManager.INSTANCE.isCallerTrusted(provider)) {
throw new NullPointerException();
}
this.spi = cipherSpi;
--- a/jdk/src/java.base/share/classes/javax/crypto/JarVerifier.java Fri Oct 03 13:00:21 2014 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 2007, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package javax.crypto;
-
-import java.io.*;
-import java.net.*;
-import java.security.*;
-import java.util.jar.*;
-
-/**
- * This class verifies JAR files (and any supporting JAR files), and
- * determines whether they may be used in this implementation.
- *
- * The JCE in OpenJDK has an open cryptographic interface, meaning it
- * does not restrict which providers can be used. Compliance with
- * United States export controls and with local law governing the
- * import/export of products incorporating the JCE in the OpenJDK is
- * the responsibility of the licensee.
- *
- * @since 1.7
- */
-final class JarVerifier {
-
- // The URL for the JAR file we want to verify.
- private URL jarURL;
- private boolean savePerms;
- private CryptoPermissions appPerms = null;
-
- /**
- * Creates a JarVerifier object to verify the given URL.
- *
- * @param jarURL the JAR file to be verified.
- * @param savePerms if true, save the permissions allowed by the
- * exemption mechanism
- */
- JarVerifier(URL jarURL, boolean savePerms) {
- this.jarURL = jarURL;
- this.savePerms = savePerms;
- }
-
- /**
- * Verify the JAR file is signed by an entity which has a certificate
- * issued by a trusted CA.
- *
- * In OpenJDK, we just need to examine the "cryptoperms" file to see
- * if any permissions were bundled together with this jar file.
- */
- void verify() throws JarException, IOException {
-
- // Short-circuit. If we weren't asked to save any, we're done.
- if (!savePerms) {
- return;
- }
-
- // If the protocol of jarURL isn't "jar", we should
- // construct a JAR URL so we can open a JarURLConnection
- // for verifying this provider.
- final URL url = jarURL.getProtocol().equalsIgnoreCase("jar")?
- jarURL : new URL("jar:" + jarURL.toString() + "!/");
-
- JarFile jf = null;
- try {
-
- // Get a link to the Jarfile to search.
- try {
- jf = AccessController.doPrivileged(
- new PrivilegedExceptionAction<JarFile>() {
- public JarFile run() throws Exception {
- JarURLConnection conn =
- (JarURLConnection) url.openConnection();
- // You could do some caching here as
- // an optimization.
- conn.setUseCaches(false);
- return conn.getJarFile();
- }
- });
- } catch (java.security.PrivilegedActionException pae) {
- throw new SecurityException("Cannot load " + url.toString(), pae);
- }
-
- if (jf != null) {
- JarEntry je = jf.getJarEntry("cryptoPerms");
- if (je == null) {
- throw new JarException(
- "Can not find cryptoPerms");
- }
- try {
- appPerms = new CryptoPermissions();
- appPerms.load(jf.getInputStream(je));
- } catch (Exception ex) {
- JarException jex =
- new JarException("Cannot load/parse" +
- jarURL.toString());
- jex.initCause(ex);
- throw jex;
- }
- }
- } finally {
- // Only call close() when caching is not enabled.
- // Otherwise, exceptions will be thrown for all
- // subsequent accesses of this cached jar.
- if (jf != null) {
- jf.close();
- }
- }
- }
-
- /**
- * Verify that the provided certs include the
- * framework signing certificate.
- *
- * @param certs the list of certs to be checked.
- * @throws Exception if the list of certs did not contain
- * the framework signing certificate
- */
- static void verifyPolicySigned(java.security.cert.Certificate[] certs)
- throws Exception {
- }
-
- /**
- * Returns the permissions which are bundled with the JAR file,
- * aka the "cryptoperms" file.
- *
- * NOTE: if this JarVerifier instance is constructed with "savePerms"
- * equal to false, then this method would always return null.
- */
- CryptoPermissions getPermissions() {
- return appPerms;
- }
-}
--- a/jdk/src/java.base/share/classes/javax/crypto/JceSecurity.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/javax/crypto/JceSecurity.java Tue Oct 07 15:44:11 2014 -0700
@@ -76,12 +76,14 @@
static {
try {
AccessController.doPrivileged(
- new PrivilegedExceptionAction<Object>() {
- public Object run() throws Exception {
+ new PrivilegedExceptionAction<Void> () {
+ @Override
+ public Void run() throws Exception {
setupJurisdictionPolicies();
return null;
}
- });
+ }
+ );
isRestricted = defaultPolicy.implies(
CryptoAllPermission.INSTANCE) ? false : true;
@@ -143,9 +145,9 @@
* @throws Exception on error
*/
static CryptoPermissions verifyExemptJar(URL codeBase) throws Exception {
- JarVerifier jv = new JarVerifier(codeBase, true);
- jv.verify();
- return jv.getPermissions();
+ ProviderVerifier pv = new ProviderVerifier(codeBase, true);
+ pv.verify();
+ return pv.getPermissions();
}
/**
@@ -153,11 +155,11 @@
*
* @throws Exception on error
*/
- static void verifyProviderJar(URL codeBase) throws Exception {
+ static void verifyProvider(URL codeBase, Provider p) throws Exception {
// Verify the provider JAR file and all
// supporting JAR files if there are any.
- JarVerifier jv = new JarVerifier(codeBase, false);
- jv.verify();
+ ProviderVerifier pv = new ProviderVerifier(codeBase, p, false);
+ pv.verify();
}
private final static Object PROVIDER_VERIFIED = Boolean.TRUE;
@@ -183,7 +185,7 @@
try {
verifyingProviders.put(p, Boolean.FALSE);
URL providerURL = getCodeBase(p.getClass());
- verifyProviderJar(providerURL);
+ verifyProvider(providerURL, p);
// Verified ok, cache result
verificationResults.put(p, PROVIDER_VERIFIED);
return null;
@@ -222,18 +224,20 @@
synchronized (codeBaseCacheRef) {
URL url = codeBaseCacheRef.get(clazz);
if (url == null) {
- url = AccessController.doPrivileged(new PrivilegedAction<URL>() {
- public URL run() {
- ProtectionDomain pd = clazz.getProtectionDomain();
- if (pd != null) {
- CodeSource cs = pd.getCodeSource();
- if (cs != null) {
- return cs.getLocation();
+ url = AccessController.doPrivileged(
+ new PrivilegedAction<URL>() {
+ @Override
+ public URL run() {
+ ProtectionDomain pd = clazz.getProtectionDomain();
+ if (pd != null) {
+ CodeSource cs = pd.getCodeSource();
+ if (cs != null) {
+ return cs.getLocation();
+ }
}
+ return NULL_URL;
}
- return NULL_URL;
- }
- });
+ });
codeBaseCacheRef.put(clazz, url);
}
return (url == NULL_URL) ? null : url;
@@ -315,7 +319,7 @@
// Enforce the signer restraint, i.e. signer of JCE framework
// jar should also be the signer of the two jurisdiction policy
// jar files.
- JarVerifier.verifyPolicySigned(je.getCertificates());
+ ProviderVerifier.verifyPolicySigned(je.getCertificates());
}
// Close and nullify the JarFile reference to help GC.
jf.close();
--- a/jdk/src/java.base/share/classes/javax/crypto/JceSecurityManager.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/javax/crypto/JceSecurityManager.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, 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
@@ -228,7 +228,7 @@
}
// See bug 4341369 & 4334690 for more info.
- boolean isCallerTrusted() {
+ boolean isCallerTrusted(Provider provider) {
// Get the caller and its codebase.
Class<?>[] context = getClassContext();
URL callerCodeBase = null;
@@ -249,7 +249,7 @@
}
// Check whether the caller is a trusted provider.
try {
- JceSecurity.verifyProviderJar(callerCodeBase);
+ JceSecurity.verifyProvider(callerCodeBase, provider);
} catch (Exception e2) {
return false;
}
--- a/jdk/src/java.base/share/classes/javax/crypto/KeyGenerator.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/javax/crypto/KeyGenerator.java Tue Oct 07 15:44:11 2014 -0700
@@ -320,7 +320,7 @@
/**
* Update the active spi of this class and return the next
- * implementation for failover. If no more implemenations are
+ * implementation for failover. If no more implementations are
* available, this method returns null. However, the active spi of
* this class is never set to null.
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/java.base/share/classes/javax/crypto/ProviderVerifier.java Tue Oct 07 15:44:11 2014 -0700
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.crypto;
+
+import java.io.*;
+import java.net.*;
+import java.security.*;
+import java.util.jar.*;
+
+/**
+ * This class verifies Provider/Policy resources found at a URL
+ * (currently only JAR files and any supporting JAR files), and
+ * determines whether they may be used in this implementation.
+ *
+ * The JCE in OpenJDK has an open cryptographic interface, meaning it
+ * does not restrict which providers can be used. Compliance with
+ * United States export controls and with local law governing the
+ * import/export of products incorporating the JCE in the OpenJDK is
+ * the responsibility of the licensee.
+ *
+ * @since 1.7
+ */
+final class ProviderVerifier {
+
+ // The URL for the JAR file we want to verify.
+ private URL jarURL;
+ private Provider provider;
+ private boolean savePerms;
+ private CryptoPermissions appPerms = null;
+
+ /**
+ * Creates a ProviderVerifier object to verify the given URL.
+ *
+ * @param jarURL the JAR file to be verified.
+ * @param savePerms if true, save the permissions allowed by the
+ * exemption mechanism
+ */
+ ProviderVerifier(URL jarURL, boolean savePerms) {
+ this(jarURL, null, savePerms);
+ }
+
+ /**
+ * Creates a ProviderVerifier object to verify the given URL.
+ *
+ * @param jarURL the JAR file to be verified
+ * @param provider the corresponding provider.
+ * @param savePerms if true, save the permissions allowed by the
+ * exemption mechanism
+ */
+ ProviderVerifier(URL jarURL, Provider provider, boolean savePerms) {
+ this.jarURL = jarURL;
+ this.provider = provider;
+ this.savePerms = savePerms;
+ }
+
+ /**
+ * Verify the JAR file is signed by an entity which has a certificate
+ * issued by a trusted CA.
+ *
+ * In OpenJDK, we just need to examine the "cryptoperms" file to see
+ * if any permissions were bundled together with this jar file.
+ */
+ void verify() throws IOException {
+
+ // Short-circuit. If we weren't asked to save any, we're done.
+ if (!savePerms) {
+ return;
+ }
+
+ // If the protocol of jarURL isn't "jar", we should
+ // construct a JAR URL so we can open a JarURLConnection
+ // for verifying this provider.
+ final URL url = jarURL.getProtocol().equalsIgnoreCase("jar")?
+ jarURL : new URL("jar:" + jarURL.toString() + "!/");
+
+ JarFile jf = null;
+ try {
+
+ // Get a link to the Jarfile to search.
+ try {
+ jf = AccessController.doPrivileged(
+ new PrivilegedExceptionAction<JarFile>() {
+ public JarFile run() throws Exception {
+ JarURLConnection conn =
+ (JarURLConnection) url.openConnection();
+ // You could do some caching here as
+ // an optimization.
+ conn.setUseCaches(false);
+ return conn.getJarFile();
+ }
+ });
+ } catch (java.security.PrivilegedActionException pae) {
+ throw new SecurityException("Cannot load " + url.toString(),
+ pae.getCause());
+ }
+
+ if (jf != null) {
+ JarEntry je = jf.getJarEntry("cryptoPerms");
+ if (je == null) {
+ throw new JarException(
+ "Can not find cryptoPerms");
+ }
+ try {
+ appPerms = new CryptoPermissions();
+ appPerms.load(jf.getInputStream(je));
+ } catch (Exception ex) {
+ JarException jex =
+ new JarException("Cannot load/parse" +
+ jarURL.toString());
+ jex.initCause(ex);
+ throw jex;
+ }
+ }
+ } finally {
+ // Only call close() when caching is not enabled.
+ // Otherwise, exceptions will be thrown for all
+ // subsequent accesses of this cached jar.
+ if (jf != null) {
+ jf.close();
+ }
+ }
+ }
+
+ /**
+ * Verify that the provided certs include the
+ * framework signing certificate.
+ *
+ * @param certs the list of certs to be checked.
+ * @throws Exception if the list of certs did not contain
+ * the framework signing certificate
+ */
+ static void verifyPolicySigned(java.security.cert.Certificate[] certs)
+ throws Exception {
+ }
+
+ /**
+ * Returns the permissions which are bundled with the JAR file,
+ * aka the "cryptoperms" file.
+ *
+ * NOTE: if this ProviderVerifier instance is constructed with "savePerms"
+ * equal to false, then this method would always return null.
+ */
+ CryptoPermissions getPermissions() {
+ return appPerms;
+ }
+}
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources.java Tue Oct 07 15:44:11 2014 -0700
@@ -337,7 +337,7 @@
{"New.prompt.", "New {0}: "},
{"Passwords.must.differ", "Passwords must differ"},
{"Re.enter.new.prompt.", "Re-enter new {0}: "},
- {"Re.enter.passpword.", "Re-enter password: "},
+ {"Re.enter.password.", "Re-enter password: "},
{"Re.enter.new.password.", "Re-enter new password: "},
{"They.don.t.match.Try.again", "They don't match. Try again"},
{"Enter.prompt.alias.name.", "Enter {0} alias name: "},
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_de.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_de.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -336,7 +336,7 @@
{"New.prompt.", "Neues {0}: "},
{"Passwords.must.differ", "Kennw\u00F6rter m\u00FCssen sich unterscheiden"},
{"Re.enter.new.prompt.", "Neues {0} erneut eingeben: "},
- {"Re.enter.passpword.", "Geben Sie das Kennwort erneut ein: "},
+ {"Re.enter.password.", "Geben Sie das Kennwort erneut ein: "},
{"Re.enter.new.password.", "Neues Kennwort erneut eingeben: "},
{"They.don.t.match.Try.again", "Keine \u00DCbereinstimmung. Wiederholen Sie den Vorgang"},
{"Enter.prompt.alias.name.", "{0}-Aliasnamen eingeben: "},
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_es.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_es.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -336,7 +336,7 @@
{"New.prompt.", "Nuevo {0}: "},
{"Passwords.must.differ", "Las contrase\u00F1as deben ser distintas"},
{"Re.enter.new.prompt.", "Vuelva a escribir el nuevo {0}: "},
- {"Re.enter.passpword.", "Vuelva a introducir la contrase\u00F1a: "},
+ {"Re.enter.password.", "Vuelva a introducir la contrase\u00F1a: "},
{"Re.enter.new.password.", "Volver a escribir la contrase\u00F1a nueva: "},
{"They.don.t.match.Try.again", "No coinciden. Int\u00E9ntelo de nuevo"},
{"Enter.prompt.alias.name.", "Escriba el nombre de alias de {0}: "},
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_fr.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_fr.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -336,7 +336,7 @@
{"New.prompt.", "Nouveau {0} : "},
{"Passwords.must.differ", "Les mots de passe doivent diff\u00E9rer"},
{"Re.enter.new.prompt.", "Indiquez encore le nouveau {0} : "},
- {"Re.enter.passpword.", "R\u00E9p\u00E9tez le mot de passe : "},
+ {"Re.enter.password.", "R\u00E9p\u00E9tez le mot de passe : "},
{"Re.enter.new.password.", "Ressaisissez le nouveau mot de passe : "},
{"They.don.t.match.Try.again", "Ils sont diff\u00E9rents. R\u00E9essayez."},
{"Enter.prompt.alias.name.", "Indiquez le nom d''alias {0} : "},
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_it.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_it.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -336,7 +336,7 @@
{"New.prompt.", "Nuova {0}: "},
{"Passwords.must.differ", "Le password non devono coincidere"},
{"Re.enter.new.prompt.", "Reimmettere un nuovo valore per {0}: "},
- {"Re.enter.passpword.", "Reimmettere la password: "},
+ {"Re.enter.password.", "Reimmettere la password: "},
{"Re.enter.new.password.", "Immettere nuovamente la nuova password: "},
{"They.don.t.match.Try.again", "Non corrispondono. Riprovare."},
{"Enter.prompt.alias.name.", "Immettere nome alias {0}: "},
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_ja.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_ja.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -336,7 +336,7 @@
{"New.prompt.", "\u65B0\u898F{0}: "},
{"Passwords.must.differ", "\u30D1\u30B9\u30EF\u30FC\u30C9\u306F\u7570\u306A\u3063\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
{"Re.enter.new.prompt.", "\u65B0\u898F{0}\u3092\u518D\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
- {"Re.enter.passpword.", "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u518D\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
+ {"Re.enter.password.", "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u518D\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
{"Re.enter.new.password.", "\u65B0\u898F\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u518D\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
{"They.don.t.match.Try.again", "\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002\u3082\u3046\u4E00\u5EA6\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044"},
{"Enter.prompt.alias.name.", "{0}\u306E\u5225\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: "},
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_ko.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_ko.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -336,7 +336,7 @@
{"New.prompt.", "\uC0C8 {0}: "},
{"Passwords.must.differ", "\uBE44\uBC00\uBC88\uD638\uB294 \uB2EC\uB77C\uC57C \uD569\uB2C8\uB2E4."},
{"Re.enter.new.prompt.", "\uC0C8 {0} \uB2E4\uC2DC \uC785\uB825: "},
- {"Re.enter.passpword.", "\uBE44\uBC00\uBC88\uD638 \uB2E4\uC2DC \uC785\uB825: "},
+ {"Re.enter.password.", "\uBE44\uBC00\uBC88\uD638 \uB2E4\uC2DC \uC785\uB825: "},
{"Re.enter.new.password.", "\uC0C8 \uBE44\uBC00\uBC88\uD638 \uB2E4\uC2DC \uC785\uB825: "},
{"They.don.t.match.Try.again", "\uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC2DC\uB3C4\uD558\uC2ED\uC2DC\uC624."},
{"Enter.prompt.alias.name.", "{0} \uBCC4\uCE6D \uC774\uB984 \uC785\uB825: "},
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_pt_BR.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_pt_BR.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -336,7 +336,7 @@
{"New.prompt.", "Nova {0}: "},
{"Passwords.must.differ", "As senhas devem ser diferentes"},
{"Re.enter.new.prompt.", "Informe novamente a nova {0}: "},
- {"Re.enter.passpword.", "Redigite a senha: "},
+ {"Re.enter.password.", "Redigite a senha: "},
{"Re.enter.new.password.", "Informe novamente a nova senha: "},
{"They.don.t.match.Try.again", "Elas n\u00E3o correspondem. Tente novamente"},
{"Enter.prompt.alias.name.", "Informe o nome do alias {0}: "},
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_sv.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_sv.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -336,7 +336,7 @@
{"New.prompt.", "Nytt {0}: "},
{"Passwords.must.differ", "L\u00F6senorden m\u00E5ste vara olika"},
{"Re.enter.new.prompt.", "Ange nytt {0} igen: "},
- {"Re.enter.passpword.", "Ange l\u00F6senord igen: "},
+ {"Re.enter.password.", "Ange l\u00F6senord igen: "},
{"Re.enter.new.password.", "Ange det nya l\u00F6senordet igen: "},
{"They.don.t.match.Try.again", "De matchar inte. F\u00F6rs\u00F6k igen"},
{"Enter.prompt.alias.name.", "Ange aliasnamn f\u00F6r {0}: "},
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_CN.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_CN.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -336,7 +336,7 @@
{"New.prompt.", "\u65B0{0}: "},
{"Passwords.must.differ", "\u53E3\u4EE4\u4E0D\u80FD\u76F8\u540C"},
{"Re.enter.new.prompt.", "\u91CD\u65B0\u8F93\u5165\u65B0{0}: "},
- {"Re.enter.passpword.", "\u518D\u6B21\u8F93\u5165\u53E3\u4EE4: "},
+ {"Re.enter.password.", "\u518D\u6B21\u8F93\u5165\u53E3\u4EE4: "},
{"Re.enter.new.password.", "\u518D\u6B21\u8F93\u5165\u65B0\u53E3\u4EE4: "},
{"They.don.t.match.Try.again", "\u5B83\u4EEC\u4E0D\u5339\u914D\u3002\u8BF7\u91CD\u8BD5"},
{"Enter.prompt.alias.name.", "\u8F93\u5165{0}\u522B\u540D: "},
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_TW.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_TW.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -336,7 +336,7 @@
{"New.prompt.", "\u65B0 {0}: "},
{"Passwords.must.differ", "\u5FC5\u9808\u662F\u4E0D\u540C\u7684\u5BC6\u78BC"},
{"Re.enter.new.prompt.", "\u91CD\u65B0\u8F38\u5165\u65B0 {0}: "},
- {"Re.enter.passpword.", "\u91CD\u65B0\u8F38\u5165\u5BC6\u78BC:"},
+ {"Re.enter.password.", "\u91CD\u65B0\u8F38\u5165\u5BC6\u78BC:"},
{"Re.enter.new.password.", "\u91CD\u65B0\u8F38\u5165\u65B0\u5BC6\u78BC: "},
{"They.don.t.match.Try.again", "\u5B83\u5011\u4E0D\u76F8\u7B26\u3002\u8ACB\u91CD\u8A66"},
{"Enter.prompt.alias.name.", "\u8F38\u5165 {0} \u5225\u540D\u540D\u7A31: "},
--- a/jdk/src/java.base/share/classes/sun/text/resources/FormatData.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/sun/text/resources/FormatData.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, 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
@@ -154,18 +154,18 @@
},
{ "MonthNarrows",
new String[] {
- "J",
- "F",
- "M",
- "A",
- "M",
- "J",
- "J",
- "A",
- "S",
- "O",
- "N",
- "D",
+ "1",
+ "2",
+ "3",
+ "4",
+ "5",
+ "6",
+ "7",
+ "8",
+ "9",
+ "10",
+ "11",
+ "12",
"",
}
},
--- a/jdk/src/java.base/share/classes/sun/text/resources/en/FormatData_en.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.base/share/classes/sun/text/resources/en/FormatData_en.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -53,6 +53,23 @@
// define this method as follows:
// return new Object[][] { };
return new Object[][] {
+ { "MonthNarrows",
+ new String[] {
+ "J",
+ "F",
+ "M",
+ "A",
+ "M",
+ "J",
+ "J",
+ "A",
+ "S",
+ "O",
+ "N",
+ "D",
+ "",
+ }
+ },
{ "NumberPatterns",
new String[] {
"#,##0.###;-#,##0.###", // decimal pattern
--- a/jdk/src/java.logging/share/classes/java/util/logging/FileHandler.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.logging/share/classes/java/util/logging/FileHandler.java Tue Oct 07 15:44:11 2014 -0700
@@ -260,6 +260,11 @@
public FileHandler() throws IOException, SecurityException {
checkPermission();
configure();
+ // pattern will have been set by configure. check that it's not
+ // empty.
+ if (pattern.isEmpty()) {
+ throw new NullPointerException();
+ }
openFiles();
}
@@ -402,6 +407,14 @@
openFiles();
}
+ private boolean isParentWritable(Path path) {
+ Path parent = path.getParent();
+ if (parent == null) {
+ parent = path.toAbsolutePath().getParent();
+ }
+ return parent != null && Files.isWritable(parent);
+ }
+
/**
* Open the set of output files, based on the configured
* instance variables.
@@ -416,6 +429,10 @@
limit = 0;
}
+ // All constructors check that pattern is neither null nor empty.
+ assert pattern != null : "pattern should not be null";
+ assert !pattern.isEmpty() : "pattern should not be empty";
+
// We register our own ErrorManager during initialization
// so we can record exceptions.
InitializationErrorManager em = new InitializationErrorManager();
@@ -458,7 +475,7 @@
// Note that this is a situation that may happen,
// but not too frequently.
if (Files.isRegularFile(lockFilePath, LinkOption.NOFOLLOW_LINKS)
- && Files.isWritable(lockFilePath.getParent())) {
+ && isParentWritable(lockFilePath)) {
try {
channel = FileChannel.open(lockFilePath,
WRITE, APPEND);
--- a/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, 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
@@ -169,6 +169,9 @@
// True if JVM death is imminent and the exit hook has been called.
private boolean deathImminent;
+ private final Map<Object, Runnable> listeners =
+ Collections.synchronizedMap(new IdentityHashMap<>());
+
static {
manager = AccessController.doPrivileged(new PrivilegedAction<LogManager>() {
@Override
@@ -1168,7 +1171,8 @@
* Any log level definitions in the new configuration file will be
* applied using Logger.setLevel(), if the target Logger exists.
* <p>
- * A PropertyChangeEvent will be fired after the properties are read.
+ * Any {@linkplain #addConfigurationListener registered configuration
+ * listener} will be invoked after the properties are read.
*
* @exception SecurityException if a security manager exists and if
* the caller does not have LoggingPermission("control").
@@ -1302,7 +1306,8 @@
/**
* Reinitialize the logging properties and reread the logging configuration
* from the given stream, which should be in java.util.Properties format.
- * A PropertyChangeEvent will be fired after the properties are read.
+ * Any {@linkplain #addConfigurationListener registered configuration
+ * listener} will be invoked after the properties are read.
* <p>
* Any log level definitions in the new configuration file will be
* applied using Logger.setLevel(), if the target Logger exists.
@@ -1335,10 +1340,14 @@
// Set levels on any pre-existing loggers, based on the new properties.
setLevelsOnExistingLoggers();
- // Note that we need to reinitialize global handles when
- // they are first referenced.
- synchronized (this) {
- initializedGlobalHandlers = false;
+ try {
+ invokeConfigurationListeners();
+ } finally {
+ // Note that we need to reinitialize global handles when
+ // they are first referenced.
+ synchronized (this) {
+ initializedGlobalHandlers = false;
+ }
}
}
@@ -1620,4 +1629,95 @@
}
return loggingMXBean;
}
+
+ /**
+ * Adds a configuration listener to be invoked each time the logging
+ * configuration is read.
+ * If the listener is already registered the method does nothing.
+ * <p>
+ * The listener is invoked with privileges that are restricted by the
+ * calling context of this method.
+ * The order in which the listeners are invoked is unspecified.
+ * <p>
+ * It is recommended that listeners do not throw errors or exceptions.
+ *
+ * If a listener terminates with an uncaught error or exception then
+ * the first exception will be propagated to the caller of
+ * {@link #readConfiguration()} (or {@link #readConfiguration(java.io.InputStream)})
+ * after all listeners have been invoked.
+ *
+ * @implNote If more than one listener terminates with an uncaught error or
+ * exception, an implementation may record the additional errors or
+ * exceptions as {@linkplain Throwable#addSuppressed(java.lang.Throwable)
+ * suppressed exceptions}.
+ *
+ * @param listener A configuration listener that will be invoked after the
+ * configuration changed.
+ * @return This LogManager.
+ * @throws SecurityException if a security manager exists and if the
+ * caller does not have LoggingPermission("control").
+ * @throws NullPointerException if the listener is null.
+ *
+ * @since 1.9
+ */
+ public LogManager addConfigurationListener(Runnable listener) {
+ final Runnable r = Objects.requireNonNull(listener);
+ checkPermission();
+ final SecurityManager sm = System.getSecurityManager();
+ final AccessControlContext acc =
+ sm == null ? null : AccessController.getContext();
+ final PrivilegedAction<Void> pa =
+ acc == null ? null : () -> { r.run() ; return null; };
+ final Runnable pr =
+ acc == null ? r : () -> AccessController.doPrivileged(pa, acc);
+ // Will do nothing if already registered.
+ listeners.putIfAbsent(r, pr);
+ return this;
+ }
+
+ /**
+ * Removes a previously registered configuration listener.
+ *
+ * Returns silently if the listener is not found.
+ *
+ * @param listener the configuration listener to remove.
+ * @throws NullPointerException if the listener is null.
+ * @throws SecurityException if a security manager exists and if the
+ * caller does not have LoggingPermission("control").
+ *
+ * @since 1.9
+ */
+ public void removeConfigurationListener(Runnable listener) {
+ final Runnable key = Objects.requireNonNull(listener);
+ checkPermission();
+ listeners.remove(key);
+ }
+
+ private void invokeConfigurationListeners() {
+ Throwable t = null;
+
+ // We're using an IdentityHashMap because we want to compare
+ // keys using identity (==).
+ // We don't want to loop within a block synchronized on 'listeners'
+ // to avoid invoking listeners from yet another synchronized block.
+ // So we're taking a snapshot of the values list to avoid the risk of
+ // ConcurrentModificationException while looping.
+ //
+ for (Runnable c : listeners.values().toArray(new Runnable[0])) {
+ try {
+ c.run();
+ } catch (ThreadDeath death) {
+ throw death;
+ } catch (Error | RuntimeException x) {
+ if (t == null) t = x;
+ else t.addSuppressed(x);
+ }
+ }
+ // Listeners are not supposed to throw exceptions, but if that
+ // happens, we will rethrow the first error or exception that is raised
+ // after all listeners have been invoked.
+ if (t instanceof Error) throw (Error)t;
+ if (t instanceof RuntimeException) throw (RuntimeException)t;
+ }
+
}
--- a/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java Tue Oct 07 15:44:11 2014 -0700
@@ -699,15 +699,15 @@
//create a SignatureAlgorithms from the SignatureMethod inside
//SignedInfo. This is used to validate the signature.
SignatureAlgorithm sa = si.getSignatureAlgorithm();
- if (log.isLoggable(java.util.logging.Level.FINE)) {
- log.log(java.util.logging.Level.FINE, "signatureMethodURI = " + sa.getAlgorithmURI());
- log.log(java.util.logging.Level.FINE, "jceSigAlgorithm = " + sa.getJCEAlgorithmString());
- log.log(java.util.logging.Level.FINE, "jceSigProvider = " + sa.getJCEProviderName());
- log.log(java.util.logging.Level.FINE, "PublicKey = " + pk);
- }
byte sigBytes[] = null;
try {
sa.initVerify(pk);
+ if (log.isLoggable(java.util.logging.Level.FINE)) {
+ log.log(java.util.logging.Level.FINE, "signatureMethodURI = " + sa.getAlgorithmURI());
+ log.log(java.util.logging.Level.FINE, "jceSigAlgorithm = " + sa.getJCEAlgorithmString());
+ log.log(java.util.logging.Level.FINE, "jceSigProvider = " + sa.getJCEProviderName());
+ log.log(java.util.logging.Level.FINE, "PublicKey = " + pk);
+ }
// Get the canonicalized (normalized) SignedInfo
SignerOutputStream so = new SignerOutputStream(sa);
--- a/jdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp Tue Oct 07 15:44:11 2014 -0700
@@ -211,6 +211,7 @@
digest_item.len = jDigestLength;
ECPrivateKey privKey;
+ privKey.privateValue.data = NULL;
// Initialize the ECParams struct
ECParams *ecparams = NULL;
@@ -387,9 +388,14 @@
{
jbyteArray jSecret = NULL;
ECParams *ecparams = NULL;
+ SECItem privateValue_item;
+ privateValue_item.data = NULL;
+ SECItem publicValue_item;
+ publicValue_item.data = NULL;
+ SECKEYECParams params_item;
+ params_item.data = NULL;
// Extract private key value
- SECItem privateValue_item;
privateValue_item.len = env->GetArrayLength(privateKey);
privateValue_item.data =
(unsigned char *) env->GetByteArrayElements(privateKey, 0);
@@ -398,7 +404,6 @@
}
// Extract public key value
- SECItem publicValue_item;
publicValue_item.len = env->GetArrayLength(publicKey);
publicValue_item.data =
(unsigned char *) env->GetByteArrayElements(publicKey, 0);
@@ -407,7 +412,6 @@
}
// Initialize the ECParams struct
- SECKEYECParams params_item;
params_item.len = env->GetArrayLength(encodedParams);
params_item.data =
(unsigned char *) env->GetByteArrayElements(encodedParams, 0);
--- a/jdk/src/jdk.dev/share/classes/com/sun/jarsigner/ContentSigner.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/src/jdk.dev/share/classes/com/sun/jarsigner/ContentSigner.java Tue Oct 07 15:44:11 2014 -0700
@@ -37,6 +37,7 @@
* @author Vincent Ryan
*/
+@jdk.Exported
public abstract class ContentSigner {
/**
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/jdk.dev/share/classes/com/sun/jarsigner/package-info.java Tue Oct 07 15:44:11 2014 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/**
+ * This package comprises the interfaces and classes used to define the
+ * signing mechanism used by the <tt>jarsigner</tt> tool.
+ * <p>
+ * Clients may override the default signing mechanism of the <tt>jarsigner</tt>
+ * tool by supplying an alternative implementation of
+ * {@link com.sun.jarsigner.ContentSigner}.
+ */
+
+@jdk.Exported
+package com.sun.jarsigner;
--- a/jdk/src/jdk.dev/share/classes/com/sun/jarsigner/package.html Fri Oct 03 13:00:21 2014 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-<html>
-<!--
-
-Copyright (c) 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. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
- <head>
- <title>Jarsigner Signing Mechanism Package</title>
- </head>
- <body>
-This package comprises the interfaces and classes used to define the
-signing mechanism used by the <tt>jarsigner</tt> tool.
-<p>
-Clients may override the default signing mechanism of the <tt>jarsigner</tt>
-tool by supplying an alternative implementation of
-{@link com.sun.jarsigner.ContentSigner}.
- </body>
-</html>
--- a/jdk/test/java/lang/invoke/LFCaching/TestMethods.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/test/java/lang/invoke/LFCaching/TestMethods.java Tue Oct 07 15:44:11 2014 -0700
@@ -44,7 +44,7 @@
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
data.put("mtTarget", mtTarget);
// Arity after reducing because of long and double take 2 slots.
@@ -83,7 +83,7 @@
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
data.put("mtTarget", mtTarget);
// Arity after reducing because of long and double take 2 slots.
@@ -91,7 +91,7 @@
int dropArgsPos = Helper.RNG.nextInt(realArity + 1);
data.put("dropArgsPos", dropArgsPos);
MethodType mtDropArgs = TestMethods.randomMethodTypeGenerator(
- Helper.RNG.nextInt(Helper.MAX_ARITY - realArity));
+ Helper.RNG.nextInt(super.maxArity - realArity));
data.put("mtDropArgs", mtDropArgs);
return data;
}
@@ -106,20 +106,20 @@
int mtTgtSlotsCount = TestMethods.argSlotsCount(mtTarget);
int mtDASlotsCount = TestMethods.argSlotsCount(mtDropArgs);
List<Class<?>> fakeParList;
- if (mtTgtSlotsCount + mtDASlotsCount > Helper.MAX_ARITY - 1) {
+ if (mtTgtSlotsCount + mtDASlotsCount > super.maxArity - 1) {
fakeParList = TestMethods.reduceArgListToSlotsCount(mtDropArgs.parameterList(),
- Helper.MAX_ARITY - mtTgtSlotsCount - 1);
+ super.maxArity - mtTgtSlotsCount - 1);
} else {
fakeParList = mtDropArgs.parameterList();
}
return MethodHandles.dropArguments(target, dropArgsPos, fakeParList);
}
},
- EXPLICIT_CAST_ARGUMENTS("explicitCastArguments") {
+ EXPLICIT_CAST_ARGUMENTS("explicitCastArguments", Helper.MAX_ARITY / 2) {
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY / 2);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
data.put("mtTarget", mtTarget);
// Arity after reducing because of long and double take 2 slots.
@@ -146,11 +146,11 @@
return MethodHandles.explicitCastArguments(target, mtExcplCastArgs);
}
},
- FILTER_ARGUMENTS("filterArguments") {
+ FILTER_ARGUMENTS("filterArguments", Helper.MAX_ARITY / 2) {
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY / 2);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
data.put("mtTarget", mtTarget);
// Arity after reducing because of long and double take 2 slots.
@@ -184,7 +184,7 @@
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
data.put("mtTarget", mtTarget);
// Arity after reducing because of long and double take 2 slots.
@@ -211,7 +211,7 @@
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
data.put("mtTarget", mtTarget);
// Arity after reducing because of long and double take 2 slots.
@@ -236,18 +236,18 @@
return MethodHandles.insertArguments(target, insertArgsPos, insertList);
}
},
- PERMUTE_ARGUMENTS("permuteArguments") {
+ PERMUTE_ARGUMENTS("permuteArguments", Helper.MAX_ARITY / 2) {
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY / 2);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
// Arity after reducing because of long and double take 2 slots.
int realArity = mtTarget.parameterCount();
int[] permuteArgsReorderArray = new int[realArity];
- int mtParmuteArgsNum = Helper.RNG.nextInt(Helper.MAX_ARITY);
- mtParmuteArgsNum = mtParmuteArgsNum == 0 ? 1 : mtParmuteArgsNum;
- MethodType mtPermuteArgs = TestMethods.randomMethodTypeGenerator(mtParmuteArgsNum);
+ int mtPermuteArgsNum = Helper.RNG.nextInt(Helper.MAX_ARITY);
+ mtPermuteArgsNum = mtPermuteArgsNum == 0 ? 1 : mtPermuteArgsNum;
+ MethodType mtPermuteArgs = TestMethods.randomMethodTypeGenerator(mtPermuteArgsNum);
mtTarget = mtTarget.changeReturnType(mtPermuteArgs.returnType());
for (int i = 0; i < realArity; i++) {
int mtPermuteArgsParNum = Helper.RNG.nextInt(mtPermuteArgs.parameterCount());
@@ -275,7 +275,7 @@
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
data.put("mtTarget", mtTarget);
return data;
@@ -293,7 +293,7 @@
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
data.put("mtTarget", mtTarget);
// Arity after reducing because of long and double take 2 slots.
@@ -329,7 +329,7 @@
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
data.put("mtTarget", mtTarget);
// Arity after reducing because of long and double take 2 slots.
@@ -359,11 +359,11 @@
return MethodHandles.catchException(target, Exception.class, handler);
}
},
- INVOKER("invoker") {
+ INVOKER("invoker", Helper.MAX_ARITY - 1) {
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
data.put("mtTarget", mtTarget);
return data;
@@ -375,11 +375,11 @@
return MethodHandles.invoker(mtTarget);
}
},
- EXACT_INVOKER("exactInvoker") {
+ EXACT_INVOKER("exactInvoker", Helper.MAX_ARITY - 1) {
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
data.put("mtTarget", mtTarget);
return data;
@@ -391,11 +391,11 @@
return MethodHandles.exactInvoker(mtTarget);
}
},
- SPREAD_INVOKER("spreadInvoker") {
+ SPREAD_INVOKER("spreadInvoker", Helper.MAX_ARITY - 1) {
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
data.put("mtTarget", mtTarget);
// Arity after reducing because of long and double take 2 slots.
@@ -416,7 +416,7 @@
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
data.put("mtTarget", mtTarget);
return data;
@@ -436,7 +436,7 @@
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
data.put("mtTarget", mtTarget);
return data;
@@ -456,7 +456,7 @@
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
data.put("mtTarget", mtTarget);
return data;
@@ -481,7 +481,7 @@
@Override
public Map<String, Object> getTestCaseData() {
Map<String, Object> data = new HashMap<>();
- int desiredArity = Helper.RNG.nextInt(Helper.MAX_ARITY);
+ int desiredArity = Helper.RNG.nextInt(super.maxArity);
MethodType mtTarget = TestMethods.randomMethodTypeGenerator(desiredArity);
data.put("mtTarget", mtTarget);
return data;
@@ -503,8 +503,15 @@
*/
public final String name;
+ private final int maxArity;
+
+ private TestMethods(String name, int maxArity) {
+ this.name = name;
+ this.maxArity = maxArity;
+ }
+
private TestMethods(String name) {
- this.name = name;
+ this(name, Helper.MAX_ARITY);
}
protected MethodHandle getMH(Map<String, Object> data, TestMethods.Kind kind) throws NoSuchMethodException, IllegalAccessException {
--- a/jdk/test/java/lang/management/MemoryMXBean/MemoryTest.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryTest.java Tue Oct 07 15:44:11 2014 -0700
@@ -59,13 +59,13 @@
// (or equivalent for other collectors)
// Number of GC memory managers = 2
- // Hotspot VM 1.8+ after perm gen removal is expected to have two or
- // three non-heap memory pools:
- // - Code cache
+ // Hotspot VM 1.8+ after perm gen removal is expected to have between two
+ // or five non-heap memory pools:
+ // - Code cache (between one and three depending on the -XX:SegmentedCodeCache option)
// - Metaspace
// - Compressed Class Space (if compressed class pointers are used)
private static int[] expectedMinNumPools = {3, 2};
- private static int[] expectedMaxNumPools = {3, 3};
+ private static int[] expectedMaxNumPools = {3, 5};
private static int expectedNumGCMgrs = 2;
private static int expectedNumMgrs = expectedNumGCMgrs + 2;
private static String[] types = { "heap", "non-heap" };
--- a/jdk/test/java/net/InetAddress/IPv4Formats.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/test/java/net/InetAddress/IPv4Formats.java Tue Oct 07 15:44:11 2014 -0700
@@ -36,7 +36,7 @@
{"126.1", "126.0.0.1"},
{"128.50.65534", "128.50.255.254"},
{"192.168.1.2", "192.168.1.2"},
- {"hello.foo.bar", null},
+ {"invalidhost.invalid", null},
{"1024.1.2.3", null},
{"128.14.66000", null }
};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/FileHandlerPath.java Tue Oct 07 15:44:11 2014 -0700
@@ -0,0 +1,315 @@
+/*
+ * Copyright (c) 2014, 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.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FilePermission;
+import java.io.IOException;
+import java.nio.channels.FileChannel;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import static java.nio.file.StandardOpenOption.CREATE_NEW;
+import static java.nio.file.StandardOpenOption.WRITE;
+import java.security.CodeSource;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+import java.util.PropertyPermission;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.logging.FileHandler;
+import java.util.logging.LogManager;
+import java.util.logging.LoggingPermission;
+
+/**
+ * @test
+ * @bug 8059269
+ * @summary tests that using a simple (non composite) pattern does not lead
+ * to NPE when the lock file already exists.
+ * @run main/othervm FileHandlerPath UNSECURE
+ * @run main/othervm FileHandlerPath SECURE
+ * @author danielfuchs
+ */
+public class FileHandlerPath {
+
+ /**
+ * We will test the simple pattern in two configurations.
+ * UNSECURE: No security manager.
+ * SECURE: With the security manager present - and the required
+ * permissions granted.
+ */
+ public static enum TestCase {
+ UNSECURE, SECURE;
+ public void run(Properties propertyFile) throws Exception {
+ System.out.println("Running test case: " + name());
+ Configure.setUp(this, propertyFile);
+ test(this.name() + " " + propertyFile.getProperty("test.name"), propertyFile);
+ }
+ }
+
+
+ // Use a random name provided by UUID to avoid collision with other tests
+ final static String logFile = FileHandlerPath.class.getSimpleName() + "_"
+ + UUID.randomUUID().toString() + ".log";
+ final static String tmpLogFile;
+ final static String userDir = System.getProperty("user.dir");
+ final static String tmpDir = System.getProperty("java.io.tmpdir");
+ private static final List<Properties> properties;
+ static {
+ tmpLogFile = new File(tmpDir, logFile).toString();
+ Properties props1 = new Properties();
+ Properties props2 = new Properties();
+ props1.setProperty("test.name", "relative file");
+ props1.setProperty("test.file.name", logFile);
+ props1.setProperty(FileHandler.class.getName() + ".pattern", logFile);
+ props1.setProperty(FileHandler.class.getName() + ".count", "1");
+ props2.setProperty("test.name", "absoluste file");
+ props2.setProperty("test.file.name", tmpLogFile);
+ props2.setProperty(FileHandler.class.getName() + ".pattern", "%t/" + logFile);
+ props2.setProperty(FileHandler.class.getName() + ".count", "1");
+ properties = Collections.unmodifiableList(Arrays.asList(
+ props1,
+ props2));
+ }
+
+ public static void main(String... args) throws Exception {
+
+ if (args == null || args.length == 0) {
+ args = new String[] {
+ TestCase.UNSECURE.name(),
+ TestCase.SECURE.name(),
+ };
+ }
+
+ // Sanity checks
+
+ if (!Files.isWritable(Paths.get(userDir))) {
+ throw new RuntimeException(userDir +
+ ": user.dir is not writable - can't run test.");
+ }
+ if (!Files.isWritable(Paths.get(tmpDir))) {
+ throw new RuntimeException(tmpDir +
+ ": java.io.tmpdir is not writable - can't run test.");
+ }
+
+ File[] files = {
+ new File(logFile),
+ new File(tmpLogFile),
+ new File(logFile+".1"),
+ new File(tmpLogFile+".1"),
+ new File(logFile+".lck"),
+ new File(tmpLogFile+".lck"),
+ new File(logFile+".1.lck"),
+ new File(tmpLogFile+".1.lck")
+ };
+
+ for (File log : files) {
+ if (log.exists()) {
+ throw new Exception(log +": file already exists - can't run test.");
+ }
+ }
+
+ // Now start the real test
+
+ try {
+ for (String testName : args) {
+ for (Properties propertyFile : properties) {
+ TestCase test = TestCase.valueOf(testName);
+ test.run(propertyFile);
+ }
+ }
+ } finally {
+ // Cleanup...
+ Configure.doPrivileged(() -> {
+ for(File log : files) {
+ try {
+ final boolean isLockFile = log.getName().endsWith(".lck");
+ // lock file should already be deleted, except if the
+ // test failed in exception.
+ // log file should all be present, except if the test
+ // failed in exception.
+ if (log.exists()) {
+ if (!isLockFile) {
+ System.out.println("deleting "+log.toString());
+ } else {
+ System.err.println("deleting lock file "+log.toString());
+ }
+ log.delete();
+ } else {
+ if (!isLockFile) {
+ System.err.println(log.toString() + ": not found.");
+ }
+ }
+ } catch (Throwable t) {
+ // should not happen
+ t.printStackTrace();
+ }
+ }
+ });
+ }
+ }
+
+ static class Configure {
+ static Policy policy = null;
+ static final AtomicBoolean allowAll = new AtomicBoolean(false);
+ static void setUp(TestCase test, Properties propertyFile) {
+ switch (test) {
+ case SECURE:
+ if (policy == null && System.getSecurityManager() != null) {
+ throw new IllegalStateException("SecurityManager already set");
+ } else if (policy == null) {
+ policy = new SimplePolicy(TestCase.SECURE, allowAll);
+ Policy.setPolicy(policy);
+ System.setSecurityManager(new SecurityManager());
+ }
+ if (System.getSecurityManager() == null) {
+ throw new IllegalStateException("No SecurityManager.");
+ }
+ if (policy == null) {
+ throw new IllegalStateException("policy not configured");
+ }
+ break;
+ case UNSECURE:
+ if (System.getSecurityManager() != null) {
+ throw new IllegalStateException("SecurityManager already set");
+ }
+ break;
+ default:
+ new InternalError("No such testcase: " + test);
+ }
+ doPrivileged(() -> {
+ try {
+ ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+ propertyFile.store(bytes, propertyFile.getProperty("test.name"));
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes.toByteArray());
+ LogManager.getLogManager().readConfiguration(bais);
+ } catch (IOException ex) {
+ throw new RuntimeException(ex);
+ }
+ });
+ }
+ static void doPrivileged(Runnable run) {
+ allowAll.set(true);
+ try {
+ run.run();
+ } finally {
+ allowAll.set(false);
+ }
+ }
+ }
+
+ public static void test(String name, Properties props) throws Exception {
+ System.out.println("Testing: " + name);
+ String file = props.getProperty("test.file.name");
+ // create the lock files first - in order to take the path that
+ // used to trigger the NPE
+ Files.createFile(Paths.get(file + ".lck"));
+ Files.createFile(Paths.get(file + ".1.lck"));
+ final FileHandler f1 = new FileHandler();
+ final FileHandler f2 = new FileHandler();
+ f1.close();
+ f2.close();
+ System.out.println("Success for " + name);
+ }
+
+
+ final static class PermissionsBuilder {
+ final Permissions perms;
+ public PermissionsBuilder() {
+ this(new Permissions());
+ }
+ public PermissionsBuilder(Permissions perms) {
+ this.perms = perms;
+ }
+ public PermissionsBuilder add(Permission p) {
+ perms.add(p);
+ return this;
+ }
+ public PermissionsBuilder addAll(PermissionCollection col) {
+ if (col != null) {
+ for (Enumeration<Permission> e = col.elements(); e.hasMoreElements(); ) {
+ perms.add(e.nextElement());
+ }
+ }
+ return this;
+ }
+ public Permissions toPermissions() {
+ final PermissionsBuilder builder = new PermissionsBuilder();
+ builder.addAll(perms);
+ return builder.perms;
+ }
+ }
+
+ public static class SimplePolicy extends Policy {
+
+ final Permissions permissions;
+ final Permissions allPermissions;
+ final AtomicBoolean allowAll;
+ public SimplePolicy(TestCase test, AtomicBoolean allowAll) {
+ this.allowAll = allowAll;
+ permissions = new Permissions();
+ permissions.add(new LoggingPermission("control", null)); // needed by new FileHandler()
+ permissions.add(new FilePermission("<<ALL FILES>>", "read")); // needed by new FileHandler()
+ permissions.add(new FilePermission(logFile, "write,delete")); // needed by new FileHandler()
+ permissions.add(new FilePermission(logFile+".lck", "write,delete")); // needed by FileHandler.close()
+ permissions.add(new FilePermission(logFile+".1", "write,delete")); // needed by new FileHandler()
+ permissions.add(new FilePermission(logFile+".1.lck", "write,delete")); // needed by FileHandler.close()
+ permissions.add(new FilePermission(tmpLogFile, "write,delete")); // needed by new FileHandler()
+ permissions.add(new FilePermission(tmpLogFile+".lck", "write,delete")); // needed by FileHandler.close()
+ permissions.add(new FilePermission(tmpLogFile+".1", "write,delete")); // needed by new FileHandler()
+ permissions.add(new FilePermission(tmpLogFile+".1.lck", "write,delete")); // needed by FileHandler.close()
+ permissions.add(new FilePermission(userDir, "write")); // needed by new FileHandler()
+ permissions.add(new FilePermission(tmpDir, "write")); // needed by new FileHandler()
+ permissions.add(new PropertyPermission("user.dir", "read"));
+ permissions.add(new PropertyPermission("java.io.tmpdir", "read"));
+ allPermissions = new Permissions();
+ allPermissions.add(new java.security.AllPermission());
+ }
+
+ @Override
+ public boolean implies(ProtectionDomain domain, Permission permission) {
+ if (allowAll.get()) return allPermissions.implies(permission);
+ return permissions.implies(permission);
+ }
+
+ @Override
+ public PermissionCollection getPermissions(CodeSource codesource) {
+ return new PermissionsBuilder().addAll(allowAll.get()
+ ? allPermissions : permissions).toPermissions();
+ }
+
+ @Override
+ public PermissionCollection getPermissions(ProtectionDomain domain) {
+ return new PermissionsBuilder().addAll(allowAll.get()
+ ? allPermissions : permissions).toPermissions();
+ }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/FileHandlerPatternExceptions.java Tue Oct 07 15:44:11 2014 -0700
@@ -0,0 +1,331 @@
+/*
+ * Copyright (c) 2014, 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.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.AccessControlException;
+import java.security.CodeSource;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.logging.FileHandler;
+import java.util.logging.LogManager;
+
+/**
+ * @test
+ * @bug 8025690
+ * @summary tests that an empty or null pattern always result in an exception.
+ * @run main/othervm FileHandlerPatternExceptions UNSECURE
+ * @run main/othervm FileHandlerPatternExceptions SECURE
+ * @author danielfuchs
+ */
+public class FileHandlerPatternExceptions {
+
+ /**
+ * We will test null/empty pattern in two configurations.
+ * UNSECURE: No security manager.
+ * SECURE: With the security manager present - and the required
+ * permissions granted.
+ */
+ public static enum TestCase {
+ UNSECURE, SECURE;
+ public void run(Properties propertyFile) throws Exception {
+ System.out.println("Running test case: " + name());
+ Configure.setUp(this, propertyFile);
+ test(this.name() + " " + propertyFile.getProperty("test.name"));
+ }
+ }
+
+
+ private static final String PREFIX =
+ "FileHandler-" + UUID.randomUUID() + ".log";
+ private static final String userDir = System.getProperty("user.dir", ".");
+ private static final boolean userDirWritable = Files.isWritable(Paths.get(userDir));
+
+ private static final List<Properties> properties;
+ static {
+ Properties props1 = new Properties();
+ Properties props2 = new Properties();
+ props1.setProperty("test.name", "with count=1");
+ props1.setProperty(FileHandler.class.getName() + ".pattern", "");
+ props1.setProperty(FileHandler.class.getName() + ".count", "1");
+ props2.setProperty("test.name", "with count=2");
+ props2.setProperty(FileHandler.class.getName() + ".pattern", "");
+ props2.setProperty(FileHandler.class.getName() + ".count", "2");
+ properties = Collections.unmodifiableList(Arrays.asList(
+ props1,
+ props2));
+ }
+
+ public static void main(String... args) throws Exception {
+
+
+ if (args == null || args.length == 0) {
+ args = new String[] {
+ TestCase.UNSECURE.name(),
+ TestCase.SECURE.name(),
+ };
+ }
+
+ try {
+ for (String testName : args) {
+ for (Properties propertyFile : properties) {
+ TestCase test = TestCase.valueOf(testName);
+ test.run(propertyFile);
+ }
+ }
+ } finally {
+ if (userDirWritable) {
+ Configure.doPrivileged(() -> {
+ // cleanup - delete files that have been created
+ try {
+ Files.list(Paths.get(userDir))
+ .filter((f) -> f.toString().contains(PREFIX))
+ .forEach((f) -> {
+ try {
+ System.out.println("deleting " + f);
+ Files.delete(f);
+ } catch(Throwable t) {
+ System.err.println("Failed to delete " + f + ": " + t);
+ }
+ });
+ } catch(Throwable t) {
+ System.err.println("Cleanup failed to list files: " + t);
+ t.printStackTrace();
+ }
+ });
+ }
+ }
+ }
+
+ static class Configure {
+ static Policy policy = null;
+ static final AtomicBoolean allowAll = new AtomicBoolean(false);
+ static void setUp(TestCase test, Properties propertyFile) {
+ switch (test) {
+ case SECURE:
+ if (policy == null && System.getSecurityManager() != null) {
+ throw new IllegalStateException("SecurityManager already set");
+ } else if (policy == null) {
+ policy = new SimplePolicy(TestCase.SECURE, allowAll);
+ Policy.setPolicy(policy);
+ System.setSecurityManager(new SecurityManager());
+ }
+ if (System.getSecurityManager() == null) {
+ throw new IllegalStateException("No SecurityManager.");
+ }
+ if (policy == null) {
+ throw new IllegalStateException("policy not configured");
+ }
+ break;
+ case UNSECURE:
+ if (System.getSecurityManager() != null) {
+ throw new IllegalStateException("SecurityManager already set");
+ }
+ break;
+ default:
+ new InternalError("No such testcase: " + test);
+ }
+ doPrivileged(() -> {
+ try {
+ ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+ propertyFile.store(bytes, propertyFile.getProperty("test.name"));
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes.toByteArray());
+ LogManager.getLogManager().readConfiguration(bais);
+ } catch (IOException ex) {
+ throw new RuntimeException(ex);
+ }
+ });
+ }
+ static void doPrivileged(Runnable run) {
+ allowAll.set(true);
+ try {
+ run.run();
+ } finally {
+ allowAll.set(false);
+ }
+ }
+ }
+
+ @FunctionalInterface
+ public static interface FileHandlerSupplier {
+ public FileHandler test() throws Exception;
+ }
+
+ private static void checkException(Class<? extends Exception> type, FileHandlerSupplier test) {
+ Throwable t = null;
+ FileHandler f = null;
+ try {
+ f = test.test();
+ } catch (Throwable x) {
+ t = x;
+ }
+ try {
+ if (type != null && t == null) {
+ throw new RuntimeException("Expected " + type.getName() + " not thrown");
+ } else if (type != null && t != null) {
+ if (type.isInstance(t)) {
+ System.out.println("Recieved expected exception: " + t);
+ } else {
+ throw new RuntimeException("Exception type mismatch: "
+ + type.getName() + " expected, "
+ + t.getClass().getName() + " received.", t);
+ }
+ } else if (t != null) {
+ throw new RuntimeException("Unexpected exception received: " + t, t);
+ }
+ } finally {
+ if (f != null) {
+ // f should always be null when an exception is expected,
+ // but in case the test doesn't behave as expected we will
+ // want to close f.
+ try { f.close(); } catch (Throwable x) {};
+ }
+ }
+ }
+
+ public static void test(String name) throws Exception {
+ System.out.println("Testing: " + name);
+ checkException(RuntimeException.class, () -> new FileHandler());
+ checkException(IllegalArgumentException.class, () -> new FileHandler(""));
+ checkException(NullPointerException.class, () -> new FileHandler(null));
+
+ checkException(IllegalArgumentException.class, () -> new FileHandler("", true));
+ checkException(IllegalArgumentException.class, () -> new FileHandler("", false));
+ checkException(NullPointerException.class, () -> new FileHandler(null, true));
+ checkException(NullPointerException.class, () -> new FileHandler(null, false));
+
+ checkException(IllegalArgumentException.class, () -> new FileHandler("", 1, 1));
+ checkException(IllegalArgumentException.class, () -> new FileHandler(PREFIX, 0, 0));
+ checkException(IllegalArgumentException.class, () -> new FileHandler(PREFIX, -1, 1));
+ checkException(IllegalArgumentException.class, () -> new FileHandler("", 0, 0));
+ checkException(IllegalArgumentException.class, () -> new FileHandler("", -1, 1));
+
+ checkException(IllegalArgumentException.class, () -> new FileHandler("", 1, 1, true));
+ checkException(IllegalArgumentException.class, () -> new FileHandler(PREFIX, 0, 0, true));
+ checkException(IllegalArgumentException.class, () -> new FileHandler(PREFIX, -1, 1, true));
+ checkException(IllegalArgumentException.class, () -> new FileHandler("", 0, 0, true));
+ checkException(IllegalArgumentException.class, () -> new FileHandler("", -1, 1, true));
+
+ checkException(IllegalArgumentException.class, () -> new FileHandler("", 1, 1, false));
+ checkException(IllegalArgumentException.class, () -> new FileHandler(PREFIX, 0, 0, false));
+ checkException(IllegalArgumentException.class, () -> new FileHandler(PREFIX, -1, 1, false));
+ checkException(IllegalArgumentException.class, () -> new FileHandler("", 0, 0, false));
+ checkException(IllegalArgumentException.class, () -> new FileHandler("", -1, 1, false));
+
+ final Class<? extends Exception> expectedException =
+ System.getSecurityManager() != null ? AccessControlException.class : null;
+
+ if (userDirWritable || expectedException != null) {
+ // These calls will create files in user.dir in the UNSECURE case.
+ // The file name contain a random UUID (PREFIX) which identifies them
+ // and allow us to remove them cleanly at the end (see finally block
+ // in main()).
+ checkException(expectedException,
+ () -> new FileHandler(PREFIX, 0, 1, true));
+ checkException(expectedException,
+ () -> new FileHandler(PREFIX, 1, 2, true));
+ checkException(expectedException,
+ () -> new FileHandler(PREFIX, 0, 1, false));
+ checkException(expectedException,
+ () -> new FileHandler(PREFIX, 1, 2, false));
+ }
+ }
+
+
+ final static class PermissionsBuilder {
+ final Permissions perms;
+ public PermissionsBuilder() {
+ this(new Permissions());
+ }
+ public PermissionsBuilder(Permissions perms) {
+ this.perms = perms;
+ }
+ public PermissionsBuilder add(Permission p) {
+ perms.add(p);
+ return this;
+ }
+ public PermissionsBuilder addAll(PermissionCollection col) {
+ if (col != null) {
+ for (Enumeration<Permission> e = col.elements(); e.hasMoreElements(); ) {
+ perms.add(e.nextElement());
+ }
+ }
+ return this;
+ }
+ public Permissions toPermissions() {
+ final PermissionsBuilder builder = new PermissionsBuilder();
+ builder.addAll(perms);
+ return builder.perms;
+ }
+ }
+
+ public static class SimplePolicy extends Policy {
+
+ final Permissions permissions;
+ final Permissions allPermissions;
+ final AtomicBoolean allowAll;
+ public SimplePolicy(TestCase test, AtomicBoolean allowAll) {
+ this.allowAll = allowAll;
+ // we don't actually need any permission to create our
+ // FileHandlers because we're passing invalid parameters
+ // which will make the creation fail...
+ permissions = new Permissions();
+
+ // these are used for configuring the test itself...
+ allPermissions = new Permissions();
+ allPermissions.add(new java.security.AllPermission());
+
+ }
+
+ @Override
+ public boolean implies(ProtectionDomain domain, Permission permission) {
+ if (allowAll.get()) return allPermissions.implies(permission);
+ return permissions.implies(permission);
+ }
+
+ @Override
+ public PermissionCollection getPermissions(CodeSource codesource) {
+ return new PermissionsBuilder().addAll(allowAll.get()
+ ? allPermissions : permissions).toPermissions();
+ }
+
+ @Override
+ public PermissionCollection getPermissions(ProtectionDomain domain) {
+ return new PermissionsBuilder().addAll(allowAll.get()
+ ? allPermissions : permissions).toPermissions();
+ }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/TestConfigurationListeners.java Tue Oct 07 15:44:11 2014 -0700
@@ -0,0 +1,489 @@
+/*
+ * Copyright (c) 2014, 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.ByteArrayInputStream;
+import java.io.FilePermission;
+import java.io.IOException;
+import java.security.AccessControlException;
+import java.security.CodeSource;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.ConcurrentModificationException;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.PropertyPermission;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.logging.LogManager;
+import java.util.logging.LoggingPermission;
+
+/**
+ * @test
+ * @bug 8043306
+ * @summary tests LogManager.addConfigurationListener and
+ * LogManager.removeConfigurationListener;
+ * @build TestConfigurationListeners
+ * @run main/othervm TestConfigurationListeners UNSECURE
+ * @run main/othervm TestConfigurationListeners PERMISSION
+ * @run main/othervm TestConfigurationListeners SECURE
+ * @author danielfuchs
+ */
+public class TestConfigurationListeners {
+
+ /**
+ * We will test add and remove ConfigurationListeners in 3 configurations.
+ * UNSECURE: No security manager.
+ * SECURE: With the security manager present - and the required
+ * LoggingPermission("control") granted.
+ * PERMISSION: With the security manager present - and the required
+ * LoggingPermission("control") *not* granted. Here we will
+ * test that the expected security permission is thrown.
+ */
+ public static enum TestCase {
+ UNSECURE, SECURE, PERMISSION;
+ public void run(String name) throws Exception {
+ System.out.println("Running test case: " + name());
+ switch (this) {
+ case UNSECURE:
+ testUnsecure(name);
+ break;
+ case SECURE:
+ testSecure(name);
+ break;
+ case PERMISSION:
+ testPermission(name);
+ break;
+ default:
+ throw new Error("Unknown test case: "+this);
+ }
+ }
+ public String loggerName(String name) {
+ return name;
+ }
+ }
+
+ public static void main(String... args) throws Exception {
+
+
+ if (args == null || args.length == 0) {
+ args = new String[] {
+ TestCase.UNSECURE.name(),
+ TestCase.SECURE.name(),
+ };
+ }
+
+ for (String testName : args) {
+ TestCase test = TestCase.valueOf(testName);
+ test.run(test.loggerName("foo.bar"));
+ }
+ }
+
+ /**
+ * Test without security manager.
+ * @param loggerName The logger to use.
+ * @throws Exception if the test fails.
+ */
+ public static void testUnsecure(String loggerName) throws Exception {
+ if (System.getSecurityManager() != null) {
+ throw new Error("Security manager is set");
+ }
+ test(loggerName);
+ }
+
+ /**
+ * Test with security manager.
+ * @param loggerName The logger to use.
+ * @throws Exception if the test fails.
+ */
+ public static void testSecure(String loggerName) throws Exception {
+ if (System.getSecurityManager() != null) {
+ throw new Error("Security manager is already set");
+ }
+ Policy.setPolicy(new SimplePolicy(TestCase.SECURE));
+ System.setSecurityManager(new SecurityManager());
+ test(loggerName);
+ }
+
+ /**
+ * Test the LoggingPermission("control") is required.
+ * @param loggerName The logger to use.
+ */
+ public static void testPermission(String loggerName) {
+ TestConfigurationListener run = new TestConfigurationListener(
+ TestCase.PERMISSION.toString());
+ if (System.getSecurityManager() != null) {
+ throw new Error("Security manager is already set");
+ }
+ Policy.setPolicy(new SimplePolicy(TestCase.PERMISSION));
+ System.setSecurityManager(new SecurityManager());
+
+ try {
+ LogManager.getLogManager().addConfigurationListener(run);
+ throw new RuntimeException("addConfigurationListener: Permission not checked!");
+ } catch (AccessControlException x) {
+ boolean ok = false;
+ if (x.getPermission() instanceof LoggingPermission) {
+ if ("control".equals(x.getPermission().getName())) {
+ System.out.println("addConfigurationListener: Got expected exception: " + x);
+ ok = true;
+ }
+ }
+ if (!ok) {
+ throw new RuntimeException("addConfigurationListener: Unexpected exception: "+x, x);
+ }
+ }
+
+ try {
+ LogManager.getLogManager().removeConfigurationListener(run);
+ throw new RuntimeException("removeConfigurationListener: Permission not checked!");
+ } catch (AccessControlException x) {
+ boolean ok = false;
+ if (x.getPermission() instanceof LoggingPermission) {
+ if ("control".equals(x.getPermission().getName())) {
+ System.out.println("removeConfigurationListener: Got expected exception: " + x);
+ ok = true;
+ }
+ }
+ if (!ok) {
+ throw new RuntimeException("removeConfigurationListener: Unexpected exception: "+x, x);
+ }
+ }
+ try {
+ LogManager.getLogManager().addConfigurationListener(null);
+ throw new RuntimeException(
+ "addConfigurationListener(null): Expected NPE not thrown.");
+ } catch (NullPointerException npe) {
+ System.out.println("Got expected NPE: "+npe);
+ }
+
+ try {
+ LogManager.getLogManager().removeConfigurationListener(null);
+ throw new RuntimeException(
+ "removeConfigurationListener(null): Expected NPE not thrown.");
+ } catch (NullPointerException npe) {
+ System.out.println("Got expected NPE: "+npe);
+ }
+
+
+ }
+
+
+ static class TestConfigurationListener implements Runnable {
+ final AtomicLong count = new AtomicLong(0);
+ final String name;
+ TestConfigurationListener(String name) {
+ this.name = name;
+ }
+ @Override
+ public void run() {
+ final long times = count.incrementAndGet();
+ System.out.println("Configured \"" + name + "\": " + times);
+ }
+ }
+
+ static class ConfigurationListenerException extends RuntimeException {
+ public ConfigurationListenerException(String msg) {
+ super(msg);
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getName() + ": " + getMessage();
+ }
+ }
+ static class ConfigurationListenerError extends Error {
+ public ConfigurationListenerError(String msg) {
+ super(msg);
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getName() + ": " + getMessage();
+ }
+ }
+
+ static class ThrowingConfigurationListener extends TestConfigurationListener {
+
+ final boolean error;
+ public ThrowingConfigurationListener(String name, boolean error) {
+ super(name);
+ this.error = error;
+ }
+
+ @Override
+ public void run() {
+ if (error)
+ throw new ConfigurationListenerError(name);
+ else
+ throw new ConfigurationListenerException(name);
+ }
+
+ @Override
+ public String toString() {
+ final Class<? extends Throwable> type =
+ error ? ConfigurationListenerError.class
+ : ConfigurationListenerException.class;
+ return type.getName()+ ": " + name;
+ }
+
+ }
+
+ private static void expect(TestConfigurationListener listener, long value) {
+ final long got = listener.count.longValue();
+ if (got != value) {
+ throw new RuntimeException(listener.name + " expected " + value +", got " + got);
+ }
+
+ }
+
+ public interface ThrowingConsumer<T, I extends Exception> {
+ public void accept(T t) throws I;
+ }
+
+ public static class ReadConfiguration implements ThrowingConsumer<LogManager, IOException> {
+
+ @Override
+ public void accept(LogManager t) throws IOException {
+ t.readConfiguration();
+ }
+
+ }
+
+ public static void test(String loggerName) throws Exception {
+ System.out.println("Starting test for " + loggerName);
+ test("m.readConfiguration()", (m) -> m.readConfiguration());
+ test("m.readConfiguration(new ByteArrayInputStream(new byte[0]))",
+ (m) -> m.readConfiguration(new ByteArrayInputStream(new byte[0])));
+ System.out.println("Test passed for " + loggerName);
+ }
+
+ public static void test(String testName,
+ ThrowingConsumer<LogManager, IOException> readConfiguration) throws Exception {
+
+
+ System.out.println("\nBEGIN " + testName);
+ LogManager m = LogManager.getLogManager();
+
+ final TestConfigurationListener l1 = new TestConfigurationListener("l#1");
+ final TestConfigurationListener l2 = new TestConfigurationListener("l#2");
+ final TestConfigurationListener l3 = new ThrowingConfigurationListener("l#3", false);
+ final TestConfigurationListener l4 = new ThrowingConfigurationListener("l#4", true);
+ final TestConfigurationListener l5 = new ThrowingConfigurationListener("l#5", false);
+
+ final Set<String> expectedExceptions =
+ Collections.unmodifiableSet(
+ new HashSet<>(Arrays.asList(
+ l3.toString(), l4.toString(), l5.toString())));
+
+ m.addConfigurationListener(l1);
+ m.addConfigurationListener(l2);
+ expect(l1, 0);
+ expect(l2, 0);
+
+ readConfiguration.accept(m);
+ expect(l1, 1);
+ expect(l2, 1);
+ m.addConfigurationListener(l1);
+ expect(l1, 1);
+ expect(l2, 1);
+ readConfiguration.accept(m);
+ expect(l1, 2);
+ expect(l2, 2);
+ m.removeConfigurationListener(l1);
+ expect(l1, 2);
+ expect(l2, 2);
+ readConfiguration.accept(m);
+ expect(l1, 2);
+ expect(l2, 3);
+ m.removeConfigurationListener(l1);
+ expect(l1, 2);
+ expect(l2, 3);
+ readConfiguration.accept(m);
+ expect(l1, 2);
+ expect(l2, 4);
+ m.removeConfigurationListener(l2);
+ expect(l1, 2);
+ expect(l2, 4);
+ readConfiguration.accept(m);
+ expect(l1, 2);
+ expect(l2, 4);
+
+ // l1 and l2 should no longer be present: this should not fail...
+ m.removeConfigurationListener(l1);
+ m.removeConfigurationListener(l1);
+ m.removeConfigurationListener(l2);
+ m.removeConfigurationListener(l2);
+ expect(l1, 2);
+ expect(l2, 4);
+
+ readConfiguration.accept(m);
+ expect(l1, 2);
+ expect(l2, 4);
+
+ // add back l1 and l2
+ m.addConfigurationListener(l1);
+ m.addConfigurationListener(l2);
+ expect(l1, 2);
+ expect(l2, 4);
+
+ readConfiguration.accept(m);
+ expect(l1, 3);
+ expect(l2, 5);
+
+ m.removeConfigurationListener(l1);
+ m.removeConfigurationListener(l2);
+ expect(l1, 3);
+ expect(l2, 5);
+
+ readConfiguration.accept(m);
+ expect(l1, 3);
+ expect(l2, 5);
+
+ // Check the behavior when listeners throw exceptions
+ // l3, l4, and l5 will throw an error/exception.
+ // The first that is raised will be propagated, after all listeners
+ // have been invoked. The other exceptions will be added to the
+ // suppressed list.
+ //
+ // We will check that all listeners have been invoked and that we
+ // have the set of 3 exceptions expected from l3, l4, l5.
+ //
+ m.addConfigurationListener(l4);
+ m.addConfigurationListener(l1);
+ m.addConfigurationListener(l2);
+ m.addConfigurationListener(l3);
+ m.addConfigurationListener(l5);
+
+ try {
+ readConfiguration.accept(m);
+ throw new RuntimeException("Excpected exception/error not raised");
+ } catch(ConfigurationListenerException | ConfigurationListenerError t) {
+ final Set<String> received = new HashSet<>();
+ received.add(t.toString());
+ for (Throwable s : t.getSuppressed()) {
+ received.add(s.toString());
+ }
+ System.out.println("Received exceptions: " + received);
+ if (!expectedExceptions.equals(received)) {
+ throw new RuntimeException(
+ "List of received exceptions differs from expected:"
+ + "\n\texpected: " + expectedExceptions
+ + "\n\treceived: " + received);
+ }
+ }
+ expect(l1, 4);
+ expect(l2, 6);
+
+ m.removeConfigurationListener(l1);
+ m.removeConfigurationListener(l2);
+ m.removeConfigurationListener(l3);
+ m.removeConfigurationListener(l4);
+ m.removeConfigurationListener(l5);
+ readConfiguration.accept(m);
+ expect(l1, 4);
+ expect(l2, 6);
+
+
+ try {
+ m.addConfigurationListener(null);
+ throw new RuntimeException(
+ "addConfigurationListener(null): Expected NPE not thrown.");
+ } catch (NullPointerException npe) {
+ System.out.println("Got expected NPE: "+npe);
+ }
+
+ try {
+ m.removeConfigurationListener(null);
+ throw new RuntimeException(
+ "removeConfigurationListener(null): Expected NPE not thrown.");
+ } catch (NullPointerException npe) {
+ System.out.println("Got expected NPE: "+npe);
+ }
+
+ System.out.println("END " + testName+"\n");
+
+ }
+
+
+ final static class PermissionsBuilder {
+ final Permissions perms;
+ public PermissionsBuilder() {
+ this(new Permissions());
+ }
+ public PermissionsBuilder(Permissions perms) {
+ this.perms = perms;
+ }
+ public PermissionsBuilder add(Permission p) {
+ perms.add(p);
+ return this;
+ }
+ public PermissionsBuilder addAll(PermissionCollection col) {
+ if (col != null) {
+ for (Enumeration<Permission> e = col.elements(); e.hasMoreElements(); ) {
+ perms.add(e.nextElement());
+ }
+ }
+ return this;
+ }
+ public Permissions toPermissions() {
+ final PermissionsBuilder builder = new PermissionsBuilder();
+ builder.addAll(perms);
+ return builder.perms;
+ }
+ }
+
+ public static class SimplePolicy extends Policy {
+
+ final Permissions permissions;
+ public SimplePolicy(TestCase test) {
+ permissions = new Permissions();
+ if (test != TestCase.PERMISSION) {
+ permissions.add(new LoggingPermission("control", null));
+ permissions.add(new PropertyPermission("java.util.logging.config.class", "read"));
+ permissions.add(new PropertyPermission("java.util.logging.config.file", "read"));
+ permissions.add(new PropertyPermission("java.home", "read"));
+ permissions.add(new FilePermission("<<ALL FILES>>", "read"));
+ }
+ }
+
+ @Override
+ public boolean implies(ProtectionDomain domain, Permission permission) {
+ return permissions.implies(permission);
+ }
+
+ @Override
+ public PermissionCollection getPermissions(CodeSource codesource) {
+ return new PermissionsBuilder().addAll(permissions).toPermissions();
+ }
+
+ @Override
+ public PermissionCollection getPermissions(ProtectionDomain domain) {
+ return new PermissionsBuilder().addAll(permissions).toPermissions();
+ }
+ }
+
+}
--- a/jdk/test/sun/security/tools/keytool/autotest.sh Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/test/sun/security/tools/keytool/autotest.sh Tue Oct 07 15:44:11 2014 -0700
@@ -84,6 +84,11 @@
"/usr/lib/nss/libsoftokn3.so"`
fi
;;
+ Darwin )
+ LIBNAME=`find_one \
+ "/Applications/Firefox.app/Contents/MacOS/libsoftokn3.dylib" \
+ "/Applications/Thunderbird.app//Contents/MacOS/libsoftokn3.dylib"`
+ ;;
* )
echo "Will not run test on: ${OS}"
exit 0;
@@ -95,6 +100,12 @@
exit 0
fi
+echo "Using NSS lib at $LIBNAME"
+
+if [ $OS = Darwin ]; then
+ export DYLD_LIBRARY_PATH=`dirname $LIBNAME`
+fi
+
${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . -XDignore.symbol.file \
${TESTSRC}${FS}KeyToolTest.java || exit 10
--- a/jdk/test/sun/text/resources/LocaleData Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/test/sun/text/resources/LocaleData Tue Oct 07 15:44:11 2014 -0700
@@ -2502,7 +2502,7 @@
CalendarData/pl_PL/minimalDaysInFirstWeek=4
CalendarData/pt_PT/minimalDaysInFirstWeek=4
-#bug 4945388
+#bug 4945388
CurrencyNames/be_BY/BYR=\u0420\u0443\u0431
CurrencyNames/bg_BG/BGN=\u043B\u0432.
@@ -5419,7 +5419,7 @@
FormatData/en_SG/DatePatterns/2=MMM d, yyyy
FormatData/en_SG/DatePatterns/3=M/d/yy
FormatData/en_SG/DateTimePatterns/0={1} {0}
-# Use approved data
+# Use approved data
FormatData/ms/Eras/0=BCE
FormatData/ms/Eras/1=CE
FormatData/sr_BA/MonthNames/5=\u0458\u0443\u043d\u0438
@@ -5568,7 +5568,7 @@
FormatData/fi/AmPmMarkers/0=ap.
FormatData/fi/AmPmMarkers/1=ip.
-# bug 6507067
+# bug 6507067
TimeZoneNames/zh_TW/Asia\/Taipei/1=\u53f0\u7063\u6a19\u6e96\u6642\u9593
TimeZoneNames/zh_TW/Asia\/Taipei/2=TST
@@ -7699,3 +7699,577 @@
# bug 8055222
CurrencyNames/lt_LT/EUR=\u20AC
+
+# bug 8042126 + missing MonthNarrows data
+FormatData//MonthNarrows/0=1
+FormatData//MonthNarrows/1=2
+FormatData//MonthNarrows/2=3
+FormatData//MonthNarrows/3=4
+FormatData//MonthNarrows/4=5
+FormatData//MonthNarrows/5=6
+FormatData//MonthNarrows/6=7
+FormatData//MonthNarrows/7=8
+FormatData//MonthNarrows/8=9
+FormatData//MonthNarrows/9=10
+FormatData//MonthNarrows/10=11
+FormatData//MonthNarrows/11=12
+FormatData//MonthNarrows/12=
+FormatData/bg/MonthNarrows/0=\u044f
+FormatData/bg/MonthNarrows/1=\u0444
+FormatData/bg/MonthNarrows/2=\u043c
+FormatData/bg/MonthNarrows/3=\u0430
+FormatData/bg/MonthNarrows/4=\u043c
+FormatData/bg/MonthNarrows/5=\u044e
+FormatData/bg/MonthNarrows/6=\u044e
+FormatData/bg/MonthNarrows/7=\u0430
+FormatData/bg/MonthNarrows/8=\u0441
+FormatData/bg/MonthNarrows/9=\u043e
+FormatData/bg/MonthNarrows/10=\u043d
+FormatData/bg/MonthNarrows/11=\u0434
+FormatData/bg/MonthNarrows/12=
+FormatData/zh_TW/MonthNarrows/0=1
+FormatData/zh_TW/MonthNarrows/1=2
+FormatData/zh_TW/MonthNarrows/2=3
+FormatData/zh_TW/MonthNarrows/3=4
+FormatData/zh_TW/MonthNarrows/4=5
+FormatData/zh_TW/MonthNarrows/5=6
+FormatData/zh_TW/MonthNarrows/6=7
+FormatData/zh_TW/MonthNarrows/7=8
+FormatData/zh_TW/MonthNarrows/8=9
+FormatData/zh_TW/MonthNarrows/9=10
+FormatData/zh_TW/MonthNarrows/10=11
+FormatData/zh_TW/MonthNarrows/11=12
+FormatData/zh_TW/MonthNarrows/12=
+FormatData/it/MonthNarrows/0=G
+FormatData/it/MonthNarrows/1=F
+FormatData/it/MonthNarrows/2=M
+FormatData/it/MonthNarrows/3=A
+FormatData/it/MonthNarrows/4=M
+FormatData/it/MonthNarrows/5=G
+FormatData/it/MonthNarrows/6=L
+FormatData/it/MonthNarrows/7=A
+FormatData/it/MonthNarrows/8=S
+FormatData/it/MonthNarrows/9=O
+FormatData/it/MonthNarrows/10=N
+FormatData/it/MonthNarrows/11=D
+FormatData/it/MonthNarrows/12=
+FormatData/ko/MonthNarrows/0=1\uc6d4
+FormatData/ko/MonthNarrows/1=2\uc6d4
+FormatData/ko/MonthNarrows/2=3\uc6d4
+FormatData/ko/MonthNarrows/3=4\uc6d4
+FormatData/ko/MonthNarrows/4=5\uc6d4
+FormatData/ko/MonthNarrows/5=6\uc6d4
+FormatData/ko/MonthNarrows/6=7\uc6d4
+FormatData/ko/MonthNarrows/7=8\uc6d4
+FormatData/ko/MonthNarrows/8=9\uc6d4
+FormatData/ko/MonthNarrows/9=10\uc6d4
+FormatData/ko/MonthNarrows/10=11\uc6d4
+FormatData/ko/MonthNarrows/11=12\uc6d4
+FormatData/ko/MonthNarrows/12=
+FormatData/uk/MonthNarrows/0=\u0421
+FormatData/uk/MonthNarrows/1=\u041b
+FormatData/uk/MonthNarrows/2=\u0411
+FormatData/uk/MonthNarrows/3=\u041a
+FormatData/uk/MonthNarrows/4=\u0422
+FormatData/uk/MonthNarrows/5=\u0427
+FormatData/uk/MonthNarrows/6=\u041b
+FormatData/uk/MonthNarrows/7=\u0421
+FormatData/uk/MonthNarrows/8=\u0412
+FormatData/uk/MonthNarrows/9=\u0416
+FormatData/uk/MonthNarrows/10=\u041b
+FormatData/uk/MonthNarrows/11=\u0413
+FormatData/uk/MonthNarrows/12=
+FormatData/lv/MonthNarrows/0=J
+FormatData/lv/MonthNarrows/1=F
+FormatData/lv/MonthNarrows/2=M
+FormatData/lv/MonthNarrows/3=A
+FormatData/lv/MonthNarrows/4=M
+FormatData/lv/MonthNarrows/5=J
+FormatData/lv/MonthNarrows/6=J
+FormatData/lv/MonthNarrows/7=A
+FormatData/lv/MonthNarrows/8=S
+FormatData/lv/MonthNarrows/9=O
+FormatData/lv/MonthNarrows/10=N
+FormatData/lv/MonthNarrows/11=D
+FormatData/lv/MonthNarrows/12=
+FormatData/pt/MonthNarrows/0=J
+FormatData/pt/MonthNarrows/1=F
+FormatData/pt/MonthNarrows/2=M
+FormatData/pt/MonthNarrows/3=A
+FormatData/pt/MonthNarrows/4=M
+FormatData/pt/MonthNarrows/5=J
+FormatData/pt/MonthNarrows/6=J
+FormatData/pt/MonthNarrows/7=A
+FormatData/pt/MonthNarrows/8=S
+FormatData/pt/MonthNarrows/9=O
+FormatData/pt/MonthNarrows/10=N
+FormatData/pt/MonthNarrows/11=D
+FormatData/pt/MonthNarrows/12=
+FormatData/sk/MonthNarrows/0=j
+FormatData/sk/MonthNarrows/1=f
+FormatData/sk/MonthNarrows/2=m
+FormatData/sk/MonthNarrows/3=a
+FormatData/sk/MonthNarrows/4=m
+FormatData/sk/MonthNarrows/5=j
+FormatData/sk/MonthNarrows/6=j
+FormatData/sk/MonthNarrows/7=a
+FormatData/sk/MonthNarrows/8=s
+FormatData/sk/MonthNarrows/9=o
+FormatData/sk/MonthNarrows/10=n
+FormatData/sk/MonthNarrows/11=d
+FormatData/sk/MonthNarrows/12=
+FormatData/hi_IN/MonthNarrows/0=\u091c
+FormatData/hi_IN/MonthNarrows/1=\u092b\u093c
+FormatData/hi_IN/MonthNarrows/2=\u092e\u093e
+FormatData/hi_IN/MonthNarrows/3=\u0905
+FormatData/hi_IN/MonthNarrows/4=\u092e
+FormatData/hi_IN/MonthNarrows/5=\u091c\u0942
+FormatData/hi_IN/MonthNarrows/6=\u091c\u0941
+FormatData/hi_IN/MonthNarrows/7=\u0905
+FormatData/hi_IN/MonthNarrows/8=\u0938\u093f
+FormatData/hi_IN/MonthNarrows/9=\u0905
+FormatData/hi_IN/MonthNarrows/10=\u0928
+FormatData/hi_IN/MonthNarrows/11=\u0926\u093f
+FormatData/hi_IN/MonthNarrows/12=
+FormatData/ga/MonthNarrows/0=E
+FormatData/ga/MonthNarrows/1=F
+FormatData/ga/MonthNarrows/2=M
+FormatData/ga/MonthNarrows/3=A
+FormatData/ga/MonthNarrows/4=B
+FormatData/ga/MonthNarrows/5=M
+FormatData/ga/MonthNarrows/6=I
+FormatData/ga/MonthNarrows/7=L
+FormatData/ga/MonthNarrows/8=M
+FormatData/ga/MonthNarrows/9=D
+FormatData/ga/MonthNarrows/10=S
+FormatData/ga/MonthNarrows/11=N
+FormatData/ga/MonthNarrows/12=
+FormatData/et/MonthNarrows/0=J
+FormatData/et/MonthNarrows/1=V
+FormatData/et/MonthNarrows/2=M
+FormatData/et/MonthNarrows/3=A
+FormatData/et/MonthNarrows/4=M
+FormatData/et/MonthNarrows/5=J
+FormatData/et/MonthNarrows/6=J
+FormatData/et/MonthNarrows/7=A
+FormatData/et/MonthNarrows/8=S
+FormatData/et/MonthNarrows/9=O
+FormatData/et/MonthNarrows/10=N
+FormatData/et/MonthNarrows/11=D
+FormatData/et/MonthNarrows/12=
+FormatData/sv/MonthNarrows/0=J
+FormatData/sv/MonthNarrows/1=F
+FormatData/sv/MonthNarrows/2=M
+FormatData/sv/MonthNarrows/3=A
+FormatData/sv/MonthNarrows/4=M
+FormatData/sv/MonthNarrows/5=J
+FormatData/sv/MonthNarrows/6=J
+FormatData/sv/MonthNarrows/7=A
+FormatData/sv/MonthNarrows/8=S
+FormatData/sv/MonthNarrows/9=O
+FormatData/sv/MonthNarrows/10=N
+FormatData/sv/MonthNarrows/11=D
+FormatData/sv/MonthNarrows/12=
+FormatData/cs/MonthNarrows/0=l
+FormatData/cs/MonthNarrows/1=\u00fa
+FormatData/cs/MonthNarrows/2=b
+FormatData/cs/MonthNarrows/3=d
+FormatData/cs/MonthNarrows/4=k
+FormatData/cs/MonthNarrows/5=\u010d
+FormatData/cs/MonthNarrows/6=\u010d
+FormatData/cs/MonthNarrows/7=s
+FormatData/cs/MonthNarrows/8=z
+FormatData/cs/MonthNarrows/9=\u0159
+FormatData/cs/MonthNarrows/10=l
+FormatData/cs/MonthNarrows/11=p
+FormatData/cs/MonthNarrows/12=
+FormatData/el/MonthNarrows/0=\u0399
+FormatData/el/MonthNarrows/1=\u03a6
+FormatData/el/MonthNarrows/2=\u039c
+FormatData/el/MonthNarrows/3=\u0391
+FormatData/el/MonthNarrows/4=\u039c
+FormatData/el/MonthNarrows/5=\u0399
+FormatData/el/MonthNarrows/6=\u0399
+FormatData/el/MonthNarrows/7=\u0391
+FormatData/el/MonthNarrows/8=\u03a3
+FormatData/el/MonthNarrows/9=\u039f
+FormatData/el/MonthNarrows/10=\u039d
+FormatData/el/MonthNarrows/11=\u0394
+FormatData/el/MonthNarrows/12=
+FormatData/hu/MonthNarrows/0=J
+FormatData/hu/MonthNarrows/1=F
+FormatData/hu/MonthNarrows/2=M
+FormatData/hu/MonthNarrows/3=\u00c1
+FormatData/hu/MonthNarrows/4=M
+FormatData/hu/MonthNarrows/5=J
+FormatData/hu/MonthNarrows/6=J
+FormatData/hu/MonthNarrows/7=A
+FormatData/hu/MonthNarrows/8=Sz
+FormatData/hu/MonthNarrows/9=O
+FormatData/hu/MonthNarrows/10=N
+FormatData/hu/MonthNarrows/11=D
+FormatData/hu/MonthNarrows/12=
+FormatData/es/MonthNarrows/0=E
+FormatData/es/MonthNarrows/1=F
+FormatData/es/MonthNarrows/2=M
+FormatData/es/MonthNarrows/3=A
+FormatData/es/MonthNarrows/4=M
+FormatData/es/MonthNarrows/5=J
+FormatData/es/MonthNarrows/6=J
+FormatData/es/MonthNarrows/7=A
+FormatData/es/MonthNarrows/8=S
+FormatData/es/MonthNarrows/9=O
+FormatData/es/MonthNarrows/10=N
+FormatData/es/MonthNarrows/11=D
+FormatData/es/MonthNarrows/12=
+FormatData/tr/MonthNarrows/0=O
+FormatData/tr/MonthNarrows/1=\u015e
+FormatData/tr/MonthNarrows/2=M
+FormatData/tr/MonthNarrows/3=N
+FormatData/tr/MonthNarrows/4=M
+FormatData/tr/MonthNarrows/5=H
+FormatData/tr/MonthNarrows/6=T
+FormatData/tr/MonthNarrows/7=A
+FormatData/tr/MonthNarrows/8=E
+FormatData/tr/MonthNarrows/9=E
+FormatData/tr/MonthNarrows/10=K
+FormatData/tr/MonthNarrows/11=A
+FormatData/tr/MonthNarrows/12=
+FormatData/hr/MonthNarrows/0=1.
+FormatData/hr/MonthNarrows/1=2.
+FormatData/hr/MonthNarrows/2=3.
+FormatData/hr/MonthNarrows/3=4.
+FormatData/hr/MonthNarrows/4=5.
+FormatData/hr/MonthNarrows/5=6.
+FormatData/hr/MonthNarrows/6=7.
+FormatData/hr/MonthNarrows/7=8.
+FormatData/hr/MonthNarrows/8=9.
+FormatData/hr/MonthNarrows/9=10.
+FormatData/hr/MonthNarrows/10=11.
+FormatData/hr/MonthNarrows/11=12.
+FormatData/hr/MonthNarrows/12=
+FormatData/lt/MonthNarrows/0=S
+FormatData/lt/MonthNarrows/1=V
+FormatData/lt/MonthNarrows/2=K
+FormatData/lt/MonthNarrows/3=B
+FormatData/lt/MonthNarrows/4=G
+FormatData/lt/MonthNarrows/5=B
+FormatData/lt/MonthNarrows/6=L
+FormatData/lt/MonthNarrows/7=R
+FormatData/lt/MonthNarrows/8=R
+FormatData/lt/MonthNarrows/9=S
+FormatData/lt/MonthNarrows/10=L
+FormatData/lt/MonthNarrows/11=G
+FormatData/lt/MonthNarrows/12=
+FormatData/sq/MonthNarrows/0=J
+FormatData/sq/MonthNarrows/1=S
+FormatData/sq/MonthNarrows/2=M
+FormatData/sq/MonthNarrows/3=P
+FormatData/sq/MonthNarrows/4=M
+FormatData/sq/MonthNarrows/5=Q
+FormatData/sq/MonthNarrows/6=K
+FormatData/sq/MonthNarrows/7=G
+FormatData/sq/MonthNarrows/8=S
+FormatData/sq/MonthNarrows/9=T
+FormatData/sq/MonthNarrows/10=N
+FormatData/sq/MonthNarrows/11=D
+FormatData/sq/MonthNarrows/12=
+FormatData/fr/MonthNarrows/0=J
+FormatData/fr/MonthNarrows/1=F
+FormatData/fr/MonthNarrows/2=M
+FormatData/fr/MonthNarrows/3=A
+FormatData/fr/MonthNarrows/4=M
+FormatData/fr/MonthNarrows/5=J
+FormatData/fr/MonthNarrows/6=J
+FormatData/fr/MonthNarrows/7=A
+FormatData/fr/MonthNarrows/8=S
+FormatData/fr/MonthNarrows/9=O
+FormatData/fr/MonthNarrows/10=N
+FormatData/fr/MonthNarrows/11=D
+FormatData/fr/MonthNarrows/12=
+FormatData/is/MonthNarrows/0=J
+FormatData/is/MonthNarrows/1=F
+FormatData/is/MonthNarrows/2=M
+FormatData/is/MonthNarrows/3=A
+FormatData/is/MonthNarrows/4=M
+FormatData/is/MonthNarrows/5=J
+FormatData/is/MonthNarrows/6=J
+FormatData/is/MonthNarrows/7=\u00c1
+FormatData/is/MonthNarrows/8=L
+FormatData/is/MonthNarrows/9=O
+FormatData/is/MonthNarrows/10=N
+FormatData/is/MonthNarrows/11=D
+FormatData/is/MonthNarrows/12=
+FormatData/de/MonthNarrows/0=J
+FormatData/de/MonthNarrows/1=F
+FormatData/de/MonthNarrows/2=M
+FormatData/de/MonthNarrows/3=A
+FormatData/de/MonthNarrows/4=M
+FormatData/de/MonthNarrows/5=J
+FormatData/de/MonthNarrows/6=J
+FormatData/de/MonthNarrows/7=A
+FormatData/de/MonthNarrows/8=S
+FormatData/de/MonthNarrows/9=O
+FormatData/de/MonthNarrows/10=N
+FormatData/de/MonthNarrows/11=D
+FormatData/de/MonthNarrows/12=
+FormatData/en/MonthNarrows/0=J
+FormatData/en/MonthNarrows/1=F
+FormatData/en/MonthNarrows/2=M
+FormatData/en/MonthNarrows/3=A
+FormatData/en/MonthNarrows/4=M
+FormatData/en/MonthNarrows/5=J
+FormatData/en/MonthNarrows/6=J
+FormatData/en/MonthNarrows/7=A
+FormatData/en/MonthNarrows/8=S
+FormatData/en/MonthNarrows/9=O
+FormatData/en/MonthNarrows/10=N
+FormatData/en/MonthNarrows/11=D
+FormatData/en/MonthNarrows/12=
+FormatData/ca/MonthNarrows/0=G
+FormatData/ca/MonthNarrows/1=F
+FormatData/ca/MonthNarrows/2=M
+FormatData/ca/MonthNarrows/3=A
+FormatData/ca/MonthNarrows/4=M
+FormatData/ca/MonthNarrows/5=J
+FormatData/ca/MonthNarrows/6=G
+FormatData/ca/MonthNarrows/7=A
+FormatData/ca/MonthNarrows/8=S
+FormatData/ca/MonthNarrows/9=O
+FormatData/ca/MonthNarrows/10=N
+FormatData/ca/MonthNarrows/11=D
+FormatData/ca/MonthNarrows/12=
+FormatData/sl/MonthNarrows/0=j
+FormatData/sl/MonthNarrows/1=f
+FormatData/sl/MonthNarrows/2=m
+FormatData/sl/MonthNarrows/3=a
+FormatData/sl/MonthNarrows/4=m
+FormatData/sl/MonthNarrows/5=j
+FormatData/sl/MonthNarrows/6=j
+FormatData/sl/MonthNarrows/7=a
+FormatData/sl/MonthNarrows/8=s
+FormatData/sl/MonthNarrows/9=o
+FormatData/sl/MonthNarrows/10=n
+FormatData/sl/MonthNarrows/11=d
+FormatData/sl/MonthNarrows/12=
+FormatData/fi/MonthNarrows/0=T
+FormatData/fi/MonthNarrows/1=H
+FormatData/fi/MonthNarrows/2=M
+FormatData/fi/MonthNarrows/3=H
+FormatData/fi/MonthNarrows/4=T
+FormatData/fi/MonthNarrows/5=K
+FormatData/fi/MonthNarrows/6=H
+FormatData/fi/MonthNarrows/7=E
+FormatData/fi/MonthNarrows/8=S
+FormatData/fi/MonthNarrows/9=L
+FormatData/fi/MonthNarrows/10=M
+FormatData/fi/MonthNarrows/11=J
+FormatData/fi/MonthNarrows/12=
+FormatData/mk/MonthNarrows/0=\u0458
+FormatData/mk/MonthNarrows/1=\u0444
+FormatData/mk/MonthNarrows/2=\u043c
+FormatData/mk/MonthNarrows/3=\u0430
+FormatData/mk/MonthNarrows/4=\u043c
+FormatData/mk/MonthNarrows/5=\u0458
+FormatData/mk/MonthNarrows/6=\u0458
+FormatData/mk/MonthNarrows/7=\u0430
+FormatData/mk/MonthNarrows/8=\u0441
+FormatData/mk/MonthNarrows/9=\u043e
+FormatData/mk/MonthNarrows/10=\u043d
+FormatData/mk/MonthNarrows/11=\u0434
+FormatData/mk/MonthNarrows/12=
+FormatData/sr-Latn/MonthNarrows/0=j
+FormatData/sr-Latn/MonthNarrows/1=f
+FormatData/sr-Latn/MonthNarrows/2=m
+FormatData/sr-Latn/MonthNarrows/3=a
+FormatData/sr-Latn/MonthNarrows/4=m
+FormatData/sr-Latn/MonthNarrows/5=j
+FormatData/sr-Latn/MonthNarrows/6=j
+FormatData/sr-Latn/MonthNarrows/7=a
+FormatData/sr-Latn/MonthNarrows/8=s
+FormatData/sr-Latn/MonthNarrows/9=o
+FormatData/sr-Latn/MonthNarrows/10=n
+FormatData/sr-Latn/MonthNarrows/11=d
+FormatData/sr-Latn/MonthNarrows/12=
+FormatData/th/MonthNarrows/0=\u0e21.\u0e04.
+FormatData/th/MonthNarrows/1=\u0e01.\u0e1e.
+FormatData/th/MonthNarrows/2=\u0e21\u0e35.\u0e04.
+FormatData/th/MonthNarrows/3=\u0e40\u0e21.\u0e22.
+FormatData/th/MonthNarrows/4=\u0e1e.\u0e04.
+FormatData/th/MonthNarrows/5=\u0e21\u0e34.\u0e22
+FormatData/th/MonthNarrows/6=\u0e01.\u0e04.
+FormatData/th/MonthNarrows/7=\u0e2a.\u0e04.
+FormatData/th/MonthNarrows/8=\u0e01.\u0e22.
+FormatData/th/MonthNarrows/9=\u0e15.\u0e04.
+FormatData/th/MonthNarrows/10=\u0e1e.\u0e22.
+FormatData/th/MonthNarrows/11=\u0e18.\u0e04.
+FormatData/th/MonthNarrows/12=
+FormatData/ar/MonthNarrows/0=\u064a
+FormatData/ar/MonthNarrows/1=\u0641
+FormatData/ar/MonthNarrows/2=\u0645
+FormatData/ar/MonthNarrows/3=\u0623
+FormatData/ar/MonthNarrows/4=\u0648
+FormatData/ar/MonthNarrows/5=\u0646
+FormatData/ar/MonthNarrows/6=\u0644
+FormatData/ar/MonthNarrows/7=\u063a
+FormatData/ar/MonthNarrows/8=\u0633
+FormatData/ar/MonthNarrows/9=\u0643
+FormatData/ar/MonthNarrows/10=\u0628
+FormatData/ar/MonthNarrows/11=\u062f
+FormatData/ar/MonthNarrows/12=
+FormatData/ru/MonthNarrows/0=\u042f
+FormatData/ru/MonthNarrows/1=\u0424
+FormatData/ru/MonthNarrows/2=\u041c
+FormatData/ru/MonthNarrows/3=\u0410
+FormatData/ru/MonthNarrows/4=\u041c
+FormatData/ru/MonthNarrows/5=\u0418
+FormatData/ru/MonthNarrows/6=\u0418
+FormatData/ru/MonthNarrows/7=\u0410
+FormatData/ru/MonthNarrows/8=\u0421
+FormatData/ru/MonthNarrows/9=\u041e
+FormatData/ru/MonthNarrows/10=\u041d
+FormatData/ru/MonthNarrows/11=\u0414
+FormatData/ru/MonthNarrows/12=
+FormatData/ms/MonthNarrows/0=J
+FormatData/ms/MonthNarrows/1=F
+FormatData/ms/MonthNarrows/2=M
+FormatData/ms/MonthNarrows/3=A
+FormatData/ms/MonthNarrows/4=M
+FormatData/ms/MonthNarrows/5=J
+FormatData/ms/MonthNarrows/6=J
+FormatData/ms/MonthNarrows/7=O
+FormatData/ms/MonthNarrows/8=S
+FormatData/ms/MonthNarrows/9=O
+FormatData/ms/MonthNarrows/10=N
+FormatData/ms/MonthNarrows/11=D
+FormatData/ms/MonthNarrows/12=
+FormatData/nl/MonthNarrows/0=J
+FormatData/nl/MonthNarrows/1=F
+FormatData/nl/MonthNarrows/2=M
+FormatData/nl/MonthNarrows/3=A
+FormatData/nl/MonthNarrows/4=M
+FormatData/nl/MonthNarrows/5=J
+FormatData/nl/MonthNarrows/6=J
+FormatData/nl/MonthNarrows/7=A
+FormatData/nl/MonthNarrows/8=S
+FormatData/nl/MonthNarrows/9=O
+FormatData/nl/MonthNarrows/10=N
+FormatData/nl/MonthNarrows/11=D
+FormatData/nl/MonthNarrows/12=
+FormatData/vi/MonthNarrows/0=1
+FormatData/vi/MonthNarrows/1=2
+FormatData/vi/MonthNarrows/2=3
+FormatData/vi/MonthNarrows/3=4
+FormatData/vi/MonthNarrows/4=5
+FormatData/vi/MonthNarrows/5=6
+FormatData/vi/MonthNarrows/6=7
+FormatData/vi/MonthNarrows/7=8
+FormatData/vi/MonthNarrows/8=9
+FormatData/vi/MonthNarrows/9=10
+FormatData/vi/MonthNarrows/10=11
+FormatData/vi/MonthNarrows/11=12
+FormatData/vi/MonthNarrows/12=
+FormatData/sr/MonthNarrows/0=\u0458
+FormatData/sr/MonthNarrows/1=\u0444
+FormatData/sr/MonthNarrows/2=\u043c
+FormatData/sr/MonthNarrows/3=\u0430
+FormatData/sr/MonthNarrows/4=\u043c
+FormatData/sr/MonthNarrows/5=\u0458
+FormatData/sr/MonthNarrows/6=\u0458
+FormatData/sr/MonthNarrows/7=\u0430
+FormatData/sr/MonthNarrows/8=\u0441
+FormatData/sr/MonthNarrows/9=\u043e
+FormatData/sr/MonthNarrows/10=\u043d
+FormatData/sr/MonthNarrows/11=\u0434
+FormatData/sr/MonthNarrows/12=
+FormatData/mt/MonthNarrows/0=J
+FormatData/mt/MonthNarrows/1=F
+FormatData/mt/MonthNarrows/2=M
+FormatData/mt/MonthNarrows/3=A
+FormatData/mt/MonthNarrows/4=M
+FormatData/mt/MonthNarrows/5=\u0120
+FormatData/mt/MonthNarrows/6=L
+FormatData/mt/MonthNarrows/7=A
+FormatData/mt/MonthNarrows/8=S
+FormatData/mt/MonthNarrows/9=O
+FormatData/mt/MonthNarrows/10=N
+FormatData/mt/MonthNarrows/11=D
+FormatData/mt/MonthNarrows/12=
+FormatData/da/MonthNarrows/0=J
+FormatData/da/MonthNarrows/1=F
+FormatData/da/MonthNarrows/2=M
+FormatData/da/MonthNarrows/3=A
+FormatData/da/MonthNarrows/4=M
+FormatData/da/MonthNarrows/5=J
+FormatData/da/MonthNarrows/6=J
+FormatData/da/MonthNarrows/7=A
+FormatData/da/MonthNarrows/8=S
+FormatData/da/MonthNarrows/9=O
+FormatData/da/MonthNarrows/10=N
+FormatData/da/MonthNarrows/11=D
+FormatData/da/MonthNarrows/12=
+FormatData/ro/MonthNarrows/0=I
+FormatData/ro/MonthNarrows/1=F
+FormatData/ro/MonthNarrows/2=M
+FormatData/ro/MonthNarrows/3=A
+FormatData/ro/MonthNarrows/4=M
+FormatData/ro/MonthNarrows/5=I
+FormatData/ro/MonthNarrows/6=I
+FormatData/ro/MonthNarrows/7=A
+FormatData/ro/MonthNarrows/8=S
+FormatData/ro/MonthNarrows/9=O
+FormatData/ro/MonthNarrows/10=N
+FormatData/ro/MonthNarrows/11=D
+FormatData/ro/MonthNarrows/12=
+FormatData/no/MonthNarrows/0=J
+FormatData/no/MonthNarrows/1=F
+FormatData/no/MonthNarrows/2=M
+FormatData/no/MonthNarrows/3=A
+FormatData/no/MonthNarrows/4=M
+FormatData/no/MonthNarrows/5=J
+FormatData/no/MonthNarrows/6=J
+FormatData/no/MonthNarrows/7=A
+FormatData/no/MonthNarrows/8=S
+FormatData/no/MonthNarrows/9=O
+FormatData/no/MonthNarrows/10=N
+FormatData/no/MonthNarrows/11=D
+FormatData/no/MonthNarrows/12=
+FormatData/pl/MonthNarrows/0=s
+FormatData/pl/MonthNarrows/1=l
+FormatData/pl/MonthNarrows/2=m
+FormatData/pl/MonthNarrows/3=k
+FormatData/pl/MonthNarrows/4=m
+FormatData/pl/MonthNarrows/5=c
+FormatData/pl/MonthNarrows/6=l
+FormatData/pl/MonthNarrows/7=s
+FormatData/pl/MonthNarrows/8=w
+FormatData/pl/MonthNarrows/9=p
+FormatData/pl/MonthNarrows/10=l
+FormatData/pl/MonthNarrows/11=g
+FormatData/pl/MonthNarrows/12=
+FormatData/iw/MonthNarrows/0=1
+FormatData/iw/MonthNarrows/1=2
+FormatData/iw/MonthNarrows/2=3
+FormatData/iw/MonthNarrows/3=4
+FormatData/iw/MonthNarrows/4=5
+FormatData/iw/MonthNarrows/5=6
+FormatData/iw/MonthNarrows/6=7
+FormatData/iw/MonthNarrows/7=8
+FormatData/iw/MonthNarrows/8=9
+FormatData/iw/MonthNarrows/9=10
+FormatData/iw/MonthNarrows/10=11
+FormatData/iw/MonthNarrows/11=12
+FormatData/iw/MonthNarrows/12=
+FormatData/zh/MonthNarrows/0=1
+FormatData/zh/MonthNarrows/1=2
+FormatData/zh/MonthNarrows/2=3
+FormatData/zh/MonthNarrows/3=4
+FormatData/zh/MonthNarrows/4=5
+FormatData/zh/MonthNarrows/5=6
+FormatData/zh/MonthNarrows/6=7
+FormatData/zh/MonthNarrows/7=8
+FormatData/zh/MonthNarrows/8=9
+FormatData/zh/MonthNarrows/9=10
+FormatData/zh/MonthNarrows/10=11
+FormatData/zh/MonthNarrows/11=12
+FormatData/zh/MonthNarrows/12=
--- a/jdk/test/sun/text/resources/LocaleDataTest.java Fri Oct 03 13:00:21 2014 +0200
+++ b/jdk/test/sun/text/resources/LocaleDataTest.java Tue Oct 07 15:44:11 2014 -0700
@@ -36,7 +36,7 @@
* 6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 7101495
* 7003124 7085757 7028073 7171028 7189611 8000983 7195759 8004489 8006509
* 7114053 7074882 7040556 8013836 8021121 6192407 6931564 8027695 8017142
- * 8037343 8055222
+ * 8037343 8055222 8042126
* @summary Verify locale data
*
*/
--- a/langtools/.hgtags Fri Oct 03 13:00:21 2014 +0200
+++ b/langtools/.hgtags Tue Oct 07 15:44:11 2014 -0700
@@ -275,3 +275,4 @@
ef5427c13e1e741c457a2ed868e3b6d6bf717754 jdk9-b30
0046d55383a9d873ffbc7253d7c5e28ab98c5bea jdk9-b31
ad99965443d19a59e810ae67b0b742bb9722f5ed jdk9-b32
+e891e0c4edc5174a4da6d19dc2d59697b79f1916 jdk9-b33
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java Fri Oct 03 13:00:21 2014 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java Tue Oct 07 15:44:11 2014 -0700
@@ -333,7 +333,7 @@
HtmlTree ul = new HtmlTree(HtmlTag.UL);
ul.addStyle(HtmlStyle.blockList);
for (PackageDoc pkg : pkgSet) {
- Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name()));
+ Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(getPackageAnchorName(pkg)));
Content link = getResource("doclet.ClassUse_Uses.of.0.in.1",
getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER,
classdoc)),
@@ -355,7 +355,7 @@
*/
protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException {
Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
- getHyperLink(pkg.name(), new StringContent(utils.getPackageName(pkg))));
+ getHyperLink(getPackageAnchorName(pkg), new StringContent(utils.getPackageName(pkg))));
contentTree.addContent(tdFirst);
HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
tdLast.addStyle(HtmlStyle.colLast);
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Fri Oct 03 13:00:21 2014 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Tue Oct 07 15:44:11 2014 -0700
@@ -992,6 +992,16 @@
}
/**
+ * Given a package, return the name to be used in HTML anchor tag.
+ * @param packageDoc the package.
+ * @return the name to be used in HTML anchor tag.
+ */
+ public String getPackageAnchorName(PackageDoc packageDoc) {
+ return packageDoc == null || packageDoc.name().length() == 0 ?
+ SectionName.UNNAMED_PACKAGE_ANCHOR.getName() : packageDoc.name();
+ }
+
+ /**
* Return the link to the given package.
*
* @param pkg the package to link to.
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java Fri Oct 03 13:00:21 2014 +0200
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java Tue Oct 07 15:44:11 2014 -0700
@@ -207,7 +207,7 @@
} else {
tr.addStyle(HtmlStyle.rowColor);
}
- addClassRow(itc.next(), packageName, tr);
+ addClassRow(itc.next(), usingPackage, tr);
tbody.addContent(tr);
}
table.addContent(tbody);
@@ -220,15 +220,15 @@
* Add a row for the class that uses the given package.
*
* @param usedClass the class that uses the given package
- * @param packageName the name of the package to which the class belongs
+ * @param pkg the package to which the class belongs
* @param contentTree the content tree to which the row will be added
*/
- protected void addClassRow(ClassDoc usedClass, String packageName,
+ protected void addClassRow(ClassDoc usedClass, PackageDoc pkg,
Content contentTree) {
DocPath dp = pathString(usedClass,
DocPaths.CLASS_USE.resolve(DocPath.forName(usedClass)));
Content td = HtmlTree.TD(HtmlStyle.colOne,
- getHyperLink(dp.fragment(packageName), new StringContent(usedClass.name())));
+ getHyperLink(dp.fragment(getPackageAnchorName(pkg)), new StringContent(usedClass.name())));
addIndexComment(usedClass, td);
contentTree.addContent(td);
}
--- a/langtools/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java Fri Oct 03 13:00:21 2014 +0200
+++ b/langtools/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java Tue Oct 07 15:44:11 2014 -0700
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 6492694 8026567
+ * @bug 6492694 8026567 8048351
* @summary Test package deprecation.
* @author bpatel
* @library ../lib/
@@ -70,6 +70,8 @@
"pkg1");
checkOutput("allclasses-frame.html", false,
"FooDepr");
+ checkOutput("class-use/C2.ModalExclusionType.html", true,
+ "<td class=\"colFirst\"><a href=\"#unnamed.package\"><Unnamed></a></td>");
checkFiles(false,
"pkg1/package-summary.html",
--- a/langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java Fri Oct 03 13:00:21 2014 +0200
+++ b/langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java Tue Oct 07 15:44:11 2014 -0700
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4496290 4985072 7006178 7068595 8016328 8050031
+ * @bug 4496290 4985072 7006178 7068595 8016328 8050031 8048351
* @summary A simple test to ensure class-use files are correct.
* @author jamieh
* @library ../lib
@@ -134,9 +134,12 @@
"Uses of <a href=\"../UsedInC.html\" title=\"class in <Unnamed>\">"
+ "UsedInC</a> in <a href=\"../package-summary.html\"><Unnamed></a>"
);
+ checkOutput("class-use/UsedInC.html", true,
+ "<li class=\"blockList\"><a name=\"unnamed.package\">"
+ );
checkOutput("package-use.html", true,
"<td class=\"colOne\">"
- + "<a href=\"class-use/UsedInC.html#%3CUnnamed%3E\">UsedInC</a> </td>"
+ + "<a href=\"class-use/UsedInC.html#unnamed.package\">UsedInC</a> </td>"
);
}
--- a/langtools/test/tools/javac/T6306967.java Fri Oct 03 13:00:21 2014 +0200
+++ b/langtools/test/tools/javac/T6306967.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,32 +1,9 @@
/*
- * Copyright (c) 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.
- */
-
-/*
- * @test
+ * @test /nodynamiccopyright/
* @bug 6306967
* @summary Variable x is used before initialized
* @author Wei Tao
- * @compile/fail T6306967.java
+ * @compile/fail/ref=T6306967.out -XDrawDiagnostics T6306967.java
*/
public class T6306967 {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T6306967.out Tue Oct 07 15:44:11 2014 -0700
@@ -0,0 +1,2 @@
+T6306967.java:18:28: compiler.err.var.might.not.have.been.initialized: x
+1 error
--- a/langtools/test/tools/javac/T6379327.java Fri Oct 03 13:00:21 2014 +0200
+++ b/langtools/test/tools/javac/T6379327.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,32 +1,9 @@
/*
- * Copyright (c) 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.
- */
-
-/*
- * @test
+ * @test /nodynamiccopyright/
* @bug 6379327
* @summary Erroneous catch block not detected with anonymous class declaration
* @author Peter Jones, Wei Tao
- * @compile/fail T6379327.java
+ * @compile/fail/ref=T6379327.out -XDrawDiagnostics T6379327.java
*/
import java.security.*;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T6379327.out Tue Oct 07 15:44:11 2014 -0700
@@ -0,0 +1,2 @@
+T6379327.java:19:11: compiler.err.except.never.thrown.in.try: java.lang.ClassNotFoundException
+1 error
--- a/langtools/test/tools/javac/T6407257.java Fri Oct 03 13:00:21 2014 +0200
+++ b/langtools/test/tools/javac/T6407257.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,32 +1,9 @@
/*
- * Copyright (c) 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.
- */
-
-/*
- * @test
+ * @test /nodynamiccopyright/
* @bug 6407257
* @summary javac locks up when encountering cyclic inheritance
* @author Peter von der Ah\u00e9
- * @compile/fail T6407257.java
+ * @compile/fail/ref=T6407257.out -XDrawDiagnostics T6407257.java
*/
class T6407257a extends T6407257a {}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T6407257.out Tue Oct 07 15:44:11 2014 -0700
@@ -0,0 +1,2 @@
+T6407257.java:9:1: compiler.err.cyclic.inheritance: T6407257a
+1 error
--- a/langtools/test/tools/javac/T6663588.java Fri Oct 03 13:00:21 2014 +0200
+++ b/langtools/test/tools/javac/T6663588.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,32 +1,9 @@
/*
- * Copyright (c) 2008, 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
+ * @test /nodynamiccopyright/
* @bug 6663588
* @summary Compiler goes into infinite loop for Cyclic Inheritance test case
* @author Maurizio Cimadamore
- * @compile/fail T6663588.java
+ * @compile/fail/ref=T6663588.out -XDrawDiagnostics T6663588.java
*/
public class T6663588<T extends T6663588.Inner> extends T6663588 {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T6663588.out Tue Oct 07 15:44:11 2014 -0700
@@ -0,0 +1,2 @@
+T6663588.java:9:8: compiler.err.cyclic.inheritance: T6663588
+1 error
--- a/langtools/test/tools/javac/UncaughtOverflow.java Fri Oct 03 13:00:21 2014 +0200
+++ b/langtools/test/tools/javac/UncaughtOverflow.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,36 +1,14 @@
/*
- * Copyright (c) 1997, 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 4035346
+ * @test /nodynamiccopyright/
+ * @bug 4035346 4097402
* @summary Compiler used to allow this initialization, despite the overflow.
* @author turnidge
*
- * @compile/fail UncaughtOverflow.java
+ * @compile/fail/ref=UncaughtOverflow.out -XDrawDiagnostics UncaughtOverflow.java
*/
public
class UncaughtOverflow {
- int i = 100000000000;
+ int i1 = 100000000000;
+ int i2 = -2147483649;
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/UncaughtOverflow.out Tue Oct 07 15:44:11 2014 -0700
@@ -0,0 +1,3 @@
+UncaughtOverflow.java:12:14: compiler.err.int.number.too.large: 100000000000
+UncaughtOverflow.java:13:15: compiler.err.int.number.too.large: -2147483649
+2 errors
--- a/langtools/test/tools/javac/UncaughtOverflow2.java Fri Oct 03 13:00:21 2014 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 1998, 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 4097402
- * @summary Compiler used to allow this initialization, despite the overflow.
- * @author turnidge
- *
- * @compile/fail UncaughtOverflow2.java
- */
-
-public
-class UncaughtOverflow2 {
- int i = -2147483649;
-}
--- a/langtools/test/tools/javac/UseEnum.java Fri Oct 03 13:00:21 2014 +0200
+++ b/langtools/test/tools/javac/UseEnum.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,40 +1,16 @@
/*
- * Copyright (c) 2004, 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
+ * @test /nodynamiccopyright/
* @bug 5013488
* @summary Compiler AssertionError: com.sun.tools.javac.util.Bits.incl(Bits.java:73)
*
- * @compile/fail UseEnum.java
+ * @compile/fail/ref=UseEnum.out -XDrawDiagnostics UseEnum.java
*/
import static java.lang.System.out;
class UseEnum {
-
+ enum Animal {cat, dog, bird, fish};
public static void main(String args[]) {
- enum Animal {cat, dog, bird, fish};
Animal pet;
pet = Animal.cat;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/UseEnum.out Tue Oct 07 15:44:11 2014 -0700
@@ -0,0 +1,2 @@
+UseEnum.java:19:29: compiler.err.cant.resolve.location: kindname.variable, beast, , , (compiler.misc.location: kindname.class, UseEnum, null)
+1 error
--- a/langtools/test/tools/javac/VoidArray.java Fri Oct 03 13:00:21 2014 +0200
+++ b/langtools/test/tools/javac/VoidArray.java Tue Oct 07 15:44:11 2014 -0700
@@ -1,33 +1,10 @@
/*
- * Copyright (c) 1997, 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
+ * @test /nodynamiccopyright/
* @bug 4034979
* @summary The compiler should never allow void[] to appear as a type
* in a program.
*
- * @compile/fail VoidArray.java
+ * @compile/fail/ref=VoidArray.out -XDrawDiagnostics VoidArray.java
*/
public
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/VoidArray.out Tue Oct 07 15:44:11 2014 -0700
@@ -0,0 +1,7 @@
+VoidArray.java:12:9: compiler.err.expected: token.identifier
+VoidArray.java:12:13: compiler.err.expected: token.identifier
+VoidArray.java:14:9: compiler.err.expected: token.identifier
+VoidArray.java:14:12: compiler.err.invalid.meth.decl.ret.type.req
+VoidArray.java:14:24: compiler.err.expected: token.identifier
+VoidArray.java:14:28: compiler.err.expected3: ',', ')', '['
+6 errors
--- a/make/jprt.properties Fri Oct 03 13:00:21 2014 +0200
+++ b/make/jprt.properties Tue Oct 07 15:44:11 2014 -0700
@@ -483,7 +483,10 @@
${my.make.rule.test.targets.hotspot.servertests}, \
${my.make.rule.test.targets.hotspot.internalvmtests}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_wbapitest}, \
- ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler}, \
+ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler_1}, \
+ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler_2}, \
+ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler_3}, \
+ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler_closed}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_gc}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_runtime}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_runtime_closed}, \
--- a/modules.xml Fri Oct 03 13:00:21 2014 +0200
+++ b/modules.xml Tue Oct 07 15:44:11 2014 -0700
@@ -1603,6 +1603,9 @@
<depend>jdk.rmic</depend>
<depend>jdk.xml.bind</depend>
<depend>jdk.xml.ws</depend>
+ <export>
+ <name>com.sun.jarsigner</name>
+ </export>
</module>
<module>
<name>jdk.hotspot.agent</name>
--- a/nashorn/.hgtags Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/.hgtags Tue Oct 07 15:44:11 2014 -0700
@@ -266,3 +266,4 @@
072dbed6c5d968a6b9e156c36cd8838b4ff86ea1 jdk9-b30
77efdecfa2a5c28672b7c7dcc2d1b52dcb90d493 jdk9-b31
62ba20541b948fb98a7036d9f01baa54e95fb6fa jdk9-b32
+b374d8910e7f8de2b7ecacee9ae4cad88f23feab jdk9-b33
--- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java Tue Oct 07 15:44:11 2014 -0700
@@ -85,6 +85,7 @@
import jdk.internal.org.objectweb.asm.Handle;
import jdk.internal.org.objectweb.asm.MethodVisitor;
import jdk.internal.org.objectweb.asm.Type;
+import jdk.nashorn.internal.objects.annotations.SpecializedFunction.LinkLogic;
/**
* Base class for all method generating classes.
@@ -97,7 +98,7 @@
private final Type returnType;
private final Type[] argumentTypes;
- static final Type EMPTY_LINK_LOGIC_TYPE = Type.getType("Ljdk/nashorn/internal/objects/annotations/SpecializedFunction$LinkLogic$Empty;");
+ static final Type EMPTY_LINK_LOGIC_TYPE = Type.getType(LinkLogic.getEmptyLinkLogicClass());
MethodGenerator(final MethodVisitor mv, final int access, final String name, final String descriptor) {
super(Main.ASM_VERSION, mv);
--- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfo.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfo.java Tue Oct 07 15:44:11 2014 -0700
@@ -38,6 +38,7 @@
import jdk.nashorn.internal.objects.annotations.ScriptClass;
import jdk.nashorn.internal.objects.annotations.Setter;
import jdk.nashorn.internal.objects.annotations.SpecializedFunction;
+import jdk.nashorn.internal.objects.annotations.SpecializedFunction.LinkLogic;
import jdk.nashorn.internal.objects.annotations.Where;
import jdk.nashorn.internal.tools.nasgen.MemberInfo.Kind;
@@ -55,8 +56,8 @@
static final String SETTER_ANNO_DESC = Type.getDescriptor(Setter.class);
static final String PROPERTY_ANNO_DESC = Type.getDescriptor(Property.class);
static final String WHERE_ENUM_DESC = Type.getDescriptor(Where.class);
+ static final String LINK_LOGIC_DESC = Type.getDescriptor(LinkLogic.class);
static final String SPECIALIZED_FUNCTION = Type.getDescriptor(SpecializedFunction.class);
- static final String LINK_LOGIC_DESC = "Ljdk/nashorn/internal/objects/annotations/SpecializedFunction$LinkLogic;";
static final Map<String, Kind> annotations = new HashMap<>();
--- a/nashorn/make/BuildNashorn.gmk Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/make/BuildNashorn.gmk Tue Oct 07 15:44:11 2014 -0700
@@ -29,6 +29,7 @@
-include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
+include SetupJavaCompilers.gmk
JDK_CLASSES := $(subst $(SPACE),$(PATH_SEP),$(strip $(addprefix $(JDK_OUTPUTDIR)/modules/, \
java.base java.logging java.scripting)))
@@ -63,10 +64,10 @@
# Build nasgen
$(eval $(call SetupJavaCompilation,BUILD_NASGEN, \
- SETUP := GENERATE_NEWBYTECODE_DEBUG, \
+ SETUP := GENERATE_OLDBYTECODE, \
SRC := $(NASGEN_SRC) $(ASM_SRC), \
BIN := $(NASHORN_OUTPUTDIR)/nasgen_classes, \
- ADD_JAVAC_FLAGS := -cp $(NASHORN_OUTPUTDIR)/nashorn_classes))
+ ADD_JAVAC_FLAGS := -bootclasspath "$(BOOT_RTJAR)$(PATH_SEP)$(NASHORN_OUTPUTDIR)/nashorn_classes"))
# Nasgen needs nashorn classes
$(BUILD_NASGEN): $(BUILD_NASHORN)
--- a/nashorn/samples/BufferArray.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/samples/BufferArray.java Tue Oct 07 15:44:11 2014 -0700
@@ -29,8 +29,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import java.nio.DoubleBuffer;
import jdk.nashorn.api.scripting.AbstractJSObject;
-import java.nio.DoubleBuffer;
/**
* Simple class demonstrating pluggable script object
@@ -112,6 +112,8 @@
return true;
}
};
+ default:
+ break;
}
return null;
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ApplySpecialization.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ApplySpecialization.java Tue Oct 07 15:44:11 2014 -0700
@@ -27,7 +27,6 @@
import static jdk.nashorn.internal.codegen.CompilerConstants.ARGUMENTS_VAR;
import static jdk.nashorn.internal.codegen.CompilerConstants.EXPLODED_ARGUMENT_PREFIX;
-
import java.lang.invoke.MethodType;
import java.util.ArrayDeque;
import java.util.ArrayList;
@@ -35,7 +34,6 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-
import jdk.nashorn.internal.ir.AccessNode;
import jdk.nashorn.internal.ir.CallNode;
import jdk.nashorn.internal.ir.Expression;
@@ -131,7 +129,7 @@
@SuppressWarnings("serial")
final UnsupportedOperationException uoe = new UnsupportedOperationException() {
@Override
- public Throwable fillInStackTrace() {
+ public synchronized Throwable fillInStackTrace() {
return null;
}
};
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java Tue Oct 07 15:44:11 2014 -0700
@@ -104,6 +104,7 @@
import jdk.nashorn.internal.ir.IndexNode;
import jdk.nashorn.internal.ir.JoinPredecessor;
import jdk.nashorn.internal.ir.JoinPredecessorExpression;
+import jdk.nashorn.internal.ir.JumpStatement;
import jdk.nashorn.internal.ir.LabelNode;
import jdk.nashorn.internal.ir.LexicalContext;
import jdk.nashorn.internal.ir.LexicalContextNode;
@@ -1204,17 +1205,21 @@
@Override
public boolean enterBreakNode(final BreakNode breakNode) {
+ return enterJumpStatement(breakNode);
+ }
+
+ private boolean enterJumpStatement(final JumpStatement jump) {
if(!method.isReachable()) {
return false;
}
- enterStatement(breakNode);
-
- method.beforeJoinPoint(breakNode);
- final BreakableNode breakFrom = lc.getBreakable(breakNode.getLabelName());
- popScopesUntil(breakFrom);
- final Label breakLabel = breakFrom.getBreakLabel();
- breakLabel.markAsBreakTarget();
- method.splitAwareGoto(lc, breakLabel, breakFrom);
+ enterStatement(jump);
+
+ method.beforeJoinPoint(jump);
+ final BreakableNode target = jump.getTarget(lc);
+ popScopesUntil(target);
+ final Label targetLabel = jump.getTargetLabel(target);
+ targetLabel.markAsBreakTarget();
+ method.splitAwareGoto(lc, targetLabel, target);
return false;
}
@@ -1517,19 +1522,7 @@
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
- if(!method.isReachable()) {
- return false;
- }
- enterStatement(continueNode);
- method.beforeJoinPoint(continueNode);
-
- final LoopNode continueTo = lc.getContinueTo(continueNode.getLabelName());
- popScopesUntil(continueTo);
- final Label continueLabel = continueTo.getContinueLabel();
- continueLabel.markAsBreakTarget();
- method.splitAwareGoto(lc, continueLabel, continueTo);
-
- return false;
+ return enterJumpStatement(continueNode);
}
@Override
@@ -2807,6 +2800,7 @@
final boolean hasReturn = method.hasReturn();
final SplitMethodEmitter splitMethod = ((SplitMethodEmitter)method);
final List<Label> targets = splitMethod.getExternalTargets();
+ final boolean hasControlFlow = hasReturn || !targets.isEmpty();
final List<BreakableNode> targetNodes = splitMethod.getExternalTargetNodes();
final Type returnType = lc.getCurrentFunction().getReturnType();
@@ -2814,6 +2808,9 @@
// Wrap up this method.
if(method.isReachable()) {
+ if (hasControlFlow) {
+ method.setSplitState(-1);
+ }
method.loadCompilerConstant(RETURN, returnType);
method._return(returnType);
}
@@ -2831,17 +2828,16 @@
throw e;
}
+ //no external jump targets or return in switch node
+ if (!hasControlFlow) {
+ return splitNode;
+ }
+
// Handle return from split method if there was one.
final MethodEmitter caller = method;
final int targetCount = targets.size();
- //no external jump targets or return in switch node
- if (!hasReturn && targets.isEmpty()) {
- return splitNode;
- }
-
- caller.loadCompilerConstant(SCOPE);
- caller.checkcast(Scope.class);
+ caller.loadScope();
caller.invoke(Scope.GET_SPLIT_STATE);
final Label breakLabel = new Label("no_split_state");
@@ -2873,19 +2869,16 @@
caller.loadCompilerConstant(RETURN, returnType);
caller._return(returnType);
} else {
- // Clear split state.
- caller.loadCompilerConstant(SCOPE);
- caller.checkcast(Scope.class);
- caller.load(-1);
- caller.invoke(Scope.SET_SPLIT_STATE);
final BreakableNode targetNode = targetNodes.get(i - 1);
final Label label = targets.get(i - 1);
- final JoinPredecessor jumpOrigin = splitNode.getJumpOrigin(label);
- if(jumpOrigin != null) {
- method.beforeJoinPoint(jumpOrigin);
+ if (!lc.isExternalTarget(splitNode, targetNode)) {
+ final JoinPredecessor jumpOrigin = splitNode.getJumpOrigin(label);
+ if(jumpOrigin != null) {
+ method.beforeJoinPoint(jumpOrigin);
+ }
+ popScopesUntil(targetNode);
}
- popScopesUntil(targetNode);
- caller.splitAwareGoto(lc, targets.get(i - 1), targetNode);
+ caller.splitAwareGoto(lc, label, targetNode);
}
}
caller.label(breakLabel);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CompilationPhase.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CompilationPhase.java Tue Oct 07 15:44:11 2014 -0700
@@ -38,7 +38,6 @@
import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.SPLIT;
import static jdk.nashorn.internal.ir.FunctionNode.CompilationState.SYMBOLS_ASSIGNED;
import static jdk.nashorn.internal.runtime.logging.DebugLogger.quote;
-
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.EnumSet;
@@ -48,7 +47,6 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-
import jdk.nashorn.internal.AssertsEnabled;
import jdk.nashorn.internal.codegen.Compiler.CompilationPhases;
import jdk.nashorn.internal.ir.FunctionNode;
@@ -627,7 +625,7 @@
/**
* Start a compilation phase
- * @param compiler
+ * @param compiler the compiler to use
* @param functionNode function to compile
* @return function node
*/
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Compiler.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Compiler.java Tue Oct 07 15:44:11 2014 -0700
@@ -32,7 +32,6 @@
import static jdk.nashorn.internal.codegen.CompilerConstants.THIS;
import static jdk.nashorn.internal.codegen.CompilerConstants.VARARGS;
import static jdk.nashorn.internal.runtime.logging.DebugLogger.quote;
-
import java.io.File;
import java.lang.invoke.MethodType;
import java.util.Arrays;
@@ -154,6 +153,13 @@
private RecompilableScriptFunctionData compiledFunction;
/**
+ * Most compile unit names are longer than the default StringBuilder buffer,
+ * worth startup performance when massive class generation is going on to increase
+ * this
+ */
+ private static final int COMPILE_UNIT_NAME_BUFFER_SIZE = 32;
+
+ /**
* Compilation phases that a compilation goes through
*/
public static class CompilationPhases implements Iterable<CompilationPhase> {
@@ -631,7 +637,8 @@
}
String nextCompileUnitName() {
- final StringBuilder sb = new StringBuilder(firstCompileUnitName);
+ final StringBuilder sb = new StringBuilder(COMPILE_UNIT_NAME_BUFFER_SIZE);
+ sb.append(firstCompileUnitName);
final int cuid = nextCompileUnitId.getAndIncrement();
if (cuid > 0) {
sb.append("$cu").append(cuid);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Label.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Label.java Tue Oct 07 15:44:11 2014 -0700
@@ -590,8 +590,13 @@
return label.getOffset() > other.label.getOffset();
}
+ private String str;
+
@Override
public String toString() {
- return name + '_' + id;
+ if (str == null) {
+ str = name + '_' + id;
+ }
+ return str;
}
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/LocalVariableTypesCalculator.java Tue Oct 07 15:44:11 2014 -0700
@@ -464,21 +464,20 @@
@Override
public boolean enterBreakNode(final BreakNode breakNode) {
- if(!reachable) {
- return false;
- }
-
- final BreakableNode target = lc.getBreakable(breakNode.getLabelName());
- return splitAwareJumpToLabel(breakNode, target, target.getBreakLabel());
+ return enterJumpStatement(breakNode);
}
@Override
public boolean enterContinueNode(final ContinueNode continueNode) {
+ return enterJumpStatement(continueNode);
+ }
+
+ private boolean enterJumpStatement(final JumpStatement jump) {
if(!reachable) {
return false;
}
- final LoopNode target = lc.getContinueTo(continueNode.getLabelName());
- return splitAwareJumpToLabel(continueNode, target, target.getContinueLabel());
+ final BreakableNode target = jump.getTarget(lc);
+ return splitAwareJumpToLabel(jump, target, jump.getTargetLabel(target));
}
private boolean splitAwareJumpToLabel(final JumpStatement jumpStatement, final BreakableNode target, final Label targetLabel) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Lower.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Lower.java Tue Oct 07 15:44:11 2014 -0700
@@ -52,6 +52,7 @@
import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
import jdk.nashorn.internal.ir.IdentNode;
import jdk.nashorn.internal.ir.IfNode;
+import jdk.nashorn.internal.ir.JumpStatement;
import jdk.nashorn.internal.ir.LabelNode;
import jdk.nashorn.internal.ir.LexicalContext;
import jdk.nashorn.internal.ir.LiteralNode;
@@ -382,12 +383,16 @@
@Override
public Node leaveBreakNode(final BreakNode breakNode) {
- return copy(breakNode, (Node)Lower.this.lc.getBreakable(breakNode.getLabelName()));
+ return leaveJumpStatement(breakNode);
}
@Override
public Node leaveContinueNode(final ContinueNode continueNode) {
- return copy(continueNode, Lower.this.lc.getContinueTo(continueNode.getLabelName()));
+ return leaveJumpStatement(continueNode);
+ }
+
+ private Node leaveJumpStatement(final JumpStatement jump) {
+ return copy(jump, (Node)jump.getTarget(Lower.this.lc));
}
@Override
@@ -627,7 +632,7 @@
@Override
public Node leaveContinueNode(final ContinueNode node) {
// all inner loops have been popped.
- if (lex.contains(lex.getContinueTo(node.getLabelName()))) {
+ if (lex.contains(node.getTarget(lex))) {
escapes.add(node);
}
return node;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/MethodEmitter.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/MethodEmitter.java Tue Oct 07 15:44:11 2014 -0700
@@ -103,6 +103,7 @@
import jdk.nashorn.internal.runtime.Debug;
import jdk.nashorn.internal.runtime.JSType;
import jdk.nashorn.internal.runtime.RewriteException;
+import jdk.nashorn.internal.runtime.Scope;
import jdk.nashorn.internal.runtime.ScriptObject;
import jdk.nashorn.internal.runtime.ScriptRuntime;
import jdk.nashorn.internal.runtime.UnwarrantedOptimismException;
@@ -1046,6 +1047,14 @@
return load(getCompilerConstantSymbol(cc), type != null ? type : getCompilerConstantType(cc));
}
+ MethodEmitter loadScope() {
+ return loadCompilerConstant(SCOPE).checkcast(Scope.class);
+ }
+
+ MethodEmitter setSplitState(final int state) {
+ return loadScope().load(state).invoke(Scope.SET_SPLIT_STATE);
+ }
+
void storeCompilerConstant(final CompilerConstants cc) {
storeCompilerConstant(cc, null);
}
@@ -2134,6 +2143,8 @@
load("Function");
invoke(ScriptRuntime.INVALIDATE_RESERVED_BUILTIN_NAME);
break;
+ default:
+ break;
}
return this;
}
@@ -2574,12 +2585,55 @@
*
* @param args debug information to print
*/
+ @SuppressWarnings("unused")
private void debug(final Object... args) {
if (debug) {
debug(30, args);
}
}
+ private void debug(final String arg) {
+ if (debug) {
+ debug(30, arg);
+ }
+ }
+
+ private void debug(final Object arg0, final Object arg1) {
+ if (debug) {
+ debug(30, new Object[] { arg0, arg1 });
+ }
+ }
+
+ private void debug(final Object arg0, final Object arg1, final Object arg2) {
+ if (debug) {
+ debug(30, new Object[] { arg0, arg1, arg2 });
+ }
+ }
+
+ private void debug(final Object arg0, final Object arg1, final Object arg2, final Object arg3) {
+ if (debug) {
+ debug(30, new Object[] { arg0, arg1, arg2, arg3 });
+ }
+ }
+
+ private void debug(final Object arg0, final Object arg1, final Object arg2, final Object arg3, final Object arg4) {
+ if (debug) {
+ debug(30, new Object[] { arg0, arg1, arg2, arg3, arg4 });
+ }
+ }
+
+ private void debug(final Object arg0, final Object arg1, final Object arg2, final Object arg3, final Object arg4, final Object arg5) {
+ if (debug) {
+ debug(30, new Object[] { arg0, arg1, arg2, arg3, arg4, arg5 });
+ }
+ }
+
+ private void debug(final Object arg0, final Object arg1, final Object arg2, final Object arg3, final Object arg4, final Object arg5, final Object arg6) {
+ if (debug) {
+ debug(30, new Object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6 });
+ }
+ }
+
/**
* Debug function that outputs generated bytecode and stack contents
* for a label - indentation is currently the only thing that differs
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java Tue Oct 07 15:44:11 2014 -0700
@@ -443,7 +443,7 @@
// does not increase filesDeleted
}
files[i] = null; // gc eligible
- };
+ }
}
private static Path[] getAllRegularFilesInLastModifiedOrder() throws IOException {
@@ -454,7 +454,7 @@
@Override
public boolean test(final Path path) {
return !Files.isDirectory(path);
- };
+ }
})
.map(new Function<Path, PathAndTime>() {
@Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/SplitMethodEmitter.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/SplitMethodEmitter.java Tue Oct 07 15:44:11 2014 -0700
@@ -25,8 +25,6 @@
package jdk.nashorn.internal.codegen;
-import static jdk.nashorn.internal.codegen.CompilerConstants.SCOPE;
-
import java.util.ArrayList;
import java.util.List;
import jdk.internal.org.objectweb.asm.MethodVisitor;
@@ -34,7 +32,6 @@
import jdk.nashorn.internal.ir.BreakableNode;
import jdk.nashorn.internal.ir.LexicalContext;
import jdk.nashorn.internal.ir.SplitNode;
-import jdk.nashorn.internal.runtime.Scope;
/**
* Emitter used for splitting methods. Needs to keep track of if there are jump targets
@@ -65,15 +62,13 @@
assert splitNode != null;
final int index = findExternalTarget(lc, label, targetNode);
if (index >= 0) {
- loadCompilerConstant(SCOPE);
- checkcast(Scope.class);
- load(index + 1);
- invoke(Scope.SET_SPLIT_STATE);
- loadUndefined(Type.OBJECT);
- _return(functionNode.getReturnType());
- return;
+ setSplitState(index + 1); // 0 is ordinary return
+ final Type retType = functionNode.getReturnType();
+ loadUndefined(retType);
+ _return(retType);
+ } else {
+ super.splitAwareGoto(lc, label, targetNode);
}
- super.splitAwareGoto(lc, label, targetNode);
}
private int findExternalTarget(final LexicalContext lc, final Label label, final BreakableNode targetNode) {
@@ -94,11 +89,7 @@
@Override
MethodEmitter registerReturn() {
setHasReturn();
- loadCompilerConstant(SCOPE);
- checkcast(Scope.class);
- load(0);
- invoke(Scope.SET_SPLIT_STATE);
- return this;
+ return setSplitState(0);
}
final List<Label> getExternalTargets() {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/Type.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/Type.java Tue Oct 07 15:44:11 2014 -0700
@@ -47,7 +47,6 @@
import static jdk.internal.org.objectweb.asm.Opcodes.T_INT;
import static jdk.internal.org.objectweb.asm.Opcodes.T_LONG;
import static jdk.nashorn.internal.codegen.CompilerConstants.staticCallNoLookup;
-
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
@@ -55,8 +54,10 @@
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
+import java.util.Collections;
import java.util.Map;
import java.util.TreeMap;
+import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import jdk.internal.org.objectweb.asm.Handle;
@@ -104,6 +105,16 @@
/** The class for this type */
private final Class<?> clazz;
+ /**
+ * Cache for internal types - this is a query that requires complex stringbuilding inside
+ * ASM and it saves startup time to cache the type mappings
+ */
+ private static final Map<Class<?>, jdk.internal.org.objectweb.asm.Type> INTERNAL_TYPE_CACHE =
+ Collections.synchronizedMap(new WeakHashMap<Class<?>, jdk.internal.org.objectweb.asm.Type>());
+
+ /** Internal ASM type for this Type - computed once at construction */
+ private final jdk.internal.org.objectweb.asm.Type internalType;
+
/** Weights are used to decide which types are "wider" than other types */
protected static final int MIN_WEIGHT = -1;
@@ -122,12 +133,13 @@
* @param slots how many bytecode slots the type takes up
*/
Type(final String name, final Class<?> clazz, final int weight, final int slots) {
- this.name = name;
- this.clazz = clazz;
- this.descriptor = jdk.internal.org.objectweb.asm.Type.getDescriptor(clazz);
- this.weight = weight;
+ this.name = name;
+ this.clazz = clazz;
+ this.descriptor = jdk.internal.org.objectweb.asm.Type.getDescriptor(clazz);
+ this.weight = weight;
assert weight >= MIN_WEIGHT && weight <= MAX_WEIGHT : "illegal type weight: " + weight;
- this.slots = slots;
+ this.slots = slots;
+ this.internalType = getInternalType(clazz);
}
/**
@@ -299,7 +311,7 @@
*
* @param typeMap the type map
* @param output data output
- * @throws IOException
+ * @throws IOException if write cannot be completed
*/
public static void writeTypeMap(final Map<Integer, Type> typeMap, final DataOutput output) throws IOException {
if (typeMap == null) {
@@ -329,7 +341,7 @@
*
* @param input data input
* @return type map
- * @throws IOException
+ * @throws IOException if read cannot be completed
*/
public static Map<Integer, Type> readTypeMap(final DataInput input) throws IOException {
final int size = input.readInt();
@@ -357,11 +369,22 @@
}
private jdk.internal.org.objectweb.asm.Type getInternalType() {
- return jdk.internal.org.objectweb.asm.Type.getType(getTypeClass());
+ return internalType;
+ }
+
+ private static jdk.internal.org.objectweb.asm.Type lookupInternalType(final Class<?> type) {
+ final Map<Class<?>, jdk.internal.org.objectweb.asm.Type> cache = INTERNAL_TYPE_CACHE;
+ jdk.internal.org.objectweb.asm.Type itype = cache.get(type);
+ if (itype != null) {
+ return itype;
+ }
+ itype = jdk.internal.org.objectweb.asm.Type.getType(type);
+ cache.put(type, itype);
+ return itype;
}
private static jdk.internal.org.objectweb.asm.Type getInternalType(final Class<?> type) {
- return jdk.internal.org.objectweb.asm.Type.getType(type);
+ return lookupInternalType(type);
}
static void invokestatic(final MethodVisitor method, final Call call) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BreakNode.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BreakNode.java Tue Oct 07 15:44:11 2014 -0700
@@ -25,6 +25,7 @@
package jdk.nashorn.internal.ir;
+import jdk.nashorn.internal.codegen.Label;
import jdk.nashorn.internal.ir.annotations.Immutable;
import jdk.nashorn.internal.ir.visitor.NodeVisitor;
@@ -68,4 +69,14 @@
String getStatementName() {
return "break";
}
+
+ @Override
+ public BreakableNode getTarget(final LexicalContext lc) {
+ return lc.getBreakable(getLabelName());
+ }
+
+ @Override
+ public Label getTargetLabel(final BreakableNode target) {
+ return target.getBreakLabel();
+ }
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ContinueNode.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/ContinueNode.java Tue Oct 07 15:44:11 2014 -0700
@@ -25,6 +25,7 @@
package jdk.nashorn.internal.ir;
+import jdk.nashorn.internal.codegen.Label;
import jdk.nashorn.internal.ir.annotations.Immutable;
import jdk.nashorn.internal.ir.visitor.NodeVisitor;
@@ -67,5 +68,16 @@
String getStatementName() {
return "continue";
}
+
+
+ @Override
+ public BreakableNode getTarget(final LexicalContext lc) {
+ return lc.getContinueTo(getLabelName());
+ }
+
+ @Override
+ public Label getTargetLabel(final BreakableNode target) {
+ return ((LoopNode)target).getContinueLabel();
+ }
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/JumpStatement.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/JumpStatement.java Tue Oct 07 15:44:11 2014 -0700
@@ -25,6 +25,8 @@
package jdk.nashorn.internal.ir;
+import jdk.nashorn.internal.codegen.Label;
+
/**
* Common base class for jump statements (e.g. {@code break} and {@code continue}).
*/
@@ -82,6 +84,24 @@
abstract String getStatementName();
+ /**
+ * Finds the target for this jump statement in a lexical context.
+ * @param lc the lexical context
+ * @return the target, or null if not found
+ */
+ public abstract BreakableNode getTarget(final LexicalContext lc);
+
+ /**
+ * Returns the label corresponding to this kind of jump statement (either a break or continue label) in the target.
+ * @param target the target. Note that it need not be the target of this jump statement, as the method can retrieve
+ * a label on any passed target as long as the target has a label of the requisite kind. Of course, it is advisable
+ * to invoke the method on a jump statement that targets the breakable.
+ * @return the label of the target corresponding to the kind of jump statement.
+ * @throws ClassCastException if invoked on the kind of breakable node that this jump statement is not prepared to
+ * handle.
+ */
+ public abstract Label getTargetLabel(final BreakableNode target);
+
@Override
public JumpStatement setLocalVariableConversion(final LexicalContext lc, final LocalVariableConversion conversion) {
if(this.conversion == conversion) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java Tue Oct 07 15:44:11 2014 -0700
@@ -561,6 +561,7 @@
*
* @param engine ScriptEngine to initialize
*/
+ @SuppressWarnings("hiding")
public void initBuiltinObjects(final ScriptEngine engine) {
if (this.builtinObject != null) {
// already initialized, just return
@@ -905,10 +906,12 @@
}
switch (nameStr) {
- case "context":
- return sctxt;
- case "engine":
- return global.engine;
+ case "context":
+ return sctxt;
+ case "engine":
+ return global.engine;
+ default:
+ break;
}
if (self == UNDEFINED) {
@@ -1715,6 +1718,7 @@
return func;
}
+ @SuppressWarnings("hiding")
private void init(final ScriptEngine engine) {
assert Context.getGlobal() == this : "this global is not set as current";
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArray.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeArray.java Tue Oct 07 15:44:11 2014 -0700
@@ -1835,7 +1835,7 @@
return false;
}
- private ContinuousArrayData getContinuousNonEmptyArrayData(final Object self) {
+ private static ContinuousArrayData getContinuousNonEmptyArrayData(final Object self) {
final ContinuousArrayData data = getContinuousArrayData(self);
if (data != null) {
return data.length() == 0 ? null : data;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDebug.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDebug.java Tue Oct 07 15:44:11 2014 -0700
@@ -26,7 +26,6 @@
package jdk.nashorn.internal.objects;
import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
-
import java.io.PrintWriter;
import java.util.LinkedList;
import java.util.Objects;
@@ -262,8 +261,8 @@
/**
* Set the event queue capacity
- * @param self
- * @param newCapacity
+ * @param self an event queue
+ * @param newCapacity new capacity
*/
@Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
public static void setEventQueueCapacity(final Object self, final Object newCapacity) {
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/annotations/SpecializedFunction.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/annotations/SpecializedFunction.java Tue Oct 07 15:44:11 2014 -0700
@@ -77,7 +77,7 @@
public boolean isEmpty() {
return true;
}
- };
+ }
/**
* Get the class representing the empty link logic
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/AbstractParser.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/AbstractParser.java Tue Oct 07 15:44:11 2014 -0700
@@ -30,7 +30,6 @@
import static jdk.nashorn.internal.parser.TokenType.EOF;
import static jdk.nashorn.internal.parser.TokenType.EOL;
import static jdk.nashorn.internal.parser.TokenType.IDENT;
-
import java.util.HashMap;
import java.util.Map;
import jdk.nashorn.internal.ir.IdentNode;
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CodeInstaller.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CodeInstaller.java Tue Oct 07 15:44:11 2014 -0700
@@ -100,4 +100,21 @@
* @return compiled script data
*/
public StoredScript loadScript(Source source, String functionKey);
+
+ /**
+ * Returns a new code installer that shares most of the functionality of this code installer, but uses a
+ * new, independent class loader.
+ * @return a new code installer with a new independent class loader.
+ */
+ public CodeInstaller<T> withNewLoader();
+
+ /**
+ * Returns true if this code installer is compatible with the other code installer. Compatibility is expected to be
+ * an equivalence relation, and installers are supposed to be compatible with those they create using
+ * {@link #withNewLoader()}.
+ * @param other the other code installer tested for compatibility with this code installer.
+ * @return true if this code installer is compatible with the other code installer.
+ */
+ public boolean isCompatibleWith(CodeInstaller<T> other);
+
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CodeStore.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CodeStore.java Tue Oct 07 15:44:11 2014 -0700
@@ -210,7 +210,7 @@
/**
* Constructor
*
- * @throws IOException
+ * @throws IOException if there are read/write problems with the cache and cache directory
*/
public DirectoryCodeStore() throws IOException {
this(Options.getStringProperty("nashorn.persistent.code.cache", "nashorn_code_cache"), false, DEFAULT_MIN_SIZE);
@@ -222,7 +222,7 @@
* @param path directory to store code in
* @param readOnly is this a read only code store
* @param minSize minimum file size for caching scripts
- * @throws IOException
+ * @throws IOException if there are read/write problems with the cache and cache directory
*/
public DirectoryCodeStore(final String path, final boolean readOnly, final int minSize) throws IOException {
this.dir = checkDirectory(path, readOnly);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CompiledFunction.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CompiledFunction.java Tue Oct 07 15:44:11 2014 -0700
@@ -110,9 +110,8 @@
*/
this.invoker = MH.insertArguments(invoker, invoker.type().parameterCount() - 1, UnwarrantedOptimismException.FIRST_PROGRAM_POINT);
throw new AssertionError("Optimistic (UnwarrantedOptimismException throwing) builtin functions are currently not in use");
- } else {
- this.invoker = invoker;
}
+ this.invoker = invoker;
this.constructor = constructor;
this.flags = flags;
this.callSiteType = callSiteType;
@@ -510,8 +509,8 @@
return ((ArrayType)paramTypes[paramTypes.length - 1]).getElementType();
}
- boolean matchesCallSite(final MethodType callSiteType, final boolean pickVarArg) {
- if (callSiteType.equals(this.callSiteType)) {
+ boolean matchesCallSite(final MethodType other, final boolean pickVarArg) {
+ if (other.equals(this.callSiteType)) {
return true;
}
final MethodType type = type();
@@ -521,7 +520,7 @@
return pickVarArg;
}
- final int csParamCount = getParamCount(callSiteType);
+ final int csParamCount = getParamCount(other);
final boolean csIsVarArg = csParamCount == Integer.MAX_VALUE;
final int thisThisIndex = needsCallee() ? 1 : 0; // Index of "this" parameter in this function's type
@@ -530,7 +529,7 @@
// We must match all incoming parameters, except "this". Starting from 1 to skip "this".
for(int i = 1; i < minParams; ++i) {
final Type fnType = Type.typeFor(type.parameterType(i + thisThisIndex));
- final Type csType = csIsVarArg ? Type.OBJECT : Type.typeFor(callSiteType.parameterType(i + 1));
+ final Type csType = csIsVarArg ? Type.OBJECT : Type.typeFor(other.parameterType(i + 1));
if(!fnType.isEquivalentTo(csType)) {
return false;
}
@@ -752,9 +751,9 @@
return sb.toString();
}
- private void logRecompile(final String reason, final FunctionNode fn, final MethodType callSiteType, final Map<Integer, Type> ipp) {
+ private void logRecompile(final String reason, final FunctionNode fn, final MethodType type, final Map<Integer, Type> ipp) {
if (log.isEnabled()) {
- log.info(reason, DebugLogger.quote(fn.getName()), " signature: ", callSiteType, " ", toStringInvalidations(ipp));
+ log.info(reason, DebugLogger.quote(fn.getName()), " signature: ", type, " ", toStringInvalidations(ipp));
}
}
@@ -815,8 +814,6 @@
compiler.persistClassInfo(cacheKey, normalFn);
}
- FunctionNode fn2 = effectiveOptInfo.reparse();
- fn2 = compiler.compile(fn2, CompilationPhases.COMPILE_UPTO_BYTECODE);
log.info("Done.");
final boolean canBeDeoptimized = normalFn.canBeDeoptimized();
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java Tue Oct 07 15:44:11 2014 -0700
@@ -64,9 +64,7 @@
import java.util.function.Consumer;
import java.util.function.Supplier;
import java.util.logging.Level;
-
import javax.script.ScriptEngine;
-
import jdk.internal.org.objectweb.asm.ClassReader;
import jdk.internal.org.objectweb.asm.util.CheckClassAdapter;
import jdk.nashorn.api.scripting.ClassFilter;
@@ -161,7 +159,7 @@
}
/**
- * Return the context for this installer
+ * Return the script environment for this installer
* @return ScriptEnvironment
*/
@Override
@@ -225,6 +223,20 @@
}
return null;
}
+
+ @Override
+ public CodeInstaller<ScriptEnvironment> withNewLoader() {
+ return new ContextCodeInstaller(context, context.createNewLoader(), codeSource);
+ }
+
+ @Override
+ public boolean isCompatibleWith(final CodeInstaller<ScriptEnvironment> other) {
+ if (other instanceof ContextCodeInstaller) {
+ final ContextCodeInstaller cci = (ContextCodeInstaller)other;
+ return cci.context == context && cci.codeSource == codeSource;
+ }
+ return false;
+ }
}
/** Is Context global debug mode enabled ? */
@@ -1390,7 +1402,7 @@
* logic to e.g. multiple switchpoint classes.
*/
public static final class BuiltinSwitchPoint extends SwitchPoint {
-
+ //empty
}
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Debug.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Debug.java Tue Oct 07 15:44:11 2014 -0700
@@ -26,7 +26,6 @@
package jdk.nashorn.internal.runtime;
import static jdk.nashorn.internal.parser.TokenType.EOF;
-
import jdk.nashorn.internal.parser.Lexer;
import jdk.nashorn.internal.parser.Token;
import jdk.nashorn.internal.parser.TokenStream;
@@ -42,12 +41,12 @@
/**
* Return the topmost JavaScript frame in a stack trace
- * @param e
+ * @param t throwable that contains the stack trace
* @return line describing the topmost JavaScript frame
*/
- public static String firstJSFrame(final Throwable e) {
- for (final StackTraceElement ste : e.getStackTrace()) {
- if(ECMAErrors.isScriptFrame(ste)) {
+ public static String firstJSFrame(final Throwable t) {
+ for (final StackTraceElement ste : t.getStackTrace()) {
+ if (ECMAErrors.isScriptFrame(ste)) {
return ste.toString();
}
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/RecompilableScriptFunctionData.java Tue Oct 07 15:44:11 2014 -0700
@@ -26,6 +26,7 @@
package jdk.nashorn.internal.runtime;
import static jdk.nashorn.internal.lookup.Lookup.MH;
+
import java.io.IOException;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
@@ -268,7 +269,7 @@
if (this.source == null && this.installer == null) {
this.source = src;
this.installer = inst;
- } else if (this.source != src || this.installer != inst) {
+ } else if (this.source != src || !this.installer.isCompatibleWith(inst)) {
// Existing values must be same as those passed as parameters
throw new IllegalArgumentException();
}
@@ -407,6 +408,17 @@
return getCompiler(fn, actualCallSiteType, newLocals(runtimeScope), null, null);
}
+ /**
+ * Returns a code installer for installing new code. If we're using either optimistic typing or loader-per-compile,
+ * then asks for a code installer with a new class loader; otherwise just uses the current installer. We use
+ * a new class loader with optimistic typing so that deoptimized code can get reclaimed by GC.
+ * @return a code installer for installing new code.
+ */
+ private CodeInstaller<ScriptEnvironment> getInstallerForNewCode() {
+ final ScriptEnvironment env = installer.getOwner();
+ return env._optimistic_types || env._loader_per_compile ? installer.withNewLoader() : installer;
+ }
+
Compiler getCompiler(final FunctionNode functionNode, final MethodType actualCallSiteType,
final ScriptObject runtimeScope, final Map<Integer, Type> invalidatedProgramPoints,
final int[] continuationEntryPoints) {
@@ -417,7 +429,7 @@
return new Compiler(
context,
context.getEnv(),
- installer,
+ getInstallerForNewCode(),
functionNode.getSource(), // source
context.getErrorManager(),
isStrict() | functionNode.isStrict(), // is strict
@@ -463,11 +475,12 @@
final TypeMap typeMap = typeMap(actualCallSiteType);
final Type[] paramTypes = typeMap == null ? null : typeMap.getParameterTypes(functionNodeId);
cacheKey = CodeStore.getCacheKey(functionNodeId, paramTypes);
- final StoredScript script = installer.loadScript(source, cacheKey);
+ final CodeInstaller<ScriptEnvironment> newInstaller = getInstallerForNewCode();
+ final StoredScript script = newInstaller.loadScript(source, cacheKey);
if (script != null) {
Compiler.updateCompilationId(script.getCompilationId());
- return install(script);
+ return installStoredScript(script, newInstaller);
}
}
@@ -481,15 +494,7 @@
return new FunctionInitializer(compiledFn, compiler.getInvalidatedProgramPoints());
}
-
- /**
- * Install this script using the given {@code installer}.
- *
- * @param script the compiled script
- * @return the function initializer
- */
- private FunctionInitializer install(final StoredScript script) {
-
+ private static Map<String, Class<?>> installStoredScriptClasses(final StoredScript script, final CodeInstaller<ScriptEnvironment> installer) {
final Map<String, Class<?>> installedClasses = new HashMap<>();
final Map<String, byte[]> classBytes = script.getClassBytes();
final String mainClassName = script.getMainClassName();
@@ -501,14 +506,25 @@
for (final Map.Entry<String, byte[]> entry : classBytes.entrySet()) {
final String className = entry.getKey();
- final byte[] code = entry.getValue();
+ final byte[] bytecode = entry.getValue();
if (className.equals(mainClassName)) {
continue;
}
- installedClasses.put(className, installer.install(className, code));
+ installedClasses.put(className, installer.install(className, bytecode));
}
+ return installedClasses;
+ }
+
+ /**
+ * Install this script using the given {@code installer}.
+ *
+ * @param script the compiled script
+ * @return the function initializer
+ */
+ private FunctionInitializer installStoredScript(final StoredScript script, final CodeInstaller<ScriptEnvironment> newInstaller) {
+ final Map<String, Class<?>> installedClasses = installStoredScriptClasses(script, newInstaller);
final Map<Integer, FunctionInitializer> initializers = script.getInitializers();
assert initializers != null;
@@ -523,7 +539,7 @@
}
}
- installer.initialize(installedClasses.values(), source, constants);
+ newInstaller.initialize(installedClasses.values(), source, constants);
initializer.setCode(installedClasses.get(initializer.getClassName()));
return initializer;
}
@@ -588,9 +604,11 @@
return lookupCodeMethod(fn.getCompileUnit().getCode(), type);
}
- MethodHandle lookupCodeMethod(final Class<?> code, final MethodType targetType) {
- log.info("Looking up ", DebugLogger.quote(name), " type=", targetType);
- return MH.findStatic(LOOKUP, code, functionName, targetType);
+ MethodHandle lookupCodeMethod(final Class<?> codeClass, final MethodType targetType) {
+ if (log.isEnabled()) {
+ log.info("Looking up ", DebugLogger.quote(name), " type=", targetType);
+ }
+ return MH.findStatic(LOOKUP, codeClass, functionName, targetType);
}
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptFunction.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptFunction.java Tue Oct 07 15:44:11 2014 -0700
@@ -501,7 +501,7 @@
* @param linkLogicClass linkLogicClass, or null if no link logic exists
* @return link logic instance, or null if one could not be constructed for this receiver
*/
- private LinkLogic getLinkLogic(final Object self, final Class<? extends LinkLogic> linkLogicClass) {
+ private static LinkLogic getLinkLogic(final Object self, final Class<? extends LinkLogic> linkLogicClass) {
if (linkLogicClass == null) {
return LinkLogic.EMPTY_INSTANCE; //always OK to link this, specialization but without special linking logic
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java Tue Oct 07 15:44:11 2014 -0700
@@ -935,10 +935,10 @@
* creating setters that probably aren't used. Inject directly into the spill pool
* the defaults for "arguments" and "caller"
*
- * @param key
- * @param propertyFlags
- * @param getter
- * @param setter
+ * @param key property key
+ * @param propertyFlags flags
+ * @param getter getter for {@link UserAccessorProperty}, null if not present or N/A
+ * @param setter setter for {@link UserAccessorProperty}, null if not present or N/A
*/
protected final void initUserAccessors(final String key, final int propertyFlags, final ScriptFunction getter, final ScriptFunction setter) {
final int slot = spillLength;
@@ -1749,8 +1749,8 @@
*/
public Object put(final Object key, final Object value, final boolean strict) {
final Object oldValue = get(key);
- final int flags = strict ? NashornCallSiteDescriptor.CALLSITE_STRICT : 0;
- set(key, value, flags);
+ final int scriptObjectFlags = strict ? NashornCallSiteDescriptor.CALLSITE_STRICT : 0;
+ set(key, value, scriptObjectFlags);
return oldValue;
}
@@ -1763,9 +1763,9 @@
* @param strict strict mode or not
*/
public void putAll(final Map<?, ?> otherMap, final boolean strict) {
- final int flags = strict ? NashornCallSiteDescriptor.CALLSITE_STRICT : 0;
+ final int scriptObjectFlags = strict ? NashornCallSiteDescriptor.CALLSITE_STRICT : 0;
for (final Map.Entry<?, ?> entry : otherMap.entrySet()) {
- set(entry.getKey(), entry.getValue(), flags);
+ set(entry.getKey(), entry.getValue(), scriptObjectFlags);
}
}
@@ -2046,7 +2046,7 @@
// Marks a property as declared and sets its value. Used as slow path for block-scoped LET and CONST
@SuppressWarnings("unused")
private void declareAndSet(final String key, final Object value) {
- final PropertyMap map = getMap();
+ final PropertyMap oldMap = getMap();
final FindProperty find = findProperty(key, false);
assert find != null;
@@ -2054,7 +2054,7 @@
assert property != null;
assert property.needsDeclaration();
- final PropertyMap newMap = map.replaceProperty(property, property.removeFlags(Property.NEEDS_DECLARATION));
+ final PropertyMap newMap = oldMap.replaceProperty(property, property.removeFlags(Property.NEEDS_DECLARATION));
setMap(newMap);
set(key, value, 0);
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ArrayData.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ArrayData.java Tue Oct 07 15:44:11 2014 -0700
@@ -536,7 +536,7 @@
final Class<?> widest = widestType(items);
ArrayData newData = convert(widest);
- long pos = newData.length();
+ long pos = newData.length;
for (final Object item : items) {
newData = newData.ensure(pos); //avoid sparse array
newData.set((int)pos++, item, strict);
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ArrayFilter.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ArrayFilter.java Tue Oct 07 15:44:11 2014 -0700
@@ -39,7 +39,7 @@
protected ArrayData underlying;
ArrayFilter(final ArrayData underlying) {
- super(underlying.length());
+ super(underlying.length);
this.underlying = underlying;
}
@@ -70,13 +70,13 @@
@Override
public void shiftLeft(final int by) {
underlying.shiftLeft(by);
- setLength(underlying.length());
+ setLength(underlying.length);
}
@Override
public ArrayData shiftRight(final int by) {
underlying = underlying.shiftRight(by);
- setLength(underlying.length());
+ setLength(underlying.length);
return this;
}
@@ -84,7 +84,7 @@
@Override
public ArrayData ensure(final long safeIndex) {
underlying = underlying.ensure(safeIndex);
- setLength(underlying.length());
+ setLength(underlying.length);
return this;
}
@@ -92,7 +92,7 @@
@Override
public ArrayData shrink(final long newLength) {
underlying = underlying.shrink(newLength);
- setLength(underlying.length());
+ setLength(underlying.length);
return this;
}
@@ -100,7 +100,7 @@
@Override
public ArrayData set(final int index, final Object value, final boolean strict) {
underlying = underlying.set(index, value, strict);
- setLength(underlying.length());
+ setLength(underlying.length);
return this;
}
@@ -108,7 +108,7 @@
@Override
public ArrayData set(final int index, final int value, final boolean strict) {
underlying = underlying.set(index, value, strict);
- setLength(underlying.length());
+ setLength(underlying.length);
return this;
}
@@ -116,7 +116,7 @@
@Override
public ArrayData set(final int index, final long value, final boolean strict) {
underlying = underlying.set(index, value, strict);
- setLength(underlying.length());
+ setLength(underlying.length);
return this;
}
@@ -124,7 +124,7 @@
@Override
public ArrayData set(final int index, final double value, final boolean strict) {
underlying = underlying.set(index, value, strict);
- setLength(underlying.length());
+ setLength(underlying.length);
return this;
}
@@ -189,28 +189,28 @@
@Override
public ArrayData delete(final int index) {
underlying = underlying.delete(index);
- setLength(underlying.length());
+ setLength(underlying.length);
return this;
}
@Override
public ArrayData delete(final long from, final long to) {
underlying = underlying.delete(from, to);
- setLength(underlying.length());
+ setLength(underlying.length);
return this;
}
@Override
public ArrayData convert(final Class<?> type) {
underlying = underlying.convert(type);
- setLength(underlying.length());
+ setLength(underlying.length);
return this;
}
@Override
public Object pop() {
final Object value = underlying.pop();
- setLength(underlying.length());
+ setLength(underlying.length);
return value;
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ContinuousArrayData.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ContinuousArrayData.java Tue Oct 07 15:44:11 2014 -0700
@@ -76,11 +76,11 @@
* array without reallocating, or if we are overwriting an already
* allocated element
*
- * @param index
+ * @param index index to check
* @return true if we don't need to do any array reallocation to fit an element at index
*/
public final boolean hasRoomFor(final int index) {
- return has(index) || (index == length() && ensure(index) == this);
+ return has(index) || (index == length && ensure(index) == this);
}
/**
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/DeletedArrayFilter.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/DeletedArrayFilter.java Tue Oct 07 15:44:11 2014 -0700
@@ -26,7 +26,6 @@
package jdk.nashorn.internal.runtime.arrays;
import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
-
import java.lang.reflect.Array;
import jdk.nashorn.internal.runtime.BitVector;
@@ -40,7 +39,7 @@
DeletedArrayFilter(final ArrayData underlying) {
super(underlying);
- this.deleted = new BitVector(underlying.length());
+ this.deleted = new BitVector(underlying.length);
}
@Override
@@ -80,25 +79,25 @@
@Override
public void shiftLeft(final int by) {
super.shiftLeft(by);
- deleted.shiftLeft(by, length());
+ deleted.shiftLeft(by, length);
}
@Override
public ArrayData shiftRight(final int by) {
super.shiftRight(by);
- deleted.shiftRight(by, length());
+ deleted.shiftRight(by, length);
return this;
}
@Override
public ArrayData ensure(final long safeIndex) {
- if (safeIndex >= SparseArrayData.MAX_DENSE_LENGTH && safeIndex >= length()) {
+ if (safeIndex >= SparseArrayData.MAX_DENSE_LENGTH && safeIndex >= length) {
return new SparseArrayData(this, safeIndex + 1);
}
super.ensure(safeIndex);
- deleted.resize(length());
+ deleted.resize(length);
return this;
}
@@ -106,7 +105,7 @@
@Override
public ArrayData shrink(final long newLength) {
super.shrink(newLength);
- deleted.resize(length());
+ deleted.resize(length);
return this;
}
@@ -147,7 +146,7 @@
@Override
public ArrayData delete(final int index) {
final long longIndex = ArrayIndex.toLongIndex(index);
- assert longIndex >= 0 && longIndex < length();
+ assert longIndex >= 0 && longIndex < length;
deleted.set(longIndex);
underlying.setEmpty(index);
return this;
@@ -155,7 +154,7 @@
@Override
public ArrayData delete(final long fromIndex, final long toIndex) {
- assert fromIndex >= 0 && fromIndex <= toIndex && toIndex < length();
+ assert fromIndex >= 0 && fromIndex <= toIndex && toIndex < length;
deleted.setRange(fromIndex, toIndex + 1);
underlying.setEmpty(fromIndex, toIndex);
return this;
@@ -163,7 +162,7 @@
@Override
public Object pop() {
- final long index = length() - 1;
+ final long index = length - 1;
if (super.has((int)index)) {
final boolean isDeleted = deleted.isSet(index);
@@ -180,7 +179,7 @@
final ArrayData newArray = underlying.slice(from, to);
final DeletedArrayFilter newFilter = new DeletedArrayFilter(newArray);
newFilter.getDeleted().copy(deleted);
- newFilter.getDeleted().shiftLeft(from, newFilter.length());
+ newFilter.getDeleted().shiftLeft(from, newFilter.length);
return newFilter;
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/DeletedRangeArrayFilter.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/DeletedRangeArrayFilter.java Tue Oct 07 15:44:11 2014 -0700
@@ -45,7 +45,7 @@
if(hi < SparseArrayData.MAX_DENSE_LENGTH || underlying instanceof SparseArrayData) {
return underlying;
}
- return new SparseArrayData(underlying, underlying.length());
+ return new SparseArrayData(underlying, underlying.length);
}
private boolean isEmpty() {
@@ -93,7 +93,7 @@
@Override
public ArrayData ensure(final long safeIndex) {
- if (safeIndex >= SparseArrayData.MAX_DENSE_LENGTH && safeIndex >= length()) {
+ if (safeIndex >= SparseArrayData.MAX_DENSE_LENGTH && safeIndex >= length) {
return new SparseArrayData(this, safeIndex + 1);
}
@@ -110,8 +110,9 @@
@Override
public ArrayData shiftRight(final int by) {
super.shiftRight(by);
- lo = Math.min(length(), lo + by);
- hi = Math.min(length() - 1, hi + by);
+ final long len = length;
+ lo = Math.min(len, lo + by);
+ hi = Math.min(len - 1, hi + by);
return isEmpty() ? getUnderlying() : this;
}
@@ -237,7 +238,7 @@
@Override
public Object pop() {
- final int index = (int)(length() - 1);
+ final int index = (int)length - 1;
if (super.has(index)) {
final boolean isDeleted = isDeleted(index);
final Object value = super.pop();
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/IntArrayData.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/IntArrayData.java Tue Oct 07 15:44:11 2014 -0700
@@ -105,13 +105,13 @@
@Override
public ArrayData copy() {
- return new IntArrayData(array.clone(), (int) length());
+ return new IntArrayData(array.clone(), (int)length);
}
@Override
public Object asArrayOfType(final Class<?> componentType) {
if (componentType == int.class) {
- return array.length == length() ? array.clone() : Arrays.copyOf(array, (int) length());
+ return array.length == length ? array.clone() : Arrays.copyOf(array, (int)length);
}
return super.asArrayOfType(componentType);
}
@@ -183,7 +183,7 @@
@Override
public ArrayData shiftRight(final int by) {
- final ArrayData newData = ensure(by + length() - 1);
+ final ArrayData newData = ensure(by + length - 1);
if (newData != this) {
newData.shiftRight(by);
return newData;
@@ -229,7 +229,7 @@
@Override
public ArrayData set(final int index, final int value, final boolean strict) {
array[index] = value;
- setLength(Math.max(index + 1, length()));
+ setLength(Math.max(index + 1, length));
return this;
}
@@ -238,7 +238,7 @@
public ArrayData set(final int index, final long value, final boolean strict) {
if (JSType.isRepresentableAsInt(value)) {
array[index] = JSType.toInt32(value);
- setLength(Math.max(index + 1, length()));
+ setLength(Math.max(index + 1, length));
return this;
}
@@ -249,7 +249,7 @@
public ArrayData set(final int index, final double value, final boolean strict) {
if (JSType.isRepresentableAsInt(value)) {
array[index] = (int)(long)value;
- setLength(Math.max(index + 1, length()));
+ setLength(Math.max(index + 1, length));
return this;
}
@@ -298,7 +298,7 @@
@Override
public boolean has(final int index) {
- return 0 <= index && index < length();
+ return 0 <= index && index < length;
}
@Override
@@ -313,11 +313,11 @@
@Override
public Object pop() {
- if (length() == 0) {
+ if (length == 0) {
return ScriptRuntime.UNDEFINED;
}
- final int newLength = (int) length() - 1;
+ final int newLength = (int)length - 1;
final int elem = array[newLength];
array[newLength] = 0;
setLength(newLength);
@@ -327,7 +327,7 @@
@Override
public ArrayData slice(final long from, final long to) {
- final long start = from < 0 ? from + length() : from;
+ final long start = from < 0 ? from + length : from;
final long newLength = to - start;
return new IntArrayData(Arrays.copyOfRange(array, (int)from, (int)to), (int)newLength);
@@ -335,18 +335,18 @@
@Override
public final ArrayData push(final boolean strict, final int item) {
- final long length = length();
- final ArrayData newData = ensure(length);
+ final long len = length;
+ final ArrayData newData = ensure(len);
if (newData == this) {
- array[(int)length] = item;
+ array[(int)len] = item;
return this;
}
- return newData.set((int)length, item, strict);
+ return newData.set((int)len, item, strict);
}
@Override
public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
- final long oldLength = length();
+ final long oldLength = length;
final long newLength = oldLength - removed + added;
if (newLength > SparseArrayData.MAX_DENSE_LENGTH && newLength > array.length) {
throw new UnsupportedOperationException();
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/LongArrayData.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/LongArrayData.java Tue Oct 07 15:44:11 2014 -0700
@@ -62,12 +62,12 @@
@Override
public ArrayData copy() {
- return new LongArrayData(array.clone(), (int)length());
+ return new LongArrayData(array.clone(), (int)length);
}
@Override
public Object[] asObjectArray() {
- return toObjectArray(array, (int)length());
+ return toObjectArray(array, (int)length);
}
private static Object[] toObjectArray(final long[] array, final int length) {
@@ -84,7 +84,7 @@
@Override
public Object asArrayOfType(final Class<?> componentType) {
if (componentType == long.class) {
- return array.length == length() ? array.clone() : Arrays.copyOf(array, (int)length());
+ return array.length == length ? array.clone() : Arrays.copyOf(array, (int)length);
}
return super.asArrayOfType(componentType);
}
@@ -105,11 +105,11 @@
if (type == Integer.class || type == Long.class) {
return this;
}
- final int length = (int) length();
+ final int len = (int)length;
if (type == Double.class) {
- return new NumberArrayData(LongArrayData.toDoubleArray(array, length), length);
+ return new NumberArrayData(LongArrayData.toDoubleArray(array, len), len);
}
- return new ObjectArrayData(LongArrayData.toObjectArray(array, length), length);
+ return new ObjectArrayData(LongArrayData.toObjectArray(array, len), len);
}
@Override
@@ -119,7 +119,7 @@
@Override
public ArrayData shiftRight(final int by) {
- final ArrayData newData = ensure(by + length() - 1);
+ final ArrayData newData = ensure(by + length - 1);
if (newData != this) {
newData.shiftRight(by);
return newData;
@@ -165,14 +165,14 @@
@Override
public ArrayData set(final int index, final int value, final boolean strict) {
array[index] = value;
- setLength(Math.max(index + 1, length()));
+ setLength(Math.max(index + 1, length));
return this;
}
@Override
public ArrayData set(final int index, final long value, final boolean strict) {
array[index] = value;
- setLength(Math.max(index + 1, length()));
+ setLength(Math.max(index + 1, length));
return this;
}
@@ -180,7 +180,7 @@
public ArrayData set(final int index, final double value, final boolean strict) {
if (JSType.isRepresentableAsLong(value)) {
array[index] = (long)value;
- setLength(Math.max(index + 1, length()));
+ setLength(Math.max(index + 1, length));
return this;
}
return convert(Double.class).set(index, value, strict);
@@ -256,7 +256,7 @@
@Override
public boolean has(final int index) {
- return 0 <= index && index < length();
+ return 0 <= index && index < length;
}
@Override
@@ -271,11 +271,11 @@
@Override
public Object pop() {
- if (length() == 0) {
+ if (length == 0) {
return ScriptRuntime.UNDEFINED;
}
- final int newLength = (int) (length() - 1);
+ final int newLength = (int)length - 1;
final long elem = array[newLength];
array[newLength] = 0;
setLength(newLength);
@@ -285,25 +285,25 @@
@Override
public ArrayData slice(final long from, final long to) {
- final long start = from < 0 ? from + length() : from;
+ final long start = from < 0 ? from + length : from;
final long newLength = to - start;
return new LongArrayData(Arrays.copyOfRange(array, (int)from, (int)to), (int)newLength);
}
@Override
public final ArrayData push(final boolean strict, final long item) {
- final long length = length();
- final ArrayData newData = ensure(length);
+ final long len = length;
+ final ArrayData newData = ensure(len);
if (newData == this) {
- array[(int)length] = item;
+ array[(int)len] = item;
return this;
}
- return newData.set((int)length, item, strict);
+ return newData.set((int)len, item, strict);
}
@Override
public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
- final long oldLength = length();
+ final long oldLength = length;
final long newLength = oldLength - removed + added;
if (newLength > SparseArrayData.MAX_DENSE_LENGTH && newLength > array.length) {
throw new UnsupportedOperationException();
@@ -353,7 +353,6 @@
final long elem = array[newLength];
array[newLength] = 0;
return elem;
- //return array[(int)--length];
}
@Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/NoTypeArrayData.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/NoTypeArrayData.java Tue Oct 07 15:44:11 2014 -0700
@@ -58,19 +58,19 @@
@Override
public ArrayData convert(final Class<?> type) {
- final long length = length();
+ final long len = length;
final ArrayData arrayData;
if (type == Long.class) {
- arrayData = new LongArrayData(new long[ArrayData.nextSize((int)length)], (int)length);
+ arrayData = new LongArrayData(new long[ArrayData.nextSize((int)len)], (int)len);
} else if (type == Double.class) {
- arrayData = new NumberArrayData(new double[ArrayData.nextSize((int)length)], (int)length);
+ arrayData = new NumberArrayData(new double[ArrayData.nextSize((int)len)], (int)len);
} else if (type == Integer.class) {
- arrayData = new IntArrayData(new int[ArrayData.nextSize((int)length)], (int)length);
+ arrayData = new IntArrayData(new int[ArrayData.nextSize((int)len)], (int)len);
} else {
assert !type.isPrimitive();
- arrayData = new ObjectArrayData(new Object[ArrayData.nextSize((int)length)], (int)length);
+ arrayData = new ObjectArrayData(new Object[ArrayData.nextSize((int)len)], (int)len);
}
- return length == 0 ? arrayData : new DeletedRangeArrayFilter(arrayData, 0, length - 1);
+ return length == 0 ? arrayData : new DeletedRangeArrayFilter(arrayData, 0, len - 1);
}
@Override
@@ -90,11 +90,11 @@
}
// Don't trample the shared EMPTY_ARRAY.
- if (length() == 0) {
- return new NoTypeArrayData(Math.max(safeIndex + 1, length()));
+ if (length == 0) {
+ return new NoTypeArrayData(Math.max(safeIndex + 1, length));
}
- setLength(Math.max(safeIndex + 1, length()));
+ setLength(Math.max(safeIndex + 1, length));
return this;
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/NumberArrayData.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/NumberArrayData.java Tue Oct 07 15:44:11 2014 -0700
@@ -61,12 +61,12 @@
@Override
public ArrayData copy() {
- return new NumberArrayData(array.clone(), (int) length());
+ return new NumberArrayData(array.clone(), (int)length);
}
@Override
public Object[] asObjectArray() {
- return toObjectArray(array, (int) length());
+ return toObjectArray(array, (int)length);
}
private static Object[] toObjectArray(final double[] array, final int length) {
@@ -82,7 +82,7 @@
@Override
public Object asArrayOfType(final Class<?> componentType) {
if(componentType == double.class) {
- return array.length == length() ? array.clone() : Arrays.copyOf(array, (int) length());
+ return array.length == length ? array.clone() : Arrays.copyOf(array, (int)length);
}
return super.asArrayOfType(componentType);
}
@@ -90,8 +90,8 @@
@Override
public ArrayData convert(final Class<?> type) {
if (type != Double.class && type != Integer.class && type != Long.class) {
- final int length = (int) length();
- return new ObjectArrayData(NumberArrayData.toObjectArray(array, length), length);
+ final int len = (int)length;
+ return new ObjectArrayData(NumberArrayData.toObjectArray(array, len), len);
}
return this;
}
@@ -103,7 +103,7 @@
@Override
public ArrayData shiftRight(final int by) {
- final ArrayData newData = ensure(by + length() - 1);
+ final ArrayData newData = ensure(by + length - 1);
if (newData != this) {
newData.shiftRight(by);
return newData;
@@ -148,21 +148,21 @@
@Override
public ArrayData set(final int index, final int value, final boolean strict) {
array[index] = value;
- setLength(Math.max(index + 1, length()));
+ setLength(Math.max(index + 1, length));
return this;
}
@Override
public ArrayData set(final int index, final long value, final boolean strict) {
array[index] = value;
- setLength(Math.max(index + 1, length()));
+ setLength(Math.max(index + 1, length));
return this;
}
@Override
public ArrayData set(final int index, final double value, final boolean strict) {
array[index] = value;
- setLength(Math.max(index + 1, length()));
+ setLength(Math.max(index + 1, length));
return this;
}
@@ -231,7 +231,7 @@
@Override
public boolean has(final int index) {
- return 0 <= index && index < length();
+ return 0 <= index && index < length;
}
@Override
@@ -246,11 +246,11 @@
@Override
public Object pop() {
- if (length() == 0) {
+ if (length == 0) {
return UNDEFINED;
}
- final int newLength = (int) (length() - 1);
+ final int newLength = (int)length - 1;
final double elem = array[newLength];
array[newLength] = 0;
setLength(newLength);
@@ -259,25 +259,25 @@
@Override
public ArrayData slice(final long from, final long to) {
- final long start = from < 0 ? from + length() : from;
+ final long start = from < 0 ? from + length : from;
final long newLength = to - start;
return new NumberArrayData(Arrays.copyOfRange(array, (int)from, (int)to), (int)newLength);
}
@Override
public final ArrayData push(final boolean strict, final double item) {
- final long length = length();
- final ArrayData newData = ensure(length);
+ final long len = length;
+ final ArrayData newData = ensure(len);
if (newData == this) {
- array[(int)length] = item;
+ array[(int)len] = item;
return this;
}
- return newData.set((int)length, item, strict);
+ return newData.set((int)len, item, strict);
}
@Override
public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
- final long oldLength = length();
+ final long oldLength = length;
final long newLength = oldLength - removed + added;
if (newLength > SparseArrayData.MAX_DENSE_LENGTH && newLength > array.length) {
throw new UnsupportedOperationException();
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java Tue Oct 07 15:44:11 2014 -0700
@@ -67,14 +67,14 @@
@Override
public Object[] asObjectArray() {
- return array.length == length() ? array.clone() : asObjectArrayCopy();
+ return array.length == length ? array.clone() : asObjectArrayCopy();
}
private Object[] asObjectArrayCopy() {
- final long l = length();
- assert l <= Integer.MAX_VALUE;
- final Object[] copy = new Object[(int)l];
- System.arraycopy(array, 0, copy, 0, (int)l);
+ final long len = length;
+ assert len <= Integer.MAX_VALUE;
+ final Object[] copy = new Object[(int)len];
+ System.arraycopy(array, 0, copy, 0, (int)len);
return copy;
}
@@ -90,7 +90,7 @@
@Override
public ArrayData shiftRight(final int by) {
- final ArrayData newData = ensure(by + length() - 1);
+ final ArrayData newData = ensure(by + length - 1);
if (newData != this) {
newData.shiftRight(by);
return newData;
@@ -122,28 +122,28 @@
@Override
public ArrayData set(final int index, final Object value, final boolean strict) {
array[index] = value;
- setLength(Math.max(index + 1, length()));
+ setLength(Math.max(index + 1, length));
return this;
}
@Override
public ArrayData set(final int index, final int value, final boolean strict) {
array[index] = value;
- setLength(Math.max(index + 1, length()));
+ setLength(Math.max(index + 1, length));
return this;
}
@Override
public ArrayData set(final int index, final long value, final boolean strict) {
array[index] = value;
- setLength(Math.max(index + 1, length()));
+ setLength(Math.max(index + 1, length));
return this;
}
@Override
public ArrayData set(final int index, final double value, final boolean strict) {
array[index] = value;
- setLength(Math.max(index + 1, length()));
+ setLength(Math.max(index + 1, length));
return this;
}
@@ -220,7 +220,7 @@
@Override
public boolean has(final int index) {
- return 0 <= index && index < length();
+ return 0 <= index && index < length;
}
@Override
@@ -273,11 +273,11 @@
@Override
public Object pop() {
- if (length() == 0) {
+ if (length == 0) {
return ScriptRuntime.UNDEFINED;
}
- final int newLength = (int) (length() - 1);
+ final int newLength = (int)length - 1;
final Object elem = array[newLength];
setEmpty(newLength);
setLength(newLength);
@@ -286,25 +286,25 @@
@Override
public ArrayData slice(final long from, final long to) {
- final long start = from < 0 ? from + length() : from;
+ final long start = from < 0 ? from + length : from;
final long newLength = to - start;
return new ObjectArrayData(Arrays.copyOfRange(array, (int)from, (int)to), (int)newLength);
}
@Override
public ArrayData push(final boolean strict, final Object item) {
- final long length = length();
- final ArrayData newData = ensure(length);
+ final long len = length;
+ final ArrayData newData = ensure(len);
if (newData == this) {
- array[(int)length] = item;
+ array[(int)len] = item;
return this;
}
- return newData.set((int)length, item, strict);
+ return newData.set((int)len, item, strict);
}
@Override
public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
- final long oldLength = length();
+ final long oldLength = length;
final long newLength = oldLength - removed + added;
if (newLength > SparseArrayData.MAX_DENSE_LENGTH && newLength > array.length) {
throw new UnsupportedOperationException();
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/SparseArrayData.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/SparseArrayData.java Tue Oct 07 15:44:11 2014 -0700
@@ -53,28 +53,28 @@
SparseArrayData(final ArrayData underlying, final long length, final TreeMap<Long, Object> sparseMap) {
super(length);
- assert underlying.length() <= length;
+ assert underlying.length <= length;
this.underlying = underlying;
- this.maxDenseLength = Math.max(MAX_DENSE_LENGTH, underlying.length());
+ this.maxDenseLength = Math.max(MAX_DENSE_LENGTH, underlying.length);
this.sparseMap = sparseMap;
}
@Override
public ArrayData copy() {
- return new SparseArrayData(underlying.copy(), length(), new TreeMap<>(sparseMap));
+ return new SparseArrayData(underlying.copy(), length, new TreeMap<>(sparseMap));
}
@Override
public Object[] asObjectArray() {
- final int length = (int) Math.min(length(), Integer.MAX_VALUE);
- final int underlyingLength = (int) Math.min(length, underlying.length());
- final Object[] objArray = new Object[length];
+ final int len = (int)Math.min(length, Integer.MAX_VALUE);
+ final int underlyingLength = (int)Math.min(len, underlying.length);
+ final Object[] objArray = new Object[len];
for (int i = 0; i < underlyingLength; i++) {
objArray[i] = underlying.getObject(i);
}
- Arrays.fill(objArray, underlyingLength, length, ScriptRuntime.UNDEFINED);
+ Arrays.fill(objArray, underlyingLength, len, ScriptRuntime.UNDEFINED);
for (final Map.Entry<Long, Object> entry : sparseMap.entrySet()) {
final long key = entry.getKey();
@@ -104,14 +104,14 @@
}
sparseMap = newSparseMap;
- setLength(Math.max(length() - by, 0));
+ setLength(Math.max(length - by, 0));
}
@Override
public ArrayData shiftRight(final int by) {
final TreeMap<Long, Object> newSparseMap = new TreeMap<>();
- if (underlying.length() + by > maxDenseLength) {
- for (long i = maxDenseLength - by; i < underlying.length(); i++) {
+ if (underlying.length + by > maxDenseLength) {
+ for (long i = maxDenseLength - by; i < underlying.length; i++) {
if (underlying.has((int) i)) {
newSparseMap.put(Long.valueOf(i + by), underlying.getObject((int) i));
}
@@ -127,23 +127,23 @@
}
sparseMap = newSparseMap;
- setLength(length() + by);
+ setLength(length + by);
return this;
}
@Override
public ArrayData ensure(final long safeIndex) {
- if (safeIndex < maxDenseLength && underlying.length() <= safeIndex) {
+ if (safeIndex < maxDenseLength && underlying.length <= safeIndex) {
underlying = underlying.ensure(safeIndex);
}
- setLength(Math.max(safeIndex + 1, length()));
+ setLength(Math.max(safeIndex + 1, length));
return this;
}
@Override
public ArrayData shrink(final long newLength) {
- if (newLength < underlying.length()) {
+ if (newLength < underlying.length) {
underlying = underlying.shrink(newLength);
underlying.setLength(newLength);
sparseMap.clear();
@@ -160,11 +160,11 @@
if (index >= 0 && index < maxDenseLength) {
ensure(index);
underlying = underlying.set(index, value, strict);
- setLength(Math.max(underlying.length(), length()));
+ setLength(Math.max(underlying.length, length));
} else {
final Long longIndex = indexToKey(index);
sparseMap.put(longIndex, value);
- setLength(Math.max(longIndex + 1, length()));
+ setLength(Math.max(longIndex + 1, length));
}
return this;
@@ -175,11 +175,11 @@
if (index >= 0 && index < maxDenseLength) {
ensure(index);
underlying = underlying.set(index, value, strict);
- setLength(Math.max(underlying.length(), length()));
+ setLength(Math.max(underlying.length, length));
} else {
final Long longIndex = indexToKey(index);
sparseMap.put(longIndex, value);
- setLength(Math.max(longIndex + 1, length()));
+ setLength(Math.max(longIndex + 1, length));
}
return this;
}
@@ -189,11 +189,11 @@
if (index >= 0 && index < maxDenseLength) {
ensure(index);
underlying = underlying.set(index, value, strict);
- setLength(Math.max(underlying.length(), length()));
+ setLength(Math.max(underlying.length, length));
} else {
final Long longIndex = indexToKey(index);
sparseMap.put(longIndex, value);
- setLength(Math.max(longIndex + 1, length()));
+ setLength(Math.max(longIndex + 1, length));
}
return this;
}
@@ -203,11 +203,11 @@
if (index >= 0 && index < maxDenseLength) {
ensure(index);
underlying = underlying.set(index, value, strict);
- setLength(Math.max(underlying.length(), length()));
+ setLength(Math.max(underlying.length, length));
} else {
final Long longIndex = indexToKey(index);
sparseMap.put(longIndex, value);
- setLength(Math.max(longIndex + 1, length()));
+ setLength(Math.max(longIndex + 1, length));
}
return this;
}
@@ -294,7 +294,7 @@
@Override
public boolean has(final int index) {
if (index >= 0 && index < maxDenseLength) {
- return index < underlying.length() && underlying.has(index);
+ return index < underlying.length && underlying.has(index);
}
return sparseMap.containsKey(indexToKey(index));
@@ -303,7 +303,7 @@
@Override
public ArrayData delete(final int index) {
if (index >= 0 && index < maxDenseLength) {
- if (index < underlying.length()) {
+ if (index < underlying.length) {
underlying = underlying.delete(index);
}
} else {
@@ -315,8 +315,8 @@
@Override
public ArrayData delete(final long fromIndex, final long toIndex) {
- if (fromIndex < maxDenseLength && fromIndex < underlying.length()) {
- underlying = underlying.delete(fromIndex, Math.min(toIndex, underlying.length() - 1));
+ if (fromIndex < maxDenseLength && fromIndex < underlying.length) {
+ underlying = underlying.delete(fromIndex, Math.min(toIndex, underlying.length - 1));
}
if (toIndex >= maxDenseLength) {
sparseMap.subMap(fromIndex, true, toIndex, true).clear();
@@ -336,30 +336,30 @@
@Override
public Object pop() {
- if (length() == 0) {
+ if (length == 0) {
return ScriptRuntime.UNDEFINED;
}
- if (length() == underlying.length()) {
+ if (length == underlying.length) {
final Object result = underlying.pop();
- setLength(underlying.length());
+ setLength(underlying.length);
return result;
}
- setLength(length() - 1);
- final Long key = Long.valueOf(length());
+ setLength(length - 1);
+ final Long key = Long.valueOf(length);
return sparseMap.containsKey(key) ? sparseMap.remove(key) : ScriptRuntime.UNDEFINED;
}
@Override
public ArrayData slice(final long from, final long to) {
- assert to <= length();
- final long start = from < 0 ? (from + length()) : from;
+ assert to <= length;
+ final long start = from < 0 ? (from + length) : from;
final long newLength = to - start;
if (start >= 0 && to <= maxDenseLength) {
- if (newLength <= underlying.length()) {
+ if (newLength <= underlying.length) {
return underlying.slice(from, to);
}
- return underlying.slice(from, to).ensure(newLength - 1).delete(underlying.length(), newLength);
+ return underlying.slice(from, to).ensure(newLength - 1).delete(underlying.length, newLength);
}
ArrayData sliced = EMPTY_ARRAY;
@@ -369,13 +369,13 @@
sliced = sliced.set((int)(i - start), getObject((int)i), false);
}
}
- assert sliced.length() == newLength;
+ assert sliced.length == newLength;
return sliced;
}
@Override
public long nextIndex(final long index) {
- if (index < underlying.length() - 1) {
+ if (index < underlying.length - 1) {
return underlying.nextIndex(index);
}
@@ -383,6 +383,6 @@
if (nextKey != null) {
return nextKey;
}
- return length();
+ return length;
}
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/TypedArrayData.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/TypedArrayData.java Tue Oct 07 15:44:11 2014 -0700
@@ -54,11 +54,11 @@
}
/**
- * Length in elements. Accessed from {@code ArrayBufferView}
+ * Length in number of elements. Accessed from {@code ArrayBufferView}
* @return element length
*/
public final int getElementLength() {
- return (int)length();
+ return (int)length;
}
/**
@@ -119,7 +119,7 @@
@Override
public final boolean has(final int index) {
- return 0 <= index && index < length();
+ return 0 <= index && index < length;
}
@Override
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/UndefinedArrayFilter.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/UndefinedArrayFilter.java Tue Oct 07 15:44:11 2014 -0700
@@ -26,7 +26,6 @@
package jdk.nashorn.internal.runtime.arrays;
import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
-
import java.lang.reflect.Array;
import jdk.nashorn.internal.runtime.BitVector;
import jdk.nashorn.internal.runtime.UnwarrantedOptimismException;
@@ -41,7 +40,7 @@
UndefinedArrayFilter(final ArrayData underlying) {
super(underlying);
- this.undefined = new BitVector(underlying.length());
+ this.undefined = new BitVector(underlying.length);
}
@Override
@@ -81,25 +80,25 @@
@Override
public void shiftLeft(final int by) {
super.shiftLeft(by);
- undefined.shiftLeft(by, length());
+ undefined.shiftLeft(by, length);
}
@Override
public ArrayData shiftRight(final int by) {
super.shiftRight(by);
- undefined.shiftRight(by, length());
+ undefined.shiftRight(by, length);
return this;
}
@Override
public ArrayData ensure(final long safeIndex) {
- if (safeIndex >= SparseArrayData.MAX_DENSE_LENGTH && safeIndex >= length()) {
+ if (safeIndex >= SparseArrayData.MAX_DENSE_LENGTH && safeIndex >= length) {
return new SparseArrayData(this, safeIndex + 1);
}
super.ensure(safeIndex);
- undefined.resize(length());
+ undefined.resize(length);
return this;
}
@@ -107,7 +106,7 @@
@Override
public ArrayData shrink(final long newLength) {
super.shrink(newLength);
- undefined.resize(length());
+ undefined.resize(length);
return this;
}
@@ -217,7 +216,7 @@
@Override
public Object pop() {
- final long index = length() - 1;
+ final long index = length - 1;
if (super.has((int)index)) {
final boolean isUndefined = undefined.isSet(index);
@@ -234,7 +233,7 @@
final ArrayData newArray = underlying.slice(from, to);
final UndefinedArrayFilter newFilter = new UndefinedArrayFilter(newArray);
newFilter.getUndefined().copy(undefined);
- newFilter.getUndefined().shiftLeft(from, newFilter.length());
+ newFilter.getUndefined().shiftLeft(from, newFilter.length);
return newFilter;
}
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/RegExpFactory.java Fri Oct 03 13:00:21 2014 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/RegExpFactory.java Tue Oct 07 15:44:11 2014 -0700
@@ -25,6 +25,9 @@
package jdk.nashorn.internal.runtime.regexp;
+import java.util.Collections;
+import java.util.Set;
+import java.util.WeakHashMap;
import jdk.nashorn.internal.runtime.ParserException;
import jdk.nashorn.internal.runtime.options.Options;
@@ -39,6 +42,15 @@
private final static String JDK = "jdk";
private final static String JONI = "joni";
+ /** Weak cache of already validated regexps - when reparsing, we don't, for example
+ * need to recompile (reverify) all regexps that have previously been parsed by this
+ * RegExpFactory in a previous compilation. This saves significant time in e.g. avatar
+ * startup */
+ private static final Set<String> VALID_CACHE_SET =
+ Collections.newSetFromMap(
+ Collections.synchronizedMap(
+ new WeakHashMap<String, Boolean>()));
+
static {
final String impl = Options.getStringProperty("nashorn.regexp.impl", JONI);
switch (impl) {
@@ -88,7 +100,9 @@
*/
// @SuppressWarnings({"unused"})
public static void validate(final String pattern, final String flags) throws ParserException {
- instance.compile(pattern, flags);
+ if (VALID_CACHE_SET.add(pattern + flags)) {
+ instance.compile(pattern, flags);
+ }
}
/**