changeset 10670:ea62ea52af27

Merge
author asaha
date Fri, 10 Apr 2015 20:39:34 -0700
parents 7087623dfa70 87d655ae0753
children bdcb84f20548
files .hgtags src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java src/share/classes/sun/security/ssl/ClientHandshaker.java src/solaris/bin/arm/jvm.cfg src/solaris/bin/ppc/jvm.cfg
diffstat 294 files changed, 43316 insertions(+), 1420 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Apr 10 07:27:56 2015 -0700
+++ b/.hgtags	Fri Apr 10 20:39:34 2015 -0700
@@ -399,3 +399,14 @@
 6a8f9512afa687632f0a0d881bbdb446d984a74c jdk8u45-b12
 55a75b0db87693e1e186752f553c337cb035a38e jdk8u45-b13
 20e6cadfac43717a81d99daff5e769de695992cd jdk8u45-b14
+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
--- a/make/CompileJavaClasses.gmk	Fri Apr 10 07:27:56 2015 -0700
+++ b/make/CompileJavaClasses.gmk	Fri Apr 10 20:39:34 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,7 +64,10 @@
     # 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 \
@@ -73,8 +76,6 @@
     EXCLUDES += com/sun/java/accessibility/extensions
   endif
 
-endif
-
 ifneq ($(OPENJDK_TARGET_OS), solaris)
   # Exclude Solaris nio and two security related files in src/share/classes
   EXFILES += SolarisAclFileAttributeView.java \
@@ -272,7 +273,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 +380,6 @@
 
 ##########################################################################################
 
