changeset 11064:940d3fd7709b

Merge
author asaha
date Thu, 04 Jun 2015 15:21:53 -0700
parents 5f5d2ee0a189 ba679572195c
children f55bca9b91b1
files .hgtags src/share/lib/security/java.security-aix src/share/lib/security/java.security-linux src/share/lib/security/java.security-macosx src/share/lib/security/java.security-solaris src/share/lib/security/java.security-windows src/solaris/bin/arm/jvm.cfg src/solaris/bin/ppc/jvm.cfg test/com/sun/management/OperatingSystemMXBean/GetTotalSwapSpaceSize.java test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh test/sun/security/krb5/auto/SSL.java
diffstat 570 files changed, 54538 insertions(+), 4717 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Sat May 23 02:49:50 2015 +0300
+++ b/.hgtags	Thu Jun 04 15:21:53 2015 -0700
@@ -420,4 +420,27 @@
 7e8459e7a45cb5b49de376893e3a95bfa92d0325 jdk8u51-b09
 dcc75a75d3a30270fbf52d0d0b0504319882e419 jdk8u51-b10
 3ed614d4eee7c3225d48ed7c90622dd888cd143e jdk8u51-b11
+0010682d9a2b81daf7c08239161f7c2a91977299 jdk8u51-b12
+217fa7205549d196c60f814bf3fc9795d756f493 jdk8u51-b13
+b7403e15864dc0c1f9740d66af91bddb3e2215e8 jdk8u51-b14
+192bda44c0c463104c96058bb815a546b282ca43 jdk8u51-b15
+5c31204d19e5976f025026db3d5c17331e8c44db jdk8u60-b00
+c46daef6edb5385d11876ed40f292a4b62e96867 jdk8u60-b01
+c10fd784956cc7099657181029ac3e790267b678 jdk8u60-b02
+87c95759b92b9c2933e439f0f7e4897635af16e0 jdk8u60-b03
+81e87652146b74c4ffeb1862e3e0eb3ace2374e4 jdk8u60-b04
+433942aab113e7eeecbe086b346219536738b0b6 jdk8u60-b05
+3a8ecea921f65bc1aef108b657c718348e152b9a jdk8u60-b06
+e48ca20d8943854c878e3b8d86d6d5387b047996 jdk8u60-b07
+478602cc17e212571cd0bec8979d5adc6d5c456e jdk8u60-b08
+fc3f69854e7d28416168eee07859c06fe90fa6f5 jdk8u60-b09
+ae448eca6b545670656c505bdc830b6dabaf1be3 jdk8u60-b10
+bdcb84f205482c7aea48a1403e843f5fd689d849 jdk8u60-b11
+87d4b7551d321c473d97afd75c1b71f6cedda4e2 jdk8u60-b12
+4e2206aa336c312ee180421387b7a6e7cdd0a3ca jdk8u60-b13
+3ad03712ea43feb5d4cd8cb216e6d295d09b8457 jdk8u60-b14
+a006fa0a9e8f18dee6daf8984bd11625c4c4860c jdk8u60-b15
+6ed3821c212a93ffc6bfcc292ef7aca3b7165139 jdk8u60-b16
+c30db4c968f63dce1bf2f9df240fb75a8f27f922 jdk8u60-b17
+57336c319de8a141d0bcd04265ce36734fb51380 jdk8u60-b18
 286b9a885fcc6245fdf2b20697473ec3b35f2538 jdk8u65-b00
--- a/make/CompileJavaClasses.gmk	Sat May 23 02:49:50 2015 +0300
+++ b/make/CompileJavaClasses.gmk	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, 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
@@ -64,17 +64,15 @@
     # This gets built on unix platforms implicitly in the old build even though
     # it's excluded in the closed build.
     EXCLUDES += sun/java2d/pisces
+  endif
+endif
 
+ifeq ($(OPENJDK_TARGET_OS), windows)
     # AccessBridge is compiled separately below.
     EXFILES += AccessBridge.java \
-        AccessBridgeLoader.java \
-        com/sun/java/accessibility/util/java/awt/ChoiceTranslator.java
-    # This seems to never be built
-    EXCLUDES += com/sun/java/accessibility/extensions
+        AccessBridgeLoader.java
   endif
 
-endif
-
 ifneq ($(OPENJDK_TARGET_OS), solaris)
   # Exclude Solaris nio and two security related files in src/share/classes
   EXFILES += SolarisAclFileAttributeView.java \
@@ -272,7 +270,7 @@
 
 ifndef OPENJDK
   CLOSED_SRC_DIRS := $(JDK_TOPDIR)/src/closed/share/classes \
-      $(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS_API_DIR)/classes
+      $(wildcard $(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS_API_DIR)/classes)
 endif
 
 MACOSX_SRC_DIRS :=
@@ -379,7 +377,6 @@
 
 ##########################################################################################
 
-ifndef OPENJDK
   ifeq ($(OPENJDK_TARGET_OS), windows)
     ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
       $(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_32, \
@@ -413,7 +410,6 @@
 
     endif
   endif
-endif
 
 ##########################################################################################
 
--- a/make/CompileLaunchers.gmk	Sat May 23 02:49:50 2015 +0300
+++ b/make/CompileLaunchers.gmk	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, 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
@@ -659,11 +659,10 @@
 ##########################################################################################
 # jabswitch
 
-ifndef OPENJDK
   ifeq ($(OPENJDK_TARGET_OS), windows)
 
     $(eval $(call SetupNativeCompilation,BUILD_JABSWITCH, \
-        SRC := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge, \
+      SRC := $(JDK_TOPDIR)/src/windows/native/sun/bridge, \
         INCLUDE_FILES := jabswitch.cpp, \
         LANG := C++, \
         CFLAGS := $(filter-out -Zc:wchar_t-, $(CFLAGS_JDKEXE)) -Zc:wchar_t \
@@ -675,17 +674,16 @@
         OUTPUT_DIR := $(JDK_OUTPUTDIR)/bin, \
         PROGRAM := jabswitch, \
         DEBUG_SYMBOLS := true, \
-        VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/AccessBridgeStatusWindow.rc, \
+      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/native/sun/bridge/AccessBridgeStatusWindow.rc, \
         RC_FLAGS := $(RC_FLAGS) \
             -D "JDK_FNAME=jabswitch.exe" \
             -D "JDK_INTERNAL_NAME=jabswitch" \
             -D "JDK_FTYPE=0x01L", \
-        MANIFEST := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/jabswitch.manifest))
+      MANIFEST := $(JDK_TOPDIR)/src/windows/native/sun/bridge/jabswitch.manifest))
 
     BUILD_LAUNCHERS += $(BUILD_JABSWITCH)
 
   endif
-endif
 
 ##########################################################################################
 
--- a/make/CopyFiles.gmk	Sat May 23 02:49:50 2015 +0300
+++ b/make/CopyFiles.gmk	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -55,7 +55,6 @@
 
 ##########################################################################################
 
-ifndef OPENJDK
   ifeq ($(OPENJDK_TARGET_OS), windows)
     COPY_FILES += $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCallbacks.h \
         $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCalls.h \
@@ -64,14 +63,12 @@
         $(JDK_OUTPUTDIR)/lib/accessibility.properties
 
     $(OPENJDK_TARGET_OS_INCLUDE)/bridge/%: \
-        $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/%
+      $(JDK_TOPDIR)/src/windows/native/sun/bridge/%
 		$(install-file)
 
     $(JDK_OUTPUTDIR)/lib/accessibility.properties: \
-        $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/accessibility.properties
+      $(JDK_TOPDIR)/src/windows/native/sun/bridge/accessibility.properties
 		$(install-file)
-
-  endif
 endif
 
 ##########################################################################################
@@ -285,7 +282,10 @@
 ifeq ($(OPENJDK_TARGET_OS), macosx)
   JVMCFG_SRC := $(JDK_TOPDIR)/src/macosx/bin/$(JVMCFG_ARCH)/jvm.cfg
 else
-  JVMCFG_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/$(JVMCFG_ARCH)/jvm.cfg
+  JVMCFG_BASE := $(OPENJDK_TARGET_OS_API_DIR)/bin/$(JVMCFG_ARCH)/jvm.cfg
+  ALT_JVMCFG_SRC := $(JDK_TOPDIR)/src/closed/$(JVMCFG_BASE)
+  # Use the ALT file if it exists
+  JVMCFG_SRC := $(if $(wildcard $(ALT_JVMCFG_SRC)),$(ALT_JVMCFG_SRC),$(JDK_TOPDIR)/src/$(JVMCFG_BASE))
 endif
 JVMCFG_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
 JVMCFG := $(JVMCFG_DIR)/jvm.cfg
--- a/make/CreateJars.gmk	Sat May 23 02:49:50 2015 +0300
+++ b/make/CreateJars.gmk	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, 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
@@ -267,10 +267,12 @@
 	$(RM) $@ $@.tmp
 	$(GREP) -e '\.class$$' $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
         ifneq ($(PROFILE), )
-          # # Add back classes from excluded packages (fixing the $ substitution in the process)
-	  for type in $(subst \$$,\, $(RT_JAR_INCLUDE_TYPES)) ; do \
-	    $(ECHO) $$type >> $@.tmp ; \
-	  done
+          ifneq ($(strip $(RT_JAR_INCLUDE_TYPES)), )
+           # Add back classes from excluded packages (fixing the $ substitution in the process)
+	    for type in $(subst \$$,\, $(RT_JAR_INCLUDE_TYPES)) ; do \
+	      $(ECHO) $$type >> $@.tmp ; \
+	    done
+          endif
         endif
 	$(MV) $@.tmp $@
 
@@ -281,15 +283,15 @@
 	    -e '/_the\.*' -e '^_the\.*' -e '\\_the\.*' -e 'javac_state' \
 	    $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.jars.contents > $@.tmp
         ifneq ($(PROFILE), )
-          # # Strip out all META-INF/services/ entries
-	  $(GREP) -v -e 'META-INF/services/' $@.tmp > $@.tmp2
-          # # Add back the required services
-          # # FIXME: On Solaris if PROFILE_INCLUDE_METAINF_SERVICES is not defined
-          # # we get a syntax error from sh. That doesn't happen on linux
-	  for service in $(PROFILE_INCLUDE_METAINF_SERVICES) ; do \
-	    $(ECHO) $$service >> $@.tmp2; \
-	  done
-	  $(MV) $@.tmp2 $@.tmp
+          ifneq ($(strip $(PROFILE_INCLUDE_METAINF_SERVICES)), )
+            # Strip out all META-INF/services/ entries
+	    $(GREP) -v -e 'META-INF/services/' $@.tmp > $@.tmp2
+	    # Add back the required services
+	    for service in $(PROFILE_INCLUDE_METAINF_SERVICES) ; do \
+	      $(ECHO) $$service >> $@.tmp2; \
+	    done
+	    $(MV) $@.tmp2 $@.tmp
+          endif
         endif
 	$(MV) $@.tmp $@
 
