changeset 454:687b1a67541e

Merge
author mchung
date Mon, 12 Nov 2012 18:44:56 -0800
parents e5a6e9b33b1c (current diff) 54d599a5b4aa (diff)
children 3fc86e3ac96f
files .hgtags
diffstat 16 files changed, 467 insertions(+), 322 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Jul 24 16:17:44 2012 +0100
+++ b/.hgtags	Mon Nov 12 18:44:56 2012 -0800
@@ -176,3 +176,18 @@
 30141e598d72a6146126cb86b034ed6d0bd191b3 jdk8-b46
 21e46ea21c6a26246fb7a1926ac7fe8d580d0518 jdk8-b47
 7e2b179a5b4dbd3f097e28daa00abfcc72ba3e0b jdk8-b48
+fe44e58a6bdbeae350ce96aafb49770a5dca5d8a jdk8-b49
+d20d9eb9f093adbf392918c703960ad24c93a331 jdk8-b50
+9b0f841ca9f7ee9bacf16a5ab41c4f829276bc6b jdk8-b51
+80689ff9cb499837513f18a1136dac7f0686cd55 jdk8-b52
+63aeb7a2472fb299134ad7388e0a111a5340b02d jdk8-b53
+16c82fc74695bab9b9e0fb05c086a5a08ba0082f jdk8-b54
+e8a0e84383d6fbd303ce44bd355fb25972b13286 jdk8-b55
+bf1bb47414e178beff67dc255fc3b97bf401f679 jdk8-b56
+f3ab4163ae012965fc8acdfc25ce0fece8d6906d jdk8-b57
+18462a19f7bd66d38015f61ea549a5e0c0c889a3 jdk8-b58
+d54dc53e223ed9ce7d5f4d2cd02ad9d5def3c2db jdk8-b59
+207ef43ba69ead6cbbab415d81834545e4d46747 jdk8-b60
+0e08ba7648fb3faa0986cb217887d7c4990977f3 jdk8-b61
+08afb9c6f44f11c3595b01fd0985db64b29834dd jdk8-b62
+6ccbf67b68bfed1ab9c44ab8748a5bdc7df33506 jdk8-b63
--- a/make/common/Defs-bsd.gmk	Tue Jul 24 16:17:44 2012 +0100
+++ b/make/common/Defs-bsd.gmk	Mon Nov 12 18:44:56 2012 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 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
--- a/make/common/internal/Resources.gmk	Tue Jul 24 16:17:44 2012 +0100
+++ b/make/common/internal/Resources.gmk	Mon Nov 12 18:44:56 2012 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2005, 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
--- a/make/common/shared/Defs-bsd.gmk	Tue Jul 24 16:17:44 2012 +0100
+++ b/make/common/shared/Defs-bsd.gmk	Mon Nov 12 18:44:56 2012 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 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
--- a/make/common/shared/Defs-utils.gmk	Tue Jul 24 16:17:44 2012 +0100
+++ b/make/common/shared/Defs-utils.gmk	Mon Nov 12 18:44:56 2012 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 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
@@ -151,16 +151,26 @@
 ifeq ($(PLATFORM),windows)
   ifdef USING_CYGWIN
     # Intrinsic unix command, with backslash-escaped character interpretation
-    ECHO = $(UNIXCOMMAND_PATH)echo -e
-    ZIPEXE = $(UNIXCOMMAND_PATH)zip
-    UNZIP  = $(UNIXCOMMAND_PATH)unzip
+    ECHO     = $(UNIXCOMMAND_PATH)echo -e
+    ZIPEXE   = $(UNIXCOMMAND_PATH)zip
+    UNZIP    = $(UNIXCOMMAND_PATH)unzip
+    # Some CYGWIN nawk versions require BINMODE=w for proper '\r' interpretation
+    NAWK     = $(UNIXCOMMAND_PATH)awk -v BINMODE=w
   else
