提交 7d9c5d37 编写于 作者: A asaha

Merge

#
# 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 @@ build: unpacker
vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)
ifeq ($(STANDALONE),true)
ZIPOBJDIR = $(OUTPUTDIR)/tmp/sun/java.util.zip/zip/$(OBJDIRNAME)
......@@ -131,8 +127,9 @@ prop:
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 @@ winres::
$(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
......
#
# 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:
*;
};
......@@ -76,7 +76,6 @@ endif
endif # PLATFORM
ifeq ($(PLATFORM), linux)
ifeq ($(VARIANT), OPT)
......
#
# 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_default_rule: all
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
......
......@@ -198,10 +198,12 @@ INSTALL_DOT_LIB = true
#
# 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)
......
#
# 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 @@ OTHER_CPPFLAGS += -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"'
ifeq ($(PLATFORM), solaris)
LDFLAGS += -R$(OPENWIN_LIB)
LDFLAGS += -M mapfile-$(ARCH)
endif
#
# 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
......
#
# 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
......
#
# 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
......
#
# 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
......
......@@ -86,7 +86,8 @@ OTHER_INCLUDES += \
-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
#
......
#
# 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 @@ else
endif
SUBDIRS =
SUBDIRS_misc = nio scripting nbproject
SUBDIRS_misc = nio scripting nbproject forkjoin
SUBDIRS_enterprise = $(WEBSERVICES_SUBDIR)
SUBDIRS_management = jmx
......
#
# 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
#
# 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
#
# 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 @@ BUILDDIR = ../..
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::
......
#
# 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
/*
* 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 @@ char *JLI_StringDup(const char *s1);
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 @@ int JLI_StrCCmp(const char *s1, const char* s2);
#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
......
......@@ -4184,9 +4184,11 @@ class Character implements java.io.Serializable, Comparable<Character> {
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 @@ class Character implements java.io.Serializable, Comparable<Character> {
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);
......
......@@ -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 class AccessibleObject implements AnnotatedElement {
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
}
}
......@@ -74,14 +74,6 @@ public final
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 @@ public final
* 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 @@ public final
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,20 +553,22 @@ public final
// 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);
}
return tmp;
}
// Returns ConstructorAccessor for this Constructor object, not
// looking up the chain to the root
ConstructorAccessor getConstructorAccessor() {
......
......@@ -79,11 +79,6 @@ class Field extends AccessibleObject implements Member {
// 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 @@ class Field extends AccessibleObject implements Member {
* instance of the class or interface declaring the underlying
* field, the method throws an {@code IllegalArgumentException}.
*
* <p>If this {@code Field} object enforces Java language access control, and
* <p>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 @@ class Field extends AccessibleObject implements Member {
* {@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 @@ class Field extends AccessibleObject implements Member {
* 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 @@ class Field extends AccessibleObject implements Member {
* 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 @@ class Field extends AccessibleObject implements Member {
* 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 @@ class Field extends AccessibleObject implements Member {
* 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 @@ class Field extends AccessibleObject implements Member {
* 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 @@ class Field extends AccessibleObject implements Member {
* 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 @@ class Field extends AccessibleObject implements Member {
* 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 @@ class Field extends AccessibleObject implements Member {
* 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 @@ class Field extends AccessibleObject implements Member {
* an instance of the class or interface declaring the underlying
* field, the method throws an {@code IllegalArgumentException}.
*
* <p>If this {@code Field} object enforces Java language access control, and
* <p>If this {@code Field} object is enforcing Java language access control, and
* the underlying field is inaccessible, the method throws an
* {@code IllegalAccessException}.
*
* <p>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 @@ class Field extends AccessibleObject implements Member {
* @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 @@ class Field extends AccessibleObject implements Member {
* @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 @@ class Field extends AccessibleObject implements Member {
* @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 @@ class Field extends AccessibleObject implements Member {
* @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 @@ class Field extends AccessibleObject implements Member {
* @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 @@ class Field extends AccessibleObject implements Member {
* @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 @@ class Field extends AccessibleObject implements Member {
* @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 @@ class Field extends AccessibleObject implements Member {
* @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 @@ class Field extends AccessibleObject implements Member {
* @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 @@ class Field extends AccessibleObject implements Member {
tmp = reflectionFactory.newFieldAccessor(this, overrideFinalCheck);
setFieldAccessor(tmp, overrideFinalCheck);
}
return tmp;
}
......@@ -965,21 +979,8 @@ class Field extends AccessibleObject implements Member {
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);
}
}
}
......
......@@ -83,11 +83,6 @@ public final
// 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 final
*/
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 @@ public final
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 @@ public final
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 @@ public final
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 @@ public final
((Class)exceptions[k]).getName():
exceptions[k].toString());
if (k < (exceptions.length - 1))
sb.append(",");
sb.append(',');
}
}
return sb.toString();
......@@ -565,7 +561,7 @@ public final
* {@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 @@ public final
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);
}
}
MethodAccessor ma = methodAccessor; // read volatile
if (ma == null) {
ma = acquireMethodAccessor();
}
if (methodAccessor == null) acquireMethodAccessor();
return methodAccessor.invoke(obj, args);
return ma.invoke(obj, args);
}
/**
......@@ -654,20 +639,22 @@ public final
// (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);
}
return tmp;
}
// Returns MethodAccessor for this Method object, not looking up
// the chain to the root
MethodAccessor getMethodAccessor() {
......
......@@ -2067,7 +2067,7 @@ public final class Files {
*
* @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 @@ public final class Files {
*
* @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 @@ public final class Files {
* 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
......
......@@ -550,18 +550,21 @@ public interface Path
* <p> If this path is relative then its absolute path is first obtained,
* as if by invoking the {@link #toAbsolutePath toAbsolutePath} method.
*
* <p> 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 <em>real
* path</em>, 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.
* <p> 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 <em>real path</em>, 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 <em>real</em> path of the file
* located by this object
......@@ -576,7 +579,7 @@ public interface Path
* 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
......
......@@ -80,7 +80,7 @@ public class DriverManager {
// List of registered JDBC drivers
private final static CopyOnWriteArrayList<Driver> registeredDrivers = new CopyOnWriteArrayList<Driver>();
private final static CopyOnWriteArrayList<DriverInfo> registeredDrivers = new CopyOnWriteArrayList<DriverInfo>();
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 @@ public class DriverManager {
// 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 @@ public class DriverManager {
/* 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 @@ public class DriverManager {
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 @@ public class DriverManager {
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 @@ public class DriverManager {
private static void loadInitialDrivers() {
String drivers;
try {
drivers = (String) AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
drivers = AccessController.doPrivileged(new PrivilegedAction<String>() {
public String run() {
return System.getProperty("jdbc.drivers");
}
});
......@@ -495,8 +496,8 @@ public class DriverManager {
// 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<Void>() {
public Void run() {
ServiceLoader<Driver> loadedDrivers = ServiceLoader.load(Driver.class);
Iterator driversIterator = loadedDrivers.iterator();
......@@ -569,16 +570,16 @@ public class DriverManager {
// 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 @@ public class DriverManager {
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 + "]");
}
}
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -106,7 +106,7 @@ public class EnumMap<K extends Enum<K>, V> extends AbstractMap<K, V>
/**
* 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 @@ public class EnumMap<K extends Enum<K>, V> extends AbstractMap<K, V>
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 class EnumMap<K extends Enum<K>, V> extends AbstractMap<K, V>
public Iterator<Map.Entry<K,V>> iterator() {
return new EntryIterator();
}
public boolean contains(Object o) {
if (!(o instanceof Map.Entry))
return false;
......@@ -552,72 +553,84 @@ public class EnumMap<K extends Enum<K>, V> extends AbstractMap<K, V>
}
}
/**
* Since we don't use Entry objects, we use the Iterator itself as entry.
*/
private class EntryIterator extends EnumMapIterator<Map.Entry<K,V>>
implements Map.Entry<K,V>
{
private class EntryIterator extends EnumMapIterator<Map.Entry<K,V>> {
private Entry lastReturnedEntry = null;
public Map.Entry<K,V> next() {
if (!hasNext())
throw new NoSuchElementException();
lastReturnedIndex = index++;
return this;
lastReturnedEntry = new Entry(index++);
return lastReturnedEntry;
}
public void remove() {
lastReturnedIndex =
((null == lastReturnedEntry) ? -1 : lastReturnedEntry.index);
super.remove();
lastReturnedEntry.index = lastReturnedIndex;
lastReturnedEntry = null;
}
private class Entry implements Map.Entry<K,V> {
private int index;
private Entry(int index) {
this.index = index;
}
public K getKey() {
checkLastReturnedIndexForEntryUse();
return keyUniverse[lastReturnedIndex];
checkIndexForEntryUse();
return keyUniverse[index];
}
public V getValue() {
checkLastReturnedIndexForEntryUse();
return unmaskNull(vals[lastReturnedIndex]);
checkIndexForEntryUse();
return unmaskNull(vals[index]);
}
public V setValue(V value) {
checkLastReturnedIndexForEntryUse();
V oldValue = unmaskNull(vals[lastReturnedIndex]);
vals[lastReturnedIndex] = maskNull(value);
checkIndexForEntryUse();
V oldValue = unmaskNull(vals[index]);
vals[index] = maskNull(value);
return oldValue;
}
public boolean equals(Object o) {
if (lastReturnedIndex < 0)
if (index < 0)
return o == this;
if (!(o instanceof Map.Entry))
return false;
Map.Entry e = (Map.Entry)o;
V ourValue = unmaskNull(vals[lastReturnedIndex]);
V ourValue = unmaskNull(vals[index]);
Object hisValue = e.getValue();
return e.getKey() == keyUniverse[lastReturnedIndex] &&
return (e.getKey() == keyUniverse[index] &&
(ourValue == hisValue ||
(ourValue != null && ourValue.equals(hisValue)));
(ourValue != null && ourValue.equals(hisValue))));
}
public int hashCode() {
if (lastReturnedIndex < 0)
if (index < 0)
return super.hashCode();
Object value = vals[lastReturnedIndex];
return keyUniverse[lastReturnedIndex].hashCode()
^ (value == NULL ? 0 : value.hashCode());
return entryHashCode(index);
}
public String toString() {
if (lastReturnedIndex < 0)
if (index < 0)
return super.toString();
return keyUniverse[lastReturnedIndex] + "="
+ unmaskNull(vals[lastReturnedIndex]);
return keyUniverse[index] + "="
+ unmaskNull(vals[index]);
}
private void checkLastReturnedIndexForEntryUse() {
if (lastReturnedIndex < 0)
private void checkIndexForEntryUse() {
if (index < 0)
throw new IllegalStateException("Entry was removed");
}
}
}
// Comparison and hashing
......@@ -631,10 +644,35 @@ public class EnumMap<K extends Enum<K>, V> extends AbstractMap<K, V>
* @return <tt>true</tt> 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<K,V> m = (Map<K,V>)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;
......@@ -649,6 +687,26 @@ public class EnumMap<K extends Enum<K>, V> extends AbstractMap<K, V>
return true;
}
/**
* 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 @@ public class EnumMap<K extends Enum<K>, V> extends AbstractMap<K, V>
s.writeInt(size);
// Write out keys and values (alternating)
for (Map.Entry<K,V> 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--;
}
}
}
......
/*
* 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 @@ public class IdentityHashMap<K,V>
}
}
/**
* Since we don't use Entry objects, we use the Iterator
* itself as an entry.
*/
private class EntryIterator
extends IdentityHashMapIterator<Map.Entry<K,V>>
implements Map.Entry<K,V>
{
private Entry lastReturnedEntry = null;
public Map.Entry<K,V> 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");
public void remove() {
lastReturnedIndex =
((null == lastReturnedEntry) ? -1 : lastReturnedEntry.index);
super.remove();
lastReturnedEntry.index = lastReturnedIndex;
lastReturnedEntry = null;
}
private class Entry implements Map.Entry<K,V> {
private int index;
return (K) unmaskNull(traversalTable[lastReturnedIndex]);
private Entry(int index) {
this.index = index;
}
public V getValue() {
// Provide a better exception than out of bounds index
if (lastReturnedIndex < 0)
throw new IllegalStateException("Entry was removed");
public K getKey() {
checkIndexForEntryUse();
return (K) unmaskNull(traversalTable[index]);
}
return (V) traversalTable[lastReturnedIndex+1];
public V getValue() {
checkIndexForEntryUse();
return (V) traversalTable[index+1];
}
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;
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[lastReturnedIndex], value);
put((K) traversalTable[index], value);
return oldValue;
}
public boolean equals(Object o) {
if (lastReturnedIndex < 0)
if (index < 0)
return super.equals(o);
if (!(o instanceof Map.Entry))
return false;
Map.Entry e = (Map.Entry)o;
return e.getKey() == getKey() &&
e.getValue() == getValue();
return (e.getKey() == unmaskNull(traversalTable[index]) &&
e.getValue() == traversalTable[index+1]);
}
public int hashCode() {
if (lastReturnedIndex < 0)
return super.hashCode();
return System.identityHashCode(getKey()) ^
System.identityHashCode(getValue());
return (System.identityHashCode(unmaskNull(traversalTable[index])) ^
System.identityHashCode(traversalTable[index+1]));
}
public String toString() {
if (lastReturnedIndex < 0)
if (index < 0)
return super.toString();
return getKey() + "=" + getValue();
return (unmaskNull(traversalTable[index]) + "="
+ traversalTable[index+1]);
}
private void checkIndexForEntryUse() {
if (index < 0)
throw new IllegalStateException("Entry was removed");
}
}
}
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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/
*/
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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 @@ public class ForkJoinPool extends AbstractExecutorService {
/**
* 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 @@ public class ForkJoinPool extends AbstractExecutorService {
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 @@ public class ForkJoinPool extends AbstractExecutorService {
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 @@ public class ForkJoinPool extends AbstractExecutorService {
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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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/
*/
/**
......
......@@ -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;
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册