@@ -309,6 +311,15 @@
 	$(MKDIR) -p $(@D)
 	$(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
 
+# Code these targets explicitly because the target "%" expansion does
+# not work with the inline "$" in the file name.
+$(BEANLESS_CLASSES)/java/util/jar/Pack200\$$Packer.class: $(JDK_OUTPUTDIR)/classes/java/util/jar/Pack200$$Packer.class
+	$(MKDIR) -p $(@D)
+	$(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
+$(BEANLESS_CLASSES)/java/util/jar/Pack200\$$Unpacker.class: $(JDK_OUTPUTDIR)/classes/java/util/jar/Pack200$$Unpacker.class
+	$(MKDIR) -p $(@D)
+	$(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
+
 CLASSES_TO_DEBEAN = \
     java/util/logging/LogManager.class \
     java/util/jar/Pack200\$$Packer.class \
@@ -639,18 +650,8 @@
 
 ##########################################################################################
 
-ifndef OPENJDK
-  ifeq ($(OPENJDK_TARGET_OS), windows)
-
-    $(eval $(call SetupArchive,BUILD_JACCESS_JAR, , \
-        SRCS := $(JDK_OUTPUTDIR)/classes, \
-        INCLUDES := com/sun/java/accessibility/util, \
-        JAR := $(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar, \
-        SKIP_METAINF := true))
-
-    JARS += $(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar
-
-    ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
+ifeq ($(OPENJDK_TARGET_OS), windows)
+  ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
       $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_32_JAR, , \
           SRCS := $(JDK_OUTPUTDIR)/classes_ab/32bit, \
           INCLUDES := com/sun/java/accessibility, \
@@ -665,7 +666,7 @@
 
       JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-32.jar \
           $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge.jar
-    else
+  else
       $(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_64_JAR, , \
           SRCS := $(JDK_OUTPUTDIR)/classes_ab/64bit, \
           INCLUDES := com/sun/java/accessibility, \
@@ -673,10 +674,17 @@
           SKIP_METAINF := true))
 
       JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar
-    endif
   endif
 endif
 
+$(eval $(call SetupArchive,BUILD_JACCESS_JAR, , \
+    SRCS := $(JDK_OUTPUTDIR)/classes, \
+    INCLUDES := com/sun/java/accessibility/util, \
+    JAR := $(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar, \
+    SKIP_METAINF := true))
+
+JARS += $(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar
+
 ##########################################################################################
 
 #
--- a/make/Images.gmk	Sat May 23 02:49:50 2015 +0300
+++ b/make/Images.gmk	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, 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
@@ -161,11 +161,13 @@
 
 ifeq ($(OPENJDK_TARGET_OS), windows)
   JDK_BIN_LIST := $(filter $(addprefix %, $(WINDOWS_JDK_BIN_FILES)), $(ALL_BIN_LIST))
-  # On windows x86, the server jvm is filtered out from the j2re image. This could possibly
-  # be handled by profiles in the future. If no client jvm is built, leave server in.
+  # On windows x86, the server jvm is filtered out from the j2re image. This is historical
+  # and is not applied to compact profiles. If no client jvm is built, leave server in.
   ifeq ($(OPENJDK_TARGET_CPU), x86)
     ifeq ($(JVM_VARIANT_CLIENT), true)
-      JRE_BIN_LIST := $(filter-out $(JDK_OUTPUTDIR)/bin/server/%, $(JRE_BIN_LIST))
+      ifeq ($(PROFILE), )
+        JRE_BIN_LIST := $(filter-out $(JDK_OUTPUTDIR)/bin/server/%, $(JRE_BIN_LIST))
+      endif
     endif
   endif
 else
--- a/make/Import.gmk	Sat May 23 02:49:50 2015 +0300
+++ b/make/Import.gmk	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2014, 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
@@ -116,6 +116,12 @@
 #
 HOTSPOT_IMPORT_FILES := $(addprefix $(LIBRARY_PREFIX), jvm.* saproc.* jsig.* sawindbg.* jvm_db.* jvm_dtrace.*) \
     Xusage.txt sa-jdi.jar
+
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+    # additional debug file
+    HOTSPOT_IMPORT_FILES += Info.plist
+endif
+
 $(eval $(call CopyDir,HOTSPOT0, $(HOTSPOT_LIB_DIR), $(INSTALL_LIBRARIES_HERE), $(HOTSPOT_IMPORT_FILES)))
 $(eval $(call CopyDir,HOTSPOT1, $(HOTSPOT_DIST)/lib, $(JDK_OUTPUTDIR)/lib, $(HOTSPOT_IMPORT_FILES)))
 
--- a/make/Profiles.gmk	Sat May 23 02:49:50 2015 +0300
+++ b/make/Profiles.gmk	Thu Jun 04 15:21:53 2015 -0700
@@ -47,7 +47,6 @@
 # Note that some jars may be optional depending on the type of build (jdk vs.
 # openjdk) and the platform.
 #
-# WARNING: incoming lists are currently validated for linux only!
 ###############################################################################
 
 # These are jar files for which the contents vary depending on the profile
--- a/make/Tools.gmk	Sat May 23 02:49:50 2015 +0300
+++ b/make/Tools.gmk	Thu Jun 04 15:21:53 2015 -0700
@@ -124,11 +124,11 @@
     build.tools.cldrconverter.CLDRConverter
 
 TOOL_REMOVEMETHODS = $(JAVA_SMALL) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \
-    -cp $(JDK_OUTPUTDIR)/btclasses:$(JDK_OUTPUTDIR) \
+    -cp '$(JDK_OUTPUTDIR)/btclasses$(PATH_SEP)$(JDK_OUTPUTDIR)' \
     build.tools.classfile.RemoveMethods
 
 TOOL_CHECKDEPS = $(JAVA_SMALL) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \
-    -cp $(JDK_OUTPUTDIR)/btclasses:$(JDK_OUTPUTDIR) \
+    -cp '$(JDK_OUTPUTDIR)/btclasses$(PATH_SEP)$(JDK_OUTPUTDIR)' \
     build.tools.deps.CheckDeps
 
 TOOL_ADDTORESTRICTEDPKGS=$(JAVA_SMALL) -cp $(JDK_OUTPUTDIR)/btclasses \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/data/charsetmapping/IBM1166.c2b	Thu Jun 04 15:21:53 2015 -0700
@@ -0,0 +1,1 @@
+0x15	U+0085
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/data/charsetmapping/IBM1166.map	Thu Jun 04 15:21:53 2015 -0700
@@ -0,0 +1,256 @@
+0x00	U+0000
+0x01	U+0001
+0x02	U+0002
+0x03	U+0003
+0x04	U+009c
+0x05	U+0009
+0x06	U+0086
+0x07	U+007f
+0x08	U+0097
+0x09	U+008d
+0x0a	U+008e
+0x0b	U+000b
+0x0c	U+000c
+0x0d	U+000d
+0x0e	U+000e
+0x0f	U+000f
+0x10	U+0010
+0x11	U+0011
+0x12	U+0012
+0x13	U+0013
+0x14	U+009d
+0x15	U+000a
+0x16	U+0008
+0x17	U+0087
+0x18	U+0018
+0x19	U+0019
+0x1a	U+0092
+0x1b	U+008f
+0x1c	U+001c
+0x1d	U+001d
+0x1e	U+001e
+0x1f	U+001f
+0x20	U+0080
+0x21	U+0081
+0x22	U+0082
+0x23	U+0083
+0x24	U+0084
+0x25	U+000a
+0x26	U+0017
+0x27	U+001b
+0x28	U+0088
+0x29	U+0089
+0x2a	U+008a
+0x2b	U+008b
+0x2c	U+008c
+0x2d	U+0005
+0x2e	U+0006
+0x2f	U+0007
+0x30	U+0090
+0x31	U+0091
+0x32	U+0016
+0x33	U+0093
+0x34	U+0094
+0x35	U+0095
+0x36	U+0096
+0x37	U+0004
+0x38	U+0098
+0x39	U+0099
+0x3a	U+009a
+0x3b	U+009b
+0x3c	U+0014
+0x3d	U+0015
+0x3e	U+009e
+0x3f	U+001a
+0x40	U+0020
+0x41	U+00a0
+0x42	U+04d9
+0x43	U+0493
+0x44	U+0451
+0x45	U+0454
+0x46	U+0455
+0x47	U+0456
+0x48	U+049b
+0x49	U+0458
+0x4a	U+005b
+0x4b	U+002e
+0x4c	U+003c
+0x4d	U+0028
+0x4e	U+002b
+0x4f	U+0021
+0x50	U+0026
+0x51	U+04a3
+0x52	U+04e9
+0x53	U+04b1
+0x54	U+04af
+0x55	U+045e
+0x56	U+04bb
+0x57	U+042a
+0x58	U+2116
+0x59	U+04d8
+0x5a	U+005d
+0x5b	U+0024
+0x5c	U+002a
+0x5d	U+0029
+0x5e	U+003b
+0x5f	U+005e
+0x60	U+002d
+0x61	U+002f
+0x62	U+0492
+0x63	U+0401
+0x64	U+0404
+0x65	U+0405
+0x66	U+0406
+0x67	U+049a
+0x68	U+0408
+0x69	U+04a2
+0x6a	U+007c
+0x6b	U+002c
+0x6c	U+0025
+0x6d	U+005f
+0x6e	U+003e
+0x6f	U+003f
+0x70	U+04e8
+0x71	U+04b0
+0x72	U+04ae
+0x73	U+00ad
+0x74	U+040e
+0x75	U+04ba
+0x76	U+044e
+0x77	U+0430
+0x78	U+0431
+0x79	U+0060
+0x7a	U+003a
+0x7b	U+0023
+0x7c	U+0040
+0x7d	U+0027
+0x7e	U+003d
+0x7f	U+0022
+0x80	U+0446
+0x81	U+0061
+0x82	U+0062
+0x83	U+0063
+0x84	U+0064
+0x85	U+0065
+0x86	U+0066
+0x87	U+0067
+0x88	U+0068
+0x89	U+0069
+0x8a	U+0434
+0x8b	U+0435
+0x8c	U+0444
+0x8d	U+0433
+0x8e	U+0445
+0x8f	U+0438
+0x90	U+0439
+0x91	U+006a
+0x92	U+006b
+0x93	U+006c
+0x94	U+006d
+0x95	U+006e
+0x96	U+006f
+0x97	U+0070
+0x98	U+0071
+0x99	U+0072
+0x9a	U+043a
+0x9b	U+043b
+0x9c	U+043c
+0x9d	U+043d
+0x9e	U+043e
+0x9f	U+043f
+0xa0	U+044f
+0xa1	U+007e
+0xa2	U+0073
+0xa3	U+0074
+0xa4	U+0075
+0xa5	U+0076
+0xa6	U+0077
+0xa7	U+0078
+0xa8	U+0079
+0xa9	U+007a
+0xaa	U+0440
+0xab	U+0441
+0xac	U+0442
+0xad	U+0443
+0xae	U+0436
+0xaf	U+0432
+0xb0	U+044c
+0xb1	U+044b
+0xb2	U+0437
+0xb3	U+0448
+0xb4	U+044d
+0xb5	U+0449
+0xb6	U+0447
+0xb7	U+044a
+0xb8	U+042e
+0xb9	U+0410
+0xba	U+0411
+0xbb	U+0426
+0xbc	U+0414
+0xbd	U+0415
+0xbe	U+0424
+0xbf	U+0413
+0xc0	U+007b
+0xc1	U+0041
+0xc2	U+0042
+0xc3	U+0043
+0xc4	U+0044
+0xc5	U+0045
+0xc6	U+0046
+0xc7	U+0047
+0xc8	U+0048
+0xc9	U+0049
+0xca	U+0425
+0xcb	U+0418
+0xcc	U+0419
+0xcd	U+041a
+0xce	U+041b
+0xcf	U+041c
+0xd0	U+007d
+0xd1	U+004a
+0xd2	U+004b
+0xd3	U+004c
+0xd4	U+004d
+0xd5	U+004e
+0xd6	U+004f
+0xd7	U+0050
+0xd8	U+0051
+0xd9	U+0052
+0xda	U+041d
+0xdb	U+041e
+0xdc	U+041f
+0xdd	U+042f
+0xde	U+0420
+0xdf	U+0421
+0xe0	U+005c
+0xe1	U+20ac
+0xe2	U+0053
+0xe3	U+0054
+0xe4	U+0055
+0xe5	U+0056
+0xe6	U+0057
+0xe7	U+0058
+0xe8	U+0059
+0xe9	U+005a
+0xea	U+0422
+0xeb	U+0423
+0xec	U+0416
+0xed	U+0412
+0xee	U+042c
+0xef	U+042b
+0xf0	U+0030
+0xf1	U+0031
+0xf2	U+0032
+0xf3	U+0033
+0xf4	U+0034
+0xf5	U+0035
+0xf6	U+0036
+0xf7	U+0037
+0xf8	U+0038
+0xf9	U+0039
+0xfa	U+0417
+0xfb	U+0428
+0xfc	U+042d
+0xfd	U+0429
+0xfe	U+0427
+0xff	U+009f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/data/charsetmapping/IBM1166.nr	Thu Jun 04 15:21:53 2015 -0700
@@ -0,0 +1,1 @@
+0x25	U+000a
--- a/make/data/charsetmapping/extsbcs	Sat May 23 02:49:50 2015 +0300
+++ b/make/data/charsetmapping/extsbcs	Thu Jun 04 15:21:53 2015 -0700
@@ -22,6 +22,7 @@
 IBM1147		IBM01147	Cp1147		false		sun.nio.cs.ext
 IBM1148		IBM01148	Cp1148		false		sun.nio.cs.ext
 IBM1149		IBM01149	Cp1149		false		sun.nio.cs.ext
+IBM1166		x-IBM1166	Cp1166		false		sun.nio.cs.ext
 IBM273		IBM273		Cp273		false		sun.nio.cs.ext
 IBM277		IBM277		Cp277		false		sun.nio.cs.ext
 IBM278		IBM278		Cp278		false		sun.nio.cs.ext
--- a/make/data/tzdata/VERSION	Sat May 23 02:49:50 2015 +0300
+++ b/make/data/tzdata/VERSION	Thu Jun 04 15:21:53 2015 -0700
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2015b
+tzdata2015d
--- a/make/data/tzdata/africa	Sat May 23 02:49:50 2015 +0300
+++ b/make/data/tzdata/africa	Thu Jun 04 15:21:53 2015 -0700
@@ -342,35 +342,29 @@
 # above) says DST had no affect on electricity consumption.  There is
 # no information about when DST will end this fall.  See:
 # http://abcnews.go.com/International/wireStory/el-sissi-pushes-egyptians-line-23614833
+
+# From Steffen Thorsen (2015-04-08):
+# Egypt will start DST on midnight after Thursday, April 30, 2015.
+# This is based on a law (no 35) from May 15, 2014 saying it starts the last
+# Thursday of April....  Clocks will still be turned back for Ramadan, but
+# dates not yet announced....
+# http://almogaz.com/news/weird-news/2015/04/05/1947105 ...
+# http://www.timeanddate.com/news/time/egypt-starts-dst-2015.html
+
+# From Ahmed Nazmy (2015-04-20):
+# Egypt's ministers cabinet just announced ... that it will cancel DST at
+# least for 2015.
 #
-# For now, guess that later spring and fall transitions will use
-# 2010's rules, and guess that Egypt will switch to standard time at
-# 24:00 the last Thursday before Ramadan, and back to DST at 00:00 the
-# first Friday after Ramadan.  To implement this,
-# transition dates for 2015 through 2037 were determined by running
-# the following program under GNU Emacs 24.3, with the results integrated
-# by hand into the table below.  Ramadan again intrudes on the guessed
-# DST starting in 2038, but that's beyond our somewhat-arbitrary cutoff.
-# (let ((islamic-year 1436))
-#   (while (< islamic-year 1460)
-#     (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
-#           (b (calendar-islamic-to-absolute (list 10 1 islamic-year)))
-#           (friday 5))
-#       (while (/= friday (mod a 7))
-#         (setq a (1- a)))
-#       (while (/= friday (mod b 7))
-#         (setq b (1+ b)))
-#       (setq a (1- a))
-#       (setq b (1- b))
-#       (setq a (calendar-gregorian-from-absolute a))
-#       (setq b (calendar-gregorian-from-absolute b))
-#       (insert
-#        (format
-#         (concat "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t0\t-\n"
-#                 "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t1:00\tS\n")
-#         (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
-#         (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
-#     (setq islamic-year (+ 1 islamic-year))))
+# From Tim Parenti (2015-04-20):
+# http://english.ahram.org.eg/WriterArticles/NewsContentP/1/128195/Egypt/No-daylight-saving-this-summer-Egypts-prime-minist.aspx
+# "Egypt's cabinet agreed on Monday not to switch clocks for daylight saving
+# time this summer, and carry out studies on the possibility of canceling the
+# practice altogether in future years."
+#
+# From Paul Eggert (2015-04-20):
+# For now, assume DST will be canceled.  Any resumption would likely
+# use different rules anyway.
+
 Rule	Egypt	2008	only	-	Aug	lastThu	24:00	0	-
 Rule	Egypt	2009	only	-	Aug	20	24:00	0	-
 Rule	Egypt	2010	only	-	Aug	10	24:00	0	-
@@ -379,22 +373,7 @@
 Rule	Egypt	2014	only	-	May	15	24:00	1:00	S
 Rule	Egypt	2014	only	-	Jun	26	24:00	0	-
 Rule	Egypt	2014	only	-	Jul	31	24:00	1:00	S
-Rule	Egypt	2014	max	-	Sep	lastThu	24:00	0	-
-Rule	Egypt	2015	2019	-	Apr	lastFri	 0:00s	1:00	S
-Rule	Egypt	2015	only	-	Jun	11	24:00	0	-
-Rule	Egypt	2015	only	-	Jul	23	24:00	1:00	S
-Rule	Egypt	2016	only	-	Jun	 2	24:00	0	-
-Rule	Egypt	2016	only	-	Jul	 7	24:00	1:00	S
-Rule	Egypt	2017	only	-	May	25	24:00	0	-
-Rule	Egypt	2017	only	-	Jun	29	24:00	1:00	S
-Rule	Egypt	2018	only	-	May	10	24:00	0	-
-Rule	Egypt	2018	only	-	Jun	14	24:00	1:00	S
-Rule	Egypt	2019	only	-	May	 2	24:00	0	-
-Rule	Egypt	2019	only	-	Jun	 6	24:00	1:00	S
-Rule	Egypt	2020	only	-	May	28	24:00	1:00	S
-Rule	Egypt	2021	only	-	May	13	24:00	1:00	S
-Rule	Egypt	2022	only	-	May	 5	24:00	1:00	S
-Rule	Egypt	2023	max	-	Apr	lastFri	 0:00s	1:00	S
+Rule	Egypt	2014	only	-	Sep	lastThu	24:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Cairo	2:05:09 -	LMT	1900 Oct
--- a/make/data/tzdata/antarctica	Sat May 23 02:49:50 2015 +0300
+++ b/make/data/tzdata/antarctica	Thu Jun 04 15:21:53 2015 -0700
@@ -38,41 +38,6 @@
 # I made up all time zone abbreviations mentioned here; corrections welcome!
 # FORMAT is 'zzz' and GMTOFF is 0 for locations while uninhabited.
 
-# These rules are stolen from the 'southamerica' file.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	ArgAQ	1964	1966	-	Mar	 1	0:00	0	-
-Rule	ArgAQ	1964	1966	-	Oct	15	0:00	1:00	S
-Rule	ArgAQ	1967	only	-	Apr	 2	0:00	0	-
-Rule	ArgAQ	1967	1968	-	Oct	Sun>=1	0:00	1:00	S
-Rule	ArgAQ	1968	1969	-	Apr	Sun>=1	0:00	0	-
-Rule	ArgAQ	1974	only	-	Jan	23	0:00	1:00	S
-Rule	ArgAQ	1974	only	-	May	 1	0:00	0	-
-Rule	ChileAQ	1972	1986	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1974	1987	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	1987	only	-	Apr	12	3:00u	0	-
-Rule	ChileAQ	1988	1989	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1988	only	-	Oct	Sun>=1	4:00u	1:00	S
-Rule	ChileAQ	1989	only	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	1990	only	-	Mar	18	3:00u	0	-
-Rule	ChileAQ	1990	only	-	Sep	16	4:00u	1:00	S
-Rule	ChileAQ	1991	1996	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1991	1997	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	1997	only	-	Mar	30	3:00u	0	-
-Rule	ChileAQ	1998	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1998	only	-	Sep	27	4:00u	1:00	S
-Rule	ChileAQ	1999	only	-	Apr	 4	3:00u	0	-
-Rule	ChileAQ	1999	2010	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	2000	2007	-	Mar	Sun>=9	3:00u	0	-
-# N.B.: the end of March 29 in Chile is March 30 in Universal time,
-# which is used below in specifying the transition.
-Rule	ChileAQ	2008	only	-	Mar	30	3:00u	0	-
-Rule	ChileAQ	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	2010	only	-	Apr	Sun>=1	3:00u	0	-
-Rule	ChileAQ	2011	only	-	May	Sun>=2	3:00u	0	-
-Rule	ChileAQ	2011	only	-	Aug	Sun>=16	4:00u	1:00	S
-Rule	ChileAQ	2012	2015	-	Apr	Sun>=23	3:00u	0	-
-Rule	ChileAQ	2012	2014	-	Sep	Sun>=2	4:00u	1:00	S
-
 # Argentina - year-round bases
 # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
 # Carlini, Potter Cove, King George Island, -6414-0602320, since 1982-01
@@ -367,21 +332,7 @@
 # USA - year-round bases
 #
 # Palmer, Anvers Island, since 1965 (moved 2 miles in 1968)
-#
-# From Ethan Dicks (1996-10-06):
-# It keeps the same time as Punta Arenas, Chile, because, just like us
-# and the South Pole, that's the other end of their supply line....
-# I verified with someone who was there that since 1980,
-# Palmer has followed Chile.  Prior to that, before the Falklands War,
-# Palmer used to be supplied from Argentina.
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Antarctica/Palmer	0	-	zzz	1965
-			-4:00	ArgAQ	AR%sT	1969 Oct  5
-			-3:00	ArgAQ	AR%sT	1982 May
-			-4:00	ChileAQ	CL%sT	2015 Apr 26 3:00u
-			-3:00	-	CLT
-#
+# See 'southamerica' for Antarctica/Palmer, since it uses South American DST.
 #
 # McMurdo Station, Ross Island, since 1955-12
 # Amundsen-Scott South Pole Station, continuously occupied since 1956-11-20
--- a/make/data/tzdata/backward	Sat May 23 02:49:50 2015 +0300
+++ b/make/data/tzdata/backward	Thu Jun 04 15:21:53 2015 -0700
@@ -43,6 +43,7 @@
 Link	America/Indiana/Knox	America/Knox_IN
 Link	America/Kentucky/Louisville	America/Louisville
 Link	America/Argentina/Mendoza	America/Mendoza
+Link	America/Toronto		America/Montreal
 Link	America/Rio_Branco	America/Porto_Acre
 Link	America/Argentina/Cordoba	America/Rosario
 Link	America/Denver		America/Shiprock
--- a/make/data/tzdata/europe	Sat May 23 02:49:50 2015 +0300
+++ b/make/data/tzdata/europe	Thu Jun 04 15:21:53 2015 -0700
@@ -99,7 +99,7 @@
 #        1:00:14    SET           Swedish (1879-1899)*
 #        2:00       EET EEST      Eastern Europe
 #        3:00       FET           Further-eastern Europe (2011-2014)*
-#        3:00       MSK MSD  MSM* Moscow
+#        3:00       MSK MSD  MSM* Minsk, Moscow
 
 # From Peter Ilieve (1994-12-04),
 # The original six [EU members]: Belgium, France, (West) Germany, Italy,
--- a/make/data/tzdata/northamerica	Sat May 23 02:49:50 2015 +0300
+++ b/make/data/tzdata/northamerica	Thu Jun 04 15:21:53 2015 -0700
@@ -250,9 +250,14 @@
 # The law doesn't give abbreviations.
 #
 # From Paul Eggert (2000-01-08), following a heads-up from Rives McDow:
-# Public law 106-564 (2000-12-23) introduced the abbreviation
-# "Chamorro Standard Time" for time in Guam and the Northern Marianas.
-# See the file "australasia".
+# Public law 106-564 (2000-12-23) introduced ... "Chamorro Standard Time"
+# for time in Guam and the Northern Marianas.  See the file "australasia".
+#
+# From Paul Eggert (2015-04-17):
+# HST and HDT are standardized abbreviations for Hawaii-Aleutian
+# standard and daylight times.  See section 9.47 (p 234) of the
+# U.S. Government Printing Office Style Manual (2008)
+# http://www.gpo.gov/fdsys/pkg/GPO-STYLEMANUAL-2008/pdf/GPO-STYLEMANUAL-2008.pdf
 
 # From Arthur David Olson, 2005-08-09
 # The following was signed into law on 2005-08-08.
@@ -559,7 +564,7 @@
 			-11:00	-	BST	1969
 			-11:00	US	B%sT	1983 Oct 30  2:00
 			-10:00	US	AH%sT	1983 Nov 30
-			-10:00	US	HA%sT
+			-10:00	US	H%sT
 # The following switches don't quite make our 1970 cutoff.
 #
 # Shanks writes that part of southwest Alaska (e.g. Aniak)
@@ -1354,14 +1359,9 @@
 
 # Quebec
 
-# From Paul Eggert (2013-08-30):
-# Since 1970 most of Quebec has been like Toronto.
-# However, because earlier versions of the tz database mistakenly relied on data
-# from Shanks & Pottenger saying that Quebec differed from Ontario after 1970,
-# a separate entry was created for most of Quebec.  We're loath to lose
-# its pre-1970 info, even though the tz database is normally limited to
-# zones that differ after 1970, so keep this otherwise out-of-scope entry.
-
+# From Paul Eggert (2015-03-24):
+# See America/Toronto for most of Quebec, including Montreal.
+#
 # Matthews and Vincent (1998) also write that Quebec east of the -63
 # meridian is supposed to observe AST, but residents as far east as
 # Natashquan use EST/EDT, and residents east of Natashquan use AST.
@@ -1375,39 +1375,10 @@
 # For lack of better info, guess this practice began around 1970, contra to
 # Shanks & Pottenger who have this region observing AST/ADT.
 
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Mont	1917	only	-	Mar	25	2:00	1:00	D
-Rule	Mont	1917	only	-	Apr	24	0:00	0	S
-Rule	Mont	1919	only	-	Mar	31	2:30	1:00	D
-Rule	Mont	1919	only	-	Oct	25	2:30	0	S
-Rule	Mont	1920	only	-	May	 2	2:30	1:00	D
-Rule	Mont	1920	1922	-	Oct	Sun>=1	2:30	0	S
-Rule	Mont	1921	only	-	May	 1	2:00	1:00	D
-Rule	Mont	1922	only	-	Apr	30	2:00	1:00	D
-Rule	Mont	1924	only	-	May	17	2:00	1:00	D
-Rule	Mont	1924	1926	-	Sep	lastSun	2:30	0	S
-Rule	Mont	1925	1926	-	May	Sun>=1	2:00	1:00	D
-Rule	Mont	1927	1937	-	Apr	lastSat	24:00	1:00	D
-Rule	Mont	1927	1937	-	Sep	lastSat	24:00	0	S
-Rule	Mont	1938	1940	-	Apr	lastSun	0:00	1:00	D
-Rule	Mont	1938	1939	-	Sep	lastSun	0:00	0	S
-Rule	Mont	1946	1973	-	Apr	lastSun	2:00	1:00	D
-Rule	Mont	1945	1948	-	Sep	lastSun	2:00	0	S
-Rule	Mont	1949	1950	-	Oct	lastSun	2:00	0	S
-Rule	Mont	1951	1956	-	Sep	lastSun	2:00	0	S
-Rule	Mont	1957	1973	-	Oct	lastSun	2:00	0	S
-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Blanc-Sablon -3:48:28 -	LMT	1884
 			-4:00	Canada	A%sT	1970
 			-4:00	-	AST
-Zone America/Montreal	-4:54:16 -	LMT	1884
-			-5:00	Mont	E%sT	1918
-			-5:00	Canada	E%sT	1919
-			-5:00	Mont	E%sT	1942 Feb  9  2:00s
-			-5:00	Canada	E%sT	1946
-			-5:00	Mont	E%sT	1974
-			-5:00	Canada	E%sT
 
 # Ontario
 
@@ -1898,17 +1869,115 @@
 # Dawson switched to PST in 1973.  Inuvik switched to MST in 1979.
 # Mathew Englander (1996-10-07) gives the following refs:
 #	* 1967. Paragraph 28(34)(g) of the Interpretation Act, S.C. 1967-68,
-#	c. 7 defines Yukon standard time as UTC-9.  This is still valid;
+#	c. 7 defines Yukon standard time as UTC-9....
 #	see Interpretation Act, R.S.C. 1985, c. I-21, s. 35(1).
+#	[http://canlii.ca/t/7vhg]
 #	* C.O. 1973/214 switched Yukon to PST on 1973-10-28 00:00.
 #	* O.I.C. 1980/02 established DST.
 #	* O.I.C. 1987/056 changed DST to Apr firstSun 2:00 to Oct lastSun 2:00.
-# Shanks & Pottenger say Yukon's 1973-10-28 switch was at 2:00; go
-# with Englander.
-# From Chris Walton (2006-06-26):
-# Here is a link to the old daylight saving portion of the interpretation
-# act which was last updated in 1987:
-# http://www.gov.yk.ca/legislation/regs/oic1987_056.pdf
+
+# From Brian Inglis (2015-04-14):
+#
+# I tried to trace the history of Yukon time and found the following
+# regulations, giving the reference title and URL if found, regulation name,
+# and relevant quote if available.  Each regulation specifically revokes its
+# predecessor.  The final reference is to the current Interpretation Act
+# authorizing and resulting from these regulatory changes.
+#
+# Only recent regulations were retrievable via Yukon government site search or
+# index, and only some via Canadian legal sources.  Other sources used include
+# articles titled "Standard Time and Time Zones in Canada" from JRASC via ADS
+# Abstracts, cited by ADO for 1932 ..., and updated versions from 1958 and
+# 1970 quoted below; each article includes current extracts from provincial
+# and territorial ST and DST regulations at the end, summaries and details of
+# standard times and daylight saving time at many locations across Canada,
+# with time zone maps, tables and calculations for Canadian Sunrise, Sunset,
+# and LMST; they also cover many countries and global locations, with a chart
+# and table showing current Universal Time offsets, and may be useful as
+# another source of information for 1970 and earlier.
+#
+# * Standard Time and Time Zones in Canada; Smith, C.C.; JRASC, Vol. 26,
+#   pp.49-77; February 1932; SAO/NASA Astrophysics Data System (ADS)
+#   http://adsabs.harvard.edu/abs/1932JRASC..26...49S from p.75:
+#   Yukon Interpretation Ordinance
+#   Yukon standard time is the local mean time at the one hundred and
+#   thirty-fifth meridian.
+#
+# * Standard Time and Time Zones in Canada; Smith, C.C.; Thomson, Malcolm M.;
+#   JRASC, Vol. 52, pp.193-223; October 1958; SAO/NASA Astrophysics Data System
+#   (ADS) http://adsabs.harvard.edu/abs/1958JRASC..52..193S from pp.220-1:
+#   Yukon Interpretation Ordinance, 1955, Chap. 16.
+#
+#     (1) Subject to this section, standard time shall be reckoned as nine
+#     hours behind Greenwich Time and called Yukon Standard Time.
+#
+#     (2) Notwithstanding subsection (1), the Commissioner may make regulations
+#     varying the manner of reckoning standard time.
+#
+# * Yukon Territory Commissioner's Order 1966-20 Interpretation Ordinance
+#   http://? - no online source found
+#
+# * Standard Time and Time Zones in Canada; Thomson, Malcolm M.; JRASC,
+#   Vol. 64, pp.129-162; June 1970; SAO/NASA Astrophysics Data System (ADS)
+#   http://adsabs.harvard.edu/abs/1970JRASC..64..129T from p.156: Yukon
+#   Territory Commissioner's Order 1967-59 Interpretation Ordinance ...
+#
+#     1. Commissioner's Order 1966-20 dated at Whitehorse in the Yukon
+#     Territory on 27th January, 1966, is hereby revoked.
+#
+#     2. Yukon (East) Standard Time as defined by section 36 of the
+#     Interpretation Ordinance from and after mid-night on the 28th day of May,
+#     1967 shall be reckoned in the same manner as Pacific Standard Time, that
+#     is to say, eight hours behind Greenwich Time in the area of the Yukon
+#     Territory lying east of the 138th degree longitude west.
+#
+#     3. In the remainder of the Territory, lying west of the 138th degree
+#     longitude west, Yukon (West) Standard Time shall be reckoned as nine
+#     hours behind Greenwich Time.
+#
+# * Yukon Standard Time defined as Pacific Standard Time, YCO 1973/214
+#   http://www.canlii.org/en/yk/laws/regu/yco-1973-214/latest/yco-1973-214.html
+#   C.O. 1973/214 INTERPRETATION ACT ...
+#
+#     1. Effective October 28, 1973 Commissioner's Order 1967/59 is hereby
+#     revoked.
+#
+#     2. Yukon Standard Time as defined by section 36 of the Interpretation
+#     Act from and after midnight on the twenty-eighth day of October, 1973
+#     shall be reckoned in the same manner as Pacific Standard Time, that is
+#     to say eight hours behind Greenwich Time.
+#
+# * O.I.C. 1980/02 INTERPRETATION ACT
+#   http://? - no online source found
+#
+# * Yukon Daylight Saving Time, YOIC 1987/56
+#   http://www.canlii.org/en/yk/laws/regu/yoic-1987-56/latest/yoic-1987-56.html
+#   O.I.C. 1987/056 INTERPRETATION ACT ...
+#
+#   In every year between
+#     (a) two o'clock in the morning in the first Sunday in April, and
+#     (b) two o'clock in the morning in the last Sunday in October,
+#   Standard Time shall be reckoned as seven hours behind Greenwich Time and
+#   called Yukon Daylight Saving Time.
+#   ...
+#   Dated ... 9th day of March, A.D., 1987.
+#
+# * Yukon Daylight Saving Time 2006, YOIC 2006/127
+#   http://www.canlii.org/en/yk/laws/regu/yoic-2006-127/latest/yoic-2006-127.html
+#   O.I.C. 2006/127 INTERPRETATION ACT ...
+#
+#     1. In Yukon each year the time for general purposes shall be 7 hours
+#     behind Greenwich mean time during the period commencing at two o'clock
+#     in the forenoon on the second Sunday of March and ending at two o'clock
+#     in the forenoon on the first Sunday of November and shall be called
+#     Yukon Daylight Saving Time.
+#
+#     2. Order-in-Council 1987/56 is revoked.
+#
+#     3. This order comes into force January 1, 2007.
+#
+# * Interpretation Act, RSY 2002, c 125
+# http://www.canlii.org/en/yk/laws/stat/rsy-2002-c-125/latest/rsy-2002-c-125.html
 
 # From Rives McDow (1999-09-04):
 # Nunavut ... moved ... to incorporate the whole territory into one time zone.
@@ -2134,7 +2203,7 @@
 			-7:00	NT_YK	M%sT	1980
 			-7:00	Canada	M%sT
 Zone America/Whitehorse	-9:00:12 -	LMT	1900 Aug 20
-			-9:00	NT_YK	Y%sT	1966 Jul  1  2:00
+			-9:00	NT_YK	Y%sT	1967 May 28  0:00
 			-8:00	NT_YK	P%sT	1980
 			-8:00	Canada	P%sT
 Zone America/Dawson	-9:17:40 -	LMT	1900 Aug 20
--- a/make/data/tzdata/southamerica	Sat May 23 02:49:50 2015 +0300
+++ b/make/data/tzdata/southamerica	Thu Jun 04 15:21:53 2015 -0700
@@ -1121,6 +1121,60 @@
 
 # Chile
 
+# From Paul Eggert (2015-04-03):
+# Shanks & Pottenger says America/Santiago introduced standard time in
+# 1890 and rounds its UTC offset to 70W40; guess that in practice this
+# was the same offset as in 1916-1919.  It also says Pacific/Easter
+# standardized on 109W22 in 1890; assume this didn't change the clocks.
+#
+# Dates for America/Santiago from 1910 to 2004 are primarily from
+# the following source, cited by Oscar van Vlijmen (2006-10-08):
+# [1] Chile Law
+# http://www.webexhibits.org/daylightsaving/chile.html
+# This contains a copy of a this official table:
+# Cambios en la hora oficial de Chile desde 1900 (retrieved 2008-03-30)
+# http://web.archive.org/web/20080330200901/http://www.horaoficial.cl/cambio.htm
+# [1] needs several corrections, though.
+#
+# The first set of corrections is from:
+# [2] History of the Official Time of Chile
+# http://www.horaoficial.cl/ing/horaof_ing.html (retrieved 2012-03-06).  See:
+# http://web.archive.org/web/20120306042032/http://www.horaoficial.cl/ing/horaof_ing.html
+# This is an English translation of:
+# Historia de la hora oficial de Chile (retrieved 2012-10-24).  See:
+# http://web.archive.org/web/20121024234627/http://www.horaoficial.cl/horaof.htm
+# A fancier Spanish version (requiring mouse-clicking) is at:
+# http://www.horaoficial.cl/historia_hora.html
+# Conflicts between [1] and [2] were resolved as follows:
+#
+#  - [1] says the 1910 transition was Jan 1, [2] says Jan 10 and cites
+#    Boletín Nº 1, Aviso Nº 1 (1910).  Go with [2].
+#
+#  - [1] says SMT was -4:42:45, [2] says Chile's official time from
+#    1916 to 1919 was -4:42:46.3, the meridian of Chile's National
+#    Astronomical Observatory (OAN), then located in what is now
+#    Quinta Normal in Santiago.  Go with [2], rounding it to -4:42:46.
+#
+#  - [1] says the 1918 transition was Sep 1, [2] says Sep 10 and cites
+#    Boletín Nº 22, Aviso Nº 129/1918 (1918-08-23).  Go with [2].
+#
+#  - [1] does not give times for transitions; assume they occur
+#    at midnight mainland time, the current common practice.  However,
+#    go with [2]'s specification of 23:00 for the 1947-05-21 transition.
+#
+# Another correction to [1] is from Jesper Nørgaard Welen, who
+# wrote (2006-10-08), "I think that there are some obvious mistakes in
+# the suggested link from Oscar van Vlijmen,... for instance entry 66
+# says that GMT-4 ended 1990-09-12 while entry 67 only begins GMT-3 at
+# 1990-09-15 (they should have been 1990-09-15 and 1990-09-16
+# respectively), but anyhow it clears up some doubts too."
+#
+# Data for Pacific/Easter from 1910 through 1967 come from Shanks &
+# Pottenger.  After that, for lack of better info assume
+# Pacific/Easter is always two hours behind America/Santiago;
+# this is known to work for DST transitions starting in 2008 and
+# may well be true for earlier transitions.
+
 # From Eduardo Krell (1995-10-19):
 # The law says to switch to DST at midnight [24:00] on the second SATURDAY
 # of October....  The law is the same for March and October.
@@ -1133,78 +1187,35 @@
 # Because of the same drought, the government decided to end DST later,
 # on April 3, (one-time change).
 
-# From Oscar van Vlijmen (2006-10-08):
-# http://www.horaoficial.cl/cambio.htm
-
-# From Jesper Nørgaard Welen (2006-10-08):
-# I think that there are some obvious mistakes in the suggested link
-# from Oscar van Vlijmen,... for instance entry 66 says that GMT-4
-# ended 1990-09-12 while entry 67 only begins GMT-3 at 1990-09-15
-# (they should have been 1990-09-15 and 1990-09-16 respectively), but
-# anyhow it clears up some doubts too.
-
-# From Paul Eggert (2014-08-12):
-# The following data entries for Chile and America/Santiago are from
-# <http://www.horaoficial.cl/horaof.htm> (2006-09-20), transcribed by
-# Jesper Nørgaard Welen.  The data entries for Pacific/Easter are from Shanks
-# & Pottenger, except with DST transitions after 1932 cloned from
-# America/Santiago.  The pre-1980 Pacific/Easter data entries are dubious,
-# but we have no other source.
-
 # From Germán Poo-Caamaño (2008-03-03):
 # Due to drought, Chile extends Daylight Time in three weeks.  This
 # is one-time change (Saturday 3/29 at 24:00 for America/Santiago
 # and Saturday 3/29 at 22:00 for Pacific/Easter)
 # The Supreme Decree is located at
 # http://www.shoa.cl/servicios/supremo316.pdf
-# and the instructions for 2008 are located in:
-# http://www.horaoficial.cl/cambio.htm
-
+#
 # From José Miguel Garrido (2008-03-05):
-# ...
-# You could see the announces of the change on
 # http://www.shoa.cl/noticias/2008/04hora/hora.htm
 
 # From Angel Chiang (2010-03-04):
 # Subject: DST in Chile exceptionally extended to 3 April due to earthquake
 # http://www.gobiernodechile.cl/viewNoticia.aspx?idArticulo=30098
-# (in Spanish, last paragraph).
 #
-# This is breaking news. There should be more information available later.
-
 # From Arthur David Olson (2010-03-06):
 # Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch.
 
-# From Glenn Eychaner (2011-03-02):
-# It appears that the Chilean government has decided to postpone the
-# change from summer time to winter time again, by three weeks to April
-# 2nd:
-# http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
-#
-# This is not yet reflected in the official "cambio de hora" site, but
-# probably will be soon:
-# http://www.horaoficial.cl/cambio.htm
-
-# From Arthur David Olson (2011-03-02):
-# The emol.com article mentions a water shortage as the cause of the
-# postponement, which may mean that it's not a permanent change.
-
 # From Glenn Eychaner (2011-03-28):
-# The article:
 # http://diario.elmercurio.com/2011/03/28/_portada/_portada/noticias/7565897A-CA86-49E6-9E03-660B21A4883E.htm?id=3D{7565897A-CA86-49E6-9E03-660B21A4883E}
-#
 # In English:
 # Chile's clocks will go back an hour this year on the 7th of May instead
 # of this Saturday. They will go forward again the 3rd Saturday in
-# August, not in October as they have since 1968. This is a pilot plan
-# which will be reevaluated in 2012.
+# August, not in October as they have since 1968.
 
 # From Mauricio Parada (2012-02-22), translated by Glenn Eychaner (2012-02-23):
 # As stated in the website of the Chilean Energy Ministry
 # http://www.minenergia.cl/ministerio/noticias/generales/gobierno-anuncia-fechas-de-cambio-de.html
 # The Chilean Government has decided to postpone the entrance into winter time
-# (to leave DST) from March 11 2012 to April 28th 2012. The decision has not
-# been yet formalized but it will within the next days.
+# (to leave DST) from March 11 2012 to April 28th 2012....
 # Quote from the website communication:
 #
 # 6. For the year 2012, the dates of entry into winter time will be as follows:
@@ -1237,17 +1248,9 @@
 # From Paul Eggert (2015-03-03):
 # For now, assume that the extension will persist indefinitely.
 
-# NOTE: ChileAQ rules for Antarctic bases are stored separately in the
-# 'antarctica' file.
-
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
+Rule	Chile	1927	1931	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
-Rule	Chile	1942	only	-	Jun	 1	4:00u	0	-
-Rule	Chile	1942	only	-	Aug	 1	5:00u	1:00	S
-Rule	Chile	1946	only	-	Jul	15	4:00u	1:00	S
-Rule	Chile	1946	only	-	Sep	 1	3:00u	0:00	-
-Rule	Chile	1947	only	-	Apr	 1	4:00u	0	-
 Rule	Chile	1968	only	-	Nov	 3	4:00u	1:00	S
 Rule	Chile	1969	only	-	Mar	30	3:00u	0	-
 Rule	Chile	1969	only	-	Nov	23	4:00u	1:00	S
@@ -1258,10 +1261,8 @@
 Rule	Chile	1973	only	-	Sep	30	4:00u	1:00	S
 Rule	Chile	1974	1987	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	Chile	1987	only	-	Apr	12	3:00u	0	-
-Rule	Chile	1988	1989	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	1988	only	-	Oct	Sun>=1	4:00u	1:00	S
-Rule	Chile	1989	only	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	Chile	1990	only	-	Mar	18	3:00u	0	-
+Rule	Chile	1988	1990	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	1988	1989	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	Chile	1990	only	-	Sep	16	4:00u	1:00	S
 Rule	Chile	1991	1996	-	Mar	Sun>=9	3:00u	0	-
 Rule	Chile	1991	1997	-	Oct	Sun>=9	4:00u	1:00	S
@@ -1284,15 +1285,21 @@
 # (1996-09) says 1998-03-08.  Ignore these.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Santiago	-4:42:46 -	LMT	1890
-			-4:42:46 -	SMT	1910        # Santiago Mean Time
+			-4:42:46 -	SMT	1910 Jan 10 # Santiago Mean Time
 			-5:00	-	CLT	1916 Jul  1 # Chile Time
-			-4:42:46 -	SMT	1918 Sep  1 # Santiago Mean Time
-			-4:00	-	CLT	1919 Jul  1 # Chile Time
-			-4:42:46 -	SMT	1927 Sep  1 # Santiago Mean Time
-			-5:00	Chile	CL%sT	1947 May 22 # Chile Time
+			-4:42:46 -	SMT	1918 Sep 10
+			-4:00	-	CLT	1919 Jul  1
+			-4:42:46 -	SMT	1927 Sep  1
+			-5:00	Chile	CL%sT	1932 Sep  1
+			-4:00	-	CLT	1942 Jun  1
+			-5:00	-	CLT	1942 Aug  1
+			-4:00	-	CLT	1946 Jul 15
+			-4:00	1:00	CLST	1946 Sep  1 # central Chile
+			-4:00	-	CLT	1947 Apr  1
+			-5:00	-	CLT	1947 May 21 23:00
 			-4:00	Chile	CL%sT	2015 Apr 26  3:00u
 			-3:00	-	CLT
-Zone Pacific/Easter	-7:17:44 -	LMT	1890
+Zone Pacific/Easter	-7:17:28 -	LMT	1890
 			-7:17:28 -	EMT	1932 Sep    # Easter Mean Time
 			-7:00	Chile	EAS%sT	1982 Mar 14 3:00u # Easter Time
 			-6:00	Chile	EAS%sT	2015 Apr 26 3:00u
@@ -1302,6 +1309,25 @@
 # Other Chilean locations, including Juan Fernández Is, Desventuradas Is,
 # and Antarctic bases, are like America/Santiago.
 
+# Antarctic base using South American rules
+# (See the file 'antarctica' for more.)
+#
+# Palmer, Anvers Island, since 1965 (moved 2 miles in 1968)
+#
+# From Ethan Dicks (1996-10-06):
+# It keeps the same time as Punta Arenas, Chile, because, just like us
+# and the South Pole, that's the other end of their supply line....
+# I verified with someone who was there that since 1980,
+# Palmer has followed Chile.  Prior to that, before the Falklands War,
+# Palmer used to be supplied from Argentina.
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Antarctica/Palmer	0	-	zzz	1965
+			-4:00	Arg	AR%sT	1969 Oct  5
+			-3:00	Arg	AR%sT	1982 May
+			-4:00	Chile	CL%sT	2015 Apr 26 3:00u
+			-3:00	-	CLT
+
 # Colombia
 
 # Milne gives 4:56:16.4 for Bogotá time in 1899; round to nearest.  He writes,
--- a/make/gensrc/GensrcLocaleDataMetaInfo.gmk	Sat May 23 02:49:50 2015 +0300
+++ b/make/gensrc/GensrcLocaleDataMetaInfo.gmk	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, 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
@@ -34,7 +34,8 @@
     -name "TimeZoneNames_*.java" -o -name "TimeZoneNames_*.properties" -o \
     -name "LocaleNames_*.java" -o -name "LocaleNames_*.properties" -o \
     -name "CurrencyNames_*.java" -o -name "CurrencyNames_*.properties" -o \
-    -name "CalendarData_*.java" -o -name "CalendarData_*.properties")
+    -name "CalendarData_*.java" -o -name "CalendarData_*.properties" -o \
+    -name "BreakIteratorInfo_*.java" -o -name "BreakIteratorRules_*.java")
 
 # Then translate the locale files into for example: FormatData_sv
 LOCALE_RESOURCES := $(sort $(subst .properties,,$(subst .java,,$(notdir $(LOCALE_FILES)))))
@@ -79,6 +80,12 @@
 #sun.text.resources.CollationData
 $(eval $(call CaptureLocale,CollationData))
 
+#sun.text.resources.BreakIteratorInfo
+$(eval $(call CaptureLocale,BreakIteratorInfo))
+
+#sun.text.resources.BreakIteratorRules
+$(eval $(call CaptureLocale,BreakIteratorRules))
+
 #sun.util.resources.TimeZoneNames
 $(eval $(call CaptureLocale,TimeZoneNames))
 
--- a/make/gensrc/GensrcMisc.gmk	Sat May 23 02:49:50 2015 +0300
+++ b/make/gensrc/GensrcMisc.gmk	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, 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
@@ -174,11 +174,10 @@
 
 ##########################################################################################
 
-ifndef OPENJDK
   ifeq ($(OPENJDK_TARGET_OS), windows)
 
     AB_GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc_ab
-    AB_SRC_DIR := $(JDK_TOPDIR)/src/closed/windows/classes/com/sun/java/accessibility
+  AB_SRC_DIR := $(JDK_TOPDIR)/src/windows/classes/com/sun/java/accessibility
 
     ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
       $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridgeLoader.java: \
@@ -216,6 +215,5 @@
 
     endif
   endif
-endif
 
 ##########################################################################################
--- a/make/lib/Awt2dLibraries.gmk	Sat May 23 02:49:50 2015 +0300
+++ b/make/lib/Awt2dLibraries.gmk	Thu Jun 04 15:21:53 2015 -0700
@@ -319,7 +319,6 @@
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
   LIBAWT_FILES += awt_LoadLibrary.c
-  LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks
 endif
 
 ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
@@ -485,7 +484,6 @@
     LDFLAGS_SUFFIX_macosx := -lmlib_image -ljvm $(LIBM) \
         -framework Cocoa \
         -framework OpenGL \
-        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
         -framework JavaNativeFoundation \
         -framework JavaRuntimeSupport \
         -framework ApplicationServices \
@@ -827,8 +825,8 @@
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \
     LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
-    LDFLAGS_SUFFIX_solaris := -lawt -lawt_xawt -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
-    LDFLAGS_SUFFIX_aix := -lawt -lawt_xawt $(LIBM) $(LIBCXX) -ljava -ljvm,\
+    LDFLAGS_SUFFIX_solaris := -lawt -lawt_headless -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
+    LDFLAGS_SUFFIX_aix := -lawt -lawt_headless $(LIBM) $(LIBCXX) -ljava -ljvm,\
     LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \
         -ljava -ljvm, \
     LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
@@ -1120,12 +1118,6 @@
         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga \
         $(foreach dir, $(LIBAWT_HEADLESS_DIRS), -I$(dir))
 
-    ifeq ($(OPENJDK_TARGET_OS), macosx)
-      LIBAWT_HEADLESS_CFLAGS += \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
-    endif
-
     LIBAWT_HEADLESS_FILES := \
         awt_Font.c \
         HeadlessToolkit.c \
@@ -1217,8 +1209,7 @@
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
     LIBSPLASHSCREEN_CFLAGS := -I$(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen \
-        $(LIBSPLASHSCREEN_CFLAGS) \
-        -F/System/Library/Frameworks/JavaVM.framework/Frameworks
+        $(LIBSPLASHSCREEN_CFLAGS)
     LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
     LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp
 
@@ -1250,7 +1241,6 @@
         -framework ApplicationServices \
         -framework Foundation \
         -framework Cocoa \
-        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
         -framework JavaNativeFoundation
   else ifeq ($(OPENJDK_TARGET_OS), windows)
     LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll
@@ -1436,9 +1426,7 @@
           -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
           -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
           -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
-          -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
+          -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_SUFFIX_macosx := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
@@ -1449,7 +1437,6 @@
           -framework Cocoa \
           -framework Security \
           -framework ExceptionHandling \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
           -framework JavaNativeFoundation \
           -framework JavaRuntimeSupport \
           -framework OpenGL \
@@ -1482,8 +1469,7 @@
       CFLAGS := $(CFLAGS_JDKLIB) \
           -I$(JDK_TOPDIR)/src/macosx/native/com/apple/laf \
           -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
-          -I$(JDK_TOPDIR)/src/macosx/native/sun/awt \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks, \
+          -I$(JDK_TOPDIR)/src/macosx/native/sun/awt, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN) \
           -Xlinker -rpath -Xlinker @loader_path, \
@@ -1491,7 +1477,6 @@
           -framework Cocoa \
           -framework Carbon \
           -framework ApplicationServices \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
           -framework JavaNativeFoundation \
           -framework JavaRuntimeSupport \
           -ljava -ljvm, \
--- a/make/lib/PlatformLibraries.gmk	Sat May 23 02:49:50 2015 +0300
+++ b/make/lib/PlatformLibraries.gmk	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, 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
@@ -32,14 +32,11 @@
       LANG := C, \
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
-          -I$(JDK_TOPDIR)/src/macosx/native/apple/applescript \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
+          -I$(JDK_TOPDIR)/src/macosx/native/apple/applescript, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_SUFFIX := -framework Cocoa \
           -framework Carbon \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
           -framework JavaNativeFoundation \
           $(LDFLAGS_JDKLIB_SUFFIX), \
       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libAppleScriptEngine, \
@@ -63,9 +60,7 @@
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
-          -I$(JDK_OUTPUTDIR)/gensrc/sun/osxapp \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
+          -I$(JDK_OUTPUTDIR)/gensrc/sun/osxapp, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_SUFFIX_macosx := \
@@ -76,7 +71,6 @@
           -framework Cocoa \
           -framework Security \
           -framework ExceptionHandling \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
           -framework JavaNativeFoundation \
           -framework JavaRuntimeSupport \
           -framework OpenGL \
@@ -108,16 +102,13 @@
       OPTIMIZATION := LOW, \
       CFLAGS := $(CFLAGS_JDKLIB) \
           $(foreach dir, $(LIBOSX_DIRS), -I$(dir)) \
-          -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
-          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
+          -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LDFLAGS_SUFFIX_macosx := \
           -losxapp \
           -framework Cocoa \
           -framework ApplicationServices \
-          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
           -framework JavaNativeFoundation \
           -framework JavaRuntimeSupport \
           -framework Security \
@@ -136,10 +127,9 @@
 
 ##########################################################################################
 
-ifndef OPENJDK
   ifeq ($(OPENJDK_TARGET_OS), windows)
 
-    ACCESSBRIDGE_SRCDIR := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge
+  ACCESSBRIDGE_SRCDIR := $(JDK_TOPDIR)/src/windows/native/sun/bridge
 
     define SetupAccessBridge
       # Parameter 1 Suffix
@@ -158,8 +148,7 @@
           LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
               winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \
               ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
-              -subsystem:windows -machine:$2 \
-              -def:$(ACCESSBRIDGE_SRCDIR)/JAWTAccessBridge.DEF, \
+            -subsystem:windows -machine:$2, \
           VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
           RC_FLAGS := $(RC_FLAGS) \
               -D "JDK_FNAME=JAWTAccessBridge$1.dll" \
@@ -168,7 +157,8 @@
           OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawtaccessbridge$1, \
           DEBUG_SYMBOLS := true)
 
-      $$(BUILD_JAWTACCESSBRIDGE$1): $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
+    $$(BUILD_JAWTACCESSBRIDGE$1): \
+        $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
 
       $(call SetupNativeCompilation,BUILD_JAVAACCESSBRIDGE$1, \
           LIBRARY = JavaAccessBridge$1, \
@@ -184,8 +174,7 @@
           LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
               winspool.lib comdlg32.lib advapi32.lib shell32.lib \
               ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
-              -subsystem:windows -machine:$2 \
-              -def:$(ACCESSBRIDGE_SRCDIR)/JavaAccessBridge.DEF, \
+            -subsystem:windows -machine:$2, \
           VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
           RC_FLAGS := $(RC_FLAGS) \
               -D "JDK_FNAME=JavaAccessBridge$1.dll" \
@@ -230,5 +219,5 @@
     else
       $(eval $(call SetupAccessBridge,-64,X64,64))
     endif
+
   endif
-endif
--- a/make/mapfiles/libnet/mapfile-vers	Sat May 23 02:49:50 2015 +0300
+++ b/make/mapfiles/libnet/mapfile-vers	Thu Jun 04 15:21:53 2015 -0700
@@ -110,6 +110,8 @@
 		NET_Bind;
 		NET_MapSocketOption;
 		NET_Wait;
+		NET_EnableFastTcpLoopback;
+		NET_ThrowNew;
                 ipv6_available;
 
 	local:
--- a/make/profile-includes.txt	Sat May 23 02:49:50 2015 +0300
+++ b/make/profile-includes.txt	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2014, 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
@@ -22,38 +22,150 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
+
+# These lists define where a file belongs if it exists. It is perfectly fine
+# if a file does not exist on some platforms - we do not have to produce exact
+# per-platform lists. However, for clarity, platform-unique files are handled
+# in platform-specific conditionals.
+
+# On different platforms the libraries are placed into different locations in the
+# JRE:
+ifeq (, $(findstring $(OPENJDK_TARGET_OS), windows macosx))
+    # On non-windows/OSX libraries go into jre/lib/<arch>
+    LIBS_PREFIX := $(OPENJDK_TARGET_CPU_LEGACY_LIB)/
+else
+    # On OSX they go into jre/lib/ - on Windows they go into jre/bin/ and we won't use this
+    LIBS_PREFIX :=
+endif
+
+# Debug info files are tricky to deal with due to all the different platform variants
+# and because they can be zipped.
+ifeq ($(ZIP_DEBUGINFO_FILES), true)
+    # Common case and 'just works' on all platforms
+    DEBUG_SUFFIX := .diz
+else
+    # It gets complicated ...
+    ifeq ($(OPENJDK_TARGET_OS), macosx)
+        # This is a directory, not a simple file, so
+        # it needs expanding explicitly later on
+        DEBUG_SUFFIX := $(SHARED_LIBRARY_SUFFIX).dSYM
+    else
+        ifeq ($(OPENJDK_TARGET_OS), windows)
+            DEBUG_SUFFIX := .map .pdb
+        else
+            DEBUG_SUFFIX := .debuginfo
+        endif
+    endif
+endif
+
+# Expand the contents of the .dSYM directories on macosx.
+# Param 1 - debug files list eg libFoo.dylib.dSYM or libFoo.diz (if zipped)
+# Param 2 - libraries list eg Foo
+# On macosx if not zipping debuginfo files we expand the contents of the .dSYM directories,
+# else we return the original list of .diz files.
+# On other OS we return the original list of debuginfo files (whether zipped or not)
+#
+define expand-debuginfo
+  $(if $(and $(filter-out true, $(ZIP_DEBUGINFO_FILES)), $(filter macosx, $(OPENJDK_TARGET_OS))), \
+      $(foreach i, $1, $(addsuffix /Contents/Info.plist, $i)) \
+          $(foreach i, $2, $(addsuffix /Contents/Resources/DWARF/$i, $(filter $i.%, $1))), \
+      $1)
+endef
+
+# Common executable files
 PROFILE_1_JRE_BIN_FILES := \
     java$(EXE_SUFFIX) \
     keytool$(EXE_SUFFIX)
 
-PROFILE_1_JRE_LIB_FILES := \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)j2pkcs11$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsig.diz \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)net$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)nio$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)sunec$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)verify$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)verify.diz \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)zip$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/client/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/client/$(LIBRARY_PREFIX)jsig.diz \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/client/$(LIBRARY_PREFIX)jvm$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/client/$(LIBRARY_PREFIX)jvm.diz \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/client/Xusage.txt \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/jli/$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/jvm.cfg \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/minimal/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/minimal/$(LIBRARY_PREFIX)jsig.diz \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/minimal/$(LIBRARY_PREFIX)jvm$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/minimal/$(LIBRARY_PREFIX)jvm.diz \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/minimal/Xusage.txt \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/$(LIBRARY_PREFIX)jsig.diz \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/$(LIBRARY_PREFIX)jvm$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/$(LIBRARY_PREFIX)jvm.diz \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/server/Xusage.txt \
+ifeq ($(OPENJDK_TARGET_OS), windows)
+    PROFILE_1_JRE_BIN_FILES += javaw$(EXE_SUFFIX)
+endif
+
+PROFILE_1_LIBRARIES := \
+    j2pkcs11 \
+    java  \
+    jsig \
+    net \
+    nio \
+    sunec \
+    verify \
+    zip
+
+ifeq ($(OPENJDK_TARGET_OS), windows)
+    PROFILE_1_LIBRARIES += msvcrt100
+endif
+
+PROFILE_1_LIBRARIES := $(addprefix $(LIBRARY_PREFIX), $(PROFILE_1_LIBRARIES))
+PROFILE_1_DEBUG_FILES := $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(PROFILE_1_LIBRARIES)))
+PROFILE_1_LIBRARIES := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(PROFILE_1_LIBRARIES))
+PROFILE_1_DEBUG_FILES := $(call expand-debuginfo, $(PROFILE_1_DEBUG_FILES), $(PROFILE_1_LIBRARIES))
+PROFILE_1_LIBRARIES += $(PROFILE_1_DEBUG_FILES)
+
+# Note: libjsig exists as both the real file and a symlink in the VM directory
+#       so we have to treat it with care when looking for the debuginfo files
+VM_LIBRARIES := \
+    jvm 
+
+ifeq ($(OPENJDK_TARGET_OS), solaris)
+    VM_LIBRARIES += jvm_db jvm_dtrace
+endif
+
+VM_SYMLINKS := \
+    jsig
+
+VM_LIBRARIES := $(addprefix $(LIBRARY_PREFIX), $(VM_LIBRARIES))
+VM_DEBUG_FILES := $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(VM_LIBRARIES)))
+VM_SYMLINKS := $(addprefix $(LIBRARY_PREFIX), $(VM_SYMLINKS))
+VM_LIBRARIES := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(VM_LIBRARIES))
+VM_DEBUG_FILES := $(call expand-debuginfo, $(VM_DEBUG_FILES), $(VM_LIBRARIES))
+VM_DEBUG_FILES +=  $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(VM_SYMLINKS)))
+VM_SYMLINKS := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(VM_SYMLINKS))
+VM_LIBRARIES += $(VM_SYMLINKS)
+
+VM_FILES := \
+    Xusage.txt
+
+VM_DIRS := client server minimal
+
+VM_FILES := $(foreach i, $(VM_DIRS), $(addprefix $i/, $(VM_LIBRARIES) $(VM_FILES) $(VM_DEBUG_FILES)))
+
+JLI_LIBRARIES := \
+    jli
+
+ifneq ($(OPENJDK_TARGET_OS), windows)
+    JLI_SUBDIR := jli/
+else
+    JLI_SUBDIR :=
+endif
+
+JLI_LIBRARIES := $(addprefix $(JLI_SUBDIR)$(LIBRARY_PREFIX), $(JLI_LIBRARIES))
+JLI_DEBUG_FILES := $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(JLI_LIBRARIES)))
+JLI_LIBRARIES := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(JLI_LIBRARIES))
+JLI_DEBUG_FILES := $(call expand-debuginfo, $(JLI_DEBUG_FILES), $(JLI_LIBRARIES))
+JLI_LIBRARIES += $(JLI_DEBUG_FILES)
+
+ifneq ($(OPENJDK_TARGET_OS), windows)
+    PROFILE_1_JRE_LIB_FILES := \
+        $(addprefix $(LIBS_PREFIX), $(PROFILE_1_LIBRARIES) $(VM_FILES) $(JLI_LIBRARIES))
+else
+    # On windows libraries go into jre/bin
+    PROFILE_1_JRE_BIN_FILES += $(PROFILE_1_LIBRARIES) $(VM_FILES) $(JLI_LIBRARIES)
+endif
+
+# Remaining jre/lib contents
+# OSX doesn't use <arch> directory
+#
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+    PROFILE_1_JRE_LIB_FILES += \
+        jvm.cfg \
+        jspawnhelper
+else
+    PROFILE_1_JRE_LIB_FILES += \
+        $(OPENJDK_TARGET_CPU_LEGACY_LIB)/jvm.cfg \
+        $(OPENJDK_TARGET_CPU_LEGACY_LIB)/jspawnhelper
+endif
+
+PROFILE_1_JRE_LIB_FILES += \
     calendars.properties \
     classlist \
     content-types.properties \