-ifndef OPENJDK
   ifeq ($(OPENJDK_TARGET_OS), windows)
     ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
       $(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_32, \
@@ -413,7 +413,6 @@
 
     endif
   endif
-endif
 
 ##########################################################################################
 
--- a/make/CompileLaunchers.gmk	Fri Apr 10 07:27:56 2015 -0700
+++ b/make/CompileLaunchers.gmk	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/make/CopyFiles.gmk	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/make/CreateJars.gmk	Fri Apr 10 20:39:34 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,7 +650,6 @@
 
 ##########################################################################################
 
-ifndef OPENJDK
   ifeq ($(OPENJDK_TARGET_OS), windows)
 
     $(eval $(call SetupArchive,BUILD_JACCESS_JAR, , \
@@ -675,7 +685,6 @@
       JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar
     endif
   endif
-endif
 
 ##########################################################################################
 
--- a/make/Images.gmk	Fri Apr 10 07:27:56 2015 -0700
+++ b/make/Images.gmk	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/make/Import.gmk	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/make/Profiles.gmk	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/make/Tools.gmk	Fri Apr 10 20:39:34 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	Fri Apr 10 20:39:34 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	Fri Apr 10 20:39:34 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	Fri Apr 10 20:39:34 2015 -0700
@@ -0,0 +1,1 @@
+0x25	U+000a
--- a/make/data/charsetmapping/extsbcs	Fri Apr 10 07:27:56 2015 -0700
+++ b/make/data/charsetmapping/extsbcs	Fri Apr 10 20:39:34 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/gensrc/GensrcMisc.gmk	Fri Apr 10 07:27:56 2015 -0700
+++ b/make/gensrc/GensrcMisc.gmk	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/make/lib/Awt2dLibraries.gmk	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/make/lib/PlatformLibraries.gmk	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/make/mapfiles/libnet/mapfile-vers	Fri Apr 10 20:39:34 2015 -0700
@@ -110,6 +110,8 @@
 		NET_Bind;
 		NET_MapSocketOption;
 		NET_Wait;
+		NET_EnableFastTcpLoopback;
+		NET_ThrowNew;
                 ipv6_available;
 
 	local:
--- a/make/profile-includes.txt	Fri Apr 10 07:27:56 2015 -0700
+++ b/make/profile-includes.txt	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/make/profile-rtjar-includes.txt	Fri Apr 10 20:39:34 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/tzdb/ZoneRulesBuilder.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/make/src/classes/build/tools/tzdb/ZoneRulesBuilder.java	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/aix/classes/sun/nio/fs/AixNativeDispatcher.java	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/aix/classes/sun/tools/attach/AixVirtualMachine.java	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/aix/native/sun/nio/fs/AixNativeDispatcher.c	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/aix/native/sun/tools/attach/AixVirtualMachine.c	Fri Apr 10 20:39:34 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/com/apple/laf/AquaComboBoxUI.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Fri Apr 10 20:39:34 2015 -0700
@@ -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);
--- a/src/macosx/classes/com/apple/laf/AquaIcon.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaIcon.java	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaKeyBindings.java	Fri Apr 10 20:39:34 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/AquaMenuUI.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaMenuUI.java	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaScrollPaneUI.java	Fri Apr 10 20:39:34 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/sun/awt/CGraphicsDevice.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/macosx/classes/sun/awt/CGraphicsDevice.java	Fri Apr 10 20:39:34 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/LWWindowPeer.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Fri Apr 10 20:39:34 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/CClipboard.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CClipboard.java	Fri Apr 10 20:39:34 2015 -0700
@@ -57,6 +57,18 @@
     }
 
     @Override
+    public synchronized Transferable getContents(Object requestor) {
+        checkPasteboardAndNotify();
+        return super.getContents(requestor);
+    }
+
+    @Override
+    protected synchronized Transferable getContextContents() {
+        checkPasteboardAndNotify();
+        return super.getContextContents();
+    }
+
+    @Override
     protected void setContentsNative(Transferable contents) {
         FlavorTable flavorMap = getDefaultFlavorTable();
         // Don't use delayed Clipboard rendering for the Transferable's data.
@@ -116,13 +128,20 @@
     private native void declareTypes(long[] formats, SunClipboard newOwner);
     private native void setData(byte[] data, long format);
 
+    void checkPasteboardAndNotify() {
+        if (checkPasteboardWithoutNotification()) {
+            notifyChanged();
+            lostOwnershipNow(null);
+        }
+    }
+
     /**
      * Invokes native check whether a change count on the general pasteboard is different
      * than when we set it. The different count value means the current owner lost
      * pasteboard ownership and someone else put data on the clipboard.
      * @since 1.7
      */
-    native void checkPasteboard();
+    native boolean checkPasteboardWithoutNotification();
 
     /*** Native Callbacks ***/
     private void notifyLostOwnership() {
--- a/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Fri Apr 10 20:39:34 2015 -0700
@@ -120,7 +120,7 @@
             // it won't be invoced if focuse is moved to a html element
             // on the same page.
             CClipboard clipboard = (CClipboard) Toolkit.getDefaultToolkit().getSystemClipboard();
-            clipboard.checkPasteboard();
+            clipboard.checkPasteboardAndNotify();
         }
         if (parentWindowActive) {
             responder.handleWindowFocusEvent(focused, null);
@@ -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/CPlatformWindow.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Fri Apr 10 20:39:34 2015 -0700
@@ -488,6 +488,9 @@
         } else {
             deliverZoom(true);
 
+            // We need an up to date size of the peer, so we flush the native events
+            // to be sure that there are no setBounds requests in the queue.
+            LWCToolkit.flushNativeSelectors();
             this.normalBounds = peer.getBounds();
 
             GraphicsConfiguration config = getPeer().getGraphicsConfiguration();
--- a/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Fri Apr 10 20:39:34 2015 -0700
@@ -833,7 +833,7 @@
     /**
      * Just spin a single empty block synchronously.
      */
-    private static native void flushNativeSelectors();
+    static native void flushNativeSelectors();
 
     @Override
     public Clipboard createPlatformClipboard() {
--- a/src/macosx/native/sun/awt/AWTView.m	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/macosx/native/sun/awt/AWTView.m	Fri Apr 10 20:39:34 2015 -0700
@@ -310,7 +310,10 @@
 }
 
 - (BOOL) performKeyEquivalent: (NSEvent *) event {
-    [self deliverJavaKeyEventHelper: event];
+    // if IM is active key events should be ignored 
+    if (![self hasMarkedText] && !fInPressAndHold) {
+        [self deliverJavaKeyEventHelper: event];
+    }
 
     // Workaround for 8020209: special case for "Cmd =" and "Cmd ." 
     // because Cocoa calls performKeyEquivalent twice for these keystrokes  
@@ -889,9 +892,9 @@
     // text, or 'text in progress'.  We also need to send the event if we get an insert text out of the blue!
     // (i.e., when the user uses the Character palette or Inkwell), or when the string to insert is a complex
     // Unicode value.
-    NSUInteger utf8Length = [aString lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
+    NSUInteger utf16Length = [aString lengthOfBytesUsingEncoding:NSUTF16StringEncoding];
 
-    if ([self hasMarkedText] || !fProcessingKeystroke || (utf8Length > 1)) {
+    if ([self hasMarkedText] || !fProcessingKeystroke || (utf16Length > 2)) {
         JNIEnv *env = [ThreadUtilities getJNIEnv];
 
         static JNF_MEMBER_CACHE(jm_selectPreviousGlyph, jc_CInputMethod, "selectPreviousGlyph", "()V");
--- a/src/macosx/native/sun/awt/CClipboard.m	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/macosx/native/sun/awt/CClipboard.m	Fri Apr 10 20:39:34 2015 -0700
@@ -171,6 +171,8 @@
     else [args removeLastObject];
 }
 
+
+
 - (void) checkPasteboard:(id)application {
     AWT_ASSERT_APPKIT_THREAD;
     
@@ -202,6 +204,19 @@
     }
 }
 
+- (BOOL) checkPasteboardWithoutNotification:(id)application {
+    AWT_ASSERT_APPKIT_THREAD;
+    
+    NSInteger newChangeCount = [[NSPasteboard generalPasteboard] changeCount];
+    
+    if (fChangeCount != newChangeCount) {
+        fChangeCount = newChangeCount;    
+        return YES;
+    } else {
+        return NO;
+    }
+}
+
 @end
 
 /*
@@ -348,16 +363,17 @@
  * Method:    checkPasteboard
  * Signature: ()V
  */
-JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CClipboard_checkPasteboard
-(JNIEnv *env, jobject inObject )
+JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_CClipboard_checkPasteboardWithoutNotification
+(JNIEnv *env, jobject inObject)
 {
+    __block BOOL ret = NO;
     JNF_COCOA_ENTER(env);
-
     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
-        [[CClipboard sharedClipboard] checkPasteboard:nil];
+        ret = [[CClipboard sharedClipboard] checkPasteboardWithoutNotification:nil];
     }];
-        
+     
     JNF_COCOA_EXIT(env);
+    return ret;
 }
 
 
--- a/src/macosx/native/sun/awt/awt.m	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/macosx/native/sun/awt/awt.m	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m	Fri Apr 10 20:39:34 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/crypto/provider/GHASH.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/com/sun/crypto/provider/GHASH.java	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/com/sun/crypto/provider/JceKeyStore.java	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/com/sun/crypto/provider/PBEKey.java	Fri Apr 10 20:39:34 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
@@ -27,6 +27,7 @@
 
 import java.security.KeyRep;
 import java.security.spec.InvalidKeySpecException;
+import java.util.Locale;
 import javax.crypto.SecretKey;
 import javax.crypto.spec.PBEKeySpec;
 
@@ -91,7 +92,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	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/com/sun/crypto/provider/PBEKeyFactory.java	Fri Apr 10 20:39:34 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	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -30,6 +30,7 @@
 import java.nio.CharBuffer;
 import java.nio.charset.Charset;
 import java.util.Arrays;
+import java.util.Locale;
 import java.security.KeyRep;
 import java.security.GeneralSecurityException;
 import java.security.NoSuchAlgorithmException;
@@ -143,7 +144,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) {
@@ -221,7 +222,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/jmx/remote/internal/ClientNotifForwarder.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java	Fri Apr 10 20:39:34 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
@@ -538,6 +538,13 @@
                 currentFetchThread = null;
             }
 
+            if (nr == null) {
+                if (logger.traceOn()) {
+                    logger.trace("NotifFetcher-run",
+                            "Recieved null object as notifs, stops fetching because the "
+                                    + "notification server is terminated.");
+                }
+            }
             if (nr == null || shouldStop()) {
                 // tell that the thread is REALLY stopped
                 setState(STOPPED);
@@ -657,7 +664,7 @@
                     return null;
                 }
 
-                if (shouldStop())
+                if (shouldStop() || nr == null)
                     return null;
 
                 startSequenceNumber = nr.getNextSequenceNumber();
--- a/src/share/classes/com/sun/tools/jdi/ObjectReferenceImpl.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/com/sun/tools/jdi/ObjectReferenceImpl.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -311,7 +311,7 @@
         /*
          * For nonvirtual invokes, method must have a body
          */
-        if ((options & INVOKE_NONVIRTUAL) != 0) {
+        if (isNonVirtual(options)) {
             if (method.isAbstract()) {
                 throw new IllegalArgumentException("Abstract method");
             }
@@ -323,7 +323,7 @@
          * method argument types.
          */
         ClassTypeImpl invokedClass;
-        if ((options & INVOKE_NONVIRTUAL) != 0) {
+        if (isNonVirtual(options)) {
             // No overrides in non-virtual invokes
             invokedClass = clazz;
         } else {
@@ -348,7 +348,7 @@
         /*
          * Only default methods allowed for nonvirtual invokes
          */
-        if (!method.isDefault()) {
+        if (isNonVirtual(options) && !method.isDefault()) {
             throw new IllegalArgumentException("Not a default method");
         }
     }
@@ -624,4 +624,8 @@
     byte typeValueKey() {
         return JDWP.Tag.OBJECT;
     }
+
+    private static boolean isNonVirtual(int options) {
+        return (options & INVOKE_NONVIRTUAL) != 0;
+    }
 }
--- a/src/share/classes/java/awt/Component.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/awt/Component.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -1669,15 +1669,6 @@
         /* do nothing */
     }
 
-    /*
-     * Delete references from LightweithDispatcher of a heavyweight parent
-     */
-    void clearLightweightDispatcherOnRemove(Component removedComponent) {
-        if (parent != null) {
-            parent.clearLightweightDispatcherOnRemove(removedComponent);
-        }
-    }
-
     /**
      * @deprecated As of JDK version 1.1,
      * replaced by <code>setVisible(boolean)</code>.
@@ -6180,7 +6171,7 @@
     /**
      * Indicates whether a class or its superclasses override coalesceEvents.
      * Must be called with lock on coalesceMap and privileged.
-     * @see checkCoalsecing
+     * @see checkCoalescing
      */
     private static boolean isCoalesceEventsOverriden(Class<?> clazz) {
         assert Thread.holdsLock(coalesceMap);
@@ -6986,8 +6977,6 @@
         }
 
         synchronized (getTreeLock()) {
-            clearLightweightDispatcherOnRemove(this);
-
             if (isFocusOwner() && KeyboardFocusManager.isAutoFocusTransferEnabledFor(this)) {
                 transferFocus(true);
             }
--- a/src/share/classes/java/awt/Container.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/awt/Container.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -41,6 +41,7 @@
 import java.io.PrintStream;
 import java.io.PrintWriter;
 
+import java.lang.ref.WeakReference;
 import java.security.AccessController;
 
 import java.util.EventListener;
@@ -3310,16 +3311,6 @@
         }
     }
 
-    @Override
-    void clearLightweightDispatcherOnRemove(Component removedComponent) {
-        if (dispatcher != null) {
-            dispatcher.removeReferences(removedComponent);
-        } else {
-            //It is a Lightweight Container, should clear parent`s Dispatcher
-            super.clearLightweightDispatcherOnRemove(removedComponent);
-        }
-    }
-
     final Container getTraversalRoot() {
         if (isFocusCycleRoot()) {
             return findTraversalRoot();
@@ -4413,7 +4404,9 @@
 
     LightweightDispatcher(Container nativeContainer) {
         this.nativeContainer = nativeContainer;
-        mouseEventTarget = null;
+        mouseEventTarget = new WeakReference<>(null);
+        targetLastEntered = new WeakReference<>(null);
+        targetLastEnteredDT = new WeakReference<>(null);
         eventMask = 0;
     }
 
@@ -4424,9 +4417,9 @@
     void dispose() {
         //System.out.println("Disposing lw dispatcher");
         stopListeningForOtherDrags();
-        mouseEventTarget = null;
-        targetLastEntered = null;
-        targetLastEnteredDT = null;
+        mouseEventTarget.clear();
+        targetLastEntered.clear();
+        targetLastEnteredDT.clear();
     }
 
     /**
@@ -4513,65 +4506,62 @@
 
         trackMouseEnterExit(mouseOver, e);
 
-    // 4508327 : MOUSE_CLICKED should only go to the recipient of
-    // the accompanying MOUSE_PRESSED, so don't reset mouseEventTarget on a
-    // MOUSE_CLICKED.
-    if (!isMouseGrab(e) && id != MouseEvent.MOUSE_CLICKED) {
-            mouseEventTarget = (mouseOver != nativeContainer) ? mouseOver: null;
-            isCleaned = false;
+        Component met = mouseEventTarget.get();
+        // 4508327 : MOUSE_CLICKED should only go to the recipient of
+        // the accompanying MOUSE_PRESSED, so don't reset mouseEventTarget on a
+        // MOUSE_CLICKED.
+        if (!isMouseGrab(e) && id != MouseEvent.MOUSE_CLICKED) {
+            met = (mouseOver != nativeContainer) ? mouseOver : null;
+            mouseEventTarget = new WeakReference<>(met);
         }
 
-        if (mouseEventTarget != null) {
+        if (met != null) {
             switch (id) {
-            case MouseEvent.MOUSE_ENTERED:
-            case MouseEvent.MOUSE_EXITED:
-                break;
-            case MouseEvent.MOUSE_PRESSED:
-                retargetMouseEvent(mouseEventTarget, id, e);
-                break;
-        case MouseEvent.MOUSE_RELEASED:
-            retargetMouseEvent(mouseEventTarget, id, e);
-        break;
-        case MouseEvent.MOUSE_CLICKED:
-        // 4508327: MOUSE_CLICKED should never be dispatched to a Component
-        // other than that which received the MOUSE_PRESSED event.  If the
-        // mouse is now over a different Component, don't dispatch the event.
-        // The previous fix for a similar problem was associated with bug
-        // 4155217.
-        if (mouseOver == mouseEventTarget) {
-            retargetMouseEvent(mouseOver, id, e);
-        }
-        break;
-            case MouseEvent.MOUSE_MOVED:
-                retargetMouseEvent(mouseEventTarget, id, e);
-                break;
-        case MouseEvent.MOUSE_DRAGGED:
-            if (isMouseGrab(e)) {
-                retargetMouseEvent(mouseEventTarget, id, e);
-            }
-                break;
-        case MouseEvent.MOUSE_WHEEL:
-            // This may send it somewhere that doesn't have MouseWheelEvents
-            // enabled.  In this case, Component.dispatchEventImpl() will
-            // retarget the event to a parent that DOES have the events enabled.
-            if (eventLog.isLoggable(PlatformLogger.Level.FINEST) && (mouseOver != null)) {
-                eventLog.finest("retargeting mouse wheel to " +
+                case MouseEvent.MOUSE_ENTERED:
+                case MouseEvent.MOUSE_EXITED:
+                    break;
+                case MouseEvent.MOUSE_PRESSED:
+                    retargetMouseEvent(met, id, e);
+                    break;
+                case MouseEvent.MOUSE_RELEASED:
+                    retargetMouseEvent(met, id, e);
+                    break;
+                case MouseEvent.MOUSE_CLICKED:
+                    // 4508327: MOUSE_CLICKED should never be dispatched to a Component
+                    // other than that which received the MOUSE_PRESSED event.  If the
+                    // mouse is now over a different Component, don't dispatch the event.
+                    // The previous fix for a similar problem was associated with bug
+                    // 4155217.
+                    if (mouseOver == met) {
+                        retargetMouseEvent(mouseOver, id, e);
+                    }
+                    break;
+                case MouseEvent.MOUSE_MOVED:
+                    retargetMouseEvent(met, id, e);
+                    break;
+                case MouseEvent.MOUSE_DRAGGED:
+                    if (isMouseGrab(e)) {
+                        retargetMouseEvent(met, id, e);
+                    }
+                    break;
+                case MouseEvent.MOUSE_WHEEL:
+                    // This may send it somewhere that doesn't have MouseWheelEvents
+                    // enabled.  In this case, Component.dispatchEventImpl() will
+                    // retarget the event to a parent that DOES have the events enabled.
+                    if (eventLog.isLoggable(PlatformLogger.Level.FINEST) && (mouseOver != null)) {
+                        eventLog.finest("retargeting mouse wheel to " +
                                 mouseOver.getName() + ", " +
                                 mouseOver.getClass());
+                    }
+                    retargetMouseEvent(mouseOver, id, e);
+                    break;
             }
-            retargetMouseEvent(mouseOver, id, e);
-        break;
+            //Consuming of wheel events is implemented in "retargetMouseEvent".
+            if (id != MouseEvent.MOUSE_WHEEL) {
+                e.consume();
             }
-        //Consuming of wheel events is implemented in "retargetMouseEvent".
-        if (id != MouseEvent.MOUSE_WHEEL) {
-            e.consume();
         }
-    } else if (isCleaned && id != MouseEvent.MOUSE_WHEEL) {
-        //After mouseEventTarget was removed and cleaned should consume all events
-        //until new mouseEventTarget is found
-        e.consume();
-    }
-    return e.isConsumed();
+        return e.isConsumed();
     }
 
     private boolean processDropTargetEvent(SunDropTargetEvent e) {
@@ -4628,15 +4618,16 @@
             // drag has an associated drop target. MOUSE_ENTERED comes when the
             // mouse is in the native container already. To propagate this event
             // properly we should null out targetLastEntered.
-            targetLastEnteredDT = null;
+            targetLastEnteredDT.clear();
         } else if (id == MouseEvent.MOUSE_ENTERED) {
             isMouseDTInNativeContainer = true;
         } else if (id == MouseEvent.MOUSE_EXITED) {
             isMouseDTInNativeContainer = false;
         }
-        targetLastEnteredDT = retargetMouseEnterExit(targetOver, e,
-                                                     targetLastEnteredDT,
+        Component tle = retargetMouseEnterExit(targetOver, e,
+                                                     targetLastEnteredDT.get(),
                                                      isMouseDTInNativeContainer);
+        targetLastEnteredDT = new WeakReference<>(tle);
     }
 
     /*
@@ -4662,9 +4653,10 @@
             isMouseInNativeContainer = false;
             stopListeningForOtherDrags();
         }
-        targetLastEntered = retargetMouseEnterExit(targetOver, e,
-                                                   targetLastEntered,
+        Component tle = retargetMouseEnterExit(targetOver, e,
+                                                   targetLastEntered.get(),
                                                    isMouseInNativeContainer);
+        targetLastEntered = new WeakReference<>(tle);
     }
 
     private Component retargetMouseEnterExit(Component targetOver, MouseEvent e,
@@ -4926,22 +4918,17 @@
      * is null, there are currently no events being forwarded to
      * a subcomponent.
      */
-    private transient Component mouseEventTarget;
+    private transient WeakReference<Component> mouseEventTarget;
 
     /**
      * The last component entered by the {@code MouseEvent}.
      */
-    private transient Component targetLastEntered;
+    private transient  WeakReference<Component> targetLastEntered;
 
     /**
      * The last component entered by the {@code SunDropTargetEvent}.
      */
-    private transient Component targetLastEnteredDT;
-
-    /**
-     * Indicates whether {@code mouseEventTarget} was removed and nulled
-     */
-    private transient boolean isCleaned;
+    private transient  WeakReference<Component> targetLastEnteredDT;
 
     /**
      * Is the mouse over the native container.
@@ -4982,17 +4969,4 @@
         AWTEvent.MOUSE_EVENT_MASK |
         AWTEvent.MOUSE_MOTION_EVENT_MASK |
         AWTEvent.MOUSE_WHEEL_EVENT_MASK;
-
-    void removeReferences(Component removedComponent) {
-        if (mouseEventTarget == removedComponent) {
-            isCleaned = true;
-            mouseEventTarget = null;
-        }
-        if (targetLastEntered == removedComponent) {
-            targetLastEntered = null;
-        }
-        if (targetLastEnteredDT == removedComponent) {
-            targetLastEnteredDT = null;
-        }
-    }
 }
--- a/src/share/classes/java/awt/GraphicsEnvironment.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/awt/GraphicsEnvironment.java	Fri Apr 10 20:39:34 2015 -0700
@@ -181,7 +181,8 @@
                                                      "SunOS".equals(osName) ||
                                                      "FreeBSD".equals(osName) ||
                                                      "NetBSD".equals(osName) ||
-                                                     "OpenBSD".equals(osName)) &&
+                                                     "OpenBSD".equals(osName) ||
+                                                     "AIX".equals(osName)) &&
                                                      (System.getenv("DISPLAY") == null));
                             }
                         }
--- a/src/share/classes/java/lang/Object.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/lang/Object.java	Fri Apr 10 20:39:34 2015 -0700
@@ -453,7 +453,7 @@
                                 "nanosecond timeout value out of range");
         }
 
-        if (nanos >= 500000 || (nanos != 0 && timeout == 0)) {
+        if (nanos > 0) {
             timeout++;
         }
 
--- a/src/share/classes/java/lang/String.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/lang/String.java	Fri Apr 10 20:39:34 2015 -0700
@@ -135,7 +135,7 @@
      * unnecessary since Strings are immutable.
      */
     public String() {
-        this.value = new char[0];
+        this.value = "".value;
     }
 
     /**
@@ -191,8 +191,14 @@
         if (offset < 0) {
             throw new StringIndexOutOfBoundsException(offset);
         }
-        if (count < 0) {
-            throw new StringIndexOutOfBoundsException(count);
+        if (count <= 0) {
+            if (count < 0) {
+                throw new StringIndexOutOfBoundsException(count);
+            }
+            if (offset <= value.length) {
+                this.value = "".value;
+                return;
+            }
         }
         // Note: offset or count might be near -1>>>1.
         if (offset > value.length - count) {
@@ -233,8 +239,14 @@
         if (offset < 0) {
             throw new StringIndexOutOfBoundsException(offset);
         }
-        if (count < 0) {
-            throw new StringIndexOutOfBoundsException(count);
+        if (count <= 0) {
+            if (count < 0) {
+                throw new StringIndexOutOfBoundsException(count);
+            }
+            if (offset <= codePoints.length) {
+                this.value = "".value;
+                return;
+            }
         }
         // Note: offset or count might be near -1>>>1.
         if (offset > codePoints.length - count) {
@@ -782,7 +794,7 @@
      * subarray of {@code dst} starting at index {@code dstBegin}
      * and ending at index:
      * <blockquote><pre>
-     *     dstbegin + (srcEnd-srcBegin) - 1
+     *     dstBegin + (srcEnd-srcBegin) - 1
      * </pre></blockquote>
      *
      * @param      srcBegin   index of the first character in the string
@@ -827,7 +839,7 @@
      * dst} starting at index {@code dstBegin} and ending at index:
      *
      * <blockquote><pre>
-     *     dstbegin + (srcEnd-srcBegin) - 1
+     *     dstBegin + (srcEnd-srcBegin) - 1
      * </pre></blockquote>
      *
      * @deprecated  This method does not properly convert characters into
--- a/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java	Fri Apr 10 20:39:34 2015 -0700
@@ -285,6 +285,7 @@
         // Forward the SAM method
         MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, samMethodName,
                                           samMethodType.toMethodDescriptorString(), null, null);
+        mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
         new ForwardingMethodGenerator(mv).generate(samMethodType);
 
         // Forward the bridges
@@ -292,6 +293,7 @@
             for (MethodType mt : additionalBridges) {
                 mv = cw.visitMethod(ACC_PUBLIC|ACC_BRIDGE, samMethodName,
                                     mt.toMethodDescriptorString(), null, null);
+                mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
                 new ForwardingMethodGenerator(mv).generate(mt);
             }
         }
--- a/src/share/classes/java/math/BigDecimal.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/math/BigDecimal.java	Fri Apr 10 20:39:34 2015 -0700
@@ -4801,41 +4801,61 @@
         if (dividendHi >= divisor) {
             return null;
         }
+
         final int shift = Long.numberOfLeadingZeros(divisor);
         divisor <<= shift;
 
         final long v1 = divisor >>> 32;
         final long v0 = divisor & LONG_MASK;
 
-        long q1, q0;
-        long r_tmp;
-
         long tmp = dividendLo << shift;
         long u1 = tmp >>> 32;
         long u0 = tmp & LONG_MASK;
 
         tmp = (dividendHi << shift) | (dividendLo >>> 64 - shift);
         long u2 = tmp & LONG_MASK;
-        tmp = divWord(tmp,v1);
-        q1 = tmp & LONG_MASK;
-        r_tmp = tmp >>> 32;
+        long q1, r_tmp;
+        if (v1 == 1) {
+            q1 = tmp;
+            r_tmp = 0;
+        } else if (tmp >= 0) {
+            q1 = tmp / v1;
+            r_tmp = tmp - q1 * v1;
+        } else {
+            long[] rq = divRemNegativeLong(tmp, v1);
+            q1 = rq[1];
+            r_tmp = rq[0];
+        }
+
         while(q1 >= DIV_NUM_BASE || unsignedLongCompare(q1*v0, make64(r_tmp, u1))) {
             q1--;
             r_tmp += v1;
             if (r_tmp >= DIV_NUM_BASE)
                 break;
         }
+
         tmp = mulsub(u2,u1,v1,v0,q1);
         u1 = tmp & LONG_MASK;
-        tmp = divWord(tmp,v1);
-        q0 = tmp & LONG_MASK;
-        r_tmp = tmp >>> 32;
+        long q0;
+        if (v1 == 1) {
+            q0 = tmp;
+            r_tmp = 0;
+        } else if (tmp >= 0) {
+            q0 = tmp / v1;
+            r_tmp = tmp - q0 * v1;
+        } else {
+            long[] rq = divRemNegativeLong(tmp, v1);
+            q0 = rq[1];
+            r_tmp = rq[0];
+        }
+
         while(q0 >= DIV_NUM_BASE || unsignedLongCompare(q0*v0,make64(r_tmp,u0))) {
             q0--;
             r_tmp += v1;
             if (r_tmp >= DIV_NUM_BASE)
                 break;
         }
+
         if((int)q1 < 0) {
             // result (which is positive and unsigned here)
             // can't fit into long due to sign bit is used for value
@@ -4858,10 +4878,13 @@
                 }
             }
         }
+
         long q = make64(q1,q0);
         q*=sign;
+
         if (roundingMode == ROUND_DOWN && scale == preferredScale)
             return valueOf(q, scale);
+
         long r = mulsub(u1, u0, v1, v0, q0) >>> shift;
         if (r != 0) {
             boolean increment = needIncrement(divisor >>> shift, roundingMode, sign, q, r);
@@ -4904,28 +4927,35 @@
         }
     }
 
-    private static long divWord(long n, long dLong) {
-        long r;
-        long q;
-        if (dLong == 1) {
-            q = (int)n;
-            return (q & LONG_MASK);
-        }
+    /**
+     * Calculate the quotient and remainder of dividing a negative long by
+     * another long.
+     *
+     * @param n the numerator; must be negative
+     * @param d the denominator; must not be unity
+     * @return a two-element {@long} array with the remainder and quotient in
+     *         the initial and final elements, respectively
+     */
+    private static long[] divRemNegativeLong(long n, long d) {
+        assert n < 0 : "Non-negative numerator " + n;
+        assert d != 1 : "Unity denominator";
+
         // Approximate the quotient and remainder
-        q = (n >>> 1) / (dLong >>> 1);
-        r = n - q*dLong;
+        long q = (n >>> 1) / (d >>> 1);
+        long r = n - q * d;
 
         // Correct the approximation
         while (r < 0) {
-            r += dLong;
+            r += d;
             q--;
         }
-        while (r >= dLong) {
-            r -= dLong;
+        while (r >= d) {
+            r -= d;
             q++;
         }
-        // n - q*dlong == r && 0 <= r <dLong, hence we're done.
-        return (r << 32) | (q & LONG_MASK);
+
+        // n - q*d == r && 0 <= r < d, hence we're done.
+        return new long[] {r, q};
     }
 
     private static long make64(long hi, long lo) {
--- a/src/share/classes/java/security/AccessControlContext.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/security/AccessControlContext.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -172,9 +172,24 @@
     public AccessControlContext(AccessControlContext acc,
                                 DomainCombiner combiner) {
 
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(SecurityConstants.CREATE_ACC_PERMISSION);
+        this(acc, combiner, false);
+    }
+
+    /**
+     * package private to allow calls from ProtectionDomain without performing
+     * the security check for {@linkplain SecurityConstants.CREATE_ACC_PERMISSION}
+     * permission
+     */
+    AccessControlContext(AccessControlContext acc,
+                        DomainCombiner combiner,
+                        boolean preauthorized) {
+        if (!preauthorized) {
+            SecurityManager sm = System.getSecurityManager();
+            if (sm != null) {
+                sm.checkPermission(SecurityConstants.CREATE_ACC_PERMISSION);
+                this.isAuthorized = true;
+            }
+        } else {
             this.isAuthorized = true;
         }
 
--- a/src/share/classes/java/security/ProtectionDomain.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/security/ProtectionDomain.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, 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
@@ -25,6 +25,7 @@
 
 package java.security;
 
+import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
@@ -59,35 +60,44 @@
  */
 
 public class ProtectionDomain {
+    private static class JavaSecurityAccessImpl implements JavaSecurityAccess {
+
+        private JavaSecurityAccessImpl() {
+        }
+
+        @Override
+        public <T> T doIntersectionPrivilege(
+                PrivilegedAction<T> action,
+                final AccessControlContext stack,
+                final AccessControlContext context) {
+            if (action == null) {
+                throw new NullPointerException();
+            }
+
+            return AccessController.doPrivileged(
+                action,
+                getCombinedACC(context, stack)
+            );
+        }
+
+        @Override
+        public <T> T doIntersectionPrivilege(
+                PrivilegedAction<T> action,
+                AccessControlContext context) {
+            return doIntersectionPrivilege(action,
+                AccessController.getContext(), context);
+        }
+
+        private static AccessControlContext getCombinedACC(AccessControlContext context, AccessControlContext stack) {
+            AccessControlContext acc = new AccessControlContext(context, stack.getCombiner(), true);
+
+            return new AccessControlContext(stack.getContext(), acc).optimize();
+        }
+    }
 
     static {
         // Set up JavaSecurityAccess in SharedSecrets
-        SharedSecrets.setJavaSecurityAccess(
-            new JavaSecurityAccess() {
-                public <T> T doIntersectionPrivilege(
-                    PrivilegedAction<T> action,
-                    final AccessControlContext stack,
-                    final AccessControlContext context)
-                {
-                    if (action == null) {
-                        throw new NullPointerException();
-                    }
-                    return AccessController.doPrivileged(
-                        action,
-                        new AccessControlContext(
-                            stack.getContext(), context).optimize()
-                    );
-                }
-
-                public <T> T doIntersectionPrivilege(
-                    PrivilegedAction<T> action,
-                    AccessControlContext context)
-                {
-                    return doIntersectionPrivilege(action,
-                        AccessController.getContext(), context);
-                }
-            }
-       );
+        SharedSecrets.setJavaSecurityAccess(new JavaSecurityAccessImpl());
     }
 
     /* CodeSource */
@@ -447,24 +457,37 @@
     /**
      * Used for storing ProtectionDomains as keys in a Map.
      */
-    final class Key {}
+    final static class Key {}
+
+    // A cache of ProtectionDomains and their Permissions
+    private static class PDCache implements ProtectionDomainCache {
+        // We must wrap the PermissionCollection in a WeakReference as there
+        // are some PermissionCollections which contain strong references
+        // back to a ProtectionDomain and otherwise would never be removed
+        // from the WeakHashMap
+        private final Map<Key, WeakReference<PermissionCollection>>
+            map = new WeakHashMap<>();
+
+        @Override
+        public synchronized void put(ProtectionDomain pd,
+                                     PermissionCollection pc) {
+            map.put(pd == null ? null : pd.key, new WeakReference<>(pc));
+        }
+
+        @Override
+        public synchronized PermissionCollection get(ProtectionDomain pd) {
+            WeakReference<PermissionCollection> ref =
+                map.get(pd == null ? null : pd.key);
+            return ref == null ? null : ref.get();
+        }
+    }
 
     static {
         SharedSecrets.setJavaSecurityProtectionDomainAccess(
             new JavaSecurityProtectionDomainAccess() {
+                @Override
                 public ProtectionDomainCache getProtectionDomainCache() {
-                    return new ProtectionDomainCache() {
-                        private final Map<Key, PermissionCollection> map =
-                            Collections.synchronizedMap
-                                (new WeakHashMap<Key, PermissionCollection>());
-                        public void put(ProtectionDomain pd,
-                            PermissionCollection pc) {
-                            map.put((pd == null ? null : pd.key), pc);
-                        }
-                        public PermissionCollection get(ProtectionDomain pd) {
-                            return pd == null ? map.get(null) : map.get(pd.key);
-                        }
-                    };
+                    return new PDCache();
                 }
             });
     }
--- a/src/share/classes/java/security/cert/X509CertSelector.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/security/cert/X509CertSelector.java	Fri Apr 10 20:39:34 2015 -0700
@@ -2574,8 +2574,10 @@
         } else {
             if (maxPathLen < basicConstraints) {
                 if (debug != null) {
-                    debug.println("X509CertSelector.match: maxPathLen too small ("
-                        + maxPathLen + " < " + basicConstraints + ")");
+                    debug.println("X509CertSelector.match: cert's maxPathLen " +
+                            "is less than the min maxPathLen set by " +
+                            "basicConstraints. " +
+                            "(" + maxPathLen + " < " + basicConstraints + ")");
                 }
                 return false;
             }
--- a/src/share/classes/java/util/Calendar.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/util/Calendar.java	Fri Apr 10 20:39:34 2015 -0700
@@ -2083,17 +2083,33 @@
             return null;
         }
 
+        String calendarType = getCalendarType();
+        int fieldValue = get(field);
         // the standalone and narrow styles are supported only through CalendarDataProviders.
-        if (isStandaloneStyle(style) || isNarrowStyle(style)) {
-            return CalendarDataUtility.retrieveFieldValueName(getCalendarType(),
-                                                              field, get(field),
-                                                              style, locale);
+        if (isStandaloneStyle(style) || isNarrowFormatStyle(style)) {
+            String val = CalendarDataUtility.retrieveFieldValueName(calendarType,
+                                                                    field, fieldValue,
+                                                                    style, locale);
+            // Perform fallback here to follow the CLDR rules
+            if (val == null) {
+                if (isNarrowFormatStyle(style)) {
+                    val = CalendarDataUtility.retrieveFieldValueName(calendarType,
+                                                                     field, fieldValue,
+                                                                     toStandaloneStyle(style),
+                                                                     locale);
+                } else if (isStandaloneStyle(style)) {
+                    val = CalendarDataUtility.retrieveFieldValueName(calendarType,
+                                                                     field, fieldValue,
+                                                                     getBaseStyle(style),
+                                                                     locale);
+                }
+            }
+            return val;
         }
 
         DateFormatSymbols symbols = DateFormatSymbols.getInstance(locale);
         String[] strings = getFieldStrings(field, style, symbols);
         if (strings != null) {
-            int fieldValue = get(field);
             if (fieldValue < strings.length) {
                 return strings[fieldValue];
             }
@@ -2155,10 +2171,26 @@
                                     ERA_MASK|MONTH_MASK|DAY_OF_WEEK_MASK|AM_PM_MASK)) {
             return null;
         }
-        if (style == ALL_STYLES || isStandaloneStyle(style)) {
-            return CalendarDataUtility.retrieveFieldValueNames(getCalendarType(), field, style, locale);
+
+        String calendarType = getCalendarType();
+        if (style == ALL_STYLES || isStandaloneStyle(style) || isNarrowFormatStyle(style)) {
+            Map<String, Integer> map;
+            map = CalendarDataUtility.retrieveFieldValueNames(calendarType, field, style, locale);
+
+            // Perform fallback here to follow the CLDR rules
+            if (map == null) {
+                if (isNarrowFormatStyle(style)) {
+                    map = CalendarDataUtility.retrieveFieldValueNames(calendarType, field,
+                                                                      toStandaloneStyle(style), locale);
+                } else if (style != ALL_STYLES) {
+                    map = CalendarDataUtility.retrieveFieldValueNames(calendarType, field,
+                                                                      getBaseStyle(style), locale);
+                }
+            }
+            return map;
         }
-        // SHORT, LONG, or NARROW
+
+        // SHORT or LONG
         return getDisplayNamesImpl(field, style, locale);
     }
 
@@ -2544,14 +2576,22 @@
         return style & ~STANDALONE_MASK;
     }
 
-    boolean isStandaloneStyle(int style) {
+    private int toStandaloneStyle(int style) {
+        return style | STANDALONE_MASK;
+    }
+
+    private boolean isStandaloneStyle(int style) {
         return (style & STANDALONE_MASK) != 0;
     }
 
-    boolean isNarrowStyle(int style) {
+    private boolean isNarrowStyle(int style) {
         return style == NARROW_FORMAT || style == NARROW_STANDALONE;
     }
 
+    private boolean isNarrowFormatStyle(int style) {
+        return style == NARROW_FORMAT;
+    }
+
     /**
      * Returns the pseudo-time-stamp for two fields, given their
      * individual pseudo-time-stamps.  If either of the fields
--- a/src/share/classes/java/util/ComparableTimSort.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/util/ComparableTimSort.java	Fri Apr 10 20:39:34 2015 -0700
@@ -144,10 +144,14 @@
          * large) stack lengths for smaller arrays.  The "magic numbers" in the
          * computation below must be changed if MIN_MERGE is decreased.  See
          * the MIN_MERGE declaration above for more information.
+         * The maximum value of 49 allows for an array up to length
+         * Integer.MAX_VALUE-4, if array is filled by the worst case stack size
+         * increasing scenario. More explanations are given in section 4 of:
+         * http://envisage-project.eu/wp-content/uploads/2015/02/sorting.pdf
          */
         int stackLen = (len <    120  ?  5 :
                         len <   1542  ? 10 :
-                        len < 119151  ? 24 : 40);
+                        len < 119151  ? 24 : 49);
         runBase = new int[stackLen];
         runLen = new int[stackLen];
     }
--- a/src/share/classes/java/util/TimSort.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/util/TimSort.java	Fri Apr 10 20:39:34 2015 -0700
@@ -174,10 +174,14 @@
          * large) stack lengths for smaller arrays.  The "magic numbers" in the
          * computation below must be changed if MIN_MERGE is decreased.  See
          * the MIN_MERGE declaration above for more information.
+         * The maximum value of 49 allows for an array up to length
+         * Integer.MAX_VALUE-4, if array is filled by the worst case stack size
+         * increasing scenario. More explanations are given in section 4 of:
+         * http://envisage-project.eu/wp-content/uploads/2015/02/sorting.pdf
          */
         int stackLen = (len <    120  ?  5 :
                         len <   1542  ? 10 :
-                        len < 119151  ? 24 : 40);
+                        len < 119151  ? 24 : 49);
         runBase = new int[stackLen];
         runLen = new int[stackLen];
     }
--- a/src/share/classes/java/util/concurrent/CompletableFuture.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/util/concurrent/CompletableFuture.java	Fri Apr 10 20:39:34 2015 -0700
@@ -978,7 +978,15 @@
             }
             try {
                 @SuppressWarnings("unchecked") T t = (T) r;
-                return f.apply(t).toCompletableFuture();
+                CompletableFuture<V> g = f.apply(t).toCompletableFuture();
+                Object s = g.result;
+                if (s != null)
+                    return new CompletableFuture<V>(encodeRelay(s));
+                CompletableFuture<V> d = new CompletableFuture<V>();
+                UniRelay<V> copy = new UniRelay<V>(d, g);
+                g.push(copy);
+                copy.tryFire(SYNC);
+                return d;
             } catch (Throwable ex) {
                 return new CompletableFuture<V>(encodeThrowable(ex));
             }
--- a/src/share/classes/java/util/zip/ZipEntry.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/util/zip/ZipEntry.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -41,7 +41,9 @@
 class ZipEntry implements ZipConstants, Cloneable {
 
     String name;        // entry name
-    long time = -1;     // last modification time
+    long xdostime = -1; // last modification time (in extended DOS time,
+                        // where milliseconds lost in conversion might
+                        // be encoded into the upper half)
     FileTime mtime;     // last modification time, from extra field data
     FileTime atime;     // last access time, from extra field data
     FileTime ctime;     // creation time, from extra field data
@@ -64,6 +66,28 @@
     public static final int DEFLATED = 8;
 
     /**
+     * DOS time constant for representing timestamps before 1980.
+     */
+    static final long DOSTIME_BEFORE_1980 = (1 << 21) | (1 << 16);
+
+    /**
+     * Approximately 128 years, in milliseconds (ignoring leap years etc).
+     *
+     * This establish an approximate high-bound value for DOS times in
+     * milliseconds since epoch, used to enable an efficient but
+     * sufficient bounds check to avoid generating extended last modified
+     * time entries.
+     *
+     * Calculating the exact number is locale dependent, would require loading
+     * TimeZone data eagerly, and would make little practical sense. Since DOS
+     * times theoretically go to 2107 - with compatibility not guaranteed
+     * after 2099 - setting this to a time that is before but near 2099
+     * should be sufficient.
+     */
+    private static final long UPPER_DOSTIME_BOUND =
+            128L * 365 * 24 * 60 * 60 * 1000;
+
+    /**
      * Creates a new zip entry with the specified name.
      *
      * @param  name
@@ -93,7 +117,7 @@
     public ZipEntry(ZipEntry e) {
         Objects.requireNonNull(e, "entry");
         name = e.name;
-        time = e.time;
+        xdostime = e.xdostime;
         mtime = e.mtime;
         atime = e.atime;
         ctime = e.ctime;
@@ -137,8 +161,14 @@
      * @see #getLastModifiedTime()
      */
     public void setTime(long time) {
-        this.time = time;
-        this.mtime = null;
+        this.xdostime = javaToExtendedDosTime(time);
+        // Avoid setting the mtime field if time is in the valid
+        // range for a DOS time
+        if (xdostime != DOSTIME_BEFORE_1980 && time <= UPPER_DOSTIME_BOUND) {
+            this.mtime = null;
+        } else {
+            this.mtime = FileTime.from(time, TimeUnit.MILLISECONDS);
+        }
     }
 
     /**
@@ -158,7 +188,10 @@
      * @see #setLastModifiedTime(FileTime)
      */
     public long getTime() {
-        return time;
+        if (mtime != null) {
+            return mtime.toMillis();
+        }
+        return (xdostime != -1) ? extendedDosToJavaTime(xdostime) : -1;
     }
 
     /**
@@ -180,9 +213,8 @@
      * @since 1.8
      */
     public ZipEntry setLastModifiedTime(FileTime time) {
-        Objects.requireNonNull(name, "time");
-        this.mtime = time;
-        this.time = time.to(TimeUnit.MILLISECONDS);
+        this.mtime = Objects.requireNonNull(time, "lastModifiedTime");
+        this.xdostime = javaToExtendedDosTime(time.to(TimeUnit.MILLISECONDS));
         return this;
     }
 
@@ -205,9 +237,9 @@
     public FileTime getLastModifiedTime() {
         if (mtime != null)
             return mtime;
-        if (time == -1)
+        if (xdostime == -1)
             return null;
-        return FileTime.from(time, TimeUnit.MILLISECONDS);
+        return FileTime.from(getTime(), TimeUnit.MILLISECONDS);
     }
 
     /**
@@ -227,8 +259,7 @@
      * @since 1.8
      */
     public ZipEntry setLastAccessTime(FileTime time) {
-        Objects.requireNonNull(name, "time");
-        this.atime = time;
+        this.atime = Objects.requireNonNull(time, "lastAccessTime");
         return this;
     }
 
@@ -265,8 +296,7 @@
      * @since 1.8
      */
     public ZipEntry setCreationTime(FileTime time) {
-        Objects.requireNonNull(name, "time");
-        this.ctime = time;
+        this.ctime = Objects.requireNonNull(time, "creationTime");
         return this;
     }
 
--- a/src/share/classes/java/util/zip/ZipFile.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/util/zip/ZipFile.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -46,7 +46,6 @@
 import java.util.stream.StreamSupport;
 
 import static java.util.zip.ZipConstants64.*;
-import static java.util.zip.ZipUtils.*;
 
 /**
  * This class is used to read entries from a zip file.
@@ -567,7 +566,7 @@
                 e.name = zc.toString(bname, bname.length);
             }
         }
-        e.time = dosToJavaTime(getEntryTime(jzentry));
+        e.xdostime = getEntryTime(jzentry);
         e.crc = getEntryCrc(jzentry);
         e.size = getEntrySize(jzentry);
         e.csize = getEntryCSize(jzentry);
--- a/src/share/classes/java/util/zip/ZipInputStream.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/util/zip/ZipInputStream.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -303,7 +303,7 @@
             throw new ZipException("encrypted ZIP entry not supported");
         }
         e.method = get16(tmpbuf, LOCHOW);
-        e.time = dosToJavaTime(get32(tmpbuf, LOCTIM));
+        e.xdostime = get32(tmpbuf, LOCTIM);
         if ((flag & 8) == 8) {
             /* "Data Descriptor" present */
             if (e.method != DEFLATED) {
--- a/src/share/classes/java/util/zip/ZipOutputStream.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/util/zip/ZipOutputStream.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -61,7 +61,6 @@
     private static class XEntry {
         final ZipEntry entry;
         final long offset;
-        long dostime;    // last modification time in msdos format
         public XEntry(ZipEntry entry, long offset) {
             this.entry = entry;
             this.offset = offset;
@@ -192,7 +191,7 @@
         if (current != null) {
             closeEntry();       // close previous entry
         }
-        if (e.time == -1) {
+        if (e.xdostime == -1) {
             // by default, do NOT use extended timestamps in extra
             // data, for now.
             e.setTime(System.currentTimeMillis());
@@ -389,18 +388,12 @@
         boolean hasZip64 = false;
         int elen = getExtraLen(e.extra);
 
-        // keep a copy of dostime for writeCEN(), otherwise the tz
-        // sensitive local time entries in loc and cen might be
-        // different if the default tz get changed during writeLOC()
-        // and writeCEN()
-        xentry.dostime = javaToDosTime(e.time);
-
         writeInt(LOCSIG);               // LOC header signature
         if ((flag & 8) == 8) {
             writeShort(version(e));     // version needed to extract
             writeShort(flag);           // general purpose bit flag
             writeShort(e.method);       // compression method
-            writeInt(xentry.dostime);   // last modification time
+            writeInt(e.xdostime);       // last modification time
             // store size, uncompressed size, and crc-32 in data descriptor
             // immediately following compressed entry data
             writeInt(0);
@@ -415,7 +408,7 @@
             }
             writeShort(flag);           // general purpose bit flag
             writeShort(e.method);       // compression method
-            writeInt(xentry.dostime);   // last modification time
+            writeInt(e.xdostime);       // last modification time
             writeInt(e.crc);            // crc-32
             if (hasZip64) {
                 writeInt(ZIP64_MAGICVAL);
@@ -522,9 +515,7 @@
         }
         writeShort(flag);           // general purpose bit flag
         writeShort(e.method);       // compression method
-        // use the copy in xentry, which has been converted
-        // from e.time in writeLOC()
-        writeInt(xentry.dostime);   // last modification time
+        writeInt(e.xdostime);       // last modification time
         writeInt(e.crc);            // crc-32
         writeInt(csize);            // compressed size
         writeInt(size);             // uncompressed size
--- a/src/share/classes/java/util/zip/ZipUtils.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/java/util/zip/ZipUtils.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -29,9 +29,6 @@
 import java.util.Date;
 import java.util.concurrent.TimeUnit;
 
-import static java.util.zip.ZipConstants.*;
-import static java.util.zip.ZipConstants64.*;
-
 class ZipUtils {
 
     // used to adjust values between Windows and java epoch
@@ -69,7 +66,7 @@
     /**
      * Converts DOS time to Java time (number of milliseconds since epoch).
      */
-    public static long dosToJavaTime(long dtime) {
+    private static long dosToJavaTime(long dtime) {
         @SuppressWarnings("deprecation") // Use of date constructor.
         Date d = new Date((int)(((dtime >> 25) & 0x7f) + 80),
                           (int)(((dtime >> 21) & 0x0f) - 1),
@@ -81,14 +78,26 @@
     }
 
     /**
+     * Converts extended DOS time to Java time, where up to 1999 milliseconds
+     * might be encoded into the upper half of the returned long.
+     *
+     * @param xdostime the extended DOS time value
+     * @return milliseconds since epoch
+     */
+    public static long extendedDosToJavaTime(long xdostime) {
+        long time = dosToJavaTime(xdostime);
+        return time + (xdostime >> 32);
+    }
+
+    /**
      * Converts Java time to DOS time.
      */
     @SuppressWarnings("deprecation") // Use of date methods
-    public static long javaToDosTime(long time) {
+    private static long javaToDosTime(long time) {
         Date d = new Date(time);
         int year = d.getYear() + 1900;
         if (year < 1980) {
-            return (1 << 21) | (1 << 16);
+            return ZipEntry.DOSTIME_BEFORE_1980;
         }
         return (year - 1980) << 25 | (d.getMonth() + 1) << 21 |
                d.getDate() << 16 | d.getHours() << 11 | d.getMinutes() << 5 |
@@ -96,6 +105,23 @@
     }
 
     /**
+     * Converts Java time to DOS time, encoding any milliseconds lost
+     * in the conversion into the upper half of the returned long.
+     *
+     * @param time milliseconds since epoch
+     * @return DOS time with 2s remainder encoded into upper half
+     */
+    public static long javaToExtendedDosTime(long time) {
+        if (time < 0) {
+            return ZipEntry.DOSTIME_BEFORE_1980;
+        }
+        long dostime = javaToDosTime(time);
+        return (dostime != ZipEntry.DOSTIME_BEFORE_1980)
+                ? dostime + ((time % 2000) << 32)
+                : ZipEntry.DOSTIME_BEFORE_1980;
+    }
+
+    /**
      * Fetches unsigned 16-bit value from byte array at specified offset.
      * The bytes are assumed to be in Intel (little-endian) byte order.
      */
--- a/src/share/classes/javax/crypto/spec/SecretKeySpec.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/javax/crypto/spec/SecretKeySpec.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, 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
@@ -26,6 +26,7 @@
 package javax.crypto.spec;
 
 import java.security.spec.KeySpec;
+import java.util.Locale;
 import javax.crypto.SecretKey;
 
 /**
@@ -194,7 +195,8 @@
         if (this.algorithm.equalsIgnoreCase("TripleDES"))
             return (retval ^= "desede".hashCode());
         else
-            return (retval ^= this.algorithm.toLowerCase().hashCode());
+            return (retval ^=
+                    this.algorithm.toLowerCase(Locale.ENGLISH).hashCode());
     }
 
    /**
--- a/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java	Fri Apr 10 20:39:34 2015 -0700
@@ -225,7 +225,7 @@
     }
 
     public short readShort() throws IOException {
-        if (read(byteBuf, 0, 2) < 0) {
+        if (read(byteBuf, 0, 2) != 2) {
             throw new EOFException();
         }
 
@@ -247,7 +247,7 @@
     }
 
     public int readInt() throws IOException {
-        if (read(byteBuf, 0, 4) < 0) {
+        if (read(byteBuf, 0, 4) !=  4) {
             throw new EOFException();
         }
 
--- a/src/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1254,10 +1254,11 @@
             if (serverTerminated) {
                 // we must not call fetchNotifs() if the server is
                 // terminated (timeout elapsed).
-                //
-                return new NotificationResult(0L, 0L,
-                                              new TargetedNotification[0]);
-
+                // returns null to force the client to stop fetching
+                if (logger.debugOn()) logger.debug("fetchNotifications",
+                               "The notification server has been closed, "
+                                       + "returns null to force the client to stop fetching");
+                return null;
             }
             final long csn = clientSequenceNumber;
             final int mn = maxNotifications;
--- a/src/share/classes/javax/script/ScriptEngineFactory.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/javax/script/ScriptEngineFactory.java	Fri Apr 10 20:39:34 2015 -0700
@@ -85,7 +85,7 @@
     public List<String> getNames();
 
     /**
-     * Returns the name of the scripting langauge supported by this
+     * Returns the name of the scripting language supported by this
      * <code>ScriptEngine</code>.
      * @return The name of the supported language.
      */
@@ -104,14 +104,15 @@
      * <ul>
      * <li>ScriptEngine.ENGINE</li>
      * <li>ScriptEngine.ENGINE_VERSION</li>
-     * <li>ScriptEngine.NAME</li>
      * <li>ScriptEngine.LANGUAGE</li>
      * <li>ScriptEngine.LANGUAGE_VERSION</li>
+     * <li>ScriptEngine.NAME</li>
      * </ul>
      * <p>
      * The values for these keys are the Strings returned by <code>getEngineName</code>,
-     * <code>getEngineVersion</code>, <code>getName</code>, <code>getLanguageName</code> and
-     * <code>getLanguageVersion</code> respectively.<br><br>
+     * <code>getEngineVersion</code>, <code>getLanguageName</code>,
+     * <code>getLanguageVersion</code> for the first four keys respectively. For NAME, one of the Strings
+     * returned by <code>getNames</code> is returned.<br><br>
      * A reserved key, <code><b>THREADING</b></code>, whose value describes the behavior of the engine
      * with respect to concurrent execution of scripts and maintenance of state is also defined.
      * These values for the <code><b>THREADING</b></code> key are:<br><br>
--- a/src/share/classes/javax/swing/JComponent.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/javax/swing/JComponent.java	Fri Apr 10 20:39:34 2015 -0700
@@ -3738,12 +3738,6 @@
          * @param listener  the PropertyChangeListener to be added
          */
         public void addPropertyChangeListener(PropertyChangeListener listener) {
-            if (accessibleContainerHandler == null) {
-                accessibleContainerHandler = new AccessibleContainerHandler();
-            }
-            if (propertyListenersCount++ == 0) {
-                JComponent.this.addContainerListener(accessibleContainerHandler);
-            }
             super.addPropertyChangeListener(listener);
         }
 
@@ -3755,9 +3749,6 @@
          * @param listener  the PropertyChangeListener to be removed
          */
         public void removePropertyChangeListener(PropertyChangeListener listener) {
-            if (--propertyListenersCount == 0) {
-                JComponent.this.removeContainerListener(accessibleContainerHandler);
-            }
             super.removePropertyChangeListener(listener);
         }
 
--- a/src/share/classes/javax/swing/JMenu.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/javax/swing/JMenu.java	Fri Apr 10 20:39:34 2015 -0700
@@ -475,7 +475,8 @@
             }
             // Then the y:
             y = s.height + yOffset;    // Prefer dropping down
-            if (position.y + y + pmSize.height >= screenBounds.height &&
+            if (position.y + y + pmSize.height >= screenBounds.height
+                                                  + screenBounds.y &&
                 // popup doesn't fit - place it wherever there's more room
                 screenBounds.height - s.height < 2*(position.y
                                                   - screenBounds.y)) {
--- a/src/share/classes/javax/swing/JTree.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/javax/swing/JTree.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -872,9 +872,10 @@
             if(treeModelListener != null)
                 treeModel.addTreeModelListener(treeModelListener);
             // Mark the root as expanded, if it isn't a leaf.
-            if(treeModel.getRoot() != null &&
-               !treeModel.isLeaf(treeModel.getRoot())) {
-                expandedState.put(new TreePath(treeModel.getRoot()),
+            Object treeRoot = treeModel.getRoot();
+            if(treeRoot != null &&
+               !treeModel.isLeaf(treeRoot)) {
+                expandedState.put(new TreePath(treeRoot),
                                   Boolean.TRUE);
             }
         }
@@ -3223,6 +3224,9 @@
 
         int          count = indexs.length;
         Object       parent = model.getRoot();
+        if (parent == null)
+            return null;
+
         TreePath     parentPath = new TreePath(parent);
 
         for(int counter = 0; counter < count; counter++) {
@@ -3798,8 +3802,9 @@
             if (parent.getPathCount() == 1) {
                 // New root, remove everything!
                 clearToggledPaths();
-                if(treeModel.getRoot() != null &&
-                   !treeModel.isLeaf(treeModel.getRoot())) {
+                Object treeRoot = treeModel.getRoot();
+                if(treeRoot != null &&
+                   !treeModel.isLeaf(treeRoot)) {
                     // Mark the root as expanded, if it isn't a leaf.
                     expandedState.put(parent, Boolean.TRUE);
                 }
@@ -4283,7 +4288,11 @@
             if (model == null) {
                 return null;
             }
-            TreePath path = new TreePath(model.getRoot());
+            Object treeRoot = model.getRoot();
+            if (treeRoot == null)
+                return null;
+
+            TreePath path = new TreePath(treeRoot);
             if (JTree.this.isVisible(path)) {
                 TreeCellRenderer r = JTree.this.getCellRenderer();
                 TreeUI ui = JTree.this.getUI();
@@ -4296,8 +4305,8 @@
                     boolean expanded = JTree.this.isExpanded(path);
 
                     return r.getTreeCellRendererComponent(JTree.this,
-                        model.getRoot(), selected, expanded,
-                        model.isLeaf(model.getRoot()), row, hasFocus);
+                        treeRoot, selected, expanded,
+                        model.isLeaf(treeRoot), row, hasFocus);
                 }
             }
             return null;
@@ -4350,8 +4359,11 @@
                 return 1;    // the root node
             }
 
+            Object treeRoot = model.getRoot();
+            if (treeRoot == null)
+                return 0;
             // return the root's first set of children count
-            return model.getChildCount(model.getRoot());
+            return model.getChildCount(treeRoot);
         }
 
         /**
@@ -4365,9 +4377,17 @@
             if (model == null) {
                 return null;
             }
+
+            Object treeRoot = model.getRoot();
+            if (treeRoot == null) {
+                return null;
+            }
+
             if (isRootVisible()) {
                 if (i == 0) {    // return the root node Accessible
-                    Object[] objPath = { model.getRoot() };
+                    Object[] objPath = { treeRoot };
+                    if (objPath[0] == null)
+                        return null;
                     TreePath path = new TreePath(objPath);
                     return new AccessibleJTreeNode(JTree.this, path, JTree.this);
                 } else {
@@ -4376,12 +4396,14 @@
             }
 
             // return Accessible for one of root's child nodes
-            int count = model.getChildCount(model.getRoot());
+            int count = model.getChildCount(treeRoot);
             if (i < 0 || i >= count) {
                 return null;
             }
-            Object obj = model.getChild(model.getRoot(), i);
-            Object[] objPath = { model.getRoot(), obj };
+            Object obj = model.getChild(treeRoot, i);
+            if (obj == null)
+                return null;
+            Object[] objPath = { treeRoot, obj };
             TreePath path = new TreePath(objPath);
             return new AccessibleJTreeNode(JTree.this, path, JTree.this);
         }
@@ -4420,6 +4442,9 @@
         public int getAccessibleSelectionCount() {
             Object[] rootPath = new Object[1];
             rootPath[0] = treeModel.getRoot();
+            if (rootPath[0] == null)
+                return 0;
+
             TreePath childPath = new TreePath(rootPath);
             if (JTree.this.isPathSelected(childPath)) {
                 return 1;
@@ -4442,6 +4467,8 @@
             if (i == 0) {
                 Object[] rootPath = new Object[1];
                 rootPath[0] = treeModel.getRoot();
+                if (rootPath[0] == null)
+                    return null;
                 TreePath childPath = new TreePath(rootPath);
                 if (JTree.this.isPathSelected(childPath)) {
                     return new AccessibleJTreeNode(JTree.this, childPath, JTree.this);
@@ -4461,6 +4488,8 @@
             if (i == 0) {
                 Object[] rootPath = new Object[1];
                 rootPath[0] = treeModel.getRoot();
+                if (rootPath[0] == null)
+                    return false;
                 TreePath childPath = new TreePath(rootPath);
                 return JTree.this.isPathSelected(childPath);
             } else {
@@ -4482,6 +4511,8 @@
            if (model != null) {
                if (i == 0) {
                    Object[] objPath = {model.getRoot()};
+                   if (objPath[0] == null)
+                        return;
                    TreePath path = new TreePath(objPath);
                    JTree.this.addSelectionPath(path);
                 }
@@ -4500,6 +4531,8 @@
             if (model != null) {
                 if (i == 0) {
                     Object[] objPath = {model.getRoot()};
+                    if (objPath[0] == null)
+                        return;
                     TreePath path = new TreePath(objPath);
                     JTree.this.removeSelectionPath(path);
                 }
@@ -4525,6 +4558,8 @@
             TreeModel model = JTree.this.getModel();
             if (model != null) {
                 Object[] objPath = {model.getRoot()};
+                if (objPath[0] == null)
+                    return;
                 TreePath path = new TreePath(objPath);
                 JTree.this.addSelectionPath(path);
             }
--- a/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java	Fri Apr 10 20:39:34 2015 -0700
@@ -876,6 +876,12 @@
                         return;
                     }
                     orientation = SwingConstants.HORIZONTAL;
+                } else if(e.isShiftDown()){
+                    JScrollBar hScroll = scrollpane.getHorizontalScrollBar();
+                    if (hScroll != null && hScroll.isVisible()) {
+                        toScroll = hScroll;
+                        orientation = SwingConstants.HORIZONTAL;
+                    }
                 }
 
                 e.consume();
--- a/src/share/classes/sun/applet/AppletPanel.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/applet/AppletPanel.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -682,7 +682,12 @@
 
         if (toFocus != null) {
             if (parent instanceof EmbeddedFrame) {
-                ((EmbeddedFrame)parent).synthesizeWindowActivation(true);
+                // JDK-8056915: Try to request focus to the embedder first and
+                // activate the embedded frame through it
+                if (!((EmbeddedFrame) parent).requestFocusToEmbedder()) {
+                    // Otherwise activate the embedded frame directly
+                    ((EmbeddedFrame) parent).synthesizeWindowActivation(true);
+                }
             }
             // EmbeddedFrame might have focus before the applet was added.
             // Thus after its activation the most recent focus owner will be
--- a/src/share/classes/sun/awt/EmbeddedFrame.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/awt/EmbeddedFrame.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -361,6 +361,15 @@
     public void synthesizeWindowActivation(boolean doActivate) {}
 
     /**
+     * Requests the focus to the embedder.
+     *
+     * @return {@code true} if focus request was successful, and {@code false} otherwise.
+     */
+    public boolean requestFocusToEmbedder() {
+        return false;
+    }
+
+    /**
      * Moves this embedded frame to a new location. The top-left corner of
      * the new location is specified by the <code>x</code> and <code>y</code>
      * parameters relative to the native parent component.
--- a/src/share/classes/sun/awt/datatransfer/SunClipboard.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/awt/datatransfer/SunClipboard.java	Fri Apr 10 20:39:34 2015 -0700
@@ -150,7 +150,7 @@
      *         AppContext as it is currently retrieved or null otherwise
      * @since 1.5
      */
-    private synchronized Transferable getContextContents() {
+    protected synchronized Transferable getContextContents() {
         AppContext context = AppContext.getAppContext();
         return (context == contentsContext) ? contents : null;
     }
@@ -281,42 +281,41 @@
             return;
         }
 
-        final Runnable runnable = new Runnable() {
-                public void run() {
-                    final SunClipboard sunClipboard = SunClipboard.this;
-                    ClipboardOwner owner = null;
-                    Transferable contents = null;
-
-                    synchronized (sunClipboard) {
-                        final AppContext context = sunClipboard.contentsContext;
-
-                        if (context == null) {
-                            return;
-                        }
-
-                        if (disposedContext == null || context == disposedContext) {
-                            owner = sunClipboard.owner;
-                            contents = sunClipboard.contents;
-                            sunClipboard.contentsContext = null;
-                            sunClipboard.owner = null;
-                            sunClipboard.contents = null;
-                            sunClipboard.clearNativeContext();
-                            context.removePropertyChangeListener
-                                (AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
-                        } else {
-                            return;
-                        }
-                    }
-                    if (owner != null) {
-                        owner.lostOwnership(sunClipboard, contents);
-                    }
-                }
-            };
-
-        SunToolkit.postEvent(context, new PeerEvent(this, runnable,
+        SunToolkit.postEvent(context, new PeerEvent(this, () -> lostOwnershipNow(disposedContext),
                                                     PeerEvent.PRIORITY_EVENT));
     }
 
+    protected void lostOwnershipNow(final AppContext disposedContext) {
+        final SunClipboard sunClipboard = SunClipboard.this;
+        ClipboardOwner owner = null;
+        Transferable contents = null;
+
+        synchronized (sunClipboard) {
+            final AppContext context = sunClipboard.contentsContext;
+
+            if (context == null) {
+                return;
+            }
+
+            if (disposedContext == null || context == disposedContext) {
+                owner = sunClipboard.owner;
+                contents = sunClipboard.contents;
+                sunClipboard.contentsContext = null;
+                sunClipboard.owner = null;
+                sunClipboard.contents = null;
+                sunClipboard.clearNativeContext();
+                context.removePropertyChangeListener
+                        (AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
+            } else {
+                return;
+            }
+        }
+        if (owner != null) {
+            owner.lostOwnership(sunClipboard, contents);
+        }
+    }
+
+
     protected abstract void clearNativeContext();
 
     protected abstract void setContentsNative(Transferable contents);
--- a/src/share/classes/sun/launcher/resources/launcher.properties	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/launcher/resources/launcher.properties	Fri Apr 10 20:39:34 2015 -0700
@@ -47,9 +47,13 @@
 \                  enable verbose output\n\
 \    -version      print product version and exit\n\
 \    -version:<value>\n\
+\                  Warning: this feature is deprecated and will be removed\n\
+\                  in a future release.\n\
 \                  require the specified version to run\n\
 \    -showversion  print product version and continue\n\
 \    -jre-restrict-search | -no-jre-restrict-search\n\
+\                  Warning: this feature is deprecated and will be removed\n\
+\                  in a future release.\n\
 \                  include/exclude user private JREs in the version search\n\
 \    -? -help      print this help message\n\
 \    -X            print help on non-standard options\n\
--- a/src/share/classes/sun/management/jmxremote/ConnectorBootstrap.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/management/jmxremote/ConnectorBootstrap.java	Fri Apr 10 20:39:34 2015 -0700
@@ -767,7 +767,7 @@
                     JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs);
             connServer.start();
         } catch (IOException e) {
-            if (connServer == null) {
+            if (connServer == null || connServer.getAddress() == null) {
                 throw new AgentConfigurationError(CONNECTOR_SERVER_IO_ERROR,
                         e, url.toString());
             } else {
--- a/src/share/classes/sun/misc/Unsafe.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/misc/Unsafe.java	Fri Apr 10 20:39:34 2015 -0700
@@ -846,12 +846,14 @@
         throws InstantiationException;
 
     /** Lock the object.  It must get unlocked via {@link #monitorExit}. */
+    @Deprecated
     public native void monitorEnter(Object o);
 
     /**
      * Unlock the object.  It must have been locked via {@link
      * #monitorEnter}.
      */
+    @Deprecated
     public native void monitorExit(Object o);
 
     /**
@@ -859,6 +861,7 @@
      * whether the lock succeeded.  If it did, the object must be
      * unlocked via {@link #monitorExit}.
      */
+    @Deprecated
     public native boolean tryMonitorEnter(Object o);
 
     /** Throw the exception without telling the verifier. */
--- a/src/share/classes/sun/net/httpserver/Code.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/net/httpserver/Code.java	Fri Apr 10 20:39:34 2015 -0700
@@ -103,7 +103,7 @@
         case HTTP_UNAVAILABLE: return " Service Unavailable";
         case HTTP_GATEWAY_TIMEOUT: return " Gateway Timeout";
         case HTTP_VERSION: return " HTTP Version Not Supported";
-        default: return "";
+        default: return " ";
       }
     }
 }
--- a/src/share/classes/sun/net/www/protocol/https/HttpsClient.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/net/www/protocol/https/HttpsClient.java	Fri Apr 10 20:39:34 2015 -0700
@@ -192,22 +192,6 @@
         return userAgent;
     }
 
-    // should remove once HttpClient.newHttpProxy is putback
-    private static Proxy newHttpProxy(String proxyHost, int proxyPort) {
-        InetSocketAddress saddr = null;
-        final String phost = proxyHost;
-        final int pport = proxyPort < 0 ? httpsPortNumber : proxyPort;
-        try {
-            saddr = java.security.AccessController.doPrivileged(new
-                java.security.PrivilegedExceptionAction<InetSocketAddress>() {
-                public InetSocketAddress run() {
-                    return new InetSocketAddress(phost, pport);
-                }});
-        } catch (java.security.PrivilegedActionException pae) {
-        }
-        return new Proxy(Proxy.Type.HTTP, saddr);
-    }
-
     // CONSTRUCTOR, FACTORY
 
 
@@ -251,7 +235,7 @@
         throws IOException {
         this(sf, url,
              (proxyHost == null? null:
-                HttpsClient.newHttpProxy(proxyHost, proxyPort)),
+                HttpClient.newHttpProxy(proxyHost, proxyPort, "https")),
                 connectTimeout);
     }
 
@@ -261,6 +245,11 @@
     HttpsClient(SSLSocketFactory sf, URL url, Proxy proxy,
                 int connectTimeout)
         throws IOException {
+        PlatformLogger logger = HttpURLConnection.getHttpLogger();
+        if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
+             logger.finest("Creating new HttpsClient with url:" + url + " and proxy:" + proxy +
+             " with connect timeout:" + connectTimeout);
+        }
         this.proxy = proxy;
         setSSLSocketFactory(sf);
         this.proxyDisabled = true;
@@ -317,7 +306,7 @@
 
         return HttpsClient.New(sf, url, hv,
                                (proxyHost == null? null :
-                                HttpsClient.newHttpProxy(proxyHost, proxyPort)),
+                                HttpClient.newHttpProxy(proxyHost, proxyPort, "https")),
                                useCache, connectTimeout, httpuc);
     }
 
@@ -329,6 +318,11 @@
         if (p == null) {
             p = Proxy.NO_PROXY;
         }
+        PlatformLogger logger = HttpURLConnection.getHttpLogger();
+        if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
+            logger.finest("Looking for HttpClient for URL " + url +
+                " and proxy value of " + p);
+        }
         HttpsClient ret = null;
         if (useCache) {
             /* see if one's already around */
@@ -342,14 +336,13 @@
 
             if (ret != null) {
                 if ((ret.proxy != null && ret.proxy.equals(p)) ||
-                    (ret.proxy == null && p == null)) {
+                    (ret.proxy == null && p == Proxy.NO_PROXY)) {
                     synchronized (ret) {
                         ret.cachedHttpClient = true;
                         assert ret.inCache;
                         ret.inCache = false;
                         if (httpuc != null && ret.needsTunneling())
                             httpuc.setTunnelState(TUNNELING);
-                        PlatformLogger logger = HttpURLConnection.getHttpLogger();
                         if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
                             logger.finest("KeepAlive stream retrieved from the cache, " + ret);
                         }
@@ -360,6 +353,9 @@
                     // This should be fine as it is very rare that a connection
                     // to the same host will not use the same proxy.
                     synchronized(ret) {
+                        if (logger.isLoggable(PlatformLogger.Level.FINEST)) {
+                            logger.finest("Not returning this connection to cache: " + ret);
+                        }
                         ret.inCache = false;
                         ret.closeServer();
                     }
--- a/src/share/classes/sun/nio/ch/FileChannelImpl.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/nio/ch/FileChannelImpl.java	Fri Apr 10 20:39:34 2015 -0700
@@ -38,6 +38,7 @@
 import java.nio.channels.NonWritableChannelException;
 import java.nio.channels.OverlappingFileLockException;
 import java.nio.channels.ReadableByteChannel;
+import java.nio.channels.SelectableChannel;
 import java.nio.channels.WritableByteChannel;
 import java.security.AccessController;
 import java.util.ArrayList;
@@ -407,30 +408,13 @@
     //
     private static volatile boolean fileSupported = true;
 
-    private long transferToDirectly(long position, int icount,
-                                    WritableByteChannel target)
+    private long transferToDirectlyInternal(long position, int icount,
+                                            WritableByteChannel target,
+                                            FileDescriptor targetFD)
         throws IOException
     {
-        if (!transferSupported)
-            return IOStatus.UNSUPPORTED;
-
-        FileDescriptor targetFD = null;
-        if (target instanceof FileChannelImpl) {
-            if (!fileSupported)
-                return IOStatus.UNSUPPORTED_CASE;
-            targetFD = ((FileChannelImpl)target).fd;
-        } else if (target instanceof SelChImpl) {
-            // Direct transfer to pipe causes EINVAL on some configurations
-            if ((target instanceof SinkChannelImpl) && !pipeSupported)
-                return IOStatus.UNSUPPORTED_CASE;
-            targetFD = ((SelChImpl)target).getFD();
-        }
-        if (targetFD == null)
-            return IOStatus.UNSUPPORTED;
-        int thisFDVal = IOUtil.fdVal(fd);
-        int targetFDVal = IOUtil.fdVal(targetFD);
-        if (thisFDVal == targetFDVal) // Not supported on some configurations
-            return IOStatus.UNSUPPORTED;
+        assert !nd.transferToDirectlyNeedsPositionLock() ||
+               Thread.holdsLock(positionLock);
 
         long n = -1;
         int ti = -1;
@@ -440,7 +424,7 @@
             if (!isOpen())
                 return -1;
             do {
-                n = transferTo0(thisFDVal, position, icount, targetFDVal);
+                n = transferTo0(fd, position, icount, targetFD);
             } while ((n == IOStatus.INTERRUPTED) && isOpen());
             if (n == IOStatus.UNSUPPORTED_CASE) {
                 if (target instanceof SinkChannelImpl)
@@ -461,6 +445,54 @@
         }
     }
 
+    private long transferToDirectly(long position, int icount,
+                                    WritableByteChannel target)
+        throws IOException
+    {
+        if (!transferSupported)
+            return IOStatus.UNSUPPORTED;
+
+        FileDescriptor targetFD = null;
+        if (target instanceof FileChannelImpl) {
+            if (!fileSupported)
+                return IOStatus.UNSUPPORTED_CASE;
+            targetFD = ((FileChannelImpl)target).fd;
+        } else if (target instanceof SelChImpl) {
+            // Direct transfer to pipe causes EINVAL on some configurations
+            if ((target instanceof SinkChannelImpl) && !pipeSupported)
+                return IOStatus.UNSUPPORTED_CASE;
+
+            // Platform-specific restrictions. Now there is only one:
+            // Direct transfer to non-blocking channel could be forbidden
+            SelectableChannel sc = (SelectableChannel)target;
+            if (!nd.canTransferToDirectly(sc))
+                return IOStatus.UNSUPPORTED_CASE;
+
+            targetFD = ((SelChImpl)target).getFD();
+        }
+
+        if (targetFD == null)
+            return IOStatus.UNSUPPORTED;
+        int thisFDVal = IOUtil.fdVal(fd);
+        int targetFDVal = IOUtil.fdVal(targetFD);
+        if (thisFDVal == targetFDVal) // Not supported on some configurations
+            return IOStatus.UNSUPPORTED;
+
+        if (nd.transferToDirectlyNeedsPositionLock()) {
+            synchronized (positionLock) {
+                long pos = position();
+                try {
+                    return transferToDirectlyInternal(position, icount,
+                                                      target, targetFD);
+                } finally {
+                    position(pos);
+                }
+            }
+        } else {
+            return transferToDirectlyInternal(position, icount, target, targetFD);
+        }
+    }
+
     // Maximum size to map when using a mapped buffer
     private static final long MAPPED_TRANSFER_SIZE = 8L*1024L*1024L;
 
@@ -1176,7 +1208,8 @@
     private static native int unmap0(long address, long length);
 
     // Transfers from src to dst, or returns -2 if kernel can't do that
-    private native long transferTo0(int src, long position, long count, int dst);
+    private native long transferTo0(FileDescriptor src, long position,
+                                    long count, FileDescriptor dst);
 
     // Sets or reports this file's position
     // If offset is -1, the current position is returned
--- a/src/share/classes/sun/nio/ch/FileDispatcher.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/nio/ch/FileDispatcher.java	Fri Apr 10 20:39:34 2015 -0700
@@ -25,7 +25,9 @@
 
 package sun.nio.ch;
 
-import java.io.*;
+import java.io.FileDescriptor;
+import java.io.IOException;
+import java.nio.channels.SelectableChannel;
 
 abstract class FileDispatcher extends NativeDispatcher {
 
@@ -53,4 +55,8 @@
      */
     abstract FileDescriptor duplicateForMapping(FileDescriptor fd)
         throws IOException;
+
+    abstract boolean canTransferToDirectly(SelectableChannel sc);
+
+    abstract boolean transferToDirectlyNeedsPositionLock();
 }
--- a/src/share/classes/sun/nio/ch/Net.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/nio/ch/Net.java	Fri Apr 10 20:39:34 2015 -0700
@@ -50,30 +50,8 @@
     // set to true if exclusive binding is on for Windows
     private static final boolean exclusiveBind;
 
-    static {
-        int availLevel = isExclusiveBindAvailable();
-        if (availLevel >= 0) {
-            String exclBindProp =
-                java.security.AccessController.doPrivileged(
-                    new PrivilegedAction<String>() {
-                        @Override
-                        public String run() {
-                            return System.getProperty(
-                                    "sun.net.useExclusiveBind");
-                        }
-                    });
-            if (exclBindProp != null) {
-                exclusiveBind = exclBindProp.length() == 0 ?
-                        true : Boolean.parseBoolean(exclBindProp);
-            } else if (availLevel == 1) {
-                exclusiveBind = true;
-            } else {
-                exclusiveBind = false;
-            }
-        } else {
-            exclusiveBind = false;
-        }
-    }
+    // set to true if the fast tcp loopback should be enabled on Windows
+    private static final boolean fastLoopback;
 
     // -- Miscellaneous utilities --
 
@@ -391,6 +369,23 @@
         }
     }
 
+    public static boolean isFastTcpLoopbackRequested() {
+        String loopbackProp = java.security.AccessController.doPrivileged(
+            new PrivilegedAction<String>() {
+                @Override
+                public String run() {
+                    return System.getProperty("jdk.net.useFastTcpLoopback");
+                }
+            });
+        boolean enable;
+        if ("".equals(loopbackProp)) {
+            enable = true;
+        } else {
+            enable = Boolean.parseBoolean(loopbackProp);
+        }
+        return enable;
+    }
+
     // -- Socket operations --
 
     private static native boolean isIPv6Available0();
@@ -413,15 +408,16 @@
         throws IOException {
         boolean preferIPv6 = isIPv6Available() &&
             (family != StandardProtocolFamily.INET);
-        return IOUtil.newFD(socket0(preferIPv6, stream, false));
+        return IOUtil.newFD(socket0(preferIPv6, stream, false, fastLoopback));
     }
 
     static FileDescriptor serverSocket(boolean stream) {
-        return IOUtil.newFD(socket0(isIPv6Available(), stream, true));
+        return IOUtil.newFD(socket0(isIPv6Available(), stream, true, fastLoopback));
     }
 
     // Due to oddities SO_REUSEADDR on windows reuse is ignored
-    private static native int socket0(boolean preferIPv6, boolean stream, boolean reuse);
+    private static native int socket0(boolean preferIPv6, boolean stream, boolean reuse,
+                                      boolean fastLoopback);
 
     public static void bind(FileDescriptor fd, InetAddress addr, int port)
         throws IOException
@@ -634,4 +630,30 @@
         POLLCONN   = pollconnValue();
     }
 
+    static {
+        int availLevel = isExclusiveBindAvailable();
+        if (availLevel >= 0) {
+            String exclBindProp =
+                java.security.AccessController.doPrivileged(
+                    new PrivilegedAction<String>() {
+                        @Override
+                        public String run() {
+                            return System.getProperty(
+                                    "sun.net.useExclusiveBind");
+                        }
+                    });
+            if (exclBindProp != null) {
+                exclusiveBind = exclBindProp.length() == 0 ?
+                        true : Boolean.parseBoolean(exclBindProp);
+            } else if (availLevel == 1) {
+                exclusiveBind = true;
+            } else {
+                exclusiveBind = false;
+            }
+        } else {
+            exclusiveBind = false;
+        }
+
+        fastLoopback = isFastTcpLoopbackRequested();
+    }
 }
--- a/src/share/classes/sun/nio/ch/SocketAdaptor.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/nio/ch/SocketAdaptor.java	Fri Apr 10 20:39:34 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
@@ -321,12 +321,9 @@
     }
 
     public void sendUrgentData(int data) throws IOException {
-        synchronized (sc.blockingLock()) {
-            if (!sc.isBlocking())
-                throw new IllegalBlockingModeException();
-            int n = sc.sendOutOfBandData((byte)data);
-            assert n == 1;
-        }
+        int n = sc.sendOutOfBandData((byte) data);
+        if (n == 0)
+            throw new IOException("Socket buffer full");
     }
 
     public void setOOBInline(boolean on) throws SocketException {
--- a/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1031,6 +1031,14 @@
                     "ebcdic-s-871+euro"
                 });
 
+        charset("x-IBM1166", "IBM1166",
+                new String[] {
+                    "cp1166", // JDK historical
+                    "ibm1166",
+                    "ibm-1166",
+                    "1166"
+                });
+
         charset("IBM290", "IBM290",
                 new String[] {
                     "cp290",
--- a/src/share/classes/sun/reflect/generics/repository/ClassRepository.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/reflect/generics/repository/ClassRepository.java	Fri Apr 10 20:39:34 2015 -0700
@@ -42,8 +42,11 @@
 
     public static final ClassRepository NONE = ClassRepository.make("Ljava/lang/Object;", null);
 
-    private volatile Type superclass; // caches the generic superclass info
-    private volatile Type[] superInterfaces; // caches the generic superinterface info
+    /** The generic superclass info.  Lazily initialized. */
+    private volatile Type superclass;
+
+    /** The generic superinterface info.  Lazily initialized. */
+    private volatile Type[] superInterfaces;
 
  // private, to enforce use of static factory
     private ClassRepository(String rawSig, GenericsFactory f) {
@@ -79,7 +82,7 @@
  * with which the repository was created.
  */
 
-    public Type getSuperclass(){
+    public Type getSuperclass() {
         Type superclass = this.superclass;
         if (superclass == null) { // lazily initialize superclass
             Reifier r = getReifier(); // obtain visitor
@@ -88,25 +91,24 @@
             // extract result from visitor and cache it
             superclass = r.getResult();
             this.superclass = superclass;
-            }
+        }
         return superclass; // return cached result
     }
 
-    public Type[] getSuperInterfaces(){
+    public Type[] getSuperInterfaces() {
         Type[] superInterfaces = this.superInterfaces;
         if (superInterfaces == null) { // lazily initialize super interfaces
             // first, extract super interface subtree(s) from AST
             TypeTree[] ts  = getTree().getSuperInterfaces();
             // create array to store reified subtree(s)
-            Type[] sis = new Type[ts.length];
+            superInterfaces = new Type[ts.length];
             // reify all subtrees
             for (int i = 0; i < ts.length; i++) {
                 Reifier r = getReifier(); // obtain visitor
                 ts[i].accept(r);// reify subtree
                 // extract result from visitor and store it
-                sis[i] = r.getResult();
+                superInterfaces[i] = r.getResult();
             }
-            superInterfaces = sis; // cache overall result
             this.superInterfaces = superInterfaces;
         }
         return superInterfaces.clone(); // return cached result
--- a/src/share/classes/sun/reflect/generics/repository/GenericDeclRepository.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/reflect/generics/repository/GenericDeclRepository.java	Fri Apr 10 20:39:34 2015 -0700
@@ -42,7 +42,8 @@
 public abstract class GenericDeclRepository<S extends Signature>
     extends AbstractRepository<S> {
 
-    private volatile TypeVariable<?>[] typeParams; // caches the formal type parameters
+    /** The formal type parameters.  Lazily initialized. */
+    private volatile TypeVariable<?>[] typeParams;
 
     protected GenericDeclRepository(String rawSig, GenericsFactory f) {
         super(rawSig, f);
@@ -55,8 +56,7 @@
  * If the corresponding field is non-null, it is returned.
  * If not, it is created lazily. This is done by selecting the appropriate
  * part of the tree and transforming it into a reflective object
- * using a visitor.
- * a visitor, which is created by feeding it the factory
+ * using a visitor, which is created by feeding it the factory
  * with which the repository was created.
  */
 
@@ -64,22 +64,21 @@
      * Return the formal type parameters of this generic declaration.
      * @return the formal type parameters of this generic declaration
      */
-    public TypeVariable<?>[] getTypeParameters(){
-        TypeVariable[] typeParams = this.typeParams;
+    public TypeVariable<?>[] getTypeParameters() {
+        TypeVariable<?>[] typeParams = this.typeParams;
         if (typeParams == null) { // lazily initialize type parameters
             // first, extract type parameter subtree(s) from AST
             FormalTypeParameter[] ftps = getTree().getFormalTypeParameters();
             // create array to store reified subtree(s)
-            TypeVariable<?>[] tps = new TypeVariable<?>[ftps.length];
+            typeParams = new TypeVariable<?>[ftps.length];
             // reify all subtrees
             for (int i = 0; i < ftps.length; i++) {
                 Reifier r = getReifier(); // obtain visitor
                 ftps[i].accept(r); // reify subtree
                 // extract result from visitor and store it
-                tps[i] = (TypeVariable<?>) r.getResult();
+                typeParams[i] = (TypeVariable<?>) r.getResult();
             }
-            typeParams = tps; // cache overall result
-            this.typeParams = typeParams;
+            this.typeParams = typeParams; // cache overall result
         }
         return typeParams.clone(); // return cached result
     }
--- a/src/share/classes/sun/reflect/generics/scope/AbstractScope.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/reflect/generics/scope/AbstractScope.java	Fri Apr 10 20:39:34 2015 -0700
@@ -42,7 +42,9 @@
     implements Scope {
 
     private final D recvr; // the declaration whose scope this instance represents
-    private volatile Scope enclosingScope; // the enclosing scope of this scope
+
+    /** The enclosing scope of this scope.  Lazily initialized. */
+    private volatile Scope enclosingScope;
 
     /**
      * Constructor. Takes a reflective object whose scope the newly
--- a/src/share/classes/sun/security/krb5/KrbApReq.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/krb5/KrbApReq.java	Fri Apr 10 20:39:34 2015 -0700
@@ -60,22 +60,12 @@
     private static boolean DEBUG = Krb5.DEBUG;
     private static final char[] hexConst = "0123456789ABCDEF".toCharArray();
 
-    private static final MessageDigest md;
-
-    static {
-        try {
-            md = MessageDigest.getInstance("MD5");
-        } catch (NoSuchAlgorithmException ex) {
-            throw new RuntimeException("Impossible");
-        }
-    }
-
     /**
      * Constructs an AP-REQ message to send to the peer.
      * @param tgsCred the <code>Credentials</code> to be used to construct the
      *          AP Request  protocol message.
      * @param mutualRequired Whether mutual authentication is required
-     * @param useSubkey Whether the subkey is to be used to protect this
+     * @param useSubKey Whether the subkey is to be used to protect this
      *        specific application session. If this is not set then the
      *        session key from the ticket will be used.
      * @throws KrbException for any Kerberos protocol specific error
@@ -99,10 +89,10 @@
      * @param tgsCred the <code>Credentials</code> to be used to construct the
      *          AP Request  protocol message.
      * @param mutualRequired Whether mutual authentication is required
-     * @param useSubkey Whether the subkey is to be used to protect this
+     * @param useSubKey Whether the subkey is to be used to protect this
      *        specific application session. If this is not set then the
      *        session key from the ticket will be used.
-     * @param checksum checksum of the the application data that accompanies
+     * @param cksum checksum of the the application data that accompanies
      *        the KRB_AP_REQ.
      * @throws KrbException for any Kerberos protocol specific error
      * @throws IOException for any IO related errors
@@ -142,8 +132,8 @@
      * Constructs an AP-REQ message from the bytes received from the
      * peer.
      * @param message The message received from the peer
-     * @param keys <code>EncrtyptionKey</code>s to decrypt the message;
-     *       key selected will depend on etype used to encrypte data
+     * @param cred <code>KrbAcceptCredential</code> containing keys to decrypt
+     *    the message; key selected will depend on etype used to encrypt data
      * @throws KrbException for any Kerberos protocol specific error
      * @throws IOException for any IO related errors
      *          (e.g. socket operations)
@@ -311,7 +301,14 @@
         if (!authenticator.ctime.inClockSkew())
             throw new KrbApErrException(Krb5.KRB_AP_ERR_SKEW);
 
-        byte[] hash = md.digest(apReqMessg.authenticator.cipher);
+        byte[] hash;
+        try {
+            hash = MessageDigest.getInstance("MD5")
+                    .digest(apReqMessg.authenticator.cipher);
+        } catch (NoSuchAlgorithmException ex) {
+            throw new AssertionError("Impossible");
+        }
+
         char[] h = new char[hash.length * 2];
         for (int i=0; i<hash.length; i++) {
             h[2*i] = hexConst[(hash[i]&0xff)>>4];
--- a/src/share/classes/sun/security/pkcs11/Config.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/pkcs11/Config.java	Fri Apr 10 20:39:34 2015 -0700
@@ -584,16 +584,24 @@
     }
 
     private String parseLine() throws IOException {
-        String s = parseWord();
+        // allow quoted string as part of line
+        String s = null;
         while (true) {
             int token = nextToken();
             if ((token == TT_EOL) || (token == TT_EOF)) {
                 break;
             }
-            if (token != TT_WORD) {
+            if (token != TT_WORD && token != '\"') {
                 throw excToken("Unexpected value");
             }
-            s = s + " " + st.sval;
+            if (s == null) {
+                s = st.sval;
+            } else {
+                s = s + " " + st.sval;
+            }
+        }
+        if (s == null) {
+            throw excToken("Unexpected empty line");
         }
         return s;
     }
@@ -653,7 +661,9 @@
     //
 
     private String parseLibrary(String keyword) throws IOException {
-        String lib = parseStringEntry(keyword);
+        checkDup(keyword);
+        parseEquals();
+        String lib = parseLine();
         lib = expand(lib);
         int i = lib.indexOf("/$ISA/");
         if (i != -1) {
--- a/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -905,7 +905,7 @@
     private static ObjectIdentifier mapPBEAlgorithmToOID(String algorithm)
         throws NoSuchAlgorithmException {
         // Check for PBES2 algorithms
-        if (algorithm.toLowerCase().startsWith("pbewithhmacsha")) {
+        if (algorithm.toLowerCase(Locale.ENGLISH).startsWith("pbewithhmacsha")) {
             return pbes2_OID;
         }
         return AlgorithmId.get(algorithm).getOID();
--- a/src/share/classes/sun/security/provider/ConfigFile.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/provider/ConfigFile.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -451,7 +451,7 @@
 
                 // controlFlag (required, optional, etc)
                 LoginModuleControlFlag controlFlag;
-                String sflag = match("controlFlag").toUpperCase();
+                String sflag = match("controlFlag").toUpperCase(Locale.ENGLISH);
                 switch (sflag) {
                     case "REQUIRED":
                         controlFlag = LoginModuleControlFlag.REQUIRED;
--- a/src/share/classes/sun/security/provider/PolicyParser.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/provider/PolicyParser.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, 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
@@ -707,7 +707,7 @@
             } catch (PropertyExpander.ExpandException peee) {
                 throw new IOException(peee.getLocalizedMessage());
             }
-            properties.put(key.toLowerCase(), value);
+            properties.put(key.toLowerCase(Locale.ENGLISH), value);
         }
 
         return properties;
--- a/src/share/classes/sun/security/provider/certpath/AdaptableX509CertSelector.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/provider/certpath/AdaptableX509CertSelector.java	Fri Apr 10 20:39:34 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
@@ -224,7 +224,8 @@
             if (extVal == null) {
                 if (debug != null) {
                     debug.println("AdaptableX509CertSelector.match: "
-                        + "no subject key ID extension");
+                        + "no subject key ID extension. Subject: "
+                        + xcert.getSubjectX500Principal());
                 }
                 return true;
             }
@@ -234,7 +235,9 @@
                     !Arrays.equals(ski, certSubjectKeyID)) {
                 if (debug != null) {
                     debug.println("AdaptableX509CertSelector.match: "
-                        + "subject key IDs don't match");
+                        + "subject key IDs don't match. "
+                        + "Expected: " + Arrays.toString(ski) + " "
+                        + "Cert's: " + Arrays.toString(certSubjectKeyID));
                 }
                 return false;
             }
--- a/src/share/classes/sun/security/provider/certpath/Builder.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/provider/certpath/Builder.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, 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
@@ -435,7 +435,12 @@
             if (selector.match(targetCert) && !X509CertImpl.isSelfSigned
                 (targetCert, buildParams.sigProvider())) {
                 if (debug != null) {
-                    debug.println("Builder.addMatchingCerts: adding target cert");
+                    debug.println("Builder.addMatchingCerts: " +
+                        "adding target cert" +
+                        "\n  SN: " + Debug.toHexString(
+                                            targetCert.getSerialNumber()) +
+                        "\n  Subject: " + targetCert.getSubjectX500Principal() +
+                        "\n  Issuer: " + targetCert.getIssuerX500Principal());
                 }
                 return resultCerts.add(targetCert);
             }
--- a/src/share/classes/sun/security/provider/certpath/ConstraintsChecker.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/provider/certpath/ConstraintsChecker.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, 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
@@ -145,8 +145,8 @@
         if (prevNC != null && ((i == certPathLength) ||
                 !X509CertImpl.isSelfIssued(currCert))) {
             if (debug != null) {
-                debug.println("prevNC = " + prevNC);
-                debug.println("currDN = " + currCert.getSubjectX500Principal());
+                debug.println("prevNC = " + prevNC +
+                    ", currDN = " + currCert.getSubjectX500Principal());
             }
 
             try {
@@ -184,8 +184,8 @@
             currCertImpl.getNameConstraintsExtension();
 
         if (debug != null) {
-            debug.println("prevNC = " + prevNC);
-            debug.println("newNC = " + String.valueOf(newConstraints));
+            debug.println("prevNC = " + prevNC +
+                        ", newNC = " + String.valueOf(newConstraints));
         }
 
         // if there are no previous name constraints, we just return the
@@ -225,8 +225,8 @@
         String msg = "basic constraints";
         if (debug != null) {
             debug.println("---checking " + msg + "...");
-            debug.println("i = " + i);
-            debug.println("maxPathLength = " + maxPathLength);
+            debug.println("i = " + i +
+                        ", maxPathLength = " + maxPathLength);
         }
 
         /* check if intermediate cert */
--- a/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java	Fri Apr 10 20:39:34 2015 -0700
@@ -320,6 +320,14 @@
         Set<TrustAnchor> trustAnchors, List<CertStore> certStores,
         Date validity) throws CRLException, IOException {
 
+        if (debug != null) {
+            debug.println("DistributionPointFetcher.verifyCRL: " +
+                "checking revocation status for" +
+                "\n  SN: " + Debug.toHexString(certImpl.getSerialNumber()) +
+                "\n  Subject: " + certImpl.getSubjectX500Principal() +
+                "\n  Issuer: " + certImpl.getIssuerX500Principal());
+        }
+
         boolean indirectCRL = false;
         X509CRLImpl crlImpl = X509CRLImpl.toImpl(crl);
         IssuingDistributionPointExtension idpExt =
@@ -363,7 +371,9 @@
             }
         } else if (crlIssuer.equals(certIssuer) == false) {
             if (debug != null) {
-                debug.println("crl issuer does not equal cert issuer");
+                debug.println("crl issuer does not equal cert issuer.\n" +
+                              "crl issuer: " + crlIssuer + "\n" +
+                              "cert issuer: " + certIssuer);
             }
             return false;
         } else {
--- a/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, 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
@@ -209,7 +209,8 @@
              * getMatchingEECerts
              */
             if (debug != null) {
-                debug.println("ForwardBuilder.getMatchingCACerts(): ca is target");
+                debug.println("ForwardBuilder.getMatchingCACerts(): " +
+                              "the target is a CA");
             }
 
             if (caTargetSelector == null) {
@@ -291,8 +292,14 @@
         for (X509Certificate trustedCert : trustedCerts) {
             if (sel.match(trustedCert)) {
                 if (debug != null) {
-                    debug.println("ForwardBuilder.getMatchingCACerts: "
-                        + "found matching trust anchor");
+                    debug.println("ForwardBuilder.getMatchingCACerts: " +
+                        "found matching trust anchor." +
+                        "\n  SN: " +
+                            Debug.toHexString(trustedCert.getSerialNumber()) +
+                        "\n  Subject: " +
+                            trustedCert.getSubjectX500Principal() +
+                        "\n  Issuer: " +
+                            trustedCert.getIssuerX500Principal());
                 }
                 if (caCerts.add(trustedCert) && !searchAllCertStores) {
                     return;
--- a/src/share/classes/sun/security/provider/certpath/PKIXMasterCertPathValidator.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/provider/certpath/PKIXMasterCertPathValidator.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, 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
@@ -30,6 +30,7 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
+import java.util.StringJoiner;
 import java.security.cert.CertPath;
 import java.security.cert.CertPathValidatorException;
 import java.security.cert.PKIXCertPathChecker;
@@ -88,20 +89,25 @@
              * current certificate of this loop to be the previous certificate
              * of the next loop. The state is initialized during first loop.
              */
-            if (debug != null)
-                debug.println("Checking cert" + (i+1) + " ...");
+            X509Certificate currCert = reversedCertList.get(i);
 
-            X509Certificate currCert = reversedCertList.get(i);
+            if (debug != null) {
+                debug.println("Checking cert" + (i+1) + " - Subject: " +
+                    currCert.getSubjectX500Principal());
+            }
+
             Set<String> unresCritExts = currCert.getCriticalExtensionOIDs();
             if (unresCritExts == null) {
                 unresCritExts = Collections.<String>emptySet();
             }
 
             if (debug != null && !unresCritExts.isEmpty()) {
-                debug.println("Set of critical extensions:");
+                StringJoiner joiner = new StringJoiner(", ", "{", "}");
                 for (String oid : unresCritExts) {
-                    debug.println(oid);
+                  joiner.add(oid);
                 }
+                debug.println("Set of critical extensions: " +
+                        joiner.toString());
             }
 
             for (int j = 0; j < certPathCheckers.size(); j++) {
--- a/src/share/classes/sun/security/provider/certpath/RevocationChecker.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/provider/certpath/RevocationChecker.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -343,11 +343,17 @@
                        PublicKey pubKey, boolean crlSignFlag)
         throws CertPathValidatorException
     {
+        if (debug != null) {
+            debug.println("RevocationChecker.check: checking cert" +
+                "\n  SN: " + Debug.toHexString(xcert.getSerialNumber()) +
+                "\n  Subject: " + xcert.getSubjectX500Principal() +
+                "\n  Issuer: " + xcert.getIssuerX500Principal());
+        }
         try {
             if (onlyEE && xcert.getBasicConstraints() != -1) {
                 if (debug != null) {
-                    debug.println("Skipping revocation check, not end " +
-                                  "entity cert");
+                    debug.println("Skipping revocation check; cert is not " +
+                                  "an end entity cert");
                 }
                 return;
             }
--- a/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/provider/certpath/SunCertPathBuilder.java	Fri Apr 10 20:39:34 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
@@ -136,7 +136,8 @@
         PKIXCertPathBuilderResult result = buildCertPath(false, adjList);
         if (result == null) {
             if (debug != null) {
-                debug.println("SunCertPathBuilder.engineBuild: 2nd pass");
+                debug.println("SunCertPathBuilder.engineBuild: 2nd pass; " +
+                              "try building again searching all certstores");
             }
             // try again
             adjList.clear();
--- a/src/share/classes/sun/security/ssl/ClientHandshaker.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/ssl/ClientHandshaker.java	Fri Apr 10 20:39:34 2015 -0700
@@ -59,6 +59,10 @@
  */
 final class ClientHandshaker extends Handshaker {
 
+    // constants for subject alt names of type DNS and IP
+    private final static int ALTNAME_DNS = 2;
+    private final static int ALTNAME_IP  = 7;
+
     // the server's public key from its certificate.
     private PublicKey serverKey;
 
@@ -818,6 +822,11 @@
                 } else {
                     warningSE(Alerts.alert_no_certificate);
                 }
+                if (debug != null && Debug.isOn("handshake")) {
+                    System.out.println(
+                        "Warning: no suitable certificate found - " +
+                        "continuing without client authentication");
+                }
             }
 
             //
@@ -1497,20 +1506,49 @@
             return true;
         }
 
-        // check the iPAddress field in subjectAltName extension
-        Object thisIPAddress = getSubjectAltName(thisCert, 7);  // 7: iPAddress
-        Object prevIPAddress = getSubjectAltName(prevCert, 7);
-        if (thisIPAddress != null && prevIPAddress!= null) {
-            // only allow the exactly match
-            return Objects.equals(thisIPAddress, prevIPAddress);
+        // check subject alternative names
+        Collection<List<?>> thisSubjectAltNames = null;
+        try {
+            thisSubjectAltNames = thisCert.getSubjectAlternativeNames();
+        } catch (CertificateParsingException cpe) {
+            if (debug != null && Debug.isOn("handshake")) {
+                System.out.println(
+                        "Attempt to obtain subjectAltNames extension failed!");
+            }
         }
 
-        // check the dNSName field in subjectAltName extension
-        Object thisDNSName = getSubjectAltName(thisCert, 2);    // 2: dNSName
-        Object prevDNSName = getSubjectAltName(prevCert, 2);
-        if (thisDNSName != null && prevDNSName!= null) {
-            // only allow the exactly match
-            return Objects.equals(thisDNSName, prevDNSName);
+        Collection<List<?>> prevSubjectAltNames = null;
+        try {
+            prevSubjectAltNames = prevCert.getSubjectAlternativeNames();
+        } catch (CertificateParsingException cpe) {
+            if (debug != null && Debug.isOn("handshake")) {
+                System.out.println(
+                        "Attempt to obtain subjectAltNames extension failed!");
+            }
+        }
+
+        if ((thisSubjectAltNames != null) && (prevSubjectAltNames != null)) {
+            // check the iPAddress field in subjectAltName extension
+            Collection<String> thisSubAltIPAddrs =
+                        getSubjectAltNames(thisSubjectAltNames, ALTNAME_IP);
+            Collection<String> prevSubAltIPAddrs =
+                        getSubjectAltNames(prevSubjectAltNames, ALTNAME_IP);
+            if ((thisSubAltIPAddrs != null) && (prevSubAltIPAddrs != null) &&
+                (isEquivalent(thisSubAltIPAddrs, prevSubAltIPAddrs))) {
+
+                return true;
+            }
+
+            // check the dNSName field in subjectAltName extension
+            Collection<String> thisSubAltDnsNames =
+                        getSubjectAltNames(thisSubjectAltNames, ALTNAME_DNS);
+            Collection<String> prevSubAltDnsNames =
+                        getSubjectAltNames(prevSubjectAltNames, ALTNAME_DNS);
+            if ((thisSubAltDnsNames != null) && (prevSubAltDnsNames != null) &&
+                (isEquivalent(thisSubAltDnsNames, prevSubAltDnsNames))) {
+
+                return true;
+            }
         }
 
         // check the certificate subject and issuer
@@ -1531,29 +1569,43 @@
     /*
      * Returns the subject alternative name of the specified type in the
      * subjectAltNames extension of a certificate.
+     *
+     * Note that only those subjectAltName types that use String data
+     * should be passed into this function.
      */
-    private static Object getSubjectAltName(X509Certificate cert, int type) {
-        Collection<List<?>> subjectAltNames;
+    private static Collection<String> getSubjectAltNames(
+            Collection<List<?>> subjectAltNames, int type) {
 
-        try {
-            subjectAltNames = cert.getSubjectAlternativeNames();
-        } catch (CertificateParsingException cpe) {
-            if (debug != null && Debug.isOn("handshake")) {
-                System.out.println(
-                        "Attempt to obtain subjectAltNames extension failed!");
-            }
-            return null;
-        }
-
-        if (subjectAltNames != null) {
-            for (List<?> subjectAltName : subjectAltNames) {
-                int subjectAltNameType = (Integer)subjectAltName.get(0);
-                if (subjectAltNameType == type) {
-                    return subjectAltName.get(1);
+        HashSet<String> subAltDnsNames = null;
+        for (List<?> subjectAltName : subjectAltNames) {
+            int subjectAltNameType = (Integer)subjectAltName.get(0);
+            if (subjectAltNameType == type) {
+                String subAltDnsName = (String)subjectAltName.get(1);
+                if ((subAltDnsName != null) && !subAltDnsName.isEmpty()) {
+                    if (subAltDnsNames == null) {
+                        subAltDnsNames =
+                                new HashSet<>(subjectAltNames.size());
+                    }
+                    subAltDnsNames.add(subAltDnsName);
                 }
             }
         }
 
-        return null;
+        return subAltDnsNames;
+    }
+
+    private static boolean isEquivalent(Collection<String> thisSubAltNames,
+            Collection<String> prevSubAltNames) {
+
+        for (String thisSubAltName : thisSubAltNames) {
+            for (String prevSubAltName : prevSubAltNames) {
+                // Only allow the exactly match.  Check no wildcard character.
+                if (thisSubAltName.equalsIgnoreCase(prevSubAltName)) {
+                    return true;
+                }
+            }
+        }
+
+        return false;
     }
 }
--- a/src/share/classes/sun/security/ssl/HandshakeMessage.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/ssl/HandshakeMessage.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -243,6 +243,7 @@
         protocolVersion = ProtocolVersion.valueOf(s.getInt8(), s.getInt8());
         clnt_random = new RandomCookie(s);
         sessionId = new SessionId(s.getBytes8());
+        sessionId.checkLength(protocolVersion);
         cipherSuites = new CipherSuiteList(s);
         compression_methods = s.getBytes8();
         if (messageLength() != messageLength) {
@@ -355,6 +356,7 @@
                                                   input.getInt8());
         svr_random = new RandomCookie(input);
         sessionId = new SessionId(input.getBytes8());
+        sessionId.checkLength(protocolVersion);
         cipherSuite = CipherSuite.valueOf(input.getInt8(), input.getInt8());
         compression_method = (byte)input.getInt8();
         if (messageLength() != messageLength) {
@@ -490,11 +492,14 @@
     void print(PrintStream s) throws IOException {
         s.println("*** Certificate chain");
 
-        if (debug != null && Debug.isOn("verbose")) {
-            for (int i = 0; i < chain.length; i++)
+        if (chain.length == 0) {
+            s.println("<Empty>");
+        } else if (debug != null && Debug.isOn("verbose")) {
+            for (int i = 0; i < chain.length; i++) {
                 s.println("chain [" + i + "] = " + chain[i]);
-            s.println("***");
+            }
         }
+        s.println("***");
     }
 
     X509Certificate[] getCertificateChain() {
--- a/src/share/classes/sun/security/ssl/SessionId.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/ssl/SessionId.java	Fri Apr 10 20:39:34 2015 -0700
@@ -27,6 +27,7 @@
 package sun.security.ssl;
 
 import java.security.SecureRandom;
+import javax.net.ssl.SSLProtocolException;
 
 /**
  * Encapsulates an SSL session ID.  SSL Session IDs are not reused by
@@ -41,6 +42,7 @@
 final
 class SessionId
 {
+    static int MAX_LENGTH = 32;
     private byte sessionId [];          // max 32 bytes
 
     /** Constructs a new session ID ... perhaps for a rejoinable session */
@@ -114,4 +116,19 @@
         }
         return true;
     }
+
+    /**
+     * Checks the length of the session ID to make sure it sits within
+     * the range called out in the specification
+     */
+    void checkLength(ProtocolVersion pv) throws SSLProtocolException {
+        // As of today all versions of TLS have a 32-byte maximum length.
+        // In the future we can do more here to support protocol versions
+        // that may have longer max lengths.
+        if (sessionId.length > MAX_LENGTH) {
+            throw new SSLProtocolException("Invalid session ID length (" +
+                    sessionId.length + " bytes)");
+        }
+    }
+
 }
--- a/src/share/classes/sun/security/tools/keytool/Main.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/security/tools/keytool/Main.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1494,7 +1494,7 @@
         boolean useDefaultPBEAlgorithm = true;
         SecretKey secKey = null;
 
-        if (keyAlgName.toUpperCase().startsWith("PBE")) {
+        if (keyAlgName.toUpperCase(Locale.ENGLISH).startsWith("PBE")) {
             SecretKeyFactory factory = SecretKeyFactory.getInstance("PBE");
 
             // User is prompted for PBE credential
--- a/src/share/classes/sun/text/resources/de/FormatData_de.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/text/resources/de/FormatData_de.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -142,7 +142,7 @@
                 new String[] {
                     "Jan", // abb january
                     "Feb", // abb february
-                    "Mrz", // abb march
+                    "M\u00e4r", // abb march
                     "Apr", // abb april
                     "Mai", // abb may
                     "Jun", // abb june
--- a/src/share/classes/sun/text/resources/fi/FormatData_fi.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/classes/sun/text/resources/fi/FormatData_fi.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -295,8 +295,8 @@
             },
             { "DatePatterns",
                 new String[] {
-                    "d. MMMM'ta 'yyyy", // full date pattern
-                    "d. MMMM'ta 'yyyy", // long date pattern
+                    "d. MMMM yyyy", // full date pattern
+                    "d. MMMM yyyy", // long date pattern
                     "d.M.yyyy", // medium date pattern
                     "d.M.yyyy", // short date pattern
                 }
--- a/src/share/native/java/net/net_util.h	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/native/java/net/net_util.h	Fri Apr 10 20:39:34 2015 -0700
@@ -182,9 +182,13 @@
 JNIEXPORT int JNICALL
 NET_MapSocketOptionV6(jint cmd, int *level, int *optname);
 
+JNIEXPORT jint JNICALL
+NET_EnableFastTcpLoopback(int fd);
+
 int getScopeID (struct sockaddr *);
 
 int cmpScopeID (unsigned int, struct sockaddr *);
 
 unsigned short in_cksum(unsigned short *addr, int len);
+
 #endif /* NET_UTILS_H */
--- a/src/share/native/java/util/zip/Deflater.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/native/java/util/zip/Deflater.c	Fri Apr 10 20:39:34 2015 -0700
@@ -68,10 +68,11 @@
         JNU_ThrowOutOfMemoryError(env, 0);
         return jlong_zero;
     } else {
-        char *msg;
-        switch (deflateInit2(strm, level, Z_DEFLATED,
-                             nowrap ? -MAX_WBITS : MAX_WBITS,
-                             DEF_MEM_LEVEL, strategy)) {
+        const char *msg;
+        int ret = deflateInit2(strm, level, Z_DEFLATED,
+                               nowrap ? -MAX_WBITS : MAX_WBITS,
+                               DEF_MEM_LEVEL, strategy);
+        switch (ret) {
           case Z_OK:
             return ptr_to_jlong(strm);
           case Z_MEM_ERROR:
@@ -83,7 +84,11 @@
             JNU_ThrowIllegalArgumentException(env, 0);
             return jlong_zero;
           default:
-            msg = strm->msg;
+            msg = ((strm->msg != NULL) ? strm->msg :
+                   (ret == Z_VERSION_ERROR) ?
+                   "zlib returned Z_VERSION_ERROR: "
+                   "compile time and runtime zlib implementations differ" :
+                   "unknown error initializing zlib library");
             free(strm);
             JNU_ThrowInternalError(env, msg);
             return jlong_zero;
--- a/src/share/native/sun/tracing/dtrace/JVM.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/share/native/sun/tracing/dtrace/JVM.c	Fri Apr 10 20:39:34 2015 -0700
@@ -144,32 +144,34 @@
         env, provider, &(jvm_provider->argsAttributes));
 }
 
-static void readProviderData(
+static int readProviderData(
         JNIEnv* env, jobject provider, JVM_DTraceProvider* jvm_provider) {
     jmethodID mid;
     jobjectArray probes;
     jsize i;
-    jclass clazz = (*env)->GetObjectClass(env, provider); CHECK
+    jclass clazz = (*env)->GetObjectClass(env, provider); CHECK_(0)
     mid = (*env)->GetMethodID(
-        env, clazz, "getProbes", "()[Lsun/tracing/dtrace/DTraceProbe;"); CHECK
+        env, clazz, "getProbes", "()[Lsun/tracing/dtrace/DTraceProbe;"); CHECK_(0)
     probes = (jobjectArray)(*env)->CallObjectMethod(
-        env, provider, mid); CHECK
+        env, provider, mid); CHECK_(0)
 
     // Fill JVM structure, describing provider
-    jvm_provider->probe_count = (*env)->GetArrayLength(env, probes); CHECK
+    jvm_provider->probe_count = (*env)->GetArrayLength(env, probes); CHECK_(0)
     jvm_provider->probes = (JVM_DTraceProbe*)calloc(
         jvm_provider->probe_count, sizeof(*jvm_provider->probes));
     mid = (*env)->GetMethodID(
-        env, clazz, "getProviderName", "()Ljava/lang/String;"); CHECK
+        env, clazz, "getProviderName", "()Ljava/lang/String;"); CHECK_(0)
     jvm_provider->name = (jstring)(*env)->CallObjectMethod(
-        env, provider, mid); CHECK
+        env, provider, mid); CHECK_(0)
 
-    readInterfaceAttributes(env, provider, jvm_provider); CHECK
+    readInterfaceAttributes(env, provider, jvm_provider); CHECK_(0)
 
     for (i = 0; i < jvm_provider->probe_count; ++i) {
-        jobject probe = (*env)->GetObjectArrayElement(env, probes, i); CHECK
-        readProbeData(env, probe, &jvm_provider->probes[i]); CHECK
+        jobject probe = (*env)->GetObjectArrayElement(env, probes, i); CHECK_(0)
+        readProbeData(env, probe, &jvm_provider->probes[i]); CHECK_(0)
     }
+
+    return 1;
 }
 
 /*
@@ -182,6 +184,7 @@
     jlong handle = 0;
     jsize num_providers;
     jsize i;
+    jsize count = 0;
     JVM_DTraceProvider* jvm_providers;
 
     initialize();
@@ -195,16 +198,23 @@
     jvm_providers = (JVM_DTraceProvider*)calloc(
         num_providers, sizeof(*jvm_providers));
 
-    for (i = 0; i < num_providers; ++i) {
-        JVM_DTraceProvider* p = &(jvm_providers[i]);
+    for (; count < num_providers; ++count) {
+        JVM_DTraceProvider* p = &(jvm_providers[count]);
         jobject provider = (*env)->GetObjectArrayElement(
-            env, providers, i);
-        readProviderData(env, provider, p);
+            env, providers, count);
+        if ((*env)->ExceptionOccurred(env) ||
+            ! readProviderData(env, provider, p)) {
+            // got an error, bail out!
+            break;
+        }
     }
 
-    handle = jvm_symbols->Activate(
-        env, JVM_TRACING_DTRACE_VERSION, moduleName,
-        num_providers, jvm_providers);
+    if (count == num_providers) {
+        // all providers successfully loaded - get the handle
+        handle = jvm_symbols->Activate(
+            env, JVM_TRACING_DTRACE_VERSION, moduleName,
+            num_providers, jvm_providers);
+    }
 
     for (i = 0; i < num_providers; ++i) {
         JVM_DTraceProvider* p = &(jvm_providers[i]);
--- a/src/solaris/bin/arm/jvm.cfg	Fri Apr 10 07:27:56 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-# Copyright (c) 2011, 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
-# 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.
-#
-# List of JVMs that can be used as an option to java, javac, etc.
-# Order is important -- first in this list is the default JVM.
-# NOTE that this both this file and its format are UNSUPPORTED and
-# WILL GO AWAY in a future release.
-#
-# You may also select a JVM in an arbitrary location with the
-# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
-# and may not be available in a future release.
-#
--client IF_SERVER_CLASS -server
--server KNOWN
--minimal KNOWN
--- a/src/solaris/bin/ppc/jvm.cfg	Fri Apr 10 07:27:56 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-# Copyright (c) 2011, 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
-# 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.
-#
-# List of JVMs that can be used as an option to java, javac, etc.
-# Order is important -- first in this list is the default JVM.
-# NOTE that this both this file and its format are UNSUPPORTED and
-# WILL GO AWAY in a future release.
-#
-# You may also select a JVM in an arbitrary location with the
-# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
-# and may not be available in a future release.
-#
--client KNOWN
--server KNOWN
--minimal KNOWN
--- a/src/solaris/classes/java/lang/UNIXProcess.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/classes/java/lang/UNIXProcess.java	Fri Apr 10 20:39:34 2015 -0700
@@ -405,14 +405,17 @@
         if (hasExited) return true;
         if (timeout <= 0) return false;
 
-        long timeoutAsNanos = unit.toNanos(timeout);
-        long startTime = System.nanoTime();
-        long rem = timeoutAsNanos;
+        long remainingNanos = unit.toNanos(timeout);
+        long deadline = System.nanoTime() + remainingNanos;
 
-        while (!hasExited && (rem > 0)) {
-            wait(Math.max(TimeUnit.NANOSECONDS.toMillis(rem), 1));
-            rem = timeoutAsNanos - (System.nanoTime() - startTime);
-        }
+        do {
+            // Round up to next millisecond
+            wait(TimeUnit.NANOSECONDS.toMillis(remainingNanos + 999_999L));
+            if (hasExited) {
+                return true;
+            }
+            remainingNanos = deadline - System.nanoTime();
+        } while (remainingNanos > 0);
         return hasExited;
     }
 
--- a/src/solaris/classes/sun/awt/UNIXToolkit.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/classes/sun/awt/UNIXToolkit.java	Fri Apr 10 20:39:34 2015 -0700
@@ -29,11 +29,9 @@
 import java.awt.color.ColorSpace;
 import java.awt.image.*;
 import java.security.AccessController;
-import java.security.PrivilegedAction;
 import sun.security.action.GetIntegerAction;
 import com.sun.java.swing.plaf.gtk.GTKConstants.TextDirection;
 import sun.java2d.opengl.OGLRenderQueue;
-import java.lang.reflect.InvocationTargetException;
 
 public abstract class UNIXToolkit extends SunToolkit
 {
@@ -73,16 +71,16 @@
             if (nativeGTKLoaded != null) {
                 // We've already attempted to load GTK, so just return the
                 // status of that attempt.
-                return nativeGTKLoaded.booleanValue();
+                return nativeGTKLoaded;
 
             } else if (nativeGTKAvailable != null) {
                 // We've already checked the availability of the native GTK
                 // libraries, so just return the status of that attempt.
-                return nativeGTKAvailable.booleanValue();
+                return nativeGTKAvailable;
 
             } else {
                 boolean success = check_gtk();
-                nativeGTKAvailable = Boolean.valueOf(success);
+                nativeGTKAvailable = success;
                 return success;
             }
         }
@@ -99,11 +97,10 @@
     public boolean loadGTK() {
         synchronized (GTK_LOCK) {
             if (nativeGTKLoaded == null) {
-                boolean success = load_gtk();
-                nativeGTKLoaded = Boolean.valueOf(success);
+                nativeGTKLoaded = load_gtk();
             }
         }
-        return nativeGTKLoaded.booleanValue();
+        return nativeGTKLoaded;
     }
 
     /**
@@ -252,6 +249,7 @@
 
     private native void nativeSync();
 
+    @Override
     public void sync() {
         // flush the X11 buffer
         nativeSync();
@@ -266,6 +264,8 @@
      * This requires that the Gnome properties have already been gathered.
      */
     public static final String FONTCONFIGAAHINT = "fontconfig/Antialias";
+
+    @Override
     protected RenderingHints getDesktopAAHints() {
 
         Object aaValue = getDesktopProperty("gnome.Xft/Antialias");
@@ -288,8 +288,8 @@
          * us to default to "OFF". I don't think that's the best guess.
          * So if its !=0 then lets assume AA.
          */
-        boolean aa = Boolean.valueOf(((aaValue instanceof Number) &&
-                                      ((Number)aaValue).intValue() != 0));
+        boolean aa = ((aaValue instanceof Number)
+                        && ((Number) aaValue).intValue() != 0);
         Object aaHint;
         if (aa) {
             String subpixOrder =
--- a/src/solaris/classes/sun/awt/X11/XClipboard.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/classes/sun/awt/X11/XClipboard.java	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -281,6 +281,11 @@
             }
         }
 
-        checkChange(formats);
+        XToolkit.awtUnlock();
+        try {
+            checkChange(formats);
+        } finally {
+            XToolkit.awtLock();
+        }
     }
 }
--- a/src/solaris/classes/sun/font/FcFontConfiguration.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/classes/sun/font/FcFontConfiguration.java	Fri Apr 10 20:39:34 2015 -0700
@@ -180,7 +180,7 @@
         String[] componentFaceNames = cfi[idx].getComponentFaceNames();
         FontDescriptor[] ret = new FontDescriptor[componentFaceNames.length];
         for (int i = 0; i < componentFaceNames.length; i++) {
-            ret[i] = new FontDescriptor(componentFaceNames[i], StandardCharsets.UTF_8.newEncoder(), new int[0]);
+            ret[i] = new FontDescriptor(componentFaceNames[i], StandardCharsets.ISO_8859_1.newEncoder(), new int[0]);
         }
 
         return ret;
--- a/src/solaris/classes/sun/nio/ch/FileDispatcherImpl.java	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/classes/sun/nio/ch/FileDispatcherImpl.java	Fri Apr 10 20:39:34 2015 -0700
@@ -25,10 +25,10 @@
 
 package sun.nio.ch;
 
-import java.io.*;
+import java.io.FileDescriptor;
+import java.io.IOException;
 
-class FileDispatcherImpl extends FileDispatcher
-{
+class FileDispatcherImpl extends FileDispatcher {
 
     static {
         IOUtil.load();
@@ -108,6 +108,14 @@
         return new FileDescriptor();
     }
 
+    boolean canTransferToDirectly(java.nio.channels.SelectableChannel sc) {
+        return true;
+    }
+
+    boolean transferToDirectlyNeedsPositionLock() {
+        return false;
+    }
+
     // -- Native methods --
 
     static native int read0(FileDescriptor fd, long address, int len)
--- a/src/solaris/native/java/io/UnixFileSystem_md.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/java/io/UnixFileSystem_md.c	Fri Apr 10 20:39:34 2015 -0700
@@ -283,6 +283,10 @@
     struct dirent64 *result;
     int len, maxlen;
     jobjectArray rv, old;
+    jclass str_class;
+
+    str_class = JNU_ClassString(env);
+    CHECK_NULL_RETURN(str_class, NULL);
 
     WITH_FIELD_PLATFORM_STRING(env, file, ids.path, path) {
         dir = opendir(path);
@@ -299,7 +303,7 @@
     /* Allocate an initial String array */
     len = 0;
     maxlen = 16;
-    rv = (*env)->NewObjectArray(env, maxlen, JNU_ClassString(env), NULL);
+    rv = (*env)->NewObjectArray(env, maxlen, str_class, NULL);
     if (rv == NULL) goto error;
 
     /* Scan the directory */
@@ -309,8 +313,7 @@
             continue;
         if (len == maxlen) {
             old = rv;
-            rv = (*env)->NewObjectArray(env, maxlen <<= 1,
-                                        JNU_ClassString(env), NULL);
+            rv = (*env)->NewObjectArray(env, maxlen <<= 1, str_class, NULL);
             if (rv == NULL) goto error;
             if (JNU_CopyObjectArray(env, rv, old, len) < 0) goto error;
             (*env)->DeleteLocalRef(env, old);
@@ -329,7 +332,7 @@
 
     /* Copy the final results into an appropriately-sized array */
     old = rv;
-    rv = (*env)->NewObjectArray(env, len, JNU_ClassString(env), NULL);
+    rv = (*env)->NewObjectArray(env, len, str_class, NULL);
     if (rv == NULL) {
         return NULL;
     }
--- a/src/solaris/native/java/net/Inet6AddressImpl.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/java/net/Inet6AddressImpl.c	Fri Apr 10 20:39:34 2015 -0700
@@ -196,6 +196,10 @@
     }
 
     name = (*env)->NewStringUTF(env, hostname);
+    if (name == NULL) {
+        freeifaddrs(ifa);
+        return NULL;
+    }
 
     /* Iterate over the interfaces, and total up the number of IPv4 and IPv6
      * addresses we have. Also keep a count of loopback addresses. We need to
--- a/src/solaris/native/java/net/NetworkInterface.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/java/net/NetworkInterface.c	Fri Apr 10 20:39:34 2015 -0700
@@ -253,6 +253,7 @@
     if (name_utf == NULL) {
        if (!(*env)->ExceptionCheck(env))
            JNU_ThrowOutOfMemoryError(env, NULL);
+       freeif(ifs);
        return NULL;
     }
     /*
@@ -527,9 +528,9 @@
            JNU_ThrowOutOfMemoryError(env, NULL);
        return NULL;
     }
-    if ((sock =openSocketWithFallback(env, name_utf)) < 0) {
+    if ((sock = openSocketWithFallback(env, name_utf)) < 0) {
        (*env)->ReleaseStringUTFChars(env, name, name_utf);
-       return JNI_FALSE;
+       return NULL;
     }
 
 
--- a/src/solaris/native/java/net/net_util_md.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/java/net/net_util_md.c	Fri Apr 10 20:39:34 2015 -0700
@@ -97,6 +97,7 @@
         CHECK_NULL(c);
         ni_defaultIndexID = (*env)->GetStaticFieldID(
             env, c, "defaultIndex", "I");
+        CHECK_NULL(ni_defaultIndexID);
         ni_class = c;
     }
     int defaultIndex;
@@ -119,6 +120,7 @@
         CHECK_NULL_RETURN(c, 0);
         ni_defaultIndexID = (*env)->GetStaticFieldID(env, c,
                                                      "defaultIndex", "I");
+        CHECK_NULL_RETURN(ni_defaultIndexID, 0);
         ni_class = c;
     }
     int defaultIndex = 0;
@@ -777,6 +779,11 @@
 #endif
 }
 
+JNIEXPORT jint JNICALL
+NET_EnableFastTcpLoopback(int fd) {
+    return 0;
+}
+
 /* In the case of an IPv4 Inetaddress this method will return an
  * IPv4 mapped address where IPv6 is available and v4MappedAddress is TRUE.
  * Otherwise it will return a sockaddr_in structure for an IPv4 InetAddress.
--- a/src/solaris/native/sun/awt/awt_Event.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/awt/awt_Event.c	Fri Apr 10 20:39:34 2015 -0700
@@ -42,7 +42,7 @@
 JNIEXPORT void JNICALL
 Java_java_awt_Event_initIDs(JNIEnv *env, jclass cls)
 {
-    eventIDs.data = (*env)->GetFieldID(env, cls, "data", "J");
-    eventIDs.consumed = (*env)->GetFieldID(env, cls, "consumed", "Z");
-    eventIDs.id = (*env)->GetFieldID(env, cls, "id", "I");
+    CHECK_NULL(eventIDs.data = (*env)->GetFieldID(env, cls, "data", "J"));
+    CHECK_NULL(eventIDs.consumed = (*env)->GetFieldID(env, cls, "consumed", "Z"));
+    CHECK_NULL(eventIDs.id = (*env)->GetFieldID(env, cls, "id", "I"));
 }
--- a/src/solaris/native/sun/awt/awt_Font.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/awt/awt_Font.c	Fri Apr 10 20:39:34 2015 -0700
@@ -579,6 +579,7 @@
         Disposer_AddRecord(env, font, pDataDisposeMethod, ptr_to_jlong(fdata));
         return fdata;
     } else {
+        JNU_CHECK_EXCEPTION_RETURN(env, NULL);
         Display *display = NULL;
         struct FontData *fdata = NULL;
         char fontSpec[1024];
--- a/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Fri Apr 10 20:39:34 2015 -0700
@@ -23,6 +23,7 @@
  * questions.
  */
 
+#include "jni_util.h"
 #include "awt_p.h"
 #include "awt.h"
 #include "color.h"
@@ -763,6 +764,7 @@
     XSetIOErrorHandler(xioerror_handler);
     JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XErrorHandlerUtil", "init", "(J)V",
         ptr_to_jlong(awt_display));
+    JNU_CHECK_EXCEPTION_RETURN(env, NULL);
 
     /* set awt_numScreens, and whether or not we're using Xinerama */
     xineramaInit();
@@ -789,6 +791,7 @@
             x11Screens[i].root = RootWindow(awt_display, i);
         }
         x11Screens[i].defaultConfig = makeDefaultConfig(env, i);
+        JNU_CHECK_EXCEPTION_RETURN(env, NULL);
     }
 
     return dpy;
@@ -1495,7 +1498,7 @@
     if (aData == NULL) {
         return JNI_FALSE;
     }
-    return (jboolean)aData->isTranslucencySupported;
+    return aData->isTranslucencySupported ? JNI_TRUE : JNI_FALSE;
 #endif
 }
 
@@ -1575,9 +1578,9 @@
     jobject this)
 {
 #ifdef HEADLESS
-    return false;
+    return JNI_FALSE;
 #else
-    return usingXinerama;
+    return usingXinerama ? JNI_TRUE : JNI_FALSE;
 #endif /* HEADLESS */
 }
 
--- a/src/solaris/native/sun/awt/gtk2_interface.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/awt/gtk2_interface.c	Fri Apr 10 20:39:34 2015 -0700
@@ -33,6 +33,7 @@
 #include "jvm_md.h"
 #include "sizecalc.h"
 #include <jni_util.h>
+#include "awt.h"
 
 #define GTK2_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("gtk-x11-2.0", "0")
 #define GTK2_LIB JNI_LIB_NAME("gtk-x11-2.0")
@@ -433,7 +434,8 @@
             result = TRUE;
         }
 
-        dlclose(lib);
+        // 8048289: workaround for https://bugzilla.gnome.org/show_bug.cgi?id=733065
+        // dlclose(lib);
 
         return result;
     }
@@ -889,6 +891,7 @@
      * BadMatch errors which we would normally ignore. The IO error handler
      * is preserved here, too, just for consistency.
     */
+    AWT_LOCK();
     handler = XSetErrorHandler(NULL);
     io_handler = XSetIOErrorHandler(NULL);
 
@@ -925,6 +928,7 @@
 
     XSetErrorHandler(handler);
     XSetIOErrorHandler(io_handler);
+    AWT_UNLOCK();
 
     /* Initialize widget array. */
     for (i = 0; i < _GTK_WIDGET_TYPE_SIZE; i++)
--- a/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Fri Apr 10 20:39:34 2015 -0700
@@ -72,6 +72,11 @@
 
 static void quit(JNIEnv * env, jobject jpeer, gboolean isSignalHandler)
 {
+    jthrowable pendingException;
+    if (pendingException = (*env)->ExceptionOccurred(env)) {
+         (*env)->ExceptionClear(env);
+    }
+
     GtkWidget * dialog = (GtkWidget*)jlong_to_ptr(
             (*env)->GetLongField(env, jpeer, widgetFieldID));
 
@@ -95,6 +100,10 @@
             fp_gdk_threads_leave();
         }
     }
+
+    if (pendingException) {
+         (*env)->Throw(env, pendingException);
+    }
 }
 
 /*
--- a/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c	Fri Apr 10 20:39:34 2015 -0700
@@ -56,18 +56,28 @@
 Java_sun_nio_ch_DatagramChannelImpl_initIDs(JNIEnv *env, jclass clazz)
 {
     clazz = (*env)->FindClass(env, "java/net/InetSocketAddress");
+    CHECK_NULL(clazz);
     isa_class = (*env)->NewGlobalRef(env, clazz);
+    if (isa_class == NULL) {
+        JNU_ThrowOutOfMemoryError(env, NULL);
+        return;
+    }
     isa_ctorID = (*env)->GetMethodID(env, clazz, "<init>",
                                      "(Ljava/net/InetAddress;I)V");
+    CHECK_NULL(isa_ctorID);
 
     clazz = (*env)->FindClass(env, "sun/nio/ch/DatagramChannelImpl");
+    CHECK_NULL(clazz);
     dci_senderID = (*env)->GetFieldID(env, clazz, "sender",
                                       "Ljava/net/SocketAddress;");
+    CHECK_NULL(dci_senderID);
     dci_senderAddrID = (*env)->GetFieldID(env, clazz,
                                           "cachedSenderInetAddress",
                                           "Ljava/net/InetAddress;");
+    CHECK_NULL(dci_senderAddrID);
     dci_senderPortID = (*env)->GetFieldID(env, clazz,
                                           "cachedSenderPort", "I");
+    CHECK_NULL(dci_senderPortID);
 }
 
 JNIEXPORT void JNICALL
@@ -121,7 +131,7 @@
          * but that is acceptable.
          */
         if (rv < 0 && errno == EAFNOSUPPORT)
-                rv = errno = 0;
+            rv = errno = 0;
 #endif
     }
 #endif
@@ -192,17 +202,11 @@
     if (senderAddr == NULL) {
         jobject isa = NULL;
         int port;
-        jobject ia = NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa,
-                                               &port);
-
+        jobject ia = NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa, &port);
         if (ia != NULL) {
             isa = (*env)->NewObject(env, isa_class, isa_ctorID, ia, port);
         }
-
-        if (isa == NULL) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
-            return IOS_THROWN;
-        }
+        CHECK_NULL_RETURN(isa, IOS_THROWN);
 
         (*env)->SetObjectField(env, this, dci_senderAddrID, ia);
         (*env)->SetIntField(env, this, dci_senderPortID,
--- a/src/solaris/native/sun/nio/ch/FileChannelImpl.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/nio/ch/FileChannelImpl.c	Fri Apr 10 20:39:34 2015 -0700
@@ -154,10 +154,13 @@
 
 JNIEXPORT jlong JNICALL
 Java_sun_nio_ch_FileChannelImpl_transferTo0(JNIEnv *env, jobject this,
-                                            jint srcFD,
+                                            jobject srcFDO,
                                             jlong position, jlong count,
-                                            jint dstFD)
+                                            jobject dstFDO)
 {
+    jint srcFD = fdval(env, srcFDO);
+    jint dstFD = fdval(env, dstFDO);
+
 #if defined(__linux__)
     off64_t offset = (off64_t)position;
     jlong n = sendfile64(dstFD, srcFD, &offset, (size_t)count);
--- a/src/solaris/native/sun/nio/ch/FileKey.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/nio/ch/FileKey.c	Fri Apr 10 20:39:34 2015 -0700
@@ -43,8 +43,8 @@
 JNIEXPORT void JNICALL
 Java_sun_nio_ch_FileKey_initIDs(JNIEnv *env, jclass clazz)
 {
-    key_st_dev = (*env)->GetFieldID(env, clazz, "st_dev", "J");
-    key_st_ino = (*env)->GetFieldID(env, clazz, "st_ino", "J");
+    CHECK_NULL(key_st_dev = (*env)->GetFieldID(env, clazz, "st_dev", "J"));
+    CHECK_NULL(key_st_ino = (*env)->GetFieldID(env, clazz, "st_ino", "J"));
 }
 
 
--- a/src/solaris/native/sun/nio/ch/IOUtil.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/nio/ch/IOUtil.c	Fri Apr 10 20:39:34 2015 -0700
@@ -42,8 +42,8 @@
 JNIEXPORT void JNICALL
 Java_sun_nio_ch_IOUtil_initIDs(JNIEnv *env, jclass clazz)
 {
-    clazz = (*env)->FindClass(env, "java/io/FileDescriptor");
-    fd_fdID = (*env)->GetFieldID(env, clazz, "fd", "I");
+    CHECK_NULL(clazz = (*env)->FindClass(env, "java/io/FileDescriptor"));
+    CHECK_NULL(fd_fdID = (*env)->GetFieldID(env, clazz, "fd", "I"));
 }
 
 JNIEXPORT jboolean JNICALL
--- a/src/solaris/native/sun/nio/ch/Net.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/nio/ch/Net.c	Fri Apr 10 20:39:34 2015 -0700
@@ -231,7 +231,7 @@
 
 JNIEXPORT int JNICALL
 Java_sun_nio_ch_Net_socket0(JNIEnv *env, jclass cl, jboolean preferIPv6,
-                            jboolean stream, jboolean reuse)
+                            jboolean stream, jboolean reuse, jboolean ignored)
 {
     int fd;
     int type = (stream ? SOCK_STREAM : SOCK_DGRAM);
--- a/src/solaris/native/sun/nio/ch/ServerSocketChannelImpl.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/nio/ch/ServerSocketChannelImpl.c	Fri Apr 10 20:39:34 2015 -0700
@@ -57,12 +57,20 @@
     jclass cls;
 
     cls = (*env)->FindClass(env, "java/io/FileDescriptor");
+    CHECK_NULL(cls);
     fd_fdID = (*env)->GetFieldID(env, cls, "fd", "I");
+    CHECK_NULL(fd_fdID);
 
     cls = (*env)->FindClass(env, "java/net/InetSocketAddress");
+    CHECK_NULL(cls);
     isa_class = (*env)->NewGlobalRef(env, cls);
+    if (isa_class == NULL) {
+        JNU_ThrowOutOfMemoryError(env, NULL);
+        return;
+    }
     isa_ctorID = (*env)->GetMethodID(env, cls, "<init>",
                                      "(Ljava/net/InetAddress;I)V");
+    CHECK_NULL(isa_ctorID);
 }
 
 JNIEXPORT jint JNICALL
@@ -79,6 +87,10 @@
     jint remote_port;
 
     NET_AllocSockaddr(&sa, &alloc_len);
+    if (sa == NULL) {
+        JNU_ThrowOutOfMemoryError(env, NULL);
+        return IOS_THROWN;
+    }
 
     /*
      * accept connection but ignore ECONNABORTED indicating that
@@ -110,8 +122,9 @@
     (*env)->SetIntField(env, newfdo, fd_fdID, newfd);
     remote_ia = NET_SockaddrToInetAddress(env, sa, (int *)&remote_port);
     free((void *)sa);
-    isa = (*env)->NewObject(env, isa_class, isa_ctorID,
-                            remote_ia, remote_port);
+    CHECK_NULL_RETURN(remote_ia, IOS_THROWN);
+    isa = (*env)->NewObject(env, isa_class, isa_ctorID, remote_ia, remote_port);
+    CHECK_NULL_RETURN(isa, IOS_THROWN);
     (*env)->SetObjectArrayElement(env, isaa, 0, isa);
     return 1;
 }
--- a/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c	Fri Apr 10 20:39:34 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -213,6 +213,7 @@
 
     /* retrieved address from sockaddr */
     isaObj = SockAddrToInetSocketAddress(env, sap);
+    CHECK_NULL(isaObj);
 
     /* data retrieved from sff_data */
     if (dataLength > 0) {
@@ -337,6 +338,7 @@
     }
 
     addressObj = SockAddrToInetSocketAddress(env, (struct sockaddr*)&spc->spc_aaddr);
+    CHECK_NULL(addressObj);
 
     /* create PeerAddressChanged */
     resultObj = (*env)->NewObject(env, spc_class, spc_ctrID, spc->spc_assoc_id,
@@ -393,6 +395,7 @@
     }
 
     isa = SockAddrToInetSocketAddress(env, sap);
+    CHECK_NULL(isa);
     getControlData(msg, cdata);
 
     /* create MessageInfoImpl */
@@ -461,11 +464,6 @@
             union sctp_notification *snp;
             jboolean allocated = JNI_FALSE;
 
-            if (rv > SCTP_NOTIFICATION_SIZE) {
-                JNU_ThrowInternalError(env, "should not reach here");
-                return -1;
-            }
-
             if (!(msg->msg_flags & MSG_EOR) && length < SCTP_NOTIFICATION_SIZE) {
                 char* newBuf;
                 int rvSAVE = rv;
@@ -613,4 +611,3 @@
     return Java_sun_nio_ch_SocketChannelImpl_checkConnect(env, this,
                                                           fdo, block, ready);
 }
-
--- a/src/solaris/native/sun/nio/ch/sctp/SctpNet.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/nio/ch/sctp/SctpNet.c	Fri Apr 10 20:39:34 2015 -0700
@@ -315,11 +315,12 @@
     if (isaCls == 0) {
         jclass c = (*env)->FindClass(env, "java/net/InetSocketAddress");
         CHECK_NULL(c);
+        isaCtrID = (*env)->GetMethodID(env, c, "<init>",
+                                     "(Ljava/net/InetAddress;I)V");
+        CHECK_NULL(isaCtrID);
         isaCls = (*env)->NewGlobalRef(env, c);
         CHECK_NULL(isaCls);
         (*env)->DeleteLocalRef(env, c);
-        isaCtrID = (*env)->GetMethodID(env, isaCls, "<init>",
-                                     "(Ljava/net/InetAddress;I)V");
     }
 }
 
@@ -382,8 +383,9 @@
         ia = NET_SockaddrToInetAddress(env, sap, &port);
         if (ia != NULL)
             isa = (*env)->NewObject(env, isaCls, isaCtrID, ia, port);
-        if (isa != NULL)
-            (*env)->SetObjectArrayElement(env, isaa, i, isa);
+        if (isa == NULL)
+            break;
+        (*env)->SetObjectArrayElement(env, isaa, i, isa);
 
         if (sap->sa_family == AF_INET)
             addr_buf = ((struct sockaddr_in*)addr_buf) + 1;
@@ -433,8 +435,9 @@
         ia = NET_SockaddrToInetAddress(env, sap, &port);
         if (ia != NULL)
             isa = (*env)->NewObject(env, isaCls, isaCtrID, ia, port);
-        if (isa != NULL)
-            (*env)->SetObjectArrayElement(env, isaa, i, isa);
+        if (isa == NULL)
+            break;
+        (*env)->SetObjectArrayElement(env, isaa, i, isa);
 
         if (sap->sa_family == AF_INET)
             addr_buf = ((struct sockaddr_in*)addr_buf) + 1;
--- a/src/solaris/native/sun/nio/fs/BsdNativeDispatcher.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/nio/fs/BsdNativeDispatcher.c	Fri Apr 10 20:39:34 2015 -0700
@@ -72,13 +72,15 @@
     jclass clazz;
 
     clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
-    if (clazz == NULL) {
-        return;
-    }
+    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);
 }
 
 JNIEXPORT jlong JNICALL
@@ -201,4 +203,3 @@
         free(iter);
     }
 }
-
--- a/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c	Fri Apr 10 20:39:34 2015 -0700
@@ -68,13 +68,15 @@
     my_flistxattr_func = (flistxattr_func*)dlsym(RTLD_DEFAULT, "flistxattr");
 
     clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
-    if (clazz == NULL)
-        return;
-
+    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);
 }
 
 JNIEXPORT jint JNICALL
--- a/src/solaris/native/sun/nio/fs/SolarisNativeDispatcher.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/nio/fs/SolarisNativeDispatcher.c	Fri Apr 10 20:39:34 2015 -0700
@@ -55,14 +55,17 @@
 JNIEXPORT void JNICALL
 Java_sun_nio_fs_SolarisNativeDispatcher_init(JNIEnv *env, jclass clazz) {
     clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
-    if (clazz == NULL)
-        return;
-
+    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_dev = (*env)->GetFieldID(env, clazz, "dev", "J");
+    CHECK_NULL(entry_dev);
 }
 
 JNIEXPORT jint JNICALL
--- a/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c	Fri Apr 10 20:39:34 2015 -0700
@@ -179,46 +179,64 @@
     jclass clazz;
 
     clazz = (*env)->FindClass(env, "sun/nio/fs/UnixFileAttributes");
-    if (clazz == NULL) {
-        return 0;
-    }
+    CHECK_NULL_RETURN(clazz, 0);
     attrs_st_mode = (*env)->GetFieldID(env, clazz, "st_mode", "I");
+    CHECK_NULL_RETURN(attrs_st_mode, 0);
     attrs_st_ino = (*env)->GetFieldID(env, clazz, "st_ino", "J");
+    CHECK_NULL_RETURN(attrs_st_ino, 0);
     attrs_st_dev = (*env)->GetFieldID(env, clazz, "st_dev", "J");
+    CHECK_NULL_RETURN(attrs_st_dev, 0);
     attrs_st_rdev = (*env)->GetFieldID(env, clazz, "st_rdev", "J");
+    CHECK_NULL_RETURN(attrs_st_rdev, 0);
     attrs_st_nlink = (*env)->GetFieldID(env, clazz, "st_nlink", "I");
+    CHECK_NULL_RETURN(attrs_st_nlink, 0);
     attrs_st_uid = (*env)->GetFieldID(env, clazz, "st_uid", "I");
+    CHECK_NULL_RETURN(attrs_st_uid, 0);
     attrs_st_gid = (*env)->GetFieldID(env, clazz, "st_gid", "I");
+    CHECK_NULL_RETURN(attrs_st_gid, 0);
     attrs_st_size = (*env)->GetFieldID(env, clazz, "st_size", "J");
+    CHECK_NULL_RETURN(attrs_st_size, 0);
     attrs_st_atime_sec = (*env)->GetFieldID(env, clazz, "st_atime_sec", "J");
+    CHECK_NULL_RETURN(attrs_st_atime_sec, 0);
     attrs_st_atime_nsec = (*env)->GetFieldID(env, clazz, "st_atime_nsec", "J");
+    CHECK_NULL_RETURN(attrs_st_atime_nsec, 0);
     attrs_st_mtime_sec = (*env)->GetFieldID(env, clazz, "st_mtime_sec", "J");
+    CHECK_NULL_RETURN(attrs_st_mtime_sec, 0);
     attrs_st_mtime_nsec = (*env)->GetFieldID(env, clazz, "st_mtime_nsec", "J");
+    CHECK_NULL_RETURN(attrs_st_mtime_nsec, 0);
     attrs_st_ctime_sec = (*env)->GetFieldID(env, clazz, "st_ctime_sec", "J");
+    CHECK_NULL_RETURN(attrs_st_ctime_sec, 0);
     attrs_st_ctime_nsec = (*env)->GetFieldID(env, clazz, "st_ctime_nsec", "J");
+    CHECK_NULL_RETURN(attrs_st_ctime_nsec, 0);
 
 #ifdef _DARWIN_FEATURE_64_BIT_INODE
     attrs_st_birthtime_sec = (*env)->GetFieldID(env, clazz, "st_birthtime_sec", "J");
+    CHECK_NULL_RETURN(attrs_st_birthtime_sec, 0);
 #endif
 
     clazz = (*env)->FindClass(env, "sun/nio/fs/UnixFileStoreAttributes");
-    if (clazz == NULL) {
-        return 0;
-    }
+    CHECK_NULL_RETURN(clazz, 0);
     attrs_f_frsize = (*env)->GetFieldID(env, clazz, "f_frsize", "J");
+    CHECK_NULL_RETURN(attrs_f_frsize, 0);
     attrs_f_blocks = (*env)->GetFieldID(env, clazz, "f_blocks", "J");
+    CHECK_NULL_RETURN(attrs_f_blocks, 0);
     attrs_f_bfree = (*env)->GetFieldID(env, clazz, "f_bfree", "J");
+    CHECK_NULL_RETURN(attrs_f_bfree, 0);
     attrs_f_bavail = (*env)->GetFieldID(env, clazz, "f_bavail", "J");
+    CHECK_NULL_RETURN(attrs_f_bavail, 0);
 
     clazz = (*env)->FindClass(env, "sun/nio/fs/UnixMountEntry");
-    if (clazz == NULL) {
-        return 0;
-    }
+    CHECK_NULL_RETURN(clazz, 0);
     entry_name = (*env)->GetFieldID(env, clazz, "name", "[B");
+    CHECK_NULL_RETURN(entry_name, 0);
     entry_dir = (*env)->GetFieldID(env, clazz, "dir", "[B");
+    CHECK_NULL_RETURN(entry_dir, 0);
     entry_fstype = (*env)->GetFieldID(env, clazz, "fstype", "[B");
+    CHECK_NULL_RETURN(entry_fstype, 0);
     entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
+    CHECK_NULL_RETURN(entry_options, 0);
     entry_dev = (*env)->GetFieldID(env, clazz, "dev", "J");
+    CHECK_NULL_RETURN(entry_dev, 0);
 
     /* system calls that might not be available at run time */
 
--- a/src/solaris/native/sun/xawt/XToolkit.c	Fri Apr 10 07:27:56 2015 -0700
+++ b/src/solaris/native/sun/xawt/XToolkit.c	Fri Apr 10 20:39:34 2015 -0700
@@ -77,7 +77,7 @@
 #ifndef HEADLESS
 
 extern Display* awt_init_Display(JNIEnv *env, jobject this);
-extern void freeNativeStringArray(char **array, long length);
+extern void freeNativeStringArray(char **array, jsize length);
 extern char** stringArrayToNative(JNIEnv *env, jobjectArray array, jsize * ret_length);
 
 struct XFontPeerIDs xFontPeerIDs;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/windows/classes/com/sun/java/accessibility/32bit/AccessBridgeLoader.java	Fri Apr 10 20:39:34 2015 -0700
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2002, 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
+ * 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;
+
+@jdk.Exported(false)
+abstract class AccessBridgeLoader {
+
+    /**
+     * Load JavaAccessBridge.DLL (our native half)
+     */
+    static {
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Object>() {
+                public Object run() {
+                    System.loadLibrary("JavaAccessBridge-32");
+                    return null;
+                }
+            }, null, new java.lang.RuntimePermission("loadLibrary.JavaAccessBridge-32")
+        );
+    }
+
+    boolean useJAWT_DLL = false;
+
+    /**
+     * AccessBridgeLoader constructor
+     */
+    AccessBridgeLoader() {
+        // load JAWTAccessBridge.DLL on JDK 1.4.1 or later
+        // determine which version of the JDK is running
+        String version = System.getProperty("java.version");
+        if (version != null)
+            useJAWT_DLL = (version.compareTo("1.4.1") >= 0);
+
+        if (useJAWT_DLL) {
+            // Note that we have to explicitly load JAWT.DLL
+            java.security.AccessController.doPrivileged(
+                new java.security.PrivilegedAction<Object>() {
+                    public Object run() {
+                        System.loadLibrary("JAWT");
+                        System.loadLibrary("JAWTAccessBridge-32");
+                        return null;
+                    }
+                }, null, new RuntimePermission("loadLibrary.JAWT"),
+                         new RuntimePermission("loadLibrary.JAWTAccessBridge-32")
+            );
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/windows/classes/com/sun/java/accessibility/64bit/AccessBridgeLoader.java	Fri Apr 10 20:39:34 2015 -0700
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2002, 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
+ * 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;
+
+@jdk.Exported(false)
+abstract class AccessBridgeLoader {
+
+    /**
+     * Load JavaAccessBridge.DLL (our native half)
+     */
+    static {
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Object>() {
+                public Object run() {
+                    System.loadLibrary("JavaAccessBridge-64");
+                    return null;
+                }
+            }, null, new RuntimePermission("loadLibrary.JavaAccessBridge-64")
+        );
+    }
+
+    boolean useJAWT_DLL = false;
+
+    /**
+     * AccessBridgLoader constructor
+     */
+    AccessBridgeLoader() {
+        // load JAWTAccessBridge.DLL on JDK 1.4.1 or later
+        String version = System.getProperty("java.version");
+        if (version != null)
+            useJAWT_DLL = (version.compareTo("1.4.1") >= 0);
+
+        if (useJAWT_DLL) {
+            // Note that we have to explicitly load JAWT.DLL
+            java.security.AccessController.doPrivileged(
+                new java.security.PrivilegedAction<Object>() {
+                    public Object run() {
+                        System.loadLibrary("JAWT");
+                        System.loadLibrary("JAWTAccessBridge-64");
+                        return null;
+                    }
+                }, null, new RuntimePermission("loadLibrary.JAWT"),
+                         new RuntimePermission("loadLibrary.JAWTAccessBridge-64")
+            );
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/windows/classes/com/sun/java/accessibility/AccessBridge.java	Fri Apr 10 20:39:34 2015 -0700
@@ -0,0 +1,7272 @@
+/*
+ * 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;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.util.*;
+import java.lang.*;
+import java.lang.reflect.*;
+
+import java.beans.*;
+import javax.swing.*;
+import javax.swing.event.*;
+import javax.swing.text.*;
+import javax.swing.tree.*;
+import javax.swing.table.*;
+import javax.swing.plaf.TreeUI;
+
+import javax.accessibility.*;
+import com.sun.java.accessibility.util.*;
+import sun.awt.AWTAccessor;
+import sun.awt.AppContext;
+import sun.awt.SunToolkit;
+
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CountDownLatch;
+
+/*
+ * Note: This class has to be public.  It's loaded from the VM like this:
+ *       Class.forName(atName).newInstance();
+ */
+@jdk.Exported(false)
+final public class AccessBridge extends AccessBridgeLoader {
+
+    private final String AccessBridgeVersion =
+    "AccessBridge 2.0.4";
+
+    private static AccessBridge theAccessBridge;
+    private ObjectReferences references;
+    private EventHandler eventHandler;
+    private boolean runningOnJDK1_4 = false;
+    private boolean runningOnJDK1_5 = false;
+
+    // Maps AccessibleRoles strings to AccessibleRoles.
+    private ConcurrentHashMap<String,AccessibleRole> accessibleRoleMap = new ConcurrentHashMap<>();
+
+    /**
+       If the object's role is in the following array getVirtualAccessibleName
+       will use the extended search algorithm.
+    */
+    private ArrayList<AccessibleRole> extendedVirtualNameSearchRoles = new ArrayList<>();
+    /**
+       If the role of the object's parent is in the following array
+       getVirtualAccessibleName will NOT use the extended search
+       algorithm even if the object's role is in the
+       extendedVirtualNameSearchRoles array.
+    */
+    private ArrayList<AccessibleRole> noExtendedVirtualNameSearchParentRoles = new ArrayList<>();
+
+    /**
+     * AccessBridge constructor
+     *
+     * Note: This constructor has to be public.  It's called from the VM like this:
+     *       Class.forName(atName).newInstance();
+     */
+    public AccessBridge() {
+        super();
+        theAccessBridge = this;
+        references = new ObjectReferences();
+
+        // initialize shutdown hook
+        Runtime runTime = Runtime.getRuntime();
+        shutdownHook hook = new shutdownHook();
+        runTime.addShutdownHook(new Thread(hook));
+
+        // initialize AccessibleRole map
+        initAccessibleRoleMap();
+
+        // determine which version of the JDK is running
+        String version = getJavaVersionProperty();
+        debugString("JDK version = "+version);
+        runningOnJDK1_4 = (version.compareTo("1.4") >= 0);
+        runningOnJDK1_5 = (version.compareTo("1.5") >= 0);
+
+        // initialize the methods that map HWNDs and Java top-level
+        // windows
+        if (initHWNDcalls() == true) {
+
+            // is this a JVM we can use?
+            // install JDK 1.2 and later Swing ToolKit listener
+            EventQueueMonitor.isGUIInitialized();
+
+            // start the Java event handler
+            eventHandler = new EventHandler(this);
+
+            // register for menu selection events
+            if (runningOnJDK1_4) {
+                MenuSelectionManager.defaultManager().addChangeListener(eventHandler);
+            }
+
+            // register as a NativeWindowHandler
+            addNativeWindowHandler(new DefaultNativeWindowHandler());
+
+            // start in a new thread
+            Thread abthread = new Thread(new dllRunner());
+            abthread.setDaemon(true);
+            abthread.start();
+            debugString("AccessBridge started");
+        }
+    }
+
+    /*
+     * adaptor to run the AccessBridge DLL
+     */
+    private class dllRunner implements Runnable {
+        public void run() {
+            runDLL();
+        }
+    }
+
+    /*
+     * shutdown hook
+     */
+    private class shutdownHook implements Runnable {
+
+        public void run() {
+            debugString("***** shutdownHook: shutting down...");
+            javaShutdown();
+        }
+    }
+
+
+    /*
+     * Initialize the hashtable that maps Strings to AccessibleRoles.
+     */
+    private void initAccessibleRoleMap() {
+        /*
+         * Initialize the AccessibleRoles map. This code uses methods in
+         * java.lang.reflect.* to build the map.
+         */
+        try {
+            Class<?> clAccessibleRole = Class.forName ("javax.accessibility.AccessibleRole");
+            if (null != clAccessibleRole) {
+                AccessibleRole roleUnknown = AccessibleRole.UNKNOWN;
+                Field [] fields = clAccessibleRole.getFields ();
+                int i = 0;
+                for (i = 0; i < fields.length; i ++) {
+                    Field f = fields [i];
+                    if (javax.accessibility.AccessibleRole.class == f.getType ()) {
+                        AccessibleRole nextRole = (AccessibleRole) (f.get (roleUnknown));
+                        String nextRoleString = nextRole.toDisplayString (Locale.US);
+                        accessibleRoleMap.put (nextRoleString, nextRole);
+                    }
+                }
+            }
+        } catch (Exception e) {}
+
+    /*
+      Build the extendedVirtualNameSearchRoles array list.  I chose this method
+      because some of the Accessible Roles that need to be added to it are not
+      available in all versions of the J2SE that we want to support.
+    */
+    extendedVirtualNameSearchRoles.add (AccessibleRole.COMBO_BOX);
+    try {
+        /*
+          Added in J2SE 1.4
+        */
+        extendedVirtualNameSearchRoles.add (AccessibleRole.DATE_EDITOR);
+    } catch (NoSuchFieldError e) {}
+    extendedVirtualNameSearchRoles.add (AccessibleRole.LIST);
+    extendedVirtualNameSearchRoles.add (AccessibleRole.PASSWORD_TEXT);
+    extendedVirtualNameSearchRoles.add (AccessibleRole.SLIDER);
+    try {
+        /*
+          Added in J2SE 1.3
+        */
+        extendedVirtualNameSearchRoles.add (AccessibleRole.SPIN_BOX);
+    } catch (NoSuchFieldError e) {}
+    extendedVirtualNameSearchRoles.add (AccessibleRole.TABLE);
+    extendedVirtualNameSearchRoles.add (AccessibleRole.TEXT);
+    extendedVirtualNameSearchRoles.add (AccessibleRole.UNKNOWN);
+
+    noExtendedVirtualNameSearchParentRoles.add (AccessibleRole.TABLE);
+    noExtendedVirtualNameSearchParentRoles.add (AccessibleRole.TOOL_BAR);
+    }
+
+    /**
+     * start the AccessBridge DLL running in its own thread
+     */
+    private native void runDLL();
+
+    /**
+     * debugging output (goes to OutputDebugStr())
+     */
+    private native void sendDebugString(String debugStr);
+
+    /**
+     * debugging output (goes to OutputDebugStr())
+     */
+    private void debugString(String debugStr) {
+    sendDebugString(debugStr);
+    }
+
+    /* ===== utility methods ===== */
+
+    /**
+     * decrement the reference to the object (called by native code)
+     */
+    private void decrementReference(Object o) {
+    references.decrement(o);
+    }
+
+    /**
+     * get the java.version property from the JVM
+     */
+    private String getJavaVersionProperty() {
+        String s = System.getProperty("java.version");
+        if (s != null) {
+            references.increment(s);
+            return s;
+        }
+        return null;
+    }
+
+    /**
+     * get the java.version property from the JVM
+     */
+    private String getAccessBridgeVersion() {
+        String s = new String(AccessBridgeVersion);
+        references.increment(s);
+        return s;
+    }
+
+    /* ===== HWND/Java window mapping methods ===== */
+
+    // Java toolkit methods for mapping HWNDs to Java components
+    private Method javaGetComponentFromNativeWindowHandleMethod;
+    private Method javaGetNativeWindowHandleFromComponentMethod;
+
+    // native jawt methods for mapping HWNDs to Java components
+    private native int isJAWTInstalled();
+
+    private native int jawtGetNativeWindowHandleFromComponent(Component comp);
+
+    private native Component jawtGetComponentFromNativeWindowHandle(int handle);
+
+    Toolkit toolkit;
+
+    /**
+     * map an HWND to an AWT Component
+     */
+    private boolean initHWNDcalls() {
+        Class<?> integerParemter[] = new Class<?>[1];
+        integerParemter[0] = Integer.TYPE;
+        Class<?> componentParemter[] = new Class<?>[1];
+        try {
+            componentParemter[0] = Class.forName("java.awt.Component");
+        } catch (ClassNotFoundException e) {
+            debugString("Exception: " + e.toString());
+        }
+        Object[] args = new Object[1];
+        Component c;
+        boolean returnVal = false;
+
+        toolkit = Toolkit.getDefaultToolkit();
+
+        if (useJAWT_DLL) {
+            returnVal = true;
+        } else {
+            // verify javaGetComponentFromNativeWindowHandle() method
+            // is present if JAWT.DLL is not installed
+            try {
+                javaGetComponentFromNativeWindowHandleMethod =
+                    toolkit.getClass().getMethod(
+                        "getComponentFromNativeWindowHandle", integerParemter);
+                if (javaGetComponentFromNativeWindowHandleMethod != null) {
+                    try {
+                        args[0] = new Integer(1);
+                        c = (Component) javaGetComponentFromNativeWindowHandleMethod.invoke(toolkit, args);
+                        returnVal = true;
+                    } catch (InvocationTargetException e) {
+                        debugString("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        debugString("Exception: " + e.toString());
+                    }
+                }
+            } catch (NoSuchMethodException e) {
+                debugString("Exception: " + e.toString());
+            } catch (SecurityException e) {
+                debugString("Exception: " + e.toString());
+            }
+
+            // verify getComponentFromNativeWindowHandle() method
+            // is present if JAWT.DLL is not installed
+            try {
+                javaGetNativeWindowHandleFromComponentMethod =
+                    toolkit.getClass().getMethod(
+                        "getNativeWindowHandleFromComponent", componentParemter);
+                if (javaGetNativeWindowHandleFromComponentMethod != null) {
+                    try {
+                        args[0] = new Button("OK");    // need some Component...
+                        Integer i = (Integer) javaGetNativeWindowHandleFromComponentMethod.invoke(toolkit, args);
+                        returnVal = true;
+                    } catch (InvocationTargetException e) {
+                        debugString("Exception: " + e.toString());
+                    } catch (IllegalAccessException e) {
+                        debugString("Exception: " + e.toString());
+                    } catch (Exception e) {
+                        debugString("Exception: " + e.toString());
+                    }
+                }
+            } catch (NoSuchMethodException e) {
+                debugString("Exception: " + e.toString());
+            } catch (SecurityException e) {
+                debugString("Exception: " + e.toString());
+            }
+        }
+        return returnVal;
+    }
+
+    // native window handler interface
+    private interface NativeWindowHandler {
+        public Accessible getAccessibleFromNativeWindowHandle(int nativeHandle);
+    }
+
+    // hash table of native window handle to AccessibleContext mappings
+    static private ConcurrentHashMap<Integer,AccessibleContext> windowHandleToContextMap = new ConcurrentHashMap<>();
+
+    // hash table of AccessibleContext to native window handle mappings
+    static private ConcurrentHashMap<AccessibleContext,Integer> contextToWindowHandleMap = new ConcurrentHashMap<>();
+
+    /*
+     * adds a virtual window handler to our hash tables
+     */
+    static private void registerVirtualFrame(final Accessible a,
+                                             Integer nativeWindowHandle ) {
+        if (a != null) {
+            AccessibleContext ac = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+                @Override
+                public AccessibleContext call() throws Exception {
+                    return a.getAccessibleContext();
+                }
+            }, a);
+            windowHandleToContextMap.put(nativeWindowHandle, ac);
+            contextToWindowHandleMap.put(ac, nativeWindowHandle);
+        }
+    }
+
+    /*
+     * removes a virtual window handler to our hash tables
+     */
+    static private void revokeVirtualFrame(final Accessible a,
+                                           Integer nativeWindowHandle ) {
+        AccessibleContext ac = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+            @Override
+            public AccessibleContext call() throws Exception {
+                return a.getAccessibleContext();
+            }
+        }, a);
+        windowHandleToContextMap.remove(nativeWindowHandle);
+        contextToWindowHandleMap.remove(ac);
+    }
+
+    // vector of native window handlers
+    private static Vector<NativeWindowHandler> nativeWindowHandlers = new Vector<>();
+
+    /*
+    * adds a native window handler to our list
+    */
+    private static void addNativeWindowHandler(NativeWindowHandler handler) {
+        if (handler == null) {
+            throw new IllegalArgumentException();
+        }
+        nativeWindowHandlers.addElement(handler);
+    }
+
+    /*
+     * removes a native window handler to our list
+     */
+    private static boolean removeNativeWindowHandler(NativeWindowHandler handler) {
+        if (handler == null) {
+            throw new IllegalArgumentException();
+        }
+        return nativeWindowHandlers.removeElement(handler);
+    }
+
+    /**
+     * verifies that a native window handle is a Java window
+     */
+    private boolean isJavaWindow(int nativeHandle) {
+        AccessibleContext ac = getContextFromNativeWindowHandle(nativeHandle);
+        if (ac != null) {
+            saveContextToWindowHandleMapping(ac, nativeHandle);
+            return true;
+        }
+        return false;
+    }
+
+    /*
+     * saves the mapping between an AccessibleContext and a window handle
+     */
+    private void saveContextToWindowHandleMapping(AccessibleContext ac,
+                                                  int nativeHandle) {
+        debugString("saveContextToWindowHandleMapping...");
+        if (ac == null) {
+            return;
+        }
+        if (! contextToWindowHandleMap.containsKey(ac)) {
+            debugString("saveContextToWindowHandleMapping: ac = "+ac+"; handle = "+nativeHandle);
+            contextToWindowHandleMap.put(ac, nativeHandle);
+        }
+    }
+
+    /**
+     * maps a native window handle to an Accessible Context
+     */
+    private AccessibleContext getContextFromNativeWindowHandle(int nativeHandle) {
+        // First, look for the Accessible in our hash table of
+        // virtual window handles.
+        AccessibleContext ac = windowHandleToContextMap.get(nativeHandle);
+        if(ac!=null) {
+            saveContextToWindowHandleMapping(ac, nativeHandle);
+            return ac;
+        }
+
+        // Next, look for the native window handle in our vector
+        // of native window handles.
+        int numHandlers = nativeWindowHandlers.size();
+        for (int i = 0; i < numHandlers; i++) {
+            NativeWindowHandler nextHandler = nativeWindowHandlers.elementAt(i);
+            final Accessible a = nextHandler.getAccessibleFromNativeWindowHandle(nativeHandle);
+            if (a != null) {
+                ac = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+                    @Override
+                    public AccessibleContext call() throws Exception {
+                        return a.getAccessibleContext();
+                    }
+                }, a);
+                saveContextToWindowHandleMapping(ac, nativeHandle);
+                return ac;
+            }
+        }
+        // Not found.
+        return null;
+    }
+
+    /**
+     * maps an AccessibleContext to a native window handle
+     *     returns 0 on error
+     */
+    private int getNativeWindowHandleFromContext(AccessibleContext ac) {
+    debugString("getNativeWindowHandleFromContext: ac = "+ac);
+        try {
+            return contextToWindowHandleMap.get(ac);
+        } catch (Exception ex) {
+            return 0;
+        }
+    }
+
+    private class DefaultNativeWindowHandler implements NativeWindowHandler {
+        /*
+        * returns the Accessible associated with a native window
+        */
+        public Accessible getAccessibleFromNativeWindowHandle(int nativeHandle) {
+            final Component c = getComponentFromNativeWindowHandle(nativeHandle);
+            if (c instanceof Accessible) {
+                AccessibleContext ac = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+                    @Override
+                    public AccessibleContext call() throws Exception {
+                        return c.getAccessibleContext();
+                    }
+                }, c);
+                saveContextToWindowHandleMapping(ac, nativeHandle);
+                return (Accessible)c;
+            } else {
+                return null;
+            }
+        }
+
+        /**
+        * map an HWND to an AWT Component
+        */
+        private Component getComponentFromNativeWindowHandle(int nativeHandle) {
+            if (useJAWT_DLL) {
+                debugString("*** calling jawtGetComponentFromNativeWindowHandle");
+                return jawtGetComponentFromNativeWindowHandle(nativeHandle);
+            } else {
+                debugString("*** calling javaGetComponentFromNativeWindowHandle");
+                Object[] args = new Object[1];
+                if (javaGetComponentFromNativeWindowHandleMethod != null) {
+                    try {
+                        args[0] = nativeHandle;
+                        Object o = javaGetComponentFromNativeWindowHandleMethod.invoke(toolkit, args);
+                        if (o instanceof Accessible) {
+                            final Accessible acc=(Accessible)o;
+                            AccessibleContext ac = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+                                @Override
+                                public AccessibleContext call() throws Exception {
+                                    return acc.getAccessibleContext();
+                                }
+                            }, (Component)o);
+                            saveContextToWindowHandleMapping(ac,nativeHandle);
+                        }
+                        return (Component)o;
+                    } catch (InvocationTargetException | IllegalAccessException e) {
+                        debugString("Exception: " + e.toString());
+                    }
+                }
+            }
+            return null;
+        }
+    }
+
+    /**
+     * map an AWT Component to an HWND
+     */
+    private int getNativeWindowHandleFromComponent(final Component target) {
+        if (useJAWT_DLL) {
+            debugString("*** calling jawtGetNativeWindowHandleFromComponent");
+            return jawtGetNativeWindowHandleFromComponent(target);
+        } else {
+            Object[] args = new Object[1];
+            debugString("*** calling javaGetNativeWindowHandleFromComponent");
+            if (javaGetNativeWindowHandleFromComponentMethod != null) {
+                try {
+                    args[0] = target;
+                    Integer i = (Integer) javaGetNativeWindowHandleFromComponentMethod.invoke(toolkit, args);
+                    // cache the mapping
+                    AccessibleContext ac = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+                        @Override
+                        public AccessibleContext call() throws Exception {
+                            return target.getAccessibleContext();
+                        }
+                    }, target);
+                    contextToWindowHandleMap.put(ac, i);
+                    return i.intValue();
+                } catch (InvocationTargetException e) {
+                    debugString("Exception: " + e.toString());
+                } catch (IllegalAccessException e) {
+                    debugString("Exception: " + e.toString());
+                }
+            }
+        }
+        return -1;
+    }
+
+    /* ===== AccessibleContext methods =====*/
+
+    /*
+     * returns the inner-most AccessibleContext in parent at Point(x, y)
+     */
+    private AccessibleContext getAccessibleContextAt(int x, int y,
+                                                    AccessibleContext parent) {
+        if (parent == null) {
+            return null;
+        }
+        if (windowHandleToContextMap != null &&
+            windowHandleToContextMap.containsValue(getRootAccessibleContext(parent))) {
+            // Path for applications that register their top-level
+            // windows with the AccessBridge (e.g., StarOffice 6.1)
+            return getAccessibleContextAt_1(x, y, parent);
+        } else {
+            // Path for applications that do not register
+            // their top-level windows with the AccessBridge
+            // (e.g., Swing/AWT applications)
+            return getAccessibleContextAt_2(x, y, parent);
+        }
+    }
+
+    /*
+     * returns the root accessible context
+     */
+    private AccessibleContext getRootAccessibleContext(final AccessibleContext ac) {
+        if (ac == null) {
+            return null;
+        }
+        return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+            @Override
+            public AccessibleContext call() throws Exception {
+                Accessible parent = ac.getAccessibleParent();
+                if (parent == null) {
+                    return ac;
+                }
+                Accessible tmp = parent.getAccessibleContext().getAccessibleParent();
+                while (tmp != null) {
+                    parent = tmp;
+                    tmp = parent.getAccessibleContext().getAccessibleParent();
+                }
+                return parent.getAccessibleContext();
+            }
+        }, ac);
+    }
+
+    /*
+     * StarOffice version that does not use the EventQueueMonitor
+     */
+    private AccessibleContext getAccessibleContextAt_1(final int x, final int y,
+                                                      final AccessibleContext parent) {
+        debugString(" : getAccessibleContextAt_1 called");
+        debugString("   -> x = " + x + " y = " + y + " parent = " + parent);
+
+        if (parent == null) return null;
+            final AccessibleComponent acmp = InvocationUtils.invokeAndWait(new Callable<AccessibleComponent>() {
+                @Override
+                public AccessibleComponent call() throws Exception {
+                    return parent.getAccessibleComponent();
+                }
+            }, parent);
+        if (acmp!=null) {
+            final Point loc = InvocationUtils.invokeAndWait(new Callable<Point>() {
+                @Override
+                public Point call() throws Exception {
+                    return acmp.getLocation();
+                }
+            }, parent);
+            final Accessible a = InvocationUtils.invokeAndWait(new Callable<Accessible>() {
+                @Override
+                public Accessible call() throws Exception {
+                    return acmp.getAccessibleAt(new Point(x - loc.x, y - loc.y));
+                }
+            }, parent);
+            if (a != null) {
+                AccessibleContext foundAC = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+                    @Override
+                    public AccessibleContext call() throws Exception {
+                        return a.getAccessibleContext();
+                    }
+                }, parent);
+                if (foundAC != null) {
+                    if (foundAC != parent) {
+                        // recurse down into the child
+                        return getAccessibleContextAt_1(x - loc.x, y - loc.y,
+                                                        foundAC);
+                    } else
+                        return foundAC;
+                }
+            }
+        }
+        return parent;
+    }
+
+    /*
+     * AWT/Swing version
+     */
+    private AccessibleContext getAccessibleContextAt_2(final int x, final int y,
+                                                      AccessibleContext parent) {
+        debugString("getAccessibleContextAt_2 called");
+        debugString("   -> x = " + x + " y = " + y + " parent = " + parent);
+
+        return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+            @Override
+            public AccessibleContext call() throws Exception {
+                Accessible a = EventQueueMonitor.getAccessibleAt(new Point(x, y));
+                if (a != null) {
+                    AccessibleContext childAC = a.getAccessibleContext();
+                    if (childAC != null) {
+                        debugString("   returning childAC = " + childAC);
+                        return childAC;
+                    }
+                }
+                return null;
+            }
+        }, parent);
+    }
+
+    /**
+     * returns the Accessible that has focus
+     */
+    private AccessibleContext getAccessibleContextWithFocus() {
+        Component c = AWTEventMonitor.getComponentWithFocus();
+        if (c != null) {
+            final Accessible a = Translator.getAccessible(c);
+            if (a != null) {
+                AccessibleContext ac = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+                    @Override
+                    public AccessibleContext call() throws Exception {
+                        return a.getAccessibleContext();
+                    }
+                }, c);
+                if (ac != null) {
+                    return ac;
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * returns the AccessibleName from an AccessibleContext
+     */
+    private String getAccessibleNameFromContext(final AccessibleContext ac) {
+        debugString("***** ac = "+ac.getClass());
+        if (ac != null) {
+            String s = InvocationUtils.invokeAndWait(new Callable<String>() {
+                @Override
+                public String call() throws Exception {
+                    return ac.getAccessibleName();
+                }
+            }, ac);
+            if (s != null) {
+                references.increment(s);
+                debugString("Returning AccessibleName from Context: " + s);
+                return s;
+            } else {
+                return null;
+            }
+        } else {
+            debugString("getAccessibleNameFromContext; ac = null!");
+            return null;
+        }
+    }
+
+    /**
+     * Returns an AccessibleName for a component using an algorithm optimized
+     * for the JAWS screen reader.  This method is only intended for JAWS. All
+     * other uses are entirely optional.
+     */
+    private String getVirtualAccessibleNameFromContext(final AccessibleContext ac) {
+        if (null != ac) {
+            /*
+            Step 1:
+            =======
+            Determine if we can obtain the Virtual Accessible Name from the
+            Accessible Name or Accessible Description of the object.
+            */
+            String nameString = InvocationUtils.invokeAndWait(new Callable<String>() {
+                @Override
+                public String call() throws Exception {
+                    return ac.getAccessibleName();
+                }
+            }, ac);
+            if ( ( null != nameString ) && ( 0 != nameString.length () ) ) {
+                debugString ("bk -- The Virtual Accessible Name was obtained from AccessibleContext::getAccessibleName.");
+                references.increment (nameString);
+                return nameString;
+            }
+            String descriptionString = InvocationUtils.invokeAndWait(new Callable<String>() {
+                @Override
+                public String call() throws Exception {
+                    return ac.getAccessibleDescription();
+                }
+            }, ac);
+            if ( ( null != descriptionString ) && ( 0 != descriptionString.length () ) ) {
+                debugString ("bk -- The Virtual Accessible Name was obtained from AccessibleContext::getAccessibleDescription.");
+                references.increment (descriptionString);
+                return descriptionString;
+            }
+
+            debugString ("The Virtual Accessible Name was not found using AccessibleContext::getAccessibleDescription. or getAccessibleName");
+            /*
+            Step 2:
+            =======
+            Decide whether the extended name search algorithm should be
+            used for this object.
+            */
+            boolean bExtendedSearch = false;
+            AccessibleRole role = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
+                @Override
+                public AccessibleRole call() throws Exception {
+                    return ac.getAccessibleRole();
+                }
+            }, ac);
+            AccessibleContext parentContext = null;
+            AccessibleRole parentRole = AccessibleRole.UNKNOWN;
+
+            if ( extendedVirtualNameSearchRoles.contains (role) ) {
+                parentContext = getAccessibleParentFromContext (ac);
+                if ( null != parentContext ) {
+                    final AccessibleContext parentContextInnerTemp = parentContext;
+                    parentRole = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
+                        @Override
+                        public AccessibleRole call() throws Exception {
+                            return parentContextInnerTemp.getAccessibleRole();
+                        }
+                    }, ac);
+                    if ( AccessibleRole.UNKNOWN != parentRole ) {
+                        bExtendedSearch = true;
+                        if ( noExtendedVirtualNameSearchParentRoles.contains (parentRole) ) {
+                            bExtendedSearch = false;
+                        }
+                    }
+                }
+            }
+
+            if (false == bExtendedSearch) {
+                debugString ("bk -- getVirtualAccessibleNameFromContext will not use the extended name search algorithm.  role = " + role.toDisplayString (Locale.US) );
+                /*
+                Step 3:
+                =======
+                We have determined that we should not use the extended name
+                search algorithm for this object (we must obtain the name of
+                the object from the object itself and not from neighboring
+                objects).  However the object name cannot be obtained from
+                the Accessible Name or Accessible Description of the object.
+
+                Handle several special cases here that might yield a value for
+                the Virtual Accessible Name.  Return null if the object does
+                not match the criteria for any of these special cases.
+                */
+                if (AccessibleRole.LABEL == role) {
+                    /*
+                    Does the label support the Accessible Text Interface?
+                    */
+                    final AccessibleText at = InvocationUtils.invokeAndWait(new Callable<AccessibleText>() {
+                        @Override
+                        public AccessibleText call() throws Exception {
+                            return ac.getAccessibleText();
+                        }
+                    }, ac);
+                    if (null != at) {
+                        int charCount = InvocationUtils.invokeAndWait(new Callable<Integer>() {
+                            @Override
+                            public Integer call() throws Exception {
+                                return at.getCharCount();
+                            }
+                        }, ac);
+                        String text = getAccessibleTextRangeFromContext (ac, 0, charCount);
+                        if (null != text) {
+                            debugString ("bk -- The Virtual Accessible Name was obtained from the Accessible Text of the LABEL object.");
+                            references.increment (text);
+                            return text;
+                        }
+                    }
+                    /*
+                    Does the label support the Accessible Icon Interface?
+                    */
+                    debugString ("bk -- Attempting to obtain the Virtual Accessible Name from the Accessible Icon information.");
+                    final AccessibleIcon [] ai = InvocationUtils.invokeAndWait(new Callable<AccessibleIcon[]>() {
+                        @Override
+                        public AccessibleIcon[] call() throws Exception {
+                            return ac.getAccessibleIcon();
+                        }
+                    }, ac);
+                    if ( (null != ai) && (ai.length > 0) ) {
+                        String iconDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
+                            @Override
+                            public String call() throws Exception {
+                                return ai[0].getAccessibleIconDescription();
+                            }
+                        }, ac);
+                        if (iconDescription != null){
+                            debugString ("bk -- The Virtual Accessible Name was obtained from the description of the first Accessible Icon found in the LABEL object.");
+                            references.increment (iconDescription);
+                            return iconDescription;
+                        }
+                    } else {
+                        parentContext = getAccessibleParentFromContext (ac);
+                        if ( null != parentContext ) {
+                            final AccessibleContext parentContextInnerTemp = parentContext;
+                            parentRole = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
+                                @Override
+                                public AccessibleRole call() throws Exception {
+                                    return parentContextInnerTemp.getAccessibleRole();
+                                }
+                            }, ac);
+                            if ( AccessibleRole.TABLE == parentRole ) {
+                                int indexInParent = InvocationUtils.invokeAndWait(new Callable<Integer>() {
+                                    @Override
+                                    public Integer call() throws Exception {
+                                        return ac.getAccessibleIndexInParent();
+                                    }
+                                }, ac);
+                                final AccessibleContext acTableCell = getAccessibleChildFromContext (parentContext, indexInParent);
+                                debugString ("bk -- Making a second attempt to obtain the Virtual Accessible Name from the Accessible Icon information for the Table Cell.");
+                                if (acTableCell != null) {
+                                    final AccessibleIcon [] aiRet =InvocationUtils.invokeAndWait(new Callable<AccessibleIcon[]>() {
+                                        @Override
+                                        public AccessibleIcon[] call() throws Exception {
+                                            return acTableCell.getAccessibleIcon();
+                                        }
+                                    }, ac);
+                                    if ( (null != aiRet) && (aiRet.length > 0) ) {
+                                        String iconDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
+                                            public String call() {
+                                                return aiRet[0].getAccessibleIconDescription ();
+                                            }
+                                        }, ac);
+                                        if (iconDescription != null){
+                                            debugString ("bk -- The Virtual Accessible Name was obtained from the description of the first Accessible Icon found in the Table Cell object.");
+                                            references.increment (iconDescription);
+                                            return iconDescription;
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                } else if ( (AccessibleRole.TOGGLE_BUTTON == role) ||
+                            (AccessibleRole.PUSH_BUTTON == role) ) {
+                    /*
+                    Does the button support the Accessible Icon Interface?
+                    */
+                    debugString ("bk -- Attempting to obtain the Virtual Accessible Name from the Accessible Icon information.");
+                    final AccessibleIcon [] ai = InvocationUtils.invokeAndWait(new Callable<AccessibleIcon []>() {
+                        public AccessibleIcon [] call() {
+                            return ac.getAccessibleIcon ();
+                        }
+                    }, ac);
+                    if ( (null != ai) && (ai.length > 0) ) {
+                        String iconDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
+                            public String call() {
+                                return ai[0].getAccessibleIconDescription ();
+                            }
+                        }, ac);
+                        if (iconDescription != null){
+                            debugString ("bk -- The Virtual Accessible Name was obtained from the description of the first Accessible Icon found in the TOGGLE_BUTTON or PUSH_BUTTON object.");
+                            references.increment (iconDescription);
+                            return iconDescription;
+                        }
+                    }
+                } else if ( AccessibleRole.CHECK_BOX == role ) {
+                    /*
+                    NOTE: The only case I know of in which a check box does not
+                    have a name is when that check box is contained in a table.
+
+                    In this case it would be appropriate to use the display string
+                    of the check box object as the name (in US English the display
+                    string is typically either "true" or "false").
+
+                    I am using the AccessibleValue interface to obtain the display
+                    string of the check box.  If the Accessible Value is 1, I am
+                    returning Boolean.TRUE.toString (),  If the Accessible Value is
+                    0, I am returning Boolean.FALSE.toString ().  If the Accessible
+                    Value is some other number, I will return the display string of
+                    the current numerical value of the check box.
+                    */
+                    final AccessibleValue av = InvocationUtils.invokeAndWait(new Callable<AccessibleValue>() {
+                        @Override
+                        public AccessibleValue call() throws Exception {
+                            return ac.getAccessibleValue();
+                        }
+                    }, ac);
+                    if ( null != av ) {
+                        nameString = null;
+                        Number value = InvocationUtils.invokeAndWait(new Callable<Number>() {
+                            @Override
+                            public Number call() throws Exception {
+                                return av.getCurrentAccessibleValue();
+                            }
+                        }, ac);
+                        if ( null != value ) {
+                            if ( 1 == value.intValue () ) {
+                                nameString = Boolean.TRUE.toString ();
+                            } else if ( 0 == value.intValue () ) {
+                                nameString = Boolean.FALSE.toString ();
+                            } else {
+                                nameString = value.toString ();
+                            }
+                            if ( null != nameString ) {
+                                references.increment (nameString);
+                                return nameString;
+                            }
+                        }
+                    }
+                }
+                return null;
+            }
+
+            /*
+            +
+            Beginning of the extended name search
+            +
+            */
+            final AccessibleContext parentContextOuterTemp = parentContext;
+            String parentName = InvocationUtils.invokeAndWait(new Callable<String>() {
+                @Override
+                public String call() throws Exception {
+                    return parentContextOuterTemp.getAccessibleName();
+                }
+            }, ac);
+            String parentDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
+                @Override
+                public String call() throws Exception {
+                    return parentContextOuterTemp.getAccessibleDescription();
+                }
+            }, ac);
+
+            /*
+            Step 4:
+            =======
+            Special case for Slider Bar objects.
+            */
+            if ( (AccessibleRole.SLIDER == role) &&
+                 (AccessibleRole.PANEL == parentRole) &&
+                 (null != parentName) ) {
+                debugString ("bk -- The Virtual Accessible Name was obtained from the Accessible Name of the SLIDER object's parent object.");
+                references.increment (parentName);
+                return parentName;
+            }
+
+            boolean bIsEditCombo = false;
+
+            AccessibleContext testContext = ac;
+            /*
+            Step 5:
+            =======
+            Special case for Edit Combo Boxes
+            */
+            if ( (AccessibleRole.TEXT == role) &&
+                 (AccessibleRole.COMBO_BOX == parentRole) ) {
+                bIsEditCombo = true;
+                if (null != parentName) {
+                    debugString ("bk -- The Virtual Accessible Name for this Edit Combo box was obtained from the Accessible Name of the object's parent object.");
+                    references.increment (parentName);
+                    return parentName;
+                } else if (null != parentDescription) {
+                    debugString ("bk -- The Virtual Accessible Name for this Edit Combo box was obtained from the Accessible Description of the object's parent object.");
+                    references.increment (parentDescription);
+                    return parentDescription;
+                }
+                testContext = parentContext;
+                parentRole = AccessibleRole.UNKNOWN;
+                parentContext = getAccessibleParentFromContext (testContext);
+                if ( null != parentContext ) {
+                    final AccessibleContext parentContextInnerTemp = parentContext;
+                    parentRole = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
+                        @Override
+                        public AccessibleRole call() throws Exception {
+                            return parentContextInnerTemp.getAccessibleRole();
+                        }
+                    }, ac);
+                }
+            }
+
+            /*
+            Step 6:
+            =======
+            Attempt to get the Virtual Accessible Name of the object using the
+            Accessible Relation Set Info (the LABELED_BY Accessible Relation).
+            */
+            String version = getJavaVersionProperty ();
+            if ( (null != version) && (version.compareTo ("1.3") >= 0) ) {
+                final AccessibleContext parentContextTempInner = parentContext;
+                AccessibleRelationSet ars = InvocationUtils.invokeAndWait(new Callable<AccessibleRelationSet>() {
+                    @Override
+                    public AccessibleRelationSet call() throws Exception {
+                        return parentContextTempInner.getAccessibleRelationSet();
+                    }
+                }, ac);
+                if ( ars != null && (ars.size () > 0) && (ars.contains (AccessibleRelation.LABELED_BY)) ) {
+                    AccessibleRelation labeledByRelation = ars.get (AccessibleRelation.LABELED_BY);
+                    if (labeledByRelation != null) {
+                        Object [] targets = labeledByRelation.getTarget ();
+                        Object o = targets [0];
+                        if (o instanceof Accessible) {
+                            AccessibleContext labelContext = ((Accessible)o).getAccessibleContext ();
+                            if (labelContext != null) {
+                                String labelName = labelContext.getAccessibleName ();
+                                String labelDescription = labelContext.getAccessibleDescription ();
+                                if (null != labelName) {
+                                    debugString ("bk -- The Virtual Accessible Name was obtained using the LABELED_BY AccessibleRelation -- Name Case.");
+                                    references.increment (labelName);
+                                    return labelName;
+                                } else if (null != labelDescription) {
+                                    debugString ("bk -- The Virtual Accessible Name was obtained using the LABELED_BY AccessibleRelation -- Description Case.");
+                                    references.increment (labelDescription);
+                                    return labelDescription;
+                                }
+                            }
+                        }
+                    }
+                }
+            } else {
+                debugString ("bk -- This version of Java does not support AccessibleContext::getAccessibleRelationSet.");
+            }
+
+            //Note: add AccessibleContext to use InvocationUtils.invokeAndWait
+            /*
+            Step 7:
+            =======
+            Search for a label object that is positioned either just to the left
+            or just above the object and get the Accessible Name of the Label
+            object.
+            */
+            int testIndexMax = 0;
+            int testX = 0;
+            int testY = 0;
+            int testWidth = 0;
+            int testHeight = 0;
+            int targetX = 0;
+            int targetY = 0;
+            final AccessibleContext tempContext = testContext;
+            int testIndex = InvocationUtils.invokeAndWait(new Callable<Integer>() {
+                @Override
+                public Integer call() throws Exception {
+                    return tempContext.getAccessibleIndexInParent();
+                }
+            }, ac);
+            if ( null != parentContext ) {
+                final AccessibleContext parentContextInnerTemp = parentContext;
+                testIndexMax =  InvocationUtils.invokeAndWait(new Callable<Integer>() {
+                    @Override
+                    public Integer call() throws Exception {
+                        return parentContextInnerTemp.getAccessibleChildrenCount() - 1;
+                    }
+                }, ac);
+            }
+            testX = getAccessibleXcoordFromContext (testContext);
+            testY = getAccessibleYcoordFromContext (testContext);
+            testWidth = getAccessibleWidthFromContext (testContext);
+            testHeight = getAccessibleHeightFromContext (testContext);
+            targetX = testX + 2;
+            targetY = testY + 2;
+
+            int childIndex = testIndex - 1;
+            /*Accessible child = null;
+            AccessibleContext childContext = null;
+            AccessibleRole childRole = AccessibleRole.UNKNOWN;*/
+            int childX = 0;
+            int childY = 0;
+            int childWidth = 0;
+            int childHeight = 0;
+            String childName = null;
+            String childDescription = null;
+            while (childIndex >= 0) {
+                final int childIndexTemp = childIndex;
+                final AccessibleContext parentContextInnerTemp = parentContext;
+                final Accessible child  =  InvocationUtils.invokeAndWait(new Callable<Accessible>() {
+                    @Override
+                    public Accessible call() throws Exception {
+                        return parentContextInnerTemp.getAccessibleChild(childIndexTemp);
+                    }
+                }, ac);
+                if ( null != child ) {
+                    final AccessibleContext childContext = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+                        @Override
+                        public AccessibleContext call() throws Exception {
+                            return child.getAccessibleContext();
+                        }
+                    }, ac);
+                    if ( null != childContext ) {
+                        AccessibleRole childRole = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
+                            @Override
+                            public AccessibleRole call() throws Exception {
+                                return childContext.getAccessibleRole();
+                            }
+                        }, ac);
+                        if ( AccessibleRole.LABEL == childRole ) {
+                            childX = getAccessibleXcoordFromContext (childContext);
+                            childY = getAccessibleYcoordFromContext (childContext);
+                            childWidth = getAccessibleWidthFromContext (childContext);
+                            childHeight = getAccessibleHeightFromContext (childContext);
+                            if ( (childX < testX) &&
+                                 ((childY <= targetY) && (targetY <= (childY + childHeight))) ) {
+                                childName = InvocationUtils.invokeAndWait(new Callable<String>() {
+                                    public String call() {
+                                        return childContext.getAccessibleName ();
+                                    }
+                                }, ac);
+                                if ( null != childName ) {
+                                    debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Name of a LABEL object positioned to the left of the object.");
+                                    references.increment (childName);
+                                    return childName;
+                                }
+                                childDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
+                                    public String call() {
+                                        return childContext.getAccessibleDescription ();
+                                    }
+                                }, ac);
+                                if ( null != childDescription ) {
+                                    debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Description of a LABEL object positioned to the left of the object.");
+                                    references.increment (childDescription);
+                                    return childDescription;
+                                }
+                            } else if ( (childY < targetY) &&
+                                        ((childX <= targetX) && (targetX <= (childX + childWidth))) ) {
+                                childName = InvocationUtils.invokeAndWait(new Callable<String>() {
+                                    public String call() {
+                                        return childContext.getAccessibleName ();
+                                    }
+                                }, ac);
+                                if ( null != childName ) {
+                                    debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Name of a LABEL object positioned above the object.");
+                                    references.increment (childName);
+                                    return childName;
+                                }
+                                childDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
+                                    public String call() {
+                                        return childContext.getAccessibleDescription ();
+                                    }
+                                }, ac);
+                                if ( null != childDescription ) {
+                                    debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Description of a LABEL object positioned above the object.");
+                                    references.increment (childDescription);
+                                    return childDescription;
+                                }
+                            }
+                        }
+                    }
+                }
+                childIndex --;
+            }
+            childIndex = testIndex + 1;
+            while (childIndex <= testIndexMax) {
+                final int childIndexTemp = childIndex;
+                final AccessibleContext parentContextInnerTemp = parentContext;
+                final Accessible child  =  InvocationUtils.invokeAndWait(new Callable<Accessible>() {
+                    @Override
+                    public Accessible call() throws Exception {
+                        return parentContextInnerTemp.getAccessibleChild(childIndexTemp);
+                    }
+                }, ac);
+                if ( null != child ) {
+                    final AccessibleContext childContext = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+                        @Override
+                        public AccessibleContext call() throws Exception {
+                            return child.getAccessibleContext();
+                        }
+                    }, ac);
+                    if ( null != childContext ) {
+                        AccessibleRole childRole = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
+                            @Override
+                            public AccessibleRole call() throws Exception {
+                                return childContext.getAccessibleRole();
+                            }
+                        }, ac);
+                        if ( AccessibleRole.LABEL == childRole ) {
+                            childX = getAccessibleXcoordFromContext (childContext);
+                            childY = getAccessibleYcoordFromContext (childContext);
+                            childWidth = getAccessibleWidthFromContext (childContext);
+                            childHeight = getAccessibleHeightFromContext (childContext);
+                            if ( (childX < testX) &&
+                                 ((childY <= targetY) && (targetY <= (childY + childHeight))) ) {
+                                childName = InvocationUtils.invokeAndWait(new Callable<String>() {
+                                    public String call() {
+                                        return childContext.getAccessibleName ();
+                                    }
+                                }, ac);
+                                if ( null != childName ) {
+                                    debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Name of a LABEL object positioned to the left of the object.");
+                                    references.increment (childName);
+                                    return childName;
+                                }
+                                childDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
+                                    public String call() {
+                                        return childContext.getAccessibleDescription ();
+                                    }
+                                }, ac);
+                                if ( null != childDescription ) {
+                                    debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Description of a LABEL object positioned to the left of the object.");
+                                    references.increment (childDescription);
+                                    return childDescription;
+                                }
+                            } else if ( (childY < targetY) &&
+                                        ((childX <= targetX) && (targetX <= (childX + childWidth))) ) {
+                                childName = InvocationUtils.invokeAndWait(new Callable<String>() {
+                                    public String call() {
+                                        return childContext.getAccessibleName ();
+                                    }
+                                }, ac);
+                                if ( null != childName ) {
+                                    debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Name of a LABEL object positioned above the object.");
+                                    references.increment (childName);
+                                    return childName;
+                                }
+                                childDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
+                                    public String call() {
+                                        return childContext.getAccessibleDescription ();
+                                    }
+                                }, ac);
+                                if ( null != childDescription ) {
+                                    debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Description of a LABEL object positioned above the object.");
+                                    references.increment (childDescription);
+                                    return childDescription;
+                                }
+                            }
+                        }
+                    }
+                }
+                childIndex ++;
+            }
+            /*
+            Step 8:
+            =======
+            Special case for combo boxes and text objects, based on a
+            similar special case I found in some of our internal JAWS code.
+
+            Search for a button object that is positioned either just to the left
+            or just above the object and get the Accessible Name of the button
+            object.
+            */
+            if ( (AccessibleRole.TEXT == role) ||
+                 (AccessibleRole.COMBO_BOX == role) ||
+                 (bIsEditCombo) ) {
+                childIndex = testIndex - 1;
+                while (childIndex >= 0) {
+                    final int childIndexTemp = childIndex;
+                    final AccessibleContext parentContextInnerTemp = parentContext;
+                    final Accessible child = InvocationUtils.invokeAndWait(new Callable<Accessible>() {
+                        @Override
+                        public Accessible call() throws Exception {
+                            return parentContextInnerTemp.getAccessibleChild(childIndexTemp);
+                        }
+                    }, ac);
+                    if ( null != child ) {
+                        final AccessibleContext childContext = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+                            @Override
+                            public AccessibleContext call() throws Exception {
+                                return child.getAccessibleContext();
+                            }
+                        }, ac);
+                        if ( null != childContext ) {
+                            AccessibleRole childRole = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
+                                @Override
+                                public AccessibleRole call() throws Exception {
+                                    return childContext.getAccessibleRole();
+                                }
+                            }, ac);
+                            if ( ( AccessibleRole.PUSH_BUTTON == childRole ) ||
+                                 ( AccessibleRole.TOGGLE_BUTTON == childRole )) {
+                                childX = getAccessibleXcoordFromContext (childContext);
+                                childY = getAccessibleYcoordFromContext (childContext);
+                                childWidth = getAccessibleWidthFromContext (childContext);
+                                childHeight = getAccessibleHeightFromContext (childContext);
+                                if ( (childX < testX) &&
+                                     ((childY <= targetY) && (targetY <= (childY + childHeight))) ) {
+                                    childName = InvocationUtils.invokeAndWait(new Callable<String>() {
+                                        public String call() {
+                                            return childContext.getAccessibleName ();
+                                        }
+                                    }, ac);
+                                    if ( null != childName ) {
+                                        debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Name of a PUSH_BUTTON or TOGGLE_BUTTON object positioned to the left of the object.");
+                                        references.increment (childName);
+                                        return childName;
+                                    }
+                                    childDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
+                                        public String call() {
+                                            return childContext.getAccessibleDescription ();
+                                        }
+                                    }, ac);
+                                    if ( null != childDescription ) {
+                                        debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Description of a PUSH_BUTTON or TOGGLE_BUTTON object positioned to the left of the object.");
+                                        references.increment (childDescription);
+                                        return childDescription;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    childIndex --;
+                }
+                childIndex = testIndex + 1;
+                while (childIndex <= testIndexMax) {
+                    final int childIndexTemp = childIndex;
+                    final AccessibleContext parentContextInnerTemp = parentContext;
+                    final Accessible child  =  InvocationUtils.invokeAndWait(new Callable<Accessible>() {
+                        @Override
+                        public Accessible call() throws Exception {
+                            return parentContextInnerTemp.getAccessibleChild(childIndexTemp);
+                        }
+                    }, ac);
+                    if ( null != child ) {
+                        final AccessibleContext childContext = InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+                            @Override
+                            public AccessibleContext call() throws Exception {
+                                return child.getAccessibleContext();
+                            }
+                        }, ac);
+                        if ( null != childContext ) {
+                            AccessibleRole childRole = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
+                                @Override
+                                public AccessibleRole call() throws Exception {
+                                    return childContext.getAccessibleRole();
+                                }
+                            }, ac);
+                            if ( ( AccessibleRole.PUSH_BUTTON == childRole ) ||
+                                    ( AccessibleRole.TOGGLE_BUTTON == childRole ) ) {
+                                childX = getAccessibleXcoordFromContext (childContext);
+                                childY = getAccessibleYcoordFromContext (childContext);
+                                childWidth = getAccessibleWidthFromContext (childContext);
+                                childHeight = getAccessibleHeightFromContext (childContext);
+                                if ( (childX < testX) &&
+                                     ((childY <= targetY) && (targetY <= (childY + childHeight))) ) {
+                                    childName = InvocationUtils.invokeAndWait(new Callable<String>() {
+                                        public String call() {
+                                            return childContext.getAccessibleName();
+                                        }
+                                    }, ac);
+                                    if ( null != childName ) {
+                                        debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Name of a PUSH_BUTTON or TOGGLE_BUTTON object positioned to the left of the object.");
+                                        references.increment (childName);
+                                        return childName;
+                                    }
+                                    childDescription = InvocationUtils.invokeAndWait(new Callable<String>() {
+                                        public String call() {
+                                            return childContext.getAccessibleDescription ();
+                                        }
+                                    }, ac);
+                                    if ( null != childDescription ) {
+                                        debugString ("bk -- The Virtual Accessible Name was obtained from Accessible Description of a PUSH_BUTTON or TOGGLE_BUTTON object positioned to the left of the object.");
+                                        references.increment (childDescription);
+                                        return childDescription;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    childIndex ++;
+                }
+            }
+            return null;
+        } else {
+            debugString ("AccessBridge::getVirtualAccessibleNameFromContext error - ac == null.");
+            return null;
+        }
+    }
+
+    /**
+     * returns the AccessibleDescription from an AccessibleContext
+     */
+    private String getAccessibleDescriptionFromContext(final AccessibleContext ac) {
+        if (ac != null) {
+            String s = InvocationUtils.invokeAndWait(new Callable<String>() {
+                @Override
+                public String call() throws Exception {
+                    return ac.getAccessibleDescription();
+                }
+            }, ac);
+            if (s != null) {
+                references.increment(s);
+                debugString("Returning AccessibleDescription from Context: " + s);
+                return s;
+            }
+        } else {
+            debugString("getAccessibleDescriptionFromContext; ac = null");
+        }
+        return null;
+    }
+
+    /**
+     * returns the AccessibleRole from an AccessibleContext
+     */
+    private String getAccessibleRoleStringFromContext(final AccessibleContext ac) {
+        if (ac != null) {
+            AccessibleRole role = InvocationUtils.invokeAndWait(new Callable<AccessibleRole>() {
+                @Override
+                public AccessibleRole call() throws Exception {
+                    return ac.getAccessibleRole();
+                }
+            }, ac);
+            if (role != null) {
+                String s = role.toDisplayString(Locale.US);
+                if (s != null) {
+                    references.increment(s);
+                    debugString("Returning AccessibleRole from Context: " + s);
+                    return s;
+                }
+            }
+        } else {
+            debugString("getAccessibleRoleStringFromContext; ac = null");
+        }
+        return null;
+    }
+
+    /**
+     * return the AccessibleRole from an AccessibleContext in the en_US locale
+     */
+    private String getAccessibleRoleStringFromContext_en_US(final AccessibleContext ac) {
+        return getAccessibleRoleStringFromContext(ac);
+    }
+
+    /**
+     * return the AccessibleStates from an AccessibleContext
+     */
+    private String getAccessibleStatesStringFromContext(final AccessibleContext ac) {
+        if (ac != null) {
+            AccessibleStateSet stateSet = InvocationUtils.invokeAndWait(new Callable<AccessibleStateSet>() {
+                @Override
+                public AccessibleStateSet call() throws Exception {
+                    return ac.getAccessibleStateSet();
+                }
+            }, ac);
+            if (stateSet != null) {
+                String s = stateSet.toString();
+                if (s != null &&
+                    s.indexOf(AccessibleState.MANAGES_DESCENDANTS.toDisplayString(Locale.US)) == -1) {
+                    // Indicate whether this component manages its own
+                    // children
+                    AccessibleRole role = ac.getAccessibleRole();
+                    if (role == AccessibleRole.LIST ||
+                        role == AccessibleRole.TABLE ||
+                        role == AccessibleRole.TREE) {
+                        s += ",";
+                        s += AccessibleState.MANAGES_DESCENDANTS.toDisplayString(Locale.US);
+                    }
+                    references.increment(s);
+                    debugString("Returning AccessibleStateSet from Context: " + s);
+                    return s;
+                }
+            }
+        } else {
+            debugString("getAccessibleStatesStringFromContext; ac = null");
+        }
+        return null;
+    }
+
+    /**
+     * returns the AccessibleStates from an AccessibleContext in the en_US locale
+     */
+    private String getAccessibleStatesStringFromContext_en_US(final AccessibleContext ac) {
+        if (ac != null) {
+            AccessibleStateSet stateSet = InvocationUtils.invokeAndWait(new Callable<AccessibleStateSet>() {
+                @Override
+                public AccessibleStateSet call() throws Exception {
+                    return ac.getAccessibleStateSet();
+                }
+            }, ac);
+            if (stateSet != null) {
+                String s = "";
+                AccessibleState[] states = stateSet.toArray();
+                if (states != null && states.length > 0) {
+                    s = states[0].toDisplayString(Locale.US);
+                    for (int i = 1; i < states.length; i++) {
+                        s = s + "," + states[i].toDisplayString(Locale.US);
+                    }
+                }
+                references.increment(s);
+                debugString("Returning AccessibleStateSet en_US from Context: " + s);
+                return s;
+            }
+        }
+        debugString("getAccessibleStatesStringFromContext; ac = null");
+        return null;
+    }
+
+    /**
+     * returns the AccessibleParent from an AccessibleContext
+     */
+    private AccessibleContext getAccessibleParentFromContext(final AccessibleContext ac) {
+        if (ac==null)
+            return null;
+        return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+            @Override
+            public AccessibleContext call() throws Exception {
+                Accessible a = ac.getAccessibleParent();
+                if (a != null) {
+                    AccessibleContext apc = a.getAccessibleContext();
+                    if (apc != null) {
+                        return apc;
+                    }
+                }
+                return null;
+            }
+        }, ac);
+    }
+
+    /**
+     * returns the AccessibleIndexInParent from an AccessibleContext
+     */
+    private int getAccessibleIndexInParentFromContext(final AccessibleContext ac) {
+        if (ac==null)
+            return -1;
+        return InvocationUtils.invokeAndWait(new Callable<Integer>() {
+            @Override
+            public Integer call() throws Exception {
+                return ac.getAccessibleIndexInParent();
+            }
+        }, ac);
+    }
+
+    /**
+     * returns the AccessibleChild count from an AccessibleContext
+     */
+    private int getAccessibleChildrenCountFromContext(final AccessibleContext ac) {
+        if (ac==null)
+            return -1;
+        return InvocationUtils.invokeAndWait(new Callable<Integer>() {
+            @Override
+            public Integer call() throws Exception {
+                return ac.getAccessibleChildrenCount();
+            }
+        }, ac);
+    }
+
+    /**
+     * returns the AccessibleChild Context from an AccessibleContext
+     */
+    private AccessibleContext getAccessibleChildFromContext(final AccessibleContext ac, final int index) {
+
+        if (ac == null) {
+            return null;
+        }
+
+        final JTable table = InvocationUtils.invokeAndWait(new Callable<JTable>() {
+            @Override
+            public JTable call() throws Exception {
+                // work-around for AccessibleJTable.getCurrentAccessibleContext returning
+                // wrong renderer component when cell contains more than one component
+                Accessible parent = ac.getAccessibleParent();
+                if (parent != null) {
+                    int indexInParent = ac.getAccessibleIndexInParent();
+                    Accessible child =
+                            parent.getAccessibleContext().getAccessibleChild(indexInParent);
+                    if (child instanceof JTable) {
+                        return (JTable) child;
+                    }
+                }
+                return null;
+            }
+        }, ac);
+
+        if (table == null) {
+            return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+                @Override
+                public AccessibleContext call() throws Exception {
+                    Accessible a = ac.getAccessibleChild(index);
+                    if (a != null) {
+                        return a.getAccessibleContext();
+                    }
+                    return null;
+                }
+            }, ac);
+        }
+
+        final AccessibleTable at = getAccessibleTableFromContext(ac);
+
+        final int row = getAccessibleTableRow(at, index);
+        final int column = getAccessibleTableColumn(at, index);
+
+        return InvocationUtils.invokeAndWait(new Callable<AccessibleContext>() {
+            @Override
+            public AccessibleContext call() throws Exception {
+                TableCellRenderer renderer = table.getCellRenderer(row, column);
+                if (renderer == null) {
+                    Class<?> columnClass = table.getColumnClass(column);
+                    renderer = table.getDefaultRenderer(columnClass);
+                }
+                Component component =
+                        renderer.getTableCellRendererComponent(table, table.getValueAt(row, column),
+                                false, false, row, column);
+                if (component instanceof Accessible) {
+                    return component.getAccessibleContext();
+                }
+                return null;
+            }
+        }, ac);
+    }
+
+    /**
+     * returns the AccessibleComponent bounds on screen from an AccessibleContext
+     */
+    private Rectangle getAccessibleBoundsOnScreenFromContext(final AccessibleContext ac) {
+        if(ac==null)
+            return null;
+        return InvocationUtils.invokeAndWait(new Callable<Rectangle>() {
+            @Override
+            public Rectangle call() throws Exception {
+                AccessibleComponent acmp = ac.getAccessibleComponent();
+                if (acmp != null) {
+                    Rectangle r = acmp.getBounds();
+                    if (r != null) {
+                        try {
+                            Point p = acmp.getLocationOnScreen();
+                            if (p != null) {
+                                r.x = p.x;
+                                r.y = p.y;
+                                return r;
+                            }
+                        } catch (Exception e) {
+                            return null;
+                        }
+                    }
+                }
+                return null;
+            }
+        }, ac);
+    }
+
+    /**
+     * returns the AccessibleComponent x-coord from an AccessibleContext
+     */
+    private int getAccessibleXcoordFromContext(AccessibleContext ac) {
+        if (ac != null) {
+            Rectangle r = getAccessibleBoundsOnScreenFromContext(ac);
+            if (r != null) {
+                debugString(" - Returning Accessible x coord from Context: " + r.x);
+                return r.x;
+            }
+        } else {
+            debugString("getAccessibleXcoordFromContext ac = null");
+        }
+        return -1;
+    }
+
+    /**
+     * returns the AccessibleComponent y-coord from an AccessibleContext
+     */
+    private int getAccessibleYcoordFromContext(AccessibleContext ac) {
+        debugString("getAccessibleYcoordFromContext() called");
+        if (ac != null) {
+            Rectangle r = getAccessibleBoundsOnScreenFromContext(ac);
+            if (r != null) {
+                return r.y;
+            }
+        } else {
+        debugString("getAccessibleYcoordFromContext; ac = null");
+        }
+        return -1;
+    }
+
+    /**
+     * returns the AccessibleComponent height from an AccessibleContext
+     */
+    private int getAccessibleHeightFromContext(AccessibleContext ac) {
+        if (ac != null) {
+            Rectangle r = getAccessibleBoundsOnScreenFromContext(ac);
+            if (r != null) {
+                return r.height;
+            }
+        } else {
+            debugString("getAccessibleHeightFromContext; ac = null");
+        }
+        return -1;
+    }
+
+    /**
+     * returns the AccessibleComponent width from an AccessibleContext
+     */
+    private int getAccessibleWidthFromContext(AccessibleContext ac) {
+        if (ac != null) {
+            Rectangle r = getAccessibleBoundsOnScreenFromContext(ac);
+            if (r != null) {
+                return r.width;
+            }
+        } else {
+            debugString("getAccessibleWidthFromContext; ac = null");
+        }
+        return -1;
+    }
+
+
+    /**
+     * returns the AccessibleComponent from an AccessibleContext
+     */
+    private AccessibleComponent getAccessibleComponentFromContext(AccessibleContext ac) {
+        if (ac != null) {
+            AccessibleComponent acmp = ac.getAccessibleComponent();
+            if (acmp != null) {
+                debugString("Returning AccessibleComponent Context");
+                return acmp;
+            }
+        } else {
+            debugString("getAccessibleComponentFromContext; ac = null");
+        }
+        return null;
+    }
+
+    /**
+     * returns the AccessibleAction from an AccessibleContext
+     */
+    private AccessibleAction getAccessibleActionFromContext(final AccessibleContext ac) {
+        debugString("Returning AccessibleAction Context");
+        return ac == null ? null : InvocationUtils.invokeAndWait(new Callable<AccessibleAction>() {
+            @Override
+            public AccessibleAction call() throws Exception {
+                return ac.getAccessibleAction();
+            }
+        }, ac);
+    }
+
+    /**
+     * returns the AccessibleSelection from an AccessibleContext
+     */
+    private AccessibleSelection getAccessibleSelectionFromContext(final AccessibleContext ac) {
+        return ac == null ? null : InvocationUtils.invokeAndWait(new Callable<AccessibleSelection>() {
+            @Override
+            public AccessibleSelection call() throws Exception {
+                return ac.getAccessibleSelection();
+            }
+        }, ac);
+    }
+
+    /**
+     * return the AccessibleText from an AccessibleContext
+     */
+    private AccessibleText getAccessibleTextFromContext(final AccessibleContext ac) {
+        return ac == null ? null : InvocationUtils.invokeAndWait(new Callable<AccessibleText>() {
+            @Override
+            public AccessibleText call() throws Exception {
+                return ac.getAccessibleText();
+            }
+        }, ac);
+    }
+
+    /**
+     * return the AccessibleComponent from an AccessibleContext
+     */
+    private AccessibleValue getAccessibleValueFromContext(final AccessibleContext ac) {
+        return ac == null ? null : InvocationUtils.invokeAndWait(new Callable<AccessibleValue>() {
+            @Override
+            public AccessibleValue call() throws Exception {
+                return ac.getAccessibleValue();
+            }
+        }, ac);
+    }
+
+    /* ===== AccessibleText methods ===== */
+
+    /**
+     * returns the bounding rectangle for the text cursor
+     * XXX
+     */
+    private Rectangle getCaretLocation(final AccessibleContext ac) {
+    debugString("getCaretLocation");
+        if (ac==null)
+            return null;
+        return InvocationUtils.invokeAndWait(new Callable<Rectangle>() {
+            @Override
+            public Rectangle call() throws Exception {
+                // workaround for JAAPI not returning cursor bounding rectangle
+                Rectangle r = null;
+                Accessible parent = ac.getAccessibleParent();
+                if (parent instanceof Accessible) {
+                    int indexInParent = ac.getAccessibleIndexInParent();
+                    Accessible child =
+                            parent.getAccessibleContext().getAccessibleChild(indexInParent);
+
+                    if (child instanceof JTextComponent) {
+                        JTextComponent text = (JTextComponent) child;
+                        try {
+                            r = text.modelToView(text.getCaretPosition());
+                            if (r != null) {
+                                Point p = text.getLocationOnScreen();
+                                r.translate(p.x, p.y);
+                            }
+                        } catch (BadLocationException ble) {
+                        }
+                    }
+                }
+                return r;
+            }
+        }, ac);
+    }
+
+    /**
+     * returns the x-coordinate for the text cursor rectangle
+     */
+    private int getCaretLocationX(AccessibleContext ac) {
+        Rectangle r = getCaretLocation(ac);
+        if (r != null) {
+            return r.x;
+        } else {
+            return -1;
+        }
+    }
+
+    /**
+     * returns the y-coordinate for the text cursor rectangle
+     */
+    private int getCaretLocationY(AccessibleContext ac) {
+        Rectangle r = getCaretLocation(ac);
+        if (r != null) {
+            return r.y;
+        } else {
+            return -1;
+        }
+    }
+
+    /**
+     * returns the height for the text cursor rectangle
+     */
+    private int getCaretLocationHeight(AccessibleContext ac) {
+        Rectangle r = getCaretLocation(ac);
+        if (r != null) {
+            return r.height;
+        } else {
+            return -1;
+        }
+    }
+
+    /**
+     * returns the width for the text cursor rectangle
+     */
+    private int getCaretLocationWidth(AccessibleContext ac) {
+        Rectangle r = getCaretLocation(ac);
+        if (r != null) {
+            return r.width;
+        } else {
+            return -1;
+        }
+    }
+
+    /**
+     * returns the character count from an AccessibleContext
+     */
+    private int getAccessibleCharCountFromContext(final AccessibleContext ac) {
+        if (ac==null)
+            return -1;
+        return InvocationUtils.invokeAndWait(new Callable<Integer>() {
+            @Override
+            public Integer call() throws Exception {
+                AccessibleText at = ac.getAccessibleText();
+                if (at != null) {
+                    return at.getCharCount();
+                }
+                return -1;
+            }
+        }, ac);
+    }
+
+    /**
+     * returns the caret position from an AccessibleContext
+     */
+    private int getAccessibleCaretPositionFromContext(final AccessibleContext ac) {
+        if (ac==null)
+            return -1;
+        return InvocationUtils.invokeAndWait(new Callable<Integer>() {
+            @Override
+            public Integer call() throws Exception {
+                AccessibleText at = ac.getAccessibleText();
+                if (at != null) {
+                    return at.getCaretPosition();
+                }
+                return -1;
+            }
+        }, ac);
+    }
+
+    /**
+     * Return the index at a specific point from an AccessibleContext
+     * Point(x, y) is in screen coordinates.
+     */
+    private int getAccessibleIndexAtPointFromContext(final AccessibleContext ac,
+                                                    final int x, final int y) {
+        debugString("getAccessibleIndexAtPointFromContext: x = "+x+"; y = "+y);
+        if (ac==null)
+            return -1;
+        return InvocationUtils.invokeAndWait(new Callable<Integer>() {
+            @Override
+            public Integer call() throws Exception {
+                AccessibleText at = ac.getAccessibleText();
+                AccessibleComponent acomp = ac.getAccessibleComponent();
+                if (at != null && acomp != null) {
+                    // Convert x and y from screen coordinates to
+                    // local coordinates.
+                    try {
+                        Point p = acomp.getLocationOnScreen();
+                        int x1, y1;
+                        if (p != null) {
+                            x1 = x - p.x;
+                            if (x1 < 0) {
+                                x1 = 0;
+                            }
+                            y1 = y - p.y;
+                            if (y1 < 0) {
+                                y1 = 0;
+                            }
+
+                            Point newPoint = new Point(x1, y1);
+                            int indexAtPoint = at.getIndexAtPoint(new Point(x1, y1));
+                            return indexAtPoint;
+                        }
+                    } catch (Exception e) {
+                    }
+                }
+                return -1;
+            }
+        }, ac);
+    }
+
+    /**
+     * return the letter at a specific point from an AccessibleContext
+     */
+    private String getAccessibleLetterAtIndexFromContext(final AccessibleContext ac, final int index) {
+        if (ac != null) {
+            String s = InvocationUtils.invokeAndWait(new Callable<String>() {
+                @Override
+                public String call() throws Exception {
+                    AccessibleText at = ac.getAccessibleText();
+                    if (at == null) return null;
+                    return at.getAtIndex(AccessibleText.CHARACTER, index);
+                }
+            }, ac);
+            if (s != null) {
+                references.increment(s);
+                return s;
+            }
+        } else {
+            debugString("getAccessibleLetterAtIndexFromContext; ac = null");
+        }
+        return null;
+    }
+
+    /**
+     * return the word at a specific point from an AccessibleContext
+     */
+    private String getAccessibleWordAtIndexFromContext(final AccessibleContext ac, final int index) {
+        if (ac != null) {
+            String s = InvocationUtils.invokeAndWait(new Callable<String>() {
+                @Override
+                public String call() throws Exception {
+                    AccessibleText at = ac.getAccessibleText();
+                    if (at == null) return null;
+                    return at.getAtIndex(AccessibleText.WORD, index);
+                }
+            }, ac);
+            if (s != null) {
+                references.increment(s);
+                return s;
+            }
+        } else {
+            debugString("getAccessibleWordAtIndexFromContext; ac = null");
+        }
+        return null;
+    }
+
+    /**
+     * return the sentence at a specific point from an AccessibleContext
+     */
+    private String getAccessibleSentenceAtIndexFromContext(final AccessibleContext ac, final int index) {
+        if (ac != null) {
+            String s = InvocationUtils.invokeAndWait(new Callable<String>() {
+                @Override
+                public String call() throws Exception {
+                    AccessibleText at = ac.getAccessibleText();
+                    if (at == null) return null;
+                    return at.getAtIndex(AccessibleText.SENTENCE, index);
+                }
+            }, ac);
+            if (s != null) {
+                references.increment(s);
+                return s;
+            }
+        } else {
+            debugString("getAccessibleSentenceAtIndexFromContext; ac = null");
+        }
+        return null;
+    }
+
+    /**
+     * return the text selection start from an AccessibleContext
+     */
+    private int getAccessibleTextSelectionStartFromContext(final AccessibleContext ac) {
+        if (ac == null) return -1;
+        return InvocationUtils.invokeAndWait(new Callable<Integer>() {
+            @Override
+            public Integer call() throws Exception {
+                AccessibleText at = ac.getAccessibleText();
+                if (at != null) {
+                    return at.getSelectionStart();
+                }
+                return -1;
+            }
+        }, ac);
+    }
+
+    /**
+     * return the text selection end from an AccessibleContext
+     */
+    private int getAccessibleTextSelectionEndFromContext(final AccessibleContext ac) {
+        if (ac == null)
+            return -1;
+        return InvocationUtils.invokeAndWait(new Callable<Integer>() {
+            @Override
+            public Integer call() throws Exception {
+                AccessibleText at = ac.getAccessibleText();
+                if (at != null) {
+                    return at.getSelectionEnd();
+                }
+                return -1;
+            }
+        }, ac);
+    }
+
+    /**
+     * return the selected text from an AccessibleContext
+     */
+    private String getAccessibleTextSelectedTextFromContext(final AccessibleContext ac) {
+        if (ac != null) {
+            String s = InvocationUtils.invokeAndWait(new Callable<String>() {
+                @Override
+                public String call() throws Exception {
+                    AccessibleText at = ac.getAccessibleText();
+                    if (at == null) return null;
+                    return at.getSelectedText();
+                }
+            }, ac);
+            if (s != null) {
+                references.increment(s);
+                return s;
+            }
+        } else {
+            debugString("getAccessibleTextSelectedTextFromContext; ac = null");
+        }
+        return null;
+    }
+
+    /**
+     * return the attribute string at a given index from an AccessibleContext
+     */
+    private String getAccessibleAttributesAtIndexFromContext(final AccessibleContext ac,
+                                                             final int index) {
+        if (ac == null)
+            return null;
+        AttributeSet as = InvocationUtils.invokeAndWait(new Callable<AttributeSet>() {
+            @Override
+            public AttributeSet call() throws Exception {
+                AccessibleText at = ac.getAccessibleText();
+                if (at != null) {
+                    return at.getCharacterAttribute(index);
+                }
+                return null;
+            }
+        }, ac);
+        String s = expandStyleConstants(as);
+        if (s != null) {
+            references.increment(s);
+            return s;
+        }
+        return null;
+    }
+
+    /**
+     * Get line info: left index of line
+     *
+     * algorithm:  cast back, doubling each time,
+     *             'till find line boundaries
+     *
+     * return -1 if we can't get the info (e.g. index or at passed in
+     * is bogus; etc.)
+     */
+    private int getAccessibleTextLineLeftBoundsFromContext(final AccessibleContext ac,
+                                                          final int index) {
+        if (ac == null)
+            return -1;
+        return InvocationUtils.invokeAndWait(new Callable<Integer>() {
+            @Override
+            public Integer call() throws Exception {
+                AccessibleText at = ac.getAccessibleText();
+                if (at != null) {
+                    int lineStart;
+                    int offset;
+                    Rectangle charRect;
+                    Rectangle indexRect = at.getCharacterBounds(index);
+                    int textLen = at.getCharCount();
+                    if (indexRect == null) {
+                        return -1;
+                    }
+                    // find the start of the line
+                    //
+                    offset = 1;
+                    lineStart = index - offset < 0 ? 0 : index - offset;
+                    charRect = at.getCharacterBounds(lineStart);
+                    // slouch behind beginning of line
+                    while (charRect != null
+                            && charRect.y >= indexRect.y
+                            && lineStart > 0) {
+                        offset = offset << 1;
+                        lineStart = index - offset < 0 ? 0 : index - offset;
+                        charRect = at.getCharacterBounds(lineStart);
+                    }
+                    if (lineStart == 0) {    // special case: we're on the first line!
+                        // we found it!
+                    } else {
+                        offset = offset >> 1;   // know boundary within last expansion
+                        // ground forward to beginning of line
+                        while (offset > 0) {
+                            charRect = at.getCharacterBounds(lineStart + offset);
+                            if (charRect.y < indexRect.y) { // still before line
+                                lineStart += offset;
+                            } else {
+                                // leave lineStart alone, it's close!
+                            }
+                            offset = offset >> 1;
+                        }
+                        // subtract one 'cause we're already too far...
+                        lineStart += 1;
+                    }
+                    return lineStart;
+                }
+                return -1;
+            }
+        }, ac);
+    }
+
+    /**
+     * Get line info: right index of line
+     *
+     * algorithm:  cast back, doubling each time,
+     *             'till find line boundaries
+     *
+     * return -1 if we can't get the info (e.g. index or at passed in
+     * is bogus; etc.)
+     */
+    private int getAccessibleTextLineRightBoundsFromContext(final AccessibleContext ac, final int index) {
+        if(ac == null)
+            return -1;
+        return InvocationUtils.invokeAndWait(new Callable<Integer>() {
+            @Override
+            public Integer call() throws Exception {
+                AccessibleText at = ac.getAccessibleText();
+                if (at != null) {
+                    int lineEnd;
+                    int offset;
+                    Rectangle charRect;
+                    Rectangle indexRect = at.getCharacterBounds(index);
+                    int textLen = at.getCharCount();
+                    if (indexRect == null) {
+                        return -1;
+                    }
+                    // find the end of the line
+                    //
+                    offset = 1;
+                    lineEnd = index + offset > textLen - 1
+                            ? textLen - 1 : index + offset;
+                    charRect = at.getCharacterBounds(lineEnd);
+                    // push past end of line
+                    while (charRect != null &&
+                            charRect.y <= indexRect.y &&
+                            lineEnd < textLen - 1) {
+                        offset = offset << 1;
+                        lineEnd = index + offset > textLen - 1
+                                ? textLen - 1 : index + offset;
+                        charRect = at.getCharacterBounds(lineEnd);
+                    }
+                    if (lineEnd == textLen - 1) {    // special case: on the last line!
+                        // we found it!
+                    } else {
+                        offset = offset >> 1;   // know boundary within last expansion
+                        // pull back to end of line
+                        while (offset > 0) {
+                            charRect = at.getCharacterBounds(lineEnd - offset);
+                            if (charRect.y > indexRect.y) { // still beyond line
+                                lineEnd -= offset;
+                            } else {
+                                // leave lineEnd alone, it's close!
+                            }
+                            offset = offset >> 1;
+                        }
+                        // subtract one 'cause we're already too far...
+                        lineEnd -= 1;
+                    }
+                    return lineEnd;
+                }
+                return -1;
+            }
+        }, ac);
+    }
+
+    /**
+     * Get a range of text; null if indicies are bogus
+     */
+    private String getAccessibleTextRangeFromContext(final AccessibleContext ac,
+                                                    final int start, final int end) {
+        String s = InvocationUtils.invokeAndWait(new Callable<String>() {
+            @Override
+            public String call() throws Exception {
+                if (ac != null) {
+                    AccessibleText at = ac.getAccessibleText();
+                    if (at != null) {
+                        // start - end is inclusive
+                        if (start > end) {
+                            return null;
+                        }
+                        if (end >= at.getCharCount()) {
+                            return null;
+                        }
+                        StringBuffer buf = new StringBuffer(end - start + 1);
+                        for (int i = start; i <= end; i++) {
+                            buf.append(at.getAtIndex(AccessibleText.CHARACTER, i));
+                        }
+                        return buf.toString();
+                    }
+                }
+                return null;
+            }
+        }, ac);
+        if (s != null) {
+            references.increment(s);
+            return s;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * return the AttributeSet object at a given index from an AccessibleContext
+     */
+    private AttributeSet getAccessibleAttributeSetAtIndexFromContext(final AccessibleContext ac,
+                                                                    final int index) {
+        return InvocationUtils.invokeAndWait(new Callable<AttributeSet>() {
+            @Override
+            public AttributeSet call() throws Exception {
+                if (ac != null) {
+                    AccessibleText at = ac.getAccessibleText();
+                    if (at != null) {
+                        AttributeSet as = at.getCharacterAttribute(index);
+                        if (as != null) {
+                            AccessBridge.this.references.increment(as);
+                            return as;
+                        }
+                    }
+                }
+                return null;
+            }
+        }, ac);
+    }
+
+
+    /**
+     * return the bounding rectangle at index from an AccessibleContext
+     */
+    private Rectangle getAccessibleTextRectAtIndexFromContext(final AccessibleContext ac,
+                                                        final int index) {
+        // want to do this in global coords, so need to combine w/ac global coords
+        Rectangle r = InvocationUtils.invokeAndWait(new Callable<Rectangle>() {
+            @Override
+            public Rectangle call() throws Exception {
+                // want to do this in global coords, so need to combine w/ac global coords
+                if (ac != null) {
+                    AccessibleText at = ac.getAccessibleText();
+                    if (at != null) {
+                        Rectangle rect = at.getCharacterBounds(index);
+                        if (rect != null) {
+                            String s = at.getAtIndex(AccessibleText.CHARACTER, index);
+                            if (s != null && s.equals("\n")) {
+                                rect.width = 0;
+                            }
+                            return rect;
+                        }
+                    }
+                }
+                return null;
+            }
+        }, ac);
+        Rectangle acRect = getAccessibleBoundsOnScreenFromContext(ac);
+        if (r != null && acRect != null) {
+            r.translate(acRect.x, acRect.y);
+            return r;
+        }
+        return null;
+    }
+
+    /**
+     * return the AccessibleText character x-coord at index from an AccessibleContext
+     */
+    private int getAccessibleXcoordTextRectAtIndexFromContext(AccessibleContext ac, int index) {
+        if (ac != null) {
+            Rectangle r = getAccessibleTextRectAtIndexFromContext(ac, index);
+            if (r != null) {
+                return r.x;
+            }
+        } else {
+            debugString("getAccessibleXcoordTextRectAtIndexFromContext; ac = null");
+        }
+        return -1;
+    }
+
+    /**
+     * return the AccessibleText character y-coord at index from an AccessibleContext
+     */
+    private int getAccessibleYcoordTextRectAtIndexFromContext(AccessibleContext ac, int index) {
+        if (ac != null) {
+            Rectangle r = getAccessibleTextRectAtIndexFromContext(ac, index);
+            if (r != null) {
+                return r.y;
+            }
+        } else {
+            debugString("getAccessibleYcoordTextRectAtIndexFromContext; ac = null");
+        }
+        return -1;
+    }
+
+    /**
+     * return the AccessibleText character height at index from an AccessibleContext
+     */
+    private int getAccessibleHeightTextRectAtIndexFromContext(AccessibleContext ac, int index) {
+        if (ac != null) {
+            Rectangle r = getAccessibleTextRectAtIndexFromContext(ac, index);
+            if (r != null) {
+                return r.height;
+            }
+        } else {
+            debugString("getAccessibleHeightTextRectAtIndexFromContext; ac = null");
+        }
+        return -1;
+    }
+
+    /**
+     * return the AccessibleText character width at index from an AccessibleContext
+     */
+    private int getAccessibleWidthTextRectAtIndexFromContext(AccessibleContext ac, int index) {
+        if (ac != null) {
+            Rectangle r = getAccessibleTextRectAtIndexFromContext(ac, index);
+            if (r != null) {
+                return r.width;
+            }
+        } else {
+            debugString("getAccessibleWidthTextRectAtIndexFromContext; ac = null");
+        }
+        return -1;
+    }
+
+    /* ===== AttributeSet methods for AccessibleText ===== */
+
+    /**
+     * return the bold setting from an AttributeSet
+     */
+    private boolean getBoldFromAttributeSet(AttributeSet as) {
+        if (as != null) {
+            return StyleConstants.isBold(as);
+        } else {
+            debugString("getBoldFromAttributeSet; as = null");
+        }
+        return false;
+    }
+
+    /**
+     * return the italic setting from an AttributeSet
+     */
+    private boolean getItalicFromAttributeSet(AttributeSet as) {
+        if (as != null) {
+            return StyleConstants.isItalic(as);
+        } else {
+            debugString("getItalicFromAttributeSet; as = null");
+        }
+        return false;
+    }
+
+    /**
+     * return the underline setting from an AttributeSet
+     */
+    private boolean getUnderlineFromAttributeSet(AttributeSet as) {
+        if (as != null) {
+            return StyleConstants.isUnderline(as);
+        } else {
+            debugString("getUnderlineFromAttributeSet; as = null");
+        }
+        return false;
+    }
+
+    /**
+     * return the strikethrough setting from an AttributeSet
+     */
+    private boolean getStrikethroughFromAttributeSet(AttributeSet as) {
+        if (as != null) {
+            return StyleConstants.isStrikeThrough(as);
+        } else {
+            debugString("getStrikethroughFromAttributeSet; as = null");
+        }
+        return false;
+    }
+
+    /**
+     * return the superscript setting from an AttributeSet
+     */
+    private boolean getSuperscriptFromAttributeSet(AttributeSet as) {
+        if (as != null) {
+            return StyleConstants.isSuperscript(as);
+        } else {
+            debugString("getSuperscriptFromAttributeSet; as = null");
+        }
+        return false;
+    }
+
+    /**
+     * return the subscript setting from an AttributeSet
+     */
+    private boolean getSubscriptFromAttributeSet(AttributeSet as) {
+        if (as != null) {
+            return StyleConstants.isSubscript(as);
+        } else {
+            debugString("getSubscriptFromAttributeSet; as = null");
+        }
+        return false;
+    }
+
+    /**
+     * return the background color from an AttributeSet
+     */
+    private String getBackgroundColorFromAttributeSet(AttributeSet as) {
+        if (as != null) {
+            String s = StyleConstants.getBackground(as).toString();
+            if (s != null) {
+                references.increment(s);
+                return s;
+            }
+        } else {
+            debugString("getBackgroundColorFromAttributeSet; as = null");
+        }
+        return null;
+    }
+
+    /**
+     * return the foreground color from an AttributeSet
+     */
+    private String getForegroundColorFromAttributeSet(AttributeSet as) {
+        if (as != null) {
+            String s = StyleConstants.getForeground(as).toString();
+            if (s != null) {
+                references.increment(s);
+                return s;
+            }
+        } else {
+            debugString("getForegroundColorFromAttributeSet; as = null");
+        }
+        return null;
+    }
+
+    /**
+     * return the font family from an AttributeSet
+     */
+    private String getFontFamilyFromAttributeSet(AttributeSet as) {
+        if (as != null) {
+            String s = StyleConstants.getFontFamily(as).toString();
+            if (s != null) {
+                references.increment(s);
+                return s;
+            }
+        } else {
+            debugString("getFontFamilyFromAttributeSet; as = null");
+        }
+        return null;
+    }
+
+    /**
+     * return the font size from an AttributeSet
+     */
+    private int getFontSizeFromAttributeSet(AttributeSet as) {
+        if (as != null) {
+            return StyleConstants.getFontSize(as);
+        } else {
+            debugString("getFontSizeFromAttributeSet; as = null");
+        }
+        return -1;
+    }
+
+    /**
+     * return the alignment from an AttributeSet
+     */
+    private int getAlignmentFromAttributeSet(AttributeSet as) {
+        if (as != null) {
+            return StyleConstants.getAlignment(as);
+        } else {
+            debugString("getAlignmentFromAttributeSet; as = null");
+        }
+        return -1;
+    }
+
+    /**
+     * return the BiDi level from an AttributeSet
+     */
+    private int getBidiLevelFromAttributeSet(AttributeSet as) {
+        if (as != null) {
+            return StyleConstants.getBidiLevel(as);
+        } else {
+            debugString("getBidiLevelFromAttributeSet; as = null");
+        }
+        return -1;
+    }
+
+
+    /**
+     * return the first line indent from an AttributeSet
+     */
+    private float getFirstLineIndentFromAttributeSet(AttributeSet as) {
+        if (as != null) {
+            return StyleConstants.getFirstLineIndent(as);
+        } else {
+            debugString("getFirstLineIndentFromAttributeSet; as = null");
+        }
+        return -1;
+    }
+
+    /**
+     * return the left indent from an AttributeSet
+     */
+    private float getLeftIndentFromAttributeSet(AttributeSet as) {
+        if (as != null) {
+            return StyleConstants.getLeftIndent(as);
+        } else {
+            debugString("getLeftIndentFromAttributeSet; as = null");
+        }
+        return -1;
+    }
+
+    /**
+     * return the right indent from an AttributeSet
+     */