# HG changeset patch # User andrew # Date 1338247634 -3600 # Node ID f23f68d747bcedc378b14db0799afbabbbb82b73 # Parent 635ebbe236a9bde0274ea0bf1f3c488bf40d9017# Parent 113f0d5f0a08aa0947b3edf783b603e7f042748a Merge diff -r 635ebbe236a9 -r f23f68d747bc .hgignore --- a/.hgignore Mon Jul 11 22:31:46 2011 +0100 +++ b/.hgignore Tue May 29 00:27:14 2012 +0100 @@ -2,3 +2,4 @@ ^dist/ /nbproject/private/ ^.hgtip +.DS_Store diff -r 635ebbe236a9 -r f23f68d747bc .hgtags --- a/.hgtags Mon Jul 11 22:31:46 2011 +0100 +++ b/.hgtags Tue May 29 00:27:14 2012 +0100 @@ -125,3 +125,43 @@ 77ec0541aa2aa4da27e9e385a118a2e51e7fca24 jdk7-b145 770227a4087e4e401fe87ccd19738440111c3948 jdk7-b146 73323cb3396260d93e0ab731fd2d431096ceed0f jdk7-b147 +949fb60ca830364571e7c4c9964e6b351ca929ec jdk8-b01 +ed8d94519a87b4adac270c3eec9134ff1f62bff5 jdk8-b02 +cd0da00694fbce642db9be936d3e4909a71d911d jdk8-b03 +60a68d688e24473cf84dedd1e60901a61ab82555 jdk8-b04 +cc1b599b986a37cb57de4584c5e58169766ca535 jdk8-b05 +45c43dde7ba7f176333a51a98f086275478836fa jdk8-b06 +3d61f0856f349e2163bf98146465dab3b7437f63 jdk8-b07 +0d52b1c87aa8fdea7fdc9c4126ea58f95ca6b351 jdk8-b08 +a891732c1a83082177ff7a4cf1506068d9cc0a47 jdk8-b09 +cda87f7fefcee3b89742a57ce5ad9b03a54c210d jdk8-b10 +0199e4fef5cc2bd234c65b93220459ef7a3bb3b1 jdk8-b11 +31d70911b712c6b4e580a3110363d5f044cfed7a jdk8-b12 +5b9d9b839d3d7fe02347827221c97c6d242a6f96 jdk8-b13 +e59c47de1ad8982ff3b0e843773a6902b36c2337 jdk8-b14 +7da69e7175a7c7564ee6d0e52255cbb8a57ef577 jdk8-b15 +82dc033975bb9b553b4ef97b6d483eda8de32e0f jdk8-b17 +82dc033975bb9b553b4ef97b6d483eda8de32e0f jdk8-b16 +312cf15d16577ef198b033d2a4cc0a52369b7343 jdk8-b18 +e1366c5d84ef984095a332bcee70b3938232d07d jdk8-b19 +51d8b6cb18c0978ecfa4f33e1537d35ee01b69fa jdk8-b20 +f157fc2a71a38ce44007a6f18d5b011824dce705 jdk8-b21 +a11d0062c445d5f36651c78650ab88aa594bcbff jdk8-b22 +5218eb256658442b62b05295aafa5b5f35252972 jdk8-b23 +b98f0e6dddf987df565029a1f58417fc1844c3f3 jdk8-b24 +e45d6b406d5f91ff5256a5c82456ab1e7eb8becd jdk8-b25 +79f709a099f40c08f76567fa6d813f9009a69826 jdk8-b26 +4fffe75e4edd39a2517f10b743941bf94edb143d jdk8-b27 +2082eb35d49a9c2aab90b8d4fd31cefb7a23b82e jdk8-b28 +6117395d422682f89d228347e319fcaac7edc729 jdk8-b29 +4605f8418bf562e78be79b25b6b8a5110281acae jdk8-b30 +1954151dfae8f73db24e396380f7c02bdd47c486 jdk8-b31 +5d820cb6b1afd75b619e7fd69e4f2b0eb1d5d6a1 jdk8-b32 +1e2ac1ea3f6c32a62bf88f3fa330120c30db59cb jdk8-b33 +e24c5cc8b0f7cc48374eef0f995838fb4823e0eb jdk8-b34 +e3d735914edd0a621b16bb85417423f8e6af5d51 jdk8-b35 +a5a61f259961a7f46b002e5cc50b4a9bf86927b6 jdk8-b36 +83fac66442cf680bb59ec9e3a71cc4729322b595 jdk8-b37 +b8cbfb31139f820e5e094ba71449e58159fbe22e jdk8-b38 +785af00e2827990f149b32ec37f523dbca3efdd1 jdk8-b39 +56d030e5035fdee5bba6cf318a06287fda5d67ec jdk8-b40 diff -r 635ebbe236a9 -r f23f68d747bc make/common/Defs-bsd.gmk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/common/Defs-bsd.gmk Tue May 29 00:27:14 2012 +0100 @@ -0,0 +1,46 @@ +# +# Copyright (c) 1999, 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. +# + +# +# Makefile to specify compiler flags for programs and libraries +# targeted to BSD. Should not contain any rules. +# + +# Warning: the following variables are overriden by Defs.gmk. Set +# values will be silently ignored: +# CFLAGS (set $(OTHER_CFLAGS) instead) +# CPPFLAGS (set $(OTHER_CPPFLAGS) instead) +# CXXFLAGS (set $(OTHER_CXXFLAGS) instead) +# LDFLAGS (set $(OTHER_LDFAGS) instead) +# LDLIBS (set $(EXTRA_LIBS) instead) +# LDLIBS_COMMON (set $(EXTRA_LIBS) instead) + +# Get shared JDK settings +include $(BUILDDIR)/common/shared/Defs.gmk + +ifndef PLATFORM_SRC + PLATFORM_SRC = $(TOPDIR)/src/solaris +endif # PLATFORM_SRC + diff -r 635ebbe236a9 -r f23f68d747bc make/common/internal/Resources.gmk --- a/make/common/internal/Resources.gmk Mon Jul 11 22:31:46 2011 +0100 +++ b/make/common/internal/Resources.gmk Tue May 29 00:27:14 2012 +0100 @@ -149,8 +149,8 @@ # Strip the properties files strip_all_props: $(STRIPPROPERTIES_JARFILE) $(STRIP_PROP_options) @if [ -s $(STRIP_PROP_options) ] ; then \ - $(ECHO) "$(BOOT_JAVA_CMD) -jar $(STRIPPROPERTIES_JARFILE) -optionsfile $(STRIP_PROP_options)" ; \ - $(BOOT_JAVA_CMD) -jar $(STRIPPROPERTIES_JARFILE) -optionsfile $(STRIP_PROP_options) ; \ + $(ECHO) "$(BOOT_JAVA_CMD) -jar $(STRIPPROPERTIES_JARFILE) @$(STRIP_PROP_options)" ; \ + $(BOOT_JAVA_CMD) -jar $(STRIPPROPERTIES_JARFILE) @$(STRIP_PROP_options) ; \ fi @$(java-vm-cleanup) diff -r 635ebbe236a9 -r f23f68d747bc make/common/shared/Defs-bsd.gmk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/common/shared/Defs-bsd.gmk Tue May 29 00:27:14 2012 +0100 @@ -0,0 +1,131 @@ +# +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. 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. +# + +# +# Definitions for Bsd. +# + +# Default for COMPILER_WARNINGS_FATAL on Bsd (C & C++ compiler warnings) +ifndef COMPILER_WARNINGS_FATAL + COMPILER_WARNINGS_FATAL=false +endif + +# Bsd should use parallel compilation for best build times +ifndef COMPILE_APPROACH + COMPILE_APPROACH = parallel +endif + +# Indication that we are doing an incremental build. +# This may trigger the creation of make depend files. +ifndef INCREMENTAL_BUILD + INCREMENTAL_BUILD = false +endif + +# FullPath just makes sure it never ends with a / and no duplicates +define FullPath +$(shell cd $1 2> $(DEV_NULL) && pwd) +endef + +# OptFullPath: Absolute path name of a dir that might not initially exist. +define OptFullPath +$(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi) +endef + +# Location on system where jdk installs might be +USRJDKINSTANCES_PATH =$(PACKAGE_PATH) + +# UNIXCOMMAND_PATH: path to where the most common Unix commands are. +# NOTE: Must end with / so that it could be empty, allowing PATH usage. +ifneq "$(origin ALT_UNIXCOMMAND_PATH)" "undefined" + UNIXCOMMAND_PATH :=$(call PrefixPath,$(ALT_UNIXCOMMAND_PATH)) +else + UNIXCOMMAND_PATH = /bin/ +endif + +# USRBIN_PATH: path to where the most common Unix commands are. +# NOTE: Must end with / so that it could be empty, allowing PATH usage. +ifneq "$(origin ALT_USRBIN_PATH)" "undefined" + USRBIN_PATH :=$(call PrefixPath,$(ALT_USRBIN_PATH)) +else + USRBIN_PATH = /usr/bin/ +endif + +# UNIXCCS_PATH: path to where the Solaris ported UNIX commands can be found +# NOTE: Must end with / so that it could be empty, allowing PATH usage. +ifneq "$(origin ALT_UNIXCCS_PATH)" "undefined" + UNIXCCS_PATH :=$(call PrefixPath,$(ALT_UNIXCCS_PATH)) +else + UNIXCCS_PATH = /usr/ccs/bin/ +endif + +# SLASH_JAVA: location of all network accessable files +ifdef ALT_SLASH_JAVA + SLASH_JAVA :=$(ALT_SLASH_JAVA) +else + SLASH_JAVA := $(call DirExists,/java,/java,/NOT-SET) +endif + +# JDK_DEVTOOLS_DIR: common path for all the java devtools +ifdef ALT_JDK_DEVTOOLS_DIR + JDK_DEVTOOLS_DIR =$(ALT_JDK_DEVTOOLS_DIR) +else + JDK_DEVTOOLS_DIR =$(SLASH_JAVA)/devtools +endif + +# DEVTOOLS_PATH: for other tools required for building (such as zip, etc.) +# NOTE: Must end with / so that it could be empty, allowing PATH usage. +ifneq "$(origin ALT_DEVTOOLS_PATH)" "undefined" + DEVTOOLS_PATH :=$(call PrefixPath,$(ALT_DEVTOOLS_PATH)) +else + DEVTOOLS_PATH =$(PACKAGE_PATH)/bin/ +endif + +# _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK. +# _BOOTDIR2: Second choice +ifndef ALT_BOOTDIR + _BOOTDIR1 =$(SLASH_JAVA)/re/jdk/$(PREVIOUS_JDK_VERSION)/archive/fcs/binaries/$(PLATFORM)-$(ARCH) + _BOOTDIR2 =$(USRJDKINSTANCES_PATH)/jdk$(PREVIOUS_JDK_VERSION) +endif + +# Import JDK images allow for partial builds, components not built are +# imported (or copied from) these import areas when needed. + +# BUILD_JDK_IMPORT_PATH: location of JDK install trees to import for +# multiple platforms, e.g. windows-i586, solaris-sparc, bsd-586, etc. +ifdef ALT_BUILD_JDK_IMPORT_PATH + BUILD_JDK_IMPORT_PATH :=$(call FullPath,$(ALT_BUILD_JDK_IMPORT_PATH)) +else + BUILD_JDK_IMPORT_PATH = $(PROMOTED_BUILD_BINARIES) +endif +BUILD_JDK_IMPORT_PATH:=$(call AltCheckValue,BUILD_JDK_IMPORT_PATH) + +# JDK_IMPORT_PATH: location of JDK install tree (this version) to import +ifdef ALT_JDK_IMPORT_PATH + JDK_IMPORT_PATH :=$(call FullPath,$(ALT_JDK_IMPORT_PATH)) +else + JDK_IMPORT_PATH = $(BUILD_JDK_IMPORT_PATH)/$(PLATFORM)-$(ARCH)$(_JDK_IMPORT_VARIANT) +endif +JDK_IMPORT_PATH:=$(call AltCheckValue,JDK_IMPORT_PATH) + diff -r 635ebbe236a9 -r f23f68d747bc make/common/shared/Defs-utils.gmk --- a/make/common/shared/Defs-utils.gmk Mon Jul 11 22:31:46 2011 +0100 +++ b/make/common/shared/Defs-utils.gmk Tue May 29 00:27:14 2012 +0100 @@ -31,7 +31,7 @@ # These input UTILS_* variables can be defined at anytime, ideally once. # Unix Commands: Normally /bin/, /usr/bin/. or C:/mksnt/mksnt/ # UTILS_COMMAND_PATH -# /usr/bin/ +# /usr/bin/ # UTILS_USR_BIN_PATH # /usr/ccs/bin/ (sccs, m4, lex, yacc, as, ar, strip, mcs) # UTILS_CCS_BIN_PATH @@ -53,6 +53,13 @@ UTILS_DEVTOOL_PATH=$(USRBIN_PATH) endif +ifeq ($(PLATFORM),bsd) + UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH) + UTILS_USR_BIN_PATH=$(USRBIN_PATH) + UTILS_CCS_BIN_PATH=$(USRBIN_PATH) + UTILS_DEVTOOL_PATH=$(DEVTOOLS_PATH) +endif + ifeq ($(PLATFORM),solaris) UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH) UTILS_USR_BIN_PATH=$(UNIXCOMMAND_PATH) @@ -166,15 +173,15 @@ # Also, some distribution (Ubuntu, Debian, others?) place the rpm command # itself in /usr/bin rather than it's traditional home in /bin. RPM=$(firstword $(wildcard $(UTILS_COMMAND_PATH)rpm) \ - $(wildcard $(UTILS_USR_BIN_PATH)rpm)) + $(wildcard $(UTILS_USR_BIN_PATH)rpm)) RPMBUILD=$(firstword $(wildcard $(UTILS_COMMAND_PATH)rpmbuild) \ - $(wildcard $(UTILS_USR_BIN_PATH)rpmbuild) \ - $(wildcard $(UTILS_COMMAND_PATH)rpm) \ - $(wildcard $(UTILS_USR_BIN_PATH)rpm)) + $(wildcard $(UTILS_USR_BIN_PATH)rpmbuild) \ + $(wildcard $(UTILS_COMMAND_PATH)rpm) \ + $(wildcard $(UTILS_USR_BIN_PATH)rpm)) # Most Linux distros have "sort" in /bin. Ubuntu, Debian and perhaps # others have it in /usr/bin. SORT=$(firstword $(wildcard $(UTILS_COMMAND_PATH)sort) \ - $(wildcard $(UTILS_USR_BIN_PATH)sort)) + $(wildcard $(UTILS_USR_BIN_PATH)sort)) NAWK = $(USRBIN_PATH)gawk # Intrinsic unix command, with backslash-escaped character interpretation ECHO = /bin/echo -e @@ -198,3 +205,34 @@ ECHO = /usr/bin/echo endif +# BSD specific +ifeq ($(PLATFORM),bsd) + BASENAME = $(UTILS_USR_BIN_PATH)basename + EGREP = $(UTILS_USR_BIN_PATH)egrep + EXPR = $(UTILS_COMMAND_PATH)expr + FMT = $(UTILS_USR_BIN_PATH)fmt + GREP = $(UTILS_USR_BIN_PATH)grep + GUNZIP = $(UTILS_USR_BIN_PATH)gunzip + ID = $(UTILS_USR_BIN_PATH)id + MSGFMT = $(UTILS_DEVTOOL_PATH)msgfmt + SED = $(UTILS_USR_BIN_PATH)sed + SORT = $(UTILS_USR_BIN_PATH)sort + TEST = $(UTILS_COMMAND_PATH)test + TOUCH = $(UTILS_USR_BIN_PATH)touch + TRUE = $(UTILS_USR_BIN_PATH)true + UNAME = $(UTILS_USR_BIN_PATH)uname + # BSD OS_VENDOR specific + ifeq ($(OS_VENDOR), Apple) + NAWK = $(UTILS_USR_BIN_PATH)awk + UNZIPSFX = $(UTILS_USR_BIN_PATH)unzipsfx + ZIPEXE = $(UTILS_USR_BIN_PATH)zip + else + UNZIP = $(UTILS_DEVTOOL_PATH)unzip + endif + ifeq ($(OS_VENDOR), OpenBSD) + NAWK = $(UTILS_USR_BIN_PATH)awk + else + CPIO = $(UTILS_USR_BIN_PATH)cpio + TAR = $(UTILS_USR_BIN_PATH)tar + endif +endif diff -r 635ebbe236a9 -r f23f68d747bc make/common/shared/Platform.gmk --- a/make/common/shared/Platform.gmk Mon Jul 11 22:31:46 2011 +0100 +++ b/make/common/shared/Platform.gmk Tue May 29 00:27:14 2012 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -62,8 +62,8 @@ # CLASSPATH_SEPARATOR separator in classpath, ; or : # BUNDLE_FILE_SUFFIX suffix for bundles: .tar or .tar.gz # ISA_DIR solaris only: /sparcv9 or /amd64 -# REQUIRED_WINDOWS_NAME windows only: basic name of windows -# REQUIRED_WINDOWS_VERSION windows only: specific version of windows +# REQUIRED_WINDOWS_NAME windows only: basic name of windows +# REQUIRED_WINDOWS_VERSION windows only: specific version of windows # USING_CYGWIN windows only: true or false # WINDOWS_NT_VERSION_STRING windows only: long version name # REQUIRED_OS_VERSION required OS version, e.g. 5.10, 2.4 @@ -135,7 +135,7 @@ BUNDLE_FILE_SUFFIX=.tar # Required Solaris version REQUIRED_OS_VERSION = 5.10 - # Minimum disk space needed as determined by running 'du -sk' on + # Minimum disk space needed as determined by running 'du -sk' on # a fully built workspace. ifeq ($(ARCH_FAMILY), sparc) REQUIRED_FREE_SPACE=1300000 @@ -207,7 +207,7 @@ # Suffix for file bundles used in previous release BUNDLE_FILE_SUFFIX=.tar.gz - # Minimum disk space needed as determined by running 'du -sk' on + # Minimum disk space needed as determined by running 'du -sk' on # a fully built workspace. REQUIRED_FREE_SPACE=1460000 LINUX_VERSION_INFO = /etc/redhat-release @@ -231,6 +231,99 @@ MB_OF_MEMORY := $(shell free -m | fgrep Mem: | sed -e 's@\ \ *@ @g' | cut -d' ' -f2) endif +ifeq ($(SYSTEM_UNAME), FreeBSD) + PLATFORM = bsd + OS_NAME = freebsd + OS_VENDOR = FreeBSD + REQUIRED_OS_VERSION = 6.0 +endif + +ifeq ($(SYSTEM_UNAME), Darwin) + PLATFORM = bsd + OS_NAME = darwin + OS_VENDOR = Apple + REQUIRED_OS_VERSION = 8.0 +endif + +ifeq ($(SYSTEM_UNAME), NetBSD) + PLATFORM = bsd + OS_NAME = netbsd + OS_VENDOR = NetBSD + REQUIRED_OS_VERSION = 3.0 +endif + +ifeq ($(SYSTEM_UNAME), OpenBSD) + PLATFORM = bsd + OS_NAME = openbsd + OS_VENDOR = OpenBSD + REQUIRED_OS_VERSION = 4.9 +endif + +# Platform settings specific to BSD +ifeq ($(PLATFORM), bsd) + OS_VERSION := $(shell uname -r) + # Arch and OS name/version + mach := $(shell uname -m) + archExpr = case "$(mach)" in \ + i[3-9]86) \ + echo i586 \ + ;; \ + sparc64) \ + echo sparcv9 \ + ;; \ + sparc*) \ + echo sparc \ + ;; \ + x86_64) \ + echo x86_64 \ + ;; \ + "Power Macintosh") \ + echo ppc \ + ;; \ + *) \ + echo $(mach) \ + ;; \ + esac + ARCH := $(shell $(archExpr) ) + ARCH_FAMILY := $(ARCH) + + # Darwin builds are currently universal but only include 64-bit + # + # ifeq ($(SYSTEM_UNAME), Darwin) + # ifneq ($(ARCH), ppc) + # ARCH=universal + # endif + # endif + + # i586, sparc, and ppc are 32 bit, amd64 and sparc64 are 64 + ifneq (,$(findstring $(ARCH), i586 sparc ppc universal)) + ARCH_DATA_MODEL=32 + else + ARCH_DATA_MODEL=64 + endif + + ifeq ($(ARCH), i586) + LIBARCH = i386 + else + LIBARCH = $(ARCH) + endif + + # Value of Java os.arch property + ARCHPROP = $(LIBARCH) + + # Suffix for file bundles used in previous release + BUNDLE_FILE_SUFFIX=.tar.gz + # Minimum disk space needed as determined by running 'du -sk' on + # a fully built workspace. + REQUIRED_FREE_SPACE=1500000 + # How much RAM does this machine have: + ifeq ($(OS_VENDOR), OpenBSD) + MB_OF_MEMORY=$(shell sysctl -n hw.physmem | awk '{print int($$NF / 1048576); }' ) + else + MB_OF_MEMORY=$(shell (sysctl -n hw.physmem64 2> /dev/null || sysctl -n hw.physmem) | awk '{print int($$NF / 1048576); }' ) + endif +endif + # Windows with and without CYGWIN will be slightly different ifeq ($(SYSTEM_UNAME), Windows_NT) PLATFORM = windows @@ -327,7 +420,7 @@ endif # Suffix for file bundles used in previous release BUNDLE_FILE_SUFFIX=.tar - # Minimum disk space needed as determined by running 'du -sk' on + # Minimum disk space needed as determined by running 'du -sk' on # a fully built workspace. REQUIRED_FREE_SPACE=500000 # How much RAM does this machine have: @@ -335,8 +428,8 @@ MB_OF_MEMORY := $(shell \ if [ -f "C:/cygwin/bin/free.exe" ] ; then \ ( C:/cygwin/bin/bash.exe -c "C:/cygwin/bin/free.exe -m" ) | \ - grep Mem: | \ - sed -e 's@\ \ *@ @g' | cut -d' ' -f2 ; \ + grep Mem: | \ + sed -e 's@\ \ *@ @g' | cut -d' ' -f2 ; \ else \ echo "512"; \ fi) @@ -392,7 +485,7 @@ # Where is unwanted output to be delivered? DEV_NULL = /dev/null export DEV_NULL - # Character used between entries in classpath + # Character used between entries in classpath CLASSPATH_SEPARATOR = : # User name determination (set _USER) ifndef USER diff -r 635ebbe236a9 -r f23f68d747bc make/jprt.properties --- a/make/jprt.properties Mon Jul 11 22:31:46 2011 +0100 +++ b/make/jprt.properties Tue May 29 00:27:14 2012 +0100 @@ -25,12 +25,23 @@ # Properties for jprt -# Use whatever release that the submitted job requests -jprt.tools.default.release=${jprt.submit.release} +# Locked down to jdk8 +jprt.tools.default.release=jdk8 # The different build flavors we want, we override here so we just get these 2 jprt.build.flavors=product,fastdebug +# 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}, \ + windows_i586_5.1-{product|fastdebug}, \ + windows_x64_5.2-{product|fastdebug} + # Directories to be excluded from the source bundles jprt.bundle.exclude.src.dirs=build dist webrev diff -r 635ebbe236a9 -r f23f68d747bc make/tools/src/build/tools/stripproperties/StripProperties.java --- a/make/tools/src/build/tools/stripproperties/StripProperties.java Mon Jul 11 22:31:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,280 +0,0 @@ -/* - * Copyright (c) 2001, 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 build.tools.stripproperties; - -import java.io.BufferedInputStream; -import java.io.BufferedWriter; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.List; -import java.util.Properties; - -/** - * Reads a properties file from standard input and writes an equivalent - * properties file without comments to standard output. - */ -public class StripProperties { - - private static void error(String msg, Exception e) { - System.err.println("ERROR: stripproperties: " + msg); - if ( e != null ) { - System.err.println("EXCEPTION: " + e.toString()); - e.printStackTrace(); - } - } - - private static List parseOptions(String args[]) { - List files = new ArrayList(); - for ( int i = 0; i < args.length ; i++ ) { - if ( "-optionsfile".equals(args[i]) && i+1 < args.length ) { - String filename = args[++i]; - FileInputStream finput = null; - byte contents[] = null; - try { - finput = new FileInputStream(filename); - int byteCount = finput.available(); - if ( byteCount <= 0 ) { - error("The -optionsfile file is empty", null); - files = null; - } else { - contents = new byte[byteCount]; - int bytesRead = finput.read(contents); - if ( byteCount != bytesRead ) { - error("Cannot read all of -optionsfile file", null); - files = null; - } - } - } catch ( IOException e ) { - error("cannot open " + filename, e); - files = null; - } - if ( finput != null ) { - try { - finput.close(); - } catch ( IOException e ) { - files = null; - error("cannot close " + filename, e); - } - } - if ( files != null && contents != null ) { - String tokens[] = (new String(contents)).split("\\s+"); - if ( tokens.length > 0 ) { - List ofiles = parseOptions(tokens); - if ( ofiles != null ) { - files.addAll(ofiles); - } else { - error("No files found in file", null); - files = null; - } - } - } - if ( files == null ) { - break; - } - } else { - files.add(args[i]); - } - } - return files; - } - - private static boolean stripFiles(List files) { - boolean ok = true; - for ( String file : files ) { - - Properties prop = new Properties(); - InputStream in = null; - try { - in = new BufferedInputStream(new FileInputStream(file)); - prop.load(in); - } catch ( FileNotFoundException e ) { - error("Cannot access file " + file, e); - ok = false; - } catch ( IOException e ) { - error("IO exception processing file " + file, e); - ok = false; - } - if ( in != null ) { - try { - in.close(); - } catch ( IOException e ) { - error("IO exception closing file " + file, e); - ok = false; - } - } - if ( !ok ) { - break; - } - - OutputStream out = null; - try { - out = new FileOutputStream(file); - storeProperties(prop, out); - out.flush(); - } catch ( IOException e ) { - error("IO exception processing file " + file, e); - ok = false; - } - if ( out != null ) { - try { - out.close(); - } catch ( IOException e ) { - error("IO exception closing file " + file, e); - ok = false; - } - } - if ( !ok ) { - break; - } - - } - return ok; - } - - /** - * Strip the properties filenames supplied, replacing their contents. - * @param args Names of properties files to process and replace contents - */ - public static void main(String args[]) { - List files = parseOptions(args); - if ( files == null || !stripFiles(files) ) { - System.exit(1); - } - } - - // --- code below here is adapted from java.util.Properties --- - - private static final String specialSaveChars = "=: \t\r\n\f#!"; - - /* - * Converts unicodes to encoded \uxxxx - * and writes out any of the characters in specialSaveChars - * with a preceding slash - */ - private static String saveConvert(String theString, boolean escapeSpace) { - int len = theString.length(); - StringBuffer outBuffer = new StringBuffer(len*2); - - for(int x=0; x 0x00ff)) { - outBuffer.append('\\'); - outBuffer.append('u'); - outBuffer.append(toHex((aChar >> 12) & 0xF)); - outBuffer.append(toHex((aChar >> 8) & 0xF)); - outBuffer.append(toHex((aChar >> 4) & 0xF)); - outBuffer.append(toHex( aChar & 0xF)); - } else { - if (specialSaveChars.indexOf(aChar) != -1) { - outBuffer.append('\\'); - } - outBuffer.append(aChar); - } - } - } - return outBuffer.toString(); - } - - /** - * Writes the content of properties to out. - * The format is that of Properties.store with the following modifications: - *
    - *
  • No header or date is written - *
  • Latin-1 characters are written as single bytes, not escape sequences - *
  • Line breaks are indicated by a single \n independent of platform - *
      - */ - private static void storeProperties(Properties properties, OutputStream out) - throws IOException { - BufferedWriter awriter; - awriter = new BufferedWriter(new OutputStreamWriter(out, "8859_1")); - for (Enumeration e = properties.keys(); e.hasMoreElements();) { - String key = (String)e.nextElement(); - String val = (String)properties.get(key); - key = saveConvert(key, true); - - /* No need to escape embedded and trailing spaces for value, hence - * pass false to flag. - */ - val = saveConvert(val, false); - writeln(awriter, key + "=" + val); - } - awriter.flush(); - } - - private static void writeln(BufferedWriter bw, String s) throws IOException { - bw.write(s); - bw.write("\n"); - } - - /** - * Convert a nibble to a hex character - * @param nibble the nibble to convert. - */ - private static char toHex(int nibble) { - return hexDigit[(nibble & 0xF)]; - } - - /** A table of hex digits */ - private static final char[] hexDigit = { - '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' - }; -} diff -r 635ebbe236a9 -r f23f68d747bc make/tools/src/build/tools/stripproperties/StripPropertiesCorba.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/tools/src/build/tools/stripproperties/StripPropertiesCorba.java Tue May 29 00:27:14 2012 +0100 @@ -0,0 +1,288 @@ +/* + * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package build.tools.stripproperties; + +import java.io.BufferedInputStream; +import java.io.BufferedWriter; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; + +/** + * Reads a properties file from standard input and writes an equivalent + * properties file without comments to standard output. + */ +public class StripPropertiesCorba { + + private static void error(String msg, Exception e) { + System.err.println("ERROR: stripproperties: " + msg); + if ( e != null ) { + System.err.println("EXCEPTION: " + e.toString()); + e.printStackTrace(); + } + } + + private static List infiles = new ArrayList(); + private static List outfiles = new ArrayList(); + + private static boolean parseOptions(String args[]) { + boolean ok = true; + + for ( int i = 0; i < args.length ; i++ ) { + if ( "-clean".equals(args[i]) && i+2 < args.length ) { + infiles.add(args[++i]); + outfiles.add(args[++i]); + } else if ( args[i].charAt(0)=='@') { + String filename = args[i].substring(1); + FileInputStream finput = null; + byte contents[] = null; + try { + finput = new FileInputStream(filename); + int byteCount = finput.available(); + if ( byteCount <= 0 ) { + error("The @file is empty", null); + ok = false; + } else { + contents = new byte[byteCount]; + int bytesRead = finput.read(contents); + if ( byteCount != bytesRead ) { + error("Cannot read all of @file", null); + ok = false; + } + } + } catch ( IOException e ) { + error("cannot open " + filename, e); + ok = false; + } + if ( finput != null ) { + try { + finput.close(); + } catch ( IOException e ) { + ok = false; + error("cannot close " + filename, e); + } + } + if ( ok && contents != null ) { + String tokens[] = (new String(contents)).split("\\s+"); + if ( tokens.length > 0 ) { + ok = parseOptions(tokens); + } + } + if ( !ok ) { + break; + } + } else { + infiles.add(args[i]); + outfiles.add(args[i]); + } + } + return ok; + } + + private static boolean stripFiles(List infiles, List outfiles) { + boolean ok = true; + Iterator inIter = infiles.iterator(); + Iterator outIter = outfiles.iterator(); + + for (; inIter.hasNext(); ) { + String infile = inIter.next(); + String outfile = outIter.next(); + + Properties prop = new Properties(); + InputStream in = null; + try { + in = new BufferedInputStream(new FileInputStream(infile)); + prop.load(in); + } catch ( FileNotFoundException e ) { + error("Cannot access file " + infile, e); + ok = false; + } catch ( IOException e ) { + error("IO exception processing file " + infile, e); + ok = false; + } + if ( in != null ) { + try { + in.close(); + } catch ( IOException e ) { + error("IO exception closing file " + infile, e); + ok = false; + } + } + if ( !ok ) { + break; + } + + OutputStream out = null; + try { + out = new FileOutputStream(outfile); + storeProperties(prop, out); + out.flush(); + } catch ( IOException e ) { + error("IO exception processing file " + outfile, e); + ok = false; + } + if ( out != null ) { + try { + out.close(); + } catch ( IOException e ) { + error("IO exception closing file " + outfile, e); + ok = false; + } + } + if ( !ok ) { + break; + } + + } + return ok; + } + + /** + * Strip the properties filenames supplied, replacing their contents. + * @param args Names of properties files to process and replace contents + */ + public static void main(String args[]) { + boolean ok = parseOptions(args); + if ( !ok || !stripFiles(infiles, outfiles) ) { + System.exit(1); + } + } + + // --- code below here is adapted from java.util.Properties --- + + private static final String specialSaveChars = "=: \t\r\n\f#!"; + + /* + * Converts unicodes to encoded \uxxxx + * and writes out any of the characters in specialSaveChars + * with a preceding slash + */ + private static String saveConvert(String theString, boolean escapeSpace) { + int len = theString.length(); + StringBuffer outBuffer = new StringBuffer(len*2); + + for(int x=0; x 0x00ff)) { + outBuffer.append('\\'); + outBuffer.append('u'); + outBuffer.append(toHex((aChar >> 12) & 0xF)); + outBuffer.append(toHex((aChar >> 8) & 0xF)); + outBuffer.append(toHex((aChar >> 4) & 0xF)); + outBuffer.append(toHex( aChar & 0xF)); + } else { + if (specialSaveChars.indexOf(aChar) != -1) { + outBuffer.append('\\'); + } + outBuffer.append(aChar); + } + } + } + return outBuffer.toString(); + } + + /** + * Writes the content of properties to out. + * The format is that of Properties.store with the following modifications: + *
        + *
      • No header or date is written + *
      • Latin-1 characters are written as single bytes, not escape sequences + *
      • Line breaks are indicated by a single \n independent of platform + *
          + */ + private static void storeProperties(Properties properties, OutputStream out) + throws IOException { + BufferedWriter awriter; + awriter = new BufferedWriter(new OutputStreamWriter(out, "8859_1")); + for (Enumeration e = properties.keys(); e.hasMoreElements();) { + String key = (String)e.nextElement(); + String val = (String)properties.get(key); + key = saveConvert(key, true); + + /* No need to escape embedded and trailing spaces for value, hence + * pass false to flag. + */ + val = saveConvert(val, false); + writeln(awriter, key + "=" + val); + } + awriter.flush(); + } + + private static void writeln(BufferedWriter bw, String s) throws IOException { + bw.write(s); + bw.write("\n"); + } + + /** + * Convert a nibble to a hex character + * @param nibble the nibble to convert. + */ + private static char toHex(int nibble) { + return hexDigit[(nibble & 0xF)]; + } + + /** A table of hex digits */ + private static final char[] hexDigit = { + '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' + }; +} diff -r 635ebbe236a9 -r f23f68d747bc make/tools/strip_properties/Makefile --- a/make/tools/strip_properties/Makefile Mon Jul 11 22:31:46 2011 +0100 +++ b/make/tools/strip_properties/Makefile Tue May 29 00:27:14 2012 +0100 @@ -34,7 +34,7 @@ include $(BUILDDIR)/common/Defs.gmk BUILDTOOL_SOURCE_ROOT = $(BUILDDIR)/tools/src -BUILDTOOL_MAIN = $(PKGDIR)/StripProperties.java +BUILDTOOL_MAIN = $(PKGDIR)/StripPropertiesCorba.java # # Build tool jar rules. diff -r 635ebbe236a9 -r f23f68d747bc makefiles/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/makefiles/Makefile Tue May 29 00:27:14 2012 +0100 @@ -0,0 +1,257 @@ +# +# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. 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 corba workspace. +# + +include $(SPEC) +include MakeBase.gmk +include JavaCompilation.gmk +include IdlCompilation.gmk + +default: all + +JAVAC_JARS ?= "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar" \ + -jar $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar +# The Corba sources are old and generates a LOT of warnings. +# Disable these using Xlint, until someone cares to fix them. +DISABLE_CORBA_WARNINGS:=-Xlint:all,-deprecation,-unchecked,-serial,-fallthrough,-cast,-rawtypes,-static,-dep-ann + +# The "generate old bytecode" javac setup uses the new compiler to compile for the +# boot jdk to generate tools that need to be run with the boot jdk. +# Thus we force the target bytecode to the boot jdk bytecode. +$(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE,\ + JVM:=$(JAVA),\ + JAVAC:=$(JAVAC_JARS),\ + FLAGS:=$(BOOT_JDK_SOURCETARGET) -bootclasspath $(BOOT_RTJAR) $(DISABLE_CORBA_WARNINGS),\ + SERVER_DIR:=$(JAVAC_SERVERS),\ + SERVER_JVM:=$(SERVER_JAVA),\ + MODE:=$(JAVAC_USE_MODE),\ + USE_DEPS:=$(JAVAC_USE_DEPS))) + +# The "generate new bytecode" uses the new compiler to generate bytecode +# for the new jdk that is being built. The code compiled by this setup +# cannot necessarily be run with the boot jdk. +$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE,\ + JVM:=$(JAVA),\ + JAVAC:=$(JAVAC_JARS),\ + FLAGS:=-Xprefer:source -XDignore.symbol.file=true \ + -cp $(BOOT_JDK)/lib/tools.jar \ + $(DISABLE_CORBA_WARNINGS),\ + SERVER_DIR:=$(JAVAC_SERVERS),\ + SERVER_JVM:=$(SERVER_JAVA),\ + MODE:=$(JAVAC_USE_MODE),\ + USE_DEPS:=$(JAVAC_USE_DEPS))) + +$(eval $(call SetupJavaCompilation,BUILD_STRIPPROP,\ + SETUP:=GENERATE_OLDBYTECODE,\ + SRC:=$(CORBA_TOPDIR)/make/tools/src,\ + BIN:=$(CORBA_OUTPUTDIR)/btclasses/stripprop_classes)) + +$(eval $(call SetupArchive,ARCHIVE_STRIPPROP,$(BUILD_STRIPPROP),\ + SRCS:=$(CORBA_OUTPUTDIR)/btclasses/stripprop_classes,\ + JAR:=$(CORBA_OUTPUTDIR)/btjars/stripproperties.jar,\ + JARMAIN:=build.tools.stripproperties.StripPropertiesCorba)) + +$(eval $(call SetupJavaCompilation,BUILD_IDLJ,\ + SETUP:=GENERATE_OLDBYTECODE,\ + SRC:=$(CORBA_TOPDIR)/src/share/classes,\ + BIN:=$(CORBA_OUTPUTDIR)/btclasses/idlj_classes,\ + COPY:=.prp,\ + INCLUDES:=com/sun/tools/corba/se/idl,\ + EXCLUDE_FILES:=ResourceBundleUtil.java)) + +$(eval $(call SetupArchive,ARCHIVE_IDLJ,$(BUILD_IDLJ),\ + SRCS:=$(CORBA_OUTPUTDIR)/btclasses/idlj_classes,\ + SUFFIXES:=.class .prp,\ + JAR:=$(CORBA_OUTPUTDIR)/btjars/idlj.jar,\ + JARMAIN:=com.sun.tools.corba.se.idl.toJavaPortable.Compile)) + +$(eval $(call SetupJavaCompilation,BUILD_LOGUTIL,\ + SETUP:=GENERATE_OLDBYTECODE,\ + SRC:=$(CORBA_TOPDIR)/src/share/classes,\ + BIN:=$(CORBA_OUTPUTDIR)/btclasses/logutil_classes,\ + INCLUDES:=com/sun/tools/corba/se/logutil)) + +$(eval $(call SetupArchive,ARCHIVE_LOGUTIL,$(BUILD_LOGUTIL),\ + SRCS:=$(CORBA_OUTPUTDIR)/btclasses/logutil_classes,\ + JAR:=$(CORBA_OUTPUTDIR)/btjars/logutil.jar,\ + JARMAIN:=com.sun.tools.corba.se.logutil.MC)) + +# Generate LogWrapper classes +$(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/%SystemException.java : \ + $(CORBA_TOPDIR)/src/share/classes/com/sun/corba/se/spi/logging/data/%.mc \ + $(CORBA_OUTPUTDIR)/btjars/logutil.jar + mkdir -p $(@D) + rm -f $(@D)/_the_wrappers.d + echo Generating class file from $*.mc + $(JAVA) -jar $(CORBA_OUTPUTDIR)/btjars/logutil.jar make-class $< $(@D) + +# Generate LogWrapper properties file by concatening resource files +$(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/LogStrings.properties: \ + $(CORBA_OUTPUTDIR)/logwrappers/ActivationSystemException.resource \ + $(CORBA_OUTPUTDIR)/logwrappers/IORSystemException.resource \ + $(CORBA_OUTPUTDIR)/logwrappers/InterceptorsSystemException.resource \ + $(CORBA_OUTPUTDIR)/logwrappers/NamingSystemException.resource \ + $(CORBA_OUTPUTDIR)/logwrappers/OMGSystemException.resource \ + $(CORBA_OUTPUTDIR)/logwrappers/ORBUtilSystemException.resource \ + $(CORBA_OUTPUTDIR)/logwrappers/POASystemException.resource \ + $(CORBA_OUTPUTDIR)/logwrappers/UtilSystemException.resource + mkdir -p $(@D) + echo Concatenating 8 resource files into $(@F) + $(CAT) $^ > $@ + +# The resources files are generated from lisp-like .mc files. +$(CORBA_OUTPUTDIR)/logwrappers/%SystemException.resource : $(CORBA_TOPDIR)/src/share/classes/com/sun/corba/se/spi/logging/data/%.mc $(CORBA_OUTPUTDIR)/btjars/logutil.jar + mkdir -p $(@D) + rm -f $(@D)/_the_wrappers.d + echo Generating resource file from $*.mc + $(JAVA) -jar $(CORBA_OUTPUTDIR)/btjars/logutil.jar make-resource $< $(@D) + + +$(CORBA_OUTPUTDIR)/logwrappers/_the_wrappers.d : $(CORBA_OUTPUTDIR)/btjars/logutil.jar \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/ActivationSystemException.java \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/IORSystemException.java \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/InterceptorsSystemException.java \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/NamingSystemException.java \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/OMGSystemException.java \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/ORBUtilSystemException.java \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/POASystemException.java \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/UtilSystemException.java \ + $(CORBA_OUTPUTDIR)/logwrappers/com/sun/corba/se/impl/logging/LogStrings.properties + mkdir -p $(@D) + echo LOGWRAPPERS_ARE_CREATED=yes > $@ + +# Trigger the generation of the logwrappers. After the logwrapper classes and +# resources have been created, then the makefile will restart and the newly +# created java files will become part of the build further along in the makefile. +-include $(CORBA_OUTPUTDIR)/logwrappers/_the_wrappers.d + +ifeq ($(LOGWRAPPERS_ARE_CREATED),yes) + $(eval $(call SetupIdlCompilation,BUILD_IDLS,\ + IDLJ:=$(JAVA) -jar $(CORBA_OUTPUTDIR)/btjars/idlj.jar,\ + SRC:=$(CORBA_TOPDIR)/src/share/classes,\ + BIN:=$(CORBA_OUTPUTDIR)/gensrc,\ + EXCLUDES:=com/sun/tools/corba/se/idl/% \ + org/omg/CORBA/% \ + com/sun/corba/se/GiopIDL/% \ + org/omg/PortableServer/corba.idl,\ + INCLUDES:=%,\ + OLDIMPLBASES:=com/sun/corba/se/PortableActivationIDL/activation.idl \ + com/sun/corba/se/spi/activation/activation.idl,\ + DELETES:=DYNANYDELETEFILES org/omg/DynamicAny/*POA* org/omg/DynamicAny/*Holder* org/omg/DynamicAny/DynValueBoxHelper.java org/omg/DynamicAny/DynValueCommonHelper.java org/omg/DynamicAny/_DynValueCommonStub.java org/omg/DynamicAny/_DynValueBoxStub.java org/omg/DynamicAny/DynAnyPackage/TypeMismatchHolder.java org/omg/DynamicAny/DynAnyPackage/InvalidValueHolder.java org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHolder.java IOPDELETEFILES org/omg/IOP/BI_DIR_IIOP.java org/omg/IOP/ChainBypassCheck.java org/omg/IOP/ChainBypassInfo.java org/omg/IOP/FORWARDED_IDENTITY.java org/omg/IOP/INVOCATION_POLICIES.java org/omg/IOP/LogicalThreadId.java org/omg/IOP/SendingContextRunTime.java org/omg/IOP/UnknownExceptionInfo.java org/omg/IOP/TaggedComponentSeqHolder.java POAHELHOLFILES org/omg/PortableServer/CurrentPackage/NoContextHolder.java org/omg/PortableServer/ForwardRequestHolder.java org/omg/PortableServer/IdAssignmentPolicyValueHelper.java org/omg/PortableServer/IdAssignmentPolicyValueHolder.java org/omg/PortableServer/IdUniquenessPolicyValueHelper.java org/omg/PortableServer/IdUniquenessPolicyValueHolder.java org/omg/PortableServer/ImplicitActivationPolicyValueHelper.java org/omg/PortableServer/ImplicitActivationPolicyValueHolder.java org/omg/PortableServer/LifespanPolicyValueHelper.java org/omg/PortableServer/LifespanPolicyValueHolder.java org/omg/PortableServer/ServantRetentionPolicyValueHelper.java org/omg/PortableServer/ServantRetentionPolicyValueHolder.java org/omg/PortableServer/ObjectIdHelper.java org/omg/PortableServer/ObjectIdHolder.java org/omg/PortableServer/POAListHelper.java org/omg/PortableServer/POAListHolder.java org/omg/PortableServer/POAManagerPackage/AdapterInactiveHolder.java org/omg/PortableServer/POAManagerPackage/StateHelper.java org/omg/PortableServer/POAManagerPackage/StateHolder.java org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHolder.java org/omg/PortableServer/POAPackage/AdapterNonExistentHolder.java org/omg/PortableServer/POAPackage/InvalidPolicyHolder.java org/omg/PortableServer/POAPackage/NoServantHolder.java org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHolder.java org/omg/PortableServer/POAPackage/ObjectNotActiveHolder.java org/omg/PortableServer/POAPackage/ServantAlreadyActiveHolder.java org/omg/PortableServer/POAPackage/ServantNotActiveHolder.java org/omg/PortableServer/POAPackage/WrongAdapterHolder.java org/omg/PortableServer/POAPackage/WrongPolicyHolder.java org/omg/PortableServer/RequestProcessingPolicyValueHelper.java org/omg/PortableServer/RequestProcessingPolicyValueHolder.java org/omg/PortableServer/ServantActivatorHolder.java org/omg/PortableServer/ServantLocatorHolder.java org/omg/PortableServer/ThreadPolicyValueHelper.java org/omg/PortableServer/ThreadPolicyValueHolder.java PIHELHOLFILES org/omg/PortableInterceptor/ClientRequestInfoHelper.java org/omg/PortableInterceptor/ClientRequestInterceptorHelper.java org/omg/PortableInterceptor/IORInfoHelper.java org/omg/PortableInterceptor/IORInterceptorHelper.java org/omg/PortableInterceptor/InterceptorHelper.java org/omg/PortableInterceptor/ORBInitInfoHelper.java org/omg/PortableInterceptor/ORBInitializerHelper.java org/omg/PortableInterceptor/PolicyFactoryHelper.java org/omg/PortableInterceptor/ReplyStatusHelper.java org/omg/PortableInterceptor/RequestInfoHelper.java org/omg/PortableInterceptor/ServerRequestInfoHelper.java org/omg/PortableInterceptor/ServerRequestInterceptorHelper.java org/omg/PortableInterceptor/SlotIdHelper.java org/omg/PortableInterceptor/ClientRequestInfoHolder.java org/omg/PortableInterceptor/ClientRequestInterceptorHolder.java org/omg/PortableInterceptor/CurrentHolder.java org/omg/PortableInterceptor/ForwardRequestHolder.java org/omg/PortableInterceptor/IORInfoHolder.java org/omg/PortableInterceptor/IORInterceptorHolder.java org/omg/PortableInterceptor/InterceptorHolder.java org/omg/PortableInterceptor/InvalidSlotHolder.java org/omg/PortableInterceptor/ORBInitInfoHolder.java org/omg/PortableInterceptor/ORBInitializerHolder.java org/omg/PortableInterceptor/PolicyFactoryHolder.java org/omg/PortableInterceptor/RequestInfoHolder.java org/omg/PortableInterceptor/ServerRequestInfoHolder.java org/omg/PortableInterceptor/ServerRequestInterceptorHolder.java org/omg/PortableInterceptor/TaggedComponentSeqHolder.java org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHolder.java org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHolder.java org/omg/IOP/CodecPackage/FormatMismatchHolder.java org/omg/IOP/CodecPackage/InvalidTypeForEncodingHolder.java org/omg/IOP/CodecPackage/TypeMismatchHolder.java org/omg/IOP/CodecHelper.java org/omg/IOP/EncodingFormatHelper.java org/omg/IOP/EncodingHelper.java org/omg/IOP/CodecFactoryPackage/UnknownEncodingHolder.java org/omg/IOP/CodecFactoryHolder.java org/omg/IOP/CodecHolder.java org/omg/IOP/EncodingHolder.java org/omg/IOP/TaggedComponentSeqHelper.java org/omg/Dynamic/ContextListHelper.java org/omg/Dynamic/ExceptionListHelper.java org/omg/Dynamic/ParameterHolder.java org/omg/Dynamic/ParameterListHolder.java org/omg/Dynamic/ExceptionListHolder.java org/omg/Dynamic/ParameterHelper.java org/omg/Dynamic/ParameterListHelper.java org/omg/Dynamic/RequestContextHelper.java CORBAX org/omg/CORBA/OctetSeqHelper.java org/omg/CORBA/OctetSeqHolder.java org/omg/CORBA/PolicyError.java org/omg/CORBA/RepositoryIdHelper.java)) + + $(BUILD_IDLS) : $(CORBA_OUTPUTDIR)/btjars/idlj.jar + + $(CORBA_OUTPUTDIR)/gensrc/_the_idls.d : $(BUILD_IDLS) $(CORBA_OUTPUTDIR)/btjars/idlj.jar + mkdir -p $(@D) + echo IDLS_ARE_CREATED=yes > $@ + + -include $(CORBA_OUTPUTDIR)/gensrc/_the_idls.d + + ifeq ($(IDLS_ARE_CREATED),yes) + $(eval $(call SetupJavaCompilation,BUILD_CORBA,\ + SETUP:=GENERATE_NEWBYTECODE,\ + SRC:=$(CORBA_TOPDIR)/src/share/classes $(CORBA_OUTPUTDIR)/gensrc $(CORBA_OUTPUTDIR)/logwrappers,\ + EXCLUDES:=com/sun/corba/se/PortableActivationIDL\ + com/sun/tools/corba/se/logutil,\ + EXCLUDE_FILES:=com/sun/corba/se/impl/presentation/rmi/JNDIStateFactoryImpl.java \ + com/sun/corba/se/spi/presentation/rmi/StubWrapper.java \ + com/sun/org/omg/CORBA/IDLTypeOperations.java \ + com/sun/org/omg/CORBA/IRObjectOperations.java \ + org/omg/PortableInterceptor/UNKNOWN.java \ + com/sun/tools/corba/se/idl/ResourceBundleUtil.java\ + com/sun/corba/se/impl/presentation/rmi/jndi.properties,\ + COPY:=.prp LogStrings.properties,\ + BIN:=$(CORBA_OUTPUTDIR)/classes)) + + # Separate src.zip call to include sources that were excluded in the build to + # mimic behavior in old build system. + $(eval $(call SetupZipArchive,ARCHIVE_BUILD_CORBA,\ + SRC:=$(CORBA_TOPDIR)/src/share/classes $(CORBA_OUTPUTDIR)/gensrc $(CORBA_OUTPUTDIR)/logwrappers,\ + ZIP:=$(CORBA_OUTPUTDIR)/dist/lib/src.zip)) + + $(BUILD_CORBA) : $(BUILD_IDLS) $(LOGWRAPPER_DEPENDENCIES) + + # Run stripproperties on all sunorb resource files. + STRIP_PROP_SRC_FILES:=$(shell $(FIND) $(CORBA_TOPDIR)/src/share/classes -name "sunorb*.properties") + STRIP_PROP_FILES:=$(patsubst $(CORBA_TOPDIR)/src/share/classes/%,$(CORBA_OUTPUTDIR)/classes/%,\ + $(STRIP_PROP_SRC_FILES)) + # Simple delivery of zh_HK properties files just copies zh_TW properties files + STRIP_PROP_FILES+=$(patsubst $(CORBA_TOPDIR)/src/share/classes/%_zh_TW.properties,\ + $(CORBA_OUTPUTDIR)/classes/%_zh_HK.properties,\ + $(shell $(FIND) $(CORBA_TOPDIR)/src/share/classes -name "sunorb_zh_TW.properties")) + STRIP_PROP_SRC_FILES+=$(shell $(FIND) $(CORBA_TOPDIR)/src/share/classes -name "sunorb_zh_TW.properties") + STRIP_PROP_CMDLINE:=$(subst _SPACE_,$(SPACE),\ + $(join $(addprefix -clean_SPACE_,$(STRIP_PROP_SRC_FILES)), \ + $(addprefix _SPACE_,$(STRIP_PROP_FILES)))) + + $(CORBA_OUTPUTDIR)/_the.stripped_properties: $(STRIP_PROP_SRC_FILES) \ + $(CORBA_OUTPUTDIR)/btjars/stripproperties.jar + $(MKDIR) -p $(sort $(dir $(STRIP_PROP_FILES))) + $(call ListPathsSafely,STRIP_PROP_CMDLINE,\n, >> $(CORBA_OUTPUTDIR)/_the.strip_prop.cmdline) + $(JAVA) -jar $(CORBA_OUTPUTDIR)/btjars/stripproperties.jar \ + @$(CORBA_OUTPUTDIR)/_the.strip_prop.cmdline + $(TOUCH) $@ + + $(eval $(call SetupArchive,ARCHIVE_CORBA,\ + $(BUILD_CORBA) $(CORBA_OUTPUTDIR)/_the.stripped_properties,\ + SRCS:=$(CORBA_OUTPUTDIR)/classes,\ + SUFFIXES:=.class .prp .properties,\ + JAR:=$(CORBA_OUTPUTDIR)/dist/lib/classes.jar)) + + # The created classes.jar now contains Corba compiled to run on the target JDK + # and is ready for inclusion in jdk rt.jar. + + # The created src.zip now contains .java and .properties files used to create the classes in classes.jar + # and is ready for inclusion into the jdk src.zip + + BIN_FILES:=$(CORBA_TOPDIR)/src/share/classes/org/omg/CORBA/orb.idl $(CORBA_TOPDIR)/src/share/classes/org/omg/CORBA/ir.idl + + $(CORBA_OUTPUTDIR)/dist/lib/bin.zip : $(BIN_FILES) $(CORBA_OUTPUTDIR)/dist/lib/classes.jar + mkdir -p $(CORBA_OUTPUTDIR)/dist/lib + mkdir -p $(CORBA_OUTPUTDIR)/lib + rm -f $@ + echo Creating `basename $@` + cp $(CORBA_TOPDIR)/src/share/classes/org/omg/CORBA/*.idl $(CORBA_OUTPUTDIR)/lib + chmod ug+w $(CORBA_OUTPUTDIR)/lib/* + (cd $(CORBA_OUTPUTDIR); $(ZIP) -q $@ lib/orb.idl lib/ir.idl) + + # The created bin.zip now contains the corba specific binaries: orb.idl, ir.idl + + all: $(CORBA_OUTPUTDIR)/btjars/stripproperties.jar \ + $(CORBA_OUTPUTDIR)/btjars/idlj.jar \ + $(CORBA_OUTPUTDIR)/btjars/logutil.jar \ + $(CORBA_OUTPUTDIR)/dist/lib/classes.jar \ + $(CORBA_OUTPUTDIR)/dist/lib/src.zip \ + $(CORBA_OUTPUTDIR)/dist/lib/bin.zip + endif +endif + +clean: + rm -rf $(CORBA_OUTPUTDIR) + +.PHONY: default all clean clobber diff -r 635ebbe236a9 -r f23f68d747bc src/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyFactoryImpl.java --- a/src/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyFactoryImpl.java Mon Jul 11 22:31:46 2011 +0100 +++ b/src/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyFactoryImpl.java Tue May 29 00:27:14 2012 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -82,6 +82,6 @@ private String[] __ids = { "IDL:omg.org/DynamicAny/DynAnyFactory:1.0" }; public String[] _ids() { - return __ids; + return (String[]) __ids.clone(); } } diff -r 635ebbe236a9 -r f23f68d747bc src/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyImpl.java --- a/src/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyImpl.java Mon Jul 11 22:31:46 2011 +0100 +++ b/src/share/classes/com/sun/corba/se/impl/dynamicany/DynAnyImpl.java Tue May 29 00:27:14 2012 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -195,6 +195,6 @@ private String[] __ids = { "IDL:omg.org/DynamicAny/DynAny:1.0" }; public String[] _ids() { - return __ids; + return (String[]) __ids.clone(); } } diff -r 635ebbe236a9 -r f23f68d747bc src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream.java --- a/src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream.java Mon Jul 11 22:31:46 2011 +0100 +++ b/src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream.java Tue May 29 00:27:14 2012 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -423,6 +423,13 @@ impl.setByteBufferWithInfo(bbwi); } + /** + * return true if our ByteBuffer is sharing/equal to bb + */ + protected final boolean isSharing(ByteBuffer bb) { + return (getByteBuffer() == bb); + } + public final int getBufferLength() { return impl.getBufferLength(); } diff -r 635ebbe236a9 -r f23f68d747bc src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java --- a/src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java Mon Jul 11 22:31:46 2011 +0100 +++ b/src/share/classes/com/sun/corba/se/impl/encoding/CDRInputStream_1_0.java Tue May 29 00:27:14 2012 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2412,7 +2412,6 @@ if (bbwi != null && getByteBuffer() != null) { - int bbHash = System.identityHashCode(bbwi.byteBuffer); MessageMediator messageMediator = parent.getMessageMediator(); if (messageMediator != null) { @@ -2420,19 +2419,12 @@ (CDROutputObject)messageMediator.getOutputObject(); if (outputObj != null) { - ByteBuffer outputBb = outputObj.getByteBuffer(); - - int oBbHash = 0; - if (outputBb != null) + if (outputObj.isSharing(getByteBuffer())) { - oBbHash = System.identityHashCode(outputBb); - if (bbHash == oBbHash) // shared? - { - // Set OutputStream's ByteBuffer and bbwi to null - // so its ByteBuffer cannot be released to the pool - outputObj.setByteBuffer(null); - outputObj.setByteBufferWithInfo(null); - } + // Set OutputStream's ByteBuffer and bbwi to null + // so its ByteBuffer cannot be released to the pool + outputObj.setByteBuffer(null); + outputObj.setByteBufferWithInfo(null); } } } diff -r 635ebbe236a9 -r f23f68d747bc src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream.java --- a/src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream.java Mon Jul 11 22:31:46 2011 +0100 +++ b/src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream.java Tue May 29 00:27:14 2012 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -357,6 +357,13 @@ impl.setByteBuffer(byteBuffer); } + /** + * return true if our ByteBuffer is sharing/equal to bb + */ + protected final boolean isSharing(ByteBuffer bb) { + return (getByteBuffer() == bb); + } + public final boolean isLittleEndian() { return impl.isLittleEndian(); } diff -r 635ebbe236a9 -r f23f68d747bc src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java --- a/src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java Mon Jul 11 22:31:46 2011 +0100 +++ b/src/share/classes/com/sun/corba/se/impl/encoding/CDROutputStream_1_0.java Tue May 29 00:27:14 2012 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1902,7 +1902,6 @@ if (getByteBufferWithInfo() != null && getByteBuffer() != null) { - int bbHash = System.identityHashCode(bbwi.byteBuffer); MessageMediator messageMediator = parent.getMessageMediator(); if (messageMediator != null) { @@ -1910,19 +1909,12 @@ (CDRInputObject)messageMediator.getInputObject(); if (inputObj != null) { - ByteBuffer inputBb = inputObj.getByteBuffer(); - - int iBbHash = 0; - if (inputBb != null) + if (inputObj.isSharing(getByteBuffer())) { - iBbHash = System.identityHashCode(inputBb); - if (bbHash == iBbHash) // shared? - { - // Set InputStream's ByteBuffer and bbwi to null - // so its ByteBuffer cannot be released to the pool - inputObj.setByteBuffer(null); - inputObj.setByteBufferWithInfo(null); - } + // Set InputStream's ByteBuffer and bbwi to null + // so its ByteBuffer cannot be released to the pool + inputObj.setByteBuffer(null); + inputObj.setByteBufferWithInfo(null); } } } diff -r 635ebbe236a9 -r f23f68d747bc src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java --- a/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java Mon Jul 11 22:31:46 2011 +0100 +++ b/src/share/classes/com/sun/corba/se/impl/io/IIOPInputStream.java Tue May 29 00:27:14 2012 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2243,6 +2243,10 @@ } try { + Class fieldCl = fields[i].getClazz(); + if (objectValue != null && !fieldCl.isInstance(objectValue)) { + throw new IllegalArgumentException(); + } bridge.putObject( o, fields[i].getFieldID(), objectValue ) ; // reflective code: fields[i].getField().set( o, objectValue ) ; } catch (IllegalArgumentException e) { @@ -2553,6 +2557,10 @@ { try { Field fld = c.getDeclaredField( fieldName ) ; + Class fieldCl = fld.getType(); + if(v != null && !fieldCl.isInstance(v)) { + throw new Exception(); + } long key = bridge.objectFieldOffset( fld ) ; bridge.putObject( o, key, v ) ; } catch (Exception e) { diff -r 635ebbe236a9 -r f23f68d747bc src/share/classes/com/sun/corba/se/impl/orbutil/DefineWrapper.sjava --- a/src/share/classes/com/sun/corba/se/impl/orbutil/DefineWrapper.sjava Mon Jul 11 22:31:46 2011 +0100 +++ b/src/share/classes/com/sun/corba/se/impl/orbutil/DefineWrapper.sjava Tue May 29 00:27:14 2012 +0100 @@ -1,3 +1,28 @@ +/* + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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 com.sun.corba.se.impl.orbutil ; import java.lang.reflect.Method; diff -r 635ebbe236a9 -r f23f68d747bc src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypesUtil_save.sjava --- a/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypesUtil_save.sjava Mon Jul 11 22:31:46 2011 +0100 +++ b/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypesUtil_save.sjava Tue May 29 00:27:14 2012 +0100 @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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 com.sun.corba.se.impl.presentation.rmi ; diff -r 635ebbe236a9 -r f23f68d747bc src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java --- a/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java Mon Jul 11 22:31:46 2011 +0100 +++ b/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java Tue May 29 00:27:14 2012 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -113,6 +113,9 @@ import com.sun.corba.se.impl.transport.CorbaContactInfoListIteratorImpl; import com.sun.corba.se.impl.util.JDKBridge; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ConcurrentHashMap; + /** * ClientDelegate is the RMI client-side subcontract or representation * It implements RMI delegate as well as our internal ClientRequestDispatcher @@ -122,6 +125,9 @@ implements ClientRequestDispatcher { + private ConcurrentMap locks = + new ConcurrentHashMap(); + public OutputObject beginRequest(Object self, String opName, boolean isOneWay, ContactInfo contactInfo) { @@ -148,8 +154,21 @@ // This locking is done so that multiple connections are not created // for the same endpoint - //6929137 - Synchronized on contactInfo to avoid blocking across multiple endpoints - synchronized (contactInfo) { + // 7046238 - Synchronization on a single monitor for contactInfo parameters + // with identical hashCode(), so we lock on same monitor for equal parameters + // (which can refer to equal (in terms of equals()) but not the same objects) + + Object lock = locks.get(contactInfo); + + if (lock == null) { + Object newLock = new Object(); + lock = locks.putIfAbsent(contactInfo, newLock); + if (lock == null) { + lock = newLock; + } + } + + synchronized (lock) { if (contactInfo.isConnectionBased()) { if (contactInfo.shouldCacheConnection()) { connection = (CorbaConnection) @@ -254,7 +273,7 @@ registerWaiter(messageMediator); // Do connection reclaim now - synchronized (contactInfo) { + synchronized (lock) { if (contactInfo.isConnectionBased()) { if (contactInfo.shouldCacheConnection()) { OutboundConnectionCache connectionCache = diff -r 635ebbe236a9 -r f23f68d747bc src/share/classes/com/sun/org/omg/SendingContext/_CodeBaseImplBase.java --- a/src/share/classes/com/sun/org/omg/SendingContext/_CodeBaseImplBase.java Mon Jul 11 22:31:46 2011 +0100 +++ b/src/share/classes/com/sun/org/omg/SendingContext/_CodeBaseImplBase.java Tue May 29 00:27:14 2012 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -138,7 +138,7 @@ public String[] _ids () { - return __ids; + return (String[]) __ids.clone(); }