@@ -81,6 +193,14 @@
     security/trusted.libraries \
     tzdb.dat
 
+ifeq ($(OPENJDK_TARGET_OS), windows)
+    PROFILE_1_JRE_LIB_FILES += tzmappings
+else
+    ifeq ($(OPENJDK_TARGET_OS), solaris)
+        PROFILE_1_JRE_LIB_FILES += sdp/sdp.conf
+    endif
+endif
+
 PROFILE_1_JRE_OTHER_FILES := \
     COPYRIGHT \
     LICENSE \
@@ -106,32 +226,63 @@
     rmid$(EXE_SUFFIX) \
     rmiregistry$(EXE_SUFFIX)
 
+ifeq ($(OPENJDK_TARGET_OS), windows)
+    PROFILE_2_JRE_BIN_FILES += java-rmi$(EXE_SUFFIX)
+endif
+
+# If you add libraries here, make sure you use the same techniques
+# as used for the other profile's libraries regarding debug files etc
 PROFILE_2_JRE_LIB_FILES :=
 
 PROFILE_2_JRE_OTHER_FILES :=
 
 PROFILE_2_JRE_JAR_FILES :=
 
+ifeq ($(OPENJDK_TARGET_OS), windows)
+    PROFILE_3_JRE_BIN_FILES := \
+        kinit$(EXE_SUFFIX) \
+        klist$(EXE_SUFFIX) \
+        ktab$(EXE_SUFFIX)
+else
+    PROFILE_3_JRE_BIN_FILES :=
+endif
 
-PROFILE_3_JRE_BIN_FILES :=
+PROFILE_3_LIBRARIES := \
+    hprof \
+    instrument \
+    j2gss \
+    j2pcsc \
+    jaas_unix \
+    jaas_nt \
+    java_crw_demo \
+    jsdt \
+    management \
+    npt \
+    sctp
 
-PROFILE_3_JRE_LIB_FILES := \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)hprof$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)hprof.diz \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)instrument$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)instrument.diz \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)j2gss$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)j2pcsc$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jaas_unix$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)java_crw_demo$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)java_crw_demo.diz \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsdt$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsdt.diz \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)management$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)management.diz \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)npt$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)npt.diz \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)sctp$(SHARED_LIBRARY_SUFFIX) \
+ifeq ($(OPENJDK_TARGET_OS), windows)
+    PROFILE_3_LIBRARIES += w2k_lsa_auth
+else
+    ifeq ($(OPENJDK_TARGET_OS), macosx)
+        PROFILE_3_LIBRARIES += osxkrb5
+    endif
+endif
+
+PROFILE_3_LIBRARIES := $(addprefix $(LIBRARY_PREFIX), $(PROFILE_3_LIBRARIES))
+PROFILE_3_DEBUG_FILES := $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(PROFILE_3_LIBRARIES)))
+PROFILE_3_LIBRARIES := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(PROFILE_3_LIBRARIES))
+PROFILE_3_DEBUG_FILES := $(call expand-debuginfo, $(PROFILE_3_DEBUG_FILES), $(PROFILE_3_LIBRARIES))
+PROFILE_3_LIBRARIES += $(PROFILE_3_DEBUG_FILES)
+
+ifneq ($(OPENJDK_TARGET_OS), windows)
+    PROFILE_3_JRE_LIB_FILES := \
+        $(addprefix $(LIBS_PREFIX), $(PROFILE_3_LIBRARIES))
+else
+    # On windows libraries go into jre/bin
+    PROFILE_3_JRE_BIN_FILES += $(PROFILE_3_LIBRARIES)
+endif
+
+PROFILE_3_JRE_LIB_FILES += \
     jvm.hprof.txt \
     management-agent.jar \
     management/jmxremote.access \
@@ -153,25 +304,40 @@
     tnameserv$(EXE_SUFFIX) \
     unpack200$(EXE_SUFFIX)
 
-FULL_JRE_LIB_FILES := \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)awt$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)awt_xawt$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)dcpr$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)dt_socket$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)dt_socket.diz \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)fontmanager$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jdwp$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jfr$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jpeg$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsound$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsoundalsa$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)kcms$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)mlib_image$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)splashscreen$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)t2k$(SHARED_LIBRARY_SUFFIX) \
-    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX) \
+JRE_LIBRARIES := \
+    awt \
+    awt_headless \
+    awt_xawt \
+    dcpr \
+    dt_socket \
+    fontmanager \
+    jawt \
+    jdwp \
+    jfr \
+    jpeg \
+    jsound \
+    jsoundalsa \
+    kcms \
+    mlib_image \
+    splashscreen \
+    t2k \
+    unpack
+
+JRE_LIBRARIES := $(addprefix $(LIBRARY_PREFIX), $(JRE_LIBRARIES))
+JRE_DEBUG_FILES := $(foreach i, $(DEBUG_SUFFIX), $(addsuffix $i, $(JRE_LIBRARIES)))
+JRE_LIBRARIES := $(addsuffix $(SHARED_LIBRARY_SUFFIX), $(JRE_LIBRARIES))
+JRE_DEBUG_FILES := $(call expand-debuginfo, $(JRE_DEBUG_FILES), $(JRE_LIBRARIES))
+JRE_LIBRARIES += $(JRE_DEBUG_FILES)
+
+ifneq ($(OPENJDK_TARGET_OS), windows)
+    FULL_JRE_LIB_FILES := \
+        $(addprefix $(LIBS_PREFIX), $(JRE_LIBRARIES))
+else
+    # On windows libraries go into jre/bin
+    FULL_JRE_BIN_FILES += $(JRE_LIBRARIES)
+endif
+
+FULL_JRE_LIB_FILES += \
     charsets.jar \
     cmm/CIEXYZ.pf \
     cmm/GRAY.pf \
@@ -254,3 +420,4 @@
     ext/nashorn.jar \
     ext/zipfs.jar \
     jfr.jar
+
--- a/make/profile-rtjar-includes.txt	Sat May 23 02:49:50 2015 +0300
+++ b/make/profile-rtjar-includes.txt	Thu Jun 04 15:21:53 2015 -0700
@@ -162,6 +162,8 @@
     javax/management/remote/rmi/_RMIServer_Stub.class
 
 FULL_JRE_RTJAR_INCLUDE_PACKAGES := \
+    apple \
+    com/apple \
     com/oracle \
     com/sun/accessibility/internal/resources \
     com/sun/activation/registries \
@@ -213,6 +215,7 @@
     sun/dc \
     sun/font \
     sun/java2d \
+    sun/lwawt \
     sun/net/ftp \
     sun/net/smtp \
     sun/net/www/content/audio \
--- a/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java	Sat May 23 02:49:50 2015 +0300
+++ b/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -72,10 +72,6 @@
     private static String formatVersion;
     private static String dataVersion;
     private static String validCurrencyCodes;
-    private static String currenciesWith0MinorUnitDecimals;
-    private static String currenciesWith1MinorUnitDecimal;
-    private static String currenciesWith3MinorUnitDecimal;
-    private static String currenciesWithMinorUnitsUndefined;
 
     // handy constants - must match definitions in java.util.Currency
     // magic number
@@ -83,29 +79,31 @@
     // number of characters from A to Z
     private static final int A_TO_Z = ('Z' - 'A') + 1;
     // entry for invalid country codes
-    private static final int INVALID_COUNTRY_ENTRY = 0x007F;
+    private static final int INVALID_COUNTRY_ENTRY = 0x0000007F;
     // entry for countries without currency
-    private static final int COUNTRY_WITHOUT_CURRENCY_ENTRY = 0x0080;
+    private static final int COUNTRY_WITHOUT_CURRENCY_ENTRY = 0x00000200;
     // mask for simple case country entries
-    private static final int SIMPLE_CASE_COUNTRY_MASK = 0x0000;
+    private static final int SIMPLE_CASE_COUNTRY_MASK = 0x00000000;
     // mask for simple case country entry final character
-    private static final int SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK = 0x001F;
+    private static final int SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK = 0x0000001F;
     // mask for simple case country entry default currency digits
-    private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_MASK = 0x0060;
+    private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_MASK = 0x000001E0;
     // shift count for simple case country entry default currency digits
     private static final int SIMPLE_CASE_COUNTRY_DEFAULT_DIGITS_SHIFT = 5;
+    // maximum number for simple case country entry default currency digits
+    private static final int SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS = 9;
     // mask for special case country entries
-    private static final int SPECIAL_CASE_COUNTRY_MASK = 0x0080;
+    private static final int SPECIAL_CASE_COUNTRY_MASK = 0x00000200;
     // mask for special case country index
-    private static final int SPECIAL_CASE_COUNTRY_INDEX_MASK = 0x001F;
+    private static final int SPECIAL_CASE_COUNTRY_INDEX_MASK = 0x0000001F;
     // delta from entry index component in main table to index into special case tables
     private static final int SPECIAL_CASE_COUNTRY_INDEX_DELTA = 1;
     // mask for distinguishing simple and special case countries
     private static final int COUNTRY_TYPE_MASK = SIMPLE_CASE_COUNTRY_MASK | SPECIAL_CASE_COUNTRY_MASK;
     // mask for the numeric code of the currency
-    private static final int NUMERIC_CODE_MASK = 0x0003FF00;
+    private static final int NUMERIC_CODE_MASK = 0x000FFC00;
     // shift count for the numeric code of the currency
-    private static final int NUMERIC_CODE_SHIFT = 8;
+    private static final int NUMERIC_CODE_SHIFT = 10;
 
     // generated data
     private static int[] mainTable = new int[A_TO_Z * A_TO_Z];
@@ -120,7 +118,7 @@
     private static int[] specialCaseOldCurrenciesNumericCode = new int[maxSpecialCases];
     private static int[] specialCaseNewCurrenciesNumericCode = new int[maxSpecialCases];
 
-    private static final int maxOtherCurrencies = 70;
+    private static final int maxOtherCurrencies = 128;
     private static int otherCurrenciesCount = 0;
     private static StringBuffer otherCurrencies = new StringBuffer();
     private static int[] otherCurrenciesDefaultFractionDigits = new int[maxOtherCurrencies];
@@ -129,6 +127,11 @@
     // date format for parsing cut-over times
     private static SimpleDateFormat format;
 