-    ZIPEXE = $(UTILS_DEVTOOL_PATH)zip
-    UNZIP  = $(UTILS_DEVTOOL_PATH)unzip
+    ifdef USING_MSYS
+      ECHO   = $(UTILS_COMMAND_PATH)echo -e
+      ZIPEXE = $(UTILS_DEVTOOL_PATH)zip
+      UNZIP  = $(UTILS_DEVTOOL_PATH)unzip
+      NAWK   = $(UNIXCOMMAND_PATH)awk
+    else
+      ZIPEXE = $(UTILS_DEVTOOL_PATH)zip
+      UNZIP  = $(UTILS_DEVTOOL_PATH)unzip
+      NAWK   = $(UNIXCOMMAND_PATH)awk
+    endif
   endif
   # Re-define some utilities
   LEX            =# override GNU Make intrinsic: no lex on windows
-  NAWK           = $(UNIXCOMMAND_PATH)awk
+  SHA1SUM        = $(UNIXCOMMAND_PATH)openssl sha1
 endif
 
 # Linux specific
--- a/make/common/shared/Defs-windows.gmk	Tue Jul 24 16:17:44 2012 +0100
+++ b/make/common/shared/Defs-windows.gmk	Mon Nov 12 18:44:56 2012 -0800
@@ -91,6 +91,15 @@
 $(shell if [ "$1" != "" -a -d "$1" ]; then $(CYGPATH_CMD) "$1"; else echo "$1"; fi)
 endef
 else
+ifdef USING_MSYS
+DOSPATH_CMD:=$(shell cd $(JDK_TOPDIR) 2> $(DEV_NULL) && pwd)/make/tools/msys_build_scripts/dospath.sh
+define FullPath
+$(subst \,/,$(shell $(DOSPATH_CMD) $1))
+endef
+define OptFullPath
+$(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi)
+endef
+else
 # Temporary until we upgrade to MKS 8.7, MKS pwd returns mixed mode path
 define FullPath
 $(shell cd $1 2> $(DEV_NULL) && pwd)
@@ -99,6 +108,7 @@
 $(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi)
 endef
 endif
+endif
 
 # System drive
 ifdef SYSTEMDRIVE
@@ -112,14 +122,21 @@
 
 # UNIXCOMMAND_PATH: path to where the most common Unix commands are.
 #  NOTE: Must end with / so that it could be empty, allowing PATH usage.
-ifndef UNIXCOMMAND_PATH
-  ifdef ALT_UNIXCOMMAND_PATH
+#        With cygwin, use this as is; don't use FullPath on it.
+ifdef ALT_UNIXCOMMAND_PATH
+  ifdef USING_CYGWIN
+    UNIXCOMMAND_PATH       :=$(call PrefixPath,$(ALT_UNIXCOMMAND_PATH))
+  else
     xALT_UNIXCOMMAND_PATH  :="$(subst \,/,$(ALT_UNIXCOMMAND_PATH))"
     fxALT_UNIXCOMMAND_PATH :=$(call FullPath,$(xALT_UNIXCOMMAND_PATH))
     UNIXCOMMAND_PATH       :=$(call PrefixPath,$(fxALT_UNIXCOMMAND_PATH))
+  endif
+else
+  ifdef USING_CYGWIN
+    UNIXCOMMAND_PATH :=$(call PrefixPath,/usr/bin)
   else
-    ifdef USING_CYGWIN
-      UNIXCOMMAND_PATH :=$(call PrefixPath,/usr/bin)
+    ifdef USING_MSYS
+      UNIXCOMMAND_PATH :=$(call PrefixPath,/bin)
     else
       ifdef ROOTDIR
         xROOTDIR :="$(subst \,/,$(ROOTDIR))"
@@ -131,41 +148,35 @@
       ifneq ($(_rootdir),)
         UNIXCOMMAND_PATH :=$(call PrefixPath,$(_rootdir)/mksnt)
       endif
-    endif
-  endif
-  UNIXCOMMAND_PATH:=$(call AltCheckSpaces,UNIXCOMMAND_PATH)
-  export UNIXCOMMAND_PATH
+    endif # USING_MSYS
+  endif # USING_CYGWIN
 endif
+UNIXCOMMAND_PATH:=$(call AltCheckSpaces,UNIXCOMMAND_PATH)
+export UNIXCOMMAND_PATH
 
 # Get version of MKS or CYGWIN
