changeset 8144:ef0e51982c79

Merge
author asaha
date Tue, 14 Oct 2014 12:20:39 -0700
parents db99dc7ca464 b306a3535fa5
children 53cc5730c4be
files .hgtags test/java/lang/Runtime/exec/CloseRace.java
diffstat 165 files changed, 5248 insertions(+), 761 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Oct 14 10:33:34 2014 -0700
+++ b/.hgtags	Tue Oct 14 12:20:39 2014 -0700
@@ -456,6 +456,9 @@
 7f7430459adfe7b7fb65da8c3fac2ac5e3495ea1 jdk7u65-b18
 ba6cef21c369076be97dd8133fd4a158cd486bd8 jdk7u65-b19
 c3a56021fc22f886106f123d4f25b385ac6b79d7 jdk7u65-b32
+efc8886310cbccb941f826acfad2ad51a2891be5 jdk7u80-b00
+bc7f9d966c1df3748ef9c148eab25976cd065963 jdk7u80-b01
+2590a9c18fdba19086712bb91a28352e9239a2be jdk7u80-b02
 8b9d926bd35adceb99f244b7b068fedb0f220f03 jdk7u65-b20
 5cf343beab2ce73d299d4f1a8f3b95892f9fd818 jdk7u67-b01
 ba6cef21c369076be97dd8133fd4a158cd486bd8 jdk7u65-b40
@@ -511,5 +514,11 @@
 0fefa48e670a31015be985ba74e35841d0cc66c1 jdk7u75-b01
 e885a036cc5dc0f8fa07dc0a5f55647f819f3fc5 jdk7u75-b02
 4b81833e1c004460c78208c2529775a05f3abf80 jdk7u75-b03
+1964c973dcc1ddb30115b7c7b6183548b3adcdf5 jdk7u75-b04
+0666a58a7e584380c1b1dadb50ec67400110a9ab jdk7u76-b00
+182b3e8a732d6b0d21bd7d602361e5276f14b886 jdk7u76-b01
+3c743031578a431ccc1e27691b1958355d02caec jdk7u76-b02
+5e3a73518863851da31129b815a142ad34a3d376 jdk7u76-b03
+50322d45a16bd3f50a050f858495a586395e6095 jdk7u76-b04
 45f30f5524d4eef7aa512e35d5399cc4d84af174 jdk7u79-b00
-b56da93414775a70d74b6ed0b26ac80a96f9a1b8 jdk7u75-b04
+
--- a/make/bridge/Jabswitch/Makefile	Tue Oct 14 10:33:34 2014 -0700
+++ b/make/bridge/Jabswitch/Makefile	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 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
@@ -44,7 +44,10 @@
 JAB_MANIFEST_INP = $(CLOSED_PLATFORM_SRC)/native/sun/bridge/jabswitch.manifest
 JAB_MANIFEST_OUT = $(TEMPDIR)/jabswitch.exe.intermediate.manifest
 
-RC_FLAGS += /fo "$(VERSIONRES)"
+RC_FLAGS += /fo "$(VERSIONRES)" \
+            /D "JDK_FNAME=$(PROGRAM)$(EXE_SUFFIX)" \
+            /D "JDK_INTERNAL_NAME=$(PROGRAM)" \
+            /D "JDK_FTYPE=0x1L"
 OTHER_CPPFLAGS += /MD /Fo"$(TEMPDIR)/" /Fd"$(TEMPDIR)/" /analyze- /Od /Gd /nologo /Gm /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /RTC1 /W3 /ZI /Zc:wchar_t /EHsc 
 LDDFLAGS += Advapi32.lib Version.lib User32.lib
 
--- a/make/com/apple/osxui/Makefile	Tue Oct 14 10:33:34 2014 -0700
+++ b/make/com/apple/osxui/Makefile	Tue Oct 14 12:20:39 2014 -0700
@@ -67,6 +67,7 @@
 
 RESOURCE_BUNDLES_COMPILED_PROPERTIES += \
 	com/apple/laf/resources/aqua.properties
+LOCALE_SET_DEFINITION = jre
 
 #
 # Rules
--- a/make/com/sun/nio/Makefile	Tue Oct 14 10:33:34 2014 -0700
+++ b/make/com/sun/nio/Makefile	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 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
@@ -29,13 +29,8 @@
 
 BUILDDIR = ../../..
 include $(BUILDDIR)/common/Defs.gmk
-
-# MMM: disable for now
-ifneq ($(PLATFORM), macosx)
 include $(BUILDDIR)/common/Subdirs.gmk
 SUBDIRS = sctp
-endif
-
 
 all build clean clobber::
 	$(SUBDIRS-loop)
--- a/make/com/sun/nio/sctp/Exportedfiles.gmk	Tue Oct 14 10:33:34 2014 -0700
+++ b/make/com/sun/nio/sctp/Exportedfiles.gmk	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 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
@@ -28,6 +28,7 @@
 #
 
 ifneq ($(PLATFORM), windows)
+ifneq ($(PLATFORM), macosx)
 FILES_export = \
     sun/nio/ch/SctpAssocChange.java \
     sun/nio/ch/SctpChannelImpl.java \
@@ -37,3 +38,4 @@
     sun/nio/ch/SctpServerChannelImpl.java \
     sun/nio/ch/SctpStdSocketOption.java
 endif
+endif
--- a/make/com/sun/nio/sctp/FILES_c.gmk	Tue Oct 14 10:33:34 2014 -0700
+++ b/make/com/sun/nio/sctp/FILES_c.gmk	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 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
@@ -24,8 +24,10 @@
 #
 
 ifneq ($(PLATFORM),windows)
+ifneq ($(PLATFORM),macosx)
 FILES_c = \
 	SctpNet.c \
         SctpChannelImpl.c \
         SctpServerChannelImpl.c
 endif	
+endif	
--- a/make/com/sun/nio/sctp/FILES_java.gmk	Tue Oct 14 10:33:34 2014 -0700
+++ b/make/com/sun/nio/sctp/FILES_java.gmk	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 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
@@ -23,7 +23,7 @@
 # questions.
 #
 FILES_java = \
-        com/sun/nio/sctp/AbstractNotificationHandler.java \
+	com/sun/nio/sctp/AbstractNotificationHandler.java \
 	com/sun/nio/sctp/Association.java \
 	com/sun/nio/sctp/AssociationChangeNotification.java \
 	com/sun/nio/sctp/HandlerResult.java \
@@ -43,9 +43,13 @@
 	com/sun/nio/sctp/ShutdownNotification.java \
 	\
 	sun/nio/ch/SctpMessageInfoImpl.java \
-	sun/nio/ch/SctpStdSocketOption.java
+	sun/nio/ch/SctpStdSocketOption.java \
+	sun/nio/ch/SctpChannelImpl.java \
+	sun/nio/ch/SctpMultiChannelImpl.java \
+	sun/nio/ch/SctpServerChannelImpl.java
 
 ifneq ($(PLATFORM), windows)
+ifneq ($(PLATFORM), macosx)
 FILES_java += \
 	sun/nio/ch/SctpAssocChange.java \
 	sun/nio/ch/SctpAssociationImpl.java \
@@ -58,9 +62,5 @@
 	sun/nio/ch/SctpSendFailed.java \
 	sun/nio/ch/SctpServerChannelImpl.java \
 	sun/nio/ch/SctpShutdown.java
-else
-FILES_java += \
-	sun/nio/ch/SctpChannelImpl.java \
-	sun/nio/ch/SctpMultiChannelImpl.java \
-	sun/nio/ch/SctpServerChannelImpl.java
 endif
+endif
--- a/make/com/sun/nio/sctp/Makefile	Tue Oct 14 10:33:34 2014 -0700
+++ b/make/com/sun/nio/sctp/Makefile	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 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
@@ -41,7 +41,15 @@
 include FILES_java.gmk
 include Exportedfiles.gmk
 
+ifeq ($(PLATFORM), windows)
+include $(BUILDDIR)/common/Classes.gmk
+endif
+ifeq ($(PLATFORM), macosx)
+include $(BUILDDIR)/common/Classes.gmk
+endif
+
 ifneq ($(PLATFORM), windows)
+ifneq ($(PLATFORM), macosx)
 include $(BUILDDIR)/common/Mapfile-vers.gmk
 include $(BUILDDIR)/common/Library.gmk
 
@@ -67,12 +75,9 @@
 ifeq ($(PLATFORM), solaris)
 #LIBSCTP = -lsctp
 OTHER_LDLIBS += $(LIBSOCKET) -L$(LIBDIR)/$(LIBARCH) -lnet -lnio
-endif # PLATFORM
-
-else # windows
-include $(BUILDDIR)/common/Classes.gmk
-endif # ifneq windows
-
+endif
+endif # macosx
+endif # windows
 
 clean clobber::
 	$(RM) -r $(CLASSDESTDIR)/com/sun/nio/sctp
--- a/make/common/internal/Resources.gmk	Tue Oct 14 10:33:34 2014 -0700
+++ b/make/common/internal/Resources.gmk	Tue Oct 14 12:20:39 2014 -0700
@@ -225,6 +225,10 @@
 	$(add-property-java-file)
 $(GENSRCDIR)/%_zh_HK.java: $(SHARE_SRC)/classes/%_zh_TW.properties
 	$(add-property-java-file)
+ifdef PLATFORM_SRC_MACOS
+$(GENSRCDIR)/%_zh_HK.java: $(PLATFORM_SRC_MACOS)/classes/%_zh_TW.properties
+	$(add-property-java-file)
+endif
 
 # Simple delivery of zh_HK properties files just copies zh_TW properties files
 $(CLASSDESTDIR)/%_zh_HK.properties: \
--- a/make/sun/security/krb5/Makefile	Tue Oct 14 10:33:34 2014 -0700
+++ b/make/sun/security/krb5/Makefile	Tue Oct 14 12:20:39 2014 -0700
@@ -92,7 +92,7 @@
   OTHER_LDLIBS = $(LIBDL) $(JVMLIB)
 endif
 
-build:
+all:
 ifeq ($(PLATFORM),windows)
 	$(call make-launcher, kinit, sun.security.krb5.internal.tools.Kinit, , )
 	$(call make-launcher, klist, sun.security.krb5.internal.tools.Klist, , )
--- a/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Tue Oct 14 12:20:39 2014 -0700
@@ -39,7 +39,8 @@
 
     private CPlatformResponder responder;
     private static final Object classLock = new Object();
