# HG changeset patch
# User asaha
# Date 1302643383 25200
# Node ID e142148d8b5444e07602809dfbedbced25be37a5
# Parent 557bd9b5d92f1517540dd329875b5c2dfa10be7b# Parent 9128eace50f5e0624d81d7621cdfb9abd5260d78
Merge
diff -r 557bd9b5d92f -r e142148d8b54 make/com/sun/java/pack/Makefile
--- a/make/com/sun/java/pack/Makefile Fri Apr 08 10:31:14 2011 -0700
+++ b/make/com/sun/java/pack/Makefile Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 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
@@ -56,10 +56,6 @@
vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)
-
-
-
-
ifeq ($(STANDALONE),true)
ZIPOBJDIR = $(OUTPUTDIR)/tmp/sun/java.util.zip/zip/$(OBJDIRNAME)
@@ -131,8 +127,9 @@
pack200-tool:
$(call make-launcher, pack200, com.sun.java.util.jar.pack.Driver, , --pack)
+# ignore mapfile for non-product binary
unpacker:
- $(MAKE) $(UNPACK_EXE) STANDALONE=true LDMAPFLAGS_OPT= LDMAPFLAGS_DBG=
+ $(MAKE) $(UNPACK_EXE) STANDALONE=true LDMAPFLAGS_DBG=
ifeq ($(PLATFORM), windows)
IMVERSIONVALUE=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER)
@@ -147,8 +144,14 @@
$(ECHO) "Resource files not required for Unix"
endif
+# Mapfile-vers.gmk, does not copy over the mapfile-vers-unpack200, when
+# the make utiliy is re-invoked, as in this case. In order to workaround
+# this special case, the mapfile required for the unpack200 command, is
+# explicitly copied over to the expected location.
$(UNPACK_EXE): $(UNPACK_EXE_FILES_o) updatefiles winres
$(prep-target)
+ $(RM) $(TEMPDIR)/mapfile-vers
+ $(CP) mapfile-vers-unpack200 $(TEMPDIR)/mapfile-vers
$(LINKER) $(LDDFLAGS) $(UNPACK_EXE_FILES_o) $(RES) $(LIBCXX) $(LDOUTPUT)$(TEMPDIR)/unpack200$(EXE_SUFFIX)
ifdef MT
$(MT) /manifest $(OBJDIR)/unpack200$(EXE_SUFFIX).manifest /outputresource:$(TEMPDIR)/unpack200$(EXE_SUFFIX);#1
diff -r 557bd9b5d92f -r e142148d8b54 make/com/sun/java/pack/mapfile-vers-unpack200
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/com/sun/java/pack/mapfile-vers-unpack200 Tue Apr 12 14:23:03 2011 -0700
@@ -0,0 +1,31 @@
+#
+# Copyright (c) 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.
+#
+
+# Define library interface.
+
+SUNWprivate_1.1 {
+ local:
+ *;
+};
diff -r 557bd9b5d92f -r e142148d8b54 make/common/Mapfile-vers.gmk
--- a/make/common/Mapfile-vers.gmk Fri Apr 08 10:31:14 2011 -0700
+++ b/make/common/Mapfile-vers.gmk Tue Apr 12 14:23:03 2011 -0700
@@ -52,8 +52,8 @@
endif
# If we are re-ordering functions in this solaris library, we need to make
- # sure that -xF is added to the compile lines. This option is critical and
- # enables the functions to be reordered.
+ # sure that -xF is added to the compile lines. This option is critical and
+ # enables the functions to be reordered.
ifdef FILES_reorder
CFLAGS_OPT += -xF
CXXFLAGS_OPT += -xF
@@ -76,7 +76,6 @@
endif # PLATFORM
-
ifeq ($(PLATFORM), linux)
ifeq ($(VARIANT), OPT)
diff -r 557bd9b5d92f -r e142148d8b54 make/common/Program.gmk
--- a/make/common/Program.gmk Fri Apr 08 10:31:14 2011 -0700
+++ b/make/common/Program.gmk Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 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
@@ -55,6 +55,11 @@
program: $(ACTUAL_PROGRAM)
+# reuse the mapfiles in the launcher's directory, the same should
+# be applicable to the tool launchers as well.
+FILES_m = $(BUILDDIR)/java/main/java/mapfile-$(ARCH)
+include $(BUILDDIR)/common/Mapfile-vers.gmk
+
include $(JDK_TOPDIR)/make/common/Rules.gmk
ifdef NEVER_ACT_AS_SERVER_CLASS_MACHINE
diff -r 557bd9b5d92f -r e142148d8b54 make/java/java/Makefile
--- a/make/java/java/Makefile Fri Apr 08 10:31:14 2011 -0700
+++ b/make/java/java/Makefile Tue Apr 12 14:23:03 2011 -0700
@@ -198,10 +198,12 @@
#
# What to link?
+# On Windows, shell32 is not normally required and so it is delay loaded.
#
ifeq ($(PLATFORM),windows)
OTHER_LDLIBS += $(JVMLIB) -libpath:$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) fdlibm.lib \
- -libpath:$(OBJDIR)/../../../verify/$(OBJDIRNAME) verify.lib
+ -libpath:$(OBJDIR)/../../../verify/$(OBJDIRNAME) verify.lib \
+ shell32.lib delayimp.lib /DELAYLOAD:shell32.dll
else
OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) $(LIBNSL) -ldl \
-L$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) -lfdlibm.$(ARCH)
diff -r 557bd9b5d92f -r e142148d8b54 make/java/main/java/Makefile
--- a/make/java/main/java/Makefile Fri Apr 08 10:31:14 2011 -0700
+++ b/make/java/main/java/Makefile Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1996, 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
@@ -61,5 +61,4 @@
ifeq ($(PLATFORM), solaris)
LDFLAGS += -R$(OPENWIN_LIB)
-LDFLAGS += -M mapfile-$(ARCH)
endif
diff -r 557bd9b5d92f -r e142148d8b54 make/java/main/java/mapfile-amd64
--- a/make/java/main/java/mapfile-amd64 Fri Apr 08 10:31:14 2011 -0700
+++ b/make/java/main/java/mapfile-amd64 Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 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
@@ -27,7 +27,7 @@
# interested in declaring a version, simply scoping the file is sufficient.
#
-{
+SUNWprivate_1.1 {
global:
main; # Provides basic adb symbol offsets
environ; # Public symbols and required by Java run time
diff -r 557bd9b5d92f -r e142148d8b54 make/java/main/java/mapfile-i586
--- a/make/java/main/java/mapfile-i586 Fri Apr 08 10:31:14 2011 -0700
+++ b/make/java/main/java/mapfile-i586 Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 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
@@ -27,7 +27,7 @@
# interested in declaring a version, simply scoping the file is sufficient.
#
-{
+SUNWprivate_1.1 {
global:
main; # Provides basic adb symbol offsets
environ; # Public symbols and required by Java run time
diff -r 557bd9b5d92f -r e142148d8b54 make/java/main/java/mapfile-sparc
--- a/make/java/main/java/mapfile-sparc Fri Apr 08 10:31:14 2011 -0700
+++ b/make/java/main/java/mapfile-sparc Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 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
@@ -26,7 +26,7 @@
# interested in declaring a version, simply scoping the file is sufficient.
#
-{
+SUNWprivate_1.1 {
global:
main; # Provides basic adb symbol offsets
environ; # Public symbols and required by Java run time
diff -r 557bd9b5d92f -r e142148d8b54 make/java/main/java/mapfile-sparcv9
--- a/make/java/main/java/mapfile-sparcv9 Fri Apr 08 10:31:14 2011 -0700
+++ b/make/java/main/java/mapfile-sparcv9 Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 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
@@ -28,7 +28,7 @@
# interested in declaring a version, simply scoping the file is sufficient.
#
-{
+SUNWprivate_1.1 {
global:
main; # Provides basic adb symbol offsets
environ; # Public symbols and required by Java run time
diff -r 557bd9b5d92f -r e142148d8b54 make/java/management/Makefile
--- a/make/java/management/Makefile Fri Apr 08 10:31:14 2011 -0700
+++ b/make/java/management/Makefile Tue Apr 12 14:23:03 2011 -0700
@@ -86,7 +86,8 @@
-I$(SHARE_SRC)/native/sun/management
ifeq ($(PLATFORM),windows)
- OTHER_LDLIBS += $(JVMLIB)
+ # Need process status helper API (psapi) on Windows
+ OTHER_LDLIBS += $(JVMLIB) psapi.lib
endif
#
diff -r 557bd9b5d92f -r e142148d8b54 make/mksample/Makefile
--- a/make/mksample/Makefile Fri Apr 08 10:31:14 2011 -0700
+++ b/make/mksample/Makefile Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 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
@@ -38,7 +38,7 @@
endif
SUBDIRS =
-SUBDIRS_misc = nio scripting nbproject
+SUBDIRS_misc = nio scripting nbproject forkjoin
SUBDIRS_enterprise = $(WEBSERVICES_SUBDIR)
SUBDIRS_management = jmx
diff -r 557bd9b5d92f -r e142148d8b54 make/mksample/forkjoin/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/mksample/forkjoin/Makefile Tue Apr 12 14:23:03 2011 -0700
@@ -0,0 +1,41 @@
+#
+# Copyright (c) 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.
+#
+
+#
+# Makefile for building all the samples under the forkjoin subdirectory.
+#
+
+BUILDDIR = ../..
+PRODUCT = java
+include $(BUILDDIR)/common/Defs.gmk
+
+SUBDIRS = mergesort
+include $(BUILDDIR)/common/Subdirs.gmk
+
+all build clean clobber::
+ $(SUBDIRS-loop)
+
+clobber clean ::
+ $(RM) -r $(SAMPLEDIR)/forkjoin
diff -r 557bd9b5d92f -r e142148d8b54 make/mksample/forkjoin/mergesort/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/mksample/forkjoin/mergesort/Makefile Tue Apr 12 14:23:03 2011 -0700
@@ -0,0 +1,51 @@
+#
+# Copyright (c) 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.
+#
+
+#
+# Makefile for the forkjoin/mergesort sample code
+#
+
+BUILDDIR = ../../..
+
+PRODUCT = java
+
+include $(BUILDDIR)/common/Defs.gmk
+
+SAMPLE_SRC_DIR = $(SHARE_SRC)/sample/forkjoin/mergesort
+SAMPLE_DST_DIR = $(SAMPLEDIR)/forkjoin/mergesort
+
+SAMPLE_FILES = \
+ $(SAMPLE_DST_DIR)/MergeDemo.java \
+ $(SAMPLE_DST_DIR)/MergeSort.java
+
+all build: $(SAMPLE_FILES)
+
+$(SAMPLE_DST_DIR)/%: $(SAMPLE_SRC_DIR)/%
+ $(install-file)
+
+clean clobber:
+ $(RM) -r $(SAMPLE_DST_DIR)
+
+.PHONY: all build clean clobber
diff -r 557bd9b5d92f -r e142148d8b54 make/mksample/nio/Makefile
--- a/make/mksample/nio/Makefile Fri Apr 08 10:31:14 2011 -0700
+++ b/make/mksample/nio/Makefile Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 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
@@ -31,7 +31,7 @@
PRODUCT = java
include $(BUILDDIR)/common/Defs.gmk
-SUBDIRS = file multicast server
+SUBDIRS = chatserver file multicast server
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
diff -r 557bd9b5d92f -r e142148d8b54 make/mksample/nio/chatserver/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/mksample/nio/chatserver/Makefile Tue Apr 12 14:23:03 2011 -0700
@@ -0,0 +1,56 @@
+#
+# Copyright (c) 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.
+#
+
+#
+# Makefile for the nio/chatserver sample code
+#
+
+BUILDDIR = ../../..
+
+PRODUCT = java
+
+include $(BUILDDIR)/common/Defs.gmk
+
+SAMPLE_SRC_DIR = $(SHARE_SRC)/sample/nio/chatserver
+SAMPLE_DST_DIR = $(SAMPLEDIR)/nio/chatserver
+
+SAMPLE_FILES = \
+ $(SAMPLE_DST_DIR)/ChatServer.java \
+ $(SAMPLE_DST_DIR)/Client.java \
+ $(SAMPLE_DST_DIR)/ClientReader.java \
+ $(SAMPLE_DST_DIR)/DataReader.java \
+ $(SAMPLE_DST_DIR)/MessageReader.java \
+ $(SAMPLE_DST_DIR)/NameReader.java \
+ $(SAMPLE_DST_DIR)/README.txt
+
+all build: $(SAMPLE_FILES)
+
+$(SAMPLE_DST_DIR)/%: $(SAMPLE_SRC_DIR)/%
+ $(install-file)
+
+clean clobber:
+ $(RM) -r $(SAMPLE_DST_DIR)
+
+.PHONY: all build clean clobber
diff -r 557bd9b5d92f -r e142148d8b54 src/share/bin/jli_util.h
--- a/src/share/bin/jli_util.h Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/bin/jli_util.h Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,6 @@
void JLI_MemFree(void *ptr);
int JLI_StrCCmp(const char *s1, const char* s2);
-
#define JLI_StrLen(p1) strlen((p1))
#define JLI_StrChr(p1, p2) strchr((p1), (p2))
#define JLI_StrRChr(p1, p2) strrchr((p1), (p2))
@@ -48,6 +47,7 @@
#define JLI_StrSpn(p1, p2) strspn((p1), (p2))
#define JLI_StrCSpn(p1, p2) strcspn((p1), (p2))
#define JLI_StrPBrk(p1, p2) strpbrk((p1), (p2))
+#define JLI_StrTok(p1, p2) strtok((p1), (p2))
/* On Windows lseek() is in io.h rather than the location dictated by POSIX. */
#ifdef _WIN32
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/lang/Character.java
--- a/src/share/classes/java/lang/Character.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/lang/Character.java Tue Apr 12 14:23:03 2011 -0700
@@ -4184,9 +4184,11 @@
aliases.put("AVST", AVESTAN);
aliases.put("BALI", BALINESE);
aliases.put("BAMU", BAMUM);
+ aliases.put("BATK", BATAK);
aliases.put("BENG", BENGALI);
aliases.put("BOPO", BOPOMOFO);
aliases.put("BRAI", BRAILLE);
+ aliases.put("BRAH", BRAHMI);
aliases.put("BUGI", BUGINESE);
aliases.put("BUHD", BUHID);
aliases.put("CANS", CANADIAN_ABORIGINAL);
@@ -4230,6 +4232,7 @@
aliases.put("LISU", LISU);
aliases.put("LYCI", LYCIAN);
aliases.put("LYDI", LYDIAN);
+ aliases.put("MAND", MANDAIC);
aliases.put("MLYM", MALAYALAM);
aliases.put("MONG", MONGOLIAN);
aliases.put("MTEI", MEETEI_MAYEK);
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/lang/reflect/AccessibleObject.java
--- a/src/share/classes/java/lang/reflect/AccessibleObject.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/lang/reflect/AccessibleObject.java Tue Apr 12 14:23:03 2011 -0700
@@ -26,6 +26,7 @@
package java.lang.reflect;
import java.security.AccessController;
+import sun.reflect.Reflection;
import sun.reflect.ReflectionFactory;
import java.lang.annotation.Annotation;
@@ -201,4 +202,73 @@
public Annotation[] getDeclaredAnnotations() {
throw new AssertionError("All subclasses should override this method");
}
+
+
+ // Shared access checking logic.
+
+ // For non-public members or members in package-private classes,
+ // it is necessary to perform somewhat expensive security checks.
+ // If the security check succeeds for a given class, it will
+ // always succeed (it is not affected by the granting or revoking
+ // of permissions); we speed up the check in the common case by
+ // remembering the last Class for which the check succeeded.
+ //
+ // The simple security check for Constructor is to see if
+ // the caller has already been seen, verified, and cached.
+ // (See also Class.newInstance(), which uses a similar method.)
+ //
+ // A more complicated security check cache is needed for Method and Field
+ // The cache can be either null (empty cache), a 2-array of {caller,target},
+ // or a caller (with target implicitly equal to this.clazz).
+ // In the 2-array case, the target is always different from the clazz.
+ volatile Object securityCheckCache;
+
+ void checkAccess(Class> caller, Class> clazz, Object obj, int modifiers)
+ throws IllegalAccessException
+ {
+ if (caller == clazz) { // quick check
+ return; // ACCESS IS OK
+ }
+ Object cache = securityCheckCache; // read volatile
+ Class> targetClass = clazz;
+ if (obj != null
+ && Modifier.isProtected(modifiers)
+ && ((targetClass = obj.getClass()) != clazz)) {
+ // Must match a 2-list of { caller, targetClass }.
+ if (cache instanceof Class[]) {
+ Class>[] cache2 = (Class>[]) cache;
+ if (cache2[1] == targetClass &&
+ cache2[0] == caller) {
+ return; // ACCESS IS OK
+ }
+ // (Test cache[1] first since range check for [1]
+ // subsumes range check for [0].)
+ }
+ } else if (cache == caller) {
+ // Non-protected case (or obj.class == this.clazz).
+ return; // ACCESS IS OK
+ }
+
+ // If no return, fall through to the slow path.
+ slowCheckMemberAccess(caller, clazz, obj, modifiers, targetClass);
+ }
+
+ // Keep all this slow stuff out of line:
+ void slowCheckMemberAccess(Class> caller, Class> clazz, Object obj, int modifiers,
+ Class> targetClass)
+ throws IllegalAccessException
+ {
+ Reflection.ensureMemberAccess(caller, clazz, obj, modifiers);
+
+ // Success: Update the cache.
+ Object cache = ((targetClass == clazz)
+ ? caller
+ : new Class>[] { caller, targetClass });
+
+ // Note: The two cache elements are not volatile,
+ // but they are effectively final. The Java memory model
+ // guarantees that the initializing stores for the cache
+ // elements will occur before the volatile write.
+ securityCheckCache = cache; // write volatile
+ }
}
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/lang/reflect/Constructor.java
--- a/src/share/classes/java/lang/reflect/Constructor.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/lang/reflect/Constructor.java Tue Apr 12 14:23:03 2011 -0700
@@ -74,14 +74,6 @@
private byte[] annotations;
private byte[] parameterAnnotations;
- // For non-public members or members in package-private classes,
- // it is necessary to perform somewhat expensive security checks.
- // If the security check succeeds for a given class, it will
- // always succeed (it is not affected by the granting or revoking
- // of permissions); we speed up the check in the common case by
- // remembering the last Class for which the check succeeded.
- private volatile Class> securityCheckCache;
-
// Generics infrastructure
// Accessor for factory
private GenericsFactory getFactory() {
@@ -495,7 +487,7 @@
* this object represents
*
* @exception IllegalAccessException if this {@code Constructor} object
- * enforces Java language access control and the underlying
+ * is enforcing Java language access control and the underlying
* constructor is inaccessible.
* @exception IllegalArgumentException if the number of actual
* and formal parameters differ; if an unwrapping
@@ -518,16 +510,17 @@
if (!override) {
if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) {
Class> caller = Reflection.getCallerClass(2);
- if (securityCheckCache != caller) {
- Reflection.ensureMemberAccess(caller, clazz, null, modifiers);
- securityCheckCache = caller;
- }
+
+ checkAccess(caller, clazz, null, modifiers);
}
}
if ((clazz.getModifiers() & Modifier.ENUM) != 0)
throw new IllegalArgumentException("Cannot reflectively create enum objects");
- if (constructorAccessor == null) acquireConstructorAccessor();
- return (T) constructorAccessor.newInstance(initargs);
+ ConstructorAccessor ca = constructorAccessor; // read volatile
+ if (ca == null) {
+ ca = acquireConstructorAccessor();
+ }
+ return (T) ca.newInstance(initargs);
}
/**
@@ -560,18 +553,20 @@
// ConstructorAccessor for a given Constructor. However, avoiding
// synchronization will probably make the implementation more
// scalable.
- private void acquireConstructorAccessor() {
+ private ConstructorAccessor acquireConstructorAccessor() {
// First check to see if one has been created yet, and take it
// if so.
ConstructorAccessor tmp = null;
if (root != null) tmp = root.getConstructorAccessor();
if (tmp != null) {
constructorAccessor = tmp;
- return;
+ } else {
+ // Otherwise fabricate one and propagate it up to the root
+ tmp = reflectionFactory.newConstructorAccessor(this);
+ setConstructorAccessor(tmp);
}
- // Otherwise fabricate one and propagate it up to the root
- tmp = reflectionFactory.newConstructorAccessor(this);
- setConstructorAccessor(tmp);
+
+ return tmp;
}
// Returns ConstructorAccessor for this Constructor object, not
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/lang/reflect/Field.java
--- a/src/share/classes/java/lang/reflect/Field.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/lang/reflect/Field.java Tue Apr 12 14:23:03 2011 -0700
@@ -79,11 +79,6 @@
// potentially many Field objects pointing to it.)
private Field root;
- // More complicated security check cache needed here than for
- // Class.newInstance() and Constructor.newInstance()
- private Class> securityCheckCache;
- private Class> securityCheckTargetClassCache;
-
// Generics infrastructure
private String getGenericSignature() {return signature;}
@@ -340,7 +335,7 @@
* instance of the class or interface declaring the underlying
* field, the method throws an {@code IllegalArgumentException}.
*
- *
If this {@code Field} object enforces Java language access control, and
+ *
If this {@code Field} object is enforcing Java language access control, and
* the underlying field is inaccessible, the method throws an
* {@code IllegalAccessException}.
* If the underlying field is static, the class that declared the
@@ -360,8 +355,9 @@
* {@code obj}; primitive values are wrapped in an appropriate
* object before being returned
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof).
@@ -383,8 +379,9 @@
* from
* @return the value of the {@code boolean} field
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
@@ -410,8 +407,9 @@
* from
* @return the value of the {@code byte} field
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
@@ -439,8 +437,9 @@
* from
* @return the value of the field converted to type {@code char}
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
@@ -468,8 +467,9 @@
* from
* @return the value of the field converted to type {@code short}
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
@@ -497,8 +497,9 @@
* from
* @return the value of the field converted to type {@code int}
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
@@ -526,8 +527,9 @@
* from
* @return the value of the field converted to type {@code long}
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
@@ -555,8 +557,9 @@
* from
* @return the value of the field converted to type {@code float}
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
@@ -584,8 +587,9 @@
* from
* @return the value of the field converted to type {@code double}
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
@@ -621,14 +625,14 @@
* an instance of the class or interface declaring the underlying
* field, the method throws an {@code IllegalArgumentException}.
*
- *
If this {@code Field} object enforces Java language access control, and
+ *
If this {@code Field} object is enforcing Java language access control, and
* the underlying field is inaccessible, the method throws an
* {@code IllegalAccessException}.
*
*
If the underlying field is final, the method throws an
- * {@code IllegalAccessException} unless
- * {@code setAccessible(true)} has succeeded for this field
- * and this field is non-static. Setting a final field in this way
+ * {@code IllegalAccessException} unless {@code setAccessible(true)}
+ * has succeeded for this {@code Field} object
+ * and the field is non-static. Setting a final field in this way
* is meaningful only during deserialization or reconstruction of
* instances of classes with blank final fields, before they are
* made available for access by other parts of a program. Use in
@@ -658,8 +662,9 @@
* @param value the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
@@ -686,8 +691,9 @@
* @param z the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
@@ -715,8 +721,9 @@
* @param b the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
@@ -744,8 +751,9 @@
* @param c the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
@@ -773,8 +781,9 @@
* @param s the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
@@ -802,8 +811,9 @@
* @param i the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
@@ -831,8 +841,9 @@
* @param l the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
@@ -860,8 +871,9 @@
* @param f the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
@@ -889,8 +901,9 @@
* @param d the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * is enforcing Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
@@ -936,6 +949,7 @@
tmp = reflectionFactory.newFieldAccessor(this, overrideFinalCheck);
setFieldAccessor(tmp, overrideFinalCheck);
}
+
return tmp;
}
@@ -965,21 +979,8 @@
if (!override) {
if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) {
Class> caller = Reflection.getCallerClass(4);
- Class> targetClass = ((obj == null || !Modifier.isProtected(modifiers))
- ? clazz
- : obj.getClass());
- synchronized (this) {
- if ((securityCheckCache == caller)
- && (securityCheckTargetClassCache == targetClass)) {
- return;
- }
- }
- Reflection.ensureMemberAccess(caller, clazz, obj, modifiers);
- synchronized (this) {
- securityCheckCache = caller;
- securityCheckTargetClassCache = targetClass;
- }
+ checkAccess(caller, clazz, obj, modifiers);
}
}
}
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/lang/reflect/Method.java
--- a/src/share/classes/java/lang/reflect/Method.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/lang/reflect/Method.java Tue Apr 12 14:23:03 2011 -0700
@@ -83,11 +83,6 @@
// potentially many Method objects pointing to it.)
private Method root;
- // More complicated security check cache needed here than for
- // Class.newInstance() and Constructor.newInstance()
- private Class> securityCheckCache;
- private Class> securityCheckTargetClassCache;
-
// Generics infrastructure
private String getGenericSignature() {return signature;}
@@ -402,28 +397,28 @@
*/
public String toString() {
try {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
int mod = getModifiers() & Modifier.methodModifiers();
if (mod != 0) {
- sb.append(Modifier.toString(mod) + " ");
+ sb.append(Modifier.toString(mod)).append(' ');
}
- sb.append(Field.getTypeName(getReturnType()) + " ");
- sb.append(Field.getTypeName(getDeclaringClass()) + ".");
- sb.append(getName() + "(");
+ sb.append(Field.getTypeName(getReturnType())).append(' ');
+ sb.append(Field.getTypeName(getDeclaringClass())).append('.');
+ sb.append(getName()).append('(');
Class>[] params = parameterTypes; // avoid clone
for (int j = 0; j < params.length; j++) {
sb.append(Field.getTypeName(params[j]));
if (j < (params.length - 1))
- sb.append(",");
+ sb.append(',');
}
- sb.append(")");
+ sb.append(')');
Class>[] exceptions = exceptionTypes; // avoid clone
if (exceptions.length > 0) {
sb.append(" throws ");
for (int k = 0; k < exceptions.length; k++) {
sb.append(exceptions[k].getName());
if (k < (exceptions.length - 1))
- sb.append(",");
+ sb.append(',');
}
}
return sb.toString();
@@ -475,15 +470,15 @@
StringBuilder sb = new StringBuilder();
int mod = getModifiers() & Modifier.methodModifiers();
if (mod != 0) {
- sb.append(Modifier.toString(mod) + " ");
+ sb.append(Modifier.toString(mod)).append(' ');
}
TypeVariable>[] typeparms = getTypeParameters();
if (typeparms.length > 0) {
boolean first = true;
- sb.append("<");
+ sb.append('<');
for(TypeVariable> typeparm: typeparms) {
if (!first)
- sb.append(",");
+ sb.append(',');
// Class objects can't occur here; no need to test
// and call Class.getName().
sb.append(typeparm.toString());
@@ -494,10 +489,11 @@
Type genRetType = getGenericReturnType();
sb.append( ((genRetType instanceof Class>)?
- Field.getTypeName((Class>)genRetType):genRetType.toString()) + " ");
+ Field.getTypeName((Class>)genRetType):genRetType.toString()))
+ .append(' ');
- sb.append(Field.getTypeName(getDeclaringClass()) + ".");
- sb.append(getName() + "(");
+ sb.append(Field.getTypeName(getDeclaringClass())).append('.');
+ sb.append(getName()).append('(');
Type[] params = getGenericParameterTypes();
for (int j = 0; j < params.length; j++) {
String param = (params[j] instanceof Class)?
@@ -507,9 +503,9 @@
param = param.replaceFirst("\\[\\]$", "...");
sb.append(param);
if (j < (params.length - 1))
- sb.append(",");
+ sb.append(',');
}
- sb.append(")");
+ sb.append(')');
Type[] exceptions = getGenericExceptionTypes();
if (exceptions.length > 0) {
sb.append(" throws ");
@@ -518,7 +514,7 @@
((Class)exceptions[k]).getName():
exceptions[k].toString());
if (k < (exceptions.length - 1))
- sb.append(",");
+ sb.append(',');
}
}
return sb.toString();
@@ -565,7 +561,7 @@
* {@code args}
*
* @exception IllegalAccessException if this {@code Method} object
- * enforces Java language access control and the underlying
+ * is enforcing Java language access control and the underlying
* method is inaccessible.
* @exception IllegalArgumentException if the method is an
* instance method and the specified object argument
@@ -591,26 +587,15 @@
if (!override) {
if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) {
Class> caller = Reflection.getCallerClass(1);
- Class> targetClass = ((obj == null || !Modifier.isProtected(modifiers))
- ? clazz
- : obj.getClass());
- boolean cached;
- synchronized (this) {
- cached = (securityCheckCache == caller)
- && (securityCheckTargetClassCache == targetClass);
- }
- if (!cached) {
- Reflection.ensureMemberAccess(caller, clazz, obj, modifiers);
- synchronized (this) {
- securityCheckCache = caller;
- securityCheckTargetClassCache = targetClass;
- }
- }
+ checkAccess(caller, clazz, obj, modifiers);
}
}
- if (methodAccessor == null) acquireMethodAccessor();
- return methodAccessor.invoke(obj, args);
+ MethodAccessor ma = methodAccessor; // read volatile
+ if (ma == null) {
+ ma = acquireMethodAccessor();
+ }
+ return ma.invoke(obj, args);
}
/**
@@ -654,18 +639,20 @@
// (though not efficient) to generate more than one MethodAccessor
// for a given Method. However, avoiding synchronization will
// probably make the implementation more scalable.
- private void acquireMethodAccessor() {
+ private MethodAccessor acquireMethodAccessor() {
// First check to see if one has been created yet, and take it
// if so
MethodAccessor tmp = null;
if (root != null) tmp = root.getMethodAccessor();
if (tmp != null) {
methodAccessor = tmp;
- return;
+ } else {
+ // Otherwise fabricate one and propagate it up to the root
+ tmp = reflectionFactory.newMethodAccessor(this);
+ setMethodAccessor(tmp);
}
- // Otherwise fabricate one and propagate it up to the root
- tmp = reflectionFactory.newMethodAccessor(this);
- setMethodAccessor(tmp);
+
+ return tmp;
}
// Returns MethodAccessor for this Method object, not looking up
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/nio/file/Files.java
--- a/src/share/classes/java/nio/file/Files.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/nio/file/Files.java Tue Apr 12 14:23:03 2011 -0700
@@ -2067,7 +2067,7 @@
*
* @return {@code true} if the file is a symbolic link; {@code false} if
* the file does not exist, is not a symbolic link, or it cannot
- * be determined if the file is symbolic link or not.
+ * be determined if the file is a symbolic link or not.
*
* @throws SecurityException
* In the case of the default provider, and a security manager is
@@ -2106,7 +2106,7 @@
*
* @return {@code true} if the file is a directory; {@code false} if
* the file does not exist, is not a directory, or it cannot
- * be determined if the file is directory or not.
+ * be determined if the file is a directory or not.
*
* @throws SecurityException
* In the case of the default provider, and a security manager is
@@ -2142,8 +2142,8 @@
* options indicating how symbolic links are handled
*
* @return {@code true} if the file is a regular file; {@code false} if
- * the file does not exist, is not a direcregular filetory, or it
- * cannot be determined if the file is regular file or not.
+ * the file does not exist, is not a regular file, or it
+ * cannot be determined if the file is a regular file or not.
*
* @throws SecurityException
* In the case of the default provider, and a security manager is
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/nio/file/Path.java
--- a/src/share/classes/java/nio/file/Path.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/nio/file/Path.java Tue Apr 12 14:23:03 2011 -0700
@@ -550,18 +550,21 @@
*
If this path is relative then its absolute path is first obtained,
* as if by invoking the {@link #toAbsolutePath toAbsolutePath} method.
*
- *
The {@code resolveLinks} parameter specifies if symbolic links
- * should be resolved. This parameter is ignored when symbolic links are
- * not supported. Where supported, and the parameter has the value {@code
- * true} then symbolic links are resolved to their final target. Where the
- * parameter has the value {@code false} then this method does not resolve
- * symbolic links. Some implementations allow special names such as
- * "{@code ..}" to refer to the parent directory. When deriving the real
- * path, and a "{@code ..}" (or equivalent) is preceded by a
- * non-"{@code ..}" name then an implementation will typically causes both
- * names to be removed. When not resolving symbolic links and the preceding
- * name is a symbolic link then the names are only removed if it guaranteed
- * that the resulting path will locate the same file as this path.
+ *
The {@code options} array may be used to indicate how symbolic links
+ * are handled. By default, symbolic links are resolved to their final
+ * target. If the option {@link LinkOption#NOFOLLOW_LINKS NOFOLLOW_LINKS} is
+ * present then this method does not resolve symbolic links.
+ *
+ * Some implementations allow special names such as "{@code ..}" to refer to
+ * the parent directory. When deriving the real path, and a
+ * "{@code ..}" (or equivalent) is preceded by a non-"{@code ..}" name then
+ * an implementation will typically cause both names to be removed. When
+ * not resolving symbolic links and the preceding name is a symbolic link
+ * then the names are only removed if it guaranteed that the resulting path
+ * will locate the same file as this path.
+ *
+ * @param options
+ * options indicating how symbolic links are handled
*
* @return an absolute path represent the real path of the file
* located by this object
@@ -576,7 +579,7 @@
* checkPropertyAccess} method is invoked to check access to the
* system property {@code user.dir}
*/
- Path toRealPath(boolean resolveLinks) throws IOException;
+ Path toRealPath(LinkOption... options) throws IOException;
/**
* Returns a {@link File} object representing this path. Where this {@code
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/sql/DriverManager.java
--- a/src/share/classes/java/sql/DriverManager.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/sql/DriverManager.java Tue Apr 12 14:23:03 2011 -0700
@@ -80,7 +80,7 @@
// List of registered JDBC drivers
- private final static CopyOnWriteArrayList registeredDrivers = new CopyOnWriteArrayList();
+ private final static CopyOnWriteArrayList registeredDrivers = new CopyOnWriteArrayList();
private static volatile int loginTimeout = 0;
private static volatile java.io.PrintWriter logWriter = null;
private static volatile java.io.PrintStream logStream = null;
@@ -265,22 +265,22 @@
// Walk through the loaded registeredDrivers attempting to locate someone
// who understands the given URL.
- for (Driver aDriver : registeredDrivers) {
+ for (DriverInfo aDriver : registeredDrivers) {
// If the caller does not have permission to load the driver then
// skip it.
- if(isDriverAllowed(aDriver, callerCL)) {
+ if(isDriverAllowed(aDriver.driver, callerCL)) {
try {
- if(aDriver.acceptsURL(url)) {
+ if(aDriver.driver.acceptsURL(url)) {
// Success!
- println("getDriver returning " + aDriver.getClass().getName());
- return (aDriver);
+ println("getDriver returning " + aDriver.driver.getClass().getName());
+ return (aDriver.driver);
}
} catch(SQLException sqe) {
// Drop through and try the next driver.
}
} else {
- println(" skipping: " + aDriver.getClass().getName());
+ println(" skipping: " + aDriver.driver.getClass().getName());
}
}
@@ -305,7 +305,7 @@
/* Register the driver if it has not already been added to our list */
if(driver != null) {
- registeredDrivers.addIfAbsent(driver);
+ registeredDrivers.addIfAbsent(new DriverInfo(driver));
} else {
// This is for compatibility with the original DriverManager
throw new NullPointerException();
@@ -333,9 +333,10 @@
ClassLoader callerCL = DriverManager.getCallerClassLoader();
println("DriverManager.deregisterDriver: " + driver);
- if(registeredDrivers.contains(driver)) {
+ DriverInfo aDriver = new DriverInfo(driver);
+ if(registeredDrivers.contains(aDriver)) {
if (isDriverAllowed(driver, callerCL)) {
- registeredDrivers.remove(driver);
+ registeredDrivers.remove(aDriver);
} else {
// If the caller does not have permission to load the driver then
// throw a SecurityException.
@@ -363,11 +364,11 @@
ClassLoader callerCL = DriverManager.getCallerClassLoader();
// Walk through the loaded registeredDrivers.
- for(Driver aDriver : registeredDrivers) {
+ for(DriverInfo aDriver : registeredDrivers) {
// If the caller does not have permission to load the driver then
// skip it.
- if(isDriverAllowed(aDriver, callerCL)) {
- result.addElement(aDriver);
+ if(isDriverAllowed(aDriver.driver, callerCL)) {
+ result.addElement(aDriver.driver);
} else {
println(" skipping: " + aDriver.getClass().getName());
}
@@ -482,8 +483,8 @@
private static void loadInitialDrivers() {
String drivers;
try {
- drivers = (String) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
+ drivers = AccessController.doPrivileged(new PrivilegedAction() {
+ public String run() {
return System.getProperty("jdbc.drivers");
}
});
@@ -495,8 +496,8 @@
// exposed as a java.sql.Driver.class service.
// ServiceLoader.load() replaces the sun.misc.Providers()
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Void run() {
ServiceLoader loadedDrivers = ServiceLoader.load(Driver.class);
Iterator driversIterator = loadedDrivers.iterator();
@@ -569,16 +570,16 @@
// Remember the first exception that gets raised so we can reraise it.
SQLException reason = null;
- for(Driver aDriver : registeredDrivers) {
+ for(DriverInfo aDriver : registeredDrivers) {
// If the caller does not have permission to load the driver then
// skip it.
- if(isDriverAllowed(aDriver, callerCL)) {
+ if(isDriverAllowed(aDriver.driver, callerCL)) {
try {
- println(" trying " + aDriver.getClass().getName());
- Connection con = aDriver.connect(url, info);
+ println(" trying " + aDriver.driver.getClass().getName());
+ Connection con = aDriver.driver.connect(url, info);
if (con != null) {
// Success!
- println("getConnection returning " + aDriver.getClass().getName());
+ println("getConnection returning " + aDriver.driver.getClass().getName());
return (con);
}
} catch (SQLException ex) {
@@ -607,3 +608,29 @@
private static native ClassLoader getCallerClassLoader();
}
+
+/*
+ * Wrapper class for registered Drivers in order to not expose Driver.equals()
+ * to avoid the capture of the Driver it being compared to as it might not
+ * normally have access.
+ */
+class DriverInfo {
+
+ final Driver driver;
+ DriverInfo(Driver driver) {
+ this.driver = driver;
+ }
+
+ public boolean equals(Object other) {
+ return (other instanceof DriverInfo)
+ && this.driver == ((DriverInfo) other).driver;
+ }
+
+ public int hashCode() {
+ return driver.hashCode();
+ }
+
+ public String toString() {
+ return ("driver[className=" + driver + "]");
+ }
+}
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/AbstractQueue.java
--- a/src/share/classes/java/util/AbstractQueue.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/AbstractQueue.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/ArrayDeque.java
--- a/src/share/classes/java/util/ArrayDeque.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/ArrayDeque.java Tue Apr 12 14:23:03 2011 -0700
@@ -29,7 +29,7 @@
* file:
*
* Written by Josh Bloch of Google Inc. and released to the public domain,
- * as explained at http://creativecommons.org/licenses/publicdomain.
+ * as explained at http://creativecommons.org/publicdomain/zero/1.0/.
*/
package java.util;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/Deque.java
--- a/src/share/classes/java/util/Deque.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/Deque.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea and Josh Bloch with assistance from members of
* JCP JSR-166 Expert Group and released to the public domain, as explained
- * at http://creativecommons.org/licenses/publicdomain
+ * at http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/EnumMap.java
--- a/src/share/classes/java/util/EnumMap.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/EnumMap.java Tue Apr 12 14:23:03 2011 -0700
@@ -106,7 +106,7 @@
/**
* Distinguished non-null value for representing null values.
*/
- private static final Object NULL = new Object();
+ private static final Object NULL = new Integer(0);
private Object maskNull(Object value) {
return (value == null ? NULL : value);
@@ -116,7 +116,7 @@
return (V) (value == NULL ? null : value);
}
- private static Enum[] ZERO_LENGTH_ENUM_ARRAY = new Enum[0];
+ private static final Enum[] ZERO_LENGTH_ENUM_ARRAY = new Enum[0];
/**
* Creates an empty enum map with the specified key type.
@@ -464,6 +464,7 @@
public Iterator> iterator() {
return new EntryIterator();
}
+
public boolean contains(Object o) {
if (!(o instanceof Map.Entry))
return false;
@@ -552,70 +553,82 @@
}
}
- /**
- * Since we don't use Entry objects, we use the Iterator itself as entry.
- */
- private class EntryIterator extends EnumMapIterator>
- implements Map.Entry
- {
+ private class EntryIterator extends EnumMapIterator> {
+ private Entry lastReturnedEntry = null;
+
public Map.Entry next() {
if (!hasNext())
throw new NoSuchElementException();
- lastReturnedIndex = index++;
- return this;
- }
-
- public K getKey() {
- checkLastReturnedIndexForEntryUse();
- return keyUniverse[lastReturnedIndex];
+ lastReturnedEntry = new Entry(index++);
+ return lastReturnedEntry;
}
- public V getValue() {
- checkLastReturnedIndexForEntryUse();
- return unmaskNull(vals[lastReturnedIndex]);
- }
-
- public V setValue(V value) {
- checkLastReturnedIndexForEntryUse();
- V oldValue = unmaskNull(vals[lastReturnedIndex]);
- vals[lastReturnedIndex] = maskNull(value);
- return oldValue;
+ public void remove() {
+ lastReturnedIndex =
+ ((null == lastReturnedEntry) ? -1 : lastReturnedEntry.index);
+ super.remove();
+ lastReturnedEntry.index = lastReturnedIndex;
+ lastReturnedEntry = null;
}
- public boolean equals(Object o) {
- if (lastReturnedIndex < 0)
- return o == this;
+ private class Entry implements Map.Entry {
+ private int index;
+
+ private Entry(int index) {
+ this.index = index;
+ }
+
+ public K getKey() {
+ checkIndexForEntryUse();
+ return keyUniverse[index];
+ }
- if (!(o instanceof Map.Entry))
- return false;
- Map.Entry e = (Map.Entry)o;
- V ourValue = unmaskNull(vals[lastReturnedIndex]);
- Object hisValue = e.getValue();
- return e.getKey() == keyUniverse[lastReturnedIndex] &&
- (ourValue == hisValue ||
- (ourValue != null && ourValue.equals(hisValue)));
- }
+ public V getValue() {
+ checkIndexForEntryUse();
+ return unmaskNull(vals[index]);
+ }
+
+ public V setValue(V value) {
+ checkIndexForEntryUse();
+ V oldValue = unmaskNull(vals[index]);
+ vals[index] = maskNull(value);
+ return oldValue;
+ }
+
+ public boolean equals(Object o) {
+ if (index < 0)
+ return o == this;
- public int hashCode() {
- if (lastReturnedIndex < 0)
- return super.hashCode();
+ if (!(o instanceof Map.Entry))
+ return false;
- Object value = vals[lastReturnedIndex];
- return keyUniverse[lastReturnedIndex].hashCode()
- ^ (value == NULL ? 0 : value.hashCode());
- }
+ Map.Entry e = (Map.Entry)o;
+ V ourValue = unmaskNull(vals[index]);
+ Object hisValue = e.getValue();
+ return (e.getKey() == keyUniverse[index] &&
+ (ourValue == hisValue ||
+ (ourValue != null && ourValue.equals(hisValue))));
+ }
+
+ public int hashCode() {
+ if (index < 0)
+ return super.hashCode();
- public String toString() {
- if (lastReturnedIndex < 0)
- return super.toString();
+ return entryHashCode(index);
+ }
+
+ public String toString() {
+ if (index < 0)
+ return super.toString();
- return keyUniverse[lastReturnedIndex] + "="
- + unmaskNull(vals[lastReturnedIndex]);
- }
+ return keyUniverse[index] + "="
+ + unmaskNull(vals[index]);
+ }
- private void checkLastReturnedIndexForEntryUse() {
- if (lastReturnedIndex < 0)
- throw new IllegalStateException("Entry was removed");
+ private void checkIndexForEntryUse() {
+ if (index < 0)
+ throw new IllegalStateException("Entry was removed");
+ }
}
}
@@ -631,10 +644,35 @@
* @return true if the specified object is equal to this map
*/
public boolean equals(Object o) {
- if (!(o instanceof EnumMap))
- return super.equals(o);
+ if (this == o)
+ return true;
+ if (o instanceof EnumMap)
+ return equals((EnumMap)o);
+ if (!(o instanceof Map))
+ return false;
+
+ Map m = (Map)o;
+ if (size != m.size())
+ return false;
- EnumMap em = (EnumMap)o;
+ for (int i = 0; i < keyUniverse.length; i++) {
+ if (null != vals[i]) {
+ K key = keyUniverse[i];
+ V value = unmaskNull(vals[i]);
+ if (null == value) {
+ if (!((null == m.get(key)) && m.containsKey(key)))
+ return false;
+ } else {
+ if (!value.equals(m.get(key)))
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ private boolean equals(EnumMap em) {
if (em.keyType != keyType)
return size == 0 && em.size == 0;
@@ -650,6 +688,26 @@
}
/**
+ * Returns the hash code value for this map. The hash code of a map is
+ * defined to be the sum of the hash codes of each entry in the map.
+ */
+ public int hashCode() {
+ int h = 0;
+
+ for (int i = 0; i < keyUniverse.length; i++) {
+ if (null != vals[i]) {
+ h += entryHashCode(i);
+ }
+ }
+
+ return h;
+ }
+
+ private int entryHashCode(int index) {
+ return (keyUniverse[index].hashCode() ^ vals[index].hashCode());
+ }
+
+ /**
* Returns a shallow copy of this enum map. (The values themselves
* are not cloned.
*
@@ -705,9 +763,13 @@
s.writeInt(size);
// Write out keys and values (alternating)
- for (Map.Entry e : entrySet()) {
- s.writeObject(e.getKey());
- s.writeObject(e.getValue());
+ int entriesToBeWritten = size;
+ for (int i = 0; entriesToBeWritten > 0; i++) {
+ if (null != vals[i]) {
+ s.writeObject(keyUniverse[i]);
+ s.writeObject(unmaskNull(vals[i]));
+ entriesToBeWritten--;
+ }
}
}
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/IdentityHashMap.java
--- a/src/share/classes/java/util/IdentityHashMap.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/IdentityHashMap.java Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -829,71 +829,82 @@
}
}
- /**
- * Since we don't use Entry objects, we use the Iterator
- * itself as an entry.
- */
private class EntryIterator
extends IdentityHashMapIterator>
- implements Map.Entry
{
+ private Entry lastReturnedEntry = null;
+
public Map.Entry next() {
- nextIndex();
- return this;
+ lastReturnedEntry = new Entry(nextIndex());
+ return lastReturnedEntry;
}
- public K getKey() {
- // Provide a better exception than out of bounds index
- if (lastReturnedIndex < 0)
- throw new IllegalStateException("Entry was removed");
-
- return (K) unmaskNull(traversalTable[lastReturnedIndex]);
- }
-
- public V getValue() {
- // Provide a better exception than out of bounds index
- if (lastReturnedIndex < 0)
- throw new IllegalStateException("Entry was removed");
-
- return (V) traversalTable[lastReturnedIndex+1];
+ public void remove() {
+ lastReturnedIndex =
+ ((null == lastReturnedEntry) ? -1 : lastReturnedEntry.index);
+ super.remove();
+ lastReturnedEntry.index = lastReturnedIndex;
+ lastReturnedEntry = null;
}
- public V setValue(V value) {
- // It would be mean-spirited to proceed here if remove() called
- if (lastReturnedIndex < 0)
- throw new IllegalStateException("Entry was removed");
- V oldValue = (V) traversalTable[lastReturnedIndex+1];
- traversalTable[lastReturnedIndex+1] = value;
- // if shadowing, force into main table
- if (traversalTable != IdentityHashMap.this.table)
- put((K) traversalTable[lastReturnedIndex], value);
- return oldValue;
- }
+ private class Entry implements Map.Entry {
+ private int index;
+
+ private Entry(int index) {
+ this.index = index;
+ }
+
+ public K getKey() {
+ checkIndexForEntryUse();
+ return (K) unmaskNull(traversalTable[index]);
+ }
- public boolean equals(Object o) {
- if (lastReturnedIndex < 0)
- return super.equals(o);
+ public V getValue() {
+ checkIndexForEntryUse();
+ return (V) traversalTable[index+1];
+ }
+
+ public V setValue(V value) {
+ checkIndexForEntryUse();
+ V oldValue = (V) traversalTable[index+1];
+ traversalTable[index+1] = value;
+ // if shadowing, force into main table
+ if (traversalTable != IdentityHashMap.this.table)
+ put((K) traversalTable[index], value);
+ return oldValue;
+ }
- if (!(o instanceof Map.Entry))
- return false;
- Map.Entry e = (Map.Entry)o;
- return e.getKey() == getKey() &&
- e.getValue() == getValue();
- }
+ public boolean equals(Object o) {
+ if (index < 0)
+ return super.equals(o);
+
+ if (!(o instanceof Map.Entry))
+ return false;
+ Map.Entry e = (Map.Entry)o;
+ return (e.getKey() == unmaskNull(traversalTable[index]) &&
+ e.getValue() == traversalTable[index+1]);
+ }
+
+ public int hashCode() {
+ if (lastReturnedIndex < 0)
+ return super.hashCode();
- public int hashCode() {
- if (lastReturnedIndex < 0)
- return super.hashCode();
+ return (System.identityHashCode(unmaskNull(traversalTable[index])) ^
+ System.identityHashCode(traversalTable[index+1]));
+ }
+
+ public String toString() {
+ if (index < 0)
+ return super.toString();
- return System.identityHashCode(getKey()) ^
- System.identityHashCode(getValue());
- }
+ return (unmaskNull(traversalTable[index]) + "="
+ + traversalTable[index+1]);
+ }
- public String toString() {
- if (lastReturnedIndex < 0)
- return super.toString();
-
- return getKey() + "=" + getValue();
+ private void checkIndexForEntryUse() {
+ if (index < 0)
+ throw new IllegalStateException("Entry was removed");
+ }
}
}
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/NavigableMap.java
--- a/src/share/classes/java/util/NavigableMap.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/NavigableMap.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea and Josh Bloch with assistance from members of JCP
* JSR-166 Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/NavigableSet.java
--- a/src/share/classes/java/util/NavigableSet.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/NavigableSet.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea and Josh Bloch with assistance from members of JCP
* JSR-166 Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/Queue.java
--- a/src/share/classes/java/util/Queue.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/Queue.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/AbstractExecutorService.java
--- a/src/share/classes/java/util/concurrent/AbstractExecutorService.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/AbstractExecutorService.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ArrayBlockingQueue.java
--- a/src/share/classes/java/util/concurrent/ArrayBlockingQueue.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ArrayBlockingQueue.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/BlockingDeque.java
--- a/src/share/classes/java/util/concurrent/BlockingDeque.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/BlockingDeque.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/BlockingQueue.java
--- a/src/share/classes/java/util/concurrent/BlockingQueue.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/BlockingQueue.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/BrokenBarrierException.java
--- a/src/share/classes/java/util/concurrent/BrokenBarrierException.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/BrokenBarrierException.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/Callable.java
--- a/src/share/classes/java/util/concurrent/Callable.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/Callable.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/CancellationException.java
--- a/src/share/classes/java/util/concurrent/CancellationException.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/CancellationException.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/CompletionService.java
--- a/src/share/classes/java/util/concurrent/CompletionService.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/CompletionService.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ConcurrentHashMap.java
--- a/src/share/classes/java/util/concurrent/ConcurrentHashMap.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ConcurrentHashMap.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java
--- a/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea and Martin Buchholz with assistance from members of
* JCP JSR-166 Expert Group and released to the public domain, as explained
- * at http://creativecommons.org/licenses/publicdomain
+ * at http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java
--- a/src/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea and Martin Buchholz with assistance from members of
* JCP JSR-166 Expert Group and released to the public domain, as explained
- * at http://creativecommons.org/licenses/publicdomain
+ * at http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ConcurrentMap.java
--- a/src/share/classes/java/util/concurrent/ConcurrentMap.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ConcurrentMap.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ConcurrentNavigableMap.java
--- a/src/share/classes/java/util/concurrent/ConcurrentNavigableMap.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ConcurrentNavigableMap.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java
--- a/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ConcurrentSkipListSet.java
--- a/src/share/classes/java/util/concurrent/ConcurrentSkipListSet.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ConcurrentSkipListSet.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/CopyOnWriteArraySet.java
--- a/src/share/classes/java/util/concurrent/CopyOnWriteArraySet.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/CopyOnWriteArraySet.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/CountDownLatch.java
--- a/src/share/classes/java/util/concurrent/CountDownLatch.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/CountDownLatch.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/CyclicBarrier.java
--- a/src/share/classes/java/util/concurrent/CyclicBarrier.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/CyclicBarrier.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/DelayQueue.java
--- a/src/share/classes/java/util/concurrent/DelayQueue.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/DelayQueue.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/Delayed.java
--- a/src/share/classes/java/util/concurrent/Delayed.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/Delayed.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/Exchanger.java
--- a/src/share/classes/java/util/concurrent/Exchanger.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/Exchanger.java Tue Apr 12 14:23:03 2011 -0700
@@ -31,7 +31,7 @@
* Written by Doug Lea, Bill Scherer, and Michael Scott with
* assistance from members of JCP JSR-166 Expert Group and released to
* the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ExecutionException.java
--- a/src/share/classes/java/util/concurrent/ExecutionException.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ExecutionException.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/Executor.java
--- a/src/share/classes/java/util/concurrent/Executor.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/Executor.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ExecutorCompletionService.java
--- a/src/share/classes/java/util/concurrent/ExecutorCompletionService.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ExecutorCompletionService.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ExecutorService.java
--- a/src/share/classes/java/util/concurrent/ExecutorService.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ExecutorService.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/Executors.java
--- a/src/share/classes/java/util/concurrent/Executors.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/Executors.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ForkJoinPool.java
--- a/src/share/classes/java/util/concurrent/ForkJoinPool.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ForkJoinPool.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
@@ -791,18 +791,19 @@
/**
* Tries to enqueue worker w in wait queue and await change in
- * worker's eventCount. If the pool is quiescent, possibly
- * terminates worker upon exit. Otherwise, before blocking,
- * rescans queues to avoid missed signals. Upon finding work,
- * releases at least one worker (which may be the current
- * worker). Rescans restart upon detected staleness or failure to
- * release due to contention. Note the unusual conventions about
- * Thread.interrupt here and elsewhere: Because interrupts are
- * used solely to alert threads to check termination, which is
- * checked here anyway, we clear status (using Thread.interrupted)
- * before any call to park, so that park does not immediately
- * return due to status being set via some other unrelated call to
- * interrupt in user code.
+ * worker's eventCount. If the pool is quiescent and there is
+ * more than one worker, possibly terminates worker upon exit.
+ * Otherwise, before blocking, rescans queues to avoid missed
+ * signals. Upon finding work, releases at least one worker
+ * (which may be the current worker). Rescans restart upon
+ * detected staleness or failure to release due to
+ * contention. Note the unusual conventions about Thread.interrupt
+ * here and elsewhere: Because interrupts are used solely to alert
+ * threads to check termination, which is checked here anyway, we
+ * clear status (using Thread.interrupted) before any call to
+ * park, so that park does not immediately return due to status
+ * being set via some other unrelated call to interrupt in user
+ * code.
*
* @param w the calling worker
* @param c the ctl value on entry
@@ -823,7 +824,7 @@
else if (w.eventCount != v)
return true; // update next time
}
- if (parallelism + (int)(nc >> AC_SHIFT) == 0 &&
+ if ((int)c != 0 && parallelism + (int)(nc >> AC_SHIFT) == 0 &&
blockedCount == 0 && quiescerCount == 0)
idleAwaitWork(w, nc, c, v); // quiescent
for (boolean rescanned = false;;) {
@@ -893,7 +894,8 @@
w.parked = false;
if (w.eventCount != v)
break;
- else if (System.nanoTime() - startTime < SHRINK_RATE)
+ else if (System.nanoTime() - startTime <
+ SHRINK_RATE - (SHRINK_RATE / 10)) // timing slop
Thread.interrupted(); // spurious wakeup
else if (UNSAFE.compareAndSwapLong(this, ctlOffset,
currentCtl, prevCtl)) {
@@ -1175,7 +1177,7 @@
ws[k] = w;
nextWorkerIndex = k + 1;
int m = g & SMASK;
- g = k >= m? ((m << 1) + 1) & SMASK : g + (SG_UNIT<<1);
+ g = k > m? ((m << 1) + 1) & SMASK : g + (SG_UNIT<<1);
}
} finally {
scanGuard = g;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ForkJoinTask.java
--- a/src/share/classes/java/util/concurrent/ForkJoinTask.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ForkJoinTask.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java
--- a/src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/Future.java
--- a/src/share/classes/java/util/concurrent/Future.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/Future.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/FutureTask.java
--- a/src/share/classes/java/util/concurrent/FutureTask.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/FutureTask.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/LinkedBlockingDeque.java
--- a/src/share/classes/java/util/concurrent/LinkedBlockingDeque.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/LinkedBlockingDeque.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/LinkedBlockingQueue.java
--- a/src/share/classes/java/util/concurrent/LinkedBlockingQueue.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/LinkedBlockingQueue.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/LinkedTransferQueue.java
--- a/src/share/classes/java/util/concurrent/LinkedTransferQueue.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/LinkedTransferQueue.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/Phaser.java
--- a/src/share/classes/java/util/concurrent/Phaser.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/Phaser.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/PriorityBlockingQueue.java
--- a/src/share/classes/java/util/concurrent/PriorityBlockingQueue.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/PriorityBlockingQueue.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/RecursiveAction.java
--- a/src/share/classes/java/util/concurrent/RecursiveAction.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/RecursiveAction.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/RecursiveTask.java
--- a/src/share/classes/java/util/concurrent/RecursiveTask.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/RecursiveTask.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/RejectedExecutionException.java
--- a/src/share/classes/java/util/concurrent/RejectedExecutionException.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/RejectedExecutionException.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/RejectedExecutionHandler.java
--- a/src/share/classes/java/util/concurrent/RejectedExecutionHandler.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/RejectedExecutionHandler.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/RunnableFuture.java
--- a/src/share/classes/java/util/concurrent/RunnableFuture.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/RunnableFuture.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/RunnableScheduledFuture.java
--- a/src/share/classes/java/util/concurrent/RunnableScheduledFuture.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/RunnableScheduledFuture.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ScheduledExecutorService.java
--- a/src/share/classes/java/util/concurrent/ScheduledExecutorService.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ScheduledExecutorService.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ScheduledFuture.java
--- a/src/share/classes/java/util/concurrent/ScheduledFuture.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ScheduledFuture.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java
--- a/src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ScheduledThreadPoolExecutor.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/Semaphore.java
--- a/src/share/classes/java/util/concurrent/Semaphore.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/Semaphore.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/SynchronousQueue.java
--- a/src/share/classes/java/util/concurrent/SynchronousQueue.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/SynchronousQueue.java Tue Apr 12 14:23:03 2011 -0700
@@ -31,7 +31,7 @@
* Written by Doug Lea, Bill Scherer, and Michael Scott with
* assistance from members of JCP JSR-166 Expert Group and released to
* the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ThreadFactory.java
--- a/src/share/classes/java/util/concurrent/ThreadFactory.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ThreadFactory.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ThreadLocalRandom.java
--- a/src/share/classes/java/util/concurrent/ThreadLocalRandom.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ThreadLocalRandom.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/ThreadPoolExecutor.java
--- a/src/share/classes/java/util/concurrent/ThreadPoolExecutor.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/ThreadPoolExecutor.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/TimeUnit.java
--- a/src/share/classes/java/util/concurrent/TimeUnit.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/TimeUnit.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/TimeoutException.java
--- a/src/share/classes/java/util/concurrent/TimeoutException.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/TimeoutException.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/TransferQueue.java
--- a/src/share/classes/java/util/concurrent/TransferQueue.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/TransferQueue.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/atomic/AtomicBoolean.java
--- a/src/share/classes/java/util/concurrent/atomic/AtomicBoolean.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicBoolean.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.atomic;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/atomic/AtomicInteger.java
--- a/src/share/classes/java/util/concurrent/atomic/AtomicInteger.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicInteger.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.atomic;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java
--- a/src/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.atomic;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
--- a/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.atomic;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/atomic/AtomicLong.java
--- a/src/share/classes/java/util/concurrent/atomic/AtomicLong.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicLong.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.atomic;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java
--- a/src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.atomic;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
--- a/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.atomic;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java
--- a/src/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicMarkableReference.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.atomic;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/atomic/AtomicReference.java
--- a/src/share/classes/java/util/concurrent/atomic/AtomicReference.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicReference.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.atomic;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java
--- a/src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.atomic;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
--- a/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.atomic;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java
--- a/src/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.atomic;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/atomic/package-info.java
--- a/src/share/classes/java/util/concurrent/atomic/package-info.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/atomic/package-info.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
/**
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/locks/AbstractOwnableSynchronizer.java
--- a/src/share/classes/java/util/concurrent/locks/AbstractOwnableSynchronizer.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/locks/AbstractOwnableSynchronizer.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.locks;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java
--- a/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.locks;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
--- a/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.locks;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/locks/Condition.java
--- a/src/share/classes/java/util/concurrent/locks/Condition.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/locks/Condition.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.locks;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/locks/Lock.java
--- a/src/share/classes/java/util/concurrent/locks/Lock.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/locks/Lock.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.locks;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/locks/LockSupport.java
--- a/src/share/classes/java/util/concurrent/locks/LockSupport.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/locks/LockSupport.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.locks;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/locks/ReadWriteLock.java
--- a/src/share/classes/java/util/concurrent/locks/ReadWriteLock.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/locks/ReadWriteLock.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.locks;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/locks/ReentrantLock.java
--- a/src/share/classes/java/util/concurrent/locks/ReentrantLock.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/locks/ReentrantLock.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.locks;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java
--- a/src/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent.locks;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/locks/package-info.java
--- a/src/share/classes/java/util/concurrent/locks/package-info.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/locks/package-info.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
/**
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/concurrent/package-info.java
--- a/src/share/classes/java/util/concurrent/package-info.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/concurrent/package-info.java Tue Apr 12 14:23:03 2011 -0700
@@ -30,7 +30,7 @@
*
* Written by Doug Lea with assistance from members of JCP JSR-166
* Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
+ * http://creativecommons.org/publicdomain/zero/1.0/
*/
/**
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/jar/JarFile.java
--- a/src/share/classes/java/util/jar/JarFile.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/jar/JarFile.java Tue Apr 12 14:23:03 2011 -0700
@@ -37,6 +37,7 @@
import sun.security.action.GetPropertyAction;
import sun.security.util.ManifestEntryVerifier;
import sun.misc.SharedSecrets;
+import sun.security.util.SignatureFileVerifier;
/**
* The JarFile class is used to read the contents of a jar file
@@ -178,7 +179,7 @@
byte[] b = getBytes(manEntry);
man = new Manifest(new ByteArrayInputStream(b));
if (!jvInitialized) {
- jv = new JarVerifier(b);
+ jv = new JarVerifier(b, man);
}
} else {
man = new Manifest(super.getInputStream(manEntry));
@@ -297,10 +298,7 @@
if (names != null) {
for (int i = 0; i < names.length; i++) {
String name = names[i].toUpperCase(Locale.ENGLISH);
- if (name.endsWith(".DSA") ||
- name.endsWith(".RSA") ||
- name.endsWith(".EC") ||
- name.endsWith(".SF")) {
+ if (SignatureFileVerifier.isBlockOrSF(name)) {
// Assume since we found a signature-related file
// that the jar is signed and that we therefore
// need a JarVerifier and Manifest
@@ -329,17 +327,17 @@
if (names != null) {
for (int i = 0; i < names.length; i++) {
JarEntry e = getJarEntry(names[i]);
- if (!e.isDirectory()) {
+ if (!e.isDirectory() &&
+ SignatureFileVerifier.isBlock(names[i])) {
if (mev == null) {
mev = new ManifestEntryVerifier
(getManifestFromReference());
}
- byte[] b = getBytes(e);
- if (b != null && b.length > 0) {
- jv.beginEntry(e, mev);
- jv.update(b.length, b, 0, b.length, mev);
- jv.update(-1, null, 0, 0, mev);
- }
+ String key = names[i].substring(
+ 0, names[i].lastIndexOf("."));
+ jv.verifyBlock(names[i],
+ getBytes(e),
+ super.getInputStream(getJarEntry(key + ".SF")));
}
}
}
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/jar/JarInputStream.java
--- a/src/share/classes/java/util/jar/JarInputStream.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/jar/JarInputStream.java Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -95,7 +95,7 @@
man.read(new ByteArrayInputStream(bytes));
closeEntry();
if (doVerify) {
- jv = new JarVerifier(bytes);
+ jv = new JarVerifier(bytes, man);
mev = new ManifestEntryVerifier(man);
}
return (JarEntry)super.getNextEntry();
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/jar/JarVerifier.java
--- a/src/share/classes/java/util/jar/JarVerifier.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/jar/JarVerifier.java Tue Apr 12 14:23:03 2011 -0700
@@ -48,35 +48,18 @@
/* a table mapping names to code signers, for jar entries that have
had their actual hashes verified */
- private Hashtable verifiedSigners;
+ private Map verifiedSigners;
/* a table mapping names to code signers, for jar entries that have
passed the .SF/.DSA/.EC -> MANIFEST check */
- private Hashtable sigFileSigners;
-
- /* a hash table to hold .SF bytes */
- private Hashtable sigFileData;
-
- /** "queue" of pending PKCS7 blocks that we couldn't parse
- * until we parsed the .SF file */
- private ArrayList pendingBlocks;
+ private Map sigFileSigners;
/* cache of CodeSigner objects */
private ArrayList signerCache;
- /* Are we parsing a block? */
- private boolean parsingBlockOrSF = false;
-
- /* Are we done parsing META-INF entries? */
- private boolean parsingMeta = true;
-
/* Are there are files to verify? */
private boolean anyToVerify = true;
- /* The output stream to use when keeping track of files we are interested
- in */
- private ByteArrayOutputStream baos;
-
/** The ManifestDigester object */
private volatile ManifestDigester manDig;
@@ -92,20 +75,20 @@
/** collect -DIGEST-MANIFEST values for blacklist */
private List manifestDigests;
- public JarVerifier(byte rawBytes[]) {
+ /** The manifest object */
+ Manifest man = null;
+
+ public JarVerifier(byte rawBytes[], Manifest man) {
+ this.man = man;
manifestRawBytes = rawBytes;
- sigFileSigners = new Hashtable();
- verifiedSigners = new Hashtable();
- sigFileData = new Hashtable(11);
- pendingBlocks = new ArrayList();
- baos = new ByteArrayOutputStream();
+ sigFileSigners = new HashMap();
+ verifiedSigners = new HashMap();
manifestDigests = new ArrayList();
}
/**
- * This method scans to see which entry we're parsing and
- * keeps various state information depending on what type of
- * file is being parsed.
+ * This method scans to see which entry we're parsing and keeps
+ * various state information depending on the file being parsed.
*/
public void beginEntry(JarEntry je, ManifestEntryVerifier mev)
throws IOException
@@ -129,30 +112,6 @@
* b. digest mismatch between the actual jar entry and the manifest
*/
- if (parsingMeta) {
- String uname = name.toUpperCase(Locale.ENGLISH);
- if ((uname.startsWith("META-INF/") ||
- uname.startsWith("/META-INF/"))) {
-
- if (je.isDirectory()) {
- mev.setEntry(null, je);
- return;
- }
-
- if (SignatureFileVerifier.isBlockOrSF(uname)) {
- /* We parse only DSA, RSA or EC PKCS7 blocks. */
- parsingBlockOrSF = true;
- baos.reset();
- mev.setEntry(null, je);
- }
- return;
- }
- }
-
- if (parsingMeta) {
- doneWithMeta();
- }
-
if (je.isDirectory()) {
mev.setEntry(null, je);
return;
@@ -188,11 +147,7 @@
throws IOException
{
if (b != -1) {
- if (parsingBlockOrSF) {
- baos.write(b);
- } else {
- mev.update((byte)b);
- }
+ mev.update((byte)b);
} else {
processEntry(mev);
}
@@ -207,11 +162,7 @@
throws IOException
{
if (n != -1) {
- if (parsingBlockOrSF) {
- baos.write(b, off, n);
- } else {
- mev.update(b, off, n);
- }
+ mev.update(b, off, n);
} else {
processEntry(mev);
}
@@ -223,101 +174,10 @@
private void processEntry(ManifestEntryVerifier mev)
throws IOException
{
- if (!parsingBlockOrSF) {
- JarEntry je = mev.getEntry();
- if ((je != null) && (je.signers == null)) {
- je.signers = mev.verify(verifiedSigners, sigFileSigners);
- je.certs = mapSignersToCertArray(je.signers);
- }
- } else {
-
- try {
- parsingBlockOrSF = false;
-
- if (debug != null) {
- debug.println("processEntry: processing block");
- }
-
- String uname = mev.getEntry().getName()
- .toUpperCase(Locale.ENGLISH);
-
- if (uname.endsWith(".SF")) {
- String key = uname.substring(0, uname.length()-3);
- byte bytes[] = baos.toByteArray();
- // add to sigFileData in case future blocks need it
- sigFileData.put(key, bytes);
- // check pending blocks, we can now process
- // anyone waiting for this .SF file
- Iterator it = pendingBlocks.iterator();
- while (it.hasNext()) {
- SignatureFileVerifier sfv =
- (SignatureFileVerifier) it.next();
- if (sfv.needSignatureFile(key)) {
- if (debug != null) {
- debug.println(
- "processEntry: processing pending block");
- }
-
- sfv.setSignatureFile(bytes);
- sfv.process(sigFileSigners, manifestDigests);
- }
- }
- return;
- }
-
- // now we are parsing a signature block file
-
- String key = uname.substring(0, uname.lastIndexOf("."));
-
- if (signerCache == null)
- signerCache = new ArrayList();
-
- if (manDig == null) {
- synchronized(manifestRawBytes) {
- if (manDig == null) {
- manDig = new ManifestDigester(manifestRawBytes);
- manifestRawBytes = null;
- }
- }
- }
-
- SignatureFileVerifier sfv =
- new SignatureFileVerifier(signerCache,
- manDig, uname, baos.toByteArray());
-
- if (sfv.needSignatureFileBytes()) {
- // see if we have already parsed an external .SF file
- byte[] bytes = (byte[]) sigFileData.get(key);
-
- if (bytes == null) {
- // put this block on queue for later processing
- // since we don't have the .SF bytes yet
- // (uname, block);
- if (debug != null) {
- debug.println("adding pending block");
- }
- pendingBlocks.add(sfv);
- return;
- } else {
- sfv.setSignatureFile(bytes);
- }
- }
- sfv.process(sigFileSigners, manifestDigests);
-
- } catch (IOException ioe) {
- // e.g. sun.security.pkcs.ParsingException
- if (debug != null) debug.println("processEntry caught: "+ioe);
- // ignore and treat as unsigned
- } catch (SignatureException se) {
- if (debug != null) debug.println("processEntry caught: "+se);
- // ignore and treat as unsigned
- } catch (NoSuchAlgorithmException nsae) {
- if (debug != null) debug.println("processEntry caught: "+nsae);
- // ignore and treat as unsigned
- } catch (CertificateException ce) {
- if (debug != null) debug.println("processEntry caught: "+ce);
- // ignore and treat as unsigned
- }
+ JarEntry je = mev.getEntry();
+ if ((je != null) && (je.signers == null)) {
+ je.signers = mev.verify(verifiedSigners, sigFileSigners);
+ je.certs = mapSignersToCertArray(je.signers);
}
}
@@ -354,15 +214,15 @@
* Force a read of the entry data to generate the
* verification hash.
*/
- try {
- InputStream s = jar.getInputStream(entry);
+ try (InputStream s = jar.getInputStream(entry)) {
byte[] buffer = new byte[1024];
int n = buffer.length;
while (n != -1) {
n = s.read(buffer, 0, buffer.length);
}
- s.close();
} catch (IOException e) {
+ // Ignore. When an exception is thrown, code signer
+ // will not be assigned.
}
}
return getCodeSigners(name);
@@ -408,11 +268,7 @@
*/
void doneWithMeta()
{
- parsingMeta = false;
anyToVerify = !sigFileSigners.isEmpty();
- baos = null;
- sigFileData = null;
- pendingBlocks = null;
signerCache = null;
manDig = null;
// MANIFEST.MF is always treated as signed and verified,
@@ -423,6 +279,41 @@
}
}
+ /**
+ * Verifies a PKCS7 SignedData block
+ * @param key name of block
+ * @param block the pkcs7 file
+ * @param ins the clear data
+ */
+ void verifyBlock(String key, byte[] block, InputStream ins) {
+ try {
+ if (signerCache == null)
+ signerCache = new ArrayList();
+
+ if (manDig == null) {
+ synchronized(manifestRawBytes) {
+ if (manDig == null) {
+ manDig = new ManifestDigester(manifestRawBytes);
+ manifestRawBytes = null;
+ }
+ }
+ }
+ SignatureFileVerifier sfv =
+ new SignatureFileVerifier(signerCache, man,
+ manDig, key, block);
+
+ if (sfv.needSignatureFile()) {
+ // see if we have already parsed an external .SF file
+ sfv.setSignatureFile(ins);
+ }
+ sfv.process(sigFileSigners, manifestDigests);
+ } catch (Exception e) {
+ if (debug != null) {
+ e.printStackTrace();
+ }
+ }
+ }
+
static class VerifierStream extends java.io.InputStream {
private InputStream is;
@@ -553,10 +444,7 @@
* but this handles a CodeSource of any type, just in case.
*/
CodeSource[] sources = mapSignersToCodeSources(cs.getLocation(), getJarCodeSigners(), true);
- List sourceList = new ArrayList();
- for (int i = 0; i < sources.length; i++) {
- sourceList.add(sources[i]);
- }
+ List sourceList = Arrays.asList(sources);
int j = sourceList.indexOf(cs);
if (j != -1) {
CodeSigner[] match;
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/java/util/zip/DeflaterOutputStream.java
--- a/src/share/classes/java/util/zip/DeflaterOutputStream.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/java/util/zip/DeflaterOutputStream.java Tue Apr 12 14:23:03 2011 -0700
@@ -206,14 +206,9 @@
return;
}
if (!def.finished()) {
- // Deflate no more than stride bytes at a time. This avoids
- // excess copying in deflateBytes (see Deflater.c)
- int stride = buf.length;
- for (int i = 0; i < len; i+= stride) {
- def.setInput(b, off + i, Math.min(stride, len - i));
- while (!def.needsInput()) {
- deflate();
- }
+ def.setInput(b, off, len);
+ while (!def.needsInput()) {
+ deflate();
}
}
}
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/javax/swing/plaf/LayerUI.java
--- a/src/share/classes/javax/swing/plaf/LayerUI.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/javax/swing/plaf/LayerUI.java Tue Apr 12 14:23:03 2011 -0700
@@ -710,8 +710,8 @@
*
* @param x the x value of the region to be painted
* @param y the y value of the region to be painted
- * @param w the width of the region to be painted
- * @param h the height of the region to be painted
+ * @param width the width of the region to be painted
+ * @param height the height of the region to be painted
*
* @see JComponent#paintImmediately(int, int, int, int)
*/
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/sun/nio/ch/DatagramChannelImpl.java
--- a/src/share/classes/sun/nio/ch/DatagramChannelImpl.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/sun/nio/ch/DatagramChannelImpl.java Tue Apr 12 14:23:03 2011 -0700
@@ -388,9 +388,8 @@
// we must instead use a nonempty buffer, otherwise the call
// will not block waiting for a datagram on some platforms.
int newSize = Math.max(rem, 1);
- ByteBuffer bb = null;
+ ByteBuffer bb = Util.getTemporaryDirectBuffer(newSize);
try {
- bb = Util.getTemporaryDirectBuffer(newSize);
int n = receiveIntoNativeBuffer(fd, bb, newSize, 0);
bb.flip();
if (n > 0 && rem > 0)
@@ -482,9 +481,8 @@
assert (pos <= lim);
int rem = (pos <= lim ? lim - pos : 0);
- ByteBuffer bb = null;
+ ByteBuffer bb = Util.getTemporaryDirectBuffer(rem);
try {
- bb = Util.getTemporaryDirectBuffer(rem);
bb.put(src);
bb.flip();
// Do not update src until we see how many bytes were written
@@ -766,10 +764,10 @@
// check multicast address is compatible with this socket
if (group instanceof Inet4Address) {
if (family == StandardProtocolFamily.INET6 && !Net.canIPv6SocketJoinIPv4Group())
- throw new IllegalArgumentException("Group is not IPv4 multicast address");
+ throw new IllegalArgumentException("IPv6 socket cannot join IPv4 multicast group");
} else if (group instanceof Inet6Address) {
if (family != StandardProtocolFamily.INET6)
- throw new IllegalArgumentException("Group is not IPv6 multicast address");
+ throw new IllegalArgumentException("Only IPv6 sockets can join IPv6 multicast group");
} else {
throw new IllegalArgumentException("Address type not supported");
}
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/sun/nio/ch/IOUtil.java
--- a/src/share/classes/sun/nio/ch/IOUtil.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/sun/nio/ch/IOUtil.java Tue Apr 12 14:23:03 2011 -0700
@@ -50,9 +50,8 @@
int lim = src.limit();
assert (pos <= lim);
int rem = (pos <= lim ? lim - pos : 0);
- ByteBuffer bb = null;
+ ByteBuffer bb = Util.getTemporaryDirectBuffer(rem);
try {
- bb = Util.getTemporaryDirectBuffer(rem);
bb.put(src);
bb.flip();
// Do not update src until we see how many bytes were written
@@ -187,9 +186,8 @@
return readIntoNativeBuffer(fd, dst, position, nd, lock);
// Substitute a native buffer
- ByteBuffer bb = null;
+ ByteBuffer bb = Util.getTemporaryDirectBuffer(dst.remaining());
try {
- bb = Util.getTemporaryDirectBuffer(dst.remaining());
int n = readIntoNativeBuffer(fd, bb, position, nd, lock);
bb.flip();
if (n > 0)
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/sun/nio/fs/Util.java
--- a/src/share/classes/sun/nio/fs/Util.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/sun/nio/fs/Util.java Tue Apr 12 14:23:03 2011 -0700
@@ -26,6 +26,7 @@
package sun.nio.fs;
import java.util.*;
+import java.nio.file.*;
/**
* Utility methods
@@ -80,4 +81,21 @@
}
return set;
}
+
+ /**
+ * Returns {@code true} if symbolic links should be followed
+ */
+ static boolean followLinks(LinkOption... options) {
+ boolean followLinks = true;
+ for (LinkOption option: options) {
+ if (option == LinkOption.NOFOLLOW_LINKS) {
+ followLinks = false;
+ } else if (option == null) {
+ throw new NullPointerException();
+ } else {
+ throw new AssertionError("Should not get here");
+ }
+ }
+ return followLinks;
+ }
}
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/sun/security/jgss/krb5/InitSecContextToken.java
--- a/src/share/classes/sun/security/jgss/krb5/InitSecContextToken.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/sun/security/jgss/krb5/InitSecContextToken.java Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -127,8 +127,8 @@
//System.out.println("Sub-Session Key Missing in Authenticator.\n");
}
- OverloadedChecksum gssChecksum =
- new OverloadedChecksum(context, apReq.getChecksum(), sessionKey);
+ OverloadedChecksum gssChecksum = new OverloadedChecksum(
+ context, apReq.getChecksum(), sessionKey, subKey);
gssChecksum.setContextFlags(context);
Credentials delegCred = gssChecksum.getDelegatedCreds();
if (delegCred != null) {
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/sun/security/jgss/krb5/InitialToken.java
--- a/src/share/classes/sun/security/jgss/krb5/InitialToken.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/sun/security/jgss/krb5/InitialToken.java Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -210,8 +210,8 @@
// be passed in if this checksum type denotes a
// raw_checksum. In that case, make Checksum class krb5
// internal.
- public OverloadedChecksum(Krb5Context context,
- Checksum checksum, EncryptionKey key)
+ public OverloadedChecksum(Krb5Context context, Checksum checksum,
+ EncryptionKey key, EncryptionKey subKey)
throws GSSException, KrbException, IOException {
int pos = 0;
@@ -283,9 +283,17 @@
new KrbCred(credBytes, EncryptionKey.NULL_KEY).
getDelegatedCreds()[0];
} else {
- delegCreds =
- new KrbCred(credBytes, key).
- getDelegatedCreds()[0];
+ KrbCred cred;
+ try {
+ cred = new KrbCred(credBytes, key);
+ } catch (KrbException e) {
+ if (subKey != null) {
+ cred = new KrbCred(credBytes, subKey);
+ } else {
+ throw e;
+ }
+ }
+ delegCreds = cred.getDelegatedCreds()[0];
}
}
}
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/sun/security/krb5/KrbApReq.java
--- a/src/share/classes/sun/security/krb5/KrbApReq.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/sun/security/krb5/KrbApReq.java Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -37,6 +37,7 @@
import java.net.InetAddress;
import sun.security.util.*;
import java.io.IOException;
+import java.util.Arrays;
/**
* This class encapsulates a KRB-AP-REQ that a client sends to a
@@ -54,9 +55,6 @@
private static CacheTable table = new CacheTable();
private static boolean DEBUG = Krb5.DEBUG;
- // default is address-less tickets
- private boolean KDC_EMPTY_ADDRESSES_ALLOWED = true;
-
/**
* Contructs a AP-REQ message to send to the peer.
* @param tgsCred the Credentials to be used to construct the
@@ -312,23 +310,19 @@
table.put(client, time, currTime.getTime());
}
- // check to use addresses in tickets
- if (Config.getInstance().useAddresses()) {
- KDC_EMPTY_ADDRESSES_ALLOWED = false;
- }
-
- // sender host address
- HostAddress sender = null;
if (initiator != null) {
- sender = new HostAddress(initiator);
- }
-
- if (sender != null || !KDC_EMPTY_ADDRESSES_ALLOWED) {
- if (enc_ticketPart.caddr != null) {
- if (sender == null)
- throw new KrbApErrException(Krb5.KRB_AP_ERR_BADADDR);
- if (!enc_ticketPart.caddr.inList(sender))
- throw new KrbApErrException(Krb5.KRB_AP_ERR_BADADDR);
+ // sender host address
+ HostAddress sender = new HostAddress(initiator);
+ if (enc_ticketPart.caddr != null
+ && !enc_ticketPart.caddr.inList(sender)) {
+ if (DEBUG) {
+ System.out.println(">>> KrbApReq: initiator is "
+ + sender.getInetAddress()
+ + ", but caddr is "
+ + Arrays.toString(
+ enc_ticketPart.caddr.getInetAddresses()));
+ }
+ throw new KrbApErrException(Krb5.KRB_AP_ERR_BADADDR);
}
}
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/sun/security/pkcs/PKCS7.java
--- a/src/share/classes/sun/security/pkcs/PKCS7.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/sun/security/pkcs/PKCS7.java Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -38,6 +38,7 @@
import sun.security.util.*;
import sun.security.x509.AlgorithmId;
import sun.security.x509.CertificateIssuerName;
+import sun.security.x509.KeyUsageExtension;
import sun.security.x509.X509CertImpl;
import sun.security.x509.X509CertInfo;
import sun.security.x509.X509CRLImpl;
@@ -492,7 +493,7 @@
// CRLs (optional)
if (crls != null && crls.length != 0) {
// cast to X509CRLImpl[] since X509CRLImpl implements DerEncoder
- Set implCRLs = new HashSet(crls.length);
+ Set implCRLs = new HashSet<>(crls.length);
for (X509CRL crl: crls) {
if (crl instanceof X509CRLImpl)
implCRLs.add((X509CRLImpl) crl);
@@ -530,6 +531,168 @@
}
/**
+ * Verifying signed data using an external chunked data source.
+ */
+ public static class PKCS7Verifier {
+
+ private final SignerInfo si; // Signer to verify
+ private final MessageDigest md; // MessageDigest object for chunks
+ private final Signature sig; // Signature object for chunks
+
+ private PKCS7Verifier(SignerInfo si, MessageDigest md, Signature sig) {
+ this.si = si;
+ this.md = md;
+ this.sig = sig;
+ }
+
+ public static PKCS7Verifier from(PKCS7 block, SignerInfo si) throws
+ SignatureException, NoSuchAlgorithmException {
+
+ try {
+ MessageDigest md = null;
+ Signature sig;
+
+ ContentInfo content = block.getContentInfo();
+ String digestAlgname = si.getDigestAlgorithmId().getName();
+
+ // if there are authenticate attributes, feed data chunks to
+ // the message digest. In this case, pv.md is not null
+ if (si.authenticatedAttributes != null) {
+ // first, check content type
+ ObjectIdentifier contentType = (ObjectIdentifier)
+ si.authenticatedAttributes.getAttributeValue(
+ PKCS9Attribute.CONTENT_TYPE_OID);
+ if (contentType == null ||
+ !contentType.equals(content.contentType))
+ return null; // contentType does not match, bad SignerInfo
+
+ // now, check message digest
+ byte[] messageDigest = (byte[])
+ si.authenticatedAttributes.getAttributeValue(
+ PKCS9Attribute.MESSAGE_DIGEST_OID);
+
+ if (messageDigest == null) // fail if there is no message digest
+ return null;
+
+ md = MessageDigest.getInstance(digestAlgname);
+ }
+
+ // put together digest algorithm and encryption algorithm
+ // to form signing algorithm
+ String encryptionAlgname =
+ si.getDigestEncryptionAlgorithmId().getName();
+
+ // Workaround: sometimes the encryptionAlgname is actually
+ // a signature name
+ String tmp = AlgorithmId.getEncAlgFromSigAlg(encryptionAlgname);
+ if (tmp != null) encryptionAlgname = tmp;
+ String algname = AlgorithmId.makeSigAlg(
+ digestAlgname, encryptionAlgname);
+
+ sig = Signature.getInstance(algname);
+ X509Certificate cert = si.getCertificate(block);
+
+ if (cert == null) {
+ return null;
+ }
+ if (cert.hasUnsupportedCriticalExtension()) {
+ throw new SignatureException("Certificate has unsupported "
+ + "critical extension(s)");
+ }
+
+ // Make sure that if the usage of the key in the certificate is
+ // restricted, it can be used for digital signatures.
+ // XXX We may want to check for additional extensions in the
+ // future.
+ boolean[] keyUsageBits = cert.getKeyUsage();
+ if (keyUsageBits != null) {
+ KeyUsageExtension keyUsage;
+ try {
+ // We don't care whether or not this extension was marked
+ // critical in the certificate.
+ // We're interested only in its value (i.e., the bits set)
+ // and treat the extension as critical.
+ keyUsage = new KeyUsageExtension(keyUsageBits);
+ } catch (IOException ioe) {
+ throw new SignatureException("Failed to parse keyUsage "
+ + "extension");
+ }
+
+ boolean digSigAllowed = ((Boolean)keyUsage.get(
+ KeyUsageExtension.DIGITAL_SIGNATURE)).booleanValue();
+
+ boolean nonRepuAllowed = ((Boolean)keyUsage.get(
+ KeyUsageExtension.NON_REPUDIATION)).booleanValue();
+
+ if (!digSigAllowed && !nonRepuAllowed) {
+ throw new SignatureException("Key usage restricted: "
+ + "cannot be used for "
+ + "digital signatures");
+ }
+ }
+
+ PublicKey key = cert.getPublicKey();
+ sig.initVerify(key);
+ return new PKCS7Verifier(si, md, sig);
+ } catch (IOException e) {
+ throw new SignatureException("IO error verifying signature:\n" +
+ e.getMessage());
+
+ } catch (InvalidKeyException e) {
+ throw new SignatureException("InvalidKey: " + e.getMessage());
+
+ }
+ }
+
+ public void update(byte[] data, int off, int end)
+ throws SignatureException {
+ if (md != null) {
+ md.update(data, off, end-off);
+ } else {
+ sig.update(data, off, end-off);
+ }
+ }
+
+ public SignerInfo verify() throws SignatureException {
+ try {
+ // if there are authenticate attributes, get the message
+ // digest and compare it with the digest of data
+ if (md != null) {
+ // now, check message digest
+ byte[] messageDigest = (byte[])
+ si.authenticatedAttributes.getAttributeValue(
+ PKCS9Attribute.MESSAGE_DIGEST_OID);
+
+ byte[] computedMessageDigest = md.digest();
+
+ if (!MessageDigest.isEqual(
+ messageDigest, computedMessageDigest)) {
+ return null;
+ }
+
+ // message digest attribute matched
+ // digest of original data
+
+ // the data actually signed is the DER encoding of
+ // the authenticated attributes (tagged with
+ // the "SET OF" tag, not 0xA0).
+ byte[] dataSigned = si.authenticatedAttributes.getDerEncoding();
+ sig.update(dataSigned);
+ }
+
+ if (sig.verify(si.getEncryptedDigest())) {
+ return si;
+ }
+
+ } catch (IOException e) {
+ throw new SignatureException("IO error verifying signature:\n" +
+ e.getMessage());
+ }
+ return null;
+ }
+ }
+
+ /**
* This verifies a given SignerInfo.
*
* @param info the signer information.
@@ -554,19 +717,16 @@
public SignerInfo[] verify(byte[] bytes)
throws NoSuchAlgorithmException, SignatureException {
- Vector intResult = new Vector();
+ List intResult = new ArrayList<>();
for (int i = 0; i < signerInfos.length; i++) {
SignerInfo signerInfo = verify(signerInfos[i], bytes);
if (signerInfo != null) {
- intResult.addElement(signerInfo);
+ intResult.add(signerInfo);
}
}
- if (intResult.size() != 0) {
-
- SignerInfo[] result = new SignerInfo[intResult.size()];
- intResult.copyInto(result);
- return result;
+ if (!intResult.isEmpty()) {
+ return intResult.toArray(new SignerInfo[intResult.size()]);
}
return null;
}
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/sun/security/pkcs/SignerInfo.java
--- a/src/share/classes/sun/security/pkcs/SignerInfo.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/sun/security/pkcs/SignerInfo.java Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -230,7 +230,7 @@
if (userCert == null)
return null;
- ArrayList certList = new ArrayList();
+ ArrayList certList = new ArrayList<>();
certList.add(userCert);
X509Certificate[] pkcsCerts = block.getCertificates();
@@ -276,132 +276,20 @@
/* Returns null if verify fails, this signerInfo if
verify succeeds. */
SignerInfo verify(PKCS7 block, byte[] data)
- throws NoSuchAlgorithmException, SignatureException {
-
- try {
-
- ContentInfo content = block.getContentInfo();
- if (data == null) {
- data = content.getContentBytes();
- }
-
- String digestAlgname = getDigestAlgorithmId().getName();
-
- byte[] dataSigned;
-
- // if there are authenticate attributes, get the message
- // digest and compare it with the digest of data
- if (authenticatedAttributes == null) {
- dataSigned = data;
- } else {
-
- // first, check content type
- ObjectIdentifier contentType = (ObjectIdentifier)
- authenticatedAttributes.getAttributeValue(
- PKCS9Attribute.CONTENT_TYPE_OID);
- if (contentType == null ||
- !contentType.equals(content.contentType))
- return null; // contentType does not match, bad SignerInfo
-
- // now, check message digest
- byte[] messageDigest = (byte[])
- authenticatedAttributes.getAttributeValue(
- PKCS9Attribute.MESSAGE_DIGEST_OID);
-
- if (messageDigest == null) // fail if there is no message digest
- return null;
-
- MessageDigest md = MessageDigest.getInstance(digestAlgname);
- byte[] computedMessageDigest = md.digest(data);
-
- if (messageDigest.length != computedMessageDigest.length)
- return null;
- for (int i = 0; i < messageDigest.length; i++) {
- if (messageDigest[i] != computedMessageDigest[i])
- return null;
- }
-
- // message digest attribute matched
- // digest of original data
-
- // the data actually signed is the DER encoding of
- // the authenticated attributes (tagged with
- // the "SET OF" tag, not 0xA0).
- dataSigned = authenticatedAttributes.getDerEncoding();
- }
-
- // put together digest algorithm and encryption algorithm
- // to form signing algorithm
- String encryptionAlgname =
- getDigestEncryptionAlgorithmId().getName();
+ throws NoSuchAlgorithmException, SignatureException {
- // Workaround: sometimes the encryptionAlgname is actually
- // a signature name
- String tmp = AlgorithmId.getEncAlgFromSigAlg(encryptionAlgname);
- if (tmp != null) encryptionAlgname = tmp;
- String algname = AlgorithmId.makeSigAlg(
- digestAlgname, encryptionAlgname);
-
- Signature sig = Signature.getInstance(algname);
- X509Certificate cert = getCertificate(block);
-
- if (cert == null) {
- return null;
- }
- if (cert.hasUnsupportedCriticalExtension()) {
- throw new SignatureException("Certificate has unsupported "
- + "critical extension(s)");
+ PKCS7.PKCS7Verifier p7v = PKCS7.PKCS7Verifier.from(block, this);
+ if (p7v == null) return null;
+ if (data == null) {
+ try {
+ data = block.getContentInfo().getContentBytes();
+ } catch (IOException e) {
+ throw new SignatureException("IO error verifying signature:\n" +
+ e.getMessage());
}
-
- // Make sure that if the usage of the key in the certificate is
- // restricted, it can be used for digital signatures.
- // XXX We may want to check for additional extensions in the
- // future.
- boolean[] keyUsageBits = cert.getKeyUsage();
- if (keyUsageBits != null) {
- KeyUsageExtension keyUsage;
- try {
- // We don't care whether or not this extension was marked
- // critical in the certificate.
- // We're interested only in its value (i.e., the bits set)
- // and treat the extension as critical.
- keyUsage = new KeyUsageExtension(keyUsageBits);
- } catch (IOException ioe) {
- throw new SignatureException("Failed to parse keyUsage "
- + "extension");
- }
-
- boolean digSigAllowed = ((Boolean)keyUsage.get(
- KeyUsageExtension.DIGITAL_SIGNATURE)).booleanValue();
-
- boolean nonRepuAllowed = ((Boolean)keyUsage.get(
- KeyUsageExtension.NON_REPUDIATION)).booleanValue();
-
- if (!digSigAllowed && !nonRepuAllowed) {
- throw new SignatureException("Key usage restricted: "
- + "cannot be used for "
- + "digital signatures");
- }
- }
-
- PublicKey key = cert.getPublicKey();
- sig.initVerify(key);
-
- sig.update(dataSigned);
-
- if (sig.verify(encryptedDigest)) {
- return this;
- }
-
- } catch (IOException e) {
- throw new SignatureException("IO error verifying signature:\n" +
- e.getMessage());
-
- } catch (InvalidKeyException e) {
- throw new SignatureException("InvalidKey: " + e.getMessage());
-
}
- return null;
+ p7v.update(data, 0, data.length);
+ return p7v.verify();
}
/* Verify the content of the pkcs7 block. */
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/sun/security/ssl/CipherSuiteList.java
--- a/src/share/classes/sun/security/ssl/CipherSuiteList.java Fri Apr 08 10:31:14 2011 -0700
+++ b/src/share/classes/sun/security/ssl/CipherSuiteList.java Tue Apr 12 14:23:03 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -40,10 +40,6 @@
*/
final class CipherSuiteList {
- // lists of supported and default enabled ciphersuites
- // created on demand
- private static CipherSuiteList supportedSuites, defaultSuites;
-
private final Collection cipherSuites;
private String[] suiteNames;
@@ -206,57 +202,8 @@
*/
static synchronized void clearAvailableCache() {
if (CipherSuite.DYNAMIC_AVAILABILITY) {
- supportedSuites = null;
- defaultSuites = null;
CipherSuite.BulkCipher.clearAvailableCache();
JsseJce.clearEcAvailable();
}
}
-
- /**
- * Return the list of all available CipherSuites with a priority of
- * minPriority or above.
- * Should be called with the Class lock held.
- */
- private static CipherSuiteList buildAvailableCache(int minPriority) {
- // SortedSet automatically arranges ciphersuites in default
- // preference order
- Set cipherSuites = new TreeSet<>();
- Collection allowedCipherSuites =
- CipherSuite.allowedCipherSuites();
- for (CipherSuite c : allowedCipherSuites) {
- if ((c.allowed == false) || (c.priority < minPriority)) {
- continue;
- }
-
- if (c.isAvailable()) {
- cipherSuites.add(c);
- }
- }
-
- return new CipherSuiteList(cipherSuites);
- }
-
- /**
- * Return supported CipherSuites in preference order.
- */
- static synchronized CipherSuiteList getSupported() {
- if (supportedSuites == null) {
- supportedSuites =
- buildAvailableCache(CipherSuite.SUPPORTED_SUITES_PRIORITY);
- }
- return supportedSuites;
- }
-
- /**
- * Return default enabled CipherSuites in preference order.
- */
- static synchronized CipherSuiteList getDefault() {
- if (defaultSuites == null) {
- defaultSuites =
- buildAvailableCache(CipherSuite.DEFAULT_SUITES_PRIORITY);
- }
- return defaultSuites;
- }
-
}
diff -r 557bd9b5d92f -r e142148d8b54 src/share/classes/sun/security/ssl/DefaultSSLContextImpl.java
--- a/src/share/classes/sun/security/ssl/DefaultSSLContextImpl.java Fri Apr 08 10:31:14 2011 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 2005, 2007, 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 sun.security.ssl;
-
-import java.io.*;
-import java.util.*;
-
-import java.security.*;
-
-import javax.net.ssl.*;
-
-/**
- * "Default" SSLContext as returned by SSLContext.getDefault(). It comes
- * initialized with default KeyManagers and TrustManagers created using
- * various system properties.
- *
- * @since 1.6
- */
-public final class DefaultSSLContextImpl extends SSLContextImpl {
-
- private static final String NONE = "NONE";
- private static final String P11KEYSTORE = "PKCS11";
- private static final Debug debug = Debug.getInstance("ssl");
-
- private static volatile SSLContextImpl defaultImpl;
-
- private static TrustManager[] defaultTrustManagers;
-
- private static KeyManager[] defaultKeyManagers;
-
- public DefaultSSLContextImpl() throws Exception {
- super(defaultImpl);
- try {
- super.engineInit(getDefaultKeyManager(), getDefaultTrustManager(), null);
- } catch (Exception e) {
- if (debug != null && Debug.isOn("defaultctx")) {
- System.out.println("default context init failed: " + e);
- }
- throw e;
- }
- if (defaultImpl == null) {
- defaultImpl = this;
- }
- }
-
- protected void engineInit(KeyManager[] km, TrustManager[] tm,
- SecureRandom sr) throws KeyManagementException {
- throw new KeyManagementException
- ("Default SSLContext is initialized automatically");
- }
-
- static synchronized SSLContextImpl getDefaultImpl() throws Exception {
- if (defaultImpl == null) {
- new DefaultSSLContextImpl();
- }
- return defaultImpl;
- }
-
- private static synchronized TrustManager[] getDefaultTrustManager() throws Exception {
- if (defaultTrustManagers != null) {
- return defaultTrustManagers;
- }
-
- KeyStore ks = TrustManagerFactoryImpl.getCacertsKeyStore("defaultctx");
-
- TrustManagerFactory tmf = TrustManagerFactory.getInstance(
- TrustManagerFactory.getDefaultAlgorithm());
- tmf.init(ks);
- defaultTrustManagers = tmf.getTrustManagers();
- return defaultTrustManagers;
- }
-
- private static synchronized KeyManager[] getDefaultKeyManager() throws Exception {
- if (defaultKeyManagers != null) {
- return defaultKeyManagers;
- }
-
- final Map props = new HashMap<>();
- AccessController.doPrivileged(
- new PrivilegedExceptionAction