-ifdef USING_CYGWIN
-  ifndef CYGWIN_VER
-    _CYGWIN_VER :=$(shell $(UNAME))
-    CYGWIN_VER  :=$(call GetVersion,$(_CYGWIN_VER))
-    export CYGWIN_VER
+ifdef USING_MKS
+  _MKS_VER :=$(shell $(MKSINFO) 2>&1 | $(GREP) Release | $(TAIL) -1 | $(SED) -e 's@.*\(Release.*\)@\1@')
+  MKS_VER  :=$(call GetVersion,$(_MKS_VER))
+  # At this point, we can re-define FullPath to use DOSNAME_CMD
+  CHECK_MKS87:=$(call CheckVersions,$(MKS_VER),8.7)
+  TRY_DOSNAME:=false
+  ifeq ($(CHECK_MKS87),same)
+    TRY_DOSNAME:=true
   endif
-else # MKS
-_MKS_VER :=$(shell $(MKSINFO) 2>&1 | $(GREP) Release | $(TAIL) -1 | $(SED) -e 's@.*\(Release.*\)@\1@')
-MKS_VER  :=$(call GetVersion,$(_MKS_VER))
-# At this point, we can re-define FullPath to use DOSNAME_CMD
-CHECK_MKS87:=$(call CheckVersions,$(MKS_VER),8.7)
-TRY_DOSNAME:=false
-ifeq ($(CHECK_MKS87),same)
-TRY_DOSNAME:=true
-endif
-# Newer should be ok
-ifeq ($(CHECK_MKS87),newer)
-TRY_DOSNAME:=true
-endif
-ifeq ($(TRY_DOSNAME),true)
-ifeq ($(shell $(UNIXCOMMAND_PATH)dosname -s $(_system_drive)/ 2> $(DEV_NULL)),$(_system_drive)/)
-_DOSNAME=$(UNIXCOMMAND_PATH)dosname
-DOSNAME_CMD:=$(_DOSNAME) -s
+  # Newer should be ok
+  ifeq ($(CHECK_MKS87),newer)
+    TRY_DOSNAME:=true
+  endif
+  ifeq ($(TRY_DOSNAME),true)
+    ifeq ($(shell $(UNIXCOMMAND_PATH)dosname -s $(_system_drive)/ 2> $(DEV_NULL)),$(_system_drive)/)
+      _DOSNAME=$(UNIXCOMMAND_PATH)dosname
+      DOSNAME_CMD:=$(_DOSNAME) -s
 define FullPath
 $(subst //,/,$(shell echo $1 | $(DOSNAME_CMD) 2> $(DEV_NULL)))
 endef
-endif # test dosname -s
-endif # TRY_DOSNAME
+    endif # test dosname -s
+  endif # TRY_DOSNAME
 endif # MKS
 
 # We try to get references to what we need via the default component
@@ -240,6 +251,8 @@
 # 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.
 ifndef DEVTOOLS_PATH
+  # 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.
   ifdef ALT_DEVTOOLS_PATH
     xALT_DEVTOOLS_PATH  :="$(subst \,/,$(ALT_DEVTOOLS_PATH))"
     fxALT_DEVTOOLS_PATH :=$(call FullPath,$(xALT_DEVTOOLS_PATH))
@@ -248,10 +261,14 @@
     ifdef USING_CYGWIN
       DEVTOOLS_PATH :=$(UNIXCOMMAND_PATH)
     else
-      xDEVTOOLS_PATH  :="$(_system_drive)/utils"
-      fxDEVTOOLS_PATH :=$(call FullPath,$(xDEVTOOLS_PATH))
-      DEVTOOLS_PATH  :=$(call PrefixPath,$(fxDEVTOOLS_PATH))
-    endif
+      ifdef USING_MSYS
+        DEVTOOLS_PATH :=$(UNIXCOMMAND_PATH)
+      else
+        xDEVTOOLS_PATH  :="$(_system_drive)/utils"
+        fxDEVTOOLS_PATH :=$(call FullPath,$(xDEVTOOLS_PATH))
+        DEVTOOLS_PATH  :=$(call PrefixPath,$(fxDEVTOOLS_PATH))
+      endif # USING_MSYS
+    endif # USING_CYGWIN
   endif
   DEVTOOLS_PATH:=$(call AltCheckSpaces,DEVTOOLS_PATH)
   export DEVTOOLS_PATH
--- a/make/common/shared/Platform.gmk	Tue Jul 24 16:17:44 2012 +0100
+++ b/make/common/shared/Platform.gmk	Mon Nov 12 18:44:56 2012 -0800
@@ -65,6 +65,8 @@
 #     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
+#     USING_MSYS                  windows only: true or false
+#     USING_MKS                   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
 #     REQUIRED_FREE_SPACE         minimum disk space needed for outputdir
@@ -327,6 +329,8 @@
 # Windows with and without CYGWIN will be slightly different
 ifeq ($(SYSTEM_UNAME), Windows_NT)
   PLATFORM = windows
+  USING_MKS = true
+  export USING_MKS
   OS_VERSION := $(shell uname -r)
   WINDOWS_NT_VERSION_STRING=Windows_NT
   REQUIRED_MKS_VER=6.1
@@ -339,6 +343,11 @@
   WINDOWS_NT_VERSION_STRING=CYGWIN_NT
   REQUIRED_CYGWIN_VER=4.0
 endif
+ifneq (,$(findstring MINGW,$(SYSTEM_UNAME)))
+  PLATFORM = windows
+  USING_MSYS = true
+  export USING_MSYS
+endif
 
 # Platform settings specific to Windows
 ifeq ($(PLATFORM), windows)
--- a/make/tools/src/build/tools/stripproperties/StripPropertiesCorba.java	Tue Jul 24 16:17:44 2012 +0100
+++ b/make/tools/src/build/tools/stripproperties/StripPropertiesCorba.java	Mon Nov 12 18:44:56 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
--- a/make/tools/strip_properties/Makefile	Tue Jul 24 16:17:44 2012 +0100
+++ b/make/tools/strip_properties/Makefile	Mon Nov 12 18:44:56 2012 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefiles/BuildCorba.gmk	Mon Nov 12 18:44:56 2012 -0800
@@ -0,0 +1,253 @@
+#
+# 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.
+#
+
+# This must be the first rule
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+include JavaCompilation.gmk
+include IdlCompilation.gmk
+
+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:=$(SJAVAC_SERVER_DIR),\
+     SERVER_JVM:=$(SJAVAC_SERVER_JAVA)))
+
+# 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:=-cp $(BOOT_TOOLSJAR) -XDignore.symbol.file=true $(DISABLE_CORBA_WARNINGS),\
+     SERVER_DIR:=$(SJAVAC_SERVER_DIR),\
+     SERVER_JVM:=$(SJAVAC_SERVER_JAVA)))
+
+$(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) $(LOG_INFO) 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) $(LOG_INFO) 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) $(LOG_INFO) 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/com/sun/tools/corba/se/idl/orb.idl \
+			   $(CORBA_TOPDIR)/src/share/classes/com/sun/tools/corba/se/idl/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) $(BIN_FILES) $(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 
--- a/makefiles/Makefile	Tue Jul 24 16:17:44 2012 +0100
+++ b/makefiles/Makefile	Mon Nov 12 18:44:56 2012 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 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
@@ -23,237 +23,27 @@
 # questions.
 #
 
-#
-# Makefile for building the corba workspace.
-#
-
-# This must be the first rule
-default: all
-
-include $(SPEC)
-include MakeBase.gmk
-include JavaCompilation.gmk
-include IdlCompilation.gmk
-
-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)
-
+# Locate this Makefile
+ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
+    makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST))
+else
+    makefile_path:=$(lastword $(MAKEFILE_LIST))
+endif
+repo_dir:=$(patsubst %/makefiles/Makefile,%,$(makefile_path))
 