+    // Minor Units
+    private static String[] currenciesWithDefinedMinorUnitDecimals =
+        new String[SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS + 1];
+    private static String currenciesWithMinorUnitsUndefined;
+
     public static void main(String[] args) {
 
         // Look for "-o outputfilename" option
@@ -171,16 +174,14 @@
         formatVersion = (String) currencyData.get("formatVersion");
         dataVersion = (String) currencyData.get("dataVersion");
         validCurrencyCodes = (String) currencyData.get("all");
-        currenciesWith0MinorUnitDecimals  = (String) currencyData.get("minor0");
-        currenciesWith1MinorUnitDecimal  = (String) currencyData.get("minor1");
-        currenciesWith3MinorUnitDecimal  = (String) currencyData.get("minor3");
+        for (int i = 0; i <= SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS; i++) {
+            currenciesWithDefinedMinorUnitDecimals[i]
+                = (String) currencyData.get("minor"+i);
+        }
         currenciesWithMinorUnitsUndefined  = (String) currencyData.get("minorUndefined");
         if (formatVersion == null ||
                 dataVersion == null ||
                 validCurrencyCodes == null ||
-                currenciesWith0MinorUnitDecimals == null ||
-                currenciesWith1MinorUnitDecimal == null ||
-                currenciesWith3MinorUnitDecimal == null ||
                 currenciesWithMinorUnitsUndefined == null) {
             throw new NullPointerException("not all required data is defined in input");
         }
@@ -207,7 +208,7 @@
                         if (currencyInfo.charAt(0) == firstChar && currencyInfo.charAt(1) == secondChar) {
                             checkCurrencyCode(currencyInfo);
                             int digits = getDefaultFractionDigits(currencyInfo);
-                            if (digits < 0 || digits > 3) {
+                            if (digits < 0 || digits > SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS) {
                                 throw new RuntimeException("fraction digits out of range for " + currencyInfo);
                             }
                             int numericCode= getNumericCode(currencyInfo);
@@ -231,13 +232,14 @@
     }
 
     private static int getDefaultFractionDigits(String currencyCode) {
-        if (currenciesWith0MinorUnitDecimals.indexOf(currencyCode) != -1) {
-            return 0;
-        } else if (currenciesWith1MinorUnitDecimal.indexOf(currencyCode) != -1) {
-            return 1;
-        } else if (currenciesWith3MinorUnitDecimal.indexOf(currencyCode) != -1) {
-            return 3;
-        } else if (currenciesWithMinorUnitsUndefined.indexOf(currencyCode) != -1) {
+        for (int i = 0; i <= SIMPLE_CASE_COUNTRY_MAX_DEFAULT_DIGITS; i++) {
+            if (currenciesWithDefinedMinorUnitDecimals[i] != null &&
+                currenciesWithDefinedMinorUnitDecimals[i].indexOf(currencyCode) != -1) {
+                return i;
+            }
+        }
+
+        if (currenciesWithMinorUnitsUndefined.indexOf(currencyCode) != -1) {
             return -1;
         } else {
             return 2;
--- a/make/src/classes/build/tools/tzdb/ZoneRulesBuilder.java	Sat May 23 02:49:50 2015 +0300
+++ b/make/src/classes/build/tools/tzdb/ZoneRulesBuilder.java	Thu Jun 04 15:21:53 2015 -0700
@@ -491,10 +491,10 @@
                 TZRule rule = new TZRule(year, month, dayOfMonthIndicator, dayOfWeek, time, timeEndOfDay, timeDefinition, savingAmountSecs);
                 if (lastRule) {
                     lastRuleList.add(rule);
-                    maxLastRuleStartYear = Math.max(startYear, maxLastRuleStartYear);
                 } else {
                     ruleList.add(rule);
                 }
+                maxLastRuleStartYear = Math.max(startYear, maxLastRuleStartYear);
                 year++;
             }
         }
--- a/src/aix/classes/sun/nio/fs/AixNativeDispatcher.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/aix/classes/sun/nio/fs/AixNativeDispatcher.java	Thu Jun 04 15:21:53 2015 -0700
@@ -43,7 +43,7 @@
     static native UnixMountEntry[] getmntctl() throws UnixException;
 
     // initialize
-    private static native int init();
+    private static native void init();
 
     static {
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
--- a/src/aix/classes/sun/tools/attach/AixVirtualMachine.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/aix/classes/sun/tools/attach/AixVirtualMachine.java	Thu Jun 04 15:21:53 2015 -0700
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2013 SAP AG. All rights reserved.
+ * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2015 SAP AG. 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,14 +25,14 @@
  */
 package sun.tools.attach;
 
-import com.sun.tools.attach.VirtualMachine;
+import com.sun.tools.attach.AttachOperationFailedException;
 import com.sun.tools.attach.AgentLoadException;
 import com.sun.tools.attach.AttachNotSupportedException;
 import com.sun.tools.attach.spi.AttachProvider;
+
 import java.io.InputStream;
 import java.io.IOException;
 import java.io.File;
-import java.util.Properties;
 
 // Based on 'LinuxVirtualMachine.java'. All occurrences of the string
 // "Linux" have been textually replaced by "Aix" to avoid confusion.
@@ -192,6 +192,8 @@
         }
 
         if (completionStatus != 0) {
+            // read from the stream and use that as the error message
+            String message = readErrorMessage(sis);
             sis.close();
 
             // In the event of a protocol mismatch then the target VM
@@ -206,7 +208,11 @@
             if (cmd.equals("load")) {
                 throw new AgentLoadException("Failed to load agent library");
             } else {
-                throw new IOException("Command failed in target VM");
+                if (message == null) {
+                    throw new AttachOperationFailedException("Command failed in target VM");
+                } else {
+                    throw new AttachOperationFailedException(message);
+                }
             }
         }
 
--- a/src/aix/native/sun/nio/fs/AixNativeDispatcher.c	Sat May 23 02:49:50 2015 +0300
+++ b/src/aix/native/sun/nio/fs/AixNativeDispatcher.c	Thu Jun 04 15:21:53 2015 -0700
@@ -56,23 +56,26 @@
 /**
  * Initialization
  */
-JNIEXPORT jint JNICALL
+JNIEXPORT void JNICALL
 Java_sun_nio_fs_AixNativeDispatcher_init(JNIEnv* env, jclass this)
 {
-    jint flags = 0;
     jclass clazz;
 
     clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
-    if (clazz == NULL) {
-        return 0;
+    CHECK_NULL(clazz);
+    entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
+    CHECK_NULL(entry_name);
+    entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
+    CHECK_NULL(entry_dir);
+    entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
+    CHECK_NULL(entry_fstype);
+    entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
+    CHECK_NULL(entry_options);
+    entry_cls = (*env)->NewGlobalRef(env, clazz);
+    if (entry_cls == NULL) {
+        JNU_ThrowOutOfMemoryError(env, NULL);
+        return;
     }
-    entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
-    entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
-    entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
-    entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
-    entry_cls = (*env)->NewGlobalRef(env, clazz);
-
-    return 0;
 }
 
 /**
--- a/src/aix/native/sun/tools/attach/AixVirtualMachine.c	Sat May 23 02:49:50 2015 +0300
+++ b/src/aix/native/sun/tools/attach/AixVirtualMachine.c	Thu Jun 04 15:21:53 2015 -0700
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2013 SAP AG. All rights reserved.
+ * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2015 SAP AG. 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
@@ -238,14 +238,14 @@
         len = remaining;
     }
 
-    RESTARTABLE(read(fd, buf+off, len), n);
+    RESTARTABLE(read(fd, buf, len), n);
     if (n == -1) {
         JNU_ThrowIOExceptionWithLastError(env, "read");
     } else {
         if (n == 0) {
             n = -1;     // EOF
         } else {
-            (*env)->SetByteArrayRegion(env, ba, off, (jint)n, (jbyte *)(buf+off));
+            (*env)->SetByteArrayRegion(env, ba, off, (jint)n, (jbyte *)(buf));
         }
     }
     return n;
--- a/src/macosx/classes/apple/security/KeychainStore.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/apple/security/KeychainStore.java	Thu Jun 04 15:21:53 2015 -0700
@@ -140,7 +140,8 @@
      * password to recover it.
      *
      * @param alias the alias name
-     * @param password the password for recovering the key
+     * @param password the password for recovering the key. This password is
+     *        used internally as the key is exported in a PKCS12 format.
      *
      * @return the requested key, or null if the given alias does not exist
      * or does not identify a <i>key entry</i>.
@@ -155,6 +156,20 @@
     {
         permissionCheck();
 
+        // An empty password is rejected by MacOS API, no private key data
+        // is exported. If no password is passed (as is the case when
+        // this implementation is used as browser keystore in various
+        // deployment scenarios like Webstart, JFX and applets), create
+        // a dummy password so MacOS API is happy.
+        if (password == null || password.length == 0) {
+            // Must not be a char array with only a 0, as this is an empty
+            // string.
+            if (random == null) {
+                random = new SecureRandom();
+            }
+            password = Long.toString(random.nextLong()).toCharArray();
+        }
+
         Object entry = entries.get(alias.toLowerCase());
 
         if (entry == null || !(entry instanceof KeyEntry)) {
--- a/src/macosx/classes/com/apple/laf/AquaBorder.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/com/apple/laf/AquaBorder.java	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, 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
@@ -68,8 +68,9 @@
         painter.state.set(size);
     }
 
+    @Override
     public Insets getBorderInsets(final Component c) {
-        return sizeVariant.margins;
+        return (Insets) sizeVariant.margins.clone();
     }
 
     protected AquaBorder deriveBorderForSize(final Size size) {
@@ -130,8 +131,10 @@
         return (focusable != null && focusable instanceof JComponent && ((JComponent)focusable).hasFocus());
     }
 
+    @Override
     public boolean isBorderOpaque() { return false; }
 
+    @Override
     public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int w, final int h) {
         painter.paint(g, c, x, y, w, h);
     }
--- a/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Thu Jun 04 15:21:53 2015 -0700
@@ -152,20 +152,6 @@
         }
 
         @Override
-        public void focusGained(final FocusEvent e) {
-            if (arrowButton != null) {
-                arrowButton.repaint();
-            }
-        }
-
-        @Override
-        public void focusLost(final FocusEvent e) {
-            if (arrowButton != null) {
-                arrowButton.repaint();
-            }
-        }
-
-        @Override
         public void changedUpdate(final DocumentEvent e) {
             editorTextChanged();
         }
@@ -250,6 +236,16 @@
      */
     protected FocusListener createFocusListener() {
         return new BasicComboBoxUI.FocusHandler() {
+            @Override
+            public void focusGained(FocusEvent e) {
+                super.focusGained(e);
+
+                if (arrowButton != null) {
+                    arrowButton.repaint();
+                }
+            }
+
+            @Override
             public void focusLost(final FocusEvent e) {
                 hasFocus = false;
                 if (!e.isTemporary()) {
@@ -262,6 +258,10 @@
                 if (ac != null) {
                     ac.firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.FOCUSED, null);
                 }
+
+                if (arrowButton != null) {
+                    arrowButton.repaint();
+                }
             }
         };
     }
@@ -273,7 +273,7 @@
 
         actionMap.put("aquaSelectNext", highlightNextAction);
         actionMap.put("aquaSelectPrevious", highlightPreviousAction);
-        actionMap.put("aquaEnterPressed", triggerSelectionAction);
+        actionMap.put("enterPressed", triggerSelectionAction);
         actionMap.put("aquaSpacePressed", toggleSelectionAction);
 
         actionMap.put("aquaSelectHome", highlightFirstAction);
@@ -429,6 +429,7 @@
             if (editor != null) {
                 final Rectangle editorRect = rectangleForCurrentValue();
                 editorRect.width += 4;
+                editorRect.height += 1;
                 editor.setBounds(editorRect);
             }
         }
--- a/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, 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
@@ -1089,8 +1089,15 @@
             super(f);
         }
 
-        public Component getTableCellRendererComponent(final JTable list, final Object value, final boolean isSelected, final boolean cellHasFocus, final int index, final int col) {
-            super.getTableCellRendererComponent(list, value, isSelected, false, index, col); // No focus border, thanks
+        public Component getTableCellRendererComponent(final JTable list,
+                                                       final Object value,
+                                                       final boolean isSelected,
+                                                       final boolean cellHasFocus,
+                                                       final int index,
+                                                       final int col) {
+            super.getTableCellRendererComponent(list, value, isSelected, false,
+                                                index,
+                                                col); // No focus border, thanks
             final File file = (File)value;
             final JFileChooser fc = getFileChooser();
             setText(fc.getName(file));
@@ -1105,8 +1112,14 @@
             super(f);
         }
 
-        public Component getTableCellRendererComponent(final JTable list, final Object value, final boolean isSelected, final boolean cellHasFocus, final int index, final int col) {
-            super.getTableCellRendererComponent(list, value, isSelected, false, index, col);
+        public Component getTableCellRendererComponent(final JTable list,
+                                                       final Object value,
+                                                       final boolean isSelected,
+                                                       final boolean cellHasFocus,
+                                                       final int index,
+                                                       final int col) {
+            super.getTableCellRendererComponent(list, value, isSelected, false,
+                                                index, col);
             final File file = (File)fFileList.getValueAt(index, 0);
             setEnabled(isSelectableInList(file));
             final DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.SHORT);
@@ -1122,14 +1135,17 @@
         }
     }
 
+    @Override
     public Dimension getPreferredSize(final JComponent c) {
-        return PREF_SIZE;
+        return new Dimension(PREF_WIDTH, PREF_HEIGHT);
     }
 
+    @Override
     public Dimension getMinimumSize(final JComponent c) {
-        return MIN_SIZE;
+        return new Dimension(MIN_WIDTH, MIN_HEIGHT);
     }
 
+    @Override
     public Dimension getMaximumSize(final JComponent c) {
         return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
     }
@@ -1793,12 +1809,8 @@
 
     private static final int PREF_WIDTH = 550;
     private static final int PREF_HEIGHT = 400;
-    private static final Dimension PREF_SIZE = new Dimension(PREF_WIDTH, PREF_HEIGHT);
-
     private static final int MIN_WIDTH = 400;
     private static final int MIN_HEIGHT = 250;
-    private static final Dimension MIN_SIZE = new Dimension(MIN_WIDTH, MIN_HEIGHT);
-
     private static final int LIST_MIN_WIDTH = 400;
     private static final int LIST_MIN_HEIGHT = 100;
     private static final Dimension LIST_MIN_SIZE = new Dimension(LIST_MIN_WIDTH, LIST_MIN_HEIGHT);
--- a/src/macosx/classes/com/apple/laf/AquaIcon.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/com/apple/laf/AquaIcon.java	Thu Jun 04 15:21:53 2015 -0700
@@ -195,7 +195,7 @@
                     AquaPainter.create(JRSUIState.getInstance());
             initIconPainter(painter);
 
-            g.setClip(new Rectangle(x, y, width, height));
+            g.clipRect(x, y, width, height);
             painter.paint(g, c, x, y, width, height);
             g.dispose();
         }
--- a/src/macosx/classes/com/apple/laf/AquaKeyBindings.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/com/apple/laf/AquaKeyBindings.java	Thu Jun 04 15:21:53 2015 -0700
@@ -214,7 +214,7 @@
             "PAGE_DOWN", "aquaSelectPageDown",
             "HOME", "aquaSelectHome",
             "END", "aquaSelectEnd",
-            "ENTER", "aquaEnterPressed",
+            "ENTER", "enterPressed",
             "UP", "aquaSelectPrevious",
             "KP_UP", "aquaSelectPrevious",
             "DOWN", "aquaSelectNext",
--- a/src/macosx/classes/com/apple/laf/AquaMenuBarBorder.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/com/apple/laf/AquaMenuBarBorder.java	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, 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,46 +25,33 @@
 
 package com.apple.laf;
 
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Insets;
 
 import javax.swing.border.Border;
 
+import sun.swing.SwingUtilities2;
+
+/**
+ * The class represents the border of a {@code JMenuBar}.
+ */
 public class AquaMenuBarBorder implements Border {
-    public AquaMenuBarBorder() {
-        super();
+
+    @Override
+    public void paintBorder(final Component c, final Graphics g, final int x,
+                            final int y, final int width, final int height) {
+        g.setColor(Color.gray);
+        SwingUtilities2.drawHLine(g, x, x + width - 1, y + height - 1);
     }
 
-    /**
-     * Paints the border for the specified component with the specified
-     * position and size.
-     * @param c the component for which this border is being painted
-     * @param g the paint graphics
-     * @param x the x position of the painted border
-     * @param y the y position of the painted border
-     * @param width the width of the painted border
-     * @param height the height of the painted border
-     */
-    public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int width, final int height) {
-        // for now we don't paint a border. We let the button paint it since there
-        // needs to be a strict ordering for aqua components.
-        //paintButton(c, g, x, y, width, height);
-        g.setColor(Color.gray);
-        g.drawLine(x, y + height - 1, x + width, y + height - 1);
-    }
-
-    /**
-     * Returns the insets of the border.
-     * @param c the component for which this border insets value applies
-     */
+    @Override
     public Insets getBorderInsets(final Component c) {
         return new Insets(0, 0, 1, 0);
     }
 
-    /**
-     * Returns whether or not the border is opaque.  If the border
-     * is opaque, it is responsible for filling in it's own
-     * background when painting.
-     */
+    @Override
     public boolean isBorderOpaque() {
         return false;
     }
--- a/src/macosx/classes/com/apple/laf/AquaMenuUI.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/com/apple/laf/AquaMenuUI.java	Thu Jun 04 15:21:53 2015 -0700
@@ -148,11 +148,15 @@
 
             // In Aqua, we always have a menu delay, regardless of where the menu is.
             if (!(selectedPath.length > 0 && selectedPath[selectedPath.length - 1] == menu.getPopupMenu())) {
-                if (menu.getDelay() == 0) {
-                    appendPath(getPath(), menu.getPopupMenu());
-                } else {
-                    manager.setSelectedPath(getPath());
-                    setupPostTimer(menu);
+                // the condition below prevents from activating menu in other frame
+                if (!menu.isTopLevelMenu() || (selectedPath.length > 0 &&
+                        selectedPath[0] == menu.getParent())) {
+                    if (menu.getDelay() == 0) {
+                        appendPath(getPath(), menu.getPopupMenu());
+                    } else {
+                        manager.setSelectedPath(getPath());
+                        setupPostTimer(menu);
+                    }
                 }
             }
         }
--- a/src/macosx/classes/com/apple/laf/AquaScrollPaneUI.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/com/apple/laf/AquaScrollPaneUI.java	Thu Jun 04 15:21:53 2015 -0700
@@ -29,6 +29,7 @@
 
 import javax.swing.*;
 import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicScrollPaneUI;
 
 public class AquaScrollPaneUI extends javax.swing.plaf.basic.BasicScrollPaneUI {
     public static ComponentUI createUI(final JComponent x) {
@@ -39,28 +40,9 @@
         return new XYMouseWheelHandler();
     }
 
-    // This is a grody hack to trick BasicScrollPaneUI into scrolling horizontally
-    // when we notice that the shift key is down. This should be removed when AWT/Swing
-    // becomes aware of of multi-axis scroll wheels.
-    protected class XYMouseWheelHandler extends javax.swing.plaf.basic.BasicScrollPaneUI.MouseWheelHandler {
+    protected class XYMouseWheelHandler extends BasicScrollPaneUI.MouseWheelHandler {
         public void mouseWheelMoved(final MouseWheelEvent e) {
-            JScrollBar vScrollBar = null;
-            boolean wasVisible = false;
-
-            if (e.isShiftDown()) {
-                vScrollBar = scrollpane.getVerticalScrollBar();
-                if (vScrollBar != null) {
-                    wasVisible = vScrollBar.isVisible();
-                    vScrollBar.setVisible(false);
-                }
-            }
-
             super.mouseWheelMoved(e);
-
-            if (wasVisible) {
-                vScrollBar.setVisible(true);
-            }
-
             // Consume the event even when the scrollBar is invisible
             // see #7124320
             e.consume();
--- a/src/macosx/classes/com/apple/laf/AquaTextFieldBorder.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/com/apple/laf/AquaTextFieldBorder.java	Thu Jun 04 15:21:53 2015 -0700
@@ -124,7 +124,7 @@
 
     public Insets getBorderInsets(final Component c) {
         if (!(c instanceof JTextComponent) || c.isOpaque()) return new InsetsUIResource(3, 7, 3, 7);
-        return new InsetsUIResource(6, 7, 6, 7);
+        return new InsetsUIResource(5, 5, 5, 5);
     }
 
     protected static State getStateFor(final JTextComponent jc) {
--- a/src/macosx/classes/sun/awt/CGraphicsDevice.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/sun/awt/CGraphicsDevice.java	Thu Jun 04 15:21:53 2015 -0700
@@ -43,7 +43,6 @@
      * therefore methods, which is using this id should be ready to it.
      */
     private volatile int displayID;
-    private volatile Insets screenInsets;
     private volatile double xResolution;
     private volatile double yResolution;
     private volatile int scale;
@@ -120,7 +119,13 @@
     }
 
     public Insets getScreenInsets() {
-        return screenInsets;
+        // the insets are queried synchronously and are not cached
+        // since there are no Quartz or Cocoa means to receive notifications
+        // on insets changes (e.g. when the Dock is resized):
+        // the existing CGDisplayReconfigurationCallBack is not notified
+        // as well as the NSApplicationDidChangeScreenParametersNotification
+        // is fired on the Dock location changes only
+        return nativeGetScreenInsets(displayID);
     }
 
     public int getScaleFactor() {
@@ -135,7 +140,6 @@
     public void displayChanged() {
         xResolution = nativeGetXResolution(displayID);
         yResolution = nativeGetYResolution(displayID);
-        screenInsets = nativeGetScreenInsets(displayID);
         scale = (int) nativeGetScaleFactor(displayID);
         //TODO configs/fullscreenWindow/modes?
     }
--- a/src/macosx/classes/sun/lwawt/LWCheckboxPeer.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/sun/lwawt/LWCheckboxPeer.java	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, 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
@@ -132,7 +132,9 @@
     @Override
     public void setState(final boolean state) {
         synchronized (getDelegateLock()) {
+            getDelegate().getCurrentButton().removeItemListener(this);
             getDelegate().setSelected(state);
+            getDelegate().getCurrentButton().addItemListener(this);
         }
         repaintPeer();
     }
--- a/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Thu Jun 04 15:21:53 2015 -0700
@@ -1295,6 +1295,12 @@
         }
 
         KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
+
+        if (!becomesFocused && kfmPeer.getCurrentFocusedWindow() != getTarget()) {
+            // late window focus lost event - ingoring
+            return;
+        }
+
         kfmPeer.setCurrentFocusedWindow(becomesFocused ? getTarget() : null);
 
         int eventID = becomesFocused ? WindowEvent.WINDOW_GAINED_FOCUS : WindowEvent.WINDOW_LOST_FOCUS;
--- a/src/macosx/classes/sun/lwawt/macosx/CAccessibility.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/sun/lwawt/macosx/CAccessibility.java	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, 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
@@ -630,7 +630,7 @@
 
             if (!allowIgnored) {
                 final AccessibleRole role = context.getAccessibleRole();
-                if (role != null && ignoredRoles.contains(roleKey(role))) {
+                if (role != null && ignoredRoles != null && ignoredRoles.contains(roleKey(role))) {
                     // Get the child's unignored children.
                     _addChildren(child, whichChildren, false, childrenAndRoles);
                 } else {
--- a/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Thu Jun 04 15:21:53 2015 -0700
@@ -161,7 +161,7 @@
         }
         // ignore focus "lost" native request as it may mistakenly
         // deactivate active window (see 8001161)
-        if (globalFocusedWindow == this && parentWindowActive) {
+        if (globalFocusedWindow == this) {
             responder.handleWindowFocusEvent(parentWindowActive, null);
         }
     }
--- a/src/macosx/classes/sun/lwawt/macosx/CImage.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/sun/lwawt/macosx/CImage.java	Thu Jun 04 15:21:53 2015 -0700
@@ -136,33 +136,35 @@
             return ((DataBufferInt)bimg.getRaster().getDataBuffer()).getData();
         }
 
+        // This is used to create a CImage from a Image
+        public CImage createFromImage(final Image image) {
+            return createFromImage(image, true);
+        }
+
         public CImage createFromImageImmediately(final Image image) {
-            int[]  buffer = imageToArray(image, false);
-
-            if (buffer == null) {
-                return null;
-            }
-
-            return new CImage(nativeCreateNSImageFromArray(buffer, image.getWidth(null),
-                                                           image.getHeight(null)));
+            return createFromImage(image, false);
         }
 
         // This is used to create a CImage from a Image
-        public CImage createFromImage(final Image image) {
+        private CImage createFromImage(final Image image, final boolean prepareImage) {
             if (image instanceof MultiResolutionImage) {
                 List<Image> resolutionVariants
                         = ((MultiResolutionImage) image).getResolutionVariants();
-                return createFromImages(resolutionVariants);
+                return createFromImages(resolutionVariants, prepareImage);
             }
 
-            int[] buffer = imageToArray(image, true);
+            int[] buffer = imageToArray(image, prepareImage);
             if (buffer == null) {
                 return null;
             }
             return new CImage(nativeCreateNSImageFromArray(buffer, image.getWidth(null), image.getHeight(null)));
         }
 
-        public CImage createFromImages(List<Image> images) {
+        public CImage createFromImages(final List<Image> images) {
+            return createFromImages(images, true);
+        }
+
+        private CImage createFromImages(final List<Image> images, final boolean prepareImage) {
             if (images == null || images.isEmpty()) {
                 return null;
             }
@@ -175,8 +177,8 @@
 
             num = 0;
 
-            for (Image img : images) {
-                buffers[num] = imageToArray(img, true);
+            for (final Image img : images) {
+                buffers[num] = imageToArray(img, prepareImage);
                 if (buffers[num] == null) {
                     // Unable to process the image
                     continue;
@@ -191,9 +193,9 @@
             }
 
             return new CImage(nativeCreateNSImageFromArrays(
-                        Arrays.copyOf(buffers, num),
-                        Arrays.copyOf(w, num),
-                        Arrays.copyOf(h, num)));
+                    Arrays.copyOf(buffers, num),
+                    Arrays.copyOf(w, num),
+                    Arrays.copyOf(h, num)));
         }
 
         static int getSelectorAsInt(final String fromString) {
--- a/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Thu Jun 04 15:21:53 2015 -0700
@@ -36,6 +36,10 @@
 import javax.print.*;
 import javax.print.attribute.PrintRequestAttributeSet;
 import javax.print.attribute.HashPrintRequestAttributeSet;
+import javax.print.attribute.standard.Media;
+import javax.print.attribute.standard.MediaPrintableArea;
+import javax.print.attribute.standard.MediaSize;
+import javax.print.attribute.standard.MediaSizeName;
 import javax.print.attribute.standard.PageRanges;
 
 import sun.java2d.*;
@@ -741,4 +745,34 @@
     protected void startPage(PageFormat arg0, Printable arg1, int arg2, boolean arg3) throws PrinterException {
         // TODO Auto-generated method stub
     }
+
+    @Override
+    protected MediaSize getMediaSize(Media media, PrintService service,
+            PageFormat page) {
+        if (media == null || !(media instanceof MediaSizeName)) {
+            return getDefaultMediaSize(page);
 }
+        MediaSize size = MediaSize.getMediaSizeForName((MediaSizeName) media);
+        return size != null ? size : getDefaultMediaSize(page);
+    }
+
+    private MediaSize getDefaultMediaSize(PageFormat page){
+            final int inch = 72;
+            Paper paper = page.getPaper();
+            float width = (float) (paper.getWidth() / inch);
+            float height = (float) (paper.getHeight() / inch);
+            return new MediaSize(width, height, MediaSize.INCH);
+    }
+
+    @Override
+    protected MediaPrintableArea getDefaultPrintableArea(PageFormat page, double w, double h) {
+        final float dpi = 72.0f;
+        Paper paper = page.getPaper();
+        return new MediaPrintableArea(
+                (float) (paper.getImageableX() / dpi),
+                (float) (paper.getImageableY() / dpi),
+                (float) (paper.getImageableWidth() / dpi),
+                (float) (paper.getImageableHeight() / dpi),
+                MediaPrintableArea.INCH);
+    }
+}
\ No newline at end of file
--- a/src/macosx/javavm/export/jawt_md.h	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/javavm/export/jawt_md.h	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, 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/src/macosx/native/com/sun/media/sound/PLATFORM_API_MacOSX_PCM.cpp	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/native/com/sun/media/sound/PLATFORM_API_MacOSX_PCM.cpp	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
 //#define USE_VERBOSE_TRACE
 
 #include <AudioUnit/AudioUnit.h>
-#include <CoreServices/CoreServices.h>
 #include <AudioToolbox/AudioConverter.h>
 #include <pthread.h>
 #include <math.h>
@@ -617,7 +616,7 @@
 
     ~OSX_DirectAudioDevice() {
         if (audioUnit) {
-            CloseComponent(audioUnit);
+            AudioComponentInstanceDispose(audioUnit);
         }
         if (resampler) {
             delete resampler;
@@ -629,17 +628,16 @@
 {
     OSStatus err;
     AudioUnit unit;
-    UInt32 size;
 
-    ComponentDescription desc;
+    AudioComponentDescription desc;
     desc.componentType         = kAudioUnitType_Output;
     desc.componentSubType      = (deviceID == 0 && isSource) ? kAudioUnitSubType_DefaultOutput : kAudioUnitSubType_HALOutput;
     desc.componentManufacturer = kAudioUnitManufacturer_Apple;
     desc.componentFlags        = 0;
     desc.componentFlagsMask    = 0;
 
-    Component comp = FindNextComponent(NULL, &desc);
-    err = OpenAComponent(comp, &unit);
+    AudioComponent comp = AudioComponentFindNext(NULL, &desc);
+    err = AudioComponentInstanceNew(comp, &unit);
 
     if (err) {
         OS_ERROR0(err, "CreateOutputUnit:OpenAComponent");
@@ -664,7 +662,7 @@
             // get real AudioDeviceID for default input device (macosx current input device)
             deviceID = GetDefaultDevice(isSource);
             if (!deviceID) {
-                CloseComponent(unit);
+                AudioComponentInstanceDispose(unit);
                 return NULL;
             }
         }
@@ -675,7 +673,7 @@
                                     0, &deviceID, sizeof(deviceID));
         if (err) {
             OS_ERROR0(err, "SetProperty (CurrentDevice)");
-            CloseComponent(unit);
+            AudioComponentInstanceDispose(unit);
             return NULL;
         }
     }
--- a/src/macosx/native/sun/awt/LWCToolkit.h	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/native/sun/awt/LWCToolkit.h	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,8 +28,6 @@
 
 #import <Cocoa/Cocoa.h>
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
-#import <CoreServices/CoreServices.h>
-#import <AudioToolbox/AudioToolbox.h>
 
 #define DEBUG 1
 
--- a/src/macosx/native/sun/awt/awt.m	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/native/sun/awt/awt.m	Thu Jun 04 15:21:53 2015 -0700
@@ -30,6 +30,7 @@
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
 #import <JavaRuntimeSupport/JavaRuntimeSupport.h>
 
+#import "jni_util.h" 
 #import "NSApplicationAWT.h"
 #import "PropertiesUtilities.h"
 #import "ThreadUtilities.h"
@@ -436,8 +437,11 @@
     }
     JNIEnv* env = [ThreadUtilities getJNIEnvUncached];
     jclass jc_ThreadGroupUtils = (*env)->FindClass(env, "sun/misc/ThreadGroupUtils");
+    CHECK_NULL_RETURN(jc_ThreadGroupUtils, JNI_VERSION_1_4);
     jmethodID sjm_getRootThreadGroup = (*env)->GetStaticMethodID(env, jc_ThreadGroupUtils, "getRootThreadGroup", "()Ljava/lang/ThreadGroup;");
+    CHECK_NULL_RETURN(sjm_getRootThreadGroup, JNI_VERSION_1_4);
     jobject rootThreadGroup = (*env)->CallStaticObjectMethod(env, jc_ThreadGroupUtils, sjm_getRootThreadGroup);
+    CHECK_NULL_RETURN(rootThreadGroup, JNI_VERSION_1_4);
     [ThreadUtilities setAppkitThreadGroup:(*env)->NewGlobalRef(env, rootThreadGroup)];
     // The current thread was attached in getJNIEnvUnchached.
     // Detach it back. It will be reattached later if needed with a proper TG
--- a/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m	Sat May 23 02:49:50 2015 +0300
+++ b/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m	Thu Jun 04 15:21:53 2015 -0700
@@ -126,12 +126,30 @@
     return buf;
 }
 
+BOOL isSWTRunning() {
+    char envVar[80];
+    // If this property is present we are running SWT
+    snprintf(envVar, sizeof(envVar), "JAVA_STARTED_ON_FIRST_THREAD_%d", getpid());
+    return getenv(envVar) != NULL;
+}
+
 char* SplashGetScaledImageName(const char* jar, const char* file,
                                float *scaleFactor) {
+    *scaleFactor = 1;
+
+    if(isSWTRunning()){
+        return nil;
+    }
+
     NSAutoreleasePool *pool = [NSAutoreleasePool new];
-    *scaleFactor = 1;
     char* scaledFile = nil;
-    float screenScaleFactor = 1;
+    __block float screenScaleFactor = 1;
+
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+        // initialize NSApplication and AWT stuff
+        [NSApplicationAWT sharedApplication];
+        screenScaleFactor = [SplashNSScreen() backingScaleFactor];
+    }];
 
     if (screenScaleFactor > 1) {
         NSString *fileName = [NSString stringWithUTF8String: file];
@@ -176,9 +194,12 @@
     splash->screenFormat.byteOrder = 1 ?  BYTE_ORDER_LSBFIRST : BYTE_ORDER_MSBFIRST;
     splash->screenFormat.depthBytes = 4;
 
-    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
-        [NSApplicationAWT runAWTLoopWithApp:[NSApplicationAWT sharedApplication]];
-    }];
+    // If we are running SWT we should not start a runLoop
+    if (!isSWTRunning()) {
+        [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
+            [NSApplicationAWT runAWTLoopWithApp:[NSApplicationAWT sharedApplication]];
+        }];
+    }
 }
 
 void
--- a/src/share/classes/com/sun/beans/decoder/ArrayElementHandler.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/share/classes/com/sun/beans/decoder/ArrayElementHandler.java	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2013, 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/src/share/classes/com/sun/crypto/provider/GCTR.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/share/classes/com/sun/crypto/provider/GCTR.java	Thu Jun 04 15:21:53 2015 -0700
@@ -38,7 +38,17 @@
  * under section 6.5. It needs to be constructed w/ an initialized
  * cipher object, and initial counter block(ICB). Given an input X
  * of arbitrary length, it processes and returns an output which has
- * the same length as X.
+ * the same length as X. The invariants of this class are:
+ *
+ * (1) The length of intialCounterBlk (and also of its clones, e.g.,
+ * fields counter and counterSave) is equal to AES_BLOCK_SIZE.
+ *
+ * (2) After construction, the field counter never becomes null, it
+ * always contains a byte array of length AES_BLOCK_SIZE.
+ *
+ * If any invariant is broken, failures can occur because the
+ * AESCrypt.encryptBlock method can be intrinsified on the HotSpot VM
+ * (see JDK-8067648 for details).
  *
  * <p>This function is used in the implementation of GCM mode.
  *
@@ -59,6 +69,10 @@
     // NOTE: cipher should already be initialized
     GCTR(SymmetricCipher cipher, byte[] initialCounterBlk) {
         this.aes = cipher;
+        if (initialCounterBlk.length != AES_BLOCK_SIZE) {
+            throw new RuntimeException("length of initial counter block (" + initialCounterBlk.length +
+                                       ") not equal to AES_BLOCK_SIZE (" + AES_BLOCK_SIZE + ")");
+        }
         this.icb = initialCounterBlk;
         this.counter = icb.clone();
     }
@@ -137,6 +151,8 @@
      * Restores the content of this object to the previous saved one.
      */
     void restore() {
-        this.counter = this.counterSave;
+        if (this.counterSave != null) {
+            this.counter = this.counterSave;
+        }
     }
 }
--- a/src/share/classes/com/sun/crypto/provider/GHASH.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/share/classes/com/sun/crypto/provider/GHASH.java	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,9 +29,7 @@
 
 package com.sun.crypto.provider;
 
-import java.util.Arrays;
-import java.security.*;
-import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE;
+import java.security.ProviderException;
 
 /**
  * This class represents the GHASH function defined in NIST 800-38D
@@ -44,62 +43,90 @@
  */
 final class GHASH {
 
-    private static final byte P128 = (byte) 0xe1; //reduction polynomial
-
-    private static boolean getBit(byte[] b, int pos) {
-        int p = pos / 8;
-        pos %= 8;
-        int i = (b[p] >>> (7 - pos)) & 1;
-        return i != 0;
+    private static long getLong(byte[] buffer, int offset) {
+        long result = 0;
+        int end = offset + 8;
+        for (int i = offset; i < end; ++i) {
+            result = (result << 8) + (buffer[i] & 0xFF);
+        }
+        return result;
     }
 
-    private static void shift(byte[] b) {
-        byte temp, temp2;
-        temp2 = 0;
-        for (int i = 0; i < b.length; i++) {
-            temp = (byte) ((b[i] & 0x01) << 7);
-            b[i] = (byte) ((b[i] & 0xff) >>> 1);
-            b[i] = (byte) (b[i] | temp2);
-            temp2 = temp;
+    private static void putLong(byte[] buffer, int offset, long value) {
+        int end = offset + 8;
+        for (int i = end - 1; i >= offset; --i) {
+            buffer[i] = (byte) value;
+            value >>= 8;
         }
     }
 
-    // Given block X and Y, returns the muliplication of X * Y
-    private static byte[] blockMult(byte[] x, byte[] y) {
-        if (x.length != AES_BLOCK_SIZE || y.length != AES_BLOCK_SIZE) {
-            throw new RuntimeException("illegal input sizes");
+    private static final int AES_BLOCK_SIZE = 16;
+
+    // Multiplies state0, state1 by V0, V1.
+    private void blockMult(long V0, long V1) {
+        long Z0 = 0;
+        long Z1 = 0;
+        long X;
+
+        // Separate loops for processing state0 and state1.
+        X = state0;
+        for (int i = 0; i < 64; i++) {
+            // Zi+1 = Zi if bit i of x is 0
+            long mask = X >> 63;
+            Z0 ^= V0 & mask;
+            Z1 ^= V1 & mask;
+
+            // Save mask for conditional reduction below.
+            mask = (V1 << 63) >> 63;
+
+            // V = rightshift(V)
+            long carry = V0 & 1;
+            V0 = V0 >>> 1;
+            V1 = (V1 >>> 1) | (carry << 63);
+
+            // Conditional reduction modulo P128.
+            V0 ^= 0xe100000000000000L & mask;
+            X <<= 1;
         }
-        byte[] z = new byte[AES_BLOCK_SIZE];
-        byte[] v = y.clone();
-        // calculate Z1-Z127 and V1-V127
-        for (int i = 0; i < 127; i++) {
+
+        X = state1;
+        for (int i = 64; i < 127; i++) {
             // Zi+1 = Zi if bit i of x is 0
-            if (getBit(x, i)) {
-                for (int n = 0; n < z.length; n++) {
-                    z[n] ^= v[n];
-                }
-            }
-            boolean lastBitOfV = getBit(v, 127);
-            shift(v);
-            if (lastBitOfV) v[0] ^= P128;
+            long mask = X >> 63;
+            Z0 ^= V0 & mask;
+            Z1 ^= V1 & mask;
+
+            // Save mask for conditional reduction below.
+            mask = (V1 << 63) >> 63;
+
+            // V = rightshift(V)
+            long carry = V0 & 1;
+            V0 = V0 >>> 1;
+            V1 = (V1 >>> 1) | (carry << 63);
+
+            // Conditional reduction.
+            V0 ^= 0xe100000000000000L & mask;
+            X <<= 1;
         }
+
         // calculate Z128
-        if (getBit(x, 127)) {
-            for (int n = 0; n < z.length; n++) {
-                z[n] ^= v[n];
-            }
-        }
-        return z;
+        long mask = X >> 63;
+        Z0 ^= V0 & mask;
+        Z1 ^= V1 & mask;
+
+        // Save result.
+        state0 = Z0;
+        state1 = Z1;
     }
 
     // hash subkey H; should not change after the object has been constructed
-    private final byte[] subkeyH;
+    private final long subkeyH0, subkeyH1;
 
     // buffer for storing hash
-    private byte[] state;
+    private long state0, state1;
 
     // variables for save/restore calls
-    private byte[] stateSave = null;
+    private long stateSave0, stateSave1;
 
     /**
      * Initializes the cipher in the specified mode with the given key
@@ -114,8 +141,8 @@
         if ((subkeyH == null) || subkeyH.length != AES_BLOCK_SIZE) {
             throw new ProviderException("Internal error");
         }
-        this.subkeyH = subkeyH;
-        this.state = new byte[AES_BLOCK_SIZE];
+        this.subkeyH0 = getLong(subkeyH, 0);
+        this.subkeyH1 = getLong(subkeyH, 8);
     }
 
     /**
@@ -124,31 +151,33 @@
      * this object for different data w/ the same H.
      */
     void reset() {
-        Arrays.fill(state, (byte) 0);
+        state0 = 0;
+        state1 = 0;
     }
 
     /**
      * Save the current snapshot of this GHASH object.
      */
     void save() {
-        stateSave = state.clone();
+        stateSave0 = state0;
+        stateSave1 = state1;
     }
 
     /**
      * Restores this object using the saved snapshot.
      */
     void restore() {
-        state = stateSave;
+        state0 = stateSave0;
+        state1 = stateSave1;
     }
 
     private void processBlock(byte[] data, int ofs) {
         if (data.length - ofs < AES_BLOCK_SIZE) {
             throw new RuntimeException("need complete block");
         }
-        for (int n = 0; n < state.length; n++) {
-            state[n] ^= data[ofs + n];
-        }
-        state = blockMult(state, subkeyH);
+        state0 ^= getLong(data, ofs);
+        state1 ^= getLong(data, ofs + 8);
+        blockMult(subkeyH0, subkeyH1);
     }
 
     void update(byte[] in) {
@@ -169,10 +198,10 @@
     }
 
     byte[] digest() {
-        try {
-            return state.clone();
-        } finally {
-            reset();
-        }
+        byte[] result = new byte[AES_BLOCK_SIZE];
+        putLong(result, 0, state0);
+        putLong(result, 8, state1);
+        reset();
+        return result;
     }
 }
--- a/src/share/classes/com/sun/crypto/provider/JceKeyStore.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/share/classes/com/sun/crypto/provider/JceKeyStore.java	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, 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
@@ -107,7 +107,7 @@
     {
         Key key = null;
 
-        Object entry = entries.get(alias.toLowerCase());
+        Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
 
         if (!((entry instanceof PrivateKeyEntry) ||
               (entry instanceof SecretKeyEntry))) {
@@ -150,7 +150,7 @@
     {
         Certificate[] chain = null;
 
-        Object entry = entries.get(alias.toLowerCase());
+        Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
 
         if ((entry instanceof PrivateKeyEntry)
             && (((PrivateKeyEntry)entry).chain != null)) {
@@ -178,7 +178,7 @@
     public Certificate engineGetCertificate(String alias) {
         Certificate cert = null;
 
-        Object entry = entries.get(alias.toLowerCase());
+        Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
 
         if (entry != null) {
             if (entry instanceof TrustedCertEntry) {
@@ -203,7 +203,7 @@
     public Date engineGetCreationDate(String alias) {
         Date date = null;
 
-        Object entry = entries.get(alias.toLowerCase());
+        Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
 
         if (entry != null) {
             // We have to create a new instance of java.util.Date because
@@ -266,7 +266,7 @@
                     }
 
                     // store the entry
-                    entries.put(alias.toLowerCase(), entry);
+                    entries.put(alias.toLowerCase(Locale.ENGLISH), entry);
 
                 } else {
                     SecretKeyEntry entry = new SecretKeyEntry();
@@ -274,7 +274,7 @@
 
                     // seal and store the key
                     entry.sealedKey = keyProtector.seal(key);
-                    entries.put(alias.toLowerCase(), entry);
+                    entries.put(alias.toLowerCase(Locale.ENGLISH), entry);
                 }
 
             } catch (Exception e) {
@@ -322,7 +322,7 @@
                 entry.chain = null;
             }
 
-            entries.put(alias.toLowerCase(), entry);
+            entries.put(alias.toLowerCase(Locale.ENGLISH), entry);
         }
     }
 
@@ -345,7 +345,7 @@
     {
         synchronized(entries) {
 
-            Object entry = entries.get(alias.toLowerCase());
+            Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
             if (entry != null) {
                 if (entry instanceof PrivateKeyEntry) {
                     throw new KeyStoreException("Cannot overwrite own "
@@ -358,7 +358,7 @@
             TrustedCertEntry trustedCertEntry = new TrustedCertEntry();
             trustedCertEntry.cert = cert;
             trustedCertEntry.date = new Date();
-            entries.put(alias.toLowerCase(), trustedCertEntry);
+            entries.put(alias.toLowerCase(Locale.ENGLISH), trustedCertEntry);
         }
     }
 
@@ -373,7 +373,7 @@
         throws KeyStoreException
     {
         synchronized(entries) {
-            entries.remove(alias.toLowerCase());
+            entries.remove(alias.toLowerCase(Locale.ENGLISH));
         }
     }
 
@@ -394,7 +394,7 @@
      * @return true if the alias exists, false otherwise
      */
     public boolean engineContainsAlias(String alias) {
-        return entries.containsKey(alias.toLowerCase());
+        return entries.containsKey(alias.toLowerCase(Locale.ENGLISH));
     }
 
     /**
@@ -416,7 +416,7 @@
     public boolean engineIsKeyEntry(String alias) {
         boolean isKey = false;
 
-        Object entry = entries.get(alias.toLowerCase());
+        Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
         if ((entry instanceof PrivateKeyEntry)
             || (entry instanceof SecretKeyEntry)) {
             isKey = true;
@@ -434,7 +434,7 @@
      */
     public boolean engineIsCertificateEntry(String alias) {
         boolean isCert = false;
-        Object entry = entries.get(alias.toLowerCase());
+        Object entry = entries.get(alias.toLowerCase(Locale.ENGLISH));
         if (entry instanceof TrustedCertEntry) {
             isCert = true;
         }
--- a/src/share/classes/com/sun/crypto/provider/PBEKey.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/share/classes/com/sun/crypto/provider/PBEKey.java	Thu Jun 04 15:21:53 2015 -0700
@@ -28,6 +28,7 @@
 import java.security.MessageDigest;
 import java.security.KeyRep;
 import java.security.spec.InvalidKeySpecException;
+import java.util.Locale;
 import javax.crypto.SecretKey;
 import javax.crypto.spec.PBEKeySpec;
 
@@ -92,7 +93,7 @@
         for (int i = 1; i < this.key.length; i++) {
             retval += this.key[i] * i;
         }
-        return(retval ^= getAlgorithm().toLowerCase().hashCode());
+        return(retval ^= getAlgorithm().toLowerCase(Locale.ENGLISH).hashCode());
     }
 
     public boolean equals(Object obj) {
--- a/src/share/classes/com/sun/crypto/provider/PBEKeyFactory.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/share/classes/com/sun/crypto/provider/PBEKeyFactory.java	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -32,6 +32,7 @@
 import javax.crypto.SecretKeyFactorySpi;
 import javax.crypto.spec.PBEKeySpec;
 import java.util.HashSet;
+import java.util.Locale;
 
 /**
  * This class implements a key factory for PBE keys according to PKCS#5,
@@ -56,24 +57,24 @@
 
     static {
         validTypes = new HashSet<String>(17);
-        validTypes.add("PBEWithMD5AndDES".toUpperCase());
-        validTypes.add("PBEWithSHA1AndDESede".toUpperCase());
-        validTypes.add("PBEWithSHA1AndRC2_40".toUpperCase());
-        validTypes.add("PBEWithSHA1AndRC2_128".toUpperCase());
-        validTypes.add("PBEWithSHA1AndRC4_40".toUpperCase());
-        validTypes.add("PBEWithSHA1AndRC4_128".toUpperCase());
+        validTypes.add("PBEWithMD5AndDES".toUpperCase(Locale.ENGLISH));
+        validTypes.add("PBEWithSHA1AndDESede".toUpperCase(Locale.ENGLISH));
+        validTypes.add("PBEWithSHA1AndRC2_40".toUpperCase(Locale.ENGLISH));
+        validTypes.add("PBEWithSHA1AndRC2_128".toUpperCase(Locale.ENGLISH));
+        validTypes.add("PBEWithSHA1AndRC4_40".toUpperCase(Locale.ENGLISH));
+        validTypes.add("PBEWithSHA1AndRC4_128".toUpperCase(Locale.ENGLISH));
         // Proprietary algorithm.
-        validTypes.add("PBEWithMD5AndTripleDES".toUpperCase());
-        validTypes.add("PBEWithHmacSHA1AndAES_128".toUpperCase());
-        validTypes.add("PBEWithHmacSHA224AndAES_128".toUpperCase());
-        validTypes.add("PBEWithHmacSHA256AndAES_128".toUpperCase());
-        validTypes.add("PBEWithHmacSHA384AndAES_128".toUpperCase());
-        validTypes.add("PBEWithHmacSHA512AndAES_128".toUpperCase());
-        validTypes.add("PBEWithHmacSHA1AndAES_256".toUpperCase());
-        validTypes.add("PBEWithHmacSHA224AndAES_256".toUpperCase());
-        validTypes.add("PBEWithHmacSHA256AndAES_256".toUpperCase());
-        validTypes.add("PBEWithHmacSHA384AndAES_256".toUpperCase());
-        validTypes.add("PBEWithHmacSHA512AndAES_256".toUpperCase());
+        validTypes.add("PBEWithMD5AndTripleDES".toUpperCase(Locale.ENGLISH));
+        validTypes.add("PBEWithHmacSHA1AndAES_128".toUpperCase(Locale.ENGLISH));
+        validTypes.add("PBEWithHmacSHA224AndAES_128".toUpperCase(Locale.ENGLISH));
+        validTypes.add("PBEWithHmacSHA256AndAES_128".toUpperCase(Locale.ENGLISH));
+        validTypes.add("PBEWithHmacSHA384AndAES_128".toUpperCase(Locale.ENGLISH));
+        validTypes.add("PBEWithHmacSHA512AndAES_128".toUpperCase(Locale.ENGLISH));
+        validTypes.add("PBEWithHmacSHA1AndAES_256".toUpperCase(Locale.ENGLISH));
+        validTypes.add("PBEWithHmacSHA224AndAES_256".toUpperCase(Locale.ENGLISH));
+        validTypes.add("PBEWithHmacSHA256AndAES_256".toUpperCase(Locale.ENGLISH));
+        validTypes.add("PBEWithHmacSHA384AndAES_256".toUpperCase(Locale.ENGLISH));
+        validTypes.add("PBEWithHmacSHA512AndAES_256".toUpperCase(Locale.ENGLISH));
     }
 
     public static final class PBEWithMD5AndDES
@@ -237,7 +238,7 @@
     protected KeySpec engineGetKeySpec(SecretKey key, Class<?> keySpecCl)
         throws InvalidKeySpecException {
         if ((key instanceof SecretKey)
-            && (validTypes.contains(key.getAlgorithm().toUpperCase()))
+            && (validTypes.contains(key.getAlgorithm().toUpperCase(Locale.ENGLISH)))
             && (key.getFormat().equalsIgnoreCase("RAW"))) {
 
             // Check if requested key spec is amongst the valid ones
@@ -279,7 +280,7 @@
     {
         try {
             if ((key != null) &&
-                (validTypes.contains(key.getAlgorithm().toUpperCase())) &&
+                (validTypes.contains(key.getAlgorithm().toUpperCase(Locale.ENGLISH))) &&
                 (key.getFormat().equalsIgnoreCase("RAW"))) {
 
                 // Check if key originates from this factory
--- a/src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java	Thu Jun 04 15:21:53 2015 -0700
@@ -31,6 +31,7 @@
 import java.nio.charset.Charset;
 import java.util.Arrays;
 import java.security.MessageDigest;
+import java.util.Locale;
 import java.security.KeyRep;
 import java.security.GeneralSecurityException;
 import java.security.NoSuchAlgorithmException;
@@ -144,7 +145,7 @@
                 @Override
                 public int hashCode() {
                     return Arrays.hashCode(password) * 41 +
-                            prf.getAlgorithm().toLowerCase().hashCode();
+                      prf.getAlgorithm().toLowerCase(Locale.ENGLISH).hashCode();
                 }
                 @Override
                 public boolean equals(Object obj) {
@@ -222,7 +223,7 @@
         for (int i = 1; i < this.key.length; i++) {
             retval += this.key[i] * i;
         }
-        return(retval ^= getAlgorithm().toLowerCase().hashCode());
+        return(retval ^= getAlgorithm().toLowerCase(Locale.ENGLISH).hashCode());
     }
 
     public boolean equals(Object obj) {
--- a/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	Sat May 23 02:49:50 2015 +0300
+++ b/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java	Thu Jun 04 15:21:53 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, 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
@@ -43,8 +43,6 @@
 
 import java.awt.image.Raster;
 import java.awt.image.WritableRaster;
-import java.awt.image.SampleModel;
-import java.awt.image.DataBuffer;
 import java.awt.image.DataBufferByte;
 import java.awt.image.ColorModel;
 import java.awt.image.IndexColorModel;
@@ -1048,7 +1046,13 @@
 
         // Call the writer, who will call back for every scanline
 
-        processImageStarted(currentImage);
+        clearAbortRequest();
+        cbLock.lock();
+        try {
+            processImageStarted(currentImage);
+        } finally {
+            cbLock.unlock();
+        }
 
         boolean aborted = false;
 
@@ -1100,6 +1104,11 @@
         currentImage++;  // After a successful write
     }
 
+    @Override
+    public boolean canWriteSequence() {
+        return true;
+    }
+
     public void prepareWriteSequence(IIOMetadata streamMetadata)
         throws IOException {
         setThreadLock();
@@ -1225,6 +1234,23 @@
         }
     }
 
+    @Override
+    protected synchronized void clearAbortRequest() {
+        setThreadLock();
+        try {
+            cbLock.check();
+            if (abortRequested()) {
+                super.clearAbortRequest();
+                // reset C structures
+                resetWriter(structPointer);
+                // reset the native destination
+                setDest(structPointer);
+            }
+        } finally {
+            clearThreadLock();
+        }
+    }
+
     private void resetInternalState() {
         // reset C structures
         resetWriter(structPointer);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/java/accessibility/util/AWTEventMonitor.java	Thu Jun 04 15:21:53 2015 -0700
@@ -0,0 +1,1495 @@
+/*
+ * Copyright (c) 2002, 2015, 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.java.accessibility.util;
+
+import java.util.*;
+import java.awt.*;
+import java.awt.event.*;
+import javax.accessibility.*;
+import javax.swing.*;
+import javax.swing.event.*;
+import sun.security.util.SecurityConstants.AWT;
+
+/**
+ * <P>The {@code AWTEventMonitor} implements a suite of listeners that are
+ * conditionally installed on every AWT component instance in the Java
+ * Virtual Machine.  The events captured by these listeners are made
+ * available through a unified set of listeners supported by {@code AWTEventMonitor}.
+ * With this, all the individual events on each of the AWT component
+ * instances are funneled into one set of listeners broken down by category
+ * (see {@link EventID} for the categories).
+ * <p>This class depends upon {@link EventQueueMonitor}, which provides the base
+ * level support for capturing the top-level containers as they are created.
+ */
+
+@jdk.Exported
+public class AWTEventMonitor {
+
+    static private boolean runningOnJDK1_4 = false;
+
+    /**
+     * The current component with keyboard focus.
+     *
+     * @see #getComponentWithFocus
+     *
+     * @deprecated This field is unused; to get the component with focus use the
+     * getComponentWithFocus method.
+     */
+    @Deprecated
+    static protected Component componentWithFocus = null;
+
+    static private Component componentWithFocus_private = null;
+
+    // Low-level listeners
+    /**
+     * The current list of registered ComponentListener classes.
+     *
+     * @see #addComponentListener
+     * @see #removeComponentListener
+     *
+     * @deprecated This field is unused.
+     */
+    @Deprecated
+    static protected ComponentListener     componentListener     = null;
+
+    static private ComponentListener componentListener_private = null;
+
+    /**
+     * The current list of registered ContainerListener classes.
+     *
+     * @see #addContainerListener
+     * @see #removeContainerListener
+     *
+     * @deprecated This field is unused.
+     */
+    @Deprecated
+    static protected ContainerListener     containerListener     = null;
+
+    static private ContainerListener containerListener_private = null;
+
+    /**
+     * The current list of registered FocusListener classes.
+     *
+     * @see #addFocusListener
+     * @see #removeFocusListener
+     *
+     * @deprecated This field is unused.
+     */
+    @Deprecated
+    static protected FocusListener         focusListener         = null;
+
+    static private FocusListener focusListener_private = null;
+
+    /**
+     * The current list of registered KeyListener classes.
+     *
+     * @see #addKeyListener
+     * @see #removeKeyListener
+     *
+     * @deprecated This field is unused.
+     */
+    @Deprecated
+    static protected KeyListener           keyListener           = null;
+
+    static private KeyListener keyListener_private = null;
+
+    /**
+     * The current list of registered MouseListener classes.
+     *
+     * @see #addMouseListener
+     * @see #removeMouseListener
+     *
+     * @deprecated This field is unused.
+     */
+    @Deprecated
+    static protected MouseListener         mouseListener         = null;
+
+    static private MouseListener mouseListener_private = null;
+
+    /**
+     * The current list of registered MouseMotionListener classes.
+     *
+     * @see #addMouseMotionListener
+     * @see #removeMouseMotionListener
+     *
+     * @deprecated This field is unused.
+     */
+    @Deprecated
+    static protected MouseMotionListener   mouseMotionListener   = null;
+
+    static private MouseMotionListener mouseMotionListener_private = null;
+
+    /**
+     * The current list of registered WindowListener classes.
+     *
+     * @see #addWindowListener
+     * @see #removeWindowListener
+     *
+     * @deprecated This field is unused.
+     */
+    @Deprecated
+    static protected WindowListener        windowListener        = null;
+
+    static private WindowListener windowListener_private = null;
+
+
+    // Semantic listeners
+    /**
+     * The current list of registered ActionListener classes.
+     *
+     * @see #addActionListener
+     * @see #removeActionListener
+     *
+     * @deprecated This field is unused.
+     */
+    @Deprecated
+    static protected ActionListener        actionListener        = null;
+
+    static private ActionListener actionListener_private = null;
+
+    /**
+     * The current list of registered AdjustmentListener classes.
+     *
+     * @see #addAdjustmentListener
+     * @see #removeAdjustmentListener
+     *
+     * @deprecated This field is unused.
+     */
+    @Deprecated
+    static protected AdjustmentListener    adjustmentListener    = null;
+
+    static private AdjustmentListener adjustmentListener_private = null;
+
+    /**
+     * The current list of registered ItemListener classes.
+     *
+     * @see #addItemListener
+     * @see #removeItemListener
+     *
+     * @deprecated This field is unused.
+     */
+    @Deprecated
+    static protected ItemListener          itemListener          = null;
+
+    static private ItemListener itemListener_private = null;
+
+    /**
+     * The current list of registered TextListener classes.
+     *
+     * @see #addTextListener
+     * @see #removeTextListener
+     *
+     * @deprecated This field is unused.
+     */
+    @Deprecated
+    static protected TextListener          textListener          = null;
+
+    static private TextListener textListener_private = null;
+
+
+    /**
+     * The actual listener that is installed on the component instances.
+     * This listener calls the other registered listeners when an event
+     * occurs.  By doing things this way, the actual number of listeners
+     * installed on a component instance is drastically reduced.
+     *
+     * @deprecated This field is unused.
+     */
+    @Deprecated
+    static protected AWTEventsListener awtListener = new AWTEventsListener();
+
+    static private final AWTEventsListener awtListener_private = new AWTEventsListener();
+
+    /**
+     * Returns the component that currently has keyboard focus.  The return
+     * value can be null.
+     *
+     * @return the component that has keyboard focus
+     */
+    static public Component getComponentWithFocus() {
+        return componentWithFocus_private;
+    }
+
+    /*
+     * Check permissions
+     */
+    static private void checkInstallPermission() {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkPermission(AWT.ALL_AWT_EVENTS_PERMISSION);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#COMPONENT COMPONENT}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: this listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeComponentListener
+     */
+    static public void addComponentListener(ComponentListener l) {
+        if (componentListener_private == null) {
+            checkInstallPermission();
+            awtListener_private.installListeners(EventID.COMPONENT);
+        }
+        componentListener_private = AWTEventMulticaster.add(componentListener_private, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#COMPONENT COMPONENT} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addComponentListener
+     */
+    static public void removeComponentListener(ComponentListener l) {
+        componentListener_private = AWTEventMulticaster.remove(componentListener_private, l);
+        if (componentListener_private == null) {
+            awtListener_private.removeListeners(EventID.COMPONENT);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#CONTAINER CONTAINER}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: this listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeContainerListener
+     */
+    static public void addContainerListener(ContainerListener l) {
+        containerListener_private = AWTEventMulticaster.add(containerListener_private, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#CONTAINER CONTAINER} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addContainerListener
+     */
+    static public void removeContainerListener(ContainerListener l) {
+        containerListener_private = AWTEventMulticaster.remove(containerListener_private, l);
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#FOCUS FOCUS} events
+     * on each component instance in the Java Virtual Machine when they occur.
+     * <P>Note: this listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeFocusListener
+     */
+    static public void addFocusListener(FocusListener l) {
+        focusListener_private = AWTEventMulticaster.add(focusListener_private, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives {@link EventID#FOCUS FOCUS}
+     * events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addFocusListener
+     */
+    static public void removeFocusListener(FocusListener l) {
+        focusListener_private = AWTEventMulticaster.remove(focusListener_private, l);
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#KEY KEY} events on each
+     * component instance in the Java Virtual Machine when they occur.
+     * <P>Note: this listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeKeyListener
+     */
+    static public void addKeyListener(KeyListener l) {
+        if (keyListener_private == null) {
+            checkInstallPermission();
+            awtListener_private.installListeners(EventID.KEY);
+        }
+        keyListener_private = AWTEventMulticaster.add(keyListener_private, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives {@link EventID#KEY KEY}
+     * events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addKeyListener
+     */
+    static public void removeKeyListener(KeyListener l) {
+        keyListener_private = AWTEventMulticaster.remove(keyListener_private, l);
+        if (keyListener_private == null)  {
+            awtListener_private.removeListeners(EventID.KEY);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#MOUSE MOUSE} events
+     * on each component instance in the Java Virtual Machine when they occur.
+     * <P>Note: this listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeMouseListener
+     */
+    static public void addMouseListener(MouseListener l) {
+        if (mouseListener_private == null) {
+            checkInstallPermission();
+            awtListener_private.installListeners(EventID.MOUSE);
+        }
+        mouseListener_private = AWTEventMulticaster.add(mouseListener_private, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#MOUSE MOUSE} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addMouseListener
+     */
+    static public void removeMouseListener(MouseListener l) {
+        mouseListener_private = AWTEventMulticaster.remove(mouseListener_private, l);
+        if (mouseListener_private == null) {
+            awtListener_private.removeListeners(EventID.MOUSE);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all mouse {@link EventID#MOTION MOTION}
+     * events on each component instance in the Java Virtual Machine when they occur.
+     * <P>Note: this listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeMouseMotionListener
+     */
+    static public void addMouseMotionListener(MouseMotionListener l) {
+        if (mouseMotionListener_private == null) {
+            checkInstallPermission();
+            awtListener_private.installListeners(EventID.MOTION);
+        }
+        mouseMotionListener_private = AWTEventMulticaster.add(mouseMotionListener_private, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#MOTION MOTION} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addMouseMotionListener
+     */
+    static public void removeMouseMotionListener(MouseMotionListener l) {
+        mouseMotionListener_private = AWTEventMulticaster.remove(mouseMotionListener_private, l);
+        if (mouseMotionListener_private == null) {
+            awtListener_private.removeListeners(EventID.MOTION);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#WINDOW WINDOW}
+     * events on each component instance in the Java Virtual Machine when they occur.
+     * <P>Note: this listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeWindowListener
+     */
+    static public void addWindowListener(WindowListener l) {
+        if (windowListener_private == null) {
+            checkInstallPermission();
+            awtListener_private.installListeners(EventID.WINDOW);
+        }
+        windowListener_private = AWTEventMulticaster.add(windowListener_private, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#WINDOW WINDOW} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addWindowListener
+     */
+    static public void removeWindowListener(WindowListener l) {
+        windowListener_private = AWTEventMulticaster.remove(windowListener_private, l);
+        if (windowListener_private == null) {
+            awtListener_private.removeListeners(EventID.WINDOW);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#ACTION ACTION}
+     * events on each component instance in the Java Virtual Machine when they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeActionListener
+     */
+    static public void addActionListener(ActionListener l) {
+        if (actionListener_private == null) {
+            checkInstallPermission();
+            awtListener_private.installListeners(EventID.ACTION);
+        }
+        actionListener_private = AWTEventMulticaster.add(actionListener_private, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#ACTION ACTION} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addActionListener
+     */
+    static public void removeActionListener(ActionListener l) {
+        actionListener_private = AWTEventMulticaster.remove(actionListener_private, l);
+        if (actionListener_private == null) {
+            awtListener_private.removeListeners(EventID.ACTION);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all
+     * {@link EventID#ADJUSTMENT ADJUSTMENT} events on each component instance
+     * in the Java Virtual Machine when they occur.
+     * <P>Note: this listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeAdjustmentListener
+     */
+    static public void addAdjustmentListener(AdjustmentListener l) {
+        if (adjustmentListener_private == null) {
+            checkInstallPermission();
+            awtListener_private.installListeners(EventID.ADJUSTMENT);
+        }
+        adjustmentListener_private = AWTEventMulticaster.add(adjustmentListener_private, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#ADJUSTMENT ADJUSTMENT} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addAdjustmentListener
+     */
+    static public void removeAdjustmentListener(AdjustmentListener l) {
+        adjustmentListener_private = AWTEventMulticaster.remove(adjustmentListener_private, l);
+        if (adjustmentListener_private == null) {
+            awtListener_private.removeListeners(EventID.ADJUSTMENT);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#ITEM ITEM} events
+     * on each component instance in the Java Virtual Machine when they occur.
+     * <P>Note: this listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeItemListener
+     */
+    static public void addItemListener(ItemListener l) {
+        if (itemListener_private == null) {
+            checkInstallPermission();
+            awtListener_private.installListeners(EventID.ITEM);
+        }
+        itemListener_private = AWTEventMulticaster.add(itemListener_private, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives {@link EventID#ITEM ITEM}
+     * events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addItemListener
+     */
+    static public void removeItemListener(ItemListener l) {
+        itemListener_private = AWTEventMulticaster.remove(itemListener_private, l);
+        if (itemListener_private == null) {
+            awtListener_private.removeListeners(EventID.ITEM);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#TEXT TEXT} events
+     * on each component instance in the Java Virtual Machine when they occur.
+     * <P>Note: this listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeTextListener
+     */
+    static public void addTextListener(TextListener l) {
+        if (textListener_private == null) {
+            checkInstallPermission();
+            awtListener_private.installListeners(EventID.TEXT);
+        }
+        textListener_private = AWTEventMulticaster.add(textListener_private, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives {@link EventID#TEXT TEXT}
+     * events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addTextListener
+     */
+    static public void removeTextListener(TextListener l) {
+        textListener_private = AWTEventMulticaster.remove(textListener_private, l);
+        if (textListener_private == null) {
+            awtListener_private.removeListeners(EventID.TEXT);
+        }
+    }
+
+
+    /**
+     * AWTEventsListener is the class that does all the work for AWTEventMonitor.
+     * It is not intended for use by any other class except AWTEventMonitor.
+     *
+     */
+
+    static class AWTEventsListener implements TopLevelWindowListener,
+        ActionListener, AdjustmentListener, ComponentListener,
+        ContainerListener, FocusListener, ItemListener, KeyListener,
+        MouseListener, MouseMotionListener, TextListener, WindowListener,
+        ChangeListener {
+
+        /**
+         * internal variables for Action introspection
+         */
+        private java.lang.Class actionListeners[];
+        private java.lang.reflect.Method removeActionMethod;
+        private java.lang.reflect.Method addActionMethod;
+        private java.lang.Object actionArgs[];
+
+        /**
+         * internal variables for Item introspection
+         */
+        private java.lang.Class itemListeners[];
+        private java.lang.reflect.Method removeItemMethod;
+        private java.lang.reflect.Method addItemMethod;
+        private java.lang.Object itemArgs[];
+
+        /**
+         * internal variables for Text introspection
+         */
+        private java.lang.Class textListeners[];
+        private java.lang.reflect.Method removeTextMethod;
+        private java.lang.reflect.Method addTextMethod;
+        private java.lang.Object textArgs[];
+
+        /**
+         * internal variables for Window introspection
+         */
+        private java.lang.Class windowListeners[];
+        private java.lang.reflect.Method removeWindowMethod;
+        private java.lang.reflect.Method addWindowMethod;
+        private java.lang.Object windowArgs[];
+
+        /**
+         * Create a new instance of this class and install it on each component
+         * instance in the virtual machine that supports any of the currently
+         * registered listeners in AWTEventMonitor.  Also registers itself
+         * as a TopLevelWindowListener with EventQueueMonitor so it can
+         * automatically add new listeners to new components.
+         *
+         * @see EventQueueMonitor
+         * @see AWTEventMonitor
+         */
+        public AWTEventsListener() {
+            String version = System.getProperty("java.version");
+            if (version != null) {
+                runningOnJDK1_4 = (version.compareTo("1.4") >= 0);
+            }
+            initializeIntrospection();
+            installListeners();
+            if (runningOnJDK1_4) {
+                MenuSelectionManager.defaultManager().addChangeListener(this);
+            }
+            EventQueueMonitor.addTopLevelWindowListener(this);
+        }
+
+        /**
+         * Set up all of the variables needed for introspection
+         */
+        private boolean initializeIntrospection() {
+            try {
+                actionListeners = new java.lang.Class[1];
+                actionArgs = new java.lang.Object[1];
+                actionListeners[0] = Class.forName("java.awt.event.ActionListener");
+                actionArgs[0] = this;
+
+                itemListeners = new java.lang.Class[1];
+                itemArgs = new java.lang.Object[1];
+                itemListeners[0] = Class.forName("java.awt.event.ItemListener");
+                itemArgs[0] = this;
+
+                textListeners = new java.lang.Class[1];
+                textArgs = new java.lang.Object[1];
+                textListeners[0] = Class.forName("java.awt.event.TextListener");
+                textArgs[0] = this;
+
+                windowListeners = new java.lang.Class[1];
+                windowArgs = new java.lang.Object[1];
+                windowListeners[0] = Class.forName("java.awt.event.WindowListener");
+                windowArgs[0] = this;
+
+                return true;
+            } catch (ClassNotFoundException e) {
+                System.out.println("EXCEPTION - Class 'java.awt.event.*' not in CLASSPATH");
+                return false;
+            }
+        }
+
+        /**
+         * Installs all currently registered listeners on all components based
+         * upon the current topLevelWindows cached by EventQueueMonitor.
+         * @see EventQueueMonitor
+         * @see AWTEventMonitor
+         */
+        protected void installListeners() {
+            Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
+            if (topLevelWindows != null) {
+                for (int i = 0; i < topLevelWindows.length; i++) {
+                    installListeners(topLevelWindows[i]);
+                }
+            }
+        }
+
+        /**
+         * Installs listeners for the given event ID on all components based
+         * upon the current topLevelWindows cached by EventQueueMonitor.
+         * @see EventID
+         * @param eventID the event ID
+         */
+        protected void installListeners(int eventID) {
+            Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
+            if (topLevelWindows != null) {
+                for (int i = 0; i < topLevelWindows.length; i++) {
+                    installListeners(topLevelWindows[i], eventID);
+                }
+            }
+        }
+
+        /**
+         * Installs all currently registered listeners to just the component.
+         * @param c the component to add listeners to
+         */
+        protected void installListeners(Component c) {
+
+            // Container and focus listeners are always installed for our own use.
+            //
+            installListeners(c,EventID.CONTAINER);
+            installListeners(c,EventID.FOCUS);
+
+            // conditionally install low-level listeners
+            //
+            if (AWTEventMonitor.componentListener_private != null) {
+                installListeners(c,EventID.COMPONENT);
+            }
+            if (AWTEventMonitor.keyListener_private != null) {
+                installListeners(c,EventID.KEY);
+            }
+            if (AWTEventMonitor.mouseListener_private != null) {
+                installListeners(c,EventID.MOUSE);
+            }
+            if (AWTEventMonitor.mouseMotionListener_private != null) {
+                installListeners(c,EventID.MOTION);
+            }
+            if (AWTEventMonitor.windowListener_private != null) {
+                installListeners(c,EventID.WINDOW);
+            }
+
+            // conditionally install Semantic listeners
+            //
+            if (AWTEventMonitor.actionListener_private != null) {
+                installListeners(c,EventID.ACTION);
+            }
+            if (AWTEventMonitor.adjustmentListener_private != null) {
+                installListeners(c,EventID.ADJUSTMENT);
+            }
+            if (AWTEventMonitor.itemListener_private != null) {
+                installListeners(c,EventID.ITEM);
+            }
+            if (AWTEventMonitor.textListener_private != null) {
+                installListeners(c,EventID.TEXT);
+            }
+        }
+
+        public void stateChanged(ChangeEvent e) {
+            processFocusGained();
+        }
+
+        private void processFocusGained() {
+            Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
+            if (focusOwner == null) {
+                return;
+            }
+            MenuSelectionManager.defaultManager().removeChangeListener(this);
+            MenuSelectionManager.defaultManager().addChangeListener(this);
+
+            // Only menus and popup selections are handled by the JRootPane.
+            if (focusOwner instanceof JRootPane) {
+                MenuElement [] path =
+                    MenuSelectionManager.defaultManager().getSelectedPath();
+                if (path.length > 1) {
+                    Component penult = path[path.length-2].getComponent();
+                    Component last = path[path.length-1].getComponent();
+
+                    if (last instanceof JPopupMenu ||
+                        last instanceof JMenu) {
+                        // This is a popup with nothing in the popup
+                        // selected. The menu itself is selected.
+                        componentWithFocus_private = last;
+                    } else if (penult instanceof JPopupMenu) {
+                        // This is a popup with an item selected
+                        componentWithFocus_private = penult;
+                    }
+                }
+            } else {
+                // The focus owner has the selection.
+                componentWithFocus_private = focusOwner;
+            }
+        }
+
+        /**
+         * Installs the given listener on the component and any of its children.
+         * As a precaution, it always attempts to remove itself as a listener
+         * first so it's always guaranteed to have installed itself just once.
+         * @param c the component to add listeners to
+         * @param eventID the eventID to add listeners for
+         * @see EventID
+         */
+        protected void installListeners(Component c, int eventID) {
+
+            // install the appropriate listener hook into this component
+            //
+            switch (eventID) {
+
+            case EventID.ACTION:
+                try {
+                    removeActionMethod = c.getClass().getMethod(
+                        "removeActionListener", actionListeners);
+                    addActionMethod = c.getClass().getMethod(
+                        "addActionListener", actionListeners);
+                    try {
+                        removeActionMethod.invoke(c, actionArgs);
+                        addActionMethod.invoke(c, actionArgs);
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                break;
+
+            case EventID.ADJUSTMENT:
+                if (c instanceof Adjustable) {
+                    ((Adjustable) c).removeAdjustmentListener(this);
+                    ((Adjustable) c).addAdjustmentListener(this);
+                }
+                break;
+
+            case EventID.COMPONENT:
+                c.removeComponentListener(this);
+                c.addComponentListener(this);
+                break;
+
+            case EventID.CONTAINER:
+                if (c instanceof Container) {
+                    ((Container) c).removeContainerListener(this);
+                    ((Container) c).addContainerListener(this);
+                }
+                break;
+
+            case EventID.FOCUS:
+                c.removeFocusListener(this);
+                c.addFocusListener(this);
+
+                if (runningOnJDK1_4) {
+                    processFocusGained();
+
+                } else {        // not runningOnJDK1_4
+                    if ((c != componentWithFocus_private) && c.hasFocus()) {
+                        componentWithFocus_private = c;
+                    }
+                }
+                break;
+
+            case EventID.ITEM:
+                try {
+                    removeItemMethod = c.getClass().getMethod(
+                        "removeItemListener", itemListeners);
+                    addItemMethod = c.getClass().getMethod(
+                        "addItemListener", itemListeners);
+                    try {
+                        removeItemMethod.invoke(c, itemArgs);
+                        addItemMethod.invoke(c, itemArgs);
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                // [PK] CheckboxMenuItem isn't a component but it does
+                // implement Interface ItemSelectable!!
+                // if (c instanceof CheckboxMenuItem) {
+                //     ((CheckboxMenuItem) c).removeItemListener(this);
+                //     ((CheckboxMenuItem) c).addItemListener(this);
+                break;
+
+            case EventID.KEY:
+                c.removeKeyListener(this);
+                c.addKeyListener(this);
+                break;
+
+            case EventID.MOUSE:
+                c.removeMouseListener(this);
+                c.addMouseListener(this);
+                break;
+
+            case EventID.MOTION:
+                c.removeMouseMotionListener(this);
+                c.addMouseMotionListener(this);
+                break;
+
+            case EventID.TEXT:
+                try {
+                    removeTextMethod = c.getClass().getMethod(
+                        "removeTextListener", textListeners);
+                    addTextMethod = c.getClass().getMethod(
+                        "addTextListener", textListeners);
+                    try {
+                        removeTextMethod.invoke(c, textArgs);
+                        addTextMethod.invoke(c, textArgs);
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                break;
+
+            case EventID.WINDOW:
+                try {
+                    removeWindowMethod = c.getClass().getMethod(
+                        "removeWindowListener", windowListeners);
+                    addWindowMethod = c.getClass().getMethod(
+                        "addWindowListener", windowListeners);
+                    try {
+                        removeWindowMethod.invoke(c, windowArgs);
+                        addWindowMethod.invoke(c, windowArgs);
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                break;
+
+            // Don't bother recursing the children if this isn't going to
+            // accomplish anything.
+            //
+            default:
+                return;
+            }
+
+            // if this component is a container, recurse through children
+            //
+            if (c instanceof Container) {
+                int count = ((Container) c).getComponentCount();
+                for (int i = 0; i < count; i++) {
+                    installListeners(((Container) c).getComponent(i), eventID);
+                }
+            }
+        }
+
+        /**
+         * Removes all listeners for the given event ID on all components based
+         * upon the topLevelWindows cached by EventQueueMonitor.
+         * @param eventID the event ID
+         * @see EventID
+         */
+        protected void removeListeners(int eventID) {
+            Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
+            if (topLevelWindows != null) {
+                for (int i = 0; i < topLevelWindows.length; i++) {
+                    removeListeners(topLevelWindows[i], eventID);
+                }
+            }
+        }
+
+        /**
+         * Removes all listeners for the given component and all its children.
+         * @param c the component
+         */
+        protected void removeListeners(Component c) {
+
+            // conditionally remove low-level listeners
+            //
+            if (AWTEventMonitor.componentListener_private != null) {
+                removeListeners(c,EventID.COMPONENT);
+            }
+            if (AWTEventMonitor.keyListener_private != null) {
+                removeListeners(c,EventID.KEY);
+            }
+            if (AWTEventMonitor.mouseListener_private != null) {
+                removeListeners(c,EventID.MOUSE);
+            }
+            if (AWTEventMonitor.mouseMotionListener_private != null) {
+                removeListeners(c,EventID.MOTION);
+            }
+            if (AWTEventMonitor.windowListener_private != null) {
+                removeListeners(c,EventID.WINDOW);
+            }
+
+            // Remove semantic listeners
+            //
+            if (AWTEventMonitor.actionListener_private != null) {
+                removeListeners(c,EventID.ACTION);
+            }
+            if (AWTEventMonitor.adjustmentListener_private != null) {
+                removeListeners(c,EventID.ADJUSTMENT);
+            }
+            if (AWTEventMonitor.itemListener_private != null) {
+                removeListeners(c,EventID.ITEM);
+            }
+            if (AWTEventMonitor.textListener_private != null) {
+                removeListeners(c,EventID.TEXT);
+            }
+        }
+
+        /**
+         * Removes all listeners for the event ID from the component and all
+         * of its children.
+         * @param c the component to remove listeners from
+         * @see EventID
+         */
+        protected void removeListeners(Component c, int eventID) {
+
+            // remove the appropriate listener hook into this component
+            //
+            switch (eventID) {
+
+            case EventID.ACTION:
+                try {
+                    removeActionMethod = c.getClass().getMethod(
+                        "removeActionListener",
+                        actionListeners);
+                    try {
+                        removeActionMethod.invoke(c, actionArgs);
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                break;
+
+            case EventID.ADJUSTMENT:
+                if (c instanceof Adjustable) {
+                    ((Adjustable) c).removeAdjustmentListener(this);
+                }
+                break;
+
+            case EventID.COMPONENT:
+                c.removeComponentListener(this);
+                break;
+
+            // Never remove these because we're always interested in them
+            // for our own use.
+            //case EventID.CONTAINER:
+            //    if (c instanceof Container) {
+            //        ((Container) c).removeContainerListener(this);
+            //    }
+            //    break;
+            //
+            //case EventID.FOCUS:
+            //    c.removeFocusListener(this);
+            //    break;
+
+            case EventID.ITEM:
+                try {
+                    removeItemMethod = c.getClass().getMethod(
+                        "removeItemListener", itemListeners);
+                    try {
+                        removeItemMethod.invoke(c, itemArgs);
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                // [PK] CheckboxMenuItem isn't a component but it does
+                // implement Interface ItemSelectable!!
+                // if (c instanceof CheckboxMenuItem) {
+                //     ((CheckboxMenuItem) c).removeItemListener(this);
+                break;
+
+            case EventID.KEY:
+                c.removeKeyListener(this);
+                break;
+
+            case EventID.MOUSE:
+                c.removeMouseListener(this);
+                break;
+
+            case EventID.MOTION:
+                c.removeMouseMotionListener(this);
+                break;
+
+            case EventID.TEXT:
+                try {
+                    removeTextMethod = c.getClass().getMethod(
+                        "removeTextListener", textListeners);
+                    try {
+                        removeTextMethod.invoke(c, textArgs);
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                break;
+
+            case EventID.WINDOW:
+                try {
+                    removeWindowMethod = c.getClass().getMethod(
+                        "removeWindowListener", windowListeners);
+                    try {
+                        removeWindowMethod.invoke(c, windowArgs);
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                break;
+
+            default:
+                return;
+            }
+
+            if (c instanceof Container) {
+                int count = ((Container) c).getComponentCount();
+                for (int i = 0; i < count; i++) {
+                    removeListeners(((Container) c).getComponent(i), eventID);
+                }
+            }
+        }
+
+        /********************************************************************/
+        /*                                                                  */
+        /* Listener Interface Methods                                       */
+        /*                                                                  */
+        /********************************************************************/
+
+        /* TopLevelWindow Methods ***************************************/
+
+        /**
+         * Called when top level window is created.
+         * @see EventQueueMonitor
+         * @see EventQueueMonitor#addTopLevelWindowListener
+         */
+        public void topLevelWindowCreated(Window w) {
+            installListeners(w);
+        }
+
+        /**
+         * Called when top level window is destroyed.
+         * @see EventQueueMonitor
+         * @see EventQueueMonitor#addTopLevelWindowListener
+         */
+        public void topLevelWindowDestroyed(Window w) {
+        }
+
+        /* ActionListener Methods ***************************************/
+
+        /**
+         * Called when an action is performed.
+         * @see AWTEventMonitor#addActionListener
+         */
+        public void actionPerformed(ActionEvent e) {
+            if (AWTEventMonitor.actionListener_private != null) {
+                AWTEventMonitor.actionListener_private.actionPerformed(e);
+            }
+        }
+
+        /* AdjustmentListener Methods ***********************************/
+
+        /**
+         * Called when an adjustment is made.
+         * @see AWTEventMonitor#addAdjustmentListener
+         */
+        public void adjustmentValueChanged(AdjustmentEvent e) {
+            if (AWTEventMonitor.adjustmentListener_private != null) {
+                AWTEventMonitor.adjustmentListener_private.adjustmentValueChanged(e);
+            }
+        }
+
+        /* ComponentListener Methods ************************************/
+
+        /**
+         * Called when a component is hidden.
+         * @see AWTEventMonitor#addComponentListener
+         */
+        public void componentHidden(ComponentEvent e) {
+            if (AWTEventMonitor.componentListener_private != null) {
+                AWTEventMonitor.componentListener_private.componentHidden(e);
+            }
+        }
+
+        /**
+         * Called when a component is moved.
+         * @see AWTEventMonitor#addComponentListener
+         */
+        public void componentMoved(ComponentEvent e) {
+            if (AWTEventMonitor.componentListener_private != null) {
+                AWTEventMonitor.componentListener_private.componentMoved(e);
+            }
+        }
+
+        /**
+         * Called when a component is resized.
+         * @see AWTEventMonitor#addComponentListener
+         */
+        public void componentResized(ComponentEvent e) {
+            if (AWTEventMonitor.componentListener_private != null) {
+                AWTEventMonitor.componentListener_private.componentResized(e);
+            }
+        }
+
+        /**
+         * Called when a component is shown.
+         * @see AWTEventMonitor#addComponentListener
+         */
+        public void componentShown(ComponentEvent e) {
+            if (AWTEventMonitor.componentListener_private != null) {
+                AWTEventMonitor.componentListener_private.componentShown(e);
+            }
+        }
+
+        /* ContainerListener Methods ************************************/
+
+        /**
+         * Called when a component is added to a container.
+         * @see AWTEventMonitor#addContainerListener
+         */
+        public void componentAdded(ContainerEvent e) {
+            installListeners(e.getChild());
+            if (AWTEventMonitor.containerListener_private != null) {
+                AWTEventMonitor.containerListener_private.componentAdded(e);
+            }
+        }
+
+        /**
+         * Called when a component is removed from a container.
+         * @see AWTEventMonitor#addContainerListener
+         */
+        public void componentRemoved(ContainerEvent e) {
+            removeListeners(e.getChild());
+            if (AWTEventMonitor.containerListener_private != null) {
+                AWTEventMonitor.containerListener_private.componentRemoved(e);
+            }
+        }
+
+        /* FocusListener Methods ****************************************/
+
+        /**
+         * Called when a component gains keyboard focus.
+         * @see AWTEventMonitor#addFocusListener
+         */
+        public void focusGained(FocusEvent e) {
+            AWTEventMonitor.componentWithFocus_private = (Component) e.getSource();
+            if (AWTEventMonitor.focusListener_private != null) {
+                AWTEventMonitor.focusListener_private.focusGained(e);
+            }
+        }
+
+        /**
+         * Called when a component loses keyboard focus.
+         * @see AWTEventMonitor#addFocusListener
+         */
+        public void focusLost(FocusEvent e) {
+            AWTEventMonitor.componentWithFocus_private = null;
+            if (AWTEventMonitor.focusListener_private != null) {
+                AWTEventMonitor.focusListener_private.focusLost(e);
+            }
+        }
+
+        /* ItemListener Methods *****************************************/
+
+        /**
+         * Called when an item's state changes.
+         * @see AWTEventMonitor#addItemListener
+         */
+        public void itemStateChanged(ItemEvent e) {
+            if (AWTEventMonitor.itemListener_private != null) {
+                AWTEventMonitor.itemListener_private.itemStateChanged(e);
+            }
+        }
+
+        /* KeyListener Methods ******************************************/
+
+        /**
+         * Called when a key is pressed.
+         * @see AWTEventMonitor#addKeyListener
+         */
+        public void keyPressed(KeyEvent e) {
+            if (AWTEventMonitor.keyListener_private != null) {
+                AWTEventMonitor.keyListener_private.keyPressed(e);
+            }
+        }
+
+        /**
+         * Called when a key is typed.
+         * @see AWTEventMonitor#addKeyListener
+         */
+        public void keyReleased(KeyEvent e) {
+            if (AWTEventMonitor.keyListener_private != null) {
+                AWTEventMonitor.keyListener_private.keyReleased(e);
+            }
+        }
+
+        /**
+         * Called when a key is released.
+         * @see AWTEventMonitor#addKeyListener
+         */
+        public void keyTyped(KeyEvent e) {
+            if (AWTEventMonitor.keyListener_private != null) {
+                AWTEventMonitor.keyListener_private.keyTyped(e);
+            }
+        }
+
+        /* MouseListener Methods ****************************************/
+
+        /**
+         * Called when the mouse is clicked.
+         * @see AWTEventMonitor#addMouseListener
+         */
+        public void mouseClicked(MouseEvent e) {
+            if (AWTEventMonitor.mouseListener_private != null) {
+                AWTEventMonitor.mouseListener_private.mouseClicked(e);
+            }
+        }
+
+        /**
+         * Called when the mouse enters a component.
+         * @see AWTEventMonitor#addMouseListener
+         */
+        public void mouseEntered(MouseEvent e) {
+            if (AWTEventMonitor.mouseListener_private != null) {
+                AWTEventMonitor.mouseListener_private.mouseEntered(e);
+            }
+        }
+
+        /**
+         * Called when the mouse leaves a component.
+         * @see AWTEventMonitor#addMouseListener
+         */
+        public void mouseExited(MouseEvent e) {
+            if (AWTEventMonitor.mouseListener_private != null) {
+                AWTEventMonitor.mouseListener_private.mouseExited(e);
+            }
+        }
+
+        /**
+         * Called when the mouse is pressed.
+         * @see AWTEventMonitor#addMouseListener
+         */
+        public void mousePressed(MouseEvent e) {
+            if (AWTEventMonitor.mouseListener_private != null) {
+                AWTEventMonitor.mouseListener_private.mousePressed(e);
+            }
+        }
+
+        /**
+         * Called when the mouse is released.
+         * @see AWTEventMonitor#addMouseListener
+         */
+        public void mouseReleased(MouseEvent e) {
+            if (AWTEventMonitor.mouseListener_private != null) {
+                AWTEventMonitor.mouseListener_private.mouseReleased(e);
+            }
+        }
+
+        /* MouseMotionListener Methods **********************************/
+
+        /**
+         * Called when the mouse is dragged.
+         * @see AWTEventMonitor#addMouseMotionListener
+         */
+        public void mouseDragged(MouseEvent e) {
+            if (AWTEventMonitor.mouseMotionListener_private != null) {
+                AWTEventMonitor.mouseMotionListener_private.mouseDragged(e);
+            }
+        }
+
+        /**
+         * Called when the mouse is moved.
+         * @see AWTEventMonitor#addMouseMotionListener
+         */
+        public void mouseMoved(MouseEvent e) {
+            if (AWTEventMonitor.mouseMotionListener_private != null) {
+                AWTEventMonitor.mouseMotionListener_private.mouseMoved(e);
+            }
+        }
+
+        /* TextListener Methods *****************************************/
+
+        /**
+         * Called when a component's text value changed.
+         * @see AWTEventMonitor#addTextListener
+         */
+        public void textValueChanged(TextEvent e) {
+            if (AWTEventMonitor.textListener_private != null) {
+                AWTEventMonitor.textListener_private.textValueChanged(e);
+            }
+        }
+
+        /* WindowListener Methods ***************************************/
+
+        /**
+         * Called when a window is opened.
+         * @see AWTEventMonitor#addWindowListener
+         */
+        public void windowOpened(WindowEvent e) {
+            if (AWTEventMonitor.windowListener_private != null) {
+                AWTEventMonitor.windowListener_private.windowOpened(e);
+            }
+        }
+
+        /**
+         * Called when a window is in the process of closing.
+         * @see AWTEventMonitor#addWindowListener
+         */
+        public void windowClosing(WindowEvent e) {
+            if (AWTEventMonitor.windowListener_private != null) {
+                AWTEventMonitor.windowListener_private.windowClosing(e);
+            }
+        }
+
+        /**
+         * Called when a window is closed.
+         * @see AWTEventMonitor#addWindowListener
+         */
+        public void windowClosed(WindowEvent e) {
+            if (AWTEventMonitor.windowListener_private != null) {
+                AWTEventMonitor.windowListener_private.windowClosed(e);
+            }
+        }
+
+        /**
+         * Called when a window is iconified.
+         * @see AWTEventMonitor#addWindowListener
+         */
+        public void windowIconified(WindowEvent e) {
+            if (AWTEventMonitor.windowListener_private != null) {
+                AWTEventMonitor.windowListener_private.windowIconified(e);
+            }
+        }
+
+        /**
+         * Called when a window is deiconified.
+         * @see AWTEventMonitor#addWindowListener
+         */
+        public void windowDeiconified(WindowEvent e) {
+            if (AWTEventMonitor.windowListener_private != null) {
+                AWTEventMonitor.windowListener_private.windowDeiconified(e);
+            }
+        }
+
+        /**
+         * Called when a window is activated.
+         * @see AWTEventMonitor#addWindowListener
+         */
+        public void windowActivated(WindowEvent e) {
+            if (AWTEventMonitor.windowListener_private != null) {
+                AWTEventMonitor.windowListener_private.windowActivated(e);
+            }
+        }
+
+        /**
+         * Called when a window is deactivated.
+         * @see AWTEventMonitor#addWindowListener
+         */
+        public void windowDeactivated(WindowEvent e) {
+            if (AWTEventMonitor.windowListener_private != null) {
+                AWTEventMonitor.windowListener_private.windowDeactivated(e);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/java/accessibility/util/AccessibilityEventMonitor.java	Thu Jun 04 15:21:53 2015 -0700
@@ -0,0 +1,376 @@
+/*
+ * Copyright (c) 2002, 2015, 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.java.accessibility.util;
+
+import java.util.*;
+import java.beans.*;
+import java.awt.*;
+import java.awt.event.*;
+import javax.accessibility.*;
+
+/**
+ * <P>{@code AccessibilityEventMonitor} implements a PropertyChange listener
+ * on every UI object that implements interface {@code Accessible} in the Java
+ * Virtual Machine.  The events captured by these listeners are made available
+ * through listeners supported by {@code AccessibilityEventMonitor}.
+ * With this, all the individual events on each of the UI object
+ * instances are funneled into one set of PropertyChange listeners.
+ * <p>This class depends upon {@link EventQueueMonitor}, which provides the base
+ * level support for capturing the top-level containers as they are created.
+ *
+ */
+
+@jdk.Exported
+public class AccessibilityEventMonitor {
+
+    // listeners
+    /**
+     * The current list of registered {@link java.beans.PropertyChangeListener
+     * PropertyChangeListener} classes.
+     *
+     * @see #addPropertyChangeListener
+     * @see #removePropertyChangeListener
+     */
+    static protected final AccessibilityListenerList listenerList =
+        new AccessibilityListenerList();
+
+
+    /**
+     * The actual listener that is installed on the component instances.
+     * This listener calls the other registered listeners when an event
+     * occurs.  By doing things this way, the actual number of listeners
+     * installed on a component instance is drastically reduced.
+     */
+    static protected final AccessibilityEventListener accessibilityListener =
+        new AccessibilityEventListener();
+
+    /**
+     * Adds the specified listener to receive all PropertyChange events on
+     * each UI object instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to UI object instances that support this listener type.
+     *
+     * @param l the listener to add
+     *
+     * @see #removePropertyChangeListener
+     */
+    static public void addPropertyChangeListener(PropertyChangeListener l) {
+        if (listenerList.getListenerCount(PropertyChangeListener.class) == 0) {
+            accessibilityListener.installListeners();
+        }
+        listenerList.add(PropertyChangeListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives PropertyChange
+     * events when they occur.
+     * @see #addPropertyChangeListener
+     * @param l the listener to remove
+     */
+    static public void removePropertyChangeListener(PropertyChangeListener l) {
+        listenerList.remove(PropertyChangeListener.class, l);
+        if (listenerList.getListenerCount(PropertyChangeListener.class) == 0) {
+            accessibilityListener.removeListeners();
+        }
+    }
+
+
+    /**
+     * AccessibilityEventListener is the class that does all the work for
+     * AccessibilityEventMonitor.  It is not intended for use by any other
+     * class except AccessibilityEventMonitor.
+     *
+     */
+
+    static class AccessibilityEventListener implements TopLevelWindowListener,
+                PropertyChangeListener {
+
+        /**
+         * Create a new instance of this class and install it on each component
+         * instance in the virtual machine that supports any of the currently
+         * registered listeners in AccessibilityEventMonitor.  Also registers
+         * itself as a TopLevelWindowListener with EventQueueMonitor so it can
+         * automatically add new listeners to new components.
+         * @see EventQueueMonitor
+         * @see AccessibilityEventMonitor
+         */
+        public AccessibilityEventListener() {
+            EventQueueMonitor.addTopLevelWindowListener(this);
+        }
+
+        /**
+         * Installs PropertyChange listeners on all Accessible objects based
+         * upon the current topLevelWindows cached by EventQueueMonitor.
+         * @see EventQueueMonitor
+         * @see AWTEventMonitor
+         */
+        protected void installListeners() {
+            Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
+            if (topLevelWindows != null) {
+                for (int i = 0; i < topLevelWindows.length; i++) {
+                    if (topLevelWindows[i] instanceof Accessible) {
+                        installListeners((Accessible) topLevelWindows[i]);
+                    }
+                }
+            }
+        }
+
+        /**
+         * Installs PropertyChange listeners to the Accessible object, and it's
+         * children (so long as the object isn't of TRANSIENT state).
+         * @param a the Accessible object to add listeners to
+         */
+        protected void installListeners(Accessible a) {
+            installListeners(a.getAccessibleContext());
+        }
+
+        /**
+         * Installs PropertyChange listeners to the AccessibleContext object,
+         * and it's * children (so long as the object isn't of TRANSIENT state).
+         * @param a the Accessible object to add listeners to
+         */
+        private void installListeners(AccessibleContext ac) {
+
+            if (ac != null) {
+                AccessibleStateSet states = ac.getAccessibleStateSet();
+                if (!states.contains(AccessibleState.TRANSIENT)) {
+                    ac.addPropertyChangeListener(this);
+                    /*
+                     * Don't add listeners to transient children. Components
+                     * with transient children should return an AccessibleStateSet
+                     * containing AccessibleState.MANAGES_DESCENDANTS. Components
+                     * may not explicitly return the MANAGES_DESCENDANTS state.
+                     * In this case, don't add listeners to the children of
+                     * lists, tables and trees.
+                     */
+                    AccessibleStateSet set = ac.getAccessibleStateSet();
+                    if (set.contains(_AccessibleState.MANAGES_DESCENDANTS)) {
+                        return;
+                    }
+                    AccessibleRole role = ac.getAccessibleRole();
+                    if (role == AccessibleRole.LIST ||
+                        role == AccessibleRole.TREE) {
+                        return;
+                    }
+                    if (role == AccessibleRole.TABLE) {
+                        // handle Oracle tables containing tables
+                        Accessible child = ac.getAccessibleChild(0);
+                        if (child != null) {
+                            AccessibleContext ac2 = child.getAccessibleContext();
+                            if (ac2 != null) {
+                                role = ac2.getAccessibleRole();
+                                if (role != null && role != AccessibleRole.TABLE) {
+                                    return;
+                                }
+                            }
+                        }
+                    }
+                    int count = ac.getAccessibleChildrenCount();
+                    for (int i = 0; i < count; i++) {
+                        Accessible child = ac.getAccessibleChild(i);
+                        if (child != null) {
+                            installListeners(child);
+                        }
+                    }
+                }
+            }
+        }
+
+        /**
+         * Removes PropertyChange listeners on all Accessible objects based
+         * upon the topLevelWindows cached by EventQueueMonitor.
+         * @param eventID the event ID
+         * @see EventID
+         */
+        protected void removeListeners() {
+            Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
+            if (topLevelWindows != null) {
+                for (int i = 0; i < topLevelWindows.length; i++) {
+                    if (topLevelWindows[i] instanceof Accessible) {
+                        removeListeners((Accessible) topLevelWindows[i]);
+                    }
+                }
+            }
+        }
+
+        /**
+         * Removes PropertyChange listeners for the given Accessible object,
+         * it's children (so long as the object isn't of TRANSIENT state).
+         * @param a the Accessible object to remove listeners from
+         */
+        protected void removeListeners(Accessible a) {
+            removeListeners(a.getAccessibleContext());
+        }
+
+        /**
+         * Removes PropertyChange listeners for the given AccessibleContext
+         * object, it's children (so long as the object isn't of TRANSIENT
+         * state).
+         * @param a the Accessible object to remove listeners from
+         */
+        private void removeListeners(AccessibleContext ac) {
+
+
+            if (ac != null) {
+                // Listeners are not added to transient components.
+                AccessibleStateSet states = ac.getAccessibleStateSet();
+                if (!states.contains(AccessibleState.TRANSIENT)) {
+                    ac.removePropertyChangeListener(this);
+                    /*
+                     * Listeners are not added to transient children. Components
+                     * with transient children should return an AccessibleStateSet
+                     * containing AccessibleState.MANAGES_DESCENDANTS. Components
+                     * may not explicitly return the MANAGES_DESCENDANTS state.
+                     * In this case, don't remove listeners from the children of
+                     * lists, tables and trees.
+                     */
+                    if (states.contains(_AccessibleState.MANAGES_DESCENDANTS)) {
+                        return;
+                    }
+                    AccessibleRole role = ac.getAccessibleRole();
+                    if (role == AccessibleRole.LIST ||
+                        role == AccessibleRole.TABLE ||
+                        role == AccessibleRole.TREE) {
+                        return;
+                    }
+                    int count = ac.getAccessibleChildrenCount();
+                    for (int i = 0; i < count; i++) {
+                        Accessible child = ac.getAccessibleChild(i);
+                        if (child != null) {
+                            removeListeners(child);
+                        }
+                    }
+                }
+            }
+        }
+
+        /********************************************************************/
+        /*                                                                  */
+        /* Listener Interface Methods                                       */
+        /*                                                                  */
+        /********************************************************************/
+
+        /* TopLevelWindow Methods ***************************************/
+
+        /**
+         * Called when top level window is created.
+         * @see EventQueueMonitor
+         * @see EventQueueMonitor#addTopLevelWindowListener
+         */
+        public void topLevelWindowCreated(Window w) {
+            if (w instanceof Accessible) {
+                installListeners((Accessible) w);
+            }
+        }
+
+        /**
+         * Called when top level window is destroyed.
+         * @see EventQueueMonitor
+         * @see EventQueueMonitor#addTopLevelWindowListener
+         */
+        public void topLevelWindowDestroyed(Window w) {
+            if (w instanceof Accessible) {
+                removeListeners((Accessible) w);
+            }
+        }
+
+
+        /* PropertyChangeListener Methods **************************************/
+
+        public void propertyChange(PropertyChangeEvent e) {
+            // propogate the event
+            Object[] listeners =
+                    AccessibilityEventMonitor.listenerList.getListenerList();
+            for (int i = listeners.length-2; i>=0; i-=2) {
+                if (listeners[i]==PropertyChangeListener.class) {
+                    ((PropertyChangeListener)listeners[i+1]).propertyChange(e);
+                }
+            }
+
+            // handle childbirth/death
+            String name = e.getPropertyName();
+            if (name.compareTo(AccessibleContext.ACCESSIBLE_CHILD_PROPERTY) == 0) {
+                Object oldValue = e.getOldValue();
+                Object newValue = e.getNewValue();
+
+                if ((oldValue == null) ^ (newValue == null)) { // one null, not both
+                    if (oldValue != null) {
+                        // this Accessible is a child that's going away
+                        if (oldValue instanceof Accessible) {
+                            Accessible a = (Accessible) oldValue;
+                            removeListeners(a.getAccessibleContext());
+                        } else if (oldValue instanceof AccessibleContext) {
+                            removeListeners((AccessibleContext) oldValue);
+                        }
+                    } else if (newValue != null) {
+                        // this Accessible is a child was just born
+                        if (newValue instanceof Accessible) {
+                            Accessible a = (Accessible) newValue;
+                            installListeners(a.getAccessibleContext());
+                        } else if (newValue instanceof AccessibleContext) {
+                            installListeners((AccessibleContext) newValue);
+                        }
+                    }
+                } else {
+                    System.out.println("ERROR in usage of PropertyChangeEvents for: " + e.toString());
+                }
+            }
+        }
+    }
+}
+
+/*
+ * workaround for no public AccessibleState constructor
+ */
+class _AccessibleState extends AccessibleState {
+    /**
+     * Indicates this object is responsible for managing its
+     * subcomponents.  This is typically used for trees and tables
+     * that have a large number of subcomponents and where the
+     * objects are created only when needed and otherwise remain virtual.
+     * The application should not manage the subcomponents directly.
+     */
+    public static final _AccessibleState MANAGES_DESCENDANTS
+        = new _AccessibleState ("managesDescendants");
+
+    /**
+     * Creates a new AccessibleState using the given locale independent key.
+     * This should not be a public method.  Instead, it is used to create
+     * the constants in this file to make it a strongly typed enumeration.
+     * Subclasses of this class should enforce similar policy.
+     * <p>
+     * The key String should be a locale independent key for the state.
+     * It is not intended to be used as the actual String to display
+     * to the user.  To get the localized string, use toDisplayString.
+     *
+     * @param key the locale independent name of the state.
+     * @see AccessibleBundle#toDisplayString
+     */
+    protected _AccessibleState(String key) {
+        super(key);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/java/accessibility/util/AccessibilityListenerList.java	Thu Jun 04 15:21:53 2015 -0700
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2005, 2015, 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.java.accessibility.util;
+
+import java.util.*;
+import java.beans.*;
+import java.awt.*;
+import java.awt.event.*;
+import javax.accessibility.*;
+
+/**
+ * <P>The {@code AccessibilityListenerList} is a copy of the Swing
+ * {@link javax.swing.event.EventListenerList EventListerList} class.
+ *
+ */
+
+@jdk.Exported
+public class AccessibilityListenerList {
+    /* A null array to be shared by all empty listener lists */
+    private final static Object[] NULL_ARRAY = new Object[0];
+
+    /**
+     * The list of listener type, listener pairs
+     */
+    protected transient Object[] listenerList = NULL_ARRAY;
+
+    /**
+     * Passes back the event listener list as an array of listener type, listener pairs.
+     * Note that for performance reasons, this implementation passes back the actual
+     * data structure in which the listener data is stored internally. This method
+     * is guaranteed to pass back a non-null array, so that no null-checking
+     * is required in fire methods. A zero-length array of Object is returned if
+     * there are currently no listeners.
+     * <p>
+     * Absolutely no modification of the data contained in this array should be
+     * made.  If any such manipulation is necessary, it should be done on a copy
+     * of the array returned rather than the array itself.
+     *
+     * @return an array of listener type, listener pairs.
+     */
+    public Object[] getListenerList() {
+        return listenerList;
+    }
+
+    /**
+     * Returns the total number of listeners for this listener list.
+     *
+     * @return the total number of listeners for this listener list.
+     */
+    public int getListenerCount() {
+        return listenerList.length/2;
+    }
+
+    /**
+     * Return the total number of listeners of the supplied type
+     * for this listener list.
+     *
+     * @param t the type of the listener to be counted
+     * @return the number of listeners found
+     */
+    public int getListenerCount(Class t) {
+        int count = 0;
+        Object[] lList = listenerList;
+        for (int i = 0; i < lList.length; i+=2) {
+            if (t == (Class)lList[i])
+                count++;
+        }
+        return count;
+    }
+
+    /**
+     * Add the listener as a listener of the specified type.
+     *
+     * @param t the type of the listener to be added
+     * @param l the listener to be added
+     */
+    public synchronized void add(Class t, EventListener l) {
+        if (!t.isInstance(l)) {
+            throw new IllegalArgumentException("Listener " + l +
+                                         " is not of type " + t);
+        }
+        if (l ==null) {
+            throw new IllegalArgumentException("Listener " + l +
+                                         " is null");
+        }
+        if (listenerList == NULL_ARRAY) {
+            // if this is the first listener added,
+            // initialize the lists
+            listenerList = new Object[] { t, l };
+        } else {
+            // Otherwise copy the array and add the new listener
+            int i = listenerList.length;
+            Object[] tmp = new Object[i+2];
+            System.arraycopy(listenerList, 0, tmp, 0, i);
+
+            tmp[i] = t;
+            tmp[i+1] = l;
+
+            listenerList = tmp;
+        }
+    }
+
+    /**
+     * Remove the listener as a listener of the specified type.
+     *
+     * @param t the type of the listener to be removed
+     * @param l the listener to be removed
+     */
+    public synchronized void remove(Class t, EventListener l) {
+        if (!t.isInstance(l)) {
+            throw new IllegalArgumentException("Listener " + l +
+                                         " is not of type " + t);
+        }
+        if (l ==null) {
+            throw new IllegalArgumentException("Listener " + l +
+                                         " is null");
+        }
+
+        // Is l on the list?
+        int index = -1;
+        for (int i = listenerList.length-2; i>=0; i-=2) {
+            if ((listenerList[i]==t) && (listenerList[i+1] == l)) {
+                index = i;
+                break;
+            }
+        }
+
+        // If so,  remove it
+        if (index != -1) {
+            Object[] tmp = new Object[listenerList.length-2];
+            // Copy the list up to index
+            System.arraycopy(listenerList, 0, tmp, 0, index);
+            // Copy from two past the index, up to
+            // the end of tmp (which is two elements
+            // shorter than the old list)
+            if (index < tmp.length)
+                System.arraycopy(listenerList, index+2, tmp, index,
+                                 tmp.length - index);
+            // set the listener array to the new array or null
+            listenerList = (tmp.length == 0) ? NULL_ARRAY : tmp;
+            }
+    }
+
+    /**
+     * Return a string representation of the {@code AccessibilityListenerList}.
+     *
+     * @return a string representation of the {@code AccessibilityListenerList}.
+     */
+    public String toString() {
+        Object[] lList = listenerList;
+        String s = "EventListenerList: ";
+        s += lList.length/2 + " listeners: ";
+        for (int i = 0 ; i <= lList.length-2 ; i+=2) {
+            s += " type " + ((Class)lList[i]).getName();
+            s += " listener " + lList[i+1];
+        }
+        return s;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/java/accessibility/util/EventID.java	Thu Jun 04 15:21:53 2015 -0700
@@ -0,0 +1,206 @@
+/*
+ * Copyright (c) 2002, 2015, 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.java.accessibility.util;
+
+/**
+ * EventID contains integer constants that map to event support in
+ * AWT and Swing.  They are used by primarily by AWTEventMonitor,
+ * AWTEventsListener, SwingEventMonitor, and SwingEventListener, but
+ * can be freely used by any other class.
+ *
+ * @see AWTEventMonitor
+ * @see SwingEventMonitor
+ *
+ */
+@jdk.Exported
+public class EventID {
+
+    /**
+     * Maps to AWT Action support (i.e., ActionListener and ActionEvent)
+     */
+    static public final int ACTION              = 0;
+
+    /**
+     * Maps to AWT Adjustment support (i.e., AdjustmentListener
+     * and AdjustmentEvent)
+     */
+    static public final int ADJUSTMENT          = 1;
+
+    /**
+     * Maps to AWT Component support (i.e., ComponentListener
+     * and ComponentEvent)
+     */
+    static public final int COMPONENT           = 2;
+
+    /**
+     * Maps to AWT Container support (i.e., ContainerListener
+     * and ContainerEvent)
+     */
+    static public final int CONTAINER           = 3;
+
+    /**
+     * Maps to AWT Focus support (i.e., FocusListener and FocusEvent)
+     */
+    static public final int FOCUS               = 4;
+
+    /**
+     * Maps to AWT Item support (i.e., ItemListener and ItemEvent)
+     */
+    static public final int ITEM                = 5;
+
+    /**
+     * Maps to AWT Key support (i.e., KeyListener and KeyEvent)
+     */
+    static public final int KEY                 = 6;
+
+    /**
+     * Maps to AWT Mouse support (i.e., MouseListener and MouseEvent)
+     */
+    static public final int MOUSE               = 7;
+
+    /**
+     * Maps to AWT MouseMotion support (i.e., MouseMotionListener
+     * and MouseMotionEvent)
+     */
+    static public final int MOTION              = 8;
+
+    /**
+     * Maps to AWT Text support (i.e., TextListener and TextEvent)
+     */
+    static public final int TEXT                = 10;
+
+    /**
+     * Maps to AWT Window support (i.e., WindowListener and WindowEvent)
+     */
+    static public final int WINDOW              = 11;
+
+    /**
+     * Maps to Swing Ancestor support (i.e., AncestorListener and
+     * AncestorEvent)
+     */
+    static public final int ANCESTOR           = 12;
+
+    /**
+     * Maps to Swing Text Caret support (i.e., CaretListener and
+     * CaretEvent)
+     */
+    static public final int CARET              = 13;
+
+    /**
+     * Maps to Swing CellEditor support (i.e., CellEditorListener and
+     * CellEditorEvent)
+     */
+    static public final int CELLEDITOR         = 14;
+
+    /**
+     * Maps to Swing Change support (i.e., ChangeListener and
+     * ChangeEvent)
+     */
+    static public final int CHANGE             = 15;
+
+    /**
+     * Maps to Swing TableColumnModel support (i.e.,
+     * TableColumnModelListener and TableColumnModelEvent)
+     */
+    static public final int COLUMNMODEL        = 16;
+
+    /**
+     * Maps to Swing Document support (i.e., DocumentListener and
+     * DocumentEvent)
+     */
+    static public final int DOCUMENT           = 17;
+
+    /**
+     * Maps to Swing ListData support (i.e., ListDataListener and
+     * ListDataEvent)
+     */
+    static public final int LISTDATA           = 18;
+
+    /**
+     * Maps to Swing ListSelection support (i.e., ListSelectionListener and
+     * ListSelectionEvent)
+     */
+    static public final int LISTSELECTION      = 19;
+
+    /**
+     * Maps to Swing Menu support (i.e., MenuListener and
+     * MenuEvent)
+     */
+    static public final int MENU               = 20;
+
+    /**
+     * Maps to Swing PopupMenu support (i.e., PopupMenuListener and
+     * PopupMenuEvent)
+     */
+    static public final int POPUPMENU          = 21;
+
+    /**
+     * Maps to Swing TableModel support (i.e., TableModelListener and
+     * TableModelEvent)
+     */
+    static public final int TABLEMODEL         = 22;
+
+    /**
+     * Maps to Swing TreeExpansion support (i.e., TreeExpansionListener and
+     * TreeExpansionEvent)
+     */
+    static public final int TREEEXPANSION      = 23;
+
+    /**
+     * Maps to Swing TreeModel support (i.e., TreeModelListener and
+     * TreeModelEvent)
+     */
+    static public final int TREEMODEL          = 24;
+
+    /**
+     * Maps to Swing TreeSelection support (i.e., TreeSelectionListener and
+     * TreeSelectionEvent)
+     */
+    static public final int TREESELECTION      = 25;
+
+    /**
+     * Maps to Swing UndoableEdit support (i.e., UndoableEditListener and
+     * UndoableEditEvent)
+     */
+    static public final int UNDOABLEEDIT       = 26;
+
+    /**
+     * Maps to Beans PropertyChange support (i.e., PropertyChangeListener
+     * and PropertyChangeEvent)
+     */
+    static public final int PROPERTYCHANGE     = 27;
+
+    /**
+     * Maps to Beans VetoableChange support (i.e., VetoableChangeListener
+     * and VetoableChangeEvent)
+     */
+    static public final int VETOABLECHANGE     = 28;
+
+    /**
+     * Maps to Swing InternalFrame support (i.e., InternalFrameListener)
+     */
+    static public final int INTERNALFRAME      = 29;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/java/accessibility/util/EventQueueMonitor.java	Thu Jun 04 15:21:53 2015 -0700
@@ -0,0 +1,619 @@
+/*
+ * Copyright (c) 2002, 2015, 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.java.accessibility.util;
+
+import java.util.*;
+import java.awt.*;
+import java.awt.event.*;
+import javax.accessibility.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * The {@code EventQueueMonitor} class provides key core functionality for Assistive
+ * Technologies (and other system-level technologies that need some of the same
+ * things that Assistive Technology needs).
+ *
+ * @see AWTEventMonitor
+ * @see SwingEventMonitor
+ */
+@jdk.Exported
+public class EventQueueMonitor
+        implements AWTEventListener {
+
+    // NOTE:  All of the following properties are static.  The reason
+    //        for this is that there may be multiple EventQueue instances
+    //        in use in the same VM.  By making these properties static,
+    //        we can guarantee we get the information from all of the
+    //        EventQueue instances.
+
+    // The stuff that is cached.
+    //
+    static Vector topLevelWindows          = new Vector();
+    static Window topLevelWindowWithFocus  = null;
+    static Point currentMousePosition      = null;
+    static Component currentMouseComponent = null;
+
+    // Low-level listener interfaces
+    //
+    static GUIInitializedListener guiInitializedListener = null;
+    static TopLevelWindowListener topLevelWindowListener = null;
+    static MouseMotionListener    mouseMotionListener    = null;
+
+    /**
+     * Class variable stating whether the assistive technologies have
+     * been loaded yet or not.  The assistive technologies won't be
+     * loaded until the first event is posted to the EventQueue.  This
+     * gives the toolkit a chance to do all the necessary initialization
+     * it needs to do.
+     */
+
+    /**
+     * Class variable stating whether the GUI subsystem has been initialized
+     * or not.
+     *
+     * @see #isGUIInitialized
+     */
+    static boolean guiInitialized = false;
+
+    /**
+     * Queue that holds events for later processing.
+     */
+    static EventQueueMonitorItem componentEventQueue = null;
+
+    /**
+     * Class that tells us what the component event dispatch thread is.
+     */
+    static private ComponentEvtDispatchThread cedt = null;
+
+    /**
+     * Handle the synchronization between the thing that populates the
+     * component event dispatch thread ({@link #queueComponentEvent})
+     * and the thing that processes the events ({@link ComponentEvtDispatchThread}).
+     */
+    static Object componentEventQueueLock = new Object();
+
+    /**
+     * Create a new {@code EventQueueMonitor} instance.  Normally, this will
+     * be called only by the AWT Toolkit during initialization time.
+     * Assistive technologies should not create instances of
+     * EventQueueMonitor by themselves.  Instead, they should either
+     * refer to it directly via the static methods in this class, e.g.,
+     * {@link #getCurrentMousePosition} or obtain the instance by asking the
+     * Toolkit, e.g., {@link java.awt.Toolkit#getSystemEventQueue}.
+     */
+    public EventQueueMonitor() {
+        if (cedt == null) {
+            cedt = new ComponentEvtDispatchThread("EventQueueMonitor-ComponentEvtDispatch");
+
+            cedt.setDaemon(true);
+            cedt.start();
+        }
+    }
+
+    /**
+     * Queue up a {@link java.awt.event.ComponentEvent ComponentEvent} for later
+     * processing by the {@link ComponentEvtDispatch} thread.
+     *
+     * @param e a {@code ComponentEvent}
+     */
+    static void queueComponentEvent(ComponentEvent e) {
+        synchronized(componentEventQueueLock) {
+            EventQueueMonitorItem eqi = new EventQueueMonitorItem(e);
+            if (componentEventQueue == null) {
+                componentEventQueue = eqi;
+            } else {
+                EventQueueMonitorItem q = componentEventQueue;
+                while (true) {
+                    if (q.next != null) {
+                        q = q.next;
+                    } else {
+                        break;
+                    }
+                }
+                q.next = eqi;
+            }
+            componentEventQueueLock.notifyAll();
+        }
+    }
+
+    /**
+     * Tell the {@code EventQueueMonitor} to start listening for events.
+     */
+    public static void maybeInitialize() {
+        if (cedt == null) {
+            java.security.AccessController.doPrivileged(
+                new java.security.PrivilegedAction() {
+                    public Object run() {
+                        try {
+                            long eventMask = AWTEvent.WINDOW_EVENT_MASK |
+                                AWTEvent.FOCUS_EVENT_MASK |
+                                AWTEvent.MOUSE_MOTION_EVENT_MASK;
+
+                            Toolkit.getDefaultToolkit().addAWTEventListener(new EventQueueMonitor(), eventMask);
+                        } catch (Exception e) {
+                        }
+                        return null;
+                    }
+                }
+            );
+        }
+    }
+
+    /**
+     * Handle events as a result of registering a listener
+     * on the {@link java.awt.EventQueue EventQueue} in {@link #maybeInitialize}.
+     */
+    public void eventDispatched(AWTEvent theEvent) {
+        processEvent(theEvent);
+    }
+
+    /**
+     * Assisitive technologies that have
+     * registered a {@link GUIInitializedListener} will be notified.
+     *
+     * @see #addGUIInitializedListener
+     */
+    static void maybeNotifyAssistiveTechnologies() {
+
+        if (!guiInitialized) {
+            guiInitialized = true;
+            if (guiInitializedListener != null) {
+                guiInitializedListener.guiInitialized();
+            }
+        }
+
+    }
+
+    /********************************************************************/
+    /*                                                                  */
+    /* Package Private Methods                                          */
+    /*                                                                  */
+    /********************************************************************/
+
+    /**
+     * Add a Container to the list of top-level containers
+     * in the cache.  This follows the object's hierarchy up the
+     * tree until it finds the top most parent.  If the parent is
+     * not already in the list of Containers, it adds it to the list.
+     *
+     * @param c the Container
+     */
+    static void addTopLevelWindow(Component c) {
+        Container parent;
+
+        if (c == null) {
+            return;
+        }
+
+        if (!(c instanceof Window)) {
+            addTopLevelWindow(c.getParent());
+            return;
+        }
+
+        if ((c instanceof Dialog) || (c instanceof Window)) {
+            parent = (Container) c;
+        } else {
+            parent = c.getParent();
+            if (parent != null) {
+                addTopLevelWindow(parent);
+                return;
+            }
+        }
+
+        if (parent == null) {
+            parent = (Container) c;
+        }
+
+        // Because this method is static, do not make it synchronized because
+        // it can lock the whole class.  Instead, just lock what needs to be
+        // locked.
+        //
+        synchronized (topLevelWindows) {
+            if ((parent != null) && !topLevelWindows.contains(parent)) {
+                topLevelWindows.addElement(parent);
+                if (topLevelWindowListener != null) {
+                    topLevelWindowListener.topLevelWindowCreated((Window) parent);
+                }
+            }
+        }
+    }
+
+    /**
+     * Removes a container from the list of top level containers in the cache.
+     *
+     * @param c the top level container to remove
+     */
+    static void removeTopLevelWindow(Window w) {
+
+        // Because this method is static, do not make it synchronized because
+        // it can lock the whole class.  Instead, just lock what needs to be
+        // locked.
+        //
+        synchronized (topLevelWindows) {
+            if (topLevelWindows.contains(w)) {
+                topLevelWindows.removeElement(w);
+                if (topLevelWindowListener != null) {
+                    topLevelWindowListener.topLevelWindowDestroyed(w);
+                }
+            }
+        }
+    }
+
+    /**
+     * Update current mouse position.
+     *
+     * @param mouseEvent the MouseEvent that holds the new mouse position.
+     */
+    static void updateCurrentMousePosition(MouseEvent mouseEvent) {
+        Point oldMousePos = currentMousePosition;
+        // Be careful here.  The component in the event might be
+        // hidden by the time we process the event.
+        try {
+            Point eventPoint      = mouseEvent.getPoint();
+            currentMouseComponent = (Component) (mouseEvent.getSource());
+            currentMousePosition  = currentMouseComponent.getLocationOnScreen();
+            currentMousePosition.translate(eventPoint.x,eventPoint.y);
+        } catch (Exception e) {
+            currentMousePosition = oldMousePos;
+        }
+    }
+
+    /**
+     * Process the event.  This maintains the event cache in addition
+     * to calling all the registered listeners.  NOTE: The events that
+     * come through here are from peered Components.
+     *
+     * @param theEvent the AWTEvent
+     */
+    static void processEvent(AWTEvent theEvent) {
+        switch (theEvent.getID()) {
+        case MouseEvent.MOUSE_MOVED:
+        case MouseEvent.MOUSE_DRAGGED:
+        case FocusEvent.FOCUS_GAINED:
+        case WindowEvent.WINDOW_DEACTIVATED:
+            queueComponentEvent((ComponentEvent) theEvent);
+            break;
+
+        case WindowEvent.WINDOW_ACTIVATED:
+            // Dialogs fire WINDOW_ACTIVATED and FOCUS_GAINED events
+            // before WINDOW_OPENED so we need to add topLevelListeners
+            // for the dialog when it is first activated to get a
+            // focus gained event for the focus component in the dialog.
+            if (theEvent instanceof ComponentEvent) {
+                ComponentEvent ce = (ComponentEvent)theEvent;
+                if (ce.getComponent() instanceof Window) {
+                    EventQueueMonitor.addTopLevelWindow(ce.getComponent());
+                    EventQueueMonitor.maybeNotifyAssistiveTechnologies();
+                } else {
+                    EventQueueMonitor.maybeNotifyAssistiveTechnologies();
+                    EventQueueMonitor.addTopLevelWindow(ce.getComponent());
+                }
+            }
+            queueComponentEvent((ComponentEvent) theEvent);
+            break;
+
+            // handle WINDOW_OPENED and WINDOW_CLOSED events synchronously
+        case WindowEvent.WINDOW_OPENED:
+            if (theEvent instanceof ComponentEvent) {
+                ComponentEvent ce = (ComponentEvent)theEvent;
+                if (ce.getComponent() instanceof Window) {
+                    EventQueueMonitor.addTopLevelWindow(ce.getComponent());
+                    EventQueueMonitor.maybeNotifyAssistiveTechnologies();
+                } else {
+                    EventQueueMonitor.maybeNotifyAssistiveTechnologies();
+                    EventQueueMonitor.addTopLevelWindow(ce.getComponent());
+                }
+            }
+            break;
+        case WindowEvent.WINDOW_CLOSED:
+            if (theEvent instanceof ComponentEvent) {
+                ComponentEvent ce = (ComponentEvent)theEvent;
+                EventQueueMonitor.removeTopLevelWindow((Window) (ce.getComponent()));
+            }
+            break;
+
+        default:
+            break;
+        }
+    }
+
+    /**
+     * Internal test
+     */
+    static synchronized Component getShowingComponentAt(Container c, int x, int y) {
+        if (!c.contains(x, y)) {
+            return null;
+        }
+        int ncomponents = c.getComponentCount();
+        for (int i = 0 ; i < ncomponents ; i++) {
+            Component comp = c.getComponent(i);
+            if (comp != null && comp.isShowing()) {
+                Point location = comp.getLocation();
+                if (comp.contains(x - location.x, y - location.y)) {
+                    return comp;
+                }
+            }
+        }
+        return c;
+    }
+
+    /**
+     * Return the Component at the given Point on the screen in the
+     * given Container.
+     *
+     * @param c the Container to search
+     * @param p the Point in screen coordinates
+     * @return the Component at the given Point on the screen in the
+     * given Container -- can be null if no Component is at that Point
+     */
+    static synchronized Component getComponentAt(Container c, Point p) {
+        if (!c.isShowing()) {
+            return null;
+        }
+
+        Component comp;
+        Point containerLoc = c.getLocationOnScreen();
+        Point containerPoint = new Point(p.x - containerLoc.x,
+                                         p.y - containerLoc.y);
+
+        comp = getShowingComponentAt(c, containerPoint.x, containerPoint.y);
+
+        if ((comp != c) && (comp instanceof Container)) {
+            return getComponentAt((Container)comp,p);
+        } else {
+            return comp;
+        }
+    }
+
+    /**
+     * Obtain the {@link javax.accessibility.Accessible Accessible} object at the given point on the Screen.
+     * The return value may be null if an {@code Accessible} object cannot be
+     * found at the particular point.
+     *
+     * @param p the point to be accessed
+     * @return the {@code Accessible} at the specified point
+     */
+    static public Accessible getAccessibleAt(Point p) {
+        Window w = getTopLevelWindowWithFocus();
+        Window[] wins = getTopLevelWindows();
+        Component c = null;
+
+        // See if the point we're being asked about is the
+        // currentMousePosition.  If so, start with the component
+        // that we know the currentMousePostion is over
+        //
+        if (currentMousePosition == null) {
+            return null;
+        }
+        if (currentMousePosition.equals(p)) {
+            if (currentMouseComponent instanceof Container) {
+                c = getComponentAt((Container) currentMouseComponent, p);
+            }
+        }
+
+        // Try the window with focus next
+        //
+        if (c == null && w != null) {
+            c = getComponentAt(w,p);
+        }
+
+        // Try the other windows next.  [[[WDW: Stacking order???]]]
+        if (c == null) {
+            for (int i = 0; i < wins.length; i++) {
+                c = getComponentAt(wins[i],p);
+                if (c != null) {
+                    break;
+                }
+            }
+        }
+
+        if (c instanceof Accessible) {
+            AccessibleContext ac = ((Accessible) c).getAccessibleContext();
+            if (ac != null) {
+                AccessibleComponent acmp = ac.getAccessibleComponent();
+                if ((acmp != null) && (ac.getAccessibleChildrenCount() != 0)) {
+                    Point location = acmp.getLocationOnScreen();
+                    location.move(p.x - location.x, p.y - location.y);
+                    return acmp.getAccessibleAt(location);
+                }
+            }
+            return (Accessible) c;
+        } else {
+            return Translator.getAccessible(c);
+        }
+    }
+
+    /********************************************************************/
+    /*                                                                  */
+    /* Public Methods                                                   */
+    /*                                                                  */
+    /********************************************************************/
+
+    /**
+     * Says whether the GUI subsystem has been initialized or not.
+     * If this returns true, the assistive technology can freely
+     * create GUI component instances.  If the return value is false,
+     * the assistive technology should register a {@link GUIInitializedListener}
+     * and wait to create GUI component instances until the listener is
+     * called.
+     *
+     * @return true if the GUI subsystem has been initialized
+     * @see #addGUIInitializedListener
+     */
+    static public boolean isGUIInitialized() {
+        maybeInitialize();
+        return guiInitialized;
+    }
+
+    /**
+     * Adds the specified listener to be notified when the GUI subsystem
+     * is initialized.  Assistive technologies should get the results of
+     * {@link #isGUIInitialized} before calling this method.
+     *
+     * @param l the listener to add
+     * @see #isGUIInitialized
+     * @see #removeTopLevelWindowListener
+     */
+    static public void addGUIInitializedListener(GUIInitializedListener l) {
+        maybeInitialize();
+        guiInitializedListener =
+            GUIInitializedMulticaster.add(guiInitializedListener,l);
+    }
+
+    /**
+     * Removes the specified listener to be notified when the GUI subsystem
+     * is initialized.
+     *
+     * @param l the listener to remove
+     * @see #addGUIInitializedListener
+     */
+    static public void removeGUIInitializedListener(GUIInitializedListener l) {
+        guiInitializedListener =
+            GUIInitializedMulticaster.remove(guiInitializedListener,l);
+    }
+
+    /**
+     * Adds the specified listener to be notified when a top level window
+     * is created or destroyed.
+     *
+     * @param l the listener to add
+     * @see #removeTopLevelWindowListener
+     */
+    static public void addTopLevelWindowListener(TopLevelWindowListener l) {
+        topLevelWindowListener =
+            TopLevelWindowMulticaster.add(topLevelWindowListener,l);
+    }
+
+    /**
+     * Removes the specified listener to be notified when a top level window
+     * is created or destroyed.
+     *
+     * @param l the listener to remove
+     * @see #addTopLevelWindowListener
+     */
+    static public void removeTopLevelWindowListener(TopLevelWindowListener l) {
+        topLevelWindowListener =
+            TopLevelWindowMulticaster.remove(topLevelWindowListener,l);
+    }
+
+    /**
+     * Return the last recorded position of the mouse in screen coordinates.
+     *
+     * @return the last recorded position of the mouse in screen coordinates
+     */
+    static public Point getCurrentMousePosition() {
+        return currentMousePosition;
+    }
+
+    /**
+     * Return the list of top level Windows in use in the Java Virtual Machine.
+     *
+     * @return an array of top level {@code Window}s in use in the Java Virtual Machine
+     */
+    static public Window[] getTopLevelWindows() {
+
+        // Because this method is static, do not make it synchronized because
+        // it can lock the whole class.  Instead, just lock what needs to be
+        // locked.
+        //
+        synchronized (topLevelWindows) {
+            int count = topLevelWindows.size();
+            if (count > 0) {
+                Window[] w = new Window[count];
+                for (int i = 0; i < count; i++) {
+                    w[i] = (Window)topLevelWindows.elementAt(i);
+                }
+                return w;
+            } else {
+                return new Window[0];
+            }
+        }
+    }
+
+    /**
+     * Return the top level {@code Window} that currently has keyboard focus.
+     *
+     * @return the top level {@code Window} that currently has keyboard focus
+     */
+    static public Window getTopLevelWindowWithFocus() {
+        return topLevelWindowWithFocus;
+    }
+}
+
+/**
+ * Handle all Component events in a separate thread.  The reason for this is
+ * that WindowEvents tend to be used to do lots of processing on the Window
+ * hierarchy.  As a result, it can frequently result in deadlock situations.
+ */
+class ComponentEvtDispatchThread extends Thread {
+    public ComponentEvtDispatchThread(String name) {
+        super(name);
+    }
+    public void run() {
+        ComponentEvent ce = null;
+        while (true) {
+            synchronized(EventQueueMonitor.componentEventQueueLock) {
+                while (EventQueueMonitor.componentEventQueue == null) {
+                    try {
+                        EventQueueMonitor.componentEventQueueLock.wait();
+                    } catch (InterruptedException e) {
+                    }
+                }
+                ce = (ComponentEvent)EventQueueMonitor.componentEventQueue.event;
+                EventQueueMonitor.componentEventQueue =
+                    EventQueueMonitor.componentEventQueue.next;
+            }
+            switch (ce.getID()) {
+            case MouseEvent.MOUSE_MOVED:
+            case MouseEvent.MOUSE_DRAGGED:
+                EventQueueMonitor.updateCurrentMousePosition((MouseEvent) ce);
+                break;
+            case WindowEvent.WINDOW_ACTIVATED:
+                EventQueueMonitor.maybeNotifyAssistiveTechnologies();
+                EventQueueMonitor.topLevelWindowWithFocus = ((WindowEvent) ce).getWindow();
+                break;
+
+            default:
+                break;
+            }
+        }
+    }
+}
+
+/**
+ * EventQueueMonitorItem is the basic type that handles the
+ * queue for queueComponentEvent and the ComponentEvtDispatchThread.
+ */
+class EventQueueMonitorItem {
+    AWTEvent event;
+    EventQueueMonitorItem next;
+
+    EventQueueMonitorItem(AWTEvent evt) {
+        event = evt;
+            next = null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/java/accessibility/util/GUIInitializedListener.java	Thu Jun 04 15:21:53 2015 -0700
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2002, 2015, 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.java.accessibility.util;
+
+import java.awt.*;
+import java.util.*;
+import javax.accessibility.*;
+
+/**
+ * The {@code GUIInitializedListener} interface is used by the {@link EventQueueMonitor}
+ * class to notify an interested party when the GUI subsystem has been
+ * initialized.  This is necessary because assistive technologies can
+ * be loaded before the GUI subsystem is initialized.  As a result,
+ * assistive technologies should check the
+ * {@link EventQueueMonitor#isGUIInitialized isGUIInitialized} method
+ * of {@code EventQueueMonitor} before creating any GUI components.  If the
+ * return value is true, assistive technologies can create GUI components
+ * following the same thread restrictions as any other application.  If
+ * the return value is false, the assistive technology should register
+ * a {@code GUIInitializedListener} with the {@code EventQueueMonitor} to be notified
+ * when the GUI subsystem is initialized.
+ *
+ * @see EventQueueMonitor
+ * @see EventQueueMonitor#isGUIInitialized
+ * @see EventQueueMonitor#addGUIInitializedListener
+ * @see EventQueueMonitor#removeGUIInitializedListener
+ *
+ */
+@jdk.Exported
+public interface GUIInitializedListener extends EventListener {
+
+    /**
+     * Invoked when the GUI subsystem is initialized and it's OK for
+     * the assisitive technology to create instances of GUI objects.
+     */
+    public void guiInitialized();
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/java/accessibility/util/GUIInitializedMulticaster.java	Thu Jun 04 15:21:53 2015 -0700
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2005, 2015, 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.java.accessibility.util;
+
+import java.awt.*;
+import java.util.EventListener;
+import javax.accessibility.*;
+
+
+/**
+ * The GUIInitializedMulticaster class is used to maintain a list of
+ * GUIInitializedListener classes.  It is intended to be used primarily
+ * for internal support in the EventQueueMonitor class, and is not intended
+ * to be used by classes outside the Java Accessibility Utility package.
+ *
+ * @see EventQueueMonitor
+ * @see EventQueueMonitor#addGUIInitializedListener
+ * @see EventQueueMonitor#removeGUIInitializedListener
+ *
+ */
+@jdk.Exported(false)
+public class GUIInitializedMulticaster
+    extends AWTEventMulticaster implements GUIInitializedListener
+{
+    protected GUIInitializedMulticaster(EventListener a, EventListener b) {
+        super(a, b);
+    }
+
+    public void guiInitialized() {
+        ((GUIInitializedListener)a).guiInitialized();
+        ((GUIInitializedListener)b).guiInitialized();
+    }
+
+    public static GUIInitializedListener add(GUIInitializedListener a, GUIInitializedListener b) {
+        return (GUIInitializedListener)addInternal(a, b);
+    }
+
+    public static GUIInitializedListener remove(GUIInitializedListener l, GUIInitializedListener oldl) {
+        return (GUIInitializedListener)removeInternal(l, oldl);
+    }
+
+    protected static EventListener addInternal(EventListener a, EventListener b) {
+        if (a == null)  return b;
+        if (b == null)  return a;
+        return new GUIInitializedMulticaster(a, b);
+    }
+
+    protected static EventListener removeInternal(EventListener l, EventListener oldl) {
+        if (l == oldl || l == null) {
+            return null;
+        } else if (l instanceof GUIInitializedMulticaster) {
+            return ((GUIInitializedMulticaster)l).remove(oldl);
+        } else {
+            return l;           // it's not here
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/java/accessibility/util/SwingEventMonitor.java	Thu Jun 04 15:21:53 2015 -0700
@@ -0,0 +1,2542 @@
+/*
+ * Copyright (c) 2002, 2015, 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.java.accessibility.util;
+
+import java.util.*;
+import java.beans.*;
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+import javax.swing.event.*;
+import javax.swing.table.*;
+import javax.swing.tree.*;
+import javax.swing.text.*;
+import javax.swing.undo.*;
+import javax.accessibility.*;
+
+
+/**
+ * <P>{@code SwingEventMonitor} extends {@link AWTEventMonitor} by adding a suite of
+ * listeners conditionally installed on every Swing component instance
+ * in the Java Virtual Machine.  The events captured by these listeners
+ * are made available through a unified set of listeners supported by
+ * {@code SwingEventMonitor}.  With this, all the individual events on each of the
+ * AWT and Swing component instances are funneled into one set of listeners
+ * broken down by category (see {@link EventID} for the categories).
+ * <p>This class depends upon {@link EventQueueMonitor}, which provides the base
+ * level support for capturing the top-level containers as they are created.
+ * <p>Because this class extends {@code AWTEventMonitor}, it is not
+ * necessary to use this class and {@code AWTEventMonitor} at the same time.
+ * If you want to monitor both AWT and Swing components, you should
+ * use just this class.
+ *
+ * @see AWTEventMonitor
+ *
+ */
+@jdk.Exported
+public class SwingEventMonitor extends AWTEventMonitor {
+
+    /**
+     * The master list of all listeners registered by other classes.
+     * This can only be publicly modified by calling the add or
+     * remove listener methods in this class.
+     */
+    static protected final EventListenerList listenerList = new EventListenerList();
+
+    /**
+     * The actual listener that is installed on the component instances.
+     * This listener calls the other registered listeners when an event
+     * occurs.  By doing things this way, the actual number of listeners
+     * installed on a component instance is drastically reduced.
+     */
+    static protected final SwingEventListener swingListener = new SwingEventListener();
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#ANCESTOR ANCESTOR}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeAncestorListener
+     */
+    static public void addAncestorListener(AncestorListener l) {
+        if (listenerList.getListenerCount(AncestorListener.class) == 0) {
+            swingListener.installListeners(EventID.ANCESTOR);
+        }
+        listenerList.add(AncestorListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#ANCESTOR ANCESTOR} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addAncestorListener
+     */
+    static public void removeAncestorListener(AncestorListener l) {
+        listenerList.remove(AncestorListener.class, l);
+        if (listenerList.getListenerCount(AncestorListener.class) == 0) {
+            swingListener.removeListeners(EventID.ANCESTOR);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#CARET CARET} events
+     * on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeCaretListener
+     */
+    static public void addCaretListener(CaretListener l) {
+        if (listenerList.getListenerCount(CaretListener.class) == 0) {
+            swingListener.installListeners(EventID.CARET);
+        }
+        listenerList.add(CaretListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#CARET CARET} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addCaretListener
+     */
+    static public void removeCaretListener(CaretListener l) {
+        listenerList.remove(CaretListener.class, l);
+        if (listenerList.getListenerCount(CaretListener.class) == 0) {
+            swingListener.removeListeners(EventID.CARET);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all
+     * {@link EventID#CELLEDITOR CELLEDITOR} events on each
+     * component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeCellEditorListener
+     */
+    static public void addCellEditorListener(CellEditorListener l) {
+        if (listenerList.getListenerCount(CellEditorListener.class) == 0) {
+            swingListener.installListeners(EventID.CELLEDITOR);
+        }
+        listenerList.add(CellEditorListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#CELLEDITOR CELLEDITOR} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addCellEditorListener
+     */
+    static public void removeCellEditorListener(CellEditorListener l) {
+        listenerList.remove(CellEditorListener.class, l);
+        if (listenerList.getListenerCount(CellEditorListener.class) == 0) {
+            swingListener.removeListeners(EventID.CELLEDITOR);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#CHANGE CHANGE}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeChangeListener
+     */
+    static public void addChangeListener(ChangeListener l) {
+        if (listenerList.getListenerCount(ChangeListener.class) == 0) {
+            swingListener.installListeners(EventID.CHANGE);
+        }
+        listenerList.add(ChangeListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#CHANGE CHANGE} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addChangeListener
+     */
+    static public void removeChangeListener(ChangeListener l) {
+        listenerList.remove(ChangeListener.class, l);
+        if (listenerList.getListenerCount(ChangeListener.class) == 0) {
+            swingListener.removeListeners(EventID.CHANGE);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#COLUMNMODEL COLUMNMODEL}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeColumnModelListener
+     */
+    static public void addColumnModelListener(TableColumnModelListener l) {
+        if (listenerList.getListenerCount(TableColumnModelListener.class) == 0) {
+            swingListener.installListeners(EventID.COLUMNMODEL);
+        }
+        listenerList.add(TableColumnModelListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#COLUMNMODEL COLUMNMODEL} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addColumnModelListener
+     */
+    static public void removeColumnModelListener(TableColumnModelListener l) {
+        listenerList.remove(TableColumnModelListener.class, l);
+        if (listenerList.getListenerCount(TableColumnModelListener.class) == 0) {
+            swingListener.removeListeners(EventID.COLUMNMODEL);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#DOCUMENT DOCUMENT}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeDocumentListener
+     */
+    static public void addDocumentListener(DocumentListener l) {
+        if (listenerList.getListenerCount(DocumentListener.class) == 0) {
+            swingListener.installListeners(EventID.DOCUMENT);
+        }
+        listenerList.add(DocumentListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#DOCUMENT DOCUMENT} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addDocumentListener
+     */
+    static public void removeDocumentListener(DocumentListener l) {
+        listenerList.remove(DocumentListener.class, l);
+        if (listenerList.getListenerCount(DocumentListener.class) == 0) {
+            swingListener.removeListeners(EventID.DOCUMENT);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#LISTDATA LISTDATA}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeListDataListener
+     */
+    static public void addListDataListener(ListDataListener l) {
+        if (listenerList.getListenerCount(ListDataListener.class) == 0) {
+            swingListener.installListeners(EventID.LISTDATA);
+        }
+        listenerList.add(ListDataListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#LISTDATA LISTDATA} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addListDataListener
+     */
+    static public void removeListDataListener(ListDataListener l) {
+        listenerList.remove(ListDataListener.class, l);
+        if (listenerList.getListenerCount(ListDataListener.class) == 0) {
+            swingListener.removeListeners(EventID.LISTDATA);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#LISTSELECTION LISTSELECTION}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeListSelectionListener
+     */
+    static public void addListSelectionListener(ListSelectionListener l) {
+        if (listenerList.getListenerCount(ListSelectionListener.class) == 0) {
+            swingListener.installListeners(EventID.LISTSELECTION);
+        }
+        listenerList.add(ListSelectionListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#LISTSELECTION LISTSELECTION} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addListSelectionListener
+     */
+    static public void removeListSelectionListener(ListSelectionListener l) {
+        listenerList.remove(ListSelectionListener.class, l);
+        if (listenerList.getListenerCount(ListSelectionListener.class) == 0) {
+            swingListener.removeListeners(EventID.LISTSELECTION);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#MENU MENU} events
+     * on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeMenuListener
+     */
+    static public void addMenuListener(MenuListener l) {
+        if (listenerList.getListenerCount(MenuListener.class) == 0) {
+            swingListener.installListeners(EventID.MENU);
+        }
+        listenerList.add(MenuListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#MENU MENU} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addMenuListener
+     */
+    static public void removeMenuListener(MenuListener l) {
+        listenerList.remove(MenuListener.class, l);
+        if (listenerList.getListenerCount(MenuListener.class) == 0) {
+            swingListener.removeListeners(EventID.MENU);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#POPUPMENU POPUPMENU}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removePopupMenuListener
+     */
+    static public void addPopupMenuListener(PopupMenuListener l) {
+        if (listenerList.getListenerCount(PopupMenuListener.class) == 0) {
+            swingListener.installListeners(EventID.POPUPMENU);
+        }
+        listenerList.add(PopupMenuListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#POPUPMENU POPUPMENU} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addPopupMenuListener
+     */
+    static public void removePopupMenuListener(PopupMenuListener l) {
+        listenerList.remove(PopupMenuListener.class, l);
+        if (listenerList.getListenerCount(PopupMenuListener.class) == 0) {
+            swingListener.removeListeners(EventID.POPUPMENU);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#TABLEMODEL TABLEMODEL}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeTableModelListener
+     */
+    static public void addTableModelListener(TableModelListener l) {
+        if (listenerList.getListenerCount(TableModelListener.class) == 0) {
+            swingListener.installListeners(EventID.TABLEMODEL);
+        }
+        listenerList.add(TableModelListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#TABLEMODEL TABLEMODEL} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addTableModelListener
+     */
+    static public void removeTableModelListener(TableModelListener l) {
+        listenerList.remove(TableModelListener.class, l);
+        if (listenerList.getListenerCount(TableModelListener.class) == 0) {
+            swingListener.removeListeners(EventID.TABLEMODEL);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#TREEEXPANSION TREEEXPANSION}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeTreeExpansionListener
+     */
+    static public void addTreeExpansionListener(TreeExpansionListener l) {
+        if (listenerList.getListenerCount(TreeExpansionListener.class) == 0) {
+            swingListener.installListeners(EventID.TREEEXPANSION);
+        }
+        listenerList.add(TreeExpansionListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#TREEEXPANSION TREEEXPANSION} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addTreeExpansionListener
+     */
+    static public void removeTreeExpansionListener(TreeExpansionListener l) {
+        listenerList.remove(TreeExpansionListener.class, l);
+        if (listenerList.getListenerCount(TreeExpansionListener.class) == 0) {
+            swingListener.removeListeners(EventID.TREEEXPANSION);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#TREEMODEL TREEMODEL}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeTreeModelListener
+     */
+    static public void addTreeModelListener(TreeModelListener l) {
+        if (listenerList.getListenerCount(TreeModelListener.class) == 0) {
+            swingListener.installListeners(EventID.TREEMODEL);
+        }
+        listenerList.add(TreeModelListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#TREEMODEL TREEMODEL} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addTreeModelListener
+     */
+    static public void removeTreeModelListener(TreeModelListener l) {
+        listenerList.remove(TreeModelListener.class, l);
+        if (listenerList.getListenerCount(TreeModelListener.class) == 0) {
+            swingListener.removeListeners(EventID.TREEMODEL);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#TREESELECTION TREESELECTION}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeTreeSelectionListener
+     */
+    static public void addTreeSelectionListener(TreeSelectionListener l) {
+        if (listenerList.getListenerCount(TreeSelectionListener.class) == 0) {
+            swingListener.installListeners(EventID.TREESELECTION);
+        }
+        listenerList.add(TreeSelectionListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#TREESELECTION TREESELECTION} events when they occur.
+     * @see #addTreeSelectionListener
+     * @param l the listener to remove
+     */
+    static public void removeTreeSelectionListener(TreeSelectionListener l) {
+        listenerList.remove(TreeSelectionListener.class, l);
+        if (listenerList.getListenerCount(TreeSelectionListener.class) == 0) {
+            swingListener.removeListeners(EventID.TREESELECTION);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#UNDOABLEEDIT UNDOABLEEDIT}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeUndoableEditListener
+     */
+    static public void addUndoableEditListener(UndoableEditListener l) {
+        if (listenerList.getListenerCount(UndoableEditListener.class) == 0) {
+            swingListener.installListeners(EventID.UNDOABLEEDIT);
+        }
+        listenerList.add(UndoableEditListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#UNDOABLEEDIT UNDOABLEEDIT} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addUndoableEditListener
+     */
+    static public void removeUndoableEditListener(UndoableEditListener l) {
+        listenerList.remove(UndoableEditListener.class, l);
+        if (listenerList.getListenerCount(UndoableEditListener.class) == 0) {
+            swingListener.removeListeners(EventID.UNDOABLEEDIT);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#INTERNALFRAME INTERNALFRAME}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeInternalFrameListener
+     */
+    static public void addInternalFrameListener(InternalFrameListener l) {
+        if (listenerList.getListenerCount(InternalFrameListener.class) == 0) {
+            swingListener.installListeners(EventID.INTERNALFRAME);
+        }
+        listenerList.add(InternalFrameListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#INTERNALFRAME INTERNALFRAME} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addInternalFrameListener
+     */
+    static public void removeInternalFrameListener(InternalFrameListener l) {
+        listenerList.remove(InternalFrameListener.class, l);
+        if (listenerList.getListenerCount(InternalFrameListener.class) == 0) {
+            swingListener.removeListeners(EventID.INTERNALFRAME);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#PROPERTYCHANGE PROPERTYCHANGE}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removePropertyChangeListener
+     */
+    static public void addPropertyChangeListener(PropertyChangeListener l) {
+        if (listenerList.getListenerCount(PropertyChangeListener.class) == 0) {
+            swingListener.installListeners(EventID.PROPERTYCHANGE);
+        }
+        listenerList.add(PropertyChangeListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#PROPERTYCHANGE PROPERTYCHANGE} events when they occur.
+     * @see #addPropertyChangeListener
+     * @param l the listener to remove
+     */
+    static public void removePropertyChangeListener(PropertyChangeListener l) {
+        listenerList.remove(PropertyChangeListener.class, l);
+        if (listenerList.getListenerCount(PropertyChangeListener.class) == 0) {
+            swingListener.removeListeners(EventID.PROPERTYCHANGE);
+        }
+    }
+
+    /**
+     * Adds the specified listener to receive all {@link EventID#VETOABLECHANGE VETOABLECHANGE}
+     * events on each component instance in the Java Virtual Machine as they occur.
+     * <P>Note: This listener is automatically added to all component
+     * instances created after this method is called.  In addition, it
+     * is only added to component instances that support this listener type.
+     *
+     * @param l the listener to add
+     * @see #removeVetoableChangeListener
+     */
+    static public void addVetoableChangeListener(VetoableChangeListener l) {
+        if (listenerList.getListenerCount(VetoableChangeListener.class) == 0) {
+            swingListener.installListeners(EventID.VETOABLECHANGE);
+        }
+        listenerList.add(VetoableChangeListener.class, l);
+    }
+
+    /**
+     * Removes the specified listener so it no longer receives
+     * {@link EventID#VETOABLECHANGE VETOABLECHANGE} events when they occur.
+     *
+     * @param l the listener to remove
+     * @see #addVetoableChangeListener
+     */
+    static public void removeVetoableChangeListener(VetoableChangeListener l) {
+        listenerList.remove(VetoableChangeListener.class, l);
+        if (listenerList.getListenerCount(VetoableChangeListener.class) == 0) {
+            swingListener.removeListeners(EventID.VETOABLECHANGE);
+        }
+    }
+
+
+    /**
+     * SwingEventListener is the class that does all the work for
+     * SwingEventMonitor.  It is not intended for use by any other class
+     * except SwingEventMonitor.
+     *
+     */
+    static class SwingEventListener extends AWTEventsListener
+            implements AncestorListener, CaretListener, CellEditorListener,
+            ChangeListener, DocumentListener, ListDataListener,
+            ListSelectionListener, MenuListener, PopupMenuListener,
+            TableColumnModelListener, TableModelListener, TreeExpansionListener,
+            TreeModelListener, TreeSelectionListener, UndoableEditListener,
+            InternalFrameListener,
+            PropertyChangeListener, VetoableChangeListener {
+
+        /**
+         * internal variables for Caret introspection
+         */
+        private java.lang.Class caretListeners[];
+        private java.lang.reflect.Method removeCaretMethod;
+        private java.lang.reflect.Method addCaretMethod;
+        private java.lang.Object caretArgs[];
+
+        /**
+         * internal variables for CellEditor introspection
+         */
+        private java.lang.Class cellEditorListeners[];
+        private java.lang.reflect.Method removeCellEditorMethod;
+        private java.lang.reflect.Method addCellEditorMethod;
+        private java.lang.Object cellEditorArgs[];
+        private java.lang.reflect.Method getCellEditorMethod;
+
+        /**
+         * internal variables for Change introspection
+         */
+        private java.lang.Class changeListeners[];
+        private java.lang.reflect.Method removeChangeMethod;
+        private java.lang.reflect.Method addChangeMethod;
+        private java.lang.Object changeArgs[];
+
+        /**
+         * internal variable for ColumnModel introspection
+         */
+        private java.lang.reflect.Method getColumnModelMethod;
+
+        /**
+         * internal variables for Document introspection
+         */
+        private java.lang.Class documentListeners[];
+        private java.lang.reflect.Method removeDocumentMethod;
+        private java.lang.reflect.Method addDocumentMethod;
+        private java.lang.Object documentArgs[];
+        private java.lang.reflect.Method getDocumentMethod;
+
+        /**
+         * internal variable for ListData, Table, and Tree introspection
+         */
+        private java.lang.reflect.Method getModelMethod;
+
+        /**
+         * internal variables for ListSelection introspection
+         */
+        private java.lang.Class listSelectionListeners[];
+        private java.lang.reflect.Method removeListSelectionMethod;
+        private java.lang.reflect.Method addListSelectionMethod;
+        private java.lang.Object listSelectionArgs[];
+        private java.lang.reflect.Method getSelectionModelMethod;
+
+        /**
+         * internal variables for Menu introspection
+         */
+        private java.lang.Class menuListeners[];
+        private java.lang.reflect.Method removeMenuMethod;
+        private java.lang.reflect.Method addMenuMethod;
+        private java.lang.Object menuArgs[];
+
+        /**
+         * internal variables for PopupMenu introspection
+         */
+        private java.lang.Class popupMenuListeners[];
+        private java.lang.reflect.Method removePopupMenuMethod;
+        private java.lang.reflect.Method addPopupMenuMethod;
+        private java.lang.Object popupMenuArgs[];
+        private java.lang.reflect.Method getPopupMenuMethod;
+
+        /**
+         * internal variables for TreeExpansion introspection
+         */
+        private java.lang.Class treeExpansionListeners[];
+        private java.lang.reflect.Method removeTreeExpansionMethod;
+        private java.lang.reflect.Method addTreeExpansionMethod;
+        private java.lang.Object treeExpansionArgs[];
+
+        /**
+         * internal variables for TreeSelection introspection
+         */
+        private java.lang.Class treeSelectionListeners[];
+        private java.lang.reflect.Method removeTreeSelectionMethod;
+        private java.lang.reflect.Method addTreeSelectionMethod;
+        private java.lang.Object treeSelectionArgs[];
+
+        /**
+         * internal variables for UndoableEdit introspection
+         */
+        private java.lang.Class undoableEditListeners[];
+        private java.lang.reflect.Method removeUndoableEditMethod;
+        private java.lang.reflect.Method addUndoableEditMethod;
+        private java.lang.Object undoableEditArgs[];
+
+        /**
+         * internal variables for InternalFrame introspection
+         */
+        private java.lang.Class internalFrameListeners[];
+        private java.lang.reflect.Method removeInternalFrameMethod;
+        private java.lang.reflect.Method addInternalFrameMethod;
+        private java.lang.Object internalFrameArgs[];
+
+        /**
+         * internal variables for PropertyChange introspection
+         */
+        private java.lang.Class propertyChangeListeners[];
+        private java.lang.reflect.Method removePropertyChangeMethod;
+        private java.lang.reflect.Method addPropertyChangeMethod;
+        private java.lang.Object propertyChangeArgs[];
+
+        /**
+         * internal variables for a variety of change introspections
+         */
+        private java.lang.Class nullClass[];
+        private java.lang.Object nullArgs[];
+
+        /**
+         * Create a new instance of this class and install it on each component
+         * instance in the virtual machine that supports any of the currently
+         * registered listeners in SwingEventMonitor.  Also registers itself
+         * as a TopLevelWindowListener with EventQueueMonitor so it can
+         * automatically add new listeners to new components.
+         * @see EventQueueMonitor
+         * @see SwingEventMonitor
+         */
+        public SwingEventListener() {
+            initializeIntrospection();
+            installListeners();
+            EventQueueMonitor.addTopLevelWindowListener(this);
+        }
+
+        /**
+         * Set up all of the variables needed for introspection
+         */
+        private boolean initializeIntrospection() {
+            try {
+                caretListeners = new java.lang.Class[1];
+                caretArgs = new java.lang.Object[1];
+                caretListeners[0] = Class.forName("javax.swing.event.CaretListener");
+                caretArgs[0] = this;
+
+                cellEditorListeners = new java.lang.Class[1];
+                cellEditorArgs = new java.lang.Object[1];
+                cellEditorListeners[0] = Class.forName("javax.swing.event.CellEditorListener");
+                cellEditorArgs[0] = this;
+
+                changeListeners = new java.lang.Class[1];
+                changeArgs = new java.lang.Object[1];
+                changeListeners[0] = Class.forName("javax.swing.event.ChangeListener");
+                changeArgs[0] = this;
+
+                documentListeners = new java.lang.Class[1];
+                documentArgs = new java.lang.Object[1];
+                documentListeners[0] = Class.forName("javax.swing.event.DocumentListener");
+                documentArgs[0] = this;
+
+                listSelectionListeners = new java.lang.Class[1];
+                listSelectionArgs = new java.lang.Object[1];
+                listSelectionListeners[0] = Class.forName("javax.swing.event.ListSelectionListener");
+                listSelectionArgs[0] = this;
+
+                menuListeners = new java.lang.Class[1];
+                menuArgs = new java.lang.Object[1];
+                menuListeners[0] = Class.forName("javax.swing.event.MenuListener");
+                menuArgs[0] = this;
+
+                popupMenuListeners = new java.lang.Class[1];
+                popupMenuArgs = new java.lang.Object[1];
+                popupMenuListeners[0] = Class.forName("javax.swing.event.PopupMenuListener");
+                popupMenuArgs[0] = this;
+
+                treeExpansionListeners = new java.lang.Class[1];
+                treeExpansionArgs = new java.lang.Object[1];
+                treeExpansionListeners[0] = Class.forName("javax.swing.event.TreeExpansionListener");
+                treeExpansionArgs[0] = this;
+
+                treeSelectionListeners = new java.lang.Class[1];
+                treeSelectionArgs = new java.lang.Object[1];
+                treeSelectionListeners[0] = Class.forName("javax.swing.event.TreeSelectionListener");
+                treeSelectionArgs[0] = this;
+
+                undoableEditListeners = new java.lang.Class[1];
+                undoableEditArgs = new java.lang.Object[1];
+                undoableEditListeners[0] = Class.forName("javax.swing.event.UndoableEditListener");
+                undoableEditArgs[0] = this;
+
+                internalFrameListeners = new java.lang.Class[1];
+                internalFrameArgs = new java.lang.Object[1];
+                internalFrameListeners[0] = Class.forName("javax.swing.event.InternalFrameListener");
+                internalFrameArgs[0] = this;
+
+                nullClass = new java.lang.Class[0];
+                nullArgs = new java.lang.Object[0];
+
+            } catch (ClassNotFoundException e) {
+                System.out.println("EXCEPTION - Class 'javax.swing.event.*' not in CLASSPATH");
+                return false;
+            }
+
+            try {
+                propertyChangeListeners = new java.lang.Class[1];
+                propertyChangeArgs = new java.lang.Object[1];
+                propertyChangeListeners[0] = Class.forName("java.beans.PropertyChangeListener");
+                propertyChangeArgs[0] = this;
+
+            } catch (ClassNotFoundException e) {
+                System.out.println("EXCEPTION - Class 'java.beans.*' not in CLASSPATH");
+                return false;
+            }
+
+            return true;
+        }
+
+        /**
+         * Installs all appropriate Swing listeners to just the component.
+         * Also calls super (AWTEventsListener.installListeners()) to install
+         * the requested AWT listeners.
+         * @param c the component to add listeners to
+         */
+        protected void installListeners(Component c) {
+
+            // This SwingEventListener needs to be notified when a new
+            // Swing component has been added so it can add Swing listeners
+            // to these components.  As a result, we always need a Container
+            // listener on every Container.
+            //
+            installListeners(c,EventID.CONTAINER);
+
+            // conditionally install Swing listeners
+            //
+            if (SwingEventMonitor.listenerList.getListenerCount(AncestorListener.class) > 0) {
+                installListeners(c,EventID.ANCESTOR);
+            }
+            if (SwingEventMonitor.listenerList.getListenerCount(CaretListener.class) > 0) {
+                installListeners(c,EventID.CARET);
+            }
+            if (SwingEventMonitor.listenerList.getListenerCount(CellEditorListener.class) > 0) {
+                installListeners(c,EventID.CELLEDITOR);
+            }
+            if (SwingEventMonitor.listenerList.getListenerCount(ChangeListener.class) > 0) {
+                installListeners(c,EventID.CHANGE);
+            }
+            if (SwingEventMonitor.listenerList.getListenerCount(TableColumnModelListener.class) > 0) {
+                installListeners(c,EventID.COLUMNMODEL);
+            }
+            if (SwingEventMonitor.listenerList.getListenerCount(DocumentListener.class) > 0) {
+                installListeners(c,EventID.DOCUMENT);
+            }
+            if (SwingEventMonitor.listenerList.getListenerCount(ListDataListener.class) > 0) {
+                installListeners(c,EventID.LISTDATA);
+            }
+            if (SwingEventMonitor.listenerList.getListenerCount(ListSelectionListener.class) > 0) {
+                installListeners(c,EventID.LISTSELECTION);
+            }
+            if (SwingEventMonitor.listenerList.getListenerCount(MenuListener.class) > 0) {
+                installListeners(c,EventID.MENU);
+            }
+            if (SwingEventMonitor.listenerList.getListenerCount(PopupMenuListener.class) > 0) {
+                installListeners(c,EventID.POPUPMENU);
+            }
+            if (SwingEventMonitor.listenerList.getListenerCount(TableModelListener.class) > 0) {
+                installListeners(c,EventID.TABLEMODEL);
+            }
+            if (SwingEventMonitor.listenerList.getListenerCount(TreeExpansionListener.class) > 0) {
+                installListeners(c,EventID.TREEEXPANSION);
+            }
+            if (SwingEventMonitor.listenerList.getListenerCount(TreeModelListener.class) > 0) {
+                installListeners(c,EventID.TREEMODEL);
+            }
+            if (SwingEventMonitor.listenerList.getListenerCount(TreeSelectionListener.class) > 0) {
+                installListeners(c,EventID.TREESELECTION);
+            }
+            if (SwingEventMonitor.listenerList.getListenerCount(UndoableEditListener.class) > 0) {
+                installListeners(c,EventID.UNDOABLEEDIT);
+            }
+            if (SwingEventMonitor.listenerList.getListenerCount(InternalFrameListener.class) > 0) {
+                installListeners(c,EventID.INTERNALFRAME);
+            }
+
+            // Conditionally install Beans listeners
+            //
+            if (SwingEventMonitor.listenerList.getListenerCount(PropertyChangeListener.class) > 0) {
+                installListeners(c,EventID.PROPERTYCHANGE);
+            }
+            if (SwingEventMonitor.listenerList.getListenerCount(VetoableChangeListener.class) > 0) {
+                installListeners(c,EventID.VETOABLECHANGE);
+            }
+
+            // Now install the AWT listeners if needed.
+            //
+            super.installListeners(c);
+        }
+
+        /**
+         * Installs all appropriate Swing listeners to the component and all its
+         * children.  As a precaution, it always attempts to remove itself as
+         * a listener first so we're always guaranteed it will installed itself
+         * just once.
+         * @param c the component to add listeners to
+         * @param eventID the eventID to add listeners for
+         */
+        protected void installListeners(Component c, int eventID) {
+
+            // install the appropriate listener hook into this component
+            //
+            switch (eventID) {
+
+            case EventID.CONTAINER:
+                if (c instanceof Container) {
+                    ((Container) c).removeContainerListener(this);
+                    ((Container) c).addContainerListener(this);
+                }
+                break;
+
+            case EventID.ANCESTOR:
+                if (c instanceof JComponent) {
+                    ((JComponent) c).removeAncestorListener(this);
+                    ((JComponent) c).addAncestorListener(this);
+                }
+                break;
+
+            case EventID.CARET:
+                try {
+                    removeCaretMethod = c.getClass().getMethod(
+                        "removeCaretListener", caretListeners);
+                    addCaretMethod = c.getClass().getMethod(
+                        "addCaretListener", caretListeners);
+                    try {
+                        removeCaretMethod.invoke(c, caretArgs);
+                        addCaretMethod.invoke(c, caretArgs);
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                break;
+
+            case EventID.CELLEDITOR:
+                //  Look for components which support the getCellEditor method
+                //  (e.g. JTable, JTree)
+                //
+                try {
+                    getCellEditorMethod = c.getClass().getMethod(
+                        "getCellEditorMethod", nullClass);
+                    try {
+                        Object o = getCellEditorMethod.invoke(c, nullArgs);
+                        if (o != null && o instanceof CellEditor) {
+                            ((CellEditor) o).removeCellEditorListener(this);
+                            ((CellEditor) o).addCellEditorListener(this);
+                        }
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+
+                //  Look for components which support CellEditor listeners
+                //  (no current example)
+                //
+                try {
+                    removeCellEditorMethod = c.getClass().getMethod(
+                        "removeCellEditorListener", cellEditorListeners);
+                    addCellEditorMethod = c.getClass().getMethod(
+                        "addCellEditorListener", cellEditorListeners);
+                    try {
+                        removeCellEditorMethod.invoke(c, cellEditorArgs);
+                        addCellEditorMethod.invoke(c, cellEditorArgs);
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                break;
+
+            case EventID.CHANGE:
+    //  [[[FIXME:  Need to add support for Style, StyleContext  -pk]]]
+
+                //  Look for components which support Change listeners
+                //  (e.g. AbstractButton, Caret, JProgressBar, JSlider,
+                //   JTabbedpane, JTextComponent, JViewport)
+                //
+                try {
+                    removeChangeMethod = c.getClass().getMethod(
+                        "removeChangeListener", changeListeners);
+                    addChangeMethod = c.getClass().getMethod(
+                        "addChangeListener", changeListeners);
+                    try {
+                        removeChangeMethod.invoke(c, changeArgs);
+                        addChangeMethod.invoke(c, changeArgs);
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+
+                //  Look for components which support the getModel method
+                //  whose model supports Change listeners
+                //  (e.g. BoundedRangeModel, ButtonModel, SingleSelectionModel)
+                //
+                try {
+                    getModelMethod = c.getClass().getMethod(
+                        "getModel", nullClass);
+                    try {
+                        Object o = getModelMethod.invoke(c, nullArgs);
+                        if (o != null) {
+                            removeChangeMethod = o.getClass().getMethod(
+                                "removeChangeListener", changeListeners);
+                            addChangeMethod = o.getClass().getMethod(
+                                "addChangeListener", changeListeners);
+                            removeChangeMethod.invoke(o, changeArgs);
+                            addChangeMethod.invoke(o, changeArgs);
+                        }
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+
+                break;
+
+            case EventID.COLUMNMODEL:
+                try {
+                    getColumnModelMethod = c.getClass().getMethod(
+                        "getTableColumnModel", nullClass);
+                    try {
+                        Object o = getColumnModelMethod.invoke(c, nullArgs);
+                        if (o != null && o instanceof TableColumnModel) {
+                            ((TableColumnModel) o).removeColumnModelListener(this);
+                            ((TableColumnModel) o).addColumnModelListener(this);
+                        }
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                break;
+
+            case EventID.DOCUMENT:
+                //  Look for components which support the getDocument method
+                //  (e.g. JTextComponent)
+                //
+                try {
+                    getDocumentMethod = c.getClass().getMethod(
+                        "getDocument", nullClass);
+                    try {
+                        Object o = getDocumentMethod.invoke(c, nullArgs);
+                        if (o != null && o instanceof Document) {
+                            ((Document) o).removeDocumentListener(this);
+                            ((Document) o).addDocumentListener(this);
+                        }
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+
+                //  Look for components which support Document listeners
+                //  (no current example)
+                //
+                try {
+                    removeDocumentMethod = c.getClass().getMethod(
+                        "removeDocumentListener", documentListeners);
+                    addDocumentMethod = c.getClass().getMethod(
+                        "addDocumentListener", documentListeners);
+                    try {
+                        removeDocumentMethod.invoke(c, documentArgs);
+                        addDocumentMethod.invoke(c, documentArgs);
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                //  Add the monitor as a PropertyChangeListener for document
+                //  change events from text components.
+                //
+                if (c instanceof JTextComponent) {
+                    try {
+                        removePropertyChangeMethod = c.getClass().getMethod(
+                            "removePropertyChangeListener",
+                            propertyChangeListeners);
+                        addPropertyChangeMethod = c.getClass().getMethod(
+                            "addPropertyChangeListener",
+                            propertyChangeListeners);
+                        try {
+                            removePropertyChangeMethod.invoke(c,
+                                propertyChangeArgs);
+                            addPropertyChangeMethod.invoke(c,
+                                propertyChangeArgs);
+                        } catch (java.lang.reflect.InvocationTargetException e) {
+                            System.out.println("Exception: " + e.toString());
+                        } catch (IllegalAccessException e) {
+                            System.out.println("Exception: " + e.toString());
+                        }
+                    } catch (NoSuchMethodException e) {
+                        // System.out.println("Exception: " + e.toString());
+                    } catch (SecurityException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                }
+                break;
+
+            case EventID.LISTDATA:
+            case EventID.TABLEMODEL:
+            case EventID.TREEMODEL:
+                try {
+                    getModelMethod = c.getClass().getMethod(
+                        "getModel", nullClass);
+                    try {
+                        Object o = getModelMethod.invoke(c, nullArgs);
+                        if (o != null) {
+                            if (eventID == EventID.LISTDATA &&
+                                o instanceof ListModel) {
+                                ((ListModel) o).removeListDataListener(this);
+                                ((ListModel) o).addListDataListener(this);
+                            } else if (eventID == EventID.TABLEMODEL &&
+                                o instanceof TableModel) {
+                                ((TableModel) o).removeTableModelListener(this);
+                                ((TableModel) o).addTableModelListener(this);
+                            } else if (
+                                o instanceof TreeModel) {
+                                ((TreeModel) o).removeTreeModelListener(this);
+                                ((TreeModel) o).addTreeModelListener(this);
+                            }
+                        }
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                break;
+
+            case EventID.LISTSELECTION:
+                //  Look for components which support ListSelectionListeners
+                //  (e.g. JList)
+                //
+                try {
+                    removeListSelectionMethod = c.getClass().getMethod(
+                        "removeListSelectionListener", listSelectionListeners);
+                    addListSelectionMethod = c.getClass().getMethod(
+                        "addListSelectionListener", listSelectionListeners);
+                    try {
+                        removeListSelectionMethod.invoke(c, listSelectionArgs);
+                        addListSelectionMethod.invoke(c, listSelectionArgs);
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+
+                //  Look for selection models which support ListSelectionListeners
+                //  (e.g. JTable's selection model)
+                //
+                try {
+                    getSelectionModelMethod = c.getClass().getMethod(
+                        "getSelectionModel", nullClass);
+                    try {
+                        Object o = getSelectionModelMethod.invoke(c, nullArgs);
+                        if (o != null && o instanceof ListSelectionModel) {
+                            ((ListSelectionModel) o).removeListSelectionListener(this);
+                            ((ListSelectionModel) o).addListSelectionListener(this);
+                        }
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                break;
+
+            case EventID.MENU:
+                try {
+                    removeMenuMethod = c.getClass().getMethod(
+                        "removeMenuListener", menuListeners);
+                    addMenuMethod = c.getClass().getMethod(
+                        "addMenuListener", menuListeners);
+                    try {
+                        removeMenuMethod.invoke(c, menuArgs);
+                        addMenuMethod.invoke(c, menuArgs);
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                break;
+
+            case EventID.POPUPMENU:
+                //  Look for components which support PopupMenuListeners
+                //  (e.g. JPopupMenu)
+                //
+                try {
+                    removePopupMenuMethod = c.getClass().getMethod(
+                        "removePopupMenuListener", popupMenuListeners);
+                    addPopupMenuMethod = c.getClass().getMethod(
+                        "addPopupMenuListener", popupMenuListeners);
+                    try {
+                        removePopupMenuMethod.invoke(c, popupMenuArgs);
+                        addPopupMenuMethod.invoke(c, popupMenuArgs);
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+
+                //  Look for components which support getPopupMenu
+                //  (e.g. JMenu)
+                //
+                try {
+                    getPopupMenuMethod = c.getClass().getMethod(
+                        "getPopupMenu", nullClass);
+                    try {
+                        Object o = getPopupMenuMethod.invoke(c, nullArgs);
+                        if (o != null) {
+                            removePopupMenuMethod = o.getClass().getMethod(
+                                "removePopupMenuListener", popupMenuListeners);
+                            addPopupMenuMethod = o.getClass().getMethod(
+                                "addPopupMenuListener", popupMenuListeners);
+                            removePopupMenuMethod.invoke(o, popupMenuArgs);
+                            addPopupMenuMethod.invoke(o, popupMenuArgs);
+                        }
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                break;
+
+            case EventID.TREEEXPANSION:
+                try {
+                    removeTreeExpansionMethod = c.getClass().getMethod(
+                        "removeTreeExpansionListener", treeExpansionListeners);
+                    addTreeExpansionMethod = c.getClass().getMethod(
+                        "addTreeExpansionListener", treeExpansionListeners);
+                    try {
+                        removeTreeExpansionMethod.invoke(c, treeExpansionArgs);
+                        addTreeExpansionMethod.invoke(c, treeExpansionArgs);
+                    } catch (java.lang.reflect.InvocationTargetException e) {
+                        System.out.println("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        System.out.println("Exception: " + e.toString());
+                    }
+                } catch (NoSuchMethodException e) {
+                    // System.out.println("Exception: " + e.toString());
+                } catch (SecurityException e) {
+                    System.out.println("Exception: " + e.toString());
+                }
+                break;
+
+            case EventID.TREESELECTION:
+                try {
+                    removeTreeSelectionMethod = c.getClass().getMethod(
+                        "removeTreeSelectionListener", treeSelectionListeners);