-    private static volatile CEmbeddedFrame focusedWindow;
+    private static volatile CEmbeddedFrame globalFocusedWindow;
+    private CEmbeddedFrame browserWindowFocusedApplet;
     private boolean parentWindowActive = true;
 
     public CEmbeddedFrame() {
@@ -118,10 +119,10 @@
         synchronized (classLock) {
             // In some cases an applet may not receive the focus lost event
             // from the parent window (see 8012330)
-            focusedWindow = (focused) ? this
-                    : ((focusedWindow == this) ? null : focusedWindow);
+            globalFocusedWindow = (focused) ? this
+                    : ((globalFocusedWindow == this) ? null : globalFocusedWindow);
         }
-        if (focusedWindow == this) {
+        if (globalFocusedWindow == this) {
             // see bug 8010925
             // we can't put this to handleWindowFocusEvent because
             // it won't be invoced if focuse is moved to a html element
@@ -151,9 +152,23 @@
      */
     public void handleWindowFocusEvent(boolean parentWindowActive) {
         this.parentWindowActive = parentWindowActive;
+        // If several applets are running in different browser's windows, it is necessary to
+        // detect the switching between the parent windows and update globalFocusedWindow accordingly.
+        synchronized (classLock) {
+            if (!parentWindowActive) {
+                this.browserWindowFocusedApplet = globalFocusedWindow;
+            }
+            if (parentWindowActive && globalFocusedWindow != this && isParentWindowChanged()) {
+                // It looks like we have switched to another browser window, let's restore focus to
+                // the previously focused applet in this window. If no applets were focused in the
+                // window, we will set focus to the first applet in the window.
+                globalFocusedWindow = (this.browserWindowFocusedApplet != null) ? this.browserWindowFocusedApplet
+                        : this;
+            }
+        }
         // ignore focus "lost" native request as it may mistakenly
         // deactivate active window (see 8001161)
-        if (focusedWindow == this && parentWindowActive) {
+        if (globalFocusedWindow == this && parentWindowActive) {
             responder.handleWindowFocusEvent(parentWindowActive, null);
         }
     }
@@ -161,4 +176,10 @@
     public boolean isParentWindowActive() {
         return parentWindowActive;
     }
+
+    private boolean isParentWindowChanged() {
+        // If globalFocusedWindow is located at inactive parent window or null, we have swithed to
+        // another window.
+        return globalFocusedWindow != null ? !globalFocusedWindow.isParentWindowActive() : true;
+    }
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Tue Oct 14 12:20:39 2014 -0700
@@ -118,6 +118,7 @@
     static final int NONACTIVATING = 1 << 24;
     static final int IS_DIALOG = 1 << 25;
     static final int IS_MODAL = 1 << 26;
+    static final int IS_POPUP = 1 << 27;
 
     static final int _STYLE_PROP_BITMASK = DECORATED | TEXTURED | UNIFIED | UTILITY | HUD | SHEET | CLOSEABLE | MINIMIZABLE | RESIZABLE;
 
@@ -308,6 +309,7 @@
             styleBits = SET(styleBits, TEXTURED, false);
             // Popups in applets don't activate applet's process
             styleBits = SET(styleBits, NONACTIVATING, true);
+            styleBits = SET(styleBits, IS_POPUP, true);
         }
 
         if (Window.Type.UTILITY.equals(target.getType())) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/macosx/classes/sun/nio/ch/SctpChannelImpl.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2009, 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 sun.nio.ch;
+
+import java.net.SocketAddress;
+import java.net.InetAddress;
+import java.io.IOException;
+import java.util.Set;
+import java.nio.ByteBuffer;
+import java.nio.channels.spi.SelectorProvider;
+import com.sun.nio.sctp.Association;
+import com.sun.nio.sctp.MessageInfo;
+import com.sun.nio.sctp.NotificationHandler;
+import com.sun.nio.sctp.SctpChannel;
+import com.sun.nio.sctp.SctpSocketOption;
+
+/**
+ * Unimplemented.
+ */
+public class SctpChannelImpl extends SctpChannel
+{
+    private static final String message = "SCTP not supported on this platform";
+
+    public SctpChannelImpl(SelectorProvider provider) {
+        super(provider);
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public Association association() {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public SctpChannel bind(SocketAddress local)
+                            throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public SctpChannel bindAddress(InetAddress address)
+         throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public SctpChannel unbindAddress(InetAddress address)
+         throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public boolean connect(SocketAddress remote) throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public boolean connect(SocketAddress remote, int maxOutStreams,
+       int maxInStreams) throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public boolean isConnectionPending() {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public boolean finishConnect() throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public Set<SocketAddress> getAllLocalAddresses()
+            throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public Set<SocketAddress> getRemoteAddresses()
+            throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public SctpChannel shutdown() throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public <T> T getOption(SctpSocketOption<T> name)
+            throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public <T> SctpChannel setOption(SctpSocketOption<T> name, T value)
+        throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public Set<SctpSocketOption<?>> supportedOptions() {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public <T> MessageInfo receive(ByteBuffer dst, T attachment,
+            NotificationHandler<T> handler) throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public int send(ByteBuffer src, MessageInfo messageInfo)
+            throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    protected void implConfigureBlocking(boolean block) throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public void implCloseSelectableChannel() throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/macosx/classes/sun/nio/ch/SctpMultiChannelImpl.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2009, 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 sun.nio.ch;
+
+import java.net.SocketAddress;
+import java.net.InetAddress;
+import java.io.IOException;
+import java.util.Set;
+import java.nio.ByteBuffer;
+import java.nio.channels.spi.SelectorProvider;
+import com.sun.nio.sctp.Association;
+import com.sun.nio.sctp.SctpChannel;
+import com.sun.nio.sctp.MessageInfo;
+import com.sun.nio.sctp.NotificationHandler;
+import com.sun.nio.sctp.SctpMultiChannel;
+import com.sun.nio.sctp.SctpSocketOption;
+
+/**
+ * Unimplemented.
+ */
+public class SctpMultiChannelImpl extends SctpMultiChannel
+{
+    private static final String message = "SCTP not supported on this platform";
+
+    public SctpMultiChannelImpl(SelectorProvider provider) {
+        super(provider);
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public Set<Association> associations() {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public SctpMultiChannel bind(SocketAddress local,
+            int backlog) throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public SctpMultiChannel bindAddress(InetAddress address)
+         throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public SctpMultiChannel unbindAddress(InetAddress address)
+         throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public Set<SocketAddress> getAllLocalAddresses()
+            throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public Set<SocketAddress> getRemoteAddresses
+            (Association association) throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public SctpMultiChannel shutdown(Association association)
+            throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public <T> T getOption(SctpSocketOption<T> name,
+            Association association) throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public <T> SctpMultiChannel setOption(SctpSocketOption<T> name,
+            T value, Association association) throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public Set<SctpSocketOption<?>> supportedOptions() {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public <T> MessageInfo receive(ByteBuffer buffer, T attachment,
+            NotificationHandler<T> handler) throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public int send(ByteBuffer buffer, MessageInfo messageInfo)
+            throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public SctpChannel branch(Association association)
+            throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    protected void implConfigureBlocking(boolean block) throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public void implCloseSelectableChannel() throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/macosx/classes/sun/nio/ch/SctpServerChannelImpl.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2009, 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 sun.nio.ch;
+
+import java.net.SocketAddress;
+import java.net.InetAddress;
+import java.io.IOException;
+import java.util.Set;
+import java.nio.channels.spi.SelectorProvider;
+import com.sun.nio.sctp.SctpChannel;
+import com.sun.nio.sctp.SctpServerChannel;
+import com.sun.nio.sctp.SctpSocketOption;
+
+/**
+ * Unimplemented.
+ */
+public class SctpServerChannelImpl extends SctpServerChannel
+{
+    private static final String message = "SCTP not supported on this platform";
+
+    public SctpServerChannelImpl(SelectorProvider provider) {
+        super(provider);
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public SctpChannel accept() throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public SctpServerChannel bind(SocketAddress local,
+            int backlog) throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public SctpServerChannel bindAddress(InetAddress address)
+         throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public SctpServerChannel unbindAddress(InetAddress address)
+         throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public Set<SocketAddress> getAllLocalAddresses()
+            throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public <T> T getOption(SctpSocketOption<T> name) throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public <T> SctpServerChannel setOption(SctpSocketOption<T> name,
+            T value) throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public Set<SctpSocketOption<?>> supportedOptions() {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    protected void implConfigureBlocking(boolean block) throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+
+    @Override
+    public void implCloseSelectableChannel() throws IOException {
+        throw new UnsupportedOperationException(message);
+    }
+}
--- a/src/macosx/native/sun/awt/AWTWindow.m	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/macosx/native/sun/awt/AWTWindow.m	Tue Oct 14 12:20:39 2014 -0700
@@ -307,6 +307,10 @@
         [self adjustGrowBoxWindow];
     } else growBoxWindow = nil;
 
+    if (IS(self.styleBits, IS_POPUP)) {
+        [self.nsWindow setCollectionBehavior:(1 << 8) /*NSWindowCollectionBehaviorFullScreenAuxiliary*/]; 
+    }
+
     return self;
 }
 
--- a/src/macosx/native/sun/awt/JavaComponentAccessibility.m	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/macosx/native/sun/awt/JavaComponentAccessibility.m	Tue Oct 14 12:20:39 2014 -0700
@@ -256,11 +256,15 @@
         jsize count = [ignoredKeys count];
 
         JNIEnv *env = [ThreadUtilities getJNIEnv];
-        jclass clazz = (*env)->FindClass(env, "java/lang/String");
-        result = (*env)->NewObjectArray(env, count, clazz, NULL); // AWT_THREADING Safe (known object)
-        (*env)->DeleteLocalRef(env, clazz);
 
-        NSUInteger i;
+        static JNF_CLASS_CACHE(jc_String, "java/lang/String");
+        result = JNFNewObjectArray(env, &jc_String, count);
+        if (!result) {
+            NSLog(@"In %s, can't create Java array of String objects", __FUNCTION__);
+            return;
+        }
+
+        NSInteger i;
         for (i = 0; i < count; i++) {
             jstring jString = JNFNSToJavaString(env, [ignoredKeys objectAtIndex:i]);
             (*env)->SetObjectArrayElement(env, result, i, jString);
@@ -295,7 +299,7 @@
     jsize arrayLen = (*env)->GetArrayLength(env, jchildrenAndRoles);
     NSMutableArray *children = [NSMutableArray arrayWithCapacity:arrayLen/2]; //childrenAndRoles array contains two elements (child, role) for each child
 
-    NSUInteger i;
+    NSInteger i;
     NSUInteger childIndex = (whichChildren >= 0) ? whichChildren : 0; // if we're getting one particular child, make sure to set its index correctly
     for(i = 0; i < arrayLen; i+=2)
     {
@@ -391,8 +395,13 @@
     // Get all the other accessibility attributes states we need in one swell foop.
     // javaRole isn't pulled in because we need protected access to AccessibleRole.key
     jbooleanArray attributeStates = JNFCallStaticObjectMethod(env, jm_getInitialAttributeStates, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop)
-    if (attributeStates == NULL) return NULL;
+    if (attributeStates == NULL) return nil;
     jboolean *attributeStatesArray = (*env)->GetBooleanArrayElements(env, attributeStates, 0);
+    if (attributeStatesArray == NULL) {
+        // Note: Java will not be on the stack here so a java exception can't happen and no need to call ExceptionCheck.
+        NSLog(@"%s failed calling GetBooleanArrayElements", __FUNCTION__);
+        return nil;
+    }
 
     // if there's a component, it can be enabled and it has a size/position
     if (attributeStatesArray[0]) {
@@ -1113,7 +1122,9 @@
     JNIEnv *env = [ThreadUtilities getJNIEnv];
     id value = nil;
 
+    NSWindow* hostWindow = [[self->fView window] retain];
     jobject focused = JNFCallStaticObjectMethod(env, jm_getFocusOwner, fComponent); // AWT_THREADING Safe (AWTRunLoop)
+    [hostWindow release];
     if (focused != NULL) {
         if (JNFIsInstanceOf(env, focused, &sjc_Accessible)) {
             value = [JavaComponentAccessibility createWithAccessible:focused withEnv:env withView:fView];
@@ -1220,7 +1231,7 @@
     // Go through the tabs and find selAccessible
     _numTabs = [tabs count];
     JavaComponentAccessibility *aTab;
-    NSUInteger i;
+    NSInteger i;
     for (i = 0; i < _numTabs; i++) {
         aTab = (JavaComponentAccessibility *)[tabs objectAtIndex:i];
         if ([aTab isAccessibleWithEnv:env forAccessible:selAccessible]) {
@@ -1247,7 +1258,7 @@
 
     NSString *tabJavaRole = JNFJavaToNSString(env, JNFGetObjectField(env, jtabJavaRole, sjf_key));
 
-    NSUInteger i;
+    NSInteger i;
     NSUInteger tabIndex = (whichTabs >= 0) ? whichTabs : 0; // if we're getting one particular child, make sure to set its index correctly
     for(i = 0; i < arrayLen; i+=2) {
         jobject jtab = (*env)->GetObjectArrayElement(env, jtabsAndRoles, i);
--- a/src/macosx/native/sun/awt/JavaTextAccessibility.m	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/macosx/native/sun/awt/JavaTextAccessibility.m	Tue Oct 14 12:20:39 2014 -0700
@@ -40,6 +40,11 @@
  */
 NSValue *javaIntArrayToNSRangeValue(JNIEnv* env, jintArray array) {
     jint *values = (*env)->GetIntArrayElements(env, array, 0);
+    if (values == NULL) {
+        // Note: Java will not be on the stack here so a java exception can't happen and no need to call ExceptionCheck.
+        NSLog(@"%s failed calling GetIntArrayElements", __FUNCTION__);
+        return nil;
+    };
     NSValue *value = [NSValue valueWithRange:NSMakeRange(values[0], values[1] - values[0])];
     (*env)->ReleaseIntArrayElements(env, array, values, 0);
     return value;
@@ -285,6 +290,11 @@
 
     // We cheat because we know that the array is 4 elements long (x, y, width, height)
     jdouble *values = (*env)->GetDoubleArrayElements(env, axBounds, 0);
+    if (values == NULL) {
+        // Note: Java will not be on the stack here so a java exception can't happen and no need to call ExceptionCheck.
+        NSLog(@"%s failed calling GetDoubleArrayElements", __FUNCTION__); 
+        return nil;
+    };
     NSRect bounds;
     bounds.origin.x = values[0];
     bounds.origin.y = [[[[self view] window] screen] frame].size.height - values[1] - values[3]; //values[1] is y-coord from top-left of screen. Flip. Account for the height (values[3]) when flipping
--- a/src/share/classes/com/sun/crypto/provider/OAEPParameters.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/crypto/provider/OAEPParameters.java	Tue Oct 14 12:20:39 2014 -0700
@@ -106,20 +106,6 @@
         }
     }
 
-    private static String convertToStandardName(String internalName) {
-        if (internalName.equals("SHA")) {
-            return "SHA-1";
-        } else if (internalName.equals("SHA256")) {
-            return "SHA-256";
-        } else if (internalName.equals("SHA384")) {
-            return "SHA-384";
-        } else if (internalName.equals("SHA512")) {
-            return "SHA-512";
-        } else {
-            return internalName;
-        }
-    }
-
     protected void engineInit(byte[] encoded)
         throws IOException {
         DerInputStream der = new DerInputStream(encoded);
@@ -131,7 +117,7 @@
             DerValue data = datum[i];
             if (data.isContextSpecific((byte) 0x00)) {
                 // hash algid
-                mdName = convertToStandardName(AlgorithmId.parse
+                mdName = AlgorithmId.getStandardDigestName(AlgorithmId.parse
                     (data.data.getDerValue()).getName());
             } else if (data.isContextSpecific((byte) 0x01)) {
                 // mgf algid
@@ -141,7 +127,8 @@
                 }
                 AlgorithmId params = AlgorithmId.parse(
                     new DerValue(val.getEncodedParams()));
-                String mgfDigestName = convertToStandardName(params.getName());
+                String mgfDigestName = AlgorithmId.getStandardDigestName(
+                        params.getName());
                 if (mgfDigestName.equals("SHA-1")) {
                     mgfSpec = MGF1ParameterSpec.SHA1;
                 } else if (mgfDigestName.equals("SHA-256")) {
--- a/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1256,8 +1256,11 @@
             if (name.equals("IHDR")) {
                 IHDR_width = getIntAttribute(node, "width");
                 IHDR_height = getIntAttribute(node, "height");
-                IHDR_bitDepth = getEnumeratedAttribute(node, "bitDepth",
-                                                       IHDR_bitDepths);
+                IHDR_bitDepth =
+                        Integer.valueOf(IHDR_bitDepths[
+                                getEnumeratedAttribute(node,
+                                                    "bitDepth",
+                                                    IHDR_bitDepths)]);
                 IHDR_colorType = getEnumeratedAttribute(node, "colorType",
                                                         IHDR_colorTypeNames);
                 IHDR_compressionMethod =
--- a/src/share/classes/com/sun/java/swing/plaf/windows/AnimationController.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/AnimationController.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
@@ -130,11 +130,14 @@
                     //one second seems plausible value
                     duration = 1000;
                 } else {
-                     duration = XPStyle.getXP().getThemeTransitionDuration(
-                           c, part,
-                           normalizeState(oldState),
-                           normalizeState(newState),
-                           Prop.TRANSITIONDURATIONS);
+                    XPStyle xp = XPStyle.getXP();
+                    duration = (xp != null)
+                               ? xp.getThemeTransitionDuration(
+                                       c, part,
+                                       normalizeState(oldState),
+                                       normalizeState(newState),
+                                       Prop.TRANSITIONDURATIONS)
+                               : 1000;
                 }
                 controller.startAnimation(c, part, oldState, newState, duration);
             }
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, 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
@@ -37,6 +37,7 @@
 import static com.sun.java.swing.plaf.windows.TMSchema.Part;
 import static com.sun.java.swing.plaf.windows.TMSchema.State;
 import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
+
 import sun.swing.DefaultLookup;
 import sun.swing.StringUIClientPropertyKey;
 
@@ -231,6 +232,9 @@
 
     private void paintXPComboBoxBackground(Graphics g, JComponent c) {
         XPStyle xp = XPStyle.getXP();
+        if (xp == null) {
+            return;
+        }
         State state = getXPComboBoxState(c);
         Skin skin = null;
         if (! comboBox.isEditable()
@@ -400,17 +404,18 @@
      * @return a button which represents the popup control
      */
     protected JButton createArrowButton() {
-        if (XPStyle.getXP() != null) {
-            return new XPComboBoxButton();
+        XPStyle xp = XPStyle.getXP();
+        if (xp != null) {
+            return new XPComboBoxButton(xp);
         } else {
             return super.createArrowButton();
         }
     }
 
     private class XPComboBoxButton extends XPStyle.GlyphButton {
-        public XPComboBoxButton() {
+        public XPComboBoxButton(XPStyle xp) {
             super(null,
-                  (! XPStyle.getXP().isSkinDefined(comboBox, Part.CP_DROPDOWNBUTTONRIGHT))
+                  (! xp.isSkinDefined(comboBox, Part.CP_DROPDOWNBUTTONRIGHT))
                    ? Part.CP_DROPDOWNBUTTON
                    : (comboBox.getComponentOrientation() == ComponentOrientation.RIGHT_TO_LEFT)
                      ? Part.CP_DROPDOWNBUTTONLEFT
@@ -423,10 +428,11 @@
         protected State getState() {
             State rv;
             rv = super.getState();
+            XPStyle xp = XPStyle.getXP();
             if (rv != State.DISABLED
                 && comboBox != null && ! comboBox.isEditable()
-                && XPStyle.getXP().isSkinDefined(comboBox,
-                                                 Part.CP_DROPDOWNBUTTONRIGHT)) {
+                && xp != null && xp.isSkinDefined(comboBox,
+                                                  Part.CP_DROPDOWNBUTTONRIGHT)) {
                 /*
                  * for non editable ComboBoxes Vista seems to have the
                  * same glyph for all non DISABLED states
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, 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
@@ -125,6 +125,9 @@
     static void paintXPText(AbstractButton b, Part part, State state,
             Graphics g, int x, int y, String text, int mnemIndex) {
         XPStyle xp = XPStyle.getXP();
+        if (xp == null) {
+            return;
+        }
         Color textColor = b.getForeground();
 
         if (textColor instanceof UIResource) {
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, 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
@@ -613,8 +613,8 @@
 
     private static class MenuArrowIcon implements Icon, UIResource, Serializable {
         public void paintIcon(Component c, Graphics g, int x, int y) {
-            if (WindowsMenuItemUI.isVistaPainting()) {
-                XPStyle xp = XPStyle.getXP();
+            XPStyle xp = XPStyle.getXP();
+            if (WindowsMenuItemUI.isVistaPainting(xp)) {
                 State state = State.NORMAL;
                 if (c instanceof JMenuItem) {
                     state = ((JMenuItem) c).getModel().isEnabled()
@@ -647,16 +647,18 @@
             }
         }
         public int getIconWidth() {
-            if (WindowsMenuItemUI.isVistaPainting()) {
-                Skin skin = XPStyle.getXP().getSkin(null, Part.MP_POPUPSUBMENU);
+            XPStyle xp = XPStyle.getXP();
+            if (WindowsMenuItemUI.isVistaPainting(xp)) {
+                Skin skin = xp.getSkin(null, Part.MP_POPUPSUBMENU);
                 return skin.getWidth();
             } else {
                 return 4;
             }
         }
         public int getIconHeight() {
-            if (WindowsMenuItemUI.isVistaPainting()) {
-                Skin skin = XPStyle.getXP().getSkin(null, Part.MP_POPUPSUBMENU);
+            XPStyle xp = XPStyle.getXP();
+            if (WindowsMenuItemUI.isVistaPainting(xp)) {
+                Skin skin = xp.getSkin(null, Part.MP_POPUPSUBMENU);
                 return skin.getHeight();
             } else {
                 return 8;
@@ -682,7 +684,8 @@
         }
 
         static int getIconWidth() {
-            return XPStyle.getXP().getSkin(null, Part.MP_POPUPCHECK).getWidth()
+            XPStyle xp = XPStyle.getXP();
+            return ((xp != null) ? xp.getSkin(null, Part.MP_POPUPCHECK).getWidth() : 16)
                 + 2 * OFFSET;
         }
 
@@ -745,12 +748,17 @@
                 Icon icon = getIcon();
                 int height = 0;
                 if (icon != null) {
-                    height = icon.getIconHeight() + 2 * OFFSET;
+                    height = icon.getIconHeight();
                 } else {
-                    Skin skin =
-                        XPStyle.getXP().getSkin(null, Part.MP_POPUPCHECK);
-                    height = skin.getHeight() + 2 * OFFSET;
+                    XPStyle xp = XPStyle.getXP();
+                    if (xp != null) {
+                        Skin skin = xp.getSkin(null, Part.MP_POPUPCHECK);
+                        height = skin.getHeight();
+                    } else {
+                        height = 16;
+                    }
                 }
+                height +=  2 * OFFSET;
                 return height;
             }
 
@@ -798,14 +806,16 @@
                                   ? State.BULLETDISABLED
                                   : State.CHECKMARKDISABLED;
                         }
-                        Skin skin;
                         XPStyle xp = XPStyle.getXP();
-                        skin =  xp.getSkin(c, backgroundPart);
-                        skin.paintSkin(g, x, y,
-                            getIconWidth(), getIconHeight(), backgroundState);
-                        if (icon == null) {
-                            skin = xp.getSkin(c, part);
-                            skin.paintSkin(g, x + OFFSET, y + OFFSET, state);
+                        if (xp != null) {
+                            Skin skin;
+                            skin =  xp.getSkin(c, backgroundPart);
+                            skin.paintSkin(g, x, y,
+                                getIconWidth(), getIconHeight(), backgroundState);
+                            if (icon == null) {
+                                skin = xp.getSkin(c, part);
+                                skin.paintSkin(g, x + OFFSET, y + OFFSET, state);
+                            }
                         }
                     }
                 }
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -85,14 +85,15 @@
             }
         } else {
             buttonWidth += 2;
-            selectedTitleGradientColor =
-                    UIManager.getColor("InternalFrame.activeTitleGradient");
-            notSelectedTitleGradientColor =
-                    UIManager.getColor("InternalFrame.inactiveTitleGradient");
             Color activeBorderColor =
                     UIManager.getColor("InternalFrame.activeBorderColor");
             setBorder(BorderFactory.createLineBorder(activeBorderColor, 1));
         }
+        // JDK-8039383: initialize these colors because getXP() may return null when theme is changed
+        selectedTitleGradientColor =
+                UIManager.getColor("InternalFrame.activeTitleGradient");
+        notSelectedTitleGradientColor =
+                UIManager.getColor("InternalFrame.inactiveTitleGradient");
     }
 
     protected void uninstallListeners() {
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Tue Oct 14 12:20:39 2014 -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
@@ -2400,8 +2400,9 @@
         }
 
         public Object getXPValue(UIDefaults table) {
-            Border xpBorder = XPStyle.getXP().getBorder(null, (Part)xpValue);
-            if (extraMargin != null) {
+            XPStyle xp = XPStyle.getXP();
+            Border xpBorder = xp != null ? xp.getBorder(null, (Part)xpValue) : null;
+            if (xpBorder != null && extraMargin != null) {
                 return new BorderUIResource.
                         CompoundBorderUIResource(xpBorder, extraMargin);
             } else {
@@ -2417,7 +2418,8 @@
 
         public Object getXPValue(UIDefaults table) {
             XPColorValueKey key = (XPColorValueKey)xpValue;
-            return XPStyle.getXP().getColor(key.skin, key.prop, null);
+            XPStyle xp = XPStyle.getXP();
+            return xp != null ? xp.getColor(key.skin, key.prop, null) : null;
         }
 
         private static class XPColorValueKey {
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuBarUI.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuBarUI.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, 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
@@ -155,8 +155,8 @@
 
     @Override
     public void paint(Graphics g, JComponent c) {
-        if (WindowsMenuItemUI.isVistaPainting()) {
-            XPStyle xp = XPStyle.getXP();
+        XPStyle xp = XPStyle.getXP();
+        if (WindowsMenuItemUI.isVistaPainting(xp)) {
             Skin skin;
             skin = xp.getSkin(c, Part.MP_BARBACKGROUND);
             int width = c.getWidth();
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, 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
@@ -108,8 +108,9 @@
 
     static void paintBackground(WindowsMenuItemUIAccessor menuItemUI,
             Graphics g, JMenuItem menuItem, Color bgColor) {
-        assert isVistaPainting();
-        if (isVistaPainting()) {
+        XPStyle xp = XPStyle.getXP();
+        assert isVistaPainting(xp);
+        if (isVistaPainting(xp)) {
             int menuWidth = menuItem.getWidth();
             int menuHeight = menuItem.getHeight();
             if (menuItem.isOpaque()) {
@@ -118,7 +119,6 @@
                 g.fillRect(0,0, menuWidth, menuHeight);
                 g.setColor(oldColor);
             }
-            XPStyle xp = XPStyle.getXP();
             Part part = menuItemUI.getPart(menuItem);
             Skin skin = xp.getSkin(menuItem, part);
             skin.paintSkin(g, 0 , 0,
@@ -170,8 +170,11 @@
      * is it possible that in some theme some Vista parts are not defined while
      * others are?
      */
-    static boolean isVistaPainting() {
-        XPStyle xp = XPStyle.getXP();
+    static boolean isVistaPainting(final XPStyle xp) {
         return xp != null && xp.isSkinDefined(null, Part.MP_POPUPITEM);
     }
+
+    static boolean isVistaPainting() {
+        return isVistaPainting(XPStyle.getXP());
+    }
 }
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsPopupMenuSeparatorUI.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsPopupMenuSeparatorUI.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -50,7 +50,8 @@
 
     public void paint(Graphics g, JComponent c) {
         Dimension s = c.getSize();
-        if (WindowsMenuItemUI.isVistaPainting()) {
+        XPStyle xp = XPStyle.getXP();
+        if (WindowsMenuItemUI.isVistaPainting(xp)) {
             int x = 1;
             Component parent = c.getParent();
             if (parent instanceof JComponent) {
@@ -67,7 +68,7 @@
                     x += WindowsPopupMenuUI.getGutterWidth();
                 }
             }
-            Skin skin = XPStyle.getXP().getSkin(c, Part.MP_POPUPSEPARATOR);
+            Skin skin = xp.getSkin(c, Part.MP_POPUPSEPARATOR);
             int skinHeight = skin.getHeight();
             int y = (s.height - skinHeight) / 2;
             skin.paintSkin(g, x, y, s.width - x - 1, skinHeight, State.NORMAL);
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsPopupMenuUI.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsPopupMenuUI.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, 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
@@ -194,8 +194,8 @@
 
     @Override
     public void paint(Graphics g, JComponent c) {
-        if (WindowsMenuItemUI.isVistaPainting()) {
-            XPStyle xp = XPStyle.getXP();
+        XPStyle xp = XPStyle.getXP();
+        if (WindowsMenuItemUI.isVistaPainting(xp)) {
             Skin skin = xp.getSkin(c, Part.MP_POPUPBACKGROUND);
             skin.paintSkin(g, 0, 0, c.getWidth(),c.getHeight(), State.NORMAL);
             int textOffset = getTextOffset(c);
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsProgressBarUI.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsProgressBarUI.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, 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
@@ -317,8 +317,9 @@
     private Rectangle getFullChunkBounds(Rectangle box) {
         boolean vertical = (progressBar.getOrientation() == JProgressBar.VERTICAL);
         XPStyle xp = XPStyle.getXP();
-        int gap = xp.getInt(progressBar, Part.PP_PROGRESS, null,
-                            Prop.PROGRESSSPACESIZE, 0);
+        int gap = (xp != null) ? xp.getInt(progressBar, Part.PP_PROGRESS,
+                                           null, Prop.PROGRESSSPACESIZE, 0)
+                               : 0;
 
         if (!vertical) {
             int chunksize = box.width+gap;
@@ -333,6 +334,9 @@
                                           boolean vertical,
                                           int bgwidth, int bgheight) {
         XPStyle xp = XPStyle.getXP();
+        if (xp == null) {
+            return;
+        }
 
         // create a new graphics to keep drawing surface state
         Graphics2D gfx = (Graphics2D)g.create();
@@ -391,6 +395,9 @@
     private void paintXPBackground(Graphics g, boolean vertical,
                                    int barRectWidth, int barRectHeight) {
         XPStyle xp = XPStyle.getXP();
+        if (xp == null) {
+            return;
+        }
         Part part = vertical ? Part.PP_BARVERT : Part.PP_BAR;
         Skin skin = xp.getSkin(progressBar, part);
 
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsSliderUI.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsSliderUI.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, 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
@@ -215,7 +215,6 @@
     }
 
     private Part getXPThumbPart() {
-        XPStyle xp = XPStyle.getXP();
         Part part;
         boolean vertical = (slider.getOrientation() == JSlider.VERTICAL);
         boolean leftToRight = slider.getComponentOrientation().isLeftToRight();
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsSpinnerUI.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsSpinnerUI.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, 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
@@ -63,6 +63,9 @@
 
     private void paintXPBackground(Graphics g, JComponent c) {
         XPStyle xp = XPStyle.getXP();
+        if (xp == null) {
+            return;
+        }
         Skin skin = xp.getSkin(c, Part.EP_EDIT);
         State state = getXPState(c);
         skin.paintSkin(g, 0, 0, c.getWidth(), c.getHeight(), state);
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, 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
@@ -90,9 +90,10 @@
             this.column = column;
             this.hasRollover = (column == getRolloverColumn());
             if (skin == null) {
-                skin = XPStyle.getXP().getSkin(header, Part.HP_HEADERITEM);
+                XPStyle xp = XPStyle.getXP();
+                skin = (xp != null) ? xp.getSkin(header, Part.HP_HEADERITEM) : null;
             }
-            Insets margins = skin.getContentMargin();
+            Insets margins = (skin != null) ? skin.getContentMargin() : null;
             Border border = null;
             int contentTop = 0;
             int contentLeft = 0;
--- a/src/share/classes/com/sun/java/swing/plaf/windows/XPStyle.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/XPStyle.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -115,7 +115,7 @@
                 }
             }
         }
-        return xp;
+        return ThemeReader.isXPStyleEnabled() ? xp : null;
     }
 
     static boolean isVista() {
@@ -180,9 +180,10 @@
      * should probably be cached there instead of here.
      */
     Dimension getDimension(Component c, Part part, State state, Prop prop) {
-        return ThemeReader.getPosition(part.getControlName(c), part.getValue(),
-                                       State.getValue(part, state),
-                                       prop.getValue());
+        Dimension d = ThemeReader.getPosition(part.getControlName(c), part.getValue(),
+                                              State.getValue(part, state),
+                                              prop.getValue());
+        return (d != null) ? d : new Dimension();
     }
 
     /** Get a named <code>Point</code> (e.g. a location or an offset) value
@@ -199,11 +200,7 @@
         Dimension d = ThemeReader.getPosition(part.getControlName(c), part.getValue(),
                                               State.getValue(part, state),
                                               prop.getValue());
-        if (d != null) {
-            return new Point(d.width, d.height);
-        } else {
-            return null;
-        }
+        return (d != null) ? new Point(d.width, d.height) : new Point();
     }
 
     /** Get a named <code>Insets</code> value from the current style
@@ -217,9 +214,10 @@
      * The return value is already cached in those places.
      */
     Insets getMargin(Component c, Part part, State state, Prop prop) {
-        return ThemeReader.getThemeMargins(part.getControlName(c), part.getValue(),
-                                           State.getValue(part, state),
-                                           prop.getValue());
+        Insets insets = ThemeReader.getThemeMargins(part.getControlName(c), part.getValue(),
+                                                    State.getValue(part, state),
+                                                    prop.getValue());
+        return (insets != null) ? insets : new Insets(0, 0, 0, 0);
     }
 
 
@@ -505,16 +503,17 @@
             int boundingWidth = 100;
             int boundingHeight = 100;
 
-            return ThemeReader.getThemeBackgroundContentMargins(
+            Insets insets = ThemeReader.getThemeBackgroundContentMargins(
                 part.getControlName(null), part.getValue(),
                 0, boundingWidth, boundingHeight);
+            return (insets != null) ? insets : new Insets(0, 0, 0, 0);
         }
 
         private int getWidth(State state) {
             if (size == null) {
                 size = getPartSize(part, state);
             }
-            return size.width;
+            return (size != null) ? size.width : 0;
         }
 
         int getWidth() {
@@ -525,7 +524,7 @@
             if (size == null) {
                 size = getPartSize(part, state);
             }
-            return size.height;
+            return (size != null) ? size.height : 0;
         }
 
         int getHeight() {
@@ -582,6 +581,9 @@
          * @param state which state to paint
          */
         void paintSkin(Graphics g, int dx, int dy, int dw, int dh, State state) {
+            if (XPStyle.getXP() == null) {
+                return;
+            }
             if (ThemeReader.isGetThemeTransitionDurationDefined()
                   && component instanceof JComponent
                   && SwingUtilities.getAncestorOfClass(CellRendererPane.class,
@@ -607,6 +609,9 @@
          * @param state which state to paint
          */
         void paintSkinRaw(Graphics g, int dx, int dy, int dw, int dh, State state) {
+            if (XPStyle.getXP() == null) {
+                return;
+            }
             skinPainter.paint(null, g, dx, dy, dw, dh, this, state);
         }
 
@@ -625,6 +630,9 @@
          */
         void paintSkin(Graphics g, int dx, int dy, int dw, int dh, State state,
                 boolean borderFill) {
+            if (XPStyle.getXP() == null) {
+                return;
+            }
             if(borderFill && "borderfill".equals(getTypeEnumName(component, part,
                     state, Prop.BGTYPE))) {
                 return;
@@ -679,7 +687,7 @@
 
         public GlyphButton(Component parent, Part part) {
             XPStyle xp = getXP();
-            skin = xp.getSkin(parent, part);
+            skin = xp != null ? xp.getSkin(parent, part) : null;
             setBorder(null);
             setContentAreaFilled(false);
             setMinimumSize(new Dimension(5, 5));
@@ -704,13 +712,16 @@
         }
 
         public void paintComponent(Graphics g) {
+            if (XPStyle.getXP() == null || skin == null) {
+                return;
+            }
             Dimension d = getSize();
             skin.paintSkin(g, 0, 0, d.width, d.height, getState());
         }
 
         public void setPart(Component parent, Part part) {
             XPStyle xp = getXP();
-            skin = xp.getSkin(parent, part);
+            skin = xp != null ? xp.getSkin(parent, part) : null;
             revalidate();
             repaint();
         }
--- a/src/share/classes/java/awt/event/MouseEvent.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/java/awt/event/MouseEvent.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -758,7 +758,6 @@
 
             if (getModifiersEx() != 0) { //There is at least one more button in a pressed state.
                 if (id == MouseEvent.MOUSE_RELEASED || id == MouseEvent.MOUSE_CLICKED){
-                    System.out.println("MEvent. CASE!");
                     shouldExcludeButtonFromExtModifiers = true;
                 }
             }
--- a/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -41,8 +41,8 @@
 public class IndexedPropertyDescriptor extends PropertyDescriptor {
 
     private Reference<Class> indexedPropertyTypeRef;
-    private Reference<Method> indexedReadMethodRef;
-    private Reference<Method> indexedWriteMethodRef;
+    private final MethodRef indexedReadMethodRef = new MethodRef();
+    private final MethodRef indexedWriteMethodRef = new MethodRef();
 
     private String indexedReadMethodName;
     private String indexedWriteMethodName;
@@ -173,11 +173,11 @@
      * May return null if the property isn't indexed or is write-only.
      */
     public synchronized Method getIndexedReadMethod() {
-        Method indexedReadMethod = getIndexedReadMethod0();
+        Method indexedReadMethod = this.indexedReadMethodRef.get();
         if (indexedReadMethod == null) {
             Class cls = getClass0();
             if (cls == null ||
-                (indexedReadMethodName == null && indexedReadMethodRef == null)) {
+                (indexedReadMethodName == null && !this.indexedReadMethodRef.isSet())) {
                 // the Indexed readMethod was explicitly set to null.
                 return null;
             }
@@ -213,20 +213,19 @@
 
         // the indexed property type is set by the reader.
         setIndexedPropertyType(findIndexedPropertyType(readMethod,
-                                                       getIndexedWriteMethod0()));
+                                                       this.indexedWriteMethodRef.get()));
         setIndexedReadMethod0(readMethod);
     }
 
     private void setIndexedReadMethod0(Method readMethod) {
+        this.indexedReadMethodRef.set(readMethod);
         if (readMethod == null) {
             indexedReadMethodName = null;
-            indexedReadMethodRef = null;
             return;
         }
         setClass0(readMethod.getDeclaringClass());
 
         indexedReadMethodName = readMethod.getName();
-        this.indexedReadMethodRef = getSoftReference(readMethod);
         setTransient(readMethod.getAnnotation(Transient.class));
     }
 
@@ -239,11 +238,11 @@
      * May return null if the property isn't indexed or is read-only.
      */
     public synchronized Method getIndexedWriteMethod() {
-        Method indexedWriteMethod = getIndexedWriteMethod0();
+        Method indexedWriteMethod = this.indexedWriteMethodRef.get();
         if (indexedWriteMethod == null) {
             Class cls = getClass0();
             if (cls == null ||
-                (indexedWriteMethodName == null && indexedWriteMethodRef == null)) {
+                (indexedWriteMethodName == null && !this.indexedWriteMethodRef.isSet())) {
                 // the Indexed writeMethod was explicitly set to null.
                 return null;
             }
@@ -297,15 +296,14 @@
     }
 
     private void setIndexedWriteMethod0(Method writeMethod) {
+        this.indexedWriteMethodRef.set(writeMethod);
         if (writeMethod == null) {
             indexedWriteMethodName = null;
-            indexedWriteMethodRef = null;
             return;
         }
         setClass0(writeMethod.getDeclaringClass());
 
         indexedWriteMethodName = writeMethod.getName();
-        this.indexedWriteMethodRef = getSoftReference(writeMethod);
         setTransient(writeMethod.getAnnotation(Transient.class));
     }
 
@@ -345,18 +343,6 @@
                 : null;
     }
 
-    private Method getIndexedReadMethod0() {
-        return (this.indexedReadMethodRef != null)
-                ? this.indexedReadMethodRef.get()
-                : null;
-    }
-
-    private Method getIndexedWriteMethod0() {
-        return (this.indexedWriteMethodRef != null)
-                ? this.indexedWriteMethodRef.get()
-                : null;
-    }
-
     private Class findIndexedPropertyType(Method indexedReadMethod,
                                           Method indexedWriteMethod)
         throws IntrospectionException {
@@ -488,8 +474,8 @@
      */
     IndexedPropertyDescriptor(IndexedPropertyDescriptor old) {
         super(old);
-        indexedReadMethodRef = old.indexedReadMethodRef;
-        indexedWriteMethodRef = old.indexedWriteMethodRef;
+        this.indexedReadMethodRef.set(old.indexedReadMethodRef.get());
+        this.indexedWriteMethodRef.set(old.indexedWriteMethodRef.get());
         indexedPropertyTypeRef = old.indexedPropertyTypeRef;
         indexedWriteMethodName = old.indexedWriteMethodName;
         indexedReadMethodName = old.indexedReadMethodName;
@@ -498,7 +484,7 @@
     void updateGenericsFor(Class<?> type) {
         super.updateGenericsFor(type);
         try {
-            setIndexedPropertyType(findIndexedPropertyType(getIndexedReadMethod0(), getIndexedWriteMethod0()));
+            setIndexedPropertyType(findIndexedPropertyType(this.indexedReadMethodRef.get(), this.indexedWriteMethodRef.get()));
         }
         catch (IntrospectionException exception) {
             setIndexedPropertyType(null);
@@ -528,7 +514,7 @@
     void appendTo(StringBuilder sb) {
         super.appendTo(sb);
         appendTo(sb, "indexedPropertyType", this.indexedPropertyTypeRef);
-        appendTo(sb, "indexedReadMethod", this.indexedReadMethodRef);
-        appendTo(sb, "indexedWriteMethod", this.indexedWriteMethodRef);
+        appendTo(sb, "indexedReadMethod", this.indexedReadMethodRef.get());
+        appendTo(sb, "indexedWriteMethod", this.indexedWriteMethodRef.get());
     }
 }
--- a/src/share/classes/java/beans/MethodDescriptor.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/java/beans/MethodDescriptor.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -38,7 +38,7 @@
 
 public class MethodDescriptor extends FeatureDescriptor {
 
-    private Reference<Method> methodRef;
+    private final MethodRef methodRef = new MethodRef();
 
     private String[] paramNames;
 
@@ -79,7 +79,7 @@
      * @return The low-level description of the method
      */
     public synchronized Method getMethod() {
-        Method method = getMethod0();
+        Method method = this.methodRef.get();
         if (method == null) {
             Class cls = getClass0();
             String name = getName();
@@ -112,13 +112,7 @@
             setClass0(method.getDeclaringClass());
         }
         setParams(getParameterTypes(getClass0(), method));
-        this.methodRef = getSoftReference(method);
-    }
-
-    private Method getMethod0() {
-        return (this.methodRef != null)
-                ? this.methodRef.get()
-                : null;
+        this.methodRef.set(method);
     }
 
     private synchronized void setParams(Class[] param) {
@@ -173,12 +167,10 @@
      */
 
     MethodDescriptor(MethodDescriptor x, MethodDescriptor y) {
-        super(x,y);
+        super(x, y);
 
-        methodRef = x.methodRef;
-        if (y.methodRef != null) {
-            methodRef = y.methodRef;
-        }
+        Method method = y.methodRef.get();
+        this.methodRef.set(null != method ? method : x.methodRef.get());
         params = x.params;
         if (y.params != null) {
             params = y.params;
@@ -201,7 +193,7 @@
     MethodDescriptor(MethodDescriptor old) {
         super(old);
 
-        methodRef = old.methodRef;
+        this.methodRef.set(old.getMethod());
         params = old.params;
         paramNames = old.paramNames;
 
@@ -215,7 +207,7 @@
     }
 
     void appendTo(StringBuilder sb) {
-        appendTo(sb, "method", this.methodRef);
+        appendTo(sb, "method", this.methodRef.get());
         if (this.parameterDescriptors != null) {
             sb.append("; parameterDescriptors={");
             for (ParameterDescriptor pd : this.parameterDescriptors) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/beans/MethodRef.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 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.
+ */
+
+package java.beans;
+
+import java.lang.ref.SoftReference;
+import java.lang.ref.WeakReference;
+import java.lang.reflect.Method;
+
+import static sun.reflect.misc.ReflectUtil.isPackageAccessible;
+
+final class MethodRef {
+    private String signature;
+    private SoftReference<Method> methodRef;
+    private WeakReference<Class<?>> typeRef;
+
+    void set(Method method) {
+        if (method == null) {
+            this.signature = null;
+            this.methodRef = null;
+            this.typeRef = null;
+        }
+        else {
+            this.signature = method.toGenericString();
+            this.methodRef = new SoftReference<>(method);
+            this.typeRef = new WeakReference<Class<?>>(method.getDeclaringClass());
+        }
+    }
+
+    boolean isSet() {
+        return this.methodRef != null;
+    }
+
+    Method get() {
+        if (this.methodRef == null) {
+            return null;
+        }
+        Method method = this.methodRef.get();
+        if (method == null) {
+            method = find(this.typeRef.get(), this.signature);
+            if (method == null) {
+                this.signature = null;
+                this.methodRef = null;
+                this.typeRef = null;
+            }
+            else {
+                this.methodRef = new SoftReference<>(method);
+            }
+        }
+        return isPackageAccessible(method.getDeclaringClass()) ? method : null;
+    }
+
+    private static Method find(Class<?> type, String signature) {
+        if (type != null) {
+            for (Method method : type.getMethods()) {
+                if (type.equals(method.getDeclaringClass())) {
+                    if (method.toGenericString().equals(signature)) {
+                        return method;
+                    }
+                }
+            }
+        }
+        return null;
+    }
+}
--- a/src/share/classes/java/beans/PropertyDescriptor.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/java/beans/PropertyDescriptor.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -36,8 +36,8 @@
 public class PropertyDescriptor extends FeatureDescriptor {
 
     private Reference<Class> propertyTypeRef;
-    private Reference<Method> readMethodRef;
-    private Reference<Method> writeMethodRef;
+    private final MethodRef readMethodRef = new MethodRef();
+    private final MethodRef writeMethodRef = new MethodRef();
     private Reference<Class> propertyEditorClassRef;
 
     private boolean bound;
@@ -68,8 +68,8 @@
     public PropertyDescriptor(String propertyName, Class<?> beanClass)
                 throws IntrospectionException {
         this(propertyName, beanClass,
-             Introspector.IS_PREFIX + NameGenerator.capitalize(propertyName),
-             Introspector.SET_PREFIX + NameGenerator.capitalize(propertyName));
+                Introspector.IS_PREFIX + NameGenerator.capitalize(propertyName),
+                Introspector.SET_PREFIX + NameGenerator.capitalize(propertyName));
     }
 
     /**
@@ -203,10 +203,10 @@
      * May return null if the property can't be read.
      */
     public synchronized Method getReadMethod() {
-        Method readMethod = getReadMethod0();
+        Method readMethod = this.readMethodRef.get();
         if (readMethod == null) {
             Class cls = getClass0();
-            if (cls == null || (readMethodName == null && readMethodRef == null)) {
+            if (cls == null || (readMethodName == null && !this.readMethodRef.isSet())) {
                 // The read method was explicitly set to null.
                 return null;
             }
@@ -246,17 +246,16 @@
      */
     public synchronized void setReadMethod(Method readMethod)
                                 throws IntrospectionException {
+        this.readMethodRef.set(readMethod);
         if (readMethod == null) {
             readMethodName = null;
-            readMethodRef = null;
             return;
         }
         // The property type is determined by the read method.
-        setPropertyType(findPropertyType(readMethod, getWriteMethod0()));
+        setPropertyType(findPropertyType(readMethod, this.writeMethodRef.get()));
         setClass0(readMethod.getDeclaringClass());
 
         readMethodName = readMethod.getName();
-        this.readMethodRef = getSoftReference(readMethod);
         setTransient(readMethod.getAnnotation(Transient.class));
     }
 
@@ -267,10 +266,10 @@
      * May return null if the property can't be written.
      */
     public synchronized Method getWriteMethod() {
-        Method writeMethod = getWriteMethod0();
+        Method writeMethod = this.writeMethodRef.get();
         if (writeMethod == null) {
             Class cls = getClass0();
-            if (cls == null || (writeMethodName == null && writeMethodRef == null)) {
+            if (cls == null || (writeMethodName == null && !this.writeMethodRef.isSet())) {
                 // The write method was explicitly set to null.
                 return null;
             }
@@ -316,9 +315,9 @@
      */
     public synchronized void setWriteMethod(Method writeMethod)
                                 throws IntrospectionException {
+        this.writeMethodRef.set(writeMethod);
         if (writeMethod == null) {
             writeMethodName = null;
-            writeMethodRef = null;
             return;
         }
         // Set the property type - which validates the method
@@ -326,22 +325,9 @@
         setClass0(writeMethod.getDeclaringClass());
 
         writeMethodName = writeMethod.getName();
-        this.writeMethodRef = getSoftReference(writeMethod);
         setTransient(writeMethod.getAnnotation(Transient.class));
     }
 
-    private Method getReadMethod0() {
-        return (this.readMethodRef != null)
-                ? this.readMethodRef.get()
-                : null;
-    }
-
-    private Method getWriteMethod0() {
-        return (this.writeMethodRef != null)
-                ? this.writeMethodRef.get()
-                : null;
-    }
-
     /**
      * Overridden to ensure that a super class doesn't take precedent
      */
@@ -618,8 +604,8 @@
     PropertyDescriptor(PropertyDescriptor old) {
         super(old);
         propertyTypeRef = old.propertyTypeRef;
-        readMethodRef = old.readMethodRef;
-        writeMethodRef = old.writeMethodRef;
+        this.readMethodRef.set(old.readMethodRef.get());
+        this.writeMethodRef.set(old.writeMethodRef.get());
         propertyEditorClassRef = old.propertyEditorClassRef;
 
         writeMethodName = old.writeMethodName;
@@ -633,7 +619,7 @@
     void updateGenericsFor(Class<?> type) {
         setClass0(type);
         try {
-            setPropertyType(findPropertyType(getReadMethod0(), getWriteMethod0()));
+            setPropertyType(findPropertyType(this.readMethodRef.get(), this.writeMethodRef.get()));
         }
         catch (IntrospectionException exception) {
             setPropertyType(null);
@@ -724,8 +710,8 @@
         appendTo(sb, "constrained", this.constrained);
         appendTo(sb, "propertyEditorClass", this.propertyEditorClassRef);
         appendTo(sb, "propertyType", this.propertyTypeRef);
-        appendTo(sb, "readMethod", this.readMethodRef);
-        appendTo(sb, "writeMethod", this.writeMethodRef);
+        appendTo(sb, "readMethod", this.readMethodRef.get());
+        appendTo(sb, "writeMethod", this.writeMethodRef.get());
     }
 
     private boolean isAssignable(Method m1, Method m2) {
--- a/src/share/classes/java/lang/ClassValue.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/java/lang/ClassValue.java	Tue Oct 14 12:20:39 2014 -0700
@@ -489,9 +489,18 @@
         /** Remove an entry. */
         synchronized
         void removeEntry(ClassValue<?> classValue) {
-            // make all cache elements for this guy go stale:
-            if (remove(classValue.identity) != null) {
+            Entry<?> e = remove(classValue.identity);
+            if (e == null) {
+                // Uninitialized, and no pending calls to computeValue.  No change.
+            } else if (e.isPromise()) {
+                // State is uninitialized, with a pending call to finishEntry.
+                // Since remove is a no-op in such a state, keep the promise
+                // by putting it back into the map.
+                put(classValue.identity, e);
+            } else {
+                // In an initialized state.  Bump forward, and de-initialize.
                 classValue.bumpVersion();
+                // Make all cache elements for this guy go stale.
                 removeStaleEntries(classValue);
             }
         }
--- a/src/share/classes/java/net/InetAddress.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/java/net/InetAddress.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1128,7 +1128,7 @@
             // see if it is IPv4 address
             addr = IPAddressUtil.textToNumericFormatV4(host);
             if (addr == null) {
-                // see if it is IPv6 address
+                // This is supposed to be an IPv6 literal
                 // Check if a numeric or string zone id is present
                 int pos;
                 if ((pos=host.indexOf ("%")) != -1) {
@@ -1137,7 +1137,9 @@
                         ifname = host.substring (pos+1);
                     }
                 }
-                addr = IPAddressUtil.textToNumericFormatV6(host);
+                if ((addr = IPAddressUtil.textToNumericFormatV6(host)) == null && host.contains(":")) {
+                    throw new UnknownHostException(host + ": invalid IPv6 address");
+                }
             } else if (ipv6Expected) {
                 // Means an IPv4 litteral between brackets!
                 throw new UnknownHostException("["+host+"]");
@@ -1155,10 +1157,10 @@
                 }
                 return ret;
             }
-            } else if (ipv6Expected) {
-                // We were expecting an IPv6 Litteral, but got something else
-                throw new UnknownHostException("["+host+"]");
-            }
+        } else if (ipv6Expected) {
+            // We were expecting an IPv6 Litteral, but got something else
+            throw new UnknownHostException("["+host+"]");
+        }
         return getAllByName0(host, reqAddr, true);
     }
 
--- a/src/share/classes/javax/swing/JPopupMenu.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/javax/swing/JPopupMenu.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, 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
@@ -735,7 +735,7 @@
 
             if (pref == null || pref.width != getWidth() ||
                                 pref.height != getHeight()) {
-                popup = getPopup();
+                showPopup();
             } else {
                 validate();
             }
@@ -786,7 +786,7 @@
 
         if(b) {
             firePopupMenuWillBecomeVisible();
-            popup = getPopup();
+            showPopup();
             firePropertyChange("visible", Boolean.FALSE, Boolean.TRUE);
 
 
@@ -804,7 +804,7 @@
     }
 
     /**
-     * Returns a <code>Popup</code> instance from the
+     * Retrieves <code>Popup</code> instance from the
      * <code>PopupMenuUI</code> that has had <code>show</code> invoked on
      * it. If the current <code>popup</code> is non-null,
      * this will invoke <code>dispose</code> of it, and then
@@ -813,7 +813,7 @@
      * This does NOT fire any events, it is up the caller to dispatch
      * the necessary events.
      */
-    private Popup getPopup() {
+    private void showPopup() {
         Popup oldPopup = popup;
 
         if (oldPopup != null) {
@@ -837,8 +837,8 @@
                                           desiredLocationY);
 
         popupFactory.setPopupType(PopupFactory.LIGHT_WEIGHT_POPUP);
+        popup = newPopup;
         newPopup.show();
-        return newPopup;
     }
 
     /**
@@ -867,7 +867,7 @@
         desiredLocationX = x;
         desiredLocationY = y;
         if(popup != null && (x != oldX || y != oldY)) {
-            popup = getPopup();
+            showPopup();
         }
     }
 
@@ -1024,7 +1024,7 @@
             Dimension newSize = getPreferredSize();
 
             if (!oldSize.equals(newSize)) {
-                popup = getPopup();
+                showPopup();
             }
         }
     }
--- a/src/share/classes/javax/swing/MenuSelectionManager.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/javax/swing/MenuSelectionManager.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, 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
@@ -30,6 +30,7 @@
 import javax.swing.event.*;
 
 import sun.awt.AppContext;
+import sun.swing.SwingUtilities2;
 
 /**
  * A MenuSelectionManager owns the selection in menu hierarchy.
@@ -60,6 +61,12 @@
             if (msm == null) {
                 msm = new MenuSelectionManager();
                 context.put(MENU_SELECTION_MANAGER_KEY, msm);
+
+                // installing additional listener if found in the AppContext
+                Object o = context.get(SwingUtilities2.MENU_SELECTION_MANAGER_LISTENER_KEY);
+                if (o != null && o instanceof ChangeListener) {
+                    msm.addChangeListener((ChangeListener) o);
+                }
             }
 
             return msm;
--- a/src/share/classes/javax/swing/PopupFactory.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/javax/swing/PopupFactory.java	Tue Oct 14 12:20:39 2014 -0700
@@ -25,10 +25,14 @@
 
 package javax.swing;
 
+import sun.awt.EmbeddedFrame;
+import sun.awt.OSInfo;
+
 import java.applet.Applet;
 import java.awt.*;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
+import java.security.AccessController;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -226,7 +230,13 @@
         case MEDIUM_WEIGHT_POPUP:
             return getMediumWeightPopup(owner, contents, ownerX, ownerY);
         case HEAVY_WEIGHT_POPUP:
-            return getHeavyWeightPopup(owner, contents, ownerX, ownerY);
+            Popup popup = getHeavyWeightPopup(owner, contents, ownerX, ownerY);
+            if ((AccessController.doPrivileged(OSInfo.getOSTypeAction()) ==
+                OSInfo.OSType.MACOSX) && (owner != null) &&
+                (EmbeddedFrame.getAppletIfAncestorOf(owner) != null)) {
+                ((HeavyWeightPopup)popup).setCacheEnabled(false);
+            }
+            return popup;
         }
         return null;
     }
@@ -294,6 +304,8 @@
         private static final Object heavyWeightPopupCacheKey =
                  new StringBuffer("PopupFactory.heavyWeightPopupCache");
 
+        private volatile boolean isCacheEnabled = true;
+
         /**
          * Returns either a new or recycled <code>Popup</code> containing
          * the specified children.
@@ -448,12 +460,23 @@
             }
         }
 
+        /**
+         * Enables or disables cache for current object.
+         */
+        void setCacheEnabled(boolean enable) {
+            isCacheEnabled = enable;
+        }
+
         //
         // Popup methods
         //
         public void hide() {
             super.hide();
-            recycleHeavyWeightPopup(this);
+            if (isCacheEnabled) {
+                recycleHeavyWeightPopup(this);
+            } else {
+                this._dispose();
+            }
         }
 
         /**
--- a/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java	Tue Oct 14 12:20:39 2014 -0700
@@ -30,6 +30,11 @@
 import java.util.*;
 import java.awt.FocusTraversalPolicy;
 import sun.util.logging.PlatformLogger;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import sun.security.action.GetPropertyAction;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 /**
  * A FocusTraversalPolicy that determines traversal order by sorting the
@@ -89,6 +94,34 @@
     final private int FORWARD_TRAVERSAL = 0;
     final private int BACKWARD_TRAVERSAL = 1;
 
+    /*
+     * When true (by default), the legacy merge-sort algo is used to sort an FTP cycle.
+     * When false, the default (tim-sort) algo is used, which may lead to an exception.
+     * See: JDK-8048887
+     */
+    private static final boolean legacySortingFTPEnabled;
+    private static final Method legacyMergeSortMethod;
+
+    static {
+        legacySortingFTPEnabled = "true".equals(AccessController.doPrivileged(
+            new GetPropertyAction("swing.legacySortingFTPEnabled", "true")));
+        legacyMergeSortMethod = legacySortingFTPEnabled ?
+            AccessController.doPrivileged(new PrivilegedAction<Method>() {
+                public Method run() {
+                    try {
+                        Class c = Class.forName("java.util.Arrays");
+                        Method m = c.getDeclaredMethod("legacyMergeSort", new Class[]{Object[].class, Comparator.class});
+                        m.setAccessible(true);
+                        return m;
+                    } catch (ClassNotFoundException | NoSuchMethodException e) {
+                        // using default sorting algo
+                        return null;
+                    }
+                }
+            }) :
+            null;
+    }
+
     /**
      * Constructs a SortingFocusTraversalPolicy without a Comparator.
      * Subclasses must set the Comparator using <code>setComparator</code>
@@ -133,10 +166,32 @@
     private void enumerateAndSortCycle(Container focusCycleRoot, List<Component> cycle) {
         if (focusCycleRoot.isShowing()) {
             enumerateCycle(focusCycleRoot, cycle);
-            Collections.sort(cycle, comparator);
+            if (!legacySortingFTPEnabled ||
+                !legacySort(cycle, comparator))
+            {
+                Collections.sort(cycle, comparator);
+            }
         }
     }
 
+    private boolean legacySort(List<Component> l, Comparator<? super Component> c) {
+        if (legacyMergeSortMethod == null)
+            return false;
+
+        Object[] a = l.toArray();
+        try {
+            legacyMergeSortMethod.invoke(null, a, c);
+        } catch (IllegalAccessException | InvocationTargetException e) {
+            return false;
+        }
+        ListIterator<Component> i = l.listIterator();
+        for (Object e : a) {
+            i.next();
+            i.set((Component)e);
+        }
+        return true;
+    }
+
     private void enumerateCycle(Container container, List<Component> cycle) {
         if (!(container.isVisible() && container.isDisplayable())) {
             return;
--- a/src/share/classes/javax/swing/plaf/nimbus/skin.laf	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/nimbus/skin.laf	Tue Oct 14 12:20:39 2014 -0700
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <!--
- Copyright (c) 1998, 2010, 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
@@ -13424,10 +13424,10 @@
             <state stateKeys="Selected">
                 <style>
                    <textForeground>
-                      <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                      <matte red="255" green="255" blue="255" alpha="255" uiDefaultParentName="nimbusLightBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
                    </textForeground>
                    <textBackground>
-                      <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                      <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
                    </textBackground>
                    <background/>
                    <inherit-textForeground>false</inherit-textForeground>
@@ -13453,7 +13453,7 @@
                 <style>
                    <textForeground/>
                    <textBackground>
-                       <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                       <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
                    </textBackground>
                    <background/>
                    <inherit-textBackground>false</inherit-textBackground>
@@ -13477,7 +13477,7 @@
             <state stateKeys="Disabled">
                 <style>
                    <textForeground>
-                      <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                      <matte red="142" green="143" blue="145" alpha="255" uiDefaultParentName="nimbusDisabledText" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
                    </textForeground>
                    <textBackground/>
                    <background/>
@@ -13520,7 +13520,7 @@
                         </textForeground>
                         <textBackground/>
                         <background>
-                           <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0" uiResource="false"/>
+                           <matte red="57" green="105" blue="138" alpha="255" uiDefaultParentName="nimbusSelectionBackground" hueOffset="0.0" saturationOffset="0.0" brightnessOffset="0.0" alphaOffset="0"/>
                         </background>
                         <inherit-textForeground>false</inherit-textForeground>
                         <inherit-background>false</inherit-background>
--- a/src/share/classes/sun/awt/image/BytePackedRaster.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/sun/awt/image/BytePackedRaster.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1408,10 +1408,10 @@
             }
         }
 
-        long lastbit = (long) dataBitOffset
-                       + (long) (height - 1) * (long) scanlineStride * 8
-                       + (long) (width - 1) * (long) pixelBitStride
-                       + (long) pixelBitStride - 1;
+        int lastbit = (dataBitOffset
+                       + (height-1) * scanlineStride * 8
+                       + (width-1) * pixelBitStride
+                       + pixelBitStride - 1);
         if (lastbit < 0 || lastbit / 8 >= data.length) {
             throw new RasterFormatException("raster dimensions overflow " +
                                             "array bounds");
--- a/src/share/classes/sun/net/www/http/HttpClient.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/sun/net/www/http/HttpClient.java	Tue Oct 14 12:20:39 2014 -0700
@@ -651,7 +651,9 @@
                     // try once more
                     openServer();
                     if (needsTunneling()) {
+                        MessageHeader origRequests = requests;
                         httpuc.doTunneling();
+                        requests = origRequests;
                     }
                     afterConnect();
                     writeRequests(requests, poster);
@@ -762,7 +764,9 @@
                         cachedHttpClient = false;
                         openServer();
                         if (needsTunneling()) {
+                            MessageHeader origRequests = requests;
                             httpuc.doTunneling();
+                            requests = origRequests;
                         }
                         afterConnect();
                         writeRequests(requests, poster);
--- a/src/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java	Tue Oct 14 12:20:39 2014 -0700
@@ -301,7 +301,7 @@
             throw new IOException(fe);
         }
         try {
-            ftp.login(user, password.toCharArray());
+            ftp.login(user, password == null ? null : password.toCharArray());
         } catch (sun.net.ftp.FtpProtocolException e) {
             ftp.close();
             // Backward compatibility
--- a/src/share/classes/sun/net/www/protocol/http/NegotiateAuthentication.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/sun/net/www/protocol/http/NegotiateAuthentication.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2009, 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
@@ -32,6 +32,7 @@
 import sun.net.www.HeaderParser;
 import sun.misc.BASE64Decoder;
 import sun.misc.BASE64Encoder;
+import sun.util.logging.PlatformLogger;
 import static sun.net.www.protocol.http.AuthScheme.NEGOTIATE;
 import static sun.net.www.protocol.http.AuthScheme.KERBEROS;
 
@@ -45,6 +46,7 @@
 class NegotiateAuthentication extends AuthenticationInfo {
 
     private static final long serialVersionUID = 100L;
+    private static final PlatformLogger logger = HttpURLConnection.getHttpLogger();
 
     final private HttpCallerInfo hci;
 
@@ -80,6 +82,31 @@
     }
 
     /**
+     * Find out if the HttpCallerInfo supports Negotiate protocol.
+     * @return true if supported
+     */
+    public static boolean isSupported(HttpCallerInfo hci) {
+        ClassLoader loader = null;
+        try {
+            loader = Thread.currentThread().getContextClassLoader();
+        } catch (SecurityException se) {
+            if (logger.isLoggable(PlatformLogger.Level.FINER)) {
+                logger.finer("NegotiateAuthentication: " +
+                    "Attempt to get the context class loader failed - " + se);
+            }
+        }
+
+        if (loader != null) {
+            // Lock on the class loader instance to avoid the deadlock engaging
+            // the lock in "ClassLoader.loadClass(String, boolean)" method.
+            synchronized (loader) {
+                return isSupportedImpl(hci);
+            }
+        }
+        return isSupportedImpl(hci);
+    }
+
+    /**
      * Find out if the HttpCallerInfo supports Negotiate protocol. In order to
      * find out yes or no, an initialization of a Negotiator object against it
      * is tried. The generated object will be cached under the name of ths
@@ -90,7 +117,7 @@
      *
      * @return true if supported
      */
-    synchronized public static boolean isSupported(HttpCallerInfo hci) {
+    private static synchronized boolean isSupportedImpl(HttpCallerInfo hci) {
         if (supported == null) {
             supported = new HashMap <String, Boolean>();
             cache = new HashMap <String, Negotiator>();
--- a/src/share/classes/sun/security/pkcs/SignerInfo.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/sun/security/pkcs/SignerInfo.java	Tue Oct 14 12:20:39 2014 -0700
@@ -273,24 +273,6 @@
         return certList;
     }
 
-    // Copied from com.sun.crypto.provider.OAEPParameters.
-    private static String convertToStandardName(String internalName) {
-        if (internalName.equals("SHA")) {
-            return "SHA-1";
-        } else if (internalName.equals("SHA224")) {
-            return "SHA-224";
-        } else if (internalName.equals("SHA256")) {
-            return "SHA-256";
-        } else if (internalName.equals("SHA384")) {
-            return "SHA-384";
-        } else if (internalName.equals("SHA512")) {
-            return "SHA-512";
-        } else {
-            return internalName;
-        }
-    }
-
-
     /* Returns null if verify fails, this signerInfo if
        verify succeeds. */
     SignerInfo verify(PKCS7 block, byte[] data)
@@ -330,7 +312,7 @@
                     return null;
 
                 MessageDigest md = MessageDigest.getInstance(
-                        convertToStandardName(digestAlgname));
+                        AlgorithmId.getStandardDigestName(digestAlgname));
                 byte[] computedMessageDigest = md.digest(data);
 
                 if (messageDigest.length != computedMessageDigest.length)
--- a/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java	Tue Oct 14 12:20:39 2014 -0700
@@ -375,20 +375,22 @@
         boolean add = false;
         for (AccessDescription ad : adList) {
             CertStore cs = URICertStore.getInstance(ad);
-            try {
-                if (certs.addAll((Collection<X509Certificate>)
-                    cs.getCertificates(caSelector))) {
-                    add = true;
-                    if (!searchAllCertStores) {
-                        return true;
+            if (cs != null) {
+                try {
+                    if (certs.addAll((Collection<X509Certificate>)
+                            cs.getCertificates(caSelector))) {
+                        add = true;
+                        if (!searchAllCertStores) {
+                            return true;
+                        }
                     }
+                } catch (CertStoreException cse) {
+                    if (debug != null) {
+                        debug.println("exception getting certs from CertStore:");
+                        cse.printStackTrace();
+                    }
+                    continue;
                 }
-            } catch (CertStoreException cse) {
-                if (debug != null) {
-                    debug.println("exception getting certs from CertStore:");
-                    cse.printStackTrace();
-                }
-                continue;
             }
         }
         return add;
--- a/src/share/classes/sun/security/ssl/DHCrypt.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/sun/security/ssl/DHCrypt.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -188,7 +188,7 @@
      *         the same size as the Diffie-Hellman modulus.
      */
     SecretKey getAgreedSecret(BigInteger peerPublicValue,
-            boolean keyIsValidated) throws IOException {
+            boolean keyIsValidated) throws SSLHandshakeException {
         try {
             KeyFactory kf = JsseJce.getKeyFactory("DiffieHellman");
             DHPublicKeySpec spec =
@@ -211,7 +211,8 @@
             ka.doPhase(publicKey, true);
             return ka.generateSecret("TlsPremasterSecret");
         } catch (GeneralSecurityException e) {
-            throw new RuntimeException("Could not generate secret", e);
+            throw (SSLHandshakeException) new SSLHandshakeException(
+                "Could not generate secret").initCause(e);
         }
     }
 
--- a/src/share/classes/sun/security/ssl/ECDHCrypt.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/sun/security/ssl/ECDHCrypt.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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.SecretKey;
 import javax.crypto.KeyAgreement;
 import javax.crypto.spec.*;
+import javax.net.ssl.SSLHandshakeException;
 
 /**
  * Helper class for the ECDH key exchange. It generates the appropriate
@@ -89,19 +90,20 @@
     }
 
     // called by ClientHandshaker with either the server's static or ephemeral public key
-    SecretKey getAgreedSecret(PublicKey peerPublicKey) {
+    SecretKey getAgreedSecret(PublicKey peerPublicKey) throws SSLHandshakeException {
         try {
             KeyAgreement ka = JsseJce.getKeyAgreement("ECDH");
             ka.init(privateKey);
             ka.doPhase(peerPublicKey, true);
             return ka.generateSecret("TlsPremasterSecret");
         } catch (GeneralSecurityException e) {
-            throw new RuntimeException("Could not generate secret", e);
+            throw (SSLHandshakeException) new SSLHandshakeException(
+                "Could not generate secret").initCause(e);
         }
     }
 
     // called by ServerHandshaker
-    SecretKey getAgreedSecret(byte[] encodedPoint) {
+    SecretKey getAgreedSecret(byte[] encodedPoint) throws SSLHandshakeException {
         try {
             ECParameterSpec params = publicKey.getParams();
             ECPoint point = JsseJce.decodePoint(encodedPoint, params.getCurve());
@@ -109,10 +111,9 @@
             ECPublicKeySpec spec = new ECPublicKeySpec(point, params);
             PublicKey peerPublicKey = kf.generatePublic(spec);
             return getAgreedSecret(peerPublicKey);
-        } catch (GeneralSecurityException e) {
-            throw new RuntimeException("Could not generate secret", e);
-        } catch (java.io.IOException e) {
-            throw new RuntimeException("Could not generate secret", e);
+        } catch (GeneralSecurityException | java.io.IOException e) {
+            throw (SSLHandshakeException) new SSLHandshakeException(
+                "Could not generate secret").initCause(e);
         }
     }
 
--- a/src/share/classes/sun/security/util/SignatureFileVerifier.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/sun/security/util/SignatureFileVerifier.java	Tue Oct 14 12:20:39 2014 -0700
@@ -39,6 +39,7 @@
 import sun.misc.BASE64Decoder;
 
 import sun.security.jca.Providers;
+import sun.security.x509.AlgorithmId;
 
 public class SignatureFileVerifier {
 
@@ -613,7 +614,8 @@
         throws NoSuchAlgorithmException, SignatureException {
 
         MessageDigest md =
-            MessageDigest.getInstance(token.getHashAlgorithm().getName());
+            MessageDigest.getInstance(AlgorithmId.getStandardDigestName(
+                    token.getHashAlgorithm().getName()));
 
         if (!Arrays.equals(token.getHashedMessage(), md.digest(signature))) {
             throw new SignatureException("Signature timestamp (#" +
--- a/src/share/classes/sun/security/x509/AlgorithmId.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/sun/security/x509/AlgorithmId.java	Tue Oct 14 12:20:39 2014 -0700
@@ -940,4 +940,21 @@
         }
         return null;
     }
+
+    // Copied from com.sun.crypto.provider.OAEPParameters.convertToStandardName()
+    public static String getStandardDigestName(String internalName) {
+        if (internalName.equals("SHA")) {
+            return "SHA-1";
+        } else if (internalName.equals("SHA224")) {
+            return "SHA-224";
+        } else if (internalName.equals("SHA256")) {
+            return "SHA-256";
+        } else if (internalName.equals("SHA384")) {
+            return "SHA-384";
+        } else if (internalName.equals("SHA512")) {
+            return "SHA-512";
+        } else {
+            return internalName;
+        }
+    }
 }
--- a/src/share/classes/sun/swing/SwingUtilities2.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/sun/swing/SwingUtilities2.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -80,6 +80,9 @@
     public static final Object LAF_STATE_KEY =
             new StringBuffer("LookAndFeel State");
 
+    public static final Object MENU_SELECTION_MANAGER_LISTENER_KEY =
+            new StringBuffer("MenuSelectionManager listener key");
+
     // Maintain a cache of CACHE_SIZE fonts and the left side bearing
      // of the characters falling into the range MIN_CHAR_INDEX to
      // MAX_CHAR_INDEX. The values in fontCache are created as needed.
--- a/src/share/classes/sun/util/resources/TimeZoneNames_de.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames_de.java	Tue Oct 14 12:20:39 2014 -0700
@@ -89,8 +89,8 @@
                                      "Chinesische Sommerzeit", "CDT"};
         String CUBA[] = new String[] {"Kubanische Normalzeit", "CST",
                                       "Kubanische Sommerzeit", "CDT"};
-        String DARWIN[] = new String[] {"Zentrale Normalzeit (Northern Territory)", "ACST",
-                                        "Zentrale Sommerzeit (Northern Territory)", "ACDT"};
+        String DARWIN[] = new String[] {"Zentrale Normalzeit (Northern Territory)", "CST",
+                                        "Zentrale Sommerzeit (Northern Territory)", "CST"};
         String DUBLIN[] = new String[] {"Greenwich Zeit", "GMT",
                                         "Irische Sommerzeit", "IST"};
         String EAT[] = new String[] {"Ostafrikanische Zeit", "EAT",
@@ -103,8 +103,8 @@
                                      "Ostgr\u00f6nl\u00e4ndische Sommerzeit", "EGST"};
         String EST[] = new String[] {"\u00d6stliche Normalzeit", "EST",
                                      "\u00d6stliche Sommerzeit", "EDT"};
-        String EST_NSW[] = new String[] {"\u00D6stliche Normalzeit (New South Wales)", "AEST",
-                                         "\u00D6stliche Sommerzeit (New South Wales)", "AEDT"};
+        String EST_NSW[] = new String[] {"\u00D6stliche Normalzeit (New South Wales)", "EST",
+                                         "\u00D6stliche Sommerzeit (New South Wales)", "EST"};
         String FET[] = new String[] {"Kaliningrader Zeit", "FET",
                                      "Kaliningrader Sommerzeit", "FEST"};
         String GHMT[] = new String[] {"Ghanaische Normalzeit", "GMT",
--- a/src/share/classes/sun/util/resources/TimeZoneNames_es.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames_es.java	Tue Oct 14 12:20:39 2014 -0700
@@ -403,7 +403,8 @@
             {"America/Mendoza", AGT},
             {"America/Menominee", CST},
             {"America/Merida", CST},
-            {"America/Metlakatla", PST},
+            {"America/Metlakatla", new String[] {"Hora de Metlakatla", "MeST",
+                                                 "Hora de verano de Metlakatla", "MeDT"}},
             {"America/Mexico_City", CST},
             {"America/Miquelon", new String[] {"Hora est\u00e1ndar de Pierre & Miquelon", "PMST",
                                                "Hora de verano de Pierre & Miquelon", "PMDT"}},
@@ -468,7 +469,7 @@
             {"Antarctica/DumontDUrville", new String[] {"Hora de Dumont-d'Urville", "DDUT",
                                                         "Hora de verano de Dumont-d'Urville", "DDUST"}},
             {"Antarctica/Macquarie", new String[] {"Hora de Isla Macquarie", "MIST",
-                                                   "Hora de verano de Isla Macquarie", "MIDT"}},
+                                                   "Hora de verano de Isla Macquarie", "MIST"}},
             {"Antarctica/Mawson", new String[] {"Hora de Mawson", "MAWT",
                                                 "Hora de verano de Mawson", "MAWST"}},
             {"Antarctica/McMurdo", NZST},
--- a/src/share/classes/sun/util/resources/TimeZoneNames_sv.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames_sv.java	Tue Oct 14 12:20:39 2014 -0700
@@ -61,10 +61,10 @@
                                      "Atlantisk sommartid", "ADT"};
         String BDT[] = new String[] {"Bangladesh, normaltid", "BDT",
                                      "Bangladesh, sommartid", "BDST"};
-        String BRISBANE[] = new String[] {"\u00D6stlig standardtid (Queensland)", "AEST",
-                                          "\u00D6stlig sommartid (Queensland)", "AEDT"};
-        String BROKEN_HILL[] = new String[] {"Central standardtid (Sydaustralien/New South Wales)", "ACST",
-                                             "Central sommartid (South Australia/New South Wales)", "ACDT"};
+        String BRISBANE[] = new String[] {"\u00D6stlig standardtid (Queensland)", "EST",
+                                          "\u00D6stlig sommartid (Queensland)", "EST"};
+        String BROKEN_HILL[] = new String[] {"Central standardtid (Sydaustralien/New South Wales)", "CST",
+                                             "Central sommartid (South Australia/New South Wales)", "CST"};
         String BRT[] = new String[] {"Brasilien, normaltid", "BRT",
                                      "Brasilien, sommartid", "BRST"};
         String BTT[] = new String[] {"Bhutan, normaltid", "BTT",
--- a/src/share/native/sun/security/smartcardio/pcsc.c	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/native/sun/security/smartcardio/pcsc.c	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, 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
@@ -64,17 +64,32 @@
 
 #define J2PCSC_EXCEPTION_NAME "sun/security/smartcardio/PCSCException"
 
+void throwOutOfMemoryError(JNIEnv *env, const char *msg) {
+    jclass cls = (*env)->FindClass(env, "java/lang/OutOfMemoryError");
+
+    if (cls != NULL) /* Otherwise an exception has already been thrown */
+        (*env)->ThrowNew(env, cls, msg);
+
+}
+
 void throwPCSCException(JNIEnv* env, LONG code) {
     jclass pcscClass;
     jmethodID constructor;
     jthrowable pcscException;
 
     pcscClass = (*env)->FindClass(env, J2PCSC_EXCEPTION_NAME);
-    assert(pcscClass != NULL);
+    if (pcscClass == NULL) {
+        return;
+    }
     constructor = (*env)->GetMethodID(env, pcscClass, "<init>", "(I)V");
-    assert(constructor != NULL);
-    pcscException = (jthrowable) (*env)->NewObject(env, pcscClass, constructor, (jint)code);
-    (*env)->Throw(env, pcscException);
+    if (constructor == NULL) {
+        return;
+    }
+    pcscException = (jthrowable) (*env)->NewObject(env, pcscClass,
+        constructor, (jint)code);
+    if (pcscException != NULL) {
+        (*env)->Throw(env, pcscException);
+    }
 }
 
 jboolean handleRV(JNIEnv* env, LONG code) {
@@ -110,7 +125,7 @@
 jobjectArray pcsc_multi2jstring(JNIEnv *env, char *spec) {
     jobjectArray result;
     jclass stringClass;
-    char *cp, **tab;
+    char *cp, **tab = NULL;
     jstring js;
     int cnt = 0;
 
@@ -121,6 +136,10 @@
     }
 
     tab = (char **)malloc(cnt * sizeof(char *));
+    if (tab == NULL) {
+        throwOutOfMemoryError(env, NULL);
+        return NULL;
+    }
 
     cnt = 0;
     cp = spec;
@@ -130,12 +149,26 @@
     }
 
     stringClass = (*env)->FindClass(env, "java/lang/String");
-    assert(stringClass != NULL);
+    if (stringClass == NULL) {
+        free(tab);
+        return NULL;
+    }
 
     result = (*env)->NewObjectArray(env, cnt, stringClass, NULL);
-    while (cnt-- > 0) {
-        js = (*env)->NewStringUTF(env, tab[cnt]);
-        (*env)->SetObjectArrayElement(env, result, cnt, js);
+    if (result != NULL) {
+        while (cnt-- > 0) {
+            js = (*env)->NewStringUTF(env, tab[cnt]);
+            if ((*env)->ExceptionCheck(env)) {
+                free(tab);
+                return NULL;
+            }
+            (*env)->SetObjectArrayElement(env, result, cnt, js);
+            if ((*env)->ExceptionCheck(env)) {
+                free(tab);
+                return NULL;
+            }
+            (*env)->DeleteLocalRef(env, js);
+        }
     }
     free(tab);
     return result;
@@ -146,7 +179,7 @@
 {
     SCARDCONTEXT context = (SCARDCONTEXT)jContext;
     LONG rv;
-    LPTSTR mszReaders;
+    LPTSTR mszReaders = NULL;
     DWORD size = 0;
     jobjectArray result;
 
@@ -157,13 +190,20 @@
     }
     dprintf1("-size: %d\n", size);
 
-    mszReaders = malloc(size);
-    rv = CALL_SCardListReaders(context, NULL, mszReaders, &size);
-    if (handleRV(env, rv)) {
-        free(mszReaders);
-        return NULL;
+    if (size) {
+        mszReaders = malloc(size);
+        if (mszReaders == NULL) {
+            throwOutOfMemoryError(env, NULL);
+            return NULL;
+        }
+
+        rv = CALL_SCardListReaders(context, NULL, mszReaders, &size);
+        if (handleRV(env, rv)) {
+            free(mszReaders);
+            return NULL;
+        }
+        dprintf1("-String: %s\n", mszReaders);
     }
-    dprintf1("-String: %s\n", mszReaders);
 
     result = pcsc_multi2jstring(env, mszReaders);
     free(mszReaders);
@@ -181,6 +221,9 @@
     DWORD proto = 0;
 
     readerName = (*env)->GetStringUTFChars(env, jReaderName, NULL);
+    if (readerName == NULL) {
+        return 0;
+    }
     rv = CALL_SCardConnect(context, readerName, jShareMode, jPreferredProtocols, &card, &proto);
     (*env)->ReleaseStringUTFChars(env, jReaderName, readerName);
     dprintf1("-cardhandle: %x\n", card);
@@ -210,6 +253,9 @@
     sendPci.cbPciLength = sizeof(SCARD_IO_REQUEST);
 
     sbuf = (unsigned char *) ((*env)->GetByteArrayElements(env, jBuf, NULL));
+    if (sbuf == NULL) {
+        return NULL;
+    }
     rv = CALL_SCardTransmit(card, &sendPci, sbuf + ofs, len, NULL, rbuf, &rlen);
     (*env)->ReleaseByteArrayElements(env, jBuf, (jbyte *)sbuf, JNI_ABORT);
 
@@ -218,7 +264,12 @@
     }
 
     jOut = (*env)->NewByteArray(env, rlen);
-    (*env)->SetByteArrayRegion(env, jOut, 0, rlen, (jbyte *)rbuf);
+    if (jOut != NULL) {
+        (*env)->SetByteArrayRegion(env, jOut, 0, rlen, (jbyte *)rbuf);
+        if ((*env)->ExceptionCheck(env)) {
+            return NULL;
+        }
+    }
     return jOut;
 }
 
@@ -234,7 +285,7 @@
     DWORD state = 0;
     DWORD protocol = 0;
     jbyteArray jArray;
-    jbyte tmp;
+    jbyte status[2];
 
     rv = CALL_SCardStatus(card, readerName, &readerLen, &state, &protocol, atr, &atrLen);
     if (handleRV(env, rv)) {
@@ -245,13 +296,19 @@
     dprintf1("-protocol: %d\n", protocol);
 
     jArray = (*env)->NewByteArray(env, atrLen);
+    if (jArray == NULL) {
+        return NULL;
+    }
     (*env)->SetByteArrayRegion(env, jArray, 0, atrLen, (jbyte *)atr);
-
-    tmp = (jbyte)state;
-    (*env)->SetByteArrayRegion(env, jStatus, 0, 1, &tmp);
-    tmp = (jbyte)protocol;
-    (*env)->SetByteArrayRegion(env, jStatus, 1, 1, &tmp);
-
+    if ((*env)->ExceptionCheck(env)) {
+        return NULL;
+    }
+    status[0] = (jbyte) state;
+    status[1] = (jbyte) protocol;
+    (*env)->SetByteArrayRegion(env, jStatus, 0, 2, status);
+    if ((*env)->ExceptionCheck(env)) {
+        return NULL;
+    }
     return jArray;
 }
 
@@ -274,36 +331,78 @@
     SCARDCONTEXT context = (SCARDCONTEXT)jContext;
     LONG rv;
     int readers = (*env)->GetArrayLength(env, jReaderNames);
-    SCARD_READERSTATE *readerState = malloc(readers * sizeof(SCARD_READERSTATE));
+    SCARD_READERSTATE *readerState;
     int i;
-    jintArray jEventState;
-    int *currentState = (*env)->GetIntArrayElements(env, jCurrentState, NULL);
+    jintArray jEventState = NULL;
+    int *currentState = NULL;
+    const char *readerName;
+
+    readerState = calloc(readers, sizeof(SCARD_READERSTATE));
+    if (readerState == NULL && readers > 0) {
+        throwOutOfMemoryError(env, NULL);
+        return NULL;
+    }
+
+    currentState = (*env)->GetIntArrayElements(env, jCurrentState, NULL);
+    if (currentState == NULL) {
+        free(readerState);
+        return NULL;
+    }
+
+    for (i = 0; i < readers; i++) {
+        readerState[i].szReader = NULL;
+    }
 
     for (i = 0; i < readers; i++) {
         jobject jReaderName = (*env)->GetObjectArrayElement(env, jReaderNames, i);
-        readerState[i].szReader = (*env)->GetStringUTFChars(env, jReaderName, NULL);
+        if ((*env)->ExceptionCheck(env)) {
+            goto cleanup;
+        }
+        readerName = (*env)->GetStringUTFChars(env, jReaderName, NULL);
+        if (readerName == NULL) {
+            goto cleanup;
+        }
+        readerState[i].szReader = strdup(readerName);
+        (*env)->ReleaseStringUTFChars(env, jReaderName, readerName);
+        if (readerState[i].szReader == NULL) {
+            throwOutOfMemoryError(env, NULL);
+            goto cleanup;
+        }
         readerState[i].pvUserData = NULL;
         readerState[i].dwCurrentState = currentState[i];
         readerState[i].dwEventState = SCARD_STATE_UNAWARE;
         readerState[i].cbAtr = 0;
+        (*env)->DeleteLocalRef(env, jReaderName);
     }
-    (*env)->ReleaseIntArrayElements(env, jCurrentState, currentState, JNI_ABORT);
 
-    rv = CALL_SCardGetStatusChange(context, (DWORD)jTimeout, readerState, readers);
+    if (readers > 0) {
+        rv = CALL_SCardGetStatusChange(context, (DWORD)jTimeout, readerState, readers);
+        if (handleRV(env, rv)) {
+            goto cleanup;
+        }
+    }
 
     jEventState = (*env)->NewIntArray(env, readers);
+    if (jEventState == NULL) {
+        goto cleanup;
+    }
     for (i = 0; i < readers; i++) {
         jint eventStateTmp;
-        jobject jReaderName = (*env)->GetObjectArrayElement(env, jReaderNames, i);
         dprintf3("-reader status %s: 0x%X, 0x%X\n", readerState[i].szReader,
             readerState[i].dwCurrentState, readerState[i].dwEventState);
-        (*env)->ReleaseStringUTFChars(env, jReaderName, readerState[i].szReader);
         eventStateTmp = (jint)readerState[i].dwEventState;
         (*env)->SetIntArrayRegion(env, jEventState, i, 1, &eventStateTmp);
+        if ((*env)->ExceptionCheck(env)) {
+            jEventState = NULL;
+            goto cleanup;
+        }
+    }
+cleanup:
+    (*env)->ReleaseIntArrayElements(env, jCurrentState, currentState, JNI_ABORT);
+    for (i = 0; i < readers; i++) {
+        free((char *)readerState[i].szReader);
     }
     free(readerState);
-
-    handleRV(env, rv);
     return jEventState;
 }
 
@@ -336,13 +435,18 @@
 {
     SCARDHANDLE card = (SCARDHANDLE)jCard;
     LONG rv;
-    jbyte* sendBuffer = (*env)->GetByteArrayElements(env, jSendBuffer, NULL);
+    jbyte* sendBuffer;
     jint sendBufferLength = (*env)->GetArrayLength(env, jSendBuffer);
     jbyte receiveBuffer[MAX_STACK_BUFFER_SIZE];
     jint receiveBufferLength = MAX_STACK_BUFFER_SIZE;
     ULONG returnedLength = 0;
     jbyteArray jReceiveBuffer;
 
+    sendBuffer = (*env)->GetByteArrayElements(env, jSendBuffer, NULL);
+    if (sendBuffer == NULL) {
+        return NULL;
+    }
+
 #ifdef J2PCSC_DEBUG
 {
     int k;
@@ -375,7 +479,12 @@
 #endif
 
     jReceiveBuffer = (*env)->NewByteArray(env, returnedLength);
+    if (jReceiveBuffer == NULL) {
+        return NULL;
+    }
     (*env)->SetByteArrayRegion(env, jReceiveBuffer, 0, returnedLength, receiveBuffer);
-
+    if ((*env)->ExceptionCheck(env)) {
+        return NULL;
+    }
     return jReceiveBuffer;
 }
--- a/src/share/npt/utf.c	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/share/npt/utf.c	Tue Oct 14 12:20:39 2014 -0700
@@ -390,7 +390,7 @@
 
 /* ================================================================= */
 
-#if 1  /* Test program */
+#ifdef COMPILE_WITH_UTF_TEST  /* Test program */
 
 /*
  * Convert any byte array into a printable string.
--- a/src/solaris/classes/java/lang/UNIXProcess.java.bsd	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/solaris/classes/java/lang/UNIXProcess.java.bsd	Tue Oct 14 12:20:39 2014 -0700
@@ -308,47 +308,39 @@
         ProcessPipeInputStream(int fd) {
             super(new FileInputStream(newFileDescriptor(fd)));
         }
-
-        private InputStream drainInputStream(InputStream in)
+        private static byte[] drainInputStream(InputStream in)
                 throws IOException {
             int n = 0;
             int j;
             byte[] a = null;
-            synchronized (closeLock) {
-                if (buf == null) // asynchronous close()?
-                    return null; // discard
-                j = in.available();
+            while ((j = in.available()) > 0) {
+                a = (a == null) ? new byte[j] : Arrays.copyOf(a, n + j);
+                n += in.read(a, n, j);
             }
-            while (j > 0) {
-                a = (a == null) ? new byte[j] : Arrays.copyOf(a, n + j);
-                synchronized (closeLock) {
-                    if (buf == null) // asynchronous close()?
-                        return null; // discard
-                    n += in.read(a, n, j);
-                    j = in.available();
-                }
-            }
-            return (a == null) ?
-                    ProcessBuilder.NullInputStream.INSTANCE :
-                    new ByteArrayInputStream(n == a.length ? a : Arrays.copyOf(a, n));
+            return (a == null || n == a.length) ? a : Arrays.copyOf(a, n);
         }
 
         /** Called by the process reaper thread when the process exits. */
         synchronized void processExited() {
-            try {
-                InputStream in = this.in;
-                if (in != null) {
-                    InputStream stragglers = drainInputStream(in);
-                    in.close();
-                    this.in = stragglers;
-                }
-            } catch (IOException ignored) { }
+            synchronized (closeLock) {
+                try {
+                    InputStream in = this.in;
+                    // this stream is closed if and only if: in == null
+                    if (in != null) {
+                        byte[] stragglers = drainInputStream(in);
+                        in.close();
+                        this.in = (stragglers == null) ?
+                            ProcessBuilder.NullInputStream.INSTANCE :
+                            new ByteArrayInputStream(stragglers);
+                    }
+                } catch (IOException ignored) {}
+            }
         }
 
         @Override
         public void close() throws IOException {
             // BufferedInputStream#close() is not synchronized unlike most other methods.
-            // Synchronizing helps avoid racing with drainInputStream().
+            // Synchronizing helps avoid race with processExited().
             synchronized (closeLock) {
                 super.close();
             }
--- a/src/solaris/classes/java/lang/UNIXProcess.java.linux	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/solaris/classes/java/lang/UNIXProcess.java.linux	Tue Oct 14 12:20:39 2014 -0700
@@ -310,47 +310,39 @@
         ProcessPipeInputStream(int fd) {
             super(new FileInputStream(newFileDescriptor(fd)));
         }
-
-        private InputStream drainInputStream(InputStream in)
+        private static byte[] drainInputStream(InputStream in)
                 throws IOException {
             int n = 0;
             int j;
             byte[] a = null;
-            synchronized (closeLock) {
-                if (buf == null) // asynchronous close()?
-                    return null; // discard
-                j = in.available();
+            while ((j = in.available()) > 0) {
+                a = (a == null) ? new byte[j] : Arrays.copyOf(a, n + j);
+                n += in.read(a, n, j);
             }
-            while (j > 0) {
-                a = (a == null) ? new byte[j] : Arrays.copyOf(a, n + j);
-                synchronized (closeLock) {
-                    if (buf == null) // asynchronous close()?
-                        return null; // discard
-                    n += in.read(a, n, j);
-                    j = in.available();
-                }
-            }
-            return (a == null) ?
-                    ProcessBuilder.NullInputStream.INSTANCE :
-                    new ByteArrayInputStream(n == a.length ? a : Arrays.copyOf(a, n));
+            return (a == null || n == a.length) ? a : Arrays.copyOf(a, n);
         }
 
         /** Called by the process reaper thread when the process exits. */
         synchronized void processExited() {
-            try {
-                InputStream in = this.in;
-                if (in != null) {
-                    InputStream stragglers = drainInputStream(in);
-                    in.close();
-                    this.in = stragglers;
-                }
-            } catch (IOException ignored) { }
+            synchronized (closeLock) {
+                try {
+                    InputStream in = this.in;
+                    // this stream is closed if and only if: in == null
+                    if (in != null) {
+                        byte[] stragglers = drainInputStream(in);
+                        in.close();
+                        this.in = (stragglers == null) ?
+                            ProcessBuilder.NullInputStream.INSTANCE :
+                            new ByteArrayInputStream(stragglers);
+                    }
+                } catch (IOException ignored) {}
+            }
         }
 
         @Override
         public void close() throws IOException {
             // BufferedInputStream#close() is not synchronized unlike most other methods.
-            // Synchronizing helps avoid racing with drainInputStream().
+            // Synchronizing helps avoid race with processExited().
             synchronized (closeLock) {
                 super.close();
             }
--- a/src/solaris/classes/sun/awt/X11/XContentWindow.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/solaris/classes/sun/awt/X11/XContentWindow.java	Tue Oct 14 12:20:39 2014 -0700
@@ -24,9 +24,7 @@
  */
 package sun.awt.X11;
 
-import java.awt.Component;
-import java.awt.Rectangle;
-import java.awt.Insets;
+import java.awt.*;
 
 import java.awt.event.ComponentEvent;
 
@@ -162,6 +160,23 @@
         }
     }
 
+    public void handleButtonPressRelease(XEvent xev) {
+        if (xev.get_type() == XConstants.ButtonPress) {
+            Window parentWindow = (Window)parentFrame.getTarget();
+            /*
+             * In case the decorated frame is active but not focused
+             * (that is an owned window is currently focused)
+             * it should be made a focused window.
+             * This is needed to focus the frame when it's clicked
+             * in an empty spot of its content area. See 6886678.
+             */
+            if (parentWindow != null && parentWindow.isActive() && !parentWindow.isFocused()) {
+                parentFrame.requestWindowFocus();
+            }
+        }
+        super.handleButtonPressRelease(xev);
+    }
+
     void purgeIconifiedExposeEvents() {
         for (SavedExposeEvent evt : iconifiedExposeEvents) {
             super.handleExposeEvent(evt.target, evt.x, evt.y, evt.w, evt.h);
--- a/src/solaris/classes/sun/awt/windows/ThemeReader.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/solaris/classes/sun/awt/windows/ThemeReader.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -41,6 +41,10 @@
         return false;
     }
 
+    public static boolean isXPStyleEnabled() {
+        return false;
+    }
+
     public static void paintBackground(int[] buffer, String widget,
            int part, int state, int x, int y, int w, int h, int stride) {
     }
--- a/src/solaris/classes/sun/nio/fs/UnixPath.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/solaris/classes/sun/nio/fs/UnixPath.java	Tue Oct 14 12:20:39 2014 -0700
@@ -482,7 +482,7 @@
     @Override
     public Path normalize() {
         final int count = getNameCount();
-        if (count == 0)
+        if (count == 0 || isEmpty())
             return this;
 
         boolean[] ignore = new boolean[count];      // true => ignore name
--- a/src/solaris/native/java/lang/UNIXProcess_md.c	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/solaris/native/java/lang/UNIXProcess_md.c	Tue Oct 14 12:20:39 2014 -0700
@@ -602,9 +602,9 @@
      */
     assert(prog != NULL && argBlock != NULL);
     if ((phelperpath = getBytes(env, helperpath))   == NULL) goto Catch;
-    if ((pprog     = getBytes(env, prog))       == NULL) goto Catch;
-    if ((pargBlock = getBytes(env, argBlock))   == NULL) goto Catch;
-    if ((c->argv = NEW(const char *, argc + 3)) == NULL) goto Catch;
+    if ((pprog       = getBytes(env, prog))         == NULL) goto Catch;
+    if ((pargBlock   = getBytes(env, argBlock))     == NULL) goto Catch;
+    if ((c->argv     = NEW(const char *, argc + 3)) == NULL) goto Catch;
     c->argv[0] = pprog;
     c->argc = argc + 2;
     initVectorFromBlock(c->argv+1, pargBlock, argc);
@@ -693,10 +693,11 @@
     closeSafely(childenv[0]);
     closeSafely(childenv[1]);
 
-    releaseBytes(env, prog,     pprog);
-    releaseBytes(env, argBlock, pargBlock);
-    releaseBytes(env, envBlock, penvBlock);
-    releaseBytes(env, dir,      c->pdir);
+    releaseBytes(env, helperpath, phelperpath);
+    releaseBytes(env, prog,       pprog);
+    releaseBytes(env, argBlock,   pargBlock);
+    releaseBytes(env, envBlock,   penvBlock);
+    releaseBytes(env, dir,        c->pdir);
 
     free(c->argv);
     free(c->envv);
--- a/src/solaris/native/java/util/TimeZone_md.c	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/solaris/native/java/util/TimeZone_md.c	Tue Oct 14 12:20:39 2014 -0700
@@ -172,7 +172,6 @@
                 break;
             }
             if ((fd = open(pathname, O_RDONLY)) == -1) {
-                fd = 0;
                 break;
             }
             if (read(fd, dbuf, size) != (ssize_t) size) {
@@ -188,7 +187,7 @@
             free((void *) dbuf);
             dbuf = NULL;
             (void) close(fd);
-            fd = 0;
+            fd = -1;
         }
         free((void *) pathname);
         pathname = NULL;
@@ -203,7 +202,7 @@
     if (pathname != NULL) {
         free((void *) pathname);
     }
-    if (fd != 0) {
+    if (fd != -1) {
         (void) close(fd);
     }
     if (dbuf != NULL) {
--- a/src/solaris/native/sun/security/smartcardio/pcsc_md.c	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/solaris/native/sun/security/smartcardio/pcsc_md.c	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 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
@@ -32,8 +32,6 @@
 
 #include <winscard.h>
 
-#include <jni_util.h>
-
 #include "sun_security_smartcardio_PlatformPCSC.h"
 
 #include "pcsc_md.h"
@@ -50,12 +48,40 @@
 FPTR_SCardEndTransaction scardEndTransaction;
 FPTR_SCardControl scardControl;
 
+/*
+ * Throws a Java Exception by name
+ */
+void throwByName(JNIEnv *env, const char *name, const char *msg)
+{
+    jclass cls = (*env)->FindClass(env, name);
+
+    if (cls != 0) /* Otherwise an exception has already been thrown */
+        (*env)->ThrowNew(env, cls, msg);
+}
+
+/*
+ * Throws java.lang.NullPointerException
+ */
+void throwNullPointerException(JNIEnv *env, const char *msg)
+{
+    throwByName(env, "java/lang/NullPointerException", msg);
+}
+
+/*
+ * Throws java.io.IOException
+ */
+void throwIOException(JNIEnv *env, const char *msg)
+{
+    throwByName(env, "java/io/IOException", msg);
+}
+
+
 void *findFunction(JNIEnv *env, void *hModule, char *functionName) {
     void *fAddress = dlsym(hModule, functionName);
     if (fAddress == NULL) {
         char errorMessage[256];
         snprintf(errorMessage, sizeof(errorMessage), "Symbol not found: %s", functionName);
-        JNU_ThrowNullPointerException(env, errorMessage);
+        throwNullPointerException(env, errorMessage);
         return NULL;
     }
     return fAddress;
@@ -64,22 +90,53 @@
 JNIEXPORT void JNICALL Java_sun_security_smartcardio_PlatformPCSC_initialize
         (JNIEnv *env, jclass thisClass, jstring jLibName) {
     const char *libName = (*env)->GetStringUTFChars(env, jLibName, NULL);
+    if (libName == NULL) {
+        throwNullPointerException(env, "PCSC library name is null");
+        return;
+    }
     hModule = dlopen(libName, RTLD_LAZY);
     (*env)->ReleaseStringUTFChars(env, jLibName, libName);
 
     if (hModule == NULL) {
-        JNU_ThrowIOException(env, dlerror());
+        throwIOException(env, dlerror());
         return;
     }
     scardEstablishContext = (FPTR_SCardEstablishContext)findFunction(env, hModule, "SCardEstablishContext");
+    if ((*env)->ExceptionCheck(env)) {
+         return;
+    }
     scardConnect          = (FPTR_SCardConnect)         findFunction(env, hModule, "SCardConnect");
+    if ((*env)->ExceptionCheck(env)) {
+         return;
+    }
     scardDisconnect       = (FPTR_SCardDisconnect)      findFunction(env, hModule, "SCardDisconnect");
+    if ((*env)->ExceptionCheck(env)) {
+         return;
+    }
     scardStatus           = (FPTR_SCardStatus)          findFunction(env, hModule, "SCardStatus");
+    if ((*env)->ExceptionCheck(env)) {
+         return;
+    }
     scardGetStatusChange  = (FPTR_SCardGetStatusChange) findFunction(env, hModule, "SCardGetStatusChange");
+    if ((*env)->ExceptionCheck(env)) {
+         return;
+    }
     scardTransmit         = (FPTR_SCardTransmit)        findFunction(env, hModule, "SCardTransmit");
+    if ((*env)->ExceptionCheck(env)) {
+         return;
+    }
     scardListReaders      = (FPTR_SCardListReaders)     findFunction(env, hModule, "SCardListReaders");
+    if ((*env)->ExceptionCheck(env)) {
+         return;
+    }
     scardBeginTransaction = (FPTR_SCardBeginTransaction)findFunction(env, hModule, "SCardBeginTransaction");
+    if ((*env)->ExceptionCheck(env)) {
+         return;
+    }
     scardEndTransaction   = (FPTR_SCardEndTransaction)  findFunction(env, hModule, "SCardEndTransaction");
+    if ((*env)->ExceptionCheck(env)) {
+         return;
+    }
 #ifndef __APPLE__
     scardControl          = (FPTR_SCardControl)         findFunction(env, hModule, "SCardControl");
 #else
--- a/src/windows/classes/sun/awt/windows/ThemeReader.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/ThemeReader.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -58,6 +58,8 @@
     private static final Lock writeLock = readWriteLock.writeLock();
     private static volatile boolean valid = false;
 
+    static volatile boolean xpStyleEnabled;
+
     static void flush() {
         // Could be called on Toolkit thread, so do not try to aquire locks
         // to avoid deadlock with theme initialization
@@ -66,6 +68,10 @@
 
     public native static boolean isThemed();
 
+    public static boolean isXPStyleEnabled() {
+        return xpStyleEnabled;
+    }
+
     // this should be called only with writeLock held
     private static Long getThemeImpl(String widget) {
         Long theme = widgetToTheme.get(widget);
--- a/src/windows/classes/sun/awt/windows/WToolkit.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WToolkit.java	Tue Oct 14 12:20:39 2014 -0700
@@ -36,6 +36,7 @@
 import java.beans.PropertyChangeListener;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import sun.awt.AppContext;
 import sun.awt.AWTAutoShutdown;
 import sun.awt.AppContext;
 import sun.awt.SunToolkit;
@@ -70,6 +71,9 @@
 
     private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.windows.WToolkit");
 
+    // Desktop property which specifies whether XP visual styles are in effect
+    public static final String XPSTYLE_THEME_ACTIVE = "win.xpstyle.themeActive";
+
     static GraphicsConfiguration config;
 
     // System clipboard.
@@ -829,7 +833,7 @@
     private synchronized void lazilyInitWProps() {
         if (wprops == null) {
             wprops = new WDesktopProperties(this);
-            updateProperties();
+            updateProperties(wprops.getProperties());
         }
     }
 
@@ -864,27 +868,41 @@
      * Windows doesn't always send WM_SETTINGCHANGE when it should.
      */
     private void windowsSettingChange() {
+        // JDK-8039383: Have to update the value of XPSTYLE_THEME_ACTIVE property
+        // as soon as possible to prevent NPE and other errors because theme data
+        // has become unavailable.
+        final Map<String, Object> props = getWProps();
+        if (props == null) {
+            // props has not been initialized, so we have nothing to update
+            return;
+        }
+
+        updateXPStyleEnabled(props.get(XPSTYLE_THEME_ACTIVE));
+
         if (AppContext.getAppContext() == null) {
             // We cannot post the update to any EventQueue. Listeners will
             // be called on EDTs by DesktopPropertyChangeSupport
-            updateProperties();
+            updateProperties(props);
         } else {
+            // Cannot update on Toolkit thread.
+            // DesktopPropertyChangeSupport will call listeners on Toolkit
+            // thread if it has AppContext (standalone mode)
             EventQueue.invokeLater(new Runnable() {
                 @Override
                 public void run() {
-                    updateProperties();
+                    updateProperties(props);
                 }
             });
         }
     }
 
-    private synchronized void updateProperties() {
-        if (null == wprops) {
-            // wprops has not been initialized, so we have nothing to update
+    private synchronized void updateProperties(final Map<String, Object> props) {
+        if (null == props) {
             return;
         }
 
-        Map<String, Object> props = wprops.getProperties();
+        updateXPStyleEnabled(props.get(XPSTYLE_THEME_ACTIVE));
+
         for (String propName : props.keySet()) {
             Object val = props.get(propName);
             if (log.isLoggable(PlatformLogger.FINER)) {
@@ -1013,6 +1031,14 @@
 
     private native synchronized int getNumberOfButtonsImpl();
 
+    private synchronized Map<String, Object> getWProps() {
+        return (wprops != null) ? wprops.getProperties() : null;
+    }
+
+    private void updateXPStyleEnabled(final Object dskProp) {
+        ThemeReader.xpStyleEnabled = Boolean.TRUE.equals(dskProp);
+    }
+
     @Override
     public int getNumberOfButtons(){
         if (numberOfButtons == 0) {
--- a/src/windows/native/java/net/NetworkInterface.c	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/windows/native/java/net/NetworkInterface.c	Tue Oct 14 12:20:39 2014 -0700
@@ -175,7 +175,7 @@
     int count;
     netif *netifP;
     DWORD i;
-    int lo=0, eth=0, tr=0, fddi=0, ppp=0, sl=0, net=0, wlen=0;
+    int lo=0, eth=0, tr=0, fddi=0, ppp=0, sl=0, wlan=0, net=0, wlen=0;
 
     /*
      * Ask the IP Helper library to enumerate the adapters
@@ -215,15 +215,15 @@
          */
         switch (ifrowP->dwType) {
             case MIB_IF_TYPE_ETHERNET:
-                sprintf(dev_name, "eth%d", eth++);
+                _snprintf_s(dev_name, 8, _TRUNCATE, "eth%d", eth++);
                 break;
 
             case MIB_IF_TYPE_TOKENRING:
-                sprintf(dev_name, "tr%d", tr++);
+                _snprintf_s(dev_name, 8, _TRUNCATE, "tr%d", tr++);
                 break;
 
             case MIB_IF_TYPE_FDDI:
-                sprintf(dev_name, "fddi%d", fddi++);
+                _snprintf_s(dev_name, 8, _TRUNCATE, "fddi%d", fddi++);
                 break;
 
             case MIB_IF_TYPE_LOOPBACK:
@@ -231,20 +231,24 @@
                 if (lo > 0) {
                     continue;
                 }
-                strcpy(dev_name, "lo");
+                strncpy_s(dev_name, 8, "lo", _TRUNCATE);
                 lo++;
                 break;
 
             case MIB_IF_TYPE_PPP:
-                sprintf(dev_name, "ppp%d", ppp++);
+                _snprintf_s(dev_name, 8, _TRUNCATE, "ppp%d", ppp++);
                 break;
 
             case MIB_IF_TYPE_SLIP:
-                sprintf(dev_name, "sl%d", sl++);
+                _snprintf_s(dev_name, 8, _TRUNCATE, "sl%d", sl++);
+                break;
+
+            case IF_TYPE_IEEE80211:
+                _snprintf_s(dev_name, 8, _TRUNCATE, "wlan%d", wlan++);
                 break;
 
             default:
-                sprintf(dev_name, "net%d", net++);
+                _snprintf_s(dev_name, 8, _TRUNCATE, "net%d", net++);
         }
 
         /*
@@ -409,6 +413,7 @@
             case MIB_IF_TYPE_TOKENRING:
             case MIB_IF_TYPE_FDDI:
             case MIB_IF_TYPE_LOOPBACK:
+            case IF_TYPE_IEEE80211:
               /**
                * Contrary to what it seems to indicate, dwBCastAddr doesn't
                * contain the broadcast address but 0 or 1 depending on whether
@@ -949,6 +954,7 @@
       case MIB_IF_TYPE_ETHERNET:
       case MIB_IF_TYPE_TOKENRING:
       case MIB_IF_TYPE_FDDI:
+      case IF_TYPE_IEEE80211:
         len = ifRowP->dwPhysAddrLen;
         ret = (*env)->NewByteArray(env, len);
         if (!IS_NULL(ret)) {
--- a/src/windows/native/java/net/NetworkInterface.h	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/windows/native/java/net/NetworkInterface.h	Tue Oct 14 12:20:39 2014 -0700
@@ -88,4 +88,9 @@
 
 int enumInterfaces(JNIEnv *env, netif **netifPP);
 
+// Windows Visa (and later) only.....
+#ifndef IF_TYPE_IEEE80211
+#define IF_TYPE_IEEE80211     71
 #endif
+
+#endif
--- a/src/windows/native/java/net/TwoStacksPlainSocketImpl.c	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/windows/native/java/net/TwoStacksPlainSocketImpl.c	Tue Oct 14 12:20:39 2014 -0700
@@ -576,6 +576,7 @@
 {
     /* fields on this */
     jint port;
+    jint scope;
     jint timeout = (*env)->GetIntField(env, this, psi_timeoutID);
     jobject fdObj = (*env)->GetObjectField(env, this, psi_fdID);
     jobject fd1Obj = (*env)->GetObjectField(env, this, psi_fd1ID);
@@ -751,9 +752,12 @@
             return;
         }
         setInet6Address_ipaddress(env, socketAddressObj, (const char *)&him.him6.sin6_addr);
-
         setInetAddress_family(env, socketAddressObj, IPv6);
-        setInet6Address_scopeid(env, socketAddressObj, him.him6.sin6_scope_id);
+        scope = him.him6.sin6_scope_id;
+        (*env)->SetIntField(env, socketAddressObj, ia6_scopeidID, scope);
+        if(scope>0) {
+            (*env)->SetBooleanField(env, socketAddressObj, ia6_scopeidsetID, JNI_TRUE);
+        }
     }
     /* fields common to AF_INET and AF_INET6 */
 
--- a/src/windows/native/sun/windows/awt_Component.cpp	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/windows/native/sun/windows/awt_Component.cpp	Tue Oct 14 12:20:39 2014 -0700
@@ -491,7 +491,12 @@
      * member is referred in the GetClassName method of AwtLabel class.
      * So m_peerObject member must be set here.
      */
-    m_peerObject = env->NewGlobalRef(peer);
+    if (m_peerObject == NULL) {
+        m_peerObject = env->NewGlobalRef(peer);
+    } else {
+        assert(env->IsSameObject(m_peerObject, peer));
+    }
+
     RegisterClass();
 
     jobject target = env->GetObjectField(peer, AwtObject::targetID);
@@ -2126,19 +2131,7 @@
     }
 
     jlong getMessageTimeUTC() {
-        return windowsToUTC(getMessageTimeWindows());
-    }
-
-    // If calling order of GetTickCount and JVM_CurrentTimeMillis
-    // is swapped, it would sometimes give different result.
-    // Anyway, we would not always have determinism
-    // and sortedness of time conversion here (due to Windows's
-    // timers peculiarities). Having some euristic algorithm might
-    // help here.
-    jlong windowsToUTC(DWORD windowsTime) {
-        jlong offset = ::GetTickCount() - windowsTime;
-        jlong jvm_time = ::JVM_CurrentTimeMillis(NULL, 0);
-        return jvm_time - offset;
+        return ::JVM_CurrentTimeMillis(NULL, 0);
     }
 } //TimeHelper
 
@@ -3561,7 +3554,7 @@
 
 
     SendKeyEventToFocusOwner(java_awt_event_KeyEvent_KEY_PRESSED,
-                             TimeHelper::windowsToUTC(msg.time), jkey, character,
+                             TimeHelper::getMessageTimeUTC(), jkey, character,
                              modifiers, keyLocation, (jlong)wkey, &msg);
 
     // bugid 4724007: Windows does not create a WM_CHAR for the Del key
@@ -3571,7 +3564,7 @@
     // for Java - we don't want Windows trying to process it).
     if (jkey == java_awt_event_KeyEvent_VK_DELETE) {
         SendKeyEventToFocusOwner(java_awt_event_KeyEvent_KEY_TYPED,
-                                 TimeHelper::windowsToUTC(msg.time),
+                                 TimeHelper::getMessageTimeUTC(),
                                  java_awt_event_KeyEvent_VK_UNDEFINED,
                                  character, modifiers,
                                  java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN, (jlong)0);
@@ -3603,7 +3596,7 @@
     UpdateDynPrimaryKeymap(wkey, jkey, keyLocation, modifiers);
 
     SendKeyEventToFocusOwner(java_awt_event_KeyEvent_KEY_RELEASED,
-                             TimeHelper::windowsToUTC(msg.time), jkey, character,
+                             TimeHelper::getMessageTimeUTC(), jkey, character,
                              modifiers, keyLocation, (jlong)wkey, &msg);
     return mrConsume;
 }
@@ -3648,7 +3641,7 @@
 
     jint modifiers = GetJavaModifiers();
     SendKeyEventToFocusOwner(java_awt_event_KeyEvent_KEY_TYPED,
-                             TimeHelper::windowsToUTC(msg.time),
+                             TimeHelper::getMessageTimeUTC(),
                              java_awt_event_KeyEvent_VK_UNDEFINED,
                              unicodeChar, modifiers,
                              java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN, (jlong)0,
@@ -3717,7 +3710,7 @@
     InitMessage(&msg, message, character,
                               MAKELPARAM(repCnt, flags));
     SendKeyEventToFocusOwner(java_awt_event_KeyEvent_KEY_TYPED,
-                             TimeHelper::windowsToUTC(msg.time),
+                             TimeHelper::getMessageTimeUTC(),
                              java_awt_event_KeyEvent_VK_UNDEFINED,
                              unicodeChar, modifiers,
                              java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN, (jlong)0,
--- a/src/windows/native/sun/windows/awt_TrayIcon.cpp	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/windows/native/sun/windows/awt_TrayIcon.cpp	Tue Oct 14 12:20:39 2014 -0700
@@ -325,7 +325,7 @@
 
 MsgRouting AwtTrayIcon::WmMouseDown(UINT flags, int x, int y, int button)
 {
-    jlong now = TimeHelper::windowsToUTC(::GetTickCount());
+    jlong now = TimeHelper::getMessageTimeUTC();
     jint javaModif = AwtComponent::GetJavaModifiers();
 
     if (lastClickTrIc == this &&
@@ -361,14 +361,14 @@
     MSG msg;
     AwtComponent::InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y);
 
-    SendMouseEvent(java_awt_event_MouseEvent_MOUSE_RELEASED, TimeHelper::windowsToUTC(::GetTickCount()),
+    SendMouseEvent(java_awt_event_MouseEvent_MOUSE_RELEASED, TimeHelper::getMessageTimeUTC(),
                    x, y, AwtComponent::GetJavaModifiers(), clickCount,
                    (AwtComponent::GetButton(button) == java_awt_event_MouseEvent_BUTTON3 ?
                     TRUE : FALSE), AwtComponent::GetButton(button), &msg);
 
     if ((m_mouseButtonClickAllowed & AwtComponent::GetButtonMK(button)) != 0) { // No up-button in the drag-state
         SendMouseEvent(java_awt_event_MouseEvent_MOUSE_CLICKED,
-                       TimeHelper::windowsToUTC(::GetTickCount()), x, y, AwtComponent::GetJavaModifiers(),
+                       TimeHelper::getMessageTimeUTC(), x, y, AwtComponent::GetJavaModifiers(),
                        clickCount, JNI_FALSE, AwtComponent::GetButton(button));
     }
     m_mouseButtonClickAllowed &= ~AwtComponent::GetButtonMK(button); // Exclude the up-button from the drag-state
@@ -395,7 +395,7 @@
         if ((flags & ALL_MK_BUTTONS) != 0) {
             m_mouseButtonClickAllowed = 0;
         } else {
-            SendMouseEvent(java_awt_event_MouseEvent_MOUSE_MOVED, TimeHelper::windowsToUTC(::GetTickCount()), x, y,
+            SendMouseEvent(java_awt_event_MouseEvent_MOUSE_MOVED, TimeHelper::getMessageTimeUTC(), x, y,
                            AwtComponent::GetJavaModifiers(), 0, JNI_FALSE,
                            java_awt_event_MouseEvent_NOBUTTON, &msg);
         }
@@ -408,7 +408,7 @@
     if (AwtComponent::GetJavaModifiers() & java_awt_event_InputEvent_BUTTON1_DOWN_MASK) {
         MSG msg;
         AwtComponent::InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y);
-        SendActionEvent(java_awt_event_ActionEvent_ACTION_PERFORMED, TimeHelper::windowsToUTC(::GetTickCount()),
+        SendActionEvent(java_awt_event_ActionEvent_ACTION_PERFORMED, TimeHelper::getMessageTimeUTC(),
                         AwtComponent::GetJavaModifiers(), &msg);
     }
     return mrConsume;
@@ -417,14 +417,14 @@
 MsgRouting AwtTrayIcon::WmKeySelect(UINT flags, int x, int y)
 {
     static jlong lastKeySelectTime = 0;
-    jlong now = TimeHelper::windowsToUTC(::GetTickCount());
+    jlong now = TimeHelper::getMessageTimeUTC();
 
     // If a user selects a notify icon with the ENTER key,
     // Shell 5.0 sends double NIN_KEYSELECT notification.
     if (lastKeySelectTime != now) {
         MSG msg;
         AwtComponent::InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y);
-        SendActionEvent(java_awt_event_ActionEvent_ACTION_PERFORMED, TimeHelper::windowsToUTC(::GetTickCount()),
+        SendActionEvent(java_awt_event_ActionEvent_ACTION_PERFORMED, TimeHelper::getMessageTimeUTC(),
                         AwtComponent::GetJavaModifiers(), &msg);
     }
     lastKeySelectTime = now;
@@ -441,7 +441,7 @@
     if (clickCount == 2) {
         MSG msg;
         AwtComponent::InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y);
-        SendActionEvent(java_awt_event_ActionEvent_ACTION_PERFORMED, TimeHelper::windowsToUTC(::GetTickCount()),
+        SendActionEvent(java_awt_event_ActionEvent_ACTION_PERFORMED, TimeHelper::getMessageTimeUTC(),
                         AwtComponent::GetJavaModifiers(), &msg);
     }
     return mrConsume;
--- a/src/windows/transport/shmem/shmem_md.c	Tue Oct 14 10:33:34 2014 -0700
+++ b/src/windows/transport/shmem/shmem_md.c	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, 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
@@ -30,6 +30,11 @@
 #include "sysShmem.h"
 #include "shmemBase.h"  /* for exitTransportWithError */
 
+/* Use THIS_FILE when it is available. */
+#ifndef THIS_FILE
+    #define THIS_FILE __FILE__
+#endif
+
 /*
  * These functions are not completely universal. For now, they are used
  * exclusively for Jbug's shared memory transport mechanism. They have
--- a/test/ProblemList.txt	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/ProblemList.txt	Tue Oct 14 12:20:39 2014 -0700
@@ -396,10 +396,6 @@
 # 7132203
 sun/jvmstat/monitor/MonitoredVm/CR6672135.java                  generic-all
 
-# 8001118
-sun/tools/jcmd/jcmd-f.sh					generic-all
-sun/tools/jcmd/jcmd-help-help.sh				generic-all
-
 # 7175775
 sun/tools/jinfo/Basic.sh					macosx-all
 
@@ -444,9 +440,6 @@
 # Problems on windows, jmap.exe hangs? (these run jmap), fails on Solaris 10 x86
 java/util/concurrent/locks/Lock/TimedAcquireLeak.java           generic-all
 
-# 7041639, Solaris DSA keypair generation bug
-java/util/TimeZone/TimeZoneDatePermissionCheck.sh               solaris-all
-
 # 8026772: test/sun/util/resources/TimeZone/Bug6317929.java failing
 sun/util/resources/TimeZone/Bug6317929.java                     generic-all
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/5036554/JavaBug.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 bug;
+
+public class JavaBug {
+    public static void main(String[] args) {
+        try {
+            org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null);
+            org.omg.CORBA.Any any = orb.create_any();
+            myStringHelper.insert(any, "hello");
+            System.out.println("Any: " + myStringHelper.extract(any));
+        } catch( Exception e ) {
+            e.printStackTrace();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/5036554/README	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+Bug # 5036554 unmarshal error on CORBA alias type in CORBA any
+
+Platform : ALL 
+
+Testcase directory :  <.../corba>
+
+Test Procedure : <STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
+Step 1: create a file bug.idl with the following content:
+
+// IDL file bug.idl
+module bug {
+    typedef string myString;
+};
+
+Step 2: Translate bug.idl with the command: idlj bug.idl
+This will create the file bug/myStringHelper.java
+
+Step 3:
+Create the file JavaBug.java in directory bug with the following content:
+
+// Java file JavaBug.java
+package bug;
+
+public class JavaBug {
+    public static void main(String[] args) {
+        try {
+            org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null);
+            org.omg.CORBA.Any any = orb.create_any();
+            myStringHelper.insert(any, "hello");
+            System.out.println("Any: " + myStringHelper.extract(any));
+        } catch( Exception e ) {
+            e.printStackTrace();
+        }
+    }
+}  
+
+Step 4:
+Compile all java files with the command: javac -d . bug\*.java
+
+Step 5:
+Execute the program with the command: java -cp . bug/JavaBug
+
+Step 6: Note the null pointer exception in the the output!
+
+
+Without Fix behaviour :  <java.lang.NullPointerException
+        at com.sun.corba.se.internal.corba.TCUtility.unmarshalIn(TCUtility.java:290)
+        at com.sun.corba.se.internal.corba.AnyImpl.read_value(AnyImpl.java:561)
+        at bug.myStringHelper.insert(myStringHelper.java:20)
+        at bug.JavaBug.main(JavaBug.java:8)>
+        
+With Fix behaviour :  <The output message printed on the console: "Any: hello">
+
+Other Comments :  <Test case is automated.>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/5036554/TestCorbaBug.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,112 @@
+#!/bin/sh
+#
+# Copyright (c) 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.
+#
+# 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.
+#
+
+# @test  
+# @bug 5036554 6357706
+# @summary unmarshal error on CORBA alias type in CORBA any
+# @run shell TestCorbaBug.sh
+
+if [ "${TESTSRC}" = "" ]
+then TESTSRC=.
+fi
+
+if [ "${TESTJAVA}" = "" ]
+then
+  PARENT=`dirname \`which java\``
+  TESTJAVA=`dirname ${PARENT}`
+  echo "TESTJAVA not set, selecting " ${TESTJAVA}
+  echo "If this is incorrect, try setting the variable manually."
+fi
+
+if [ "${TESTCLASSES}" = "" ]
+then
+  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
+  exit 1
+fi
+
+# set platform-dependent variables
+OS=`uname -s`
+case "$OS" in
+  SunOS | Linux | Darwin )
+    PS=":"
+    FS="/"
+    ;;
+  CYGWIN* )
+    PS=";"
+    FS="/"
+    ;;
+  Windows* )
+    PS=";"
+    FS="\\"
+    ;;
+  * )
+    echo "Unrecognized system!"
+    exit 1;
+    ;;
+esac
+
+CLASSPATH=.${PS}${TESTCLASSES}; export CLASSPATH
+
+THIS_DIR=`pwd`
+
+${TESTJAVA}${FS}bin${FS}java -version
+
+mkdir bug
+
+cp ${TESTSRC}${FS}bug.idl .
+${TESTJAVA}${FS}bin${FS}idlj bug.idl
+
+cp ${TESTSRC}${FS}JavaBug.java bug
+
+chmod -fR 777 bug
+
+${TESTJAVA}${FS}bin${FS}javac -d . bug${FS}*.java
+
+${TESTJAVA}${FS}bin${FS}java -cp . bug/JavaBug > test.out 2>&1 
+
+grep "NullPointerException" test.out
+
+ERROR=$?
+
+cat test.out
+
+if [ $ERROR = 0 ]
+then
+    echo "Test Failed"
+    exit 1
+fi
+
+grep "Any: hello" test.out
+
+STATUS=$?
+
+if [ $STATUS = 0 ]
+then
+    echo "Test Passed"
+    exit 0
+else
+    echo "Invalid output"
+    cat test.out
+    exit 2
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/5036554/bug.idl	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,4 @@
+// IDL file bug.idl
+module bug {
+    typedef string myString;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/se/impl/io/CustomOutputStream.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+import java.io.Serializable;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.Principal;
+import org.omg.CORBA_2_3.portable.OutputStream;
+import org.omg.CORBA_2_3.portable.InputStream;
+
+public class CustomOutputStream extends OutputStream {
+
+    @Override
+    public void write_value(Serializable value, Class clz) {
+    }
+
+    @Override
+    public InputStream create_input_stream() {
+        return null;
+    }
+
+    @Override
+    public void write_boolean(boolean value) {
+    }
+
+    @Override
+    public void write_char(char value) {
+    }
+
+    @Override
+    public void write_wchar(char value) {
+    }
+
+    @Override
+    public void write_octet(byte value) {
+    }
+
+    @Override
+    public void write_short(short value) {
+    }
+
+    @Override
+    public void write_ushort(short value) {
+    }
+
+    @Override
+    public void write_long(int value) {
+    }
+
+    @Override
+    public void write_ulong(int value) {
+    }
+
+    @Override
+    public void write_longlong(long value) {
+    }
+
+    @Override
+    public void write_ulonglong(long value) {
+    }
+
+    @Override
+    public void write_float(float value) {
+    }
+
+    @Override
+    public void write_double(double value) {
+    }
+
+    @Override
+    public void write_string(String value) {
+    }
+
+    @Override
+    public void write_wstring(String value) {
+    }
+
+    @Override
+    public void write_boolean_array(boolean[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_char_array(char[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_wchar_array(char[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_octet_array(byte[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_short_array(short[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_ushort_array(short[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_long_array(int[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_ulong_array(int[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_longlong_array(long[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_ulonglong_array(long[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_float_array(float[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_double_array(double[] value, int offset,
+            int length) {
+    }
+
+    @Override
+    public void write_Object(org.omg.CORBA.Object value) {
+    }
+
+    @Override
+    public void write_TypeCode(TypeCode value) {
+    }
+
+    @Override
+    public void write_any(Any value) {
+    }
+
+    @Override
+    public void write_Principal(Principal value) {
+    }
+
+    @Override
+    public void write(int b) throws java.io.IOException {
+    }
+
+    @Override
+    public void write_fixed(java.math.BigDecimal value) {
+    }
+
+    @Override
+    public void write_Context(org.omg.CORBA.Context ctx,
+            org.omg.CORBA.ContextList contexts) {
+    }
+
+    @Override
+    public org.omg.CORBA.ORB orb() {
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/se/impl/io/HookPutFieldsTest.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 7095856
+ * @summary OutputStreamHook doesn't handle null values
+ */
+
+import java.net.InetAddress;
+import javax.rmi.CORBA.Util;
+import javax.rmi.CORBA.ValueHandler;
+
+public class HookPutFieldsTest  {
+
+    public static void main(String[] args ) throws Exception {
+        CustomOutputStream os = new CustomOutputStream();
+        InetAddress a = InetAddress.getByAddress(null, new byte[] {1,2,3,4});
+        ValueHandler vh = Util.createValueHandler();
+        vh.writeValue(os, a);
+    }
+}
--- a/test/demo/zipfs/basic.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/demo/zipfs/basic.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -40,7 +40,7 @@
 
 OS=`uname -s`
 case "$OS" in
-    Windows_* )
+    Windows_* | CYGWIN* )
         CLASSPATH="${TESTCLASSES};${ZIPFS}"
         ;;
     * )
--- a/test/java/awt/FileDialog/SaveFileNameOverrideTest/SaveFileNameOverrideTest.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/java/awt/FileDialog/SaveFileNameOverrideTest/SaveFileNameOverrideTest.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,6 +1,29 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
 /*
   test
-  @bug 6998877
+  @bug 6998877 8022531
   @summary After double-click on the folder names, FileNameOverrideTest FAILED
   @author Sergey.Bylokhov@oracle.com area=awt.filedialog
   @library ../../regtesthelpers
@@ -36,7 +59,8 @@
 
         String[] instructions = {
                 "1) Click on 'Show File Dialog' button. A file dialog will come up.",
-                "2) Double-click on '" + clickDirName + "' and click OK.",
+                "2) Double-click on '" + clickDirName + "' and click a confirmation",
+                "   button, it can be 'OK', 'Save' or any other platform-dependent name.",
                 "3) See result of the test below"
         };
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Focus/8044614/TestApplet.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+import java.applet.Applet;
+import java.awt.TextField;
+
+public class TestApplet extends Applet {
+    TextField textField = null;
+
+    public void init() {
+        textField = new TextField(25);
+        add(textField);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Focus/8044614/applet1.html	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,37 @@
+<!--
+ Copyright (c) 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.
+ 
+ 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.
+-->
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=utf-8">
+  <title>First Applet</title>
+</head>
+  <body>
+    <applet 
+      code="TestApplet.class"
+      width="400" 
+      height="200"/>
+    </applet>
+  </body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Focus/8044614/applet2.html	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,37 @@
+<!--
+ Copyright (c) 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.
+ 
+ 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.
+-->
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=utf-8">
+  <title>Second Applet</title>
+</head>
+  <body>
+    <applet 
+      code="TestApplet.class"
+      width="400" 
+      height="200"/>
+    </applet>
+  </body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Focus/8044614/bug8044614.html	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,36 @@
+<!--
+ Copyright (c) 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.
+ 
+ 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.
+-->
+
+<html>
+<head>
+<title>bug8044614</title>
+</head>
+<body>
+
+<h1>bug8044614</h1>
+
+<p> See the dialog box (usually in upper left corner) for instructions</p>
+
+<APPLET CODE="bug8044614.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Focus/8044614/bug8044614.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8044614
+ * @summary Tests focus transfer between applets in different browser windows
+ * @author Dmitry Markov
+ * @library ../../regtesthelpers
+ * @build Sysout
+ * @run applet/manual=yesno bug8044614.html
+ */
+
+import javax.swing.JApplet;
+
+import test.java.awt.regtesthelpers.Sysout;
+
+public class bug8044614 extends JApplet {
+    public void init() {
+        String[] instructions = {
+            "(1) Go to the test directory test/java/awt/Focus/8044614",
+            "(2) Compile source file: javac TestApplet.java",
+            "(3) Open the \"main.html\" file in the browser",
+            "(4) Click the \"Start First Applet\" link to open the first applet window",
+            "(5) Wait for the applet to start (press \"Run\" to any security alerts that appears)",
+            "(6) Enter \"Hello\" to the text field",
+            "(7) Click the \"Start Second Applet)\" link to open the second applet window",
+            "(8) Wait for the applet to start (press \"Run\" to any security alerts that appears)",
+            "(9) Enter \"World\" to the text field",
+            "(10) Go back to the first applet and make sure you can enter some text to the text field"
+        };
+
+        Sysout.createDialogWithInstructions(instructions);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Focus/8044614/main.html	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,46 @@
+<!--
+ Copyright (c) 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.
+
+ 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.
+-->
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=utf-8">
+  <title>Applet Focus Bug main window</title>
+  <script language="JavaScript">
+    function openWindow(strURL, strWindowName, strWindowFeatures) {
+      var win = window.open(strURL, strWindowName, strWindowFeatures);
+    }
+  </script>
+
+</head>
+  <body>
+    <table>
+      <tr>
+        <td><a href="javascript:openWindow('applet1.html', '', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=400, top=0, left=0, hide=no')">Start First Applet</a></td>
+      </tr>
+      <tr>
+        <td><a href="javascript:openWindow('applet2.html', '', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=400, top=0, left=350, hide=no')">Start Second Applet</a></td>
+      </tr>
+    </table>
+  </body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/Focus/SortingFPT/JDK8048887.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/*
+  @test
+  @bug       8048887
+  @summary   Tests SortingFTP for an exception caused by the tim-sort algo.
+  @author    anton.tarasov: area=awt.focus
+  @run       main JDK8040632
+*/
+
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+import java.awt.Dimension;
+import java.awt.Color;
+import java.awt.GridBagLayout;
+import java.awt.GridBagConstraints;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+public class JDK8048887 {
+
+    static volatile boolean passed = true;
+
+    public static void main(String[] args) {
+        JDK8048887 app = new JDK8048887();
+        app.start();
+    }
+
+    public void start() {
+        final CountDownLatch latch = new CountDownLatch(1);
+
+        SwingUtilities.invokeLater(() -> {
+                // Catch the original exception which sounds like:
+                // java.lang.IllegalArgumentException: Comparison method violates its general contract!
+                Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
+                        public void uncaughtException(Thread t, Throwable e) {
+                            e.printStackTrace();
+                            if (e instanceof IllegalArgumentException) {
+                                passed = false;
+                                latch.countDown();
+                            }
+                        }
+                    });
+
+                TestDialog d = new TestDialog();
+                // It's expected that the dialog is focused on start.
+                // The listener is called after the FTP completes processing and the bug is reproduced or not.
+                d.addWindowFocusListener(new WindowAdapter() {
+                        public void windowGainedFocus(WindowEvent e) {
+                            latch.countDown();
+                        }
+                });
+                d.setVisible(true);
+        });
+
+        try {
+            latch.await(5, TimeUnit.SECONDS);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+
+        if (passed)
+            System.out.println("Test passed.");
+        else
+            throw new RuntimeException("Test failed!");
+    }
+}
+
+class TestDialog extends JFrame {
+
+    // The layout of the components reproduces the transitivity issue
+    // with SortingFocusTraversalPolicy relying on the tim-sort algo.
+
+    private static int[] Xs = new int[] {71, 23, 62, 4, 79, 39, 34, 9, 84, 58, 30, 34, 38, 15, 69, 10, 44, 95, 70, 54,
+    44, 62, 77, 64, 70, 83, 31, 48, 96, 54, 40, 3, 60, 58, 3, 20, 94, 54, 26, 19, 48, 47, 12, 70, 86, 43, 71, 97, 19,
+    69, 90, 22, 43, 76, 10, 60, 29, 49, 9, 9, 15, 73, 85, 80, 81, 35, 87, 43, 17, 57, 38, 44, 29, 86, 96, 15, 57, 26,
+    27, 78, 26, 87, 43, 6, 4, 16, 57, 99, 32, 86, 96, 5, 50, 69, 12, 4, 36, 84, 71, 60, 22, 46, 11, 44, 87, 3, 23, 14,
+    43, 25, 32, 44, 11, 18, 77, 2, 51, 87, 88, 53, 69, 37, 14, 10, 25, 73, 39, 33, 91, 51, 96, 9, 74, 66, 70, 42, 72,
+    7, 82, 40, 91, 33, 83, 54, 33, 50, 83, 1, 81, 32, 66, 11, 75, 56, 53, 45, 1, 69, 46, 31, 79, 58, 12, 20, 92, 49,
+    50, 90, 33, 8, 43, 93, 72, 78, 9, 56, 84, 60, 30, 39, 33, 88, 84, 56, 49, 47, 4, 90, 57, 6, 23, 96, 37, 88, 22, 79,
+    35, 80, 45, 55};
+
+    public TestDialog() {
+        JPanel panel = new JPanel(new GridBagLayout());
+        GridBagConstraints gbc = new GridBagConstraints();
+        for (int i=0; i < Xs.length; i++) {
+            gbc.gridx = Xs[i];
+            gbc.gridy = 100 - gbc.gridx;
+            panel.add(new MyComponent(), gbc);
+        }
+        getRootPane().getContentPane().add(panel);
+        pack();
+    }
+
+    public static class MyComponent extends JPanel {
+        private final static Dimension SIZE = new Dimension(1,1);
+
+        public MyComponent() {
+            setBackground(Color.BLACK);
+            setOpaque(true);
+        }
+
+        @Override
+        public Dimension getPreferredSize() {
+            return SIZE;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/List/ListGarbageCollectionTest/AwtListGarbageCollectionTest.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 8040076
+ * @summary AwtList not garbage collected
+ * @run main/othervm -Xmx100m AwtListGarbageCollectionTest
+ */
+
+import java.awt.*;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.lang.ref.WeakReference;
+
+public class AwtListGarbageCollectionTest {
+    public static void main(String[] args) {
+        Frame frame = new Frame("List leak test");
+        try {
+            test(frame);
+        } finally {
+            frame.dispose();
+        }
+    }
+
+    private static void test(Frame frame) {
+        WeakReference<List> weakListRef = null;
+        try {
+            frame.setSize(300, 200);
+            frame.setVisible(true);
+
+            List strongListRef = new List();
+            frame.add(strongListRef);
+            strongListRef.setMultipleMode(true);
+            frame.remove(strongListRef);
+            weakListRef = new WeakReference<List>(strongListRef);
+            strongListRef = null;
+
+            //make out of memory to force gc
+            String veryLongString = new String(new char[100]);
+            while (true) {
+                veryLongString += veryLongString;
+            }
+        } catch (OutOfMemoryError e) {
+            if (weakListRef == null) {
+                throw new RuntimeException("Weak list ref wasn't created");
+            } else if (weakListRef.get() != null) {
+                throw new RuntimeException("List wasn't garbage collected");
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/event/InputEvent/EventWhenTest/EventWhenTest.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+import sun.awt.SunToolkit;
+
+import java.awt.*;
+import java.awt.event.AWTEventListener;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+
+/*
+ * @test
+ * @bug 8046495
+ * @summary Verifies that mouse/key events has always increasing 'when' timestamps
+ * @author Anton Nashatyrev
+ * @run main EventWhenTest
+ */
+public class EventWhenTest {
+
+    private static volatile int eventsCount = 0;
+    private static volatile boolean failed = false;
+
+    static {
+        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
+            long lastWhen = 0;
+
+            @Override
+            public void eventDispatched(AWTEvent event) {
+                long curWhen;
+                if (event instanceof KeyEvent) {
+                    curWhen = ((KeyEvent) event).getWhen();
+                } else if (event instanceof MouseEvent) {
+                    curWhen = ((MouseEvent) event).getWhen();
+                } else {
+                    return;
+                }
+
+                eventsCount++;
+
+                if (curWhen < lastWhen) {
+                    System.err.println("FAILED: " + curWhen + " < " + lastWhen +
+                        " for " + event);
+                    failed = true;
+                } else {
+                    lastWhen = curWhen;
+                }
+            }
+        }, AWTEvent.KEY_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK);
+    }
+
+    public static void main(String[] args) throws Exception {
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Frame frame = new Frame();
+
+        try {
+            Button b = new Button("Button");
+            frame.setBounds(300, 300, 300, 300);
+            frame.add(b);
+            frame.setVisible(true);
+            toolkit.realSync();
+
+            Robot robot = new Robot();
+            robot.mouseMove((int)frame.getLocationOnScreen().getX() + 150,
+                    (int)frame.getLocationOnScreen().getY() + 150);
+
+            eventsCount = 0;
+            System.out.println("Clicking mouse...");
+            for (int i = 0; i < 300 && !failed; i++) {
+                robot.mousePress(InputEvent.BUTTON1_MASK);
+                robot.mouseRelease(InputEvent.BUTTON1_MASK);
+                Thread.sleep(10);
+                b.setLabel("Click: " + i);
+            }
+
+            if (eventsCount == 0) {
+                throw new RuntimeException("No events were received");
+            }
+
+            if (failed) {
+                throw new RuntimeException("Test failed.");
+            }
+            System.out.println("Clicking mouse done: " + eventsCount + " events.");
+
+            b.requestFocusInWindow();
+            toolkit.realSync();
+
+            eventsCount = 0;
+            System.out.println("Typing a key...");
+            for (int i = 0; i < 300 && !failed; i++) {
+                robot.keyPress(KeyEvent.VK_A);
+                robot.keyRelease(KeyEvent.VK_A);
+                Thread.sleep(10);
+                b.setLabel("Type: " + i);
+            }
+            System.out.println("Key typing done: " + eventsCount + " events.");
+
+            if (eventsCount == 0) {
+                throw new RuntimeException("No events were received");
+            }
+
+            if (failed) {
+                throw new RuntimeException("Test failed.");
+            }
+
+            System.out.println("Success!");
+        } finally {
+            frame.dispose();
+        }
+    }
+}
--- a/test/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java	Tue Oct 14 12:20:39 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 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
@@ -23,7 +23,7 @@
 
 /*
   @test
-  @bug       7154072
+  @bug       7154072 7161320
   @summary   Tests that key events with modifiers are not swallowed.
   @author    anton.tarasov: area=awt.focus
   @library   ../../../regtesthelpers
@@ -49,6 +49,11 @@
     static Robot r;
 
     public static void main(String[] args) {
+        if (sun.awt.OSInfo.getOSType() == sun.awt.OSInfo.OSType.WINDOWS) {
+            System.out.println("Skipped. Test not for MS Windows.");
+            return;
+        }
+
         f.add(t);
         f.pack();
         f.setVisible(true);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/beans/Introspector/Test7172865.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+import java.beans.IndexedPropertyDescriptor;
+import java.beans.MethodDescriptor;
+import java.beans.PropertyDescriptor;
+
+/*
+ * @test
+ * @bug 7172854 7172865
+ * @summary Tests that cached methods are not lost
+ * @author Sergey Malenkov
+ */
+
+public class Test7172865 {
+    public static void main(String[] args) throws Exception {
+        int errors = 0;
+
+        MethodDescriptor md = new MethodDescriptor(Test7172865.class.getMethod("getGood"));
+
+        errors += test(PropertyDescriptor.class, "good", true);
+        PropertyDescriptor pdGoodString = new PropertyDescriptor("good", Test7172865.class, "getGood", "setGood");
+        PropertyDescriptor pdGoodMethod = new PropertyDescriptor("good",
+                Test7172865.class.getMethod("getGood"),
+                Test7172865.class.getMethod("setGood", args.getClass()));
+
+        errors += test(PropertyDescriptor.class, "bad", false);
+        PropertyDescriptor pdBadString = new PropertyDescriptor("bad", Test7172865.class, "getBad", null);
+        PropertyDescriptor pdBadMethod = new PropertyDescriptor("bad",
+                Test7172865.class.getMethod("getBad"),
+                Test7172865.class.getMethod("setBad", args.getClass()));
+
+        errors += test(IndexedPropertyDescriptor.class, "good", true);
+        IndexedPropertyDescriptor ipdGoodString = new IndexedPropertyDescriptor("good", Test7172865.class, "getGood", "setGood", "getGood", "setGood");
+        IndexedPropertyDescriptor ipdGoodMethod = new IndexedPropertyDescriptor("good",
+                Test7172865.class.getMethod("getGood"),
+                Test7172865.class.getMethod("setGood", args.getClass()),
+                Test7172865.class.getMethod("getGood", Integer.TYPE),
+                Test7172865.class.getMethod("setGood", Integer.TYPE, String.class));
+
+        errors += test(IndexedPropertyDescriptor.class, "bad", false);
+        IndexedPropertyDescriptor ipdBadString = new IndexedPropertyDescriptor("bad", Test7172865.class, "getBad", null, "getBad", null);
+        IndexedPropertyDescriptor ipdBadMethod = new IndexedPropertyDescriptor("bad",
+                Test7172865.class.getMethod("getBad"),
+                Test7172865.class.getMethod("setBad", args.getClass()),
+                Test7172865.class.getMethod("getBad", Integer.TYPE),
+                Test7172865.class.getMethod("setBad", Integer.TYPE, String.class));
+
+        for (int i = 1; i <= 2; i++) {
+            System.out.println("STEP: " + i);
+            errors += test("md", null != md.getMethod());
+
+            errors += test("pdGoodString", pdGoodString, true, true);
+            errors += test("pdGoodMethod", pdGoodMethod, true, true);
+
+            errors += test("pdBadString", pdBadString, true, false);
+            errors += test("pdBadMethod", pdBadMethod, true, true);
+
+            errors += test("ipdGoodString", ipdGoodString, true, true, true, true);
+            errors += test("ipdGoodMethod", ipdGoodMethod, true, true, true, true);
+
+            errors += test("ipdBadString", ipdBadString, true, false, true, false);
+            errors += test("ipdBadMethod", ipdBadMethod, true, true, true, true);
+
+            try {
+                int[] array = new int[1024];
+                while (true) {
+                    array = new int[array.length << 1];
+                }
+            }
+            catch (OutOfMemoryError error) {
+                System.gc();
+            }
+        }
+        if (errors > 0) {
+            throw new Error("found " + errors + " errors");
+        }
+    }
+
+    private static int test(Class<?> type, String property, boolean value) {
+        String message = type.getSimpleName() + "(" + property + ") ";
+        try {
+            type.getConstructor(String.class, Class.class).newInstance(property, Test7172865.class);
+            message += "passed";
+        }
+        catch (Exception exception) {
+            message += "failed";
+            value = !value;
+        }
+        if (value) {
+            message += " as expected";
+        }
+        System.out.println(message);
+        return value ? 0 : 1;
+    }
+
+    private static int test(String message, boolean value) {
+        System.out.println(message + ": " + (value ? "passed" : "failed"));
+        return value ? 0 : 1;
+    }
+
+    private static int test(String message, PropertyDescriptor pd, boolean rm, boolean wm) {
+        return test(message + ".Read", rm == (null != pd.getReadMethod()))
+             + test(message + ".Write", wm == (null != pd.getWriteMethod()));
+    }
+
+    private static int test(String message, IndexedPropertyDescriptor ipd, boolean rm, boolean wm, boolean irm, boolean iwm) {
+        return test(message, ipd, rm, wm)
+             + test(message + ".IndexedRead", irm == (null != ipd.getIndexedReadMethod()))
+             + test(message + ".IndexedWrite", iwm == (null != ipd.getIndexedWriteMethod()));
+    }
+
+    public String[] getGood() {
+        return null;
+    }
+
+    public String getGood(int index) {
+        return null;
+    }
+
+    public void setGood(String[] good) {
+    }
+
+    public void setGood(int index, String value) {
+    }
+
+    public String[] getBad() {
+        return null;
+    }
+
+    public String getBad(int index) {
+        return null;
+    }
+
+    public Test7172865 setBad(String[] bad) {
+        return null;
+    }
+
+    public Test7172865 setBad(int index, String value) {
+        return null;
+    }
+}
--- a/test/java/lang/ClassLoader/Assert.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/java/lang/ClassLoader/Assert.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -23,6 +23,21 @@
 
 #
 
+OS=`uname -s`
+case "$OS" in
+  SunOS | Linux | Darwin )
+    FS="/"
+    CHMOD="${FS}bin${FS}chmod"
+    ;;
+  Windows* | CYGWIN* )
+    CHMOD="chmod"
+    ;;
+  * )
+    echo "Unrecognized system!"
+    exit 1;
+    ;;
+esac
+
 if [ "${TESTSRC}" = "" ]
 then
   echo "TESTSRC not set.  Test cannot execute.  Failed."
@@ -46,6 +61,7 @@
 cp ${TESTSRC}/Assert.java .
 cp -R ${TESTSRC}/package1 .
 cp -R ${TESTSRC}/package2 .
+${CHMOD} -R u+w *
 
 ${TESTJAVA}/bin/javac Assert.java 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/lang/ProcessBuilder/CloseRace.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2013, 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 8024521
+ * @summary Closing ProcessPipeInputStream at the time the process exits is racy
+ *          and leads to data corruption. Run this test manually (as
+ *          an ordinary java program) with  -Xmx8M  to repro bug 8024521.
+ * @run main/othervm -Xmx8M -Dtest.duration=2 CloseRace
+ */
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CountDownLatch;
+
+public class CloseRace {
+    private static final String BIG_FILE = "bigfile";
+
+    private static final int[] procFDs = new int[6];
+
+    /** default value sufficient to repro bug 8024521. */
+    private static final int testDurationSeconds
+        = Integer.getInteger("test.duration", 600);
+
+    private static final CountDownLatch threadsStarted
+        = new CountDownLatch(2);
+
+    static boolean fdInUse(int i) {
+        return new File("/proc/self/fd/" + i).exists();
+    }
+
+    static boolean[] procFDsInUse() {
+        boolean[] inUse = new boolean[procFDs.length];
+        for (int i = 0; i < procFDs.length; i++)
+            inUse[i] = fdInUse(procFDs[i]);
+        return inUse;
+    }
+
+    static int count(boolean[] bits) {
+        int count = 0;
+        for (int i = 0; i < bits.length; i++)
+            count += bits[i] ? 1 : 0;
+        return count;
+    }
+
+    static void dumpAllStacks() {
+        System.err.println("Start of dump");
+        final Map<Thread, StackTraceElement[]> allStackTraces
+                = Thread.getAllStackTraces();
+        for (Thread thread : allStackTraces.keySet()) {
+            System.err.println("Thread " + thread.getName());
+            for (StackTraceElement element : allStackTraces.get(thread))
+                System.err.println("\t" + element);
+        }
+        System.err.println("End of dump");
+    }
+
+    public static void main(String args[]) throws Exception {
+        if (!(new File("/proc/self/fd").isDirectory()))
+            return;
+
+        // Catch Errors from process reaper
+        Thread.setDefaultUncaughtExceptionHandler(
+                new Thread.UncaughtExceptionHandler() {
+                    @Override
+                    public void uncaughtException(Thread t, Throwable e) {
+                        e.printStackTrace();
+                        System.exit(1);
+                    }
+                });
+
+        try (RandomAccessFile f = new RandomAccessFile(BIG_FILE, "rw")) {
+            f.setLength(Runtime.getRuntime().maxMemory()); // provoke OOME
+        }
+
+        for (int i = 0, j = 0; j < procFDs.length; i++)
+            if (!fdInUse(i))
+                procFDs[j++] = i;
+
+        Thread[] threads = {
+            new Thread(new OpenLoop()),
+            new Thread(new ExecLoop()),
+        };
+        for (Thread thread : threads)
+            thread.start();
+
+        threadsStarted.await();
+        Thread.sleep(testDurationSeconds * 1000);
+
+        for (Thread thread : threads)
+            thread.interrupt();
+        for (Thread thread : threads) {
+            thread.join(10_000);
+            if (thread.isAlive()) {
+                dumpAllStacks();
+                throw new Error("At least one child thread ("
+                        + thread.getName()
+                        + ") failed to finish gracefully");
+            }
+        }
+    }
+
+    static class OpenLoop implements Runnable {
+        public void run() {
+            threadsStarted.countDown();
+            while (!Thread.interrupted()) {
+                try {
+                    // wait for ExecLoop to finish creating process
+                    do {
+                        if (Thread.interrupted())
+                            return;
+                    } while (count(procFDsInUse()) != 3);
+                    List<InputStream> iss = new ArrayList<>(4);
+
+                    // eat up three "holes" (closed ends of pipe fd pairs)
+                    for (int i = 0; i < 3; i++)
+                        iss.add(new FileInputStream(BIG_FILE));
+                    do {
+                        if (Thread.interrupted())
+                            return;
+                    } while (count(procFDsInUse()) == procFDs.length);
+                    // hopefully this will racily occupy empty fd slot
+                    iss.add(new FileInputStream(BIG_FILE));
+                    Thread.sleep(1); // Widen race window
+                    for (InputStream is : iss)
+                        is.close();
+                } catch (InterruptedException e) {
+                    break;
+                } catch (Exception e) {
+                    throw new Error(e);
+                }
+            }
+        }
+    }
+
+    static class ExecLoop implements Runnable {
+        public void run() {
+            threadsStarted.countDown();
+            ProcessBuilder builder = new ProcessBuilder("/bin/true");
+            while (!Thread.interrupted()) {
+                try {
+                    // wait for OpenLoop to finish
+                    do {
+                        if (Thread.interrupted())
+                            return;
+                    } while (count(procFDsInUse()) > 0);
+                    Process process = builder.start();
+                    InputStream is = process.getInputStream();
+                    process.waitFor();
+                    is.close();
+                } catch (InterruptedException e) {
+                    break;
+                } catch (Exception e) {
+                    throw new Error(e);
+                }
+            }
+        }
+    }
+}
--- a/test/java/lang/Runtime/exec/CloseRace.java	Tue Oct 14 10:33:34 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-/*
- * Copyright (c) 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.
- *
- * 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.
- */
-
-/**
- * @test
- * @bug 8024521
- * @summary Closing ProcessPipeInputStream at the time the process exits is racy
- *          and leads to the data corruption.
- * @library /lib/testlibrary
- * @run main/othervm/timeout=80 CloseRace
- */
-
-/**
- * This test has a little chance to catch the race during the given default
- * time gap of 20 seconds. To increase the time gap, set the system property
- * CloseRaceTimeGap=N to the number of seconds.
- * Jtreg's timeoutFactor should also be set appropriately.
- *
- * For example, to run the test for 10 minutes:
- * > jtreg \
- *       -testjdk:$(PATH_TO_TESTED_JDK) \
- *       -timeoutFactor:10 \
- *       -DCloseRaceTimeGap=600 \
- *       $(PATH_TO_TESTED_JDK_SOURCE)/test/java/lang/Runtime/exec/CloseRace.java
- */
-
-import java.io.*;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.LinkedList;
-import java.util.List;
-import jdk.testlibrary.OutputAnalyzer;
-import static jdk.testlibrary.ProcessTools.*;
-
-public class CloseRace {
-
-    public static void main(String args[]) throws Exception {
-        ProcessBuilder pb = createJavaProcessBuilder("-Xmx64M", "CloseRace$Child",
-                System.getProperty("CloseRaceTimeGap", "20"));
-        OutputAnalyzer oa = new OutputAnalyzer(pb.start());
-        oa.stderrShouldNotContain("java.lang.OutOfMemoryError");
-    }
-
-    public static class Child {
-        private static final String BIG_FILE = "bigfile";
-        private static final String SMALL_FILE = "smallfile";
-        private static int timeGap = 20; // seconds
-
-        public static void main(String args[]) throws Exception {
-            if (args.length > 0) {
-                try {
-                    timeGap = Integer.parseInt(args[0]);
-                    timeGap = Math.max(timeGap, 10);
-                    timeGap = Math.min(timeGap, 10 * 60 * 60); // no more than 10 hours
-                } catch (NumberFormatException ignore) {}
-            }
-            try (RandomAccessFile f = new RandomAccessFile(BIG_FILE, "rw")) {
-                f.setLength(1024 * 1024 * 1024); // 1 Gb, greater than max heap size
-            }
-            try (FileOutputStream fs = new FileOutputStream(SMALL_FILE);
-                 PrintStream ps = new PrintStream(fs)) {
-                for (int i = 0; i < 128; ++i)
-                    ps.println("line of text");
-            }
-
-            List<Thread> threads = new LinkedList<>();
-            for (int i = 0; i < 99; ++i) {
-                Thread t = new Thread (new OpenLoop());
-                t.start();
-                threads.add(t);
-            }
-            Thread t2 = new Thread (new ExecLoop());
-            t2.start();
-            threads.add(t2);
-
-            Thread.sleep(timeGap);
-
-            for (Thread t : threads) {
-                t.interrupt();
-                t.join();
-            }
-        }
-
-        private static class OpenLoop implements Runnable {
-            public void run() {
-                final Path bigFilePath = Paths.get(BIG_FILE);
-                while (!Thread.interrupted()) {
-                    try (InputStream in = Files.newInputStream(bigFilePath)) {
-                        // Widen the race window by sleeping 1ms
-                        Thread.sleep(1);
-                    } catch (InterruptedException e) {
-                        break;
-                    } catch (Exception e) {
-                        System.err.println(e);
-                    }
-                }
-            }
-        }
-
-        private static class ExecLoop implements Runnable {
-            public void run() {
-                List<String> command = new ArrayList<>(
-                        Arrays.asList("/bin/cat", SMALL_FILE));
-                while (!Thread.interrupted()) {
-                    try {
-                        ProcessBuilder builder = new ProcessBuilder(command);
-                        final Process process = builder.start();
-                        InputStream is = process.getInputStream();
-                        InputStreamReader isr = new InputStreamReader(is);
-                        BufferedReader br = new BufferedReader(isr);
-                        while (br.readLine() != null) {}
-                        process.waitFor();
-                        isr.close();
-                    } catch (InterruptedException e) {
-                        break;
-                    } catch (Exception e) {
-                        System.err.println(e);
-                    }
-                }
-            }
-        }
-    }
-}
--- a/test/java/net/NetworkInterface/UniqueMacAddressesTest.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/java/net/NetworkInterface/UniqueMacAddressesTest.java	Tue Oct 14 12:20:39 2014 -0700
@@ -118,11 +118,14 @@
         NetworkInterface netIf = null;
         while (nis.hasMoreElements()) {
             netIf = (NetworkInterface) nis.nextElement();
-            macAddr = netIf.getHardwareAddress();
-            if (macAddr != null) {
-                System.out
-                        .println("Adding NetworkInterface " + netIf.getName());
-                networkInterfaceList.add(netIf);
+            if (netIf.isUp()) {
+                macAddr = netIf.getHardwareAddress();
+                if (macAddr != null) {
+                    System.out.println("Adding NetworkInterface "
+                            + netIf.getName() + " with mac address "
+                            + createMacAddressString(netIf));
+                    networkInterfaceList.add(netIf);
+                }
             }
         }
     }
--- a/test/java/net/ipv6tests/BadIPv6Addresses.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/java/net/ipv6tests/BadIPv6Addresses.java	Tue Oct 14 12:20:39 2014 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4742177
+ * @bug 4742177 8019834
  * @summary Re-test IPv6 (and specifically MulticastSocket) with latest Linux & USAGI code
  */
 import java.net.*;
--- a/test/java/nio/charset/coders/CheckSJISMappingProp.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/java/nio/charset/coders/CheckSJISMappingProp.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -36,7 +36,7 @@
 case "$OS" in
   SunOS | Linux | Darwin ) ;;
   # Skip locale test for Windows
-  Windows* )
+  Windows* | CYGWIN* )
     echo "Passed"; exit 0 ;;
   * ) echo "Unrecognized system!" ;  exit 1 ;;
 esac
--- a/test/java/nio/file/Path/PathOps.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/java/nio/file/Path/PathOps.java	Tue Oct 14 12:20:39 2014 -0700
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4313887 6838333 6925932 7006126
+ * @bug 4313887 6838333 6925932 7006126 8037945
  * @summary Unit test for java.nio.file.Path path operations
  */
 
@@ -899,6 +899,8 @@
             .normalize("foo");
         test("/foo")
             .normalize("/foo");
+        test("")
+            .normalize("");
         test(".")
             .normalize("");
         test("..")
--- a/test/java/rmi/registry/readTest/readTest.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/java/rmi/registry/readTest/readTest.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -37,11 +37,13 @@
   SunOS | Linux | Darwin )
     PS=":"
     FS="/"
+    CHMOD="${FS}bin${FS}chmod"
     FILEURL="file:"
     ;;
   Windows* )
     PS=";"
     FS="\\"
+    CHMOD="chmod"
     FILEURL="file:/"
     if [ "$VER" -eq "5" ]; then
         ARGS="-Djdk.net.ephemeralPortRange.low=1024 -Djdk.net.ephemeralPortRange.high=65000"
@@ -51,6 +53,7 @@
   CYGWIN* )
     PS=";"
     FS="/"
+    CHMOD="chmod"
     FILEURL="file:/"
     if [ "${VER}" -eq "5" ]; then
         ARGS="-Djdk.net.ephemeralPortRange.low=1024 -Djdk.net.ephemeralPortRange.high=65000"
@@ -65,6 +68,7 @@
 
 TEST_CLASSPATH=.$PS${TESTCLASSPATH:-$TESTCLASSES}
 cp -r ${TESTSRC}${FS}* .
+${CHMOD} -R u+w *
 ${TESTJAVA}${FS}bin${FS}javac testPkg${FS}*java
 ${TESTJAVA}${FS}bin${FS}javac -cp $TEST_CLASSPATH readTest.java
 
--- a/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -36,6 +36,7 @@
 ${TESTJAVA}/bin/keytool -genkeypair -alias testcert \
   -keystore ${TESTCLASSES}/timezonedatetest.store \
   -storepass testpass -validity 360 \
+  -keyalg rsa \
   -dname "cn=Mark Wildebeest, ou=FreeSoft, o=Red Hat, c=NL" \
   -keypass testpass
 
--- a/test/java/util/jar/JarInputStream/ExtraFileInMetaInf.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/java/util/jar/JarInputStream/ExtraFileInMetaInf.java	Tue Oct 14 12:20:39 2014 -0700
@@ -49,7 +49,7 @@
         new File("ks").delete();
         sun.security.tools.KeyTool.main(
                 ("-keystore ks -storepass changeit -keypass changeit " +
-                        "-alias a -dname CN=A -genkeypair").split(" "));
+                        "-keyalg rsa -alias a -dname CN=A -genkeypair").split(" "));
         sun.security.tools.JarSigner.main(
                 "-keystore ks -storepass changeit x.jar a".split(" "));
 
--- a/test/java/util/logging/ParentLoggersTest.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/java/util/logging/ParentLoggersTest.java	Tue Oct 14 12:20:39 2014 -0700
@@ -40,7 +40,9 @@
     static final String LOGGER_NAME_1   = PARENT_NAME_1 + ".myLogger";
     static final String LOGGER_NAME_2   = PARENT_NAME_2 + ".myBar.myLogger";
 
-    static final List<String> initialLoggerNames = new ArrayList<String>();
+    static final List<String> initialLoggerNames = new ArrayList<>();
+    static final List<Logger> createdLoggers = new ArrayList<>();
+
     public static void main(String args[]) throws Exception {
         // cache the initial set of loggers before this test begins
         // to add any loggers
@@ -51,7 +53,7 @@
             if (!defaultLoggers.contains(logger)) {
                 initialLoggerNames.add(logger);
             }
-        };
+        }
 
         String tstSrc = System.getProperty(TST_SRC_PROP);
         File   fname  = new File(tstSrc, LM_PROP_FNAME);
@@ -69,7 +71,7 @@
     }
 
     public static List<String> getDefaultLoggerNames() {
-        List<String> expectedLoggerNames = new ArrayList<String>();
+        List<String> expectedLoggerNames = new ArrayList<>();
 
         // LogManager always creates two loggers:
         expectedLoggerNames.add("");       // root   logger: ""
@@ -83,56 +85,41 @@
      */
     public static boolean checkLoggers() {
         String failMsg = "# checkLoggers: getLoggerNames() returned unexpected loggers";
-        Vector<String> expectedLoggerNames = new Vector<String>(getDefaultLoggerNames());
+        List<String> expectedLoggerNames = new ArrayList<>(getDefaultLoggerNames());
 
         // Create the logger LOGGER_NAME_1
-        Logger logger1 = Logger.getLogger(LOGGER_NAME_1);
-        expectedLoggerNames.addElement(PARENT_NAME_1);
-        expectedLoggerNames.addElement(LOGGER_NAME_1);
+        createdLoggers.add(Logger.getLogger(LOGGER_NAME_1));
+        expectedLoggerNames.add(PARENT_NAME_1);
+        expectedLoggerNames.add(LOGGER_NAME_1);
 
         // Create the logger LOGGER_NAME_2
-        Logger logger2 = Logger.getLogger(LOGGER_NAME_2);
-        expectedLoggerNames.addElement(PARENT_NAME_2);
-        expectedLoggerNames.addElement(LOGGER_NAME_2);
+        createdLoggers.add(Logger.getLogger(LOGGER_NAME_2));
+        expectedLoggerNames.add(PARENT_NAME_2);
+        expectedLoggerNames.add(LOGGER_NAME_2);
 
         Enumeration<String> returnedLoggersEnum = logMgr.getLoggerNames();
-        Vector<String>      returnedLoggerNames = new Vector<String>(0);
+        List<String>      returnedLoggerNames = new ArrayList<>(0);
         while (returnedLoggersEnum.hasMoreElements()) {
            String logger = returnedLoggersEnum.nextElement();
             if (!initialLoggerNames.contains(logger)) {
                 // filter out the loggers that have been added before this test runs
-                returnedLoggerNames.addElement(logger);
+                returnedLoggerNames.add(logger);
             }
-
-        };
-
+        }
+        System.out.println(returnedLoggerNames);
         return checkNames(expectedLoggerNames, returnedLoggerNames, failMsg);
     }
 
     // Returns boolean values: PASSED or FAILED
-    private static boolean checkNames(Vector<String> expNames,
-                                      Vector<String> retNames,
+    private static boolean checkNames(List<String> expNames,
+                                      List<String> retNames,
                                       String failMsg) {
         boolean status = PASSED;
 
         if (expNames.size() != retNames.size()) {
             status = FAILED;
-        } else {
-            boolean checked[] = new boolean[retNames.size()];
-            for (int i = 0; i < expNames.size(); i++) {
-                 int j = 0;
-                for (; j < retNames.size(); j++) {
-                    if (!checked[j] &&
-                        expNames.elementAt(i).equals(retNames.elementAt(j))) {
-                        checked[j] = true;
-                        break;
-                    }
-                }
-                if (j >= retNames.size()) {
-                    status = FAILED;
-                    break;
-                }
-            }
+        } else if (!new HashSet<>(expNames).equals(new HashSet<>(retNames))) {
+            status = FAILED;
         }
         if (!status) {
             printFailMsg(expNames, retNames, failMsg);
@@ -140,25 +127,25 @@
         return status;
     }
 
-    private static void printFailMsg(Vector<String> expNames,
-                                     Vector<String> retNames,
+    private static void printFailMsg(List<String> expNames,
+                                     List<String> retNames,
                                      String failMsg) {
         out.println();
         out.println(failMsg);
-        if (expNames.size() == 0) {
+        if (expNames.isEmpty()) {
             out.println("# there are NO expected logger names");
         } else {
             out.println("# expected logger names (" + expNames.size() + "):");
             for (int i = 0; i < expNames.size(); i++) {
-               out.println(" expNames[" + i + "] = " + expNames.elementAt(i));
+               out.println(" expNames[" + i + "] = " + expNames.get(i));
             }
         }
-        if (retNames.size() == 0) {
+        if (retNames.isEmpty()) {
             out.println("# there are NO returned logger names");
         } else {
             out.println("# returned logger names (" + retNames.size() + "):");
             for (int i = 0; i < retNames.size(); i++) {
-               out.println("  retNames[" + i + "] = " + retNames.elementAt(i));
+               out.println("  retNames[" + i + "] = " + retNames.get(i));
             }
         }
     }
--- a/test/java/util/logging/TestLoggerBundleSync.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/java/util/logging/TestLoggerBundleSync.java	Tue Oct 14 12:20:39 2014 -0700
@@ -190,8 +190,10 @@
         final static class MyHandler extends Handler {
             volatile ResourceBundle rb;
             volatile String rbName;
+            volatile int count = 0;
             @Override
             public synchronized void publish(LogRecord record) {
+                count++;
                 rb = record.getResourceBundle();
                 rbName = record.getResourceBundleName();
             }
@@ -227,23 +229,51 @@
                         Logger ll = Logger.getLogger(l.getName()+".bie.bye");
                         ResourceBundle hrb;
                         String hrbName;
+                        if (handler.getLevel() != Level.FINEST) {
+                            throw new RuntimeException("Handler level is not finest: "
+                                    + handler.getLevel());
+                        }
+                        final int countBefore = handler.count;
                         ll.setLevel(Level.FINEST);
                         ll.addHandler(handler);
                         ll.fine("dummy");
                         ll.removeHandler(handler);
+                        final int countAfter = handler.count;
+                        if (countBefore == countAfter) {
+                            throw new RuntimeException("Handler not called for "
+                                    + ll.getName() + "("+ countAfter +")");
+                        }
                         hrb = handler.rb;
                         hrbName = handler.rbName;
                         if (name != null) {
+                            // if name is not null, then it implies that it
+                            // won't change, since setResourceBundle() cannot
+                            // replace a non null name.
+                            // Since we never set the resource bundle on 'll',
+                            // then ll must inherit its resource bundle [name]
+                            // from l - and therefor we should find it in
+                            // handler.rb/handler.rbName
                             if (!name.equals(hrbName)) {
                                 throw new RuntimeException("Unexpected bundle name: "
-                                        +hrb.getClass().getName());
+                                        +hrbName);
                             }
+                            // here we know that hrbName is not null so hrb
+                            // should not be null either.
                             if (!name.equals(hrb.getClass().getName())) {
                                 throw new RuntimeException("Unexpected bundle name: "
                                         +hrb.getClass().getName());
                             }
                         }
 
+                        // Make sure to refer to 'l' explicitly in order to
+                        // prevent eager garbage collecting before the end of
+                        // the test (JDK-8030192)
+                        if (!ll.getName().startsWith(l.getName())) {
+                            throw new RuntimeException("Logger " + ll.getName()
+                                    + "does not start with expected prefix "
+                                    + l.getName());
+                        }
+
                         getRBcount.incrementAndGet();
                         if (!goOn) break;
                         Thread.sleep(1);
--- a/test/java/util/zip/ZipFile/ReadZip.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/java/util/zip/ZipFile/ReadZip.java	Tue Oct 14 12:20:39 2014 -0700
@@ -63,6 +63,8 @@
         Files.copy(Paths.get(System.getProperty("test.src", ""), "input.zip"),
                    newZip.toPath(), StandardCopyOption.REPLACE_EXISTING);
 
+        newZip.setWritable(true);
+
         // pad some bytes
         try (OutputStream os = Files.newOutputStream(newZip.toPath(),
                                                      StandardOpenOption.APPEND)) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/imageio/plugins/png/PngDitDepthTest.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/*
+* @test
+* @bug 4991647
+* @summary PNGMetadata.getAsTree() sets bitDepth to invalid value
+* @run main PngDitDepthTest
+*/
+
+import org.w3c.dom.Node;
+
+import javax.imageio.ImageIO;
+import javax.imageio.ImageTypeSpecifier;
+import javax.imageio.ImageWriter;
+import javax.imageio.metadata.IIOInvalidTreeException;
+import javax.imageio.metadata.IIOMetadata;
+import java.awt.image.ColorModel;
+import java.awt.image.SampleModel;
+import java.util.Iterator;
+
+public class PngDitDepthTest {
+
+    public static void main(String[] args) throws IIOInvalidTreeException {
+
+        // getting the writer for the png format
+        Iterator iter = ImageIO.getImageWritersByFormatName("png");
+        ImageWriter writer = (ImageWriter) iter.next();
+
+        // creating a color model
+        ColorModel colorModel = ColorModel.getRGBdefault();
+
+        // creating a sample model
+        SampleModel sampleModel = colorModel.createCompatibleSampleModel(640, 480);
+
+        // creating a default metadata object
+        IIOMetadata metaData = writer.getDefaultImageMetadata(new ImageTypeSpecifier(colorModel, sampleModel), null);
+        String formatName = metaData.getNativeMetadataFormatName();
+
+        // first call
+        Node metaDataNode = metaData.getAsTree(formatName);
+        try {
+            metaData.setFromTree(formatName, metaDataNode);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+
+        // second call (bitdepht is already set to an invalid value)
+        metaDataNode = metaData.getAsTree(formatName);
+
+        metaData.setFromTree(formatName, metaDataNode);
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JFileChooser/8046391/bug8046391.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8046391
+ * @summary JFileChooser hangs if displayed in Windows L&F
+ * @author Alexey Ivanov
+ * @run main/othervm/timeout=10 bug8046391
+*/
+
+import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
+import sun.awt.OSInfo;
+import sun.awt.OSInfo.OSType;
+
+import javax.swing.JFileChooser;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+
+public class bug8046391  {
+
+    public static void main(String[] args) throws Exception {
+        OSType type = OSInfo.getOSType();
+        if (type != OSType.WINDOWS) {
+            System.out.println("This test is for Windows only... skipping!");
+            return;
+        }
+
+        SwingUtilities.invokeAndWait(() -> {
+            try {
+                UIManager.setLookAndFeel(new WindowsLookAndFeel());
+            } catch (UnsupportedLookAndFeelException e) {
+                e.printStackTrace();
+            }
+            System.out.println("Creating JFileChooser...");
+            JFileChooser fileChooser = new JFileChooser();
+            System.out.println("Test passed: chooser = " + fileChooser);
+        });
+        // Test fails if creating JFileChooser hangs
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JPopupMenu/7160604/bug7160604.html	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,30 @@
+<!--
+ Copyright (c) 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.
+
+ 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.
+-->
+
+<html>
+<body>
+<applet  code="bug7160604.class" width=400 height=100></applet>
+Click on the top-bar and combo-box more than once. 
+Make sure popup menu and drop-down list have a border and their items are drawn properly.
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JPopupMenu/7160604/bug7160604.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/* @test
+   @bug 7160604
+   @summary Using non-opaque windows - popups are initially not painted correctly
+   @author Oleg Pekhovskiy
+   @run applet/manual=yesno bug7160604.html
+*/
+
+import javax.swing.AbstractAction;
+import javax.swing.BorderFactory;
+import javax.swing.JApplet;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.JWindow;
+import javax.swing.SwingUtilities;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+
+public class bug7160604 extends JApplet {
+
+    public void init() {
+        SwingUtilities.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                final JWindow window = new JWindow();
+                window.setLocation(200, 200);
+                window.setSize(300, 300);
+
+                final JLabel label = new JLabel("...click to invoke JPopupMenu");
+                label.setOpaque(true);
+                final JPanel contentPane = new JPanel(new BorderLayout());
+                contentPane.setBorder(BorderFactory.createLineBorder(Color.RED));
+                window.setContentPane(contentPane);
+                contentPane.add(label, BorderLayout.NORTH);
+
+                final JComboBox comboBox = new JComboBox(new Object[]{"1", "2", "3", "4"});
+                contentPane.add(comboBox, BorderLayout.SOUTH);
+
+                final JPopupMenu jPopupMenu = new JPopupMenu();
+
+                jPopupMenu.add("string");
+                jPopupMenu.add(new AbstractAction("action") {
+                    @Override
+                    public void actionPerformed(final ActionEvent e) {
+                    }
+                });
+                jPopupMenu.add(new JLabel("label"));
+                jPopupMenu.add(new JMenuItem("MenuItem"));
+                label.addMouseListener(new MouseAdapter() {
+                    @Override
+                    public void mouseReleased(final MouseEvent e) {
+                        jPopupMenu.show(label, 0, 0);
+                    }
+                });
+
+                window.setBackground(new Color(0, 0, 0, 0));
+
+                window.setVisible(true);
+            }
+        });
+    }
+}
--- a/test/javax/swing/JTextField/8036819/bug8036819.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/javax/swing/JTextField/8036819/bug8036819.java	Tue Oct 14 12:20:39 2014 -0700
@@ -73,7 +73,7 @@
         usernameLabel.setLabelFor(usernameField);
 
         JLabel pwdLabel = new JLabel("Password: ");
-        JTextField pwdField = new JTextField(20);
+        final JTextField pwdField = new JTextField(20);
         pwdLabel.setDisplayedMnemonic(KeyEvent.VK_P);
         pwdLabel.setLabelFor(pwdField);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/PopupFactory/8048506/bug8048506.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8048506
+ * @summary Tests that popup with null-owner does not throw NPE
+ * @author Dmitry Markov
+ */
+
+import javax.swing.*;
+import javax.swing.plaf.metal.MetalLookAndFeel;
+
+public class bug8048506 {
+
+    public static void main(String[] args) throws Exception {
+        UIManager.setLookAndFeel(new MetalLookAndFeel());
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                createAndShowGUI();
+            }
+        });
+        System.out.println("The test passed");
+    }
+
+    private static void createAndShowGUI() {
+        JFrame frame = new JFrame("bug8048506");
+        frame.setSize(400, 400);
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.setVisible(true);
+
+        PopupFactory factory = PopupFactory.getSharedInstance();
+
+        // Create and show popup with owner
+        Popup popup1 = factory.getPopup(frame, new JLabel("Popup with owner"), 100, 100);
+        popup1.show();
+
+        //Create and show popup without owner
+        Popup popup2 = factory.getPopup(null, new JLabel("Popup without owner"), 200, 200);
+        popup2.show();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/plaf/nimbus/8041725/bug8041725.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/* @test
+   @bug 8041725
+   @summary JList selection colors are not UIResource instances in Nimbus L&F
+   @author Anton Litvinov
+*/
+
+import java.awt.*;
+import javax.swing.*;
+import javax.swing.plaf.*;
+import javax.swing.plaf.nimbus.*;
+
+public class bug8041725 {
+    public static void main(String[] args) throws Exception {
+        UIManager.setLookAndFeel(new NimbusLookAndFeel());
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                JFrame frame = new JFrame("bug8041725");
+                frame.setSize(200, 200);
+                JList list = new JList(new String[]{"Item1", "Item2", "Item3"});
+                frame.getContentPane().add(list);
+                frame.pack();
+                frame.setVisible(true);
+
+                System.err.println("Test #1: No items are selected, list is enabled.");
+                testSelectionColors(list);
+
+                System.err.println("Test #2: No items are selected, list is disabled.");
+                list.setEnabled(false);
+                testSelectionColors(list);
+
+                System.err.println("Test #3: One item is selected, list is disabled.");
+                list.setSelectedIndex(0);
+                testSelectionColors(list);
+
+                System.err.println("Test #4: One item is selected, list is enabled.");
+                list.setEnabled(true);
+                testSelectionColors(list);
+
+                frame.dispose();
+            }
+        });
+    }
+
+    private static void testSelectionColors(JList list) {
+        Color selBackColor = list.getSelectionBackground();
+        if (!(selBackColor instanceof UIResource)) {
+            throw new RuntimeException(String.format(
+                "JList.getSelectionBackground() returned instance of '%s' instead of UIResource.",
+                selBackColor.getClass()));
+        }
+        Color selForeColor = list.getSelectionForeground();
+        if (!(selForeColor instanceof UIResource)) {
+            throw new RuntimeException(String.format(
+                "JList.getSelectionForeground() returned instance of '%s' instead of UIResource.",
+                selForeColor.getClass()));
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/text/GlyphView/4984669/bug4984669.html	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,30 @@
+<html>
+<!--
+  Copyright (c) 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.
+ 
+  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.
+-->
+<body>
+<applet  code="bug4984669.class" width=300 height=300></applet>
+The four lines printed above in a bold typeface should all be underlined.
+It is a bug if any of these lines is underlined only partially.
+The very first line should not be underlined at all.
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/text/GlyphView/4984669/bug4984669.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/* @test
+   @bug 4984669 8002148
+   @summary Tests HTML underlining
+   @author Peter Zhelezniakov
+   @run applet/manual=yesno bug4984669.html
+*/
+import javax.swing.*;
+import javax.swing.text.*;
+
+public class bug4984669 extends JApplet
+{
+    public void init() {
+        JEditorPane pane = new JEditorPane();
+        this.getContentPane().add(new JScrollPane(pane));
+        pane.setEditorKit(new StyledEditorKit());
+
+        try {
+            pane.getDocument().insertString(0,"12   \n",null);
+            MutableAttributeSet attrs = new SimpleAttributeSet();
+
+            StyleConstants.setFontSize(attrs, 36);
+            StyleConstants.setBold(attrs, true);
+            StyleConstants.setUnderline(attrs, true);
+            pane.getDocument().insertString(6, "aa\n", attrs);
+            pane.getDocument().insertString(9, "bbb\n", attrs);
+            pane.getDocument().insertString(13, "cccc\n", attrs);
+            pane.getDocument().insertString(18, "ddddd\n", attrs);
+        } catch (Exception e) {
+            throw new Error("Failed: Unexpected Exception", e);
+        }
+    }
+}
--- a/test/javax/swing/text/StyledEditorKit/8016833/bug8016833.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/javax/swing/text/StyledEditorKit/8016833/bug8016833.java	Tue Oct 14 12:20:39 2014 -0700
@@ -190,9 +190,9 @@
         // not too wide
         assertTrue(out3.getWidth() * 0.8 < out2.getWidth());
         // not too low
-        assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) < 3);
+        assertTrue(out3.getY() - (out1.getY() + out2.getHeight() - 1) < 4);
         // not too high
-        assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) > 0);
+        assertTrue(out3.getY() - (out1.getY() + out2.getHeight() - 1) > 0);
     }
 
     void testStrikthrough() {
@@ -217,7 +217,7 @@
         // not too wide
         assertTrue(out3.getWidth() * 0.8 < out2.getWidth());
         // not too low
-        assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) < 0);
+        assertTrue(out3.getY() - (out1.getY() + out2.getHeight() - 1) < 0);
         // not too high
         assertTrue(out3.getY() - out1.getY() > 1);
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/bind/marshal/8036981/Good.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 testjaxbcontext;
+
+import org.w3c.dom.Element;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlType;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * Java class for Good complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
+ *
+ * <pre>
+ * &lt;complexType name="Good">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;any processContents='skip' maxOccurs="70"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Good", propOrder = {
+    "any"
+})
+public class Good {
+
+    @XmlAnyElement
+    protected List<Element> any;
+
+    /**
+     * Gets the value of the any property.
+     *
+     * <p>
+     * This accessor method returns a reference to the live list, not a
+     * snapshot. Therefore any modification you make to the returned list will
+     * be present inside the JAXB object. This is why there is not a
+     * <CODE>set</CODE> method for the any property.
+     *
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     *
+     *
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link org.w3c.dom.Element }
+     *
+     *
+     */
+    public List<Element> getAny() {
+        if (any == null) {
+            any = new ArrayList<Element>();
+        }
+        return this.any;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/bind/marshal/8036981/Main.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 testjaxbcontext;
+
+import javax.xml.bind.annotation.*;
+
+/**
+ * <p>
+ * Java class for main complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
+ *
+ * <pre>
+ * &lt;complexType name="main">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="Root" type="{}Root"/>
+ *         &lt;element name="Good" type="{}Good"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "main", propOrder = {
+    "root",
+    "good"
+})
+@XmlRootElement
+public class Main {
+
+    @XmlElement(name = "Root", required = true)
+    protected Root root;
+    @XmlElement(name = "Good", required = true)
+    protected Good good;
+
+    /**
+     * Gets the value of the root property.
+     *
+     * @return possible object is {@link Root }
+     *
+     */
+    public Root getRoot() {
+        return root;
+    }
+
+    /**
+     * Sets the value of the root property.
+     *
+     * @param value allowed object is {@link Root }
+     *
+     */
+    public void setRoot(Root value) {
+        this.root = value;
+    }
+
+    /**
+     * Gets the value of the good property.
+     *
+     * @return possible object is {@link Good }
+     *
+     */
+    public Good getGood() {
+        return good;
+    }
+
+    /**
+     * Sets the value of the good property.
+     *
+     * @param value allowed object is {@link Good }
+     *
+     */
+    public void setGood(Good value) {
+        this.good = value;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/bind/marshal/8036981/ObjectFactory.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 testjaxbcontext;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+/**
+ * This object contains factory methods for each Java content interface and Java
+ * element interface generated in the generated package.
+ * <p>
+ * An ObjectFactory allows you to programatically construct new instances of the
+ * Java representation for XML content. The Java representation of XML content
+ * can consist of schema derived interfaces and classes representing the binding
+ * of schema type definitions, element declarations and model groups. Factory
+ * methods for each of these are provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of
+     * schema derived classes for package: generated
+     *
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link Root }
+     *
+     */
+    public Root createRoot() {
+        return new Root();
+    }
+
+    /**
+     * Create an instance of {@link Good }
+     *
+     */
+    public Good createGood() {
+        return new Good();
+    }
+
+    /**
+     * Create an instance of {@link Main }
+     *
+     */
+    public Main createMain() {
+        return new Main();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/bind/marshal/8036981/Root.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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 testjaxbcontext;
+
+import javax.xml.bind.annotation.*;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * Java class for Root complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
+ *
+ * <pre>
+ * &lt;complexType name="Root">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;any processContents='skip' maxOccurs="70"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Root", propOrder = {
+    "content"
+})
+public class Root {
+
+    @XmlMixed
+    @XmlAnyElement
+    protected List<Object> content;
+
+    /**
+     * Gets the value of the content property.
+     *
+     * <p>
+     * This accessor method returns a reference to the live list, not a
+     * snapshot. Therefore any modification you make to the returned list will
+     * be present inside the JAXB object. This is why there is not a
+     * <CODE>set</CODE> method for the content property.
+     *
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getContent().add(newItem);
+     * </pre>
+     *
+     *
+     * <p>
+     * Objects of the following type(s) are allowed in the list      {@link org.w3c.dom.Element }
+     * {@link String }
+     *
+     *
+     */
+    public List<Object> getContent() {
+        if (content == null) {
+            content = new ArrayList<Object>();
+        }
+        return this.content;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/bind/marshal/8036981/Test.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test Test.java
+ * @bug 8036981
+ * @summary JAXB not preserving formatting during unmarshalling/marshalling
+ * @compile Good.java Main.java ObjectFactory.java Root.java
+ * @run main/othervm Test
+ */
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import java.io.File;
+import java.io.StringWriter;
+
+/**
+ * Test for marshalling and unmarshalling mixed and unmixed content
+ */
+public class Test {
+
+    private static final String EXPECTED = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><main><Root>\n" +
+            "        <SomeTag>\n" +
+            "            <AChildTag>\n" +
+            "                <AnotherChildTag/>\n" +
+            "                <AnotherChildTag/>\n" +
+            "            </AChildTag>\n" +
+            "        </SomeTag>\n" +
+            "    </Root><Good><VeryGood><TheBest><MegaSuper/><MegaSuper/>\n" +
+            "            </TheBest>\n" +
+            "        </VeryGood></Good></main>";
+
+    public static void main(String[] args) throws Exception {
+        JAXBContext jc = JAXBContext.newInstance("testjaxbcontext");
+        Unmarshaller u = jc.createUnmarshaller();
+        Object result = u.unmarshal(new File(System.getProperty("test.src", ".") + "/test.xml"));
+        StringWriter sw = new StringWriter();
+        Marshaller m = jc.createMarshaller();
+        m.marshal(result, sw);
+        System.out.println("Expected:" + EXPECTED);
+        System.out.println("Observed:" + sw.toString());
+        if (!EXPECTED.equals(sw.toString())) {
+            throw new Exception("Unmarshal/Marshal generates different content");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/bind/marshal/8036981/test.xml	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<main>
+    <Root>
+        <SomeTag>
+            <AChildTag>
+                <AnotherChildTag/>
+                <AnotherChildTag/>
+            </AChildTag>
+        </SomeTag>
+    </Root>
+    <Good>
+        <VeryGood>
+            <TheBest>
+                <MegaSuper/>
+                <MegaSuper/>
+            </TheBest>
+        </VeryGood>
+    </Good>
+</main>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/common/8032908/TestFunc.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+import org.w3c.dom.Node;
+
+public class TestFunc {
+
+    public static String test(Node node) {
+        String s = node.getTextContent();
+        return s;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/common/8032908/XSLT.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 8032908
+ * @summary Test if Node.getTextContent() function correctly returns children
+ * content
+ * @compile TestFunc.java XSLT.java
+ * @run main/othervm XSLT
+ */
+import java.io.ByteArrayOutputStream;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+public class XSLT {
+
+    static final String XMLTOTRANSFORM = "/in.xml";
+    static final String XSLTRANSFORMER = "/test.xsl";
+    static final String EXPECTEDRESULT = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>ABCDEFG";
+
+    public static void main(String[] args) throws TransformerException {
+        ByteArrayOutputStream resStream = new ByteArrayOutputStream();
+        TransformerFactory trf = TransformerFactory.newInstance();
+        Transformer tr = trf.newTransformer(new StreamSource(System.getProperty("test.src", ".") + XSLTRANSFORMER));
+        tr.transform(new StreamSource(System.getProperty("test.src", ".") + XMLTOTRANSFORM), new StreamResult(resStream));
+        System.out.println("Transformation completed. Result:" + resStream.toString());
+        if (!resStream.toString().equals(EXPECTEDRESULT)) {
+            throw new RuntimeException("Incorrect transformation result");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/common/8032908/in.xml	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root><elem><level2_0>ABCD</level2_0><level2_1>EFG</level2_1></elem></root>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/common/8032908/test.xsl	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform exclude-result-prefixes="cscdt_ufunc" version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:cscdt_ufunc="http://xml.apache.org/xalan/java">
+    <xsl:template match="elem">
+        <xsl:value-of select="cscdt_ufunc:TestFunc.test(.)" />
+    </xsl:template>
+</xsl:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/jaxp/validation/8049514/FeaturePropagationTest.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+
+/**
+ * @test
+ * @bug 8049514
+ * @summary verifies that feature set on the factory is propagated properly
+ *          to the validator
+ * @run main/othervm FeaturePropagationTest
+ */
+
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStreamReader;
+import javax.xml.XMLConstants;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.*;
+
+/**
+ * JDK-8049514
+ *
+ * FEATURE_SECURE_PROCESSING can not be turned off on a validator through
+ * SchemaFactory
+ */
+public class FeaturePropagationTest {
+
+    static String xsd = "<?xml version='1.0'?>\n" + "<schema xmlns='http://www.w3.org/2001/XMLSchema'\n"
+            + "        xmlns:test='jaxp13_test'\n"
+            + "        targetNamespace='jaxp13_test'\n"
+            + "        elementFormDefault='qualified'>\n"
+            + "    <element name='test' type='string'/>\n"
+            + "</schema>\n";
+
+    public static void main(String[] args) throws Exception {
+        InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(xsd.getBytes()));
+        StreamSource xsdSource = new StreamSource(reader);
+
+        SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+        schemaFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
+        Schema schema = null;
+        schema = schemaFactory.newSchema(xsdSource);
+
+        Validator validator = schema.newValidator();
+
+        if (validator.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) {
+            throw new RuntimeException("Feature set on the factory is not inherited!");
+        }
+
+    }
+}
--- a/test/javax/xml/ws/8033113/Organization_List.wsdl	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/javax/xml/ws/8033113/Organization_List.wsdl	Tue Oct 14 12:20:39 2014 -0700
@@ -1,56 +1,78 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<wsdl:definitions targetNamespace="urn:Organization_List" xmlns:s0="urn:Organization_List" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:types>
-  <xsd:schema elementFormDefault="qualified" targetNamespace="urn:Organization_List">
-   <xsd:element name="OpGetList" type="s0:GetListInputMap"/>
-   <xsd:complexType name="GetListInputMap">
-    <xsd:sequence>
-     <xsd:element name="Qualification" type="xsd:string"/>
-    </xsd:sequence>
-   </xsd:complexType>
-   <xsd:element name="OpGetListResponse" type="s0:GetListOutputMap"/>
-   <xsd:complexType name="GetListOutputMap">
-    <xsd:sequence>
-     <xsd:element maxOccurs="unbounded" name="getListValues">
-      <xsd:complexType>
-       <xsd:sequence>
-        <xsd:element name="Organization_Name" type="xsd:string"/>
-       </xsd:sequence>
-      </xsd:complexType>
-     </xsd:element>
-    </xsd:sequence>
-   </xsd:complexType>
-   <xsd:element name="AuthenticationInfo" type="s0:AuthenticationInfo"/>
-   <xsd:complexType name="AuthenticationInfo">
-    <xsd:sequence>
-     <xsd:element name="userName" type="xsd:string"/>
-     <xsd:element name="password" type="xsd:string"/>
-     <xsd:element minOccurs="0" name="authentication" type="xsd:string"/>
-     <xsd:element minOccurs="0" name="locale" type="xsd:string"/>
-     <xsd:element minOccurs="0" name="timeZone" type="xsd:string"/>
-    </xsd:sequence>
-   </xsd:complexType>
-  </xsd:schema>
- </wsdl:types>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 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.
+
+ 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.
+-->
+<wsdl:definitions targetNamespace="urn:Organization_List" xmlns:s0="urn:Organization_List" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+  <xsd:schema elementFormDefault="qualified" targetNamespace="urn:Organization_List">
+   <xsd:element name="OpGetList" type="s0:GetListInputMap"/>
+   <xsd:complexType name="GetListInputMap">
+    <xsd:sequence>
+     <xsd:element name="Qualification" type="xsd:string"/>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:element name="OpGetListResponse" type="s0:GetListOutputMap"/>
+   <xsd:complexType name="GetListOutputMap">
+    <xsd:sequence>
+     <xsd:element maxOccurs="unbounded" name="getListValues">
+      <xsd:complexType>
+       <xsd:sequence>
+        <xsd:element name="Organization_Name" type="xsd:string"/>
+       </xsd:sequence>
+      </xsd:complexType>
+     </xsd:element>
+    </xsd:sequence>
+   </xsd:complexType>
+   <xsd:element name="AuthenticationInfo" type="s0:AuthenticationInfo"/>
+   <xsd:complexType name="AuthenticationInfo">
+    <xsd:sequence>
+     <xsd:element name="userName" type="xsd:string"/>
+     <xsd:element name="password" type="xsd:string"/>
+     <xsd:element minOccurs="0" name="authentication" type="xsd:string"/>
+     <xsd:element minOccurs="0" name="locale" type="xsd:string"/>
+     <xsd:element minOccurs="0" name="timeZone" type="xsd:string"/>
+    </xsd:sequence>
+   </xsd:complexType>
+  </xsd:schema>
+ </wsdl:types>
 
    <wsdl:message name="ARAuthenticate">
       <wsdl:part element="s0:AuthenticationInfo" name="param"/>
-   </wsdl:message>
+   </wsdl:message>
 
    <wsdl:message name="OpGetListSoapIn">
       <wsdl:part element="s0:OpGetList" name="param"/>
-   </wsdl:message>
+   </wsdl:message>
 
    <wsdl:message name="OpGetListSoapOut">
       <wsdl:part element="s0:OpGetListResponse" name="param"/>
-   </wsdl:message>
+   </wsdl:message>
 
    <wsdl:portType name="Organization_ListPortType">
       <wsdl:operation name="OpGetList">
          <wsdl:input message="s0:OpGetListSoapIn"/>
          <wsdl:output message="s0:OpGetListSoapOut"/>
       </wsdl:operation>
-   </wsdl:portType>
+   </wsdl:portType>
 
    <wsdl:binding name="Organization_ListSoapBinding" type="s0:Organization_ListPortType">
       <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
@@ -65,13 +87,13 @@
             <soap:body use="literal"/>
          </wsdl:output>
       </wsdl:operation>
-   </wsdl:binding>
+   </wsdl:binding>
 
    <wsdl:service name="Organization_ListService">
       <wsdl:port binding="s0:Organization_ListSoapBinding" name="Organization_ListSoap">
          <soap:address location="http://bogus:9080/URL"/>
       </wsdl:port>
-   </wsdl:service>
+   </wsdl:service>
 
-</wsdl:definitions>
+</wsdl:definitions>
 
--- a/test/javax/xml/ws/8033113/customization.xml	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/javax/xml/ws/8033113/customization.xml	Tue Oct 14 12:20:39 2014 -0700
@@ -1,23 +1,45 @@
-<jaxws:bindings wsdlLocation="./Organization_List.wsdl"  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
-   <jaxws:enableWrapperStyle>false</jaxws:enableWrapperStyle>
-   <jaxws:bindings node="wsdl:definitions/wsdl:binding[@name='Organization_ListSoapBinding']/wsdl:operation[@name='OpGetList']">
-     <jaxws:parameter part="wsdl:definitions/wsdl:message[@name='ARAuthenticate']/wsdl:part[@name='param']"  name="authParam"/>
-     <jaxws:parameter part="wsdl:definitions/wsdl:message[@name='OpGetListSoapIn']/wsdl:part[@name='param']"  name="inParam"/>
-     <jaxws:parameter part="wsdl:definitions/wsdl:message[@name='OpGetListSoapOut']/wsdl:part[@name='param']"  name="outParam"/>
-   </jaxws:bindings>
-</jaxws:bindings>
-
-<!--wsdl:message definitions from WSDL whose part names we are trying to override...
- 
-   <wsdl:message name="ARAuthenticate">
-      <wsdl:part element="s0:AuthenticationInfo" name="param"/>
-   </wsdl:message>
-
-   <wsdl:message name="OpGetListSoapIn">
-      <wsdl:part element="s0:OpGetList" name="param"/>
-   </wsdl:message>
-
-   <wsdl:message name="OpGetListSoapOut">
-      <wsdl:part element="s0:OpGetListResponse" name="param"/>
-   </wsdl:message>
--->
+<!--
+ Copyright (c) 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.
+
+ 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.
+-->
+<jaxws:bindings wsdlLocation="./Organization_List.wsdl"  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
+   <jaxws:enableWrapperStyle>false</jaxws:enableWrapperStyle>
+   <jaxws:bindings node="wsdl:definitions/wsdl:binding[@name='Organization_ListSoapBinding']/wsdl:operation[@name='OpGetList']">
+     <jaxws:parameter part="wsdl:definitions/wsdl:message[@name='ARAuthenticate']/wsdl:part[@name='param']"  name="authParam"/>
+     <jaxws:parameter part="wsdl:definitions/wsdl:message[@name='OpGetListSoapIn']/wsdl:part[@name='param']"  name="inParam"/>
+     <jaxws:parameter part="wsdl:definitions/wsdl:message[@name='OpGetListSoapOut']/wsdl:part[@name='param']"  name="outParam"/>
+   </jaxws:bindings>
+</jaxws:bindings>
+
+<!--wsdl:message definitions from WSDL whose part names we are trying to override...
+ 
+   <wsdl:message name="ARAuthenticate">
+      <wsdl:part element="s0:AuthenticationInfo" name="param"/>
+   </wsdl:message>
+
+   <wsdl:message name="OpGetListSoapIn">
+      <wsdl:part element="s0:OpGetList" name="param"/>
+   </wsdl:message>
+
+   <wsdl:message name="OpGetListSoapOut">
+      <wsdl:part element="s0:OpGetListResponse" name="param"/>
+   </wsdl:message>
+-->
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/ws/8043129/MailTest.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8043129
+ * @summary JAF initialisation in SAAJ clashing with the one in javax.mail
+ * @author mkos
+ * @library javax.mail.jar
+ * @build MailTest
+ * @run main MailTest
+ */
+
+import javax.activation.CommandMap;
+import javax.activation.MailcapCommandMap;
+import javax.mail.BodyPart;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Multipart;
+import javax.mail.Session;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeBodyPart;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeMultipart;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+public class MailTest {
+
+    String host = null;
+    String user = "";
+    String password = null;
+    String from = null;
+    String to = null;
+
+    public static void main(String[] args) {
+        MailTest t = new MailTest();
+
+        t.user = "somebody@somewhere.com";
+        t.from = "somebody@somewhere.com";
+        t.to = "somebody@somewhere.com";
+
+        t.user = "somebody@somewhere.com";
+        t.password = "somepassword";
+        t.host = "somehost";
+
+        t.sendMail();    //this works
+
+        t.addSoapAttachement();
+        t.sendMail();    //after addAttachmentPart to soapmessage it do not work
+
+        // workaroundJAFSetup();
+        // t.sendMail();    //after workaround works again
+    }
+
+    void addSoapAttachement() {
+        try {
+            MessageFactory messageFactory = MessageFactory.newInstance();
+            SOAPMessage message = messageFactory.createMessage();
+            AttachmentPart a = message.createAttachmentPart();
+            a.setContentType("binary/octet-stream");
+            message.addAttachmentPart(a);
+        } catch (SOAPException e) {
+            e.printStackTrace();
+        }
+    }
+
+    void sendMail() {
+
+        try {
+            Properties props = new Properties();
+            props.put("mail.smtp.host", host);
+            props.put("mail.smtp.auth", "true");
+
+            Session session = Session.getInstance(props);
+            session.setDebug(true);
+
+            // Define message
+            MimeMessage message = new MimeMessage(session);
+            message.setFrom(new InternetAddress(from));
+            message.addRecipients(Message.RecipientType.TO, to);
+            message.setSubject("this is a multipart test");
+
+            Multipart multipart = new MimeMultipart();
+
+            BodyPart messageBodyPart1 = new MimeBodyPart();
+            messageBodyPart1.setText("please send also this Content\n ciao!");
+            multipart.addBodyPart(messageBodyPart1);
+
+            BodyPart messageBodyPart2 = new MimeBodyPart();
+            messageBodyPart2.setContent("<b>please</b> send also this Content <br>ciao!", "text/html; charset=UTF-8");
+            multipart.addBodyPart(messageBodyPart2);
+
+            message.setContent(multipart);
+
+            /*
+                Transport tr = session.getTransport("smtp");
+                tr.connect(host,user, password);
+                tr.sendMessage(message,InternetAddress.parse(to));
+                tr.close();
+            */
+
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            message.writeTo(baos);
+            String output = baos.toString();
+            System.out.println("output = " + output);
+            if (output.contains("also this Content")) {
+                System.out.println("Test PASSED.");
+            } else {
+                System.out.println("Test FAILED, missing content.");
+                throw new IllegalStateException("Test FAILED, missing content.");
+            }
+        } catch (MessagingException ignored) {
+        } catch (IOException ignored) {
+        }
+    }
+
+    // this is how the error can be worked around ...
+    static void workaroundJAFSetup() {
+        MailcapCommandMap mailMap = (MailcapCommandMap) CommandMap.getDefaultCommandMap();
+        mailMap.addMailcap("multipart/mixed;;x-java-content-handler=com.sun.mail.handlers.multipart_mixed");
+    }
+}
Binary file test/javax/xml/ws/8043129/javax.mail.jar has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/ws/xsanymixed/CopyingResponse.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+
+import org.somewhere.ws.EchoRequest;
+import org.somewhere.ws.EchoResponse;
+
+public class CopyingResponse extends EchoResponse {
+
+    public CopyingResponse() {}
+
+    public CopyingResponse(EchoRequest request) {
+        content = request.getContent();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/ws/xsanymixed/ServiceImpl.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+import org.somewhere.ws.EchoRequest;
+import org.somewhere.ws.EchoResponse;
+import org.somewhere.ws.TestPort;
+
+import java.util.ArrayList;
+
+import javax.jws.WebService;
+import javax.xml.namespace.QName;
+
+
+/**
+ * Simple Webservice implementation just copying xml part as is
+ * from incoming request into outgoing response
+ */
+@WebService(
+        endpointInterface = "org.somewhere.ws.TestPort",
+        targetNamespace = "http://ws.somewhere.org/",
+        serviceName = "TestService",
+        portName = "TestPort")
+public class ServiceImpl implements TestPort {
+
+    public static final QName PORT_NAME = new QName("http://ws.somewhere.org/", "TestPort");
+    public static final QName SERVICE_NAME = new QName("http://ws.somewhere.org/", "TestService");
+
+    @Override
+    public EchoResponse echo(EchoRequest request) {
+        System.err.println( "request.getContent="+(ArrayList)(request.getContent()));
+        return new CopyingResponse(request);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/ws/xsanymixed/Test.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,197 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8036981 8038966 8051441
+ * @summary the content of xs:any content:mixed should remain as is,
+ *          no white space changes and no changes to namespace prefixes
+ * @run shell compile-wsdl.sh
+ * @run main/othervm Test
+ */
+
+import com.sun.net.httpserver.HttpServer;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.InetSocketAddress;
+import java.net.URL;
+import java.nio.file.FileVisitResult;
+import static java.nio.file.FileVisitResult.CONTINUE;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.Service;
+
+public class Test {
+
+    private static HttpServer httpServer;
+    private static Endpoint endpoint;
+    private static final String NL = System.getProperty("line.separator");
+
+    private static final String XS_ANY_MIXED_PART =
+            "<AppHdr xmlns=\"urn:head.001\">" + NL +
+            "      <Fr>" + NL + NL +
+            "<FIId xmlns=\"urn:head.009\">" + NL + NL +
+            "        any" + NL +
+            "    white" + NL +
+            "      space" + NL + NL +
+            "        <FinInstnId>... and" + NL + NL +
+            "            NO namespace prefixes!!!" + NL + NL +
+            "        </FinInstnId>" + NL + NL +
+            "  </FIId>" + NL +
+            "</Fr>" + NL +
+            "</AppHdr>";
+
+    private static final String XML_REQUEST = "<soap:Envelope " +
+            "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
+            "xmlns:ws=\"http://ws.somewhere.org/\">" +
+            "<soap:Header/><soap:Body>" +
+            "<ws:echoRequest>" + NL +
+                XS_ANY_MIXED_PART + NL +
+            "</ws:echoRequest>" +
+            "</soap:Body></soap:Envelope>";
+
+    private static String deployWebservice() throws IOException {
+        // Manually create HttpServer here using ephemeral address for port
+        // so as to not end up with attempt to bind to an in-use port
+        httpServer = HttpServer.create(new InetSocketAddress(0), 0);
+        httpServer.start();
+
+        endpoint = Endpoint.create(new ServiceImpl());
+        endpoint.publish(httpServer.createContext("/wservice"));
+
+        String wsdlAddress = "http://localhost:" + httpServer.getAddress().getPort() + "/wservice?wsdl";
+        log("address = " + wsdlAddress);
+        return wsdlAddress;
+    }
+
+    private static void stopWebservice() {
+        if (endpoint != null && endpoint.isPublished()) {
+            endpoint.stop();
+        }
+        if (httpServer != null) {
+            httpServer.stop(0);
+        }
+    }
+
+    public static void main(String[] args) throws IOException, TransformerException {
+
+        try {
+            String address = deployWebservice();
+            Service service = Service.create(new URL(address), ServiceImpl.SERVICE_NAME);
+
+            log( "PORT="+ServiceImpl.PORT_NAME+" service="+service);
+            Dispatch<Source> d = service.createDispatch(ServiceImpl.PORT_NAME, Source.class, Service.Mode.MESSAGE);
+            Source response = d.invoke(new StreamSource(new StringReader(XML_REQUEST)));
+
+            log( "reponse="+response );
+            String resultXml = toString(response);
+
+            log("= request ======== \n");
+            log(XML_REQUEST);
+            log("= result ========= \n");
+            log(resultXml);
+            log("\n==================");
+
+            boolean xsAnyMixedPartSame = resultXml.contains(XS_ANY_MIXED_PART);
+            log("resultXml.contains(XS_ANY_PART) = " + xsAnyMixedPartSame);
+            if (!xsAnyMixedPartSame) {
+                fail("The xs:any content=mixed part is supposed to be same in request and response.");
+                throw new RuntimeException();
+            }
+
+            log("TEST PASSED");
+        } finally {
+            stopWebservice();
+
+            // if you need to debug or explore wsdl generation result
+            // comment this line out:
+            deleteGeneratedFiles();
+        }
+    }
+
+    private static String toString(Source response) throws TransformerException, IOException {
+        TransformerFactory transformerFactory = TransformerFactory.newInstance();
+        Transformer transformer = transformerFactory.newTransformer();
+        StreamResult xmlOutput = new StreamResult(new StringWriter());
+        transformer.transform(response, xmlOutput);
+        return xmlOutput.getWriter().toString();
+    }
+
+    private static void fail(String message) {
+        log("TEST FAILED.");
+        throw new RuntimeException(message);
+    }
+
+    private static void log(String msg) {
+        System.out.println(msg);
+    }
+
+    private static void deleteGeneratedFiles() {
+        Path p = Paths.get("..", "classes", "javax", "xml", "ws", "xsanymixed", "org");
+        System.out.println("performing cleanup, deleting wsdl compilation result: " + p.toFile().getAbsolutePath());
+        if (Files.exists(p)) {
+            try {
+                Files.walkFileTree(p, new SimpleFileVisitor<Path>() {
+                    @Override
+                    public FileVisitResult visitFile(
+                            Path file,
+                            BasicFileAttributes attrs) throws IOException {
+
+                        System.out.println("deleting file [" + file.toFile().getAbsoluteFile() + "]");
+                        Files.delete(file);
+                        return CONTINUE;
+                    }
+
+                    @Override
+                    public FileVisitResult postVisitDirectory(
+                            Path dir,
+                            IOException exc) throws IOException {
+
+                        System.out.println("deleting dir [" + dir.toFile().getAbsoluteFile() + "]");
+                        if (exc == null) {
+                            Files.delete(dir);
+                            return CONTINUE;
+                        } else {
+                            throw exc;
+                        }
+                    }
+                });
+            } catch (IOException ioe) {
+                ioe.printStackTrace();
+            }
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/ws/xsanymixed/compile-wsdl.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,36 @@
+#! /bin/sh
+
+#
+# Copyright (c) 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.
+#
+# 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.
+#
+
+#
+
+if [ "x$TESTJAVA" = x ]; then
+  TESTJAVA=$1; shift
+  TESTCLASSES=.
+fi
+
+echo "compiling [test-service.wsdl] wsdl ..."
+$TESTJAVA/bin/wsimport -keep  -d ${TESTCLASSES} ${TESTSRC}/service.wsdl
+
+echo "WSDL compiled. Main test class Test.java can be compiled now."
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/xml/ws/xsanymixed/service.wsdl	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+  Copyright (c) 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.
+
+  This code is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+  version 2 for more details (a copy is included in the LICENSE file that
+  accompanied this code).
+
+  You should have received a copy of the GNU General Public License version
+  2 along with this work; if not, write to the Free Software Foundation,
+  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+  or visit www.oracle.com if you need additional information or have any
+  questions.
+-->
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+             xmlns:tns="http://ws.somewhere.org/"
+             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+             xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
+             name="TestService"
+             targetNamespace="http://ws.somewhere.org/">
+
+    <types>
+        <xsd:schema targetNamespace="http://ws.somewhere.org/" version="1.0"
+                    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ws.somewhere.org/">
+
+            <xsd:element type="tns:echoRequest" name="echoRequest"/>
+            <xsd:element type="tns:echoResponse" name="echoResponse"/>
+
+            <xsd:complexType name="echoRequest" mixed="true">
+                <xsd:sequence>
+                    <xsd:any namespace="##any" processContents="skip" minOccurs="1" maxOccurs="10"/>
+                </xsd:sequence>
+            </xsd:complexType>
+
+            <xsd:complexType name="echoResponse" mixed="true">
+                <xsd:sequence>
+                    <xsd:any namespace="##any" processContents="skip" minOccurs="1" maxOccurs="10"/>
+                </xsd:sequence>
+            </xsd:complexType>
+        </xsd:schema>
+    </types>
+
+    <message name="echoRequest">
+        <part element="tns:echoRequest" name="parameters"/>
+    </message>
+    <message name="echoResponse">
+        <part element="tns:echoResponse" name="parameters"/>
+    </message>
+
+    <portType name="TestPort">
+        <operation name="echo">
+            <input message="tns:echoRequest" wsam:Action="http://ws.somewhere.org/tester/echoRequest"/>
+            <output message="tns:echoResponse" wsam:Action="http://ws.somewhere.org/tester/echoResponse"/>
+        </operation>
+    </portType>
+
+    <binding name="TestServicePortBinding" type="tns:TestPort">
+        <soap:binding style="document"
+                      transport="http://schemas.xmlsoap.org/soap/http"/>
+
+        <operation name="echo">
+            <soap:operation soapAction=""/>
+            <input>
+                <soap:body use="literal"/>
+            </input>
+            <output>
+                <soap:body use="literal"/>
+            </output>
+        </operation>
+    </binding>
+
+    <service name="TestService">
+        <port binding="tns:TestServicePortBinding" name="TestPort">
+            <soap:address location="http://localhost/ws/tester"/>
+        </port>
+    </service>
+</definitions>
--- a/test/sun/net/ftp/FtpURL.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/net/ftp/FtpURL.java	Tue Oct 14 12:20:39 2014 -0700
@@ -483,7 +483,7 @@
 
             // Now let's check the URL handler
 
-            url = new URL("ftp://user2:@localhost:" + port + "/%2Fusr/bin;type=d");
+            url = new URL("ftp://user2@localhost:" + port + "/%2Fusr/bin;type=d");
             con = url.openConnection();
             in = new BufferedReader(new InputStreamReader(con.getInputStream()));
             do {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/net/www/http/HttpClient/B8025710.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,409 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+import java.io.*;
+import java.net.*;
+import java.security.*;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import javax.net.ServerSocketFactory;
+import javax.net.SocketFactory;
+import javax.net.ssl.*;
+
+/**
+ * @test
+ * @bug 8025710
+ * @summary Proxied https connection reuse by HttpClient can send CONNECT to the server
+ */
+public class B8025710 {
+
+    private final static AtomicBoolean connectInServer = new AtomicBoolean();
+    private static final String keystorefile =
+            System.getProperty("test.src", "./")
+            + "/../../../../../sun/security/ssl/etc/keystore";
+    private static final String passphrase = "passphrase";
+
+    public static void main(String[] args) throws Exception {
+        new B8025710().runTest();
+
+        if (connectInServer.get())
+            throw new RuntimeException("TEST FAILED: server got proxy header");
+        else
+            System.out.println("TEST PASSED");
+    }
+
+    private void runTest() throws Exception {
+        ProxyServer proxyServer = new ProxyServer();
+        HttpServer httpServer = new HttpServer();
+        httpServer.start();
+        proxyServer.start();
+
+        URL url = new URL("https", InetAddress.getLocalHost().getHostName(),
+                httpServer.getPort(), "/");
+
+        Proxy proxy = new Proxy(Proxy.Type.HTTP, proxyServer.getAddress());
+
+        HttpsURLConnection.setDefaultSSLSocketFactory(createTestSSLSocketFactory());
+
+        // Make two connections. The bug occurs when the second request is made
+        for (int i = 0; i < 2; i++) {
+            System.out.println("Client: Requesting " + url.toExternalForm()
+                    + " via " + proxy.toString()
+                    + " (attempt " + (i + 1) + " of 2)");
+
+            HttpsURLConnection connection =
+                    (HttpsURLConnection) url.openConnection(proxy);
+
+            connection.setRequestMethod("POST");
+            connection.setDoInput(true);
+            connection.setDoOutput(true);
+            connection.setRequestProperty("User-Agent", "Test/1.0");
+            connection.getOutputStream().write("Hello, world!".getBytes("UTF-8"));
+
+            if (connection.getResponseCode() != 200) {
+                System.err.println("Client: Unexpected response code "
+                        + connection.getResponseCode());
+                break;
+            }
+
+            String response = readLine(connection.getInputStream());
+            if (!"Hi!".equals(response)) {
+                System.err.println("Client: Unexpected response body: "
+                        + response);
+            }
+        }
+        httpServer.close();
+        proxyServer.close();
+        httpServer.join();
+        proxyServer.join();
+    }
+
+    class ProxyServer extends Thread implements Closeable {
+
+        private final ServerSocket proxySocket;
+        private final Pattern connectLinePattern =
+                Pattern.compile("^CONNECT ([^: ]+):([0-9]+) HTTP/[0-9.]+$");
+        private final String PROXY_RESPONSE =
+                "HTTP/1.0 200 Connection Established\r\n"
+                + "Proxy-Agent: TestProxy/1.0\r\n"
+                + "\r\n";
+
+        ProxyServer() throws Exception {
+            super("ProxyServer Thread");
+
+            // Create the http proxy server socket
+            proxySocket = ServerSocketFactory.getDefault().createServerSocket();
+            proxySocket.bind(new InetSocketAddress(InetAddress.getLocalHost(), 0));
+        }
+
+        public SocketAddress getAddress() { return  proxySocket.getLocalSocketAddress(); }
+
+        @Override
+        public void close() throws IOException {
+            proxySocket.close();
+        }
+
+        @Override
+        public void run() {
+            ArrayList<Thread> threads = new ArrayList<>();
+            int connectionCount = 0;
+            try {
+                while (connectionCount++ < 2) {
+                    final Socket clientSocket = proxySocket.accept();
+                    final int proxyConnectionCount = connectionCount;
+                    System.out.println("Proxy: NEW CONNECTION "
+                            + proxyConnectionCount);
+
+                    Thread t = new Thread("ProxySocket" + proxyConnectionCount) {
+                        @Override
+                        public void run() {
+                            try {
+                                String firstLine =
+                                        readHeader(clientSocket.getInputStream());
+
+                                Matcher connectLineMatcher =
+                                        connectLinePattern.matcher(firstLine);
+                                if (!connectLineMatcher.matches()) {
+                                    System.out.println("Proxy: Unexpected"
+                                            + " request to the proxy: "
+                                            + firstLine);
+                                    return;
+                                }
+
+                                String host    = connectLineMatcher.group(1);
+                                String portStr = connectLineMatcher.group(2);
+                                int port       = Integer.parseInt(portStr);
+
+                                Socket serverSocket = SocketFactory.getDefault()
+                                        .createSocket(host, port);
+
+                                clientSocket.getOutputStream()
+                                        .write(PROXY_RESPONSE.getBytes("UTF-8"));
+
+                                ProxyTunnel copyToClient =
+                                        new ProxyTunnel(serverSocket, clientSocket);
+                                ProxyTunnel copyToServer =
+                                        new ProxyTunnel(clientSocket, serverSocket);
+
+                                copyToClient.start();
+                                copyToServer.start();
+
+                                copyToClient.join();
+                                // here copyToClient.close() would not provoke the
+                                // bug ( since it would trigger the retry logic in
+                                // HttpURLConnction.writeRequests ), so close only
+                                // the output to get the connection in this state.
+                                clientSocket.shutdownOutput();
+
+                                try {
+                                    Thread.sleep(3000);
+                                } catch (InterruptedException ignored) { }
+
+                                // now close all connections to finish the test
+                                copyToServer.close();
+                                copyToClient.close();
+                            } catch (IOException | NumberFormatException
+                                    | InterruptedException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    };
+                    threads.add(t);
+                    t.start();
+                }
+                for (Thread t: threads)
+                    t.join();
+            } catch (IOException | InterruptedException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    /**
+     * This inner class provides unidirectional data flow through the sockets
+     * by continuously copying bytes from the input socket onto the output
+     * socket, until both sockets are open and EOF has not been received.
+     */
+    class ProxyTunnel extends Thread {
+        private final Socket sockIn;
+        private final Socket sockOut;
+        private final InputStream input;
+        private final OutputStream output;
+
+        public ProxyTunnel(Socket sockIn, Socket sockOut) throws IOException {
+            super("ProxyTunnel");
+            this.sockIn  = sockIn;
+            this.sockOut = sockOut;
+            input  = sockIn.getInputStream();
+            output = sockOut.getOutputStream();
+        }
+
+        public void run() {
+            byte[] buf = new byte[8192];
+            int bytesRead;
+
+            try {
+                while ((bytesRead = input.read(buf)) >= 0) {
+                    output.write(buf, 0, bytesRead);
+                    output.flush();
+                }
+            } catch (IOException ignored) {
+                close();
+            }
+        }
+
+        public void close() {
+            try {
+                if (!sockIn.isClosed())
+                    sockIn.close();
+                if (!sockOut.isClosed())
+                    sockOut.close();
+            } catch (IOException ignored) { }
+        }
+    }
+
+    /**
+     * the server thread
+     */
+    class HttpServer extends Thread implements Closeable {
+
+        private final ServerSocket serverSocket;
+        private final SSLSocketFactory sslSocketFactory;
+        private final String serverResponse =
+                "HTTP/1.1 200 OK\r\n"
+                + "Content-Type: text/plain\r\n"
+                + "Content-Length: 3\r\n"
+                + "\r\n"
+                + "Hi!";
+        private int connectionCount = 0;
+
+        HttpServer() throws Exception {
+            super("HttpServer Thread");
+
+            KeyStore ks = KeyStore.getInstance("JKS");
+            ks.load(new FileInputStream(keystorefile), passphrase.toCharArray());
+            KeyManagerFactory factory = KeyManagerFactory.getInstance("SunX509");
+            factory.init(ks, passphrase.toCharArray());
+            SSLContext ctx = SSLContext.getInstance("TLS");
+            ctx.init(factory.getKeyManagers(), null, null);
+
+            sslSocketFactory = ctx.getSocketFactory();
+
+            // Create the server that the test wants to connect to via the proxy
+            serverSocket = ServerSocketFactory.getDefault().createServerSocket();
+            serverSocket.bind(new InetSocketAddress(InetAddress.getLocalHost(), 0));
+        }
+
+        public int getPort() { return  serverSocket.getLocalPort(); }
+
+        @Override
+        public void close() throws IOException { serverSocket.close(); }
+
+        @Override
+        public void run() {
+            try {
+                while (connectionCount++ < 2) {
+                    Socket socket = serverSocket.accept();
+                    System.out.println("Server: NEW CONNECTION "
+                            + connectionCount);
+
+                    SSLSocket sslSocket = (SSLSocket) sslSocketFactory
+                            .createSocket(socket,null, getPort(), false);
+                    sslSocket.setUseClientMode(false);
+                    sslSocket.startHandshake();
+
+                    String firstLine = readHeader(sslSocket.getInputStream());
+                    if (firstLine != null && firstLine.contains("CONNECT")) {
+                        System.out.println("Server: BUG! HTTP CONNECT"
+                                + " encountered: " + firstLine);
+                        connectInServer.set(true);
+                    }
+
+                    // write the success response, the request body is not read.
+                    // close only output and keep input open.
+                    OutputStream out = sslSocket.getOutputStream();
+                    out.write(serverResponse.getBytes("UTF-8"));
+                    socket.shutdownOutput();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    /**
+     * read the header and return only the first line.
+     *
+     * @param inputStream the stream to read from
+     * @return the first line of the stream
+     * @throws IOException if reading failed
+     */
+    private static String readHeader(InputStream inputStream)
+            throws IOException {
+        String line;
+        String firstLine = null;
+        while ((line = readLine(inputStream)) != null && line.length() > 0) {
+            if (firstLine == null) {
+                firstLine = line;
+            }
+        }
+
+        return firstLine;
+    }
+
+    /**
+     * read a line from stream.
+     *
+     * @param inputStream the stream to read from
+     * @return the line
+     * @throws IOException  if reading failed
+     */
+    private static String readLine(InputStream inputStream)
+            throws IOException {
+        final StringBuilder line = new StringBuilder();
+        int ch;
+        while ((ch = inputStream.read()) != -1) {
+            if (ch == '\r') {
+                continue;
+            }
+
+            if (ch == '\n') {
+                break;
+            }
+
+            line.append((char) ch);
+        }
+
+        return line.toString();
+    }
+
+    private SSLSocketFactory createTestSSLSocketFactory() {
+
+        HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
+            @Override
+            public boolean verify(String hostname, SSLSession sslSession) {
+                // ignore the cert's CN; it's not important to this test
+                return true;
+            }
+        });
+
+        // Set up the socket factory to use a trust manager that trusts all
+        // certs, since trust validation isn't important to this test
+        final TrustManager[] trustAllCertChains = new TrustManager[] {
+            new X509TrustManager() {
+                @Override
+                public X509Certificate[] getAcceptedIssuers() {
+                    return null;
+                }
+
+                @Override
+                public void checkClientTrusted(X509Certificate[] certs,
+                        String authType) {
+                }
+
+                @Override
+                public void checkServerTrusted(X509Certificate[] certs,
+                        String authType) {
+                }
+            }
+        };
+
+        final SSLContext sc;
+        try {
+            sc = SSLContext.getInstance("TLS");
+        } catch (NoSuchAlgorithmException e) {
+            throw new RuntimeException(e);
+        }
+
+        try {
+            sc.init(null, trustAllCertChains, new java.security.SecureRandom());
+        } catch (KeyManagementException e) {
+            throw new RuntimeException(e);
+        }
+
+        return sc.getSocketFactory();
+    }
+}
--- a/test/sun/net/www/protocol/jar/jarbug/run.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/net/www/protocol/jar/jarbug/run.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -34,14 +34,17 @@
   SunOS | Linux | Darwin )
     PS=":"
     FS="/"
+    CHMOD="${FS}bin${FS}chmod"
     ;;
   Windows* )
     PS=";"
     FS="\\"
+    CHMOD="chmod"
     ;;
   CYGWIN* )
     PS=";"
     FS="/"
+    CHMOD="chmod"
     #
     # javac does not like /cygdrive produced by `pwd`.
     #
@@ -59,6 +62,7 @@
 mkdir -p ${DEST}${FS}jar1
 cd ${TESTSRC}${FS}etc${FS}jar1
 cp -r . ${DEST}${FS}jar1
+${CHMOD} -R u+w ${DEST}${FS}jar1
 ${TESTJAVA}${FS}bin${FS}javac -d ${DEST}${FS}jar1 \
     ${TESTSRC}${FS}src${FS}jar1${FS}LoadResourceBundle.java
 ${TESTJAVA}${FS}bin${FS}javac -d ${DEST}${FS}jar1 \
--- a/test/sun/security/pkcs12/PKCS12SameKeyId.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/pkcs12/PKCS12SameKeyId.java	Tue Oct 14 12:20:39 2014 -0700
@@ -59,7 +59,7 @@
         for (int i=0; i<SIZE; i++) {
             System.err.print(".");
             String cmd = "-keystore " + JKSFILE
-                    + " -storepass changeit -keypass changeit "
+                    + " -storepass changeit -keypass changeit -keyalg rsa "
                     + "-genkeypair -alias p" + i + " -dname CN=" + i;
             KeyTool.main(cmd.split(" "));
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/tools/jarsigner/TimestampAlg.java	Tue Oct 14 12:20:39 2014 -0700
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 8049480
+ * @summary Current versions of Java can't verify jars signed and timestamped with Java 9
+ */
+
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+public class TimestampAlg {
+
+    public static void main(String[] args) throws Exception {
+        // This is a very simple jar file signed by JDK 9 with a timestamp
+        // using the SHA-256 message digest algorithm.
+        String var =
+            "504b0304140008080800c28ee844000000000000000000000000140000004d45" +
+            "54412d494e462f4d414e49464553542e4d4615cd4d0b82301c80f1fb60df61c7" +
+            "42666a9928749846f4aa8924745cf9d716b6c59c48df3ebd3e87df73e152d4d0" +
+            "195a82ee849211716d07a344033750d1f83785d076e830b8be1fb80e15d28096" +
+            "bca535ef4c058fbe21b34cf3670b2451faab3437a333c708a3947f20220ca362" +
+            "cfa8e7afe95634e32b22af821df2d6786d5ff637cf3abfe3f05e4190a42779b5" +
+            "76470532cbd56a798105db4cd01f504b07082c3740c69c000000a6000000504b" +
+            "0304140008080800c28ee8440000000000000000000000000f0000004d455441" +
+            "2d494e462f4f4c442e534675cf416f823018c6f13b09dfa1c7ed50575014493c" +
+            "80bae8a6a091383db6f082955a595b86ecd34fb3db92dd9ed32fff67c74b494d" +
+            "a300ef41697e9501727ac4b6768b10bbde10cf7809dae03595bcf81d5ce2d018" +
+            "c5596340072872bdecd02554f17c70f16fc730cfb4a8c6b0ad934fdfb6d0e854" +
+            "fbb794ecd52eeecbe5e45f394071bd9ef30c34131f87a3e956c561efb0938e56" +
+            "b7573d5c6cd3599bbe2ddd28acfafe9d992aa006721c758fe2718fe0b6753c6f" +
+            "e410cca50125a9c005d52607d694e82951341380a657555f1535f7a3cfb6655b" +
+            "31bd4080c2bf55016a98a8f2512948f7e5968dfbbe495fcca6383bdfe753a467" +
+            "90ca41a297861544cd270fe807504b0708521a35550201000048010000504b03" +
+            "04140008080800c28ee844000000000000000000000000100000004d4554412d" +
+            "494e462f4f4c442e52534185947b38d37d1fc7fdb61923530eb39e688622a77e" +
+            "5b666ab9939c9544c831ee39d42c9511e576d8c8b9876745b5743b5414268718" +
+            "b969548e95d61c2224b47423a648393d73dd5d4fe5b9afe7f9f3f3b9deefeff5" +
+            "bd3e9ff7e7053210ba708476bc55fc6719400292c340a8800cc4460800e06441" +
+            "1938c23bde0af083c22080b81828fd5d08e430200f4006a41664003772a01000" +
+            "028145a66e3cba6af9a601a44516246e1d2805873ac1a0f2d093545f70b3920c" +
+            "ce00248246e04ec20e02e8262a09200e6ff0adfc2f3d0350fbf149d12fa00c40" +
+            "564cd497823000406cb4ef6571fdec06c95a370fde860e89425861e16e0b19a1" +
+            "4c6c4f52d6102dd3a6bf45e740d9a0bed342ee5e832885fa1a979dc7e6161253" +
+            "4c2cda0362e5ec02ae440e44e80c56bffc4ab4f349f3b1f6bddae8c2979fca4b" +
+            "5e7e46ac2fa529481dd8d750a26dcd7d74deb8dde7fc70c072465af0a1e359af" +
+            "4cf4b1aaa14fc4238cee096ca3133575d52179a7e7da8990f6ed5da71ca84c37" +
+            "2d3117c356b1ac2cdde3c8600ead44f8878b2f8f10831f4d5d590a28d95b316c" +
+            "cf456277a83533e12ea42a14c8fc05da6b2483b74ab7c4e70a2dd60f417d2f97" +
+            "3359bb233e3d6b5ab60202e7bd7b4fd7f228febd1f0403b0c62f4190b69264bf" +
+            "72426589ab516d00040a880137b0200654114d4d050943c11490e82d88b38ecd" +
+            "26a42c027cd749ffe67955e7d9357b81aece4e877d49ee62b8afeed7a755fa9e" +
+            "786d6edc5d7e5ae3603e5d6e39d0cbc74300c35eb354282842a183159763c67a" +
+            "35b0b1ac1929e7b8ad510da5aa454d5eb3034cf11d27f594326384873f7c8949" +
+            "1a7f4a3cfccb892faf873c621292bd597072cdcd732d1ee7490e611ec28c90f9" +
+            "81bbd71ef0e4b50c4e93869c9af8c9d3d154169bbf8dff7aa706ebac1f6d2589" +
+            "8078532a9867e31d7f576365bc0c6c132fb7719b58d88ebcf438715768aea361" +
+            "f7017f614acfaf465e6d794b84e317b2937d66a8f5cea13666d541cce02705a8" +
+            "cef2d6d2f69b96ac88fec9998228a7c1d96d09c315b29797ecda02250dc7383a" +
+            "6f2bf75b0f17d48c07afa48c640d3478dd3ad18963c0712003ae27ca3a885a9b" +
+            "bcef71fef1027e8e228c01885dede0446717674996f8f413f59a5c3f91a001c0" +
+            "b632f78891424ce58a58df39727a6cc492ea4c94d5f23f6ad1276561d6eb057f" +
+            "befab3e5baff5dec50224a891fb49c29ab6cd6cab3f7731d097fc3d65e949b33" +
+            "b7a578f0b379e47a98c0a91b5fb0ce685952a78afc5cfa0e373df4a035c15132" +
+            "bb62a6387ad8caaadab680b8a169805e49b69e5ad8409de9b7079b6def2af45a" +
+            "dada5e7cdee4b5359892d1803dfc765dd18849fd0bf44b64866ed654fc117ea6" +
+            "5e6b1922eff99b73f0c77257e994d307defc9a29cedd1ac7be68a626d6edf96e" +
+            "c692bdf22ee792369dd535a0dfa7d711396996f692895df223eaaa5f47414f45" +
+            "b2c3b39d65772575c5cf4a437319b00990011b834b7f1b0c623d048963c07a44" +
+            "4dfe4f60813d12b5b87f0b16ea0f6e0096e30973075d454238d411260ee2d6a8" +
+            "61aa68a6bb3119ab837aaa39abd612eab39f9da4665c977e0cff019201a19384" +
+            "d3222b5a160ffe07340620c10d220998e65d3431411e13916b4e44ae191143fa" +
+            "be91cb1605ff6d2db96470d220e2af3c40f6ed5d032ee2cfe022bafd240fa1fd" +
+            "5f6e3567dd9071543e381b57bdd80cb1575a376abcc947495167e61e6e32a1ae" +
+            "93d416c8bc197b6bda347e6bcc6553839ed0a78d7ac28d57f2f7f8cd857d14e4" +
+            "497caa1cd34e1829aa7574aa3984ad39934e765598bdf0356c31a8f5c4a316d6" +
+            "c6beedf3add584c5769a6901a7836d3b32e3a03c58c739a6969e0260a002f463" +
+            "2773e84174c7faa41086e0d5d0ceaefc4df5a443d4e8af8a462dd67181ce11be" +
+            "a6ef64ce907252a0d0e6f03ef467e6763c244c48574856017d294607d3f87d5b" +
+            "0eb9eba2c60dc6c70dddfb837914babf172574ef99a4bb1e361353de4d95c576" +
+            "c494e1e9bce62d4fd08ad5e731691d1895636525bb79d76b2f1ce07d1604aa95" +
+            "8d9dfc8b5b6ee01110b3ca2d75181a44c528300ede3c612715c04d7baf786a18" +
+            "87b5f95861180fa256055b006005b67aa0923a70405c5c022af903f0187b3458" +
+            "748cc0bdfeac15adcb7029a17883d0f5ef80573caa61574bb66747bc61aae3ca" +
+            "0c3fe8bcd223d54fd7f5a2270843f9559a99f76aff45d965ba91374fa05a706f" +
+            "479416999389d4e29eb74a1984a30face935fd2118a580a3cd5a6567c2e21e92" +
+            "bb358c54822aaa049a8f47712889ee4507ae4ffd150ba50f444f99701c49fa97" +
+            "72edc44e69cfcda9cffc9f75c49fdb6b28b9699a2567289979dfd42664626232" +
+            "75b682be2baf3856623e37bb47c15e3e8e084771e4f3e7b53265efbc48e616cd" +
+            "ed18c4a546de3f5bd793857c9c7a99615161b7cdcca53fa1d4c119a33bb150a4" +
+            "6e4996450724eed76ae3d2dbc02f147228353241beba27e585a3dd556b8e5c2e" +
+            "5f4a3328fd214663223ec27d4fb134873a85630026a204ee5e059ee29a807f3f" +
+            "82ffcd3b2437cc1bf95a6813dec5195b38cd227002c6f5f53dcd1212f7182038" +
+            "9877b7ddf1ff2c0c65993b9524d3b41eca82ded2b951471c871b741fddd9fdc7" +
+            "70a79bb91c3d91f3a9aa8f880ec22099418c65654a7e3a25c4d8925e98e1e390" +
+            "1437e8767c9debf521e5c93ad5026ab8e5ef9696983ba6d0335e17de6ba65747" +
+            "91a0fb6ecdf20bde55874082a7f19b4332ddbba24d4eb98a9b0e55e4294f37be" +
+            "edd62a3e3ebccf8ded49f3a029fa76becf3389a386d2d62faca4f85cbb643489" +
+            "2e2abfd66dbe727f4fe28d8f8d551e0f8f4c8eda346c66d1bc6fa7a68eabdfb7" +
+            "0d0a34e65910bba73413ad8680dfaa473753ae9e2fd032d8f6cc66d19c57e679" +
+            "7fcc33cce8df504b0708267c480f1b08000030090000504b0304140008080800" +
+            "b78ee844000000000000000000000000090004004d4554412d494e462ffeca00" +
+            "000300504b0708000000000200000000000000504b0304140008080800b78ee8" +
+            "440000000000000000000000000100000041f3cb2fc9c8cc4be70200504b0708" +
+            "3c0a34d30a00000008000000504b01021400140008080800c28ee8442c3740c6" +
+            "9c000000a60000001400000000000000000000000000000000004d4554412d49" +
+            "4e462f4d414e49464553542e4d46504b01021400140008080800c28ee844521a" +
+            "355502010000480100000f00000000000000000000000000de0000004d455441" +
+            "2d494e462f4f4c442e5346504b01021400140008080800c28ee844267c480f1b" +
+            "0800003009000010000000000000000000000000001d0200004d4554412d494e" +
+            "462f4f4c442e525341504b01021400140008080800b78ee84400000000020000" +
+            "00000000000900040000000000000000000000760a00004d4554412d494e462f" +
+            "feca0000504b01021400140008080800b78ee8443c0a34d30a00000008000000" +
+            "0100000000000000000000000000b30a000041504b0506000000000500050027" +
+            "010000ec0a00000000";
+        byte[] data = new byte[var.length()/2];
+        for (int i=0; i<data.length; i++) {
+            data[i] = Integer.valueOf(var.substring(2*i,2*i+2), 16).byteValue();
+        }
+        Files.write(Paths.get("x.jar"), data);
+
+        try (JarFile jf = new JarFile("x.jar")) {
+            JarEntry je = jf.getJarEntry("A");
+            try (InputStream is = jf.getInputStream(je)) {
+                is.read(new byte[10]);
+            }
+            if (je.getCertificates().length != 1) {
+                throw new Exception();
+            }
+        }
+    }
+}
--- a/test/sun/security/tools/jarsigner/TimestampCheck.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/jarsigner/TimestampCheck.java	Tue Oct 14 12:20:39 2014 -0700
@@ -188,7 +188,7 @@
             DerOutputStream tstInfo2 = new DerOutputStream();
             tstInfo2.putOctetString(tstInfo.toByteArray());
 
-            Signature sig = Signature.getInstance("SHA1withDSA");
+            Signature sig = Signature.getInstance("SHA1withRSA");
             sig.initSign((PrivateKey)(ks.getKey(
                     alias, "changeit".toCharArray())));
             sig.update(tstInfo.toByteArray());
@@ -205,7 +205,7 @@
             SignerInfo signerInfo = new SignerInfo(
                     new X500Name(signer.getIssuerX500Principal().getName()),
                     signer.getSerialNumber(),
-                    aid, AlgorithmId.get("DSA"), sig.sign());
+                    aid, AlgorithmId.get("RSA"), sig.sign());
 
             SignerInfo[] signerInfos = {signerInfo};
             PKCS7 p7 =
--- a/test/sun/security/tools/jarsigner/checkusage.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/jarsigner/checkusage.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -45,7 +45,7 @@
     ;;
 esac
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit"
+KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keyalg rsa"
 JAR=$TESTJAVA${FS}bin${FS}jar
 JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner"
 
--- a/test/sun/security/tools/jarsigner/crl.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/jarsigner/crl.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -45,7 +45,7 @@
 
 KS=crl.jks
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"
+KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS -keyalg rsa"
 
 rm $KS 2> /dev/null
 
--- a/test/sun/security/tools/jarsigner/jvindex.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/jarsigner/jvindex.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -47,7 +47,7 @@
 JFILE=jvindex.jar
 
 KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit \
-        -keystore $KS"
+        -keystore $KS -keyalg rsa"
 JAR=$TESTJAVA${FS}bin${FS}jar
 JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner -keystore $KS -storepass changeit"
 
--- a/test/sun/security/tools/jarsigner/newsize7.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/jarsigner/newsize7.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -51,7 +51,7 @@
 
 KSFILE=ns7.jks
 
-KT="${TESTJAVA}${FS}bin${FS}keytool -keystore ns7.jks -storepass changeit -keypass changeit"
+KT="${TESTJAVA}${FS}bin${FS}keytool -keystore ns7.jks -storepass changeit -keypass changeit -keyalg rsa"
 JAR="${TESTJAVA}${FS}bin${FS}jar"
 JS="${TESTJAVA}${FS}bin${FS}jarsigner -keystore ns7.jks -storepass changeit"
 
--- a/test/sun/security/tools/jarsigner/onlymanifest.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/jarsigner/onlymanifest.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -46,7 +46,7 @@
 JFILE=onlymanifest.jar
 
 KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit \
-        -keystore $KS"
+        -keystore $KS -keyalg rsa"
 JAR=$TESTJAVA${FS}bin${FS}jar
 JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
 
--- a/test/sun/security/tools/jarsigner/passtype.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/jarsigner/passtype.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -45,7 +45,7 @@
 KS=pt.jks
 JFILE=pt.jar
 
-KT="$TESTJAVA${FS}bin${FS}keytool -keystore $KS -validity 300"
+KT="$TESTJAVA${FS}bin${FS}keytool -keystore $KS -validity 300 -keyalg rsa"
 JAR=$TESTJAVA${FS}bin${FS}jar
 JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
 
--- a/test/sun/security/tools/jarsigner/samename.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/jarsigner/samename.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -47,7 +47,7 @@
 KS=samename.jks
 JFILE=em.jar
 
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"
+KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS -keyalg rsa"
 JAR=$TESTJAVA${FS}bin${FS}jar
 JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
 
--- a/test/sun/security/tools/jarsigner/ts.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/jarsigner/ts.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -53,7 +53,7 @@
 JAR="${TESTJAVA}${FS}bin${FS}jar"
 JAVA="${TESTJAVA}${FS}bin${FS}java"
 JAVAC="${TESTJAVA}${FS}bin${FS}javac"
-KT="${TESTJAVA}${FS}bin${FS}keytool -keystore tsks -storepass changeit -keypass changeit -validity 200"
+KT="${TESTJAVA}${FS}bin${FS}keytool -keystore tsks -storepass changeit -keypass changeit -keyalg rsa -validity 200"
 
 rm tsks
 echo Nothing > A
--- a/test/sun/security/tools/keytool/CloseFile.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/keytool/CloseFile.java	Tue Oct 14 12:20:39 2014 -0700
@@ -58,7 +58,7 @@
     }
 
     static void run(String s) throws Exception {
-        KeyTool.main((s+" -debug").split(" "));
+        KeyTool.main((s+" -debug -keyalg rsa").split(" "));
     }
     static void remove(String filename, boolean check) {
         new File(filename).delete();
--- a/test/sun/security/tools/keytool/ListKeychainStore.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/keytool/ListKeychainStore.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -71,6 +71,7 @@
         -storetype PKCS12 \
         -keystore $TEMPORARY_P12 \
         -storepass $PWD \
+        -keyalg rsa \
         -dname "CN=$i,OU=$i,O=$i,ST=$i,C=US" \
         -alias 7133495-$i
 
--- a/test/sun/security/tools/keytool/StartDateTest.java	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/keytool/StartDateTest.java	Tue Oct 14 12:20:39 2014 -0700
@@ -48,7 +48,7 @@
         new File("jks").delete();
 
         run("-keystore jks -storetype jks -storepass changeit -keypass changeit -alias me " +
-                "-genkeypair -dname CN=Haha -startdate +1y");
+                "-keyalg rsa -genkeypair -dname CN=Haha -startdate +1y");
         cal.setTime(getIssueDate());
         System.out.println(cal);
         if (cal.get(Calendar.YEAR) != year + 1) {
--- a/test/sun/security/tools/keytool/emptysubject.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/keytool/emptysubject.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -45,7 +45,7 @@
 esac
 
 KS=emptysubject.jks
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"
+KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS -keyalg rsa"
 
 rm $KS
 
--- a/test/sun/security/tools/keytool/importreadall.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/keytool/importreadall.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -49,7 +49,7 @@
     ;;
 esac
 
-KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool -keystore importreadall.jks -storepass changeit -keypass changeit"
+KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool -keystore importreadall.jks -storepass changeit -keypass changeit -keyalg rsa"
 
 # In case the test is run twice in the same directory
 
--- a/test/sun/security/tools/keytool/readjar.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/keytool/readjar.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -45,7 +45,7 @@
 KS=readjar.jks
 rm $KS
 $TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS \
-        -alias x -dname CN=X -genkeypair
+        -keyalg rsa -alias x -dname CN=X -genkeypair
 $TESTJAVA${FS}bin${FS}jar cvf readjar.jar $KS
 $TESTJAVA${FS}bin${FS}jarsigner -storepass changeit -keystore $KS readjar.jar x
 
--- a/test/sun/security/tools/keytool/selfissued.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/keytool/selfissued.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -45,7 +45,7 @@
 esac
 
 KS=selfsigned.jks
-KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"
+KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS -keyalg rsa"
 
 rm $KS
 
--- a/test/sun/security/tools/keytool/trystore.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/tools/keytool/trystore.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -43,7 +43,7 @@
 
 rm trystore.jks 2> /dev/null
 
-KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool -storetype jks -keystore trystore.jks"
+KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool -storetype jks -keystore trystore.jks -keyalg rsa"
 $KEYTOOL -genkeypair -alias a -dname CN=A -storepass changeit -keypass changeit
 $KEYTOOL -genkeypair -alias b -dname CN=B -storepass changeit -keypass changeit
 
--- a/test/sun/security/validator/samedn.sh	Tue Oct 14 10:33:34 2014 -0700
+++ b/test/sun/security/validator/samedn.sh	Tue Oct 14 12:20:39 2014 -0700
@@ -47,7 +47,7 @@
 esac
 
 KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit \
-    -keypass changeit -keystore samedn.jks"
+    -keypass changeit -keystore samedn.jks -keyalg rsa"
 JAVAC=$TESTJAVA${FS}bin${FS}javac
 JAVA=$TESTJAVA${FS}bin${FS}java