# HG changeset patch
# User kamg
# Date 1288136908 25200
# Node ID 2c819a885d10ea3bbd678c9720bbbe43fa0903fb
# Parent fd89b5882576e3e58f7107c2b87693b7ff16c860# Parent 58ca130ef652f7dbcf940284d61daf3f5715adc4
Merge
diff -r fd89b5882576 -r 2c819a885d10 .hgignore
--- a/.hgignore Tue Oct 26 14:08:49 2010 -0400
+++ b/.hgignore Tue Oct 26 16:48:28 2010 -0700
@@ -1,3 +1,4 @@
^build/
^dist/
/nbproject/private/
+^webrev
diff -r fd89b5882576 -r 2c819a885d10 .hgtags
--- a/.hgtags Tue Oct 26 14:08:49 2010 -0400
+++ b/.hgtags Tue Oct 26 16:48:28 2010 -0700
@@ -87,3 +87,5 @@
a6442d6bc38a44152e0662688213ce4d2701f42a jdk7-b110
69f3edf083477955b5bd2f754252c7504167d8e1 jdk7-b111
f960f117f1623629f64203e2b09a92a8f6f14ff5 jdk7-b112
+1fee41c7ed2b3388970a756a85aa693c0de8407a jdk7-b113
+750c1ccb2f2d1ddfa95ab6c7f897fdab2f87f7e9 jdk7-b114
diff -r fd89b5882576 -r 2c819a885d10 .hgtags-top-repo
--- a/.hgtags-top-repo Tue Oct 26 14:08:49 2010 -0400
+++ b/.hgtags-top-repo Tue Oct 26 16:48:28 2010 -0700
@@ -87,3 +87,5 @@
2a02d4a6955c7c078aee9a604cb3be409800d82c jdk7-b110
9702d6fef68e17533ee7fcf5923b11ead3e912ce jdk7-b111
b852103caf73da70068473777ae867a457bb3ae1 jdk7-b112
+c1df968c4527bfab5f97662a89245f15d12d378b jdk7-b113
+27985a5c6e5268014d25d55886e0ecb96af4763d jdk7-b114
diff -r fd89b5882576 -r 2c819a885d10 Makefile
--- a/Makefile Tue Oct 26 14:08:49 2010 -0400
+++ b/Makefile Tue Oct 26 16:48:28 2010 -0700
@@ -558,9 +558,12 @@
# rule to test
################################################################
-.NOTPARALLEL: test
+.NOTPARALLEL: test_run
-test: test_clean test_start test_summary
+test:
+ $(MAKE) test_run
+
+test_run: test_clean test_start test_summary
test_start:
@$(ECHO) "Tests started at `$(DATE)`"
@@ -586,7 +589,7 @@
# Get failure list from log
$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
@$(RM) $@
- @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) > $@
+ @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
# Get log file of all tests run
JDK_TO_TEST := $(shell \
@@ -598,10 +601,11 @@
$(ECHO) "$(PRODUCT_HOME)"; \
fi \
)
+TEST_TARGETS=all
$(OUTPUTDIR)/test_log.txt:
$(RM) $@
- ( $(CD) test && \
- $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) \
+ ( $(CD) test && \
+ $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \
) | tee $@
################################################################
@@ -614,7 +618,7 @@
# PHONY
################################################################
-.PHONY: all test test_start test_summary test_clean \
+.PHONY: all test test_run test_start test_summary test_clean \
generic_build_repo_series \
what clobber insane \
dev dev-build dev-sanity dev-clobber \
diff -r fd89b5882576 -r 2c819a885d10 corba/.hgtags
--- a/corba/.hgtags Tue Oct 26 14:08:49 2010 -0400
+++ b/corba/.hgtags Tue Oct 26 16:48:28 2010 -0700
@@ -87,3 +87,5 @@
0e1f80fda2271f53d4bbb59ec3f301dfbcef6a0a jdk7-b110
640fa4d4e2ad4c2d7e4815c955026740d8c52b7a jdk7-b111
cc67fdc4fee9a5b25caee4e71b51a8ff24ae7d1a jdk7-b112
+a89a6c5be9d1a754868d3d359cbf7ad36aa95631 jdk7-b113
+88fddb73c5c4a4b50c319cbae9380caf5172ab45 jdk7-b114
diff -r fd89b5882576 -r 2c819a885d10 hotspot/.hgtags
--- a/hotspot/.hgtags Tue Oct 26 14:08:49 2010 -0400
+++ b/hotspot/.hgtags Tue Oct 26 16:48:28 2010 -0700
@@ -122,4 +122,6 @@
2f25f2b8de2700a1822463b1bd3d02b5e218018f jdk7-b110
07b042e13dde4f3479ba9ec55120fcd5e8623323 jdk7-b111
5511edd5d719f3fc9fdd04879482026a3d2c8652 jdk7-b112
+beef35b96b81129c375d572357fb9548d9020db1 jdk7-b113
+68d6141ea19de3a9ba98ef753f0da41a61f736a0 jdk7-b114
5511edd5d719f3fc9fdd04879482026a3d2c8652 hs20-b01
diff -r fd89b5882576 -r 2c819a885d10 hotspot/make/hotspot_version
--- a/hotspot/make/hotspot_version Tue Oct 26 14:08:49 2010 -0400
+++ b/hotspot/make/hotspot_version Tue Oct 26 16:48:28 2010 -0700
@@ -35,7 +35,7 @@
HS_MAJOR_VER=20
HS_MINOR_VER=0
-HS_BUILD_NUMBER=01
+HS_BUILD_NUMBER=02
JDK_MAJOR_VER=1
JDK_MINOR_VER=7
diff -r fd89b5882576 -r 2c819a885d10 hotspot/src/share/vm/runtime/arguments.cpp
--- a/hotspot/src/share/vm/runtime/arguments.cpp Tue Oct 26 14:08:49 2010 -0400
+++ b/hotspot/src/share/vm/runtime/arguments.cpp Tue Oct 26 16:48:28 2010 -0700
@@ -2979,6 +2979,13 @@
UseCompressedOops = false;
#endif
+#if defined(_LP64)
+ if ((DumpSharedSpaces || RequireSharedSpaces) && UseCompressedOops) {
+ // Disable compressed oops with shared spaces
+ UseCompressedOops = false;
+ }
+#endif
+
// Set object alignment values.
set_object_alignment();
diff -r fd89b5882576 -r 2c819a885d10 hotspot/src/share/vm/runtime/globals.hpp
--- a/hotspot/src/share/vm/runtime/globals.hpp Tue Oct 26 14:08:49 2010 -0400
+++ b/hotspot/src/share/vm/runtime/globals.hpp Tue Oct 26 16:48:28 2010 -0700
@@ -3545,7 +3545,7 @@
product(uintx, SharedDummyBlockSize, 512*M, \
"Size of dummy block used to shift heap addresses (in bytes)") \
\
- product(uintx, SharedReadWriteSize, 12*M, \
+ product(uintx, SharedReadWriteSize, NOT_LP64(12*M) LP64_ONLY(13*M), \
"Size of read-write space in permanent generation (in bytes)") \
\
product(uintx, SharedReadOnlySize, 10*M, \
diff -r fd89b5882576 -r 2c819a885d10 jaxp/.hgtags
--- a/jaxp/.hgtags Tue Oct 26 14:08:49 2010 -0400
+++ b/jaxp/.hgtags Tue Oct 26 16:48:28 2010 -0700
@@ -87,3 +87,5 @@
d422dbdd09766269344b796b3a46a5b3f74557e1 jdk7-b110
8106c747067c905d814a737a57fea0e29057b33f jdk7-b111
1b05254242881527b4d5d711295c0fe708c8823a jdk7-b112
+bc0c84ce54c34d3e8b0604b94da0d7c75c26755e jdk7-b113
+d57197d22c2bfc39d1a860040f655b466ab46f52 jdk7-b114
diff -r fd89b5882576 -r 2c819a885d10 jaxws/.hgtags
--- a/jaxws/.hgtags Tue Oct 26 14:08:49 2010 -0400
+++ b/jaxws/.hgtags Tue Oct 26 16:48:28 2010 -0700
@@ -87,3 +87,5 @@
95ecac35fb11530752bd0404c9bf02bcfb30990e jdk7-b110
2575ebca96c7fb1b78f6ae025a97321210aba309 jdk7-b111
8e0f0054817f0f73fb33e80fb1333fb45b1d513d jdk7-b112
+d35c94fd22362f478f75b4bfcd2bef6a83cb9b3f jdk7-b113
+400f494c81c5ec87714b705648afbb3cb680bf73 jdk7-b114
diff -r fd89b5882576 -r 2c819a885d10 jdk/.hgtags
--- a/jdk/.hgtags Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/.hgtags Tue Oct 26 16:48:28 2010 -0700
@@ -87,3 +87,5 @@
176586cd040e4dd17a5ff6e91f72df10d7442453 jdk7-b110
fb63a2688db807a73e2a3de7d9bab298f1bff0e8 jdk7-b111
b53f226b1d91473ac54184afa827be07b87e0319 jdk7-b112
+61d3b9fbb26bdef56cfa41b9af5bc312a22cbeb8 jdk7-b113
+e250cef36ea05e627e7e6f7d75e5e19f529e2ba3 jdk7-b114
diff -r fd89b5882576 -r 2c819a885d10 jdk/make/Makefile
--- a/jdk/make/Makefile Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/make/Makefile Tue Oct 26 16:48:28 2010 -0700
@@ -75,7 +75,6 @@
import_fastdebug -- copy in the fastdebug components \n\
import_debug -- copy in the debug components \n\
modules -- build the jdk and jre module images (experimental) \n\
-sccs_get -- make sure all SCCS files are up-to-date (need SCCS) \n\
create_links -- create softlinks in Solaris 32bit build to 64bit dirs \n\
"
@@ -278,21 +277,6 @@
$(OUTPUTDIR) $(TEMPDIR):
$(MKDIR) -p $@
-# cleanup everything. If the workspace is not being built by the control
-# workspace, and if it is a Teamware workspace, then see if there are
-# any files which are not under SCCS control.
-clean clobber::
-ifndef EXTERNALSANITYCONTROL
- @if [ -d $(TOPDIR)/Codemgr_wsdata ]; then \
- $(ECHO) '\nPerforming workspace scan for remnant files.\n' \
- ' Any files listed below are not under SCCS control in the workspace\n' \
- ' and you should review them and possibly remove them manually:' ; \
- $(FIND) $(TOPDIR)/make $(TOPDIR)/src -type f | \
- $(SED) 's+SCCS/[ps]\.++' | $(SORT) | $(UNIQ) -c | $(NAWK) '$$1<2 {print $$2;}' ; \
- $(ECHO) 'End of workspace scan.' ; \
- fi
-endif
-
# this should be the last rule in this file:
all::
@if [ -r $(WARNING_FILE) ]; then \
@@ -341,16 +325,70 @@
include $(BUILDDIR)/common/internal/BinaryPlugs.gmk
#
-# Get top level sccs_get rule
+# Test rule
#
-include $(BUILDDIR)/common/Rules-SCCS.gmk
+
+.NOTPARALLEL: test_run
+
+test:
+ $(MAKE) test_run
+
+test_run: test_clean test_start test_summary
+
+test_start:
+ @$(ECHO) "Tests started at `$(DATE)`"
+
+test_clean:
+ $(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
+test_summary: $(OUTPUTDIR)/test_failures.txt
+ @$(ECHO) "#################################################"
+ @$(ECHO) "Tests completed at `$(DATE)`"
+ @( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
+ || $(ECHO) "No TEST STATS seen in log" )
+ @$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
+ @$(ECHO) "#################################################"
+ @if [ -s $< ] ; then \
+ $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
+ $(CAT) $<; \
+ exit 1; \
+ else \
+ $(ECHO) "Success! No failures detected"; \
+ fi
+
+# Get failure list from log
+$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
+ @$(RM) $@
+ @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
+
+# Get log file of all tests run
+JDK_TO_TEST := $(shell \
+ if [ -d "$(ABS_OUTPUTDIR)/j2sdk-image" ] ; then \
+ $(ECHO) "$(ABS_OUTPUTDIR)/j2sdk-image"; \
+ elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then \
+ $(ECHO) "$(ABS_OUTPUTDIR)"; \
+ elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \
+ $(ECHO) "$(PRODUCT_HOME)"; \
+ fi \
+)
+
+TEST_TARGETS=jdk_all
+$(OUTPUTDIR)/test_log.txt:
+ $(RM) $@
+ ( $(CD) ../test && \
+ $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \
+ ) | tee $@
+
+#
# JPRT rules
+#
+
include jprt.gmk
#
# Phonies to avoid accidents.
#
.PHONY: all build clean clobber optimized debug fastdebug create_links \
- import import_product import_fastdebug import_debug
+ import import_product import_fastdebug import_debug \
+ test test_run test_start test_clean test_summary
diff -r fd89b5882576 -r 2c819a885d10 jdk/make/common/Cscope.gmk
--- a/jdk/make/common/Cscope.gmk Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/make/common/Cscope.gmk Tue Oct 26 16:48:28 2010 -0700
@@ -76,7 +76,7 @@
# What files should we include? A simple rule might be just those files under
# SCM control, however this would miss files we create like the opcodes and
# CClassHeaders. The following attempts to find everything that is *useful*.
-# (.del files are created by sccsrm, demo directories contain many .java files
+# (demo directories contain many .java files
# that probably aren't useful for development, and the pkgarchive may contain
# duplicates of files within the source hierarchy). The ordering of the .raw
# file is an attempt to make cscope display the most relevant files first.
diff -r fd89b5882576 -r 2c819a885d10 jdk/make/common/Defs.gmk
--- a/jdk/make/common/Defs.gmk Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/make/common/Defs.gmk Tue Oct 26 16:48:28 2010 -0700
@@ -334,7 +334,7 @@
DOCSDIRSUFFIX =
# The MESSAGE, WARNING and ERROR files are used to store sanityck and
-# SCCS check messages, warnings and errors.
+# warnings and errors.
ifndef ERROR_FILE
ERROR_FILE = $(OUTPUTDIR)/sanityCheckErrors.txt
endif
@@ -634,38 +634,6 @@
VERSION_DEFINES = -DRELEASE='"$(RELEASE)"'
-# Note: As a rule, GNU Make rules should not appear in any of the
-# Defs*.gmk files. These were added for Kestrel-Solaris and do address
-# a TeamWare bug. They should be moved elsewhere for Merlin.
-#
-# Override gnumake built-in rules which do sccs get operations badly.
-# (They put the checked out code in the current directory, not in the
-# directory of the original file.)
-# Since this is a symptom of a teamware failure, complain and die on the spot.
-
-# This message immediately goes to stdout and the build terminates.
-define SCCS-trouble
-$(error \
-"ERROR: File $@ referenced while building in $(CURRENT_DIRECTORY) \
- is out of date with respect to its SCCS file $<. \
- This can happen from an unresolved Teamware conflict, a file movement, or \
- a failure in which SCCS files are updated but the 'sccs get' was not done. \
- You should double check for other out of date files in your workspace. \
- Or run: cd $(TOPDIR) && $(MAKE) sccs_get")
-endef
-
-%:: s.%
- @$(SCCS-trouble)
-%:: SCCS/s.%
- @$(SCCS-trouble)
- @$(ECHO) " is out of date with respect to its SCCS file." >> $(WARNING_FILE)
- @$(ECHO) " This file may be from an unresolved Teamware conflict." >> $(WARNING_FILE)
- @$(ECHO) " This is also a symptom of a Teamware bringover/putback failure" >> $(WARNING_FILE)
- @$(ECHO) " in which SCCS files are updated but not checked out." >> $(WARNING_FILE)
- @$(ECHO) " Check for other out of date files in your workspace." >> $(WARNING_FILE)
- @$(ECHO) "" >> $(WARNING_FILE)
- @#exit 666
-
ifdef INSANE
export INSANE
endif
diff -r fd89b5882576 -r 2c819a885d10 jdk/make/common/Rules-SCCS.gmk
--- a/jdk/make/common/Rules-SCCS.gmk Tue Oct 26 14:08:49 2010 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-#
-# Copyright (c) 2005, 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.
-#
-
-#
-# Only get these rules if SCCS is available
-#
-
-ifdef SCCS
-
-# SCCS command to extract out latest source
-SCCS_GET=$(SCCS) get -s
-
-#
-# Make sure all files in workspace are fresh
-#
-TEMP_ALL_FILES=$(JDK_TOPDIR)/temp_filelist
-$(TEMP_ALL_FILES): $(JDK_TOPDIR)/Codemgr_wsdata/nametable
- $(prep-target)
- @$(CUT) -d' ' -f1 $< \
- | $(GREP) -v '^VERSION' \
- | $(GREP) -v '^deleted_files' \
- | $(GREP) -v '^Codemgr_wsdata' > $@
-
-sccs_get: $(TEMP_ALL_FILES)
- @$(PRINTF) "Workspace has %d files\n" `$(CAT) $< | $(WC) -l`
- @count=0; \
- for i in `$(CAT) $<` ; do \
- f=$(JDK_TOPDIR)/$$i; \
- count=`$(EXPR) $$count '+' 1`; \
- if [ `$(EXPR) $$count '%' 100` = 0 ] ; then \
- $(PRINTF) "\rChecked $$count files"; \
- fi; \
- if [ ! -f $$f ] ; then \
- $(PRINTF) "\r$(SCCS_GET) $$f\n"; \
- (cd `$(DIRNAME) $$f` && $(SCCS_GET) `$(BASENAME) $$f`); \
- elif /usr/bin/test $$f -ot `$(DIRNAME) $$f`/SCCS/s.`$(BASENAME) $$f` ; then \
- $(PRINTF) "\r$(SCCS_GET) $$f\n"; \
- (cd `$(DIRNAME) $$f` && $(SCCS_GET) `$(BASENAME) $$f`); \
- fi; \
- done; \
- $(PRINTF) "\rChecked $$count files\n"
-
-#
-# Phonies to avoid accidents.
-#
-.PHONY: sccs_get
-
-endif
diff -r fd89b5882576 -r 2c819a885d10 jdk/make/common/internal/Resources.gmk
--- a/jdk/make/common/internal/Resources.gmk Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/make/common/internal/Resources.gmk Tue Oct 26 16:48:28 2010 -0700
@@ -251,13 +251,13 @@
# Make sure the build rule creates all the properties
resources:
-ifneq ($(PROPERTIES_FILES),)
+ifneq ($(strip $(PROPERTIES_FILES)),)
resources: strip_prop_options_clean strip_all_props
clobber clean::
$(RM) $(STRIP_PROP_FILES) $(STRIP_PROP_options)
endif
-ifneq ($(COMPILED_PROPERTIES),)
+ifneq ($(strip $(COMPILED_PROPERTIES)),)
resources: compile_prop_options_clean compile_all_props
clobber clean::
$(RM) $(COMPILE_PROP_JAVA_FILES) $(COMPILE_PROP_options)
diff -r fd89b5882576 -r 2c819a885d10 jdk/make/common/shared/Defs-javadoc.gmk
--- a/jdk/make/common/shared/Defs-javadoc.gmk Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/make/common/shared/Defs-javadoc.gmk Tue Oct 26 16:48:28 2010 -0700
@@ -45,7 +45,7 @@
PLUGIN2_FIRST_COPYRIGHT_YEAR = 2007
# Oracle name
-COMPANY_NAME = Oracle and/or its affiliates
+FULL_COMPANY_NAME = Oracle and/or its affiliates
# Copyright address
COMPANY_ADDRESS = 500 Oracle Parkway Redwood Shores, CA 94065 USA.
diff -r fd89b5882576 -r 2c819a885d10 jdk/make/common/shared/Defs-utils.gmk
--- a/jdk/make/common/shared/Defs-utils.gmk Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/make/common/shared/Defs-utils.gmk Tue Oct 26 16:48:28 2010 -0700
@@ -33,7 +33,7 @@
# UTILS_COMMAND_PATH
# /usr/bin/
# UTILS_USR_BIN_PATH
-# /usr/ccs/bin/ (sccs, m4, lex, yacc, as, ar, strip, mcs)
+# /usr/ccs/bin/ (m4, lex, yacc, as, ar, strip, mcs)
# UTILS_CCS_BIN_PATH
# Dev Tools: zip, unzip, etc that we may have special versions of
# UTILS_DEVTOOL_PATH
@@ -117,7 +117,6 @@
RMDIR = $(UTILS_COMMAND_PATH)rmdir
RPM = $(UTILS_COMMAND_PATH)rpm
RPMBUILD = $(UTILS_COMMAND_PATH)rpmbuild
-SCCS = $(UTILS_CCS_BIN_PATH)sccs
SED = $(UTILS_COMMAND_PATH)sed
SH = $(UTILS_COMMAND_PATH)sh
SHOWREV = $(UTILS_USR_BIN_PATH)showrev
@@ -183,7 +182,7 @@
NAWK = $(USRBIN_PATH)gawk
# Intrinsic unix command, with backslash-escaped character interpretation
ECHO = /bin/echo -e
- # These are really in UTILS_USR_BIN_PATH on Linux (only sccs is not)
+ # These are really in UTILS_USR_BIN_PATH on Linux
AR = $(UTILS_USR_BIN_PATH)ar
AS = $(UTILS_USR_BIN_PATH)as
LD = $(UTILS_USR_BIN_PATH)ld
diff -r fd89b5882576 -r 2c819a885d10 jdk/make/common/shared/Defs.gmk
--- a/jdk/make/common/shared/Defs.gmk Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/make/common/shared/Defs.gmk Tue Oct 26 16:48:28 2010 -0700
@@ -219,7 +219,7 @@
PRODUCT_NAME = Java(TM)
PRODUCT_SUFFIX = SE Runtime Environment
JDK_RC_PLATFORM_NAME = Platform SE
- COMPANY_NAME = Oracle
+ COMPANY_NAME = Oracle Corporation
endif
RUNTIME_NAME = $(PRODUCT_NAME) $(PRODUCT_SUFFIX)
@@ -341,7 +341,33 @@
include $(_PRIVATE_DEFS_FILE)
endif
+# OUTPUTDIR: Location of all output for the build
+ifdef ALT_OUTPUTDIR
+ OUTPUTDIR:=$(subst \,/,$(ALT_OUTPUTDIR))
+ # Assumes this is absolute (checks later)
+ ABS_OUTPUTDIR:=$(OUTPUTDIR)
+else
+ ifndef _OUTPUTDIR
+ # Default: Get "build" parent directory, which should always exist
+ ifndef BUILD_PARENT_DIRECTORY
+ BUILD_PARENT_DIRECTORY=$(BUILDDIR)/..
+ endif
+ ifdef OPENJDK
+ _OUTPUTDIRNAME=$(PLATFORM)-$(ARCH)$(OPENJDK_SUFFIX)
+ else
+ _OUTPUTDIRNAME=$(PLATFORM)-$(ARCH)
+ endif
+ _OUTPUTDIR=$(BUILD_PARENT_DIRECTORY)/build/$(_OUTPUTDIRNAME)
+ endif
+ OUTPUTDIR:=$(_OUTPUTDIR)
+endif
+# Check for spaces and null value
+OUTPUTDIR:=$(call AltCheckSpaces,OUTPUTDIR)
+OUTPUTDIR:=$(call AltCheckValue,OUTPUTDIR)
+
# Get platform specific settings
+# NB: OUTPUTDIR must be defined. Otherwise hotspot import detection will not work correctly
+# On other hand this must be included early as it provides platform specific defines such as FullPath
include $(JDK_MAKE_SHARED_DIR)/Defs-$(PLATFORM).gmk
# Components
@@ -478,32 +504,6 @@
CACERTS_FILE:=$(call AltCheckSpaces,CACERTS_FILE)
CACERTS_FILE:=$(call AltCheckValue,CACERTS_FILE)
-# OUTPUTDIR: Location of all output for the build
-ifdef ALT_OUTPUTDIR
- OUTPUTDIR:=$(subst \,/,$(ALT_OUTPUTDIR))
- # Assumes this is absolute (checks later)
- ABS_OUTPUTDIR:=$(OUTPUTDIR)
-else
- ifndef _OUTPUTDIR
- # Default: Get "build" parent directory, which should always exist
- ifndef BUILD_PARENT_DIRECTORY
- BUILD_PARENT_DIRECTORY=$(BUILDDIR)/..
- endif
- ABS_BUILD_PARENT_DIRECTORY:=$(call FullPath,$(BUILD_PARENT_DIRECTORY))
- ifdef OPENJDK
- _OUTPUTDIRNAME=$(PLATFORM)-$(ARCH)$(OPENJDK_SUFFIX)
- else
- _OUTPUTDIRNAME=$(PLATFORM)-$(ARCH)
- endif
- _OUTPUTDIR=$(BUILD_PARENT_DIRECTORY)/build/$(_OUTPUTDIRNAME)
- ABS_OUTPUTDIR:=$(ABS_BUILD_PARENT_DIRECTORY)/build/$(_OUTPUTDIRNAME)
- endif
- OUTPUTDIR:=$(_OUTPUTDIR)
-endif
-# Check for spaces and null value
-OUTPUTDIR:=$(call AltCheckSpaces,OUTPUTDIR)
-OUTPUTDIR:=$(call AltCheckValue,OUTPUTDIR)
-
#
# When signing the JCE framework and provider, we could be using built
# bits on a read-only filesystem. If so, this test will fail and crash
@@ -519,7 +519,13 @@
# Define absolute path if needed and check for spaces and null value
ifndef ABS_OUTPUTDIR
- ABS_OUTPUTDIR:=$(call FullPath,$(OUTPUTDIR))
+ ifdef _OUTPUTDIRNAME
+ #Could not define this at the same time as _OUTPUTDIRNAME as FullPath is not defined at that point
+ ABS_BUILD_PARENT_DIRECTORY:=$(call FullPath,$(BUILD_PARENT_DIRECTORY))
+ ABS_OUTPUTDIR:=$(ABS_BUILD_PARENT_DIRECTORY)/build/$(_OUTPUTDIRNAME)
+ else
+ ABS_OUTPUTDIR:=$(call FullPath,$(OUTPUTDIR))
+ endif
endif
ABS_OUTPUTDIR:=$(call AltCheckSpaces,ABS_OUTPUTDIR)
ABS_OUTPUTDIR:=$(call AltCheckValue,ABS_OUTPUTDIR)
@@ -572,10 +578,23 @@
ANT_HOME := $(call DirExists,$(JDK_DEVTOOLS_DIR)/share/ant/latest,,)
endif
endif
+
+# There are few problems with ant we need to workaround:
+# 1) ant is using temporary directory java.io.tmpdir
+# However, this directory is not unique enough and two separate ant processes
+# can easily end up using the exact same temp directory. This may lead to weird build failures
+# To workaround this we will define tmp dir explicitly
+# 2) ant attempts to detect JDK location based on java.exe location
+# This is fragile as developer may have JRE first on the PATH.
+# To workaround this we will specify JAVA_HOME explicitly
+
+ANT_TMPDIR = $(ABS_OUTPUTDIR)/tmp
+ANT_WORKAROUNDS = ANT_OPTS=-Djava.io.tmpdir='$(ANT_TMPDIR)' JAVA_HOME='$(BOOTDIR)'
+
ifeq ($(ANT_HOME),)
- ANT = ant
+ ANT = $(ANT_WORKAROUNDS) ant
else
- ANT = $(ANT_HOME)/bin/ant
+ ANT = $(ANT_WORKAROUNDS) $(ANT_HOME)/bin/ant
endif
ifdef ALT_COPYRIGHT_YEAR
diff -r fd89b5882576 -r 2c819a885d10 jdk/make/docs/Makefile
--- a/jdk/make/docs/Makefile Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/make/docs/Makefile Tue Oct 26 16:48:28 2010 -0700
@@ -57,7 +57,7 @@
# Common Java trademark line
JAVA_TRADEMARK_LINE = Java is a trademark or registered trademark of \
-$(COMPANY_NAME) in the US and other countries.
+$(FULL_COMPANY_NAME) in the US and other countries.
#
# Definitions for imported components
diff -r fd89b5882576 -r 2c819a885d10 jdk/make/java/java/FILES_java.gmk
--- a/jdk/make/java/java/FILES_java.gmk Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/make/java/java/FILES_java.gmk Tue Oct 26 16:48:28 2010 -0700
@@ -284,6 +284,7 @@
java/util/concurrent/CancellationException.java \
java/util/concurrent/CompletionService.java \
java/util/concurrent/ConcurrentHashMap.java \
+ java/util/concurrent/ConcurrentLinkedDeque.java \
java/util/concurrent/ConcurrentLinkedQueue.java \
java/util/concurrent/ConcurrentMap.java \
java/util/concurrent/ConcurrentNavigableMap.java \
diff -r fd89b5882576 -r 2c819a885d10 jdk/make/jprt.properties
--- a/jdk/make/jprt.properties Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/make/jprt.properties Tue Oct 26 16:48:28 2010 -0700
@@ -25,43 +25,265 @@
# Properties for jprt
-# Use whatever release that the submitted job requests
+# At submit time, the release supplied will be in jprt.submit.release
+# and will be one of the official release names defined in jprt.
+# jprt supports property value expansion using ${property.name} syntax.
+
+# This tells jprt what default release we want to build
jprt.tools.default.release=${jprt.submit.release}
# The different build flavors we want, we override here so we just get these 2
jprt.build.flavors=product,fastdebug
-# Standard test target for everybody
-jprt.test.targets=*-*-*-jvm98
+# Define the Windows we want (temporary)
+jprt.my.windows.i586.jdk7b107=windows_i586_5.0
+jprt.my.windows.i586.jdk7temp=windows_i586_5.0
+jprt.my.windows.i586.jdk7=windows_i586_5.1
+jprt.my.windows.i586=${jprt.my.windows.i586.${jprt.tools.default.release}}
+
+# Standard list of jprt build targets for this source tree
+jprt.build.targets= \
+ solaris_sparc_5.10-{product|fastdebug}, \
+ solaris_sparcv9_5.10-{product|fastdebug}, \
+ solaris_i586_5.10-{product|fastdebug}, \
+ solaris_x64_5.10-{product|fastdebug}, \
+ linux_i586_2.6-{product|fastdebug}, \
+ linux_x64_2.6-{product|fastdebug}, \
+ ${jprt.my.windows.i586}-{product|fastdebug}, \
+ windows_x64_5.2-{product|fastdebug}
+
+# Standard vm test target
+jprt.test.targets= \
+ solaris_sparc_5.10-product-c1-jvm98, \
+ solaris_sparcv9_5.10-product-c2-jvm98, \
+ solaris_i586_5.10-product-c1-jvm98, \
+ solaris_x64_5.10-product-c2-jvm98, \
+ linux_i586_2.6-product-{c1|c2}-jvm98, \
+ linux_x64_2.6-product-c2-jvm98, \
+ ${jprt.my.windows.i586}-product-c1-jvm98, \
+ windows_x64_5.2-product-c2-jvm98
+
+# User can select the test set with jprt submit "-testset name" option
+jprt.my.test.set=${jprt.test.set}
-# Test targets in test/Makefile (some longer running tests only test c2)
-jprt.make.rule.test.targets= \
- *-product-*-jdk_beans1, \
- *-product-*-jdk_beans2, \
- *-product-*-jdk_beans3, \
- *-product-*-jdk_io, \
- *-product-*-jdk_lang, \
- *-product-*-jdk_management1, \
- *-product-*-jdk_management2, \
- *-product-*-jdk_math, \
- *-product-*-jdk_misc, \
- *-product-*-jdk_net, \
- *-product-*-jdk_nio1, \
- *-product-*-jdk_nio2, \
- *-product-*-jdk_nio3, \
- *-product-*-jdk_security1, \
- *-product-*-jdk_security2, \
- *-product-*-jdk_security3, \
- *-product-*-jdk_text, \
- *-product-*-jdk_tools1, \
- *-product-*-jdk_tools2, \
- *-product-*-jdk_util
+# Default jdk test targets in test/Makefile (no fastdebug & limited c2)
+jprt.make.rule.default.test.targets= \
+ \
+ solaris_sparc_5.10-product-c1-jdk_beans1, \
+ solaris_sparcv9_5.10-product-c2-jdk_beans1, \
+ solaris_i586_5.10-product-c1-jdk_beans1, \
+ solaris_x64_5.10-product-c2-jdk_beans1, \
+ linux_i586_2.6-product-{c1|c2}-jdk_beans1, \
+ linux_x64_2.6-product-c2-jdk_beans1, \
+ ${jprt.my.windows.i586}-product-c1-jdk_beans1, \
+ windows_x64_5.2-product-c2-jdk_beans1, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_io, \
+ solaris_sparcv9_5.10-product-c2-jdk_io, \
+ solaris_i586_5.10-product-c1-jdk_io, \
+ solaris_x64_5.10-product-c2-jdk_io, \
+ linux_i586_2.6-product-{c1|c2}-jdk_io, \
+ linux_x64_2.6-product-c2-jdk_io, \
+ ${jprt.my.windows.i586}-product-c1-jdk_io, \
+ windows_x64_5.2-product-c2-jdk_io, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_lang, \
+ solaris_sparcv9_5.10-product-c2-jdk_lang, \
+ solaris_i586_5.10-product-c1-jdk_lang, \
+ solaris_x64_5.10-product-c2-jdk_lang, \
+ linux_i586_2.6-product-{c1|c2}-jdk_lang, \
+ linux_x64_2.6-product-c2-jdk_lang, \
+ ${jprt.my.windows.i586}-product-c1-jdk_lang, \
+ windows_x64_5.2-product-c2-jdk_lang, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_math, \
+ solaris_sparcv9_5.10-product-c2-jdk_math, \
+ solaris_i586_5.10-product-c1-jdk_math, \
+ solaris_x64_5.10-product-c2-jdk_math, \
+ linux_i586_2.6-product-{c1|c2}-jdk_math, \
+ linux_x64_2.6-product-c2-jdk_math, \
+ ${jprt.my.windows.i586}-product-c1-jdk_math, \
+ windows_x64_5.2-product-c2-jdk_math, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_misc, \
+ solaris_sparcv9_5.10-product-c2-jdk_misc, \
+ solaris_i586_5.10-product-c1-jdk_misc, \
+ solaris_x64_5.10-product-c2-jdk_misc, \
+ linux_i586_2.6-product-{c1|c2}-jdk_misc, \
+ linux_x64_2.6-product-c2-jdk_misc, \
+ ${jprt.my.windows.i586}-product-c1-jdk_misc, \
+ windows_x64_5.2-product-c2-jdk_misc, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_net, \
+ solaris_sparcv9_5.10-product-c2-jdk_net, \
+ solaris_i586_5.10-product-c1-jdk_net, \
+ solaris_x64_5.10-product-c2-jdk_net, \
+ linux_i586_2.6-product-{c1|c2}-jdk_net, \
+ linux_x64_2.6-product-c2-jdk_net, \
+ ${jprt.my.windows.i586}-product-c1-jdk_net, \
+ windows_x64_5.2-product-c2-jdk_net, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_nio1, \
+ solaris_sparcv9_5.10-product-c2-jdk_nio1, \
+ solaris_i586_5.10-product-c1-jdk_nio1, \
+ solaris_x64_5.10-product-c2-jdk_nio1, \
+ linux_i586_2.6-product-{c1|c2}-jdk_nio1, \
+ linux_x64_2.6-product-c2-jdk_nio1, \
+ ${jprt.my.windows.i586}-product-c1-jdk_nio1, \
+ windows_x64_5.2-product-c2-jdk_nio1, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_nio2, \
+ solaris_sparcv9_5.10-product-c2-jdk_nio2, \
+ solaris_i586_5.10-product-c1-jdk_nio2, \
+ solaris_x64_5.10-product-c2-jdk_nio2, \
+ linux_i586_2.6-product-{c1|c2}-jdk_nio2, \
+ linux_x64_2.6-product-c2-jdk_nio2, \
+ ${jprt.my.windows.i586}-product-c1-jdk_nio2, \
+ windows_x64_5.2-product-c2-jdk_nio2, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_nio3, \
+ solaris_sparcv9_5.10-product-c2-jdk_nio3, \
+ solaris_i586_5.10-product-c1-jdk_nio3, \
+ solaris_x64_5.10-product-c2-jdk_nio3, \
+ linux_i586_2.6-product-{c1|c2}-jdk_nio3, \
+ linux_x64_2.6-product-c2-jdk_nio3, \
+ ${jprt.my.windows.i586}-product-c1-jdk_nio3, \
+ windows_x64_5.2-product-c2-jdk_nio3, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_security1, \
+ solaris_sparcv9_5.10-product-c2-jdk_security1, \
+ solaris_i586_5.10-product-c1-jdk_security1, \
+ solaris_x64_5.10-product-c2-jdk_security1, \
+ linux_i586_2.6-product-{c1|c2}-jdk_security1, \
+ linux_x64_2.6-product-c2-jdk_security1, \
+ ${jprt.my.windows.i586}-product-c1-jdk_security1, \
+ windows_x64_5.2-product-c2-jdk_security1, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_text, \
+ solaris_sparcv9_5.10-product-c2-jdk_text, \
+ solaris_i586_5.10-product-c1-jdk_text, \
+ solaris_x64_5.10-product-c2-jdk_text, \
+ linux_i586_2.6-product-{c1|c2}-jdk_text, \
+ linux_x64_2.6-product-c2-jdk_text, \
+ ${jprt.my.windows.i586}-product-c1-jdk_text, \
+ windows_x64_5.2-product-c2-jdk_text, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_tools1, \
+ solaris_sparcv9_5.10-product-c2-jdk_tools1, \
+ solaris_i586_5.10-product-c1-jdk_tools1, \
+ solaris_x64_5.10-product-c2-jdk_tools1, \
+ linux_i586_2.6-product-{c1|c2}-jdk_tools1, \
+ linux_x64_2.6-product-c2-jdk_tools1, \
+ ${jprt.my.windows.i586}-product-c1-jdk_tools1, \
+ windows_x64_5.2-product-c2-jdk_tools1, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_util, \
+ solaris_sparcv9_5.10-product-c2-jdk_util, \
+ solaris_i586_5.10-product-c1-jdk_util, \
+ solaris_x64_5.10-product-c2-jdk_util, \
+ linux_i586_2.6-product-{c1|c2}-jdk_util, \
+ linux_x64_2.6-product-c2-jdk_util, \
+ ${jprt.my.windows.i586}-product-c1-jdk_util, \
+ windows_x64_5.2-product-c2-jdk_util
-# Some of these are crashing Xvfb or windows manager, need dedicated DISPLAY per test batch
-jprt2.make.rule.test.targets= \
- *-product-*-jdk_awt, \
- *-product-*-jdk_rmi, \
- *-product-*-jdk_swing, \
+# All jdk test targets in test/Makefile (still no fastdebug & limited c2)
+jprt.make.rule.all.test.targets= \
+ \
+ ${jprt.make.rule.default.test.targets}, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_awt, \
+ solaris_sparcv9_5.10-product-c2-jdk_awt, \
+ solaris_i586_5.10-product-c1-jdk_awt, \
+ solaris_x64_5.10-product-c2-jdk_awt, \
+ linux_i586_2.6-product-{c1|c2}-jdk_awt, \
+ linux_x64_2.6-product-c2-jdk_awt, \
+ ${jprt.my.windows.i586}-product-c1-jdk_awt, \
+ windows_x64_5.2-product-c2-jdk_awt, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_beans2, \
+ solaris_sparcv9_5.10-product-c2-jdk_beans2, \
+ solaris_i586_5.10-product-c1-jdk_beans2, \
+ solaris_x64_5.10-product-c2-jdk_beans2, \
+ linux_i586_2.6-product-{c1|c2}-jdk_beans2, \
+ linux_x64_2.6-product-c2-jdk_beans2, \
+ ${jprt.my.windows.i586}-product-c1-jdk_beans2, \
+ windows_x64_5.2-product-c2-jdk_beans2, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_beans3, \
+ solaris_sparcv9_5.10-product-c2-jdk_beans3, \
+ solaris_i586_5.10-product-c1-jdk_beans3, \
+ solaris_x64_5.10-product-c2-jdk_beans3, \
+ linux_i586_2.6-product-{c1|c2}-jdk_beans3, \
+ linux_x64_2.6-product-c2-jdk_beans3, \
+ ${jprt.my.windows.i586}-product-c1-jdk_beans3, \
+ windows_x64_5.2-product-c2-jdk_beans3, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_management1, \
+ solaris_sparcv9_5.10-product-c2-jdk_management1, \
+ solaris_i586_5.10-product-c1-jdk_management1, \
+ solaris_x64_5.10-product-c2-jdk_management1, \
+ linux_i586_2.6-product-{c1|c2}-jdk_management1, \
+ linux_x64_2.6-product-c2-jdk_management1, \
+ ${jprt.my.windows.i586}-product-c1-jdk_management1, \
+ windows_x64_5.2-product-c2-jdk_management1, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_management2, \
+ solaris_sparcv9_5.10-product-c2-jdk_management2, \
+ solaris_i586_5.10-product-c1-jdk_management2, \
+ solaris_x64_5.10-product-c2-jdk_management2, \
+ linux_i586_2.6-product-{c1|c2}-jdk_management2, \
+ linux_x64_2.6-product-c2-jdk_management2, \
+ ${jprt.my.windows.i586}-product-c1-jdk_management2, \
+ windows_x64_5.2-product-c2-jdk_management2, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_rmi, \
+ solaris_sparcv9_5.10-product-c2-jdk_rmi, \
+ solaris_i586_5.10-product-c1-jdk_rmi, \
+ solaris_x64_5.10-product-c2-jdk_rmi, \
+ linux_i586_2.6-product-{c1|c2}-jdk_rmi, \
+ linux_x64_2.6-product-c2-jdk_rmi, \
+ ${jprt.my.windows.i586}-product-c1-jdk_rmi, \
+ windows_x64_5.2-product-c2-jdk_rmi, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_security2, \
+ solaris_sparcv9_5.10-product-c2-jdk_security2, \
+ solaris_i586_5.10-product-c1-jdk_security2, \
+ solaris_x64_5.10-product-c2-jdk_security2, \
+ linux_i586_2.6-product-{c1|c2}-jdk_security2, \
+ linux_x64_2.6-product-c2-jdk_security2, \
+ ${jprt.my.windows.i586}-product-c1-jdk_security2, \
+ windows_x64_5.2-product-c2-jdk_security2, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_security3, \
+ solaris_sparcv9_5.10-product-c2-jdk_security3, \
+ solaris_i586_5.10-product-c1-jdk_security3, \
+ solaris_x64_5.10-product-c2-jdk_security3, \
+ linux_i586_2.6-product-{c1|c2}-jdk_security3, \
+ linux_x64_2.6-product-c2-jdk_security3, \
+ ${jprt.my.windows.i586}-product-c1-jdk_security3, \
+ windows_x64_5.2-product-c2-jdk_security3, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_swing, \
+ solaris_sparcv9_5.10-product-c2-jdk_swing, \
+ solaris_i586_5.10-product-c1-jdk_swing, \
+ solaris_x64_5.10-product-c2-jdk_swing, \
+ linux_i586_2.6-product-{c1|c2}-jdk_swing, \
+ linux_x64_2.6-product-c2-jdk_swing, \
+ ${jprt.my.windows.i586}-product-c1-jdk_swing, \
+ windows_x64_5.2-product-c2-jdk_swing, \
+ \
+ solaris_sparc_5.10-product-c1-jdk_tools2, \
+ solaris_sparcv9_5.10-product-c2-jdk_tools2, \
+ solaris_i586_5.10-product-c1-jdk_tools2, \
+ solaris_x64_5.10-product-c2-jdk_tools2, \
+ linux_i586_2.6-product-{c1|c2}-jdk_tools2, \
+ linux_x64_2.6-product-c2-jdk_tools2, \
+ ${jprt.my.windows.i586}-product-c1-jdk_tools2, \
+ windows_x64_5.2-product-c2-jdk_tools2
+
+# Select list to use (allow for testset to be empty too)
+jprt.make.rule..test.targets=${jprt.make.rule.default.test.targets}
+jprt.make.rule.test.targets=${jprt.make.rule.${jprt.my.test.set}.test.targets}
# Directories to be excluded from the source bundles
jprt.bundle.exclude.src.dirs=build dist webrev
diff -r fd89b5882576 -r 2c819a885d10 jdk/make/mkdemo/Makefile
--- a/jdk/make/mkdemo/Makefile Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/make/mkdemo/Makefile Tue Oct 26 16:48:28 2010 -0700
@@ -31,7 +31,7 @@
PRODUCT = demos
include $(BUILDDIR)/common/Defs.gmk
-SUBDIRS = jni
+SUBDIRS = jni nio
SUBDIRS_desktop = applets jfc
SUBDIRS_management = management
SUBDIRS_misc = scripting
diff -r fd89b5882576 -r 2c819a885d10 jdk/make/mkdemo/nio/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/mkdemo/nio/Makefile Tue Oct 26 16:48:28 2010 -0700
@@ -0,0 +1,39 @@
+#
+# Copyright (c) 1997, 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.
+#
+
+#
+# Makefile for building the jfc demos
+#
+
+BUILDDIR = ../..
+PRODUCT = demos
+include $(BUILDDIR)/common/Defs.gmk
+
+SUBDIRS = zipfs
+include $(BUILDDIR)/common/Subdirs.gmk
+
+all build clean clobber::
+ $(SUBDIRS-loop)
+
diff -r fd89b5882576 -r 2c819a885d10 jdk/make/mkdemo/nio/zipfs/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/mkdemo/nio/zipfs/Makefile Tue Oct 26 16:48:28 2010 -0700
@@ -0,0 +1,44 @@
+#
+# Copyright (c) 1997, 2002, 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 to build the ZipFileSystem demo.
+#
+
+BUILDDIR = ../../..
+PRODUCT = demo/zipfs
+DEMONAME = zipfs
+include $(BUILDDIR)/common/Defs.gmk
+
+DEMO_ROOT = $(SHARE_SRC)/demo/nio/$(DEMONAME)
+DEMO_TOPFILES = ./README.txt
+DEMO_SRCDIR = $(DEMO_ROOT)
+DEMO_DESTDIR = $(DEMODIR)/nio/$(DEMONAME)
+
+#
+# Demo jar building rules.
+#
+include $(BUILDDIR)/common/Demo.gmk
+
diff -r fd89b5882576 -r 2c819a885d10 jdk/make/sun/cmm/lcms/Makefile
--- a/jdk/make/sun/cmm/lcms/Makefile Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/make/sun/cmm/lcms/Makefile Tue Oct 26 16:48:28 2010 -0700
@@ -80,7 +80,12 @@
vpath %.c $(SHARE_SRC)/native/sun/java2d
ifeq ($(PLATFORM), windows)
-OTHER_CFLAGS += -DCMS_IS_WINDOWS_ -Dsqrtf=sqrt
+OTHER_CFLAGS += -DCMS_IS_WINDOWS_
+
+ifeq ($(COMPILER_VERSION), VS2003)
+OTHER_CFLAGS += -Dsqrtf=sqrt
+endif
+
OTHER_LDLIBS = $(OBJDIR)/../../../sun.awt/awt/$(OBJDIRNAME)/awt.lib
OTHER_INCLUDES += -I$(SHARE_SRC)/native/sun/java2d \
-I$(SHARE_SRC)/native/sun/awt/debug
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java
--- a/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java Tue Oct 26 16:48:28 2010 -0700
@@ -525,7 +525,7 @@
iMatchColumns = new Vector(10);
for(int i = 0; i < 10 ; i++) {
- iMatchColumns.add(i,new Integer(-1));
+ iMatchColumns.add(i,Integer.valueOf(-1));
}
strMatchColumns = new Vector(10);
@@ -889,7 +889,12 @@
success = false;
} else {
tWriter = (TransactionalWriter)rowSetWriter;
- ((CachedRowSetWriter)tWriter).commit(this, updateOnInsert);
+ if (tWriter instanceof CachedRowSetWriter) {
+ ((CachedRowSetWriter)tWriter).commit(this, updateOnInsert);
+ } else {
+ tWriter.commit();
+ }
+
success = true;
}
}
@@ -1294,7 +1299,7 @@
tMap = new TreeMap();
for (int i = 0; iJoinRowSet
@@ -550,7 +552,7 @@
// This 'if' will be removed after all joins are implemented.
throw new SQLException(resBundle.handleGetObject("joinrowsetimpl.notsupported").toString());
} else {
- Integer Intgr = new Integer(JoinRowSet.INNER_JOIN);
+ Integer Intgr = Integer.valueOf(JoinRowSet.INNER_JOIN);
vecJoinType.add(Intgr);
}
} else {
@@ -874,8 +876,8 @@
String strWhereClause = "Select ";
String whereClause;
- String tabName= null;
- String strTabName = null;
+ String tabName= "";
+ String strTabName = "";
int sz,cols;
int j;
CachedRowSetImpl crs;
@@ -889,8 +891,6 @@
// tableNameX.(rowsetX.getMatchColumnName()) ==
// tableNameZ.(rowsetZ.getMatchColumnName()));
- tabName = new String();
- strTabName = new String();
sz = vecRowSetsInJOIN.size();
for(int i=0;iString detailing the vendor name of this
* SyncProvider
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/com/sun/rowset/providers/RIXMLProvider.java
--- a/jdk/src/share/classes/com/sun/rowset/providers/RIXMLProvider.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/com/sun/rowset/providers/RIXMLProvider.java Tue Oct 26 16:48:28 2010 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -85,7 +85,7 @@
/**
* The vendor name of this SyncProvider implementation.
*/
- private String vendorName = "Sun Microsystems Inc.";
+ private String vendorName = "Oracle Corporation";
/**
* The version number of this SyncProvider implementation.
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/com/sun/servicetag/Installer.java
--- a/jdk/src/share/classes/com/sun/servicetag/Installer.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/com/sun/servicetag/Installer.java Tue Oct 26 16:48:28 2010 -0700
@@ -43,7 +43,8 @@
"servicetag.dir.path";
private static String SVCTAG_ENABLE_REGISTRATION =
"servicetag.registration.enabled";
- private final static String SUN_VENDOR = "Sun Microsystems";
+ private final static String ORACLE = "Oracle";
+ private final static String SUN = "Sun Microsystems";
private final static String REGISTRATION_XML = "registration.xml";
private final static String SERVICE_TAG_FILE = "servicetag";
private final static String REGISTRATION_HTML_NAME = "register";
@@ -84,9 +85,10 @@
// Implementation of ServiceTag.getJavaServiceTag(String) method
static ServiceTag getJavaServiceTag(String source) throws IOException {
- if (!System.getProperty("java.vendor").startsWith(SUN_VENDOR)) {
+ String vendor = System.getProperty("java.vendor", "");
+ if (!vendor.startsWith(SUN) && !vendor.startsWith(ORACLE)) {
// Products bundling this implementation may run on
- // Mac OS which is not a Sun JDK
+ // Mac OS which is not a Sun/Oracle JDK
return null;
}
boolean cleanup = false;
@@ -365,7 +367,7 @@
props.getProperty("servicetag.parent.name"),
props.getProperty("servicetag.parent.urn"),
getProductDefinedId(),
- SUN_VENDOR,
+ System.getProperty("java.vendor"),
System.getProperty("os.arch"),
getZoneName(),
svcTagSource);
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/com/sun/servicetag/RegistrationData.java
--- a/jdk/src/share/classes/com/sun/servicetag/RegistrationData.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/com/sun/servicetag/RegistrationData.java Tue Oct 26 16:48:28 2010 -0700
@@ -80,12 +80,12 @@
*
*
systemManufacturer
*
System manufacturer
- *
e.g. Sun Microsystems
+ *
e.g. Oracle Corporation
*
*
*
cpuManufacturer
*
CPU manufacturer
- *
e.g. Sun Microsystems
+ *
e.g. Oracle Corporation
*
*
*
serialNumber
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/com/sun/servicetag/Registry.java
--- a/jdk/src/share/classes/com/sun/servicetag/Registry.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/com/sun/servicetag/Registry.java Tue Oct 26 16:48:28 2010 -0700
@@ -90,7 +90,7 @@
stclient = getWindowsStClientFile();
} else {
if (isVerbose()) {
- System.out.println("Running on non-Sun JDK");
+ System.out.println("Running on unsupported platform");
}
}
initialized = true;
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/com/sun/servicetag/SolarisSystemEnvironment.java
--- a/jdk/src/share/classes/com/sun/servicetag/SolarisSystemEnvironment.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/com/sun/servicetag/SolarisSystemEnvironment.java Tue Oct 26 16:48:28 2010 -0700
@@ -44,6 +44,7 @@
* Solaris implementation of the SystemEnvironment class.
*/
class SolarisSystemEnvironment extends SystemEnvironment {
+ private static final String ORACLE = "Oracle Corporation";
SolarisSystemEnvironment() {
setHostId(getCommandOutput("/usr/bin/hostid"));
setSystemModel(getCommandOutput("/usr/bin/uname", "-i"));
@@ -59,7 +60,7 @@
private String getSolarisCpuManufacturer() {
// not fully accurate, this could be another manufacturer (fujitsu for example)
if ("sparc".equalsIgnoreCase(System.getProperty("os.arch"))) {
- return "Sun Microsystems, Inc";
+ return ORACLE;
}
// if we're here, then we'll try smbios (type 4)
@@ -73,7 +74,7 @@
private String getSolarisSystemManufacturer() {
// not fully accurate, this could be another manufacturer (fujitsu for example)
if ("sparc".equalsIgnoreCase(System.getProperty("os.arch"))) {
- return "Sun Microsystems, Inc";
+ return ORACLE;
}
// if we're here, then we'll try smbios (type 1)
@@ -117,7 +118,7 @@
// ID SIZE TYPE
// 1 150 SMB_TYPE_SYSTEM (system information)
//
- // Manufacturer: Sun Microsystems
+ // Manufacturer: Oracle Corporation
// Product: Sun Fire X4600
// Version: To Be Filled By O.E.M.
// Serial Number: 00:14:4F:45:0C:2A
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/awt/Dialog.java
--- a/jdk/src/share/classes/java/awt/Dialog.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/awt/Dialog.java Tue Oct 26 16:48:28 2010 -0700
@@ -1068,7 +1068,7 @@
modalityPushed();
try {
EventQueue eventQueue = Toolkit.getDefaultToolkit().getSystemEventQueue();
- secondaryLoop = eventQueue.createSecondaryLoop(cond, modalFilter, 5000);
+ secondaryLoop = eventQueue.createSecondaryLoop(cond, modalFilter, 0);
if (!secondaryLoop.enter()) {
secondaryLoop = null;
}
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/awt/KeyboardFocusManager.java
--- a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java Tue Oct 26 16:48:28 2010 -0700
@@ -142,6 +142,9 @@
public void removeLastFocusRequest(Component heavyweight) {
KeyboardFocusManager.removeLastFocusRequest(heavyweight);
}
+ public void setMostRecentFocusOwner(Window window, Component component) {
+ KeyboardFocusManager.setMostRecentFocusOwner(window, component);
+ }
}
);
}
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/awt/event/ActionEvent.java
--- a/jdk/src/share/classes/java/awt/event/ActionEvent.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/awt/event/ActionEvent.java Tue Oct 26 16:48:28 2010 -0700
@@ -51,7 +51,7 @@
* in the range from {@code ACTION_FIRST} to {@code ACTION_LAST}.
*
* @see ActionListener
- * @see Tutorial: Java 1.1 Event Model
+ * @see Tutorial: How to Write an Action Listener
*
* @author Carl Quinn
* @since 1.1
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/awt/image/SampleModel.java
--- a/jdk/src/share/classes/java/awt/image/SampleModel.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/awt/image/SampleModel.java Tue Oct 26 16:48:28 2010 -0700
@@ -937,14 +937,22 @@
int iArray[], DataBuffer data) {
int pixels[];
int Offset=0;
+ int x1 = x + w;
+ int y1 = y + h;
+
+ if (x < 0 || x1 < x || x1 > width ||
+ y < 0 || y1 < y || y1 > height)
+ {
+ throw new ArrayIndexOutOfBoundsException("Invalid coordinates.");
+ }
if (iArray != null)
pixels = iArray;
else
pixels = new int[w * h];
- for(int i=y; i<(h+y); i++) {
- for (int j=x; j<(w+x); j++) {
+ for(int i=y; i width ||
+ y < 0 || y1 < y || y1 > height)
+ {
+ throw new ArrayIndexOutOfBoundsException("Invalid coordinates");
+ }
if (fArray != null)
pixels = fArray;
else
pixels = new float[w * h];
- for (int i=y; i<(h+y); i++) {
- for (int j=x; j<(w+x); j++) {
+ for (int i=y; i width ||
+ y < 0 || y1 < y || y1 > height)
+ {
+ throw new ArrayIndexOutOfBoundsException("Invalid coordinates");
+ }
if (dArray != null)
pixels = dArray;
else
pixels = new double[w * h];
- for (int i=y; i<(y+h); i++) {
- for (int j=x; j<(x+w); j++) {
+ for (int i=y; i type, String name, int args) {
- for (Method method : type.getMethods()) {
- if (method.getName().equals(name) && (args == method.getParameterTypes().length)) {
- try {
- return MethodFinder.findAccessibleMethod(method);
+ /**
+ * Internal support for finding a target methodName with a given
+ * parameter list on a given class.
+ */
+ private static Method internalFindMethod(Class start, String methodName,
+ int argCount, Class args[]) {
+ // For overriden methods we need to find the most derived version.
+ // So we start with the given class and walk up the superclass chain.
+
+ Method method = null;
+
+ for (Class cl = start; cl != null; cl = cl.getSuperclass()) {
+ Method methods[] = getPublicDeclaredMethods(cl);
+ for (int i = 0; i < methods.length; i++) {
+ method = methods[i];
+ if (method == null) {
+ continue;
}
- catch (NoSuchMethodException exception) {
- // continue search for a method with the specified count of parameters
+
+ // make sure method signature matches.
+ Class params[] = FeatureDescriptor.getParameterTypes(start, method);
+ if (method.getName().equals(methodName) &&
+ params.length == argCount) {
+ if (args != null) {
+ boolean different = false;
+ if (argCount > 0) {
+ for (int j = 0; j < argCount; j++) {
+ if (params[j] != args[j]) {
+ different = true;
+ continue;
+ }
+ }
+ if (different) {
+ continue;
+ }
+ }
+ }
+ return method;
}
}
}
- return null;
+ method = null;
+
+ // Now check any inherited interfaces. This is necessary both when
+ // the argument class is itself an interface, and when the argument
+ // class is an abstract class.
+ Class ifcs[] = start.getInterfaces();
+ for (int i = 0 ; i < ifcs.length; i++) {
+ // Note: The original implementation had both methods calling
+ // the 3 arg method. This is preserved but perhaps it should
+ // pass the args array instead of null.
+ method = internalFindMethod(ifcs[i], methodName, argCount, null);
+ if (method != null) {
+ break;
+ }
+ }
+ return method;
}
- static Method findInstanceMethod(Class> type, String name, Class>... args) {
- try {
- return MethodFinder.findInstanceMethod(type, name, args);
- }
- catch (NoSuchMethodException exception) {
+ /**
+ * Find a target methodName on a given class.
+ */
+ static Method findMethod(Class cls, String methodName, int argCount) {
+ return findMethod(cls, methodName, argCount, null);
+ }
+
+ /**
+ * Find a target methodName with specific parameter list on a given class.
+ *
+ * Used in the contructors of the EventSetDescriptor,
+ * PropertyDescriptor and the IndexedPropertyDescriptor.
+ *
+ * @param cls The Class object on which to retrieve the method.
+ * @param methodName Name of the method.
+ * @param argCount Number of arguments for the desired method.
+ * @param args Array of argument types for the method.
+ * @return the method or null if not found
+ */
+ static Method findMethod(Class cls, String methodName, int argCount,
+ Class args[]) {
+ if (methodName == null) {
return null;
}
+ return internalFindMethod(cls, methodName, argCount, args);
}
/**
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/beans/MethodDescriptor.java
--- a/jdk/src/share/classes/java/beans/MethodDescriptor.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/beans/MethodDescriptor.java Tue Oct 26 16:48:28 2010 -0700
@@ -90,13 +90,13 @@
// Find methods for up to 2 params. We are guessing here.
// This block should never execute unless the classloader
// that loaded the argument classes disappears.
- method = Introspector.findMethod(cls, name, i);
+ method = Introspector.findMethod(cls, name, i, null);
if (method != null) {
break;
}
}
} else {
- method = Statement.getMethod(cls, name, params);
+ method = Introspector.findMethod(cls, name, params.length, params);
}
setMethod(method);
}
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/beans/PropertyDescriptor.java
--- a/jdk/src/share/classes/java/beans/PropertyDescriptor.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/beans/PropertyDescriptor.java Tue Oct 26 16:48:28 2010 -0700
@@ -112,7 +112,8 @@
// If this class or one of its base classes allow PropertyChangeListener,
// then we assume that any properties we discover are "bound".
// See Introspector.getTargetPropertyInfo() method.
- this.bound = null != Introspector.findInstanceMethod(beanClass, "addPropertyChangeListener", PropertyChangeListener.class);
+ Class[] args = { PropertyChangeListener.class };
+ this.bound = null != Introspector.findMethod(beanClass, "addPropertyChangeListener", args.length, args);
}
/**
@@ -223,10 +224,10 @@
// property type is. For booleans, there can be "is" and "get"
// methods. If an "is" method exists, this is the official
// reader method so look for this one first.
- readMethod = Introspector.findInstanceMethod(cls, readMethodName);
+ readMethod = Introspector.findMethod(cls, readMethodName, 0);
if (readMethod == null) {
readMethodName = Introspector.GET_PREFIX + getBaseName();
- readMethod = Introspector.findInstanceMethod(cls, readMethodName);
+ readMethod = Introspector.findMethod(cls, readMethodName, 0);
}
try {
setReadMethod(readMethod);
@@ -291,7 +292,8 @@
writeMethodName = Introspector.SET_PREFIX + getBaseName();
}
- writeMethod = Introspector.findInstanceMethod(cls, writeMethodName, type);
+ Class[] args = (type == null) ? null : new Class[] { type };
+ writeMethod = Introspector.findMethod(cls, writeMethodName, 1, args);
if (writeMethod != null) {
if (!writeMethod.getReturnType().equals(void.class)) {
writeMethod = null;
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/lang/System.java
--- a/jdk/src/share/classes/java/lang/System.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/lang/System.java Tue Oct 26 16:48:28 2010 -0700
@@ -1101,22 +1101,12 @@
lineSeparator = props.getProperty("line.separator");
sun.misc.Version.init();
- // Workaround until DownloadManager initialization is revisited.
- // Make JavaLangAccess available early enough for internal
- // Shutdown hooks to be registered
- setJavaLangAccess();
-
// Gets and removes system properties that configure the Integer
// cache used to support the object identity semantics of autoboxing.
// At this time, the size of the cache may be controlled by the
// vm option -XX:AutoBoxCacheMax=.
Integer.getAndRemoveCacheProperties();
- // Load the zip library now in order to keep java.util.zip.ZipFile
- // from trying to use itself to load this library later.
- loadLibrary("zip");
-
-
FileInputStream fdIn = new FileInputStream(FileDescriptor.in);
FileOutputStream fdOut = new FileOutputStream(FileDescriptor.out);
FileOutputStream fdErr = new FileOutputStream(FileDescriptor.err);
@@ -1124,6 +1114,10 @@
setOut0(new PrintStream(new BufferedOutputStream(fdOut, 128), true));
setErr0(new PrintStream(new BufferedOutputStream(fdErr, 128), true));
+ // Load the zip library now in order to keep java.util.zip.ZipFile
+ // from trying to use itself to load this library later.
+ loadLibrary("zip");
+
// Setup Java signal handlers for HUP, TERM, and INT (where available).
Terminator.setup();
@@ -1153,6 +1147,9 @@
// way as other threads; we must do it ourselves here.
Thread current = Thread.currentThread();
current.getThreadGroup().add(current);
+
+ // register shared secrets
+ setJavaLangAccess();
}
private static void setJavaLangAccess() {
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/net/InetAddress.java
--- a/jdk/src/share/classes/java/net/InetAddress.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/net/InetAddress.java Tue Oct 26 16:48:28 2010 -0700
@@ -677,19 +677,20 @@
static InetAddressImpl impl;
- private static HashMap lookupTable = new HashMap();
+ private static HashMap lookupTable
+ = new HashMap();
/**
* Represents a cache entry
*/
static final class CacheEntry {
- CacheEntry(Object address, long expiration) {
- this.address = address;
+ CacheEntry(InetAddress[] addresses, long expiration) {
+ this.addresses = addresses;
this.expiration = expiration;
}
- Object address;
+ InetAddress[] addresses;
long expiration;
}
@@ -698,7 +699,7 @@
* at creation time.
*/
static final class Cache {
- private LinkedHashMap cache;
+ private LinkedHashMap cache;
private Type type;
enum Type {Positive, Negative};
@@ -708,7 +709,7 @@
*/
public Cache(Type type) {
this.type = type;
- cache = new LinkedHashMap();
+ cache = new LinkedHashMap();
}
private int getPolicy() {
@@ -724,7 +725,7 @@
* entry then for this host then the entry will be
* replaced.
*/
- public Cache put(String host, Object address) {
+ public Cache put(String host, InetAddress[] addresses) {
int policy = getPolicy();
if (policy == InetAddressCachePolicy.NEVER) {
return this;
@@ -736,12 +737,10 @@
// As we iterate in insertion order we can
// terminate when a non-expired entry is found.
- LinkedList expired = new LinkedList();
- Iterator i = cache.keySet().iterator();
+ LinkedList expired = new LinkedList();
long now = System.currentTimeMillis();
- while (i.hasNext()) {
- String key = (String)i.next();
- CacheEntry entry = (CacheEntry)cache.get(key);
+ for (String key : cache.keySet()) {
+ CacheEntry entry = cache.get(key);
if (entry.expiration >= 0 && entry.expiration < now) {
expired.add(key);
@@ -750,9 +749,8 @@
}
}
- i = expired.iterator();
- while (i.hasNext()) {
- cache.remove(i.next());
+ for (String key : expired) {
+ cache.remove(key);
}
}
@@ -766,7 +764,7 @@
} else {
expiration = System.currentTimeMillis() + (policy * 1000);
}
- CacheEntry entry = new CacheEntry(address, expiration);
+ CacheEntry entry = new CacheEntry(addresses, expiration);
cache.put(host, entry);
return this;
}
@@ -780,7 +778,7 @@
if (policy == InetAddressCachePolicy.NEVER) {
return null;
}
- CacheEntry entry = (CacheEntry)cache.get(host);
+ CacheEntry entry = cache.get(host);
// check if entry has expired
if (entry != null && policy != InetAddressCachePolicy.FOREVER) {
@@ -814,42 +812,41 @@
}
/*
- * Cache the given hostname and address.
+ * Cache the given hostname and addresses.
*/
- private static void cacheAddress(String hostname, Object address,
- boolean success) {
+ private static void cacheAddresses(String hostname,
+ InetAddress[] addresses,
+ boolean success) {
hostname = hostname.toLowerCase();
synchronized (addressCache) {
cacheInitIfNeeded();
if (success) {
- addressCache.put(hostname, address);
+ addressCache.put(hostname, addresses);
} else {
- negativeCache.put(hostname, address);
+ negativeCache.put(hostname, addresses);
}
}
}
/*
* Lookup hostname in cache (positive & negative cache). If
- * found return address, null if not found.
+ * found return addresses, null if not found.
*/
- private static Object getCachedAddress(String hostname) {
+ private static InetAddress[] getCachedAddresses(String hostname) {
hostname = hostname.toLowerCase();
// search both positive & negative caches
synchronized (addressCache) {
- CacheEntry entry;
-
cacheInitIfNeeded();
- entry = addressCache.get(hostname);
+ CacheEntry entry = addressCache.get(hostname);
if (entry == null) {
entry = negativeCache.get(hostname);
}
if (entry != null) {
- return entry.address;
+ return entry.addresses;
}
}
@@ -911,7 +908,7 @@
static {
// create the impl
- impl = (new InetAddressImplFactory()).create();
+ impl = InetAddressImplFactory.create();
// get name service if provided and requested
String provider = null;;
@@ -931,7 +928,7 @@
}
// if not designate any name services provider,
- // creat a default one
+ // create a default one
if (nameServices.size() == 0) {
NameService ns = createNSProvider("default");
nameServices.add(ns);
@@ -939,7 +936,7 @@
}
/**
- * Create an InetAddress based on the provided host name and IP address
+ * Creates an InetAddress based on the provided host name and IP address.
* No name service is checked for the validity of the address.
*
*
The host name can either be a machine name, such as
@@ -1067,13 +1064,13 @@
boolean ipv6Expected = false;
if (host.charAt(0) == '[') {
- // This is supposed to be an IPv6 litteral
+ // This is supposed to be an IPv6 literal
if (host.length() > 2 && host.charAt(host.length()-1) == ']') {
host = host.substring(1, host.length() -1);
ipv6Expected = true;
} else {
// This was supposed to be a IPv6 address, but it's not!
- throw new UnknownHostException(host);
+ throw new UnknownHostException(host + ": invalid IPv6 address");
}
}
@@ -1180,8 +1177,6 @@
throws UnknownHostException {
/* If it gets here it is presumed to be a hostname */
/* Cache.get can return: null, unknownAddress, or InetAddress[] */
- Object obj = null;
- Object objcopy = null;
/* make sure the connection to the host is allowed, before we
* give out a hostname
@@ -1193,26 +1188,23 @@
}
}
- obj = getCachedAddress(host);
+ InetAddress[] addresses = getCachedAddresses(host);
/* If no entry in cache, then do the host lookup */
- if (obj == null) {
- obj = getAddressFromNameService(host);
+ if (addresses == null) {
+ addresses = getAddressesFromNameService(host);
}
- if (obj == unknown_array)
+ if (addresses == unknown_array)
throw new UnknownHostException(host);
- /* Make a copy of the InetAddress array */
- objcopy = ((InetAddress [])obj).clone();
-
- return (InetAddress [])objcopy;
+ return addresses.clone();
}
- private static Object getAddressFromNameService(String host)
+ private static InetAddress[] getAddressesFromNameService(String host)
throws UnknownHostException
{
- Object obj = null;
+ InetAddress[] addresses = null;
boolean success = false;
UnknownHostException ex = null;
@@ -1226,16 +1218,16 @@
// would be blocked until the host is removed
// from the lookupTable. Then this thread
// should try to look up the addressCache.
- // i) if it found the address in the
+ // i) if it found the addresses in the
// addressCache, checkLookupTable() would
- // return the address.
- // ii) if it didn't find the address in the
+ // return the addresses.
+ // ii) if it didn't find the addresses in the
// addressCache for any reason,
// it should add the host in the
// lookupTable and return null so the
// following code would do a lookup itself.
- if ((obj = checkLookupTable(host)) == null) {
- // This is the first thread which looks up the address
+ if ((addresses = checkLookupTable(host)) == null) {
+ // This is the first thread which looks up the addresses
// this host or the cache entry for this host has been
// expired so this thread should do the lookup.
for (NameService nameService : nameServices) {
@@ -1246,26 +1238,26 @@
* allocating space when the lookup fails.
*/
- obj = nameService.lookupAllHostAddr(host);
+ addresses = nameService.lookupAllHostAddr(host);
success = true;
break;
} catch (UnknownHostException uhe) {
if (host.equalsIgnoreCase("localhost")) {
InetAddress[] local = new InetAddress[] { impl.loopbackAddress() };
- obj = local;
+ addresses = local;
success = true;
break;
}
else {
- obj = unknown_array;
+ addresses = unknown_array;
success = false;
ex = uhe;
}
}
}
- // Cache the address.
- cacheAddress(host, obj, success);
+ // Cache the addresses.
+ cacheAddresses(host, addresses, success);
// Delete the host from the lookupTable, and
// notify all threads waiting for the monitor
// for lookupTable.
@@ -1274,13 +1266,13 @@
throw ex;
}
- return obj;
+ return addresses;
}
- private static Object checkLookupTable(String host) {
- // make sure obj is null.
- Object obj = null;
+ private static InetAddress[] checkLookupTable(String host) {
+ // make sure addresses is null.
+ InetAddress[] addresses = null;
synchronized (lookupTable) {
// If the host isn't in the lookupTable, add it in the
@@ -1288,11 +1280,11 @@
// the lookup.
if (lookupTable.containsKey(host) == false) {
lookupTable.put(host, null);
- return obj;
+ return addresses;
}
// If the host is in the lookupTable, it means that another
- // thread is trying to look up the address of this host.
+ // thread is trying to look up the addresses of this host.
// This thread should wait.
while (lookupTable.containsKey(host)) {
try {
@@ -1302,18 +1294,18 @@
}
}
- // The other thread has finished looking up the address of
- // the host. This thread should retry to get the address
- // from the addressCache. If it doesn't get the address from
- // the cache, it will try to look up the address itself.
- obj = getCachedAddress(host);
- if (obj == null) {
+ // The other thread has finished looking up the addresses of
+ // the host. This thread should retry to get the addresses
+ // from the addressCache. If it doesn't get the addresses from
+ // the cache, it will try to look up the addresses itself.
+ addresses = getCachedAddresses(host);
+ if (addresses == null) {
synchronized (lookupTable) {
lookupTable.put(host, null);
}
}
- return obj;
+ return addresses;
}
private static void updateLookupTable(String host) {
@@ -1396,15 +1388,20 @@
cachedLocalHost = null;
}
- // we are calling getAddressFromNameService directly
+ // we are calling getAddressesFromNameService directly
// to avoid getting localHost from cache
if (ret == null) {
InetAddress[] localAddrs;
try {
localAddrs =
- (InetAddress[]) InetAddress.getAddressFromNameService(local);
+ InetAddress.getAddressesFromNameService(local);
} catch (UnknownHostException uhe) {
- throw new UnknownHostException(local + ": " + uhe.getMessage());
+ // Rethrow with a more informative error message.
+ UnknownHostException uhe2 =
+ new UnknownHostException(local + ": " +
+ uhe.getMessage());
+ uhe2.initCause(uhe);
+ throw uhe2;
}
cachedLocalHost = localAddrs[0];
cacheTime = now;
@@ -1434,8 +1431,8 @@
/*
* Load and instantiate an underlying impl class
*/
- static Object loadImpl(String implName) {
- Object impl;
+ static InetAddressImpl loadImpl(String implName) {
+ Object impl = null;
/*
* Property "impl.prefix" will be prepended to the classname
@@ -1446,7 +1443,6 @@
*/
String prefix = AccessController.doPrivileged(
new GetPropertyAction("impl.prefix", ""));
- impl = null;
try {
impl = Class.forName("java.net." + prefix + implName).newInstance();
} catch (ClassNotFoundException e) {
@@ -1471,7 +1467,7 @@
}
}
- return impl;
+ return (InetAddressImpl) impl;
}
private void readObjectNoData (ObjectInputStream s) throws
@@ -1498,13 +1494,8 @@
class InetAddressImplFactory {
static InetAddressImpl create() {
- Object o;
- if (isIPv6Supported()) {
- o = InetAddress.loadImpl("Inet6AddressImpl");
- } else {
- o = InetAddress.loadImpl("Inet4AddressImpl");
- }
- return (InetAddressImpl)o;
+ return InetAddress.loadImpl(isIPv6Supported() ?
+ "Inet6AddressImpl" : "Inet4AddressImpl");
}
static native boolean isIPv6Supported();
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/nio/file/FileSystemLoopException.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/nio/file/FileSystemLoopException.java Tue Oct 26 16:48:28 2010 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. 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 java.nio.file;
+
+/**
+ * Checked exception thrown when a file system loop, or cycle, is encountered.
+ *
+ * @since 1.7
+ * @see Files#walkFileTree
+ */
+
+public class FileSystemLoopException
+ extends FileSystemException
+{
+ private static final long serialVersionUID = 4843039591949217617L;
+
+ /**
+ * Constructs an instance of this class.
+ *
+ * @param file
+ * a string identifying the file causing the cycle or {@code null} if
+ * not known
+ */
+ public FileSystemLoopException(String file) {
+ super(file);
+ }
+}
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/nio/file/FileTreeWalker.java
--- a/jdk/src/share/classes/java/nio/file/FileTreeWalker.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/nio/file/FileTreeWalker.java Tue Oct 26 16:48:28 2010 -0700
@@ -38,7 +38,6 @@
class FileTreeWalker {
private final boolean followLinks;
- private final boolean detectCycles;
private final LinkOption[] linkOptions;
private final FileVisitor super Path> visitor;
private final int maxDepth;
@@ -48,17 +47,15 @@
int maxDepth)
{
boolean fl = false;
- boolean dc = false;
for (FileVisitOption option: options) {
+ // will throw NPE if options contains null
switch (option) {
- case FOLLOW_LINKS : fl = true; break;
- case DETECT_CYCLES : dc = true; break;
+ case FOLLOW_LINKS : fl = true; break;
default:
throw new AssertionError("Should not get here");
}
}
this.followLinks = fl;
- this.detectCycles = fl | dc;
this.linkOptions = (fl) ? new LinkOption[0] :
new LinkOption[] { LinkOption.NOFOLLOW_LINKS };
this.visitor = visitor;
@@ -68,13 +65,11 @@
/**
* Walk file tree starting at the given file
*/
- void walk(Path start) {
+ void walk(Path start) throws IOException {
FileVisitResult result = walk(start,
0,
new ArrayList());
- if (result == null) {
- throw new NullPointerException("Visitor returned 'null'");
- }
+ Objects.nonNull(result, "FileVisitor returned null");
}
/**
@@ -88,11 +83,8 @@
private FileVisitResult walk(Path file,
int depth,
List ancestors)
+ throws IOException
{
- // depth check
- if (depth > maxDepth)
- return FileVisitResult.CONTINUE;
-
// if attributes are cached then use them if possible
BasicFileAttributes attrs = null;
if ((depth > 0) &&
@@ -137,13 +129,13 @@
return visitor.visitFileFailed(file, exc);
}
- // file is not a directory so invoke visitFile method
- if (!attrs.isDirectory()) {
+ // at maximum depth or file is not a directory
+ if (depth >= maxDepth || !attrs.isDirectory()) {
return visitor.visitFile(file, attrs);
}
- // check for cycles
- if (detectCycles) {
+ // check for cycles when following links
+ if (followLinks) {
Object key = attrs.fileKey();
// if this directory and ancestor has a file key then we compare
@@ -153,19 +145,23 @@
if (key != null && ancestorKey != null) {
if (key.equals(ancestorKey)) {
// cycle detected
- return visitor.visitFile(file, attrs);
+ return visitor.visitFileFailed(file,
+ new FileSystemLoopException(file.toString()));
}
} else {
+ boolean isSameFile = false;
try {
- if (file.isSameFile(ancestor.file())) {
- // cycle detected
- return visitor.visitFile(file, attrs);
- }
+ isSameFile = file.isSameFile(ancestor.file());
} catch (IOException x) {
// ignore
} catch (SecurityException x) {
// ignore
}
+ if (isSameFile) {
+ // cycle detected
+ return visitor.visitFileFailed(file,
+ new FileSystemLoopException(file.toString()));
+ }
}
}
@@ -181,7 +177,7 @@
try {
stream = file.newDirectoryStream();
} catch (IOException x) {
- return visitor.preVisitDirectoryFailed(file, x);
+ return visitor.visitFileFailed(file, x);
} catch (SecurityException x) {
// ignore, as per spec
return FileVisitResult.CONTINUE;
@@ -192,20 +188,14 @@
// invoke preVisitDirectory and then visit each entry
try {
- result = visitor.preVisitDirectory(file);
+ result = visitor.preVisitDirectory(file, attrs);
if (result != FileVisitResult.CONTINUE) {
return result;
}
- // if an I/O occurs during iteration then a CME is thrown. We
- // need to distinguish this from a CME thrown by the visitor.
- boolean inAction = false;
-
try {
for (Path entry: stream) {
- inAction = true;
result = walk(entry, depth+1, ancestors);
- inAction = false;
// returning null will cause NPE to be thrown
if (result == null || result == FileVisitResult.TERMINATE)
@@ -215,17 +205,9 @@
if (result == FileVisitResult.SKIP_SIBLINGS)
break;
}
- } catch (ConcurrentModificationException x) {
- // if CME thrown because the iteration failed then remember
- // the IOException so that it is notified to postVisitDirectory
- if (!inAction) {
- // iteration failed
- Throwable t = x.getCause();
- if (t instanceof IOException)
- ioe = (IOException)t;
- }
- if (ioe == null)
- throw x;
+ } catch (DirectoryIteratorException e) {
+ // IOException will be notified to postVisitDirectory
+ ioe = e.getCause();
}
} finally {
try {
@@ -238,7 +220,7 @@
} finally {
// remove key from trail if doing cycle detection
- if (detectCycles) {
+ if (followLinks) {
ancestors.remove(ancestors.size()-1);
}
}
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/nio/file/FileVisitOption.java
--- a/jdk/src/share/classes/java/nio/file/FileVisitOption.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/nio/file/FileVisitOption.java Tue Oct 26 16:48:28 2010 -0700
@@ -37,9 +37,5 @@
/**
* Follow symbolic links.
*/
- FOLLOW_LINKS,
- /**
- * Detect cycles in the file tree.
- */
- DETECT_CYCLES;
+ FOLLOW_LINKS;
}
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/nio/file/FileVisitor.java
--- a/jdk/src/share/classes/java/nio/file/FileVisitor.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/nio/file/FileVisitor.java Tue Oct 26 16:48:28 2010 -0700
@@ -40,33 +40,28 @@
* Path start = ...
* Files.walkFileTree(start, new SimpleFileVisitor<Path>() {
* @Override
- * public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
- * try {
- * file.delete();
- * } catch (IOException exc) {
- * // failed to delete, do error handling here
- * }
+ * public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
+ * throws IOException
+ * {
+ * file.delete();
* return FileVisitResult.CONTINUE;
* }
* @Override
- * public FileVisitResult postVisitDirectory(Path dir, IOException e) {
- * if (e == null) {
- * try {
- * dir.delete();
- * } catch (IOException exc) {
- * // failed to delete, do error handling here
- * }
- * } else {
+ * public FileVisitResult postVisitDirectory(Path dir, IOException e)
+ * throws IOException
+ * {
+ * if (e != null) {
* // directory iteration failed
+ * throw e;
* }
+ * dir.delete();
* return FileVisitResult.CONTINUE;
* }
* });
*
- *
Furthermore, suppose we want to copy a file tree rooted at a source
- * directory to a target location. In that case, symbolic links should be
- * followed and the target directory should be created before the entries in
- * the directory are copied.
+ *
Furthermore, suppose we want to copy a file tree to a target location.
+ * In that case, symbolic links should be followed and the target directory
+ * should be created before the entries in the directory are copied.
*
* final Path source = ...
* final Path target = ...
@@ -74,25 +69,21 @@
* Files.walkFileTree(source, EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE,
* new SimpleFileVisitor<Path>() {
* @Override
- * public FileVisitResult preVisitDirectory(Path dir) {
+ * public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)
+ * throws IOException
+ * {
* try {
* dir.copyTo(target.resolve(source.relativize(dir)));
* } catch (FileAlreadyExistsException e) {
* // ignore
- * } catch (IOException e) {
- * // copy failed, do error handling here
- * // skip rest of directory and descendants
- * return SKIP_SUBTREE;
* }
* return CONTINUE;
* }
* @Override
- * public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
- * try {
- * file.copyTo(target.resolve(source.relativize(file)));
- * } catch (IOException e) {
- * // copy failed, do error handling here
- * }
+ * public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
+ * throws IOException
+ * {
+ * file.copyTo(target.resolve(source.relativize(file)));
* return CONTINUE;
* }
* });
@@ -114,22 +105,16 @@
*
* @param dir
* a reference to the directory
+ * @param attrs
+ * the directory's basic attributes
*
* @return the visit result
+ *
+ * @throws IOException
+ * if an I/O error occurs
*/
- FileVisitResult preVisitDirectory(T dir);
-
- /**
- * Invoked for a directory that could not be opened.
- *
- * @param dir
- * a reference to the directory
- * @param exc
- * the I/O exception thrown from the attempt to open the directory
- *
- * @return the visit result
- */
- FileVisitResult preVisitDirectoryFailed(T dir, IOException exc);
+ FileVisitResult preVisitDirectory(T dir, BasicFileAttributes attrs)
+ throws IOException;
/**
* Invoked for a file in a directory.
@@ -140,21 +125,30 @@
* the file's basic attributes
*
* @return the visit result
+ *
+ * @throws IOException
+ * if an I/O error occurs
*/
- FileVisitResult visitFile(T file, BasicFileAttributes attrs);
+ FileVisitResult visitFile(T file, BasicFileAttributes attrs)
+ throws IOException;
/**
- * Invoked for a file when its basic file attributes could not be read.
+ * Invoked for a file that could not be visited. This method is invoked
+ * if the file's attributes could not be read, the file is a directory
+ * that could not be opened, and other reasons.
*
* @param file
* a reference to the file
* @param exc
- * the I/O exception thrown from the attempt to read the file
- * attributes
+ * the I/O exception that prevented the file from being visited
*
* @return the visit result
+ *
+ * @throws IOException
+ * if an I/O error occurs
*/
- FileVisitResult visitFileFailed(T file, IOException exc);
+ FileVisitResult visitFileFailed(T file, IOException exc)
+ throws IOException;
/**
* Invoked for a directory after entries in the directory, and all of their
@@ -171,6 +165,10 @@
* of the directory to complete prematurely
*
* @return the visit result
+ *
+ * @throws IOException
+ * if an I/O error occurs
*/
- FileVisitResult postVisitDirectory(T dir, IOException exc);
+ FileVisitResult postVisitDirectory(T dir, IOException exc)
+ throws IOException;
}
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/nio/file/Files.java
--- a/jdk/src/share/classes/java/nio/file/Files.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/nio/file/Files.java Tue Oct 26 16:48:28 2010 -0700
@@ -135,9 +135,9 @@
* FileVisitor} invoked for each file encountered. File tree traversal
* completes when all accessible files in the tree have been visited, or a
* visit method returns a result of {@link FileVisitResult#TERMINATE
- * TERMINATE}. Where a visit method terminates due an uncaught error or
- * runtime exception then the traversal is terminated and the error or
- * exception is propagated to the caller of this method.
+ * TERMINATE}. Where a visit method terminates due an {@code IOException},
+ * an uncaught error, or runtime exception, then the traversal is terminated
+ * and the error or exception is propagated to the caller of this method.
*
*
For each file encountered this method attempts to gets its {@link
* java.nio.file.attribute.BasicFileAttributes}. If the file is not a
@@ -146,12 +146,10 @@
* due to an I/O exception, then the {@link FileVisitor#visitFileFailed
* visitFileFailed} method is invoked with the I/O exception.
*
- *
Where the file is a directory, this method attempts to open it by
- * invoking its {@link Path#newDirectoryStream newDirectoryStream} method.
- * Where the directory could not be opened, due to an {@code IOException},
- * then the {@link FileVisitor#preVisitDirectoryFailed preVisitDirectoryFailed}
- * method is invoked with the I/O exception, after which, the file tree walk
- * continues, by default, at the next sibling of the directory.
+ *
Where the file is a directory, and the directory could not be opened,
+ * then the {@code visitFileFailed} method is invoked with the I/O exception,
+ * after which, the file tree walk continues, by default, at the next
+ * sibling of the directory.
*
*
Where the directory is opened successfully, then the entries in the
* directory, and their descendants are visited. When all entries
@@ -171,26 +169,25 @@
* method is invoked as specified above).
*
*
If the {@code options} parameter contains the {@link
- * FileVisitOption#DETECT_CYCLES DETECT_CYCLES} or {@link
- * FileVisitOption#FOLLOW_LINKS FOLLOW_LINKS} options then this method keeps
+ * FileVisitOption#FOLLOW_LINKS FOLLOW_LINKS} option then this method keeps
* track of directories visited so that cycles can be detected. A cycle
* arises when there is an entry in a directory that is an ancestor of the
* directory. Cycle detection is done by recording the {@link
* java.nio.file.attribute.BasicFileAttributes#fileKey file-key} of directories,
* or if file keys are not available, by invoking the {@link Path#isSameFile
* isSameFile} method to test if a directory is the same file as an
- * ancestor. When a cycle is detected the {@link FileVisitor#visitFile
- * visitFile} is invoked with the attributes of the directory. The {@link
- * java.nio.file.attribute.BasicFileAttributes#isDirectory isDirectory}
- * method may be used to test if the file is a directory and that a cycle is
- * detected. The {@code preVisitDirectory} and {@code postVisitDirectory}
- * methods are not invoked.
+ * ancestor. When a cycle is detected it is treated as an I/O error, and the
+ * {@link FileVisitor#visitFileFailed visitFileFailed} method is invoked with
+ * an instance of {@link FileSystemLoopException}.
*
*
The {@code maxDepth} parameter is the maximum number of levels of
* directories to visit. A value of {@code 0} means that only the starting
* file is visited, unless denied by the security manager. A value of
* {@link Integer#MAX_VALUE MAX_VALUE} may be used to indicate that all
- * levels should be visited.
+ * levels should be visited. The {@code visitFile} method is invoked for all
+ * files, including directories, encountered at {@code maxDepth}, unless the
+ * basic file attributes cannot be read, in which case the {@code
+ * visitFileFailed} method is invoked.
*
*
If a visitor returns a result of {@code null} then {@code
* NullPointerException} is thrown.
@@ -215,11 +212,14 @@
* In the case of the default provider, the {@link
* SecurityManager#checkRead(String) checkRead} method is invoked
* to check read access to the directory.
+ * @throws IOException
+ * If an I/O error is thrown by a visitor method
*/
public static void walkFileTree(Path start,
Set options,
int maxDepth,
FileVisitor super Path> visitor)
+ throws IOException
{
if (maxDepth < 0)
throw new IllegalArgumentException("'maxDepth' is negative");
@@ -245,8 +245,12 @@
* In the case of the default provider, the {@link
* SecurityManager#checkRead(String) checkRead} method is invoked
* to check read access to the directory.
+ * @throws IOException
+ * If an I/O error is thrown by a visitor method
*/
- public static void walkFileTree(Path start, FileVisitor super Path> visitor) {
+ public static void walkFileTree(Path start, FileVisitor super Path> visitor)
+ throws IOException
+ {
walkFileTree(start,
EnumSet.noneOf(FileVisitOption.class),
Integer.MAX_VALUE,
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/nio/file/SimpleFileVisitor.java
--- a/jdk/src/share/classes/java/nio/file/SimpleFileVisitor.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/nio/file/SimpleFileVisitor.java Tue Oct 26 16:48:28 2010 -0700
@@ -27,7 +27,7 @@
import java.nio.file.attribute.BasicFileAttributes;
import java.io.IOException;
-import java.io.IOError;
+import java.util.Objects;
/**
* A simple visitor of files with default behavior to visit all files and to
@@ -48,70 +48,47 @@
}
/**
- * Throws NullPointerException if obj is null.
- */
- private static void checkNotNull(Object obj) {
- if (obj == null)
- throw new NullPointerException();
- }
-
- /**
* Invoked for a directory before entries in the directory are visited.
*
*
Unless overridden, this method returns {@link FileVisitResult#CONTINUE
* CONTINUE}.
*/
@Override
- public FileVisitResult preVisitDirectory(T dir) {
- checkNotNull(dir);
+ public FileVisitResult preVisitDirectory(T dir, BasicFileAttributes attrs)
+ throws IOException
+ {
+ Objects.nonNull(dir);
+ Objects.nonNull(attrs);
return FileVisitResult.CONTINUE;
}
/**
- * Invoked for a directory that could not be opened.
- *
- *
Unless overridden, this method throws {@link IOError} with the I/O
- * exception as cause.
- *
- * @throws IOError
- * with the I/O exception thrown when the attempt to open the
- * directory failed
- */
- @Override
- public FileVisitResult preVisitDirectoryFailed(T dir, IOException exc) {
- checkNotNull(dir);
- checkNotNull(exc);
- throw new IOError(exc);
- }
-
- /**
* Invoked for a file in a directory.
*
*
Unless overridden, this method returns {@link FileVisitResult#CONTINUE
* CONTINUE}.
*/
@Override
- public FileVisitResult visitFile(T file, BasicFileAttributes attrs) {
- checkNotNull(file);
- checkNotNull(attrs);
+ public FileVisitResult visitFile(T file, BasicFileAttributes attrs)
+ throws IOException
+ {
+ Objects.nonNull(file);
+ Objects.nonNull(attrs);
return FileVisitResult.CONTINUE;
}
/**
- * Invoked for a file when its basic file attributes could not be read.
+ * Invoked for a file that could not be visited.
*
- *
Unless overridden, this method throws {@link IOError} with the I/O
- * exception as cause.
- *
- * @throws IOError
- * with the I/O exception thrown when the attempt to read the file
- * attributes failed
+ *
Unless overridden, this method re-throws the I/O exception that prevented
+ * the file from being visited.
*/
@Override
- public FileVisitResult visitFileFailed(T file, IOException exc) {
- checkNotNull(file);
- checkNotNull(exc);
- throw new IOError(exc);
+ public FileVisitResult visitFileFailed(T file, IOException exc)
+ throws IOException
+ {
+ Objects.nonNull(file);
+ throw exc;
}
/**
@@ -120,18 +97,16 @@
*
*
Unless overridden, this method returns {@link FileVisitResult#CONTINUE
* CONTINUE} if the directory iteration completes without an I/O exception;
- * otherwise this method throws {@link IOError} with the I/O exception as
- * cause.
- *
- * @throws IOError
- * with the I/O exception thrown when iteration of the directory
- * completed prematurely due to an I/O error
+ * otherwise this method re-throws the I/O exception that caused the iteration
+ * of the directory to terminate prematurely.
*/
@Override
- public FileVisitResult postVisitDirectory(T dir, IOException exc) {
- checkNotNull(dir);
+ public FileVisitResult postVisitDirectory(T dir, IOException exc)
+ throws IOException
+ {
+ Objects.nonNull(dir);
if (exc != null)
- throw new IOError(exc);
+ throw exc;
return FileVisitResult.CONTINUE;
}
}
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/sql/DatabaseMetaData.java
--- a/jdk/src/share/classes/java/sql/DatabaseMetaData.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/sql/DatabaseMetaData.java Tue Oct 26 16:48:28 2010 -0700
@@ -3643,7 +3643,7 @@
/**
* Retrieves whether a generated key will always be returned if the column
- * name(s) or indexe(s) specified for the auto generated key column(s)
+ * name(s) or index(es) specified for the auto generated key column(s)
* are valid and the statement succeeds. The key that is returned may or
* may not be based on the column(s) for the auto generated key.
* Consult your JDBC driver documentation for additional details.
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/sql/Statement.java
--- a/jdk/src/share/classes/java/sql/Statement.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/sql/Statement.java Tue Oct 26 16:48:28 2010 -0700
@@ -1051,9 +1051,9 @@
/**
* Returns a value indicating whether this {@code Statement} will be
- * closed when all dependent objects such as resultsets are closed.
+ * closed when all its dependent result sets are closed.
* @return {@code true} if the {@code Statement} will be closed when all
- * of its dependent objects are closed; {@code false} otherwise
+ * of its dependent result sets are closed; {@code false} otherwise
* @throws SQLException if this method is called on a closed
* {@code Statement}
* @since 1.7
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/util/Locale.java
--- a/jdk/src/share/classes/java/util/Locale.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/util/Locale.java Tue Oct 26 16:48:28 2010 -0700
@@ -569,6 +569,9 @@
* @exception NullPointerException thrown if any argument is null.
*/
public Locale(String language, String country, String variant) {
+ if (language== null || country == null || variant == null) {
+ throw new NullPointerException();
+ }
_baseLocale = BaseLocale.getInstance(convertOldISOCodes(language), "", country, variant);
_extensions = getCompatibilityExtensions(language, "", country, variant);
}
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/util/ResourceBundle.java
--- a/jdk/src/share/classes/java/util/ResourceBundle.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/java/util/ResourceBundle.java Tue Oct 26 16:48:28 2010 -0700
@@ -293,16 +293,6 @@
= new ConcurrentHashMap(INITIAL_CACHE_SIZE);
/**
- * This ConcurrentMap is used to keep multiple threads from loading the
- * same bundle concurrently. The table entries are
- * where CacheKey is the key for the bundle that is under construction
- * and Thread is the thread that is constructing the bundle.
- * This list is manipulated in findBundleInCache and putBundleInCache.
- */
- private static final ConcurrentMap underConstruction
- = new ConcurrentHashMap();
-
- /**
* Queue for reference objects referring to class loaders or bundles.
*/
private static final ReferenceQueue referenceQueue = new ReferenceQueue();
@@ -1381,7 +1371,7 @@
boolean expiredBundle = false;
// First, look up the cache to see if it's in the cache, without
- // declaring beginLoading.
+ // attempting to load bundle.
cacheKey.setLocale(targetLocale);
ResourceBundle bundle = findBundleInCache(cacheKey, control);
if (isValidBundle(bundle)) {
@@ -1408,56 +1398,25 @@
CacheKey constKey = (CacheKey) cacheKey.clone();
try {
- // Try declaring loading. If beginLoading() returns true,
- // then we can proceed. Otherwise, we need to take a look
- // at the cache again to see if someone else has loaded
- // the bundle and put it in the cache while we've been
- // waiting for other loading work to complete.
- while (!beginLoading(constKey)) {
- bundle = findBundleInCache(cacheKey, control);
- if (bundle == null) {
- continue;
+ bundle = loadBundle(cacheKey, formats, control, expiredBundle);
+ if (bundle != null) {
+ if (bundle.parent == null) {
+ bundle.setParent(parent);
}
- if (bundle == NONEXISTENT_BUNDLE) {
- // If the bundle is NONEXISTENT_BUNDLE, the bundle doesn't exist.
- return parent;
- }
- expiredBundle = bundle.expired;
- if (!expiredBundle) {
- if (bundle.parent == parent) {
- return bundle;
- }
- BundleReference bundleRef = cacheList.get(cacheKey);
- if (bundleRef != null && bundleRef.get() == bundle) {
- cacheList.remove(cacheKey, bundleRef);
- }
- }
+ bundle.locale = targetLocale;
+ bundle = putBundleInCache(cacheKey, bundle, control);
+ return bundle;
}
- try {
- bundle = loadBundle(cacheKey, formats, control, expiredBundle);
- if (bundle != null) {
- if (bundle.parent == null) {
- bundle.setParent(parent);
- }
- bundle.locale = targetLocale;
- bundle = putBundleInCache(cacheKey, bundle, control);
- return bundle;
- }
-
- // Put NONEXISTENT_BUNDLE in the cache as a mark that there's no bundle
- // instance for the locale.
- putBundleInCache(cacheKey, NONEXISTENT_BUNDLE, control);
- } finally {
- endLoading(constKey);
- }
+ // Put NONEXISTENT_BUNDLE in the cache as a mark that there's no bundle
+ // instance for the locale.
+ putBundleInCache(cacheKey, NONEXISTENT_BUNDLE, control);
} finally {
if (constKey.getCause() instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
}
}
- assert underConstruction.get(cacheKey) != Thread.currentThread();
return parent;
}
@@ -1465,7 +1424,6 @@
List formats,
Control control,
boolean reload) {
- assert underConstruction.get(cacheKey) == Thread.currentThread();
// Here we actually load the bundle in the order of formats
// specified by the getFormats() value.
@@ -1498,7 +1456,6 @@
break;
}
}
- assert underConstruction.get(cacheKey) == Thread.currentThread();
return bundle;
}
@@ -1530,57 +1487,6 @@
}
/**
- * Declares the beginning of actual resource bundle loading. This method
- * returns true if the declaration is successful and the current thread has
- * been put in underConstruction. If someone else has already begun
- * loading, this method waits until that loading work is complete and
- * returns false.
- */
- private static final boolean beginLoading(CacheKey constKey) {
- Thread me = Thread.currentThread();
- Thread worker;
- // We need to declare by putting the current Thread (me) to
- // underConstruction that we are working on loading the specified
- // resource bundle. If we are already working the loading, it means
- // that the resource loading requires a recursive call. In that case,
- // we have to proceed. (4300693)
- if (((worker = underConstruction.putIfAbsent(constKey, me)) == null)
- || worker == me) {
- return true;
- }
-
- // If someone else is working on the loading, wait until
- // the Thread finishes the bundle loading.
- synchronized (worker) {
- while (underConstruction.get(constKey) == worker) {
- try {
- worker.wait();
- } catch (InterruptedException e) {
- // record the interruption
- constKey.setCause(e);
- }
- }
- }
- return false;
- }
-
- /**
- * Declares the end of the bundle loading. This method calls notifyAll
- * for those who are waiting for this completion.
- */
- private static final void endLoading(CacheKey constKey) {
- // Remove this Thread from the underConstruction map and wake up
- // those who have been waiting for me to complete this bundle
- // loading.
- Thread me = Thread.currentThread();
- assert (underConstruction.get(constKey) == me);
- underConstruction.remove(constKey);
- synchronized (me) {
- me.notifyAll();
- }
- }
-
- /**
* Throw a MissingResourceException with proper message
*/
private static final void throwMissingResourceException(String baseName,
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java Tue Oct 26 16:48:28 2010 -0700
@@ -0,0 +1,1445 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * 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
+ */
+
+package java.util.concurrent;
+
+import java.util.AbstractCollection;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.ConcurrentModificationException;
+import java.util.Deque;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+import java.util.Queue;
+
+/**
+ * An unbounded concurrent {@linkplain Deque deque} based on linked nodes.
+ * Concurrent insertion, removal, and access operations execute safely
+ * across multiple threads.
+ * A {@code ConcurrentLinkedDeque} is an appropriate choice when
+ * many threads will share access to a common collection.
+ * Like most other concurrent collection implementations, this class
+ * does not permit the use of {@code null} elements.
+ *
+ *
Iterators are weakly consistent, returning elements
+ * reflecting the state of the deque at some point at or since the
+ * creation of the iterator. They do not throw {@link
+ * java.util.ConcurrentModificationException
+ * ConcurrentModificationException}, and may proceed concurrently with
+ * other operations.
+ *
+ *
Beware that, unlike in most collections, the {@code size}
+ * method is NOT a constant-time operation. Because of the
+ * asynchronous nature of these deques, determining the current number
+ * of elements requires a traversal of the elements.
+ *
+ *
This class and its iterator implement all of the optional
+ * methods of the {@link Deque} and {@link Iterator} interfaces.
+ *
+ *
Memory consistency effects: As with other concurrent collections,
+ * actions in a thread prior to placing an object into a
+ * {@code ConcurrentLinkedDeque}
+ * happen-before
+ * actions subsequent to the access or removal of that element from
+ * the {@code ConcurrentLinkedDeque} in another thread.
+ *
+ *
This class is a member of the
+ *
+ * Java Collections Framework.
+ *
+ * @since 1.7
+ * @author Doug Lea
+ * @author Martin Buchholz
+ * @param the type of elements held in this collection
+ */
+
+public class ConcurrentLinkedDeque
+ extends AbstractCollection
+ implements Deque, java.io.Serializable {
+
+ /*
+ * This is an implementation of a concurrent lock-free deque
+ * supporting interior removes but not interior insertions, as
+ * required to support the entire Deque interface.
+ *
+ * We extend the techniques developed for ConcurrentLinkedQueue and
+ * LinkedTransferQueue (see the internal docs for those classes).
+ * Understanding the ConcurrentLinkedQueue implementation is a
+ * prerequisite for understanding the implementation of this class.
+ *
+ * The data structure is a symmetrical doubly-linked "GC-robust"
+ * linked list of nodes. We minimize the number of volatile writes
+ * using two techniques: advancing multiple hops with a single CAS
+ * and mixing volatile and non-volatile writes of the same memory
+ * locations.
+ *
+ * A node contains the expected E ("item") and links to predecessor
+ * ("prev") and successor ("next") nodes:
+ *
+ * class Node { volatile Node prev, next; volatile E item; }
+ *
+ * A node p is considered "live" if it contains a non-null item
+ * (p.item != null). When an item is CASed to null, the item is
+ * atomically logically deleted from the collection.
+ *
+ * At any time, there is precisely one "first" node with a null
+ * prev reference that terminates any chain of prev references
+ * starting at a live node. Similarly there is precisely one
+ * "last" node terminating any chain of next references starting at
+ * a live node. The "first" and "last" nodes may or may not be live.
+ * The "first" and "last" nodes are always mutually reachable.
+ *
+ * A new element is added atomically by CASing the null prev or
+ * next reference in the first or last node to a fresh node
+ * containing the element. The element's node atomically becomes
+ * "live" at that point.
+ *
+ * A node is considered "active" if it is a live node, or the
+ * first or last node. Active nodes cannot be unlinked.
+ *
+ * A "self-link" is a next or prev reference that is the same node:
+ * p.prev == p or p.next == p
+ * Self-links are used in the node unlinking process. Active nodes
+ * never have self-links.
+ *
+ * A node p is active if and only if:
+ *
+ * p.item != null ||
+ * (p.prev == null && p.next != p) ||
+ * (p.next == null && p.prev != p)
+ *
+ * The deque object has two node references, "head" and "tail".
+ * The head and tail are only approximations to the first and last
+ * nodes of the deque. The first node can always be found by
+ * following prev pointers from head; likewise for tail. However,
+ * it is permissible for head and tail to be referring to deleted
+ * nodes that have been unlinked and so may not be reachable from
+ * any live node.
+ *
+ * There are 3 stages of node deletion;
+ * "logical deletion", "unlinking", and "gc-unlinking".
+ *
+ * 1. "logical deletion" by CASing item to null atomically removes
+ * the element from the collection, and makes the containing node
+ * eligible for unlinking.
+ *
+ * 2. "unlinking" makes a deleted node unreachable from active
+ * nodes, and thus eventually reclaimable by GC. Unlinked nodes
+ * may remain reachable indefinitely from an iterator.
+ *
+ * Physical node unlinking is merely an optimization (albeit a
+ * critical one), and so can be performed at our convenience. At
+ * any time, the set of live nodes maintained by prev and next
+ * links are identical, that is, the live nodes found via next
+ * links from the first node is equal to the elements found via
+ * prev links from the last node. However, this is not true for
+ * nodes that have already been logically deleted - such nodes may
+ * be reachable in one direction only.
+ *
+ * 3. "gc-unlinking" takes unlinking further by making active
+ * nodes unreachable from deleted nodes, making it easier for the
+ * GC to reclaim future deleted nodes. This step makes the data
+ * structure "gc-robust", as first described in detail by Boehm
+ * (http://portal.acm.org/citation.cfm?doid=503272.503282).
+ *
+ * GC-unlinked nodes may remain reachable indefinitely from an
+ * iterator, but unlike unlinked nodes, are never reachable from
+ * head or tail.
+ *
+ * Making the data structure GC-robust will eliminate the risk of
+ * unbounded memory retention with conservative GCs and is likely
+ * to improve performance with generational GCs.
+ *
+ * When a node is dequeued at either end, e.g. via poll(), we would
+ * like to break any references from the node to active nodes. We
+ * develop further the use of self-links that was very effective in
+ * other concurrent collection classes. The idea is to replace
+ * prev and next pointers with special values that are interpreted
+ * to mean off-the-list-at-one-end. These are approximations, but
+ * good enough to preserve the properties we want in our
+ * traversals, e.g. we guarantee that a traversal will never visit
+ * the same element twice, but we don't guarantee whether a
+ * traversal that runs out of elements will be able to see more
+ * elements later after enqueues at that end. Doing gc-unlinking
+ * safely is particularly tricky, since any node can be in use
+ * indefinitely (for example by an iterator). We must ensure that
+ * the nodes pointed at by head/tail never get gc-unlinked, since
+ * head/tail are needed to get "back on track" by other nodes that
+ * are gc-unlinked. gc-unlinking accounts for much of the
+ * implementation complexity.
+ *
+ * Since neither unlinking nor gc-unlinking are necessary for
+ * correctness, there are many implementation choices regarding
+ * frequency (eagerness) of these operations. Since volatile
+ * reads are likely to be much cheaper than CASes, saving CASes by
+ * unlinking multiple adjacent nodes at a time may be a win.
+ * gc-unlinking can be performed rarely and still be effective,
+ * since it is most important that long chains of deleted nodes
+ * are occasionally broken.
+ *
+ * The actual representation we use is that p.next == p means to
+ * goto the first node (which in turn is reached by following prev
+ * pointers from head), and p.next == null && p.prev == p means
+ * that the iteration is at an end and that p is a (final static)
+ * dummy node, NEXT_TERMINATOR, and not the last active node.
+ * Finishing the iteration when encountering such a TERMINATOR is
+ * good enough for read-only traversals, so such traversals can use
+ * p.next == null as the termination condition. When we need to
+ * find the last (active) node, for enqueueing a new node, we need
+ * to check whether we have reached a TERMINATOR node; if so,
+ * restart traversal from tail.
+ *
+ * The implementation is completely directionally symmetrical,
+ * except that most public methods that iterate through the list
+ * follow next pointers ("forward" direction).
+ *
+ * We believe (without full proof) that all single-element deque
+ * operations (e.g., addFirst, peekLast, pollLast) are linearizable
+ * (see Herlihy and Shavit's book). However, some combinations of
+ * operations are known not to be linearizable. In particular,
+ * when an addFirst(A) is racing with pollFirst() removing B, it is
+ * possible for an observer iterating over the elements to observe
+ * A B C and subsequently observe A C, even though no interior
+ * removes are ever performed. Nevertheless, iterators behave
+ * reasonably, providing the "weakly consistent" guarantees.
+ *
+ * Empirically, microbenchmarks suggest that this class adds about
+ * 40% overhead relative to ConcurrentLinkedQueue, which feels as
+ * good as we can hope for.
+ */
+
+ private static final long serialVersionUID = 876323262645176354L;
+
+ /**
+ * A node from which the first node on list (that is, the unique node p
+ * with p.prev == null && p.next != p) can be reached in O(1) time.
+ * Invariants:
+ * - the first node is always O(1) reachable from head via prev links
+ * - all live nodes are reachable from the first node via succ()
+ * - head != null
+ * - (tmp = head).next != tmp || tmp != head
+ * - head is never gc-unlinked (but may be unlinked)
+ * Non-invariants:
+ * - head.item may or may not be null
+ * - head may not be reachable from the first or last node, or from tail
+ */
+ private transient volatile Node head;
+
+ /**
+ * A node from which the last node on list (that is, the unique node p
+ * with p.next == null && p.prev != p) can be reached in O(1) time.
+ * Invariants:
+ * - the last node is always O(1) reachable from tail via next links
+ * - all live nodes are reachable from the last node via pred()
+ * - tail != null
+ * - tail is never gc-unlinked (but may be unlinked)
+ * Non-invariants:
+ * - tail.item may or may not be null
+ * - tail may not be reachable from the first or last node, or from head
+ */
+ private transient volatile Node tail;
+
+ private final static Node
* The SyncFactory checks this file and registers the
@@ -369,7 +369,7 @@
try {
// check if user is supplying his Synchronisation Provider
- // Implementation if not use Sun's implementation.
+ // Implementation if not using Oracle's implementation.
// properties.load(new FileInputStream(ROWSET_PROPERTIES));
// The rowset.properties needs to be in jdk/jre/lib when
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/javax/sql/rowset/spi/SyncProvider.java
--- a/jdk/src/share/classes/javax/sql/rowset/spi/SyncProvider.java Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncProvider.java Tue Oct 26 16:48:28 2010 -0700
@@ -91,8 +91,8 @@
*
*
* A vendor can register a SyncProvider implementation class name
- * with Sun Microsystems, Inc. by sending email to jdbc@sun.com.
- * Sun will maintain a database listing the
+ * with Oracle Corporation by sending email to jdbc@sun.com.
+ * Oracle will maintain a database listing the
* available SyncProvider implementations for use with compliant
* RowSet implementations. This database will be similar to the
* one already maintained to list available JDBC drivers.
diff -r fd89b5882576 -r 2c819a885d10 jdk/src/share/classes/javax/sql/rowset/spi/package.html
--- a/jdk/src/share/classes/javax/sql/rowset/spi/package.html Tue Oct 26 14:08:49 2010 -0400
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/package.html Tue Oct 26 16:48:28 2010 -0700
@@ -8,7 +8,7 @@
-
-
-
-
-
-
+
+
-
-
-
+
-
+
-
+
-
+
Must set property 'includes'
-
-
-
-
-
+
-
+
Must set property 'run.classname'
-
+
-
-
-
+
@@ -118,7 +118,7 @@
-
+
@@ -127,36 +127,36 @@
-
+
Some tests failed; see report for details.
-
+
-
+
-
+
Must set property 'debug.classname'
-
+
Must set property 'jtreg.tests'
-
+
-
+
Must set property 'class'
@@ -169,16 +169,16 @@
-
+
-
-
-
+
@@ -187,7 +187,7 @@
-
+
@@ -196,26 +196,26 @@
-
+
-
+
-
+
-
-
+
-
@@ -236,7 +236,7 @@
-
+
@@ -251,28 +251,29 @@
-
-
+
-
+
diff -r fd89b5882576 -r 2c819a885d10 langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java
--- a/langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java Tue Oct 26 14:08:49 2010 -0400
+++ b/langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java Tue Oct 26 16:48:28 2010 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -99,9 +99,6 @@
private static Context preRegister(Context context) {
Bark.preRegister(context);
- // force the use of the scanner that captures Javadoc comments
- DocCommentScanner.Factory.preRegister(context);
-
if (context.get(JavaFileManager.class) == null)
JavacFileManager.preRegister(context);
diff -r fd89b5882576 -r 2c819a885d10 langtools/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Tue Oct 26 14:08:49 2010 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Tue Oct 26 16:48:28 2010 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -96,9 +96,6 @@
args.getClass();
context.getClass();
fileObjects.getClass();
-
- // force the use of the scanner that captures Javadoc comments
- com.sun.tools.javac.parser.DocCommentScanner.Factory.preRegister(context);
}
JavacTaskImpl(JavacTool tool,
@@ -337,9 +334,13 @@
ListBuffer elements = new ListBuffer();
for (JCCompilationUnit unit : units) {
- for (JCTree node : unit.defs)
- if (node.getTag() == JCTree.CLASSDEF)
- elements.append(((JCTree.JCClassDecl) node).sym);
+ for (JCTree node : unit.defs) {
+ if (node.getTag() == JCTree.CLASSDEF) {
+ JCClassDecl cdef = (JCClassDecl) node;
+ if (cdef.sym != null) // maybe null if errors in anno processing
+ elements.append(cdef.sym);
+ }
+ }
}
return elements.toList();
}
diff -r fd89b5882576 -r 2c819a885d10 langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java Tue Oct 26 14:08:49 2010 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java Tue Oct 26 16:48:28 2010 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,6 @@
import com.sun.tools.javac.comp.MemberEnter;
import com.sun.tools.javac.comp.Resolve;
import com.sun.tools.javac.model.JavacElements;
-import com.sun.tools.javac.processing.JavacMessager;
import com.sun.tools.javac.processing.JavacProcessingEnvironment;
import com.sun.tools.javac.tree.JCTree.*;
import com.sun.tools.javac.tree.JCTree;
@@ -81,14 +80,15 @@
*/
public class JavacTrees extends Trees {
- private final Resolve resolve;
- private final Enter enter;
- private final Log log;
- private final MemberEnter memberEnter;
- private final Attr attr;
- private final TreeMaker treeMaker;
- private final JavacElements elements;
- private final JavacTaskImpl javacTaskImpl;
+ // in a world of a single context per compilation, these would all be final
+ private Resolve resolve;
+ private Enter enter;
+ private Log log;
+ private MemberEnter memberEnter;
+ private Attr attr;
+ private TreeMaker treeMaker;
+ private JavacElements elements;
+ private JavacTaskImpl javacTaskImpl;
public static JavacTrees instance(JavaCompiler.CompilationTask task) {
if (!(task instanceof JavacTaskImpl))
@@ -111,6 +111,14 @@
private JavacTrees(Context context) {
context.put(JavacTrees.class, this);
+ init(context);
+ }
+
+ public void updateContext(Context context) {
+ init(context);
+ }
+
+ private void init(Context context) {
attr = Attr.instance(context);
enter = Enter.instance(context);
elements = JavacElements.instance(context);
@@ -337,6 +345,7 @@
super(M);
}
+ @Override
public T copy(T t, JCTree leaf) {
T t2 = super.copy(t, leaf);
if (t == leaf)
diff -r fd89b5882576 -r 2c819a885d10 langtools/src/share/classes/com/sun/tools/javac/code/Scope.java
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Scope.java Tue Oct 26 14:08:49 2010 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Scope.java Tue Oct 26 16:48:28 2010 -0700
@@ -70,6 +70,45 @@
*/
public int nelems = 0;
+ /** A timestamp - useful to quickly check whether a scope has changed or not
+ */
+ public ScopeCounter scopeCounter;
+
+ static ScopeCounter dummyCounter = new ScopeCounter() {
+ @Override
+ public void inc() {
+ //do nothing
+ }
+ };
+
+ public static class ScopeCounter {
+ protected static final Context.Key scopeCounterKey =
+ new Context.Key();
+
+ public static ScopeCounter instance(Context context) {
+ ScopeCounter instance = context.get(scopeCounterKey);
+ if (instance == null)
+ instance = new ScopeCounter(context);
+ return instance;
+ }
+
+ protected ScopeCounter(Context context) {
+ context.put(scopeCounterKey, this);
+ }
+
+ private ScopeCounter() {};
+
+ private long val = 0;
+
+ public void inc() {
+ val++;
+ }
+
+ public long val() {
+ return val;
+ }
+ }
+
/** Every hash bucket is a list of Entry's which ends in sentinel.
*/
private static final Entry sentinel = new Entry(null, null, null, null);
@@ -80,12 +119,12 @@
/** A value for the empty scope.
*/
- public static final Scope emptyScope = new Scope(null, null, new Entry[]{});
+ public static final Scope emptyScope = new Scope(null, null, new Entry[]{}, dummyCounter);
/** Construct a new scope, within scope next, with given owner, using
* given table. The table's length must be an exponent of 2.
*/
- Scope(Scope next, Symbol owner, Entry[] table) {
+ private Scope(Scope next, Symbol owner, Entry[] table, ScopeCounter scopeCounter) {
this.next = next;
assert emptyScope == null || owner != null;
this.owner = owner;
@@ -94,13 +133,18 @@
this.elems = null;
this.nelems = 0;
this.shared = 0;
+ this.scopeCounter = scopeCounter;
}
/** Construct a new scope, within scope next, with given owner,
* using a fresh table of length INITIAL_SIZE.
*/
public Scope(Symbol owner) {
- this(null, owner, new Entry[INITIAL_SIZE]);
+ this(owner, dummyCounter);
+ }
+
+ protected Scope(Symbol owner, ScopeCounter scopeCounter) {
+ this(null, owner, new Entry[INITIAL_SIZE], scopeCounter);
for (int i = 0; i < INITIAL_SIZE; i++) table[i] = sentinel;
}
@@ -110,7 +154,7 @@
* of fresh tables.
*/
public Scope dup() {
- Scope result = new Scope(this, this.owner, this.table);
+ Scope result = new Scope(this, this.owner, this.table, scopeCounter);
shared++;
// System.out.println("====> duping scope " + this.hashCode() + " owned by " + this.owner + " to " + result.hashCode());
// new Error().printStackTrace(System.out);
@@ -123,7 +167,7 @@
* of fresh tables.
*/
public Scope dup(Symbol newOwner) {
- Scope result = new Scope(this, newOwner, this.table);
+ Scope result = new Scope(this, newOwner, this.table, scopeCounter);
shared++;
// System.out.println("====> duping scope " + this.hashCode() + " owned by " + newOwner + " to " + result.hashCode());
// new Error().printStackTrace(System.out);
@@ -135,7 +179,7 @@
* the table of its outer scope.
*/
public Scope dupUnshared() {
- return new Scope(this, this.owner, this.table.clone());
+ return new Scope(this, this.owner, this.table.clone(), scopeCounter);
}
/** Remove all entries of this scope from its table, if shared
@@ -211,6 +255,7 @@
table[hash] = e;
elems = e;
nelems++;
+ scopeCounter.inc();
}
Entry makeEntry(Symbol sym, Entry shadowed, Entry sibling, Scope scope, Scope origin) {
@@ -226,6 +271,8 @@
while (e.scope == this && e.sym != sym) e = e.next();
if (e.scope == null) return;
+ scopeCounter.inc();
+
// remove e from table and shadowed list;
Entry te = table[sym.name.hashCode() & hashMask];
if (te == e)
@@ -472,7 +519,7 @@
public static final Entry[] emptyTable = new Entry[0];
public DelegatedScope(Scope outer) {
- super(outer, outer.owner, emptyTable);
+ super(outer, outer.owner, emptyTable, outer.scopeCounter);
delegatee = outer;
}
public Scope dup() {
@@ -498,10 +545,22 @@
}
}
+ /** A class scope, for which a scope counter should be provided */
+ public static class ClassScope extends Scope {
+
+ ClassScope(Scope next, Symbol owner, Entry[] table, ScopeCounter scopeCounter) {
+ super(next, owner, table, scopeCounter);
+ }
+
+ public ClassScope(Symbol owner, ScopeCounter scopeCounter) {
+ super(owner, scopeCounter);
+ }
+ }
+
/** An error scope, for which the owner should be an error symbol. */
public static class ErrorScope extends Scope {
ErrorScope(Scope next, Symbol errSymbol, Entry[] table) {
- super(next, /*owner=*/errSymbol, table);
+ super(next, /*owner=*/errSymbol, table, dummyCounter);
}
public ErrorScope(Symbol errSymbol) {
super(errSymbol);
diff -r fd89b5882576 -r 2c819a885d10 langtools/src/share/classes/com/sun/tools/javac/code/Source.java
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Source.java Tue Oct 26 14:08:49 2010 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Source.java Tue Oct 26 16:48:28 2010 -0700
@@ -25,11 +25,14 @@
package com.sun.tools.javac.code;
+import java.util.*;
+import javax.lang.model.SourceVersion;
+import static javax.lang.model.SourceVersion.*;
+
import com.sun.tools.javac.util.*;
import com.sun.tools.javac.jvm.Target;
-import javax.lang.model.SourceVersion;
-import static javax.lang.model.SourceVersion.*;
-import java.util.*;
+
+import static com.sun.tools.javac.main.OptionName.*;
/** The source language version accepted.
*
@@ -71,7 +74,7 @@
Source instance = context.get(sourceKey);
if (instance == null) {
Options options = Options.instance(context);
- String sourceString = options.get("-source");
+ String sourceString = options.get(SOURCE);
if (sourceString != null) instance = lookup(sourceString);
if (instance == null) instance = DEFAULT;
context.put(sourceKey, instance);
diff -r fd89b5882576 -r 2c819a885d10 langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java Tue Oct 26 14:08:49 2010 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java Tue Oct 26 16:48:28 2010 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -960,6 +960,8 @@
return ElementKind.ENUM_CONSTANT;
} else if (owner.kind == TYP || owner.kind == ERR) {
return ElementKind.FIELD;
+ } else if (isResourceVariable()) {
+ return ElementKind.RESOURCE_VARIABLE;
} else {
return ElementKind.LOCAL_VARIABLE;
}
diff -r fd89b5882576 -r 2c819a885d10 langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java Tue Oct 26 14:08:49 2010 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java Tue Oct 26 16:48:28 2010 -0700
@@ -74,6 +74,7 @@
public final JCNoType voidType = new JCNoType(TypeTags.VOID);
private final Names names;
+ private final Scope.ScopeCounter scopeCounter;
private final ClassReader reader;
private final Target target;
@@ -340,6 +341,7 @@
context.put(symtabKey, this);
names = Names.instance(context);
+ scopeCounter = Scope.ScopeCounter.instance(context);
target = Target.instance(context);
// Create the unknown type
@@ -386,7 +388,7 @@
// Create class to hold all predefined constants and operations.
predefClass = new ClassSymbol(PUBLIC|ACYCLIC, names.empty, rootPackage);
- Scope scope = new Scope(predefClass);
+ Scope scope = new Scope.ClassScope(predefClass, scopeCounter);
predefClass.members_field = scope;
// Enter symbols for basic types.
@@ -476,7 +478,7 @@
proprietarySymbol.completer = null;
proprietarySymbol.flags_field = PUBLIC|ACYCLIC|ANNOTATION|INTERFACE;
proprietarySymbol.erasure_field = proprietaryType;
- proprietarySymbol.members_field = new Scope(proprietarySymbol);
+ proprietarySymbol.members_field = new Scope.ClassScope(proprietarySymbol, scopeCounter);
proprietaryType.typarams_field = List.nil();
proprietaryType.allparams_field = List.nil();
proprietaryType.supertype_field = annotationType;
@@ -488,7 +490,7 @@
ClassType arrayClassType = (ClassType)arrayClass.type;
arrayClassType.supertype_field = objectType;
arrayClassType.interfaces_field = List.of(cloneableType, serializableType);
- arrayClass.members_field = new Scope(arrayClass);
+ arrayClass.members_field = new Scope.ClassScope(arrayClass, scopeCounter);
lengthVar = new VarSymbol(
PUBLIC | FINAL,
names.length,
diff -r fd89b5882576 -r 2c819a885d10 langtools/src/share/classes/com/sun/tools/javac/code/Types.java
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java Tue Oct 26 14:08:49 2010 -0400
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java Tue Oct 26 16:48:28 2010 -0700
@@ -69,6 +69,7 @@
new Context.Key();
final Symtab syms;
+ final Scope.ScopeCounter scopeCounter;
final JavacMessages messages;
final Names names;
final boolean allowBoxing;
@@ -89,6 +90,7 @@
protected Types(Context context) {
context.put(typesKey, this);
syms = Symtab.instance(context);
+ scopeCounter = Scope.ScopeCounter.instance(context);
names = Names.instance(context);
allowBoxing = Source.instance(context).allowBoxing();
reader = ClassReader.instance(context);
@@ -1984,22 +1986,26 @@
final MethodSymbol cachedImpl;
final Filter implFilter;
final boolean checkResult;
+ final Scope.ScopeCounter scopeCounter;
public Entry(MethodSymbol cachedImpl,
Filter scopeFilter,
- boolean checkResult) {
+ boolean checkResult,
+ Scope.ScopeCounter scopeCounter) {
this.cachedImpl = cachedImpl;
this.implFilter = scopeFilter;
this.checkResult = checkResult;
+ this.scopeCounter = scopeCounter;
}
- boolean matches(Filter scopeFilter, boolean checkResult) {
+ boolean matches(Filter scopeFilter, boolean checkResult, Scope.ScopeCounter scopeCounter) {
return this.implFilter == scopeFilter &&
- this.checkResult == checkResult;
+ this.checkResult == checkResult &&
+ this.scopeCounter.val() >= scopeCounter.val();
}
}
- MethodSymbol get(MethodSymbol ms, TypeSymbol origin, boolean checkResult, Filter implFilter) {
+ MethodSymbol get(MethodSymbol ms, TypeSymbol origin, boolean checkResult, Filter implFilter, Scope.ScopeCounter scopeCounter) {
SoftReference