changeset 9581:fd1198c70c2c

Merge
author lana
date Wed, 16 Apr 2014 15:03:29 -0700
parents 57c1da89ae1a 4d83f11e9ec9
children 441a988fee9e
files make/mapfiles/libnet/mapfile-vers src/macosx/classes/sun/lwawt/LWToolkit.java src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java src/macosx/native/sun/awt/LWCToolkit.m src/share/classes/java/util/TreeMap.java src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.h src/windows/classes/sun/awt/windows/WClipboard.java src/windows/classes/sun/awt/windows/WToolkit.java
diffstat 261 files changed, 6803 insertions(+), 1852 deletions(-) [+]
line wrap: on
line diff
--- a/make/data/tzdata/VERSION	Wed Apr 16 12:32:36 2014 -0700
+++ b/make/data/tzdata/VERSION	Wed Apr 16 15:03:29 2014 -0700
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2014a
+tzdata2014b
--- a/make/data/tzdata/africa	Wed Apr 16 12:32:36 2014 -0700
+++ b/make/data/tzdata/africa	Wed Apr 16 15:03:29 2014 -0700
@@ -891,7 +891,10 @@
 # Another source (specifying the time for start and end in the decree):
 # http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html
 
-# From Paul Eggert (2013-10-03):
+# From Sebastien Willemijns (2014-03-18):
+# http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp
+
+# From Paul Eggert (2014-03-19):
 # To estimate what the Moroccan government will do in future years,
 # transition dates for 2014 through 2038 were determined by running
 # the following program under GNU Emacs 24.3:
--- a/make/data/tzdata/antarctica	Wed Apr 16 12:32:36 2014 -0700
+++ b/make/data/tzdata/antarctica	Wed Apr 16 15:03:29 2014 -0700
@@ -253,24 +253,41 @@
 # year-round base
 # Scott Base, Ross Island, since 1957-01.
 # See Pacific/Auckland.
-#
-# These rules for New Zealand are stolen from the 'australasia' file.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	NZAQ	1974	only	-	Nov	 3	2:00s	1:00	D
-Rule	NZAQ	1975	1988	-	Oct	lastSun	2:00s	1:00	D
-Rule	NZAQ	1989	only	-	Oct	 8	2:00s	1:00	D
-Rule	NZAQ	1990	2006	-	Oct	Sun>=1	2:00s	1:00	D
-Rule	NZAQ	1975	only	-	Feb	23	2:00s	0	S
-Rule	NZAQ	1976	1989	-	Mar	Sun>=1	2:00s	0	S
-Rule	NZAQ	1990	2007	-	Mar	Sun>=15	2:00s	0	S
-Rule	NZAQ	2007	max	-	Sep	lastSun	2:00s	1:00	D
-Rule	NZAQ	2008	max	-	Apr	Sun>=1	2:00s	0	S
 
 # Norway - territories
 # Bouvet (never inhabited)
 #
 # claims
 # Peter I Island (never inhabited)
+#
+# year-round base
+# Troll, Queen Maud Land, -720041+0023206, since 2005-02-12
+#
+# From Paul-Inge Flakstad (2014-03-10):
+# I recently had a long dialog about this with the developer of timegenie.com.
+# In the absence of specific dates, he decided to choose some likely ones:
+#   GMT +1 - From March 1 to the last Sunday in March
+#   GMT +2 - From the last Sunday in March until the last Sunday in October
+#   GMT +1 - From the last Sunday in October until November 7
+#   GMT +0 - From November 7 until March 1
+# The dates for switching to and from UTC+0 will probably not be absolutely
+# correct, but they should be quite close to the actual dates.
+#
+# From Paul Eggert (2014-03-21):
+# The CET-switching Troll rules require zic from tzcode 2014b or later, so as
+# suggested by Bengt-Inge Larsson comment them out for now, and approximate
+# with only UTC and CEST.  Uncomment them when 2014b is more prevalent.
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+#Rule	Troll	2005	max	-	Mar	 1	1:00u	1:00	CET
+Rule	Troll	2005	max	-	Mar	lastSun	1:00u	2:00	CEST
+#Rule	Troll	2005	max	-	Oct	lastSun	1:00u	1:00	CET
+#Rule	Troll	2004	max	-	Nov	 7	1:00u	0:00	UTC
+# Remove the following line when uncommenting the above '#Rule' lines.
+Rule	Troll	2004	max	-	Oct	lastSun	1:00u	0:00	UTC
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Antarctica/Troll	0	-	zzz	2005 Feb 12
+     			0:00	Troll	%s
 
 # Poland - year-round base
 # Arctowski, King George Island, -620945-0582745, since 1977
--- a/make/data/tzdata/australasia	Wed Apr 16 12:32:36 2014 -0700
+++ b/make/data/tzdata/australasia	Wed Apr 16 15:03:29 2014 -0700
@@ -786,14 +786,29 @@
 
 # Johnston
 #
-# From Paul Eggert (2013-09-03):
+# From Paul Eggert (2014-03-11):
+# Sometimes Johnston kept Hawaii time, and sometimes it was an hour behind.
+# Details are uncertain.  We have no data for Johnston after 1970, so
+# treat it like Hawaii for now.
+#
 # In his memoirs of June 6th to October 4, 1945
 # <http://www.315bw.org/Herb_Bach.htm> (2005), Herbert C. Bach writes,
 # "We started our letdown to Kwajalein Atoll and landed there at 5:00 AM
 # Johnston time, 1:30 AM Kwajalein time."  This was in June 1945, and
 # confirms that Johnston kept the same time as Honolulu in summer 1945.
-# We have no better information, so for now, assume this has been true
-# indefinitely into the past.
+#
+# From Lyle McElhaney (2014-03-11):
+# [W]hen JI was being used for that [atomic bomb] testing, the time being used
+# was not Hawaiian time but rather the same time being used on the ships,
+# which had a GMT offset of -11 hours.  This apparently applied to at least the
+# time from Operation Newsreel (Hardtack I/Teak shot, 1958-08-01) to the last
+# Operation Fishbowl shot (Tightrope, 1962-11-04).... [See] Herman Hoerlin,
+# "The United States High-Altitude Test Experience: A Review Emphasizing the
+# Impact on the Environment", Los Alamos LA-6405, Oct 1976
+# <http://www.fas.org/sgp/othergov/doe/lanl/docs1/00322994.pdf>.
+# See the table on page 4 where he lists GMT and local times for the tests; a
+# footnote for the JI tests reads that local time is "JI time = Hawaii Time
+# Minus One Hour".
 #
 # See 'northamerica' for Pacific/Johnston.
 
--- a/make/data/tzdata/europe	Wed Apr 16 12:32:36 2014 -0700
+++ b/make/data/tzdata/europe	Wed Apr 16 15:03:29 2014 -0700
@@ -2986,7 +2986,11 @@
 # Assume it happened in March by not changing the clocks.
 			3:00	Russia	MSK/MSD	1997
 			3:00	-	MSK	1997 Mar lastSun 1:00u
-			2:00	EU	EE%sT
+# From Alexander Krivenyshev (2014-03-17):
+# time change at 2:00 (2am) on March 30, 2014
+# http://vz.ru/news/2014/3/17/677464.html
+			2:00	EU	EE%sT	2014 Mar 30 2:00
+			4:00	-	MSK
 
 # Vatican City
 # See Europe/Rome.
--- a/make/data/tzdata/leapseconds	Wed Apr 16 12:32:36 2014 -0700
+++ b/make/data/tzdata/leapseconds	Wed Apr 16 15:03:29 2014 -0700
@@ -20,7 +20,7 @@
 # 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.
-
+#
 # Allowance for leapseconds added to each timezone file.
 
 # This file is in the public domain.
--- a/make/data/tzdata/zone.tab	Wed Apr 16 12:32:36 2014 -0700
+++ b/make/data/tzdata/zone.tab	Wed Apr 16 15:03:29 2014 -0700
@@ -74,6 +74,7 @@
 AQ	-7824+10654	Antarctica/Vostok	Vostok Station, Lake Vostok
 AQ	-6640+14001	Antarctica/DumontDUrville	Dumont-d'Urville Station, Terre Adelie
 AQ	-690022+0393524	Antarctica/Syowa	Syowa Station, E Ongul I
+AQ	-720041+0023206	Antarctica/Troll	Troll Station, Queen Maud Land
 AR	-3436-05827	America/Argentina/Buenos_Aires	Buenos Aires (BA, CF)
 AR	-3124-06411	America/Argentina/Cordoba	most locations (CB, CC, CN, ER, FM, MN, SE, SF)
 AR	-2447-06525	America/Argentina/Salta	(SA, LP, NQ, RN)
@@ -366,6 +367,7 @@
 RU	+5545+03735	Europe/Moscow	Moscow+00 - west Russia
 RU	+4844+04425	Europe/Volgograd	Moscow+00 - Caspian Sea
 RU	+5312+05009	Europe/Samara	Moscow+00 - Samara, Udmurtia
+RU	+4457+03406	Europe/Simferopol	Moscow+00 - Crimea
 RU	+5651+06036	Asia/Yekaterinburg	Moscow+02 - Urals
 RU	+5500+07324	Asia/Omsk	Moscow+03 - west Siberia
 RU	+5502+08255	Asia/Novosibirsk	Moscow+03 - Novosibirsk
@@ -421,7 +423,6 @@
 UA	+5026+03031	Europe/Kiev	most locations
 UA	+4837+02218	Europe/Uzhgorod	Ruthenia
 UA	+4750+03510	Europe/Zaporozhye	Zaporozh'ye, E Lugansk / Zaporizhia, E Luhansk
-UA	+4457+03406	Europe/Simferopol	central Crimea
 UG	+0019+03225	Africa/Kampala
 UM	+1645-16931	Pacific/Johnston	Johnston Atoll
 UM	+2813-17722	Pacific/Midway	Midway Islands
--- a/make/mapfiles/libnet/mapfile-vers	Wed Apr 16 12:32:36 2014 -0700
+++ b/make/mapfiles/libnet/mapfile-vers	Wed Apr 16 15:03:29 2014 -0700
@@ -94,6 +94,10 @@
 		Java_sun_net_sdp_SdpSupport_create0;
 		Java_sun_net_spi_DefaultProxySelector_init;
 		Java_sun_net_spi_DefaultProxySelector_getSystemProxy;
+		Java_sun_net_ExtendedOptionsImpl_init;
+		Java_sun_net_ExtendedOptionsImpl_setFlowOption;
+		Java_sun_net_ExtendedOptionsImpl_getFlowOption;
+		Java_sun_net_ExtendedOptionsImpl_flowSupported;
 		NET_AllocSockaddr;
 		NET_SockaddrToInetAddress;
                 NET_SockaddrEqualsInetAddress;