-$(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))
+# What is the name of this subsystem (langtools, corba, etc)?
+subsystem_name:=$(notdir $(repo_dir))
 
-                # 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/com/sun/tools/corba/se/idl/orb.idl \
-			   $(CORBA_TOPDIR)/src/share/classes/com/sun/tools/corba/se/idl/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) $(BIN_FILES) $(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
+# Try to locate top-level makefile
+top_level_makefile:=$(repo_dir)/../common/makefiles/Makefile
+ifneq ($(wildcard $(top_level_makefile)),)
+  $(info Will run $(subsystem_name) target on top-level Makefile)
+  $(info WARNING: This is a non-recommended way of building!)
+  $(info ===================================================)
+else
+  $(info Cannot locate top-level Makefile. Is this repo not checked out as part of a complete forest?)
+  $(error Build from top-level Makefile instead)
 endif
 
-clean:
-	$(RM) -rf $(CORBA_OUTPUTDIR)
-
-.PHONY: default all clean clobber 
+all:
+	@$(MAKE) -f $(top_level_makefile) $(subsystem_name)
--- a/src/share/classes/com/sun/corba/se/impl/transport/CorbaResponseWaitingRoomImpl.java	Tue Jul 24 16:17:44 2012 +0100
+++ b/src/share/classes/com/sun/corba/se/impl/transport/CorbaResponseWaitingRoomImpl.java	Mon Nov 12 18:44:56 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -25,7 +25,10 @@
 
 package com.sun.corba.se.impl.transport;
 
-import java.util.Hashtable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
 
 import org.omg.CORBA.CompletionStatus;
 import org.omg.CORBA.SystemException;
@@ -68,7 +71,7 @@
 
     private CorbaConnection connection;
     // Maps requestId to an OutCallDesc.
-    private Hashtable out_calls = null; // REVISIT - use int hastable/map
+    final private Map<Integer, OutCallDesc> out_calls;
 
     public CorbaResponseWaitingRoomImpl(ORB orb, CorbaConnection connection)
     {
@@ -76,7 +79,8 @@
         wrapper = ORBUtilSystemException.get( orb,
             CORBALogDomains.RPC_TRANSPORT ) ;
         this.connection = connection;
-        out_calls = new Hashtable();
+        out_calls =
+            Collections.synchronizedMap(new HashMap<Integer, OutCallDesc>());
     }
 
     ////////////////////////////////////////////////////
@@ -139,7 +143,7 @@
             return null;
         }
 
