changeset 7373:b41024bcedc7

Merge
author lana
date Tue, 22 Jul 2014 18:16:37 -0700
parents 9c9794cffe04 d3f6d3392cdf
children 0b9ab5a573c0
files src/windows/classes/sun/awt/windows/ThemeReader.java src/windows/classes/sun/awt/windows/WToolkit.java
diffstat 47 files changed, 1571 insertions(+), 345 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/crypto/provider/OAEPParameters.java	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/crypto/provider/OAEPParameters.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/AnimationController.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuBarUI.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsPopupMenuSeparatorUI.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsPopupMenuUI.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsProgressBarUI.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsSliderUI.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsSpinnerUI.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/XPStyle.java	Tue Jul 22 18:16:37 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/beans/XMLEncoder.java	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/java/beans/XMLEncoder.java	Tue Jul 22 18:16:37 2014 -0700
@@ -377,7 +377,7 @@
             Object arg = args[i];
             mark(arg, true);
         }
-        mark(stm.getTarget(), false);
+        mark(stm.getTarget(), stm instanceof Expression);
     }
 
 
--- a/src/share/classes/sun/security/pkcs/SignerInfo.java	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/sun/security/pkcs/SignerInfo.java	Tue Jul 22 18:16:37 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/PKIXCertPathValidator.java	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java	Tue Jul 22 18:16:37 2014 -0700
@@ -234,10 +234,6 @@
         // check trusted certificate's subject
         issuerSelector.setSubject(firstCert.getIssuerX500Principal());
 