--- a/src/macosx/classes/apple/laf/JRSUIConstants.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/classes/apple/laf/JRSUIConstants.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,13 @@
 import java.lang.annotation.Native;
 
 public final class JRSUIConstants {
+
+    /**
+     * There is no way to get width of focus border, so it is hardcoded here.
+     * All components, which can be focused should take care about it.
+     */
+    public static final int FOCUS_SIZE = 4;
+
     private static native long getPtrForConstant(final int constant);
 
     static class Key {
--- a/src/macosx/classes/com/apple/laf/AquaButtonExtendedTypes.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaButtonExtendedTypes.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,8 @@
 import com.apple.laf.AquaUtilControlSize.*;
 import com.apple.laf.AquaUtils.RecyclableSingleton;
 
+import static apple.laf.JRSUIConstants.FOCUS_SIZE;
+
 /**
  * All the "magic numbers" in this class should go away once
  * <rdar://problem/4613866> "default font" and sizes for controls in Java Aqua Look and Feel
@@ -145,7 +147,8 @@
     protected static Map<String, TypeSpecifier> getAllTypes() {
         final Map<String, TypeSpecifier> specifiersByName = new HashMap<String, TypeSpecifier>();
 
-        final Insets focusInsets = new Insets(4, 4, 4, 4);
+        final Insets focusInsets = new Insets(FOCUS_SIZE, FOCUS_SIZE,
+                                              FOCUS_SIZE, FOCUS_SIZE);
 
         final TypeSpecifier[] specifiers = {
             new TypeSpecifier("toolbar", true) {
--- a/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1266,64 +1266,70 @@
     /**
      * Data model for a type-face selection combo-box.
      */
-    protected class FilterComboBoxModel extends DefaultListModel implements ComboBoxModel, PropertyChangeListener {
-        int selectedIndex = -1;
-
+    protected class FilterComboBoxModel extends AbstractListModel<FileFilter> implements ComboBoxModel<FileFilter>,
+            PropertyChangeListener {
+        protected FileFilter[] filters;
         protected FilterComboBoxModel() {
             super();
-            final FileFilter filters[] = getFileChooser().getChoosableFileFilters();
-            for (int i = 0; i < filters.length; i++) {
-                this.add(i, filters[i]);
+            filters = getFileChooser().getChoosableFileFilters();
+        }
+
+        public void propertyChange(PropertyChangeEvent e) {
+            String prop = e.getPropertyName();
+            if(prop == JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) {
+                filters = (FileFilter[]) e.getNewValue();
+                fireContentsChanged(this, -1, -1);
+            } else if (prop == JFileChooser.FILE_FILTER_CHANGED_PROPERTY) {
+                fireContentsChanged(this, -1, -1);
             }
         }
 
-        public void propertyChange(final PropertyChangeEvent e) {
-            final String prop = e.getPropertyName();
-            if (prop == JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) {
-                this.clear();
-                final FileFilter filters[] = (FileFilter[])e.getNewValue();
-
-                for (int i = 0; i < filters.length; i++) {
-                    this.add(i, filters[i]);
-                }
-
-                fireContentsChanged(this, -1, -1);
-            } else if (prop == JFileChooser.FILE_FILTER_CHANGED_PROPERTY) {
-                final FileFilter currentFilter = (FileFilter)e.getNewValue();
-                FileFilter filters[] = getFileChooser().getChoosableFileFilters();
-
-                boolean found = false;
-                if (currentFilter != null) {
-                    for (final FileFilter element : filters) {
-                        if (element == currentFilter) {
-                            found = true;
-                        }
-                    }
-                    if (found == false) {
-                        getFileChooser().addChoosableFileFilter(currentFilter);
-                    }
-                }
-
-                filters = getFileChooser().getChoosableFileFilters();
-                setSelectedItem(e.getNewValue());
-            }
-        }
-
-        public void setSelectedItem(final Object filter) {
-            if (filter != null) {
-                selectedIndex = this.indexOf(filter);
+        public void setSelectedItem(Object filter) {
+            if(filter != null) {
+                getFileChooser().setFileFilter((FileFilter) filter);
                 fireContentsChanged(this, -1, -1);
             }
         }
 
         public Object getSelectedItem() {
-            final Object returnValue = null;
+            // Ensure that the current filter is in the list.
+            // NOTE: we shouldnt' have to do this, since JFileChooser adds
+            // the filter to the choosable filters list when the filter
+            // is set. Lets be paranoid just in case someone overrides
+            // setFileFilter in JFileChooser.
+            FileFilter currentFilter = getFileChooser().getFileFilter();
+            boolean found = false;
+            if(currentFilter != null) {
+                for (FileFilter filter : filters) {
+                    if (filter == currentFilter) {
+                        found = true;
+                    }
+                }
+                if(found == false) {
+                    getFileChooser().addChoosableFileFilter(currentFilter);
+                }
+            }
+            return getFileChooser().getFileFilter();
+        }
 
-            if (this.size() > 0) {
-                if ((selectedIndex != -1) && (selectedIndex < size())) { return this.get(selectedIndex); }
+        public int getSize() {
+            if(filters != null) {
+                return filters.length;
+            } else {
+                return 0;
             }
+        }
 
-            return returnValue;
+        public FileFilter getElementAt(int index) {
+            if(index > getSize() - 1) {
+                // This shouldn't happen. Try to recover gracefully.
+                return getFileChooser().getFileFilter();
+            }
+            if(filters != null) {
+                return filters[index];
+            } else {
+                return null;
+            }
         }
     }
 
--- a/src/macosx/classes/com/apple/laf/AquaIcon.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaIcon.java	Wed Apr 16 15:03:29 2014 -0700
@@ -44,7 +44,8 @@
     }
 
     static UIResource getIconFor(final JRSUIControlSpec spec, final int width, final int height) {
-        return new CachableJRSUIIcon(width, height) {
+        return new ScalingJRSUIIcon(width, height) {
+            @Override
             public void initIconPainter(final AquaPainter<JRSUIState> painter) {
                 spec.initIconPainter(painter);
             }
@@ -128,35 +129,12 @@
             if (image != null) return image;
 
             if (!GraphicsEnvironment.isHeadless()) {
-                image = getOptimizedImage();
+                image = createImage();
             }
 
             return image;
         }
 
-        private Image getOptimizedImage() {
-            final Image img = createImage();
-            // TODO: no RuntimeOptions for now
-            //if (RuntimeOptions.getRenderer(null) != RuntimeOptions.Sun) return img;
-            return getProgressiveOptimizedImage(img, getIconWidth(), getIconHeight());
-        }
-
-        static Image getProgressiveOptimizedImage(final Image img, final int w, final int h) {
-            if (img == null) return null;
-
-            final int halfImgW = img.getWidth(null) / 2;
-            final int halfImgH = img.getHeight(null) / 2;
-            if (w * 2 > halfImgW && h * 2 > halfImgH) return img;
-
-            final BufferedImage halfImage = new BufferedImage(halfImgW, halfImgH, BufferedImage.TYPE_INT_ARGB);
-            final Graphics g = halfImage.getGraphics();
-            ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
-            g.drawImage(img, 0, 0, halfImgW, halfImgH, null);
-            g.dispose();
-
-            return getProgressiveOptimizedImage(halfImage, w, h);
-        }
-
         abstract Image createImage();
 
         public boolean hasIconRef() {
@@ -189,24 +167,50 @@
 
     }
 
-    static abstract class CachableJRSUIIcon extends CachingScalingIcon implements UIResource {
-        public CachableJRSUIIcon(final int width, final int height) {
-            super(width, height);
+    static abstract class ScalingJRSUIIcon implements Icon, UIResource {
+        final int width;
+        final int height;
+
+        public ScalingJRSUIIcon(final int width, final int height) {
+            this.width = width;
+            this.height = height;
         }
 
-        Image createImage() {
-            final AquaPainter<JRSUIState> painter = AquaPainter.create(JRSUIState.getInstance());
+        @Override
+        public void paintIcon(final Component c, Graphics g,
+                final int x, final int y) {
+            if (GraphicsEnvironment.isHeadless()) {
+                return;
+            }
+
+            g = g.create();
+
+            if (g instanceof Graphics2D) {
+                // improves icon rendering quality in Quartz
+                ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING,
+                        RenderingHints.VALUE_RENDER_QUALITY);
+            }
+
+            final AquaPainter<JRSUIState> painter =
+                    AquaPainter.create(JRSUIState.getInstance());
             initIconPainter(painter);
 
-            final BufferedImage img = new BufferedImage(getIconWidth(), getIconHeight(), BufferedImage.TYPE_INT_ARGB_PRE);
-            final Graphics g = img.getGraphics();
-            g.setClip(new Rectangle(0, 0, getIconWidth(), getIconHeight()));
-            painter.paint(g, null, 0, 0, getIconWidth(), getIconHeight());
+            g.setClip(new Rectangle(x, y, width, height));
+            painter.paint(g, c, x, y, width, height);
             g.dispose();
-            return img;
         }
 
         public abstract void initIconPainter(final AquaPainter<JRSUIState> painter);
+
+        @Override
+        public int getIconWidth() {
+            return width;
+        }
+
+        @Override
+        public int getIconHeight() {
+            return height;
+        }
     }
 
     static class FileIcon extends CachingScalingIcon {
--- a/src/macosx/classes/com/apple/laf/AquaInternalFrameUI.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaInternalFrameUI.java	Wed Apr 16 15:03:29 2014 -0700
@@ -786,8 +786,9 @@
     }
 
     static final RecyclableSingleton<Icon> RESIZE_ICON = new RecyclableSingleton<Icon>() {
+        @Override
         protected Icon getInstance() {
-            return new AquaIcon.CachableJRSUIIcon(11, 11) {
+            return new AquaIcon.ScalingJRSUIIcon(11, 11) {
                 public void initIconPainter(final AquaPainter<JRSUIState> iconState) {
                     iconState.state.set(Widget.GROW_BOX_TEXTURED);
                     iconState.state.set(WindowType.UTILITY);
--- a/src/macosx/classes/com/apple/laf/AquaPainter.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/classes/com/apple/laf/AquaPainter.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -141,40 +141,71 @@
             paintFromSingleCachedImage(g, control, stateToPaint, boundsRect);
         }
 
+        /**
+         * Paints a native control, which identified by its size and a set of
+         * additional arguments using a cached image.
+         *
+         * @param  g Graphics to draw the control
+         * @param  control the reference to the native control
+         * @param  controlState the state of the native control
+         * @param  bounds the rectangle where the native part should be drawn.
+         *         Note: the focus can/will be drawn outside of this bounds.
+         */
         static void paintFromSingleCachedImage(final Graphics2D g,
-                final JRSUIControl control, final JRSUIState controlState,
-                final Rectangle bounds) {
+                                               final JRSUIControl control,
+                                               final JRSUIState controlState,
+                                               final Rectangle bounds) {
             if (bounds.width <= 0 || bounds.height <= 0) {
                 return;
             }
 
-            int scale = 1;
-            if (g instanceof SunGraphics2D) {
-                scale = ((SunGraphics2D) g).surfaceData.getDefaultScale();
+            int focus = 0;
+            if (controlState.is(JRSUIConstants.Focused.YES)) {
+                focus = JRSUIConstants.FOCUS_SIZE;
             }
+
+            final int imgX = bounds.x - focus;
+            final int imgY = bounds.y - focus;
+            final int imgW = bounds.width + (focus << 1);
+            final int imgH = bounds.height + (focus << 1);
             final GraphicsConfiguration config = g.getDeviceConfiguration();
             final ImageCache cache = ImageCache.getInstance();
-            final int imgW = bounds.width * scale;
-            final int imgH = bounds.height * scale;
-            AquaPixelsKey key = new AquaPixelsKey(config,
-                    imgW, imgH, scale, controlState);
-            BufferedImage img = (BufferedImage) cache.getImage(key);
+            final AquaPixelsKey key = new AquaPixelsKey(config, imgW, imgH,
+                                                        bounds, controlState);
+            Image img = cache.getImage(key);
             if (img == null) {
-                img = new BufferedImage(imgW, imgH, BufferedImage.TYPE_INT_ARGB_PRE);
+
+                Image baseImage = createImage(imgX, imgY, imgW, imgH, bounds,
+                                              control, controlState);
+
+                img = new MultiResolutionBufferedImage(baseImage,
+                        (rvWidth, rvHeight) -> createImage(imgX, imgY,
+                         rvWidth, rvHeight, bounds, control, controlState));
+
                 if (!controlState.is(JRSUIConstants.Animating.YES)) {
                     cache.setImage(key, img);
                 }
-
-                final WritableRaster raster = img.getRaster();
-                final DataBufferInt buffer = (DataBufferInt) raster.getDataBuffer();
-
-                control.set(controlState);
-                control.paint(SunWritableRaster.stealData(buffer, 0),
-                        imgW, imgH, 0, 0, bounds.width, bounds.height);
-                SunWritableRaster.markDirty(buffer);
             }
 
-            g.drawImage(img, bounds.x, bounds.y, bounds.width, bounds.height, null);
+            g.drawImage(img, imgX, imgY, imgW, imgH, null);
+        }
+
+        private static Image createImage(int imgX, int imgY, int imgW, int imgH,
+                                         final Rectangle bounds,
+                                         final JRSUIControl control,
+                                         JRSUIState controlState) {
+            BufferedImage img = new BufferedImage(imgW, imgH,
+                    BufferedImage.TYPE_INT_ARGB_PRE);
+
+            final WritableRaster raster = img.getRaster();
+            final DataBufferInt buffer = (DataBufferInt) raster.getDataBuffer();
+
+            control.set(controlState);
+            control.paint(SunWritableRaster.stealData(buffer, 0), imgW, imgH,
+                          bounds.x - imgX, bounds.y - imgY, bounds.width,
+                          bounds.height);
+            SunWritableRaster.markDirty(buffer);
+            return img;
         }
     }
 
@@ -187,21 +218,22 @@
         private final GraphicsConfiguration config;
         private final int w;
         private final int h;
-        private final int scale;
+        private final Rectangle bounds;
         private final JRSUIState state;
 
         AquaPixelsKey(final GraphicsConfiguration config,
-                final int w, final int h, final int scale,
+                final int w, final int h, final Rectangle bounds,
                 final JRSUIState state) {
             this.pixelCount = w * h;
             this.config = config;
             this.w = w;
             this.h = h;
-            this.scale = scale;
+            this.bounds = bounds;
             this.state = state;
             this.hash = hash();
         }
 
+        @Override
         public int getPixelCount() {
             return pixelCount;
         }
@@ -210,7 +242,7 @@
             int hash = config != null ? config.hashCode() : 0;
             hash = 31 * hash + w;
             hash = 31 * hash + h;
-            hash = 31 * hash + scale;
+            hash = 31 * hash + bounds.hashCode();
             hash = 31 * hash + state.hashCode();
             return hash;
         }
@@ -225,7 +257,7 @@
             if (obj instanceof AquaPixelsKey) {
                 AquaPixelsKey key = (AquaPixelsKey) obj;
                 return config == key.config && w == key.w && h == key.h
-                        && scale == key.scale && state.equals(key.state);
+                        && bounds.equals(key.bounds) && state.equals(key.state);
             }
             return false;
         }
--- a/src/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,9 +30,6 @@
 import java.awt.Component;
 import java.awt.Graphics;
 import java.awt.Graphics2D;
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-import java.awt.GraphicsEnvironment;
 import java.awt.Image;
 import java.awt.ImageCapabilities;
 import java.awt.Rectangle;
@@ -80,23 +77,34 @@
     private ContextCapabilities oglCaps;
     private OGLContext context;
     private final Object disposerReferent = new Object();
+    private final int maxTextureSize;
+
     private static native boolean initCGL();
     private static native long getCGLConfigInfo(int displayID, int visualnum,
                                                 int swapInterval);
     private static native int getOGLCapabilities(long configInfo);
 
+    /**
+     * Returns GL_MAX_TEXTURE_SIZE from the shared opengl context. Must be
+     * called under OGLRQ lock, because this method change current context.
+     *
+     * @return GL_MAX_TEXTURE_SIZE
+     */
+    private static native int nativeGetMaxTextureSize();
+
     static {
         cglAvailable = initCGL();
     }
 
     private CGLGraphicsConfig(CGraphicsDevice device, int pixfmt,
-                                long configInfo, ContextCapabilities oglCaps)
-    {
+                              long configInfo, int maxTextureSize,
+                              ContextCapabilities oglCaps) {
         super(device);
 
         this.pixfmt = pixfmt;
         this.pConfigInfo = configInfo;
         this.oglCaps = oglCaps;
+        this.maxTextureSize = maxTextureSize;
         context = new OGLContext(OGLRenderQueue.getInstance(), this);
 
         // add a record to the Disposer so that we destroy the native
@@ -126,6 +134,7 @@
         }
 
         long cfginfo = 0;
+        int textureSize = 0;
         final String ids[] = new String[1];
         OGLRenderQueue rq = OGLRenderQueue.getInstance();
         rq.lock();
@@ -138,11 +147,14 @@
             cfginfo = getCGLConfigInfo(device.getCGDisplayID(), pixfmt,
                                        kOpenGLSwapInterval);
             if (cfginfo != 0L) {
+                textureSize = nativeGetMaxTextureSize();
+                // 7160609: GL still fails to create a square texture of this
+                // size. Half should be safe enough.
+                // Explicitly not support a texture more than 2^14, see 8010999.
+                textureSize = textureSize <= 16384 ? textureSize / 2 : 8192;
                 OGLContext.setScratchSurface(cfginfo);
-                rq.flushAndInvokeNow(new Runnable() {
-                    public void run() {
-                        ids[0] = OGLContext.getOGLIdString();
-                    }
+                rq.flushAndInvokeNow(() -> {
+                    ids[0] = OGLContext.getOGLIdString();
                 });
             }
         } finally {
@@ -154,8 +166,7 @@
 
         int oglCaps = getOGLCapabilities(cfginfo);
         ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);
-
-        return new CGLGraphicsConfig(device, pixfmt, cfginfo, caps);
+        return new CGLGraphicsConfig(device, pixfmt, cfginfo, textureSize, caps);
     }
 
     public static boolean isCGLAvailable() {
@@ -246,8 +257,6 @@
         } finally {
             rq.unlock();
         }
-
-        updateTotalDisplayBounds();
     }
 
     @Override
@@ -421,57 +430,15 @@
         AccelDeviceEventNotifier.removeListener(l);
     }
 
-    private static final Rectangle totalDisplayBounds = new Rectangle();
-
-    private static void updateTotalDisplayBounds() {
-        synchronized (totalDisplayBounds) {
-            Rectangle virtualBounds = new Rectangle();
-            for (GraphicsDevice gd : GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()) {
-                for (GraphicsConfiguration gc : gd.getConfigurations()) {
-                    virtualBounds = virtualBounds.union(gc.getBounds());
-                }
-            }
-            totalDisplayBounds.setBounds(virtualBounds);
-        }
-    }
-
-    // 7160609: GL still fails to create a square texture of this size,
-    //          so we use this value to cap the total display bounds.
-    native private static int getMaxTextureSize();
-
     @Override
     public int getMaxTextureWidth() {
-        //Temporary disable this logic and use some magic constrain.
-        /*
-         int width;
-
-         synchronized (totalDisplayBounds) {
-         if (totalDisplayBounds.width == 0) {
-         updateTotalDisplayBounds();
-         }
-         width = totalDisplayBounds.width;
-         }
-
-         return Math.min(width, getMaxTextureSize());
-         */
-        return getMaxTextureSize() / (getDevice().getScaleFactor() * 2);
+        return Math.max(maxTextureSize / getDevice().getScaleFactor(),
+                        getBounds().width);
     }
 
     @Override
     public int getMaxTextureHeight() {
-        //Temporary disable this logic and use some magic constrain.
-        /*
-         int height;
-
-         synchronized (totalDisplayBounds) {
-         if (totalDisplayBounds.height == 0) {
-         updateTotalDisplayBounds();
-         }
-         height = totalDisplayBounds.height;
-         }
-
-         return Math.min(height, getMaxTextureSize());
-         */
-        return getMaxTextureSize() / (getDevice().getScaleFactor() * 2);
+        return Math.max(maxTextureSize / getDevice().getScaleFactor(),
+                        getBounds().height);
     }
 }
--- a/src/macosx/classes/sun/lwawt/LWToolkit.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/classes/sun/lwawt/LWToolkit.java	Wed Apr 16 15:03:29 2014 -0700
@@ -28,19 +28,18 @@
 import java.awt.*;
 import java.awt.List;
 import java.awt.datatransfer.*;
-import java.awt.dnd.*;
-import java.awt.dnd.peer.*;
 import java.awt.image.*;
 import java.awt.peer.*;
 import java.security.*;
 import java.util.*;
 
 import sun.awt.*;
-import sun.lwawt.macosx.*;
 import sun.print.*;
 import sun.security.util.SecurityConstants;
 import sun.misc.ThreadGroupUtils;
 
+import static sun.lwawt.LWWindowPeer.PeerType;
+
 public abstract class LWToolkit extends SunToolkit implements Runnable {
 
     private final static int STATE_NONE = 0;
@@ -103,7 +102,7 @@
     /*
      * Sends a request to stop the message pump.
      */
-    public void shutdown() {
+    public final void shutdown() {
         setRunState(STATE_SHUTDOWN);
         platformShutdown();
     }
@@ -134,7 +133,7 @@
         notifyAll();
     }
 
-    public boolean isTerminating() {
+    public final boolean isTerminating() {
         return getRunState() >= STATE_SHUTDOWN;
     }
 
@@ -151,7 +150,8 @@
         }
     }
 
-    public void run() {
+    @Override
+    public final void run() {
         setRunState(STATE_INIT);
         platformInit();
         AWTAutoShutdown.notifyToolkitThreadFree();
@@ -203,80 +203,51 @@
      * Note that LWWindowPeer implements WindowPeer, FramePeer
      * and DialogPeer interfaces.
      */
-    private LWWindowPeer createDelegatedPeer(Window target, PlatformComponent platformComponent,
-                                             PlatformWindow platformWindow, LWWindowPeer.PeerType peerType)
-    {
+    protected LWWindowPeer createDelegatedPeer(Window target,
+                                               PlatformComponent platformComponent,
+                                               PlatformWindow platformWindow,
+                                               PeerType peerType) {
         LWWindowPeer peer = new LWWindowPeer(target, platformComponent, platformWindow, peerType);
         targetCreatedPeer(target, peer);
         peer.initialize();
         return peer;
     }
 
-    private LWLightweightFramePeer createDelegatedLwPeer(LightweightFrame target,
-                                                         PlatformComponent platformComponent,
-                                                         PlatformWindow platformWindow)
-    {
-        LWLightweightFramePeer peer = new LWLightweightFramePeer(target, platformComponent, platformWindow);
+    @Override
+    public final FramePeer createLightweightFrame(LightweightFrame target) {
+        PlatformComponent platformComponent = createLwPlatformComponent();
+        PlatformWindow platformWindow = createPlatformWindow(PeerType.LW_FRAME);
+        LWLightweightFramePeer peer = new LWLightweightFramePeer(target,
+                                                                 platformComponent,
+                                                                 platformWindow);
         targetCreatedPeer(target, peer);
         peer.initialize();
         return peer;
     }
 
     @Override
-    public FramePeer createLightweightFrame(LightweightFrame target) {
-        PlatformComponent platformComponent = createLwPlatformComponent();
-        PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.LW_FRAME);
-        return createDelegatedLwPeer(target, platformComponent, platformWindow);
+    public final WindowPeer createWindow(Window target) {
+        PlatformComponent platformComponent = createPlatformComponent();
+        PlatformWindow platformWindow = createPlatformWindow(PeerType.SIMPLEWINDOW);
+        return createDelegatedPeer(target, platformComponent, platformWindow, PeerType.SIMPLEWINDOW);
     }
 
     @Override
-    public WindowPeer createWindow(Window target) {
+    public final FramePeer createFrame(Frame target) {
         PlatformComponent platformComponent = createPlatformComponent();
-        PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.SIMPLEWINDOW);
-        return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.SIMPLEWINDOW);
-    }
-
-    @Override
-    public FramePeer createFrame(Frame target) {
-        PlatformComponent platformComponent = createPlatformComponent();
-        PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.FRAME);
-        return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.FRAME);
-    }
-
-    public LWWindowPeer createEmbeddedFrame(CEmbeddedFrame target) {
-        PlatformComponent platformComponent = createPlatformComponent();
-        PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.EMBEDDED_FRAME);
-        return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.EMBEDDED_FRAME);
-    }
-
-    public LWWindowPeer createEmbeddedFrame(CViewEmbeddedFrame target) {
-        PlatformComponent platformComponent = createPlatformComponent();
-        PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.VIEW_EMBEDDED_FRAME);
-        return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.VIEW_EMBEDDED_FRAME);
-    }
-
-
-    CPrinterDialogPeer createCPrinterDialog(CPrinterDialog target) {
-        PlatformComponent platformComponent = createPlatformComponent();
-        PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.DIALOG);
-        CPrinterDialogPeer peer = new CPrinterDialogPeer(target, platformComponent, platformWindow);
-        targetCreatedPeer(target, peer);
-        return peer;
+        PlatformWindow platformWindow = createPlatformWindow(PeerType.FRAME);
+        return createDelegatedPeer(target, platformComponent, platformWindow, PeerType.FRAME);
     }
 
     @Override
     public DialogPeer createDialog(Dialog target) {
-        if (target instanceof CPrinterDialog) {
-            return createCPrinterDialog((CPrinterDialog)target);
-        }
-
         PlatformComponent platformComponent = createPlatformComponent();
-        PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.DIALOG);
-        return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.DIALOG);
+        PlatformWindow platformWindow = createPlatformWindow(PeerType.DIALOG);
+        return createDelegatedPeer(target, platformComponent, platformWindow, PeerType.DIALOG);
     }
 
     @Override
-    public FileDialogPeer createFileDialog(FileDialog target) {
+    public final FileDialogPeer createFileDialog(FileDialog target) {
         FileDialogPeer peer = createFileDialogPeer(target);
         targetCreatedPeer(target, peer);
         return peer;
@@ -285,7 +256,7 @@
     // ---- LIGHTWEIGHT COMPONENT PEERS ---- //
 
     @Override
-    public ButtonPeer createButton(Button target) {
+    public final ButtonPeer createButton(Button target) {
         PlatformComponent platformComponent = createPlatformComponent();
         LWButtonPeer peer = new LWButtonPeer(target, platformComponent);
         targetCreatedPeer(target, peer);
@@ -294,7 +265,7 @@
     }
 
     @Override
-    public CheckboxPeer createCheckbox(Checkbox target) {
+    public final CheckboxPeer createCheckbox(Checkbox target) {
         PlatformComponent platformComponent = createPlatformComponent();
         LWCheckboxPeer peer = new LWCheckboxPeer(target, platformComponent);
         targetCreatedPeer(target, peer);
@@ -303,12 +274,7 @@
     }
 
     @Override
-    public CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target) {
-        throw new RuntimeException("not implemented");
-    }
-
-    @Override
-    public ChoicePeer createChoice(Choice target) {
+    public final ChoicePeer createChoice(Choice target) {
         PlatformComponent platformComponent = createPlatformComponent();
         LWChoicePeer peer = new LWChoicePeer(target, platformComponent);
         targetCreatedPeer(target, peer);
@@ -317,7 +283,7 @@
     }
 
     @Override
-    public LabelPeer createLabel(Label target) {
+    public final LabelPeer createLabel(Label target) {
         PlatformComponent platformComponent = createPlatformComponent();
         LWLabelPeer peer = new LWLabelPeer(target, platformComponent);
         targetCreatedPeer(target, peer);
@@ -326,7 +292,7 @@
     }
 
     @Override
-    public CanvasPeer createCanvas(Canvas target) {
+    public final CanvasPeer createCanvas(Canvas target) {
         PlatformComponent platformComponent = createPlatformComponent();
         LWCanvasPeer<?, ?> peer = new LWCanvasPeer<>(target, platformComponent);
         targetCreatedPeer(target, peer);
@@ -335,7 +301,7 @@
     }
 
     @Override
-    public ListPeer createList(List target) {
+    public final ListPeer createList(List target) {
         PlatformComponent platformComponent = createPlatformComponent();
         LWListPeer peer = new LWListPeer(target, platformComponent);
         targetCreatedPeer(target, peer);
@@ -344,22 +310,7 @@
     }
 
     @Override
-    public MenuPeer createMenu(Menu target) {
-        throw new RuntimeException("not implemented");
-    }
-
-    @Override
-    public MenuBarPeer createMenuBar(MenuBar target) {
-        throw new RuntimeException("not implemented");
-    }
-
-    @Override
-    public MenuItemPeer createMenuItem(MenuItem target) {
-        throw new RuntimeException("not implemented");
-    }
-
-    @Override
-    public PanelPeer createPanel(Panel target) {
+    public final PanelPeer createPanel(Panel target) {
         PlatformComponent platformComponent = createPlatformComponent();
         LWPanelPeer peer = new LWPanelPeer(target, platformComponent);
         targetCreatedPeer(target, peer);
@@ -368,12 +319,7 @@
     }
 
     @Override
-    public PopupMenuPeer createPopupMenu(PopupMenu target) {
-        throw new RuntimeException("not implemented");
-    }
-
-    @Override
-    public ScrollPanePeer createScrollPane(ScrollPane target) {
+    public final ScrollPanePeer createScrollPane(ScrollPane target) {
         PlatformComponent platformComponent = createPlatformComponent();
         LWScrollPanePeer peer = new LWScrollPanePeer(target, platformComponent);
         targetCreatedPeer(target, peer);
@@ -382,7 +328,7 @@
     }
 
     @Override
-    public ScrollbarPeer createScrollbar(Scrollbar target) {
+    public final ScrollbarPeer createScrollbar(Scrollbar target) {
         PlatformComponent platformComponent = createPlatformComponent();
         LWScrollBarPeer peer = new LWScrollBarPeer(target, platformComponent);
         targetCreatedPeer(target, peer);
@@ -391,7 +337,7 @@
     }
 
     @Override
-    public TextAreaPeer createTextArea(TextArea target) {
+    public final TextAreaPeer createTextArea(TextArea target) {
         PlatformComponent platformComponent = createPlatformComponent();
         LWTextAreaPeer peer = new LWTextAreaPeer(target, platformComponent);
         targetCreatedPeer(target, peer);
@@ -400,7 +346,7 @@
     }
 
     @Override
-    public TextFieldPeer createTextField(TextField target) {
+    public final TextFieldPeer createTextField(TextField target) {
         PlatformComponent platformComponent = createPlatformComponent();
         LWTextFieldPeer peer = new LWTextFieldPeer(target, platformComponent);
         targetCreatedPeer(target, peer);
@@ -411,56 +357,51 @@
     // ---- NON-COMPONENT PEERS ---- //
 
     @Override
-    public ColorModel getColorModel() throws HeadlessException {
-        return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getColorModel();
+    public final ColorModel getColorModel() throws HeadlessException {
+        return GraphicsEnvironment.getLocalGraphicsEnvironment()
+                                  .getDefaultScreenDevice()
+                                  .getDefaultConfiguration().getColorModel();
     }
 
     @Override
-    public boolean isDesktopSupported() {
+    public final boolean isDesktopSupported() {
         return true;
     }
 
     @Override
-    protected DesktopPeer createDesktopPeer(Desktop target) {
-       return new CDesktopPeer();
-    }
-
-    @Override
-    public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) {
-        DragSourceContextPeer dscp = CDragSourceContextPeer.createDragSourceContextPeer(dge);
-
-        return dscp;
-    }
-
-    @Override
-    public KeyboardFocusManagerPeer getKeyboardFocusManagerPeer() {
+    public final KeyboardFocusManagerPeer getKeyboardFocusManagerPeer() {
         return LWKeyboardFocusManagerPeer.getInstance();
     }
 
     @Override
-    public synchronized MouseInfoPeer getMouseInfoPeer() {
+    public final synchronized MouseInfoPeer getMouseInfoPeer() {
         if (mouseInfoPeer == null) {
             mouseInfoPeer = createMouseInfoPeerImpl();
         }
         return mouseInfoPeer;
     }
 
-    protected MouseInfoPeer createMouseInfoPeerImpl() {
+    protected final MouseInfoPeer createMouseInfoPeerImpl() {
         return new LWMouseInfoPeer();
     }
 
-    public PrintJob getPrintJob(Frame frame, String doctitle, Properties props) {
+    @Override
+    public final PrintJob getPrintJob(Frame frame, String doctitle,
+                                      Properties props) {
         return getPrintJob(frame, doctitle, null, null);
     }
 
-    public PrintJob getPrintJob(Frame frame, String doctitle, JobAttributes jobAttributes, PageAttributes pageAttributes) {
+    @Override
+    public final PrintJob getPrintJob(Frame frame, String doctitle,
+                                      JobAttributes jobAttributes,
+                                      PageAttributes pageAttributes) {
         if (GraphicsEnvironment.isHeadless()) {
             throw new IllegalArgumentException();
         }
 
         PrintJob2D printJob = new PrintJob2D(frame, doctitle, jobAttributes, pageAttributes);
 
-        if (printJob.printDialog() == false) {
+        if (!printJob.printDialog()) {
             printJob = null;
         }
 
@@ -468,27 +409,7 @@
     }
 
     @Override
-    public RobotPeer createRobot(Robot target, GraphicsDevice screen) {
-        throw new RuntimeException("not implemented");
-    }
-
-    @Override
-    public boolean isTraySupported() {
-        throw new RuntimeException("not implemented");
-    }
-
-    @Override
-    public SystemTrayPeer createSystemTray(SystemTray target) {
-        throw new RuntimeException("not implemented");
-    }
-
-    @Override
-    public TrayIconPeer createTrayIcon(TrayIcon target) {
-        throw new RuntimeException("not implemented");
-    }
-
-    @Override
-    public Clipboard getSystemClipboard() {
+    public final Clipboard getSystemClipboard() {
         SecurityManager security = System.getSecurityManager();
         if (security != null) {
             security.checkPermission(SecurityConstants.AWT.ACCESS_CLIPBOARD_PERMISSION);
@@ -502,7 +423,8 @@
         return clipboard;
     }
 
-    protected abstract SecurityWarningWindow createSecurityWarning(Window ownerWindow, LWWindowPeer ownerPeer);
+    protected abstract SecurityWarningWindow createSecurityWarning(
+            Window ownerWindow, LWWindowPeer ownerPeer);
 
     // ---- DELEGATES ---- //
 
@@ -511,7 +433,7 @@
     /*
      * Creates a delegate for the given peer type (window, frame, dialog, etc.)
      */
-    protected abstract PlatformWindow createPlatformWindow(LWWindowPeer.PeerType peerType);
+    protected abstract PlatformWindow createPlatformWindow(PeerType peerType);
 
     protected abstract PlatformComponent createPlatformComponent();
 
@@ -545,7 +467,7 @@
     }
 
     @Override
-    public void grab(final Window w) {
+    public final void grab(final Window w) {
         final Object peer = AWTAccessor.getComponentAccessor().getPeer(w);
         if (peer != null) {
             ((LWWindowPeer) peer).grab();
@@ -553,7 +475,7 @@
     }
 
     @Override
-    public void ungrab(final Window w) {
+    public final void ungrab(final Window w) {
         final Object peer = AWTAccessor.getComponentAccessor().getPeer(w);
         if (peer != null) {
             ((LWWindowPeer) peer).ungrab(false);
--- a/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -629,6 +629,7 @@
         final boolean isNewDevice = updateGraphicsDevice();
         if (resized || isNewDevice) {
             replaceSurfaceData();
+            updateMinimumSize();
         }
 
         // Third, COMPONENT_MOVED/COMPONENT_RESIZED/PAINT events
@@ -1046,7 +1047,9 @@
 
     @Override
     public final void displayChanged() {
-        updateGraphicsDevice();
+        if (updateGraphicsDevice()) {
+            updateMinimumSize();
+        }
         // Replace surface unconditionally, because internal state of the
         // GraphicsDevice could be changed.
         replaceSurfaceData();
--- a/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,16 +23,15 @@
  * questions.
  */
 
+
 package sun.lwawt.macosx;
 
-import sun.lwawt.LWToolkit;
-import sun.lwawt.LWWindowPeer;
-import sun.lwawt.macosx.CocoaConstants;
+import java.awt.AWTKeyStroke;
+import java.awt.Point;
+import java.awt.Toolkit;
 
 import sun.awt.EmbeddedFrame;
-
-import java.awt.*;
-import java.awt.event.*;
+import sun.lwawt.LWWindowPeer;
 
 public class CEmbeddedFrame extends EmbeddedFrame {
 
@@ -47,7 +46,7 @@
 
     public void addNotify() {
         if (getPeer() == null) {
-            LWToolkit toolkit = (LWToolkit)Toolkit.getDefaultToolkit();
+            LWCToolkit toolkit = (LWCToolkit)Toolkit.getDefaultToolkit();
             LWWindowPeer peer = toolkit.createEmbeddedFrame(this);
             setPeer(peer);
             responder = new CPlatformResponder(peer, true);
--- a/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,14 +22,17 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+
 package sun.lwawt.macosx;
 
 import java.awt.AWTKeyStroke;
 import java.awt.Toolkit;
 import java.lang.reflect.InvocationTargetException;
+
 import sun.awt.EmbeddedFrame;
-import sun.lwawt.LWToolkit;
 import sun.lwawt.LWWindowPeer;
+
 /*
  * The CViewEmbeddedFrame class is used in the SWT_AWT bridge.
  * This is a part of public API and should not be renamed or moved
@@ -48,7 +51,7 @@
     @Override
     public void addNotify() {
         if (getPeer() == null) {
-            LWToolkit toolkit = (LWToolkit) Toolkit.getDefaultToolkit();
+            LWCToolkit toolkit = (LWCToolkit) Toolkit.getDefaultToolkit();
             setPeer(toolkit.createEmbeddedFrame(this));
         }
         super.addNotify();
--- a/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Wed Apr 16 15:03:29 2014 -0700
@@ -33,6 +33,7 @@
 import java.awt.event.InvocationEvent;
 import java.awt.event.KeyEvent;
 import java.awt.im.InputMethodHighlight;
+import java.awt.im.spi.InputMethodDescriptor;
 import java.awt.peer.*;
 import java.lang.reflect.*;
 import java.net.URL;
@@ -43,6 +44,7 @@
 
 import sun.awt.*;
 import sun.awt.datatransfer.DataTransferer;
+import sun.java2d.opengl.OGLRenderQueue;
 import sun.lwawt.*;
 import sun.lwawt.LWWindowPeer.PeerType;
 import sun.security.action.GetBooleanAction;
@@ -50,7 +52,7 @@
 
 import sun.util.CoreResourceBundleControl;
 
-class NamedCursor extends Cursor {
+final class NamedCursor extends Cursor {
     NamedCursor(String name) {
         super(name);
     }
@@ -76,6 +78,7 @@
 
         ResourceBundle platformResources = java.security.AccessController.doPrivileged(
                 new java.security.PrivilegedAction<ResourceBundle>() {
+            @Override
             public ResourceBundle run() {
                 ResourceBundle platformResources = null;
                 try {
@@ -133,18 +136,20 @@
 
     private native void loadNativeColors(final int[] systemColors, final int[] appleColors);
 
+    @Override
     protected void loadSystemColors(final int[] systemColors) {
         if (systemColors == null) return;
         loadNativeColors(systemColors, appleColors);
     }
 
     private static class AppleSpecificColor extends Color {
-        int index;
-        public AppleSpecificColor(int index) {
+        private final int index;
+        AppleSpecificColor(int index) {
             super(appleColors[index]);
             this.index = index;
         }
 
+        @Override
         public int getRGB() {
             return appleColors[index];
         }
@@ -152,7 +157,6 @@
 
     /**
      * Returns Apple specific colors that we may expose going forward.
-     *
      */
     public static Color getAppleColor(int color) {
         return new AppleSpecificColor(color);
@@ -181,13 +185,44 @@
         } else if (peerType == PeerType.LW_FRAME) {
             return new CPlatformLWWindow();
         } else {
-            assert (peerType == PeerType.SIMPLEWINDOW || peerType == PeerType.DIALOG || peerType == PeerType.FRAME);
+            assert (peerType == PeerType.SIMPLEWINDOW
+                    || peerType == PeerType.DIALOG
+                    || peerType == PeerType.FRAME);
             return new CPlatformWindow();
         }
     }
 
+    LWWindowPeer createEmbeddedFrame(CEmbeddedFrame target) {
+        PlatformComponent platformComponent = createPlatformComponent();
+        PlatformWindow platformWindow = createPlatformWindow(PeerType.EMBEDDED_FRAME);
+        return createDelegatedPeer(target, platformComponent, platformWindow, PeerType.EMBEDDED_FRAME);
+    }
+
+    LWWindowPeer createEmbeddedFrame(CViewEmbeddedFrame target) {
+        PlatformComponent platformComponent = createPlatformComponent();
+        PlatformWindow platformWindow = createPlatformWindow(PeerType.VIEW_EMBEDDED_FRAME);
+        return createDelegatedPeer(target, platformComponent, platformWindow, PeerType.VIEW_EMBEDDED_FRAME);
+    }
+
+    private CPrinterDialogPeer createCPrinterDialog(CPrinterDialog target) {
+        PlatformComponent platformComponent = createPlatformComponent();
+        PlatformWindow platformWindow = createPlatformWindow(PeerType.DIALOG);
+        CPrinterDialogPeer peer = new CPrinterDialogPeer(target, platformComponent, platformWindow);
+        targetCreatedPeer(target, peer);
+        return peer;
+    }
+
     @Override
-    protected SecurityWarningWindow createSecurityWarning(Window ownerWindow, LWWindowPeer ownerPeer) {
+    public DialogPeer createDialog(Dialog target) {
+        if (target instanceof CPrinterDialog) {
+            return createCPrinterDialog((CPrinterDialog)target);
+        }
+        return super.createDialog(target);
+    }
+
+    @Override
+    protected SecurityWarningWindow createSecurityWarning(Window ownerWindow,
+                                                          LWWindowPeer ownerPeer) {
         return new CWarningWindow(ownerWindow, ownerPeer);
     }
 
@@ -239,13 +274,11 @@
         PopupMenuPeer peer = new CPopupMenu(target);
         targetCreatedPeer(target, peer);
         return peer;
-
     }
 
     @Override
     public SystemTrayPeer createSystemTray(SystemTray target) {
-        SystemTrayPeer peer = new CSystemTray();
-        return peer;
+        return new CSystemTray();
     }
 
     @Override
@@ -256,56 +289,63 @@
     }
 
     @Override
+    protected DesktopPeer createDesktopPeer(Desktop target) {
+        return new CDesktopPeer();
+    }
+
+    @Override
     public LWCursorManager getCursorManager() {
         return CCursorManager.getInstance();
     }
 
     @Override
-    public Cursor createCustomCursor(final Image cursor, final Point hotSpot, final String name) throws IndexOutOfBoundsException, HeadlessException {
+    public Cursor createCustomCursor(final Image cursor, final Point hotSpot,
+                                     final String name)
+            throws IndexOutOfBoundsException, HeadlessException {
         return new CCustomCursor(cursor, hotSpot, name);
     }
 
     @Override
-    public Dimension getBestCursorSize(final int preferredWidth, final int preferredHeight) throws HeadlessException {
+    public Dimension getBestCursorSize(final int preferredWidth,
+                                       final int preferredHeight)
+            throws HeadlessException {
         return CCustomCursor.getBestCursorSize(preferredWidth, preferredHeight);
     }
 
     @Override
     protected void platformCleanup() {
         // TODO Auto-generated method stub
-
     }
 
     @Override
     protected void platformInit() {
         // TODO Auto-generated method stub
-
     }
 
     @Override
     protected void platformRunMessage() {
         // TODO Auto-generated method stub
-
     }
 
     @Override
     protected void platformShutdown() {
         // TODO Auto-generated method stub
-
     }
 
     class OSXPlatformFont extends sun.awt.PlatformFont
     {
-        public OSXPlatformFont(String name, int style)
+        OSXPlatformFont(String name, int style)
         {
             super(name, style);
         }
+        @Override
         protected char getMissingGlyphCharacter()
         {
             // Follow up for real implementation
             return (char)0xfff8; // see http://developer.apple.com/fonts/LastResortFont/
         }
     }
+    @Override
     public FontPeer getFontPeer(String name, int style) {
         return new OSXPlatformFont(name, style);
     }
@@ -325,7 +365,7 @@
     @Override
     protected void initializeDesktopProperties() {
         super.initializeDesktopProperties();
-        Map <Object, Object> fontHints = new HashMap<Object, Object>();
+        Map <Object, Object> fontHints = new HashMap<>();
         fontHints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
         fontHints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
         desktopProperties.put(SunToolkit.DESKTOPFONTHINTS, fontHints);
@@ -346,14 +386,8 @@
         desktopProperties.put("DnD.Cursor.CopyNoDrop", new NamedCursor("DnD.Cursor.CopyNoDrop"));
         desktopProperties.put("DnD.Cursor.MoveNoDrop", new NamedCursor("DnD.Cursor.MoveNoDrop"));
         desktopProperties.put("DnD.Cursor.LinkNoDrop", new NamedCursor("DnD.Cursor.LinkNoDrop"));
-
     }
 
-
-/*
- * The method returns true if some events were processed during that timeout.
- * @see sun.awt.SunToolkit#syncNativeQueue(long)
- */
     @Override
     protected boolean syncNativeQueue(long timeout) {
         return nativeSyncQueue(timeout);
@@ -376,8 +410,11 @@
 
     @Override
     public void sync() {
-        // TODO Auto-generated method stub
-
+        // flush the OGL pipeline (this is a no-op if OGL is not enabled)
+        OGLRenderQueue.sync();
+        // setNeedsDisplay() selector was sent to the appropriate CALayer so now
+        // we have to flush the native selectors queue.
+        flushNativeSelectors();
     }
 
     @Override
@@ -397,6 +434,7 @@
      * as Num Lock on PC keyboards is called Clear, doesn't lock
      * anything and is used for entirely different purpose.
      */
+    @Override
     public boolean getLockingKeyState(int keyCode) throws UnsupportedOperationException {
         switch (keyCode) {
             case KeyEvent.VK_NUM_LOCK:
@@ -416,10 +454,12 @@
     //Set to true by default.
     private static boolean areExtraMouseButtonsEnabled = true;
 
+    @Override
     public boolean areExtraMouseButtonsEnabled() throws HeadlessException {
         return areExtraMouseButtonsEnabled;
     }
 
+    @Override
     public int getNumberOfButtons(){
         return BUTTONS;
     }
@@ -482,6 +522,7 @@
      * @see       java.awt.MenuShortcut
      * @since     JDK1.1
      */
+    @Override
     public int getMenuShortcutKeyMask() {
         return Event.META_MASK;
     }
@@ -515,8 +556,8 @@
                 ? getImageWithResolutionVariant(url, url2x) : super.getImage(url);
     }
 
-    static final String nsImagePrefix = "NSImage://";
-    protected Image checkForNSImage(final String imageName) {
+    private static final String nsImagePrefix = "NSImage://";
+    private Image checkForNSImage(final String imageName) {
         if (imageName == null) return null;
         if (!imageName.startsWith(nsImagePrefix)) return null;
         return CImage.getCreator().createImageFromName(imageName.substring(nsImagePrefix.length()));
@@ -535,8 +576,9 @@
         synchronized(ret) { return ret[0]; }
     }
 
-    public static <T> T invokeAndWait(final Callable<T> callable, Component component) throws Exception {
-        final CallableWrapper<T> wrapper = new CallableWrapper<T>(callable);
+    public static <T> T invokeAndWait(final Callable<T> callable,
+                                      Component component) throws Exception {
+        final CallableWrapper<T> wrapper = new CallableWrapper<>(callable);
         invokeAndWait(wrapper, component);
         return wrapper.getResult();
     }
@@ -546,10 +588,11 @@
         T object;
         Exception e;
 
-        public CallableWrapper(final Callable<T> callable) {
+        CallableWrapper(final Callable<T> callable) {
             this.callable = callable;
         }
 
+        @Override
         public void run() {
             try {
                 object = callable.call();
@@ -564,12 +607,16 @@
         }
     }
 
-    // Kicks an event over to the appropriate eventqueue and waits for it to finish
-    // To avoid deadlocking, we manually run the NSRunLoop while waiting
-    // Any selector invoked using ThreadUtilities performOnMainThread will be processed in doAWTRunLoop
-    // The InvocationEvent will call LWCToolkit.stopAWTRunLoop() when finished, which will stop our manual runloop
-    // Does not dispatch native events while in the loop
-    public static void invokeAndWait(Runnable runnable, Component component) throws InvocationTargetException {
+    /**
+     * Kicks an event over to the appropriate eventqueue and waits for it to
+     * finish To avoid deadlocking, we manually run the NSRunLoop while waiting
+     * Any selector invoked using ThreadUtilities performOnMainThread will be
+     * processed in doAWTRunLoop The InvocationEvent will call
+     * LWCToolkit.stopAWTRunLoop() when finished, which will stop our manual
+     * runloop Does not dispatch native events while in the loop
+     */
+    public static void invokeAndWait(Runnable runnable, Component component)
+            throws InvocationTargetException {
         final long mediator = createAWTRunLoopMediator();
 
         InvocationEvent invocationEvent =
@@ -604,7 +651,8 @@
         }
     }
 
-    public static void invokeLater(Runnable event, Component component) throws InvocationTargetException {
+    public static void invokeLater(Runnable event, Component component)
+            throws InvocationTargetException {
         final InvocationEvent invocationEvent =
                 new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), event);
 
@@ -633,16 +681,18 @@
         return getSystemEventQueueImpl();
     }
 
-
 // DnD support
 
-    public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException {
-        DragSourceContextPeer dscp = CDragSourceContextPeer.createDragSourceContextPeer(dge);
-
-        return dscp;
+    @Override
+    public DragSourceContextPeer createDragSourceContextPeer(
+            DragGestureEvent dge) throws InvalidDnDOperationException {
+        return CDragSourceContextPeer.createDragSourceContextPeer(dge);
     }
 
-    public <T extends DragGestureRecognizer> T createDragGestureRecognizer(Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl) {
+    @Override
+    public <T extends DragGestureRecognizer> T createDragGestureRecognizer(
+            Class<T> abstractRecognizerClass, DragSource ds, Component c,
+            int srcActions, DragGestureListener dgl) {
         DragGestureRecognizer dgr = null;
 
         // Create a new mouse drag gesture recognizer if we have a class match:
@@ -656,6 +706,7 @@
     /**
      * Returns the default keyboard locale of the underlying operating system
      */
+    @Override
     public Locale getDefaultKeyboardLocale() {
         Locale locale = CInputMethod.getNativeLocale();
 
@@ -666,7 +717,8 @@
         return locale;
     }
 
-    public java.awt.im.spi.InputMethodDescriptor getInputMethodAdapterDescriptor() {
+    @Override
+    public InputMethodDescriptor getInputMethodAdapterDescriptor() {
         if (sInputMethodDescriptor == null)
             sInputMethodDescriptor = new CInputMethodDescriptor();
 
@@ -682,12 +734,14 @@
      * @return style attribute map, or null
      * @since 1.3
      */
+    @Override
     public Map mapInputMethodHighlight(InputMethodHighlight highlight) {
         return CInputMethod.mapInputMethodHighlight(highlight);
     }
 
     /**
-     * Returns key modifiers used by Swing to set up a focus accelerator key stroke.
+     * Returns key modifiers used by Swing to set up a focus accelerator key
+     * stroke.
      */
     @Override
     public int getFocusAcceleratorKeyMask() {
@@ -695,8 +749,8 @@
     }
 
     /**
-     * Tests whether specified key modifiers mask can be used to enter a printable
-     * character.
+     * Tests whether specified key modifiers mask can be used to enter a
+     * printable character.
      */
     @Override
     public boolean isPrintableCharacterModifiersMask(int mods) {
@@ -717,15 +771,14 @@
      * Returns the value of "sun.awt.disableCALayers" property. Default
      * value is {@code false}.
      */
-    public synchronized static boolean getSunAwtDisableCALayers() {
+    public static synchronized boolean getSunAwtDisableCALayers() {
         if (sunAwtDisableCALayers == null) {
             sunAwtDisableCALayers = AccessController.doPrivileged(
                 new GetBooleanAction("sun.awt.disableCALayers"));
         }
-        return sunAwtDisableCALayers.booleanValue();
+        return sunAwtDisableCALayers;
     }
 
-
     /*
      * Returns true if the application (one of its windows) owns keyboard focus.
      */
@@ -750,11 +803,16 @@
     static void doAWTRunLoop(long mediator, boolean processEvents) {
         doAWTRunLoopImpl(mediator, processEvents, inAWT);
     }
-    static private native void doAWTRunLoopImpl(long mediator, boolean processEvents, boolean inAWT);
+    private static native void doAWTRunLoopImpl(long mediator, boolean processEvents, boolean inAWT);
     static native void stopAWTRunLoop(long mediator);
 
     private native boolean nativeSyncQueue(long timeout);
 
+    /**
+     * Just spin a single empty block synchronously.
+     */
+    private static native void flushNativeSelectors();
+
     @Override
     public Clipboard createPlatformClipboard() {
         return new CClipboard("System");
@@ -794,6 +852,7 @@
         return true;
     }
 
+    @Override
     public boolean isSwingBackbufferTranslucencySupported() {
         return true;
     }
--- a/src/macosx/native/com/apple/laf/AquaFileView.m	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/native/com/apple/laf/AquaFileView.m	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,9 @@
  * questions.
  */
 
+
+#include <jni_util.h>
+
 #import "com_apple_laf_AquaFileView.h"
 
 #import <sys/param.h> // for MAXPATHLEN
@@ -98,6 +101,7 @@
 JNF_COCOA_ENTER(env);
 
     jbyte *byteArray = (*env)->GetByteArrayElements(env, absolutePath, NULL);
+    CHECK_NULL_RETURN(byteArray, returnValue);
     jsize length = (*env)->GetArrayLength(env, absolutePath);
 
     // Can't assume that byteArray is NULL terminated and FSPathMakeRef doesn't
@@ -138,6 +142,7 @@
 JNF_COCOA_ENTER(env);
 
     jbyte *byteArray = (*env)->GetByteArrayElements(env, absolutePath, NULL);
+    CHECK_NULL_RETURN(byteArray, returnValue);
     jsize length = (*env)->GetArrayLength(env, absolutePath);
 
     // Can't assume that byteArray is NULL terminated and FSPathMakeRef doesn't
@@ -153,7 +158,9 @@
     Boolean isDirectory = (isDir == JNI_TRUE ? true : false);
     FSRef ref;
 
-    OSErr theErr = FSPathMakeRefWithOptions((const UInt8 *)&arrayCopy, kFSPathMakeRefDoNotFollowLeafSymlink, &ref, &isDirectory);
+    OSErr theErr = FSPathMakeRefWithOptions((const UInt8 *)&arrayCopy,
+                                            kFSPathMakeRefDoNotFollowLeafSymlink,
+                                            &ref, &isDirectory);
     if (theErr == noErr) {
         CFStringRef displayName = NULL;
 
@@ -190,6 +197,7 @@
     size_t maxPathLen = sizeof(pathCString) - 1;
 
     jbyte *byteArray = (*env)->GetByteArrayElements(env, pathToAlias, NULL);
+    CHECK_NULL_RETURN(byteArray, returnValue);
     jsize length = (*env)->GetArrayLength(env, pathToAlias);
 
     if (length > maxPathLen) {
@@ -205,7 +213,8 @@
     OSErr theErr = FSPathMakeRef(pathCString, &fileRef, &isDirectory);
 
     Boolean ignored;
-    theErr = FSResolveAliasFileWithMountFlags(&fileRef, false, &ignored, &ignored, kResolveAliasFileNoUI);
+    theErr = FSResolveAliasFileWithMountFlags(&fileRef, false, &ignored,
+                                              &ignored, kResolveAliasFileNoUI);
     if (theErr == noErr) {
         UInt8 resolvedPath[MAXPATHLEN];
         theErr = FSRefMakePath(&fileRef, resolvedPath, MAXPATHLEN);
--- a/src/macosx/native/com/apple/laf/JRSUIController.m	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/native/com/apple/laf/JRSUIController.m	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -199,7 +199,7 @@
     CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
     CGContextRef cgRef = CGBitmapContextCreate(rawPixelData, imgW, imgH, 8, imgW * 4, colorspace, kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host);
     CGColorSpaceRelease(colorspace);
-    CGContextScaleCTM(cgRef, imgW/w , imgH/h);
+    CGContextScaleCTM(cgRef, imgW/(w + x + x) , imgH/(h + y + y));
 
     jint status = doPaintCGContext(cgRef, controlPtr, oldProperties, newProperties, x, y, w, h);
     CGContextRelease(cgRef);
--- a/src/macosx/native/sun/awt/AWTEvent.m	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/native/sun/awt/AWTEvent.m	Wed Apr 16 15:03:29 2014 -0700
@@ -28,6 +28,7 @@
 #import <sys/time.h>
 #include <Carbon/Carbon.h>
 
+#import "jni_util.h" 
 #import "LWCToolkit.h"
 #import "ThreadUtilities.h"
 
@@ -687,6 +688,7 @@
 
     jboolean copy = JNI_FALSE;
     jint *data = (*env)->GetIntArrayElements(env, inData, &copy);
+    CHECK_NULL_RETURN(data, postsTyped);
 
     // in  = [testChar, testDeadChar, modifierFlags, keyCode]
     jchar testChar = (jchar)data[0];
@@ -727,6 +729,7 @@
 
     jboolean copy = JNI_FALSE;
     jint *data = (*env)->GetIntArrayElements(env, inData, &copy);
+    CHECK_NULL(data);
 
     // in  = [modifierFlags, keyCode]
     jint modifierFlags = data[0];
--- a/src/macosx/native/sun/awt/AWTView.m	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/native/sun/awt/AWTView.m	Wed Apr 16 15:03:29 2014 -0700
@@ -1081,21 +1081,22 @@
     jarray array;
     jboolean isCopy;
     jint *_array;
-    NSRange range;
+    NSRange range = NSMakeRange(NSNotFound, 0);
 
     array = JNFCallObjectMethod(env, fInputMethodLOCKABLE, jm_markedRange); // AWT_THREADING Safe (AWTRunLoopMode)
 
     if (array) {
         _array = (*env)->GetIntArrayElements(env, array, &isCopy);
-        range = NSMakeRange(_array[0], _array[1]);
-
+        if (_array != NULL) {
+            range.location = _array[0];
+            range.length = _array[1];
 #ifdef IM_DEBUG
-        fprintf(stderr, "markedRange returning (%lu, %lu)\n", (unsigned long)range.location, (unsigned long)range.length);
+            fprintf(stderr, "markedRange returning (%lu, %lu)\n",
+                    (unsigned long)range.location, (unsigned long)range.length);
 #endif // IM_DEBUG
-        (*env)->ReleaseIntArrayElements(env, array, _array, 0);
+            (*env)->ReleaseIntArrayElements(env, array, _array, 0);
+        }
         (*env)->DeleteLocalRef(env, array);
-    } else {
-        range = NSMakeRange(NSNotFound, 0);
     }
 
     return range;
@@ -1115,7 +1116,7 @@
     jarray array;
     jboolean isCopy;
     jint *_array;
-    NSRange range;
+    NSRange range = NSMakeRange(NSNotFound, 0);
 
 #ifdef IM_DEBUG
     fprintf(stderr, "AWTView InputMethod Selector Called : [selectedRange]\n");
@@ -1124,15 +1125,15 @@
     array = JNFCallObjectMethod(env, fInputMethodLOCKABLE, jm_selectedRange); // AWT_THREADING Safe (AWTRunLoopMode)
     if (array) {
         _array = (*env)->GetIntArrayElements(env, array, &isCopy);
-        range = NSMakeRange(_array[0], _array[1]);
-        (*env)->ReleaseIntArrayElements(env, array, _array, 0);
+        if (_array != NULL) {
+            range.location = _array[0];
+            range.length = _array[1];
+            (*env)->ReleaseIntArrayElements(env, array, _array, 0);
+        }
         (*env)->DeleteLocalRef(env, array);
-    } else {
-        range = NSMakeRange(NSNotFound, 0);
     }
 
     return range;
-
 }
 
 /* This method returns the first frame of rects for theRange in screen coordindate system.
@@ -1140,7 +1141,7 @@
 - (NSRect) firstRectForCharacterRange:(NSRange)theRange actualRange:(NSRangePointer)actualRange
 {
     if (!fInputMethodLOCKABLE) {
-        return NSMakeRect(0, 0, 0, 0);
+        return NSZeroRect;
     }
 
     static JNF_MEMBER_CACHE(jm_firstRectForCharacterRange, jc_CInputMethod,
@@ -1152,18 +1153,27 @@
     NSRect rect;
 
 #ifdef IM_DEBUG
-    fprintf(stderr, "AWTView InputMethod Selector Called : [firstRectForCharacterRange:] location=%lu, length=%lu\n", (unsigned long)theRange.location, (unsigned long)theRange.length);
+    fprintf(stderr,
+            "AWTView InputMethod Selector Called : [firstRectForCharacterRange:] location=%lu, length=%lu\n",
+            (unsigned long)theRange.location, (unsigned long)theRange.length);
 #endif // IM_DEBUG
 
-    array = JNFCallObjectMethod(env, fInputMethodLOCKABLE, jm_firstRectForCharacterRange, theRange.location); // AWT_THREADING Safe (AWTRunLoopMode)
+    array = JNFCallObjectMethod(env, fInputMethodLOCKABLE, jm_firstRectForCharacterRange,
+                                theRange.location); // AWT_THREADING Safe (AWTRunLoopMode)
 
     _array = (*env)->GetIntArrayElements(env, array, &isCopy);
-    rect = ConvertNSScreenRect(env, NSMakeRect(_array[0], _array[1], _array[2], _array[3]));
-    (*env)->ReleaseIntArrayElements(env, array, _array, 0);
+    if (_array) {
+        rect = ConvertNSScreenRect(env, NSMakeRect(_array[0], _array[1], _array[2], _array[3]));
+        (*env)->ReleaseIntArrayElements(env, array, _array, 0);
+    } else {
+        rect = NSZeroRect;
+    }
     (*env)->DeleteLocalRef(env, array);
 
 #ifdef IM_DEBUG
-    fprintf(stderr, "firstRectForCharacterRange returning x=%f, y=%f, width=%f, height=%f\n", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
+    fprintf(stderr,
+            "firstRectForCharacterRange returning x=%f, y=%f, width=%f, height=%f\n",
+            rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
 #endif // IM_DEBUG
     return rect;
 }
--- a/src/macosx/native/sun/awt/CClipboard.m	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/native/sun/awt/CClipboard.m	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,14 +23,13 @@
  * questions.
  */
 
-#include "CClipboard.h"
-#include "CDataTransferer.h"
+#import "CClipboard.h"
+#import "CDataTransferer.h"
+#import "ThreadUtilities.h"
+#import "jni_util.h" 
 #import <Cocoa/Cocoa.h>
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
 
-#include "ThreadUtilities.h"
-
-
 static CClipboard *sClipboard = nil;
 
 //
@@ -246,6 +245,7 @@
 JNF_COCOA_ENTER(env);
     jint nBytes = (*env)->GetArrayLength(env, inBytes);
     jbyte *rawBytes = (*env)->GetPrimitiveArrayCritical(env, inBytes, NULL);
+    CHECK_NULL(rawBytes);
     NSData *bytesAsData = [NSData dataWithBytes:rawBytes length:nBytes];
     (*env)->ReleasePrimitiveArrayCritical(env, inBytes, rawBytes, JNI_ABORT);
     NSString *format = formatForIndex(inFormat);
--- a/src/macosx/native/sun/awt/CFileDialog.m	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/native/sun/awt/CFileDialog.m	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -223,9 +223,8 @@
         NSArray *urls = [dialogDelegate URLs];
         jsize count = [urls count];
 
-        jclass stringClass = (*env)->FindClass(env, "java/lang/String");
-        returnValue = (*env)->NewObjectArray(env, count, stringClass, NULL);
-        (*env)->DeleteLocalRef(env, stringClass);
+        static JNF_CLASS_CACHE(jc_String, "java/lang/String");
+        returnValue = JNFNewObjectArray(env, &jc_String, count);
 
         [urls enumerateObjectsUsingBlock:^(id url, NSUInteger index, BOOL *stop) {
             jstring filename = JNFNormalizedJavaStringForPath(env, [url path]);
--- a/src/macosx/native/sun/awt/CGraphicsEnv.m	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/native/sun/awt/CGraphicsEnv.m	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
 
+#import "jni_util.h"
 #import "LWCToolkit.h"
 #import "AWT_debug.h"
 
@@ -64,7 +65,7 @@
 
     /* Get the count */
     CGDisplayCount displayCount;
-    if (CGGetActiveDisplayList(MAX_DISPLAYS, NULL, &displayCount) != kCGErrorSuccess) {
+    if (CGGetOnlineDisplayList(MAX_DISPLAYS, NULL, &displayCount) != kCGErrorSuccess) {
         [JNFException raise:env
                          as:kInternalError
                      reason:"CGGetOnlineDisplayList() failed to get display count"];
@@ -73,23 +74,36 @@
 
     /* Allocate an array and get the size list of display Ids */
     CGDirectDisplayID displays[MAX_DISPLAYS];
-    if (CGGetActiveDisplayList(displayCount, displays, &displayCount) != kCGErrorSuccess) {
+    if (CGGetOnlineDisplayList(displayCount, displays, &displayCount) != kCGErrorSuccess) {
         [JNFException raise:env
                          as:kInternalError
                      reason:"CGGetOnlineDisplayList() failed to get display list"];
         return NULL;
     }
 
+    CGDisplayCount i;
+    CGDisplayCount displayActiveCount = 0; //Active and sleeping.
+    for (i = 0; i < displayCount; ++i) {
+        if (CGDisplayMirrorsDisplay(displays[i]) == kCGNullDirectDisplay) {
+            ++displayActiveCount;
+        } else {
+            displays[i] = kCGNullDirectDisplay;
+        }
+    }
+
     /* Allocate a java array for display identifiers */
-    ret = JNFNewIntArray(env, displayCount);
+    ret = JNFNewIntArray(env, displayActiveCount);
 
     /* Initialize and return the backing int array */
     assert(sizeof(jint) >= sizeof(CGDirectDisplayID));
     jint *elems = (*env)->GetIntArrayElements(env, ret, 0);
+    CHECK_NULL_RETURN(elems, NULL);
 
-    CGDisplayCount i;
-    for (i = 0; i < displayCount; i++) {
-        elems[i] = displays[i];
+    /* Filter out the mirrored displays */
+    for (i = 0; i < displayCount; ++i) {
+        if (displays[i] != kCGNullDirectDisplay) {
+            elems[--displayActiveCount] = displays[i];
+        }
     }
 
     (*env)->ReleaseIntArrayElements(env, ret, elems, 0);
--- a/src/macosx/native/sun/awt/CImage.m	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/native/sun/awt/CImage.m	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -147,21 +147,23 @@
     NSMutableArray * reps = [NSMutableArray arrayWithCapacity: num];
 
     jint * ws = (*env)->GetIntArrayElements(env, widths, NULL);
-    jint * hs = (*env)->GetIntArrayElements(env, heights, NULL);
+    if (ws != NULL) {
+        jint * hs = (*env)->GetIntArrayElements(env, heights, NULL);
+        if (hs != NULL) {
+            jsize i;
+            for (i = 0; i < num; i++) {
+                jintArray buffer = (*env)->GetObjectArrayElement(env, buffers, i);
 
-    jsize i;
-    for (i = 0; i < num; i++) {
-        jintArray buffer = (*env)->GetObjectArrayElement(env, buffers, i);
+                NSBitmapImageRep* imageRep = CImage_CreateImageRep(env, buffer, ws[i], hs[i]);
+                if (imageRep) {
+                    [reps addObject: imageRep];
+                }
+            }
 
-        NSBitmapImageRep* imageRep = CImage_CreateImageRep(env, buffer, ws[i], hs[i]);
-        if (imageRep) {
-            [reps addObject: imageRep];
+            (*env)->ReleaseIntArrayElements(env, heights, hs, JNI_ABORT);
         }
+        (*env)->ReleaseIntArrayElements(env, widths, ws, JNI_ABORT);
     }
-
-    (*env)->ReleaseIntArrayElements(env, heights, hs, JNI_ABORT);
-    (*env)->ReleaseIntArrayElements(env, widths, ws, JNI_ABORT);
-
     if ([reps count]) {
         NSImage *nsImage = [[NSImage alloc] initWithSize:NSMakeSize(0, 0)];
         [nsImage addRepresentations: reps];
--- a/src/macosx/native/sun/awt/CInputMethod.m	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/native/sun/awt/CInputMethod.m	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -70,17 +70,23 @@
     }
 
     // Create the java.util.Locale object
+    jobject localeObj = NULL;
     jobject langObj = (*env)->NewStringUTF(env, language);
-    jobject ctryObj = (*env)->NewStringUTF(env, country);
-    jobject vrntObj = (*env)->NewStringUTF(env, variant);
-    jobject localeObj = JNFNewObject(env, jm_localeCons, langObj, ctryObj, vrntObj); // AWT_THREADING Safe (known object)
-
+    if (langObj != NULL) {
+        jobject ctryObj = (*env)->NewStringUTF(env, country);
+        if(ctryObj != NULL) {
+            jobject vrntObj = (*env)->NewStringUTF(env, variant);
+            if (vrntObj != NULL) {
+                localeObj = JNFNewObject(env, jm_localeCons,langObj, ctryObj,
+                                         vrntObj);
+                (*env)->DeleteLocalRef(env, vrntObj);
+            }
+            (*env)->DeleteLocalRef(env, ctryObj);
+        }
+        (*env)->DeleteLocalRef(env, langObj);
+    }
     // Clean up and return.
     free(language);
-    (*env)->DeleteLocalRef(env, langObj);
-    (*env)->DeleteLocalRef(env, ctryObj);
-    (*env)->DeleteLocalRef(env, vrntObj);
-
     return localeObj;
 }
 
@@ -234,10 +240,12 @@
 
         if (sLastKeyboardLocaleObj) {
             JNFDeleteGlobalRef(env, sLastKeyboardLocaleObj);
+            sLastKeyboardLocaleObj = NULL;
         }
-
-        sLastKeyboardLocaleObj = JNFNewGlobalRef(env, localObj);
-        (*env)->DeleteLocalRef(env, localObj);
+        if (localObj != NULL) {
+            sLastKeyboardLocaleObj = JNFNewGlobalRef(env, localObj);
+            (*env)->DeleteLocalRef(env, localObj);
+        }
     }
 
     returnValue = sLastKeyboardLocaleObj;
@@ -305,9 +313,12 @@
 
     for(NSString *locale in selectableArray) {
         jobject localeObj = CreateLocaleObjectFromNSString(env, locale);
+        if (localeObj == NULL) {
+            break;
+        }
 
-        if (JNFCallBooleanMethod(env, returnValue, jm_listContains, localeObj) == JNI_FALSE) { // AWT_THREADING Safe (known object)
-            JNFCallBooleanMethod(env, returnValue, jm_listAdd, localeObj); // AWT_THREADING Safe (known object)
+        if (JNFCallBooleanMethod(env, returnValue, jm_listContains, localeObj) == JNI_FALSE) {
+            JNFCallBooleanMethod(env, returnValue, jm_listAdd, localeObj);
         }
 
         (*env)->DeleteLocalRef(env, localeObj);
--- a/src/macosx/native/sun/awt/CRobot.m	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/native/sun/awt/CRobot.m	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,9 @@
  * questions.
  */
 
+
+#import "jni_util.h"
+
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
 #import <ApplicationServices/ApplicationServices.h>
 
@@ -342,6 +345,7 @@
 
     // get a pointer to the Java int array
     void *jPixelData = (*env)->GetPrimitiveArrayCritical(env, pixels, 0);
+    CHECK_NULL(jPixelData);
 
     // create a graphics context around the Java int array
     CGColorSpaceRef picColorSpace = CGColorSpaceCreateWithName(
--- a/src/macosx/native/sun/awt/JavaComponentAccessibility.m	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/native/sun/awt/JavaComponentAccessibility.m	Wed Apr 16 15:03:29 2014 -0700
@@ -256,11 +256,15 @@
         jsize count = [ignoredKeys count];
 
         JNIEnv *env = [ThreadUtilities getJNIEnv];
-        jclass clazz = (*env)->FindClass(env, "java/lang/String");
-        result = (*env)->NewObjectArray(env, count, clazz, NULL); // AWT_THREADING Safe (known object)
-        (*env)->DeleteLocalRef(env, clazz);
 
-        NSUInteger i;
+        static JNF_CLASS_CACHE(jc_String, "java/lang/String");
+        result = JNFNewObjectArray(env, &jc_String, count);
+        if (!result) {
+            NSLog(@"In %s, can't create Java array of String objects", __FUNCTION__);
+            return;
+        }
+
+        NSInteger i;
         for (i = 0; i < count; i++) {
             jstring jString = JNFNSToJavaString(env, [ignoredKeys objectAtIndex:i]);
             (*env)->SetObjectArrayElement(env, result, i, jString);
@@ -295,7 +299,7 @@
     jsize arrayLen = (*env)->GetArrayLength(env, jchildrenAndRoles);
     NSMutableArray *children = [NSMutableArray arrayWithCapacity:arrayLen/2]; //childrenAndRoles array contains two elements (child, role) for each child
 
-    NSUInteger i;
+    NSInteger i;
     NSUInteger childIndex = (whichChildren >= 0) ? whichChildren : 0; // if we're getting one particular child, make sure to set its index correctly
     for(i = 0; i < arrayLen; i+=2)
     {
@@ -391,8 +395,13 @@
     // Get all the other accessibility attributes states we need in one swell foop.
     // javaRole isn't pulled in because we need protected access to AccessibleRole.key
     jbooleanArray attributeStates = JNFCallStaticObjectMethod(env, jm_getInitialAttributeStates, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop)
-    if (attributeStates == NULL) return NULL;
+    if (attributeStates == NULL) return nil;
     jboolean *attributeStatesArray = (*env)->GetBooleanArrayElements(env, attributeStates, 0);
+    if (attributeStatesArray == NULL) {
+        // Note: Java will not be on the stack here so a java exception can't happen and no need to call ExceptionCheck.
+        NSLog(@"%s failed calling GetBooleanArrayElements", __FUNCTION__);
+        return nil;
+    }
 
     // if there's a component, it can be enabled and it has a size/position
     if (attributeStatesArray[0]) {
@@ -1220,7 +1229,7 @@
     // Go through the tabs and find selAccessible
     _numTabs = [tabs count];
     JavaComponentAccessibility *aTab;
-    NSUInteger i;
+    NSInteger i;
     for (i = 0; i < _numTabs; i++) {
         aTab = (JavaComponentAccessibility *)[tabs objectAtIndex:i];
         if ([aTab isAccessibleWithEnv:env forAccessible:selAccessible]) {
@@ -1247,7 +1256,7 @@
 
     NSString *tabJavaRole = JNFJavaToNSString(env, JNFGetObjectField(env, jtabJavaRole, sjf_key));
 
-    NSUInteger i;
+    NSInteger i;
     NSUInteger tabIndex = (whichTabs >= 0) ? whichTabs : 0; // if we're getting one particular child, make sure to set its index correctly
     for(i = 0; i < arrayLen; i+=2) {
         jobject jtab = (*env)->GetObjectArrayElement(env, jtabsAndRoles, i);
--- a/src/macosx/native/sun/awt/JavaTextAccessibility.m	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/native/sun/awt/JavaTextAccessibility.m	Wed Apr 16 15:03:29 2014 -0700
@@ -40,6 +40,11 @@
  */
 NSValue *javaIntArrayToNSRangeValue(JNIEnv* env, jintArray array) {
     jint *values = (*env)->GetIntArrayElements(env, array, 0);
+    if (values == NULL) {
+        // Note: Java will not be on the stack here so a java exception can't happen and no need to call ExceptionCheck.
+        NSLog(@"%s failed calling GetIntArrayElements", __FUNCTION__);
+        return nil;
+    };
     NSValue *value = [NSValue valueWithRange:NSMakeRange(values[0], values[1] - values[0])];
     (*env)->ReleaseIntArrayElements(env, array, values, 0);
     return value;
@@ -285,6 +290,11 @@
 
     // We cheat because we know that the array is 4 elements long (x, y, width, height)
     jdouble *values = (*env)->GetDoubleArrayElements(env, axBounds, 0);
+    if (values == NULL) {
+        // Note: Java will not be on the stack here so a java exception can't happen and no need to call ExceptionCheck.
+        NSLog(@"%s failed calling GetDoubleArrayElements", __FUNCTION__); 
+        return nil;
+    };
     NSRect bounds;
     bounds.origin.x = values[0];
     bounds.origin.y = [[[[self view] window] screen] frame].size.height - values[1] - values[3]; //values[1] is y-coord from top-left of screen. Flip. Account for the height (values[3]) when flipping
--- a/src/macosx/native/sun/awt/LWCToolkit.m	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/native/sun/awt/LWCToolkit.m	Wed Apr 16 15:03:29 2014 -0700
@@ -111,6 +111,18 @@
     return JNI_FALSE;
 }
 
+/*
+ * Class:     sun_lwawt_macosx_LWCToolkit
+ * Method:    flushNativeSelectors
+ * Signature: ()J
+ */
+JNIEXPORT void JNICALL Java_sun_lwawt_macosx_LWCToolkit_flushNativeSelectors
+(JNIEnv *env, jclass clz)
+{
+JNF_COCOA_ENTER(env);
+        [ThreadUtilities performOnMainThreadWaiting:YES block:^(){}];
+JNF_COCOA_EXIT(env);
+}
 
 static JNF_CLASS_CACHE(jc_Component, "java/awt/Component");
 static JNF_MEMBER_CACHE(jf_Component_appContext, jc_Component, "appContext", "Lsun/awt/AppContext;");
--- a/src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -433,18 +433,18 @@
 }
 
 JNIEXPORT jint JNICALL
-Java_sun_java2d_opengl_CGLGraphicsConfig_getMaxTextureSize
+Java_sun_java2d_opengl_CGLGraphicsConfig_nativeGetMaxTextureSize
     (JNIEnv *env, jclass cglgc)
 {
-    J2dTraceLn(J2D_TRACE_INFO, "CGLGraphicsConfig_getMaxTextureSize");
+    J2dTraceLn(J2D_TRACE_INFO, "CGLGraphicsConfig_nativeGetMaxTextureSize");
 
     __block int max = 0;
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         [sharedContext makeCurrentContext];
         j2d_glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max);
+        [NSOpenGLContext clearCurrentContext];
     }];
 
     return (jint)max;
 }
-
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifScrollBarUI.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifScrollBarUI.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2003, 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
@@ -24,17 +24,19 @@
  */
 package com.sun.java.swing.plaf.motif;
 
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.plaf.*;
-import javax.swing.border.*;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.Rectangle;
+
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JScrollBar;
+import javax.swing.plaf.ComponentUI;
 import javax.swing.plaf.basic.BasicScrollBarUI;
 
-import java.awt.Dimension;
-import java.awt.Insets;
-import java.awt.Rectangle;
-import java.awt.Graphics;
-import java.awt.Color;
+import static sun.swing.SwingUtilities2.drawHLine;
+import static sun.swing.SwingUtilities2.drawVLine;
 
 
 /**
@@ -74,17 +76,13 @@
         return new MotifScrollBarButton(orientation);
     }
 
-
     public void paintTrack(Graphics g, JComponent c, Rectangle trackBounds)  {
         g.setColor(trackColor);
         g.fillRect(trackBounds.x, trackBounds.y, trackBounds.width, trackBounds.height);
     }
 
-
-    public void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
-    {
-
-        if(thumbBounds.isEmpty() || !scrollbar.isEnabled())     {
+    public void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) {
+        if (thumbBounds.isEmpty() || !scrollbar.isEnabled()) {
             return;
         }
 
@@ -93,15 +91,15 @@
 
         g.translate(thumbBounds.x, thumbBounds.y);
         g.setColor(thumbColor);
-        g.fillRect(0, 0, w-1, h-1);
+        g.fillRect(0, 0, w - 1, h - 1);
 
         g.setColor(thumbHighlightColor);
-        g.drawLine(0, 0, 0, h-1);
-        g.drawLine(1, 0, w-1, 0);
+        drawVLine(g, 0, 0, h - 1);
+        drawHLine(g, 1, w - 1, 0);
 
         g.setColor(thumbLightShadowColor);
-        g.drawLine(1, h-1, w-1, h-1);
-        g.drawLine(w-1, 1, w-1, h-2);
+        drawHLine(g, 1, w - 1, h - 1);
+        drawVLine(g, w - 1, 1, h - 2);
 
         g.translate(-thumbBounds.x, -thumbBounds.y);
     }
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifSliderUI.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifSliderUI.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,14 +25,17 @@
 
 package com.sun.java.swing.plaf.motif;
 
-import java.awt.*;
-import java.awt.event.*;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Rectangle;
 
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.plaf.*;
+import javax.swing.JComponent;
+import javax.swing.JSlider;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicSliderUI;
 
-import javax.swing.plaf.basic.BasicSliderUI;
+import static sun.swing.SwingUtilities2.drawHLine;
+import static sun.swing.SwingUtilities2.drawVLine;
 
 /**
  * Motif Slider
@@ -123,15 +126,15 @@
 
             // highlight
             g.setColor(getHighlightColor());
-            g.drawLine(0, 1, w - 1, 1);             // top
-            g.drawLine(0, 1, 0, h);                     // left
-            g.drawLine(w/2, 2, w/2, h-1);       // center
+            drawHLine(g, 0, w - 1, 1);      // top
+            drawVLine(g, 0, 1, h);          // left
+            drawVLine(g, w / 2, 2, h - 1);  // center
 
             // shadow
             g.setColor(getShadowColor());
-            g.drawLine(0, h, w - 1, h);         // bottom
-            g.drawLine(w - 1, 1, w - 1, h);     // right
-            g.drawLine(w/2 - 1, 2, w/2 - 1, h); // center
+            drawHLine(g, 0, w - 1, h);      // bottom
+            drawVLine(g, w - 1, 1, h);      // right
+            drawVLine(g, w / 2 - 1, 2, h);  // center
 
             g.translate(-x, -(knobBounds.y-1));
         }
@@ -143,15 +146,15 @@
 
             // highlight
             g.setColor(getHighlightColor());
-            g.drawLine(1, y, w, y);                     // top
-            g.drawLine(1, y+1, 1, y+h-1);               // left
-            g.drawLine(2, y+h/2, w-1, y+h/2);           // center
+            drawHLine(g, 1, w, y);             // top
+            drawVLine(g, 1, y + 1, y + h - 1); // left
+            drawHLine(g, 2, w - 1, y + h / 2); // center
 
             // shadow
             g.setColor(getShadowColor());
-            g.drawLine(2, y+h-1, w, y+h-1);             // bottom
-            g.drawLine(w, y+h-1, w, y);                 // right
-            g.drawLine(2, y+h/2-1, w-1, y+h/2-1);       // center
+            drawHLine(g, 2, w, y + h - 1);        // bottom
+            drawVLine(g, w, y + h - 1, y);        // right
+            drawHLine(g, 2, w - 1, y + h / 2 - 1);// center
 
             g.translate(-(knobBounds.x-1), 0);
         }
--- a/src/share/classes/java/awt/Component.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/awt/Component.java	Wed Apr 16 15:03:29 2014 -0700
@@ -26,10 +26,10 @@
 
 import java.io.PrintStream;
 import java.io.PrintWriter;
+import java.util.Objects;
 import java.util.Vector;
 import java.util.Locale;
 import java.util.EventListener;
-import java.util.Iterator;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
@@ -50,8 +50,6 @@
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeSupport;
 import java.beans.Transient;
-import java.awt.event.InputMethodListener;
-import java.awt.event.InputMethodEvent;
 import java.awt.im.InputContext;
 import java.awt.im.InputMethodRequests;
 import java.awt.dnd.DropTarget;
@@ -8120,18 +8118,12 @@
      * @since     JDK1.0
      */
     protected String paramString() {
-        String thisName = getName();
-        String str = (thisName != null? thisName : "") + "," + x + "," + y + "," + width + "x" + height;
-        if (!isValid()) {
-            str += ",invalid";
-        }
-        if (!visible) {
-            str += ",hidden";
-        }
-        if (!enabled) {
-            str += ",disabled";
-        }
-        return str;
+        final String thisName = Objects.toString(getName(), "");
+        final String invalid = isValid() ? "" : ",invalid";
+        final String hidden = visible ? "" : ",hidden";
+        final String disabled = enabled ? "" : ",disabled";
+        return thisName + ',' + x + ',' + y + ',' + width + 'x' + height
+                + invalid + hidden + disabled;
     }
 
     /**
@@ -8140,7 +8132,7 @@
      * @since     JDK1.0
      */
     public String toString() {
-        return getClass().getName() + "[" + paramString() + "]";
+        return getClass().getName() + '[' + paramString() + ']';
     }
 
     /**
--- a/src/share/classes/java/awt/Label.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/awt/Label.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -272,13 +272,13 @@
      * @return     the parameter string of this label
      */
     protected String paramString() {
-        String str = ",align=";
+        String align = "";
         switch (alignment) {
-          case LEFT:   str += "left"; break;
-          case CENTER: str += "center"; break;
-          case RIGHT:  str += "right"; break;
+            case LEFT:   align = "left"; break;
+            case CENTER: align = "center"; break;
+            case RIGHT:  align = "right"; break;
         }
-        return super.paramString() + str + ",text=" + text;
+        return super.paramString() + ",align=" + align + ",text=" + text;
     }
 
     /**
--- a/src/share/classes/java/awt/PointerInfo.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/awt/PointerInfo.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,62 +23,59 @@
  * questions.
  */
 
+
 package java.awt;
 
 /**
  * A class that describes the pointer position.
- * It provides the <code>GraphicsDevice</code> where the
- * pointer is and the <code>Point</code> that represents
- * the coordinates of the pointer.
+ * It provides the {@code GraphicsDevice} where the pointer is and
+ * the {@code Point} that represents the coordinates of the pointer.
  * <p>
  * Instances of this class should be obtained via
  * {@link MouseInfo#getPointerInfo}.
- * The <code>PointerInfo</code> instance is not updated dynamically
- * as the mouse moves. To get the updated location, you must call
+ * The {@code PointerInfo} instance is not updated dynamically as the mouse
+ * moves. To get the updated location, you must call
  * {@link MouseInfo#getPointerInfo} again.
  *
  * @see MouseInfo#getPointerInfo
- * @author      Roman Poborchiy
- * @since       1.5
+ * @author Roman Poborchiy
+ * @since 1.5
  */
-
 public class PointerInfo {
 
-    private GraphicsDevice device;
-    private Point location;
+    private final GraphicsDevice device;
+    private final Point location;
 
     /**
      * Package-private constructor to prevent instantiation.
      */
-    PointerInfo(GraphicsDevice device, Point location) {
+    PointerInfo(final GraphicsDevice device, final Point location) {
         this.device = device;
         this.location = location;
     }
 
     /**
-     * Returns the <code>GraphicsDevice</code> where the mouse pointer
-     * was at the moment this <code>PointerInfo</code> was created.
+     * Returns the {@code GraphicsDevice} where the mouse pointer was at the
+     * moment this {@code PointerInfo} was created.
      *
-     * @return   <code>GraphicsDevice</code> corresponding to the pointer
-     * @since    1.5
+     * @return {@code GraphicsDevice} corresponding to the pointer
+     * @since 1.5
      */
     public GraphicsDevice getDevice() {
         return device;
     }
 
     /**
-     * Returns the <code>Point</code> that represents the coordinates
-     * of the pointer on the screen. See {@link MouseInfo#getPointerInfo}
-     * for more information about coordinate calculation for multiscreen
-     * systems.
+     * Returns the {@code Point} that represents the coordinates of the pointer
+     * on the screen. See {@link MouseInfo#getPointerInfo} for more information
+     * about coordinate calculation for multiscreen systems.
      *
+     * @return coordinates of mouse pointer
      * @see MouseInfo
      * @see MouseInfo#getPointerInfo
-     * @return   coordinates of mouse pointer
-     * @since    1.5
+     * @since 1.5
      */
     public Point getLocation() {
         return location;
     }
-
 }
--- a/src/share/classes/java/awt/Toolkit.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/awt/Toolkit.java	Wed Apr 16 15:03:29 2014 -0700
@@ -26,10 +26,6 @@
 package java.awt;
 
 import java.beans.PropertyChangeEvent;
-import java.util.MissingResourceException;
-import java.util.Properties;
-import java.util.ResourceBundle;
-import java.util.StringTokenizer;
 import java.awt.event.*;
 import java.awt.peer.*;
 import java.awt.im.InputMethodHighlight;
@@ -855,50 +851,39 @@
      */
     public static synchronized Toolkit getDefaultToolkit() {
         if (toolkit == null) {
-            try {
-                // We disable the JIT during toolkit initialization.  This
-                // tends to touch lots of classes that aren't needed again
-                // later and therefore JITing is counter-productiive.
-                java.lang.Compiler.disable();
-
-                java.security.AccessController.doPrivileged(
-                        new java.security.PrivilegedAction<Void>() {
-                    public Void run() {
-                        String nm = null;
-                        Class<?> cls = null;
-                        try {
-                            nm = System.getProperty("awt.toolkit");
+            java.security.AccessController.doPrivileged(
+                    new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    Class<?> cls = null;
+                    String nm = System.getProperty("awt.toolkit");
+                    try {
+                        cls = Class.forName(nm);
+                    } catch (ClassNotFoundException e) {
+                        ClassLoader cl = ClassLoader.getSystemClassLoader();
+                        if (cl != null) {
                             try {
-                                cls = Class.forName(nm);
-                            } catch (ClassNotFoundException e) {
-                                ClassLoader cl = ClassLoader.getSystemClassLoader();
-                                if (cl != null) {
-                                    try {
-                                        cls = cl.loadClass(nm);
-                                    } catch (ClassNotFoundException ee) {
-                                        throw new AWTError("Toolkit not found: " + nm);
-                                    }
-                                }
+                                cls = cl.loadClass(nm);
+                            } catch (final ClassNotFoundException ignored) {
+                                throw new AWTError("Toolkit not found: " + nm);
                             }
-                            if (cls != null) {
-                                toolkit = (Toolkit)cls.newInstance();
-                                if (GraphicsEnvironment.isHeadless()) {
-                                    toolkit = new HeadlessToolkit(toolkit);
-                                }
+                        }
+                    }
+                    try {
+                        if (cls != null) {
+                            toolkit = (Toolkit)cls.newInstance();
+                            if (GraphicsEnvironment.isHeadless()) {
+                                toolkit = new HeadlessToolkit(toolkit);
                             }
-                        } catch (InstantiationException e) {
-                            throw new AWTError("Could not instantiate Toolkit: " + nm);
-                        } catch (IllegalAccessException e) {
-                            throw new AWTError("Could not access Toolkit: " + nm);
                         }
-                        return null;
+                    } catch (final InstantiationException ignored) {
+                        throw new AWTError("Could not instantiate Toolkit: " + nm);
+                    } catch (final IllegalAccessException ignored) {
+                        throw new AWTError("Could not access Toolkit: " + nm);
                     }
-                });
-                loadAssistiveTechnologies();
-            } finally {
-                // Make sure to always re-enable the JIT.
-                java.lang.Compiler.enable();
-            }
+                    return null;
+                }
+            });
+            loadAssistiveTechnologies();
         }
         return toolkit;
     }
--- a/src/share/classes/java/awt/peer/CheckboxMenuItemPeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/awt/peer/CheckboxMenuItemPeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,12 +38,12 @@
 public interface CheckboxMenuItemPeer extends MenuItemPeer {
 
     /**
-     * Sets the state of the checkbox to be checked ({@code true}) or
-     * unchecked ({@code false}).
+     * Sets the state of the checkbox to be checked {@code true} or
+     * unchecked {@code false}.
      *
-     * @param t the state to set on the checkbox
+     * @param state the state to set on the checkbox
      *
-     * @see CheckboxMenuItemPeer#setState(boolean)
+     * @see CheckboxMenuItem#setState(boolean)
      */
-    void setState(boolean t);
+    void setState(boolean state);
 }
--- a/src/share/classes/java/awt/peer/CheckboxPeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/awt/peer/CheckboxPeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,8 @@
  */
 package java.awt.peer;
 
-import java.awt.*;
+import java.awt.Checkbox;
+import java.awt.CheckboxGroup;
 
 /**
  * The peer interface for {@link Checkbox}.
@@ -38,8 +39,8 @@
 public interface CheckboxPeer extends ComponentPeer {
 
     /**
-     * Sets the state of the checkbox to be checked ({@code true}) or
-     * unchecked ({@code false}).
+     * Sets the state of the checkbox to be checked {@code true} or
+     * unchecked {@code false}.
      *
      * @param state the state to set on the checkbox
      *
@@ -60,7 +61,7 @@
     void setCheckboxGroup(CheckboxGroup g);
 
     /**
-     * Sets the label that should be displayed on the ckeckbox. A value of
+     * Sets the label that should be displayed on the checkbox. A value of
      * {@code null} means that no label should be displayed.
      *
      * @param label the label to be displayed on the checkbox, or
--- a/src/share/classes/java/awt/peer/ComponentPeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/awt/peer/ComponentPeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -27,11 +27,11 @@
 
 import java.awt.*;
 import java.awt.event.PaintEvent;
+import java.awt.image.ColorModel;
+import java.awt.image.ImageObserver;
 import java.awt.image.ImageProducer;
-import java.awt.image.ImageObserver;
-import java.awt.image.ColorModel;
 import java.awt.image.VolatileImage;
-import java.awt.GraphicsConfiguration;
+
 import sun.awt.CausedFocusEvent;
 import sun.java2d.pipe.Region;
 
--- a/src/share/classes/java/awt/peer/TextAreaPeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/awt/peer/TextAreaPeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -49,7 +49,7 @@
     void insert(String text, int pos);
 
     /**
-     * Replaces a range of text by the specified string
+     * Replaces a range of text by the specified string.
      *
      * @param text the replacement string
      * @param start the begin of the range to replace
--- a/src/share/classes/java/beans/Introspector.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/beans/Introspector.java	Wed Apr 16 15:03:29 2014 -0700
@@ -806,7 +806,7 @@
     }
 
     private static boolean isAssignable(Class<?> current, Class<?> candidate) {
-        return current == null ? candidate == null : current.isAssignableFrom(candidate);
+        return ((current == null) || (candidate == null)) ? current == candidate : current.isAssignableFrom(candidate);
     }
 
     /**
--- a/src/share/classes/java/net/DatagramSocket.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/net/DatagramSocket.java	Wed Apr 16 15:03:29 2014 -0700
@@ -315,6 +315,7 @@
         }
         // creates a udp socket
         impl.create();
+        impl.setDatagramSocket(this);
         created = true;
     }
 
--- a/src/share/classes/java/net/DatagramSocketImpl.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/net/DatagramSocketImpl.java	Wed Apr 16 15:03:29 2014 -0700
@@ -48,6 +48,20 @@
     protected FileDescriptor fd;
 
     /**
+     * The DatagramSocket or MulticastSocket
+     * that owns this impl
+     */
+    DatagramSocket socket;
+
+    void setDatagramSocket(DatagramSocket socket) {
+        this.socket = socket;
+    }
+
+    DatagramSocket getDatagramSocket() {
+        return socket;
+    }
+
+    /**
      * Creates a datagram socket.
      * @exception SocketException if there is an error in the
      * underlying protocol, such as a TCP error.
@@ -233,6 +247,56 @@
         return localPort;
     }
 
+    <T> void setOption(SocketOption<T> name, T value) throws IOException {
+        if (name == StandardSocketOptions.SO_SNDBUF) {
+            setOption(SocketOptions.SO_SNDBUF, value);
+        } else if (name == StandardSocketOptions.SO_RCVBUF) {
+            setOption(SocketOptions.SO_RCVBUF, value);
+        } else if (name == StandardSocketOptions.SO_REUSEADDR) {
+            setOption(SocketOptions.SO_REUSEADDR, value);
+        } else if (name == StandardSocketOptions.IP_TOS) {
+            setOption(SocketOptions.IP_TOS, value);
+        } else if (name == StandardSocketOptions.IP_MULTICAST_IF &&
+            (getDatagramSocket() instanceof MulticastSocket)) {
+            setOption(SocketOptions.IP_MULTICAST_IF2, value);
+        } else if (name == StandardSocketOptions.IP_MULTICAST_TTL &&
+            (getDatagramSocket() instanceof MulticastSocket)) {
+            if (! (value instanceof Integer)) {
+                throw new IllegalArgumentException("not an integer");
+            }
+            setTimeToLive((Integer)value);
+        } else if (name == StandardSocketOptions.IP_MULTICAST_LOOP &&
+            (getDatagramSocket() instanceof MulticastSocket)) {
+            setOption(SocketOptions.IP_MULTICAST_LOOP, value);
+        } else {
+            throw new UnsupportedOperationException("unsupported option");
+        }
+    }
+
+    <T> T getOption(SocketOption<T> name) throws IOException {
+        if (name == StandardSocketOptions.SO_SNDBUF) {
+            return (T) getOption(SocketOptions.SO_SNDBUF);
+        } else if (name == StandardSocketOptions.SO_RCVBUF) {
+            return (T) getOption(SocketOptions.SO_RCVBUF);
+        } else if (name == StandardSocketOptions.SO_REUSEADDR) {
+            return (T) getOption(SocketOptions.SO_REUSEADDR);
+        } else if (name == StandardSocketOptions.IP_TOS) {
+            return (T) getOption(SocketOptions.IP_TOS);
+        } else if (name == StandardSocketOptions.IP_MULTICAST_IF &&
+            (getDatagramSocket() instanceof MulticastSocket)) {
+            return (T) getOption(SocketOptions.IP_MULTICAST_IF2);
+        } else if (name == StandardSocketOptions.IP_MULTICAST_TTL &&
+            (getDatagramSocket() instanceof MulticastSocket)) {
+            Integer ttl = getTimeToLive();
+            return (T)ttl;
+        } else if (name == StandardSocketOptions.IP_MULTICAST_LOOP &&
+            (getDatagramSocket() instanceof MulticastSocket)) {
+            return (T) getOption(SocketOptions.IP_MULTICAST_LOOP);
+        } else {
+            throw new UnsupportedOperationException("unsupported option");
+        }
+    }
+
     /**
      * Gets the datagram socket file descriptor.
      * @return a {@code FileDescriptor} object representing the datagram socket
--- a/src/share/classes/java/net/SocketImpl.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/net/SocketImpl.java	Wed Apr 16 15:03:29 2014 -0700
@@ -355,4 +355,44 @@
     {
         /* Not implemented yet */
     }
+
+    <T> void setOption(SocketOption<T> name, T value) throws IOException {
+        if (name == StandardSocketOptions.SO_KEEPALIVE) {
+            setOption(SocketOptions.SO_KEEPALIVE, value);
+        } else if (name == StandardSocketOptions.SO_SNDBUF) {
+            setOption(SocketOptions.SO_SNDBUF, value);
+        } else if (name == StandardSocketOptions.SO_RCVBUF) {
+            setOption(SocketOptions.SO_RCVBUF, value);
+        } else if (name == StandardSocketOptions.SO_REUSEADDR) {
+            setOption(SocketOptions.SO_REUSEADDR, value);
+        } else if (name == StandardSocketOptions.SO_LINGER) {
+            setOption(SocketOptions.SO_LINGER, value);
+        } else if (name == StandardSocketOptions.IP_TOS) {
+            setOption(SocketOptions.IP_TOS, value);
+        } else if (name == StandardSocketOptions.TCP_NODELAY) {
+            setOption(SocketOptions.TCP_NODELAY, value);
+        } else {
+            throw new UnsupportedOperationException("unsupported option");
+        }
+    }
+
+    <T> T getOption(SocketOption<T> name) throws IOException {
+        if (name == StandardSocketOptions.SO_KEEPALIVE) {
+            return (T)getOption(SocketOptions.SO_KEEPALIVE);
+        } else if (name == StandardSocketOptions.SO_SNDBUF) {
+            return (T)getOption(SocketOptions.SO_SNDBUF);
+        } else if (name == StandardSocketOptions.SO_RCVBUF) {
+            return (T)getOption(SocketOptions.SO_RCVBUF);
+        } else if (name == StandardSocketOptions.SO_REUSEADDR) {
+            return (T)getOption(SocketOptions.SO_REUSEADDR);
+        } else if (name == StandardSocketOptions.SO_LINGER) {
+            return (T)getOption(SocketOptions.SO_LINGER);
+        } else if (name == StandardSocketOptions.IP_TOS) {
+            return (T)getOption(SocketOptions.IP_TOS);
+        } else if (name == StandardSocketOptions.TCP_NODELAY) {
+            return (T)getOption(SocketOptions.TCP_NODELAY);
+        } else {
+            throw new UnsupportedOperationException("unsupported option");
+        }
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/net/SocketSecrets.java	Wed Apr 16 15:03:29 2014 -0700
@@ -0,0 +1,70 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.net;
+
+import java.io.IOException;
+
+class SocketSecrets {
+
+    /* accessed by reflection from jdk.net.Sockets */
+
+    /* obj must be a Socket or ServerSocket */
+
+    private static <T> void setOption(Object obj, SocketOption<T> name, T value) throws IOException {
+        SocketImpl impl;
+
+        if (obj instanceof Socket) {
+            impl = ((Socket)obj).getImpl();
+        } else if (obj instanceof ServerSocket) {
+            impl = ((ServerSocket)obj).getImpl();
+        } else {
+            throw new IllegalArgumentException();
+        }
+        impl.setOption(name, value);
+    }
+
+    private static <T> T getOption(Object obj, SocketOption<T> name) throws IOException {
+        SocketImpl impl;
+
+        if (obj instanceof Socket) {
+            impl = ((Socket)obj).getImpl();
+        } else if (obj instanceof ServerSocket) {
+            impl = ((ServerSocket)obj).getImpl();
+        } else {
+            throw new IllegalArgumentException();
+        }
+        return impl.getOption(name);
+    }
+
+    private static <T> void setOption(DatagramSocket s, SocketOption<T> name, T value) throws IOException {
+        s.getImpl().setOption(name, value);
+    }
+
+    private static <T> T getOption(DatagramSocket s, SocketOption<T> name) throws IOException {
+        return s.getImpl().getOption(name);
+    }
+
+}
--- a/src/share/classes/java/time/Clock.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/Clock.java	Wed Apr 16 15:03:29 2014 -0700
@@ -104,7 +104,7 @@
  * resolution clock if one is available.
  *
  * @implSpec
- * This abstract class must be implemented with care to ensure other operate correctly.
+ * This abstract class must be implemented with care to ensure other classes operate correctly.
  * All implementations that can be instantiated must be final, immutable and thread-safe.
  * <p>
  * The principal methods are defined to allow the throwing of an exception.
--- a/src/share/classes/java/time/Duration.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/Duration.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1326,6 +1326,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/Instant.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/Instant.java	Wed Apr 16 15:03:29 2014 -0700
@@ -100,11 +100,6 @@
  * This class models a single instantaneous point on the time-line.
  * This might be used to record event time-stamps in the application.
  * <p>
- * For practicality, the instant is stored with some constraints.
- * The measurable time-line is restricted to the number of seconds that can be held
- * in a {@code long}. This is greater than the current estimated age of the universe.
- * The instant is stored to nanosecond resolution.
- * <p>
  * The range of an instant requires the storage of a number larger than a {@code long}.
  * To achieve this, the class stores a {@code long} representing epoch-seconds and an
  * {@code int} representing nanosecond-of-second, which will always be between 0 and 999,999,999.
@@ -1348,6 +1343,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/LocalDate.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/LocalDate.java	Wed Apr 16 15:03:29 2014 -0700
@@ -2053,6 +2053,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/LocalDateTime.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/LocalDateTime.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1986,6 +1986,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/LocalTime.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/LocalTime.java	Wed Apr 16 15:03:29 2014 -0700
@@ -838,9 +838,9 @@
                 case NANO_OF_SECOND: return withNano((int) newValue);
                 case NANO_OF_DAY: return LocalTime.ofNanoOfDay(newValue);
                 case MICRO_OF_SECOND: return withNano((int) newValue * 1000);
-                case MICRO_OF_DAY: return plusNanos((newValue - toNanoOfDay() / 1000) * 1000);
+                case MICRO_OF_DAY: return LocalTime.ofNanoOfDay(newValue * 1000);
                 case MILLI_OF_SECOND: return withNano((int) newValue * 1000_000);
-                case MILLI_OF_DAY: return plusNanos((newValue - toNanoOfDay() / 1000_000) * 1000_000);
+                case MILLI_OF_DAY: return LocalTime.ofNanoOfDay(newValue * 1000_000);
                 case SECOND_OF_MINUTE: return withSecond((int) newValue);
                 case SECOND_OF_DAY: return plusSeconds(newValue - toSecondOfDay());
                 case MINUTE_OF_HOUR: return withMinute((int) newValue);
@@ -1638,6 +1638,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/MonthDay.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/MonthDay.java	Wed Apr 16 15:03:29 2014 -0700
@@ -771,6 +771,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/OffsetDateTime.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/OffsetDateTime.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1925,6 +1925,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/OffsetTime.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/OffsetTime.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1396,6 +1396,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/Period.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/Period.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1058,6 +1058,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws java.io.InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/Year.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/Year.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1104,6 +1104,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/YearMonth.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/YearMonth.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1230,6 +1230,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/ZoneId.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/ZoneId.java	Wed Apr 16 15:03:29 2014 -0700
@@ -624,6 +624,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/ZoneOffset.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/ZoneOffset.java	Wed Apr 16 15:03:29 2014 -0700
@@ -769,6 +769,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/ZoneRegion.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/ZoneRegion.java	Wed Apr 16 15:03:29 2014 -0700
@@ -196,6 +196,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/ZonedDateTime.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/ZonedDateTime.java	Wed Apr 16 15:03:29 2014 -0700
@@ -2225,6 +2225,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/chrono/AbstractChronology.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/chrono/AbstractChronology.java	Wed Apr 16 15:03:29 2014 -0700
@@ -766,6 +766,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws java.io.InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws ObjectStreamException {
--- a/src/share/classes/java/time/chrono/ChronoLocalDate.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/chrono/ChronoLocalDate.java	Wed Apr 16 15:03:29 2014 -0700
@@ -101,19 +101,12 @@
  * <h3>When to use this interface</h3>
  * The design of the API encourages the use of {@code LocalDate} rather than this
  * interface, even in the case where the application needs to deal with multiple
- * calendar systems. The rationale for this is explored in the following documentation.
+ * calendar systems.
  * <p>
- * The primary use case where this interface should be used is where the generic
- * type parameter {@code <D>} is fully defined as a specific chronology.
- * In that case, the assumptions of that chronology are known at development
- * time and specified in the code.
- * <p>
- * When the chronology is defined in the generic type parameter as ? or otherwise
- * unknown at development time, the rest of the discussion below applies.
- * <p>
- * To emphasize the point, declaring a method signature, field or variable as this
- * interface type can initially seem like the sensible way to globalize an application,
- * however it is usually the wrong approach.
+ * This concept can seem surprising at first, as the natural way to globalize an
+ * application might initially appear to be to abstract the calendar system.
+ * However, as explored below, abstracting the calendar system is usually the wrong
+ * approach, resulting in logic errors and hard to find bugs.
  * As such, it should be considered an application-wide architectural decision to choose
  * to use this interface as opposed to {@code LocalDate}.
  *
--- a/src/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java	Wed Apr 16 15:03:29 2014 -0700
@@ -416,6 +416,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/chrono/ChronoPeriodImpl.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/chrono/ChronoPeriodImpl.java	Wed Apr 16 15:03:29 2014 -0700
@@ -376,6 +376,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws ObjectStreamException {
--- a/src/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java	Wed Apr 16 15:03:29 2014 -0700
@@ -340,6 +340,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/chrono/HijrahChronology.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/chrono/HijrahChronology.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1096,6 +1096,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/chrono/HijrahDate.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/chrono/HijrahDate.java	Wed Apr 16 15:03:29 2014 -0700
@@ -654,6 +654,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/chrono/IsoChronology.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/chrono/IsoChronology.java	Wed Apr 16 15:03:29 2014 -0700
@@ -604,6 +604,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/chrono/JapaneseChronology.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/chrono/JapaneseChronology.java	Wed Apr 16 15:03:29 2014 -0700
@@ -525,6 +525,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/chrono/JapaneseDate.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/chrono/JapaneseDate.java	Wed Apr 16 15:03:29 2014 -0700
@@ -716,6 +716,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/chrono/JapaneseEra.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/chrono/JapaneseEra.java	Wed Apr 16 15:03:29 2014 -0700
@@ -357,6 +357,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/chrono/MinguoChronology.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/chrono/MinguoChronology.java	Wed Apr 16 15:03:29 2014 -0700
@@ -355,6 +355,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/chrono/MinguoDate.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/chrono/MinguoDate.java	Wed Apr 16 15:03:29 2014 -0700
@@ -478,6 +478,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/chrono/ThaiBuddhistChronology.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/chrono/ThaiBuddhistChronology.java	Wed Apr 16 15:03:29 2014 -0700
@@ -391,6 +391,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/chrono/ThaiBuddhistDate.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/chrono/ThaiBuddhistDate.java	Wed Apr 16 15:03:29 2014 -0700
@@ -478,6 +478,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/format/DateTimeFormatter.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/format/DateTimeFormatter.java	Wed Apr 16 15:03:29 2014 -0700
@@ -344,10 +344,7 @@
  * <b>Fraction</b>: Outputs the nano-of-second field as a fraction-of-second.
  * The nano-of-second value has nine digits, thus the count of pattern letters
  * is from 1 to 9. If it is less than 9, then the nano-of-second value is
- * truncated, with only the most significant digits being output. When parsing
- * in strict mode, the number of parsed digits must match the count of pattern
- * letters. When parsing in lenient mode, the number of parsed digits must be at
- * least the count of pattern letters, up to 9 digits.
+ * truncated, with only the most significant digits being output.
  * <p>
  * <b>Year</b>: The count of letters determines the minimum field width below
  * which padding is used. If the count of letters is two, then a
@@ -1647,12 +1644,13 @@
      * @return a formatter based on this formatter with the requested resolver style, not null
      */
     public DateTimeFormatter withResolverFields(TemporalField... resolverFields) {
-        Objects.requireNonNull(resolverFields, "resolverFields");
-        Set<TemporalField> fields = new HashSet<>(Arrays.asList(resolverFields));
+        Set<TemporalField> fields = null;
+        if (resolverFields != null) {
+            fields = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(resolverFields)));
+        }
         if (Objects.equals(this.resolverFields, fields)) {
             return this;
         }
-        fields = Collections.unmodifiableSet(fields);
         return new DateTimeFormatter(printerParser, locale, decimalStyle, resolverStyle, fields, chrono, zone);
     }
 
@@ -1696,11 +1694,12 @@
      * @return a formatter based on this formatter with the requested resolver style, not null
      */
     public DateTimeFormatter withResolverFields(Set<TemporalField> resolverFields) {
-        Objects.requireNonNull(resolverFields, "resolverFields");
         if (Objects.equals(this.resolverFields, resolverFields)) {
             return this;
         }
-        resolverFields = Collections.unmodifiableSet(new HashSet<>(resolverFields));
+        if (resolverFields != null) {
+            resolverFields = Collections.unmodifiableSet(new HashSet<>(resolverFields));
+        }
         return new DateTimeFormatter(printerParser, locale, decimalStyle, resolverStyle, resolverFields, chrono, zone);
     }
 
--- a/src/share/classes/java/time/format/DateTimeFormatterBuilder.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/format/DateTimeFormatterBuilder.java	Wed Apr 16 15:03:29 2014 -0700
@@ -2596,8 +2596,16 @@
             return value;
         }
 
-        boolean isFixedWidth() {
-            return subsequentWidth == -1;
+        /**
+         * For NumberPrinterParser, the width is fixed depending on the
+         * minWidth, maxWidth, signStyle and whether subsequent fields are fixed.
+         * @param context the context
+         * @return true if the field is fixed width
+         * @see DateTimeFormatterBuilder#appendValue(java.time.temporal.TemporalField, int)
+         */
+        boolean isFixedWidth(DateTimeParseContext context) {
+            return subsequentWidth == -1 ||
+                (subsequentWidth > 0 && minWidth == maxWidth && signStyle == SignStyle.NOT_NEGATIVE);
         }
 
         @Override
@@ -2626,12 +2634,12 @@
                     return ~position;
                 }
             }
-            int effMinWidth = (context.isStrict() || isFixedWidth() ? minWidth : 1);
+            int effMinWidth = (context.isStrict() || isFixedWidth(context) ? minWidth : 1);
             int minEndPos = position + effMinWidth;
             if (minEndPos > length) {
                 return ~position;
             }
-            int effMaxWidth = (context.isStrict() || isFixedWidth() ? maxWidth : 9) + Math.max(subsequentWidth, 0);
+            int effMaxWidth = (context.isStrict() || isFixedWidth(context) ? maxWidth : 9) + Math.max(subsequentWidth, 0);
             long total = 0;
             BigInteger totalBig = null;
             int pos = position;
@@ -2866,6 +2874,21 @@
                     this.subsequentWidth + subsequentWidth);
         }
 
+        /**
+         * For a ReducedPrinterParser, fixed width is false if the mode is strict,
+         * otherwise it is set as for NumberPrinterParser.
+         * @param context the context
+         * @return if the field is fixed width
+         * @see DateTimeFormatterBuilder#appendValueReduced(java.time.temporal.TemporalField, int, int, int)
+         */
+        @Override
+        boolean isFixedWidth(DateTimeParseContext context) {
+           if (context.isStrict() == false) {
+               return false;
+           }
+           return super.isFixedWidth(context);
+        }
+
         @Override
         public String toString() {
             return "ReducedValue(" + field + "," + minWidth + "," + maxWidth + "," + (baseDate != null ? baseDate : baseValue) + ")";
--- a/src/share/classes/java/time/format/Parsed.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/format/Parsed.java	Wed Apr 16 15:03:29 2014 -0700
@@ -289,7 +289,7 @@
                             changedCount++;
                             continue outer;  // have to restart to avoid concurrent modification
                         }
-                        throw new DateTimeException("Method resolveFields() can only return ChronoZonedDateTime," +
+                        throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                                 "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                     } else if (fieldValues.containsKey(targetField) == false) {
                         changedCount++;
--- a/src/share/classes/java/time/temporal/TemporalAccessor.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/temporal/TemporalAccessor.java	Wed Apr 16 15:03:29 2014 -0700
@@ -217,7 +217,7 @@
     default int get(TemporalField field) {
         ValueRange range = range(field);
         if (range.isIntValue() == false) {
-            throw new UnsupportedTemporalTypeException("Invalid field " + field + " + for get() method, use getLong() instead");
+            throw new UnsupportedTemporalTypeException("Invalid field " + field + " for get() method, use getLong() instead");
         }
         long value = getLong(field);
         if (range.isValidValue(value) == false) {
--- a/src/share/classes/java/time/temporal/ValueRange.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/temporal/ValueRange.java	Wed Apr 16 15:03:29 2014 -0700
@@ -344,10 +344,13 @@
     /**
      * Restore the state of an ValueRange from the stream.
      * Check that the values are valid.
+     *
+     * @param s the stream to read
      * @throws InvalidObjectException if
      *     the smallest minimum is greater than the smallest maximum,
      *  or the smallest maximum is greater than the largest maximum
      *  or the largest minimum is greater than the largest maximum
+     * @throws ClassNotFoundException if a class cannot be resolved
      */
     private void readObject(ObjectInputStream s)
          throws IOException, ClassNotFoundException, InvalidObjectException
--- a/src/share/classes/java/time/temporal/WeekFields.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/temporal/WeekFields.java	Wed Apr 16 15:03:29 2014 -0700
@@ -344,8 +344,11 @@
     /**
      * Restore the state of a WeekFields from the stream.
      * Check that the values are valid.
+     *
+     * @param s the stream to read
      * @throws InvalidObjectException if the serialized object has an invalid
      *     value for firstDayOfWeek or minimalDays.
+     * @throws ClassNotFoundException if a class cannot be resolved
      */
     private void readObject(ObjectInputStream s)
          throws IOException, ClassNotFoundException, InvalidObjectException
--- a/src/share/classes/java/time/zone/ZoneOffsetTransition.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/zone/ZoneOffsetTransition.java	Wed Apr 16 15:03:29 2014 -0700
@@ -173,6 +173,8 @@
     //-----------------------------------------------------------------------
     /**
      * Defend against malicious streams.
+     *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/zone/ZoneOffsetTransitionRule.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/zone/ZoneOffsetTransitionRule.java	Wed Apr 16 15:03:29 2014 -0700
@@ -235,6 +235,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/time/zone/ZoneRules.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/time/zone/ZoneRules.java	Wed Apr 16 15:03:29 2014 -0700
@@ -319,6 +319,7 @@
     /**
      * Defend against malicious streams.
      *
+     * @param s the stream to read
      * @throws InvalidObjectException always
      */
     private void readObject(ObjectInputStream s) throws InvalidObjectException {
--- a/src/share/classes/java/util/AbstractMap.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/util/AbstractMap.java	Wed Apr 16 15:03:29 2014 -0700
@@ -305,8 +305,8 @@
      * appropriate view the first time this view is requested.  The views are
      * stateless, so there's no reason to create more than one of each.
      */
-    transient volatile Set<K>        keySet = null;
-    transient volatile Collection<V> values = null;
+    transient volatile Set<K>        keySet;
+    transient volatile Collection<V> values;
 
     /**
      * {@inheritDoc}
--- a/src/share/classes/java/util/Collections.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/util/Collections.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1466,9 +1466,9 @@
             throw new UnsupportedOperationException();
         }
 
-        private transient Set<K> keySet = null;
-        private transient Set<Map.Entry<K,V>> entrySet = null;
-        private transient Collection<V> values = null;
+        private transient Set<K> keySet;
+        private transient Set<Map.Entry<K,V>> entrySet;
+        private transient Collection<V> values;
 
         public Set<K> keySet() {
             if (keySet==null)
@@ -2597,9 +2597,9 @@
             synchronized (mutex) {m.clear();}
         }
 
-        private transient Set<K> keySet = null;
-        private transient Set<Map.Entry<K,V>> entrySet = null;
-        private transient Collection<V> values = null;
+        private transient Set<K> keySet;
+        private transient Set<Map.Entry<K,V>> entrySet;
+        private transient Collection<V> values;
 
         public Set<K> keySet() {
             synchronized (mutex) {
@@ -3082,7 +3082,7 @@
             return c.add(e);
         }
 
-        private E[] zeroLengthElementArray = null; // Lazily initialized
+        private E[] zeroLengthElementArray; // Lazily initialized
 
         private E[] zeroLengthElementArray() {
             return zeroLengthElementArray != null ? zeroLengthElementArray :
@@ -3643,7 +3643,7 @@
                 m.put(e.getKey(), e.getValue());
         }
 
-        private transient Set<Map.Entry<K,V>> entrySet = null;
+        private transient Set<Map.Entry<K,V>> entrySet;
 
         public Set<Map.Entry<K,V>> entrySet() {
             if (entrySet==null)
@@ -4877,9 +4877,9 @@
         public boolean containsValue(Object value)       {return eq(value, v);}
         public V get(Object key)              {return (eq(key, k) ? v : null);}
 
-        private transient Set<K> keySet = null;
-        private transient Set<Map.Entry<K,V>> entrySet = null;
-        private transient Collection<V> values = null;
+        private transient Set<K> keySet;
+        private transient Set<Map.Entry<K,V>> entrySet;
+        private transient Collection<V> values;
 
         public Set<K> keySet() {
             if (keySet==null)
--- a/src/share/classes/java/util/EnumMap.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/util/EnumMap.java	Wed Apr 16 15:03:29 2014 -0700
@@ -367,7 +367,7 @@
      * view the first time this view is requested.  The view is stateless,
      * so there's no reason to create more than one.
      */
-    private transient Set<Map.Entry<K,V>> entrySet = null;
+    private transient Set<Map.Entry<K,V>> entrySet;
 
     /**
      * Returns a {@link Set} view of the keys contained in this map.
@@ -562,7 +562,7 @@
     }
 
     private class EntryIterator extends EnumMapIterator<Map.Entry<K,V>> {
-        private Entry lastReturnedEntry = null;
+        private Entry lastReturnedEntry;
 
         public Map.Entry<K,V> next() {
             if (!hasNext())
--- a/src/share/classes/java/util/Hashtable.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/util/Hashtable.java	Wed Apr 16 15:03:29 2014 -0700
@@ -617,9 +617,9 @@
      * appropriate view the first time this view is requested.  The views are
      * stateless, so there's no reason to create more than one of each.
      */
-    private transient volatile Set<K> keySet = null;
-    private transient volatile Set<Map.Entry<K,V>> entrySet = null;
-    private transient volatile Collection<V> values = null;
+    private transient volatile Set<K> keySet;
+    private transient volatile Set<Map.Entry<K,V>> entrySet;
+    private transient volatile Collection<V> values;
 
     /**
      * Returns a {@link Set} view of the keys contained in this map.
@@ -1303,8 +1303,8 @@
     private class Enumerator<T> implements Enumeration<T>, Iterator<T> {
         Entry<?,?>[] table = Hashtable.this.table;
         int index = table.length;
-        Entry<?,?> entry = null;
-        Entry<?,?> lastReturned = null;
+        Entry<?,?> entry;
+        Entry<?,?> lastReturned;
         int type;
 
         /**
--- a/src/share/classes/java/util/IdentityHashMap.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/util/IdentityHashMap.java	Wed Apr 16 15:03:29 2014 -0700
@@ -842,7 +842,7 @@
     private class EntryIterator
         extends IdentityHashMapIterator<Map.Entry<K,V>>
     {
-        private Entry lastReturnedEntry = null;
+        private Entry lastReturnedEntry;
 
         public Map.Entry<K,V> next() {
             lastReturnedEntry = new Entry(nextIndex());
@@ -928,7 +928,7 @@
      * view the first time this view is requested.  The view is stateless,
      * so there's no reason to create more than one.
      */
-    private transient Set<Map.Entry<K,V>> entrySet = null;
+    private transient Set<Map.Entry<K,V>> entrySet;
 
     /**
      * Returns an identity-based set view of the keys contained in this map.
--- a/src/share/classes/java/util/LinkedList.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/util/LinkedList.java	Wed Apr 16 15:03:29 2014 -0700
@@ -869,7 +869,7 @@
     }
 
     private class ListItr implements ListIterator<E> {
-        private Node<E> lastReturned = null;
+        private Node<E> lastReturned;
         private Node<E> next;
         private int nextIndex;
         private int expectedModCount = modCount;
--- a/src/share/classes/java/util/Map.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/util/Map.java	Wed Apr 16 15:03:29 2014 -0700
@@ -157,10 +157,10 @@
      *         key
      * @throws ClassCastException if the key is of an inappropriate type for
      *         this map
-     * (<a href="Collection.html#optional-restrictions">optional</a>)
+     * (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws NullPointerException if the specified key is null and this map
      *         does not permit null keys
-     * (<a href="Collection.html#optional-restrictions">optional</a>)
+     * (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      */
     boolean containsKey(Object key);
 
@@ -177,10 +177,10 @@
      *         specified value
      * @throws ClassCastException if the value is of an inappropriate type for
      *         this map
-     * (<a href="Collection.html#optional-restrictions">optional</a>)
+     * (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws NullPointerException if the specified value is null and this
      *         map does not permit null values
-     * (<a href="Collection.html#optional-restrictions">optional</a>)
+     * (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      */
     boolean containsValue(Object value);
 
@@ -204,10 +204,10 @@
      *         {@code null} if this map contains no mapping for the key
      * @throws ClassCastException if the key is of an inappropriate type for
      *         this map
-     * (<a href="Collection.html#optional-restrictions">optional</a>)
+     * (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws NullPointerException if the specified key is null and this map
      *         does not permit null keys
-     * (<a href="Collection.html#optional-restrictions">optional</a>)
+     * (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      */
     V get(Object key);
 
@@ -264,10 +264,10 @@
      *         is not supported by this map
      * @throws ClassCastException if the key is of an inappropriate type for
      *         this map
-     * (<a href="Collection.html#optional-restrictions">optional</a>)
+     * (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws NullPointerException if the specified key is null and this
      *         map does not permit null keys
-     * (<a href="Collection.html#optional-restrictions">optional</a>)
+     * (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      */
     V remove(Object key);
 
@@ -577,10 +577,10 @@
      * {@code defaultValue} if this map contains no mapping for the key
      * @throws ClassCastException if the key is of an inappropriate type for
      * this map
-     * (<a href="Collection.html#optional-restrictions">optional</a>)
+     * (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws NullPointerException if the specified key is null and this map
      * does not permit null keys
-     * (<a href="Collection.html#optional-restrictions">optional</a>)
+     * (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @since 1.8
      */
     default V getOrDefault(Object key, V defaultValue) {
@@ -659,13 +659,13 @@
      * values
      * @throws ClassCastException if a replacement value is of an inappropriate
      *         type for this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws NullPointerException if function or a replacement value is null,
      *         and this map does not permit null keys or values
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws IllegalArgumentException if some property of a replacement value
      *         prevents it from being stored in this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws ConcurrentModificationException if an entry is found to be
      * removed during iteration
      * @since 1.8
@@ -726,16 +726,16 @@
      *         if the implementation supports null values.)
      * @throws UnsupportedOperationException if the {@code put} operation
      *         is not supported by this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws ClassCastException if the key or value is of an inappropriate
      *         type for this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws NullPointerException if the specified key or value is null,
      *         and this map does not permit null keys or values
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws IllegalArgumentException if some property of the specified key
      *         or value prevents it from being stored in this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @since 1.8
      */
     default V putIfAbsent(K key, V value) {
@@ -772,13 +772,13 @@
      * @return {@code true} if the value was removed
      * @throws UnsupportedOperationException if the {@code remove} operation
      *         is not supported by this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws ClassCastException if the key or value is of an inappropriate
      *         type for this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws NullPointerException if the specified key or value is null,
      *         and this map does not permit null keys or values
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @since 1.8
      */
     default boolean remove(Object key, Object value) {
@@ -821,14 +821,14 @@
      * @return {@code true} if the value was replaced
      * @throws UnsupportedOperationException if the {@code put} operation
      *         is not supported by this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws ClassCastException if the class of a specified key or value
      *         prevents it from being stored in this map
      * @throws NullPointerException if a specified key or newValue is null,
      *         and this map does not permit null keys or values
      * @throws NullPointerException if oldValue is null and this map does not
      *         permit null values
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws IllegalArgumentException if some property of a specified key
      *         or value prevents it from being stored in this map
      * @since 1.8
@@ -871,10 +871,10 @@
      *         if the implementation supports null values.)
      * @throws UnsupportedOperationException if the {@code put} operation
      *         is not supported by this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws ClassCastException if the class of the specified key or value
      *         prevents it from being stored in this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws NullPointerException if the specified key or value is null,
      *         and this map does not permit null keys or values
      * @throws IllegalArgumentException if some property of the specified key
@@ -942,10 +942,10 @@
      *         is null
      * @throws UnsupportedOperationException if the {@code put} operation
      *         is not supported by this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws ClassCastException if the class of the specified key or value
      *         prevents it from being stored in this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @since 1.8
      */
     default V computeIfAbsent(K key,
@@ -1003,10 +1003,10 @@
      *         remappingFunction is null
      * @throws UnsupportedOperationException if the {@code put} operation
      *         is not supported by this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws ClassCastException if the class of the specified key or value
      *         prevents it from being stored in this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @since 1.8
      */
     default V computeIfPresent(K key,
@@ -1079,10 +1079,10 @@
      *         remappingFunction is null
      * @throws UnsupportedOperationException if the {@code put} operation
      *         is not supported by this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws ClassCastException if the class of the specified key or value
      *         prevents it from being stored in this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @since 1.8
      */
     default V compute(K key,
@@ -1157,10 +1157,10 @@
      *         value is associated with the key
      * @throws UnsupportedOperationException if the {@code put} operation
      *         is not supported by this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws ClassCastException if the class of the specified key or value
      *         prevents it from being stored in this map
-     *         (<a href="Collection.html#optional-restrictions">optional</a>)
+     *         (<a href="{@docRoot}/java/util/Collection.html#optional-restrictions">optional</a>)
      * @throws NullPointerException if the specified key is null and this map
      *         does not support null keys or the value or remappingFunction is
      *         null
--- a/src/share/classes/java/util/TreeMap.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/util/TreeMap.java	Wed Apr 16 15:03:29 2014 -0700
@@ -120,7 +120,7 @@
      */
     private final Comparator<? super K> comparator;
 
-    private transient Entry<K,V> root = null;
+    private transient Entry<K,V> root;
 
     /**
      * The number of entries in the tree
@@ -784,9 +784,9 @@
      * the first time this view is requested.  Views are stateless, so
      * there's no reason to create more than one.
      */
-    private transient EntrySet entrySet = null;
-    private transient KeySet<K> navigableKeySet = null;
-    private transient NavigableMap<K,V> descendingMap = null;
+    private transient EntrySet entrySet;
+    private transient KeySet<K> navigableKeySet;
+    private transient NavigableMap<K,V> descendingMap;
 
     /**
      * Returns a {@link Set} view of the keys contained in this map.
@@ -1586,9 +1586,9 @@
         }
 
         // Views
-        transient NavigableMap<K,V> descendingMapView = null;
-        transient EntrySetView entrySetView = null;
-        transient KeySet<K> navigableKeySetView = null;
+        transient NavigableMap<K,V> descendingMapView;
+        transient EntrySetView entrySetView;
+        transient KeySet<K> navigableKeySetView;
 
         public final NavigableSet<K> navigableKeySet() {
             KeySet<K> nksv = navigableKeySetView;
@@ -2049,8 +2049,8 @@
     static final class Entry<K,V> implements Map.Entry<K,V> {
         K key;
         V value;
-        Entry<K,V> left = null;
-        Entry<K,V> right = null;
+        Entry<K,V> left;
+        Entry<K,V> right;
         Entry<K,V> parent;
         boolean color = BLACK;
 
--- a/src/share/classes/java/util/WeakHashMap.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/java/util/WeakHashMap.java	Wed Apr 16 15:03:29 2014 -0700
@@ -759,21 +759,21 @@
 
     private abstract class HashIterator<T> implements Iterator<T> {
         private int index;
-        private Entry<K,V> entry = null;
-        private Entry<K,V> lastReturned = null;
+        private Entry<K,V> entry;
+        private Entry<K,V> lastReturned;
         private int expectedModCount = modCount;
 
         /**
          * Strong reference needed to avoid disappearance of key
          * between hasNext and next
          */
-        private Object nextKey = null;
+        private Object nextKey;
 
         /**
          * Strong reference needed to avoid disappearance of key
          * between nextEntry() and any use of the entry
          */
-        private Object currentKey = null;
+        private Object currentKey;
 
         HashIterator() {
             index = isEmpty() ? 0 : table.length;
@@ -848,7 +848,7 @@
 
     // Views
 
-    private transient Set<Map.Entry<K,V>> entrySet = null;
+    private transient Set<Map.Entry<K,V>> entrySet;
 
     /**
      * Returns a {@link Set} view of the keys contained in this map.
--- a/src/share/classes/javax/sound/midi/spi/MidiDeviceProvider.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/javax/sound/midi/spi/MidiDeviceProvider.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,26 +26,24 @@
 package javax.sound.midi.spi;
 
 import javax.sound.midi.MidiDevice;
-import javax.sound.midi.MidiUnavailableException;
 
 /**
- * A <code>MidiDeviceProvider</code> is a factory or provider for a particular
- * type of MIDI device.
- * This mechanism allows the implementation to determine
- * how resources are managed in the creation and management of
- * a device.
+ * A {@code MidiDeviceProvider} is a factory or provider for a particular type
+ * of MIDI device. This mechanism allows the implementation to determine how
+ * resources are managed in the creation and management of a device.
  *
  * @author Kara Kytle
  */
 public abstract class MidiDeviceProvider {
 
-
     /**
      * Indicates whether the device provider supports the device represented by
      * the specified device info object.
-     * @param info an info object that describes the device for which support is queried
-     * @return <code>true</code> if the specified device is supported,
-     * otherwise <code>false</code>
+     *
+     * @param  info an info object that describes the device for which support
+     *         is queried
+     * @return {@code true} if the specified device is supported, otherwise
+     *         {@code false}
      */
     public boolean isDeviceSupported(MidiDevice.Info info) {
 
@@ -59,21 +57,22 @@
         return false;
     }
 
-
     /**
-     * Obtains the set of info objects representing the device
-     * or devices provided by this <code>MidiDeviceProvider</code>.
+     * Obtains the set of info objects representing the device or devices
+     * provided by this {@code MidiDeviceProvider}.
+     *
      * @return set of device info objects
      */
     public abstract MidiDevice.Info[] getDeviceInfo();
 
-
     /**
      * Obtains an instance of the device represented by the info object.
-     * @param info an info object that describes the desired device
+     *
+     * @param  info an info object that describes the desired device
      * @return device instance
      * @throws IllegalArgumentException if the info object specified does not
-     * match the info object for a device supported by this <code>MidiDeviceProvider</code>.
+     *         match the info object for a device supported by this
+     *         {@code MidiDeviceProvider}
      */
     public abstract MidiDevice getDevice(MidiDevice.Info info);
 }
--- a/src/share/classes/javax/sound/midi/spi/MidiFileReader.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/javax/sound/midi/spi/MidiFileReader.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,9 +35,10 @@
 import javax.sound.midi.InvalidMidiDataException;
 
 /**
- * A <code>MidiFileReader</code> supplies MIDI file-reading services.  Classes implementing this
- * interface can parse the format information from one or more types of
- * MIDI file, and can produce a <code>Sequence</code> object from files of these types.
+ * A {@code MidiFileReader} supplies MIDI file-reading services. Classes
+ * implementing this interface can parse the format information from one or more
+ * types of MIDI file, and can produce a {@link Sequence} object from files of
+ * these types.
  *
  * @author Kara Kytle
  * @since 1.3
@@ -45,98 +46,102 @@
 public abstract class MidiFileReader {
 
     /**
-     * Obtains the MIDI file format of the input stream provided.  The stream must
-     * point to valid MIDI file data.  In general, MIDI file readers may
+     * Obtains the MIDI file format of the input stream provided. The stream
+     * must point to valid MIDI file data. In general, MIDI file readers may
      * need to read some data from the stream before determining whether they
-     * support it.  These parsers must
-     * be able to mark the stream, read enough data to determine whether they
-     * support the stream, and, if not, reset the stream's read pointer to its original
-     * position.  If the input stream does not support this, this method may fail
-     * with an <code>IOException</code>.
-     * @param stream the input stream from which file format information should be
-     * extracted
-     * @return a <code>MidiFileFormat</code> object describing the MIDI file format
-     * @throws InvalidMidiDataException if the stream does not point to valid MIDI
-     * file data recognized by the system
+     * support it. These parsers must be able to mark the stream, read enough
+     * data to determine whether they support the stream, and, if not, reset the
+     * stream's read pointer to its original position. If the input stream does
+     * not support this, this method may fail with an {@code IOException}.
+     *
+     * @param  stream the input stream from which file format information
+     *         should be extracted
+     * @return a {@code MidiFileFormat} object describing the MIDI file format
+     * @throws InvalidMidiDataException if the stream does not point to valid
+     *         MIDI file data recognized by the system
      * @throws IOException if an I/O exception occurs
      * @see InputStream#markSupported
      * @see InputStream#mark
      */
-    public abstract MidiFileFormat getMidiFileFormat(InputStream stream) throws InvalidMidiDataException, IOException;
-
+    public abstract MidiFileFormat getMidiFileFormat(InputStream stream)
+            throws InvalidMidiDataException, IOException;
 
     /**
-     * Obtains the MIDI file format of the URL provided.  The URL must
-     * point to valid MIDI file data.
-     * @param url the URL from which file format information should be
-     * extracted
-     * @return a <code>MidiFileFormat</code> object describing the MIDI file format
+     * Obtains the MIDI file format of the URL provided. The URL must point to
+     * valid MIDI file data.
+     *
+     * @param  url the URL from which file format information should be
+     *         extracted
+     * @return a {@code MidiFileFormat} object describing the MIDI file format
      * @throws InvalidMidiDataException if the URL does not point to valid MIDI
-     * file data recognized by the system
+     *         file data recognized by the system
      * @throws IOException if an I/O exception occurs
      */
-    public abstract MidiFileFormat getMidiFileFormat(URL url) throws InvalidMidiDataException, IOException;
-
+    public abstract MidiFileFormat getMidiFileFormat(URL url)
+            throws InvalidMidiDataException, IOException;
 
     /**
-     * Obtains the MIDI file format of the <code>File</code> provided.
-     * The <code>File</code> must point to valid MIDI file data.
-     * @param file the <code>File</code> from which file format information should be
-     * extracted
-     * @return a <code>MidiFileFormat</code> object describing the MIDI file format
-     * @throws InvalidMidiDataException if the <code>File</code> does not point to valid MIDI
-     * file data recognized by the system
+     * Obtains the MIDI file format of the {@code File} provided. The
+     * {@code File} must point to valid MIDI file data.
+     *
+     * @param  file the {@code File} from which file format information should
+     *         be extracted
+     * @return a {@code MidiFileFormat} object describing the MIDI file format
+     * @throws InvalidMidiDataException if the {@code File} does not point to
+     *         valid MIDI file data recognized by the system
      * @throws IOException if an I/O exception occurs
      */
-    public abstract MidiFileFormat getMidiFileFormat(File file) throws InvalidMidiDataException, IOException;
-
+    public abstract MidiFileFormat getMidiFileFormat(File file)
+            throws InvalidMidiDataException, IOException;
 
     /**
-     * Obtains a MIDI sequence from the input stream provided.  The stream must
-     * point to valid MIDI file data.  In general, MIDI file readers may
-     * need to read some data from the stream before determining whether they
-     * support it.  These parsers must
-     * be able to mark the stream, read enough data to determine whether they
-     * support the stream, and, if not, reset the stream's read pointer to its original
-     * position.  If the input stream does not support this, this method may fail
-     * with an IOException.
-     * @param stream the input stream from which the <code>Sequence</code> should be
-     * constructed
-     * @return a <code>Sequence</code> object based on the MIDI file data contained
-     * in the input stream.
-     * @throws InvalidMidiDataException if the stream does not point to valid MIDI
-     * file data recognized by the system
+     * Obtains a MIDI sequence from the input stream provided. The stream must
+     * point to valid MIDI file data. In general, MIDI file readers may need to
+     * read some data from the stream before determining whether they support
+     * it. These parsers must be able to mark the stream, read enough data to
+     * determine whether they support the stream, and, if not, reset the
+     * stream's read pointer to its original position. If the input stream does
+     * not support this, this method may fail with an IOException.
+     *
+     * @param  stream the input stream from which the {@code Sequence} should
+     *         be constructed
+     * @return a {@code Sequence} object based on the MIDI file data contained
+     *         in the input stream.
+     * @throws InvalidMidiDataException if the stream does not point to valid
+     *         MIDI file data recognized by the system
      * @throws IOException if an I/O exception occurs
      * @see InputStream#markSupported
      * @see InputStream#mark
      */
-    public abstract Sequence getSequence(InputStream stream) throws InvalidMidiDataException, IOException;
-
+    public abstract Sequence getSequence(InputStream stream)
+            throws InvalidMidiDataException, IOException;
 
     /**
-     * Obtains a MIDI sequence from the URL provided.  The URL must
-     * point to valid MIDI file data.
-     * @param url the URL for which the <code>Sequence</code> should be
-     * constructed
-     * @return a <code>Sequence</code> object based on the MIDI file data pointed
-     * to by the URL
+     * Obtains a MIDI sequence from the URL provided. The URL must point to
+     * valid MIDI file data.
+     *
+     * @param  url the URL for which the {@code Sequence} should be constructed
+     * @return a {@code Sequence} object based on the MIDI file data pointed to
+     *         by the URL
      * @throws InvalidMidiDataException if the URL does not point to valid MIDI
-     * file data recognized by the system
+     *         file data recognized by the system
      * @throws IOException if an I/O exception occurs
      */
-    public abstract Sequence getSequence(URL url) throws InvalidMidiDataException, IOException;
-
+    public abstract Sequence getSequence(URL url)
+            throws InvalidMidiDataException, IOException;
 
     /**
-     * Obtains a MIDI sequence from the <code>File</code> provided.  The <code>File</code> must
-     * point to valid MIDI file data.
-     * @param file the <code>File</code> from which the <code>Sequence</code> should be
-     * constructed
-     * @return a <code>Sequence</code> object based on the MIDI file data pointed
-     * to by the <code>File</code>
-     * @throws InvalidMidiDataException if the <code>File</code> does not point to valid MIDI
-     * file data recognized by the system
+     * Obtains a MIDI sequence from the {@code File} provided. The {@code File}
+     * must point to valid MIDI file data.
+     *
+     * @param  file the {@code File} from which the {@code Sequence} should be
+     *         constructed
+     * @return a {@code Sequence} object based on the MIDI file data pointed to
+     *         by the {@code File}
+     * @throws InvalidMidiDataException if the {@code File} does not point to
+     *         valid MIDI file data recognized by the system
      * @throws IOException if an I/O exception occurs
      */
-    public abstract Sequence getSequence(File file) throws InvalidMidiDataException, IOException;
+    public abstract Sequence getSequence(File file)
+            throws InvalidMidiDataException, IOException;
 }
--- a/src/share/classes/javax/sound/midi/spi/MidiFileWriter.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/javax/sound/midi/spi/MidiFileWriter.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,45 +30,44 @@
 import java.io.OutputStream;
 
 import javax.sound.midi.Sequence;
-import javax.sound.midi.MidiFileFormat;
 
 /**
- * A <code>MidiFileWriter</code> supplies MIDI file-writing services.  Classes
- * that implement this interface can write one or more types of MIDI file from
- * a <code>{@link Sequence}</code> object.
+ * A {@code MidiFileWriter} supplies MIDI file-writing services. Classes that
+ * implement this interface can write one or more types of MIDI file from a
+ * {@link Sequence} object.
  *
  * @author Kara Kytle
  * @since 1.3
  */
 public abstract class MidiFileWriter {
 
-
     /**
      * Obtains the set of MIDI file types for which file writing support is
      * provided by this file writer.
-     * @return array of file types.  If no file types are supported,
-     * an array of length 0 is returned.
+     *
+     * @return array of file types. If no file types are supported, an array of
+     *         length 0 is returned.
      */
     public abstract int[] getMidiFileTypes();
 
-
     /**
-     * Obtains the file types that this file writer can write from the
-     * sequence specified.
-     * @param sequence the sequence for which MIDI file type support
-     * is queried
-     * @return array of file types.  If no file types are supported,
-     * returns an array of length 0.
+     * Obtains the file types that this file writer can write from the sequence
+     * specified.
+     *
+     * @param  sequence the sequence for which MIDI file type support is
+     *         queried
+     * @return array of file types. If no file types are supported, returns an
+     *         array of length 0.
      */
     public abstract int[] getMidiFileTypes(Sequence sequence);
 
-
     /**
      * Indicates whether file writing support for the specified MIDI file type
      * is provided by this file writer.
-     * @param fileType the file type for which write capabilities are queried
-     * @return <code>true</code> if the file type is supported,
-     * otherwise <code>false</code>
+     *
+     * @param  fileType the file type for which write capabilities are queried
+     * @return {@code true} if the file type is supported, otherwise
+     *         {@code false}
      */
     public boolean isFileTypeSupported(int fileType) {
 
@@ -81,14 +80,14 @@
         return false;
     }
 
-
     /**
      * Indicates whether a MIDI file of the file type specified can be written
      * from the sequence indicated.
-     * @param fileType the file type for which write capabilities are queried
-     * @param sequence  the sequence for which file writing support is queried
-     * @return <code>true</code> if the file type is supported for this sequence,
-     * otherwise <code>false</code>
+     *
+     * @param  fileType the file type for which write capabilities are queried
+     * @param  sequence the sequence for which file writing support is queried
+     * @return {@code true} if the file type is supported for this sequence,
+     *         otherwise {@code false}
      */
     public boolean isFileTypeSupported(int fileType, Sequence sequence) {
 
@@ -101,35 +100,38 @@
         return false;
     }
 
-
     /**
      * Writes a stream of bytes representing a MIDI file of the file type
      * indicated to the output stream provided.
-     * @param in sequence containing MIDI data to be written to the file
-     * @param fileType type of the file to be written to the output stream
-     * @param out stream to which the file data should be written
+     *
+     * @param  in sequence containing MIDI data to be written to the file
+     * @param  fileType type of the file to be written to the output stream
+     * @param  out stream to which the file data should be written
      * @return the number of bytes written to the output stream
      * @throws IOException if an I/O exception occurs
      * @throws IllegalArgumentException if the file type is not supported by
-     * this file writer
+     *         this file writer
      * @see #isFileTypeSupported(int, Sequence)
-     * @see     #getMidiFileTypes(Sequence)
+     * @see #getMidiFileTypes(Sequence)
      */
-    public abstract int write(Sequence in, int fileType, OutputStream out) throws IOException;
-
+    public abstract int write(Sequence in, int fileType, OutputStream out)
+            throws IOException;
 
     /**
      * Writes a stream of bytes representing a MIDI file of the file type
      * indicated to the external file provided.
-     * @param in sequence containing MIDI data to be written to the external file
-     * @param fileType type of the file to be written to the external file
-     * @param out external file to which the file data should be written
+     *
+     * @param  in sequence containing MIDI data to be written to the external
+     *         file
+     * @param  fileType type of the file to be written to the external file
+     * @param  out external file to which the file data should be written
      * @return the number of bytes written to the file
      * @throws IOException if an I/O exception occurs
      * @throws IllegalArgumentException if the file type is not supported by
-     * this file writer
+     *         this file writer
      * @see #isFileTypeSupported(int, Sequence)
-     * @see     #getMidiFileTypes(Sequence)
+     * @see #getMidiFileTypes(Sequence)
      */
-    public abstract int write(Sequence in, int fileType, File out) throws IOException;
+    public abstract int write(Sequence in, int fileType, File out)
+            throws IOException;
 }
--- a/src/share/classes/javax/sound/midi/spi/SoundbankReader.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/javax/sound/midi/spi/SoundbankReader.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,60 +25,58 @@
 
 package javax.sound.midi.spi;
 
+import java.io.File;
+import java.io.IOException;
 import java.io.InputStream;
-import java.io.IOException;
-import java.io.File;
-
 import java.net.URL;
 
+import javax.sound.midi.InvalidMidiDataException;
 import javax.sound.midi.Soundbank;
-import javax.sound.midi.InvalidMidiDataException;
-
 
 /**
- * A <code>SoundbankReader</code> supplies soundbank file-reading services.
- * Concrete subclasses of <code>SoundbankReader</code> parse a given
- * soundbank file, producing a {@link javax.sound.midi.Soundbank}
- * object that can be loaded into a {@link javax.sound.midi.Synthesizer}.
+ * A {@code SoundbankReader} supplies soundbank file-reading services. Concrete
+ * subclasses of {@code SoundbankReader} parse a given soundbank file, producing
+ * a {@link javax.sound.midi.Soundbank} object that can be loaded into a
+ * {@link javax.sound.midi.Synthesizer}.
  *
  * @since 1.3
  * @author Kara Kytle
  */
 public abstract class SoundbankReader {
 
+    /**
+     * Obtains a soundbank object from the URL provided.
+     *
+     * @param  url URL representing the soundbank.
+     * @return soundbank object
+     * @throws InvalidMidiDataException if the URL does not point to valid MIDI
+     *         soundbank data recognized by this soundbank reader
+     * @throws IOException if an I/O error occurs
+     */
+    public abstract Soundbank getSoundbank(URL url)
+            throws InvalidMidiDataException, IOException;
 
     /**
-     * Obtains a soundbank object from the URL provided.
-     * @param url URL representing the soundbank.
+     * Obtains a soundbank object from the {@code InputStream} provided.
+     *
+     * @param  stream {@code InputStream} representing the soundbank
      * @return soundbank object
-     * @throws InvalidMidiDataException if the URL does not point to
-     * valid MIDI soundbank data recognized by this soundbank reader
+     * @throws InvalidMidiDataException if the stream does not point to valid
+     *         MIDI soundbank data recognized by this soundbank reader
      * @throws IOException if an I/O error occurs
      */
-    public abstract Soundbank getSoundbank(URL url) throws InvalidMidiDataException, IOException;
-
+    public abstract Soundbank getSoundbank(InputStream stream)
+            throws InvalidMidiDataException, IOException;
 
     /**
-     * Obtains a soundbank object from the <code>InputStream</code> provided.
-     * @param stream <code>InputStream</code> representing the soundbank
+     * Obtains a soundbank object from the {@code File} provided.
+     *
+     * @param  file the {@code File} representing the soundbank
      * @return soundbank object
-     * @throws InvalidMidiDataException if the stream does not point to
-     * valid MIDI soundbank data recognized by this soundbank reader
+     * @throws InvalidMidiDataException if the file does not point to valid MIDI
+     *         soundbank data recognized by this soundbank reader
      * @throws IOException if an I/O error occurs
      */
-    public abstract Soundbank getSoundbank(InputStream stream) throws InvalidMidiDataException, IOException;
-
-
-    /**
-     * Obtains a soundbank object from the <code>File</code> provided.
-     * @param file the <code>File</code> representing the soundbank
-     * @return soundbank object
-     * @throws InvalidMidiDataException if the file does not point to
-     * valid MIDI soundbank data recognized by this soundbank reader
-     * @throws IOException if an I/O error occurs
-     */
-    public abstract Soundbank getSoundbank(File file) throws InvalidMidiDataException, IOException;
-
-
-
+    public abstract Soundbank getSoundbank(File file)
+            throws InvalidMidiDataException, IOException;
 }
--- a/src/share/classes/javax/swing/JTable.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/javax/swing/JTable.java	Wed Apr 16 15:03:29 2014 -0700
@@ -4043,7 +4043,7 @@
                 }
                 // Restore the lead
                 int viewLeadIndex = modelSelection.getLeadSelectionIndex();
-                if (viewLeadIndex != -1) {
+                if (viewLeadIndex != -1 && !modelSelection.isSelectionEmpty()) {
                     viewLeadIndex = convertRowIndexToView(viewLeadIndex);
                 }
                 SwingUtilities2.setLeadAnchorWithoutSelection(
--- a/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,10 @@
 import javax.swing.event.*;
 import javax.swing.plaf.*;
 
+import static sun.swing.SwingUtilities2.drawHLine;
+import static sun.swing.SwingUtilities2.drawRect;
+import static sun.swing.SwingUtilities2.drawVLine;
+
 
 /**
  * Implementation of ScrollBarUI for the Basic Look and Feel
@@ -572,17 +576,17 @@
         g.translate(thumbBounds.x, thumbBounds.y);
 
         g.setColor(thumbDarkShadowColor);
-        g.drawRect(0, 0, w-1, h-1);
+        drawRect(g, 0, 0, w - 1, h - 1);
         g.setColor(thumbColor);
-        g.fillRect(0, 0, w-1, h-1);
+        g.fillRect(0, 0, w - 1, h - 1);
 
         g.setColor(thumbHighlightColor);
-        g.drawLine(1, 1, 1, h-2);
-        g.drawLine(2, 1, w-3, 1);
+        drawVLine(g, 1, 1, h - 2);
+        drawHLine(g, 2, w - 3, 1);
 
         g.setColor(thumbLightShadowColor);
-        g.drawLine(2, h-2, w-2, h-2);
-        g.drawLine(w-2, 1, w-2, h-3);
+        drawHLine(g, 2, w - 2, h - 2);
+        drawVLine(g, w - 2, 1, h - 3);
 
         g.translate(-thumbBounds.x, -thumbBounds.y);
     }
--- a/src/share/classes/javax/swing/plaf/metal/MetalScrollBarUI.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalScrollBarUI.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2004, 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,33 +25,23 @@
 
 package javax.swing.plaf.metal;
 
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.LayoutManager;
-import java.awt.Adjustable;
-import java.awt.event.AdjustmentListener;
-import java.awt.event.AdjustmentEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ActionEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
+import java.awt.Color;
+import java.awt.Dimension;
 import java.awt.Graphics;
-import java.awt.Dimension;
 import java.awt.Rectangle;
-import java.awt.Point;
-import java.awt.Insets;
-import java.awt.Color;
-import java.awt.IllegalComponentStateException;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
 
-import java.beans.*;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JScrollBar;
+import javax.swing.UIManager;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicScrollBarUI;
 
-import javax.swing.*;
-import javax.swing.event.*;
-
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.BasicScrollBarUI;
+import static sun.swing.SwingUtilities2.drawHLine;
+import static sun.swing.SwingUtilities2.drawRect;
+import static sun.swing.SwingUtilities2.drawVLine;
 
 
 /**
@@ -159,21 +149,21 @@
 
             if ( c.isEnabled() ) {
                 g.setColor( darkShadowColor );
-                g.drawLine( 0, 0, 0, trackBounds.height - 1 );
-                g.drawLine( trackBounds.width - 2, 0, trackBounds.width - 2, trackBounds.height - 1 );
-                g.drawLine( 2, trackBounds.height - 1, trackBounds.width - 1, trackBounds.height - 1);
-                g.drawLine( 2, 0, trackBounds.width - 2, 0 );
+                drawVLine(g, 0, 0, trackBounds.height - 1);
+                drawVLine(g, trackBounds.width - 2, 0, trackBounds.height - 1);
+                drawHLine(g, 2, trackBounds.width - 1, trackBounds.height - 1);
+                drawHLine(g, 2, trackBounds.width - 2, 0);
 
                 g.setColor( shadowColor );
                 //      g.setColor( Color.red);
-                g.drawLine( 1, 1, 1, trackBounds.height - 2 );
-                g.drawLine( 1, 1, trackBounds.width - 3, 1 );
+                drawVLine(g, 1, 1, trackBounds.height - 2);
+                drawHLine(g, 1, trackBounds.width - 3, 1);
                 if (scrollbar.getValue() != scrollbar.getMaximum()) {  // thumb shadow
                     int y = thumbRect.y + thumbRect.height - trackBounds.y;
-                    g.drawLine( 1, y, trackBounds.width-1, y);
+                    drawHLine(g, 1, trackBounds.width - 1, y);
                 }
                 g.setColor(highlightColor);
-                g.drawLine( trackBounds.width - 1, 0, trackBounds.width - 1, trackBounds.height - 1 );
+                drawVLine(g, trackBounds.width - 1, 0, trackBounds.height - 1);
             } else {
                 MetalUtils.drawDisabledBorder(g, 0, 0, trackBounds.width, trackBounds.height );
             }
@@ -193,19 +183,19 @@
 
             if ( c.isEnabled() ) {
                 g.setColor( darkShadowColor );
-                g.drawLine( 0, 0, trackBounds.width - 1, 0 );  // top
-                g.drawLine( 0, 2, 0, trackBounds.height - 2 ); // left
-                g.drawLine( 0, trackBounds.height - 2, trackBounds.width - 1, trackBounds.height - 2 ); // bottom
-                g.drawLine( trackBounds.width - 1, 2, trackBounds.width - 1, trackBounds.height - 1 ); // right
+                drawHLine(g, 0, trackBounds.width - 1, 0);  // top
+                drawVLine(g, 0, 2, trackBounds.height - 2); // left
+                drawHLine(g, 0, trackBounds.width - 1, trackBounds.height - 2 ); // bottom
+                drawVLine(g, trackBounds.width - 1, 2,  trackBounds.height - 1 ); // right
 
                 g.setColor( shadowColor );
                 //      g.setColor( Color.red);
-                g.drawLine( 1, 1, trackBounds.width - 2, 1 );  // top
-                g.drawLine( 1, 1, 1, trackBounds.height - 3 ); // left
-                g.drawLine( 0, trackBounds.height - 1, trackBounds.width - 1, trackBounds.height - 1 ); // bottom
+                drawHLine(g, 1, trackBounds.width - 2, 1 );  // top
+                drawVLine(g, 1, 1, trackBounds.height - 3 ); // left
+                drawHLine(g, 0, trackBounds.width - 1, trackBounds.height - 1 ); // bottom
                 if (scrollbar.getValue() != scrollbar.getMaximum()) {  // thumb shadow
                     int x = thumbRect.x + thumbRect.width - trackBounds.x;
-                    g.drawLine( x, 1, x, trackBounds.height-1);
+                    drawVLine(g, x, 1, trackBounds.height-1);
                 }
             } else {
                 MetalUtils.drawDisabledBorder(g, 0, 0, trackBounds.width, trackBounds.height );
@@ -247,11 +237,11 @@
             g.fillRect( 0, 0, thumbBounds.width - 2, thumbBounds.height - 1 );
 
             g.setColor( thumbShadow );
-            g.drawRect( 0, 0, thumbBounds.width - 2, thumbBounds.height - 1 );
+            drawRect(g, 0, 0, thumbBounds.width - 2, thumbBounds.height - 1);
 
             g.setColor( thumbHighlightColor );
-            g.drawLine( 1, 1, thumbBounds.width - 3, 1 );
-            g.drawLine( 1, 1, 1, thumbBounds.height - 2 );
+            drawHLine(g, 1, thumbBounds.width - 3, 1);
+            drawVLine(g, 1, 1, thumbBounds.height - 2);
 
             bumps.setBumpArea( thumbBounds.width - 6, thumbBounds.height - 7 );
             bumps.paintIcon( c, g, 3, 4 );
@@ -273,11 +263,11 @@
             g.fillRect( 0, 0, thumbBounds.width - 1, thumbBounds.height - 2 );
 
             g.setColor( thumbShadow );
-            g.drawRect( 0, 0, thumbBounds.width - 1, thumbBounds.height - 2 );
+            drawRect(g, 0, 0, thumbBounds.width - 1, thumbBounds.height - 2);
 
             g.setColor( thumbHighlightColor );
-            g.drawLine( 1, 1, thumbBounds.width - 3, 1 );
-            g.drawLine( 1, 1, 1, thumbBounds.height - 3 );
+            drawHLine(g, 1, thumbBounds.width - 3, 1);
+            drawVLine(g, 1, 1, thumbBounds.height - 3);
 
             bumps.setBumpArea( thumbBounds.width - 7, thumbBounds.height - 6 );
             bumps.paintIcon( c, g, 4, 3 );
@@ -310,11 +300,11 @@
             }
 
             g.setColor(thumbShadow);
-            g.drawRect(0, 0, thumbBounds.width - 2, thumbBounds.height - 1);
+            drawRect(g, 0, 0, thumbBounds.width - 2, thumbBounds.height - 1);
 
             g.setColor(thumbHighlightColor);
-            g.drawLine(1, 1, thumbBounds.width - 3, 1);
-            g.drawLine(1, 1, 1, thumbBounds.height - 2);
+            drawHLine(g, 1, thumbBounds.width - 3, 1);
+            drawVLine(g, 1, 1, thumbBounds.height - 2);
 
             MetalUtils.drawGradient(c, g, "ScrollBar.gradient", 2, 2,
                                     thumbBounds.width - 4,
@@ -352,11 +342,11 @@
             }
 
             g.setColor(thumbShadow);
-            g.drawRect(0, 0, thumbBounds.width - 1, thumbBounds.height - 2);
+            drawRect(g, 0, 0, thumbBounds.width - 1, thumbBounds.height - 2);
 
             g.setColor(thumbHighlightColor);
-            g.drawLine(1, 1, thumbBounds.width - 2, 1);
-            g.drawLine(1, 1, 1, thumbBounds.height - 3);
+            drawHLine(g, 1, thumbBounds.width - 2, 1);
+            drawVLine(g, 1, 1, thumbBounds.height - 3);
 
             MetalUtils.drawGradient(c, g, "ScrollBar.gradient", 2, 2,
                                     thumbBounds.width - 3,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/net/ExtendedSocketOptions.java	Wed Apr 16 15:03:29 2014 -0700
@@ -0,0 +1,62 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.net;
+
+import java.net.SocketOption;
+
+/**
+ * Defines extended socket options, beyond those defined in
+ * {@link java.net.StandardSocketOptions}. These options may be platform
+ * specific.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public final class ExtendedSocketOptions {
+
+    private static class ExtSocketOption<T> implements SocketOption<T> {
+        private final String name;
+        private final Class<T> type;
+        ExtSocketOption(String name, Class<T> type) {
+            this.name = name;
+            this.type = type;
+        }
+        @Override public String name() { return name; }
+        @Override public Class<T> type() { return type; }
+        @Override public String toString() { return name; }
+    }
+
+    private ExtendedSocketOptions() {}
+
+    /**
+     * Service level properties. When a security manager is installed,
+     * setting or getting this option requires a {@link NetworkPermission}
+     * {@code ("setOption.SO_FLOW_SLA")} or {@code "getOption.SO_FLOW_SLA"}
+     * respectively.
+     */
+    public static final SocketOption<SocketFlow> SO_FLOW_SLA = new
+        ExtSocketOption<SocketFlow>("SO_FLOW_SLA", SocketFlow.class);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/net/NetworkPermission.java	Wed Apr 16 15:03:29 2014 -0700
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.net;
+
+import java.security.BasicPermission;
+
+/**
+ * Represents permission to access the extended networking capabilities
+ * defined in the jdk.net package. These permissions contain a target
+ * name, but no actions list. Callers either possess the permission or not.
+ * <p>
+ * The following targets are defined:
+ * <p>
+ * <table border=1 cellpadding=5 summary="permission target name,
+ *  what the target allows,and associated risks">
+ * <tr>
+ *   <th>Permission Target Name</th>
+ *   <th>What the Permission Allows</th>
+ *   <th>Risks of Allowing this Permission</th>
+ * </tr>
+ * <tr>
+ *   <td>setOption.SO_FLOW_SLA</td>
+ *   <td>set the {@link ExtendedSocketOptions#SO_FLOW_SLA SO_FLOW_SLA} option
+ *       on any socket that supports it</td>
+ *   <td>allows caller to set a higher priority or bandwidth allocation
+ *       to sockets it creates, than they might otherwise be allowed.</td>
+ * </tr>
+ * <tr>
+ *   <td>getOption.SO_FLOW_SLA</td>
+ *   <td>retrieve the {@link ExtendedSocketOptions#SO_FLOW_SLA SO_FLOW_SLA}
+ *       setting from any socket that supports the option</td>
+ *   <td>allows caller access to SLA information that it might not
+ *       otherwise have</td>
+ * </tr></table>
+ *
+ * @see jdk.net.ExtendedSocketOptions
+ *
+ * @since 1.9
+ */
+
+@jdk.Exported
+public final class NetworkPermission extends BasicPermission {
+
+    private static final long serialVersionUID = -2012939586906722291L;
+
+    /**
+     * Creates a NetworkPermission with the given target name.
+     *
+     * @param name the permission target name
+     * @throws NullPointerException if {@code name} is {@code null}.
+     * @throws IllegalArgumentException if {@code name} is empty.
+     */
+    public NetworkPermission(String name) {
+        super(name);
+    }
+
+    /**
+     * Creates a NetworkPermission with the given target name.
+     *
+     * @param name the permission target name
+     * @param actions should be {@code null}. Is ignored if not.
+     * @throws NullPointerException if {@code name} is {@code null}.
+     * @throws IllegalArgumentException if {@code name} is empty.
+     */
+    public NetworkPermission(String name, String actions) {
+        super(name, actions);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/net/SocketFlow.java	Wed Apr 16 15:03:29 2014 -0700
@@ -0,0 +1,169 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.net;
+
+import java.lang.annotation.Native;
+
+/**
+ * Represents the service level properties for the platform specific socket
+ * option {@link ExtendedSocketOptions#SO_FLOW_SLA}.
+ * <p>
+ * The priority and bandwidth parameters must be set before
+ * setting the socket option.
+ * <p>
+ * When the {@code SO_FLOW_SLA} option is set then it may not take effect
+ * immediately. If the value of the socket option is obtained with
+ * {@code getOption()} then the status may be returned as {@code INPROGRESS}
+ * until it takes effect. The priority and bandwidth values are only valid when
+ * the status is returned as OK.
+ * <p>
+ * When a security manager is installed, a {@link NetworkPermission}
+ * is required to set or get this option.
+ *
+ * @since 1.9
+ */
+@jdk.Exported
+public class SocketFlow {
+
+    private static final int UNSET = -1;
+    @Native public static final int NORMAL_PRIORITY = 1;
+    @Native public static final int HIGH_PRIORITY = 2;
+
+    private int priority = NORMAL_PRIORITY;
+
+    private long bandwidth = UNSET;
+
+    private Status status = Status.NO_STATUS;
+
+    private SocketFlow() {}
+
+    /**
+     * Enumeration of the return values from the SO_FLOW_SLA
+     * socket option. Both setting and getting the option return
+     * one of these statuses, which reflect the state of socket's
+     * flow.
+     *
+     * @since 1.9
+     */
+    @jdk.Exported
+    public enum Status {
+        /**
+         * Set or get socket option has not been called yet. Status
+         * values can only be retrieved after calling set or get.
+         */
+        NO_STATUS,
+        /**
+         * Flow successfully created.
+         */
+        OK,
+        /**
+         * Caller has no permission to create flow.
+         */
+        NO_PERMISSION,
+        /**
+         * Flow can not be created because socket is not connected.
+         */
+        NOT_CONNECTED,
+        /**
+         * Flow creation not supported for this socket.
+         */
+        NOT_SUPPORTED,
+        /**
+         * A flow already exists with identical attributes.
+         */
+        ALREADY_CREATED,
+        /**
+         * A flow is being created.
+         */
+        IN_PROGRESS,
+        /**
+         * Some other unspecified error.
+         */
+        OTHER
+    }
+
+    /**
+     * Creates a new SocketFlow that can be used to set the SO_FLOW_SLA
+     * socket option and create a socket flow.
+     */
+    public static SocketFlow create() {
+        return new SocketFlow();
+    }
+
+    /**
+     * Sets this SocketFlow's priority. Must be either NORMAL_PRIORITY
+     * HIGH_PRIORITY. If not set, a flow's priority is normal.
+     *
+     * @throws IllegalArgumentException if priority is not NORMAL_PRIORITY or
+     *         HIGH_PRIORITY.
+     */
+    public SocketFlow priority(int priority) {
+        if (priority != NORMAL_PRIORITY && priority != HIGH_PRIORITY) {
+            throw new IllegalArgumentException("invalid priority");
+        }
+        this.priority = priority;
+        return this;
+    }
+
+    /**
+     * Sets this SocketFlow's bandwidth. Must be greater than or equal to zero.
+     * A value of zero drops all packets for the socket.
+     *
+     * @throws IllegalArgumentException if bandwidth is less than zero.
+     */
+    public SocketFlow bandwidth(long bandwidth) {
+        if (bandwidth < 0) {
+            throw new IllegalArgumentException("invalid bandwidth");
+        } else {
+            this.bandwidth = bandwidth;
+        }
+        return this;
+    }
+
+    /**
+     * Returns this SocketFlow's priority.
+     */
+    public int priority() {
+        return priority;
+    }
+
+    /**
+     * Returns this SocketFlow's bandwidth.
+     *
+     * @return this SocketFlow's bandwidth, or {@code -1} if status is not OK.
+     */
+    public long bandwidth() {
+        return bandwidth;
+    }
+
+    /**
+     * Returns the Status value of this SocketFlow. NO_STATUS is returned
+     * if the object was not used in a call to set or get the option.
+     */
+    public Status status() {
+        return status;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/net/Sockets.java	Wed Apr 16 15:03:29 2014 -0700
@@ -0,0 +1,402 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.net;
+
+import java.net.*;
+import java.io.IOException;
+import java.io.FileDescriptor;
+import java.security.PrivilegedAction;
+import java.security.AccessController;
+import java.lang.reflect.*;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.HashMap;
+import java.util.Collections;
+import sun.net.ExtendedOptionsImpl;
+
+/**
+ * Defines static methods to set and get socket options defined by the
+ * {@link java.net.SocketOption} interface. All of the standard options defined
+ * by {@link java.net.Socket}, {@link java.net.ServerSocket}, and
+ * {@link java.net.DatagramSocket} can be set this way, as well as additional
+ * or platform specific options supported by each socket type.
+ * <p>
+ * The {@link #supportedOptions(Class)} method can be called to determine
+ * the complete set of options available (per socket type) on the
+ * current system.
+ * <p>
+ * When a security manager is installed, some non-standard socket options
+ * may require a security permission before being set or get.
+ * The details are specified in {@link ExtendedSocketOptions}. No permission
+ * is required for {@link java.net.StandardSocketOption}s.
+ *
+ * @see java.nio.channels.NetworkChannel
+ */
+@jdk.Exported
+public class Sockets {
+
+    private final static HashMap<Class<?>,Set<SocketOption<?>>>
+        options = new HashMap<>();
+
+    static {
+        initOptionSets();
+        AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    initMethods();
+                    return null;
+                }
+            }
+        );
+    }
+
+    private static Method siSetOption;
+    private static Method siGetOption;
+    private static Method dsiSetOption;
+    private static Method dsiGetOption;
+
+    private static void initMethods() {
+        try {
+            Class<?> clazz = Class.forName("java.net.SocketSecrets");
+
+            siSetOption = clazz.getDeclaredMethod(
+                "setOption", Object.class,
+                SocketOption.class, Object.class
+            );
+            siSetOption.setAccessible(true);
+
+            siGetOption = clazz.getDeclaredMethod(
+                "getOption", Object.class, SocketOption.class
+            );
+            siGetOption.setAccessible(true);
+
+            dsiSetOption = clazz.getDeclaredMethod(
+                "setOption", DatagramSocket.class,
+                SocketOption.class, Object.class
+            );
+            dsiSetOption.setAccessible(true);
+
+            dsiGetOption = clazz.getDeclaredMethod(
+                "getOption", DatagramSocket.class, SocketOption.class
+            );
+            dsiGetOption.setAccessible(true);
+        } catch (ReflectiveOperationException e) {
+            throw new InternalError(e);
+        }
+    }
+
+    private static <T> void invokeSet(
+        Method method, Object socket,
+        SocketOption<T> option, T value) throws IOException
+    {
+        try {
+            method.invoke(null, socket, option, value);
+        } catch (Exception e) {
+            if (e instanceof InvocationTargetException) {
+                Throwable t = ((InvocationTargetException)e).getTargetException();
+                if (t instanceof IOException) {
+                    throw (IOException)t;
+                }
+            }
+            throw new RuntimeException(e);
+        }
+    }
+
+    private static <T> T invokeGet(
+        Method method, Object socket, SocketOption<T> option) throws IOException
+    {
+        try {
+            return (T)method.invoke(null, socket, option);
+        } catch (Exception e) {
+            if (e instanceof InvocationTargetException) {
+                Throwable t = ((InvocationTargetException)e).getTargetException();
+                if (t instanceof IOException) {
+                    throw (IOException)t;
+                }
+            }
+            throw new RuntimeException(e);
+        }
+    }
+
+    private Sockets() {}
+
+    /**
+     * Sets the value of a socket option on a {@link java.net.Socket}
+     *
+     * @param s the socket
+     * @param name The socket option
+     * @param value The value of the socket option. May be null for some
+     *              options.
+     *
+     * @throws UnsupportedOperationException if the socket does not support
+     *         the option.
+     *
+     * @throws IllegalArgumentException if the value is not valid for
+     *         the option.
+     *
+     * @throws IOException if an I/O error occurs, or socket is closed.
+     *
+     * @throws SecurityException if a security manager is set and the
+     *         caller does not have any required permission.
+     *
+     * @throws NullPointerException if name is null
+     *
+     * @see java.net.StandardSocketOptions
+     */
+    public static <T> void setOption(Socket s, SocketOption<T> name, T value) throws IOException
+    {
+        if (!isSupported(Socket.class, name)) {
+            throw new UnsupportedOperationException(name.name());
+        }
+        invokeSet(siSetOption, s, name, value);
+    }
+
+    /**
+     * Returns the value of a socket option from a {@link java.net.Socket}
+     *
+     * @param s the socket
+     * @param name The socket option
+     *
+     * @return The value of the socket option.
+     *
+     * @throws UnsupportedOperationException if the socket does not support
+     *         the option.
+     *
+     * @throws IOException if an I/O error occurs
+     *
+     * @throws SecurityException if a security manager is set and the
+     *         caller does not have any required permission.
+     *
+     * @throws NullPointerException if name is null
+     *
+     * @see java.net.StandardSocketOptions
+     */
+    public static <T> T getOption(Socket s, SocketOption<T> name) throws IOException
+    {
+        if (!isSupported(Socket.class, name)) {
+            throw new UnsupportedOperationException(name.name());
+        }
+        return invokeGet(siGetOption, s, name);
+    }
+
+    /**
+     * Sets the value of a socket option on a {@link java.net.ServerSocket}
+     *
+     * @param s the socket
+     * @param name The socket option
+     * @param value The value of the socket option.
+     *
+     * @throws UnsupportedOperationException if the socket does not support
+     *         the option.
+     *
+     * @throws IllegalArgumentException if the value is not valid for
+     *         the option.
+     *
+     * @throws IOException if an I/O error occurs
+     *
+     * @throws NullPointerException if name is null
+     *
+     * @throws SecurityException if a security manager is set and the
+     *         caller does not have any required permission.
+     *
+     * @see java.net.StandardSocketOptions
+     */
+    public static <T> void setOption(ServerSocket s, SocketOption<T> name, T value) throws IOException
+    {
+        if (!isSupported(ServerSocket.class, name)) {
+            throw new UnsupportedOperationException(name.name());
+        }
+        invokeSet(siSetOption, s, name, value);
+    }
+
+    /**
+     * Returns the value of a socket option from a {@link java.net.ServerSocket}
+     *
+     * @param s the socket
+     * @param name The socket option
+     *
+     * @return The value of the socket option.
+     *
+     * @throws UnsupportedOperationException if the socket does not support
+     *         the option.
+     *
+     * @throws IOException if an I/O error occurs
+     *
+     * @throws NullPointerException if name is null
+     *
+     * @throws SecurityException if a security manager is set and the
+     *         caller does not have any required permission.
+     *
+     * @see java.net.StandardSocketOptions
+     */
+    public static <T> T getOption(ServerSocket s, SocketOption<T> name) throws IOException
+    {
+        if (!isSupported(ServerSocket.class, name)) {
+            throw new UnsupportedOperationException(name.name());
+        }
+        return invokeGet(siGetOption, s, name);
+    }
+
+    /**
+     * Sets the value of a socket option on a {@link java.net.DatagramSocket}
+     * or {@link java.net.MulticastSocket}
+     *
+     * @param s the socket
+     * @param name The socket option
+     * @param value The value of the socket option.
+     *
+     * @throws UnsupportedOperationException if the socket does not support
+     *         the option.
+     *
+     * @throws IllegalArgumentException if the value is not valid for
+     *         the option.
+     *
+     * @throws IOException if an I/O error occurs
+     *
+     * @throws NullPointerException if name is null
+     *
+     * @throws SecurityException if a security manager is set and the
+     *         caller does not have any required permission.
+     *
+     * @see java.net.StandardSocketOptions
+     */
+    public static <T> void setOption(DatagramSocket s, SocketOption<T> name, T value) throws IOException
+    {
+        if (!isSupported(s.getClass(), name)) {
+            throw new UnsupportedOperationException(name.name());
+        }
+        invokeSet(dsiSetOption, s, name, value);
+    }
+
+    /**
+     * Returns the value of a socket option from a
+     * {@link java.net.DatagramSocket} or {@link java.net.MulticastSocket}
+     *
+     * @param s the socket
+     * @param name The socket option
+     *
+     * @return The value of the socket option.
+     *
+     * @throws UnsupportedOperationException if the socket does not support
+     *         the option.
+     *
+     * @throws IOException if an I/O error occurs
+     *
+     * @throws NullPointerException if name is null
+     *
+     * @throws SecurityException if a security manager is set and the
+     *         caller does not have any required permission.
+     *
+     * @see java.net.StandardSocketOptions
+     */
+    public static <T> T getOption(DatagramSocket s, SocketOption<T> name) throws IOException
+    {
+        if (!isSupported(s.getClass(), name)) {
+            throw new UnsupportedOperationException(name.name());
+        }
+        return invokeGet(dsiGetOption, s, name);
+    }
+
+    /**
+     * Returns a set of {@link java.net.SocketOption}s supported by the
+     * given socket type. This set may include standard options and also
+     * non standard extended options.
+     *
+     * @param socketType the type of java.net socket
+     *
+     * @throws IllegalArgumentException if socketType is not a valid
+     *         socket type from the java.net package.
+     */
+    public static Set<SocketOption<?>> supportedOptions(Class<?> socketType) {
+        Set<SocketOption<?>> set = options.get(socketType);
+        if (set == null) {
+            throw new IllegalArgumentException("unknown socket type");
+        }
+        return set;
+    }
+
+    private static boolean isSupported(Class<?> type, SocketOption<?> option) {
+        Set<SocketOption<?>> options = supportedOptions(type);
+        return options.contains(option);
+    }
+
+    private static void initOptionSets() {
+        boolean flowsupported = ExtendedOptionsImpl.flowSupported();
+
+        // Socket
+
+        Set<SocketOption<?>> set = new HashSet<>();
+        set.add(StandardSocketOptions.SO_KEEPALIVE);
+        set.add(StandardSocketOptions.SO_SNDBUF);
+        set.add(StandardSocketOptions.SO_RCVBUF);
+        set.add(StandardSocketOptions.SO_REUSEADDR);
+        set.add(StandardSocketOptions.SO_LINGER);
+        set.add(StandardSocketOptions.IP_TOS);
+        set.add(StandardSocketOptions.TCP_NODELAY);
+        if (flowsupported) {
+            set.add(ExtendedSocketOptions.SO_FLOW_SLA);
+        }
+        set = Collections.unmodifiableSet(set);
+        options.put(Socket.class, set);
+
+        // ServerSocket
+
+        set = new HashSet<>();
+        set.add(StandardSocketOptions.SO_RCVBUF);
+        set.add(StandardSocketOptions.SO_REUSEADDR);
+        set = Collections.unmodifiableSet(set);
+        options.put(ServerSocket.class, set);
+
+        // DatagramSocket
+
+        set = new HashSet<>();
+        set.add(StandardSocketOptions.SO_SNDBUF);
+        set.add(StandardSocketOptions.SO_RCVBUF);
+        set.add(StandardSocketOptions.SO_REUSEADDR);
+        set.add(StandardSocketOptions.IP_TOS);
+        if (flowsupported) {
+            set.add(ExtendedSocketOptions.SO_FLOW_SLA);
+        }
+        set = Collections.unmodifiableSet(set);
+        options.put(DatagramSocket.class, set);
+
+        // MulticastSocket
+
+        set = new HashSet<>();
+        set.add(StandardSocketOptions.SO_SNDBUF);
+        set.add(StandardSocketOptions.SO_RCVBUF);
+        set.add(StandardSocketOptions.SO_REUSEADDR);
+        set.add(StandardSocketOptions.IP_TOS);
+        set.add(StandardSocketOptions.IP_MULTICAST_IF);
+        set.add(StandardSocketOptions.IP_MULTICAST_TTL);
+        set.add(StandardSocketOptions.IP_MULTICAST_LOOP);
+        if (flowsupported) {
+            set.add(ExtendedSocketOptions.SO_FLOW_SLA);
+        }
+        set = Collections.unmodifiableSet(set);
+        options.put(MulticastSocket.class, set);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/jdk/net/package-info.java	Wed Apr 16 15:03:29 2014 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Platform specific socket options for the {@code java.net} and {@code java.nio.channels}
+ * socket classes.
+ *
+ * @since 1.9
+ */
+
+@jdk.Exported
+package jdk.net;
--- a/src/share/classes/sun/applet/AppletPanel.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/applet/AppletPanel.java	Wed Apr 16 15:03:29 2014 -0700
@@ -28,23 +28,16 @@
 import java.applet.*;
 import java.awt.*;
 import java.awt.event.*;
-import java.awt.image.ColorModel;
-import java.awt.image.MemoryImageSource;
 import java.io.*;
 import java.lang.ref.WeakReference;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.net.InetAddress;
 import java.net.JarURLConnection;
-import java.net.MalformedURLException;
 import java.net.SocketPermission;
 import java.net.URL;
-import java.net.UnknownHostException;
 import java.security.*;
 import java.util.*;
-import java.util.Collections;
 import java.util.Locale;
-import java.util.WeakHashMap;
 import sun.awt.AWTAccessor;
 import sun.awt.AppContext;
 import sun.awt.EmbeddedFrame;
@@ -148,7 +141,9 @@
     abstract protected String getJarFiles();
     abstract protected String getSerializedObject();
 
+    @Override
     abstract public int    getWidth();
+    @Override
     abstract public int    getHeight();
     abstract public boolean hasInitialFocus();
 
@@ -184,6 +179,7 @@
         handler = new Thread(appletGroup, this, "thread " + nm);
         // set the context class loader for this thread
         AccessController.doPrivileged(new PrivilegedAction() {
+                @Override
                 public Object run() {
                     handler.setContextClassLoader(loader);
                     return null;
@@ -236,6 +232,7 @@
     /**
      * Minimum size
      */
+    @Override
     public Dimension minimumSize() {
         return new Dimension(defaultAppletSize.width,
                              defaultAppletSize.height);
@@ -244,6 +241,7 @@
     /**
      * Preferred size
      */
+    @Override
     public Dimension preferredSize() {
         return new Dimension(currentAppletSize.width,
                              currentAppletSize.height);
@@ -368,6 +366,7 @@
      *
      *
      */
+    @Override
     public void run() {
 
         Thread curThread = Thread.currentThread();
@@ -450,6 +449,7 @@
                       try {
                           final AppletPanel p = this;
                           Runnable r = new Runnable() {
+                              @Override
                               public void run() {
                                   p.validate();
                               }
@@ -480,6 +480,7 @@
                           final AppletPanel p = this;
                           final Applet a = applet;
                           Runnable r = new Runnable() {
+                              @Override
                               public void run() {
                                   p.validate();
                                   a.setVisible(true);
@@ -515,6 +516,7 @@
                     try {
                         final Applet a = applet;
                         Runnable r = new Runnable() {
+                            @Override
                             public void run() {
                                 a.setVisible(false);
                             }
@@ -574,6 +576,7 @@
                     try {
                         final Applet a = applet;
                         Runnable r = new Runnable() {
+                            @Override
                             public void run() {
                                 remove(a);
                             }
@@ -628,10 +631,13 @@
      */
     private Component getMostRecentFocusOwnerForWindow(Window w) {
         Method meth = (Method)AccessController.doPrivileged(new PrivilegedAction() {
+                @Override
                 public Object run() {
                     Method meth = null;
                     try {
-                        meth = KeyboardFocusManager.class.getDeclaredMethod("getMostRecentFocusOwner", new Class[] {Window.class});
+                        meth = KeyboardFocusManager.class.getDeclaredMethod(
+                                "getMostRecentFocusOwner",
+                                new Class[]{Window.class});
                         meth.setAccessible(true);
                     } catch (Exception e) {
                         // Must never happen
@@ -880,6 +886,7 @@
     /**
      * Return true when the applet has been started.
      */
+    @Override
     public boolean isActive() {
         return status == APPLET_START;
     }
@@ -889,6 +896,7 @@
     /**
      * Is called when the applet wants to be resized.
      */
+    @Override
     public void appletResize(int width, int height) {
         currentAppletSize.width = width;
         currentAppletSize.height = height;
@@ -904,17 +912,20 @@
         final AppletPanel ap = this;
         if (appEvtQ != null){
             appEvtQ.postEvent(new InvocationEvent(Toolkit.getDefaultToolkit(),
-                                                  new Runnable(){
-                                                      public void run(){
-                                                          if(ap != null)
-                                                          {
-                                                              ap.dispatchAppletEvent(APPLET_RESIZE, currentSize);
+                                                  new Runnable() {
+                                                      @Override
+                                                      public void run() {
+                                                          if (ap != null) {
+                                                              ap.dispatchAppletEvent(
+                                                                      APPLET_RESIZE,
+                                                                      currentSize);
                                                           }
                                                       }
                                                   }));
         }
     }
 
+    @Override
     public void setBounds(int x, int y, int width, int height) {
         super.setBounds(x, y, width, height);
         currentAppletSize.width = width;
@@ -966,7 +977,7 @@
     public String getClassLoaderCacheKey()
     {
         /**
-         * Fixed #4501142: Classlaoder sharing policy doesn't
+         * Fixed #4501142: Classloader sharing policy doesn't
          * take "archive" into account. This will be overridden
          * by Java Plug-in.                     [stanleyh]
          */
@@ -1012,6 +1023,7 @@
                 getAccessControlContext(codebase);
             c = (AppletClassLoader)
                 AccessController.doPrivileged(new PrivilegedAction() {
+                        @Override
                         public Object run() {
                             AppletClassLoader ac = createClassLoader(codebase);
                             /* Should the creation of the classloader be
@@ -1055,6 +1067,7 @@
 
         PermissionCollection perms = (PermissionCollection)
             AccessController.doPrivileged(new PrivilegedAction() {
+                    @Override
                     public Object run() {
                         Policy p = java.security.Policy.getPolicy();
                         if (p != null) {
--- a/src/share/classes/sun/applet/AppletViewer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/applet/AppletViewer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -33,21 +33,17 @@
 import javax.print.attribute.*;
 import java.applet.*;
 import java.net.URL;
-import java.net.MalformedURLException;
 import java.net.SocketPermission;
 import sun.misc.Ref;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import sun.awt.SunToolkit;
 import sun.awt.AppContext;
-import java.lang.ref.WeakReference;
 
 /**
  * A frame to show the applet tag in.
  */
-class TextFrame extends Frame {
+final class TextFrame extends Frame {
 
     /**
      * Create the tag frame.
@@ -66,6 +62,7 @@
         p.add(b);
 
         class ActionEventListener implements ActionListener {
+            @Override
             public void actionPerformed(ActionEvent evt) {
                 dispose();
             }
@@ -78,6 +75,7 @@
 
         WindowListener windowEventListener = new WindowAdapter() {
 
+            @Override
             public void windowClosing(WindowEvent evt) {
                 dispose();
             }
@@ -90,20 +88,22 @@
 }
 
 /**
- * Lets us construct one using unix-style one shot behaviors
+ * Lets us construct one using unix-style one shot behaviors.
  */
+final class StdAppletViewerFactory implements AppletViewerFactory {
 
-class StdAppletViewerFactory implements AppletViewerFactory
-{
+    @Override
     public AppletViewer createAppletViewer(int x, int y,
                                            URL doc, Hashtable atts) {
         return new AppletViewer(x, y, doc, atts, System.out, this);
     }
 
+    @Override
     public MenuBar getBaseMenuBar() {
         return new MenuBar();
     }
 
+    @Override
     public boolean isStandalone() {
         return true;
     }
@@ -116,8 +116,7 @@
  * (The document named appletviewertags.html in the JDK's docs/tooldocs directory,
  *  once the JDK docs have been installed.)
  */
-public class AppletViewer extends Frame implements AppletContext,
-                                                   Printable {
+public class AppletViewer extends Frame implements AppletContext, Printable {
 
     /**
      * Some constants...
@@ -147,13 +146,14 @@
 
 
     private final class UserActionListener implements ActionListener {
+        @Override
         public void actionPerformed(ActionEvent evt) {
             processUserAction(evt);
         }
     }
 
     /**
-     * Create the applet viewer
+     * Create the applet viewer.
      */
     public AppletViewer(int x, int y, URL doc, Hashtable atts,
                         PrintStream statusMsgStream, AppletViewerFactory factory) {
@@ -201,14 +201,17 @@
 
         WindowListener windowEventListener = new WindowAdapter() {
 
+            @Override
             public void windowClosing(WindowEvent evt) {
                 appletClose();
             }
 
+            @Override
             public void windowIconified(WindowEvent evt) {
                 appletStop();
             }
 
+            @Override
             public void windowDeiconified(WindowEvent evt) {
                 appletStart();
             }
@@ -223,6 +226,7 @@
                 this.frame = frame;
             }
 
+            @Override
             public void appletStateChanged(AppletEvent evt)
             {
                 AppletPanel src = (AppletPanel)evt.getSource();
@@ -370,6 +374,7 @@
     /**
      * Get an audio clip.
      */
+    @Override
     public AudioClip getAudioClip(URL url) {
         checkConnect(url);
         synchronized (audioClips) {
@@ -386,6 +391,7 @@
     /**
      * Get an image.
      */
+    @Override
     public Image getImage(URL url) {
         return getCachedImage(url);
     }
@@ -421,6 +427,7 @@
     /**
      * Get an applet by name.
      */
+    @Override
     public Applet getApplet(String name) {
         AppletSecurity security = (AppletSecurity)System.getSecurityManager();
         name = name.toLowerCase();
@@ -450,6 +457,7 @@
      * Return an enumeration of all the accessible
      * applets on this page.
      */
+    @Override
     public Enumeration getApplets() {
         AppletSecurity security = (AppletSecurity)System.getSecurityManager();
         Vector v = new Vector();
@@ -473,31 +481,37 @@
     /**
      * Ignore.
      */
+    @Override
     public void showDocument(URL url) {
     }
 
     /**
      * Ignore.
      */
+    @Override
     public void showDocument(URL url, String target) {
     }
 
     /**
      * Show status.
      */
+    @Override
     public void showStatus(String status) {
         label.setText(status);
     }
 
+    @Override
     public void setStream(String key, InputStream stream)throws IOException{
         // We do nothing.
     }
 
+    @Override
     public InputStream getStream(String key){
         // We do nothing.
         return null;
     }
 
+    @Override
     public Iterator getStreamKeys(){
         // We do nothing.
         return null;
@@ -611,7 +625,7 @@
         panel.sendEvent(AppletPanel.APPLET_DISPOSE);
 
         /**
-         * Fixed #4501142: Classlaoder sharing policy doesn't
+         * Fixed #4501142: Classloader sharing policy doesn't
          * take "archive" into account. This will be overridden
          * by Java Plug-in.                     [stanleyh]
          */
@@ -640,6 +654,7 @@
     void appletSave() {
         AccessController.doPrivileged(new PrivilegedAction() {
 
+            @Override
             public Object run() {
                 // XXX: this privileged block should be made smaller
                 // by initializing a private static variable with "user.dir"
@@ -768,6 +783,7 @@
         }
     }
 
+    @Override
     public int print(Graphics graphics, PageFormat pf, int pageIndex) {
         if (pageIndex > 0) {
             return Printable.NO_SUCH_PAGE;
@@ -832,6 +848,7 @@
 
         new Thread(new Runnable()
         {
+            @Override
             public void run()
             {
                 appletShutdown(p);
@@ -867,6 +884,7 @@
         //
         new Thread(new Runnable()
         {
+            @Override
             public void run()
             {
                 for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) {
--- a/src/share/classes/sun/awt/image/MultiResolutionBufferedImage.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/awt/image/MultiResolutionBufferedImage.java	Wed Apr 16 15:03:29 2014 -0700
@@ -24,6 +24,7 @@
  */
 package sun.awt.image;
 
+import java.awt.Dimension;
 import java.awt.Image;
 import java.awt.Graphics;
 import java.awt.geom.Dimension2D;
@@ -43,6 +44,13 @@
     private int availableInfo;
 
     public MultiResolutionBufferedImage(Image baseImage,
+            BiFunction<Integer, Integer, Image> mapper) {
+        this(baseImage, new Dimension[]{new Dimension(
+            baseImage.getWidth(null), baseImage.getHeight(null))
+        }, mapper);
+    }
+
+    public MultiResolutionBufferedImage(Image baseImage,
             Dimension2D[] sizes, BiFunction<Integer, Integer, Image> mapper) {
         super(baseImage.getWidth(null), baseImage.getHeight(null),
                 BufferedImage.TYPE_INT_ARGB_PRE);
@@ -115,7 +123,7 @@
     }
 
     private static void preload(Image image, int availableInfo) {
-        if (image instanceof ToolkitImage) {
+        if (availableInfo != 0 && image instanceof ToolkitImage) {
             ((ToolkitImage) image).preload(new ImageObserver() {
                 int flags = availableInfo;
 
--- a/src/share/classes/sun/java2d/pipe/DrawImage.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/java2d/pipe/DrawImage.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, 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
@@ -310,11 +310,19 @@
         return false;
     }
 
-    /*
-     * Return a BufferedImage of the requested type with the indicated
-     * subimage of the original image located at 0,0 in the new image.
-     * If a bgColor is supplied, composite the original image over that
-     * color with a SrcOver operation, otherwise make a SrcNoEa copy.
+    /**
+     * Return a non-accelerated BufferedImage of the requested type with the
+     * indicated subimage of the original image located at 0,0 in the new image.
+     * If a bgColor is supplied, composite the original image over that color
+     * with a SrcOver operation, otherwise make a SrcNoEa copy.
+     * <p>
+     * Returned BufferedImage is not accelerated for two reasons:
+     * <ul>
+     * <li> Types of the image and surface are predefined, because these types
+     *      correspond to the TransformHelpers, which we know we have. And
+     *      acceleration can change the type of the surface
+     * <li> Image will be used only once and acceleration caching wouldn't help
+     * </ul>
      */
     BufferedImage makeBufferedImage(Image img, Color bgColor, int type,
                                     int sx1, int sy1, int sx2, int sy2)
@@ -324,6 +332,7 @@
         final BufferedImage bimg = new BufferedImage(width, height, type);
         final SunGraphics2D g2d = (SunGraphics2D) bimg.createGraphics();
         g2d.setComposite(AlphaComposite.Src);
+        bimg.setAccelerationPriority(0);
         if (bgColor != null) {
             g2d.setColor(bgColor);
             g2d.fillRect(0, 0, width, height);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/net/ExtendedOptionsImpl.java	Wed Apr 16 15:03:29 2014 -0700
@@ -0,0 +1,92 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.net;
+
+import java.net.*;
+import jdk.net.*;
+import java.io.IOException;
+import java.io.FileDescriptor;
+import java.security.PrivilegedAction;
+import java.security.AccessController;
+import java.lang.reflect.Field;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.HashMap;
+import java.util.Collections;
+
+/**
+ * Contains the native implementation for extended socket options
+ * together with some other static utilities
+ */
+public class ExtendedOptionsImpl {
+
+    static {
+        AccessController.doPrivileged((PrivilegedAction<Void>)() -> {
+            System.loadLibrary("net");
+            return null;
+        });
+        init();
+    }
+
+    private ExtendedOptionsImpl() {}
+
+    public static void checkSetOptionPermission(SocketOption<?> option) {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm == null) {
+            return;
+        }
+        String check = "setOption." + option.name();
+        sm.checkPermission(new NetworkPermission(check));
+    }
+
+    public static void checkGetOptionPermission(SocketOption<?> option) {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm == null) {
+            return;
+        }
+        String check = "getOption." + option.name();
+        sm.checkPermission(new NetworkPermission(check));
+    }
+
+    public static void checkValueType(Object value, Class<?> type) {
+        if (!type.isAssignableFrom(value.getClass())) {
+            String s = "Found: " + value.getClass().toString() + " Expected: "
+                        + type.toString();
+            throw new IllegalArgumentException(s);
+        }
+    }
+
+    private static native void init();
+
+    /*
+     * Extension native implementations
+     *
+     * SO_FLOW_SLA
+     */
+    public static native void setFlowOption(FileDescriptor fd, SocketFlow f);
+    public static native void getFlowOption(FileDescriptor fd, SocketFlow f);
+    public static native boolean flowSupported();
+}
--- a/src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/nio/ch/AsynchronousSocketChannelImpl.java	Wed Apr 16 15:03:29 2014 -0700
@@ -39,6 +39,7 @@
 import java.util.concurrent.*;
 import java.util.concurrent.locks.*;
 import sun.net.NetHooks;
+import sun.net.ExtendedOptionsImpl;
 
 /**
  * Base implementation of AsynchronousSocketChannel
@@ -508,6 +509,9 @@
             set.add(StandardSocketOptions.SO_KEEPALIVE);
             set.add(StandardSocketOptions.SO_REUSEADDR);
             set.add(StandardSocketOptions.TCP_NODELAY);
+            if (ExtendedOptionsImpl.flowSupported()) {
+                set.add(jdk.net.ExtendedSocketOptions.SO_FLOW_SLA);
+            }
             return Collections.unmodifiableSet(set);
         }
     }
--- a/src/share/classes/sun/nio/ch/DatagramChannelImpl.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/nio/ch/DatagramChannelImpl.java	Wed Apr 16 15:03:29 2014 -0700
@@ -33,6 +33,7 @@
 import java.nio.channels.spi.*;
 import java.util.*;
 import sun.net.ResourceManager;
+import sun.net.ExtendedOptionsImpl;
 
 /**
  * An implementation of DatagramChannels.
@@ -317,6 +318,9 @@
             set.add(StandardSocketOptions.IP_MULTICAST_IF);
             set.add(StandardSocketOptions.IP_MULTICAST_TTL);
             set.add(StandardSocketOptions.IP_MULTICAST_LOOP);
+            if (ExtendedOptionsImpl.flowSupported()) {
+                set.add(jdk.net.ExtendedSocketOptions.SO_FLOW_SLA);
+            }
             return Collections.unmodifiableSet(set);
         }
     }
--- a/src/share/classes/sun/nio/ch/Net.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/nio/ch/Net.java	Wed Apr 16 15:03:29 2014 -0700
@@ -27,11 +27,13 @@
 
 import java.io.*;
 import java.net.*;
+import jdk.net.*;
 import java.nio.channels.*;
 import java.util.*;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.security.PrivilegedExceptionAction;
+import sun.net.ExtendedOptionsImpl;
 
 
 public class Net {
@@ -297,6 +299,16 @@
 
         // only simple values supported by this method
         Class<?> type = name.type();
+
+        if (type == SocketFlow.class) {
+            SecurityManager sm = System.getSecurityManager();
+            if (sm != null) {
+                sm.checkPermission(new NetworkPermission("setOption.SO_FLOW_SLA"));
+            }
+            ExtendedOptionsImpl.setFlowOption(fd, (SocketFlow)value);
+            return;
+        }
+
         if (type != Integer.class && type != Boolean.class)
             throw new AssertionError("Should not reach here");
 
@@ -349,6 +361,16 @@
     {
         Class<?> type = name.type();
 
+        if (type == SocketFlow.class) {
+            SecurityManager sm = System.getSecurityManager();
+            if (sm != null) {
+                sm.checkPermission(new NetworkPermission("getOption.SO_FLOW_SLA"));
+            }
+            SocketFlow flow = SocketFlow.create();
+            ExtendedOptionsImpl.getFlowOption(fd, flow);
+            return flow;
+        }
+
         // only simple values supported by this method
         if (type != Integer.class && type != Boolean.class)
             throw new AssertionError("Should not reach here");
--- a/src/share/classes/sun/nio/ch/SocketChannelImpl.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/nio/ch/SocketChannelImpl.java	Wed Apr 16 15:03:29 2014 -0700
@@ -33,6 +33,7 @@
 import java.nio.channels.spi.*;
 import java.util.*;
 import sun.net.NetHooks;
+import sun.net.ExtendedOptionsImpl;
 
 
 /**
@@ -237,6 +238,9 @@
             // additional options required by socket adaptor
             set.add(StandardSocketOptions.IP_TOS);
             set.add(ExtendedSocketOption.SO_OOBINLINE);
+            if (ExtendedOptionsImpl.flowSupported()) {
+                set.add(jdk.net.ExtendedSocketOptions.SO_FLOW_SLA);
+            }
             return Collections.unmodifiableSet(set);
         }
     }
--- a/src/share/classes/sun/swing/SwingUtilities2.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/swing/SwingUtilities2.java	Wed Apr 16 15:03:29 2014 -0700
@@ -926,6 +926,77 @@
         return retVal;
     }
 
+    /**
+     * This method should be used for drawing a borders over a filled rectangle.
+     * Draws vertical line, using the current color, between the points {@code
+     * (x, y1)} and {@code (x, y2)} in graphics context's coordinate system.
+     * Note: it use {@code Graphics.fillRect()} internally.
+     *
+     * @param g  Graphics to draw the line to.
+     * @param x  the <i>x</i> coordinate.
+     * @param y1 the first point's <i>y</i> coordinate.
+     * @param y2 the second point's <i>y</i> coordinate.
+     */
+    public static void drawVLine(Graphics g, int x, int y1, int y2) {
+        if (y2 < y1) {
+            final int temp = y2;
+            y2 = y1;
+            y1 = temp;
+        }
+        g.fillRect(x, y1, 1, y2 - y1 + 1);
+    }
+
+    /**
+     * This method should be used for drawing a borders over a filled rectangle.
+     * Draws horizontal line, using the current color, between the points {@code
+     * (x1, y)} and {@code (x2, y)} in graphics context's coordinate system.
+     * Note: it use {@code Graphics.fillRect()} internally.
+     *
+     * @param g  Graphics to draw the line to.
+     * @param x1 the first point's <i>x</i> coordinate.
+     * @param x2 the second point's <i>x</i> coordinate.
+     * @param y  the <i>y</i> coordinate.
+     */
+    public static void drawHLine(Graphics g, int x1, int x2, int y) {
+        if (x2 < x1) {
+            final int temp = x2;
+            x2 = x1;
+            x1 = temp;
+        }
+        g.fillRect(x1, y, x2 - x1 + 1, 1);
+    }
+
+    /**
+     * This method should be used for drawing a borders over a filled rectangle.
+     * Draws the outline of the specified rectangle. The left and right edges of
+     * the rectangle are at {@code x} and {@code x + w}. The top and bottom
+     * edges are at {@code y} and {@code y + h}. The rectangle is drawn using
+     * the graphics context's current color. Note: it use {@code
+     * Graphics.fillRect()} internally.
+     *
+     * @param g Graphics to draw the rectangle to.
+     * @param x the <i>x</i> coordinate of the rectangle to be drawn.
+     * @param y the <i>y</i> coordinate of the rectangle to be drawn.
+     * @param w the w of the rectangle to be drawn.
+     * @param h the h of the rectangle to be drawn.
+     * @see SwingUtilities2#drawVLine(java.awt.Graphics, int, int, int)
+     * @see SwingUtilities2#drawHLine(java.awt.Graphics, int, int, int)
+     */
+    public static void drawRect(Graphics g, int x, int y, int w, int h) {
+        if (w < 0 || h < 0) {
+            return;
+        }
+
+        if (h == 0 || w == 0) {
+            g.fillRect(x, y, w + 1, h + 1);
+        } else {
+            g.fillRect(x, y, w, 1);
+            g.fillRect(x + w, y, 1, h);
+            g.fillRect(x + 1, y + h, w, 1);
+            g.fillRect(x, y + 1, 1, h);
+        }
+    }
+
     private static TextLayout createTextLayout(JComponent c, String s,
                                             Font f, FontRenderContext frc) {
         Object shaper = (c == null ?
--- a/src/share/classes/sun/util/resources/TimeZoneNames.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/util/resources/TimeZoneNames.java	Wed Apr 16 15:03:29 2014 -0700
@@ -570,6 +570,9 @@
             {"Antarctica/Syowa", new String[] {"Syowa Time", "SYOT",
                                                "Syowa Summer Time", "SYOST",
                                                "Syowa Time", "SYOT"}},
+            {"Antarctica/Troll", new String[] {"Coordinated Universal Time", "UTC",
+                                               "Central European Summer Time", "CEST",
+                                               "Troll Time", "ATT"}},
             {"Antarctica/Vostok", new String[] {"Vostok Time", "VOST",
                                                 "Vostok Summer Time", "VOSST",
                                                 "Vostok Time", "VOST"}},
@@ -839,7 +842,7 @@
                                             "Samara Time", "SAMT"}},
             {"Europe/San_Marino", CET},
             {"Europe/Sarajevo", CET},
-            {"Europe/Simferopol", EET},
+            {"Europe/Simferopol", MSK},
             {"Europe/Skopje", CET},
             {"Europe/Sofia", EET},
             {"Europe/Stockholm", CET},
--- a/src/share/classes/sun/util/resources/de/TimeZoneNames_de.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/util/resources/de/TimeZoneNames_de.java	Wed Apr 16 15:03:29 2014 -0700
@@ -570,6 +570,9 @@
             {"Antarctica/Syowa", new String[] {"Syowa Zeit", "SYOT",
                                                "Syowa Sommerzeit", "SYOST",
                                                "Syowa Zeit", "SYOT"}},
+            {"Antarctica/Troll", new String[] {"Koordinierte Universalzeit", "UTC",
+                                               "Mitteleurop\u00e4ische Sommerzeit", "MESZ",
+                                               "Troll Time", "ATT"}},
             {"Antarctica/Vostok", new String[] {"Vostok Zeit", "VOST",
                                                 "Vostok Sommerzeit", "VOSST",
                                                 "Vostok Zeit", "VOST"}},
@@ -838,7 +841,7 @@
                                             "Samarische Zeit", "SAMT"}},
             {"Europe/San_Marino", CET},
             {"Europe/Sarajevo", CET},
-            {"Europe/Simferopol", EET},
+            {"Europe/Simferopol", MSK},
             {"Europe/Skopje", CET},
             {"Europe/Sofia", EET},
             {"Europe/Stockholm", CET},
--- a/src/share/classes/sun/util/resources/es/TimeZoneNames_es.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/util/resources/es/TimeZoneNames_es.java	Wed Apr 16 15:03:29 2014 -0700
@@ -570,6 +570,9 @@
             {"Antarctica/Syowa", new String[] {"Hora de Syowa", "SYOT",
                                                "Hora de verano de Syowa", "SYOST",
                                                "Hora de Syowa", "SYOT"}},
+            {"Antarctica/Troll", new String[] {"Hora Universal Coordinada", "UTC",
+                                               "Hora de verano de Europa Central", "CEST",
+                                               "Troll Time", "ATT"}},
             {"Antarctica/Vostok", new String[] {"Hora de Vostok", "VOST",
                                                 "Hora de verano de Vostok", "VOSST",
                                                 "Hora de Vostok", "VOST"}},
@@ -838,7 +841,7 @@
                                             "Hora de Samara", "SAMT"}},
             {"Europe/San_Marino", CET},
             {"Europe/Sarajevo", CET},
-            {"Europe/Simferopol", EET},
+            {"Europe/Simferopol", MSK},
             {"Europe/Skopje", CET},
             {"Europe/Sofia", EET},
             {"Europe/Stockholm", CET},
--- a/src/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java	Wed Apr 16 15:03:29 2014 -0700
@@ -570,6 +570,9 @@
             {"Antarctica/Syowa", new String[] {"Heure de Syowa", "SYOT",
                                                "Heure d'\u00e9t\u00e9 de Syowa", "SYOST",
                                                "Heure de Syowa", "SYOT"}},
+            {"Antarctica/Troll", new String[] {"Temps universel coordonn\u00e9", "UTC",
+                                               "Heure d'\u00e9t\u00e9 d'Europe centrale", "CEST",
+                                               "Troll Time", "ATT"}},
             {"Antarctica/Vostok", new String[] {"Heure de Vostok", "VOST",
                                                 "Heure d'\u00e9t\u00e9 de Vostok", "VOSST",
                                                 "Heure de Vostok", "VOST"}},
@@ -838,7 +841,7 @@
                                             "Heure de Samara", "SAMT"}},
             {"Europe/San_Marino", CET},
             {"Europe/Sarajevo", CET},
-            {"Europe/Simferopol", EET},
+            {"Europe/Simferopol", MSK},
             {"Europe/Skopje", CET},
             {"Europe/Sofia", EET},
             {"Europe/Stockholm", CET},
--- a/src/share/classes/sun/util/resources/it/TimeZoneNames_it.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/util/resources/it/TimeZoneNames_it.java	Wed Apr 16 15:03:29 2014 -0700
@@ -570,6 +570,9 @@
             {"Antarctica/Syowa", new String[] {"Ora di Syowa", "SYOT",
                                                "Ora estiva di Syowa", "SYOST",
                                                "Ora di Syowa", "SYOT"}},
+            {"Antarctica/Troll", new String[] {"Tempo universale coordinato", "UTC",
+                                               "Ora estiva dell'Europa centrale", "CEST",
+                                               "Troll Time", "ATT"}},
             {"Antarctica/Vostok", new String[] {"Ora di Vostok", "VOST",
                                                 "Ora estiva di Vostok", "VOSST",
                                                 "Ora di Vostok", "VOST"}},
@@ -838,7 +841,7 @@
                                             "Ora di Samara", "SAMT"}},
             {"Europe/San_Marino", CET},
             {"Europe/Sarajevo", CET},
-            {"Europe/Simferopol", EET},
+            {"Europe/Simferopol", MSK},
             {"Europe/Skopje", CET},
             {"Europe/Sofia", EET},
             {"Europe/Stockholm", CET},
--- a/src/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java	Wed Apr 16 15:03:29 2014 -0700
@@ -570,6 +570,9 @@
             {"Antarctica/Syowa", new String[] {"\u662d\u548c\u57fa\u5730\u6642\u9593", "SYOT",
                                                "\u662d\u548c\u57fa\u5730\u590f\u6642\u9593", "SYOST",
                                                "\u662D\u548C\u57FA\u5730\u6642\u9593", "SYOT"}},
+            {"Antarctica/Troll", new String[] {"\u5354\u5b9a\u4e16\u754c\u6642", "UTC",
+                                               "\u4e2d\u90e8\u30e8\u30fc\u30ed\u30c3\u30d1\u590f\u6642\u9593", "CEST",
+                                               "Troll Time", "ATT"}},
             {"Antarctica/Vostok", new String[] {"\u30dc\u30b9\u30c8\u30fc\u30af\u57fa\u5730\u6642\u9593", "VOST",
                                                 "\u30dc\u30b9\u30c8\u30fc\u30af\u57fa\u5730\u590f\u6642\u9593", "VOSST",
                                                 "\u30DC\u30B9\u30C8\u30FC\u30AF\u6642\u9593", "VOST"}},
@@ -838,7 +841,7 @@
                                             "\u30B5\u30DE\u30E9\u6642\u9593", "SAMT"}},
             {"Europe/San_Marino", CET},
             {"Europe/Sarajevo", CET},
-            {"Europe/Simferopol", EET},
+            {"Europe/Simferopol", MSK},
             {"Europe/Skopje", CET},
             {"Europe/Sofia", EET},
             {"Europe/Stockholm", CET},
--- a/src/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java	Wed Apr 16 15:03:29 2014 -0700
@@ -570,6 +570,9 @@
             {"Antarctica/Syowa", new String[] {"Syowa \uc2dc\uac04", "SYOT",
                                                "Syowa \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "SYOST",
                                                "\uC1FC\uC640 \uD45C\uC900\uC2DC", "SYOT"}},
+            {"Antarctica/Troll", new String[] {"\uc138\uacc4 \ud45c\uc900\uc2dc", "UTC",
+                                               "\uc911\uc559 \uc720\ub7fd \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "CEST",
+                                               "Troll Time", "ATT"}},
             {"Antarctica/Vostok", new String[] {"Vostok \uc2dc\uac04", "VOST",
                                                 "Vostok \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "VOSST",
                                                 "\uBCF4\uC2A4\uD1A1 \uD45C\uC900\uC2DC", "VOST"}},
@@ -838,7 +841,7 @@
                                             "\uC0AC\uB9C8\uB77C \uD45C\uC900\uC2DC", "SAMT"}},
             {"Europe/San_Marino", CET},
             {"Europe/Sarajevo", CET},
-            {"Europe/Simferopol", EET},
+            {"Europe/Simferopol", MSK},
             {"Europe/Skopje", CET},
             {"Europe/Sofia", EET},
             {"Europe/Stockholm", CET},
--- a/src/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java	Wed Apr 16 15:03:29 2014 -0700
@@ -570,6 +570,9 @@
             {"Antarctica/Syowa", new String[] {"Fuso hor\u00e1rio de Syowa", "SYOT",
                                                "Fuso hor\u00e1rio de ver\u00e3o de Syowa", "SYOST",
                                                "Hor\u00E1rio de Syowa", "SYOT"}},
+            {"Antarctica/Troll", new String[] {"Tempo universal coordenado", "UTC",
+                                               "Fuso hor\u00e1rio de ver\u00e3o da Europa Central", "CEST",
+                                               "Troll Time", "ATT"}},
             {"Antarctica/Vostok", new String[] {"Fuso hor\u00e1rio de Vostok", "VOST",
                                                 "Fuso hor\u00e1rio de ver\u00e3o de Vostok", "VOSST",
                                                 "Hor\u00E1rio de Vostok", "VOST"}},
@@ -838,7 +841,7 @@
                                             "Hor\u00E1rio de Samara", "SAMT"}},
             {"Europe/San_Marino", CET},
             {"Europe/Sarajevo", CET},
-            {"Europe/Simferopol", EET},
+            {"Europe/Simferopol", MSK},
             {"Europe/Skopje", CET},
             {"Europe/Sofia", EET},
             {"Europe/Stockholm", CET},
--- a/src/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java	Wed Apr 16 15:03:29 2014 -0700
@@ -570,6 +570,9 @@
             {"Antarctica/Syowa", new String[] {"Syowa, normaltid", "SYOT",
                                                "Syowa, sommartid", "SYOST",
                                                "Syowa-tid", "SYOT"}},
+            {"Antarctica/Troll", new String[] {"Koordinerad universell tid", "UTC",
+                                               "Centraleuropeisk sommartid", "CEST",
+                                               "Troll Time", "ATT"}},
             {"Antarctica/Vostok", new String[] {"Vostok, normaltid", "VOST",
                                                 "Vostok, sommartid", "VOSST",
                                                 "Vostok-tid", "VOST"}},
@@ -838,7 +841,7 @@
                                             "Samara-tid", "SAMT"}},
             {"Europe/San_Marino", CET},
             {"Europe/Sarajevo", CET},
-            {"Europe/Simferopol", EET},
+            {"Europe/Simferopol", MSK},
             {"Europe/Skopje", CET},
             {"Europe/Sofia", EET},
             {"Europe/Stockholm", CET},
--- a/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java	Wed Apr 16 15:03:29 2014 -0700
@@ -570,6 +570,9 @@
             {"Antarctica/Syowa", new String[] {"Syowa \u65f6\u95f4", "SYOT",
                                                "Syowa \u590f\u4ee4\u65f6", "SYOST",
                                                "Syowa \u65F6\u95F4", "SYOT"}},
+            {"Antarctica/Troll", new String[] {"\u534f\u8c03\u4e16\u754c\u65f6\u95f4", "UTC",
+                                               "\u4e2d\u6b27\u590f\u4ee4\u65f6", "CEST",
+                                               "Troll Time", "ATT"}},
             {"Antarctica/Vostok", new String[] {"\u83ab\u65af\u6258\u514b\u65f6\u95f4", "VOST",
                                                 "\u83ab\u65af\u6258\u514b\u590f\u4ee4\u65f6", "VOSST",
                                                 "\u83AB\u65AF\u6258\u514B\u65F6\u95F4", "VOST"}},
@@ -838,7 +841,7 @@
                                             "\u6C99\u9A6C\u62C9\u65F6\u95F4", "SAMT"}},
             {"Europe/San_Marino", CET},
             {"Europe/Sarajevo", CET},
-            {"Europe/Simferopol", EET},
+            {"Europe/Simferopol", MSK},
             {"Europe/Skopje", CET},
             {"Europe/Sofia", EET},
             {"Europe/Stockholm", CET},
--- a/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java	Wed Apr 16 15:03:29 2014 -0700
@@ -570,6 +570,9 @@
             {"Antarctica/Syowa", new String[] {"\u5915\u6b50\u74e6 (Syowa) \u6642\u9593", "SYOT",
                                                "\u5915\u6b50\u74e6 (Syowa) \u590f\u4ee4\u6642\u9593", "SYOST",
                                                "\u5915\u6B50\u74E6 (Syowa) \u6642\u9593", "SYOT"}},
+            {"Antarctica/Troll", new String[] {"\u5354\u8abf\u4e16\u754c\u6642\u9593", "UTC",
+                                               "\u4e2d\u6b50\u590f\u4ee4\u6642\u9593", "CEST",
+                                               "Troll Time", "ATT"}},
             {"Antarctica/Vostok", new String[] {"\u4f5b\u65af\u6258 (Vostok) \u6642\u9593", "VOST",
                                                 "\u4f5b\u65af\u6258 (Vostok) \u590f\u4ee4\u6642\u9593", "VOSST",
                                                 "\u4F5B\u65AF\u6258 (Vostok) \u6642\u9593", "VOST"}},
@@ -840,7 +843,7 @@
                                             "\u6C99\u99AC\u62C9\u6642\u9593", "SAMT"}},
             {"Europe/San_Marino", CET},
             {"Europe/Sarajevo", CET},
-            {"Europe/Simferopol", EET},
+            {"Europe/Simferopol", MSK},
             {"Europe/Skopje", CET},
             {"Europe/Sofia", EET},
             {"Europe/Stockholm", CET},
--- a/src/share/native/com/sun/media/sound/DirectAudioDevice.c	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/native/com/sun/media/sound/DirectAudioDevice.c	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2012, 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
@@ -32,6 +32,7 @@
 
 
 #include <jni.h>
+#include <jni_util.h>
 // for malloc
 #ifdef _ALLBSD_SOURCE
 #include <stdlib.h>
@@ -603,6 +604,7 @@
     if (len == 0) return 0;
     if (info && info->handle) {
         data = (UINT8*) ((*env)->GetByteArrayElements(env, jData, &didCopy));
+        CHECK_NULL_RETURN(data, ret);
         dataOffset = data;
         dataOffset += (int) offset;
         convertedData = dataOffset;
@@ -671,6 +673,7 @@
     }
     if (info && info->handle) {
         data = (char*) ((*env)->GetByteArrayElements(env, jData, NULL));
+        CHECK_NULL_RETURN(data, ret);
         dataOffset = data;
         dataOffset += (int) offset;
         ret = DAUDIO_Read(info->handle, dataOffset, (int) len);
--- a/src/share/native/com/sun/media/sound/DirectAudioDeviceProvider.c	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/native/com/sun/media/sound/DirectAudioDeviceProvider.c	Wed Apr 16 15:03:29 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
@@ -28,6 +28,7 @@
 
 
 #include <jni.h>
+#include <jni_util.h>
 #include "SoundDefs.h"
 #include "DirectAudio.h"
 #include "Utilities.h"
@@ -70,6 +71,11 @@
     jmethodID directAudioDeviceInfoConstructor;
     DirectAudioDeviceDescription desc;
     jobject info = NULL;
+    jstring name;
+    jstring vendor;
+    jstring description;
+    jstring version;
+
     TRACE1("Java_com_sun_media_sound_DirectAudioDeviceProvider_nNewDirectAudioDeviceInfo(%d).\n", mixerIndex);
 
     // retrieve class and constructor of DirectAudioDeviceProvider.DirectAudioDeviceInfo
@@ -89,14 +95,18 @@
 
     if (getDirectAudioDeviceDescription(mixerIndex, &desc)) {
         // create a new DirectAudioDeviceInfo object and return it
-        info = (*env)->NewObject(env, directAudioDeviceInfoClass, directAudioDeviceInfoConstructor,
-                                 mixerIndex,
-                                 desc.deviceID,
-                                 desc.maxSimulLines,
-                                 (*env)->NewStringUTF(env, desc.name),
-                                 (*env)->NewStringUTF(env, desc.vendor),
-                                 (*env)->NewStringUTF(env, desc.description),
-                                 (*env)->NewStringUTF(env, desc.version));
+        name = (*env)->NewStringUTF(env, desc.name);
+        CHECK_NULL_RETURN(name, info);
+        vendor = (*env)->NewStringUTF(env, desc.vendor);
+        CHECK_NULL_RETURN(vendor, info);
+        description = (*env)->NewStringUTF(env, desc.description);
+        CHECK_NULL_RETURN(description, info);
+        version = (*env)->NewStringUTF(env, desc.version);
+        CHECK_NULL_RETURN(version, info);
+        info = (*env)->NewObject(env, directAudioDeviceInfoClass,
+                                 directAudioDeviceInfoConstructor, mixerIndex,
+                                 desc.deviceID, desc.maxSimulLines,
+                                 name, vendor, description, version);
     } else {
         ERROR1("ERROR: getDirectAudioDeviceDescription(%d, desc) returned FALSE!\n", mixerIndex);
     }
--- a/src/share/native/com/sun/media/sound/PortMixer.c	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/native/com/sun/media/sound/PortMixer.c	Wed Apr 16 15:03:29 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
@@ -28,6 +28,7 @@
 
 
 #include <jni.h>
+#include <jni_util.h>
 #include "SoundDefs.h"
 #include "Ports.h"
 #include "Utilities.h"
@@ -170,6 +171,7 @@
 void* PORT_NewBooleanControl(void* creatorV, void* controlID, char* type) {
     ControlCreatorJNI* creator = (ControlCreatorJNI*) creatorV;
     jobject ctrl = NULL;
+    jstring typeString;
 
 #ifdef USE_TRACE
     if (((UINT_PTR) type) <= CONTROL_TYPE_MAX) {
@@ -199,8 +201,11 @@
         type = "Select";
     }
 
-    ctrl = (*creator->env)->NewObject(creator->env, creator->boolCtrlClass, creator->boolCtrlConstructor,
-        (jlong) (UINT_PTR) controlID, (*creator->env)->NewStringUTF(creator->env, type));
+    typeString = (*creator->env)->NewStringUTF(creator->env, type);
+    CHECK_NULL_RETURN(typeString, (void*) ctrl);
+    ctrl = (*creator->env)->NewObject(creator->env, creator->boolCtrlClass,
+                                      creator->boolCtrlConstructor,
+                                      (jlong) (UINT_PTR) controlID, typeString);
     if (!ctrl) {
         ERROR0("PORT_NewBooleanControl: ctrl is NULL\n");
     }
@@ -216,6 +221,7 @@
     jobject ctrl = NULL;
     jobjectArray controlArray;
     int i;
+    jstring typeString;
 
     TRACE2("PORT_NewCompoundControl: creating '%s' with %d controls\n", type, controlCount);
     if (!creator->compCtrlClass) {
@@ -250,8 +256,11 @@
         (*creator->env)->SetObjectArrayElement(creator->env, controlArray, i, (jobject) controls[i]);
     }
     TRACE0("PORT_NewCompoundControl: creating compound control\n");
-    ctrl = (*creator->env)->NewObject(creator->env, creator->compCtrlClass, creator->compCtrlConstructor,
-              (*creator->env)->NewStringUTF(creator->env, type), controlArray);
+    typeString = (*creator->env)->NewStringUTF(creator->env, type);
+    CHECK_NULL_RETURN(typeString, (void*) ctrl);
+    ctrl = (*creator->env)->NewObject(creator->env, creator->compCtrlClass,
+                                      creator->compCtrlConstructor,
+                                      typeString, controlArray);
     if (!ctrl) {
         ERROR0("PORT_NewCompoundControl: ctrl is NULL\n");
     }
@@ -266,6 +275,8 @@
                            float min, float max, float precision, char* units) {
     ControlCreatorJNI* creator = (ControlCreatorJNI*) creatorV;
     jobject ctrl = NULL;
+    jstring unitsString;
+    jstring typeString;
 
 #ifdef USE_TRACE
     if (((UINT_PTR) type) <= CONTROL_TYPE_MAX) {
@@ -294,18 +305,24 @@
             return NULL;
         }
     }
+    unitsString = (*creator->env)->NewStringUTF(creator->env, units);
+    CHECK_NULL_RETURN(unitsString, (void*) ctrl);
     if (((UINT_PTR) type) <= CONTROL_TYPE_MAX) {
         // constructor with int parameter
         TRACE1("PORT_NewFloatControl: calling constructor2 with type %d\n", (int) (UINT_PTR) type);
-        ctrl = (*creator->env)->NewObject(creator->env, creator->floatCtrlClass, creator->floatCtrlConstructor2,
-                  (jlong) (UINT_PTR) controlID, (jint) (UINT_PTR) type,
-                  min, max, precision, (*creator->env)->NewStringUTF(creator->env, units));
+        ctrl = (*creator->env)->NewObject(creator->env, creator->floatCtrlClass,
+                                          creator->floatCtrlConstructor2,
+                                          (jlong) (UINT_PTR) controlID, (jint) (UINT_PTR) type,
+                                          min, max, precision, unitsString);
     } else {
         TRACE0("PORT_NewFloatControl: calling constructor1\n");
         // constructor with string parameter
-        ctrl = (*creator->env)->NewObject(creator->env, creator->floatCtrlClass, creator->floatCtrlConstructor1,
-                  (jlong) (UINT_PTR) controlID, (*creator->env)->NewStringUTF(creator->env, type),
-                  min, max, precision, (*creator->env)->NewStringUTF(creator->env, units));
+        typeString = (*creator->env)->NewStringUTF(creator->env, type);
+        CHECK_NULL_RETURN(typeString, (void*) ctrl);
+        ctrl = (*creator->env)->NewObject(creator->env, creator->floatCtrlClass,
+                                          creator->floatCtrlConstructor1,
+                                          (jlong) (UINT_PTR) controlID, typeString,
+                                          min, max, precision, unitsString);
     }
     if (!ctrl) {
         ERROR0("PORT_NewFloatControl: ctrl is NULL!\n");
--- a/src/share/native/com/sun/media/sound/PortMixerProvider.c	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/native/com/sun/media/sound/PortMixerProvider.c	Wed Apr 16 15:03:29 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
@@ -27,6 +27,7 @@
 
 
 #include <jni.h>
+#include <jni_util.h>
 #include "SoundDefs.h"
 #include "Ports.h"
 #include "Utilities.h"
@@ -65,6 +66,11 @@
     jmethodID portMixerInfoConstructor;
     PortMixerDescription desc;
     jobject info = NULL;
+    jstring name;
+    jstring vendor;
+    jstring description;
+    jstring version;
+
     TRACE1("Java_com_sun_media_sound_PortMixerProvider_nNewPortMixerInfo(%d).\n", mixerIndex);
 
     // retrieve class and constructor of PortMixerProvider.PortMixerInfo
@@ -82,11 +88,17 @@
 
     if (getPortMixerDescription(mixerIndex, &desc)) {
         // create a new PortMixerInfo object and return it
-        info = (*env)->NewObject(env, portMixerInfoClass, portMixerInfoConstructor, mixerIndex,
-                                 (*env)->NewStringUTF(env, desc.name),
-                                 (*env)->NewStringUTF(env, desc.vendor),
-                                 (*env)->NewStringUTF(env, desc.description),
-                                 (*env)->NewStringUTF(env, desc.version));
+        name = (*env)->NewStringUTF(env, desc.name);
+        CHECK_NULL_RETURN(name, info);
+        vendor = (*env)->NewStringUTF(env, desc.vendor);
+        CHECK_NULL_RETURN(vendor, info);
+        description = (*env)->NewStringUTF(env, desc.description);
+        CHECK_NULL_RETURN(description, info);
+        version = (*env)->NewStringUTF(env, desc.version);
+        CHECK_NULL_RETURN(version, info);
+        info = (*env)->NewObject(env, portMixerInfoClass,
+                                 portMixerInfoConstructor, mixerIndex,
+                                 name, vendor, description, version);
     }
 
     TRACE0("Java_com_sun_media_sound_PortMixerProvider_nNewPortMixerInfo succeeded.\n");
--- a/src/share/native/java/net/net_util.h	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/native/java/net/net_util.h	Wed Apr 16 15:03:29 2014 -0700
@@ -40,7 +40,7 @@
 #define IPv6 2
 
 #define NET_ERROR(env, ex, msg) \
-{ if (!(*env)->ExceptionOccurred(env)) JNU_ThrowByName(env, ex, msg) }
+{ if (!(*env)->ExceptionOccurred(env)) JNU_ThrowByName(env, ex, msg); }
 
 /************************************************************************
  * Cached field IDs
--- a/src/share/native/sun/awt/splashscreen/java_awt_SplashScreen.c	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/native/sun/awt/splashscreen/java_awt_SplashScreen.c	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,8 +24,9 @@
  */
 
 #include "splashscreen_impl.h"
+#include <jlong_md.h>
 #include <jni.h>
-#include <jlong_md.h>
+#include <jni_util.h>
 #include <sizecalc.h>
 
 JNIEXPORT jint JNICALL
@@ -212,8 +213,9 @@
     if (!splash) {
         return JNI_FALSE;
     }
+    pBytes = (*env)->GetByteArrayElements(env, data, NULL);
+    CHECK_NULL_RETURN(pBytes, JNI_FALSE);
     size = (*env)->GetArrayLength(env, data);
-    pBytes = (*env)->GetByteArrayElements(env, data, NULL);
     rc = SplashLoadMemory(pBytes, size);
     (*env)->ReleaseByteArrayElements(env, data, pBytes, JNI_ABORT);
     return rc ? JNI_TRUE : JNI_FALSE;
--- a/src/share/native/sun/java2d/loops/TransformHelper.c	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/native/sun/java2d/loops/TransformHelper.c	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, 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
@@ -384,6 +384,7 @@
         return;
     }
     Region_IntersectBounds(&clipInfo, &dstInfo.bounds);
+    Transform_GetInfo(env, itxform, &itxInfo);
 
     numedges = (((jlong) dstInfo.bounds.y2) - ((jlong) dstInfo.bounds.y1));
     if (numedges <= 0) {
@@ -423,7 +424,6 @@
         return;
     }
 
-    Transform_GetInfo(env, itxform, &itxInfo);
 
     if (!Region_IsEmpty(&clipInfo)) {
         srcOps->GetRasInfo(env, srcOps, &srcInfo);
--- a/src/share/native/sun/java2d/opengl/OGLSurfaceData.c	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/native/sun/java2d/opengl/OGLSurfaceData.c	Wed Apr 16 15:03:29 2014 -0700
@@ -543,7 +543,9 @@
     }
 
     JNU_SetFieldByName(env, NULL, sdObject, "nativeWidth", "I", width);
+    if (!((*env)->ExceptionOccurred(env))) {
     JNU_SetFieldByName(env, NULL, sdObject, "nativeHeight", "I", height);
+    }
 
     (*env)->DeleteLocalRef(env, sdObject);
 }
--- a/src/share/npt/utf.c	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/share/npt/utf.c	Wed Apr 16 15:03:29 2014 -0700
@@ -396,7 +396,7 @@
 
 /* ================================================================= */
 
-#if 1  /* Test program */
+#ifdef COMPILE_WITH_UTF_TEST  /* Test program */
 
 /*
  * Convert any byte array into a printable string.
--- a/src/solaris/classes/java/net/PlainDatagramSocketImpl.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/solaris/classes/java/net/PlainDatagramSocketImpl.java	Wed Apr 16 15:03:29 2014 -0700
@@ -25,6 +25,11 @@
 package java.net;
 
 import java.io.IOException;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Collections;
+import jdk.net.*;
+import static sun.net.ExtendedOptionsImpl.*;
 
 /*
  * On Unix systems we simply delegate to native methods.
@@ -38,6 +43,32 @@
         init();
     }
 
+    protected <T> void setOption(SocketOption<T> name, T value) throws IOException {
+        if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) {
+            super.setOption(name, value);
+        } else {
+            if (isClosed()) {
+                throw new SocketException("Socket closed");
+            }
+            checkSetOptionPermission(name);
+            checkValueType(value, SocketFlow.class);
+            setFlowOption(getFileDescriptor(), (SocketFlow)value);
+        }
+    }
+
+    protected <T> T getOption(SocketOption<T> name) throws IOException {
+        if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) {
+            return super.getOption(name);
+        }
+        if (isClosed()) {
+            throw new SocketException("Socket closed");
+        }
+        checkGetOptionPermission(name);
+        SocketFlow flow = SocketFlow.create();
+        getFlowOption(getFileDescriptor(), flow);
+        return (T)flow;
+    }
+
     protected synchronized native void bind0(int lport, InetAddress laddr)
         throws SocketException;
 
--- a/src/solaris/classes/java/net/PlainSocketImpl.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/solaris/classes/java/net/PlainSocketImpl.java	Wed Apr 16 15:03:29 2014 -0700
@@ -26,6 +26,12 @@
 
 import java.io.IOException;
 import java.io.FileDescriptor;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Collections;
+import jdk.net.*;
+
+import static sun.net.ExtendedOptionsImpl.*;
 
 /*
  * On Unix systems we simply delegate to native methods.
@@ -51,6 +57,32 @@
         this.fd = fd;
     }
 
+    protected <T> void setOption(SocketOption<T> name, T value) throws IOException {
+        if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) {
+            super.setOption(name, value);
+        } else {
+            if (isClosedOrPending()) {
+                throw new SocketException("Socket closed");
+            }
+            checkSetOptionPermission(name);
+            checkValueType(value, SocketFlow.class);
+            setFlowOption(getFileDescriptor(), (SocketFlow)value);
+        }
+    }
+
+    protected <T> T getOption(SocketOption<T> name) throws IOException {
+        if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) {
+            return super.getOption(name);
+        }
+        if (isClosedOrPending()) {
+            throw new SocketException("Socket closed");
+        }
+        checkGetOptionPermission(name);
+        SocketFlow flow = SocketFlow.create();
+        getFlowOption(getFileDescriptor(), flow);
+        return (T)flow;
+    }
+
     native void socketCreate(boolean isServer) throws IOException;
 
     native void socketConnect(InetAddress address, int port, int timeout)
@@ -77,5 +109,4 @@
     native int socketGetOption(int opt, Object iaContainerObj) throws SocketException;
 
     native void socketSendUrgentData(int data) throws IOException;
-
 }
--- a/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -24,7 +24,6 @@
  */
 package sun.awt.X11;
 
-import java.awt.Dialog;
 import java.awt.FileDialog;
 import java.awt.peer.FileDialogPeer;
 import java.io.File;
@@ -36,15 +35,15 @@
  *
  * @author Costantino Cerbo (c.cerbo@gmail.com)
  */
-class GtkFileDialogPeer extends XDialogPeer implements FileDialogPeer {
+final class GtkFileDialogPeer extends XDialogPeer implements FileDialogPeer {
 
-    private FileDialog fd;
+    private final FileDialog fd;
 
     // A pointer to the native GTK FileChooser widget
     private volatile long widget = 0L;
 
-    public GtkFileDialogPeer(FileDialog fd) {
-        super((Dialog) fd);
+    GtkFileDialogPeer(FileDialog fd) {
+        super(fd);
         this.fd = fd;
     }
 
@@ -172,9 +171,7 @@
                 dirname = file.getParent();
             }
         }
-        GtkFileDialogPeer.this.run(fd.getTitle(), fd.getMode(), dirname,
-                                   filename, fd.getFilenameFilter(),
-                                   fd.isMultipleMode(), fd.getX(), fd.getY());
+        run(fd.getTitle(), fd.getMode(), dirname, filename,
+            fd.getFilenameFilter(), fd.isMultipleMode(), fd.getX(), fd.getY());
     }
-
 }
--- a/src/solaris/classes/sun/awt/X11/XRepaintArea.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/solaris/classes/sun/awt/X11/XRepaintArea.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,8 +28,8 @@
 
 import java.awt.Component;
 import java.awt.Graphics;
+
 import sun.awt.RepaintArea;
-import java.awt.peer.ComponentPeer;
 
 /**
  * The <code>RepaintArea</code> is a geometric construct created for the
@@ -39,24 +39,15 @@
  *
  * @author      Eric Hawkes
  */
-class XRepaintArea extends RepaintArea {
-
-    /**
-     * Constructs a new <code>XRepaintArea</code>
-     * @since   1.3
-     */
-    public XRepaintArea() {
-    }
+final class XRepaintArea extends RepaintArea {
 
     /**
      * Calls <code>Component.update(Graphics)</code> with given Graphics.
      */
     protected void updateComponent(Component comp, Graphics g) {
         if (comp != null) {
-            final XComponentPeer peer = (XComponentPeer) comp.getPeer();
-            if (peer != null) {
-                peer.paintPeer(g);
-            }
+            // We don't call peer.paintPeer() here, because we shouldn't paint
+            // native component when processing UPDATE events.
             super.updateComponent(comp, g);
         }
     }
--- a/src/solaris/classes/sun/awt/windows/ThemeReader.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/solaris/classes/sun/awt/windows/ThemeReader.java	Wed Apr 16 15:03:29 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
@@ -25,7 +25,10 @@
 
 package sun.awt.windows;
 
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Insets;
+import java.awt.Point;
 
 
 /**
@@ -36,7 +39,8 @@
  *
  * @author Leif Samuelsson
  */
-public class ThemeReader {
+public final class ThemeReader {
+
     public static boolean isThemed() {
         return false;
     }
@@ -84,16 +88,18 @@
     public static Dimension getPartSize(String widget, int part, int state) {
         return null;
     }
+
     public static long getThemeTransitionDuration(String widget, int part,
                                        int stateFrom, int stateTo, int propId) {
         return 0;
     }
+
     public static boolean isGetThemeTransitionDurationDefined() {
         return false;
     }
+
     public static Insets getThemeBackgroundContentMargins(String widget,
                     int part, int state, int boundingWidth, int boundingHeight) {
         return null;
     }
-
 }
--- a/src/solaris/native/com/sun/media/sound/PLATFORM_API_BsdOS_ALSA_MidiUtils.c	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/solaris/native/com/sun/media/sound/PLATFORM_API_BsdOS_ALSA_MidiUtils.c	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -229,8 +229,9 @@
         desc->deviceID = deviceID;
 
         buffer[0]=' '; buffer[1]='[';
+        // buffer[300] is enough to store the actual device string w/o overrun
         getDeviceStringFromDeviceID(&buffer[2], deviceID, usePlugHw, ALSA_RAWMIDI);
-        strcat(buffer, "]");
+        strncat(buffer, "]", sizeof(buffer) - strlen(buffer) - 1);
         strncpy(desc->name,
                 (cardinfo != NULL)
                     ? snd_ctl_card_info_get_id(cardinfo)
--- a/src/solaris/native/com/sun/media/sound/PLATFORM_API_BsdOS_ALSA_PCMUtils.c	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/solaris/native/com/sun/media/sound/PLATFORM_API_BsdOS_ALSA_PCMUtils.c	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -184,8 +184,9 @@
                 1 : snd_pcm_info_get_subdevices_count(pcminfo);
         *desc->deviceID = deviceID;
         buffer[0]=' '; buffer[1]='[';
+        // buffer[300] is enough to store the actual device string w/o overrun
         getDeviceStringFromDeviceID(&buffer[2], deviceID, usePlugHw, ALSA_PCM);
-        strcat(buffer, "]");
+        strncat(buffer, "]", sizeof(buffer) - strlen(buffer) - 1);
         strncpy(desc->name,
                 (cardinfo != NULL)
                     ? snd_ctl_card_info_get_id(cardinfo)
--- a/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_MidiUtils.c	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_MidiUtils.c	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -229,8 +229,9 @@
         desc->deviceID = deviceID;
 
         buffer[0]=' '; buffer[1]='[';
+        // buffer[300] is enough to store the actual device string w/o overrun
         getDeviceStringFromDeviceID(&buffer[2], deviceID, usePlugHw, ALSA_RAWMIDI);
-        strcat(buffer, "]");
+        strncat(buffer, "]", sizeof(buffer) - strlen(buffer) - 1);
         strncpy(desc->name,
                 (cardinfo != NULL)
                     ? snd_ctl_card_info_get_id(cardinfo)
--- a/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCMUtils.c	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCMUtils.c	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -184,8 +184,9 @@
                 1 : snd_pcm_info_get_subdevices_count(pcminfo);
         *desc->deviceID = deviceID;
         buffer[0]=' '; buffer[1]='[';
+        // buffer[300] is enough to store the actual device string w/o overrun
         getDeviceStringFromDeviceID(&buffer[2], deviceID, usePlugHw, ALSA_PCM);
-        strcat(buffer, "]");
+        strncat(buffer, "]", sizeof(buffer) - strlen(buffer) - 1);
         strncpy(desc->name,
                 (cardinfo != NULL)
                     ? snd_ctl_card_info_get_id(cardinfo)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/native/java/net/ExtendedOptionsImpl.c	Wed Apr 16 15:03:29 2014 -0700
@@ -0,0 +1,329 @@
+/*
+ * 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include <jni.h>
+#include <string.h>
+
+#include "net_util.h"
+#include "jdk_net_SocketFlow.h"
+
+static jclass sf_status_class;          /* Status enum type */
+
+static jfieldID sf_status;
+static jfieldID sf_priority;
+static jfieldID sf_bandwidth;
+
+static jfieldID sf_fd_fdID;             /* FileDescriptor.fd */
+
+/* References to the literal enum values */
+
+static jobject sfs_NOSTATUS;
+static jobject sfs_OK;
+static jobject sfs_NOPERMISSION;
+static jobject sfs_NOTCONNECTED;
+static jobject sfs_NOTSUPPORTED;
+static jobject sfs_ALREADYCREATED;
+static jobject sfs_INPROGRESS;
+static jobject sfs_OTHER;
+
+static jobject getEnumField(JNIEnv *env, char *name);
+static void setStatus(JNIEnv *env, jobject obj, int errval);
+
+/* OS specific code is implemented in these three functions */
+
+static jboolean flowSupported0() ;
+
+/*
+ * Class:     sun_net_ExtendedOptionsImpl
+ * Method:    init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_sun_net_ExtendedOptionsImpl_init
+  (JNIEnv *env, jclass UNUSED) {
+
+    static int initialized = 0;
+    jclass c;
+
+    /* Global class references */
+
+    if (initialized) {
+        return;
+    }
+
+    c = (*env)->FindClass(env, "jdk/net/SocketFlow$Status");
+    CHECK_NULL(c);
+    sf_status_class = (*env)->NewGlobalRef(env, c);
+    CHECK_NULL(sf_status_class);
+
+    /* int "fd" field of java.io.FileDescriptor  */
+
+    c = (*env)->FindClass(env, "java/io/FileDescriptor");
+    CHECK_NULL(c);
+    sf_fd_fdID = (*env)->GetFieldID(env, c, "fd", "I");
+    CHECK_NULL(sf_fd_fdID);
+
+
+    /* SocketFlow fields */
+
+    c = (*env)->FindClass(env, "jdk/net/SocketFlow");
+
+    /* status */
+
+    sf_status = (*env)->GetFieldID(env, c, "status",
+        "Ljdk/net/SocketFlow$Status;");
+    CHECK_NULL(sf_status);
+
+    /* priority */
+
+    sf_priority = (*env)->GetFieldID(env, c, "priority", "I");
+    CHECK_NULL(sf_priority);
+
+    /* bandwidth */
+
+    sf_bandwidth = (*env)->GetFieldID(env, c, "bandwidth", "J");
+    CHECK_NULL(sf_bandwidth);
+
+    /* Initialize the static enum values */
+
+    sfs_NOSTATUS = getEnumField(env, "NO_STATUS");
+    CHECK_NULL(sfs_NOSTATUS);
+    sfs_OK = getEnumField(env, "OK");
+    CHECK_NULL(sfs_OK);
+    sfs_NOPERMISSION = getEnumField(env, "NO_PERMISSION");
+    CHECK_NULL(sfs_NOPERMISSION);
+    sfs_NOTCONNECTED = getEnumField(env, "NOT_CONNECTED");
+    CHECK_NULL(sfs_NOTCONNECTED);
+    sfs_NOTSUPPORTED = getEnumField(env, "NOT_SUPPORTED");
+    CHECK_NULL(sfs_NOTSUPPORTED);
+    sfs_ALREADYCREATED = getEnumField(env, "ALREADY_CREATED");
+    CHECK_NULL(sfs_ALREADYCREATED);
+    sfs_INPROGRESS = getEnumField(env, "IN_PROGRESS");
+    CHECK_NULL(sfs_INPROGRESS);
+    sfs_OTHER = getEnumField(env, "OTHER");
+    CHECK_NULL(sfs_OTHER);
+    initialized = JNI_TRUE;
+}
+
+static jobject getEnumField(JNIEnv *env, char *name) {
+    jobject f;
+    jfieldID fID = (*env)->GetStaticFieldID(env, sf_status_class, name,
+        "Ljdk/net/SocketFlow$Status;");
+    CHECK_NULL_RETURN(fID, NULL);
+
+    f = (*env)->GetStaticObjectField(env, sf_status_class, fID);
+    CHECK_NULL_RETURN(f, NULL);
+    f  = (*env)->NewGlobalRef(env, f);
+    CHECK_NULL_RETURN(f, NULL);
+    return f;
+}
+
+/*
+ * Retrieve the int file-descriptor from a public socket type object.
+ * Gets impl, then the FileDescriptor from the impl, and then the fd
+ * from that.
+ */
+static int getFD(JNIEnv *env, jobject fileDesc) {
+    return (*env)->GetIntField(env, fileDesc, sf_fd_fdID);
+}
+
+/**
+ * Sets the status field of a SocketFlow to one of the
+ * canned enum values
+ */
+static void setStatus (JNIEnv *env, jobject obj, int errval) {
+    switch (errval) {
+      case 0: /* OK */
+        (*env)->SetObjectField(env, obj, sf_status, sfs_OK);
+        break;
+      case EPERM:
+        (*env)->SetObjectField(env, obj, sf_status, sfs_NOPERMISSION);
+        break;
+      case ENOTCONN:
+        (*env)->SetObjectField(env, obj, sf_status, sfs_NOTCONNECTED);
+        break;
+      case EOPNOTSUPP:
+        (*env)->SetObjectField(env, obj, sf_status, sfs_NOTSUPPORTED);
+        break;
+      case EALREADY:
+        (*env)->SetObjectField(env, obj, sf_status, sfs_ALREADYCREATED);
+        break;
+      case EINPROGRESS:
+        (*env)->SetObjectField(env, obj, sf_status, sfs_INPROGRESS);
+        break;
+      default:
+        (*env)->SetObjectField(env, obj, sf_status, sfs_OTHER);
+        break;
+    }
+}
+
+#ifdef __solaris__
+
+/*
+ * Class:     sun_net_ExtendedOptionsImpl
+ * Method:    setFlowOption
+ * Signature: (Ljava/io/FileDescriptor;Ljdk/net/SocketFlow;)V
+ */
+JNIEXPORT void JNICALL Java_sun_net_ExtendedOptionsImpl_setFlowOption
+  (JNIEnv *env, jclass UNUSED, jobject fileDesc, jobject flow) {
+    int fd = getFD(env, fileDesc);
+
+    if (fd < 0) {
+        NET_ERROR(env, JNU_JAVANETPKG "SocketException", "socket closed");
+        return;
+    } else {
+        sock_flow_props_t props;
+        jlong bandwidth;
+        int rv;
+
+        jint priority = (*env)->GetIntField(env, flow, sf_priority);
+        memset(&props, 0, sizeof(props));
+        props.sfp_version = SOCK_FLOW_PROP_VERSION1;
+
+        if (priority != jdk_net_SocketFlow_UNSET) {
+            props.sfp_mask |= SFP_PRIORITY;
+            props.sfp_priority = priority;
+        }
+        bandwidth = (*env)->GetLongField(env, flow, sf_bandwidth);
+        if (bandwidth > -1)  {
+            props.sfp_mask |= SFP_MAXBW;
+            props.sfp_maxbw = (uint64_t) bandwidth;
+        }
+        rv = setsockopt(fd, SOL_SOCKET, SO_FLOW_SLA, &props, sizeof(props));
+        if (rv < 0) {
+            if (errno == ENOPROTOOPT) {
+                JNU_ThrowByName(env, "java/lang/UnsupportedOperationException",
+                        "unsupported socket option");
+            } else {
+                NET_ERROR(env, JNU_JAVANETPKG "SocketException",
+                                "set option SO_FLOW_SLA failed");
+            }
+            return;
+        }
+        setStatus(env, flow, props.sfp_status);
+    }
+}
+
+/*
+ * Class:     sun_net_ExtendedOptionsImpl
+ * Method:    getFlowOption
+ * Signature: (Ljava/io/FileDescriptor;Ljdk/net/SocketFlow;)V
+ */
+JNIEXPORT void JNICALL Java_sun_net_ExtendedOptionsImpl_getFlowOption
+  (JNIEnv *env, jclass UNUSED, jobject fileDesc, jobject flow) {
+    int fd = getFD(env, fileDesc);
+
+    if (fd < 0) {
+        NET_ERROR(env, JNU_JAVANETPKG "SocketException", "socket closed");
+        return;
+    } else {
+        sock_flow_props_t props;
+        int status;
+        socklen_t sz = sizeof(props);
+
+        int rv = getsockopt(fd, SOL_SOCKET, SO_FLOW_SLA, &props, &sz);
+        if (rv < 0) {
+            if (errno == ENOPROTOOPT) {
+                JNU_ThrowByName(env, "java/lang/UnsupportedOperationException",
+                        "unsupported socket option");
+            } else {
+                NET_ERROR(env, JNU_JAVANETPKG "SocketException",
+                                "set option SO_FLOW_SLA failed");
+            }
+            return;
+        }
+        /* first check status to see if flow exists */
+        status = props.sfp_status;
+        setStatus(env, flow, status);
+        if (status == 0) { /* OK */
+            /* can set the other fields now */
+            if (props.sfp_mask & SFP_PRIORITY) {
+                (*env)->SetIntField(env, flow, sf_priority, props.sfp_priority);
+            }
+            if (props.sfp_mask & SFP_MAXBW) {
+                (*env)->SetLongField(env, flow, sf_bandwidth,
+                                        (jlong)props.sfp_maxbw);
+            }
+        }
+    }
+}
+
+static jboolean flowsupported;
+static jboolean flowsupported_set = JNI_FALSE;
+
+static jboolean flowSupported0() {
+    /* Do a simple dummy call, and try to figure out from that */
+    sock_flow_props_t props;
+    int rv, s;
+    if (flowsupported_set) {
+        return flowsupported;
+    }
+    s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
+    if (s < 0) {
+        flowsupported = JNI_FALSE;
+        flowsupported_set = JNI_TRUE;
+        return JNI_FALSE;
+    }
+    memset(&props, 0, sizeof(props));
+    props.sfp_version = SOCK_FLOW_PROP_VERSION1;
+    props.sfp_mask |= SFP_PRIORITY;
+    props.sfp_priority = SFP_PRIO_NORMAL;
+    rv = setsockopt(s, SOL_SOCKET, SO_FLOW_SLA, &props, sizeof(props));
+    if (rv != 0 && errno == ENOPROTOOPT) {
+        rv = JNI_FALSE;
+    } else {
+        rv = JNI_TRUE;
+    }
+    close(s);
+    flowsupported = rv;
+    flowsupported_set = JNI_TRUE;
+    return flowsupported;
+}
+
+#else /* __solaris__ */
+
+/* Non Solaris. Functionality is not supported. So, throw UnsupportedOpExc */
+
+JNIEXPORT void JNICALL Java_sun_net_ExtendedOptionsImpl_setFlowOption
+  (JNIEnv *env, jclass UNUSED, jobject fileDesc, jobject flow) {
+    JNU_ThrowByName(env, "java/lang/UnsupportedOperationException",
+        "unsupported socket option");
+}
+
+JNIEXPORT void JNICALL Java_sun_net_ExtendedOptionsImpl_getFlowOption
+  (JNIEnv *env, jclass UNUSED, jobject fileDesc, jobject flow) {
+    JNU_ThrowByName(env, "java/lang/UnsupportedOperationException",
+        "unsupported socket option");
+}
+
+static jboolean flowSupported0() {
+    return JNI_FALSE;
+}
+
+#endif /* __solaris__ */
+
+JNIEXPORT jboolean JNICALL Java_sun_net_ExtendedOptionsImpl_flowSupported
+  (JNIEnv *env, jclass UNUSED) {
+    return flowSupported0();
+}
--- a/src/solaris/native/java/net/net_util_md.h	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/solaris/native/java/net/net_util_md.h	Wed Apr 16 15:03:29 2014 -0700
@@ -93,7 +93,46 @@
 
 #ifdef __solaris__
 extern int net_getParam(char *driver, char *param);
-#endif
+
+#ifndef SO_FLOW_SLA
+#define SO_FLOW_SLA 0x1018
+
+#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
+#pragma pack(4)
+ #endif
+
+/*
+ * Used with the setsockopt(SO_FLOW_SLA, ...) call to set
+ * per socket service level properties.
+ * When the application uses per-socket API, we will enforce the properties
+ * on both outbound and inbound packets.
+ *
+ * For now, only priority and maxbw are supported in SOCK_FLOW_PROP_VERSION1.
+ */
+typedef struct sock_flow_props_s {
+        int             sfp_version;
+        uint32_t        sfp_mask;
+        int             sfp_priority;   /* flow priority */
+        uint64_t        sfp_maxbw;      /* bandwidth limit in bps */
+        int             sfp_status;     /* flow create status for getsockopt */
+} sock_flow_props_t;
+
+#define SOCK_FLOW_PROP_VERSION1 1
+
+/* bit mask values for sfp_mask */
+#define SFP_MAXBW       0x00000001      /* Flow Bandwidth Limit */
+#define SFP_PRIORITY    0x00000008      /* Flow priority */
+
+/* possible values for sfp_priority */
+#define SFP_PRIO_NORMAL 1
+#define SFP_PRIO_HIGH   2
+
+#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
+#pragma pack()
+#endif /* _LONG_LONG_ALIGNMENT */
+
+#endif /* SO_FLOW_SLA */
+#endif /* __solaris__ */
 
 /* needed from libsocket on Solaris 8 */
 
--- a/src/solaris/native/java/util/FileSystemPreferences.c	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/solaris/native/java/util/FileSystemPreferences.c	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2012, 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
@@ -38,12 +38,14 @@
 JNIEXPORT jint JNICALL
 Java_java_util_prefs_FileSystemPreferences_chmod(JNIEnv *env,
                        jclass thisclass, jstring java_fname, jint permission) {
-    const char *fname = JNU_GetStringPlatformChars(env, java_fname, JNI_FALSE);
-    int result;
-    result =  chmod(fname, permission);
-    if (result != 0)
-       result = errno;
-    JNU_ReleaseStringPlatformChars(env, java_fname, fname);
+    const char *fname = JNU_GetStringPlatformChars(env, java_fname, NULL);
+    int result = -1;
+    if (fname) {
+        result =  chmod(fname, permission);
+        if (result != 0)
+            result = errno;
+        JNU_ReleaseStringPlatformChars(env, java_fname, fname);
+    }
     return (jint) result;
 }
 
@@ -61,13 +63,16 @@
 JNIEXPORT jintArray JNICALL
 Java_java_util_prefs_FileSystemPreferences_lockFile0(JNIEnv *env,
     jclass thisclass, jstring java_fname, jint permission, jboolean shared) {
-    const char *fname = JNU_GetStringPlatformChars(env, java_fname, JNI_FALSE);
+    const char *fname = JNU_GetStringPlatformChars(env, java_fname, NULL);
     int fd, rc;
     int result[2];
-    jintArray javaResult;
+    jintArray javaResult = NULL;
     int old_umask;
     FLOCK fl;
 
+    if (!fname)
+        return javaResult;
+
     fl.l_whence = SEEK_SET;
     fl.l_len = 0;
     fl.l_start = 0;
@@ -104,7 +109,8 @@
     }
     JNU_ReleaseStringPlatformChars(env, java_fname, fname);
     javaResult = (*env)->NewIntArray(env,2);
-    (*env)->SetIntArrayRegion(env, javaResult, 0, 2, result);
+    if (javaResult)
+        (*env)->SetIntArrayRegion(env, javaResult, 0, 2, result);
     return javaResult;
 }
 
--- a/src/solaris/native/sun/awt/awt_Font.c	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/solaris/native/sun/awt/awt_Font.c	Wed Apr 16 15:03:29 2014 -0700
@@ -540,6 +540,19 @@
                     fdata->xfont = fdata->flist[i].xfont;
                     fdata->flist[i].index_length = 1;
                 } else {
+                    /* Free any already allocated storage and fonts */
+                    int j = i;
+                    for (j = 0; j <= i; j++) {
+                        free((void *)fdata->flist[j].xlfd);
+                        JNU_ReleaseStringPlatformChars(env, NULL,
+                            fdata->flist[j].charset_name);
+                        if (fdata->flist[j].load) {
+                            XFreeFont(awt_display, fdata->flist[j].xfont);
+                        }
+                    }
+                    free((void *)fdata->flist);
+                    free((void *)fdata);
+
                     if (errmsg != NULL) {
                         *errmsg = "java/lang" "NullPointerException";
                     }
--- a/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Wed Apr 16 15:03:29 2014 -0700
@@ -1,3 +1,28 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
 #include <jni.h>
 #include <stdio.h>
 #include <jni_util.h>
--- a/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.h	Wed Apr 16 12:32:36 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class sun_awt_X11_GtkFileDialogPeer */
-
-#ifndef _Included_sun_awt_X11_GtkFileDialogPeer
-#define _Included_sun_awt_X11_GtkFileDialogPeer
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/*
- * Class:     sun_awt_X11_GtkFileDialogPeer
- * Method:    initIDs
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_initIDs
-(JNIEnv *, jclass);
-
-/*
- * Class:     sun_awt_X11_GtkFileDialogPeer
- * Method:    run
- * Signature: (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/io/FilenameFilter;ZII)V
- */
-JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_run
-(JNIEnv *, jobject, jstring, jint, jstring, jstring, jobject, jboolean, jint, jint);
-
-/*
- * Class:     sun_awt_X11_GtkFileDialogPeer
- * Method:    quit
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_quit
-(JNIEnv *, jobject);
-
-/*
- * Class:     sun_awt_X11_GtkFileDialogPeer
- * Method:    toFront
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_toFront
-(JNIEnv *, jobject);
-
-/*
- * Class:     sun_awt_X11_GtkFileDialogPeer
- * Method:    setBounds
- * Signature: (IIIII)V
- */
-JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_setBounds
-(JNIEnv * env, jobject jpeer, jint x, jint y, jint width, jint height, jint op);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
--- a/src/windows/classes/sun/awt/windows/ThemeReader.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/ThemeReader.java	Wed Apr 16 15:03:29 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
@@ -25,11 +25,15 @@
 
 package sun.awt.windows;
 
-import java.awt.*;
-import java.util.*;
-import java.util.concurrent.locks.*;
-import java.beans.*;
-import javax.swing.SwingUtilities;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Insets;
+import java.awt.Point;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 /* !!!! WARNING !!!!
  * This class has to be in sync with
@@ -45,9 +49,9 @@
  * @author Bino George
  * @author Igor Kushnirskiy
  */
-public class ThemeReader {
-    private static final HashMap<String, Long> widgetToTheme =
-        new HashMap<String, Long>();
+public final class ThemeReader {
+
+    private static final Map<String, Long> widgetToTheme = new HashMap<>();
 
     // lock for the cache
     // reading should be done with readLock
@@ -70,7 +74,7 @@
         }
     }
 
-    public native static boolean isThemed();
+    public static native boolean isThemed();
 
     // this should be called only with writeLock held
     private static Long getThemeImpl(String widget) {
@@ -109,8 +113,9 @@
         return theme;
     }
 
-    public native static void paintBackground(int[] buffer, long theme, int part, int state,
-                             int x, int y, int w, int h, int stride);
+    private static native void paintBackground(int[] buffer, long theme,
+                                               int part, int state, int x,
+                                               int y, int w, int h, int stride);
 
     public static void paintBackground(int[] buffer, String widget,
            int part, int state, int x, int y, int w, int h, int stride) {
@@ -122,8 +127,8 @@
         }
     }
 
-    public native static Insets getThemeMargins(long theme, int part, int state,
- int marginType);
+    private static native Insets getThemeMargins(long theme, int part,
+                                                 int state, int marginType);
 
     public static Insets getThemeMargins(String widget, int part, int state, int marginType) {
         readLock.lock();
@@ -134,7 +139,7 @@
         }
     }
 
-    private native static boolean isThemePartDefined(long theme, int part, int state);
+    private static native boolean isThemePartDefined(long theme, int part, int state);
 
     public static boolean isThemePartDefined(String widget, int part, int state) {
         readLock.lock();
@@ -145,8 +150,8 @@
         }
     }
 
-    public native static Color getColor(long theme, int part, int state,
-                                                               int property);
+    private static native Color getColor(long theme, int part, int state,
+                                         int property);
 
     public static Color getColor(String widget, int part, int state, int property) {
         readLock.lock();
@@ -157,8 +162,8 @@
         }
     }
 
-    public native static int getInt(long theme, int part, int state,
-                                                                int property);
+    private static native int getInt(long theme, int part, int state,
+                                     int property);
 
     public static int getInt(String widget, int part, int state, int property) {
         readLock.lock();
@@ -169,8 +174,8 @@
         }
     }
 
-    public native static int getEnum(long theme, int part, int state,
-                                                                int property);
+    private static native int getEnum(long theme, int part, int state,
+                                      int property);
 
     public static int getEnum(String widget, int part, int state, int property) {
         readLock.lock();
@@ -181,8 +186,8 @@
         }
     }
 
-    public native static boolean getBoolean(long theme, int part, int state,
-                                                                int property);
+    private static native boolean getBoolean(long theme, int part, int state,
+                                             int property);
 
     public static boolean getBoolean(String widget, int part, int state,
                                      int property) {
@@ -194,7 +199,7 @@
         }
     }
 
-    public native static boolean getSysBoolean(long theme, int property);
+    private static native boolean getSysBoolean(long theme, int property);
 
     public static boolean getSysBoolean(String widget, int property) {
         readLock.lock();
@@ -205,8 +210,8 @@
         }
     }
 
-    public native static Point getPoint(long theme, int part, int state,
-                                                                int property);
+    private static native Point getPoint(long theme, int part, int state,
+                                         int property);
 
     public static Point getPoint(String widget, int part, int state, int property) {
         readLock.lock();
@@ -217,8 +222,8 @@
         }
     }
 
-    public native static Dimension getPosition(long theme, int part, int state,
-                                                                 int property);
+    private static native Dimension getPosition(long theme, int part, int state,
+                                                int property);
 
     public static Dimension getPosition(String widget, int part, int state,
                                         int property) {
@@ -230,7 +235,8 @@
         }
     }
 
-    public native static Dimension getPartSize(long theme, int part, int state);
+    private static native Dimension getPartSize(long theme, int part,
+                                                int state);
 
     public static Dimension getPartSize(String widget, int part, int state) {
         readLock.lock();
@@ -241,14 +247,15 @@
         }
     }
 
-    public native static long openTheme(String widget);
+    private static native long openTheme(String widget);
 
-    public native static void closeTheme(long theme);
+    private static native void closeTheme(long theme);
 
-    public native static void setWindowTheme(String subAppName);
+    private static native void setWindowTheme(String subAppName);
 
-    private native static long getThemeTransitionDuration(long theme, int part,
+    private static native long getThemeTransitionDuration(long theme, int part,
                                         int stateFrom, int stateTo, int propId);
+
     public static long getThemeTransitionDuration(String widget, int part,
                                        int stateFrom, int stateTo, int propId) {
         readLock.lock();
@@ -259,10 +266,12 @@
             readLock.unlock();
         }
     }
-    public native static boolean isGetThemeTransitionDurationDefined();
 
-    private native static Insets getThemeBackgroundContentMargins(long theme,
+    public static native boolean isGetThemeTransitionDurationDefined();
+
+    private static native Insets getThemeBackgroundContentMargins(long theme,
                      int part, int state, int boundingWidth, int boundingHeight);
+
     public static Insets getThemeBackgroundContentMargins(String widget,
                     int part, int state, int boundingWidth, int boundingHeight) {
         readLock.lock();
--- a/src/windows/classes/sun/awt/windows/TranslucentWindowPainter.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/TranslucentWindowPainter.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -33,7 +33,6 @@
 import java.awt.image.BufferedImage;
 import java.awt.image.DataBufferInt;
 import java.awt.image.VolatileImage;
-import java.lang.ref.WeakReference;
 import java.security.AccessController;
 import sun.awt.image.BufImgSurfaceData;
 import sun.java2d.DestSurfaceProvider;
@@ -46,7 +45,6 @@
 import sun.security.action.GetPropertyAction;
 
 import static java.awt.image.VolatileImage.*;
-import static java.awt.Transparency.*;
 import static sun.java2d.pipe.hw.AccelSurface.*;
 import static sun.java2d.pipe.hw.ContextCapabilities.*;
 
@@ -59,7 +57,7 @@
  * Note: this class does not attempt to be thread safe, it is expected to be
  * called from a single thread (EDT).
  */
-public abstract class TranslucentWindowPainter {
+abstract class TranslucentWindowPainter {
 
     protected Window window;
     protected WWindowPeer peer;
@@ -231,6 +229,7 @@
             return (viBB != null ? !viBB.contentsLost() : true);
         }
 
+        @Override
         public void flush() {
             if (backBuffer != null) {
                 backBuffer.flush();
@@ -313,6 +312,7 @@
                     try {
                         BufferedContext.validateContext(as);
                         rq.flushAndInvokeNow(new Runnable() {
+                            @Override
                             public void run() {
                                 long psdops = as.getNativeOps();
                                 arr[0] = updateWindowAccel(psdops, w, h);
--- a/src/windows/classes/sun/awt/windows/WBufferStrategy.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WBufferStrategy.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2011, 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
@@ -34,8 +34,9 @@
  * the back buffer associated with a Component.  If that
  * Component has a BufferStrategy with >1 buffer, then the
  * Image subclass associated with that buffer will be returned.
+ * Note: the class is used by the JAWT3d.
  */
-public class WBufferStrategy {
+public final class WBufferStrategy {
 
     private static native void initIDs(Class <?> componentClass);
 
--- a/src/windows/classes/sun/awt/windows/WButtonPeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WButtonPeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,7 @@
 
     // ComponentPeer overrides
 
+    @Override
     public Dimension getMinimumSize() {
         FontMetrics fm = getFontMetrics(((Button)target).getFont());
         String label = ((Button)target).getLabel();
@@ -46,12 +47,14 @@
         return new Dimension(fm.stringWidth(label) + 14,
                              fm.getHeight() + 8);
     }
+    @Override
     public boolean isFocusable() {
         return true;
     }
 
     // ButtonPeer implementation
 
+    @Override
     public native void setLabel(String label);
 
     // Toolkit & peer internals
@@ -60,6 +63,7 @@
         super(target);
     }
 
+    @Override
     native void create(WComponentPeer peer);
 
     // native callbacks
@@ -70,6 +74,7 @@
         // Fixed 5064013: the InvocationEvent time should be equals
         // the time of the ActionEvent
         WToolkit.executeOnEventHandlerThread(target, new Runnable() {
+            @Override
             public void run() {
                 postEvent(new ActionEvent(target, ActionEvent.ACTION_PERFORMED,
                                           ((Button)target).getActionCommand(),
@@ -79,6 +84,7 @@
     }
 
 
+    @Override
     public boolean shouldClearRectBeforePaint() {
         return false;
     }
@@ -88,6 +94,7 @@
      */
     private static native void initIDs();
 
+    @Override
     public boolean handleJavaKeyEvent(KeyEvent e) {
          switch (e.getID()) {
             case KeyEvent.KEY_RELEASED:
--- a/src/windows/classes/sun/awt/windows/WCanvasPeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WCanvasPeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,12 +24,16 @@
  */
 package sun.awt.windows;
 
-import java.awt.*;
-import java.awt.peer.*;
-import java.lang.ref.WeakReference;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.peer.CanvasPeer;
+
+import sun.awt.PaintEventDispatcher;
 import sun.awt.SunToolkit;
-import sun.awt.Win32GraphicsDevice;
-import sun.awt.PaintEventDispatcher;
 
 class WCanvasPeer extends WComponentPeer implements CanvasPeer {
 
@@ -41,8 +45,10 @@
         super(target);
     }
 
+    @Override
     native void create(WComponentPeer parent);
 
+    @Override
     void initialize() {
         eraseBackground = !SunToolkit.getSunAwtNoerasebackground();
         boolean eraseBackgroundOnResize = SunToolkit.getSunAwtErasebackgroundonresize();
@@ -60,6 +66,7 @@
         }
     }
 
+    @Override
     public void paint(Graphics g) {
         Dimension d = ((Component)target).getSize();
         if (g instanceof Graphics2D ||
@@ -75,6 +82,7 @@
         super.paint(g);
     }
 
+    @Override
     public boolean shouldClearRectBeforePaint() {
         return eraseBackground;
     }
@@ -99,6 +107,7 @@
     private native void setNativeBackgroundErase(boolean doErase,
                                                  boolean doEraseOnResize);
 
+    @Override
     public GraphicsConfiguration getAppropriateGraphicsConfiguration(
             GraphicsConfiguration gc)
     {
--- a/src/windows/classes/sun/awt/windows/WCheckboxMenuItemPeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WCheckboxMenuItemPeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,16 @@
  */
 package sun.awt.windows;
 
-import java.awt.*;
-import java.awt.peer.*;
+import java.awt.CheckboxMenuItem;
 import java.awt.event.ItemEvent;
+import java.awt.peer.CheckboxMenuItemPeer;
 
-class WCheckboxMenuItemPeer extends WMenuItemPeer implements CheckboxMenuItemPeer {
+final class WCheckboxMenuItemPeer extends WMenuItemPeer
+        implements CheckboxMenuItemPeer {
 
     // CheckboxMenuItemPeer implementation
 
+    @Override
     public native void setState(boolean t);
 
     // Toolkit & peer internals
@@ -46,6 +48,7 @@
     public void handleAction(final boolean state) {
         final CheckboxMenuItem target = (CheckboxMenuItem)this.target;
         WToolkit.executeOnEventHandlerThread(target, new Runnable() {
+            @Override
             public void run() {
                 target.setState(state);
                 postEvent(new ItemEvent(target, ItemEvent.ITEM_STATE_CHANGED,
--- a/src/windows/classes/sun/awt/windows/WCheckboxPeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WCheckboxPeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,12 +32,16 @@
 
     // CheckboxPeer implementation
 
+    @Override
     public native void setState(boolean state);
+    @Override
     public native void setCheckboxGroup(CheckboxGroup g);
+    @Override
     public native void setLabel(String label);
 
     private static native int getCheckMarkSize();
 
+    @Override
     public Dimension getMinimumSize() {
         String lbl = ((Checkbox)target).getLabel();
         int marksize = getCheckMarkSize();
@@ -54,6 +58,7 @@
                              Math.max(fm.getHeight() + 8,  marksize));
     }
 
+    @Override
     public boolean isFocusable() {
         return true;
     }
@@ -64,8 +69,10 @@
         super(target);
     }
 
+    @Override
     native void create(WComponentPeer parent);
 
+    @Override
     void initialize() {
         Checkbox t = (Checkbox)target;
         setState(t.getState());
@@ -79,6 +86,7 @@
         super.initialize();
     }
 
+    @Override
     public boolean shouldClearRectBeforePaint() {
         return false;
     }
@@ -88,6 +96,7 @@
     void handleAction(final boolean state) {
         final Checkbox cb = (Checkbox)this.target;
         WToolkit.executeOnEventHandlerThread(cb, new Runnable() {
+            @Override
             public void run() {
                 CheckboxGroup chg = cb.getCheckboxGroup();
                 if ((chg != null) && (cb == chg.getSelectedCheckbox()) && cb.getState()) {
--- a/src/windows/classes/sun/awt/windows/WChoicePeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WChoicePeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,7 @@
 
     // WComponentPeer overrides
 
+    @Override
     public Dimension getMinimumSize() {
         FontMetrics fm = getFontMetrics(((Choice)target).getFont());
         Choice c = (Choice)target;
@@ -45,23 +46,29 @@
         }
         return new Dimension(28 + w, Math.max(fm.getHeight() + 6, 15));
     }
+    @Override
     public boolean isFocusable() {
         return true;
     }
 
     // ChoicePeer implementation
 
+    @Override
     public native void select(int index);
 
+    @Override
     public void add(String item, int index) {
         addItem(item, index);
     }
 
+    @Override
     public boolean shouldClearRectBeforePaint() {
         return false;
     }
 
+    @Override
     public native void removeAll();
+    @Override
     public native void remove(int index);
 
     /**
@@ -72,6 +79,7 @@
     }
     public native void addItems(String[] items, int index);
 
+    @Override
     public synchronized native void reshape(int x, int y, int width, int height);
 
     private WindowListener windowListener;
@@ -82,8 +90,10 @@
         super(target);
     }
 
+    @Override
     native void create(WComponentPeer parent);
 
+    @Override
     @SuppressWarnings("deprecation")
     void initialize() {
         Choice opt = (Choice)target;
@@ -104,9 +114,11 @@
             WWindowPeer wpeer = (WWindowPeer)parentWindow.getPeer();
             if (wpeer != null) {
                 windowListener = new WindowAdapter() {
+                        @Override
                         public void windowIconified(WindowEvent e) {
                             closeList();
                         }
+                        @Override
                         public void windowClosing(WindowEvent e) {
                             closeList();
                         }
@@ -117,6 +129,7 @@
         super.initialize();
     }
 
+    @Override
     @SuppressWarnings("deprecation")
     protected void disposeImpl() {
         // TODO: we should somehow reset the listener when the choice
@@ -136,6 +149,7 @@
     void handleAction(final int index) {
         final Choice c = (Choice)target;
         WToolkit.executeOnEventHandlerThread(c, new Runnable() {
+            @Override
             public void run() {
                 c.select(index);
                 postEvent(new ItemEvent(c, ItemEvent.ITEM_STATE_CHANGED,
--- a/src/windows/classes/sun/awt/windows/WClipboard.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WClipboard.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,14 +28,11 @@
 import java.awt.datatransfer.DataFlavor;
 import java.awt.datatransfer.Transferable;
 import java.awt.datatransfer.UnsupportedFlavorException;
-
 import java.io.IOException;
-
-import java.util.Iterator;
 import java.util.Map;
 
+import sun.awt.datatransfer.DataTransferer;
 import sun.awt.datatransfer.SunClipboard;
-import sun.awt.datatransfer.DataTransferer;
 
 
 /**
@@ -50,18 +47,20 @@
  *
  * @since JDK1.1
  */
-public class WClipboard extends SunClipboard {
+final class WClipboard extends SunClipboard {
 
     private boolean isClipboardViewerRegistered;
 
-    public WClipboard() {
+    WClipboard() {
         super("System");
     }
 
+    @Override
     public long getID() {
         return 0;
     }
 
+    @Override
     protected void setContentsNative(Transferable contents) {
         // Don't use delayed Clipboard rendering for the Transferable's data.
         // If we did that, we would call Transferable.getTransferData on
@@ -106,6 +105,7 @@
      * Currently delayed data rendering is not used for the Windows clipboard,
      * so there is no native context to clear.
      */
+    @Override
     protected void clearNativeContext() {}
 
     /**
@@ -114,11 +114,13 @@
      *
      * @throws IllegalStateException if the clipboard has not been opened
      */
+    @Override
     public native void openClipboard(SunClipboard newOwner) throws IllegalStateException;
     /**
      * Call the Win32 CloseClipboard function if we have clipboard ownership,
      * does nothing if we have not ownership.
      */
+    @Override
     public native void closeClipboard();
     /**
      * Call the Win32 SetClipboardData function.
@@ -130,9 +132,12 @@
         init();
     }
 
+    @Override
     protected native long[] getClipboardFormats();
+    @Override
     protected native byte[] getClipboardData(long format) throws IOException;
 
+    @Override
     protected void registerClipboardViewerChecked() {
         if (!isClipboardViewerRegistered) {
             registerClipboardViewer();
@@ -147,6 +152,7 @@
      * until the toolkit window disposing since MSDN suggests removing
      * the window from the clipboard viewer chain just before it is destroyed.
      */
+    @Override
     protected void unregisterClipboardViewerChecked() {}
 
     /**
@@ -174,6 +180,7 @@
      *
      * @since 1.5
      */
+    @Override
     protected Transferable createLocaleTransferable(long[] formats) throws IOException {
         boolean found = false;
         for (int i = 0; i < formats.length; i++) {
@@ -196,12 +203,15 @@
         final byte[] localeDataFinal = localeData;
 
         return new Transferable() {
+                @Override
                 public DataFlavor[] getTransferDataFlavors() {
                     return new DataFlavor[] { DataTransferer.javaTextEncodingFlavor };
                 }
+                @Override
                 public boolean isDataFlavorSupported(DataFlavor flavor) {
                     return flavor.equals(DataTransferer.javaTextEncodingFlavor);
                 }
+                @Override
                 public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException {
                     if (isDataFlavorSupported(flavor)) {
                         return localeDataFinal;
@@ -210,5 +220,4 @@
                 }
             };
     }
-
 }
--- a/src/windows/classes/sun/awt/windows/WColor.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WColor.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 /*
  * This helper class maps Windows system colors to AWT Color objects.
  */
-class WColor {
+final class WColor {
 
     static final int WINDOW_BKGND = 1;  // COLOR_WINDOW
     static final int WINDOW_TEXT  = 2;  // COLOR_WINDOWTEXT
--- a/src/windows/classes/sun/awt/windows/WComponentPeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WComponentPeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -93,7 +93,9 @@
     private Color background;
     private Font font;
 
+    @Override
     public native boolean isObscured();
+    @Override
     public boolean canDetermineObscurity() { return true; }
 
     // DropTarget support
@@ -101,19 +103,21 @@
     int nDropTargets;
     long nativeDropTargetContext; // native pointer
 
-    public synchronized native void pShow();
-    public synchronized native void hide();
-    public synchronized native void enable();
-    public synchronized native void disable();
+    private synchronized native void pShow();
+    synchronized native void hide();
+    synchronized native void enable();
+    synchronized native void disable();
 
     public long getHWnd() {
         return hwnd;
     }
 
     /* New 1.1 API */
+    @Override
     public native Point getLocationOnScreen();
 
     /* New 1.1 API */
+    @Override
     public void setVisible(boolean b) {
         if (b) {
             show();
@@ -130,6 +134,7 @@
     }
 
     /* New 1.1 API */
+    @Override
     public void setEnabled(boolean b) {
         if (b) {
             enable();
@@ -143,6 +148,7 @@
     private native void reshapeNoCheck(int x, int y, int width, int height);
 
     /* New 1.1 API */
+    @Override
     public void setBounds(int x, int y, int width, int height, int op) {
         // Should set paintPending before reahape to prevent
         // thread race between paint events
@@ -185,6 +191,7 @@
         final Container cont = (Container)target;
 
         WToolkit.executeOnEventHandlerThread(cont, new Runnable() {
+            @Override
             public void run() {
                 // Discarding old paint events doesn't seem to be necessary.
                 cont.invalidate();
@@ -228,6 +235,7 @@
 
     native synchronized void updateWindow();
 
+    @Override
     public void paint(Graphics g) {
         ((Component)target).paint(g);
     }
@@ -239,6 +247,7 @@
     private native int[] createPrintedPixels(int srcX, int srcY,
                                              int srcW, int srcH,
                                              int alpha);
+    @Override
     public void print(Graphics g) {
 
         Component comp = (Component)target;
@@ -275,6 +284,7 @@
         comp.print(g);
     }
 
+    @Override
     public void coalescePaintEvent(PaintEvent e) {
         Rectangle r = e.getUpdateRect();
         if (!(e instanceof IgnorePaintEvent)) {
@@ -319,6 +329,7 @@
 
     native void nativeHandleEvent(AWTEvent e);
 
+    @Override
     @SuppressWarnings("fallthrough")
     public void handleEvent(AWTEvent e) {
         int id = e.getID();
@@ -367,21 +378,25 @@
 
     native void setFocus(boolean doSetFocus);
 
+    @Override
     public Dimension getMinimumSize() {
         return ((Component)target).getSize();
     }
 
+    @Override
     public Dimension getPreferredSize() {
         return getMinimumSize();
     }
 
     // Do nothing for heavyweight implementation
+    @Override
     public void layout() {}
 
     public Rectangle getBounds() {
         return ((Component)target).getBounds();
     }
 
+    @Override
     public boolean isFocusable() {
         return false;
     }
@@ -390,6 +405,7 @@
      * Return the GraphicsConfiguration associated with this peer, either
      * the locally stored winGraphicsConfig, or that of the target Component.
      */
+    @Override
     public GraphicsConfiguration getGraphicsConfiguration() {
         if (winGraphicsConfig != null) {
             return winGraphicsConfig;
@@ -481,6 +497,7 @@
 
     public void replaceSurfaceDataLater() {
         Runnable r = new Runnable() {
+            @Override
             public void run() {
                 // Shouldn't do anything if object is disposed in meanwhile
                 // No need for sync as disposeAction in Window is performed
@@ -501,6 +518,7 @@
         }
     }
 
+    @Override
     public boolean updateGraphicsData(GraphicsConfiguration gc) {
         winGraphicsConfig = (Win32GraphicsConfig)gc;
         try {
@@ -512,6 +530,7 @@
     }
 
     //This will return null for Components not yet added to a Container
+    @Override
     public ColorModel getColorModel() {
         GraphicsConfiguration gc = getGraphicsConfiguration();
         if (gc != null) {
@@ -549,6 +568,7 @@
     // fallback default font object
     final static Font defaultFont = new Font(Font.DIALOG, Font.PLAIN, 12);
 
+    @Override
     @SuppressWarnings("deprecation")
     public Graphics getGraphics() {
         if (isDisposed()) {
@@ -601,11 +621,13 @@
         }
         return null;
     }
+    @Override
     public FontMetrics getFontMetrics(Font font) {
         return WFontMetrics.getFontMetrics(font);
     }
 
     private synchronized native void _dispose();
+    @Override
     protected void disposeImpl() {
         SurfaceData oldData = surfaceData;
         surfaceData = null;
@@ -618,17 +640,20 @@
 
     public void disposeLater() {
         postEvent(new InvocationEvent(target, new Runnable() {
+            @Override
             public void run() {
                 dispose();
             }
         }));
     }
 
+    @Override
     public synchronized void setForeground(Color c) {
         foreground = c;
         _setForeground(c.getRGB());
     }
 
+    @Override
     public synchronized void setBackground(Color c) {
         background = c;
         _setBackground(c.getRGB());
@@ -644,19 +669,22 @@
         return background;
     }
 
-    public native void _setForeground(int rgb);
-    public native void _setBackground(int rgb);
+    private native void _setForeground(int rgb);
+    private native void _setBackground(int rgb);
 
+    @Override
     public synchronized void setFont(Font f) {
         font = f;
         _setFont(f);
     }
-    public synchronized native void _setFont(Font f);
+    synchronized native void _setFont(Font f);
+    @Override
     public void updateCursorImmediately() {
         WGlobalCursorManager.getCursorManager().updateCursorImmediately();
     }
 
     // TODO: consider moving it to KeyboardFocusManagerPeerImpl
+    @Override
     @SuppressWarnings("deprecation")
     public boolean requestFocus(Component lightweightChild, boolean temporary,
                                 boolean focusedWindowChangeAllowed, long time,
@@ -720,24 +748,29 @@
         return false;
     }
 
+    @Override
     public Image createImage(ImageProducer producer) {
         return new ToolkitImage(producer);
     }
 
+    @Override
     public Image createImage(int width, int height) {
         Win32GraphicsConfig gc =
             (Win32GraphicsConfig)getGraphicsConfiguration();
         return gc.createAcceleratedImage((Component)target, width, height);
     }
 
+    @Override
     public VolatileImage createVolatileImage(int width, int height) {
         return new SunVolatileImage((Component)target, width, height);
     }
 
+    @Override
     public boolean prepareImage(Image img, int w, int h, ImageObserver o) {
         return Toolkit.getDefaultToolkit().prepareImage(img, w, h, o);
     }
 
+    @Override
     public int checkImage(Image img, int w, int h, ImageObserver o) {
         return Toolkit.getDefaultToolkit().checkImage(img, w, h, o);
     }
@@ -891,6 +924,7 @@
      * register a DropTarget with this native peer
      */
 
+    @Override
     public synchronized void addDropTarget(DropTarget dt) {
         if (nDropTargets == 0) {
             nativeDropTargetContext = addNativeDropTarget();
@@ -902,6 +936,7 @@
      * unregister a DropTarget with this native peer
      */
 
+    @Override
     public synchronized void removeDropTarget(DropTarget dt) {
         nDropTargets--;
         if (nDropTargets == 0) {
@@ -924,6 +959,7 @@
     native void removeNativeDropTarget();
     native boolean nativeHandlesWheelScrolling();
 
+    @Override
     public boolean handlesWheelScrolling() {
         // should this be cached?
         return nativeHandlesWheelScrolling();
@@ -1001,6 +1037,7 @@
     /**
      * @see java.awt.peer.ComponentPeer#reparent
      */
+    @Override
     public void reparent(ContainerPeer newNativeParent) {
         pSetParent(newNativeParent);
     }
@@ -1008,6 +1045,7 @@
     /**
      * @see java.awt.peer.ComponentPeer#isReparentSupported
      */
+    @Override
     public boolean isReparentSupported() {
         return true;
     }
@@ -1081,6 +1119,7 @@
      * Applies the shape to the native component window.
      * @since 1.7
      */
+    @Override
     @SuppressWarnings("deprecation")
     public void applyShape(Region shape) {
         if (shapeLog.isLoggable(PlatformLogger.Level.FINER)) {
@@ -1101,6 +1140,7 @@
      * Lowers this component at the bottom of the above component. If the above parameter
      * is null then the method places this component at the top of the Z-order.
      */
+    @Override
     public void setZOrder(ComponentPeer above) {
         long aboveHWND = (above != null) ? ((WComponentPeer)above).getHWnd() : 0;
 
--- a/src/windows/classes/sun/awt/windows/WCustomCursor.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WCustomCursor.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2003, 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
@@ -38,13 +38,14 @@
  * @see Component#setCursor
  * @author      ThomasBall
  */
-public class WCustomCursor extends CustomCursor {
+final class WCustomCursor extends CustomCursor {
 
-    public WCustomCursor(Image cursor, Point hotSpot, String name)
+    WCustomCursor(Image cursor, Point hotSpot, String name)
             throws IndexOutOfBoundsException {
         super(cursor, hotSpot, name);
     }
 
+    @Override
     protected void createNativeCursor(Image im, int[] pixels, int w, int h,
                                       int xHotSpot, int yHotSpot) {
         BufferedImage bimage = new BufferedImage(w, h,
--- a/src/windows/classes/sun/awt/windows/WDataTransferer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WDataTransferer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -51,7 +51,6 @@
 
 import java.io.BufferedInputStream;
 import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.IOException;
@@ -85,7 +84,7 @@
  *
  * @since 1.3.1
  */
-public class WDataTransferer extends DataTransferer {
+final class WDataTransferer extends DataTransferer {
     private static final String[] predefinedClipboardNames = {
             "",
             "TEXT",
@@ -166,6 +165,7 @@
         return transferer;
     }
 
+    @Override
     public SortedMap <Long, DataFlavor> getFormatsForFlavors(
             DataFlavor[] flavors, FlavorTable map)
     {
@@ -179,10 +179,12 @@
         return retval;
     }
 
+    @Override
     public String getDefaultUnicodeEncoding() {
         return "utf-16le";
     }
 
+    @Override
     public byte[] translateTransferable(Transferable contents,
                                         DataFlavor flavor,
                                         long format) throws IOException
@@ -220,6 +222,7 @@
     }
 
     // The stream is closed as a closable object
+    @Override
     public Object translateStream(InputStream str,
                                  DataFlavor flavor, long format,
                                  Transferable localeTransferable)
@@ -235,6 +238,7 @@
 
     }
 
+    @Override
     public Object translateBytes(byte[] bytes, DataFlavor flavor, long format,
         Transferable localeTransferable) throws IOException
     {
@@ -282,14 +286,17 @@
 
     }
 
+    @Override
     public boolean isLocaleDependentTextFormat(long format) {
         return format == CF_TEXT || format == CFSTR_INETURL;
     }
 
+    @Override
     public boolean isFileFormat(long format) {
         return format == CF_HDROP || format == CF_FILEGROUPDESCRIPTORA || format == CF_FILEGROUPDESCRIPTORW;
     }
 
+    @Override
     protected Long getFormatForNativeAsLong(String str) {
         Long format = predefinedClipboardNameMap.get(str);
         if (format == null) {
@@ -298,6 +305,7 @@
         return format;
     }
 
+    @Override
     protected String getNativeForFormat(long format) {
         return (format < predefinedClipboardNames.length)
                 ? predefinedClipboardNames[(int)format]
@@ -307,6 +315,7 @@
     private final ToolkitThreadBlockedHandler handler =
             new WToolkitThreadBlockedHandler();
 
+    @Override
     public ToolkitThreadBlockedHandler getToolkitThreadBlockedHandler() {
         return handler;
     }
@@ -323,12 +332,14 @@
      */
     private static native String getClipboardFormatName(long format);
 
+    @Override
     public boolean isImageFormat(long format) {
         return format == CF_DIB || format == CF_ENHMETAFILE ||
                 format == CF_METAFILEPICT || format == CF_PNG ||
                 format == CF_JFIF;
     }
 
+    @Override
     protected byte[] imageToPlatformBytes(Image image, long format)
             throws IOException {
         String mimeType = null;
@@ -402,6 +413,7 @@
 
     private static final byte [] UNICODE_NULL_TERMINATOR =  new byte [] {0,0};
 
+    @Override
     protected ByteArrayOutputStream convertFileListToBytes(ArrayList<String> fileList)
             throws IOException
     {
@@ -439,6 +451,7 @@
      * Translates either a byte array or an input stream which contain
      * platform-specific image data in the given format into an Image.
      */
+    @Override
     protected Image platformImageBytesToImage(byte[] bytes, long format)
             throws IOException {
         String mimeType = null;
@@ -478,12 +491,14 @@
                                                        long format)
             throws IOException;
 
+    @Override
     protected native String[] dragQueryFile(byte[] bytes);
 }
 
 final class WToolkitThreadBlockedHandler extends Mutex
         implements ToolkitThreadBlockedHandler {
 
+    @Override
     public void enter() {
         if (!isOwned()) {
             throw new IllegalMonitorStateException();
@@ -493,6 +508,7 @@
         lock();
     }
 
+    @Override
     public void exit() {
         if (!isOwned()) {
             throw new IllegalMonitorStateException();
@@ -876,6 +892,7 @@
         descriptionParsed = true;
     }
 
+    @Override
     public synchronized int read() throws IOException {
         if( closed ){
             throw new IOException("Stream closed");
@@ -896,6 +913,7 @@
         return retval;
     }
 
+    @Override
     public synchronized void close() throws IOException {
         if( !closed ){
             closed = true;
--- a/src/windows/classes/sun/awt/windows/WDefaultFontCharset.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WDefaultFontCharset.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
 import java.nio.charset.*;
 import sun.awt.AWTCharset;
 
-public class WDefaultFontCharset extends AWTCharset
+final class WDefaultFontCharset extends AWTCharset
 {
     static {
        initIDs();
@@ -36,22 +36,24 @@
     // Name for Windows FontSet.
     private String fontName;
 
-    public WDefaultFontCharset(String name){
+    WDefaultFontCharset(String name){
         super("WDefaultFontCharset", Charset.forName("windows-1252"));
         fontName = name;
     }
 
+    @Override
     public CharsetEncoder newEncoder() {
         return new Encoder();
     }
 
     private class Encoder extends AWTCharset.Encoder {
+        @Override
         public boolean canEncode(char c){
             return canConvert(c);
         }
     }
 
-    public synchronized native boolean canConvert(char ch);
+    private synchronized native boolean canConvert(char ch);
 
     /**
      * Initialize JNI field and method IDs
--- a/src/windows/classes/sun/awt/windows/WDesktopPeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WDesktopPeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,33 +39,39 @@
  *
  * @see DesktopPeer
  */
-public class WDesktopPeer implements DesktopPeer {
+final class WDesktopPeer implements DesktopPeer {
     /* Contants for the operation verbs */
     private static String ACTION_OPEN_VERB = "open";
     private static String ACTION_EDIT_VERB = "edit";
     private static String ACTION_PRINT_VERB = "print";
 
+    @Override
     public boolean isSupported(Action action) {
         // OPEN, EDIT, PRINT, MAIL, BROWSE all supported on windows.
         return true;
     }
 
+    @Override
     public void open(File file) throws IOException {
         this.ShellExecute(file, ACTION_OPEN_VERB);
     }
 
+    @Override
     public void edit(File file) throws IOException {
         this.ShellExecute(file, ACTION_EDIT_VERB);
     }
 
+    @Override
     public void print(File file) throws IOException {
         this.ShellExecute(file, ACTION_PRINT_VERB);
     }
 
+    @Override
     public void mail(URI uri) throws IOException {
         this.ShellExecute(uri, ACTION_OPEN_VERB);
     }
 
+    @Override
     public void browse(URI uri) throws IOException {
         this.ShellExecute(uri, ACTION_OPEN_VERB);
     }
--- a/src/windows/classes/sun/awt/windows/WDesktopProperties.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WDesktopProperties.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@
  * like the Windows Pluggable Look-and-Feel can better adapt
  * itself when running on a Windows platform.
  */
-class WDesktopProperties {
+final class WDesktopProperties {
     private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.windows.WDesktopProperties");
     private static final String PREFIX = "win.";
     private static final String FILE_PREFIX = "awt.file.";
@@ -210,6 +210,7 @@
             this.winEventName = winEventName;
         }
 
+        @Override
         public void run() {
             WDesktopProperties.this.playWindowsSound(winEventName);
         }
--- a/src/windows/classes/sun/awt/windows/WDialogPeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WDialogPeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,13 @@
  */
 package sun.awt.windows;
 
-import java.util.*;
 import java.awt.*;
 import java.awt.peer.*;
 
 import sun.awt.*;
 import sun.awt.im.*;
 
-class WDialogPeer extends WWindowPeer implements DialogPeer {
+final class WDialogPeer extends WWindowPeer implements DialogPeer {
     // Toolkit & peer internals
 
     // Platform default background for dialogs.  Gets set on target if
@@ -54,6 +53,7 @@
     }
 
     native void createAwtDialog(WComponentPeer parent);
+    @Override
     void create(WComponentPeer parent) {
         preCreate(parent);
         createAwtDialog(parent);
@@ -62,6 +62,7 @@
     native void showModal();
     native void endModal();
 
+    @Override
     void initialize() {
         Dialog target = (Dialog)this.target;
         // Need to set target's background to default _before_ a call
@@ -78,6 +79,7 @@
         setResizable(target.isResizable());
     }
 
+    @Override
     protected void realShow() {
         Dialog dlg = (Dialog)target;
         if (dlg.getModalityType() != Dialog.ModalityType.MODELESS) {
@@ -87,8 +89,9 @@
         }
     }
 
+    @Override
     @SuppressWarnings("deprecation")
-    public void hide() {
+    void hide() {
         Dialog dlg = (Dialog)target;
         if (dlg.getModalityType() != Dialog.ModalityType.MODELESS) {
             endModal();
@@ -97,6 +100,7 @@
         }
     }
 
+    @Override
     public void blockWindows(java.util.List<Window> toBlock) {
         for (Window w : toBlock) {
             WWindowPeer wp = (WWindowPeer)AWTAccessor.getComponentAccessor().getPeer(w);
@@ -106,6 +110,7 @@
         }
     }
 
+    @Override
     public Dimension getMinimumSize() {
         if (((Dialog)target).isUndecorated()) {
             return super.getMinimumSize();
@@ -119,6 +124,7 @@
         return ((Dialog)target).isUndecorated();
     }
 
+    @Override
     public void reshape(int x, int y, int width, int height) {
         if (((Dialog)target).isUndecorated()) {
             super.reshape(x, y, width, height);
--- a/src/windows/classes/sun/awt/windows/WDropTargetContextPeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WDropTargetContextPeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2007, 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
@@ -79,6 +79,7 @@
         return new WDropTargetContextPeerIStream(istream);
     }
 
+    @Override
     protected Object getNativeData(long format) {
         return getData(getNativeDragContext(), format);
     }
@@ -87,14 +88,17 @@
      * signal drop complete
      */
 
+    @Override
     protected void doDropDone(boolean success, int dropAction,
                               boolean isLocal) {
         dropDone(getNativeDragContext(), success, dropAction);
     }
 
+    @Override
     protected void eventPosted(final SunDropTargetEvent e) {
         if (e.getID() != SunDropTargetEvent.MOUSE_DROPPED) {
             Runnable runnable = new Runnable() {
+                    @Override
                     public void run() {
                         e.getDispatcher().unregisterAllEvents();
                     }
@@ -124,7 +128,7 @@
  * package private class to handle file transfers
  */
 
-class WDropTargetContextPeerFileStream extends FileInputStream {
+final class WDropTargetContextPeerFileStream extends FileInputStream {
 
     /**
      * construct file input stream
@@ -142,6 +146,7 @@
      * close
      */
 
+    @Override
     public void close() throws IOException {
         if (stgmedium != 0) {
             super.close();
@@ -167,7 +172,7 @@
  * Package private class to access IStream objects
  */
 
-class WDropTargetContextPeerIStream extends InputStream {
+final class WDropTargetContextPeerIStream extends InputStream {
 
     /**
      * construct a WDropTargetContextPeerIStream wrapper
@@ -185,6 +190,7 @@
      * @return bytes available
      */
 
+    @Override
     public int available() throws IOException {
         if (istream == 0) throw new IOException("No IStream");
         return Available(istream);
@@ -196,6 +202,7 @@
      * read
      */
 
+    @Override
     public int read() throws IOException {
         if (istream == 0) throw new IOException("No IStream");
         return Read(istream);
@@ -207,6 +214,7 @@
      * read into buffer
      */
 
+    @Override
     public int read(byte[] b, int off, int len) throws IOException {
         if (istream == 0) throw new IOException("No IStream");
         return ReadBytes(istream, b, off, len);
@@ -218,6 +226,7 @@
      * close
      */
 
+    @Override
     public void close() throws IOException {
         if (istream != 0) {
             super.close();
--- a/src/windows/classes/sun/awt/windows/WEmbeddedFrame.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WEmbeddedFrame.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -203,11 +203,11 @@
     }
 
 
-    protected native boolean isPrinterDC(long hdc);
+    private native boolean isPrinterDC(long hdc);
 
-    protected native void printBand(long hdc, byte[] data, int offset,
-                                    int sx, int sy, int swidth, int sheight,
-                                    int dx, int dy, int dwidth, int dheight);
+    private native void printBand(long hdc, byte[] data, int offset, int sx,
+                                  int sy, int swidth, int sheight, int dx,
+                                  int dy, int dwidth, int dheight);
 
     /**
      * Initialize JNI field IDs
--- a/src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,12 +38,15 @@
         super(target);
     }
 
+    @Override
     native void create(WComponentPeer parent);
 
     // suppress printing of an embedded frame.
+    @Override
     public void print(Graphics g) {}
 
     // supress calling native setMinSize()
+    @Override
     public void updateMinimumSize() {}
 
     @Override
@@ -59,10 +62,12 @@
         ((EmbeddedFrame)target).notifyModalBlocked(blocker, false);
     }
 
+    @Override
     public void setBoundsPrivate(int x, int y, int width, int height) {
         setBounds(x, y, width, height, SET_BOUNDS | NO_EMBEDDED_CHECK);
     }
 
+    @Override
     public native Rectangle getBoundsPrivate();
 
     @Override
--- a/src/windows/classes/sun/awt/windows/WFileDialogPeer.java	Wed Apr 16 12:32:36 2014 -0700
+++ b/src/windows/classes/sun/awt/windows/WFileDialogPeer.java	Wed Apr 16 15:03:29 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,11 +34,10 @@
 import java.util.ResourceBundle;
 import java.util.MissingResourceException;
 import java.util.Vector;
-import sun.awt.AppContext;
 import sun.awt.CausedFocusEvent;
 import sun.awt.AWTAccessor;
 
-public class WFileDialogPeer extends WWindowPeer implements FileDialogPeer {
+final class WFileDialogPeer extends WWindowPeer implements FileDialogPeer {
 
     static {
         initIDs();
@@ -47,11 +46,12 @@
     private WComponentPeer parent;
     private FilenameFilter fileFilter;
 
-    private Vector<WWindowPeer> blockedWindows = new Vector<WWindowPeer>();
+    private Vector<WWindowPeer> blockedWindows = new Vector<>();
 
     //Needed to fix 4152317
     private static native void setFilterString(String allFilter);
 
+    @Override
     public void setFilenameFilter(FilenameFilter filter) {
         t