-        OutCallDesc call = (OutCallDesc)out_calls.get(requestId);
+        OutCallDesc call = out_calls.get(requestId);
         if (call == null) {
             throw wrapper.nullOutCall(CompletionStatus.COMPLETED_MAYBE);
         }
@@ -197,7 +201,7 @@
         LocateReplyOrReplyMessage header = (LocateReplyOrReplyMessage)
             inputObject.getMessageHeader();
         Integer requestId = new Integer(header.getRequestId());
-        OutCallDesc call = (OutCallDesc) out_calls.get(requestId);
+        OutCallDesc call = out_calls.get(requestId);
 
         if (orb.transportDebugFlag) {
             dprint(".responseReceived: id/"
@@ -248,7 +252,6 @@
 
     public int numberRegistered()
     {
-        // Note: Hashtable.size() is not synchronized
         return out_calls.size();
     }
 
@@ -264,29 +267,41 @@
             dprint(".signalExceptionToAllWaiters: " + systemException);
         }
 
-        OutCallDesc call;
-        java.util.Enumeration e = out_calls.elements();
-        while(e.hasMoreElements()) {
-            call = (OutCallDesc) e.nextElement();
+        synchronized (out_calls) {
+            if (orb.transportDebugFlag) {
+                dprint(".signalExceptionToAllWaiters: out_calls size :" +
+                       out_calls.size());
+            }
 
-            synchronized(call.done){
-                // anything waiting for BufferManagerRead's fragment queue
-                // needs to be cancelled
-                CorbaMessageMediator corbaMsgMediator =
-                             (CorbaMessageMediator)call.messageMediator;
-                CDRInputObject inputObject =
-                           (CDRInputObject)corbaMsgMediator.getInputObject();
-                // IMPORTANT: If inputObject is null, then no need to tell
-                //            BufferManagerRead to cancel request processing.
-                if (inputObject != null) {
-                    BufferManagerReadStream bufferManager =
-                        (BufferManagerReadStream)inputObject.getBufferManager();
-                    int requestId = corbaMsgMediator.getRequestId();
-                    bufferManager.cancelProcessing(requestId);
+            for (OutCallDesc call : out_calls.values()) {
+                if (orb.transportDebugFlag) {
+                    dprint(".signalExceptionToAllWaiters: signaling " +
+                            call);
                 }
-                call.inputObject = null;
-                call.exception = systemException;
-                call.done.notify();
+                synchronized(call.done) {
+                    try {
+                        // anything waiting for BufferManagerRead's fragment queue
+                        // needs to be cancelled
+                        CorbaMessageMediator corbaMsgMediator =
+                                     (CorbaMessageMediator)call.messageMediator;
+                        CDRInputObject inputObject =
+                                   (CDRInputObject)corbaMsgMediator.getInputObject();
+                        // IMPORTANT: If inputObject is null, then no need to tell
+                        //            BufferManagerRead to cancel request processing.
+                        if (inputObject != null) {
+                            BufferManagerReadStream bufferManager =
+                                (BufferManagerReadStream)inputObject.getBufferManager();
+                            int requestId = corbaMsgMediator.getRequestId();
+                            bufferManager.cancelProcessing(requestId);
+                        }
+                    } catch (Exception e) {
+                    } finally {
+                        // attempt to wake up waiting threads in all cases
+                        call.inputObject = null;
+                        call.exception = systemException;
+                        call.done.notifyAll();
+                    }
+                }
             }
         }
     }
@@ -294,7 +309,7 @@
     public MessageMediator getMessageMediator(int requestId)
     {
         Integer id = new Integer(requestId);
-        OutCallDesc call = (OutCallDesc) out_calls.get(id);
+        OutCallDesc call = out_calls.get(id);
         if (call == null) {
             // This can happen when getting early reply fragments for a
             // request which has completed (e.g., client marshaling error).
--- a/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java	Tue Jul 24 16:17:44 2012 +0100
+++ b/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java	Mon Nov 12 18:44:56 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -1521,7 +1521,7 @@
             // connection and give them the SystemException;
 
             responseWaitingRoom.signalExceptionToAllWaiters(systemException);
-
+        } finally {
             if (contactInfo != null) {
                 ((OutboundConnectionCache)getConnectionCache()).remove(contactInfo);
             } else if (acceptor != null) {
@@ -1542,7 +1542,6 @@
 
             writeUnlock();
 
-        } finally {
             if (orb.transportDebugFlag) {
                 dprint(".purgeCalls<-: "
                        + minor_code + "/" + die + "/" + lockHeld
--- a/src/share/classes/com/sun/corba/se/impl/util/IdentityHashtable.java	Tue Jul 24 16:17:44 2012 +0100
+++ b/src/share/classes/com/sun/corba/se/impl/util/IdentityHashtable.java	Mon Nov 12 18:44:56 2012 -0800
@@ -42,16 +42,6 @@
  * instead, it uses the System.identityHashcode() method and pointer comparison.
  * In addition, all synchronization has been removed.
  */
-/**
- * IdentityHashtable collision list.
- */
-class IdentityHashtableEntry {
-        int hash;
-        Object key;
-        Object value;
-        IdentityHashtableEntry next;
-}
-
 public final class IdentityHashtable extends Dictionary {
     /**
      * The hash table data.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/corba/se/impl/util/IdentityHashtableEntry.java	Mon Nov 12 18:44:56 2012 -0800
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  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.
+ */
+
+/*
+ * Licensed Materials - Property of IBM
+ * RMI-IIOP v1.0
+ * Copyright IBM Corp. 1998 1999  All Rights Reserved
+ *
+ */
+
+package com.sun.corba.se.impl.util;
+
+/**
+ * IdentityHashtable collision list.
+ */
+class IdentityHashtableEntry {
+    int hash;
+    Object key;
+    Object value;
+    IdentityHashtableEntry next;
+}
--- a/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java	Tue Jul 24 16:17:44 2012 +0100
+++ b/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java	Mon Nov 12 18:44:56 2012 -0800
@@ -1631,7 +1631,7 @@
 
         // Write data members...
         p.pln();
-        p.pln("private " + getName(theType) + " target = null;");
+        p.pln("volatile private " + getName(theType) + " target = null;");
         p.pln();
 
         // Write the ids...
@@ -1695,6 +1695,10 @@
 
         if (remoteMethods.length > 0) {
             p.plnI("try {");
+            p.pln(getName(theType) + " target = this.target;");
+            p.plnI("if (target == null) {");
+            p.pln("throw new java.io.IOException();");
+            p.pOln("}");
             p.plnI(idExtInputStream + " "+in+" = ");
             p.pln("(" + idExtInputStream + ") "+_in+";");
             p.pO();