-        // check the validity period
-        issuerSelector.setValidityPeriod(firstCert.getNotBefore(),
-                                                firstCert.getNotAfter());
-
         /*
          * Facilitate certification path construction with authority
          * key identifier and subject key identifier.
--- a/src/share/classes/sun/security/smartcardio/CardImpl.java	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/sun/security/smartcardio/CardImpl.java	Tue Jul 22 18:16:37 2014 -0700
@@ -237,7 +237,16 @@
         }
     }
 
+    private static final boolean invertReset =
+        Boolean.parseBoolean(
+            java.security.AccessController.doPrivileged(
+                new sun.security.action.GetPropertyAction(
+                    "sun.security.smartcardio.invertCardReset", "true")));
+
     public void disconnect(boolean reset) throws CardException {
+        if (invertReset) {
+            reset = !reset;
+        }
         if (reset) {
             checkSecurity("reset");
         }
--- a/src/share/classes/sun/security/ssl/CipherSuite.java	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/sun/security/ssl/CipherSuite.java	Tue Jul 22 18:16:37 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
@@ -82,6 +82,10 @@
     private final static boolean ALLOW_ECC = Debug.getBooleanProperty
         ("com.sun.net.ssl.enableECC", true);
 
+    // preserve the old order of RC4 preference
+    private final static boolean PRESERVE_RC4 = Debug.getBooleanProperty
+        ("jdk.tls.preserveRC4CipherSuites", false);
+
     // Map Integer(id) -> CipherSuite
     // contains all known CipherSuites
     private final static Map<Integer,CipherSuite> idMap;
@@ -963,16 +967,18 @@
         add("TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
             0x0032, --p, K_DHE_DSS,     B_AES_128, T);
 
-        add("TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
-            0xC007, --p, K_ECDHE_ECDSA, B_RC4_128, N);
-        add("TLS_ECDHE_RSA_WITH_RC4_128_SHA",
-            0xC011, --p, K_ECDHE_RSA,   B_RC4_128, N);
-        add("SSL_RSA_WITH_RC4_128_SHA",
-            0x0005, --p, K_RSA,         B_RC4_128, N);
-        add("TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
-            0xC002, --p, K_ECDH_ECDSA,  B_RC4_128, N);
-        add("TLS_ECDH_RSA_WITH_RC4_128_SHA",
-            0xC00C, --p, K_ECDH_RSA,    B_RC4_128, N);
+        if (PRESERVE_RC4) {
+            add("TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
+                0xC007, --p, K_ECDHE_ECDSA, B_RC4_128, N);
+            add("TLS_ECDHE_RSA_WITH_RC4_128_SHA",
+                0xC011, --p, K_ECDHE_RSA,   B_RC4_128, N);
+            add("SSL_RSA_WITH_RC4_128_SHA",
+                0x0005, --p, K_RSA,         B_RC4_128, N);
+            add("TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
+                0xC002, --p, K_ECDH_ECDSA,  B_RC4_128, N);
+            add("TLS_ECDH_RSA_WITH_RC4_128_SHA",
+                0xC00C, --p, K_ECDH_RSA,    B_RC4_128, N);
+        }
 
         add("TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
             0xC008, --p, K_ECDHE_ECDSA, B_3DES,    T);
@@ -989,6 +995,18 @@
         add("SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
             0x0013, --p, K_DHE_DSS,     B_3DES,    N);
 
+        if (!PRESERVE_RC4) {
+            add("TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
+                0xC007, --p, K_ECDHE_ECDSA, B_RC4_128, N);
+            add("TLS_ECDHE_RSA_WITH_RC4_128_SHA",
+                0xC011, --p, K_ECDHE_RSA,   B_RC4_128, N);
+            add("SSL_RSA_WITH_RC4_128_SHA",
+                0x0005, --p, K_RSA,         B_RC4_128, N);
+            add("TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
+                0xC002, --p, K_ECDH_ECDSA,  B_RC4_128, N);
+            add("TLS_ECDH_RSA_WITH_RC4_128_SHA",
+                0xC00C, --p, K_ECDH_RSA,    B_RC4_128, N);
+        }
         add("SSL_RSA_WITH_RC4_128_MD5",
             0x0004, --p, K_RSA,         B_RC4_128, N);
 
@@ -1008,7 +1026,7 @@
          * 2. If a cipher suite has been obsoleted, we put it at the end of
          *    the list.
          * 3. Prefer the stronger bulk cipher, in the order of AES_256,
-         *    AES_128, RC-4, 3DES-EDE, DES, RC4_40, DES40, NULL.
+         *    AES_128, 3DES-EDE, RC-4, DES, DES40, RC4_40, NULL.
          * 4. Prefer the stronger MAC algorithm, in the order of SHA384,
          *    SHA256, SHA, MD5.
          * 5. Prefer the better performance of key exchange and digital
@@ -1031,15 +1049,51 @@
         add("TLS_DH_anon_WITH_AES_128_CBC_SHA",
             0x0034, --p, K_DH_ANON,     B_AES_128, N);
 
+        if (!PRESERVE_RC4) {
+            add("TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
+                0xC017, --p, K_ECDH_ANON,   B_3DES,    T);
+            add("SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
+                0x001b, --p, K_DH_ANON,     B_3DES,    N);
+        }
+
         add("TLS_ECDH_anon_WITH_RC4_128_SHA",
             0xC016, --p, K_ECDH_ANON,   B_RC4_128, N);
         add("SSL_DH_anon_WITH_RC4_128_MD5",
             0x0018, --p, K_DH_ANON,     B_RC4_128, N);
 
-        add("TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
-            0xC017, --p, K_ECDH_ANON,   B_3DES,    T);
-        add("SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
-            0x001b, --p, K_DH_ANON,     B_3DES,    N);
+        if (!PRESERVE_RC4) {
+            // weak cipher suites obsoleted in TLS 1.2
+            add("SSL_RSA_WITH_DES_CBC_SHA",
+                0x0009, --p, K_RSA,         B_DES,     N, tls12);
+            add("SSL_DHE_RSA_WITH_DES_CBC_SHA",
+                0x0015, --p, K_DHE_RSA,     B_DES,     N, tls12);
+            add("SSL_DHE_DSS_WITH_DES_CBC_SHA",
+                0x0012, --p, K_DHE_DSS,     B_DES,     N, tls12);
+            add("SSL_DH_anon_WITH_DES_CBC_SHA",
+                0x001a, --p, K_DH_ANON,     B_DES,     N, tls12);
+
+            // weak cipher suites obsoleted in TLS 1.1
+            add("SSL_RSA_EXPORT_WITH_RC4_40_MD5",
+                0x0003, --p, K_RSA_EXPORT,  B_RC4_40,  N, tls11);
+            add("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5",
+                0x0017, --p, K_DH_ANON,     B_RC4_40,  N, tls11);
+
+            add("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
+                0x0008, --p, K_RSA_EXPORT,  B_DES_40,  N, tls11);
+            add("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
+                0x0014, --p, K_DHE_RSA,     B_DES_40,  N, tls11);
+            add("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
+                0x0011, --p, K_DHE_DSS,     B_DES_40,  N, tls11);
+            add("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
+                0x0019, --p, K_DH_ANON,     B_DES_40,  N, tls11);
+        }
+
+        if (PRESERVE_RC4) {
+            add("TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
+                0xC017, --p, K_ECDH_ANON,   B_3DES,    T);
+            add("SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
+                0x001b, --p, K_DH_ANON,     B_3DES,    N);
+        }
 
         add("TLS_RSA_WITH_NULL_SHA256",
             0x003b, --p, K_RSA,         B_NULL,    N, max, tls12, P_SHA256);
@@ -1058,52 +1112,70 @@
         add("SSL_RSA_WITH_NULL_MD5",
             0x0001, --p, K_RSA,         B_NULL,    N);
 
-        // weak cipher suites obsoleted in TLS 1.2
-        add("SSL_RSA_WITH_DES_CBC_SHA",
-            0x0009, --p, K_RSA,         B_DES,     N, tls12);
-        add("SSL_DHE_RSA_WITH_DES_CBC_SHA",
-            0x0015, --p, K_DHE_RSA,     B_DES,     N, tls12);
-        add("SSL_DHE_DSS_WITH_DES_CBC_SHA",
-            0x0012, --p, K_DHE_DSS,     B_DES,     N, tls12);
-        add("SSL_DH_anon_WITH_DES_CBC_SHA",
-            0x001a, --p, K_DH_ANON,     B_DES,     N, tls12);
+        if (PRESERVE_RC4) {
+            // weak cipher suites obsoleted in TLS 1.2
+            add("SSL_RSA_WITH_DES_CBC_SHA",
+                0x0009, --p, K_RSA,         B_DES,     N, tls12);
+            add("SSL_DHE_RSA_WITH_DES_CBC_SHA",
+                0x0015, --p, K_DHE_RSA,     B_DES,     N, tls12);
+            add("SSL_DHE_DSS_WITH_DES_CBC_SHA",
+                0x0012, --p, K_DHE_DSS,     B_DES,     N, tls12);
+            add("SSL_DH_anon_WITH_DES_CBC_SHA",
+                0x001a, --p, K_DH_ANON,     B_DES,     N, tls12);
 
-        // weak cipher suites obsoleted in TLS 1.1
-        add("SSL_RSA_EXPORT_WITH_RC4_40_MD5",
-            0x0003, --p, K_RSA_EXPORT,  B_RC4_40,  N, tls11);
-        add("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5",
-            0x0017, --p, K_DH_ANON,     B_RC4_40,  N, tls11);
+            // weak cipher suites obsoleted in TLS 1.1
+            add("SSL_RSA_EXPORT_WITH_RC4_40_MD5",
+                0x0003, --p, K_RSA_EXPORT,  B_RC4_40,  N, tls11);
+            add("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5",
+                0x0017, --p, K_DH_ANON,     B_RC4_40,  N, tls11);
 
-        add("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
-            0x0008, --p, K_RSA_EXPORT,  B_DES_40,  N, tls11);
-        add("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
-            0x0014, --p, K_DHE_RSA,     B_DES_40,  N, tls11);
-        add("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
-            0x0011, --p, K_DHE_DSS,     B_DES_40,  N, tls11);
-        add("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
-            0x0019, --p, K_DH_ANON,     B_DES_40,  N, tls11);
+            add("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
+                0x0008, --p, K_RSA_EXPORT,  B_DES_40,  N, tls11);
+            add("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
+                0x0014, --p, K_DHE_RSA,     B_DES_40,  N, tls11);
+            add("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
+                0x0011, --p, K_DHE_DSS,     B_DES_40,  N, tls11);
+            add("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
+                0x0019, --p, K_DH_ANON,     B_DES_40,  N, tls11);
+        }
 
         // Supported Kerberos ciphersuites from RFC2712
+        if (!PRESERVE_RC4) {
+            add("TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
+                0x001f, --p, K_KRB5,        B_3DES,    N);
+            add("TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
+                0x0023, --p, K_KRB5,        B_3DES,    N);
+        }
         add("TLS_KRB5_WITH_RC4_128_SHA",
             0x0020, --p, K_KRB5,        B_RC4_128, N);
         add("TLS_KRB5_WITH_RC4_128_MD5",
             0x0024, --p, K_KRB5,        B_RC4_128, N);
-        add("TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
-            0x001f, --p, K_KRB5,        B_3DES,    N);
-        add("TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
-            0x0023, --p, K_KRB5,        B_3DES,    N);
+        if (PRESERVE_RC4) {
+            add("TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
+                0x001f, --p, K_KRB5,        B_3DES,    N);
+            add("TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
+                0x0023, --p, K_KRB5,        B_3DES,    N);
+        }
         add("TLS_KRB5_WITH_DES_CBC_SHA",
             0x001e, --p, K_KRB5,        B_DES,     N, tls12);
         add("TLS_KRB5_WITH_DES_CBC_MD5",
             0x0022, --p, K_KRB5,        B_DES,     N, tls12);
+        if (!PRESERVE_RC4) {
+            add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
+                0x0026, --p, K_KRB5_EXPORT, B_DES_40,  N, tls11);
+            add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5",
+                0x0029, --p, K_KRB5_EXPORT, B_DES_40,  N, tls11);
+        }
         add("TLS_KRB5_EXPORT_WITH_RC4_40_SHA",
             0x0028, --p, K_KRB5_EXPORT, B_RC4_40,  N, tls11);
         add("TLS_KRB5_EXPORT_WITH_RC4_40_MD5",
             0x002b, --p, K_KRB5_EXPORT, B_RC4_40,  N, tls11);
-        add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
-            0x0026, --p, K_KRB5_EXPORT, B_DES_40,  N, tls11);
-        add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5",
-            0x0029, --p, K_KRB5_EXPORT, B_DES_40,  N, tls11);
+        if (PRESERVE_RC4) {
+            add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
+                0x0026, --p, K_KRB5_EXPORT, B_DES_40,  N, tls11);
+            add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5",
+                0x0029, --p, K_KRB5_EXPORT, B_DES_40,  N, tls11);
+        }
 
         /*
          * Other values from the TLS Cipher Suite Registry, as of August 2010.
--- a/src/share/classes/sun/security/util/SignatureFileVerifier.java	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/sun/security/util/SignatureFileVerifier.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/sun/security/x509/AlgorithmId.java	Tue Jul 22 18:16:37 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/util/resources/TimeZoneNames_de.java	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames_de.java	Tue Jul 22 18:16:37 2014 -0700
@@ -89,7 +89,7 @@
                                      "Chinesische Sommerzeit", "CDT"};
         String CUBA[] = new String[] {"Kubanische Normalzeit", "CST",
                                       "Kubanische Sommerzeit", "CDT"};
-        String DARWIN[] = new String[] {"Central Normalzeit (Northern Territory)", "CST",
+        String DARWIN[] = new String[] {"Zentrale Normalzeit (Northern Territory)", "CST",
                                         "Zentrale Sommerzeit (Northern Territory)", "CST"};
         String DUBLIN[] = new String[] {"Greenwich Zeit", "GMT",
                                         "Irische Sommerzeit", "IST"};
@@ -103,7 +103,7 @@
                                      "Ostgr\u00f6nl\u00e4ndische Sommerzeit", "EGST"};
         String EST[] = new String[] {"\u00d6stliche Normalzeit", "EST",
                                      "\u00d6stliche Sommerzeit", "EDT"};
-        String EST_NSW[] = new String[] {"Eastern Normalzeit (Neus\u00FCdwales)", "EST",
+        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"};
--- a/src/share/classes/sun/util/resources/TimeZoneNames_es.java	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames_es.java	Tue Jul 22 18:16:37 2014 -0700
@@ -77,8 +77,8 @@
                                        "Hora de verano de Chatham", "CHADT"};
         String ChST[] = new String[] {"Hora est\u00e1ndar de Chamorro", "ChST",
                                       "Hora de verano de Chamorro", "ChDT"};
-        String CHUT[] = new String[] {"Chuuk Time", "CHUT",
-                                      "Chuuk Summer Time", "CHUST"};
+        String CHUT[] = new String[] {"Hora de Chuuk", "CHUT",
+                                      "Hora de verano de Chuuk", "CHUST"};
         String CIT[] = new String[] {"Hora de Indonesia Central", "WITA",
                                      "Hora de verano de Indonesia Central", "CIST"};
         String CLT[] = new String[] {"Hora de Chile", "CLT",
@@ -159,8 +159,8 @@
                                           "Hora de verano de Pitcairn", "PDT"};
         String PKT[] = new String[] {"Hora de Pakist\u00e1n", "PKT",
                                      "Hora de verano de Pakist\u00e1n", "PKST"};
-        String PONT[] = new String[] {"Pohnpei Time", "PONT",
-                                      "Pohnpei Summer Time", "PONST"};
+        String PONT[] = new String[] {"Hora de Pohnpei", "PONT",
+                                      "Hora de verano de Pohnpei", "PONST"};
         String PST[] = new String[] {"Hora est\u00e1ndar del Pac\u00edfico", "PST",
                                      "Hora de verano del Pac\u00edfico", "PDT"};
         String SAMOA[] = new String[] {"Hora est\u00e1ndar de Samoa", "SST",
@@ -401,8 +401,8 @@
             {"America/Mendoza", AGT},
             {"America/Menominee", CST},
             {"America/Merida", CST},
-            {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
-                                                 "Metlakatla Daylight Time", "MeDT"}},
+            {"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"}},
@@ -466,8 +466,8 @@
                                                "Hora de verano de Davis", "DAVST"}},
             {"Antarctica/DumontDUrville", new String[] {"Hora de Dumont-d'Urville", "DDUT",
                                                         "Hora de verano de Dumont-d'Urville", "DDUST"}},
-            {"Antarctica/Macquarie", new String[] {"Macquarie Island Time", "MIST",
-                                                   "Macquarie Island Summer Time", "MIST"}},
+            {"Antarctica/Macquarie", new String[] {"Hora de Isla Macquarie", "MIST",
+                                                   "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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames_sv.java	Tue Jul 22 18:16:37 2014 -0700
@@ -63,7 +63,7 @@
                                      "Bangladesh, sommartid", "BDST"};
         String BRISBANE[] = new String[] {"\u00D6stlig standardtid (Queensland)", "EST",
                                           "\u00D6stlig sommartid (Queensland)", "EST"};
-        String BROKEN_HILL[] = new String[] {"Central standardtid (Sydaustralien)/New South Wales)", "CST",
+        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"};
--- a/src/solaris/classes/sun/awt/X11/XContentWindow.java	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/solaris/classes/sun/awt/X11/XContentWindow.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/solaris/classes/sun/awt/windows/ThemeReader.java	Tue Jul 22 18:16:37 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/native/java/util/TimeZone_md.c	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/solaris/native/java/util/TimeZone_md.c	Tue Jul 22 18:16:37 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/windows/classes/sun/awt/windows/ThemeReader.java	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/ThemeReader.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WToolkit.java	Tue Jul 22 18:16:37 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/sun/windows/awt_Component.cpp	Mon Jul 14 22:41:22 2014 -0700
+++ b/src/windows/native/sun/windows/awt_Component.cpp	Tue Jul 22 18:16:37 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);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/corba/se/impl/io/CustomOutputStream.java	Tue Jul 22 18:16:37 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 Jul 22 18:16:37 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);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/awt/List/ListGarbageCollectionTest/AwtListGarbageCollectionTest.java	Tue Jul 22 18:16:37 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/beans/XMLEncoder/Test8016545.java	Tue Jul 22 18:16:37 2014 -0700
@@ -0,0 +1,106 @@
+/*
+ * 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 8016545
+ * @summary Tests beans with predefined fields
+ * @author Sergey Malenkov
+ */
+
+public class Test8016545 extends AbstractTest {
+    public static void main(String[] args) {
+        new Test8016545().test(true);
+    }
+
+    @Override
+    protected Object getObject() {
+        Bean bean = new Bean();
+        bean.setUndefined(Boolean.FALSE);
+        Info info = new Info();
+        info.setEnabled(Boolean.TRUE);
+        info.setID(1);
+        bean.setInfo(info);
+        return bean;
+    }
+
+    @Override
+    protected Object getAnotherObject() {
+        Bean bean = new Bean();
+        bean.setUndefined(Boolean.TRUE);
+        bean.getInfo().setEnabled(Boolean.FALSE);
+        bean.getInfo().setID(2);
+        return bean;
+    }
+
+    public static class Bean {
+        private Info info = new Info(); // predefined
+        private Boolean defined = Boolean.TRUE;
+        private Boolean undefined;
+
+        public Info getInfo() {
+            return this.info;
+        }
+
+        public void setInfo(Info info) {
+            this.info = info;
+        }
+
+        public Boolean getDefined() {
+            return this.defined;
+        }
+
+        public void setDefined(Boolean defined) {
+            this.defined = defined;
+        }
+
+        public Boolean getUndefined() {
+            return this.undefined;
+        }
+
+        public void setUndefined(Boolean undefined) {
+            this.undefined = undefined;
+        }
+    }
+
+    public static class Info {
+        private Integer id;
+        private Boolean enabled;
+
+        public Integer getID() {
+            return this.id;
+        }
+
+        public void setID(Integer id) {
+            this.id = id;
+        }
+
+        public Boolean getEnabled() {
+            return this.enabled;
+        }
+
+        public void setEnabled(Boolean enabled) {
+            this.enabled = enabled;
+        }
+    }
+}
--- a/test/java/util/logging/ParentLoggersTest.java	Mon Jul 14 22:41:22 2014 -0700
+++ b/test/java/util/logging/ParentLoggersTest.java	Tue Jul 22 18:16:37 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	Mon Jul 14 22:41:22 2014 -0700
+++ b/test/java/util/logging/TestLoggerBundleSync.java	Tue Jul 22 18:16:37 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);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/imageio/plugins/png/PngDitDepthTest.java	Tue Jul 22 18:16:37 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 Jul 22 18:16:37 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/sun/security/provider/certpath/PKIXCertPathValidator/Validity.java	Tue Jul 22 18:16:37 2014 -0700
@@ -0,0 +1,134 @@
+/*
+ * 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 8021804
+ * @summary CertPath should validate even if the validity period of the
+ *          root cert does not include the validity period of a subordinate
+ *          cert.
+ */
+
+import java.io.ByteArrayInputStream;
+import java.security.cert.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+public class Validity {
+
+    /*
+     * Subject: OU=TestOrg, CN=TestCA
+     * Issuer: OU=TestOrg, CN=TestCA
+     * Validity
+     *     Not Before: Feb 26 21:33:55 2014 GMT
+           Not After : Feb 26 21:33:55 2024 GMT
+     * Version 1
+     */
+    static String CACertStr =
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIIBvTCCASYCCQCQRiTo4lBCFjANBgkqhkiG9w0BAQUFADAjMRAwDgYDVQQLDAdU\n" +
+        "ZXN0T3JnMQ8wDQYDVQQDDAZUZXN0Q0EwHhcNMTQwMjI2MjEzMzU1WhcNMjQwMjI2\n" +
+        "MjEzMzU1WjAjMRAwDgYDVQQLDAdUZXN0T3JnMQ8wDQYDVQQDDAZUZXN0Q0EwgZ8w\n" +
+        "DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOtKS4ZrsM3ansd61ZxitcrN0w184I+A\n" +
+        "z0kyrSP1eMtlam+cC2U91NpTz11FYV4XUfBhqqxaXW043AWTUer8pS90Pt4sCrUX\n" +
+        "COx1+QA1M3ZhbZ4sTM7XQ90JbGaBJ/sEza9mlQP7hQ2yQO/hATKbP6J5qvgG2sT2\n" +
+        "S2WYjEgwNwmFAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAQ/CXEpnx2WY4LJtv4jwE\n" +
+        "4jIVirur3pdzV5oBhPyqqHMsyhQBkukCfX7uD7L5wN1+xuM81DfANpIxlnUfybp5\n" +
+        "CpjcmktLpmyK4kJ6XnSd2blbLOIpsr9x6FqxPxpVDlyw/ySHYrIG/GZdsLHgmzGn\n" +
+        "B06jeYzH8OLf879VxAxSsPc=\n" +
+        "-----END CERTIFICATE-----";
+
+    /*
+     * Subject: OU=TestOrg, CN=TestEE0
+     * Issuer: OU=TestOrg, CN=TestCA
+     * Validity
+     *     Not Before: Feb 26 22:55:12 2014 GMT
+     *     Not After : Feb 25 22:55:12 2025 GMT
+     * Version 1
+     */
+    static String EECertStr =
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIIBtjCCAR8CAQQwDQYJKoZIhvcNAQEFBQAwIzEQMA4GA1UECwwHVGVzdE9yZzEP\n" +
+        "MA0GA1UEAwwGVGVzdENBMB4XDTE0MDIyNjIyNTUxMloXDTI1MDIyNTIyNTUxMlow\n" +
+        "JDEQMA4GA1UECwwHVGVzdE9yZzEQMA4GA1UEAwwHVGVzdEVFMDCBnzANBgkqhkiG\n" +
+        "9w0BAQEFAAOBjQAwgYkCgYEAt8xz9W3ruCTHjSOtTX6cxsUZ0nRP6EavEfzgcOYh\n" +
+        "CXGA0gr+viSHq3c2vQBxiRny2hm5rLcqpPo+2OxZtw/ajxfyrV6d/r8YyQLBvyl3\n" +
+        "xdCZdOkG1DCM1oFAQDaSRt9wN5Zm5kyg7uMig5Y4L45fP9Yee4x6Xyh36qYbsR89\n" +
+        "rFMCAwEAATANBgkqhkiG9w0BAQUFAAOBgQDZrPqSo08va1m9TOWOztTuWilGdjK/\n" +
+        "2Ed2WXg8utIpy6uAV+NaOYtHQ7ULQBVRNmwg9nKghbVbh+E/xpoihjl1x7OXass4\n" +
+        "TbwXA5GKFIFpNtDvATQ/QQZoCuCzw1FW/mH0Q7UEQ/9/iJdDad6ebkapeMwtj/8B\n" +
+        "s2IZV7s85CEOXw==\n" +
+        "-----END CERTIFICATE-----";
+
+    public static void main(String[] args) throws Exception {
+
+        String[] certStrs = {EECertStr};
+        String[] trustedCertStrs = {CACertStr};
+        runTest(certStrs, trustedCertStrs);
+
+        System.out.println("Test passed.");
+    }
+
+    private static void runTest(String[] certStrs,
+                                String[] trustedCertStrs)
+            throws Exception {
+
+        CertificateFactory cf = CertificateFactory.getInstance("X509");
+
+        // Generate the CertPath from the certs named in certStrs
+        ArrayList<X509Certificate> certs = new ArrayList<>();
+        for (String certStr : certStrs) {
+            certs.add(generateCert(certStr, cf));
+        }
+        CertPath cp = cf.generateCertPath(certs);
+
+        // Generate the set of Trust Anchors from the certs named in
+        // trustedCertStrs
+        Set<TrustAnchor> trustAnchors = new HashSet<>();
+        for (String trustedCertStr : trustedCertStrs) {
+            TrustAnchor ta = new TrustAnchor(generateCert(trustedCertStr, cf),
+                                             null);
+            trustAnchors.add(ta);
+        }
+        PKIXParameters params = new PKIXParameters(trustAnchors);
+        params.setDate(new Date(114, 3, 1));   // 2014-03-01
+        params.setRevocationEnabled(false);
+
+        // Attempt to validate the CertPath. If no exception thrown, successful.
+        CertPathValidator cpv = CertPathValidator.getInstance("PKIX");
+        cpv.validate(cp, params);
+        System.out.println("CertPath validation successful.");
+    }
+
+    private static X509Certificate generateCert(String certStr,
+                                                CertificateFactory cf)
+            throws Exception {
+        ByteArrayInputStream stream
+                = new ByteArrayInputStream(certStr.getBytes());
+        return (X509Certificate) cf.generateCertificate(stream);
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/ssl/sanity/ciphersuites/CipherSuitesInOldOrder.java	Tue Jul 22 18:16:37 2014 -0700
@@ -0,0 +1,236 @@
+/*
+ * 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
+ * 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 7174244 8043200 8050158
+ * @summary NPE in Krb5ProxyImpl.getServerKeys()
+ *
+ *     SunJSSE does not support dynamic system properties, no way to re-use
+ *     system properties in samevm/agentvm mode.
+ * @run main/othervm -Djdk.tls.preserveRC4CipherSuites=true CipherSuitesInOldOrder
+ */
+
+import java.util.*;
+import javax.net.ssl.*;
+
+public class CipherSuitesInOldOrder {
+
+    // supported ciphersuites
+    private final static List<String> supportedCipherSuites =
+            Arrays.<String>asList(
+        "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384",
+        "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384",
+        "TLS_RSA_WITH_AES_256_CBC_SHA256",
+        "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384",
+        "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384",
+        "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256",
+        "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
+        "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
+        "TLS_RSA_WITH_AES_256_CBC_SHA",
+        "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA",
+        "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA",
+        "TLS_DHE_RSA_WITH_AES_256_CBC_SHA",
+        "TLS_DHE_DSS_WITH_AES_256_CBC_SHA",
+        "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256",
+        "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
+        "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
+        "TLS_RSA_WITH_AES_128_CBC_SHA",
+        "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA",
+        "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
+        "TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
+        "TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
+        "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
+        "TLS_ECDHE_RSA_WITH_RC4_128_SHA",
+        "SSL_RSA_WITH_RC4_128_SHA",
+        "TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
+        "TLS_ECDH_RSA_WITH_RC4_128_SHA",
+        "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
+        "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA",
+        "SSL_RSA_WITH_3DES_EDE_CBC_SHA",
+        "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA",
+        "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA",
+        "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA",
+        "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
+        "SSL_RSA_WITH_RC4_128_MD5",
+
+        "TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
+
+        "TLS_DH_anon_WITH_AES_256_CBC_SHA256",
+        "TLS_ECDH_anon_WITH_AES_256_CBC_SHA",
+        "TLS_DH_anon_WITH_AES_256_CBC_SHA",
+        "TLS_DH_anon_WITH_AES_128_CBC_SHA256",
+        "TLS_ECDH_anon_WITH_AES_128_CBC_SHA",
+        "TLS_DH_anon_WITH_AES_128_CBC_SHA",
+        "TLS_ECDH_anon_WITH_RC4_128_SHA",
+        "SSL_DH_anon_WITH_RC4_128_MD5",
+        "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
+        "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
+        "TLS_RSA_WITH_NULL_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_NULL_SHA",
+        "TLS_ECDHE_RSA_WITH_NULL_SHA",
+        "SSL_RSA_WITH_NULL_SHA",
+        "TLS_ECDH_ECDSA_WITH_NULL_SHA",
+        "TLS_ECDH_RSA_WITH_NULL_SHA",
+        "TLS_ECDH_anon_WITH_NULL_SHA",
+        "SSL_RSA_WITH_NULL_MD5",
+        "SSL_RSA_WITH_DES_CBC_SHA",
+        "SSL_DHE_RSA_WITH_DES_CBC_SHA",
+        "SSL_DHE_DSS_WITH_DES_CBC_SHA",
+        "SSL_DH_anon_WITH_DES_CBC_SHA",
+        "SSL_RSA_EXPORT_WITH_RC4_40_MD5",
+        "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5",
+        "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
+        "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
+        "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
+        "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
+        "TLS_KRB5_WITH_RC4_128_SHA",
+        "TLS_KRB5_WITH_RC4_128_MD5",
+        "TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
+        "TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
+        "TLS_KRB5_WITH_DES_CBC_SHA",
+        "TLS_KRB5_WITH_DES_CBC_MD5",
+        "TLS_KRB5_EXPORT_WITH_RC4_40_SHA",
+        "TLS_KRB5_EXPORT_WITH_RC4_40_MD5",
+        "TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
+        "TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5"
+    );
+
+    private final static String[] protocols = {
+        "", "SSL", "TLS", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"
+    };
+
+
+    public static void main(String[] args) throws Exception {
+        // show all of the supported cipher suites
+        showSuites(supportedCipherSuites.toArray(new String[0]),
+                                "All supported cipher suites");
+
+        for (String protocol : protocols) {
+            System.out.println("//");
+            System.out.println("// " +
+                        "Testing for SSLContext of " + protocol);
+            System.out.println("//");
+            checkForProtocols(protocol);
+        }
+    }
+
+    public static void checkForProtocols(String protocol) throws Exception {
+        SSLContext context;
+        if (protocol.isEmpty()) {
+            context = SSLContext.getDefault();
+        } else {
+            context = SSLContext.getInstance(protocol);
+            context.init(null, null, null);
+        }
+
+        // check the order of default cipher suites of SSLContext
+        SSLParameters parameters = context.getDefaultSSLParameters();
+        checkSuites(parameters.getCipherSuites(),
+                "Default cipher suites in SSLContext");
+
+        // check the order of supported cipher suites of SSLContext
+        parameters = context.getSupportedSSLParameters();
+        checkSuites(parameters.getCipherSuites(),
+                "Supported cipher suites in SSLContext");
+
+
+        //
+        // Check the cipher suites order of SSLEngine
+        //
+        SSLEngine engine = context.createSSLEngine();
+
+        // check the order of endabled cipher suites
+        String[] ciphers = engine.getEnabledCipherSuites();
+        checkSuites(ciphers,
+                "Enabled cipher suites in SSLEngine");
+
+        // check the order of supported cipher suites
+        ciphers = engine.getSupportedCipherSuites();
+        checkSuites(ciphers,
+                "Supported cipher suites in SSLEngine");
+
+        //
+        // Check the cipher suites order of SSLSocket
+        //
+        SSLSocketFactory factory = context.getSocketFactory();
+        try (SSLSocket socket = (SSLSocket)factory.createSocket()) {
+
+            // check the order of endabled cipher suites
+            ciphers = socket.getEnabledCipherSuites();
+            checkSuites(ciphers,
+                "Enabled cipher suites in SSLSocket");
+
+            // check the order of supported cipher suites
+            ciphers = socket.getSupportedCipherSuites();
+            checkSuites(ciphers,
+                "Supported cipher suites in SSLSocket");
+        }
+
+        //
+        // Check the cipher suites order of SSLServerSocket
+        //
+        SSLServerSocketFactory serverFactory = context.getServerSocketFactory();
+        try (SSLServerSocket serverSocket =
+                (SSLServerSocket)serverFactory.createServerSocket()) {
+            // check the order of endabled cipher suites
+            ciphers = serverSocket.getEnabledCipherSuites();
+            checkSuites(ciphers,
+                "Enabled cipher suites in SSLServerSocket");
+
+            // check the order of supported cipher suites
+            ciphers = serverSocket.getSupportedCipherSuites();
+            checkSuites(ciphers,
+                "Supported cipher suites in SSLServerSocket");
+        }
+    }
+
+    private static void checkSuites(String[] suites, String title) {
+        showSuites(suites, title);
+
+        int loc = -1;
+        int index = 0;
+        for (String suite : suites) {
+            index = supportedCipherSuites.indexOf(suite);
+            if (index <= loc) {
+                throw new RuntimeException(suite + " is not in order");
+            }
+
+            loc = index;
+        }
+    }
+
+    private static void showSuites(String[] suites, String title) {
+        System.out.println(title + "[" + suites.length + "]:");
+        for (String suite : suites) {
+            System.out.println("  " + suite);
+        }
+    }
+}
--- a/test/sun/security/ssl/sanity/ciphersuites/CipherSuitesInOrder.java	Mon Jul 14 22:41:22 2014 -0700
+++ b/test/sun/security/ssl/sanity/ciphersuites/CipherSuitesInOrder.java	Tue Jul 22 18:16:37 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 7174244
+ * @bug 7174244 8043200
  * @summary NPE in Krb5ProxyImpl.getServerKeys()
  *
  *     SunJSSE does not support dynamic system properties, no way to re-use
@@ -67,11 +67,6 @@
         "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA",
         "TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
         "TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
-        "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
-        "TLS_ECDHE_RSA_WITH_RC4_128_SHA",
-        "SSL_RSA_WITH_RC4_128_SHA",
-        "TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
-        "TLS_ECDH_RSA_WITH_RC4_128_SHA",
         "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
         "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA",
         "SSL_RSA_WITH_3DES_EDE_CBC_SHA",
@@ -79,6 +74,11 @@
         "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA",
         "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA",
         "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA",
+        "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
+        "TLS_ECDHE_RSA_WITH_RC4_128_SHA",
+        "SSL_RSA_WITH_RC4_128_SHA",
+        "TLS_ECDH_ECDSA_WITH_RC4_128_SHA",
+        "TLS_ECDH_RSA_WITH_RC4_128_SHA",
         "SSL_RSA_WITH_RC4_128_MD5",
 
         "TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
@@ -89,18 +89,10 @@
         "TLS_DH_anon_WITH_AES_128_CBC_SHA256",
         "TLS_ECDH_anon_WITH_AES_128_CBC_SHA",
         "TLS_DH_anon_WITH_AES_128_CBC_SHA",
+        "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
+        "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
         "TLS_ECDH_anon_WITH_RC4_128_SHA",
         "SSL_DH_anon_WITH_RC4_128_MD5",
-        "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA",
-        "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA",
-        "TLS_RSA_WITH_NULL_SHA256",
-        "TLS_ECDHE_ECDSA_WITH_NULL_SHA",
-        "TLS_ECDHE_RSA_WITH_NULL_SHA",
-        "SSL_RSA_WITH_NULL_SHA",
-        "TLS_ECDH_ECDSA_WITH_NULL_SHA",
-        "TLS_ECDH_RSA_WITH_NULL_SHA",
-        "TLS_ECDH_anon_WITH_NULL_SHA",
-        "SSL_RSA_WITH_NULL_MD5",
         "SSL_RSA_WITH_DES_CBC_SHA",
         "SSL_DHE_RSA_WITH_DES_CBC_SHA",
         "SSL_DHE_DSS_WITH_DES_CBC_SHA",
@@ -111,16 +103,24 @@
         "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
         "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA",
         "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA",
+        "TLS_RSA_WITH_NULL_SHA256",
+        "TLS_ECDHE_ECDSA_WITH_NULL_SHA",
+        "TLS_ECDHE_RSA_WITH_NULL_SHA",
+        "SSL_RSA_WITH_NULL_SHA",
+        "TLS_ECDH_ECDSA_WITH_NULL_SHA",
+        "TLS_ECDH_RSA_WITH_NULL_SHA",
+        "TLS_ECDH_anon_WITH_NULL_SHA",
+        "SSL_RSA_WITH_NULL_MD5",
+        "TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
+        "TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
         "TLS_KRB5_WITH_RC4_128_SHA",
         "TLS_KRB5_WITH_RC4_128_MD5",
-        "TLS_KRB5_WITH_3DES_EDE_CBC_SHA",
-        "TLS_KRB5_WITH_3DES_EDE_CBC_MD5",
         "TLS_KRB5_WITH_DES_CBC_SHA",
         "TLS_KRB5_WITH_DES_CBC_MD5",
+        "TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
+        "TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5",
         "TLS_KRB5_EXPORT_WITH_RC4_40_SHA",
-        "TLS_KRB5_EXPORT_WITH_RC4_40_MD5",
-        "TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA",
-        "TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5"
+        "TLS_KRB5_EXPORT_WITH_RC4_40_MD5"
     );
 
     private final static String[] protocols = {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/tools/jarsigner/TimestampAlg.java	Tue Jul 22 18:16:37 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/tools/native2ascii/NativeErrors.java	Mon Jul 14 22:41:22 2014 -0700
+++ b/test/sun/tools/native2ascii/NativeErrors.java	Tue Jul 22 18:16:37 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 1999, 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
@@ -25,12 +25,18 @@
  * @test
  * @bug 4136352
  * @summary Test Native2ASCII error messages
- *
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.* NativeErrors
+ * @run main NativeErrors
  */
 
-import java.io.*;
-import sun.tools.native2ascii.*;
-import java.util.*;
+
+import java.io.File;
+import java.util.ResourceBundle;
+import java.util.MissingResourceException;
+import jdk.testlibrary.OutputAnalyzer;
+import jdk.testlibrary.JDKToolLauncher;
+import jdk.testlibrary.ProcessTools;
 
 public class NativeErrors {
 
@@ -45,30 +51,18 @@
         }
     }
 
-    public static void main(String args[]) throws Exception {
-        String[] command;
-        Process p = null;
-        BufferedReader in = null;
+    public static void main(String args[]) throws Throwable {
+        // Execute command in another vm. Verify stdout for expected err msg.
 
-        // Construct a command that runs the test in other vm
-        // Exec another vm to run test in
-        // Read the result to determine if test failed
-
-        command = getComString("-encoding");
-        p = Runtime.getRuntime().exec(command);
-        in = new BufferedReader(new InputStreamReader(p.getInputStream()));
-        checkResult(in, "err.bad.arg");
+        // Test with no input file given.
+        checkResult(executeCmd("-encoding"), "err.bad.arg");
 
         File f0 = new File(System.getProperty("test.src", "."), "test123");
         String path0 = f0.getPath();
         if ( f0.exists() ) {
             throw new Error("Input file should not exist: " + path0);
         }
-
-        command = getComString(path0);
-        p = Runtime.getRuntime().exec(command);
-        in = new BufferedReader(new InputStreamReader(p.getInputStream()));
-        checkResult(in, "err.cannot.read");
+        checkResult(executeCmd(path0), "err.cannot.read");
 
         File f1 = new File(System.getProperty("test.src", "."), "test1");
         File f2 = File.createTempFile("test2", ".tmp");
@@ -81,71 +75,38 @@
             throw new Error("Output file cannot be made read only: " + path2);
         }
         f2.deleteOnExit();
-
-        command = getComString(path1, path2);
-        p = Runtime.getRuntime().exec(command);
-        in = new BufferedReader(new InputStreamReader(p.getInputStream()));
-        checkResult(in, "err.cannot.write");
+        checkResult(executeCmd(path1, path2), "err.cannot.write");
     }
 
-
-    private static void checkResult(BufferedReader in, String errorExpected)
-                                                           throws Exception {
-        String errorReceived;
-        errorReceived = in.readLine();
-        assert errorReceived != null : "First readline cannot be null";
-        errorExpected = rsrc.getString(errorExpected);
-        assert errorExpected != null : "Expected message cannot be null";
-        StringBuffer error = new StringBuffer(errorExpected);
-        int start = errorExpected.indexOf("{0}");
-        if (start >= 0) {
-            error.delete(start, start+3);
-            errorExpected = error.toString();
+    private static String executeCmd(String... toolArgs) throws Throwable {
+        JDKToolLauncher cmd = JDKToolLauncher.createUsingTestJDK("native2ascii");
+        for (String s : toolArgs) {
+            cmd.addToolArg(s);
         }
-        //System.out.println("received: " + errorReceived);
-        //System.out.println("expected: " + errorExpected);
-        if (!errorReceived.endsWith(errorExpected))
-            throw new RuntimeException("Native2ascii bad arg error broken.");
+        OutputAnalyzer output = ProcessTools.executeProcess(cmd.getCommand());
+        if (output == null || output.getStdout() == null) {
+            throw new Exception("Output was null. Process did not finish correctly.");
+        }
+        if (output.getExitValue() == 0) {
+            throw new Exception("Process exit code was 0, but error was expected.");
+        }
+        return output.getStdout();
     }
 
-    private static String[] getComString(String arg2) {
-        String[] coms = new String[2];
-        coms[0] = getPathString();
-        coms[1] = arg2;
-        return coms;
-    }
+    private static void checkResult(
+            String errorReceived, String errorKey) throws Exception {
+        String errorExpected = rsrc.getString(errorKey);
+        if (errorExpected == null) {
+            throw new Exception("No error message for key: " + errorKey);
+        }
+        // Remove template tag from error message.
+        errorExpected = errorExpected.replaceAll("\\{0\\}", "");
 
-    private static String[] getComString(String arg2, String arg3) {
-        String[] coms = new String[3];
-        coms[0] = getPathString();
-        coms[1] = arg2;
-        coms[2] = arg3;
-        return coms;
-    }
-
-    /*
-     * Search for path to native2ascii
-     */
-    private static String getPathString() {
-        String path = System.getProperty("java.home") + File.separator +
-            "bin" + File.separator + "native2ascii";
-        if (File.separatorChar == '\\') {
-            path = path + ".exe";
+        System.out.println("received: " + errorReceived);
+        System.out.println("expected: " + errorExpected);
+        if (errorReceived.indexOf(errorExpected) < 0) {
+            throw new RuntimeException("Native2ascii bad arg error broken.");
         }
-        File f = new File(path);
-        if (!f.exists()) {
-            System.out.println("Cannot find native2ascii at "+path);
-            path = System.getProperty("java.home") + File.separator + ".." +
-                   File.separator + "bin" + File.separator + "native2ascii";
-            if (File.separatorChar == '\\') {
-                path = path + ".exe";
-            }
-            f = new File(path);
-            if (!f.exists())
-                throw new RuntimeException("Cannot find native2ascii at "+path);
-            System.out.println("Using native2ascii at "+path);
-        }
-        return path;
     }
 
 }
--- a/test/sun/util/resources/TimeZone/Bug6317929.java	Mon Jul 14 22:41:22 2014 -0700
+++ b/test/sun/util/resources/TimeZone/Bug6317929.java	Tue Jul 22 18:16:37 2014 -0700
@@ -130,12 +130,12 @@
                                        "(New South Wales)\"");
         tzLocale = locales2Test[1];
         if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
-           ("Eastern Normalzeit (Neus\u00fcdwales)"))
+           ("\u00D6stliche Normalzeit (New South Wales)"))
             throw new RuntimeException("\n" + tzLocale + ": LONG, " +
                                        "non-daylight saving name for " +
                                        "Australia/Currie should be " +
-                                       "\"Eastern Normalzeit " +
-                                       "(Neus\u00fcdwales)\"");
+                                       "\"\u00D6stliche Normalzeit " +
+                                       "(New South Wales)\"");
         tzLocale = locales2Test[2];
         if (!Currie.getDisplayName(false, TimeZone.LONG, tzLocale).equals
            ("Hora est\u00e1ndar Oriental (Nueva Gales del Sur)"))