Merge
diff --git a/.hgtags b/.hgtags
index 7c1c378..d941bf4 100644
--- a/.hgtags
+++ b/.hgtags
@@ -189,3 +189,4 @@
 130d3a54d28becaac0846137256c2684adb34c33 jdk8-b65
 4d337fae2250135729ee9ed2bf8baf3c60da5d6d jdk8-b66
 ce9b02a3a17edd1983201002cfa0f364e4ab7524 jdk8-b67
+53fb43e4d614c92310e1fb00ec41d1960fd9facf jdk8-b68
diff --git a/make/com/sun/security/Makefile b/make/com/sun/security/Makefile
index 3a6ae43..85a919b 100644
--- a/make/com/sun/security/Makefile
+++ b/make/com/sun/security/Makefile
@@ -35,7 +35,7 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 SUBDIRS = auth
-SUBDIRS_misc = jgss sasl auth/module
+SUBDIRS_misc = jgss sasl auth/module ntlm
 include $(BUILDDIR)/common/Subdirs.gmk
 
 all build clean clobber::
diff --git a/make/com/sun/security/ntlm/Makefile b/make/com/sun/security/ntlm/Makefile
new file mode 100644
index 0000000..547092b
--- /dev/null
+++ b/make/com/sun/security/ntlm/Makefile
@@ -0,0 +1,39 @@
+#
+# Copyright (c) 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.
+#
+
+BUILDDIR = ../../../..
+PACKAGE = com.sun.security.ntlm
+PRODUCT = sun
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+# Files
+#
+AUTO_FILES_JAVA_DIRS = com/sun/security/ntlm
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Classes.gmk
diff --git a/make/java/security/Makefile b/make/java/security/Makefile
index d68d0a0..bbb0ca4 100644
--- a/make/java/security/Makefile
+++ b/make/java/security/Makefile
@@ -40,7 +40,8 @@
 # Directories
 #
 
-PROPS_SRC   = $(TOPDIR)/src/share/lib/security/java.security
+# The default security properties file is for linux
+PROPS_SRC   = $(TOPDIR)/src/share/lib/security/java.security-linux
 
 ifeq ($(PLATFORM), solaris)
 PROPS_SRC   = $(TOPDIR)/src/share/lib/security/java.security-solaris
diff --git a/make/sun/security/Makefile b/make/sun/security/Makefile
index 5072032..9e9f8c5 100644
--- a/make/sun/security/Makefile
+++ b/make/sun/security/Makefile
@@ -38,10 +38,12 @@
 SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true
 include $(BUILDDIR)/common/Defs.gmk
 
-# build sun/security/jgss/wrapper on non-windows platform
+# build sun/security/jgss/wrapper on non-windows non-macosx platforms
 JGSS_WRAPPER =
 ifneq ($(PLATFORM), windows)
-    JGSS_WRAPPER = jgss/wrapper
+    ifneq ($(PLATFORM), macosx)
+    	JGSS_WRAPPER = jgss/wrapper
+    endif
 endif
 
 # Build PKCS#11 on all platforms
diff --git a/make/tools/src/build/tools/cldrconverter/Bundle.java b/make/tools/src/build/tools/cldrconverter/Bundle.java
index dc277ea..701ea4b 100644
--- a/make/tools/src/build/tools/cldrconverter/Bundle.java
+++ b/make/tools/src/build/tools/cldrconverter/Bundle.java
@@ -29,6 +29,7 @@
 import java.util.Arrays;
 import java.util.EnumSet;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -86,7 +87,23 @@
     private final static String[] ERA_KEYS = {
         "long.Eras",
         "Eras",
-        "short.Eras"
+        "narrow.Eras"
+    };
+
+    // Keys for individual time zone names
+    private final static String TZ_GEN_LONG_KEY = "timezone.displayname.generic.long";
+    private final static String TZ_GEN_SHORT_KEY = "timezone.displayname.generic.short";
+    private final static String TZ_STD_LONG_KEY = "timezone.displayname.standard.long";
+    private final static String TZ_STD_SHORT_KEY = "timezone.displayname.standard.short";
+    private final static String TZ_DST_LONG_KEY = "timezone.displayname.daylight.long";
+    private final static String TZ_DST_SHORT_KEY = "timezone.displayname.daylight.short";
+    private final static String[] ZONE_NAME_KEYS = {
+        TZ_STD_LONG_KEY,
+        TZ_STD_SHORT_KEY,
+        TZ_DST_LONG_KEY,
+        TZ_DST_SHORT_KEY,
+        TZ_GEN_LONG_KEY,
+        TZ_GEN_SHORT_KEY
     };
 
     private final String id;
@@ -98,6 +115,7 @@
         return bundles.get(id);
     }
 
+    @SuppressWarnings("ConvertToStringSwitch")
     Bundle(String id, String cldrPath, String bundles, String currencies) {
         this.id = id;
         this.cldrPath = cldrPath;
@@ -242,9 +260,12 @@
             // handle multiple inheritance for month and day names
             handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "MonthNames");
             handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "MonthAbbreviations");
+            handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "MonthNarrows");
             handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "DayNames");
             handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "DayAbbreviations");
+            handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "DayNarrows");
             handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "AmPmMarkers");
+            handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "narrow.AmPmMarkers");
 
             adjustEraNames(myMap, calendarType);
 
@@ -253,6 +274,99 @@
             handleDateTimeFormatPatterns(DATETIME_PATTERN_KEYS, myMap, parentsMap, calendarType, "DateTimePatterns");
         }
 
+        // if myMap has any empty timezone or metazone names, weed out them.
+        // Fill in any missing abbreviations if locale is "en".
+        for (Iterator<String> it = myMap.keySet().iterator(); it.hasNext();) {
+            String key = it.next();
+            if (key.startsWith(CLDRConverter.TIMEZONE_ID_PREFIX)
+                    || key.startsWith(CLDRConverter.METAZONE_ID_PREFIX)) {
+                @SuppressWarnings("unchecked")
+                Map<String, String> nameMap = (Map<String, String>) myMap.get(key);
+                if (nameMap.isEmpty()) {
+                    // Some zones have only exemplarCity, which become empty.
+                    // Remove those from the map.
+                    it.remove();
+                    continue;
+                }
+
+                if (id.startsWith("en")) {
+                    fillInAbbrs(key, nameMap);
+                }
+            }
+        }
+        for (Iterator<String> it = myMap.keySet().iterator(); it.hasNext();) {
+            String key = it.next();
+            if (key.startsWith(CLDRConverter.TIMEZONE_ID_PREFIX)
+                    || key.startsWith(CLDRConverter.METAZONE_ID_PREFIX)) {
+                @SuppressWarnings("unchecked")
+                Map<String, String> nameMap = (Map<String, String>) myMap.get(key);
+                // Convert key/value pairs to an array.
+                String[] names = new String[ZONE_NAME_KEYS.length];
+                int ix = 0;
+                for (String nameKey : ZONE_NAME_KEYS) {
+                    String name = nameMap.get(nameKey);
+                    if (name == null) {
+                        @SuppressWarnings("unchecked")
+                        Map<String, String> parentNames = (Map<String, String>) parentsMap.get(key);
+                        if (parentNames != null) {
+                            name = parentNames.get(nameKey);
+                        }
+                    }
+                    names[ix++] = name;
+                }
+                if (hasNulls(names)) {
+                    String metaKey = toMetaZoneKey(key);
+                    if (metaKey != null) {
+                        Object obj = myMap.get(metaKey);
+                        if (obj instanceof String[]) {
+                            String[] metaNames = (String[]) obj;
+                            for (int i = 0; i < names.length; i++) {
+                                if (names[i] == null) {
+                                    names[i] = metaNames[i];
+                                }
+                            }
+                        } else if (obj instanceof Map) {
+                            @SuppressWarnings("unchecked")
+                            Map<String, String> m = (Map<String, String>) obj;
+                            for (int i = 0; i < names.length; i++) {
+                                if (names[i] == null) {
+                                    names[i] = m.get(ZONE_NAME_KEYS[i]);
+                                }
+                            }
+                        }
+                    }
+                    // If there are still any nulls, try filling in them from en data.
+                    if (hasNulls(names) && !id.equals("en")) {
+                        @SuppressWarnings("unchecked")
+                        String[] enNames = (String[]) Bundle.getBundle("en").getTargetMap().get(key);
+                        if (enNames == null) {
+                            if (metaKey != null) {
+                                @SuppressWarnings("unchecked")
+                                String[] metaNames = (String[]) Bundle.getBundle("en").getTargetMap().get(metaKey);
+                                enNames = metaNames;
+                            }
+                        }
+                        if (enNames != null) {
+                            for (int i = 0; i < names.length; i++) {
+                                if (names[i] == null) {
+                                    names[i] = enNames[i];
+                                }
+                            }
+                        }
+                        // If there are still nulls, give up names.
+                        if (hasNulls(names)) {
+                            names = null;
+                        }
+                    }
+                }
+                // replace the Map with the array
+                if (names != null) {
+                    myMap.put(key, names);
+                } else {
+                    it.remove();
+                }
+            }
+        }
         return myMap;
     }
 
@@ -352,20 +466,10 @@
             realKeys[index] = realKey;
             eraNames[index++] = value;
         }
-        if (eraNames[0] != null) {
-            if (eraNames[1] != null) {
-                if (eraNames[2] == null) {
-                    // Eras -> short.Eras
-                    // long.Eras -> Eras
-                    map.put(realKeys[2], map.get(realKeys[1]));
-                    map.put(realKeys[1], map.get(realKeys[0]));
-                }
-            } else {
-                // long.Eras -> Eras
-                map.put(realKeys[1], map.get(realKeys[0]));
+        for (int i = 0; i < eraNames.length; i++) {
+            if (eraNames[i] == null) {
+                map.put(realKeys[i], null);
             }
-            // remove long.Eras
-            map.remove(realKeys[0]);
         }
     }
 
@@ -473,6 +577,86 @@
         return jrePattern.toString();
     }
 
+    private String toMetaZoneKey(String tzKey) {
+        if (tzKey.startsWith(CLDRConverter.TIMEZONE_ID_PREFIX)) {
+            String tz = tzKey.substring(CLDRConverter.TIMEZONE_ID_PREFIX.length());
+            String meta = CLDRConverter.handlerMetaZones.get(tz);
+            if (meta != null) {
+                return CLDRConverter.METAZONE_ID_PREFIX + meta;
+            }
+        }
+        return null;
+    }
+
+    private void fillInAbbrs(String key, Map<String, String> map) {
+        fillInAbbrs(TZ_STD_LONG_KEY, TZ_STD_SHORT_KEY, map);
+        fillInAbbrs(TZ_DST_LONG_KEY, TZ_DST_SHORT_KEY, map);
+        fillInAbbrs(TZ_GEN_LONG_KEY, TZ_GEN_SHORT_KEY, map);
+
+        // If the standard std is "Standard Time" and daylight std is "Summer Time",
+        // replace the standard std with the generic std to avoid using
+        // the same abbrivation except for Australia time zone names.
+        String std = map.get(TZ_STD_SHORT_KEY);
+        String dst = map.get(TZ_DST_SHORT_KEY);
+        String gen = map.get(TZ_GEN_SHORT_KEY);
+        if (std != null) {
+            if (dst == null) {
+                // if dst is null, create long and short names from the standard
+                // std. ("Something Standard Time" to "Something Daylight Time",
+                // or "Something Time" to "Something Summer Time")
+                String name = map.get(TZ_STD_LONG_KEY);
+                if (name != null) {
+                    if (name.contains("Standard Time")) {
+                        name = name.replace("Standard Time", "Daylight Time");
+                    } else if (name.endsWith("Mean Time")) {
+                        name = name.replace("Mean Time", "Summer Time");
+                    } else if (name.endsWith(" Time")) {
+                        name = name.replace(" Time", " Summer Time");
+                    }
+                    map.put(TZ_DST_LONG_KEY, name);
+                    fillInAbbrs(TZ_DST_LONG_KEY, TZ_DST_SHORT_KEY, map);
+                }
+            }
+            if (gen  == null) {
+                String name = map.get(TZ_STD_LONG_KEY);
+                if (name != null) {
+                    if (name.endsWith("Standard Time")) {
+                        name = name.replace("Standard Time", "Time");
+                    } else if (name.endsWith("Mean Time")) {
+                        name = name.replace("Mean Time", "Time");
+                    }
+                    map.put(TZ_GEN_LONG_KEY, name);
+                    fillInAbbrs(TZ_GEN_LONG_KEY, TZ_GEN_SHORT_KEY, map);
+                }
+            }
+        }
+    }
+
+    private void fillInAbbrs(String longKey, String shortKey, Map<String, String> map) {
+        String abbr = map.get(shortKey);
+        if (abbr == null) {
+            String name = map.get(longKey);
+            if (name != null) {
+                abbr = toAbbr(name);
+                if (abbr != null) {
+                    map.put(shortKey, abbr);
+                }
+            }
+        }
+    }
+
+    private String toAbbr(String name) {
+        String[] substrs = name.split("\\s+");
+        StringBuilder sb = new StringBuilder();
+        for (String s : substrs) {
+            char c = s.charAt(0);
+            if (c >= 'A' && c <= 'Z') {
+                sb.append(c);
+            }
+        }
+        return sb.length() > 0 ? sb.toString() : null;
+    }
+
     private void convert(CalendarType calendarType, char cldrLetter, int count, StringBuilder sb) {
         switch (cldrLetter) {
         case 'G':
@@ -539,4 +723,13 @@
             sb.append(c);
         }
     }
+
+    private static boolean hasNulls(Object[] array) {
+        for (int i = 0; i < array.length; i++) {
+            if (array[i] == null) {
+                return true;
+            }
+        }
+        return false;
+    }
 }
diff --git a/make/tools/src/build/tools/cldrconverter/BundleGenerator.java b/make/tools/src/build/tools/cldrconverter/BundleGenerator.java
index f06a903..14760bc 100644
--- a/make/tools/src/build/tools/cldrconverter/BundleGenerator.java
+++ b/make/tools/src/build/tools/cldrconverter/BundleGenerator.java
@@ -30,8 +30,27 @@
 import java.util.SortedSet;
 
 public interface BundleGenerator {
+    static enum BundleType {
+        PLAIN("java.util.ListResourceBundle"),
+        OPEN("sun.util.resources.OpenListResourceBundle"),
+        TIMEZONE("sun.util.resources.TimeZoneNamesBundle");
+
+        private final String pathName, className;
+        private BundleType(String name) {
+            pathName = name;
+            int x = name.lastIndexOf('.');
+            className = name.substring(x + 1);
+        }
+        String getPathName() {
+            return pathName;
+        }
+        String getClassName() {
+            return className;
+        }
+    };
+
     public void generateBundle(String packageName, String baseName, String localeID,
-            boolean useJava, Map<String, ?> map, boolean open) throws IOException;
+            boolean useJava, Map<String, ?> map, BundleType type) throws IOException;
 
     public void generateMetaInfo(Map<String, SortedSet<String>> metaInfo) throws IOException;
 }
diff --git a/make/tools/src/build/tools/cldrconverter/CLDRConverter.java b/make/tools/src/build/tools/cldrconverter/CLDRConverter.java
index 106e347..1d5cd5e 100644
--- a/make/tools/src/build/tools/cldrconverter/CLDRConverter.java
+++ b/make/tools/src/build/tools/cldrconverter/CLDRConverter.java
@@ -25,6 +25,7 @@
 
 package build.tools.cldrconverter;
 
+import build.tools.cldrconverter.BundleGenerator.BundleType;
 import java.io.File;
 import java.nio.file.DirectoryStream;
 import java.nio.file.FileSystems;
@@ -58,9 +59,8 @@
     static final String CURRENCY_SYMBOL_PREFIX = "currency.symbol.";
     static final String CURRENCY_NAME_PREFIX = "currency.displayname.";
     static final String TIMEZONE_ID_PREFIX = "timezone.id.";
-    static final String TIMEZONE_NAME_PREFIX = "timezone.displayname.";
+    static final String ZONE_NAME_PREFIX = "timezone.displayname.";
     static final String METAZONE_ID_PREFIX = "metazone.id.";
-    static final String METAZONE_NAME_PREFIX = "metazone.displayname.";
 
     private static SupplementDataParseHandler handlerSuppl;
     static NumberingSystemsParseHandler handlerNumbering;
@@ -236,7 +236,14 @@
                     if (sb.indexOf("root") == -1) {
                         sb.append("root");
                     }
-                    retList.add(new Bundle(id, sb.toString(), null, null));
+                    Bundle b = new Bundle(id, sb.toString(), null, null);
+                    // Insert the bundle for en at the top so that it will get
+                    // processed first.
+                    if ("en".equals(id)) {
+                        retList.add(0, b);
+                    } else {
+                        retList.add(b);
+                    }
                 }
             }
         }
@@ -312,6 +319,7 @@
         Map<String, SortedSet<String>> metaInfo = new HashMap<>();
         metaInfo.put("LocaleNames", new TreeSet<String>());
         metaInfo.put("CurrencyNames", new TreeSet<String>());
+        metaInfo.put("TimeZoneNames", new TreeSet<String>());
         metaInfo.put("CalendarData", new TreeSet<String>());
         metaInfo.put("FormatData", new TreeSet<String>());
 
@@ -348,24 +356,28 @@
                 Map<String, Object> localeNamesMap = extractLocaleNames(targetMap, bundle.getID());
                 if (!localeNamesMap.isEmpty() || bundle.isRoot()) {
                     metaInfo.get("LocaleNames").add(toLanguageTag(bundle.getID()));
-                    bundleGenerator.generateBundle("util", "LocaleNames", bundle.getID(), true, localeNamesMap, true);
+                    bundleGenerator.generateBundle("util", "LocaleNames", bundle.getID(), true, localeNamesMap, BundleType.OPEN);
                 }
             }
             if (bundleTypes.contains(Bundle.Type.CURRENCYNAMES)) {
                 Map<String, Object> currencyNamesMap = extractCurrencyNames(targetMap, bundle.getID(), bundle.getCurrencies());
                 if (!currencyNamesMap.isEmpty() || bundle.isRoot()) {
                     metaInfo.get("CurrencyNames").add(toLanguageTag(bundle.getID()));
-                    bundleGenerator.generateBundle("util", "CurrencyNames", bundle.getID(), true, currencyNamesMap, true);
+                    bundleGenerator.generateBundle("util", "CurrencyNames", bundle.getID(), true, currencyNamesMap, BundleType.OPEN);
                 }
             }
             if (bundleTypes.contains(Bundle.Type.TIMEZONENAMES)) {
                 Map<String, Object> zoneNamesMap = extractZoneNames(targetMap, bundle.getID());
+                if (!zoneNamesMap.isEmpty() || bundle.isRoot()) {
+                    metaInfo.get("TimeZoneNames").add(toLanguageTag(bundle.getID()));
+                    bundleGenerator.generateBundle("util", "TimeZoneNames", bundle.getID(), true, zoneNamesMap, BundleType.TIMEZONE);
+                }
             }
             if (bundleTypes.contains(Bundle.Type.CALENDARDATA)) {
                 Map<String, Object> calendarDataMap = extractCalendarData(targetMap, bundle.getID());
                 if (!calendarDataMap.isEmpty() || bundle.isRoot()) {
                     metaInfo.get("CalendarData").add(toLanguageTag(bundle.getID()));
-                    bundleGenerator.generateBundle("util", "CalendarData", bundle.getID(), true, calendarDataMap, false);
+                    bundleGenerator.generateBundle("util", "CalendarData", bundle.getID(), true, calendarDataMap, BundleType.PLAIN);
                 }
             }
             if (bundleTypes.contains(Bundle.Type.FORMATDATA)) {
@@ -373,9 +385,10 @@
                 // LocaleData.getAvailableLocales depends on having FormatData bundles around
                 if (!formatDataMap.isEmpty() || bundle.isRoot()) {
                     metaInfo.get("FormatData").add(toLanguageTag(bundle.getID()));
-                    bundleGenerator.generateBundle("text", "FormatData", bundle.getID(), true, formatDataMap, false);
+                    bundleGenerator.generateBundle("text", "FormatData", bundle.getID(), true, formatDataMap, BundleType.PLAIN);
                 }
             }
+
             // For testing
             SortedSet<String> allLocales = new TreeSet<>();
             allLocales.addAll(metaInfo.get("CurrencyNames"));
@@ -431,6 +444,7 @@
         private KeyComparator() {
         }
 
+        @Override
         public int compare(String o1, String o2) {
             int len1 = o1.length();
             int len2 = o2.length();
@@ -476,7 +490,26 @@
     }
 
     private static Map<String, Object> extractZoneNames(Map<String, Object> map, String id) {
-        return null;
+        Map<String, Object> names = new HashMap<>();
+        for (String tzid : handlerMetaZones.keySet()) {
+            String tzKey = TIMEZONE_ID_PREFIX + tzid;
+            Object data = map.get(tzKey);
+            if (data instanceof String[]) {
+                names.put(tzid, data);
+            } else {
+                String meta = handlerMetaZones.get(tzid);
+                if (meta != null) {
+                    String metaKey = METAZONE_ID_PREFIX + meta;
+                    data = map.get(metaKey);
+                    if (data instanceof String[]) {
+                        // Keep the metazone prefix here.
+                        names.put(metaKey, data);
+                        names.put(tzid, meta);
+                    }
+                }
+            }
+        }
+        return names;
     }
 
     private static Map<String, Object> extractCalendarData(Map<String, Object> map, String id) {
@@ -494,11 +527,19 @@
             copyIfPresent(map, prefix + "standalone.MonthNames", formatData);
             copyIfPresent(map, prefix + "MonthAbbreviations", formatData);
             copyIfPresent(map, prefix + "standalone.MonthAbbreviations", formatData);
+            copyIfPresent(map, prefix + "MonthNarrow", formatData);
+            copyIfPresent(map, prefix + "standalone.MonthNarrows", formatData);
             copyIfPresent(map, prefix + "DayNames", formatData);
+            copyIfPresent(map, prefix + "standalone.DayNames", formatData);
             copyIfPresent(map, prefix + "DayAbbreviations", formatData);
+            copyIfPresent(map, prefix + "standalone.DayAbbreviations", formatData);
+            copyIfPresent(map, prefix + "DayNarrows", formatData);
+            copyIfPresent(map, prefix + "standalone.DayNarrows", formatData);
             copyIfPresent(map, prefix + "AmPmMarkers", formatData);
+            copyIfPresent(map, prefix + "narrow.AmPmMarkers", formatData);
+            copyIfPresent(map, prefix + "long.Eras", formatData);
             copyIfPresent(map, prefix + "Eras", formatData);
-            copyIfPresent(map, prefix + "short.Eras", formatData);
+            copyIfPresent(map, prefix + "narrow.Eras", formatData);
             copyIfPresent(map, prefix + "TimePatterns", formatData);
             copyIfPresent(map, prefix + "DatePatterns", formatData);
             copyIfPresent(map, prefix + "DateTimePatterns", formatData);
@@ -560,7 +601,6 @@
                 if (x == 0 || escapeSpace) {
                     outBuffer.append('\\');
                 }
-
                 outBuffer.append(' ');
                 break;
             case '\\':
@@ -584,7 +624,7 @@
                 outBuffer.append('f');
                 break;
             default:
-                if (!USE_UTF8 && ((aChar < 0x0020) || (aChar > 0x007e))) {
+                if (aChar < 0x0020 || (!USE_UTF8 && aChar > 0x007e)) {
                     formatter.format("\\u%04x", (int)aChar);
                 } else {
                     if (specialSaveChars.indexOf(aChar) != -1) {
diff --git a/make/tools/src/build/tools/cldrconverter/LDMLParseHandler.java b/make/tools/src/build/tools/cldrconverter/LDMLParseHandler.java
index 128eaf6..812aab2 100644
--- a/make/tools/src/build/tools/cldrconverter/LDMLParseHandler.java
+++ b/make/tools/src/build/tools/cldrconverter/LDMLParseHandler.java
@@ -155,6 +155,9 @@
                 case "abbreviated":
                     pushStringArrayEntry(qName, attributes, prefix + "MonthAbbreviations/" + getContainerKey(), 13);
                     break;
+                case "narrow":
+                    pushStringArrayEntry(qName, attributes, prefix + "MonthNarrows/" + getContainerKey(), 13);
+                    break;
                 default:
                     pushIgnoredContainer(qName);
                     break;
@@ -191,6 +194,9 @@
                 case "abbreviated":
                     pushStringArrayEntry(qName, attributes, prefix + "DayAbbreviations/" + getContainerKey(), 7);
                     break;
+                case "narrow":
+                    pushStringArrayEntry(qName, attributes, prefix + "DayNarrows/" + getContainerKey(), 7);
+                    break;
                 default:
                     pushIgnoredContainer(qName);
                     break;
@@ -219,25 +225,36 @@
         case "dayPeriodWidth":
             // for FormatData
             // create string array entry for am/pm. only keeping wide
-            if ("wide".equals(attributes.getValue("type"))) {
+            switch (attributes.getValue("type")) {
+            case "wide":
                 pushStringArrayEntry(qName, attributes, "AmPmMarkers/" + getContainerKey(), 2);
-            } else {
+                break;
+            case "narrow":
+                pushStringArrayEntry(qName, attributes, "narrow.AmPmMarkers/" + getContainerKey(), 2);
+                break;
+            default:
                 pushIgnoredContainer(qName);
+                break;
             }
             break;
         case "dayPeriod":
             // for FormatData
             // add to string array entry of AmPmMarkers element
-            switch (attributes.getValue("type")) {
-            case "am":
-                pushStringArrayElement(qName, attributes, 0);
-                break;
-            case "pm":
-                pushStringArrayElement(qName, attributes, 1);
-                break;
-            default:
+            if (attributes.getValue("alt") == null) {
+                switch (attributes.getValue("type")) {
+                case "am":
+                    pushStringArrayElement(qName, attributes, 0);
+                    break;
+                case "pm":
+                    pushStringArrayElement(qName, attributes, 1);
+                    break;
+                default:
+                    pushIgnoredContainer(qName);
+                    break;
+                }
+            } else {
+                // discard alt values
                 pushIgnoredContainer(qName);
-                break;
             }
             break;
         case "eraNames":
@@ -269,7 +286,7 @@
                 assert currentContainer instanceof IgnoredContainer;
                 pushIgnoredContainer(qName);
             } else {
-                String key = currentCalendarType.keyElementName() + "short.Eras";
+                String key = currentCalendarType.keyElementName() + "narrow.Eras";
                 pushStringArrayEntry(qName, attributes, key, currentCalendarType.getEraLength(qName));
             }
             break;
@@ -301,15 +318,15 @@
             break;
         case "zone":
             {
-                String zone = attributes.getValue("type");
+                String tzid = attributes.getValue("type"); // Olson tz id
                 zonePrefix = CLDRConverter.TIMEZONE_ID_PREFIX;
-                put(zonePrefix + zone, new HashMap<String, String>());
-                pushKeyContainer(qName, attributes, zone);
+                put(zonePrefix + tzid, new HashMap<String, String>());
+                pushKeyContainer(qName, attributes, tzid);
             }
             break;
         case "metazone":
             {
-                String zone = attributes.getValue("type");
+                String zone = attributes.getValue("type"); // LDML meta zone id
                 zonePrefix = CLDRConverter.METAZONE_ID_PREFIX;
                 put(zonePrefix + zone, new HashMap<String, String>());
                 pushKeyContainer(qName, attributes, zone);
@@ -323,16 +340,12 @@
             zoneNameStyle = "short";
             pushContainer(qName, attributes);
             break;
-        case "generic": // not used in JDK
-            pushIgnoredContainer(qName);
+        case "generic":  // generic name
+        case "standard": // standard time name
+        case "daylight": // daylight saving (summer) time name
+            pushStringEntry(qName, attributes, CLDRConverter.ZONE_NAME_PREFIX + qName + "." + zoneNameStyle);
             break;
-        case "standard": // standard time
-            pushStringEntry(qName, attributes, CLDRConverter.TIMEZONE_NAME_PREFIX + "standard." + zoneNameStyle);
-            break;
-        case "daylight":
-            pushStringEntry(qName, attributes, CLDRConverter.TIMEZONE_NAME_PREFIX + "daylight." + zoneNameStyle);
-            break;
-        case "exemplarCity":
+        case "exemplarCity":  // not used in JDK
             pushIgnoredContainer(qName);
             break;
 
@@ -530,6 +543,7 @@
         case "timeZoneNames":
             zonePrefix = null;
             break;
+        case "generic":
         case "standard":
         case "daylight":
             if (zonePrefix != null && (currentContainer instanceof Entry)) {
diff --git a/make/tools/src/build/tools/cldrconverter/MetaZonesParseHandler.java b/make/tools/src/build/tools/cldrconverter/MetaZonesParseHandler.java
index 5c6f50b..99be8cf 100644
--- a/make/tools/src/build/tools/cldrconverter/MetaZonesParseHandler.java
+++ b/make/tools/src/build/tools/cldrconverter/MetaZonesParseHandler.java
@@ -46,8 +46,9 @@
         return null;
     }
 
+    // metaZone: ID -> metazone
+    // per locale: ID -> names, metazone -> names
     @Override
-    @SuppressWarnings("fallthrough")
     public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
         switch (qName) {
         case "timezone":
diff --git a/make/tools/src/build/tools/cldrconverter/ResourceBundleGenerator.java b/make/tools/src/build/tools/cldrconverter/ResourceBundleGenerator.java
index 2d031fa..c7826a2 100644
--- a/make/tools/src/build/tools/cldrconverter/ResourceBundleGenerator.java
+++ b/make/tools/src/build/tools/cldrconverter/ResourceBundleGenerator.java
@@ -28,14 +28,16 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.util.Formatter;
+import java.util.HashSet;
 import java.util.Map;
+import java.util.Set;
 import java.util.SortedSet;
 
 class ResourceBundleGenerator implements BundleGenerator {
-
     @Override
     public void generateBundle(String packageName, String baseName, String localeID, boolean useJava,
-                               Map<String, ?> map, boolean open) throws IOException {
+                               Map<String, ?> map, BundleType type) throws IOException {
         String suffix = useJava ? ".java" : ".properties";
         String lang = CLDRConverter.getLanguageCode(localeID);
         String dirName = CLDRConverter.DESTINATION_DIR + File.separator + "sun" + File.separator
@@ -67,6 +69,28 @@
             encoding = "iso-8859-1";
         }
 
+        Formatter fmt = null;
+        if (type == BundleType.TIMEZONE) {
+            fmt = new Formatter();
+            Set<String> metaKeys = new HashSet<>();
+            for (String key : map.keySet()) {
+                if (key.startsWith(CLDRConverter.METAZONE_ID_PREFIX)) {
+                    String meta = key.substring(CLDRConverter.METAZONE_ID_PREFIX.length());
+                    String[] value;
+                    value = (String[]) map.get(key);
+                    fmt.format("        final String[] %s = new String[] {\n", meta);
+                    for (String s : value) {
+                        fmt.format("               \"%s\",\n", CLDRConverter.saveConvert(s, useJava));
+                    }
+                    fmt.format("            };\n");
+                    metaKeys.add(key);
+                }
+            }
+            for (String key : metaKeys) {
+                map.remove(key);
+            }
+        }
+
         try (PrintWriter out = new PrintWriter(file, encoding)) {
             // Output copyright headers
             out.println(CopyrightHeaders.getOpenJDKCopyright());
@@ -74,16 +98,15 @@
 
             if (useJava) {
                 out.println("package sun." + packageName + ";\n");
-                if (open) {
-                    out.println("import sun.util.resources.OpenListResourceBundle;\n");
-                    out.println("public class " + baseName + ("root".equals(localeID) ? "" : "_" + localeID) + " extends OpenListResourceBundle {");
-                } else {
-                    out.println("import java.util.ListResourceBundle;\n");
-                    out.println("public class " + baseName + ("root".equals(localeID) ? "" : "_" + localeID) + " extends ListResourceBundle {");
-                }
+                out.printf("import %s;\n\n", type.getPathName());
+                out.printf("public class %s%s extends %s {\n", baseName, "root".equals(localeID) ? "" : "_" + localeID, type.getClassName());
+
                 out.println("    @Override\n" +
-                            "    protected final Object[][] getContents() {\n" +
-                            "        final Object[][] data = new Object[][] {");
+                            "    protected final Object[][] getContents() {");
+                if (fmt != null) {
+                    out.print(fmt.toString());
+                }
+                out.println("        final Object[][] data = new Object[][] {");
             }
             for (String key : map.keySet()) {
                 if (useJava) {
@@ -91,7 +114,11 @@
                     if (value == null) {
                         CLDRConverter.warning("null value for " + key);
                     } else if (value instanceof String) {
-                        out.println("            { \"" + key + "\", \"" + CLDRConverter.saveConvert((String) value, useJava) + "\" },");
+                        if (type == BundleType.TIMEZONE) {
+                            out.printf("            { \"%s\", %s },\n", key, CLDRConverter.saveConvert((String) value, useJava));
+                        } else {
+                            out.printf("            { \"%s\", \"%s\" },\n", key, CLDRConverter.saveConvert((String) value, useJava));
+                        }
                     } else if (value instanceof String[]) {
                         String[] values = (String[]) value;
                         out.println("            { \"" + key + "\",\n                new String[] {");
diff --git a/makefiles/CompileNativeLibraries.gmk b/makefiles/CompileNativeLibraries.gmk
index 1dd28f6..cb2aae5 100644
--- a/makefiles/CompileNativeLibraries.gmk
+++ b/makefiles/CompileNativeLibraries.gmk
@@ -90,14 +90,11 @@
 		ARFLAGS:=$(ARFLAGS),\
 		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libfdlibm))
 
-BUILD_LIBRARIES += $(BUILD_LIBFDLIBM)
-
 else
-#
-# On macosx they do partial (incremental) linking of fdlibm
-#   code it here...rather than add support to NativeCompilation
-#   as this is firt time I see it
-$(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM,\
+
+# On macosx the old build does partial (incremental) linking of fdlibm instead of
+# a plain static library.
+$(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC,\
                 LIBRARY:=fdlibm,\
                 OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs/libfdlibm,\
                 SRC:=$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src,\
@@ -107,11 +104,12 @@
 		LDFLAGS:=-nostdlib -r -arch x86_64,\
 		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libfdlibm))
 
-$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) : $(BUILD_LIBFDLIBM)
+BUILD_LIBFDLIBM := $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
+$(BUILD_LIBFDLIBM) : $(BUILD_LIBFDLIBM_MAC)
 	$(CP) -a $< $@
 
-BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
 endif
+BUILD_LIBRARIES += $(BUILD_LIBFDLIBM)
 
 ##########################################################################################
 
@@ -2540,6 +2538,7 @@
 ##########################################################################################
 
 ifneq ($(OPENJDK_TARGET_OS), windows)
+ifneq ($(OPENJDK_TARGET_OS), macosx)
 $(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS,\
 		LIBRARY:=j2gss,\
                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
@@ -2559,6 +2558,7 @@
 
 BUILD_LIBRARIES += $(BUILD_LIBJ2GSS)
 endif
+endif
 
 ##########################################################################################
 
diff --git a/makefiles/CopyFiles.gmk b/makefiles/CopyFiles.gmk
index e0c8d62..be24ab2 100644
--- a/makefiles/CopyFiles.gmk
+++ b/makefiles/CopyFiles.gmk
@@ -356,21 +356,9 @@
 
 ##########################################################################################
 
-PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security
+PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-$(OPENJDK_TARGET_OS)
 PROPS_DST := $(JDK_OUTPUTDIR)/lib/security/java.security
 
-ifeq ($(OPENJDK_TARGET_OS), solaris)
-	PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-solaris
-endif
-
-ifeq ($(OPENJDK_TARGET_OS), windows)
-	PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-windows
-endif
-
-ifeq ($(OPENJDK_TARGET_OS), macosx)
-	PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-macosx
-endif
-
 $(PROPS_DST): $(PROPS_SRC)
 	$(MKDIR) -p $(@D)
 	$(RM) $@
diff --git a/makefiles/CreateJars.gmk b/makefiles/CreateJars.gmk
index cd5ec1f..2bfbd35 100644
--- a/makefiles/CreateJars.gmk
+++ b/makefiles/CreateJars.gmk
@@ -810,9 +810,8 @@
 $(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(IMAGES_OUTPUTDIR)/lib/rt.jar
 	$(RM) -r $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
 	$(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
-	$(JAVA) \
-		-Xbootclasspath/a:$(JDK_OUTPUTDIR)/classes \
-		$(JAVAC_JARS) \
+	$(JAVA) $(JAVAC_JARS) \
+	    -bootclasspath $(JDK_OUTPUTDIR)/classes \
 	    -XDprocess.packages -proc:only \
 	    -processor com.sun.tools.javac.sym.CreateSymbols \
 	    -Acom.sun.tools.javac.sym.Jar=$(IMAGES_OUTPUTDIR)/lib/rt.jar \
diff --git a/src/macosx/classes/sun/lwawt/LWToolkit.java b/src/macosx/classes/sun/lwawt/LWToolkit.java
index cba6cec..57a8642 100644
--- a/src/macosx/classes/sun/lwawt/LWToolkit.java
+++ b/src/macosx/classes/sun/lwawt/LWToolkit.java
@@ -210,9 +210,9 @@
      * and DialogPeer interfaces.
      */
     private LWWindowPeer createDelegatedPeer(Window target, PlatformComponent platformComponent,
-                                             PlatformWindow platformWindow)
+                                             PlatformWindow platformWindow, LWWindowPeer.PeerType peerType)
     {
-        LWWindowPeer peer = new LWWindowPeer(target, platformComponent, platformWindow);
+        LWWindowPeer peer = new LWWindowPeer(target, platformComponent, platformWindow, peerType);
         targetCreatedPeer(target, peer);
         peer.initialize();
         return peer;
@@ -222,22 +222,29 @@
     public WindowPeer createWindow(Window target) {
         PlatformComponent platformComponent = createPlatformComponent();
         PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.SIMPLEWINDOW);
-        return createDelegatedPeer(target, platformComponent, platformWindow);
+        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);
+        return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.FRAME);
     }
 
     public LWWindowPeer createEmbeddedFrame(CEmbeddedFrame target) {
         PlatformComponent platformComponent = createPlatformComponent();
-        PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.EMBEDDEDFRAME);
-        return createDelegatedPeer(target, platformComponent, platformWindow);
+        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);
@@ -254,7 +261,7 @@
 
         PlatformComponent platformComponent = createPlatformComponent();
         PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.DIALOG);
-        return createDelegatedPeer(target, platformComponent, platformWindow);
+        return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.DIALOG);
     }
 
     @Override
diff --git a/src/macosx/classes/sun/lwawt/LWWindowPeer.java b/src/macosx/classes/sun/lwawt/LWWindowPeer.java
index 02dcaaf..9d583e6 100644
--- a/src/macosx/classes/sun/lwawt/LWWindowPeer.java
+++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java
@@ -47,7 +47,8 @@
         SIMPLEWINDOW,
         FRAME,
         DIALOG,
-        EMBEDDEDFRAME
+        EMBEDDED_FRAME,
+        VIEW_EMBEDDED_FRAME
     }
 
     private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.lwawt.focus.LWWindowPeer");
@@ -108,6 +109,8 @@
 
     private volatile boolean textured;
 
+    private final PeerType peerType;
+
     /**
      * Current modal blocker or null.
      *
@@ -116,10 +119,11 @@
     private LWWindowPeer blocker;
 
     public LWWindowPeer(Window target, PlatformComponent platformComponent,
-                        PlatformWindow platformWindow)
+                        PlatformWindow platformWindow, PeerType peerType)
     {
         super(target, platformComponent);
         this.platformWindow = platformWindow;
+        this.peerType = peerType;
 
         Window owner = target.getOwner();
         LWWindowPeer ownerPeer = (owner != null) ? (LWWindowPeer)owner.getPeer() : null;
@@ -275,6 +279,11 @@
 
     @Override
     public void setBounds(int x, int y, int w, int h, int op) {
+
+        if((op & NO_EMBEDDED_CHECK) == 0 && getPeerType() == PeerType.VIEW_EMBEDDED_FRAME) {
+            return;
+        }
+
         if ((op & SET_CLIENT_SIZE) != 0) {
             // SET_CLIENT_SIZE is only applicable to window peers, so handle it here
             // instead of pulling 'insets' field up to LWComponentPeer
@@ -1210,6 +1219,10 @@
         return this == grabbingWindow;
     }
 
+    public PeerType getPeerType() {
+        return peerType;
+    }
+
     @Override
     public String toString() {
         return super.toString() + " [target is " + getTarget() + "]";
diff --git a/src/macosx/classes/sun/lwawt/PlatformWindow.java b/src/macosx/classes/sun/lwawt/PlatformWindow.java
index 8b8e54d..0527281 100644
--- a/src/macosx/classes/sun/lwawt/PlatformWindow.java
+++ b/src/macosx/classes/sun/lwawt/PlatformWindow.java
@@ -151,4 +151,6 @@
     public long getLayerPtr();
 
     public LWWindowPeer getPeer();
+
+    public boolean isUnderMouse();
 }
diff --git a/src/macosx/classes/sun/lwawt/macosx/CMouseInfoPeer.java b/src/macosx/classes/sun/lwawt/macosx/CMouseInfoPeer.java
index 8651aa3..8ee5801 100644
--- a/src/macosx/classes/sun/lwawt/macosx/CMouseInfoPeer.java
+++ b/src/macosx/classes/sun/lwawt/macosx/CMouseInfoPeer.java
@@ -26,7 +26,6 @@
 package sun.lwawt.macosx;
 
 import java.awt.Window;
-
 import sun.lwawt.LWMouseInfoPeer;
 import sun.lwawt.LWWindowPeer;
 
@@ -41,10 +40,6 @@
             return false;
         }
 
-        LWWindowPeer peer = (LWWindowPeer)w.getPeer();
-        CPlatformWindow platformWindow = (CPlatformWindow)peer.getPlatformWindow();
-        return nativeIsWindowUnderMouse(platformWindow.getNSWindowPtr());
+        return ((LWWindowPeer)w.getPeer()).getPlatformWindow().isUnderMouse();
     }
-
-    private static native boolean nativeIsWindowUnderMouse(long ptr);
 }
diff --git a/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java b/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java
index 6a26b50..e06cc6f 100644
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java
@@ -25,16 +25,13 @@
 
 package sun.lwawt.macosx;
 
-import sun.lwawt.PlatformWindow;
-import sun.lwawt.LWWindowPeer;
-
-import sun.java2d.opengl.CGLLayer;
-import sun.java2d.SurfaceData;
-
-import sun.awt.CausedFocusEvent;
-
 import java.awt.*;
-
+import sun.awt.CausedFocusEvent;
+import sun.java2d.SurfaceData;
+import sun.java2d.opengl.CGLLayer;
+import sun.lwawt.LWWindowPeer;
+import sun.lwawt.LWWindowPeer.PeerType;
+import sun.lwawt.PlatformWindow;
 import sun.util.logging.PlatformLogger;
 
 /*
@@ -134,6 +131,7 @@
 
     // This method should be properly implemented for applets.
     // It returns null just as a stub.
+    @Override
     public PlatformWindow getTopmostPlatformWindowUnderMouse() { return null; }
 
     @Override
@@ -192,4 +190,13 @@
 
     @Override
     public void setModalBlocked(boolean blocked) {}
+
+    /*
+     * The method could not be implemented due to CALayer restrictions.
+     * The exeption enforce clients not to use it.
+     */
+    @Override
+    public boolean isUnderMouse() {
+        throw new RuntimeException("Not implemented");
+    }
 }
diff --git a/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java b/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java
index a7cdfd3..4972301 100644
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java
@@ -26,8 +26,11 @@
 package sun.lwawt.macosx;
 
 import java.awt.*;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.VolatileImage;
 
 import sun.awt.CGraphicsConfig;
+import sun.awt.CGraphicsEnvironment;
 import sun.lwawt.LWWindowPeer;
 import sun.lwawt.macosx.event.NSEvent;
 
@@ -37,6 +40,10 @@
 
 public class CPlatformView extends CFRetainedResource {
     private native long nativeCreateView(int x, int y, int width, int height, long windowLayerPtr);
+    private static native void nativeSetAutoResizable(long awtView, boolean toResize);
+    private static native int nativeGetNSViewDisplayID(long awtView);
+    private static native Rectangle2D nativeGetLocationOnScreen(long awtView);
+    private static native boolean nativeIsViewUnderMouse(long ptr);
 
     private LWWindowPeer peer;
     private SurfaceData surfaceData;
@@ -59,7 +66,7 @@
 
     public long getAWTView() {
         return ptr;
-    }
+        }
 
     public boolean isOpaque() {
         return !peer.isTranslucent();
@@ -158,10 +165,46 @@
         }
     }
 
+    public void setAutoResizable(boolean toResize) {
+        nativeSetAutoResizable(this.getAWTView(), toResize);
+    }
+
+    public boolean isUnderMouse() {
+        return nativeIsViewUnderMouse(getAWTView());
+    }
+
+    public GraphicsDevice getGraphicsDevice() {
+        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        CGraphicsEnvironment cge = (CGraphicsEnvironment)ge;
+        int displayID = nativeGetNSViewDisplayID(getAWTView());
+        GraphicsDevice gd = cge.getScreenDevice(displayID);
+        if (gd == null) {
+            // this could possibly happen during device removal
+            // use the default screen device in this case
+            gd = ge.getDefaultScreenDevice();
+        }
+        return gd;
+    }
+
+    public Point getLocationOnScreen() {
+        Rectangle r = nativeGetLocationOnScreen(this.getAWTView()).getBounds();
+        return new Point(r.x, r.y);
+    }
+
     // ----------------------------------------------------------------------
     // NATIVE CALLBACKS
     // ----------------------------------------------------------------------
 
+    /*
+     * The callback is called only in the embedded case when the view is
+     * automatically resized by the superview.
+     * In normal mode this method is never called.
+     */
+    private void deliverResize(int x, int y, int w, int h) {
+        peer.notifyReshape(x, y, w, h);
+    }
+
+
     private void deliverMouseEvent(NSEvent event) {
         int x = event.getX();
         int y = getBounds().height - event.getY();
diff --git a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
index e6ab696..b489eae 100644
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
@@ -64,8 +64,6 @@
     private static native void nativeDispose(long nsWindowPtr);
     private static native CPlatformWindow nativeGetTopmostPlatformWindowUnderMouse();
 
-    private static native int nativeGetNSWindowDisplayID(long nsWindowPtr);
-
     // Loger to report issues happened during execution but that do not affect functionality
     private static final PlatformLogger logger = PlatformLogger.getLogger("sun.lwawt.macosx.CPlatformWindow");
     private static final PlatformLogger focusLogger = PlatformLogger.getLogger("sun.lwawt.macosx.focus.CPlatformWindow");
@@ -211,9 +209,8 @@
     private CPlatformResponder responder;
     private volatile boolean zoomed = false; // from native perspective
 
-    public CPlatformWindow(final PeerType peerType) {
+    public CPlatformWindow() {
         super(0, true);
-        assert (peerType == PeerType.SIMPLEWINDOW || peerType == PeerType.DIALOG || peerType == PeerType.FRAME);
     }
 
     /*
@@ -429,16 +426,7 @@
 
     @Override
     public GraphicsDevice getGraphicsDevice() {
-        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
-        CGraphicsEnvironment cge = (CGraphicsEnvironment)ge;
-        int displayID = nativeGetNSWindowDisplayID(getNSWindowPtr());
-        GraphicsDevice gd = cge.getScreenDevice(displayID);
-        if (gd == null) {
-            // this could possibly happen during device removal
-            // use the default screen device in this case
-            gd = ge.getDefaultScreenDevice();
-        }
-        return gd;
+        return contentView.getGraphicsDevice();
     }
 
     @Override // PlatformWindow
@@ -833,6 +821,11 @@
         return peer;
     }
 
+    @Override
+    public boolean isUnderMouse() {
+        return contentView.isUnderMouse();
+    }
+
     public CPlatformView getContentView() {
         return contentView;
     }
diff --git a/src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java b/src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java
index f50f286..1ca65e7 100644
--- a/src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java
+++ b/src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java
@@ -41,7 +41,7 @@
     public CPrinterDialogPeer(CPrinterDialog target, PlatformComponent platformComponent,
                               PlatformWindow platformWindow)
     {
-        super(target, platformComponent, platformWindow);
+        super(target, platformComponent, platformWindow, LWWindowPeer.PeerType.DIALOG);
         //super(target);
         fTarget = target;
         super.initialize();
diff --git a/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java b/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java
new file mode 100644
index 0000000..306cfb1
--- /dev/null
+++ b/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 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.
+ */
+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
+ */
+public class CViewEmbeddedFrame extends EmbeddedFrame {
+
+    private final long nsViewPtr;
+
+    private boolean isActive = false;
+
+    public CViewEmbeddedFrame(long nsViewPtr) {
+        this.nsViewPtr = nsViewPtr;
+    }
+
+    @SuppressWarnings("deprecation")
+    @Override
+    public void addNotify() {
+        if (getPeer() == null) {
+            LWToolkit toolkit = (LWToolkit) Toolkit.getDefaultToolkit();
+            setPeer(toolkit.createEmbeddedFrame(this));
+        }
+        super.addNotify();
+    }
+
+    public long getEmbedderHandle() {
+        return nsViewPtr;
+    }
+
+    @Override
+    public void registerAccelerator(AWTKeyStroke awtks) {
+    }
+
+    @Override
+    public void unregisterAccelerator(AWTKeyStroke awtks) {
+    }
+
+    public boolean isParentWindowActive() {
+        return isActive;
+    }
+
+    /*
+     * Synthetic event delivery for focus management
+     */
+    @Override
+    public void synthesizeWindowActivation(boolean activated) {
+        if (isActive != activated) {
+            isActive = activated;
+            ((LWWindowPeer)getPeer()).notifyActivation(activated, null);
+        }
+    }
+
+    /*
+     * Initializes the embedded frame bounds and validates a component.
+     * Designed to be called from the main thread
+     * This method should be called once from the initialization of the SWT_AWT Bridge
+     */
+    @SuppressWarnings("deprecation")
+    public void validateWithBounds(final int x, final int y, final int width, final int height) {
+        try {
+            LWCToolkit.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    ((LWWindowPeer) getPeer()).setBoundsPrivate(0, 0, width, height);
+                    validate();
+                    setVisible(true);
+                }
+            }, null);
+        } catch (InterruptedException | InvocationTargetException ex) {}
+    }
+}
diff --git a/src/macosx/classes/sun/lwawt/macosx/CViewPlatformEmbeddedFrame.java b/src/macosx/classes/sun/lwawt/macosx/CViewPlatformEmbeddedFrame.java
new file mode 100644
index 0000000..adc3c03
--- /dev/null
+++ b/src/macosx/classes/sun/lwawt/macosx/CViewPlatformEmbeddedFrame.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 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.
+ */
+
+package sun.lwawt.macosx;
+
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.GraphicsDevice;
+import java.awt.Insets;
+import java.awt.MenuBar;
+import java.awt.Point;
+import java.awt.Window;
+import sun.awt.CausedFocusEvent.Cause;
+import sun.java2d.SurfaceData;
+import sun.lwawt.LWWindowPeer;
+import sun.lwawt.PlatformWindow;
+
+public class CViewPlatformEmbeddedFrame implements PlatformWindow {
+
+    private CPlatformView view;
+    private LWWindowPeer peer;
+    private CViewEmbeddedFrame target;
+    private CPlatformResponder responder;
+
+    @Override // PlatformWindow
+    public void initialize(Window target, final LWWindowPeer peer, PlatformWindow owner) {
+        this.peer = peer;
+        this.target = (CViewEmbeddedFrame) target;
+        responder = new CPlatformResponder(peer, false);
+
+        view = new CPlatformView();
+        view.initialize(peer, responder);
+
+        CWrapper.NSView.addSubview(this.target.getEmbedderHandle(), view.getAWTView());
+        view.setAutoResizable(true);
+    }
+
+    public long getNSViewPtr() {
+        return view.getAWTView();
+    }
+
+    @Override
+    public long getLayerPtr() {
+        return view.getWindowLayerPtr();
+    }
+
+    @Override
+    public LWWindowPeer getPeer() {
+        return peer;
+    }
+
+    @Override
+    public void dispose() {
+        CWrapper.NSView.removeFromSuperview(view.getAWTView());
+        view.dispose();
+    }
+
+    @Override
+    public void setVisible(boolean visible) {
+        CWrapper.NSView.setHidden(view.getAWTView(), !visible);
+    }
+
+    @Override
+    public void setTitle(String title) {
+    }
+
+    @Override
+    public void setBounds(int x, int y, int w, int h) {
+        view.setBounds(x, y, w, h);
+        peer.notifyReshape(x, y, w, h);
+    }
+
+    @Override
+    public GraphicsDevice getGraphicsDevice() {
+        return view.getGraphicsDevice();
+    }
+
+    @Override
+    public Point getLocationOnScreen() {
+        return view.getLocationOnScreen();
+    }
+
+    @Override
+    public Insets getInsets() {
+        return new Insets(0, 0, 0, 0);
+    }
+
+    @Override
+    public FontMetrics getFontMetrics(Font f) {
+        throw new RuntimeException("Not implemented");
+    }
+
+    @Override
+    public SurfaceData getScreenSurface() {
+        return view.getSurfaceData();
+    }
+
+    @Override
+    public SurfaceData replaceSurfaceData() {
+        return view.replaceSurfaceData();
+    }
+
+    @Override
+    public void setModalBlocked(boolean blocked) {
+    }
+
+    @Override
+    public void toFront() {
+    }
+
+    @Override
+    public void toBack() {
+    }
+
+    @Override
+    public void setMenuBar(MenuBar mb) {
+    }
+
+    @Override
+    public void setAlwaysOnTop(boolean value) {
+    }
+
+    @Override
+    public PlatformWindow getTopmostPlatformWindowUnderMouse() {
+        return null;
+    }
+
+    @Override
+    public void updateFocusableWindowState() {
+    }
+
+    @Override
+    public boolean rejectFocusRequest(Cause cause) {
+        return false;
+    }
+
+    @Override
+    public boolean requestWindowFocus() {
+        return true;
+    }
+
+    @Override
+    public boolean isActive() {
+        return target.isParentWindowActive();
+    }
+
+    @Override
+    public void setResizable(boolean resizable) {
+    }
+
+    @Override
+    public void setSizeConstraints(int minW, int minH, int maxW, int maxH) {
+    }
+
+    @Override
+    public Graphics transformGraphics(Graphics g) {
+        return g;
+    }
+
+    @Override
+    public void updateIconImages() {
+    }
+
+    @Override
+    public void setOpacity(float opacity) {
+    }
+
+    @Override
+    public void setOpaque(boolean isOpaque) {
+    }
+
+    @Override
+    public void enterFullScreenMode() {
+    }
+
+    @Override
+    public void exitFullScreenMode() {
+    }
+
+    @Override
+    public void setWindowState(int windowState) {
+    }
+
+    @Override
+    public boolean isUnderMouse() {
+        return view.isUnderMouse();
+    }
+}
diff --git a/src/macosx/classes/sun/lwawt/macosx/CWrapper.java b/src/macosx/classes/sun/lwawt/macosx/CWrapper.java
index 385259e..52aa16c 100644
--- a/src/macosx/classes/sun/lwawt/macosx/CWrapper.java
+++ b/src/macosx/classes/sun/lwawt/macosx/CWrapper.java
@@ -85,6 +85,8 @@
 
         public static native void enterFullScreenMode(long view);
         public static native void exitFullScreenMode(long view);
+
+        public static native void setHidden(long view, boolean hidden);
     }
 
     public static final class NSObject {
diff --git a/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
index 29e4f7b..ae6a4f7 100644
--- a/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
+++ b/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
@@ -156,10 +156,13 @@
 
     @Override
     protected PlatformWindow createPlatformWindow(PeerType peerType) {
-        if (peerType == PeerType.EMBEDDEDFRAME) {
+        if (peerType == PeerType.EMBEDDED_FRAME) {
             return new CPlatformEmbeddedFrame();
+        } else if (peerType == PeerType.VIEW_EMBEDDED_FRAME) {
+            return new CViewPlatformEmbeddedFrame();
         } else {
-            return new CPlatformWindow(peerType);
+            assert (peerType == PeerType.SIMPLEWINDOW || peerType == PeerType.DIALOG || peerType == PeerType.FRAME);
+            return new CPlatformWindow();
         }
     }
 
diff --git a/src/macosx/native/sun/awt/AWTSurfaceLayers.m b/src/macosx/native/sun/awt/AWTSurfaceLayers.m
index 74b0855..c6fec1f 100644
--- a/src/macosx/native/sun/awt/AWTSurfaceLayers.m
+++ b/src/macosx/native/sun/awt/AWTSurfaceLayers.m
@@ -99,17 +99,16 @@
   __block AWTSurfaceLayers *surfaceLayers = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
-  [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-      AWT_ASSERT_APPKIT_THREAD;
-
-      CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
-      surfaceLayers = [[AWTSurfaceLayers alloc] initWithWindowLayer: windowLayer];
-      CFRetain(surfaceLayers);
-      [surfaceLayers release];
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+        AWT_ASSERT_APPKIT_THREAD;
+        
+        CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
+        surfaceLayers = [[AWTSurfaceLayers alloc] initWithWindowLayer: windowLayer];
+        CFRetain(surfaceLayers);
+        [surfaceLayers release];
     }];
-
+    
 JNF_COCOA_EXIT(env);
 
   return ptr_to_jlong(surfaceLayers);
@@ -126,12 +125,13 @@
 JNF_COCOA_ENTER(env);
 
   AWTSurfaceLayers *surfaceLayers = OBJC(surfaceLayersPtr);
-  [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+    
+  [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
       AWT_ASSERT_APPKIT_THREAD;
 
       CGRect rect = CGRectMake(x, y, width, height);
       [surfaceLayers setBounds: rect];
-    }];
+  }];
 
 JNF_COCOA_EXIT(env);
 }
diff --git a/src/macosx/native/sun/awt/AWTView.m b/src/macosx/native/sun/awt/AWTView.m
index 0f896a4..3770287 100644
--- a/src/macosx/native/sun/awt/AWTView.m
+++ b/src/macosx/native/sun/awt/AWTView.m
@@ -83,6 +83,7 @@
 
     mouseIsOver = NO;
     [self resetTrackingArea];
+    [self setAutoresizesSubviews:NO];
 
     if (windowLayer != nil) {
         self.cglLayer = windowLayer;
@@ -174,6 +175,11 @@
  * Automatically triggered functions.
  */
 
+- (void)resizeWithOldSuperviewSize:(NSSize)oldBoundsSize {
+    [super resizeWithOldSuperviewSize: oldBoundsSize];
+    [self deliverResize: [self frame]];
+}
+
 /*
  * MouseEvents support
  */
@@ -437,6 +443,18 @@
     }
 }
 
+-(void) deliverResize: (NSRect) rect {
+    jint x = (jint) rect.origin.x;
+    jint y = (jint) rect.origin.y;
+    jint w = (jint) rect.size.width;
+    jint h = (jint) rect.size.height;
+    JNIEnv *env = [ThreadUtilities getJNIEnv];
+    static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView");
+    static JNF_MEMBER_CACHE(jm_deliverResize, jc_PlatformView, "deliverResize", "(IIII)V");
+    JNFCallVoidMethod(env, m_cPlatformView, jm_deliverResize, x,y,w,h);
+}
+
+
 - (void) drawRect:(NSRect)dirtyRect {
 AWT_ASSERT_APPKIT_THREAD;
 
@@ -1220,21 +1238,19 @@
     __block AWTView *newView = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     NSRect rect = NSMakeRect(originX, originY, width, height);
     jobject cPlatformView = (*env)->NewGlobalRef(env, obj);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         AWT_ASSERT_APPKIT_THREAD;
-
+                                           
         CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
         AWTView *view = [[AWTView alloc] initWithRect:rect
                                          platformView:cPlatformView
                                          windowLayer:windowLayer];
         CFRetain(view);
         [view release]; // GC
-
         newView = view;
     }];
 
@@ -1242,3 +1258,125 @@
 
     return ptr_to_jlong(newView);
 }
+
+/*
+ * Class:     sun_lwawt_macosx_CPlatformView
+ * Method:    nativeSetAutoResizable
+ * Signature: (JZ)V;
+ */
+
+JNIEXPORT void JNICALL
+Java_sun_lwawt_macosx_CPlatformView_nativeSetAutoResizable
+(JNIEnv *env, jclass cls, jlong viewPtr, jboolean toResize)
+{
+JNF_COCOA_ENTER(env);
+    
+    NSView *view = (NSView *)jlong_to_ptr(viewPtr);    
+
+   [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
+       AWT_ASSERT_APPKIT_THREAD;
+       
+       if (toResize) {
+           [view setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable];
+       } else {
+           [view setAutoresizingMask: NSViewMinYMargin | NSViewMaxXMargin];
+       }
+       
+       if ([view superview] != nil) {
+           [[view superview] setAutoresizesSubviews:(BOOL)toResize];
+       }
+       
+    }];
+JNF_COCOA_EXIT(env);
+}
+
+/*
+ * Class:     sun_lwawt_macosx_CPlatformView
+ * Method:    nativeGetNSViewDisplayID
+ * Signature: (J)I;
+ */
+
+JNIEXPORT jint JNICALL
+Java_sun_lwawt_macosx_CPlatformView_nativeGetNSViewDisplayID
+(JNIEnv *env, jclass cls, jlong viewPtr)
+{
+    __block jint ret; //CGDirectDisplayID
+    
+JNF_COCOA_ENTER(env);
+    
+    NSView *view = (NSView *)jlong_to_ptr(viewPtr);    
+    NSWindow *window = [view window];
+    
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+            AWT_ASSERT_APPKIT_THREAD;
+        
+            ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue];
+    }];
+    
+JNF_COCOA_EXIT(env);
+    
+    return ret;
+}
+
+/*
+ * Class:     sun_lwawt_macosx_CPlatformView
+ * Method:    nativeGetLocationOnScreen
+ * Signature: (J)Ljava/awt/Rectangle;
+ */
+
+JNIEXPORT jobject JNICALL
+Java_sun_lwawt_macosx_CPlatformView_nativeGetLocationOnScreen
+(JNIEnv *env, jclass cls, jlong viewPtr)
+{
+    jobject jRect = NULL;
+    
+JNF_COCOA_ENTER(env);
+    
+    __block NSRect rect = NSZeroRect;
+    
+    NSView *view = (NSView *)jlong_to_ptr(viewPtr);    
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+        AWT_ASSERT_APPKIT_THREAD;
+        
+        NSRect viewBounds = [view bounds];
+        NSRect frameInWindow = [view convertRect:viewBounds toView:nil];
+        rect = [[view window] convertRectToScreen:frameInWindow];
+        NSRect screenRect = [[NSScreen mainScreen] frame];
+        //Convert coordinates to top-left corner origin
+        rect.origin.y = screenRect.size.height - rect.origin.y - viewBounds.size.height;
+    }];
+    jRect = NSToJavaRect(env, rect);
+    
+JNF_COCOA_EXIT(env);
+    
+    return jRect;
+}
+
+/*
+ * Class:     sun_lwawt_macosx_CPlatformView
+ * Method:    nativeIsViewUnderMouse
+ * Signature: (J)Z;
+ */
+
+JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_CPlatformView_nativeIsViewUnderMouse
+(JNIEnv *env, jclass clazz, jlong viewPtr)
+{
+    __block jboolean underMouse = JNI_FALSE;
+    
+JNF_COCOA_ENTER(env);
+    
+    NSView *nsView = OBJC(viewPtr);
+   [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+       AWT_ASSERT_APPKIT_THREAD;
+       
+       NSPoint ptWindowCoords = [[nsView window] mouseLocationOutsideOfEventStream];
+       NSPoint ptViewCoords = [nsView convertPoint:ptWindowCoords fromView:nil];
+       underMouse = [nsView hitTest:ptViewCoords] != nil;
+    }];
+    
+JNF_COCOA_EXIT(env);
+    
+    return underMouse;
+}
+
+
diff --git a/src/macosx/native/sun/awt/AWTWindow.m b/src/macosx/native/sun/awt/AWTWindow.m
index 4b526ee..fa27a3b 100644
--- a/src/macosx/native/sun/awt/AWTWindow.m
+++ b/src/macosx/native/sun/awt/AWTWindow.m
@@ -1156,34 +1156,6 @@
 
 /*
  * Class:     sun_lwawt_macosx_CPlatformWindow
- * Method:    nativeGetDisplayID_AppKitThread
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL
-Java_sun_lwawt_macosx_CPlatformWindow_nativeGetNSWindowDisplayID
-(JNIEnv *env, jclass clazz, jlong windowPtr)
-{
-    __block jint ret; // CGDirectDisplayID
-
-JNF_COCOA_ENTER(env);
-
-    NSWindow *window = OBJC(windowPtr);
-
-    if ([NSThread isMainThread]) {
-        ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue];
-    } else {
-        [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-            ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue];
-        }];
-    }
-
-JNF_COCOA_EXIT(env);
-
-    return ret;
-}
-
-/*
- * Class:     sun_lwawt_macosx_CPlatformWindow
  * Method:    _toggleFullScreenMode
  * Signature: (J)V
  */
@@ -1203,27 +1175,6 @@
 JNF_COCOA_EXIT(env);
 }
 
-JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_CMouseInfoPeer_nativeIsWindowUnderMouse
-(JNIEnv *env, jclass clazz, jlong windowPtr)
-{
-    __block jboolean underMouse = JNI_FALSE;
-
-JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
-
-    NSWindow *nsWindow = OBJC(windowPtr);
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^() {
-        AWT_ASSERT_APPKIT_THREAD;
-
-        NSPoint pt = [nsWindow mouseLocationOutsideOfEventStream];
-        underMouse = [[nsWindow contentView] hitTest:pt] != nil;
-    }];
-
-JNF_COCOA_EXIT(env);
-
-    return underMouse;
-}
-
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetEnabled
 (JNIEnv *env, jclass clazz, jlong windowPtr, jboolean isEnabled)
 {
diff --git a/src/macosx/native/sun/awt/CCursorManager.m b/src/macosx/native/sun/awt/CCursorManager.m
index e7378d3..601ea91 100644
--- a/src/macosx/native/sun/awt/CCursorManager.m
+++ b/src/macosx/native/sun/awt/CCursorManager.m
@@ -123,14 +123,15 @@
     jobject jpt = NULL;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     __block NSPoint pt = NSZeroPoint;
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
-        pt = ConvertNSScreenPoint(env, [NSEvent mouseLocation]);
+    
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+            AWT_ASSERT_APPKIT_THREAD;
+        
+            pt = ConvertNSScreenPoint(env, [NSEvent mouseLocation]);
     }];
+    
     jpt = NSToJavaPoint(env, pt);
 
 JNF_COCOA_EXIT(env);
diff --git a/src/macosx/native/sun/awt/CWrapper.m b/src/macosx/native/sun/awt/CWrapper.m
index 139ea4b..eb047c5 100644
--- a/src/macosx/native/sun/awt/CWrapper.m
+++ b/src/macosx/native/sun/awt/CWrapper.m
@@ -651,6 +651,26 @@
 }
 
 /*
+ * Class:     sun_lwawt_macosx_CWrapper$NSView
+ * Method:    setHidden
+ * Signature: (JZ)V
+ */
+JNIEXPORT jlong JNICALL
+Java_sun_lwawt_macosx_CWrapper_00024NSView_setHidden
+(JNIEnv *env, jclass cls, jlong viewPtr, jboolean toHide)
+{    
+    JNF_COCOA_ENTER(env);
+    
+    NSView *view = (NSView *)jlong_to_ptr(viewPtr);
+    [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+        [view setHidden:(BOOL)toHide];
+    }];
+    
+    JNF_COCOA_EXIT(env);
+}
+
+
+/*
  * Class:     sun_lwawt_macosx_CWrapper$NSScreen
  * Method:    frame
  * Signature: (J)Ljava/awt/Rectangle;
diff --git a/src/macosx/native/sun/awt/awt.m b/src/macosx/native/sun/awt/awt.m
index d183d1b..8ca56bd 100644
--- a/src/macosx/native/sun/awt/awt.m
+++ b/src/macosx/native/sun/awt/awt.m
@@ -95,7 +95,7 @@
 
     CFRelease(busyObserver);
     CFRelease(notBusyObserver);
-
+    
     if (!headless) setBusy(YES);
 
     // Set the java name of the AppKit main thread appropriately.
@@ -367,7 +367,8 @@
             CFRunLoopRef runLoop = [[NSRunLoop currentRunLoop] getCFRunLoop];
             CFRunLoopRemoveObserver(runLoop, busyObserver, kCFRunLoopDefaultMode);
             CFRunLoopRemoveObserver(runLoop, notBusyObserver, kCFRunLoopDefaultMode);
-
+            // We don't track if the runloop is busy, so set it free to let AWT finish when it needs
+            setBusy(NO);
             busyObserver = NULL;
             notBusyObserver = NULL;
         } else {
diff --git a/src/macosx/native/sun/font/CCharToGlyphMapper.m b/src/macosx/native/sun/font/CCharToGlyphMapper.m
index e0ceb01..77eb3b8 100644
--- a/src/macosx/native/sun/font/CCharToGlyphMapper.m
+++ b/src/macosx/native/sun/font/CCharToGlyphMapper.m
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -16,9 +16,9 @@
  * 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
  */
 
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
diff --git a/src/macosx/native/sun/java2d/opengl/CGLLayer.m b/src/macosx/native/sun/java2d/opengl/CGLLayer.m
index 76d6820..6683898 100644
--- a/src/macosx/native/sun/java2d/opengl/CGLLayer.m
+++ b/src/macosx/native/sun/java2d/opengl/CGLLayer.m
@@ -151,16 +151,15 @@
     __block CGLLayer *layer = nil;
 
 JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
 
     JNFJObjectWrapper *javaLayer = [JNFJObjectWrapper wrapperWithJObject:obj withEnv:env];
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
-        AWT_ASSERT_APPKIT_THREAD;
-
-        layer = [[CGLLayer alloc] initWithJavaLayer: javaLayer];
+    [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+            AWT_ASSERT_APPKIT_THREAD;
+        
+            layer = [[CGLLayer alloc] initWithJavaLayer: javaLayer];
     }];
-
+    
 JNF_COCOA_EXIT(env);
 
     return ptr_to_jlong(layer);
diff --git a/src/macosx/native/sun/osxapp/ThreadUtilities.h b/src/macosx/native/sun/osxapp/ThreadUtilities.h
index f213a16..0acde2f 100644
--- a/src/macosx/native/sun/osxapp/ThreadUtilities.h
+++ b/src/macosx/native/sun/osxapp/ThreadUtilities.h
@@ -139,7 +139,7 @@
 + (JNIEnv*)getJNIEnvUncached;
 
 + (void)performOnMainThread:(SEL)aSelector onObject:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait awtMode:(BOOL)inAWT;
-
++ (void)performOnMainThreadWaiting:(BOOL)wait block:(void (^)())block;
 @end
 
 void OSXAPP_SetJavaVM(JavaVM *vm);
diff --git a/src/macosx/native/sun/osxapp/ThreadUtilities.m b/src/macosx/native/sun/osxapp/ThreadUtilities.m
index 788a06d..0e40fc1 100644
--- a/src/macosx/native/sun/osxapp/ThreadUtilities.m
+++ b/src/macosx/native/sun/osxapp/ThreadUtilities.m
@@ -245,6 +245,14 @@
     }
 }
 
++ (void)performOnMainThreadWaiting:(BOOL)wait block:(void (^)())block {
+    if ([NSThread isMainThread] && wait == YES) {
+        block(); 
+    } else { 
+        [JNFRunLoop performOnMainThreadWaiting:wait withBlock:block]; 
+    }
+}
+
 @end
 
 
diff --git a/src/share/classes/com/sun/java/util/jar/pack/PropMap.java b/src/share/classes/com/sun/java/util/jar/pack/PropMap.java
index e1a3855..6199c77 100644
--- a/src/share/classes/com/sun/java/util/jar/pack/PropMap.java
+++ b/src/share/classes/com/sun/java/util/jar/pack/PropMap.java
@@ -25,8 +25,6 @@
 
 package com.sun.java.util.jar.pack;
 
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeEvent;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintStream;
@@ -42,40 +40,39 @@
 import java.util.SortedMap;
 import java.util.TreeMap;
 import java.util.jar.Pack200;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
 /**
  * Control block for publishing Pack200 options to the other classes.
  */
 
 final class PropMap implements SortedMap<String, String>  {
     private final TreeMap<String, String> theMap = new TreeMap<>();;
-    private final List<PropertyChangeListener> listenerList = new ArrayList<>(1);
 
-    void addListener(PropertyChangeListener listener) {
+    // type is erased, elements are of type java.beans.PropertyChangeListener
+    private final List<Object> listenerList = new ArrayList<>(1);
+
+    void addListener(Object listener) {
+        assert Beans.isPropertyChangeListener(listener);
         listenerList.add(listener);
     }
 
-    void removeListener(PropertyChangeListener listener) {
+    void removeListener(Object listener) {
+        assert Beans.isPropertyChangeListener(listener);
         listenerList.remove(listener);
     }
 
-    void addListeners(ArrayList<PropertyChangeListener> listeners) {
-        listenerList.addAll(listeners);
-    }
-
-    void removeListeners(ArrayList<PropertyChangeListener> listeners) {
-        listenerList.removeAll(listeners);
-    }
-
     // Override:
     public String put(String key, String value) {
         String oldValue = theMap.put(key, value);
         if (value != oldValue && !listenerList.isEmpty()) {
+            assert Beans.isBeansPresent();
             // Post the property change event.
-            PropertyChangeEvent event =
-                new PropertyChangeEvent(this, key,
-                                        oldValue, value);
-            for (PropertyChangeListener listener : listenerList) {
-                listener.propertyChange(event);
+            Object event = Beans.newPropertyChangeEvent(this, key, oldValue, value);
+            for (Object listener : listenerList) {
+                Beans.invokePropertyChange(listener, event);
             }
         }
         return oldValue;
@@ -339,4 +336,113 @@
     public String lastKey() {
        return theMap.lastKey();
     }
+
+    /**
+     * A class that provides access to the java.beans.PropertyChangeListener
+     * and java.beans.PropertyChangeEvent without creating a static dependency
+     * on java.beans. This class can be removed once the addPropertyChangeListener
+     * and removePropertyChangeListener methods are removed from Packer and
+     * Unpacker.
+     */
+    private static class Beans {
+        private static final Class<?> propertyChangeListenerClass =
+            getClass("java.beans.PropertyChangeListener");
+
+        private static final Class<?> propertyChangeEventClass =
+            getClass("java.beans.PropertyChangeEvent");
+
+        private static final Method propertyChangeMethod =
+            getMethod(propertyChangeListenerClass,
+                      "propertyChange",
+                      propertyChangeEventClass);
+
+        private static final Constructor<?> propertyEventCtor =
+            getConstructor(propertyChangeEventClass,
+                           Object.class,
+                           String.class,
+                           Object.class,
+                           Object.class);
+
+        private static Class<?> getClass(String name) {
+            try {
+                return Class.forName(name, true, Beans.class.getClassLoader());
+            } catch (ClassNotFoundException e) {
+                return null;
+            }
+        }
+        private static Constructor<?> getConstructor(Class<?> c, Class<?>... types) {
+            try {
+                return (c == null) ? null : c.getDeclaredConstructor(types);
+            } catch (NoSuchMethodException x) {
+                throw new AssertionError(x);
+            }
+        }
+
+        private static Method getMethod(Class<?> c, String name, Class<?>... types) {
+            try {
+                return (c == null) ? null : c.getMethod(name, types);
+            } catch (NoSuchMethodException e) {
+                throw new AssertionError(e);
+            }
+        }
+
+        /**
+         * Returns {@code true} if java.beans is present.
+         */
+        static boolean isBeansPresent() {
+            return propertyChangeListenerClass != null &&
+                   propertyChangeEventClass != null;
+        }
+
+        /**
+         * Returns {@code true} if the given object is a PropertyChangeListener
+         */
+        static boolean isPropertyChangeListener(Object obj) {
+            if (propertyChangeListenerClass == null) {
+                return false;
+            } else {
+                return propertyChangeListenerClass.isInstance(obj);
+            }
+        }
+
+        /**
+         * Returns a new PropertyChangeEvent with the given source, property
+         * name, old and new values.
+         */
+        static Object newPropertyChangeEvent(Object source, String prop,
+                                             Object oldValue, Object newValue)
+        {
+            try {
+                return propertyEventCtor.newInstance(source, prop, oldValue, newValue);
+            } catch (InstantiationException | IllegalAccessException x) {
+                throw new AssertionError(x);
+            } catch (InvocationTargetException x) {
+                Throwable cause = x.getCause();
+                if (cause instanceof Error)
+                    throw (Error)cause;
+                if (cause instanceof RuntimeException)
+                    throw (RuntimeException)cause;
+                throw new AssertionError(x);
+            }
+        }
+
+        /**
+         * Invokes the given PropertyChangeListener's propertyChange method
+         * with the given event.
+         */
+        static void invokePropertyChange(Object listener, Object ev) {
+            try {
+                propertyChangeMethod.invoke(listener, ev);
+            } catch (IllegalAccessException x) {
+                throw new AssertionError(x);
+            } catch (InvocationTargetException x) {
+                Throwable cause = x.getCause();
+                if (cause instanceof Error)
+                    throw (Error)cause;
+                if (cause instanceof RuntimeException)
+                    throw (RuntimeException)cause;
+                throw new AssertionError(x);
+            }
+        }
+    }
 }
diff --git a/src/share/classes/com/sun/net/ssl/KeyManagerFactory.java b/src/share/classes/com/sun/net/ssl/KeyManagerFactory.java
index 36041d8..30e941a 100644
--- a/src/share/classes/com/sun/net/ssl/KeyManagerFactory.java
+++ b/src/share/classes/com/sun/net/ssl/KeyManagerFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -53,12 +53,13 @@
 
     /**
      * <p>The default KeyManager can be changed by setting the value of the
-     * "sun.ssl.keymanager.type" security property (in the Java security
-     * properties file) to the desired name.
+     * {@code sun.ssl.keymanager.type} security property to the desired name.
      *
-     * @return the default type as specified in the
-     * Java security properties file, or an implementation-specific default
-     * if no such property exists.
+     * @return the default type as specified by the
+     * {@code sun.ssl.keymanager.type} security property, or an
+     * implementation-specific default if no such property exists.
+     *
+     * @see java.security.Security security properties
      */
     public final static String getDefaultAlgorithm() {
         String type;
diff --git a/src/share/classes/com/sun/net/ssl/TrustManagerFactory.java b/src/share/classes/com/sun/net/ssl/TrustManagerFactory.java
index e3e9b64..b9ef566 100644
--- a/src/share/classes/com/sun/net/ssl/TrustManagerFactory.java
+++ b/src/share/classes/com/sun/net/ssl/TrustManagerFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -53,12 +53,13 @@
 
     /**
      * <p>The default TrustManager can be changed by setting the value of the
-     * "sun.ssl.trustmanager.type" security property
-     * (in the Java security properties file) to the desired name.
+     * {@code sun.ssl.trustmanager.type} security property to the desired name.
      *
-     * @return the default type as specified in the
-     * Java security properties file, or an implementation-specific default
-     * if no such property exists.
+     * @return the default type as specified by the
+     * {@code sun.ssl.trustmanager.type} security property, or an
+     * implementation-specific default if no such property exists.
+     *
+     * @see java.security.Security security properties
      */
     public final static String getDefaultAlgorithm() {
         String type;
diff --git a/src/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java b/src/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java
index 8824f8c..db14e42 100644
--- a/src/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java
+++ b/src/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java
@@ -264,7 +264,7 @@
  *         <code>false</code> otherwise
  */
     public boolean writeData(RowSetInternal caller) throws SQLException {
-        boolean conflict = false;
+        long conflicts = 0;
         boolean showDel = false;
         PreparedStatement pstmtIns = null;
         iChangedValsInDbAndCRS = 0;
@@ -337,8 +337,9 @@
         while (crs.next()) {
             if (crs.rowDeleted()) {
                 // The row has been deleted.
-                if (conflict = (deleteOriginalRow(crs, this.crsResolve)) == true) {
+                if (deleteOriginalRow(crs, this.crsResolve)) {
                        status.add(rows, SyncResolver.DELETE_ROW_CONFLICT);
+                       conflicts++;
                 } else {
                       // delete happened without any occurrence of conflicts
                       // so update status accordingly
@@ -349,8 +350,9 @@
                 // The row has been inserted.
 
                 pstmtIns = con.prepareStatement(insertCmd);
-                if ( (conflict = insertNewRow(crs, pstmtIns, this.crsResolve)) == true) {
+                if (insertNewRow(crs, pstmtIns, this.crsResolve)) {
                           status.add(rows, SyncResolver.INSERT_ROW_CONFLICT);
+                          conflicts++;
                 } else {
                       // insert happened without any occurrence of conflicts
                       // so update status accordingly
@@ -358,8 +360,9 @@
                 }
             } else  if (crs.rowUpdated()) {
                   // The row has been updated.
-                       if ( conflict = (updateOriginalRow(crs)) == true) {
+                       if (updateOriginalRow(crs)) {
                              status.add(rows, SyncResolver.UPDATE_ROW_CONFLICT);
+                             conflicts++;
                } else {
                       // update happened without any occurrence of conflicts
                       // so update status accordingly
@@ -395,21 +398,12 @@
         // reset
         crs.setShowDeleted(showDel);
 
-      boolean boolConf = false;
-      for (int j=1;j<status.size();j++){
-          // ignore status for index = 0 which is set to null
-          if(! ((status.get(j)).equals(SyncResolver.NO_ROW_CONFLICT))) {
-              // there is at least one conflict which needs to be resolved
-              boolConf = true;
-             break;
-          }
-      }
-
         crs.beforeFirst();
         this.crsResolve.beforeFirst();
 
-    if(boolConf) {
-        SyncProviderException spe = new SyncProviderException(status.size() - 1+resBundle.handleGetObject("crswriter.conflictsno").toString());
+    if(conflicts != 0) {
+        SyncProviderException spe = new SyncProviderException(conflicts + " " +
+                resBundle.handleGetObject("crswriter.conflictsno").toString());
         //SyncResolver syncRes = spe.getSyncResolver();
 
          SyncResolverImpl syncResImpl = (SyncResolverImpl) spe.getSyncResolver();
diff --git a/src/share/classes/com/sun/security/auth/PolicyFile.java b/src/share/classes/com/sun/security/auth/PolicyFile.java
index 43a0fc1..447eb39 100644
--- a/src/share/classes/com/sun/security/auth/PolicyFile.java
+++ b/src/share/classes/com/sun/security/auth/PolicyFile.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -59,13 +59,9 @@
  *
  * <ol>
  * <li>
- *   Loop through the <code>java.security.Security</code> properties,
+ *   Loop through the security properties,
  *   <i>auth.policy.url.1</i>, <i>auth.policy.url.2</i>, ...,
- *   <i>auth.policy.url.X</i>".  These properties are set
- *   in the Java security properties file, which is located in the file named
- *   &lt;JAVA_HOME&gt;/lib/security/java.security.
- *   &lt;JAVA_HOME&gt; refers to the value of the java.home system property,
- *   and specifies the directory where the JRE is installed.
+ *   <i>auth.policy.url.X</i>".
  *   Each property value specifies a <code>URL</code> pointing to a
  *   policy file to be loaded.  Read in and load each policy.
  *
@@ -235,6 +231,7 @@
  * @see java.security.CodeSource
  * @see java.security.Permissions
  * @see java.security.ProtectionDomain
+ * @see java.security.Security security properties
  */
 @Deprecated
 public class PolicyFile extends javax.security.auth.Policy {
diff --git a/src/share/classes/com/sun/security/auth/login/ConfigFile.java b/src/share/classes/com/sun/security/auth/login/ConfigFile.java
index c4b3acd..8299b13 100644
--- a/src/share/classes/com/sun/security/auth/login/ConfigFile.java
+++ b/src/share/classes/com/sun/security/auth/login/ConfigFile.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -49,13 +49,9 @@
  *
  * <ol>
  * <li>
- *   Loop through the <code>java.security.Security</code> properties,
+ *   Loop through the security properties,
  *   <i>login.config.url.1</i>, <i>login.config.url.2</i>, ...,
- *   <i>login.config.url.X</i>.  These properties are set
- *   in the Java security properties file, which is located in the file named
- *   &lt;JAVA_HOME&gt;/lib/security/java.security.
- *   &lt;JAVA_HOME&gt; refers to the value of the java.home system property,
- *   and specifies the directory where the JRE is installed.
+ *   <i>login.config.url.X</i>.
  *   Each property value specifies a <code>URL</code> pointing to a
  *   login configuration file to be loaded.  Read in and load
  *   each configuration.
@@ -87,6 +83,7 @@
  * <code>javax.security.auth.login.Configuration</code> class.
  *
  * @see javax.security.auth.login.LoginContext
+ * @see java.security.Security security properties
  */
 public class ConfigFile extends javax.security.auth.login.Configuration {
 
diff --git a/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java b/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java
index 5779da7..3d1744b 100644
--- a/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java
+++ b/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java
@@ -1067,10 +1067,6 @@
                     if (ktab != null) {
                         if (!privCredSet.contains(ktab)) {
                             privCredSet.add(ktab);
-                            // Compatibility; also add keys to privCredSet
-                            for (KerberosKey key: ktab.getKeys(kerbClientPrinc)) {
-                                privCredSet.add(new Krb5Util.KeysFromKeyTab(key));
-                            }
                         }
                     } else {
                         succeeded = false;
diff --git a/src/share/classes/java/lang/ThreadLocal.java b/src/share/classes/java/lang/ThreadLocal.java
index ac2254f..b337fc5 100644
--- a/src/share/classes/java/lang/ThreadLocal.java
+++ b/src/share/classes/java/lang/ThreadLocal.java
@@ -25,19 +25,21 @@
 
 package java.lang;
 import java.lang.ref.*;
+import java.util.Objects;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Supplier;
 
 /**
  * This class provides thread-local variables.  These variables differ from
  * their normal counterparts in that each thread that accesses one (via its
- * <tt>get</tt> or <tt>set</tt> method) has its own, independently initialized
- * copy of the variable.  <tt>ThreadLocal</tt> instances are typically private
+ * {@code get} or {@code set} method) has its own, independently initialized
+ * copy of the variable.  {@code ThreadLocal} instances are typically private
  * static fields in classes that wish to associate state with a thread (e.g.,
  * a user ID or Transaction ID).
  *
  * <p>For example, the class below generates unique identifiers local to each
  * thread.
- * A thread's id is assigned the first time it invokes <tt>ThreadId.get()</tt>
+ * A thread's id is assigned the first time it invokes {@code ThreadId.get()}
  * and remains unchanged on subsequent calls.
  * <pre>
  * import java.util.concurrent.atomic.AtomicInteger;
@@ -61,7 +63,7 @@
  * }
  * </pre>
  * <p>Each thread holds an implicit reference to its copy of a thread-local
- * variable as long as the thread is alive and the <tt>ThreadLocal</tt>
+ * variable as long as the thread is alive and the {@code ThreadLocal}
  * instance is accessible; after a thread goes away, all of its copies of
  * thread-local instances are subject to garbage collection (unless other
  * references to these copies exist).
@@ -108,14 +110,14 @@
      * thread-local variable.  This method will be invoked the first
      * time a thread accesses the variable with the {@link #get}
      * method, unless the thread previously invoked the {@link #set}
-     * method, in which case the <tt>initialValue</tt> method will not
+     * method, in which case the {@code initialValue} method will not
      * be invoked for the thread.  Normally, this method is invoked at
      * most once per thread, but it may be invoked again in case of
      * subsequent invocations of {@link #remove} followed by {@link #get}.
      *
-     * <p>This implementation simply returns <tt>null</tt>; if the
+     * <p>This implementation simply returns {@code null}; if the
      * programmer desires thread-local variables to have an initial
-     * value other than <tt>null</tt>, <tt>ThreadLocal</tt> must be
+     * value other than {@code null}, {@code ThreadLocal} must be
      * subclassed, and this method overridden.  Typically, an
      * anonymous inner class will be used.
      *
@@ -126,7 +128,21 @@
     }
 
     /**
+     * Creates a thread local variable. The initial value of the variable is
+     * determined by invoking the {@code get} method on the {@code Supplier}.
+     *
+     * @param supplier the supplier to be used to determine the initial value
+     * @return a new thread local variable
+     * @throws NullPointerException if the specified supplier is null
+     * @since 1.8
+     */
+    public static <T> ThreadLocal<T> withInitial(Supplier<? extends T> supplier) {
+        return new SuppliedThreadLocal<>(supplier);
+    }
+
+    /**
      * Creates a thread local variable.
+     * @see #withInitial(java.util.function.Supplier)
      */
     public ThreadLocal() {
     }
@@ -195,7 +211,7 @@
      * reinitialized by invoking its {@link #initialValue} method,
      * unless its value is {@linkplain #set set} by the current thread
      * in the interim.  This may result in multiple invocations of the
-     * <tt>initialValue</tt> method in the current thread.
+     * {@code initialValue} method in the current thread.
      *
      * @since 1.5
      */
@@ -251,6 +267,24 @@
     }
 
     /**
+     * An extension of ThreadLocal that obtains its initial value from
+     * the specified {@code Supplier}.
+     */
+    static final class SuppliedThreadLocal<T> extends ThreadLocal<T> {
+
+        private final Supplier<? extends T> supplier;
+
+        SuppliedThreadLocal(Supplier<? extends T> supplier) {
+            this.supplier = Objects.requireNonNull(supplier);
+        }
+
+        @Override
+        protected T initialValue() {
+            return supplier.get();
+        }
+    }
+
+    /**
      * ThreadLocalMap is a customized hash map suitable only for
      * maintaining thread local values. No operations are exported
      * outside of the ThreadLocal class. The class is package private to
@@ -599,9 +633,9 @@
          * @param i a position known NOT to hold a stale entry. The
          * scan starts at the element after i.
          *
-         * @param n scan control: <tt>log2(n)</tt> cells are scanned,
+         * @param n scan control: {@code log2(n)} cells are scanned,
          * unless a stale entry is found, in which case
-         * <tt>log2(table.length)-1</tt> additional cells are scanned.
+         * {@code log2(table.length)-1} additional cells are scanned.
          * When called from insertions, this parameter is the number
          * of elements, but when from replaceStaleEntry, it is the
          * table length. (Note: all this could be changed to be either
diff --git a/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java b/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
index 9e786e8..1399900 100644
--- a/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
+++ b/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
@@ -25,15 +25,15 @@
 
 package java.lang.invoke;
 
-import java.io.FileOutputStream;
-import java.io.IOException;
+import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.security.ProtectionDomain;
 import java.util.concurrent.atomic.AtomicInteger;
-import sun.util.logging.PlatformLogger;
 import jdk.internal.org.objectweb.asm.*;
 import static jdk.internal.org.objectweb.asm.Opcodes.*;
 import sun.misc.Unsafe;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 /**
  * InnerClassLambdaMetafactory
@@ -120,13 +120,34 @@
      *
      * @return a CallSite, which, when invoked, will return an instance of the
      * functional interface
-     * @throws ReflectiveOperationException
+     * @throws ReflectiveOperationException, LambdaConversionException
      */
     @Override
     CallSite buildCallSite() throws ReflectiveOperationException, LambdaConversionException {
         final Class<?> innerClass = spinInnerClass();
         if (invokedType.parameterCount() == 0) {
-            return new ConstantCallSite(MethodHandles.constant(samBase, innerClass.newInstance()));
+            final Constructor[] ctrs = AccessController.doPrivileged(
+                    new PrivilegedAction<Constructor[]>() {
+                @Override
+                public Constructor[] run() {
+                    return innerClass.getDeclaredConstructors();
+                }
+            });
+            if (ctrs.length != 1) {
+                throw new ReflectiveOperationException("Expected one lambda constructor for "
+                        + innerClass.getCanonicalName() + ", got " + ctrs.length);
+            }
+            // The lambda implementing inner class constructor is private, set
+            // it accessible (by us) before creating the constant sole instance
+            AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                @Override
+                public Void run() {
+                    ctrs[0].setAccessible(true);
+                    return null;
+                }
+            });
+            Object inst = ctrs[0].newInstance();
+            return new ConstantCallSite(MethodHandles.constant(samBase, inst));
         } else {
             return new ConstantCallSite(
                     MethodHandles.Lookup.IMPL_LOOKUP
@@ -144,7 +165,7 @@
     private <T> Class<? extends T> spinInnerClass() throws LambdaConversionException {
         String samName = samBase.getName().replace('.', '/');
 
-        cw.visit(CLASSFILE_VERSION, ACC_PUBLIC + ACC_SUPER, lambdaClassName, null, NAME_MAGIC_ACCESSOR_IMPL,
+        cw.visit(CLASSFILE_VERSION, ACC_SUPER, lambdaClassName, null, NAME_MAGIC_ACCESSOR_IMPL,
                  isSerializable ? new String[]{samName, NAME_SERIALIZABLE} : new String[]{samName});
 
         // Generate final fields to be filled in by constructor
@@ -186,17 +207,27 @@
 
         final byte[] classBytes = cw.toByteArray();
 
-        if (System.getProperty("debug.dump.generated") != null) {
+        /*** Uncomment to dump the generated file
             System.out.printf("Loaded: %s (%d bytes) %n", lambdaClassName, classBytes.length);
             try (FileOutputStream fos = new FileOutputStream(lambdaClassName.replace('/', '.') + ".class")) {
                 fos.write(classBytes);
             } catch (IOException ex) {
-                PlatformLogger.getLogger(InnerClassLambdaMetafactory.class.getName()).severe(ex.getMessage(), ex);
+                Logger.getLogger(InnerClassLambdaMetafactory.class.getName()).log(Level.SEVERE, null, ex);
             }
-        }
+        ***/
 
         ClassLoader loader = targetClass.getClassLoader();
-        ProtectionDomain pd = (loader == null) ? null : targetClass.getProtectionDomain();
+        ProtectionDomain pd = (loader == null)
+            ? null
+            : AccessController.doPrivileged(
+            new PrivilegedAction<ProtectionDomain>() {
+                @Override
+                public ProtectionDomain run() {
+                    return targetClass.getProtectionDomain();
+                }
+            }
+        );
+
         return (Class<? extends T>) Unsafe.getUnsafe().defineClass(lambdaClassName, classBytes, 0, classBytes.length, loader, pd);
     }
 
@@ -205,7 +236,7 @@
      */
     private void generateConstructor() {
         // Generate constructor
-        MethodVisitor ctor = cw.visitMethod(ACC_PUBLIC, NAME_CTOR, constructorDesc, null, null);
+        MethodVisitor ctor = cw.visitMethod(ACC_PRIVATE, NAME_CTOR, constructorDesc, null, null);
         ctor.visitCode();
         ctor.visitVarInsn(ALOAD, 0);
         ctor.visitMethodInsn(INVOKESPECIAL, NAME_MAGIC_ACCESSOR_IMPL, NAME_CTOR, METHOD_DESCRIPTOR_VOID);
diff --git a/src/share/classes/java/net/HttpCookie.java b/src/share/classes/java/net/HttpCookie.java
index fe4edc6..d5a36df 100644
--- a/src/share/classes/java/net/HttpCookie.java
+++ b/src/share/classes/java/net/HttpCookie.java
@@ -30,6 +30,8 @@
 import java.util.NoSuchElementException;
 import java.text.SimpleDateFormat;
 import java.util.TimeZone;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
 import java.util.Date;
 import java.util.Locale;
 import java.util.Objects;
@@ -89,7 +91,10 @@
     private final static String[] COOKIE_DATE_FORMATS = {
         "EEE',' dd-MMM-yyyy HH:mm:ss 'GMT'",
         "EEE',' dd MMM yyyy HH:mm:ss 'GMT'",
-        "EEE MMM dd yyyy HH:mm:ss 'GMT'Z"
+        "EEE MMM dd yyyy HH:mm:ss 'GMT'Z",
+        "EEE',' dd-MMM-yy HH:mm:ss 'GMT'",
+        "EEE',' dd MMM yy HH:mm:ss 'GMT'",
+        "EEE MMM dd yy HH:mm:ss 'GMT'Z"
     };
 
     // constant strings represent set-cookie header token
@@ -1025,13 +1030,29 @@
      *          specified by dateString
      */
     private long expiryDate2DeltaSeconds(String dateString) {
+        Calendar cal = new GregorianCalendar(GMT);
         for (int i = 0; i < COOKIE_DATE_FORMATS.length; i++) {
             SimpleDateFormat df = new SimpleDateFormat(COOKIE_DATE_FORMATS[i],
                                                        Locale.US);
+            cal.set(1970, 0, 1, 0, 0, 0);
             df.setTimeZone(GMT);
+            df.setLenient(false);
+            df.set2DigitYearStart(cal.getTime());
             try {
-                Date date = df.parse(dateString);
-                return (date.getTime() - whenCreated) / 1000;
+                cal.setTime(df.parse(dateString));
+                if (!COOKIE_DATE_FORMATS[i].contains("yyyy")) {
+                    // 2-digit years following the standard set
+                    // out it rfc 6265
+                    int year = cal.get(Calendar.YEAR);
+                    year %= 100;
+                    if (year < 70) {
+                        year += 2000;
+                    } else {
+                        year += 1900;
+                    }
+                    cal.set(Calendar.YEAR, year);
+                }
+                return (cal.getTimeInMillis() - whenCreated) / 1000;
             } catch (Exception e) {
                 // Ignore, try the next date format
             }
diff --git a/src/share/classes/java/net/Inet6Address.java b/src/share/classes/java/net/Inet6Address.java
index 77e7cf8..7329b2d 100644
--- a/src/share/classes/java/net/Inet6Address.java
+++ b/src/share/classes/java/net/Inet6Address.java
@@ -25,9 +25,9 @@
 
 package java.net;
 
-import java.io.ObjectInputStream;
 import java.io.IOException;
 import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
 import java.util.Enumeration;
 
 /**
@@ -116,7 +116,8 @@
  * <h4> Special IPv6 address </h4>
  *
  * <blockquote>
- * <table cellspacing=2 summary="Description of IPv4-mapped address"> <tr><th valign=top><i>IPv4-mapped address</i></th>
+ * <table cellspacing=2 summary="Description of IPv4-mapped address">
+ * <tr><th valign=top><i>IPv4-mapped address</i></th>
  *         <td>Of the form::ffff:w.x.y.z, this IPv6 address is used to
  *         represent an IPv4 address. It allows the native program to
  *         use the same address data structure and also the same
@@ -130,35 +131,40 @@
  *         address.</td></tr>
  * </table></blockquote>
  * <p>
- * <h4> <A NAME="scoped">Textual representation of IPv6 scoped addresses</a> </h4>
- * <p>
- * The textual representation of IPv6 addresses as described above can be extended
- * to specify IPv6 scoped addresses. This extension to the basic addressing architecture
- * is described in [draft-ietf-ipngwg-scoping-arch-04.txt].
- * <p>
- * Because link-local and site-local addresses are non-global, it is possible that different hosts
- * may have the same destination address and may be reachable through different interfaces on the
- * same originating system. In this case, the originating system is said to be connected
- * to multiple zones of the same scope. In order to disambiguate which is the intended destination
- * zone, it is possible to append a zone identifier (or <i>scope_id</i>) to an IPv6 address.
- * <p>
- * The general format for specifying the <i>scope_id</i> is the following:
+ * <h4><A NAME="scoped">Textual representation of IPv6 scoped addresses</a></h4>
+ *
+ * <p> The textual representation of IPv6 addresses as described above can be
+ * extended to specify IPv6 scoped addresses. This extension to the basic
+ * addressing architecture is described in [draft-ietf-ipngwg-scoping-arch-04.txt].
+ *
+ * <p> Because link-local and site-local addresses are non-global, it is possible
+ * that different hosts may have the same destination address and may be
+ * reachable through different interfaces on the same originating system. In
+ * this case, the originating system is said to be connected to multiple zones
+ * of the same scope. In order to disambiguate which is the intended destination
+ * zone, it is possible to append a zone identifier (or <i>scope_id</i>) to an
+ * IPv6 address.
+ *
+ * <p> The general format for specifying the <i>scope_id</i> is the following:
+ *
  * <p><blockquote><i>IPv6-address</i>%<i>scope_id</i></blockquote>
  * <p> The IPv6-address is a literal IPv6 address as described above.
- * The <i>scope_id</i> refers to an interface on the local system, and it can be specified
- * in two ways.
- * <p><ol><li><i>As a numeric identifier.</i> This must be a positive integer that identifies the
- * particular interface and scope as understood by the system. Usually, the numeric
- * values can be determined through administration tools on the system. Each interface may
- * have multiple values, one for each scope. If the scope is unspecified, then the default value
- * used is zero.</li><p>
- * <li><i>As a string.</i> This must be the exact string that is returned by
- * {@link java.net.NetworkInterface#getName()} for the particular interface in question.
- * When an Inet6Address is created in this way, the numeric scope-id is determined at the time
- * the object is created by querying the relevant NetworkInterface.</li>
- * </ol><p>
- * Note also, that the numeric <i>scope_id</i> can be retrieved from Inet6Address instances returned from the
- * NetworkInterface class. This can be used to find out the current scope ids configured on the system.
+ * The <i>scope_id</i> refers to an interface on the local system, and it can be
+ * specified in two ways.
+ * <p><ol><li><i>As a numeric identifier.</i> This must be a positive integer
+ * that identifies the particular interface and scope as understood by the
+ * system. Usually, the numeric values can be determined through administration
+ * tools on the system. Each interface may have multiple values, one for each
+ * scope. If the scope is unspecified, then the default value used is zero.</li>
+ * <p><li><i>As a string.</i> This must be the exact string that is returned by
+ * {@link java.net.NetworkInterface#getName()} for the particular interface in
+ * question. When an Inet6Address is created in this way, the numeric scope-id
+ * is determined at the time the object is created by querying the relevant
+ * NetworkInterface.</li></ol>
+ *
+ * <p> Note also, that the numeric <i>scope_id</i> can be retrieved from
+ * Inet6Address instances returned from the NetworkInterface class. This can be
+ * used to find out the current scope ids configured on the system.
  * @since 1.4
  */
 
@@ -169,7 +175,7 @@
     /*
      * cached scope_id - for link-local address use only.
      */
-    private transient int cached_scope_id = 0;
+    private transient int cached_scope_id;  // 0
 
     /**
      * Holds a 128-bit (16 bytes) IPv6 address.
@@ -179,37 +185,28 @@
     byte[] ipaddress;
 
     /**
-     * scope_id. The scope specified when the object is created. If the object is created
-     * with an interface name, then the scope_id is not determined until the time it is needed.
+     * scope_id. The scope specified when the object is created. If the object
+     * is created with an interface name, then the scope_id is not determined
+     * until the time it is needed.
      */
-    private int scope_id = 0;
+    private int scope_id;  // 0
 
     /**
      * This will be set to true when the scope_id field contains a valid
      * integer scope_id.
      */
-    private boolean scope_id_set = false;
+    private boolean scope_id_set;  // false
 
     /**
      * scoped interface. scope_id is derived from this as the scope_id of the first
      * address whose scope is the same as this address for the named interface.
      */
-    private transient NetworkInterface scope_ifname = null;
-
-    /**
-     * set if the object is constructed with a scoped interface instead of a
-     * numeric scope id.
-     */
-    private boolean scope_ifname_set = false;
+    private transient NetworkInterface scope_ifname;  // null
 
     private static final long serialVersionUID = 6880410070516793377L;
 
-    /*
-     * Perform initializations.
-     */
-    static {
-        init();
-    }
+    // Perform native initialization
+    static { init(); }
 
     Inet6Address() {
         super();
@@ -239,19 +236,24 @@
         } catch (UnknownHostException e) {} /* cant happen if ifname is null */
     }
 
-    Inet6Address (String hostName, byte addr[], NetworkInterface nif) throws UnknownHostException {
+    Inet6Address (String hostName, byte addr[], NetworkInterface nif)
+        throws UnknownHostException
+    {
         initif (hostName, addr, nif);
     }
 
-    Inet6Address (String hostName, byte addr[], String ifname) throws UnknownHostException {
+    Inet6Address (String hostName, byte addr[], String ifname)
+        throws UnknownHostException
+    {
         initstr (hostName, addr, ifname);
     }
 
     /**
-     * Create an Inet6Address in the exact manner of {@link InetAddress#getByAddress(String,byte[])}
-     * except that the IPv6 scope_id is set to the value corresponding to the given interface
-     * for the address type specified in <code>addr</code>.
-     * The call will fail with an UnknownHostException if the given interface does not have a numeric
+     * Create an Inet6Address in the exact manner of {@link
+     * InetAddress#getByAddress(String,byte[])} except that the IPv6 scope_id is
+     * set to the value corresponding to the given interface for the address
+     * type specified in <code>addr</code>. The call will fail with an
+     * UnknownHostException if the given interface does not have a numeric
      * scope_id assigned for the given address type (eg. link-local or site-local).
      * See <a href="Inet6Address.html#scoped">here</a> for a description of IPv6
      * scoped addresses.
@@ -260,14 +262,16 @@
      * @param addr the raw IP address in network byte order
      * @param nif an interface this address must be associated with.
      * @return  an Inet6Address object created from the raw IP address.
-     * @exception  UnknownHostException  if IP address is of illegal length, or if the interface
-     *          does not have a numeric scope_id assigned for the given address type.
+     * @throws  UnknownHostException
+     *          if IP address is of illegal length, or if the interface does not
+     *          have a numeric scope_id assigned for the given address type.
      *
      * @since 1.5
      */
-
-    public static Inet6Address getByAddress(String host, byte[] addr, NetworkInterface nif)
-        throws UnknownHostException {
+    public static Inet6Address getByAddress(String host, byte[] addr,
+                                            NetworkInterface nif)
+        throws UnknownHostException
+    {
         if (host != null && host.length() > 0 && host.charAt(0) == '[') {
             if (host.charAt(host.length()-1) == ']') {
                 host = host.substring(1, host.length() -1);
@@ -282,9 +286,10 @@
     }
 
     /**
-     * Create an Inet6Address in the exact manner of {@link InetAddress#getByAddress(String,byte[])}
-     * except that the IPv6 scope_id is set to the given numeric value.
-     * The scope_id is not checked to determine if it corresponds to any interface on the system.
+     * Create an Inet6Address in the exact manner of {@link
+     * InetAddress#getByAddress(String,byte[])} except that the IPv6 scope_id is
+     * set to the given numeric value. The scope_id is not checked to determine
+     * if it corresponds to any interface on the system.
      * See <a href="Inet6Address.html#scoped">here</a> for a description of IPv6
      * scoped addresses.
      *
@@ -292,13 +297,14 @@
      * @param addr the raw IP address in network byte order
      * @param scope_id the numeric scope_id for the address.
      * @return  an Inet6Address object created from the raw IP address.
-     * @exception  UnknownHostException  if IP address is of illegal length.
+     * @throws  UnknownHostException  if IP address is of illegal length.
      *
      * @since 1.5
      */
-
-    public static Inet6Address getByAddress(String host, byte[] addr, int scope_id)
-        throws UnknownHostException {
+    public static Inet6Address getByAddress(String host, byte[] addr,
+                                            int scope_id)
+        throws UnknownHostException
+    {
         if (host != null && host.length() > 0 && host.charAt(0) == '[') {
             if (host.charAt(host.length()-1) == ']') {
                 host = host.substring(1, host.length() -1);
@@ -312,7 +318,9 @@
         throw new UnknownHostException("addr is of illegal length");
     }
 
-    private void initstr (String hostName, byte addr[], String ifname) throws UnknownHostException {
+    private void initstr(String hostName, byte addr[], String ifname)
+        throws UnknownHostException
+    {
         try {
             NetworkInterface nif = NetworkInterface.getByName (ifname);
             if (nif == null) {
@@ -324,16 +332,17 @@
         }
     }
 
-    private void initif(String hostName, byte addr[],NetworkInterface nif) throws UnknownHostException {
+    private void initif(String hostName, byte addr[],NetworkInterface nif)
+        throws UnknownHostException
+    {
         this.hostName = hostName;
         if (addr.length == INADDRSZ) { // normal IPv6 address
             family = IPv6;
             ipaddress = addr.clone();
         }
         if (nif != null) {
-            this.scope_ifname = nif;
-            scope_ifname_set = true;
-            scope_id = deriveNumericScope (nif);
+            scope_ifname = nif;
+            scope_id = deriveNumericScope(nif);
             scope_id_set = true;
         }
     }
@@ -344,17 +353,16 @@
      * return true otherwise.
      */
     private boolean differentLocalAddressTypes(Inet6Address other) {
-
-        if (isLinkLocalAddress() && !other.isLinkLocalAddress()) {
+        if (isLinkLocalAddress() && !other.isLinkLocalAddress())
             return false;
-        }
-        if (isSiteLocalAddress() && !other.isSiteLocalAddress()) {
+        if (isSiteLocalAddress() && !other.isSiteLocalAddress())
             return false;
-        }
         return true;
     }
 
-    private int deriveNumericScope (NetworkInterface ifc) throws UnknownHostException {
+    private int deriveNumericScope(NetworkInterface ifc)
+        throws UnknownHostException
+    {
         Enumeration<InetAddress> addresses = ifc.getInetAddresses();
         while (addresses.hasMoreElements()) {
             InetAddress addr = addresses.nextElement();
@@ -373,16 +381,17 @@
         throw new UnknownHostException ("no scope_id found");
     }
 
-    private int deriveNumericScope (String ifname) throws UnknownHostException {
+    private int deriveNumericScope(String ifname) throws UnknownHostException {
         Enumeration<NetworkInterface> en;
         try {
             en = NetworkInterface.getNetworkInterfaces();
         } catch (SocketException e) {
-            throw new UnknownHostException ("could not enumerate local network interfaces");
+            throw new UnknownHostException(
+                    "could not enumerate local network interfaces");
         }
         while (en.hasMoreElements()) {
             NetworkInterface ifc = en.nextElement();
-            if (ifc.getName().equals (ifname)) {
+            if (ifc.getName().equals(ifname)) {
                 Enumeration<InetAddress> addresses = ifc.getInetAddresses();
                 while (addresses.hasMoreElements()) {
                     InetAddress addr = addresses.nextElement();
@@ -400,7 +409,8 @@
                 }
             }
         }
-        throw new UnknownHostException ("No matching address found for interface : " +ifname);
+        throw new UnknownHostException(
+                "No matching address found for interface : " +ifname);
     }
 
     /**
@@ -410,22 +420,14 @@
      */
     private void readObject(ObjectInputStream s)
         throws IOException, ClassNotFoundException {
-        scope_ifname = null;
-        scope_ifname_set = false;
         s.defaultReadObject();
 
-        if (ifname != null && !"".equals (ifname)) {
+        if (ifname != null && !ifname.equals("")) {
             try {
                 scope_ifname = NetworkInterface.getByName(ifname);
-                if (scope_ifname == null) {
-                    /* the interface does not exist on this system, so we clear
-                     * the scope information completely */
-                    scope_id_set = false;
-                    scope_ifname_set = false;
-                    scope_id = 0;
-                } else {
+                if (scope_ifname != null) {
                     try {
-                        scope_id = deriveNumericScope (scope_ifname);
+                        scope_id = deriveNumericScope(scope_ifname);
                     } catch (UnknownHostException e) {
                         // typically should not happen, but it may be that
                         // the machine being used for deserialization has
@@ -455,8 +457,9 @@
      * address. 11111111 at the start of the address identifies the
      * address as being a multicast address.
      *
-     * @return a <code>boolean</code> indicating if the InetAddress is
-     * an IP multicast address
+     * @return a {@code boolean} indicating if the InetAddress is an IP
+     *         multicast address
+     *
      * @since JDK1.1
      */
     @Override
@@ -466,8 +469,10 @@
 
     /**
      * Utility routine to check if the InetAddress in a wildcard address.
-     * @return a <code>boolean</code> indicating if the Inetaddress is
+     *
+     * @return a {@code boolean} indicating if the Inetaddress is
      *         a wildcard address.
+     *
      * @since 1.4
      */
     @Override
@@ -482,8 +487,9 @@
     /**
      * Utility routine to check if the InetAddress is a loopback address.
      *
-     * @return a <code>boolean</code> indicating if the InetAddress is
-     * a loopback address; or false otherwise.
+     * @return a {@code boolean} indicating if the InetAddress is a loopback
+     *         address; or false otherwise.
+     *
      * @since 1.4
      */
     @Override
@@ -498,8 +504,9 @@
     /**
      * Utility routine to check if the InetAddress is an link local address.
      *
-     * @return a <code>boolean</code> indicating if the InetAddress is
-     * a link local address; or false if address is not a link local unicast address.
+     * @return a {@code boolean} indicating if the InetAddress is a link local
+     *         address; or false if address is not a link local unicast address.
+     *
      * @since 1.4
      */
     @Override
@@ -511,8 +518,9 @@
     /**
      * Utility routine to check if the InetAddress is a site local address.
      *
-     * @return a <code>boolean</code> indicating if the InetAddress is
-     * a site local address; or false if address is not a site local unicast address.
+     * @return a {@code boolean} indicating if the InetAddress is a site local
+     *         address; or false if address is not a site local unicast address.
+     *
      * @since 1.4
      */
     @Override
@@ -524,9 +532,10 @@
     /**
      * Utility routine to check if the multicast address has global scope.
      *
-     * @return a <code>boolean</code> indicating if the address has
-     *         is a multicast address of global scope, false if it is not
-     *         of global scope or it is not a multicast address
+     * @return a {@code boolean} indicating if the address has is a multicast
+     *         address of global scope, false if it is not of global scope or
+     *         it is not a multicast address
+     *
      * @since 1.4
      */
     @Override
@@ -538,9 +547,10 @@
     /**
      * Utility routine to check if the multicast address has node scope.
      *
-     * @return a <code>boolean</code> indicating if the address has
-     *         is a multicast address of node-local scope, false if it is not
-     *         of node-local scope or it is not a multicast address
+     * @return a {@code boolean} indicating if the address has is a multicast
+     *         address of node-local scope, false if it is not of node-local
+     *         scope or it is not a multicast address
+     *
      * @since 1.4
      */
     @Override
@@ -552,9 +562,10 @@
     /**
      * Utility routine to check if the multicast address has link scope.
      *
-     * @return a <code>boolean</code> indicating if the address has
-     *         is a multicast address of link-local scope, false if it is not
-     *         of link-local scope or it is not a multicast address
+     * @return a {@code boolean} indicating if the address has is a multicast
+     *         address of link-local scope, false if it is not of link-local
+     *         scope or it is not a multicast address
+     *
      * @since 1.4
      */
     @Override
@@ -566,9 +577,10 @@
     /**
      * Utility routine to check if the multicast address has site scope.
      *
-     * @return a <code>boolean</code> indicating if the address has
-     *         is a multicast address of site-local scope, false if it is not
-     *         of site-local scope or it is not a multicast address
+     * @return a {@code boolean} indicating if the address has is a multicast
+     *         address of site-local scope, false if it is not  of site-local
+     *         scope or it is not a multicast address
+     *
      * @since 1.4
      */
     @Override
@@ -580,10 +592,10 @@
     /**
      * Utility routine to check if the multicast address has organization scope.
      *
-     * @return a <code>boolean</code> indicating if the address has
-     *         is a multicast address of organization-local scope,
-     *         false if it is not of organization-local scope
-     *         or it is not a multicast address
+     * @return a {@code boolean} indicating if the address has is a multicast
+     *         address of organization-local scope, false if it is not of
+     *         organization-local scope or it is not a multicast address
+     *
      * @since 1.4
      */
     @Override
@@ -593,9 +605,9 @@
     }
 
     /**
-     * Returns the raw IP address of this <code>InetAddress</code>
-     * object. The result is in network byte order: the highest order
-     * byte of the address is in <code>getAddress()[0]</code>.
+     * Returns the raw IP address of this {@code InetAddress} object. The result
+     * is in network byte order: the highest order byte of the address is in
+     * {@code getAddress()[0]}.
      *
      * @return  the raw IP address of this object.
      */
@@ -609,9 +621,10 @@
      * an interface. If no scoped_id is set, the returned value is zero.
      *
      * @return the scopeId, or zero if not set.
+     *
      * @since 1.5
      */
-     public int getScopeId () {
+     public int getScopeId() {
         return scope_id;
      }
 
@@ -622,22 +635,23 @@
      * @return the scoped interface, or null if not set.
      * @since 1.5
      */
-     public NetworkInterface getScopedInterface () {
+     public NetworkInterface getScopedInterface() {
         return scope_ifname;
      }
 
     /**
-     * Returns the IP address string in textual presentation. If the instance was created
-     * specifying a scope identifier then the scope id is appended to the IP address preceded by
-     * a "%" (per-cent) character. This can be either a numeric value or a string, depending on which
-     * was used to createthe instance.
+     * Returns the IP address string in textual presentation. If the instance
+     * was created specifying a scope identifier then the scope id is appended
+     * to the IP address preceded by a "%" (per-cent) character. This can be
+     * either a numeric value or a string, depending on which was used to create
+     * the instance.
      *
      * @return  the raw IP address in a string format.
      */
     @Override
     public String getHostAddress() {
         String s = numericToTextFormat(ipaddress);
-        if (scope_ifname_set) { /* must check this first */
+        if (scope_ifname != null) { /* must check this first */
             s = s + "%" + scope_ifname.getName();
         } else if (scope_id_set) {
             s = s + "%" + scope_id;
@@ -674,29 +688,27 @@
     }
 
     /**
-     * Compares this object against the specified object.
-     * The result is <code>true</code> if and only if the argument is
-     * not <code>null</code> and it represents the same IP address as
-     * this object.
-     * <p>
-     * Two instances of <code>InetAddress</code> represent the same IP
-     * address if the length of the byte arrays returned by
-     * <code>getAddress</code> is the same for both, and each of the
-     * array components is the same for the byte arrays.
+     * Compares this object against the specified object. The result is {@code
+     * true} if and only if the argument is not {@code null} and it represents
+     * the same IP address as this object.
+     *
+     * <p> Two instances of {@code InetAddress} represent the same IP address
+     * if the length of the byte arrays returned by {@code getAddress} is the
+     * same for both, and each of the array components is the same for the byte
+     * arrays.
      *
      * @param   obj   the object to compare against.
-     * @return  <code>true</code> if the objects are the same;
-     *          <code>false</code> otherwise.
+     *
+     * @return  {@code true} if the objects are the same; {@code false} otherwise.
+     *
      * @see     java.net.InetAddress#getAddress()
      */
     @Override
     public boolean equals(Object obj) {
-        if (obj == null ||
-            !(obj instanceof Inet6Address))
+        if (obj == null || !(obj instanceof Inet6Address))
             return false;
 
         Inet6Address inetAddr = (Inet6Address)obj;
-
         for (int i = 0; i < INADDRSZ; i++) {
             if (ipaddress[i] != inetAddr.ipaddress[i])
                 return false;
@@ -709,8 +721,9 @@
      * Utility routine to check if the InetAddress is an
      * IPv4 compatible IPv6 address.
      *
-     * @return a <code>boolean</code> indicating if the InetAddress is
-     * an IPv4 compatible IPv6 address; or false if address is IPv4 address.
+     * @return a {@code boolean} indicating if the InetAddress is an IPv4
+     *         compatible IPv6 address; or false if address is IPv4 address.
+     *
      * @since 1.4
      */
     public boolean isIPv4CompatibleAddress() {
@@ -727,6 +740,7 @@
 
     // Utilities
     private final static int INT16SZ = 2;
+
     /*
      * Convert IPv6 binary address into presentation (printable) format.
      *
@@ -735,9 +749,8 @@
      *         textual representation format
      * @since 1.4
      */
-    static String numericToTextFormat(byte[] src)
-    {
-        StringBuffer sb = new StringBuffer(39);
+    static String numericToTextFormat(byte[] src) {
+        StringBuilder sb = new StringBuilder(39);
         for (int i = 0; i < (INADDRSZ / INT16SZ); i++) {
             sb.append(Integer.toHexString(((src[i<<1]<<8) & 0xff00)
                                           | (src[(i<<1)+1] & 0xff)));
@@ -766,9 +779,8 @@
     private synchronized void writeObject(java.io.ObjectOutputStream s)
         throws IOException
     {
-        if (scope_ifname_set) {
+        if (scope_ifname != null)
             ifname = scope_ifname.getName();
-        }
         s.defaultWriteObject();
     }
 }
diff --git a/src/share/classes/java/net/doc-files/net-properties.html b/src/share/classes/java/net/doc-files/net-properties.html
index 37cbc93..5aac0c8 100644
--- a/src/share/classes/java/net/doc-files/net-properties.html
+++ b/src/share/classes/java/net/doc-files/net-properties.html
@@ -1,5 +1,5 @@
 <!--
- Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 1998, 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
@@ -237,6 +237,6 @@
 </UL>
 <P>Since these 2 properties are part of the security policy, they are
 not set by either the -D option or the System.setProperty() API,
-instead they are set in the JRE security policy file <code>lib/security/java.security</code>.</P>
+instead they are set as security properties.</P>
 </BODY>
 </HTML>
diff --git a/src/share/classes/java/security/KeyStore.java b/src/share/classes/java/security/KeyStore.java
index 35dd077..8e4855f 100644
--- a/src/share/classes/java/security/KeyStore.java
+++ b/src/share/classes/java/security/KeyStore.java
@@ -695,27 +695,23 @@
     }
 
     /**
-     * Returns the default keystore type as specified in the Java security
-     * properties file, or the string
-     * &quot;jks&quot; (acronym for &quot;Java keystore&quot;)
+     * Returns the default keystore type as specified by the
+     * {@code keystore.type} security property, or the string
+     * {@literal "jks"} (acronym for {@literal "Java keystore"})
      * if no such property exists.
-     * The Java security properties file is located in the file named
-     * &lt;JAVA_HOME&gt;/lib/security/java.security.
-     * &lt;JAVA_HOME&gt; refers to the value of the java.home system property,
-     * and specifies the directory where the JRE is installed.
      *
      * <p>The default keystore type can be used by applications that do not
      * want to use a hard-coded keystore type when calling one of the
-     * <code>getInstance</code> methods, and want to provide a default keystore
+     * {@code getInstance} methods, and want to provide a default keystore
      * type in case a user does not specify its own.
      *
      * <p>The default keystore type can be changed by setting the value of the
-     * "keystore.type" security property (in the Java security properties
-     * file) to the desired keystore type.
+     * {@code keystore.type} security property to the desired keystore type.
      *
-     * @return the default keystore type as specified in the
-     * Java security properties file, or the string &quot;jks&quot;
+     * @return the default keystore type as specified by the
+     * {@code keystore.type} security property, or the string {@literal "jks"}
      * if no such property exists.
+     * @see java.security.Security security properties
      */
     public final static String getDefaultType() {
         String kstype;
diff --git a/src/share/classes/java/security/Policy.java b/src/share/classes/java/security/Policy.java
index b402c76..0daf126 100644
--- a/src/share/classes/java/security/Policy.java
+++ b/src/share/classes/java/security/Policy.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -48,12 +48,8 @@
  * <code>getPolicy</code> installs an instance of the default Policy
  * implementation (a default subclass implementation of this abstract class).
  * The default Policy implementation can be changed by setting the value
- * of the "policy.provider" security property (in the Java security properties
- * file) to the fully qualified name of the desired Policy subclass
- * implementation.  The Java security properties file is located in the
- * file named &lt;JAVA_HOME&gt;/lib/security/java.security.
- * &lt;JAVA_HOME&gt; refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
+ * of the {@code policy.provider} security property to the fully qualified
+ * name of the desired Policy subclass implementation.
  *
  * <p> Application code can directly subclass Policy to provide a custom
  * implementation.  In addition, an instance of a Policy object can be
@@ -84,6 +80,7 @@
  * @see java.security.Provider
  * @see java.security.ProtectionDomain
  * @see java.security.Permission
+ * @see java.security.Security security properties
  */
 
 public abstract class Policy {
diff --git a/src/share/classes/java/security/Security.java b/src/share/classes/java/security/Security.java
index f8890e6..eccede1 100644
--- a/src/share/classes/java/security/Security.java
+++ b/src/share/classes/java/security/Security.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -39,6 +39,10 @@
  * <p>This class centralizes all security properties and common security
  * methods. One of its primary uses is to manage providers.
  *
+ * <p>The default values of security properties are read from an
+ * implementation-specific location, which is typically the properties file
+ * {@code lib/security/java.security} in the Java installation directory.
+ *
  * @author Benjamin Renaud
  */
 
diff --git a/src/share/classes/java/security/cert/CertPathBuilder.java b/src/share/classes/java/security/cert/CertPathBuilder.java
index 3d12221..998477b 100644
--- a/src/share/classes/java/security/cert/CertPathBuilder.java
+++ b/src/share/classes/java/security/cert/CertPathBuilder.java
@@ -281,25 +281,23 @@
     }
 
     /**
-     * Returns the default <code>CertPathBuilder</code> type as specified in
-     * the Java security properties file, or the string &quot;PKIX&quot;
-     * if no such property exists. The Java security properties file is
-     * located in the file named &lt;JAVA_HOME&gt;/lib/security/java.security.
-     * &lt;JAVA_HOME&gt; refers to the value of the java.home system property,
-     * and specifies the directory where the JRE is installed.
+     * Returns the default {@code CertPathBuilder} type as specified by
+     * the {@code certpathbuilder.type} security property, or the string
+     * {@literal "PKIX"} if no such property exists.
      *
-     * <p>The default <code>CertPathBuilder</code> type can be used by
+     * <p>The default {@code CertPathBuilder} type can be used by
      * applications that do not want to use a hard-coded type when calling one
-     * of the <code>getInstance</code> methods, and want to provide a default
+     * of the {@code getInstance} methods, and want to provide a default
      * type in case a user does not specify its own.
      *
-     * <p>The default <code>CertPathBuilder</code> type can be changed by
-     * setting the value of the "certpathbuilder.type" security property
-     * (in the Java security properties file) to the desired type.
+     * <p>The default {@code CertPathBuilder} type can be changed by
+     * setting the value of the {@code certpathbuilder.type} security property
+     * to the desired type.
      *
-     * @return the default <code>CertPathBuilder</code> type as specified
-     * in the Java security properties file, or the string &quot;PKIX&quot;
-     * if no such property exists.
+     * @see java.security.Security security properties
+     * @return the default {@code CertPathBuilder} type as specified
+     * by the {@code certpathbuilder.type} security property, or the string
+     * {@literal "PKIX"} if no such property exists.
      */
     public final static String getDefaultType() {
         String cpbtype =
diff --git a/src/share/classes/java/security/cert/CertPathValidator.java b/src/share/classes/java/security/cert/CertPathValidator.java
index 6720482..99ecb1e 100644
--- a/src/share/classes/java/security/cert/CertPathValidator.java
+++ b/src/share/classes/java/security/cert/CertPathValidator.java
@@ -293,25 +293,23 @@
     }
 
     /**
-     * Returns the default <code>CertPathValidator</code> type as specified in
-     * the Java security properties file, or the string &quot;PKIX&quot;
-     * if no such property exists. The Java security properties file is
-     * located in the file named &lt;JAVA_HOME&gt;/lib/security/java.security.
-     * &lt;JAVA_HOME&gt; refers to the value of the java.home system property,
-     * and specifies the directory where the JRE is installed.
+     * Returns the default {@code CertPathValidator} type as specified by
+     * the {@code certpathvalidator.type} security property, or the string
+     * {@literal "PKIX"} if no such property exists.
      *
-     * <p>The default <code>CertPathValidator</code> type can be used by
+     * <p>The default {@code CertPathValidator} type can be used by
      * applications that do not want to use a hard-coded type when calling one
-     * of the <code>getInstance</code> methods, and want to provide a default
+     * of the {@code getInstance} methods, and want to provide a default
      * type in case a user does not specify its own.
      *
-     * <p>The default <code>CertPathValidator</code> type can be changed by
-     * setting the value of the "certpathvalidator.type" security property
-     * (in the Java security properties file) to the desired type.
+     * <p>The default {@code CertPathValidator} type can be changed by
+     * setting the value of the {@code certpathvalidator.type} security
+     * property to the desired type.
      *
-     * @return the default <code>CertPathValidator</code> type as specified
-     * in the Java security properties file, or the string &quot;PKIX&quot;
-     * if no such property exists.
+     * @see java.security.Security security properties
+     * @return the default {@code CertPathValidator} type as specified
+     * by the {@code certpathvalidator.type} security property, or the string
+     * {@literal "PKIX"} if no such property exists.
      */
     public final static String getDefaultType() {
         String cpvtype =
diff --git a/src/share/classes/java/security/cert/CertStore.java b/src/share/classes/java/security/cert/CertStore.java
index 989d181..1c6dedb 100644
--- a/src/share/classes/java/security/cert/CertStore.java
+++ b/src/share/classes/java/security/cert/CertStore.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -389,25 +389,23 @@
     }
 
     /**
-     * Returns the default <code>CertStore</code> type as specified in the
-     * Java security properties file, or the string &quot;LDAP&quot; if no
-     * such property exists. The Java security properties file is located in
-     * the file named &lt;JAVA_HOME&gt;/lib/security/java.security.
-     * &lt;JAVA_HOME&gt; refers to the value of the java.home system property,
-     * and specifies the directory where the JRE is installed.
+     * Returns the default {@code CertStore} type as specified by the
+     * {@code certstore.type} security property, or the string
+     * {@literal "LDAP"} if no such property exists.
      *
-     * <p>The default <code>CertStore</code> type can be used by applications
+     * <p>The default {@code CertStore} type can be used by applications
      * that do not want to use a hard-coded type when calling one of the
-     * <code>getInstance</code> methods, and want to provide a default
-     * <code>CertStore</code> type in case a user does not specify its own.
+     * {@code getInstance} methods, and want to provide a default
+     * {@code CertStore} type in case a user does not specify its own.
      *
-     * <p>The default <code>CertStore</code> type can be changed by setting
-     * the value of the "certstore.type" security property (in the Java
-     * security properties file) to the desired type.
+     * <p>The default {@code CertStore} type can be changed by setting
+     * the value of the {@code certstore.type} security property to the
+     * desired type.
      *
-     * @return the default <code>CertStore</code> type as specified in the
-     * Java security properties file, or the string &quot;LDAP&quot;
-     * if no such property exists.
+     * @see java.security.Security security properties
+     * @return the default {@code CertStore} type as specified by the
+     * {@code certstore.type} security property, or the string
+     * {@literal "LDAP"} if no such property exists.
      */
     public final static String getDefaultType() {
         String cstype;
diff --git a/src/share/classes/java/text/DateFormatSymbols.java b/src/share/classes/java/text/DateFormatSymbols.java
index ee688ab..bde39a6 100644
--- a/src/share/classes/java/text/DateFormatSymbols.java
+++ b/src/share/classes/java/text/DateFormatSymbols.java
@@ -688,7 +688,16 @@
         }
         ResourceBundle resource = adapter.getLocaleData().getDateFormatData(locale);
 
-        eras = resource.getStringArray("Eras");
+        // JRE and CLDR use different keys
+        // JRE: Eras, short.Eras and narrow.Eras
+        // CLDR: long.Eras, Eras and narrow.Eras
+        if (resource.containsKey("Eras")) {
+            eras = resource.getStringArray("Eras");
+        } else if (resource.containsKey("long.Eras")) {
+            eras = resource.getStringArray("long.Eras");
+        } else if (resource.containsKey("short.Eras")) {
+            eras = resource.getStringArray("short.Eras");
+        }
         months = resource.getStringArray("MonthNames");
         shortMonths = resource.getStringArray("MonthAbbreviations");
         ampms = resource.getStringArray("AmPmMarkers");
diff --git a/src/share/classes/java/text/SimpleDateFormat.java b/src/share/classes/java/text/SimpleDateFormat.java
index b434b6b..0c1f4aa 100644
--- a/src/share/classes/java/text/SimpleDateFormat.java
+++ b/src/share/classes/java/text/SimpleDateFormat.java
@@ -48,12 +48,13 @@
 import java.util.Locale;
 import java.util.Map;
 import java.util.SimpleTimeZone;
+import java.util.SortedMap;
 import java.util.TimeZone;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
-import sun.util.locale.provider.LocaleProviderAdapter;
 import sun.util.calendar.CalendarUtils;
 import sun.util.calendar.ZoneInfoFile;
+import sun.util.locale.provider.LocaleProviderAdapter;
 
 /**
  * <code>SimpleDateFormat</code> is a concrete class for formatting and
@@ -1593,6 +1594,17 @@
     private int matchString(String text, int start, int field,
                             Map<String,Integer> data, CalendarBuilder calb) {
         if (data != null) {
+            // TODO: make this default when it's in the spec.
+            if (data instanceof SortedMap) {
+                for (String name : data.keySet()) {
+                    if (text.regionMatches(true, start, name, 0, name.length())) {
+                        calb.set(field, data.get(name));
+                        return start + name.length();
+                    }
+                }
+                return -start;
+            }
+
             String bestMatch = null;
 
             for (String name : data.keySet()) {
@@ -1803,7 +1815,7 @@
                          boolean obeyCount, boolean[] ambiguousYear,
                          ParsePosition origPos,
                          boolean useFollowingMinusSignAsDelimiter, CalendarBuilder calb) {
-        Number number = null;
+        Number number;
         int value = 0;
         ParsePosition pos = new ParsePosition(0);
         pos.index = start;
@@ -1876,9 +1888,7 @@
                         return index;
                     }
                 } else {
-                    Map<String, Integer> map = calendar.getDisplayNames(field,
-                                                                        Calendar.ALL_STYLES,
-                                                                        locale);
+                    Map<String, Integer> map = getDisplayNamesMap(field, locale);
                     if ((index = matchString(text, start, field, map, calb)) > 0) {
                         return index;
                     }
@@ -1940,7 +1950,7 @@
                     // count >= 3 // i.e., MMM or MMMM
                     // Want to be able to parse both short and long forms.
                     // Try count == 4 first:
-                    int newStart = 0;
+                    int newStart;
                     if ((newStart = matchString(text, start, Calendar.MONTH,
                                                 formatData.getMonths(), calb)) > 0) {
                         return newStart;
@@ -1951,9 +1961,7 @@
                         return index;
                     }
                 } else {
-                    Map<String, Integer> map = calendar.getDisplayNames(field,
-                                                                        Calendar.ALL_STYLES,
-                                                                        locale);
+                    Map<String, Integer> map = getDisplayNamesMap(field, locale);
                     if ((index = matchString(text, start, field, map, calb)) > 0) {
                         return index;
                     }
@@ -1979,7 +1987,7 @@
                     if (useDateFormatSymbols) {
                         // Want to be able to parse both short and long forms.
                         // Try count == 4 (DDDD) first:
-                        int newStart = 0;
+                        int newStart;
                         if ((newStart=matchString(text, start, Calendar.DAY_OF_WEEK,
                                                   formatData.getWeekdays(), calb)) > 0) {
                             return newStart;
@@ -2008,7 +2016,7 @@
                         return index;
                     }
                 } else {
-                    Map<String,Integer> map = calendar.getDisplayNames(field, Calendar.ALL_STYLES, locale);
+                    Map<String,Integer> map = getDisplayNamesMap(field, locale);
                     if ((index = matchString(text, start, field, map, calb)) > 0) {
                         return index;
                     }
@@ -2098,7 +2106,7 @@
                         break parsing;
                     }
 
-                    int sign = 0;
+                    int sign;
                     char c = text.charAt(pos.index);
                     if (c == 'Z') {
                         calb.set(Calendar.ZONE_OFFSET, 0).set(Calendar.DST_OFFSET, 0);
@@ -2340,6 +2348,21 @@
                 && formatData.equals(that.formatData));
     }
 
+    private static final int[] REST_OF_STYLES = {
+        Calendar.SHORT_STANDALONE, Calendar.LONG_FORMAT, Calendar.LONG_STANDALONE,
+    };
+    private Map<String, Integer> getDisplayNamesMap(int field, Locale locale) {
+        Map<String, Integer> map = calendar.getDisplayNames(field, Calendar.SHORT_FORMAT, locale);
+        // Get all SHORT and LONG styles (avoid NARROW styles).
+        for (int style : REST_OF_STYLES) {
+            Map<String, Integer> m = calendar.getDisplayNames(field, style, locale);
+            if (m != null) {
+                map.putAll(m);
+            }
+        }
+        return map;
+    }
+
     /**
      * After reading an object from the input stream, the format
      * pattern in the object is verified.
diff --git a/src/share/classes/java/util/Base64.java b/src/share/classes/java/util/Base64.java
index a44c5d0..f5ff211 100644
--- a/src/share/classes/java/util/Base64.java
+++ b/src/share/classes/java/util/Base64.java
@@ -289,8 +289,8 @@
          *
          * <p> This method first encodes all input bytes into a base64 encoded
          * byte array and then constructs a new String by using the encoded byte
-         * array and the {@link java.nio.charset.StandardCharsets.ISO_8859_1 ISO-8859-1}
-         * charset.
+         * array and the {@link java.nio.charset.StandardCharsets#ISO_8859_1
+         * ISO-8859-1} charset.
          *
          * <p> In other words, an invocation of this method has exactly the same
          * effect as invoking
@@ -358,9 +358,9 @@
          * to encode any more input bytes. The encoding operation can be
          * continued, if there is more bytes in input buffer to be encoded,
          * by invoking this method again with an output buffer that has more
-         * {@linkplain Buffer#remaining remaining} bytes. This is typically
-         * done by draining any encoded bytes from the output buffer. The
-         * value returned from last invocation needs to be passed in as the
+         * {@linkplain java.nio.Buffer#remaining remaining} bytes. This is
+         * typically done by draining any encoded bytes from the output buffer.
+         * The value returned from last invocation needs to be passed in as the
          * third parameter {@code bytesOut} if it is to continue an unfinished
          * encoding, 0 otherwise.
          *
@@ -806,9 +806,9 @@
          * buffer has insufficient space to decode any more input bytes.
          * The decoding operation can be continued, if there is more bytes
          * in input buffer to be decoded, by invoking this method again with
-         * an output buffer that has more {@linkplain Buffer#remaining remaining}
-         * bytes.This is typically done by draining any decoded bytes from the
-         * output buffer.
+         * an output buffer that has more {@linkplain java.nio.Buffer#remaining
+         * remaining} bytes. This is typically done by draining any decoded
+         * bytes from the output buffer.
          *
          * <p><b>Recommended Usage Example</b>
          * <pre>
diff --git a/src/share/classes/java/util/Calendar.java b/src/share/classes/java/util/Calendar.java
index f641a37..9b61012 100644
--- a/src/share/classes/java/util/Calendar.java
+++ b/src/share/classes/java/util/Calendar.java
@@ -53,9 +53,7 @@
 import java.text.DateFormatSymbols;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
-import java.util.spi.CalendarDataProvider;
 import sun.util.BuddhistCalendar;
-import sun.util.locale.provider.LocaleProviderAdapter;
 import sun.util.calendar.ZoneInfo;
 import sun.util.locale.provider.CalendarDataUtility;
 
@@ -746,6 +744,32 @@
     /**
      * A style specifier for {@link #getDisplayName(int, int, Locale)
      * getDisplayName} and {@link #getDisplayNames(int, int, Locale)
+     * getDisplayNames} indicating a narrow name used for format. Narrow names
+     * are typically single character strings, such as "M" for Monday.
+     *
+     * @see #NARROW_STANDALONE
+     * @see #SHORT_FORMAT
+     * @see #LONG_FOTMAT
+     * @since 1.8
+     */
+    public static final int NARROW_FORMAT = 4;
+
+    /**
+     * A style specifier for {@link #getDisplayName(int, int, Locale)
+     * getDisplayName} and {@link #getDisplayNames(int, int, Locale)
+     * getDisplayNames} indicating a narrow name independently. Narrow names
+     * are typically single character strings, such as "M" for Monday.
+     *
+     * @see #NARROW_FORMAT
+     * @see #SHORT_STANDALONE
+     * @see #LONG_STANDALONE
+     * @since 1.8
+     */
+    public static final int NARROW_STANDALONE = NARROW_FORMAT | STANDALONE_MASK;
+
+    /**
+     * A style specifier for {@link #getDisplayName(int, int, Locale)
+     * getDisplayName} and {@link #getDisplayNames(int, int, Locale)
      * getDisplayNames} indicating a short name used for format.
      *
      * @see #SHORT_STANDALONE
@@ -1472,30 +1496,31 @@
      * @param style
      *        the style applied to the string representation; one of {@link
      *        #SHORT_FORMAT} ({@link #SHORT}), {@link #SHORT_STANDALONE},
-     *        {@link #LONG_FORMAT} ({@link #LONG}) or {@link #LONG_STANDALONE}.
+     *        {@link #LONG_FORMAT} ({@link #LONG}), {@link #LONG_STANDALONE},
+     *        {@link #NARROW_FORMAT}, or {@link #NARROW_STANDALONE}.
      * @param locale
      *        the locale for the string representation
      *        (any calendar types specified by {@code locale} are ignored)
      * @return the string representation of the given
-     *        <code>field</code> in the given <code>style</code>, or
-     *        <code>null</code> if no string representation is
+     *        {@code field} in the given {@code style}, or
+     *        {@code null} if no string representation is
      *        applicable.
      * @exception IllegalArgumentException
-     *        if <code>field</code> or <code>style</code> is invalid,
-     *        or if this <code>Calendar</code> is non-lenient and any
+     *        if {@code field} or {@code style} is invalid,
+     *        or if this {@code Calendar} is non-lenient and any
      *        of the calendar fields have invalid values
      * @exception NullPointerException
-     *        if <code>locale</code> is null
+     *        if {@code locale} is null
      * @since 1.6
      */
     public String getDisplayName(int field, int style, Locale locale) {
-        if (!checkDisplayNameParams(field, style, SHORT, LONG, locale,
+        if (!checkDisplayNameParams(field, style, SHORT, NARROW_FORMAT, locale,
                             ERA_MASK|MONTH_MASK|DAY_OF_WEEK_MASK|AM_PM_MASK)) {
             return null;
         }
 
-        // the standalone styles are supported only through CalendarDataProviders.
-        if (isStandaloneStyle(style)) {
+        // the standalone and narrow styles are supported only through CalendarDataProviders.
+        if (isStandaloneStyle(style) || isNarrowStyle(style)) {
             return CalendarDataUtility.retrieveFieldValueName(getCalendarType(),
                                                               field, get(field),
                                                               style, locale);
@@ -1513,26 +1538,30 @@
     }
 
     /**
-     * Returns a <code>Map</code> containing all names of the calendar
-     * <code>field</code> in the given <code>style</code> and
-     * <code>locale</code> and their corresponding field values. For
-     * example, if this <code>Calendar</code> is a {@link
+     * Returns a {@code Map} containing all names of the calendar
+     * {@code field} in the given {@code style} and
+     * {@code locale} and their corresponding field values. For
+     * example, if this {@code Calendar} is a {@link
      * GregorianCalendar}, the returned map would contain "Jan" to
      * {@link #JANUARY}, "Feb" to {@link #FEBRUARY}, and so on, in the
      * {@linkplain #SHORT short} style in an English locale.
      *
+     * <p>Narrow names may not be unique due to use of single characters,
+     * such as "S" for Sunday and Saturday. In that case narrow names are not
+     * included in the returned {@code Map}.
+     *
      * <p>The values of other calendar fields may be taken into
      * account to determine a set of display names. For example, if
-     * this <code>Calendar</code> is a lunisolar calendar system and
+     * this {@code Calendar} is a lunisolar calendar system and
      * the year value given by the {@link #YEAR} field has a leap
      * month, this method would return month names containing the leap
      * month name, and month names are mapped to their values specific
      * for the year.
      *
      * <p>The default implementation supports display names contained in
-     * a {@link DateFormatSymbols}. For example, if <code>field</code>
-     * is {@link #MONTH} and <code>style</code> is {@link
-     * #ALL_STYLES}, this method returns a <code>Map</code> containing
+     * a {@link DateFormatSymbols}. For example, if {@code field}
+     * is {@link #MONTH} and {@code style} is {@link
+     * #ALL_STYLES}, this method returns a {@code Map} containing
      * all strings returned by {@link DateFormatSymbols#getShortMonths()}
      * and {@link DateFormatSymbols#getMonths()}.
      *
@@ -1541,30 +1570,31 @@
      * @param style
      *        the style applied to the string representation; one of {@link
      *        #SHORT_FORMAT} ({@link #SHORT}), {@link #SHORT_STANDALONE},
-     *        {@link #LONG_FORMAT} ({@link #LONG}) or {@link #LONG_STANDALONE}.
+     *        {@link #LONG_FORMAT} ({@link #LONG}), {@link #LONG_STANDALONE},
+     *        {@link #NARROW_FORMAT}, or {@link #NARROW_STANDALONE}
      * @param locale
      *        the locale for the display names
-     * @return a <code>Map</code> containing all display names in
-     *        <code>style</code> and <code>locale</code> and their
-     *        field values, or <code>null</code> if no display names
-     *        are defined for <code>field</code>
+     * @return a {@code Map} containing all display names in
+     *        {@code style} and {@code locale} and their
+     *        field values, or {@code null} if no display names
+     *        are defined for {@code field}
      * @exception IllegalArgumentException
-     *        if <code>field</code> or <code>style</code> is invalid,
-     *        or if this <code>Calendar</code> is non-lenient and any
+     *        if {@code field} or {@code style} is invalid,
+     *        or if this {@code Calendar} is non-lenient and any
      *        of the calendar fields have invalid values
      * @exception NullPointerException
-     *        if <code>locale</code> is null
+     *        if {@code locale} is null
      * @since 1.6
      */
     public Map<String, Integer> getDisplayNames(int field, int style, Locale locale) {
-        if (!checkDisplayNameParams(field, style, ALL_STYLES, LONG, locale,
+        if (!checkDisplayNameParams(field, style, ALL_STYLES, NARROW_FORMAT, locale,
                                     ERA_MASK|MONTH_MASK|DAY_OF_WEEK_MASK|AM_PM_MASK)) {
             return null;
         }
         if (style == ALL_STYLES || isStandaloneStyle(style)) {
             return CalendarDataUtility.retrieveFieldValueNames(getCalendarType(), field, style, locale);
         }
-        // SHORT or LONG
+        // SHORT, LONG, or NARROW
         return getDisplayNamesImpl(field, style, locale);
     }
 
@@ -1599,6 +1629,12 @@
 
     private String[] getFieldStrings(int field, int style, DateFormatSymbols symbols) {
         int baseStyle = getBaseStyle(style); // ignore the standalone mask
+
+        // DateFormatSymbols doesn't support any narrow names.
+        if (baseStyle == NARROW_FORMAT) {
+            return null;
+        }
+
         String[] strings = null;
         switch (field) {
         case ERA:
@@ -1948,6 +1984,10 @@
         return (style & STANDALONE_MASK) != 0;
     }
 
+    boolean isNarrowStyle(int style) {
+        return style == NARROW_FORMAT || style == NARROW_STANDALONE;
+    }
+
     /**
      * Returns the pseudo-time-stamp for two fields, given their
      * individual pseudo-time-stamps.  If either of the fields
diff --git a/src/share/classes/java/util/JapaneseImperialCalendar.java b/src/share/classes/java/util/JapaneseImperialCalendar.java
index 566d59a..11b88e6 100644
--- a/src/share/classes/java/util/JapaneseImperialCalendar.java
+++ b/src/share/classes/java/util/JapaneseImperialCalendar.java
@@ -946,8 +946,9 @@
         set(field, getRolledValue(internalGet(field), amount, min, max));
     }
 
+    @Override
     public String getDisplayName(int field, int style, Locale locale) {
-        if (!checkDisplayNameParams(field, style, SHORT, LONG, locale,
+        if (!checkDisplayNameParams(field, style, SHORT, NARROW_FORMAT, locale,
                                     ERA_MASK|YEAR_MASK|MONTH_MASK|DAY_OF_WEEK_MASK|AM_PM_MASK)) {
             return null;
         }
@@ -956,11 +957,12 @@
 
         // "GanNen" is supported only in the LONG style.
         if (field == YEAR
-            && (getBaseStyle(style) == SHORT || fieldValue != 1 || get(ERA) == 0)) {
+            && (getBaseStyle(style) != LONG || fieldValue != 1 || get(ERA) == 0)) {
             return null;
         }
 
-        String name = CalendarDataUtility.retrieveFieldValueName("japanese", field, fieldValue, style, locale);
+        String name = CalendarDataUtility.retrieveFieldValueName(getCalendarType(), field,
+                                                                 fieldValue, style, locale);
         // If the ERA value is null, then
         // try to get its name or abbreviation from the Era instance.
         if (name == null && field == ERA && fieldValue < eras.length) {
@@ -970,27 +972,37 @@
         return name;
     }
 
+    @Override
     public Map<String,Integer> getDisplayNames(int field, int style, Locale locale) {
-        if (!checkDisplayNameParams(field, style, ALL_STYLES, LONG, locale,
+        if (!checkDisplayNameParams(field, style, ALL_STYLES, NARROW_FORMAT, locale,
                                     ERA_MASK|YEAR_MASK|MONTH_MASK|DAY_OF_WEEK_MASK|AM_PM_MASK)) {
             return null;
         }
-        Map<String, Integer> names = CalendarDataUtility.retrieveFieldValueNames("japanese", field, style, locale);
+        Map<String, Integer> names;
+        names = CalendarDataUtility.retrieveFieldValueNames(getCalendarType(), field, style, locale);
         // If strings[] has fewer than eras[], get more names from eras[].
-        if (field == ERA) {
-            int size = names.size();
-            if (style == ALL_STYLES) {
-                size /= 2; // SHORT and LONG
-            }
-            if (size < eras.length) {
-                int baseStyle = getBaseStyle(style);
-                for (int i = size; i < eras.length; i++) {
-                    Era era = eras[i];
-                    if (baseStyle == ALL_STYLES || baseStyle == SHORT) {
-                        names.put(era.getAbbreviation(), i);
+        if (names != null) {
+            if (field == ERA) {
+                int size = names.size();
+                if (style == ALL_STYLES) {
+                    Set<Integer> values = new HashSet<>();
+                    // count unique era values
+                    for (String key : names.keySet()) {
+                        values.add(names.get(key));
                     }
-                    if (baseStyle == ALL_STYLES || baseStyle == LONG) {
-                        names.put(era.getName(), i);
+                    size = values.size();
+                }
+                if (size < eras.length) {
+                    int baseStyle = getBaseStyle(style);
+                    for (int i = size; i < eras.length; i++) {
+                        Era era = eras[i];
+                        if (baseStyle == ALL_STYLES || baseStyle == SHORT
+                                || baseStyle == NARROW_FORMAT) {
+                            names.put(era.getAbbreviation(), i);
+                        }
+                        if (baseStyle == ALL_STYLES || baseStyle == LONG) {
+                            names.put(era.getName(), i);
+                        }
                     }
                 }
             }
diff --git a/src/share/classes/java/util/TimeZone.java b/src/share/classes/java/util/TimeZone.java
index 13ede9c..9d9fbcc 100644
--- a/src/share/classes/java/util/TimeZone.java
+++ b/src/share/classes/java/util/TimeZone.java
@@ -43,12 +43,12 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.concurrent.ConcurrentHashMap;
-import sun.misc.SharedSecrets;
 import sun.misc.JavaAWTAccess;
+import sun.misc.SharedSecrets;
 import sun.security.action.GetPropertyAction;
-import sun.util.locale.provider.TimeZoneNameUtility;
 import sun.util.calendar.ZoneInfo;
 import sun.util.calendar.ZoneInfoFile;
+import sun.util.locale.provider.TimeZoneNameUtility;
 
 /**
  * <code>TimeZone</code> represents a time zone offset, and also figures out daylight
@@ -399,28 +399,23 @@
         if (style != SHORT && style != LONG) {
             throw new IllegalArgumentException("Illegal style: " + style);
         }
-
         String id = getID();
-        String[] names = getDisplayNames(id, locale);
-        if (names == null) {
-            if (id.startsWith("GMT") && id.length() > 3) {
-                char sign = id.charAt(3);
-                if (sign == '+' || sign == '-') {
-                    return id;
-                }
-            }
-            int offset = getRawOffset();
-            if (daylight) {
-                offset += getDSTSavings();
-            }
-            return ZoneInfoFile.toCustomID(offset);
+        String name = TimeZoneNameUtility.retrieveDisplayName(id, daylight, style, locale);
+        if (name != null) {
+            return name;
         }
 
-        int index = daylight ? 3 : 1;
-        if (style == SHORT) {
-            index++;
+        if (id.startsWith("GMT") && id.length() > 3) {
+            char sign = id.charAt(3);
+            if (sign == '+' || sign == '-') {
+                return id;
+            }
         }
-        return names[index];
+        int offset = getRawOffset();
+        if (daylight) {
+            offset += getDSTSavings();
+        }
+        return ZoneInfoFile.toCustomID(offset);
     }
 
     private static class DisplayNames {
@@ -429,9 +424,12 @@
         //   Map(key=id, value=SoftReference(Map(key=locale, value=displaynames)))
         private static final Map<String, SoftReference<Map<Locale, String[]>>> CACHE =
             new ConcurrentHashMap<>();
+
+        private DisplayNames() {
+        }
     }
 
-    private static final String[] getDisplayNames(String id, Locale locale) {
+    private static String[] getDisplayNames(String id, Locale locale) {
         Map<String, SoftReference<Map<Locale, String[]>>> displayNames = DisplayNames.CACHE;
 
         SoftReference<Map<Locale, String[]>> ref = displayNames.get(id);
@@ -631,14 +629,14 @@
     }
 
     private static synchronized TimeZone setDefaultZone() {
-        TimeZone tz = null;
+        TimeZone tz;
         // get the time zone ID from the system properties
         String zoneID = AccessController.doPrivileged(
                 new GetPropertyAction("user.timezone"));
 
         // if the time zone ID is not set (yet), perform the
         // platform to Java time zone ID mapping.
-        if (zoneID == null || zoneID.equals("")) {
+        if (zoneID == null || zoneID.isEmpty()) {
             String country = AccessController.doPrivileged(
                     new GetPropertyAction("user.country"));
             String javaHome = AccessController.doPrivileged(
@@ -670,8 +668,9 @@
         assert tz != null;
 
         final String id = zoneID;
-        AccessController.doPrivileged(new PrivilegedAction<Object>() {
-                public Object run() {
+        AccessController.doPrivileged(new PrivilegedAction<Void>() {
+            @Override
+                public Void run() {
                     System.setProperty("user.timezone", id);
                     return null;
                 }
diff --git a/src/share/classes/java/util/function/BinaryOperator.java b/src/share/classes/java/util/function/BinaryOperator.java
index 929a2de..37653b6 100644
--- a/src/share/classes/java/util/function/BinaryOperator.java
+++ b/src/share/classes/java/util/function/BinaryOperator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * 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
diff --git a/src/share/classes/java/util/function/Block.java b/src/share/classes/java/util/function/Block.java
index 6b28d18..e468396 100644
--- a/src/share/classes/java/util/function/Block.java
+++ b/src/share/classes/java/util/function/Block.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * 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
diff --git a/src/share/classes/java/util/function/DoubleBlock.java b/src/share/classes/java/util/function/DoubleBlock.java
index 80574de..d5abd87 100644
--- a/src/share/classes/java/util/function/DoubleBlock.java
+++ b/src/share/classes/java/util/function/DoubleBlock.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * 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
diff --git a/src/share/classes/java/util/function/Function.java b/src/share/classes/java/util/function/Function.java
index a651362..ce8ab1e 100644
--- a/src/share/classes/java/util/function/Function.java
+++ b/src/share/classes/java/util/function/Function.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * 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
diff --git a/src/share/classes/java/util/function/IntBlock.java b/src/share/classes/java/util/function/IntBlock.java
index 27f44d6..e016316 100644
--- a/src/share/classes/java/util/function/IntBlock.java
+++ b/src/share/classes/java/util/function/IntBlock.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * 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
diff --git a/src/share/classes/java/util/function/LongBlock.java b/src/share/classes/java/util/function/LongBlock.java
index fe1ef65..d9af366 100644
--- a/src/share/classes/java/util/function/LongBlock.java
+++ b/src/share/classes/java/util/function/LongBlock.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * 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
diff --git a/src/share/classes/java/util/function/Predicate.java b/src/share/classes/java/util/function/Predicate.java
index 4fea49c..f4e6196 100644
--- a/src/share/classes/java/util/function/Predicate.java
+++ b/src/share/classes/java/util/function/Predicate.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * 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
diff --git a/src/share/classes/java/util/logging/LogManager.java b/src/share/classes/java/util/logging/LogManager.java
index 8d83108..e3a8bf2 100644
--- a/src/share/classes/java/util/logging/LogManager.java
+++ b/src/share/classes/java/util/logging/LogManager.java
@@ -31,10 +31,10 @@
 import java.security.*;
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.WeakReference;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeEvent;
-import java.net.URL;
-import sun.security.action.GetPropertyAction;
 
 /**
  * There is a single global LogManager object that is used to
@@ -150,7 +150,7 @@
 
     // The map of the registered listeners. The map value is the registration
     // count to allow for cases where the same listener is registered many times.
-    private final Map<PropertyChangeListener,Integer> listenerMap = new HashMap<>();
+    private final Map<Object,Integer> listenerMap = new HashMap<>();
 
     // Table of named Loggers that maps names to Loggers.
     private Hashtable<String,LoggerWeakRef> namedLoggers = new Hashtable<>();
@@ -243,7 +243,7 @@
      * Protected constructor.  This is protected so that container applications
      * (such as J2EE containers) can subclass the object.  It is non-public as
      * it is intended that there only be one LogManager object, whose value is
-     * retrieved by calling Logmanager.getLogManager.
+     * retrieved by calling LogManager.getLogManager.
      */
     protected LogManager() {
         // Add a shutdown hook to close the global handlers.
@@ -971,22 +971,24 @@
         // Notify any interested parties that our properties have changed.
         // We first take a copy of the listener map so that we aren't holding any
         // locks when calling the listeners.
-        Map<PropertyChangeListener,Integer> listeners = null;
+        Map<Object,Integer> listeners = null;
         synchronized (listenerMap) {
             if (!listenerMap.isEmpty())
                 listeners = new HashMap<>(listenerMap);
         }
         if (listeners != null) {
-            PropertyChangeEvent ev = new PropertyChangeEvent(LogManager.class, null, null, null);
-            for (Map.Entry<PropertyChangeListener,Integer> entry : listeners.entrySet()) {
-                PropertyChangeListener listener = entry.getKey();
+            assert Beans.isBeansPresent();
+            Object ev = Beans.newPropertyChangeEvent(LogManager.class, null, null, null);
+            for (Map.Entry<Object,Integer> entry : listeners.entrySet()) {
+                Object listener = entry.getKey();
                 int count = entry.getValue().intValue();
                 for (int i = 0; i < count; i++) {
-                    listener.propertyChange(ev);
+                    Beans.invokePropertyChange(listener, ev);
                 }
             }
         }
 
+
         // Note that we need to reinitialize global handles when
         // they are first referenced.
         synchronized (this) {
@@ -1269,4 +1271,100 @@
         return loggingMXBean;
     }
 
+    /**
+     * A class that provides access to the java.beans.PropertyChangeListener
+     * and java.beans.PropertyChangeEvent without creating a static dependency
+     * on java.beans. This class can be removed once the addPropertyChangeListener
+     * and removePropertyChangeListener methods are removed.
+     */
+    private static class Beans {
+        private static final Class<?> propertyChangeListenerClass =
+            getClass("java.beans.PropertyChangeListener");
+
+        private static final Class<?> propertyChangeEventClass =
+            getClass("java.beans.PropertyChangeEvent");
+
+        private static final Method propertyChangeMethod =
+            getMethod(propertyChangeListenerClass,
+                      "propertyChange",
+                      propertyChangeEventClass);
+
+        private static final Constructor<?> propertyEventCtor =
+            getConstructor(propertyChangeEventClass,
+                           Object.class,
+                           String.class,
+                           Object.class,
+                           Object.class);
+
+        private static Class<?> getClass(String name) {
+            try {
+                return Class.forName(name, true, Beans.class.getClassLoader());
+            } catch (ClassNotFoundException e) {
+                return null;
+            }
+        }
+        private static Constructor<?> getConstructor(Class<?> c, Class<?>... types) {
+            try {
+                return (c == null) ? null : c.getDeclaredConstructor(types);
+            } catch (NoSuchMethodException x) {
+                throw new AssertionError(x);
+            }
+        }
+
+        private static Method getMethod(Class<?> c, String name, Class<?>... types) {
+            try {
+                return (c == null) ? null : c.getMethod(name, types);
+            } catch (NoSuchMethodException e) {
+                throw new AssertionError(e);
+            }
+        }
+
+        /**
+         * Returns {@code true} if java.beans is present.
+         */
+        static boolean isBeansPresent() {
+            return propertyChangeListenerClass != null &&
+                   propertyChangeEventClass != null;
+        }
+
+        /**
+         * Returns a new PropertyChangeEvent with the given source, property
+         * name, old and new values.
+         */
+        static Object newPropertyChangeEvent(Object source, String prop,
+                                             Object oldValue, Object newValue)
+        {
+            try {
+                return propertyEventCtor.newInstance(source, prop, oldValue, newValue);
+            } catch (InstantiationException | IllegalAccessException x) {
+                throw new AssertionError(x);
+            } catch (InvocationTargetException x) {
+                Throwable cause = x.getCause();
+                if (cause instanceof Error)
+                    throw (Error)cause;
+                if (cause instanceof RuntimeException)
+                    throw (RuntimeException)cause;
+                throw new AssertionError(x);
+            }
+        }
+
+        /**
+         * Invokes the given PropertyChangeListener's propertyChange method
+         * with the given event.
+         */
+        static void invokePropertyChange(Object listener, Object ev) {
+            try {
+                propertyChangeMethod.invoke(listener, ev);
+            } catch (IllegalAccessException x) {
+                throw new AssertionError(x);
+            } catch (InvocationTargetException x) {
+                Throwable cause = x.getCause();
+                if (cause instanceof Error)
+                    throw (Error)cause;
+                if (cause instanceof RuntimeException)
+                    throw (RuntimeException)cause;
+                throw new AssertionError(x);
+            }
+        }
+    }
 }
diff --git a/src/share/classes/java/util/spi/CalendarNameProvider.java b/src/share/classes/java/util/spi/CalendarNameProvider.java
index 20122cf..8e8d54e 100644
--- a/src/share/classes/java/util/spi/CalendarNameProvider.java
+++ b/src/share/classes/java/util/spi/CalendarNameProvider.java
@@ -174,7 +174,8 @@
      * <p>{@code style} gives the style of the string representation. It is one
      * of {@link Calendar#SHORT_FORMAT} ({@link Calendar#SHORT SHORT}),
      * {@link Calendar#SHORT_STANDALONE}, {@link Calendar#LONG_FORMAT}
-     * ({@link Calendar#LONG LONG}), or {@link Calendar#LONG_STANDALONE}.
+     * ({@link Calendar#LONG LONG}), {@link Calendar#LONG_STANDALONE},
+     * {@link Calendar#NARROW_FORMAT}, or {@link Calendar#NARROW_STANDALONE}.
      *
      * <p>For example, the following call will return {@code "Sunday"}.
      * <pre>
@@ -195,8 +196,10 @@
      *              the string representation style: one of {@link
      *              Calendar#SHORT_FORMAT} ({@link Calendar#SHORT SHORT}),
      *              {@link Calendar#SHORT_STANDALONE}, {@link
-     *              Calendar#LONG_FORMAT} ({@link Calendar#LONG LONG}), or
-     *              {@link Calendar#LONG_STANDALONE}
+     *              Calendar#LONG_FORMAT} ({@link Calendar#LONG LONG}),
+     *              {@link Calendar#LONG_STANDALONE},
+     *              {@link Calendar#NARROW_FORMAT},
+     *              or {@link Calendar#NARROW_STANDALONE}
      * @param locale
      *              the desired locale
      * @return the string representation of the {@code field value}, or {@code
@@ -226,8 +229,11 @@
      * <p>{@code style} gives the style of the string representation. It must be
      * one of {@link Calendar#ALL_STYLES}, {@link Calendar#SHORT_FORMAT} ({@link
      * Calendar#SHORT SHORT}), {@link Calendar#SHORT_STANDALONE}, {@link
-     * Calendar#LONG_FORMAT} ({@link Calendar#LONG LONG}), or {@link
-     * Calendar#LONG_STANDALONE}.
+     * Calendar#LONG_FORMAT} ({@link Calendar#LONG LONG}), {@link
+     * Calendar#LONG_STANDALONE}, {@link Calendar#NARROW_FORMAT}, or
+     * {@link Calendar#NARROW_STANDALONE}. Note that narrow names may
+     * not be unique due to use of single characters, such as "S" for Sunday
+     * and Saturday, and that no narrow names are included in that case.
      *
      * <p>For example, the following call will return a {@code Map} containing
      * {@code "January"} to {@link Calendar#JANUARY}, {@code "Jan"} to {@link
@@ -247,8 +253,9 @@
      *              {@link Calendar#ALL_STYLES}, {@link Calendar#SHORT_FORMAT}
      *              ({@link Calendar#SHORT SHORT}), {@link
      *              Calendar#SHORT_STANDALONE}, {@link Calendar#LONG_FORMAT}
-     *              ({@link Calendar#LONG LONG}), or {@link
-     *              Calendar#LONG_STANDALONE}.
+     *              ({@link Calendar#LONG LONG}), {@link Calendar#LONG_STANDALONE},
+     *              {@link Calendar#NARROW_FORMAT},
+     *              or {@link Calendar#NARROW_STANDALONE}
      * @param locale
      *              the desired locale
      * @return a {@code Map} containing all display names of {@code field} in
diff --git a/src/share/classes/java/util/spi/TimeZoneNameProvider.java b/src/share/classes/java/util/spi/TimeZoneNameProvider.java
index 730b507..766c4e3 100644
--- a/src/share/classes/java/util/spi/TimeZoneNameProvider.java
+++ b/src/share/classes/java/util/spi/TimeZoneNameProvider.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -77,4 +77,34 @@
      * @see java.util.TimeZone#getDisplayName(boolean, int, java.util.Locale)
      */
     public abstract String getDisplayName(String ID, boolean daylight, int style, Locale locale);
+
+    /**
+     * Returns a generic name for the given time zone {@code ID} that's suitable
+     * for presentation to the user in the specified {@code locale}. Generic
+     * time zone names are neutral from standard time and daylight saving
+     * time. For example, "PT" is the short generic name of time zone ID {@code
+     * America/Los_Angeles}, while its short standard time and daylight saving
+     * time names are "PST" and "PDT", respectively. Refer to
+     * {@link #getDisplayName(String, boolean, int, Locale) getDisplayName}
+     * for valid time zone IDs.
+     *
+     * <p>The default implementation of this method returns {@code null}.
+     *
+     * @param ID a time zone ID string
+     * @param style either {@link java.util.TimeZone#LONG TimeZone.LONG} or
+     *    {@link java.util.TimeZone#SHORT TimeZone.SHORT}
+     * @param locale the desired locale
+     * @return the human-readable generic name of the given time zone in the
+     *     given locale, or {@code null} if it's not available.
+     * @exception IllegalArgumentException if <code>style</code> is invalid,
+     *     or <code>locale</code> isn't one of the locales returned from
+     *     {@link LocaleServiceProvider#getAvailableLocales()
+     *     getAvailableLocales()}.
+     * @exception NullPointerException if <code>ID</code> or <code>locale</code>
+     *     is {@code null}
+     * @since 1.8
+     */
+    public String getGenericDisplayName(String ID, int style, Locale locale) {
+        return null;
+    }
 }
diff --git a/src/share/classes/javax/net/ssl/KeyManagerFactory.java b/src/share/classes/javax/net/ssl/KeyManagerFactory.java
index f9611c0..1fc94ee 100644
--- a/src/share/classes/javax/net/ssl/KeyManagerFactory.java
+++ b/src/share/classes/javax/net/ssl/KeyManagerFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -53,17 +53,13 @@
      * Obtains the default KeyManagerFactory algorithm name.
      *
      * <p>The default algorithm can be changed at runtime by setting
-     * the value of the "ssl.KeyManagerFactory.algorithm" security
-     * property (set in the Java security properties file or by calling
-     * {@link java.security.Security#setProperty(java.lang.String,
-     * java.lang.String)})
-     * to the desired algorithm name.
+     * the value of the {@code ssl.KeyManagerFactory.algorithm}
+     * security property to the desired algorithm name.
      *
-     * @see java.security.Security#setProperty(java.lang.String,
-     *          java.lang.String)
-     * @return the default algorithm name as specified in the
-     *          Java security properties, or an implementation-specific
-     *          default if no such property exists.
+     * @see java.security.Security security properties
+     * @return the default algorithm name as specified by the
+     *          {@code ssl.KeyManagerFactory.algorithm} security property, or an
+     *          implementation-specific default if no such property exists.
      */
     public final static String getDefaultAlgorithm() {
         String type;
diff --git a/src/share/classes/javax/net/ssl/TrustManagerFactory.java b/src/share/classes/javax/net/ssl/TrustManagerFactory.java
index 91b6a0e..a8a5008 100644
--- a/src/share/classes/javax/net/ssl/TrustManagerFactory.java
+++ b/src/share/classes/javax/net/ssl/TrustManagerFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -53,14 +53,13 @@
      * Obtains the default TrustManagerFactory algorithm name.
      *
      * <p>The default TrustManager can be changed at runtime by setting
-     * the value of the "ssl.TrustManagerFactory.algorithm" security
-     * property (set in the Java security properties file or by calling
-     * {@link java.security.Security#setProperty(String, String) })
-     * to the desired algorithm name.
+     * the value of the {@code ssl.TrustManagerFactory.algorithm}
+     * security property to the desired algorithm name.
      *
-     * @return the default algorithm name as specified in the
-     * Java security properties, or an implementation-specific default
-     * if no such property exists.
+     * @see java.security.Security security properties
+     * @return the default algorithm name as specified by the
+     * {@code ssl.TrustManagerFactory.algorithm} security property, or an
+     * implementation-specific default if no such property exists.
      */
     public final static String getDefaultAlgorithm() {
         String type;
diff --git a/src/share/classes/javax/security/auth/Policy.java b/src/share/classes/javax/security/auth/Policy.java
index 88264b3..5fd27ee 100644
--- a/src/share/classes/javax/security/auth/Policy.java
+++ b/src/share/classes/javax/security/auth/Policy.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -126,14 +126,9 @@
  * are rejected.  Such permission must be listed in the
  * <code>java.security.Policy</code>.
  *
- * <p> The default <code>Policy</code> implementation can be changed by
- * setting the value of the "auth.policy.provider" security property
- * (in the Java security properties file) to the fully qualified name of
- * the desired <code>Policy</code> implementation class.
- * The Java security properties file is located in the file named
- * &lt;JAVA_HOME&gt;/lib/security/java.security.
- * &lt;JAVA_HOME&gt; refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
+ * <p> The default {@code Policy} implementation can be changed by
+ * setting the value of the {@code auth.policy.provider} security property to
+ * the fully qualified name of the desired {@code Policy} implementation class.
  *
  * @deprecated  as of JDK version 1.4 -- Replaced by java.security.Policy.
  *              java.security.Policy has a method:
@@ -154,7 +149,7 @@
  * These two APIs provide callers the means to query the
  * Policy for Principal-based Permission entries.
  *
- *
+ * @see java.security.Security security properties
  */
 @Deprecated
 public abstract class Policy {
diff --git a/src/share/classes/javax/security/auth/callback/CallbackHandler.java b/src/share/classes/javax/security/auth/callback/CallbackHandler.java
index f49b1c4..4c6e9a2 100644
--- a/src/share/classes/javax/security/auth/callback/CallbackHandler.java
+++ b/src/share/classes/javax/security/auth/callback/CallbackHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -49,13 +49,9 @@
  * can then choose to prompt for a username and password serially,
  * or to prompt for both in a single window.
  *
- * <p> A default <code>CallbackHandler</code> class implementation
- * may be specified in the <i>auth.login.defaultCallbackHandler</i>
- * security property.  The security property can be set
- * in the Java security properties file located in the file named
- * &lt;JAVA_HOME&gt;/lib/security/java.security.
- * &lt;JAVA_HOME&gt; refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
+ * <p> A default {@code CallbackHandler} class implementation
+ * may be specified by setting the value of the
+ * {@code auth.login.defaultCallbackHandler} security property.
  *
  * <p> If the security property is set to the fully qualified name of a
  * <code>CallbackHandler</code> implementation class,
@@ -67,6 +63,7 @@
  * <p> All default handler implementations must provide a public
  * zero-argument constructor.
  *
+ * @see java.security.Security security properties
  */
 public interface CallbackHandler {
 
diff --git a/src/share/classes/javax/security/auth/login/Configuration.java b/src/share/classes/javax/security/auth/login/Configuration.java
index 988dc1a..ddfdd0a 100644
--- a/src/share/classes/javax/security/auth/login/Configuration.java
+++ b/src/share/classes/javax/security/auth/login/Configuration.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -173,12 +173,8 @@
  * Configuration implementation (a default subclass implementation of this
  * abstract class).
  * The default Configuration implementation can be changed by setting the value
- * of the "login.configuration.provider" security property (in the Java
- * security properties file) to the fully qualified name of the desired
- * Configuration subclass implementation.  The Java security properties file
- * is located in the file named &lt;JAVA_HOME&gt;/lib/security/java.security.
- * &lt;JAVA_HOME&gt; refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
+ * of the {@code login.configuration.provider} security property to the fully
+ * qualified name of the desired Configuration subclass implementation.
  *
  * <p> Application code can directly subclass Configuration to provide a custom
  * implementation.  In addition, an instance of a Configuration object can be
@@ -190,6 +186,7 @@
  * for a list of standard Configuration types.
  *
  * @see javax.security.auth.login.LoginContext
+ * @see java.security.Security security properties
  */
 public abstract class Configuration {
 
diff --git a/src/share/classes/javax/security/auth/login/LoginContext.java b/src/share/classes/javax/security/auth/login/LoginContext.java
index f3b1d96..e3729d2 100644
--- a/src/share/classes/javax/security/auth/login/LoginContext.java
+++ b/src/share/classes/javax/security/auth/login/LoginContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -163,9 +163,9 @@
  * input parameter, or if the caller specifies a <code>null</code>
  * CallbackHandler object (and a <code>null</code> value is permitted),
  * the LoginContext queries the
- * <i>auth.login.defaultCallbackHandler</i> security property
- * for the fully qualified class name of a default handler implementation.
- * If the security property is not set,
+ * {@code auth.login.defaultCallbackHandler} security property for the
+ * fully qualified class name of a default handler
+ * implementation. If the security property is not set,
  * then the underlying modules will not have a
  * CallbackHandler for use in communicating
  * with users.  The caller thus assumes that the configured
@@ -184,21 +184,13 @@
  * </ul>
  * </ol>
  *
- * <p> Note that Security Properties
- * (such as <code>auth.login.defaultCallbackHandler</code>)
- * can be set programmatically via the
- * <code>java.security.Security</code> class,
- * or statically in the Java security properties file located in the
- * file named &lt;JAVA_HOME&gt;/lib/security/java.security.
- * &lt;JAVA_HOME&gt; refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
- *
  * @see java.security.Security
  * @see javax.security.auth.AuthPermission
  * @see javax.security.auth.Subject
  * @see javax.security.auth.callback.CallbackHandler
  * @see javax.security.auth.login.Configuration
  * @see javax.security.auth.spi.LoginModule
+ * @see java.security.Security security properties
  */
 public class LoginContext {
 
diff --git a/src/share/classes/javax/security/cert/X509Certificate.java b/src/share/classes/javax/security/cert/X509Certificate.java
index 8a18b05..1f5af7e 100644
--- a/src/share/classes/javax/security/cert/X509Certificate.java
+++ b/src/share/classes/javax/security/cert/X509Certificate.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -96,21 +96,17 @@
  * </pre>
  * <p>
  * In either case, the code that instantiates an X.509 certificate
- * consults the Java security properties file to locate the actual
- * implementation or instantiates a default implementation.
+ * consults the value of the {@code cert.provider.x509v1} security property
+ * to locate the actual implementation or instantiates a default implementation.
  * <p>
- * The Java security properties file is located in the file named
- * &lt;JAVA_HOME&gt;/lib/security/java.security.
- * &lt;JAVA_HOME&gt; refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
- * In the Security properties file, a default implementation
- * for X.509 v1 may be given such as:
+ * The {@code cert.provider.x509v1} property is set to a default
+ * implementation for X.509 such as:
  * <pre>
  * cert.provider.x509v1=com.sun.security.cert.internal.x509.X509V1CertImpl
  * </pre>
  * <p>
- * The value of this <code>cert.provider.x509v1</code> property has to be
- * changed to instatiate another implementation. If this security
+ * The value of this {@code cert.provider.x509v1} property has to be
+ * changed to instantiate another implementation. If this security
  * property is not set, a default implementation will be used.
  * Currently, due to possible security restrictions on access to
  * Security properties, this value is looked up and cached at class
@@ -127,6 +123,7 @@
  * @since 1.4
  * @see Certificate
  * @see java.security.cert.X509Extension
+ * @see java.security.Security security properties
  */
 public abstract class X509Certificate extends Certificate {
 
@@ -156,8 +153,7 @@
      * the data read from the input stream <code>inStream</code>.
      * The implementation (X509Certificate is an abstract class) is
      * provided by the class specified as the value of the
-     * <code>cert.provider.x509v1</code>
-     * property in the security properties file.
+     * {@code cert.provider.x509v1} security property.
      *
      * <p>Note: Only one DER-encoded
      * certificate is expected to be in the input stream.
@@ -184,8 +180,7 @@
      * the specified byte array.
      * The implementation (X509Certificate is an abstract class) is
      * provided by the class specified as the value of the
-     * <code>cert.provider.x509v1</code>
-     * property in the security properties file.
+     * {@code cert.provider.x509v1} security property.
      *
      * <p>Note: All X509Certificate
      * subclasses must provide a constructor of the form:
diff --git a/src/share/classes/javax/sql/rowset/serial/SerialArray.java b/src/share/classes/javax/sql/rowset/serial/SerialArray.java
index 8c07d2e..3d3926c 100644
--- a/src/share/classes/javax/sql/rowset/serial/SerialArray.java
+++ b/src/share/classes/javax/sql/rowset/serial/SerialArray.java
@@ -31,6 +31,7 @@
 import java.net.URL;
 import java.util.Arrays;
 
+
 /**
  * A serialized version of an <code>Array</code>
  * object, which is the mapping in the Java programming language of an SQL
@@ -41,44 +42,52 @@
  * methods for getting the base type and the SQL name for the base type, and
  * methods for copying all or part of a <code>SerialArray</code> object.
  * <P>
+ *
  * Note: In order for this class to function correctly, a connection to the
  * data source
  * must be available in order for the SQL <code>Array</code> object to be
  * materialized (have all of its elements brought to the client server)
  * if necessary. At this time, logical pointers to the data in the data source,
  * such as locators, are not currently supported.
+ *
+ * <h4> Thread safety </h4>
+ *
+ * A SerialArray is not safe for use by multiple concurrent threads.  If a
+ * SerialArray is to be used by more than one thread then access to the
+ * SerialArray should be controlled by appropriate synchronization.
+ *
  */
 public class SerialArray implements Array, Serializable, Cloneable {
 
-        /**
-         * A serialized array in which each element is an <code>Object</code>
-         * in the Java programming language that represents an element
-         * in the SQL <code>ARRAY</code> value.
-         * @serial
-         */
+    /**
+     * A serialized array in which each element is an <code>Object</code>
+     * in the Java programming language that represents an element
+     * in the SQL <code>ARRAY</code> value.
+     * @serial
+     */
     private Object[] elements;
 
-        /**
-         * The SQL type of the elements in this <code>SerialArray</code> object.  The
-         * type is expressed as one of the constants from the class
-         * <code>java.sql.Types</code>.
-         * @serial
-         */
+    /**
+     * The SQL type of the elements in this <code>SerialArray</code> object.  The
+     * type is expressed as one of the constants from the class
+     * <code>java.sql.Types</code>.
+     * @serial
+     */
     private int baseType;
 
-        /**
-         * The type name used by the DBMS for the elements in the SQL <code>ARRAY</code>
-         * value that this <code>SerialArray</code> object represents.
-         * @serial
-         */
+    /**
+     * The type name used by the DBMS for the elements in the SQL <code>ARRAY</code>
+     * value that this <code>SerialArray</code> object represents.
+     * @serial
+     */
     private String baseTypeName;
 
-        /**
-         * The number of elements in this <code>SerialArray</code> object, which
-         * is also the number of elements in the SQL <code>ARRAY</code> value
-         * that this <code>SerialArray</code> object represents.
-         * @serial
-         */
+    /**
+     * The number of elements in this <code>SerialArray</code> object, which
+     * is also the number of elements in the SQL <code>ARRAY</code> value
+     * that this <code>SerialArray</code> object represents.
+     * @serial
+     */
     private int len;
 
     /**
@@ -192,24 +201,19 @@
   }
 
     /**
-     * This method frees the <code>Array</code> object and releases the resources that
-     * it holds. The object is invalid once the <code>free</code>
-     * method is called.
-     *<p>
-     * After <code>free</code> has been called, any attempt to invoke a
-     * method other than <code>free</code> will result in a <code>SQLException</code>
-     * being thrown.  If <code>free</code> is called multiple times, the subsequent
-     * calls to <code>free</code> are treated as a no-op.
-     *<p>
+     * This method frees the {@code SeriableArray} object and releases the
+     * resources that it holds. The object is invalid once the {@code free}
+     * method is called. <p> If {@code free} is called multiple times, the
+     * subsequent calls to {@code free} are treated as a no-op. </P>
      *
-     * @throws SQLException if an error occurs releasing
-     * the Array's resources
-     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
-     * this method
+     * @throws SQLException if an error occurs releasing the SerialArray's resources
      * @since 1.6
      */
     public void free() throws SQLException {
-         throw new SQLFeatureNotSupportedException("Feature not supported");
+        if (elements != null) {
+            elements = null;
+            baseTypeName= null;
+        }
     }
 
     /**
@@ -292,129 +296,140 @@
 
     }
 
-        /**
-         * Returns a new array that is a copy of this <code>SerialArray</code>
-         * object.
-         *
-         * @return a copy of this <code>SerialArray</code> object as an
-         *         <code>Object</code> in the Java programming language
-         * @throws SerialException if an error occurs retrieving a copy of
-     *         this <code>SerialArray</code> object
-         */
+    /**
+     * Returns a new array that is a copy of this <code>SerialArray</code>
+     * object.
+     *
+     * @return a copy of this <code>SerialArray</code> object as an
+     *         <code>Object</code> in the Java programming language
+     * @throws SerialException if an error occurs;
+     * if {@code free} had previously been called on this object
+     */
     public Object getArray() throws SerialException {
+        isValid();
         Object dst = new Object[len];
         System.arraycopy((Object)elements, 0, dst, 0, len);
         return dst;
     }
 
  //[if an error occurstype map used??]
-        /**
-         * Returns a new array that is a copy of this <code>SerialArray</code>
-         * object, using the given type map for the custom
-         * mapping of each element when the elements are SQL UDTs.
-         * <P>
-         * This method does custom mapping if the array elements are a UDT
-         * and the given type map has an entry for that UDT.
+    /**
+     * Returns a new array that is a copy of this <code>SerialArray</code>
+     * object, using the given type map for the custom
+     * mapping of each element when the elements are SQL UDTs.
+     * <P>
+     * This method does custom mapping if the array elements are a UDT
+     * and the given type map has an entry for that UDT.
      * Custom mapping is recursive,
-         * meaning that if, for instance, an element of an SQL structured type
-         * is an SQL structured type that itself has an element that is an SQL
-         * structured type, each structured type that has a custom mapping will be
-         * mapped according to the given type map.
-         *
+     * meaning that if, for instance, an element of an SQL structured type
+     * is an SQL structured type that itself has an element that is an SQL
+     * structured type, each structured type that has a custom mapping will be
+     * mapped according to the given type map.
+     *
      * @param map a <code>java.util.Map</code> object in which
      *        each entry consists of 1) a <code>String</code> object
      *        giving the fully qualified name of a UDT and 2) the
      *        <code>Class</code> object for the <code>SQLData</code> implementation
      *        that defines how the UDT is to be mapped
-         * @return a copy of this <code>SerialArray</code> object as an
-         *         <code>Object</code> in the Java programming language
-         * @throws SerialException if an error occurs
-         */
+     * @return a copy of this <code>SerialArray</code> object as an
+     *         <code>Object</code> in the Java programming language
+     * @throws SerialException if an error occurs;
+     * if {@code free} had previously been called on this object
+     */
     public Object getArray(Map<String, Class<?>> map) throws SerialException {
+        isValid();
         Object dst[] = new Object[len];
         System.arraycopy((Object)elements, 0, dst, 0, len);
         return dst;
     }
 
-        /**
-         * Returns a new array that is a copy of a slice
-         * of this <code>SerialArray</code> object, starting with the
-         * element at the given index and containing the given number
-         * of consecutive elements.
-         *
-         * @param index the index into this <code>SerialArray</code> object
-         *              of the first element to be copied;
-         *              the index of the first element is <code>0</code>
-         * @param count the number of consecutive elements to be copied, starting
-         *              at the given index
-         * @return a copy of the designated elements in this <code>SerialArray</code>
-         *         object as an <code>Object</code> in the Java programming language
-         * @throws SerialException if an error occurs
-         */
+    /**
+     * Returns a new array that is a copy of a slice
+     * of this <code>SerialArray</code> object, starting with the
+     * element at the given index and containing the given number
+     * of consecutive elements.
+     *
+     * @param index the index into this <code>SerialArray</code> object
+     *              of the first element to be copied;
+     *              the index of the first element is <code>0</code>
+     * @param count the number of consecutive elements to be copied, starting
+     *              at the given index
+     * @return a copy of the designated elements in this <code>SerialArray</code>
+     *         object as an <code>Object</code> in the Java programming language
+     * @throws SerialException if an error occurs;
+     * if {@code free} had previously been called on this object
+     */
     public Object getArray(long index, int count) throws SerialException {
+        isValid();
         Object dst = new Object[count];
         System.arraycopy((Object)elements, (int)index, dst, 0, count);
         return dst;
     }
 
-        /**
-         * Returns a new array that is a copy of a slice
-         * of this <code>SerialArray</code> object, starting with the
-         * element at the given index and containing the given number
-         * of consecutive elements.
-         * <P>
-         * This method does custom mapping if the array elements are a UDT
-         * and the given type map has an entry for that UDT.
+    /**
+     * Returns a new array that is a copy of a slice
+     * of this <code>SerialArray</code> object, starting with the
+     * element at the given index and containing the given number
+     * of consecutive elements.
+     * <P>
+     * This method does custom mapping if the array elements are a UDT
+     * and the given type map has an entry for that UDT.
      * Custom mapping is recursive,
-         * meaning that if, for instance, an element of an SQL structured type
-         * is an SQL structured type that itself has an element that is an SQL
-         * structured type, each structured type that has a custom mapping will be
-         * mapped according to the given type map.
-         *
-         * @param index the index into this <code>SerialArray</code> object
-         *              of the first element to be copied; the index of the
-         *              first element in the array is <code>0</code>
-         * @param count the number of consecutive elements to be copied, starting
-         *              at the given index
+     * meaning that if, for instance, an element of an SQL structured type
+     * is an SQL structured type that itself has an element that is an SQL
+     * structured type, each structured type that has a custom mapping will be
+     * mapped according to the given type map.
+     *
+     * @param index the index into this <code>SerialArray</code> object
+     *              of the first element to be copied; the index of the
+     *              first element in the array is <code>0</code>
+     * @param count the number of consecutive elements to be copied, starting
+     *              at the given index
      * @param map a <code>java.util.Map</code> object in which
      *        each entry consists of 1) a <code>String</code> object
      *        giving the fully qualified name of a UDT and 2) the
      *        <code>Class</code> object for the <code>SQLData</code> implementation
      *        that defines how the UDT is to be mapped
-         * @return a copy of the designated elements in this <code>SerialArray</code>
-         *         object as an <code>Object</code> in the Java programming language
-         * @throws SerialException if an error occurs
-         */
+     * @return a copy of the designated elements in this <code>SerialArray</code>
+     *         object as an <code>Object</code> in the Java programming language
+     * @throws SerialException if an error occurs;
+     * if {@code free} had previously been called on this object
+     */
     public Object getArray(long index, int count, Map<String,Class<?>> map)
         throws SerialException
     {
+        isValid();
         Object dst = new Object[count];
         System.arraycopy((Object)elements, (int)index, dst, 0, count);
         return dst;
     }
 
-        /**
-         * Retrieves the SQL type of the elements in this <code>SerialArray</code>
-         * object.  The <code>int</code> returned is one of the constants in the class
-         * <code>java.sql.Types</code>.
-         *
-         * @return one of the constants in <code>java.sql.Types</code>, indicating
-         *         the SQL type of the elements in this <code>SerialArray</code> object
-         * @throws SerialException if an error occurs
-         */
+    /**
+     * Retrieves the SQL type of the elements in this <code>SerialArray</code>
+     * object.  The <code>int</code> returned is one of the constants in the class
+     * <code>java.sql.Types</code>.
+     *
+     * @return one of the constants in <code>java.sql.Types</code>, indicating
+     *         the SQL type of the elements in this <code>SerialArray</code> object
+     * @throws SerialException if an error occurs;
+     * if {@code free} had previously been called on this object
+     */
     public int getBaseType() throws SerialException {
+        isValid();
         return baseType;
     }
 
-        /**
-         * Retrieves the DBMS-specific type name for the elements in this
-         * <code>SerialArray</code> object.
-         *
-         * @return the SQL type name used by the DBMS for the base type of this
+    /**
+     * Retrieves the DBMS-specific type name for the elements in this
+     * <code>SerialArray</code> object.
+     *
+     * @return the SQL type name used by the DBMS for the base type of this
      *         <code>SerialArray</code> object
-         * @throws SerialException if an error occurs
-         */
+     * @throws SerialException if an error occurs;
+     * if {@code free} had previously been called on this object
+     */
     public String getBaseTypeName() throws SerialException {
+        isValid();
         return baseTypeName;
     }
 
@@ -434,11 +449,13 @@
      * @return a <code>ResultSet</code> object containing the designated
      *         elements in this <code>SerialArray</code> object, with a
      *         separate row for each element
-     * @throws SerialException, which in turn throws an
-     *         <code>UnsupportedOperationException</code>, if this method is called
+     * @throws SerialException if called with the cause set to
+     *         {@code UnsupportedOperationException}
      */
     public ResultSet getResultSet(long index, int count) throws SerialException {
-        throw new UnsupportedOperationException();
+        SerialException se = new SerialException();
+        se.initCause(new UnsupportedOperationException());
+        throw  se;
     }
 
     /**
@@ -461,13 +478,15 @@
      * @return a <code>ResultSet</code> object containing all of the
      *         elements in this <code>SerialArray</code> object, with a
      *         separate row for each element
-     * @throws SerialException, which in turn throws an
-     *         <code>UnsupportedOperationException</code>, if this method is called
+     * @throws SerialException if called with the cause set to
+     *         {@code UnsupportedOperationException}
      */
     public ResultSet getResultSet(Map<String, Class<?>> map)
         throws SerialException
     {
-        throw new UnsupportedOperationException();
+        SerialException se = new SerialException();
+        se.initCause(new UnsupportedOperationException());
+        throw  se;
     }
 
     /**
@@ -480,11 +499,13 @@
      * @return a <code>ResultSet</code> object containing all of the
      *         elements in this <code>SerialArray</code> object, with a
      *         separate row for each element
-     * @throws SerialException if called, which in turn throws an
-     *         <code>UnsupportedOperationException</code>, if this method is called
+     * @throws SerialException if called with the cause set to
+     *         {@code UnsupportedOperationException}
      */
     public ResultSet getResultSet() throws SerialException {
-        throw new UnsupportedOperationException();
+        SerialException se = new SerialException();
+        se.initCause(new UnsupportedOperationException());
+        throw  se;
     }
 
 
@@ -514,16 +535,19 @@
      * @return a <code>ResultSet</code> object containing the designated
      *         elements in this <code>SerialArray</code> object, with a
      *         separate row for each element
-     * @throws SerialException if called, which in turn throws an
-     *         <code>UnsupportedOperationException</code>
+     * @throws SerialException if called with the cause set to
+     *         {@code UnsupportedOperationException}
      */
     public ResultSet getResultSet(long index, int count,
                                   Map<String,Class<?>> map)
         throws SerialException
     {
-        throw new UnsupportedOperationException();
+        SerialException se = new SerialException();
+        se.initCause(new UnsupportedOperationException());
+        throw  se;
     }
 
+
     /**
      * Compares this SerialArray to the specified object.  The result is {@code
      * true} if and only if the argument is not {@code null} and is a {@code
@@ -566,12 +590,12 @@
      * reference to a clone of the underlying objects array, not a reference
      * to the original underlying object array of this {@code SerialArray} object.
      *
-     * @return  a clone of this SerialArray
+     * @return a clone of this SerialArray
      */
     public Object clone() {
         try {
             SerialArray sa = (SerialArray) super.clone();
-            sa.elements = Arrays.copyOf(elements, len);
+            sa.elements = (elements != null) ? Arrays.copyOf(elements, len) : null;
             return sa;
         } catch (CloneNotSupportedException ex) {
             // this shouldn't happen, since we are Cloneable
@@ -616,6 +640,19 @@
     }
 
     /**
+     * Check to see if this object had previously had its {@code free} method
+     * called
+     *
+     * @throws SerialException
+     */
+    private void isValid() throws SerialException {
+        if (elements == null) {
+            throw new SerialException("Error: You cannot call a method on a "
+                    + "SerialArray instance once free() has been called.");
+        }
+    }
+
+    /**
      * The identifier that assists in the serialization of this <code>SerialArray</code>
      * object.
      */
diff --git a/src/share/classes/javax/sql/rowset/serial/SerialBlob.java b/src/share/classes/javax/sql/rowset/serial/SerialBlob.java
index 7b3c363..e7bdbcf 100644
--- a/src/share/classes/javax/sql/rowset/serial/SerialBlob.java
+++ b/src/share/classes/javax/sql/rowset/serial/SerialBlob.java
@@ -51,6 +51,12 @@
  * <code>Blob</code> object within a <code>SerialBlob</code> object
  * and to update or truncate a <code>Blob</code> object.
  *
+ * <h4> Thread safety </h4>
+ *
+ * <p> A SerialBlob is not safe for use by multiple concurrent threads.  If a
+ * SerialBlob is to be used by more than one thread then access to the SerialBlob
+ * should be controlled by appropriate synchronization.
+ *
  * @author Jonathan Bruce
  */
 public class SerialBlob implements Blob, Serializable, Cloneable {
@@ -76,7 +82,7 @@
     private long len;
 
     /**
-     * The orginal number of bytes in this <code>SerialBlob</code> object's
+     * The original number of bytes in this <code>SerialBlob</code> object's
      * array of bytes when it was first established.
      * @serial
      */
@@ -160,9 +166,11 @@
      * @return an array of bytes that is a copy of a region of this
      *         <code>SerialBlob</code> object, starting at the given
      *         position and containing the given number of consecutive bytes
-     * @throws SerialException if the given starting position is out of bounds
+     * @throws SerialException if the given starting position is out of bounds;
+     * if {@code free} had previously been called on this object
      */
     public byte[] getBytes(long pos, int length) throws SerialException {
+        isValid();
         if (length > len) {
             length = (int)len;
         }
@@ -189,9 +197,11 @@
      *
      * @return a <code>long</code> indicating the length in bytes of this
      *         <code>SerialBlob</code> object's array of bytes
-     * @throws SerialException if an error occurs
+     * @throws SerialException if an error occurs;
+     * if {@code free} had previously been called on this object
      */
     public long length() throws SerialException {
+        isValid();
         return len;
     }
 
@@ -203,12 +213,14 @@
      *
      * @return a <code>java.io.InputStream</code> object that contains
      *         this <code>SerialBlob</code> object's array of bytes
-     * @throws SerialException if an error occurs
+     * @throws SerialException if an error occurs;
+     * if {@code free} had previously been called on this object
      * @see #setBinaryStream
      */
     public java.io.InputStream getBinaryStream() throws SerialException {
-         InputStream stream = new ByteArrayInputStream(buf);
-         return stream;
+        isValid();
+        InputStream stream = new ByteArrayInputStream(buf);
+        return stream;
     }
 
     /**
@@ -227,12 +239,14 @@
      *         position; <code>-1</code> if the pattern is not found
      *         or the given starting position is out of bounds; position
      *         numbering for the return value starts at <code>1</code>
-     * @throws SerialException if an error occurs when serializing the blob
+     * @throws SerialException if an error occurs when serializing the blob;
+     * if {@code free} had previously been called on this object
      * @throws SQLException if there is an error accessing the <code>BLOB</code>
      *         value from the database
      */
     public long position(byte[] pattern, long start)
                 throws SerialException, SQLException {
+        isValid();
         if (start < 1 || start > len) {
             return -1;
         }
@@ -270,12 +284,14 @@
      *         at the specified position; <code>-1</code> if the pattern is
      *         not found or the given starting position is out of bounds;
      *         position numbering for the return value starts at <code>1</code>
-     * @throws SerialException if an error occurs when serializing the blob
+     * @throws SerialException if an error occurs when serializing the blob;
+     * if {@code free} had previously been called on this object
      * @throws SQLException if there is an error accessing the <code>BLOB</code>
      *         value from the database
      */
     public long position(Blob pattern, long start)
        throws SerialException, SQLException {
+        isValid();
         return position(pattern.getBytes(1, (int)(pattern.length())), start);
     }
 
@@ -293,7 +309,8 @@
      * @return the number of bytes written
      * @throws SerialException if there is an error accessing the
      *     <code>BLOB</code> value; or if an invalid position is set; if an
-     *     invalid offset value is set
+     *     invalid offset value is set;
+     * if {@code free} had previously been called on this object
      * @throws SQLException if there is an error accessing the <code>BLOB</code>
      *         value from the database
      * @see #getBytes
@@ -328,7 +345,8 @@
      *     <code>BLOB</code> value; if an invalid position is set; if an
      *     invalid offset value is set; if number of bytes to be written
      *     is greater than the <code>SerialBlob</code> length; or the combined
-     *     values of the length and offset is greater than the Blob buffer
+     *     values of the length and offset is greater than the Blob buffer;
+     * if {@code free} had previously been called on this object
      * @throws SQLException if there is an error accessing the <code>BLOB</code>
      *         value from the database.
      * @see #getBytes
@@ -336,6 +354,7 @@
     public int setBytes(long pos, byte[] bytes, int offset, int length)
         throws SerialException, SQLException {
 
+        isValid();
         if (offset < 0 || offset > bytes.length) {
             throw new SerialException("Invalid offset in byte array set");
         }
@@ -378,11 +397,13 @@
      * @throws SQLException if there is an error accessing the
      *            <code>BLOB</code> value
      * @throws SerialException if the SerialBlob in not instantiated with a
-     *     <code>Blob</code> object that supports <code>setBinaryStream()</code>
+     *     <code>Blob</code> object that supports <code>setBinaryStream()</code>;
+     * if {@code free} had previously been called on this object
      * @see #getBinaryStream
      */
     public java.io.OutputStream setBinaryStream(long pos)
         throws SerialException, SQLException {
+        isValid();
         if (this.blob != null) {
             return this.blob.setBinaryStream(pos);
         } else {
@@ -400,54 +421,75 @@
      *        value that this <code>Blob</code> object represents should be
      *        truncated
      * @throws SerialException if there is an error accessing the Blob value;
-     *     or the length to truncate is greater that the SerialBlob length
+     *     or the length to truncate is greater that the SerialBlob length;
+     * if {@code free} had previously been called on this object
      */
     public void truncate(long length) throws SerialException {
 
-         if (length > len) {
-            throw new SerialException
-               ("Length more than what can be truncated");
-         } else if((int)length == 0) {
-              buf = new byte[0];
-              len = length;
-         } else {
-              len = length;
-              buf = this.getBytes(1, (int)len);
-         }
+        isValid();
+        if (length > len) {
+           throw new SerialException
+              ("Length more than what can be truncated");
+        } else if((int)length == 0) {
+             buf = new byte[0];
+             len = length;
+        } else {
+             len = length;
+             buf = this.getBytes(1, (int)len);
+        }
     }
 
 
     /**
-     * Returns an <code>InputStream</code> object that contains a partial <code>Blob</code> value,
-     * starting  with the byte specified by pos, which is length bytes in length.
+     * Returns an
+     * <code>InputStream</code> object that contains a partial
+     * {@code Blob} value, starting with the byte specified by pos, which is
+     * length bytes in length.
      *
-     * @param pos the offset to the first byte of the partial value to be retrieved.
-     *  The first byte in the <code>Blob</code> is at position 1
+     * @param pos the offset to the first byte of the partial value to be
+     * retrieved. The first byte in the {@code Blob} is at position 1
      * @param length the length in bytes of the partial value to be retrieved
-     * @return <code>InputStream</code> through which the partial <code>Blob</code> value can be read.
-     * @throws SQLException if pos is less than 1 or if pos is greater than the number of bytes
-     * in the <code>Blob</code> or if pos + length is greater than the number of bytes
-     * in the <code>Blob</code>
+     * @return
+     * <code>InputStream</code> through which the partial {@code Blob} value can
+     * be read.
+     * @throws SQLException if pos is less than 1 or if pos is greater than the
+     * number of bytes in the {@code Blob} or if pos + length is greater than
+     * the number of bytes in the {@code Blob}
+     * @throws SerialException if the {@code free} method had been previously
+     * called on this object
      *
      * @since 1.6
      */
-    public InputStream getBinaryStream(long pos,long length) throws SQLException {
-        throw new java.lang.UnsupportedOperationException("Not supported");
+    public InputStream getBinaryStream(long pos, long length) throws SQLException {
+        isValid();
+        if (pos < 1 || pos > this.length()) {
+            throw new SerialException("Invalid position in BLOB object set");
+        }
+        if (length < 1 || length > len - pos + 1) {
+            throw new SerialException("length is < 1 or pos + length >"
+                    + "total number of bytes");
+        }
+        return new ByteArrayInputStream(buf, (int) pos - 1, (int) length);
     }
 
 
     /**
-     * This method frees the <code>Blob</code> object and releases the resources that it holds.
-     * <code>Blob</code> object. The object is invalid once the <code>free</code>
-     * method is called. If <code>free</code> is called multiple times, the subsequent
-     * calls to <code>free</code> are treated as a no-op.
+     * This method frees the {@code SeriableBlob} object and releases the
+     * resources that it holds. The object is invalid once the {@code free}
+     * method is called. <p> If {@code free} is called multiple times, the
+     * subsequent calls to {@code free} are treated as a no-op. </P>
      *
-     * @throws SQLException if an error occurs releasing
-     * the Blob's resources
+     * @throws SQLException if an error occurs releasing the Blob's resources
      * @since 1.6
      */
     public void free() throws SQLException {
-        throw new java.lang.UnsupportedOperationException("Not supported");
+        if (buf != null) {
+            buf = null;
+            if (blob != null) {
+                blob.free();
+            }
+            blob = null;
+        }
     }
 
     /**
@@ -494,7 +536,7 @@
     public Object clone() {
         try {
             SerialBlob sb = (SerialBlob) super.clone();
-            sb.buf = Arrays.copyOf(buf, (int)len);
+            sb.buf =  (buf != null) ? Arrays.copyOf(buf, (int)len) : null;
             sb.blob = null;
             return sb;
         } catch (CloneNotSupportedException ex) {
@@ -541,9 +583,21 @@
     }
 
     /**
-         * The identifier that assists in the serialization of this <code>SerialBlob</code>
-     * object.
+     * Check to see if this object had previously had its {@code free} method
+     * called
+     *
+     * @throws SerialException
      */
+    private void isValid() throws SerialException {
+        if (buf == null) {
+            throw new SerialException("Error: You cannot call a method on a "
+                    + "SerialBlob instance once free() has been called.");
+        }
+    }
 
+    /**
+     * The identifier that assists in the serialization of this
+     * {@code SerialBlob} object.
+     */
     static final long serialVersionUID = -8144641928112860441L;
 }
diff --git a/src/share/classes/javax/sql/rowset/serial/SerialClob.java b/src/share/classes/javax/sql/rowset/serial/SerialClob.java
index 84bed09..6020e34 100644
--- a/src/share/classes/javax/sql/rowset/serial/SerialClob.java
+++ b/src/share/classes/javax/sql/rowset/serial/SerialClob.java
@@ -44,6 +44,11 @@
  * from a <code>SerialClob</code> object or to locate the start of
  * a pattern of characters.
  *
+ * <h4> Thread safety </h4>
+ *
+ * <p> A SerialClob is not safe for use by multiple concurrent threads.  If a
+ * SerialClob is to be used by more than one thread then access to the SerialClob
+ * should be controlled by appropriate synchronization.
  * @author Jonathan Bruce
  */
 public class SerialClob implements Clob, Serializable, Cloneable {
@@ -180,9 +185,11 @@
      *
      * @return a <code>long</code> indicating the length in characters of this
      *         <code>SerialClob</code> object's array of character
-     * @throws SerialException if an error occurs
+     * @throws SerialException if an error occurs;
+     * if {@code free} had previously been called on this object
      */
     public long length() throws SerialException {
+        isValid();
         return len;
     }
 
@@ -194,9 +201,11 @@
      *
      * @return a <code>java.io.Reader</code> object containing this
      *         <code>SerialClob</code> object's data
-     * @throws SerialException if an error occurs
+     * @throws SerialException if an error occurs;
+     * if {@code free} had previously been called on this object
      */
     public java.io.Reader getCharacterStream() throws SerialException {
+        isValid();
         return (java.io.Reader) new CharArrayReader(buf);
     }
 
@@ -210,13 +219,15 @@
      *
      * @return a <code>java.io.InputStream</code> object containing
      *     this <code>SerialClob</code> object's data
-     * @throws SerialException if this <code>SerialClob</code> object was not instantiated
-     *     with a <code>Clob</code> object
+     * @throws SerialException if this {@code SerialClob} object was not
+     * instantiated with a <code>Clob</code> object;
+     * if {@code free} had previously been called on this object
      * @throws SQLException if there is an error accessing the
-     *     <code>CLOB</code> value represented by the <code>Clob</code> object that was
-     *     used to create this <code>SerialClob</code> object
+     *     <code>CLOB</code> value represented by the <code>Clob</code> object
+     * that was used to create this <code>SerialClob</code> object
      */
     public java.io.InputStream getAsciiStream() throws SerialException, SQLException {
+        isValid();
         if (this.clob != null) {
             return this.clob.getAsciiStream();
         } else {
@@ -248,12 +259,14 @@
      *         this <code>SerialClob</code> object beginning at the
      *         given position and containing the specified number of
      *         consecutive characters
-     * @throws SerialException if either of the arguments is out of bounds
+     * @throws SerialException if either of the arguments is out of bounds;
+     * if {@code free} had previously been called on this object
      */
     public String getSubString(long pos, int length) throws SerialException {
 
+        isValid();
         if (pos < 1 || pos > this.length()) {
-            throw new SerialException("Invalid position in BLOB object set");
+            throw new SerialException("Invalid position in SerialClob object set");
         }
 
         if ((pos-1) + length > this.length()) {
@@ -287,13 +300,14 @@
      *         <code>-1</code> if the given <code>String</code> object is
      *         not found or the starting position is out of bounds; position
      *         numbering for the return value starts at <code>1</code>
-     * @throws SerialException if an error occurs locating the String signature
-     * @throws SQLException if there is an error accessing the Blob value
+     * @throws SerialException  if the {@code free} method had been
+     * previously called on this object
+     * @throws SQLException if there is an error accessing the Clob value
      *         from the database.
      */
     public long position(String searchStr, long start)
         throws SerialException, SQLException {
-
+        isValid();
         if (start < 1 || start > len) {
             return -1;
         }
@@ -332,13 +346,14 @@
      * @return the position at which the given <code>Clob</code>
      *         object begins in this <code>SerialClob</code> object,
      *         at or after the specified starting position
-     * @throws SerialException if an error occurs locating the Clob signature
-     * @throws SQLException if there is an error accessing the Blob value
+     * @throws SerialException if an error occurs locating the Clob signature;
+     * if the {@code free} method had been previously called on this object
+     * @throws SQLException if there is an error accessing the Clob value
      *         from the database
      */
     public long position(Clob searchStr, long start)
         throws SerialException, SQLException {
-
+        isValid();
         return position(searchStr.getSubString(1,(int)searchStr.length()), start);
     }
 
@@ -358,7 +373,8 @@
      *     <code>CLOB</code> value; if an invalid position is set; if an
      *     invalid offset value is set; if number of bytes to be written
      *     is greater than the <code>SerialClob</code> length; or the combined
-     *     values of the length and offset is greater than the Clob buffer
+     *     values of the length and offset is greater than the Clob buffer;
+     * if the {@code free} method had been previously called on this object
      */
     public int setString(long pos, String str) throws SerialException {
         return (setString(pos, str, 0, str.length()));
@@ -383,10 +399,12 @@
      *     <code>CLOB</code> value; if an invalid position is set; if an
      *     invalid offset value is set; if number of bytes to be written
      *     is greater than the <code>SerialClob</code> length; or the combined
-     *     values of the length and offset is greater than the Clob buffer
+     *     values of the length and offset is greater than the Clob buffer;
+     * if the {@code free} method had been previously called on this object
      */
     public int setString(long pos, String str, int offset, int length)
         throws SerialException {
+        isValid();
         String temp = str.substring(offset);
         char cPattern[] = temp.toCharArray();
 
@@ -395,7 +413,7 @@
         }
 
         if (pos < 1 || pos > this.length()) {
-            throw new SerialException("Invalid position in BLOB object set");
+            throw new SerialException("Invalid position in Clob object set");
         }
 
         if ((long)(length) > origLen) {
@@ -430,13 +448,15 @@
      *        <code>CLOB</code> object
      * @return the stream to which ASCII encoded characters can be written
      * @throws SerialException if SerialClob is not instantiated with a
-     *     Clob object that supports <code>setAsciiStream</code>
+     *     Clob object;
+     * if the {@code free} method had been previously called on this object
      * @throws SQLException if there is an error accessing the
      *     <code>CLOB</code> value
      * @see #getAsciiStream
      */
     public java.io.OutputStream setAsciiStream(long pos)
         throws SerialException, SQLException {
+        isValid();
          if (this.clob != null) {
              return this.clob.setAsciiStream(pos);
          } else {
@@ -460,13 +480,15 @@
      *
      * @return a stream to which Unicode encoded characters can be written
      * @throws SerialException if the SerialClob is not instantiated with
-     *     a Clob object that supports <code>setCharacterStream</code>
+     *     a Clob object;
+     * if the {@code free} method had been previously called on this object
      * @throws SQLException if there is an error accessing the
      *            <code>CLOB</code> value
      * @see #getCharacterStream
      */
     public java.io.Writer setCharacterStream(long pos)
         throws SerialException, SQLException {
+        isValid();
         if (this.clob != null) {
             return this.clob.setCharacterStream(pos);
         } else {
@@ -486,33 +508,80 @@
      *
      * @param length the length, in bytes, to which the <code>CLOB</code>
      *        value should be truncated
-     * @throws SQLException if there is an error accessing the
-     *        <code>CLOB</code> value
+     * @throws SerialLException if there is an error accessing the
+     *        <code>CLOB</code> value;
+     * if the {@code free} method had been previously called on this object
      */
     public void truncate(long length) throws SerialException {
-         if (length > len) {
-            throw new SerialException
-               ("Length more than what can be truncated");
-         } else {
-              len = length;
-              // re-size the buffer
+        isValid();
+        if (length > len) {
+           throw new SerialException
+              ("Length more than what can be truncated");
+        } else {
+             len = length;
+             // re-size the buffer
 
-              if (len == 0) {
-                  buf = new char[] {};
-              } else {
+             if (len == 0) {
+                buf = new char[] {};
+             } else {
                 buf = (this.getSubString(1, (int)len)).toCharArray();
-              }
-
-         }
+             }
+        }
     }
 
 
+    /**
+     * Returns a {@code Reader} object that contains a partial
+     * {@code SerialClob} value, starting
+     * with the character specified by pos, which is length characters in length.
+     *
+     * @param pos the offset to the first character of the partial value to
+     * be retrieved.  The first character in the {@code SerialClob} is at position 1.
+     * @param length the length in characters of the partial value to be retrieved.
+     * @return {@code Reader} through which the partial {@code SerialClob}
+     * value can be read.
+     * @throws SQLException if pos is less than 1 or if pos is greater than the
+     * number of characters in the {@code SerialClob} or if pos + length
+     * is greater than the number of characters in the {@code SerialClob};
+     * @throws SerialException if the {@code free} method had been previously
+     * called on this object
+     * @since 1.6
+     */
     public Reader getCharacterStream(long pos, long length) throws SQLException {
-        throw new java.lang.UnsupportedOperationException("Not supported");
+        isValid();
+        if (pos < 1 || pos > len) {
+            throw new SerialException("Invalid position in Clob object set");
+        }
+
+        if ((pos-1) + length > len) {
+            throw new SerialException("Invalid position and substring length");
+        }
+        if (length <= 0) {
+            throw new SerialException("Invalid length specified");
+        }
+        return new CharArrayReader(buf, (int)pos, (int)length);
     }
 
+    /**
+     * This method frees the {@code SeriableClob} object and releases the
+     * resources that it holds.
+     * The object is invalid once the {@code free} method is called.
+     * <p>
+     * If {@code free} is called multiple times, the subsequent
+     * calls to {@code free} are treated as a no-op.
+     * </P>
+     * @throws SQLException if an error occurs releasing
+     * the Clob's resources
+     * @since 1.6
+     */
     public void free() throws SQLException {
-        throw new java.lang.UnsupportedOperationException("Not supported");
+        if (buf != null) {
+            buf = null;
+            if (clob != null) {
+                clob.free();
+            }
+            clob = null;
+        }
     }
 
     /**
@@ -559,7 +628,7 @@
     public Object clone() {
         try {
             SerialClob sc = (SerialClob) super.clone();
-            sc.buf = Arrays.copyOf(buf, (int)len);
+            sc.buf = (buf != null) ? Arrays.copyOf(buf, (int)len) : null;
             sc.clob = null;
             return sc;
         } catch (CloneNotSupportedException ex) {
@@ -605,7 +674,20 @@
     }
 
     /**
-         * The identifier that assists in the serialization of this <code>SerialClob</code>
+     * Check to see if this object had previously had its {@code free} method
+     * called
+     *
+     * @throws SerialException
+     */
+    private void isValid() throws SerialException {
+        if (buf == null) {
+            throw new SerialException("Error: You cannot call a method on a "
+                    + "SerialClob instance once free() has been called.");
+        }
+    }
+
+    /**
+     * The identifier that assists in the serialization of this {@code SerialClob}
      * object.
      */
     static final long serialVersionUID = -1662519690087375313L;
diff --git a/src/share/classes/javax/sql/rowset/serial/SerialDatalink.java b/src/share/classes/javax/sql/rowset/serial/SerialDatalink.java
index 8753617..4cfcfb1 100644
--- a/src/share/classes/javax/sql/rowset/serial/SerialDatalink.java
+++ b/src/share/classes/javax/sql/rowset/serial/SerialDatalink.java
@@ -42,6 +42,12 @@
  * <pre>
  *      java.net.URL url = rowset.getURL(1);
  * </pre>
+ *
+ * <h4> Thread safety </h4>
+ *
+ * A SerialDatalink is not safe for use by multiple concurrent threads.  If a
+ * SerialDatalink is to be used by more than one thread then access to the
+ * SerialDatalink should be controlled by appropriate synchronization.
  */
 public class SerialDatalink implements Serializable, Cloneable {
 
diff --git a/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java b/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java
index ede4725..b85ed1b 100644
--- a/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java
+++ b/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java
@@ -44,6 +44,12 @@
  * Static or transient fields cannot be serialized; an attempt to serialize
  * them will result in a <code>SerialException</code> object being thrown.
  *
+ * <h4> Thread safety </h4>
+ *
+ * A SerialJavaObject is not safe for use by multiple concurrent threads.  If a
+ * SerialJavaObject is to be used by more than one thread then access to the
+ * SerialJavaObject should be controlled by appropriate synchronization.
+ *
  * @author Jonathan Bruce
  */
 public class SerialJavaObject implements Serializable, Cloneable {
diff --git a/src/share/classes/javax/sql/rowset/serial/SerialRef.java b/src/share/classes/javax/sql/rowset/serial/SerialRef.java
index 3d74592..0c7269d 100644
--- a/src/share/classes/javax/sql/rowset/serial/SerialRef.java
+++ b/src/share/classes/javax/sql/rowset/serial/SerialRef.java
@@ -36,6 +36,13 @@
  * The <code>SerialRef</code> class provides a constructor  for
  * creating a <code>SerialRef</code> instance from a <code>Ref</code>
  * object and provides methods for getting and setting the <code>Ref</code> object.
+ *
+ * <h4> Thread safety </h4>
+ *
+ * A SerialRef is not safe for use by multiple concurrent threads.  If a
+ * SerialRef is to be used by more than one thread then access to the SerialRef
+ * should be controlled by appropriate synchronization.
+ *
  */
 public class SerialRef implements Ref, Serializable, Cloneable {
 
diff --git a/src/share/classes/javax/sql/rowset/serial/SerialStruct.java b/src/share/classes/javax/sql/rowset/serial/SerialStruct.java
index c48b0c7..7a73a5c 100644
--- a/src/share/classes/javax/sql/rowset/serial/SerialStruct.java
+++ b/src/share/classes/javax/sql/rowset/serial/SerialStruct.java
@@ -50,6 +50,13 @@
  * an instance from a <code>Struct</code> object, a method for retrieving
  * the SQL type name of the SQL structured type in the database, and methods
  * for retrieving its attribute values.
+ *
+ * <h4> Thread safety </h4>
+ *
+ * A SerialStruct is not safe for use by multiple concurrent threads.  If a
+ * SerialStruct is to be used by more than one thread then access to the
+ * SerialStruct should be controlled by appropriate synchronization.
+ *
  */
 public class SerialStruct implements Struct, Serializable, Cloneable {
 
diff --git a/src/share/classes/sun/java2d/pipe/ParallelogramPipe.java b/src/share/classes/sun/java2d/pipe/ParallelogramPipe.java
index 57a9372..3b6b996 100644
--- a/src/share/classes/sun/java2d/pipe/ParallelogramPipe.java
+++ b/src/share/classes/sun/java2d/pipe/ParallelogramPipe.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/src/share/classes/sun/net/www/MessageHeader.java b/src/share/classes/sun/net/www/MessageHeader.java
index dbb2cfc..3a46def 100644
--- a/src/share/classes/sun/net/www/MessageHeader.java
+++ b/src/share/classes/sun/net/www/MessageHeader.java
@@ -137,6 +137,43 @@
         return null;
     }
 
+    /**
+     * Removes bare Negotiate and Kerberos headers when an "NTLM ..."
+     * appears. All Performed on headers with key being k.
+     * @return true if there is a change
+     */
+    public boolean filterNTLMResponses(String k) {
+        boolean found = false;
+        for (int i=0; i<nkeys; i++) {
+            if (k.equalsIgnoreCase(keys[i])
+                    && values[i] != null && values[i].length() > 5
+                    && values[i].substring(0, 5).equalsIgnoreCase("NTLM ")) {
+                found = true;
+                break;
+            }
+        }
+        if (found) {
+            int j = 0;
+            for (int i=0; i<nkeys; i++) {
+                if (k.equalsIgnoreCase(keys[i]) && (
+                        "Negotiate".equalsIgnoreCase(values[i]) ||
+                        "Kerberos".equalsIgnoreCase(values[i]))) {
+                    continue;
+                }
+                if (i != j) {
+                    keys[j] = keys[i];
+                    values[j] = values[i];
+                }
+                j++;
+            }
+            if (j != nkeys) {
+                nkeys = j;
+                return true;
+            }
+        }
+        return false;
+    }
+
     class HeaderIterator implements Iterator<String> {
         int index = 0;
         int next = -1;
diff --git a/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
index 87fdaa8..8003b5a 100644
--- a/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
+++ b/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
@@ -1326,6 +1326,16 @@
                 if (logger.isLoggable(PlatformLogger.FINE)) {
                     logger.fine(responses.toString());
                 }
+
+                boolean b1 = responses.filterNTLMResponses("WWW-Authenticate");
+                boolean b2 = responses.filterNTLMResponses("Proxy-Authenticate");
+                if (b1 || b2) {
+                    if (logger.isLoggable(PlatformLogger.FINE)) {
+                        logger.fine(">>>> Headers are filtered");
+                        logger.fine(responses.toString());
+                    }
+                }
+
                 inputStream = http.getInputStream();
 
                 respCode = getResponseCode();
@@ -1784,6 +1794,13 @@
                     logger.fine(responses.toString());
                 }
 
+                if (responses.filterNTLMResponses("Proxy-Authenticate")) {
+                    if (logger.isLoggable(PlatformLogger.FINE)) {
+                        logger.fine(">>>> Headers are filtered");
+                        logger.fine(responses.toString());
+                    }
+                }
+
                 statusLine = responses.getValue(0);
                 StringTokenizer st = new StringTokenizer(statusLine);
                 st.nextToken();
diff --git a/src/share/classes/sun/security/jgss/krb5/Krb5Util.java b/src/share/classes/sun/security/jgss/krb5/Krb5Util.java
index 97f1a12..ec5bc9c 100644
--- a/src/share/classes/sun/security/jgss/krb5/Krb5Util.java
+++ b/src/share/classes/sun/security/jgss/krb5/Krb5Util.java
@@ -40,10 +40,7 @@
 import sun.security.krb5.KrbException;
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
-import java.util.Objects;
-import java.util.Set;
 import sun.security.krb5.KerberosSecrets;
 import sun.security.krb5.PrincipalName;
 /**
@@ -189,18 +186,6 @@
         return subject;
     }
 
-    // A special KerberosKey, used as keys read from a KeyTab object.
-    // Each time new keys are read from KeyTab objects in the private
-    // credentials set, old ones are removed and new ones added.
-    public static class KeysFromKeyTab extends KerberosKey {
-        private static final long serialVersionUID = 8238092170252746927L;
-
-        public KeysFromKeyTab(KerberosKey key) {
-            super(key.getPrincipal(), key.getEncoded(),
-                    key.getKeyType(), key.getVersionNumber());
-        }
-    }
-
     /**
      * Credentials of a service, the private secret to authenticate its
      * identity, which can be:
@@ -239,7 +224,7 @@
                 // Compatibility with old behavior: even when there is no
                 // KerberosPrincipal, we can find one from KerberosKeys
                 List<KerberosKey> keys = SubjectComber.findMany(
-                        subj, null, null, KerberosKey.class);
+                        subj, serverPrincipal, null, KerberosKey.class);
                 if (!keys.isEmpty()) {
                     sc.kp = keys.get(0).getPrincipal();
                     serverPrincipal = sc.kp.getName();
@@ -255,9 +240,9 @@
                         subj, null, null, KeyTab.class);
             sc.kk = SubjectComber.findMany(
                         subj, serverPrincipal, null, KerberosKey.class);
-            sc.tgt = SubjectComber.find(subj, null, null, KerberosTicket.class);
-
-            if (sc.ktabs.isEmpty() && sc.kk.isEmpty()) {
+            sc.tgt = SubjectComber.find(
+                    subj, null, serverPrincipal, KerberosTicket.class);
+            if (sc.ktabs.isEmpty() && sc.kk.isEmpty() && sc.tgt == null) {
                 return null;
             }
             return sc;
@@ -268,37 +253,16 @@
         }
 
         public KerberosKey[] getKKeys() {
-            if (ktabs.isEmpty()) {
-                return kk.toArray(new KerberosKey[kk.size()]);
-            } else {
-                List<KerberosKey> keys = new ArrayList<>();
-                for (KeyTab ktab: ktabs) {
-                    for (KerberosKey k: ktab.getKeys(kp)) {
-                        keys.add(k);
-                    }
-                }
-                // Compatibility: also add keys to privCredSet. Remove old
-                // ones first, only remove those from keytab.
-                if (!subj.isReadOnly()) {
-                    Set<Object> pcs = subj.getPrivateCredentials();
-                    synchronized (pcs) {
-                        Iterator<Object> iterator = pcs.iterator();
-                        while (iterator.hasNext()) {
-                            Object obj = iterator.next();
-                            if (obj instanceof KeysFromKeyTab) {
-                                KerberosKey key = (KerberosKey)obj;
-                                if (Objects.equals(key.getPrincipal(), kp)) {
-                                    iterator.remove();
-                                }
-                            }
-                        }
-                    }
-                    for (KerberosKey key: keys) {
-                        subj.getPrivateCredentials().add(new KeysFromKeyTab(key));
-                    }
-                }
-                return keys.toArray(new KerberosKey[keys.size()]);
+            List<KerberosKey> keys = new ArrayList<>();
+            for (KerberosKey k: kk) {
+                keys.add(k);
             }
+            for (KeyTab ktab: ktabs) {
+                for (KerberosKey k: ktab.getKeys(kp)) {
+                    keys.add(k);
+                }
+            }
+            return keys.toArray(new KerberosKey[keys.size()]);
         }
 
         public EncryptionKey[] getEKeys() {
diff --git a/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java b/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java
index 1c869ad..1cbc040 100644
--- a/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java
+++ b/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java
@@ -90,10 +90,6 @@
                                     "libgssapi_krb5.so",
                                     "libgssapi_krb5.so.2",
                                 };
-                            } else if (osname.contains("OS X")) {
-                                gssLibs = new String[]{
-                                    "/usr/lib/sasl2/libgssapiv2.2.so",
-                                };
                             }
                         } else {
                             gssLibs = new String[]{ defaultLib };
diff --git a/src/share/classes/sun/text/resources/FormatData.java b/src/share/classes/sun/text/resources/FormatData.java
index 2031cb4..d6c3067 100644
--- a/src/share/classes/sun/text/resources/FormatData.java
+++ b/src/share/classes/sun/text/resources/FormatData.java
@@ -50,6 +50,20 @@
      * Overrides ListResourceBundle
      */
     protected final Object[][] getContents() {
+        final String[] buddhistEras = new String[] { // Thai Buddhist calendar era strings
+            "BC",     // BC
+            "B.E."    // Buddhist Era
+        };
+
+        // Japanese imperial calendar era abbreviations
+        final String[] japaneseEraAbbrs = new String[] {
+            "",
+            "M",
+            "T",
+            "S",
+            "H",
+        };
+
         return new Object[][] {
             { "MonthNames",
                 new String[] {
@@ -107,29 +121,49 @@
                     "Sat" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "S",
+                    "M",
+                    "T",
+                    "W",
+                    "T",
+                    "F",
+                    "S",
+                }
+            },
             { "AmPmMarkers",
                 new String[] {
                     "AM", // am marker
                     "PM" // pm marker
                 }
             },
+            { "narrow.AmPmMarkers",
+                new String[] {
+                    "a", // am marker
+                    "p"  // pm marker
+                }
+            },
             { "Eras",
                 new String[] { // era strings for GregorianCalendar
                     "BC",
                     "AD"
                 }
             },
-            { "buddhist.Eras",
-                new String[] { // Thai Buddhist calendar era strings
-                    "BC",     // BC
-                    "B.E."    // Buddhist Era
+            { "narrow.Eras",
+                new String[] {
+                    "B",
+                    "A",
                 }
             },
+            { "buddhist.Eras",
+              buddhistEras
+            },
             { "buddhist.short.Eras",
-                new String[] { // Thai Buddhist calendar era strings
-                    "BC",     // BC
-                    "B.E."    // Buddhist Era
-                }
+              buddhistEras
+            },
+            { "buddhist.narrow.Eras",
+              buddhistEras
             },
             { "japanese.Eras",
                 new String[] { // Japanese imperial calendar era strings
@@ -141,13 +175,10 @@
                 }
             },
             { "japanese.short.Eras",
-                new String[] { // Japanese imperial calendar era abbreviations
-                    "",
-                    "M",
-                    "T",
-                    "S",
-                    "H",
-                }
+              japaneseEraAbbrs
+            },
+            { "japanese.narrow.Eras",
+              japaneseEraAbbrs
             },
             { "japanese.FirstYear",
                 new String[] { // Japanese imperial calendar year name
diff --git a/src/share/classes/sun/text/resources/ar/FormatData_ar.java b/src/share/classes/sun/text/resources/ar/FormatData_ar.java
index 98b2e4e..a6593b0 100644
--- a/src/share/classes/sun/text/resources/ar/FormatData_ar.java
+++ b/src/share/classes/sun/text/resources/ar/FormatData_ar.java
@@ -107,6 +107,17 @@
                     "\u0633" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "\u062d",
+                    "\u0646",
+                    "\u062b",
+                    "\u0631",
+                    "\u062e",
+                    "\u062c",
+                    "\u0633",
+                }
+            },
             { "AmPmMarkers",
                 new String[] {
                     "\u0635", // am marker
diff --git a/src/share/classes/sun/text/resources/be/FormatData_be.java b/src/share/classes/sun/text/resources/be/FormatData_be.java
index 7545326..7bf6c01 100644
--- a/src/share/classes/sun/text/resources/be/FormatData_be.java
+++ b/src/share/classes/sun/text/resources/be/FormatData_be.java
@@ -85,6 +85,23 @@
                     "" // abb month 13 if applicable
                 }
             },
+            { "standalone.MonthNarrows",
+                new String[] {
+                    "\u0441",
+                    "\u043b",
+                    "\u0441",
+                    "\u043a",
+                    "\u043c",
+                    "\u0447",
+                    "\u043b",
+                    "\u0436",
+                    "\u0432",
+                    "\u043a",
+                    "\u043b",
+                    "\u0441",
+                    "",
+                }
+            },
             { "DayNames",
                 new String[] {
                     "\u043d\u044f\u0434\u0437\u0435\u043b\u044f", // Sunday
@@ -107,6 +124,17 @@
                     "\u0441\u0431" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "\u043d",
+                    "\u043f",
+                    "\u0430",
+                    "\u0441",
+                    "\u0447",
+                    "\u043f",
+                    "\u0441",
+                }
+            },
             { "Eras",
                 new String[] { // era strings
                     "\u0434\u0430 \u043d.\u0435.",
diff --git a/src/share/classes/sun/text/resources/bg/FormatData_bg.java b/src/share/classes/sun/text/resources/bg/FormatData_bg.java
index 2fe3928..2b7285e 100644
--- a/src/share/classes/sun/text/resources/bg/FormatData_bg.java
+++ b/src/share/classes/sun/text/resources/bg/FormatData_bg.java
@@ -107,6 +107,17 @@
                     "\u0421\u0431" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "\u043d",
+                    "\u043f",
+                    "\u0432",
+                    "\u0441",
+                    "\u0447",
+                    "\u043f",
+                    "\u0441",
+                }
+            },
             { "Eras",
                 new String[] { // era strings
                     "\u043f\u0440.\u043d.\u0435.",
diff --git a/src/share/classes/sun/text/resources/ca/FormatData_ca.java b/src/share/classes/sun/text/resources/ca/FormatData_ca.java
index 2f9cf39..d6774db 100644
--- a/src/share/classes/sun/text/resources/ca/FormatData_ca.java
+++ b/src/share/classes/sun/text/resources/ca/FormatData_ca.java
@@ -119,6 +119,23 @@
                     "" // abb month 13 if applicable
                 }
             },
+            { "standalone.MonthNarrows",
+                new String[] {
+                    "g",
+                    "f",
+                    "m",
+                    "a",
+                    "m",
+                    "j",
+                    "j",
+                    "a",
+                    "s",
+                    "o",
+                    "n",
+                    "d",
+                    "",
+                }
+            },
             { "DayNames",
                 new String[] {
                     "diumenge", // Sunday
@@ -141,6 +158,28 @@
                     "ds." // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "G",
+                    "L",  // Note: contributed item in CDLR
+                    "T",
+                    "C",
+                    "J",
+                    "V",
+                    "S",
+                }
+            },
+            { "standalone.DayNarrows",
+                new String[] {
+                    "g",
+                    "l",
+                    "t",
+                    "c",
+                    "j",
+                    "v",
+                    "s",
+                }
+            },
             { "NumberElements",
                 new String[] {
                     ",", // decimal separator
diff --git a/src/share/classes/sun/text/resources/cs/FormatData_cs.java b/src/share/classes/sun/text/resources/cs/FormatData_cs.java
index 2bbc8c0..e0d3409 100644
--- a/src/share/classes/sun/text/resources/cs/FormatData_cs.java
+++ b/src/share/classes/sun/text/resources/cs/FormatData_cs.java
@@ -141,6 +141,17 @@
                     "So" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "N",
+                    "P",
+                    "\u00da",
+                    "S",
+                    "\u010c",
+                    "P",
+                    "S",
+                }
+            },
             { "AmPmMarkers",
                 new String[] {
                     "dop.", // am marker
diff --git a/src/share/classes/sun/text/resources/da/FormatData_da.java b/src/share/classes/sun/text/resources/da/FormatData_da.java
index d9535cf..2686877 100644
--- a/src/share/classes/sun/text/resources/da/FormatData_da.java
+++ b/src/share/classes/sun/text/resources/da/FormatData_da.java
@@ -124,6 +124,17 @@
                     "l\u00f8" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "S",
+                    "M",
+                    "T",
+                    "O",
+                    "T",
+                    "F",
+                    "L",
+                }
+            },
             { "NumberElements",
                 new String[] {
                     ",", // decimal separator
diff --git a/src/share/classes/sun/text/resources/de/FormatData_de.java b/src/share/classes/sun/text/resources/de/FormatData_de.java
index d2fe2f2..3f55bb2 100644
--- a/src/share/classes/sun/text/resources/de/FormatData_de.java
+++ b/src/share/classes/sun/text/resources/de/FormatData_de.java
@@ -124,6 +124,17 @@
                     "Sa" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "S",
+                    "M",
+                    "D",
+                    "M",
+                    "D",
+                    "F",
+                    "S",
+                }
+            },
             { "Eras",
                 new String[] { // era strings
                     "v. Chr.",
diff --git a/src/share/classes/sun/text/resources/el/FormatData_el.java b/src/share/classes/sun/text/resources/el/FormatData_el.java
index 49e0602..fd91ad2 100644
--- a/src/share/classes/sun/text/resources/el/FormatData_el.java
+++ b/src/share/classes/sun/text/resources/el/FormatData_el.java
@@ -124,6 +124,17 @@
                     "\u03a3\u03b1\u03b2" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "\u039a",
+                    "\u0394",
+                    "\u03a4",
+                    "\u03a4",
+                    "\u03a0",
+                    "\u03a0",
+                    "\u03a3",
+                }
+            },
             { "AmPmMarkers",
                 new String[] {
                     "\u03c0\u03bc", // am marker
diff --git a/src/share/classes/sun/text/resources/es/FormatData_es.java b/src/share/classes/sun/text/resources/es/FormatData_es.java
index 3ee44ba..f19685d 100644
--- a/src/share/classes/sun/text/resources/es/FormatData_es.java
+++ b/src/share/classes/sun/text/resources/es/FormatData_es.java
@@ -104,6 +104,17 @@
                     "s\u00e1b" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "D",
+                    "L",
+                    "M",
+                    "X",
+                    "J",
+                    "V",
+                    "S",
+                }
+            },
             { "NumberPatterns",
                 new String[] {
                     "#,##0.###;-#,##0.###", // decimal pattern
diff --git a/src/share/classes/sun/text/resources/et/FormatData_et.java b/src/share/classes/sun/text/resources/et/FormatData_et.java
index 90f4dcc..844b8af 100644
--- a/src/share/classes/sun/text/resources/et/FormatData_et.java
+++ b/src/share/classes/sun/text/resources/et/FormatData_et.java
@@ -104,6 +104,17 @@
                     "L" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "P",
+                    "E",
+                    "T",
+                    "K",
+                    "N",
+                    "R",
+                    "L",
+                }
+            },
             { "Eras",
                 new String[] { // era strings
                     "e.m.a.",
diff --git a/src/share/classes/sun/text/resources/fi/FormatData_fi.java b/src/share/classes/sun/text/resources/fi/FormatData_fi.java
index d8a610d..91c5ea9 100644
--- a/src/share/classes/sun/text/resources/fi/FormatData_fi.java
+++ b/src/share/classes/sun/text/resources/fi/FormatData_fi.java
@@ -116,6 +116,23 @@
                     "" // abb month 13 if applicable
                 }
             },
+            { "standalone.MonthNarrows",
+                new String[] {
+                    "T",
+                    "H",
+                    "M",
+                    "H",
+                    "T",
+                    "K",
+                    "H",
+                    "E",
+                    "S",
+                    "L",
+                    "M",
+                    "J",
+                    "",
+                }
+            },
             { "DayNames",
                 new String[] {
                     "sunnuntai", // Sunday
@@ -138,6 +155,28 @@
                     "la" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "S",
+                    "M",
+                    "T",
+                    "K",
+                    "T",
+                    "P",
+                    "L",
+                }
+            },
+            { "standalone.DayNarrows",
+                new String[] {
+                    "S",
+                    "M",
+                    "T",
+                    "K",
+                    "T",
+                    "P",
+                    "L",
+                }
+            },
             { "NumberElements",
                 new String[] {
                     ",", // decimal separator
@@ -181,6 +220,12 @@
                     "ip."  // pm marker
                 }
             },
+            { "narrow.AmPmMarkers",
+                new String[] {
+                    "ap.",
+                    "ip.",
+                }
+            },
         };
     }
 }
diff --git a/src/share/classes/sun/text/resources/fr/FormatData_fr.java b/src/share/classes/sun/text/resources/fr/FormatData_fr.java
index de857d7..f0354ec 100644
--- a/src/share/classes/sun/text/resources/fr/FormatData_fr.java
+++ b/src/share/classes/sun/text/resources/fr/FormatData_fr.java
@@ -104,6 +104,17 @@
                     "sam." // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "D",
+                    "L",
+                    "M",
+                    "M",
+                    "J",
+                    "V",
+                    "S",
+                }
+            },
             { "Eras",
                 new String[] { // era strings
                     "BC",
diff --git a/src/share/classes/sun/text/resources/hi/FormatData_hi_IN.java b/src/share/classes/sun/text/resources/hi/FormatData_hi_IN.java
index b6c1647..7f1deb8 100644
--- a/src/share/classes/sun/text/resources/hi/FormatData_hi_IN.java
+++ b/src/share/classes/sun/text/resources/hi/FormatData_hi_IN.java
@@ -99,6 +99,17 @@
                     "\u0936\u0928\u093f" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "\u0930",
+                    "\u0938\u094b",
+                    "\u092e\u0902",
+                    "\u092c\u0941",
+                    "\u0917\u0941",
+                    "\u0936\u0941",
+                    "\u0936",
+                }
+            },
             { "AmPmMarkers",
                 new String[] {
                     "\u092a\u0942\u0930\u094d\u0935\u093e\u0939\u094d\u0928", // am marker
diff --git a/src/share/classes/sun/text/resources/hr/FormatData_hr.java b/src/share/classes/sun/text/resources/hr/FormatData_hr.java
index 635b3b9..cec0867 100644
--- a/src/share/classes/sun/text/resources/hr/FormatData_hr.java
+++ b/src/share/classes/sun/text/resources/hr/FormatData_hr.java
@@ -116,6 +116,23 @@
                     "" // abb month 13 if applicable
                 }
             },
+            { "standalone.MonthNarrows",
+                new String[] {
+                    "1.",
+                    "2.",
+                    "3.",
+                    "4.",
+                    "5.",
+                    "6.",
+                    "7.",
+                    "8.",
+                    "9.",
+                    "10.",
+                    "11.",
+                    "12.",
+                    "",
+                }
+            },
             { "DayNames",
                 new String[] {
                     "nedjelja", // Sunday
@@ -138,6 +155,28 @@
                     "sub" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "N",
+                    "P",
+                    "U",
+                    "S",
+                    "\u010c",
+                    "P",
+                    "S",
+                }
+            },
+            { "standalone.DayNarrows",
+                new String[] {
+                    "n",
+                    "p",
+                    "u",
+                    "s",
+                    "\u010d",
+                    "p",
+                    "s",
+                }
+            },
             { "NumberElements",
                 new String[] {
                     ",", // decimal separator
diff --git a/src/share/classes/sun/text/resources/hu/FormatData_hu.java b/src/share/classes/sun/text/resources/hu/FormatData_hu.java
index a1ab390..0f00a40 100644
--- a/src/share/classes/sun/text/resources/hu/FormatData_hu.java
+++ b/src/share/classes/sun/text/resources/hu/FormatData_hu.java
@@ -104,6 +104,17 @@
                     "Szo" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "V",
+                    "H",
+                    "K",
+                    "Sz",
+                    "Cs",
+                    "P",
+                    "Sz",
+                }
+            },
             { "AmPmMarkers",
                 new String[] {
                     "DE", // am marker
diff --git a/src/share/classes/sun/text/resources/is/FormatData_is.java b/src/share/classes/sun/text/resources/is/FormatData_is.java
index 9a3e0ff..6b6d92c 100644
--- a/src/share/classes/sun/text/resources/is/FormatData_is.java
+++ b/src/share/classes/sun/text/resources/is/FormatData_is.java
@@ -82,6 +82,23 @@
                     "" // abb month 13 if applicable
                 }
             },
+            { "standalone.MonthNarrows",
+                new String[] {
+                    "j",
+                    "f",
+                    "m",
+                    "a",
+                    "m",
+                    "j",
+                    "j",
+                    "\u00e1",
+                    "s",
+                    "o",
+                    "n",
+                    "d",
+                    "",
+                }
+            },
             { "DayNames",
                 new String[] {
                     "sunnudagur", // Sunday
@@ -104,6 +121,28 @@
                     "lau." // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "S",
+                    "M",
+                    "\u00de",
+                    "M",
+                    "F",
+                    "F",
+                    "L",
+                }
+            },
+            { "standalone.DayNarrows",
+                new String[] {
+                    "s",
+                    "m",
+                    "\u00fe",
+                    "m",
+                    "f",
+                    "f",
+                    "l",
+                }
+            },
             { "NumberElements",
                 new String[] {
                     ",", // decimal separator
diff --git a/src/share/classes/sun/text/resources/it/FormatData_it.java b/src/share/classes/sun/text/resources/it/FormatData_it.java
index a9843cc..5b3fa9c 100644
--- a/src/share/classes/sun/text/resources/it/FormatData_it.java
+++ b/src/share/classes/sun/text/resources/it/FormatData_it.java
@@ -121,6 +121,17 @@
                     "sab" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "D",
+                    "L",
+                    "M",
+                    "M",
+                    "G",
+                    "V",
+                    "S",
+                }
+            },
             { "Eras",
                 new String[] { // era strings
                     "BC",
diff --git a/src/share/classes/sun/text/resources/iw/FormatData_iw.java b/src/share/classes/sun/text/resources/iw/FormatData_iw.java
index cfadcdf..80fb1ac 100644
--- a/src/share/classes/sun/text/resources/iw/FormatData_iw.java
+++ b/src/share/classes/sun/text/resources/iw/FormatData_iw.java
@@ -121,6 +121,28 @@
                     "\u05e9" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "\u05d0",
+                    "\u05d1",
+                    "\u05d2",
+                    "\u05d3",
+                    "\u05d4",
+                    "\u05d5",
+                    "\u05e9",
+                }
+            },
+            { "standalone.DayNarrows",
+                new String[] {
+                    "\u05d0",
+                    "\u05d1",
+                    "\u05d2",
+                    "\u05d3",
+                    "\u05d4",
+                    "\u05d5",
+                    "\u05e9",
+                }
+            },
             { "Eras",
                 new String[] { // era strings
                     "\u05dc\u05e1\u05d4\"\u05e0",
diff --git a/src/share/classes/sun/text/resources/ja/FormatData_ja.java b/src/share/classes/sun/text/resources/ja/FormatData_ja.java
index 6217d5a..a459929 100644
--- a/src/share/classes/sun/text/resources/ja/FormatData_ja.java
+++ b/src/share/classes/sun/text/resources/ja/FormatData_ja.java
@@ -104,6 +104,17 @@
                     "\u571f"  // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "\u65e5",
+                    "\u6708",
+                    "\u706b",
+                    "\u6c34",
+                    "\u6728",
+                    "\u91d1",
+                    "\u571f",
+                }
+            },
             { "AmPmMarkers",
                 new String[] {
                     "\u5348\u524d", // am marker
diff --git a/src/share/classes/sun/text/resources/ko/FormatData_ko.java b/src/share/classes/sun/text/resources/ko/FormatData_ko.java
index b574bfb..fc8badb 100644
--- a/src/share/classes/sun/text/resources/ko/FormatData_ko.java
+++ b/src/share/classes/sun/text/resources/ko/FormatData_ko.java
@@ -104,6 +104,17 @@
                     "\ud1a0" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "\uc77c",
+                    "\uc6d4",
+                    "\ud654",
+                    "\uc218",
+                    "\ubaa9",
+                    "\uae08",
+                    "\ud1a0",
+                }
+            },
             { "AmPmMarkers",
                 new String[] {
                     "\uc624\uc804", // am marker
diff --git a/src/share/classes/sun/text/resources/lt/FormatData_lt.java b/src/share/classes/sun/text/resources/lt/FormatData_lt.java
index 6fdb6c1..9e949ec 100644
--- a/src/share/classes/sun/text/resources/lt/FormatData_lt.java
+++ b/src/share/classes/sun/text/resources/lt/FormatData_lt.java
@@ -99,6 +99,23 @@
                     "" // abb month 13 if applicable
                 }
             },
+            { "standalone.MonthNarrows",
+                new String[] {
+                    "S",
+                    "V",
+                    "K",
+                    "B",
+                    "G",
+                    "B",
+                    "L",
+                    "R",
+                    "R",
+                    "S",
+                    "L",
+                    "G",
+                    "",
+                }
+            },
             { "DayNames",
                 new String[] {
                     "Sekmadienis", // Sunday
@@ -121,6 +138,28 @@
                     "\u0160t" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "S",
+                    "P",
+                    "A",
+                    "T",
+                    "K",
+                    "P",
+                    "\u0160",
+                }
+            },
+            { "standalone.DayNarrows",
+                new String[] {
+                    "S",
+                    "P",
+                    "A",
+                    "T",
+                    "K",
+                    "P",
+                    "\u0160",
+                }
+            },
             { "Eras",
                 new String[] { // era strings
                     "pr.Kr.",
diff --git a/src/share/classes/sun/text/resources/lv/FormatData_lv.java b/src/share/classes/sun/text/resources/lv/FormatData_lv.java
index e1aadce..ff9eb47 100644
--- a/src/share/classes/sun/text/resources/lv/FormatData_lv.java
+++ b/src/share/classes/sun/text/resources/lv/FormatData_lv.java
@@ -121,6 +121,17 @@
                     "S" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "S",
+                    "P",
+                    "O",
+                    "T",
+                    "C",
+                    "P",
+                    "S",
+                }
+            },
             { "Eras",
                 new String[] { // era strings
                     "pm\u0113",
diff --git a/src/share/classes/sun/text/resources/mk/FormatData_mk.java b/src/share/classes/sun/text/resources/mk/FormatData_mk.java
index ba42eeb..cd09d3e 100644
--- a/src/share/classes/sun/text/resources/mk/FormatData_mk.java
+++ b/src/share/classes/sun/text/resources/mk/FormatData_mk.java
@@ -104,6 +104,17 @@
                     "\u0441\u0430\u0431." // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "\u043d",
+                    "\u043f",
+                    "\u0432",
+                    "\u0441",
+                    "\u0447",
+                    "\u043f",
+                    "\u0441",
+                }
+            },
             { "Eras",
                 new String[] { // era strings
                     "\u043f\u0440.\u043d.\u0435.",
diff --git a/src/share/classes/sun/text/resources/ms/FormatData_ms.java b/src/share/classes/sun/text/resources/ms/FormatData_ms.java
index e3936d8..13a8d51 100644
--- a/src/share/classes/sun/text/resources/ms/FormatData_ms.java
+++ b/src/share/classes/sun/text/resources/ms/FormatData_ms.java
@@ -81,6 +81,23 @@
                     "",
                 }
             },
+            { "standalone.MonthNarrows",
+                new String[] {
+                    "J",
+                    "F",
+                    "M",
+                    "A",
+                    "M",
+                    "J",
+                    "J",
+                    "O",
+                    "S",
+                    "O",
+                    "N",
+                    "D",
+                    "",
+                }
+            },
             { "DayNames",
                 new String[] {
                     "Ahad",
@@ -103,6 +120,28 @@
                     "Sab",
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "A",
+                    "I",
+                    "S",
+                    "R",
+                    "K",
+                    "J",
+                    "S",
+                }
+            },
+            { "standalone.DayNarrows",
+                new String[] {
+                    "A",
+                    "I",
+                    "S",
+                    "R",
+                    "K",
+                    "J",
+                    "S",
+                }
+            },
             { "Eras",
                 new String[] {
                     "BCE",
diff --git a/src/share/classes/sun/text/resources/mt/FormatData_mt.java b/src/share/classes/sun/text/resources/mt/FormatData_mt.java
index 4975127..4ef0957 100644
--- a/src/share/classes/sun/text/resources/mt/FormatData_mt.java
+++ b/src/share/classes/sun/text/resources/mt/FormatData_mt.java
@@ -103,6 +103,17 @@
                     "Sib",
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "\u0126",
+                    "T",
+                    "T",
+                    "E",
+                    "\u0126",
+                    "\u0120",
+                    "S",
+                }
+            },
             { "AmPmMarkers",
                 new String[] {
                     "QN",
diff --git a/src/share/classes/sun/text/resources/nl/FormatData_nl.java b/src/share/classes/sun/text/resources/nl/FormatData_nl.java
index 4d041dd..78b937c 100644
--- a/src/share/classes/sun/text/resources/nl/FormatData_nl.java
+++ b/src/share/classes/sun/text/resources/nl/FormatData_nl.java
@@ -104,6 +104,17 @@
                     "za" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "Z",
+                    "M",
+                    "D",
+                    "W",
+                    "D",
+                    "V",
+                    "Z",
+                }
+            },
             { "Eras",
                 new String[] { // era strings for GregorianCalendar
                     "v. Chr.",
diff --git a/src/share/classes/sun/text/resources/pl/FormatData_pl.java b/src/share/classes/sun/text/resources/pl/FormatData_pl.java
index 3e52ed1..824645e 100644
--- a/src/share/classes/sun/text/resources/pl/FormatData_pl.java
+++ b/src/share/classes/sun/text/resources/pl/FormatData_pl.java
@@ -121,6 +121,17 @@
                     "So" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "N",
+                    "P",
+                    "W",
+                    "\u015a",
+                    "C",
+                    "P",
+                    "S",
+                }
+            },
             { "Eras",
                 new String[] { // era strings
                     "p.n.e.",
diff --git a/src/share/classes/sun/text/resources/pt/FormatData_pt.java b/src/share/classes/sun/text/resources/pt/FormatData_pt.java
index e926701..4a0de29 100644
--- a/src/share/classes/sun/text/resources/pt/FormatData_pt.java
+++ b/src/share/classes/sun/text/resources/pt/FormatData_pt.java
@@ -104,6 +104,17 @@
                     "S\u00e1b" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "D",
+                    "S",
+                    "T",
+                    "Q",
+                    "Q",
+                    "S",
+                    "S",
+                }
+            },
             { "NumberElements",
                 new String[] {
                     ",", // decimal al separator
diff --git a/src/share/classes/sun/text/resources/ro/FormatData_ro.java b/src/share/classes/sun/text/resources/ro/FormatData_ro.java
index 49a0cb1..c28502c 100644
--- a/src/share/classes/sun/text/resources/ro/FormatData_ro.java
+++ b/src/share/classes/sun/text/resources/ro/FormatData_ro.java
@@ -82,6 +82,23 @@
                     "" // abb month 13 if applicable
                 }
             },
+            { "standalone.MonthNarrows",
+                new String[] {
+                    "I",
+                    "F",
+                    "M",
+                    "A",
+                    "M",
+                    "I",
+                    "I",
+                    "A",
+                    "S",
+                    "O",
+                    "N",
+                    "D",
+                    "",
+                }
+            },
             { "DayNames",
                 new String[] {
                     "duminic\u0103", // Sunday
@@ -104,6 +121,29 @@
                     "S" // abb Saturday
                 }
             },
+            // commented out DayNarrows because most names are contributed.
+//          { "DayNarrows",
+//              new String[] {
+//                  "D",
+//                  "",
+//                  "",
+//                  "",
+//                  "",
+//                  "",
+//                  "",
+//              }
+//          },
+            { "standalone.DayNarrows",
+                new String[] {
+                    "D",
+                    "L",
+                    "M",
+                    "M",
+                    "J",
+                    "V",
+                    "S",
+                }
+            },
             { "Eras",
                 new String[] { // era strings
                     "d.C.",
diff --git a/src/share/classes/sun/text/resources/ru/FormatData_ru.java b/src/share/classes/sun/text/resources/ru/FormatData_ru.java
index 2eb144a..820bf53 100644
--- a/src/share/classes/sun/text/resources/ru/FormatData_ru.java
+++ b/src/share/classes/sun/text/resources/ru/FormatData_ru.java
@@ -138,6 +138,28 @@
                     "\u0421\u0431" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "\u0412",
+                    "\u041f\u043d",
+                    "\u0412\u0442",
+                    "\u0421",
+                    "\u0427",
+                    "\u041f",
+                    "\u0421", // contributed item in CLDR
+                }
+            },
+            { "standalone.DayNarrows",
+                new String[] {
+                    "\u0412",
+                    "\u041f",
+                    "\u0412",
+                    "\u0421",
+                    "\u0427",
+                    "\u041f",
+                    "\u0421",
+                }
+            },
             { "Eras",
                 new String[] { // era strings
                     "\u0434\u043e \u043d.\u044d.",
diff --git a/src/share/classes/sun/text/resources/sk/FormatData_sk.java b/src/share/classes/sun/text/resources/sk/FormatData_sk.java
index 38787ad..1109856 100644
--- a/src/share/classes/sun/text/resources/sk/FormatData_sk.java
+++ b/src/share/classes/sun/text/resources/sk/FormatData_sk.java
@@ -138,6 +138,17 @@
                     "So" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "N",
+                    "P",
+                    "U",
+                    "S",
+                    "\u0160",
+                    "P",
+                    "S",
+                }
+            },
             { "Eras",
                 new String[] { // era strings
                     "pred n.l.",
diff --git a/src/share/classes/sun/text/resources/sl/FormatData_sl.java b/src/share/classes/sun/text/resources/sl/FormatData_sl.java
index 65be14a..34ce565 100644
--- a/src/share/classes/sun/text/resources/sl/FormatData_sl.java
+++ b/src/share/classes/sun/text/resources/sl/FormatData_sl.java
@@ -121,6 +121,17 @@
                     "Sob" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "n",
+                    "p",
+                    "t",
+                    "s",
+                    "\u010d",
+                    "p",
+                    "s",
+                }
+            },
             { "Eras",
                 new String[] { // era strings
                     "pr.n.\u0161.",
diff --git a/src/share/classes/sun/text/resources/sq/FormatData_sq.java b/src/share/classes/sun/text/resources/sq/FormatData_sq.java
index b7f4038..0984bb6 100644
--- a/src/share/classes/sun/text/resources/sq/FormatData_sq.java
+++ b/src/share/classes/sun/text/resources/sq/FormatData_sq.java
@@ -104,6 +104,17 @@
                     "Sht" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "D",
+                    "H",
+                    "M",
+                    "M",
+                    "E",
+                    "P",
+                    "S",
+                }
+            },
             { "AmPmMarkers",
                 new String[] {
                     "PD", // am marker
diff --git a/src/share/classes/sun/text/resources/sr/FormatData_sr.java b/src/share/classes/sun/text/resources/sr/FormatData_sr.java
index fb96b66..d331a8d 100644
--- a/src/share/classes/sun/text/resources/sr/FormatData_sr.java
+++ b/src/share/classes/sun/text/resources/sr/FormatData_sr.java
@@ -103,12 +103,35 @@
                     "\u0441\u0443\u0431",
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "\u043d",
+                    "\u043f",
+                    "\u0443",
+                    "\u0441",
+                    "\u0447",
+                    "\u043f",
+                    "\u0441",
+                }
+            },
             { "Eras",
                 new String[] {
                     "\u043f. \u043d. \u0435.",
                     "\u043d. \u0435",
                 }
             },
+            { "short.Eras",
+                new String[] {
+                    "\u043f. \u043d. \u0435.",
+                    "\u043d. \u0435.",
+                }
+            },
+            { "narrow.Eras",
+                new String[] {
+                    "\u043f.\u043d.\u0435.",
+                    "\u043d.\u0435.",
+                }
+            },
             { "NumberPatterns",
                 new String[] {
                     "#,##0.###",
diff --git a/src/share/classes/sun/text/resources/sv/FormatData_sv.java b/src/share/classes/sun/text/resources/sv/FormatData_sv.java
index a7aca44..7368a49 100644
--- a/src/share/classes/sun/text/resources/sv/FormatData_sv.java
+++ b/src/share/classes/sun/text/resources/sv/FormatData_sv.java
@@ -82,6 +82,23 @@
                     "" // abb month 13 if applicable
                 }
             },
+            { "standalone.MonthNarrows",
+                new String[] {
+                    "J",
+                    "F",
+                    "M",
+                    "A",
+                    "M",
+                    "J",
+                    "J",
+                    "A",
+                    "S",
+                    "O",
+                    "N",
+                    "D",
+                    "",
+                }
+            },
             { "DayNames",
                 new String[] {
                     "s\u00f6ndag", // Sunday
@@ -104,12 +121,46 @@
                     "l\u00f6" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "S",
+                    "M",
+                    "T",
+                    "O",
+                    "T",
+                    "F",
+                    "L",
+                }
+            },
+            { "standalone.DayNarrows",
+                new String[] {
+                    "S",
+                    "M",
+                    "T",
+                    "O",
+                    "T",
+                    "F",
+                    "L",
+                }
+            },
+            { "narrow.Eras",
+                new String[] {
+                    "f.Kr.",
+                    "e.Kr.",
+                }
+            },
             { "AmPmMarkers",
                 new String[] {
                     "fm", // am marker
                     "em" // pm marker
                 }
             },
+            { "narrow.AmPmMarkers",
+                new String[] {
+                    "f",
+                    "e",
+                }
+            },
             { "NumberElements",
                 new String[] {
                     ",", // decimal separator
diff --git a/src/share/classes/sun/text/resources/th/FormatData_th.java b/src/share/classes/sun/text/resources/th/FormatData_th.java
index 4313b90..bec15d1 100644
--- a/src/share/classes/sun/text/resources/th/FormatData_th.java
+++ b/src/share/classes/sun/text/resources/th/FormatData_th.java
@@ -99,6 +99,23 @@
                     "" // abb month 13 if applicable
                 }
             },
+            { "standalone.MonthNarrows",
+                new String[] {
+                    "\u0e21.\u0e04.",
+                    "\u0e01.\u0e1e.",
+                    "\u0e21\u0e35.\u0e04.",
+                    "\u0e40\u0e21.\u0e22.",
+                    "\u0e1e.\u0e04.",
+                    "\u0e21\u0e34.\u0e22.",
+                    "\u0e01.\u0e04.",
+                    "\u0e2a.\u0e04.",
+                    "\u0e01.\u0e22.",
+                    "\u0e15.\u0e04.",
+                    "\u0e1e.\u0e22.",
+                    "\u0e18.\u0e04.",
+                    "",
+                }
+            },
             { "DayNames",
                 new String[] {
                     "\u0e27\u0e31\u0e19\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c", // Sunday
@@ -121,6 +138,17 @@
                     "\u0e2a." // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "\u0e2d",
+                    "\u0e08",
+                    "\u0e2d",
+                    "\u0e1e",
+                    "\u0e1e",
+                    "\u0e28",
+                    "\u0e2a",
+                }
+            },
             { "AmPmMarkers",
                 new String[] {
                     "\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07", // am marker
@@ -145,6 +173,12 @@
                     "\u0e04.\u0e28."
                 }
             },
+            { "narrow.Eras",
+                new String[] {
+                    "\u0e01\u0e48\u0e2d\u0e19 \u0e04.\u0e28.",
+                    "\u0e04.\u0e28.",
+                }
+            },
             { "buddhist.TimePatterns",
                 timePatterns
             },
diff --git a/src/share/classes/sun/text/resources/tr/FormatData_tr.java b/src/share/classes/sun/text/resources/tr/FormatData_tr.java
index 9df7ac1..2be1b12 100644
--- a/src/share/classes/sun/text/resources/tr/FormatData_tr.java
+++ b/src/share/classes/sun/text/resources/tr/FormatData_tr.java
@@ -82,6 +82,23 @@
                     "" // abb month 13 if applicable
                 }
             },
+            { "standalone.MonthNarrows",
+                new String[] {
+                    "O",
+                    "\u015e",
+                    "M",
+                    "N",
+                    "M",
+                    "H",
+                    "T",
+                    "A",
+                    "E",
+                    "E",
+                    "K",
+                    "A",
+                    "",
+                }
+            },
             { "DayNames",
                 new String[] {
                     "Pazar", // Sunday
@@ -104,6 +121,17 @@
                     "Cmt" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "P",
+                    "P",
+                    "S",
+                    "\u00c7",
+                    "P",
+                    "C",
+                    "C",
+                }
+            },
             { "NumberPatterns",
                 new String[] {
                     "#,##0.###;-#,##0.###", // decimal pattern
diff --git a/src/share/classes/sun/text/resources/uk/FormatData_uk.java b/src/share/classes/sun/text/resources/uk/FormatData_uk.java
index d9514e0..7aa0e0c 100644
--- a/src/share/classes/sun/text/resources/uk/FormatData_uk.java
+++ b/src/share/classes/sun/text/resources/uk/FormatData_uk.java
@@ -138,6 +138,17 @@
                     "\u0441\u0431" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "\u041d",
+                    "\u041f",
+                    "\u0412",
+                    "\u0421",
+                    "\u0427",
+                    "\u041f",
+                    "\u0421",
+                }
+            },
             { "Eras",
                 new String[] { // era strings
                     "\u0434\u043e \u043d.\u0435.",
diff --git a/src/share/classes/sun/text/resources/vi/FormatData_vi.java b/src/share/classes/sun/text/resources/vi/FormatData_vi.java
index c5e43ee..fd892d9 100644
--- a/src/share/classes/sun/text/resources/vi/FormatData_vi.java
+++ b/src/share/classes/sun/text/resources/vi/FormatData_vi.java
@@ -106,6 +106,17 @@
                     "Th 7" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "CN",
+                    "T2",
+                    "T3",
+                    "T4",
+                    "T5",
+                    "T6",
+                    "T7",
+                }
+            },
             { "AmPmMarkers",
                 new String[] {
                     "SA", // am marker
diff --git a/src/share/classes/sun/text/resources/zh/FormatData_zh.java b/src/share/classes/sun/text/resources/zh/FormatData_zh.java
index 57bf686..57dbe2a 100644
--- a/src/share/classes/sun/text/resources/zh/FormatData_zh.java
+++ b/src/share/classes/sun/text/resources/zh/FormatData_zh.java
@@ -82,6 +82,23 @@
                     "" // abb month 13 if applicable
                 }
             },
+            { "standalone.MonthNarrows",
+                new String[] {
+                    "1\u6708",
+                    "2\u6708",
+                    "3\u6708",
+                    "4\u6708",
+                    "5\u6708",
+                    "6\u6708",
+                    "7\u6708",
+                    "8\u6708",
+                    "9\u6708",
+                    "10\u6708",
+                    "11\u6708",
+                    "12\u6708",
+                    "",
+                }
+            },
             { "DayNames",
                 new String[] {
                     "\u661f\u671f\u65e5", // Sunday
@@ -104,6 +121,17 @@
                     "\u661f\u671f\u516d" // abb Saturday
                 }
             },
+            { "DayNarrows",
+                new String[] {
+                    "\u65e5",
+                    "\u4e00",
+                    "\u4e8c",
+                    "\u4e09",
+                    "\u56db",
+                    "\u4e94",
+                    "\u516d",
+                }
+            },
             { "AmPmMarkers",
                 new String[] {
                     "\u4e0a\u5348", // am marker
diff --git a/src/share/classes/sun/tools/jcmd/JCmd.java b/src/share/classes/sun/tools/jcmd/JCmd.java
index 4690a5b..8c5a2c5 100644
--- a/src/share/classes/sun/tools/jcmd/JCmd.java
+++ b/src/share/classes/sun/tools/jcmd/JCmd.java
@@ -1,8 +1,7 @@
 /*
  * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *com.sun.tools.attach.AttachNotSupportedException
-
+ *
  * 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
diff --git a/src/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java b/src/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java
index e841134..77f7b84 100644
--- a/src/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java
+++ b/src/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java
@@ -89,11 +89,6 @@
     }
 
     @Override
-    public TimeZoneNameProvider getTimeZoneNameProvider() {
-        return null;
-    }
-
-    @Override
     public Locale[] getAvailableLocales() {
         Set<String> all = createLanguageTagSet("All");
         Locale[] locs = new Locale[all.size()];
diff --git a/src/share/classes/sun/util/locale/provider/CalendarDataUtility.java b/src/share/classes/sun/util/locale/provider/CalendarDataUtility.java
index e86e272..f181c98 100644
--- a/src/share/classes/sun/util/locale/provider/CalendarDataUtility.java
+++ b/src/share/classes/sun/util/locale/provider/CalendarDataUtility.java
@@ -25,7 +25,6 @@
 
 package sun.util.locale.provider;
 
-import java.util.Calendar;
 import static java.util.Calendar.*;
 import java.util.Locale;
 import java.util.Map;
diff --git a/src/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java b/src/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java
index 1f262a8..20be386 100644
--- a/src/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java
+++ b/src/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java
@@ -52,7 +52,7 @@
     @Override
     public String getDisplayName(String calendarType, int field, int value, int style, Locale locale) {
         String name = null;
-        String key = getKey(calendarType, field, style);
+        String key = getResourceKey(calendarType, field, style);
         if (key != null) {
             ResourceBundle rb = LocaleProviderAdapter.forType(type).getLocaleData().getDateFormatData(locale);
             if (rb.containsKey(key)) {
@@ -64,9 +64,10 @@
                     name = strings[value];
                     // If name is empty in standalone, try its `format' style.
                     if (name.length() == 0
-                            && (style == SHORT_STANDALONE || style == LONG_STANDALONE)) {
+                            && (style == SHORT_STANDALONE || style == LONG_STANDALONE
+                                || style == NARROW_STANDALONE)) {
                         name = getDisplayName(calendarType, field, value,
-                                              style == SHORT_STANDALONE ? SHORT_FORMAT : LONG_FORMAT,
+                                              getBaseStyle(style),
                                               locale);
                     }
                 }
@@ -75,15 +76,17 @@
         return name;
     }
 
+    private static int[] REST_OF_STYLES = {
+        SHORT_STANDALONE, LONG_FORMAT, LONG_STANDALONE,
+        NARROW_FORMAT, NARROW_STANDALONE
+    };
     @Override
     public Map<String, Integer> getDisplayNames(String calendarType, int field, int style, Locale locale) {
         Map<String, Integer> names;
         if (style == ALL_STYLES) {
             names = getDisplayNamesImpl(calendarType, field, SHORT_FORMAT, locale);
-            if (field != AM_PM) {
-                for (int st : new int[] { SHORT_STANDALONE, LONG_FORMAT, LONG_STANDALONE }) {
-                    names.putAll(getDisplayNamesImpl(calendarType, field, st, locale));
-                }
+            for (int st : REST_OF_STYLES) {
+                names.putAll(getDisplayNamesImpl(calendarType, field, st, locale));
             }
         } else {
             // specific style
@@ -94,26 +97,28 @@
 
     private Map<String, Integer> getDisplayNamesImpl(String calendarType, int field,
                                                      int style, Locale locale) {
-        String key = getKey(calendarType, field, style);
+        String key = getResourceKey(calendarType, field, style);
         Map<String, Integer> map = new TreeMap<>(LengthBasedComparator.INSTANCE);
         if (key != null) {
             ResourceBundle rb = LocaleProviderAdapter.forType(type).getLocaleData().getDateFormatData(locale);
             if (rb.containsKey(key)) {
                 String[] strings = rb.getStringArray(key);
-                if (field == YEAR) {
-                    if (strings.length > 0) {
-                        map.put(strings[0], 1);
-                    }
-                } else {
-                    int base = (field == DAY_OF_WEEK) ? 1 : 0;
-                    for (int i = 0; i < strings.length; i++) {
-                        String name = strings[i];
-                        // Ignore any empty string (some standalone month names
-                        // are not defined)
-                        if (name.length() == 0) {
-                            continue;
+                if (!hasDuplicates(strings)) {
+                    if (field == YEAR) {
+                        if (strings.length > 0) {
+                            map.put(strings[0], 1);
                         }
-                        map.put(name, base + i);
+                    } else {
+                        int base = (field == DAY_OF_WEEK) ? 1 : 0;
+                        for (int i = 0; i < strings.length; i++) {
+                            String name = strings[i];
+                            // Ignore any empty string (some standalone month names
+                            // are not defined)
+                            if (name.length() == 0) {
+                                continue;
+                            }
+                            map.put(name, base + i);
+                        }
                     }
                 }
             }
@@ -121,6 +126,10 @@
         return map;
     }
 
+    private int getBaseStyle(int style) {
+        return style & ~(SHORT_STANDALONE - SHORT_FORMAT);
+    }
+
     /**
      * Comparator implementation for TreeMap which iterates keys from longest
      * to shortest.
@@ -180,55 +189,92 @@
         return langtags;
     }
 
-    private int getIntData(String key, Locale locale) {
-        ResourceBundle rb = LocaleProviderAdapter.forType(type).getLocaleData().getCalendarData(locale);
-        if (rb.containsKey(key)) {
-            String firstday = rb.getString(key);
-            return Integer.parseInt(firstday);
+    private boolean hasDuplicates(String[] strings) {
+        int len = strings.length;
+        for (int i = 0; i < len - 1; i++) {
+            String a = strings[i];
+            if (a != null) {
+                for (int j = i + 1; j < len; j++) {
+                    if (a.equals(strings[j]))  {
+                        return true;
+                    }
+                }
+            }
         }
-        // Note that the base bundle of CLDR doesn't have the Calendar week parameters.
-        return 0;
+        return false;
     }
 
-    private String getKey(String type, int field, int style) {
-        boolean standalone = (style & 0x8000) != 0;
-        style &= ~0x8000;
+    private String getResourceKey(String type, int field, int style) {
+        int baseStyle = getBaseStyle(style);
+        boolean isStandalone = (style != baseStyle);
 
         if ("gregory".equals(type)) {
             type = null;
         }
-
+        boolean isNarrow = (baseStyle == NARROW_FORMAT);
         StringBuilder key = new StringBuilder();
         switch (field) {
         case ERA:
             if (type != null) {
                 key.append(type).append('.');
             }
-            if (style == SHORT) {
-                key.append("short.");
+            if (isNarrow) {
+                key.append("narrow.");
+            } else {
+                // JRE and CLDR use different resource key conventions
+                // due to historical reasons. (JRE DateFormatSymbols.getEras returns
+                // abbreviations while other getShort*() return abbreviations.)
+                if (this.type == LocaleProviderAdapter.Type.JRE) {
+                    if (baseStyle == SHORT) {
+                        key.append("short.");
+                    }
+                } else { // CLDR
+                    if (baseStyle == LONG) {
+                        key.append("long.");
+                    }
+                }
             }
             key.append("Eras");
             break;
 
         case YEAR:
-            key.append(type).append(".FirstYear");
+            if (!isNarrow) {
+                key.append(type).append(".FirstYear");
+            }
             break;
 
         case MONTH:
-            if (standalone) {
+            if (isStandalone) {
                 key.append("standalone.");
             }
-            key.append(style == SHORT ? "MonthAbbreviations" : "MonthNames");
+            key.append("Month").append(toStyleName(baseStyle));
             break;
 
         case DAY_OF_WEEK:
-            key.append(style == SHORT ? "DayAbbreviations" : "DayNames");
+            // support standalone narrow day names
+            if (isStandalone && isNarrow) {
+                key.append("standalone.");
+            }
+            key.append("Day").append(toStyleName(baseStyle));
             break;
 
         case AM_PM:
+            if (isNarrow) {
+                key.append("narrow.");
+            }
             key.append("AmPmMarkers");
             break;
         }
         return key.length() > 0 ? key.toString() : null;
     }
+
+    private String toStyleName(int baseStyle) {
+        switch (baseStyle) {
+        case SHORT:
+            return "Abbreviations";
+        case NARROW_FORMAT:
+            return "Narrows";
+        }
+        return "Names";
+    }
 }
diff --git a/src/share/classes/sun/util/locale/provider/LocaleResources.java b/src/share/classes/sun/util/locale/provider/LocaleResources.java
index 16aae9a..ff389f6 100644
--- a/src/share/classes/sun/util/locale/provider/LocaleResources.java
+++ b/src/share/classes/sun/util/locale/provider/LocaleResources.java
@@ -46,7 +46,7 @@
 import java.util.ResourceBundle;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
-import sun.util.resources.OpenListResourceBundle;
+import sun.util.resources.TimeZoneNamesBundle;
 
 /**
  * Central accessor to locale-dependent resources.
@@ -67,13 +67,13 @@
         this.locale = locale;
     }
 
-    public OpenListResourceBundle getTimeZoneNames() {
-        OpenListResourceBundle tznames = (OpenListResourceBundle) cache.get("TimeZoneNames");
+    public TimeZoneNamesBundle getTimeZoneNames() {
+        TimeZoneNamesBundle tznames = (TimeZoneNamesBundle) cache.get("TimeZoneNames");
         if (tznames == null) {
             tznames = adapter.getLocaleData().getTimeZoneNames(locale);
-            OpenListResourceBundle olrb = (OpenListResourceBundle) cache.putIfAbsent("TimeZoneNames", tznames);
-            if (olrb != null) {
-                tznames = olrb;
+            TimeZoneNamesBundle tznb = (TimeZoneNamesBundle) cache.putIfAbsent("TimeZoneNames", tznames);
+            if (tznb != null) {
+                tznames = tznb;
             }
         }
         return tznames;
diff --git a/src/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java b/src/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java
index 15de9f5..59de0e2 100644
--- a/src/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java
+++ b/src/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java
@@ -604,5 +604,12 @@
             assert tznp != null;
             return tznp.getDisplayName(ID, daylight, style, locale);
         }
+
+        @Override
+        public String getGenericDisplayName(String ID, int style, Locale locale) {
+            TimeZoneNameProvider tznp = getImpl(locale);
+            assert tznp != null;
+            return tznp.getGenericDisplayName(ID, style, locale);
+        }
     }
 }
diff --git a/src/share/classes/sun/util/locale/provider/TimeZoneNameProviderImpl.java b/src/share/classes/sun/util/locale/provider/TimeZoneNameProviderImpl.java
index ff09286..28fd7af 100644
--- a/src/share/classes/sun/util/locale/provider/TimeZoneNameProviderImpl.java
+++ b/src/share/classes/sun/util/locale/provider/TimeZoneNameProviderImpl.java
@@ -25,11 +25,14 @@
 
 package sun.util.locale.provider;
 
+import java.util.LinkedHashSet;
 import java.util.Locale;
-import java.util.ResourceBundle;
+import java.util.Map;
 import java.util.Set;
 import java.util.TimeZone;
 import java.util.spi.TimeZoneNameProvider;
+import sun.util.calendar.ZoneInfo;
+import sun.util.resources.TimeZoneNamesBundle;
 
 /**
  * Concrete implementation of the
@@ -96,21 +99,67 @@
      */
     @Override
     public String getDisplayName(String id, boolean daylight, int style, Locale locale) {
+        String[] names = getDisplayNameArray(id, 5, locale);
+        if (names != null) {
+            int index = daylight ? 3 : 1;
+            if (style == TimeZone.SHORT) {
+                index++;
+            }
+            return names[index];
+        }
+        return null;
+    }
+
+    @Override
+    public String getGenericDisplayName(String id, int style, Locale locale) {
+        String[] names = getDisplayNameArray(id, 7, locale);
+        if (names != null && names.length >= 7) {
+            return names[(style == TimeZone.LONG) ? 5 : 6];
+        }
+        return null;
+    }
+
+    private String[] getDisplayNameArray(String id, int n, Locale locale) {
         if (id == null || locale == null) {
             throw new NullPointerException();
         }
-
         LocaleProviderAdapter adapter = LocaleProviderAdapter.forType(type);
-        ResourceBundle rb = adapter.getLocaleResources(locale).getTimeZoneNames();
-        if (rb.containsKey(id)) {
-                String[] names = rb.getStringArray(id);
-                int index = daylight ? 3 : 1;
-                if (style == TimeZone.SHORT) {
-                    index++;
-                }
-                return names[index];
-            }
+        TimeZoneNamesBundle rb = adapter.getLocaleResources(locale).getTimeZoneNames();
+        return rb.containsKey(id) ? rb.getStringArray(id, n) : null;
+    }
 
-        return null;
+    /**
+     * Returns a String[][] as the DateFormatSymbols.getZoneStrings() value for
+     * the given locale. This method is package private.
+     *
+     * @param locale a Locale for time zone names
+     * @return an array of time zone names arrays
+     */
+    String[][] getZoneStrings(Locale locale) {
+        LocaleProviderAdapter adapter = LocaleProviderAdapter.forType(type);
+        TimeZoneNamesBundle rb = adapter.getLocaleResources(locale).getTimeZoneNames();
+        Set<String> keyset = rb.keySet();
+        // Use a LinkedHashSet to preseve the order
+        Set<String[]> value = new LinkedHashSet<>();
+        for (String key : keyset) {
+            value.add(rb.getStringArray(key));
+        }
+
+        // Add aliases data for CLDR
+        if (type == LocaleProviderAdapter.Type.CLDR) {
+            // Note: TimeZoneNamesBundle creates a String[] on each getStringArray call.
+            Map<String, String> aliases = ZoneInfo.getAliasTable();
+            for (String alias : aliases.keySet()) {
+                if (!keyset.contains(alias)) {
+                    String tzid = aliases.get(alias);
+                    if (keyset.contains(tzid)) {
+                        String[] val = rb.getStringArray(tzid);
+                        val[0] = alias;
+                        value.add(val);
+                    }
+                }
+            }
+        }
+        return value.toArray(new String[0][]);
     }
 }
diff --git a/src/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java b/src/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java
index c28b0cb..a8e09a0 100644
--- a/src/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java
+++ b/src/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java
@@ -26,28 +26,28 @@
 package sun.util.locale.provider;
 
 import java.lang.ref.SoftReference;
-import java.util.Enumeration;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.spi.TimeZoneNameProvider;
 import sun.util.calendar.ZoneInfo;
 import sun.util.resources.OpenListResourceBundle;
+import sun.util.resources.TimeZoneNamesBundle;
 
 /**
  * Utility class that deals with the localized time zone names
  *
  * @author Naoto Sato
+ * @author Masayoshi Okutsu
  */
 public final class TimeZoneNameUtility {
 
     /**
      * cache to hold time zone resource bundles. Keyed by Locale
      */
-    private static ConcurrentHashMap<Locale, SoftReference<OpenListResourceBundle>> cachedBundles =
+    private static ConcurrentHashMap<Locale, SoftReference<TimeZoneNamesBundle>> cachedBundles =
         new ConcurrentHashMap<>();
 
     /**
@@ -73,15 +73,19 @@
     }
 
     private static String[][] loadZoneStrings(Locale locale) {
+        // If the provider is a TimeZoneNameProviderImpl, call its getZoneStrings
+        // in order to avoid per-ID retrieval.
+        LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(TimeZoneNameProvider.class, locale);
+        TimeZoneNameProvider provider = adapter.getTimeZoneNameProvider();
+        if (provider instanceof TimeZoneNameProviderImpl) {
+            return ((TimeZoneNameProviderImpl)provider).getZoneStrings(locale);
+        }
+
+        // Performs per-ID retrieval.
         List<String[]> zones = new LinkedList<>();
         OpenListResourceBundle rb = getBundle(locale);
-        Enumeration<String> keys = rb.getKeys();
-        String[] names;
-
-        while(keys.hasMoreElements()) {
-            String key = keys.nextElement();
-
-            names = retrieveDisplayNames(rb, key, locale);
+        for (String key : rb.keySet()) {
+            String[] names = retrieveDisplayNamesImpl(key, locale);
             if (names != null) {
                 zones.add(names);
             }
@@ -95,24 +99,50 @@
      * Retrieve display names for a time zone ID.
      */
     public static String[] retrieveDisplayNames(String id, Locale locale) {
-        OpenListResourceBundle rb = getBundle(locale);
-        return retrieveDisplayNames(rb, id, locale);
-    }
-
-    private static String[] retrieveDisplayNames(OpenListResourceBundle rb,
-                                                String id, Locale locale) {
         if (id == null || locale == null) {
             throw new NullPointerException();
         }
-
-        LocaleServiceProviderPool pool =
-            LocaleServiceProviderPool.getPool(TimeZoneNameProvider.class);
-        return pool.getLocalizedObject(TimeZoneNameGetter.INSTANCE, locale, id);
+        return retrieveDisplayNamesImpl(id, locale);
     }
 
-    private static OpenListResourceBundle getBundle(Locale locale) {
-        OpenListResourceBundle rb;
-        SoftReference<OpenListResourceBundle> data = cachedBundles.get(locale);
+    /**
+     * Retrieves a generic time zone display name for a time zone ID.
+     *
+     * @param id     time zone ID
+     * @param style  TimeZone.LONG or TimeZone.SHORT
+     * @param locale desired Locale
+     * @return the requested generic time zone display name, or null if not found.
+     */
+    public static String retrieveGenericDisplayName(String id, int style, Locale locale) {
+        LocaleServiceProviderPool pool =
+            LocaleServiceProviderPool.getPool(TimeZoneNameProvider.class);
+        return pool.getLocalizedObject(TimeZoneNameGetter.INSTANCE, locale, "generic", style, id);
+    }
+
+    /**
+     * Retrieves a standard or daylight-saving time name for the given time zone ID.
+     *
+     * @param id       time zone ID
+     * @param daylight true for a daylight saving time name, or false for a standard time name
+     * @param style    TimeZone.LONG or TimeZone.SHORT
+     * @param locale   desired Locale
+     * @return the requested time zone name, or null if not found.
+     */
+    public static String retrieveDisplayName(String id, boolean daylight, int style, Locale locale) {
+        LocaleServiceProviderPool pool =
+            LocaleServiceProviderPool.getPool(TimeZoneNameProvider.class);
+        return pool.getLocalizedObject(TimeZoneNameGetter.INSTANCE, locale, daylight ? "dst" : "std", style, id);
+    }
+
+    private static String[] retrieveDisplayNamesImpl(String id, Locale locale) {
+        LocaleServiceProviderPool pool =
+            LocaleServiceProviderPool.getPool(TimeZoneNameProvider.class);
+        return pool.getLocalizedObject(TimeZoneNameArrayGetter.INSTANCE, locale, id);
+    }
+
+    private static TimeZoneNamesBundle getBundle(Locale locale) {
+        TimeZoneNamesBundle rb;
+        SoftReference<TimeZoneNamesBundle> data = cachedBundles.get(locale);
 
         if (data == null || ((rb = data.get()) == null)) {
             rb = LocaleProviderAdapter.forJRE().getLocaleData().getTimeZoneNames(locale);
@@ -127,19 +157,18 @@
      * Obtains a localized time zone strings from a TimeZoneNameProvider
      * implementation.
      */
-    private static class TimeZoneNameGetter
+    private static class TimeZoneNameArrayGetter
         implements LocaleServiceProviderPool.LocalizedObjectGetter<TimeZoneNameProvider,
                                                                    String[]>{
-        private static final TimeZoneNameGetter INSTANCE =
-            new TimeZoneNameGetter();
+        private static final TimeZoneNameArrayGetter INSTANCE =
+            new TimeZoneNameArrayGetter();
 
         @Override
         public String[] getObject(TimeZoneNameProvider timeZoneNameProvider,
-                                Locale locale,
-                                String requestID,
-                                Object... params) {
+                                  Locale locale,
+                                  String requestID,
+                                  Object... params) {
             assert params.length == 0;
-            String queryID = requestID;
 
             // First, try to get names with the request ID
             String[] names = buildZoneStrings(timeZoneNameProvider, locale, requestID);
@@ -150,21 +179,15 @@
                 if (aliases != null) {
                     // Check whether this id is an alias, if so,
                     // look for the standard id.
-                    if (aliases.containsKey(queryID)) {
-                        String prevID = queryID;
-                        while ((queryID = aliases.get(queryID)) != null) {
-                            prevID = queryID;
-                        }
-                        queryID = prevID;
+                    String canonicalID = aliases.get(requestID);
+                    if (canonicalID != null) {
+                        names = buildZoneStrings(timeZoneNameProvider, locale, canonicalID);
                     }
-
-                    names = buildZoneStrings(timeZoneNameProvider, locale, queryID);
-
                     if (names == null) {
                         // There may be a case that a standard id has become an
                         // alias.  so, check the aliases backward.
                         names = examineAliases(timeZoneNameProvider, locale,
-                                               queryID, aliases, aliases.entrySet());
+                                   canonicalID == null ? requestID : canonicalID, aliases);
                     }
                 }
             }
@@ -178,20 +201,18 @@
 
         private static String[] examineAliases(TimeZoneNameProvider tznp, Locale locale,
                                                String id,
-                                               Map<String, String> aliases,
-                                               Set<Map.Entry<String, String>> aliasesSet) {
+                                               Map<String, String> aliases) {
             if (aliases.containsValue(id)) {
-                for (Map.Entry<String, String> entry : aliasesSet) {
+                for (Map.Entry<String, String> entry : aliases.entrySet()) {
                     if (entry.getValue().equals(id)) {
                         String alias = entry.getKey();
                         String[] names = buildZoneStrings(tznp, locale, alias);
                         if (names != null) {
                             return names;
-                        } else {
-                            names = examineAliases(tznp, locale, alias, aliases, aliasesSet);
-                            if (names != null) {
-                                return names;
-                            }
+                        }
+                        names = examineAliases(tznp, locale, alias, aliases);
+                        if (names != null) {
+                            return names;
                         }
                     }
                 }
@@ -201,7 +222,7 @@
         }
 
         private static String[] buildZoneStrings(TimeZoneNameProvider tznp,
-                                    Locale locale, String id) {
+                                                 Locale locale, String id) {
             String[] names = new String[5];
 
             for (int i = 1; i <= 4; i ++) {
@@ -220,6 +241,77 @@
         }
     }
 
+    private static class TimeZoneNameGetter
+        implements LocaleServiceProviderPool.LocalizedObjectGetter<TimeZoneNameProvider,
+                                                                   String> {
+        private static final TimeZoneNameGetter INSTANCE =
+            new TimeZoneNameGetter();
+
+        @Override
+        public String getObject(TimeZoneNameProvider timeZoneNameProvider,
+                                Locale locale,
+                                String requestID,
+                                Object... params) {
+            assert params.length == 2;
+            int style = (int) params[0];
+            String tzid = (String) params[1];
+            String value = getName(timeZoneNameProvider, locale, requestID, style, tzid);
+            if (value == null) {
+                Map<String, String> aliases = ZoneInfo.getAliasTable();
+                if (aliases != null) {
+                    String canonicalID = aliases.get(tzid);
+                    if (canonicalID != null) {
+                        value = getName(timeZoneNameProvider, locale, requestID, style, canonicalID);
+                    }
+                    if (value == null) {
+                        value = examineAliases(timeZoneNameProvider, locale, requestID,
+                                     canonicalID != null ? canonicalID : tzid, style, aliases);
+                    }
+                }
+            }
+
+            return value;
+        }
+
+        private static String examineAliases(TimeZoneNameProvider tznp, Locale locale,
+                                             String requestID, String tzid, int style,
+                                             Map<String, String> aliases) {
+            if (aliases.containsValue(tzid)) {
+                for (Map.Entry<String, String> entry : aliases.entrySet()) {
+                    if (entry.getValue().equals(tzid)) {
+                        String alias = entry.getKey();
+                        String name = getName(tznp, locale, requestID, style, alias);
+                        if (name != null) {
+                            return name;
+                        }
+                        name = examineAliases(tznp, locale, requestID, alias, style, aliases);
+                        if (name != null) {
+                            return name;
+                        }
+                    }
+                }
+            }
+            return null;
+        }
+
+        private static String getName(TimeZoneNameProvider timeZoneNameProvider,
+                                      Locale locale, String requestID, int style, String tzid) {
+            String value = null;
+            switch (requestID) {
+            case "std":
+                value = timeZoneNameProvider.getDisplayName(tzid, false, style, locale);
+                break;
+            case "dst":
+                value = timeZoneNameProvider.getDisplayName(tzid, true, style, locale);
+                break;
+            case "generic":
+                value = timeZoneNameProvider.getGenericDisplayName(tzid, style, locale);
+                break;
+            }
+            return value;
+        }
+    }
+
     // No instantiation
     private TimeZoneNameUtility() {
     }
diff --git a/src/share/classes/sun/util/resources/LocaleData.java b/src/share/classes/sun/util/resources/LocaleData.java
index 4570406..9a7a7c4 100644
--- a/src/share/classes/sun/util/resources/LocaleData.java
+++ b/src/share/classes/sun/util/resources/LocaleData.java
@@ -46,9 +46,9 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.ResourceBundle;
+import sun.util.locale.provider.LocaleDataMetaInfo;
 import sun.util.locale.provider.LocaleProviderAdapter;
 import static sun.util.locale.provider.LocaleProviderAdapter.Type.JRE;
-import sun.util.locale.provider.LocaleDataMetaInfo;
 
 /**
  * Provides information about and access to resource bundles in the
@@ -94,8 +94,8 @@
      * Gets a time zone names resource bundle, using privileges
      * to allow accessing a sun.* package.
      */
-    public OpenListResourceBundle getTimeZoneNames(Locale locale) {
-        return (OpenListResourceBundle) getBundle(type.getUtilResourcesPackage() + ".TimeZoneNames", locale);
+    public TimeZoneNamesBundle getTimeZoneNames(Locale locale) {
+        return (TimeZoneNamesBundle) getBundle(type.getUtilResourcesPackage() + ".TimeZoneNames", locale);
     }
 
     /**
@@ -158,30 +158,33 @@
             /* Get the locale string list from LocaleDataMetaInfo class. */
             String localeString = LocaleDataMetaInfo.getSupportedLocaleString(baseName);
 
-            if (localeString == null || localeString.length() == 0) {
-                return candidates;
-            }
-
-            for (Iterator<Locale> l = candidates.iterator(); l.hasNext(); ) {
-                Locale loc = l.next();
-                String lstr;
-                if (loc.getScript().length() > 0) {
-                    lstr = loc.toLanguageTag().replace('-', '_');
-                } else {
-                    lstr = loc.toString();
-                    int idx = lstr.indexOf("_#");
-                    if (idx >= 0) {
-                        lstr = lstr.substring(0, idx);
+            if (localeString != null && localeString.length() != 0) {
+                for (Iterator<Locale> l = candidates.iterator(); l.hasNext();) {
+                    Locale loc = l.next();
+                    String lstr;
+                    if (loc.getScript().length() > 0) {
+                        lstr = loc.toLanguageTag().replace('-', '_');
+                    } else {
+                        lstr = loc.toString();
+                        int idx = lstr.indexOf("_#");
+                        if (idx >= 0) {
+                            lstr = lstr.substring(0, idx);
+                        }
+                    }
+                    /* Every locale string in the locale string list returned from
+                     the above getSupportedLocaleString is enclosed
+                     within two white spaces so that we could check some locale
+                     such as "en".
+                     */
+                    if (lstr.length() != 0 && localeString.indexOf(" " + lstr + " ") == -1) {
+                        l.remove();
                     }
                 }
-                /* Every locale string in the locale string list returned from
-                   the above getSupportedLocaleString is enclosed
-                   within two white spaces so that we could check some locale
-                   such as "en".
-                */
-                if (lstr.length() != 0 && localeString.indexOf(" " + lstr + " ") == -1) {
-                    l.remove();
-                }
+            }
+            // Force fallback to Locale.ENGLISH for CLDR time zone names support
+            if (locale.getLanguage() != "en"
+                    && baseName.contains(CLDR) && baseName.endsWith("TimeZoneNames")) {
+                candidates.add(candidates.size() - 1, Locale.ENGLISH);
             }
             return candidates;
         }
diff --git a/src/share/classes/sun/util/resources/OpenListResourceBundle.java b/src/share/classes/sun/util/resources/OpenListResourceBundle.java
index e055193..494e5c8 100644
--- a/src/share/classes/sun/util/resources/OpenListResourceBundle.java
+++ b/src/share/classes/sun/util/resources/OpenListResourceBundle.java
@@ -67,6 +67,7 @@
     }
 
     // Implements java.util.ResourceBundle.handleGetObject; inherits javadoc specification.
+    @Override
     public Object handleGetObject(String key) {
         if (key == null) {
             throw new NullPointerException();
@@ -79,6 +80,7 @@
     /**
      * Implementation of ResourceBundle.getKeys.
      */
+    @Override
     public Enumeration<String> getKeys() {
         ResourceBundle parent = this.parent;
         return new ResourceBundleEnumeration(handleGetKeys(),
@@ -86,7 +88,8 @@
     }
 
     /**
-     * Returns a set of keys provided in this resource bundle
+     * Returns a set of keys provided in this resource bundle,
+     * including no parents.
      */
     public Set<String> handleGetKeys() {
         loadLookupTablesIfNecessary();
@@ -99,7 +102,7 @@
         if (keyset != null) {
             return keyset;
         }
-        Set<String> ks = new HashSet<>();
+        Set<String> ks = createSet();
         ks.addAll(handleGetKeys());
         if (parent != null) {
             ks.addAll(parent.keySet());
@@ -113,13 +116,6 @@
     }
 
     /**
-     * Returns the parent bundle
-     */
-    public OpenListResourceBundle getParent() {
-        return (OpenListResourceBundle)parent;
-    }
-
-    /**
      * See ListResourceBundle class description.
      */
     abstract protected Object[][] getContents();
@@ -160,10 +156,14 @@
      * Lets subclasses provide specialized Map implementations.
      * Default uses HashMap.
      */
-    protected Map<String, Object> createMap(int size) {
+    protected <K, V> Map<K, V> createMap(int size) {
         return new HashMap<>(size);
     }
 
+    protected <E> Set<E> createSet() {
+        return new HashSet<>();
+    }
+
     private volatile Map<String, Object> lookup = null;
     private volatile Set<String> keyset;
 }
diff --git a/src/share/classes/sun/util/resources/TimeZoneNames.java b/src/share/classes/sun/util/resources/TimeZoneNames.java
index 5b2931b..59af1d2 100644
--- a/src/share/classes/sun/util/resources/TimeZoneNames.java
+++ b/src/share/classes/sun/util/resources/TimeZoneNames.java
@@ -43,160 +43,238 @@
 public final class TimeZoneNames extends TimeZoneNamesBundle {
 
     protected final Object[][] getContents() {
+        // Note: generic names came from CLDR with some adjustments.
         String ACT[] = new String[] {"Acre Time", "ACT",
-                                     "Acre Summer Time", "ACST"};
+                                     "Acre Summer Time", "ACST",
+                                     "Acre Time", "ACT"};
         String ADELAIDE[] = new String[] {"Central Standard Time (South Australia)", "CST",
-                                          "Central Summer Time (South Australia)", "CST"};
+                                          "Central Summer Time (South Australia)", "CST",
+                                          "Central Time (South Australia)", "CT"};
         String AGT[] = new String[] {"Argentine Time", "ART",
-                                     "Argentine Summer Time", "ARST"};
+                                     "Argentine Summer Time", "ARST",
+                                     "Argentine Time", "ART"};
         String AKST[] = new String[] {"Alaska Standard Time", "AKST",
-                                      "Alaska Daylight Time", "AKDT"};
+                                      "Alaska Daylight Time", "AKDT",
+                                      "Alaska Time", "AKT"};
         String AMT[] = new String[] {"Amazon Time", "AMT",
-                                     "Amazon Summer Time", "AMST"};
+                                     "Amazon Summer Time", "AMST",
+                                     "Amazon Time", "AMT"};
         String ARAST[] = new String[] {"Arabia Standard Time", "AST",
-                                       "Arabia Daylight Time", "ADT"};
+                                       "Arabia Daylight Time", "ADT",
+                                       "Arabia Time", "AT"};
         String ARMT[] = new String[] {"Armenia Time", "AMT",
-                                      "Armenia Summer Time", "AMST"};
+                                      "Armenia Summer Time", "AMST",
+                                      "Armenia Time", "AMT"};
         String AST[] = new String[] {"Atlantic Standard Time", "AST",
-                                     "Atlantic Daylight Time", "ADT"};
+                                     "Atlantic Daylight Time", "ADT",
+                                     "Atlantic Time", "AT"};
         String BDT[] = new String[] {"Bangladesh Time", "BDT",
-                                     "Bangladesh Summer Time", "BDST"};
+                                     "Bangladesh Summer Time", "BDST",
+                                     "Bangladesh Time", "BDT"};
         String BRISBANE[] = new String[] {"Eastern Standard Time (Queensland)", "EST",
-                                          "Eastern Summer Time (Queensland)", "EST"};
+                                          "Eastern Summer Time (Queensland)", "EST",
+                                          "Eastern Time (Queensland)", "ET"};
         String BROKEN_HILL[] = new String[] {"Central Standard Time (South Australia/New South Wales)", "CST",
-                                             "Central Summer Time (South Australia/New South Wales)", "CST"};
+                                             "Central Summer Time (South Australia/New South Wales)", "CST",
+                                             "Central Time (South Australia/New South Wales)", "CT"};
         String BRT[] = new String[] {"Brasilia Time", "BRT",
-                                     "Brasilia Summer Time", "BRST"};
+                                     "Brasilia Summer Time", "BRST",
+                                     "Brasilia Time", "BRT"};
         String BTT[] = new String[] {"Bhutan Time", "BTT",
-                                     "Bhutan Summer Time", "BTST"};
+                                     "Bhutan Summer Time", "BTST",
+                                     "Bhutan Time", "BTT"};
         String CAT[] = new String[] {"Central African Time", "CAT",
-                                     "Central African Summer Time", "CAST"};
+                                     "Central African Summer Time", "CAST",
+                                     "Central Africa Time", "CAT"};
         String CET[] = new String[] {"Central European Time", "CET",
-                                     "Central European Summer Time", "CEST"};
+                                     "Central European Summer Time", "CEST",
+                                     "Central European Time", "CET"};
         String CHAST[] = new String[] {"Chatham Standard Time", "CHAST",
-                                       "Chatham Daylight Time", "CHADT"};
+                                       "Chatham Daylight Time", "CHADT",
+                                       "Chatham Time", "CHAT"};
         String CHUT[] = new String[] {"Chuuk Time", "CHUT",
-                                      "Chuuk Summer Time", "CHUST"};
+                                      "Chuuk Summer Time", "CHUST",
+                                      "Chuuk Time", "CHUT"};
         String CIT[] = new String[] {"Central Indonesia Time", "CIT",
-                                     "Central Indonesia Summer Time", "CIST"};
+                                     "Central Indonesia Summer Time", "CIST",
+                                     "Central Indonesia Time", "CIT"};
         String CLT[] = new String[] {"Chile Time", "CLT",
-                                     "Chile Summer Time", "CLST"};
+                                     "Chile Summer Time", "CLST",
+                                     "Chile Time", "CLT"};
         String CST[] = new String[] {"Central Standard Time", "CST",
-                                     "Central Daylight Time", "CDT"};
+                                     "Central Daylight Time", "CDT",
+                                     "Central Time", "CT"};
         String CTT[] = new String[] {"China Standard Time", "CST",
-                                     "China Daylight Time", "CDT"};
+                                     "China Daylight Time", "CDT",
+                                     "China Time", "CT"};
         String CUBA[] = new String[] {"Cuba Standard Time", "CST",
-                                      "Cuba Daylight Time", "CDT"};
+                                      "Cuba Daylight Time", "CDT",
+                                      "Cuba Time", "CT"};
         String DARWIN[] = new String[] {"Central Standard Time (Northern Territory)", "CST",
-                                        "Central Summer Time (Northern Territory)", "CST"};
+                                        "Central Summer Time (Northern Territory)", "CST",
+                                        "Central Time (Northern Territory)", "CT"};
         String DUBLIN[] = new String[] {"Greenwich Mean Time", "GMT",
-                                        "Irish Summer Time", "IST"};
+                                        "Irish Summer Time", "IST",
+                                        "Irish Time", "IT"};
         String EAT[] = new String[] {"Eastern African Time", "EAT",
-                                     "Eastern African Summer Time", "EAST"};
+                                     "Eastern African Summer Time", "EAST",
+                                     "Eastern Africa Time", "EAT"};
         String EASTER[] = new String[] {"Easter Is. Time", "EAST",
-                                        "Easter Is. Summer Time", "EASST"};
+                                        "Easter Is. Summer Time", "EASST",
+                                        "Easter Is. Time", "EAST"};
         String EET[] = new String[] {"Eastern European Time", "EET",
-                                     "Eastern European Summer Time", "EEST"};
+                                     "Eastern European Summer Time", "EEST",
+                                     "Eastern European Time", "EET"};
         String EGT[] = new String[] {"Eastern Greenland Time", "EGT",
-                                     "Eastern Greenland Summer Time", "EGST"};
+                                     "Eastern Greenland Summer Time", "EGST",
+                                     "Eastern Greenland Time", "EGT"};
         String EST[] = new String[] {"Eastern Standard Time", "EST",
-                                     "Eastern Daylight Time", "EDT"};
+                                     "Eastern Daylight Time", "EDT",
+                                     "Eastern Time", "ET"};
         String EST_NSW[] = new String[] {"Eastern Standard Time (New South Wales)", "EST",
-                                         "Eastern Summer Time (New South Wales)", "EST"};
+                                         "Eastern Summer Time (New South Wales)", "EST",
+                                         "Eastern Time (New South Wales)", "ET"};
         String FET[] = new String[] {"Further-eastern European Time", "FET",
-                                     "Further-eastern European Summer Time", "FEST"};
+                                     "Further-eastern European Summer Time", "FEST",
+                                     "Further-eastern European Time", "FET"};
         String GHMT[] = new String[] {"Ghana Mean Time", "GMT",
-                                     "Ghana Summer Time", "GHST"};
+                                      "Ghana Summer Time", "GHST",
+                                      "Ghana Mean Time", "GMT"};
         String GAMBIER[] =  new String[] {"Gambier Time", "GAMT",
-                                          "Gambier Summer Time", "GAMST"};
+                                          "Gambier Summer Time", "GAMST",
+                                          "Gambier Time", "GAMT"};
         String GMT[] = new String[] {"Greenwich Mean Time", "GMT",
+                                     "Greenwich Mean Time", "GMT",
                                      "Greenwich Mean Time", "GMT"};
         String GMTBST[] = new String[] {"Greenwich Mean Time", "GMT",
-                                        "British Summer Time", "BST"};
+                                        "British Summer Time", "BST",
+                                        "British Time", "BT"};
         String GST[] = new String[] {"Gulf Standard Time", "GST",
-                                     "Gulf Daylight Time", "GDT"};
+                                     "Gulf Daylight Time", "GDT",
+                                     "Gulf Time", "GT"};
         String HAST[] = new String[] {"Hawaii-Aleutian Standard Time", "HAST",
-                                      "Hawaii-Aleutian Daylight Time", "HADT"};
+                                      "Hawaii-Aleutian Daylight Time", "HADT",
+                                      "Hawaii-Aleutian Time", "HAT"};
         String HKT[] =  new String[] {"Hong Kong Time", "HKT",
-                                      "Hong Kong Summer Time", "HKST"};
+                                      "Hong Kong Summer Time", "HKST",
+                                      "Hong Kong Time", "HKT"};
         String HST[] = new String[] {"Hawaii Standard Time", "HST",
-                                     "Hawaii Daylight Time", "HDT"};
+                                     "Hawaii Daylight Time", "HDT",
+                                     "Hawaii Time", "HT"};
         String ICT[] = new String[] {"Indochina Time", "ICT",
-                                     "Indochina Summer Time", "ICST"};
+                                     "Indochina Summer Time", "ICST",
+                                     "Indochina Time", "ICT"};
         String IRT[] = new String[] {"Iran Standard Time", "IRST",
-                                     "Iran Daylight Time", "IRDT"};
+                                     "Iran Daylight Time", "IRDT",
+                                     "Iran Time", "IRT"};
         String ISRAEL[] = new String[] {"Israel Standard Time", "IST",
-                                        "Israel Daylight Time", "IDT"};
+                                        "Israel Daylight Time", "IDT",
+                                        "Israel Time", "IT"};
         String IST[] = new String[] {"India Standard Time", "IST",
-                                     "India Daylight Time", "IDT"};
+                                     "India Daylight Time", "IDT",
+                                     "India Time", "IT"};
         String JST[] = new String[] {"Japan Standard Time", "JST",
-                                     "Japan Daylight Time", "JDT"};
+                                     "Japan Daylight Time", "JDT",
+                                     "Japan Time", "JT"};
         String KST[] = new String[] {"Korea Standard Time", "KST",
-                                     "Korea Daylight Time", "KDT"};
+                                     "Korea Daylight Time", "KDT",
+                                     "Korea Time", "KT"};
         String LORD_HOWE[] = new String[] {"Lord Howe Standard Time", "LHST",
-                                           "Lord Howe Summer Time", "LHST"};
+                                           "Lord Howe Summer Time", "LHST",
+                                           "Lord Howe Time", "LHT"};
         String MHT[] = new String[] {"Marshall Islands Time", "MHT",
-                                     "Marshall Islands Summer Time", "MHST"};
+                                     "Marshall Islands Summer Time", "MHST",
+                                     "Marshall Islands Time", "MHT"};
         String MSK[] = new String[] {"Moscow Standard Time", "MSK",
-                                     "Moscow Daylight Time", "MSD"};
+                                     "Moscow Daylight Time", "MSD",
+                                     "Moscow Time", "MT"};
         String MST[] = new String[] {"Mountain Standard Time", "MST",
-                                     "Mountain Daylight Time", "MDT"};
+                                     "Mountain Daylight Time", "MDT",
+                                     "Mountain Time", "MT"};
         String MYT[] = new String[] {"Malaysia Time", "MYT",
-                                     "Malaysia Summer Time", "MYST"};
+                                     "Malaysia Summer Time", "MYST",
+                                     "Malaysia Time", "MYT"};
         String NORONHA[] = new String[] {"Fernando de Noronha Time", "FNT",
-                                         "Fernando de Noronha Summer Time", "FNST"};
+                                         "Fernando de Noronha Summer Time", "FNST",
+                                         "Fernando de Noronha Time", "FNT"};
         String NOVT[] = new String[] {"Novosibirsk Time", "NOVT",
-                                      "Novosibirsk Summer Time", "NOVST"};
+                                      "Novosibirsk Summer Time", "NOVST",
+                                      "Novosibirsk Time", "NOVT"};
         String NPT[] = new String[] {"Nepal Time", "NPT",
-                                     "Nepal Summer Time", "NPST"};
+                                     "Nepal Summer Time", "NPST",
+                                     "Nepal Time", "NPT"};
         String NST[] = new String[] {"Newfoundland Standard Time", "NST",
-                                     "Newfoundland Daylight Time", "NDT"};
+                                     "Newfoundland Daylight Time", "NDT",
+                                     "Newfoundland Time", "NT"};
         String NZST[] = new String[] {"New Zealand Standard Time", "NZST",
-                                      "New Zealand Daylight Time", "NZDT"};
+                                      "New Zealand Daylight Time", "NZDT",
+                                      "New Zealand Time", "NZT"};
         String PITCAIRN[] = new String[] {"Pitcairn Standard Time", "PST",
-                                          "Pitcairn Daylight Time", "PDT"};
+                                          "Pitcairn Daylight Time", "PDT",
+                                          "Pitcairn Time", "PT"};
         String PKT[] = new String[] {"Pakistan Time", "PKT",
-                                     "Pakistan Summer Time", "PKST"};
+                                     "Pakistan Summer Time", "PKST",
+                                     "Pakistan Time", "PKT"};
         String PONT[] = new String[] {"Pohnpei Time", "PONT",
-                                      "Pohnpei Summer Time", "PONST"};
+                                      "Pohnpei Summer Time", "PONST",
+                                      "Ponape Time", "PONT"};
         String PST[] = new String[] {"Pacific Standard Time", "PST",
-                                     "Pacific Daylight Time", "PDT"};
+                                     "Pacific Daylight Time", "PDT",
+                                     "Pacific Time", "PT"};
         String SAST[] = new String[] {"South Africa Standard Time", "SAST",
-                                      "South Africa Summer Time", "SAST"};
+                                      "South Africa Summer Time", "SAST",
+                                      "South Africa Time", "SAT"};
         String SBT[] = new String[] {"Solomon Is. Time", "SBT",
-                                     "Solomon Is. Summer Time", "SBST"};
+                                     "Solomon Is. Summer Time", "SBST",
+                                     "Solomon Is. Time", "SBT"};
         String SGT[] = new String[] {"Singapore Time", "SGT",
-                                     "Singapore Summer Time", "SGST"};
+                                     "Singapore Summer Time", "SGST",
+                                     "Singapore Time", "SGT"};
         String SLST[] = new String[] {"Greenwich Mean Time", "GMT",
-                                      "Sierra Leone Summer Time", "SLST"};
+                                      "Sierra Leone Summer Time", "SLST",
+                                      "Sierra Leone Time", "SLT"};
         String TASMANIA[] = new String[] {"Eastern Standard Time (Tasmania)", "EST",
-                                          "Eastern Summer Time (Tasmania)", "EST"};
+                                          "Eastern Summer Time (Tasmania)", "EST",
+                                          "Eastern Time (Tasmania)", "ET"};
         String TMT[] = new String[] {"Turkmenistan Time", "TMT",
-                                     "Turkmenistan Summer Time", "TMST"};
+                                     "Turkmenistan Summer Time", "TMST",
+                                     "Turkmenistan Time", "TMT"};
         String ULAT[]= new String[] {"Ulaanbaatar Time", "ULAT",
-                                     "Ulaanbaatar Summer Time", "ULAST"};
+                                     "Ulaanbaatar Summer Time", "ULAST",
+                                     "Ulaanbaatar Time", "ULAT"};
         String WART[] = new String[] {"Western Argentine Time", "WART",
-                                      "Western Argentine Summer Time", "WARST"};
+                                      "Western Argentine Summer Time", "WARST",
+                                      "Western Argentine Time", "WART"};
         String WAT[] = new String[] {"Western African Time", "WAT",
-                                     "Western African Summer Time", "WAST"};
+                                     "Western African Summer Time", "WAST",
+                                     "Western African Time", "WAT"};
         String WET[] = new String[] {"Western European Time", "WET",
-                                     "Western European Summer Time", "WEST"};
+                                     "Western European Summer Time", "WEST",
+                                     "Western European Time", "WET"};
         String WIT[] = new String[] {"West Indonesia Time", "WIT",
-                                     "West Indonesia Summer Time", "WIST"};
+                                     "West Indonesia Summer Time", "WIST",
+                                     "West Indonesia Time", "WIT"};
         String WST_AUS[] = new String[] {"Western Standard Time (Australia)", "WST",
-                                         "Western Summer Time (Australia)", "WST"};
+                                         "Western Summer Time (Australia)", "WST",
+                                         "Western Time (Australia)", "WT"};
         String SAMOA[] = new String[] {"Samoa Standard Time", "SST",
-                                       "Samoa Daylight Time", "SDT"};
+                                       "Samoa Daylight Time", "SDT",
+                                       "Samoa Time", "ST"};
         String WST_SAMOA[] = new String[] {"West Samoa Time", "WST",
-                                           "West Samoa Daylight Time", "WSDT"};
+                                           "West Samoa Daylight Time", "WSDT",
+                                           "West Samoa Time", "WST"};
         String ChST[] = new String[] {"Chamorro Standard Time", "ChST",
-                                      "Chamorro Daylight Time", "ChDT"};
+                                      "Chamorro Daylight Time", "ChDT",
+                                      "Chamorro Time", "ChT"};
         String VICTORIA[] = new String[] {"Eastern Standard Time (Victoria)", "EST",
-                                          "Eastern Summer Time (Victoria)", "EST"};
+                                          "Eastern Summer Time (Victoria)", "EST",
+                                          "Eastern Time (Victoria)", "ET"};
         String UTC[] = new String[] {"Coordinated Universal Time", "UTC",
+                                     "Coordinated Universal Time", "UTC",
                                      "Coordinated Universal Time", "UTC"};
         String UZT[] = new String[] {"Uzbekistan Time", "UZT",
-                                     "Uzbekistan Summer Time", "UZST"};
+                                     "Uzbekistan Summer Time", "UZST",
+                                     "Uzbekistan Time", "UZT"};
 
         return new Object[][] {
             {"America/Los_Angeles", PST},
@@ -309,7 +387,8 @@
             {"America/Argentina/Ushuaia", AGT},
             {"America/Aruba", AST},
             {"America/Asuncion", new String[] {"Paraguay Time", "PYT",
-                                               "Paraguay Summer Time", "PYST"}},
+                                               "Paraguay Summer Time", "PYST",
+                                               "Paraguay Time", "PYT"}},
             {"America/Atikokan", EST},
             {"America/Atka", HAST},
             {"America/Bahia", BRT},
@@ -320,17 +399,20 @@
             {"America/Blanc-Sablon", AST},
             {"America/Boa_Vista", AMT},
             {"America/Bogota", new String[] {"Colombia Time", "COT",
-                                             "Colombia Summer Time", "COST"}},
+                                             "Colombia Summer Time", "COST",
+                                             "Colombia Time", "COT"}},
             {"America/Boise", MST},
             {"America/Buenos_Aires", AGT},
             {"America/Cambridge_Bay", MST},
             {"America/Campo_Grande", AMT},
             {"America/Cancun", CST},
             {"America/Caracas", new String[] {"Venezuela Time", "VET",
-                                              "Venezuela Summer Time", "VEST"}},
+                                              "Venezuela Summer Time", "VEST",
+                                              "Venezuela Time", "VET"}},
             {"America/Catamarca", AGT},
             {"America/Cayenne", new String[] {"French Guiana Time", "GFT",
-                                              "French Guiana Summer Time", "GFST"}},
+                                              "French Guiana Summer Time", "GFST",
+                                              "French Guiana Time", "GFT"}},
             {"America/Cayman", EST},
             {"America/Chihuahua", MST},
             {"America/Creston", MST},
@@ -352,16 +434,19 @@
             {"America/Fortaleza", BRT},
             {"America/Glace_Bay", AST},
             {"America/Godthab", new String[] {"Western Greenland Time", "WGT",
-                                              "Western Greenland Summer Time", "WGST"}},
+                                              "Western Greenland Summer Time", "WGST",
+                                              "Western Greenland Time", "WGT"}},
             {"America/Goose_Bay", AST},
             {"America/Grand_Turk", EST},
             {"America/Grenada", AST},
             {"America/Guadeloupe", AST},
             {"America/Guatemala", CST},
             {"America/Guayaquil", new String[] {"Ecuador Time", "ECT",
-                                                "Ecuador Summer Time", "ECST"}},
+                                                "Ecuador Summer Time", "ECST",
+                                                "Ecuador Time", "ECT"}},
             {"America/Guyana", new String[] {"Guyana Time", "GYT",
-                                             "Guyana Summer Time", "GYST"}},
+                                             "Guyana Summer Time", "GYST",
+                                             "Guyana Time", "GYT"}},
             {"America/Havana", CUBA},
             {"America/Hermosillo", MST},
             {"America/Indiana/Indianapolis", EST},
@@ -382,9 +467,11 @@
             {"America/Knox_IN", CST},
             {"America/Kralendijk", AST},
             {"America/La_Paz", new String[] {"Bolivia Time", "BOT",
-                                             "Bolivia Summer Time", "BOST"}},
+                                             "Bolivia Summer Time", "BOST",
+                                             "Bolivia Time", "BOT"}},
             {"America/Lima", new String[] {"Peru Time", "PET",
-                                           "Peru Summer Time", "PEST"}},
+                                           "Peru Summer Time", "PEST",
+                                           "Peru Time", "PET"}},
             {"America/Louisville", EST},
             {"America/Lower_Princes", AST},
             {"America/Maceio", BRT},
@@ -398,13 +485,16 @@
             {"America/Menominee", CST},
             {"America/Merida", CST},
             {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
-                                                 "Metlakatla Daylight Time", "MeDT"}},
+                                                 "Metlakatla Daylight Time", "MeDT",
+                                                 "Metlakatla Time", "MeT"}},
             {"America/Mexico_City", CST},
             {"America/Miquelon", new String[] {"Pierre & Miquelon Standard Time", "PMST",
-                                               "Pierre & Miquelon Daylight Time", "PMDT"}},
+                                               "Pierre & Miquelon Daylight Time", "PMDT",
+                                               "Pierre & Miquelon Time", "PMT"}},
             {"America/Moncton", AST},
             {"America/Montevideo", new String[] {"Uruguay Time", "UYT",
-                                                 "Uruguay Summer Time", "UYST"}},
+                                                 "Uruguay Summer Time", "UYST",
+                                                 "Uruguay Time", "UYT"}},
             {"America/Monterrey", CST},
             {"America/Montreal", EST},
             {"America/Montserrat", AST},
@@ -419,7 +509,8 @@
             {"America/Panama", EST},
             {"America/Pangnirtung", EST},
             {"America/Paramaribo", new String[] {"Suriname Time", "SRT",
-                                                 "Suriname Summer Time", "SRST"}},
+                                                 "Suriname Summer Time", "SRST",
+                                                 "Suriname Time", "SRT"}},
             {"America/Port-au-Prince", EST},
             {"America/Port_of_Spain", AST},
             {"America/Porto_Acre", AMT},
@@ -459,113 +550,143 @@
             {"America/Yellowknife", MST},
             {"Antarctica/Casey", WST_AUS},
             {"Antarctica/Davis", new String[] {"Davis Time", "DAVT",
-                                               "Davis Summer Time", "DAVST"}},
+                                               "Davis Summer Time", "DAVST",
+                                               "Davis Time", "DAVT"}},
             {"Antarctica/DumontDUrville", new String[] {"Dumont-d'Urville Time", "DDUT",
-                                                        "Dumont-d'Urville Summer Time", "DDUST"}},
+                                                        "Dumont-d'Urville Summer Time", "DDUST",
+                                                        "Dumont-d'Urville Time", "DDUT"}},
             {"Antarctica/Macquarie", new String[] {"Macquarie Island Time", "MIST",
-                                                   "Macquarie Island Summer Time", "MIST"}},
+                                                   "Macquarie Island Summer Time", "MIST",
+                                                   "Macquarie Island Time", "MIST"}},
             {"Antarctica/Mawson", new String[] {"Mawson Time", "MAWT",
-                                                "Mawson Summer Time", "MAWST"}},
+                                                "Mawson Summer Time", "MAWST",
+                                                "Mawson Time", "MAWT"}},
             {"Antarctica/McMurdo", NZST},
             {"Antarctica/Palmer", CLT},
             {"Antarctica/Rothera", new String[] {"Rothera Time", "ROTT",
-                                                 "Rothera Summer Time", "ROTST"}},
+                                                 "Rothera Summer Time", "ROTST",
+                                                 "Rothera Time", "ROTT"}},
             {"Antarctica/South_Pole", NZST},
             {"Antarctica/Syowa", new String[] {"Syowa Time", "SYOT",
-                                               "Syowa Summer Time", "SYOST"}},
+                                               "Syowa Summer Time", "SYOST",
+                                               "Syowa Time", "SYOT"}},
             {"Antarctica/Vostok", new String[] {"Vostok Time", "VOST",
-                                                "Vostok Summer Time", "VOSST"}},
+                                                "Vostok Summer Time", "VOSST",
+                                                "Vostok Time", "VOST"}},
             {"Arctic/Longyearbyen", CET},
             {"Asia/Aden", ARAST},
             {"Asia/Almaty", new String[] {"Alma-Ata Time", "ALMT",
-                                          "Alma-Ata Summer Time", "ALMST"}},
+                                          "Alma-Ata Summer Time", "ALMST",
+                                          "Alma-Ata Time", "ALMT"}},
             {"Asia/Amman", EET},
             {"Asia/Anadyr", new String[] {"Anadyr Time", "ANAT",
-                                          "Anadyr Summer Time", "ANAST"}},
+                                          "Anadyr Summer Time", "ANAST",
+                                          "Anadyr Time", "ANAT"}},
             {"Asia/Aqtau", new String[] {"Aqtau Time", "AQTT",
-                                         "Aqtau Summer Time", "AQTST"}},
+                                         "Aqtau Summer Time", "AQTST",
+                                         "Aqtau Time", "AQTT"}},
             {"Asia/Aqtobe", new String[] {"Aqtobe Time", "AQTT",
-                                          "Aqtobe Summer Time", "AQTST"}},
+                                          "Aqtobe Summer Time", "AQTST",
+                                          "Aqtobe Time", "AQTT"}},
             {"Asia/Ashgabat", TMT},
             {"Asia/Ashkhabad", TMT},
             {"Asia/Baghdad", ARAST},
             {"Asia/Bahrain", ARAST},
             {"Asia/Baku", new String[] {"Azerbaijan Time", "AZT",
-                                        "Azerbaijan Summer Time", "AZST"}},
+                                        "Azerbaijan Summer Time", "AZST",
+                                        "Azerbaijan Time", "AZT"}},
             {"Asia/Bangkok", ICT},
             {"Asia/Beirut", EET},
             {"Asia/Bishkek", new String[] {"Kirgizstan Time", "KGT",
-                                           "Kirgizstan Summer Time", "KGST"}},
+                                           "Kirgizstan Summer Time", "KGST",
+                                           "Kirgizstan Time", "KGT"}},
             {"Asia/Brunei", new String[] {"Brunei Time", "BNT",
-                                          "Brunei Summer Time", "BNST"}},
+                                          "Brunei Summer Time", "BNST",
+                                          "Brunei Time", "BNT"}},
             {"Asia/Calcutta", IST},
             {"Asia/Choibalsan", new String[] {"Choibalsan Time", "CHOT",
-                                              "Choibalsan Summer Time", "CHOST"}},
+                                              "Choibalsan Summer Time", "CHOST",
+                                              "Choibalsan Time", "CHOT"}},
             {"Asia/Chongqing", CTT},
             {"Asia/Chungking", CTT},
             {"Asia/Colombo", IST},
             {"Asia/Dacca", BDT},
             {"Asia/Dhaka", BDT},
             {"Asia/Dili", new String[] {"Timor-Leste Time", "TLT",
-                                        "Timor-Leste Summer Time", "TLST"}},
+                                        "Timor-Leste Summer Time", "TLST",
+                                        "Timor-Leste Time", "TLT"}},
             {"Asia/Damascus", EET},
             {"Asia/Dubai", GST},
             {"Asia/Dushanbe", new String[] {"Tajikistan Time", "TJT",
-                                            "Tajikistan Summer Time", "TJST"}},
+                                            "Tajikistan Summer Time", "TJST",
+                                            "Tajikistan Time", "TJT"}},
             {"Asia/Gaza", EET},
             {"Asia/Harbin", CTT},
             {"Asia/Hebron", EET},
             {"Asia/Ho_Chi_Minh", ICT},
             {"Asia/Hong_Kong", HKT},
             {"Asia/Hovd", new String[] {"Hovd Time", "HOVT",
-                                        "Hovd Summer Time", "HOVST"}},
+                                        "Hovd Summer Time", "HOVST",
+                                        "Hovd Time", "HOVT"}},
             {"Asia/Irkutsk", new String[] {"Irkutsk Time", "IRKT",
-                                           "Irkutsk Summer Time", "IRKST"}},
+                                           "Irkutsk Summer Time", "IRKST",
+                                           "Irkutsk Time", "IRKT"}},
             {"Asia/Istanbul", EET},
             {"Asia/Jakarta", WIT},
             {"Asia/Jayapura", new String[] {"East Indonesia Time", "EIT",
-                                            "East Indonesia Summer Time", "EIST"}},
+                                            "East Indonesia Summer Time", "EIST",
+                                            "East Indonesia Time", "EIT"}},
             {"Asia/Kabul", new String[] {"Afghanistan Time", "AFT",
-                                         "Afghanistan Summer Time", "AFST"}},
+                                         "Afghanistan Summer Time", "AFST",
+                                         "Afghanistan Time", "AFT"}},
             {"Asia/Kamchatka", new String[] {"Petropavlovsk-Kamchatski Time", "PETT",
-                                             "Petropavlovsk-Kamchatski Summer Time", "PETST"}},
+                                             "Petropavlovsk-Kamchatski Summer Time", "PETST",
+                                             "Petropavlovsk-Kamchatski Time", "PETT"}},
             {"Asia/Karachi", PKT},
             {"Asia/Kashgar", CTT},
             {"Asia/Kathmandu", NPT},
             {"Asia/Katmandu", NPT},
             {"Asia/Kolkata", IST},
             {"Asia/Krasnoyarsk", new String[] {"Krasnoyarsk Time", "KRAT",
-                                               "Krasnoyarsk Summer Time", "KRAST"}},
+                                               "Krasnoyarsk Summer Time", "KRAST",
+                                               "Krasnoyarsk Time", "KRAT"}},
             {"Asia/Kuala_Lumpur", MYT},
             {"Asia/Kuching", MYT},
             {"Asia/Kuwait", ARAST},
             {"Asia/Macao", CTT},
             {"Asia/Macau", CTT},
             {"Asia/Magadan", new String[] {"Magadan Time", "MAGT",
-                                           "Magadan Summer Time", "MAGST"}},
+                                           "Magadan Summer Time", "MAGST",
+                                           "Magadan Time", "MAGT"}},
             {"Asia/Makassar", CIT},
             {"Asia/Manila", new String[] {"Philippines Time", "PHT",
-                                          "Philippines Summer Time", "PHST"}},
+                                          "Philippines Summer Time", "PHST",
+                                          "Philippines Time", "PHT"}},
             {"Asia/Muscat", GST},
             {"Asia/Nicosia", EET},
             {"Asia/Novokuznetsk", NOVT},
             {"Asia/Novosibirsk", NOVT},
             {"Asia/Oral", new String[] {"Oral Time", "ORAT",
-                                        "Oral Summer Time", "ORAST"}},
+                                        "Oral Summer Time", "ORAST",
+                                        "Oral Time", "ORAT"}},
             {"Asia/Omsk", new String[] {"Omsk Time", "OMST",
-                                        "Omsk Summer Time", "OMSST"}},
+                                        "Omsk Summer Time", "OMSST",
+                                        "Omsk Time", "OMST"}},
             {"Asia/Phnom_Penh", ICT},
             {"Asia/Pontianak", WIT},
             {"Asia/Pyongyang", KST},
             {"Asia/Qatar", ARAST},
             {"Asia/Qyzylorda", new String[] {"Qyzylorda Time", "QYZT",
-                                             "Qyzylorda Summer Time", "QYZST"}},
+                                             "Qyzylorda Summer Time", "QYZST",
+                                             "Qyzylorda Time", "QYZT"}},
             {"Asia/Rangoon", new String[] {"Myanmar Time", "MMT",
-                                           "Myanmar Summer Time", "MMST"}},
+                                           "Myanmar Summer Time", "MMST",
+                                           "Myanmar Time", "MMT"}},
             {"Asia/Riyadh", ARAST},
             {"Asia/Saigon", ICT},
             {"Asia/Sakhalin", new String[] {"Sakhalin Time", "SAKT",
-                                            "Sakhalin Summer Time", "SAKST"}},
+                                            "Sakhalin Summer Time", "SAKST",
+                                            "Sakhalin Time", "SAKT"}},
             {"Asia/Samarkand", UZT},
             {"Asia/Seoul", KST},
             {"Asia/Singapore", SGT},
@@ -573,7 +694,8 @@
             {"Asia/Tel_Aviv", ISRAEL},
             {"Asia/Tashkent", UZT},
             {"Asia/Tbilisi", new String[] {"Georgia Time", "GET",
-                                           "Georgia Summer Time", "GEST"}},
+                                           "Georgia Summer Time", "GEST",
+                                           "Georgia Time", "GET"}},
             {"Asia/Tehran", IRT},
             {"Asia/Thimbu", BTT},
             {"Asia/Thimphu", BTT},
@@ -583,28 +705,35 @@
             {"Asia/Urumqi", CTT},
             {"Asia/Vientiane", ICT},
             {"Asia/Vladivostok", new String[] {"Vladivostok Time", "VLAT",
-                                               "Vladivostok Summer Time", "VLAST"}},
+                                               "Vladivostok Summer Time", "VLAST",
+                                               "Vladivostok Time", "VLAT"}},
             {"Asia/Yakutsk", new String[] {"Yakutsk Time", "YAKT",
-                                           "Yakutsk Summer Time", "YAKST"}},
+                                           "Yakutsk Summer Time", "YAKST",
+                                           "Yakutsk Time", "YAKT"}},
             {"Asia/Yekaterinburg", new String[] {"Yekaterinburg Time", "YEKT",
-                                                 "Yekaterinburg Summer Time", "YEKST"}},
+                                                 "Yekaterinburg Summer Time", "YEKST",
+                                                 "Yekaterinburg Time", "YEKT"}},
             {"Asia/Yerevan", ARMT},
             {"Atlantic/Azores", new String[] {"Azores Time", "AZOT",
-                                              "Azores Summer Time", "AZOST"}},
+                                              "Azores Summer Time", "AZOST",
+                                              "Azores Time", "AZOT"}},
             {"Atlantic/Bermuda", AST},
             {"Atlantic/Canary", WET},
             {"Atlantic/Cape_Verde", new String[] {"Cape Verde Time", "CVT",
-                                                  "Cape Verde Summer Time", "CVST"}},
+                                                  "Cape Verde Summer Time", "CVST",
+                                                  "Cape Verde Time", "CVT"}},
             {"Atlantic/Faeroe", WET},
             {"Atlantic/Faroe", WET},
             {"Atlantic/Jan_Mayen", CET},
             {"Atlantic/Madeira", WET},
             {"Atlantic/Reykjavik", GMT},
             {"Atlantic/South_Georgia", new String[] {"South Georgia Standard Time", "GST",
-                                                     "South Georgia Daylight Time", "GDT"}},
+                                                     "South Georgia Daylight Time", "GDT",
+                                                     "South Georgia Time", "GT"}},
             {"Atlantic/St_Helena", GMT},
             {"Atlantic/Stanley", new String[] {"Falkland Is. Time", "FKT",
-                                               "Falkland Is. Summer Time", "FKST"}},
+                                               "Falkland Is. Summer Time", "FKST",
+                                               "Falkland Is. Time", "FKT"}},
             {"Australia/ACT", EST_NSW},
             {"Australia/Adelaide", ADELAIDE},
             {"Australia/Brisbane", BRISBANE},
@@ -613,7 +742,8 @@
             {"Australia/Currie", EST_NSW},
             {"Australia/Darwin", DARWIN},
             {"Australia/Eucla", new String[] {"Central Western Standard Time (Australia)", "CWST",
-                                              "Central Western Summer Time (Australia)", "CWST"}},
+                                              "Central Western Summer Time (Australia)", "CWST",
+                                              "Central Western Time (Australia)", "CWT"}},
             {"Australia/Hobart", TASMANIA},
             {"Australia/LHI", LORD_HOWE},
             {"Australia/Lindeman", BRISBANE},
@@ -697,7 +827,8 @@
             {"Europe/Riga", EET},
             {"Europe/Rome", CET},
             {"Europe/Samara", new String[] {"Samara Time", "SAMT",
-                                            "Samara Summer Time", "SAMST"}},
+                                            "Samara Summer Time", "SAMST",
+                                            "Samara Time", "SAMT"}},
             {"Europe/San_Marino", CET},
             {"Europe/Sarajevo", CET},
             {"Europe/Simferopol", EET},
@@ -713,7 +844,8 @@
             {"Europe/Vienna", CET},
             {"Europe/Vilnius", EET},
             {"Europe/Volgograd", new String[] {"Volgograd Time", "VOLT",
-                                               "Volgograd Summer Time", "VOLST"}},
+                                               "Volgograd Summer Time", "VOLST",
+                                               "Volgograd Time", "VOLT"}},
             {"Europe/Warsaw", CET},
             {"Europe/Zagreb", CET},
             {"Europe/Zaporozhye", EET},
@@ -727,30 +859,39 @@
             {"IST", IST},
             {"Indian/Antananarivo", EAT},
             {"Indian/Chagos", new String[] {"Indian Ocean Territory Time", "IOT",
-                                            "Indian Ocean Territory Summer Time", "IOST"}},
+                                            "Indian Ocean Territory Summer Time", "IOST",
+                                            "Indian Ocean Territory Time", "IOT"}},
             {"Indian/Christmas", new String[] {"Christmas Island Time", "CXT",
-                                               "Christmas Island Summer Time", "CXST"}},
+                                               "Christmas Island Summer Time", "CXST",
+                                               "Christmas Island Time", "CIT"}},
             {"Indian/Cocos", new String[] {"Cocos Islands Time", "CCT",
-                                           "Cocos Islands Summer Time", "CCST"}},
+                                           "Cocos Islands Summer Time", "CCST",
+                                           "Cocos Islands Time", "CCT"}},
             {"Indian/Comoro", EAT},
             {"Indian/Kerguelen", new String[] {"French Southern & Antarctic Lands Time", "TFT",
-                                               "French Southern & Antarctic Lands Summer Time", "TFST"}},
+                                               "French Southern & Antarctic Lands Summer Time", "TFST",
+                                               "French Southern & Antarctic Lands Time", "TFT"}},
             {"Indian/Mahe", new String[] {"Seychelles Time", "SCT",
-                                          "Seychelles Summer Time", "SCST"}},
+                                          "Seychelles Summer Time", "SCST",
+                                          "Seychelles Time", "SCT"}},
             {"Indian/Maldives", new String[] {"Maldives Time", "MVT",
-                                              "Maldives Summer Time", "MVST"}},
+                                              "Maldives Summer Time", "MVST",
+                                              "Maldives Time", "MVT"}},
             {"Indian/Mauritius", new String[] {"Mauritius Time", "MUT",
-                                               "Mauritius Summer Time", "MUST"}},
+                                               "Mauritius Summer Time", "MUST",
+                                               "Mauritius Time", "MUT"}},
             {"Indian/Mayotte", EAT},
             {"Indian/Reunion", new String[] {"Reunion Time", "RET",
-                                             "Reunion Summer Time", "REST"}},
+                                             "Reunion Summer Time", "REST",
+                                             "Reunion Time", "RET"}},
             {"Israel", ISRAEL},
             {"Jamaica", EST},
             {"Japan", JST},
             {"Kwajalein", MHT},
             {"Libya", EET},
             {"MET", new String[] {"Middle Europe Time", "MET",
-                                  "Middle Europe Summer Time", "MEST"}},
+                                  "Middle Europe Summer Time", "MEST",
+                                  "Middle Europe Time", "MET"}},
             {"Mexico/BajaNorte", PST},
             {"Mexico/BajaSur", MST},
             {"Mexico/General", CST},
@@ -770,61 +911,82 @@
             {"Pacific/Chuuk", CHUT},
             {"Pacific/Easter", EASTER},
             {"Pacific/Efate", new String[] {"Vanuatu Time", "VUT",
-                                            "Vanuatu Summer Time", "VUST"}},
+                                            "Vanuatu Summer Time", "VUST",
+                                            "Vanuatu Time", "VUT"}},
             {"Pacific/Enderbury", new String[] {"Phoenix Is. Time", "PHOT",
-                                                "Phoenix Is. Summer Time", "PHOST"}},
+                                                "Phoenix Is. Summer Time", "PHOST",
+                                                "Phoenix Is. Time", "PHOT"}},
             {"Pacific/Fakaofo", new String[] {"Tokelau Time", "TKT",
-                                              "Tokelau Summer Time", "TKST"}},
+                                              "Tokelau Summer Time", "TKST",
+                                              "Tokelau Time", "TKT"}},
             {"Pacific/Fiji", new String[] {"Fiji Time", "FJT",
-                                           "Fiji Summer Time", "FJST"}},
+                                           "Fiji Summer Time", "FJST",
+                                           "Fiji Time", "FJT"}},
             {"Pacific/Funafuti", new String[] {"Tuvalu Time", "TVT",
-                                               "Tuvalu Summer Time", "TVST"}},
+                                               "Tuvalu Summer Time", "TVST",
+                                               "Tuvalu Time", "TVT"}},
             {"Pacific/Galapagos", new String[] {"Galapagos Time", "GALT",
-                                                "Galapagos Summer Time", "GALST"}},
+                                                "Galapagos Summer Time", "GALST",
+                                                "Galapagos Time", "GALT"}},
             {"Pacific/Gambier", GAMBIER},
             {"Pacific/Guadalcanal", SBT},
             {"Pacific/Guam", ChST},
             {"Pacific/Johnston", HST},
             {"Pacific/Kiritimati", new String[] {"Line Is. Time", "LINT",
-                                                 "Line Is. Summer Time", "LINST"}},
+                                                 "Line Is. Summer Time", "LINST",
+                                                 "Line Is. Time", "LINT"}},
             {"Pacific/Kosrae", new String[] {"Kosrae Time", "KOST",
-                                             "Kosrae Summer Time", "KOSST"}},
+                                             "Kosrae Summer Time", "KOSST",
+                                             "Kosrae Time", "KOST"}},
             {"Pacific/Kwajalein", MHT},
             {"Pacific/Majuro", MHT},
             {"Pacific/Marquesas", new String[] {"Marquesas Time", "MART",
-                                                "Marquesas Summer Time", "MARST"}},
+                                                "Marquesas Summer Time", "MARST",
+                                                "Marquesas Time", "MART"}},
             {"Pacific/Midway", SAMOA},
             {"Pacific/Nauru", new String[] {"Nauru Time", "NRT",
-                                            "Nauru Summer Time", "NRST"}},
+                                            "Nauru Summer Time", "NRST",
+                                            "Nauru Time", "NRT"}},
             {"Pacific/Niue", new String[] {"Niue Time", "NUT",
-                                           "Niue Summer Time", "NUST"}},
+                                           "Niue Summer Time", "NUST",
+                                           "Niue Time", "NUT"}},
             {"Pacific/Norfolk", new String[] {"Norfolk Time", "NFT",
-                                              "Norfolk Summer Time", "NFST"}},
+                                              "Norfolk Summer Time", "NFST",
+                                              "Norfolk Time", "NFT"}},
             {"Pacific/Noumea", new String[] {"New Caledonia Time", "NCT",
-                                             "New Caledonia Summer Time", "NCST"}},
+                                             "New Caledonia Summer Time", "NCST",
+                                             "New Caledonia Time", "NCT"}},
             {"Pacific/Pago_Pago", SAMOA},
             {"Pacific/Palau", new String[] {"Palau Time", "PWT",
-                                            "Palau Summer Time", "PWST"}},
+                                            "Palau Summer Time", "PWST",
+                                            "Palau Time", "PWT"}},
             {"Pacific/Pitcairn", PITCAIRN},
             {"Pacific/Pohnpei", PONT},
             {"Pacific/Ponape", PONT},
             {"Pacific/Port_Moresby", new String[] {"Papua New Guinea Time", "PGT",
-                                                   "Papua New Guinea Summer Time", "PGST"}},
+                                                   "Papua New Guinea Summer Time", "PGST",
+                                                   "Papua New Guinea Time", "PGT"}},
             {"Pacific/Rarotonga", new String[] {"Cook Is. Time", "CKT",
-                                                "Cook Is. Summer Time", "CKHST"}},
+                                                "Cook Is. Summer Time", "CKHST",
+                                                "Cook Is. Time", "CKT"}},
             {"Pacific/Saipan", ChST},
             {"Pacific/Samoa", SAMOA},
             {"Pacific/Tahiti", new String[] {"Tahiti Time", "TAHT",
-                                             "Tahiti Summer Time", "TAHST"}},
+                                             "Tahiti Summer Time", "TAHST",
+                                             "Tahiti Time", "TAHT"}},
             {"Pacific/Tarawa", new String[] {"Gilbert Is. Time", "GILT",
-                                             "Gilbert Is. Summer Time", "GILST"}},
+                                             "Gilbert Is. Summer Time", "GILST",
+                                             "Gilbert Is. Time", "GILT"}},
             {"Pacific/Tongatapu", new String[] {"Tonga Time", "TOT",
-                                                "Tonga Summer Time", "TOST"}},
+                                                "Tonga Summer Time", "TOST",
+                                                "Tonga Time", "TOT"}},
             {"Pacific/Truk", CHUT},
             {"Pacific/Wake", new String[] {"Wake Time", "WAKT",
-                                           "Wake Summer Time", "WAKST"}},
+                                           "Wake Summer Time", "WAKST",
+                                           "Wake Time", "WAKT"}},
             {"Pacific/Wallis", new String[] {"Wallis & Futuna Time", "WFT",
-                                             "Wallis & Futuna Summer Time", "WFST"}},
+                                             "Wallis & Futuna Summer Time", "WFST",
+                                             "Wallis & Futuna Time", "WFT"}},
             {"Pacific/Yap", CHUT},
             {"Poland", CET},
             {"PRC", CTT},
diff --git a/src/share/classes/sun/util/resources/TimeZoneNamesBundle.java b/src/share/classes/sun/util/resources/TimeZoneNamesBundle.java
index 3757ed1..a3c37ec 100644
--- a/src/share/classes/sun/util/resources/TimeZoneNamesBundle.java
+++ b/src/share/classes/sun/util/resources/TimeZoneNamesBundle.java
@@ -42,6 +42,9 @@
 
 import java.util.Map;
 import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.MissingResourceException;
+import java.util.Set;
 
 /**
  * Subclass of <code>ResourceBundle</code> with special
@@ -58,6 +61,26 @@
 public abstract class TimeZoneNamesBundle extends OpenListResourceBundle {
 
     /**
+     * Returns a String array containing time zone names. The String array has
+     * at most size elements.
+     *
+     * @param key  the time zone ID for which names are obtained
+     * @param size the requested size of array for names
+     * @return a String array containing names
+     */
+    public String[] getStringArray(String key, int size) {
+        String[] names = handleGetObject(key, size);
+        if ((names == null || names.length != size) && parent != null) {
+            names = ((TimeZoneNamesBundle)parent).getStringArray(key, size);
+        }
+        if (names == null) {
+            throw new MissingResourceException("no time zone names", getClass().getName(), key);
+        }
+        return names;
+
+    }
+
+    /**
      * Maps time zone IDs to locale-specific names.
      * The value returned is an array of five strings:
      * <ul>
@@ -71,13 +94,17 @@
      * <code>getContents</code> implementations, while the time zone
      * ID is inserted into the returned array by this method.
      */
+    @Override
     public Object handleGetObject(String key) {
+        return handleGetObject(key, 5);
+    }
+
+    private String[] handleGetObject(String key, int n) {
         String[] contents = (String[]) super.handleGetObject(key);
         if (contents == null) {
             return null;
         }
-
-        int clen = contents.length;
+        int clen = Math.min(n, contents.length);
         String[] tmpobj = new String[clen+1];
         tmpobj[0] = key;
         System.arraycopy(contents, 0, tmpobj, 1, clen);
@@ -85,14 +112,24 @@
     }
 
     /**
-     * Use LinkedHashMap to preserve order of bundle entries.
+     * Use LinkedHashMap to preserve the order of bundle entries.
      */
     @Override
-    protected Map<String, Object> createMap(int size) {
+    protected <K, V> Map<K, V> createMap(int size) {
         return new LinkedHashMap<>(size);
     }
 
     /**
+     * Use LinkedHashSet to preserve the key order.
+     * @param <E> the type of elements
+     * @return a Set
+     */
+    @Override
+    protected <E> Set<E> createSet() {
+        return new LinkedHashSet<>();
+    }
+
+    /**
      * Provides key/value mappings for a specific
      * resource bundle. Each entry of the array
      * returned must be an array with two elements:
diff --git a/src/share/javavm/export/classfile_constants.h b/src/share/javavm/export/classfile_constants.h
index 2ee8a3c..1fa6e3c 100644
--- a/src/share/javavm/export/classfile_constants.h
+++ b/src/share/javavm/export/classfile_constants.h
@@ -31,7 +31,7 @@
 #endif
 
 /* Classfile version number for this information */
-#define JVM_CLASSFILE_MAJOR_VERSION 51
+#define JVM_CLASSFILE_MAJOR_VERSION 52
 #define JVM_CLASSFILE_MINOR_VERSION 0
 
 /* Flags */
diff --git a/src/share/lib/security/java.security b/src/share/lib/security/java.security-linux
similarity index 100%
rename from src/share/lib/security/java.security
rename to src/share/lib/security/java.security-linux
diff --git a/src/share/native/java/net/Inet6Address.c b/src/share/native/java/net/Inet6Address.c
index 7b04c67..1817807 100644
--- a/src/share/native/java/net/Inet6Address.c
+++ b/src/share/native/java/net/Inet6Address.c
@@ -38,7 +38,6 @@
 jfieldID ia6_cachedscopeidID;
 jfieldID ia6_scopeidsetID;
 jfieldID ia6_scopeifnameID;
-jfieldID ia6_scopeifnamesetID;
 jmethodID ia6_ctrID;
 
 /*
@@ -62,8 +61,6 @@
     CHECK_NULL(ia6_scopeidID);
     ia6_scopeifnameID = (*env)->GetFieldID(env, ia6_class, "scope_ifname", "Ljava/net/NetworkInterface;");
     CHECK_NULL(ia6_scopeifnameID);
-    ia6_scopeifnamesetID = (*env)->GetFieldID(env, ia6_class, "scope_ifname_set", "Z");
-    CHECK_NULL(ia6_scopeifnamesetID);
     ia6_ctrID = (*env)->GetMethodID(env, ia6_class, "<init>", "()V");
     CHECK_NULL(ia6_ctrID);
 }
diff --git a/src/share/native/java/util/zip/zlib-1.2.5/gzlib.c b/src/share/native/java/util/zip/zlib-1.2.5/gzlib.c
index d285126..9a3db2e 100644
--- a/src/share/native/java/util/zip/zlib-1.2.5/gzlib.c
+++ b/src/share/native/java/util/zip/zlib-1.2.5/gzlib.c
@@ -1,4 +1,5 @@
-/* NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+/*
+ * 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
diff --git a/src/solaris/classes/sun/print/UnixPrintJob.java b/src/solaris/classes/sun/print/UnixPrintJob.java
index 620cf1c..8c797ce 100644
--- a/src/solaris/classes/sun/print/UnixPrintJob.java
+++ b/src/solaris/classes/sun/print/UnixPrintJob.java
@@ -939,7 +939,7 @@
                      * is not removed for some reason, request that it is
                      * removed when the VM exits.
                      */
-                    spoolFile = Files.createTempFile("javaprint", ".ps").toFile();
+                    spoolFile = Files.createTempFile("javaprint", "").toFile();
                     spoolFile.deleteOnExit();
                 }
                 result = new FileOutputStream(spoolFile);
diff --git a/src/solaris/native/common/jdk_util_md.h b/src/solaris/native/common/jdk_util_md.h
index 6361fe0..b2472b3 100644
--- a/src/solaris/native/common/jdk_util_md.h
+++ b/src/solaris/native/common/jdk_util_md.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/src/solaris/native/sun/tools/attach/BsdVirtualMachine.c b/src/solaris/native/sun/tools/attach/BsdVirtualMachine.c
index 9d46ad3..cf3ff20 100644
--- a/src/solaris/native/sun/tools/attach/BsdVirtualMachine.c
+++ b/src/solaris/native/sun/tools/attach/BsdVirtualMachine.c
@@ -1,12 +1,12 @@
 /*
- * Copyright 2005, 2012, Oracle and/or its affiliates. All Rights Reserved.
+ * Copyright (c) 2005, 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.  Sun designates this
+ * published by the Free Software Foundation.  Oracle designates this
  * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
+ * 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
@@ -18,9 +18,9 @@
  * 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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"
diff --git a/src/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java b/src/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java
index 57a12a8..089278b 100644
--- a/src/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java
+++ b/src/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007,2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/src/windows/classes/sun/nio/fs/WindowsFileAttributes.java b/src/windows/classes/sun/nio/fs/WindowsFileAttributes.java
index dffa4f0..208435d 100644
--- a/src/windows/classes/sun/nio/fs/WindowsFileAttributes.java
+++ b/src/windows/classes/sun/nio/fs/WindowsFileAttributes.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -383,20 +383,14 @@
     }
 
     int volSerialNumber() {
-        if (volSerialNumber == 0)
-            throw new AssertionError("Should not get here");
         return volSerialNumber;
     }
 
     int fileIndexHigh() {
-        if (volSerialNumber == 0)
-            throw new AssertionError("Should not get here");
         return fileIndexHigh;
     }
 
     int fileIndexLow() {
-        if (volSerialNumber == 0)
-            throw new AssertionError("Should not get here");
         return fileIndexLow;
     }
 
diff --git a/src/windows/native/common/jdk_util_md.h b/src/windows/native/common/jdk_util_md.h
index 0bb9149..67c45a2 100644
--- a/src/windows/native/common/jdk_util_md.h
+++ b/src/windows/native/common/jdk_util_md.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/src/windows/native/java/net/NetworkInterface.c b/src/windows/native/java/net/NetworkInterface.c
index b0f9344..6d14465 100644
--- a/src/windows/native/java/net/NetworkInterface.c
+++ b/src/windows/native/java/net/NetworkInterface.c
@@ -178,7 +178,7 @@
     int count;
     netif *netifP;
     DWORD i;
-    int lo=0, eth=0, tr=0, fddi=0, ppp=0, sl=0, wlan=0, net=0;
+    int lo=0, eth=0, tr=0, fddi=0, ppp=0, sl=0, wlan=0, net=0, wlen=0;
 
     /*
      * Ask the IP Helper library to enumerate the adapters
@@ -260,8 +260,17 @@
          */
         curr = (netif *)calloc(1, sizeof(netif));
         if (curr != NULL) {
+            wlen = MultiByteToWideChar(CP_OEMCP, 0, ifrowP->bDescr,
+                       ifrowP->dwDescrLen, NULL, 0);
+            if(wlen == 0) {
+                // MultiByteToWideChar should not fail
+                // But in rare case it fails, we allow 'char' to be displayed
+                curr->displayName = (char *)malloc(ifrowP->dwDescrLen + 1);
+            } else {
+                curr->displayName = (wchar_t *)malloc(wlen*(sizeof(wchar_t))+1);
+            }
+
             curr->name = (char *)malloc(strlen(dev_name) + 1);
-            curr->displayName = (char *)malloc(ifrowP->dwDescrLen + 1);
 
             if (curr->name == NULL || curr->displayName == NULL) {
                 if (curr->name) free(curr->name);
@@ -282,8 +291,29 @@
          * 32-bit numbers as index values.
          */
         strcpy(curr->name, dev_name);
-        strncpy(curr->displayName, ifrowP->bDescr, ifrowP->dwDescrLen);
-        curr->displayName[ifrowP->dwDescrLen] = '\0';
+        if (wlen == 0) {
+            // display char type in case of MultiByteToWideChar failure
+            strncpy(curr->displayName, ifrowP->bDescr, ifrowP->dwDescrLen);
+            curr->displayName[ifrowP->dwDescrLen] = '\0';
+        } else {
+            // call MultiByteToWideChar again to fill curr->displayName
+            // it should not fail, because we have called it once before
+            if (MultiByteToWideChar(CP_OEMCP, 0, ifrowP->bDescr,
+                   ifrowP->dwDescrLen, curr->displayName, wlen) == 0) {
+                JNU_ThrowByName(env, "java/lang/Error",
+                       "Cannot get multibyte char for interface display name");
+                free_netif(netifP);
+                free(tableP);
+                free(curr->name);
+                free(curr->displayName);
+                free(curr);
+                return -1;
+            } else {
+                curr->displayName[wlen*(sizeof(wchar_t))] = '\0';
+                curr->dNameIsUnicode = TRUE;
+            }
+        }
+
         curr->dwIndex = ifrowP->dwIndex;
         curr->ifType = ifrowP->dwType;
         curr->index = GetFriendlyIfIndex(ifrowP->dwIndex);
diff --git a/test/Makefile b/test/Makefile
index e42481f..871cc54 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -505,7 +505,7 @@
           demo/jvmti demo/zipfs sample \
           javax/naming com/sun/jndi \
           javax/script \
-	  javax/sql \
+	  java/sql javax/sql \
           javax/smartcardio \
 	  javax/xml/ws com/sun/internal/ws \
 	  jdk/asm \
diff --git a/test/ProblemList.txt b/test/ProblemList.txt
index 2552ba0..d0f0921 100644
--- a/test/ProblemList.txt
+++ b/test/ProblemList.txt
@@ -263,10 +263,6 @@
 # 7164518: no PortUnreachableException on Mac
 sun/security/krb5/auto/Unreachable.java                         macosx-all
 
-# 7193792
-sun/security/pkcs11/ec/TestECDSA.java				solaris-all
-sun/security/pkcs11/ec/TestECDSA.java				linux-all
-
 # 7193793
 sun/security/pkcs11/ec/TestECDH.java				linux-all
 
@@ -363,9 +359,6 @@
 # Filed 6772009
 java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java generic-all
 
-# 8003596
-java/util/logging/CheckLockLocationTest.java			windows-all
-
 # 7041639, Solaris DSA keypair generation bug
 java/util/TimeZone/TimeZoneDatePermissionCheck.sh               solaris-all
 
diff --git a/test/com/oracle/net/sanity.sh b/test/com/oracle/net/sanity.sh
index b54d866..e2c89cc 100644
--- a/test/com/oracle/net/sanity.sh
+++ b/test/com/oracle/net/sanity.sh
@@ -63,4 +63,4 @@
 export CLASSPATH
 
 # Run sanity test (IPv4-only for now)
-$JAVA -Djava.net.preferIPv4Stack=true Sanity ${IB_LINKS}
+$JAVA ${TESTVMOPTS} -Djava.net.preferIPv4Stack=true Sanity ${IB_LINKS}
diff --git a/test/com/sun/corba/cachedSocket/7056731.sh b/test/com/sun/corba/cachedSocket/7056731.sh
index afb2278..5244b9a 100644
--- a/test/com/sun/corba/cachedSocket/7056731.sh
+++ b/test/com/sun/corba/cachedSocket/7056731.sh
@@ -64,12 +64,12 @@
 sleep 2 #give orbd time to start
 echo "started orb"
 echo "starting server"
-${TESTJAVA}${FS}bin${FS}java -cp . HelloServer -ORBInitialPort $PORT -ORBInitialHost localhost &
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp . HelloServer -ORBInitialPort $PORT -ORBInitialHost localhost &
 SERVER_PROC=$!
 sleep 2 #give server time to start
 echo "started server"
 echo "starting client (debug mode)"
-${TESTJAVA}${FS}bin${FS}java -cp . -agentlib:jdwp=transport=dt_socket,server=y,address=8000 HelloClient -ORBInitialPort $PORT -ORBInitialHost localhost > client.$$ 2>&1 & 
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp . -agentlib:jdwp=transport=dt_socket,server=y,address=8000 HelloClient -ORBInitialPort $PORT -ORBInitialHost localhost > client.$$ 2>&1 & 
 JVM_PROC=$!
 sleep 2 #give jvm/debugger/client time to start
 
diff --git a/test/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI/7089914/bug7089914.java b/test/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI/7089914/bug7089914.java
index 3354f28..c3f013c 100644
--- a/test/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI/7089914/bug7089914.java
+++ b/test/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI/7089914/bug7089914.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh b/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh
index 15faf70..a4f3726 100644
--- a/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh
+++ b/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh
@@ -59,7 +59,7 @@
 runOne()
 {
    echo "runOne $@"
-   $TESTJAVA/bin/java -classpath $TESTCLASSES $@  || exit 3
+   $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@  || exit 3
 }
 
 solaris_swap_size()
diff --git a/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh b/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh
index e4e163e..47110c0 100644
--- a/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh
+++ b/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh
@@ -43,7 +43,7 @@
 { 
    echo "runOne $@"
    $TESTJAVA/bin/javac -d $TESTCLASSES $TESTSRC/$@.java || exit 2
-   $TESTJAVA/bin/java -classpath $TESTCLASSES $@        || exit 3
+   $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@        || exit 3
 }
 
 # Test GetMaxFileDescriptorCount if we are running on Unix
diff --git a/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh b/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh
index 7cf6ae2..bc3ef46 100644
--- a/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh
+++ b/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh
@@ -43,7 +43,7 @@
 { 
    echo "runOne $@"
    $TESTJAVA/bin/javac -d $TESTCLASSES $TESTSRC/$@.java || exit 2
-   $TESTJAVA/bin/java -classpath $TESTCLASSES $@        || exit 3
+   $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@        || exit 3
 }
 
 # Test GetOpenFileDescriptorCount if we are running on Unix
diff --git a/test/com/sun/tools/attach/ApplicationSetup.sh b/test/com/sun/tools/attach/ApplicationSetup.sh
index 0537cb6..e8296df 100644
--- a/test/com/sun/tools/attach/ApplicationSetup.sh
+++ b/test/com/sun/tools/attach/ApplicationSetup.sh
@@ -41,7 +41,7 @@
 startApplication() 
 {
   # put all output from the app into ${OUTPUTFILE}
-  ${JAVA} $1 $2 $3 -jar "${TESTCLASSES}"/Application.jar > ${OUTPUTFILE} 2>&1 &
+  ${JAVA} ${TESTVMOPTS} $1 $2 $3 -jar "${TESTCLASSES}"/Application.jar > ${OUTPUTFILE} 2>&1 &
   pid="$!"
 
   # MKS creates an intermediate shell to launch ${JAVA} so
@@ -78,6 +78,6 @@
 
 stopApplication() 
 {
-  $JAVA -classpath "${TESTCLASSES}" Shutdown $1
+  $JAVA ${TESTVMOPTS} -classpath "${TESTCLASSES}" Shutdown $1
 }
 
diff --git a/test/com/sun/tools/attach/BasicTests.sh b/test/com/sun/tools/attach/BasicTests.sh
index b63d752..fc5a7fb 100644
--- a/test/com/sun/tools/attach/BasicTests.sh
+++ b/test/com/sun/tools/attach/BasicTests.sh
@@ -61,7 +61,7 @@
 
 echo "Running tests ..."
 
-$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
+$JAVA ${TESTVMOPTS} -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
   BasicTests $pid $agent $badagent $redefineagent 2>&1
 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 
diff --git a/test/com/sun/tools/attach/PermissionTests.sh b/test/com/sun/tools/attach/PermissionTests.sh
index 22828dc..d1cfb3c 100644
--- a/test/com/sun/tools/attach/PermissionTests.sh
+++ b/test/com/sun/tools/attach/PermissionTests.sh
@@ -48,7 +48,7 @@
 
 echo "Deny test"
 # deny 
-$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
+$JAVA ${TESTVMOPTS} -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
     -Djava.security.manager \
     -Djava.security.policy=${TESTSRC}/java.policy.deny \
     PermissionTest $pid true 2>&1
@@ -56,7 +56,7 @@
 
 # allow
 echo "Allow test"
-$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
+$JAVA ${TESTVMOPTS} -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
     -Djava.security.manager \
     -Djava.security.policy=${TESTSRC}/java.policy.allow \
     PermissionTest $pid false 2>&1 
diff --git a/test/com/sun/tools/attach/ProviderTests.sh b/test/com/sun/tools/attach/ProviderTests.sh
index 2f9297f..f5d6411 100644
--- a/test/com/sun/tools/attach/ProviderTests.sh
+++ b/test/com/sun/tools/attach/ProviderTests.sh
@@ -45,7 +45,7 @@
 
 echo "Running test ..."
 
-$JAVA -classpath \
+$JAVA ${TESTVMOPTS} -classpath \
   "${TESTCLASSES}${PS}${TESTCLASSES}/SimpleProvider.jar${PS}${TESTJAVA}/lib/tools.jar" \
   ProviderTest
 
diff --git a/test/com/sun/tools/extcheck/TestExtcheckArgs.sh b/test/com/sun/tools/extcheck/TestExtcheckArgs.sh
index d9bc0f5..5adbcfc 100644
--- a/test/com/sun/tools/extcheck/TestExtcheckArgs.sh
+++ b/test/com/sun/tools/extcheck/TestExtcheckArgs.sh
@@ -39,7 +39,7 @@
     exit $rc
 fi
 
-${TESTJAVA}/bin/java -classpath ${TESTJAVA}/lib/tools.jar${PS}${TESTCLASSES} TestExtcheckArgs
+${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTJAVA}/lib/tools.jar${PS}${TESTCLASSES} TestExtcheckArgs
 rc=$?
 if [ $rc != 0 ]; then
     echo Execution failure with exit status $rc
diff --git a/test/demo/zipfs/basic.sh b/test/demo/zipfs/basic.sh
index b222f87..40583d1 100644
--- a/test/demo/zipfs/basic.sh
+++ b/test/demo/zipfs/basic.sh
@@ -53,7 +53,7 @@
 
 go() {
     echo ""
-    ${TESTJAVA}/bin/java $1 $2 $3 2>&1
+    ${TESTJAVA}/bin/java ${TESTVMOPTS} $1 $2 $3 2>&1
     if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 }
 
diff --git a/test/java/awt/Focus/6981400/Test1.java b/test/java/awt/Focus/6981400/Test1.java
index 2be6e97..6702063 100644
--- a/test/java/awt/Focus/6981400/Test1.java
+++ b/test/java/awt/Focus/6981400/Test1.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/awt/Focus/6981400/Test2.java b/test/java/awt/Focus/6981400/Test2.java
index c41fbbd..fc14db2 100644
--- a/test/java/awt/Focus/6981400/Test2.java
+++ b/test/java/awt/Focus/6981400/Test2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/awt/Focus/6981400/Test3.java b/test/java/awt/Focus/6981400/Test3.java
index 268cbdf..a4a37b1 100644
--- a/test/java/awt/Focus/6981400/Test3.java
+++ b/test/java/awt/Focus/6981400/Test3.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/awt/Frame/ResizeAfterSetFont/ResizeAfterSetFont.java b/test/java/awt/Frame/ResizeAfterSetFont/ResizeAfterSetFont.java
index 32ed472..56a9318 100644
--- a/test/java/awt/Frame/ResizeAfterSetFont/ResizeAfterSetFont.java
+++ b/test/java/awt/Frame/ResizeAfterSetFont/ResizeAfterSetFont.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/awt/JAWT/JAWT.sh b/test/java/awt/JAWT/JAWT.sh
index 607ab2f..70ff02b 100644
--- a/test/java/awt/JAWT/JAWT.sh
+++ b/test/java/awt/JAWT/JAWT.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 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
diff --git a/test/java/awt/JAWT/Makefile.cygwin b/test/java/awt/JAWT/Makefile.cygwin
index 82cecfe..326d581 100644
--- a/test/java/awt/JAWT/Makefile.cygwin
+++ b/test/java/awt/JAWT/Makefile.cygwin
@@ -1,4 +1,4 @@
-# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 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
diff --git a/test/java/awt/JAWT/Makefile.unix b/test/java/awt/JAWT/Makefile.unix
index b0dc136..2b3f47c 100644
--- a/test/java/awt/JAWT/Makefile.unix
+++ b/test/java/awt/JAWT/Makefile.unix
@@ -1,4 +1,4 @@
-# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 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
diff --git a/test/java/awt/JAWT/Makefile.win b/test/java/awt/JAWT/Makefile.win
index 82a0b0e..327fb25 100644
--- a/test/java/awt/JAWT/Makefile.win
+++ b/test/java/awt/JAWT/Makefile.win
@@ -1,4 +1,4 @@
-# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 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
diff --git a/test/java/awt/JAWT/MyCanvas.java b/test/java/awt/JAWT/MyCanvas.java
index 359ade4..4bf0741 100644
--- a/test/java/awt/JAWT/MyCanvas.java
+++ b/test/java/awt/JAWT/MyCanvas.java
@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/awt/JAWT/myfile.c b/test/java/awt/JAWT/myfile.c
index b6ef750..1a10289 100644
--- a/test/java/awt/JAWT/myfile.c
+++ b/test/java/awt/JAWT/myfile.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/awt/JAWT/myfile.cpp b/test/java/awt/JAWT/myfile.cpp
index f5c3007..fc5b278 100644
--- a/test/java/awt/JAWT/myfile.cpp
+++ b/test/java/awt/JAWT/myfile.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/awt/TextArea/DisposeTest/TestDispose.java b/test/java/awt/TextArea/DisposeTest/TestDispose.java
index eaa912d..91c795f 100644
--- a/test/java/awt/TextArea/DisposeTest/TestDispose.java
+++ b/test/java/awt/TextArea/DisposeTest/TestDispose.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/awt/TextArea/TextAreaCaretVisibilityTest/bug7129742.java b/test/java/awt/TextArea/TextAreaCaretVisibilityTest/bug7129742.java
index 188cd3f..d3de495 100644
--- a/test/java/awt/TextArea/TextAreaCaretVisibilityTest/bug7129742.java
+++ b/test/java/awt/TextArea/TextAreaCaretVisibilityTest/bug7129742.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/awt/TextField/DisposeTest/TestDispose.java b/test/java/awt/TextField/DisposeTest/TestDispose.java
index a8a2fda..6ef00cd 100644
--- a/test/java/awt/TextField/DisposeTest/TestDispose.java
+++ b/test/java/awt/TextField/DisposeTest/TestDispose.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/io/File/GetXSpace.sh b/test/java/io/File/GetXSpace.sh
index 67fae42..a7e3a1c 100644
--- a/test/java/io/File/GetXSpace.sh
+++ b/test/java/io/File/GetXSpace.sh
@@ -53,7 +53,7 @@
 }
 
 runTest() {
-  ${TESTJAVA}/bin/java -cp ${TESTCLASSES} GetXSpace $* 
+  ${TESTJAVA}/bin/java ${TESTVMOPTS} -cp ${TESTCLASSES} GetXSpace $* 
   if [ $? -eq 0 ]
   then echo "Passed"
   else
diff --git a/test/java/io/File/MacPathTest.sh b/test/java/io/File/MacPathTest.sh
index ebba514..ecaa5e0 100644
--- a/test/java/io/File/MacPathTest.sh
+++ b/test/java/io/File/MacPathTest.sh
@@ -36,4 +36,4 @@
   TESTCLASSES=.
 fi
 
-export LC_ALL=en_US.UTF-8 ;${TESTJAVA}/bin/java -cp ${TESTCLASSES} MacPathTest
+export LC_ALL=en_US.UTF-8 ;${TESTJAVA}/bin/java ${TESTVMOPTS} -cp ${TESTCLASSES} MacPathTest
diff --git a/test/java/io/File/basic.sh b/test/java/io/File/basic.sh
index 74a0f71..69abf3d 100644
--- a/test/java/io/File/basic.sh
+++ b/test/java/io/File/basic.sh
@@ -44,7 +44,7 @@
     ;;
 esac
 mkdir x.Basic.dir
-if $TESTJAVA/bin/java $* -classpath "$TESTCLASSES" Basic; then
+if $TESTJAVA/bin/java ${TESTVMOPTS} $* -classpath "$TESTCLASSES" Basic; then
   [ -f x.Basic.rw ] && (echo "x.Basic.rw not deleted"; exit 1)
   ([ -d x.Basic.dir ] || [ \! -d x.Basic.dir2 ]) \
     && (echo "x.Basic.dir not renamed"; exit 1)
diff --git a/test/java/io/FileOutputStream/FileOpen.sh b/test/java/io/FileOutputStream/FileOpen.sh
index a29d3f1..d79c262 100644
--- a/test/java/io/FileOutputStream/FileOpen.sh
+++ b/test/java/io/FileOutputStream/FileOpen.sh
@@ -50,20 +50,20 @@
 	${TESTJAVA}/bin/javac -d . ${TESTSRC}\\FileOpenNeg.java
 
 	echo "Opening Writable Normal File.."
-	${TESTJAVA}/bin/java FileOpenPos ${hfile}
+	${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenPos ${hfile}
 
 	echo "Opening Writable Hidden File.."
 	${ATTRIB} +h ${hfile}
-	${TESTJAVA}/bin/java FileOpenNeg ${hfile}
+	${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenNeg ${hfile}
 
 	echo "Opening Read-Only Normal File.."
 	${ATTRIB} -h ${hfile}
 	${ATTRIB} +r ${hfile}
-	${TESTJAVA}/bin/java FileOpenNeg ${hfile}
+	${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenNeg ${hfile}
 
 	echo "Opening Read-Only Hidden File.." 
 	${ATTRIB} +h ${hfile}
-	${TESTJAVA}/bin/java FileOpenNeg ${hfile}
+	${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenNeg ${hfile}
 
         rm -f ${hfile}
 	exit
diff --git a/test/java/io/Serializable/class/run.sh b/test/java/io/Serializable/class/run.sh
index 470efe1..26ad083 100644
--- a/test/java/io/Serializable/class/run.sh
+++ b/test/java/io/Serializable/class/run.sh
@@ -45,85 +45,85 @@
 rm -f A.java     
 cp ${TESTSRC}/NonSerialA_1.java A.java
 ${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -s A
-${TESTJAVA}/bin/java Test -d
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -d
 echo
 
 echo Write NonSerial1, Read NonSerial2
 rm -f A.java     
 cp ${TESTSRC}/NonSerialA_1.java A.java
 ${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -s A
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
 rm -f A.java     
 cp ${TESTSRC}/NonSerialA_2.java A.java
 ${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -d
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -d
 echo
 
 echo Write NonSerial1, Read Serial1
 rm -f A.java     
 cp ${TESTSRC}/NonSerialA_1.java A.java
 ${TESTJAVA}/bin/javac A.java 
-${TESTJAVA}/bin/java Test -s A
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
 rm -f A.java     
 cp ${TESTSRC}/SerialA_1.java A.java
 ${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -d
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -d
 echo
 
 echo Write Serial1, Read NonSerial1
 rm -f A.java     
 cp ${TESTSRC}/SerialA_1.java A.java
 ${TESTJAVA}/bin/javac A.java 
-${TESTJAVA}/bin/java Test -s A
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
 rm -f A.java     
 cp ${TESTSRC}/NonSerialA_1.java A.java
 ${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -doe
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -doe
 echo
 
 echo Write Serial1, Read Serial2
 rm -f A.java     
 cp ${TESTSRC}/SerialA_1.java A.java
 ${TESTJAVA}/bin/javac A.java 
-${TESTJAVA}/bin/java Test -s A
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
 rm -f A.java     
 cp ${TESTSRC}/SerialA_2.java A.java
 ${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -d
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -d
 echo
 
 echo Write Serial2, Read Serial1
 rm -f A.java     
 cp ${TESTSRC}/SerialA_2.java A.java
 ${TESTJAVA}/bin/javac A.java 
-${TESTJAVA}/bin/java Test -s A
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
 rm -f A.java     
 cp ${TESTSRC}/SerialA_1.java A.java
 ${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -d
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -d
 echo
 
 echo Write Serial1, Read Serial3
 rm -f A.java     
 cp ${TESTSRC}/SerialA_1.java A.java
 ${TESTJAVA}/bin/javac A.java 
-${TESTJAVA}/bin/java Test -s A
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
 rm -f A.java     
 cp ${TESTSRC}/SerialA_3.java A.java
 ${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -de
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -de
 echo
 
 echo Write Serial3, Read Serial1
 rm -f A.java     
 cp ${TESTSRC}/SerialA_3.java A.java
 ${TESTJAVA}/bin/javac A.java 
-${TESTJAVA}/bin/java Test -s A
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
 rm -f A.java     
 cp ${TESTSRC}/SerialA_1.java A.java
 ${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -de
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -de
 echo
 
 echo Passed
diff --git a/test/java/io/Serializable/evolution/AddedExternField/run.sh b/test/java/io/Serializable/evolution/AddedExternField/run.sh
index bc5edb0..6bb2003 100644
--- a/test/java/io/Serializable/evolution/AddedExternField/run.sh
+++ b/test/java/io/Serializable/evolution/AddedExternField/run.sh
@@ -27,7 +27,7 @@
 
 rm *.class tmp.ser
 javac WriteAddedField.java
-java WriteAddedField
+java ${TESTVMOPTS} WriteAddedField
 rm *.class
 javac ReadAddedField.java
-java ReadAddedField
+java ${TESTVMOPTS} ReadAddedField
diff --git a/test/java/io/Serializable/evolution/RenamePackage/run.sh b/test/java/io/Serializable/evolution/RenamePackage/run.sh
index 13c4387..afa751a 100644
--- a/test/java/io/Serializable/evolution/RenamePackage/run.sh
+++ b/test/java/io/Serializable/evolution/RenamePackage/run.sh
@@ -86,13 +86,13 @@
 
 # Run Case 1. Map test.SerialDriver within stream to install.SerialDriver.
 CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
-${JAVA} test.SerialDriver -s
+${JAVA} ${TESTVMOPTS} test.SerialDriver -s
 CLASSPATH="${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
-${JAVA} install.SerialDriver -d
+${JAVA} ${TESTVMOPTS} install.SerialDriver -d
 rm stream.ser
 
 # Run Case 2. Map install.SerialDriver within stream to test.SerialDriver.
 CLASSPATH="${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
-${JAVA} install.SerialDriver -s
+${JAVA} ${TESTVMOPTS} install.SerialDriver -s
 CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
-${JAVA} test.SerialDriver -d
+${JAVA} ${TESTVMOPTS} test.SerialDriver -d
diff --git a/test/java/io/Serializable/maskSyntheticModifier/run.sh b/test/java/io/Serializable/maskSyntheticModifier/run.sh
index 80ebb76..075e0df 100644
--- a/test/java/io/Serializable/maskSyntheticModifier/run.sh
+++ b/test/java/io/Serializable/maskSyntheticModifier/run.sh
@@ -41,5 +41,5 @@
 set -ex
 cp ${TESTSRC}/Foo.class .
 ${TESTJAVA}/bin/javac -d . ${TESTSRC}/Test.java
-${TESTJAVA}/bin/java Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test
 rm -f *.class
diff --git a/test/java/io/Serializable/packageAccess/run.sh b/test/java/io/Serializable/packageAccess/run.sh
index ee43141..3a7f0c1 100644
--- a/test/java/io/Serializable/packageAccess/run.sh
+++ b/test/java/io/Serializable/packageAccess/run.sh
@@ -45,5 +45,5 @@
 ${TESTJAVA}/bin/jar cf foo.jar B.class D.class
 rm -f B.class D.class
 
-${TESTJAVA}/bin/java Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test
 rm -f *.class *.jar
diff --git a/test/java/io/Serializable/resolveClass/consTest/run.sh b/test/java/io/Serializable/resolveClass/consTest/run.sh
index da7cfe2..62cc8ff 100644
--- a/test/java/io/Serializable/resolveClass/consTest/run.sh
+++ b/test/java/io/Serializable/resolveClass/consTest/run.sh
@@ -44,5 +44,5 @@
 ${TESTJAVA}/bin/jar cf boot.jar *.class
 rm -f *.class
 ${TESTJAVA}/bin/javac -classpath boot.jar -d . ${TESTSRC}/Test.java
-${TESTJAVA}/bin/java -Xbootclasspath/a:boot.jar Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} -Xbootclasspath/a:boot.jar Test
 rm -f *.class *.jar
diff --git a/test/java/io/Serializable/resolveClass/deserializeButton/run.sh b/test/java/io/Serializable/resolveClass/deserializeButton/run.sh
index 251ef60..48208ae 100644
--- a/test/java/io/Serializable/resolveClass/deserializeButton/run.sh
+++ b/test/java/io/Serializable/resolveClass/deserializeButton/run.sh
@@ -46,5 +46,5 @@
 ${TESTJAVA}/bin/jar cf cb.jar *.class
 rm -f *.class
 ${TESTJAVA}/bin/javac -d . ${TESTSRC}/Test.java
-${TESTJAVA}/bin/java Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test
 rm -f *.class *.jar
diff --git a/test/java/io/Serializable/subclass/run.sh b/test/java/io/Serializable/subclass/run.sh
index 9864345..d7f1d89 100644
--- a/test/java/io/Serializable/subclass/run.sh
+++ b/test/java/io/Serializable/subclass/run.sh
@@ -25,6 +25,6 @@
 # @bug 4100915
 mkdir classes
 javac -d classes *.java
-java -classpath classes -Djava.policy=Allow.policy Test 
+java ${TESTVMOPTS} -classpath classes -Djava.policy=Allow.policy Test 
 # ENABLE next line when new method for invoking a main with a SecureClassLoader is known
 #java -classpath classes -Djava.policy=NotAllow.policy Test -expectSecurityException
diff --git a/test/java/io/Serializable/superclassDataLoss/run.sh b/test/java/io/Serializable/superclassDataLoss/run.sh
index c8d1284..4447374 100644
--- a/test/java/io/Serializable/superclassDataLoss/run.sh
+++ b/test/java/io/Serializable/superclassDataLoss/run.sh
@@ -46,5 +46,5 @@
 rm -f A.class B.class
 
 ${TESTJAVA}/bin/javac -d . ${TESTSRC}/Test.java
-${TESTJAVA}/bin/java Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test
 rm -f *.class *.jar
diff --git a/test/java/io/Serializable/unnamedPackageSwitch/run.sh b/test/java/io/Serializable/unnamedPackageSwitch/run.sh
index 384495d..f31e5c1 100644
--- a/test/java/io/Serializable/unnamedPackageSwitch/run.sh
+++ b/test/java/io/Serializable/unnamedPackageSwitch/run.sh
@@ -41,4 +41,4 @@
 set -ex
 
 ${TESTJAVA}/bin/javac -d . ${TESTSRC}/A.java ${TESTSRC}/Test.java
-${TESTJAVA}/bin/java Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test
diff --git a/test/java/lang/Class/forName/NonJavaNames.sh b/test/java/lang/Class/forName/NonJavaNames.sh
index b12f045..1465a3b 100644
--- a/test/java/lang/Class/forName/NonJavaNames.sh
+++ b/test/java/lang/Class/forName/NonJavaNames.sh
@@ -94,7 +94,7 @@
 COPYSEMICOLON="cp ${TESTSRC}/classes/semicolon.class ${TESTCLASSES}/;.class"
 $COPYSEMICOLON
 
-JAVA="$TESTJAVA/bin/java -classpath ${TESTSRC}/classes${SEP}${TESTCLASSES}"
+JAVA="$TESTJAVA/bin/java ${TESTVMOPTS} -classpath ${TESTSRC}/classes${SEP}${TESTCLASSES}"
 
 $JAVA NonJavaNames
 RESULT=$?
diff --git a/test/java/lang/ClassLoader/Assert.sh b/test/java/lang/ClassLoader/Assert.sh
index 8e6909f..9bc5e01 100644
--- a/test/java/lang/ClassLoader/Assert.sh
+++ b/test/java/lang/ClassLoader/Assert.sh
@@ -49,7 +49,7 @@
 
 ${TESTJAVA}/bin/javac Assert.java 
 
-${TESTJAVA}/bin/java Assert
+${TESTJAVA}/bin/java ${TESTVMOPTS} Assert
 
 result=$?
 if [ $result -eq 0 ]
diff --git a/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh b/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh
index 17940ea..930ba2f 100644
--- a/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh
+++ b/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh
@@ -98,6 +98,7 @@
 
 # run test
 ${TESTJAVA}${FS}bin${FS}java \
+        ${TESTVMOPTS} \
         -verbose:class -XX:+TraceClassLoading -cp . \
         -Dtest.classes=${TESTCLASSES} \
         Starter cross
diff --git a/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh b/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh
index 5c2f017..311a276 100644
--- a/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh
+++ b/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh
@@ -93,6 +93,7 @@
 
 # run test
 ${TESTJAVA}${FS}bin${FS}java \
+        ${TESTVMOPTS} \
         -verbose:class -XX:+TraceClassLoading -cp . \
         -Dtest.classes=${TESTCLASSES} \
         Starter one-way
diff --git a/test/java/lang/ClassLoader/getdotresource.sh b/test/java/lang/ClassLoader/getdotresource.sh
index 7cf63c6..a6a0723 100644
--- a/test/java/lang/ClassLoader/getdotresource.sh
+++ b/test/java/lang/ClassLoader/getdotresource.sh
@@ -33,5 +33,5 @@
 if [ x"$TESTSRC" = x ]; then TESTSRC=.; fi
 
 # now start the test
-${TESTJAVA}/bin/java -Djava.ext.dirs=$TESTSRC -cp $TESTCLASSES GetDotResource
+${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.ext.dirs=$TESTSRC -cp $TESTCLASSES GetDotResource
 
diff --git a/test/java/lang/Integer/Unsigned.java b/test/java/lang/Integer/Unsigned.java
index c7b831d..09be7bf 100644
--- a/test/java/lang/Integer/Unsigned.java
+++ b/test/java/lang/Integer/Unsigned.java
@@ -16,9 +16,9 @@
  * 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
  */
 
 /*
diff --git a/test/java/lang/Long/Unsigned.java b/test/java/lang/Long/Unsigned.java
index 22e50e6..2ccbc8d 100644
--- a/test/java/lang/Long/Unsigned.java
+++ b/test/java/lang/Long/Unsigned.java
@@ -16,9 +16,9 @@
  * 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
  */
 
 /*
diff --git a/test/java/lang/Math/CubeRootTests.java b/test/java/lang/Math/CubeRootTests.java
index 9b180d1..abb221f 100644
--- a/test/java/lang/Math/CubeRootTests.java
+++ b/test/java/lang/Math/CubeRootTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/test/java/lang/Math/Expm1Tests.java b/test/java/lang/Math/Expm1Tests.java
index b10934e..e575710 100644
--- a/test/java/lang/Math/Expm1Tests.java
+++ b/test/java/lang/Math/Expm1Tests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/test/java/lang/Math/HyperbolicTests.java b/test/java/lang/Math/HyperbolicTests.java
index 0899df8..fb9abba 100644
--- a/test/java/lang/Math/HyperbolicTests.java
+++ b/test/java/lang/Math/HyperbolicTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/test/java/lang/Math/Log10Tests.java b/test/java/lang/Math/Log10Tests.java
index a9f169a..c7ff242 100644
--- a/test/java/lang/Math/Log10Tests.java
+++ b/test/java/lang/Math/Log10Tests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/test/java/lang/Math/Log1pTests.java b/test/java/lang/Math/Log1pTests.java
index f15a92b..56a8004 100644
--- a/test/java/lang/Math/Log1pTests.java
+++ b/test/java/lang/Math/Log1pTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/test/java/lang/Math/Tests.java b/test/java/lang/Math/Tests.java
index 6b39c8a..7dd6d68 100644
--- a/test/java/lang/Math/Tests.java
+++ b/test/java/lang/Math/Tests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/test/java/lang/Runtime/exec/setcwd.sh b/test/java/lang/Runtime/exec/setcwd.sh
index 14cd010..7fe1559 100644
--- a/test/java/lang/Runtime/exec/setcwd.sh
+++ b/test/java/lang/Runtime/exec/setcwd.sh
@@ -37,5 +37,5 @@
 cp ${TESTCLASSES}/SetCwd.class foo
 
 # now start the test
-${TESTJAVA}/bin/java SetCwd
+${TESTJAVA}/bin/java ${TESTVMOPTS} SetCwd
 
diff --git a/test/java/lang/StringBuffer/TestSynchronization.java b/test/java/lang/StringBuffer/TestSynchronization.java
index 75b4b82..cde4a28 100644
--- a/test/java/lang/StringBuffer/TestSynchronization.java
+++ b/test/java/lang/StringBuffer/TestSynchronization.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/lang/StringCoding/CheckEncodings.sh b/test/java/lang/StringCoding/CheckEncodings.sh
index 6b5fc83..edc5f9a 100644
--- a/test/java/lang/StringCoding/CheckEncodings.sh
+++ b/test/java/lang/StringCoding/CheckEncodings.sh
@@ -49,7 +49,7 @@
   echo "Testing:" ${1}
   set LC_ALL="${1}"; export LC_ALL
   locale
-  ${TESTJAVA}/bin/java -version 2>&1
+  ${TESTJAVA}/bin/java ${TESTVMOPTS} -version 2>&1
   expectPass $?
 }
 
diff --git a/test/java/lang/System/finalization/FinExit.sh b/test/java/lang/System/finalization/FinExit.sh
index 53bc675..e5eec43 100644
--- a/test/java/lang/System/finalization/FinExit.sh
+++ b/test/java/lang/System/finalization/FinExit.sh
@@ -26,7 +26,7 @@
 #
 
 # We only want the first character, Windows might add CRLF
-x=`$TESTJAVA/bin/java -cp "$TESTCLASSES" FinExit | cut -c1`
+x=`$TESTJAVA/bin/java ${TESTVMOPTS} -cp "$TESTCLASSES" FinExit | cut -c1`
 echo $x
 if [ "x$x" != "x1" ]; then
   echo On-exit finalizer invoked twice
diff --git a/test/java/lang/ThreadLocal/ThreadLocalSupplierTest.java b/test/java/lang/ThreadLocal/ThreadLocalSupplierTest.java
new file mode 100644
index 0000000..5601ac5
--- /dev/null
+++ b/test/java/lang/ThreadLocal/ThreadLocalSupplierTest.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Supplier;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/**
+ * @test
+ * @run testng ThreadLocalSupplierTest
+ * @summary tests ThreadLocal.withInitial(<Supplier>).
+ * Adapted from java.lang.Basic functional test of ThreadLocal
+ *
+ * @author Jim Gish <jim.gish@oracle.com>
+ */
+@Test
+public class ThreadLocalSupplierTest {
+
+    static final class IntegerSupplier implements Supplier<Integer> {
+
+        private final AtomicInteger supply = new AtomicInteger(0);
+
+        @Override
+        public Integer get() {
+            return supply.getAndIncrement();
+        }
+
+        public int numCalls() {
+            return supply.intValue();
+        }
+    }
+
+    static IntegerSupplier theSupply = new IntegerSupplier();
+
+    static final class MyThreadLocal extends ThreadLocal<Integer> {
+
+        private final ThreadLocal<Integer> delegate;
+
+        public volatile boolean everCalled;
+
+        public MyThreadLocal(Supplier<Integer> supplier) {
+            delegate = ThreadLocal.<Integer>withInitial(supplier);
+        }
+
+        @Override
+        public Integer get() {
+            return delegate.get();
+        }
+
+        @Override
+        protected synchronized Integer initialValue() {
+            // this should never be called since we are using the factory instead
+            everCalled = true;
+            return null;
+        }
+    }
+
+    /**
+     * Our one and only ThreadLocal from which we get thread ids using a
+     * supplier which simply increments a counter on each call of get().
+     */
+    static MyThreadLocal threadLocal = new MyThreadLocal(theSupply);
+
+    public void testMultiThread() throws Exception {
+        final int threadCount = 500;
+        final Thread th[] = new Thread[threadCount];
+        final boolean visited[] = new boolean[threadCount];
+
+        // Create and start the threads
+        for (int i = 0; i < threadCount; i++) {
+            th[i] = new Thread() {
+                @Override
+                public void run() {
+                    final int threadId = threadLocal.get();
+                    assertFalse(visited[threadId], "visited[" + threadId + "]=" + visited[threadId]);
+                    visited[threadId] = true;
+                    // check the get() again
+                    final int secondCheckThreadId = threadLocal.get();
+                    assertEquals(secondCheckThreadId, threadId);
+                }
+            };
+            th[i].start();
+        }
+
+        // Wait for the threads to finish
+        for (int i = 0; i < threadCount; i++) {
+            th[i].join();
+        }
+
+        assertEquals(theSupply.numCalls(), threadCount);
+        // make sure the provided initialValue() has not been called
+        assertFalse(threadLocal.everCalled);
+        // Check results
+        for (int i = 0; i < threadCount; i++) {
+            assertTrue(visited[i], "visited[" + i + "]=" + visited[i]);
+        }
+    }
+
+    public void testSimple() {
+        final String expected = "OneWithEverything";
+        final ThreadLocal<String> threadLocal = ThreadLocal.<String>withInitial(() -> expected);
+        assertEquals(expected, threadLocal.get());
+    }
+}
diff --git a/test/java/lang/annotation/loaderLeak/LoaderLeak.sh b/test/java/lang/annotation/loaderLeak/LoaderLeak.sh
index c7315f5..bc72b93 100644
--- a/test/java/lang/annotation/loaderLeak/LoaderLeak.sh
+++ b/test/java/lang/annotation/loaderLeak/LoaderLeak.sh
@@ -69,7 +69,7 @@
 cp ${TESTSRC}${FS}*.java .
 ${TESTJAVA}${FS}bin${FS}javac -d classes A.java B.java C.java
 ${TESTJAVA}${FS}bin${FS}javac Main.java
-${TESTJAVA}${FS}bin${FS}java Main
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} Main
 result=$?
 if [ $result -eq 0 ]
 then
@@ -78,7 +78,7 @@
   echo "Failed 1 of 2"
   exit $result
 fi
-${TESTJAVA}${FS}bin${FS}java Main foo
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} Main foo
 result=$?
 if [ $result -eq 0 ]
 then
diff --git a/test/java/lang/invoke/lambda/LambdaAccessControlDoPrivilegedTest.java b/test/java/lang/invoke/lambda/LambdaAccessControlDoPrivilegedTest.java
new file mode 100644
index 0000000..8c3d1c5
--- /dev/null
+++ b/test/java/lang/invoke/lambda/LambdaAccessControlDoPrivilegedTest.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8003881
+ * @summary tests DoPrivileged action (implemented as lambda expressions) by
+ * inserting them into the BootClassPath.
+ * @compile -XDignore.symbol.file LambdaAccessControlDoPrivilegedTest.java
+ * @run main/othervm LambdaAccessControlDoPrivilegedTest
+ */
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.charset.Charset;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class LambdaAccessControlDoPrivilegedTest extends LUtils {
+    public static void main(String... args) {
+        final List<String> scratch = new ArrayList();
+        scratch.clear();
+        scratch.add("import java.security.*;");
+        scratch.add("public class DoPriv {");
+        scratch.add("public static void main(String... args) {");
+        scratch.add("String prop = AccessController.doPrivileged((PrivilegedAction<String>) () -> {");
+        scratch.add("return System.getProperty(\"user.home\");");
+        scratch.add("});");
+        scratch.add("}");
+        scratch.add("}");
+        File doprivJava = new File("DoPriv.java");
+        File doprivClass = getClassFile(doprivJava);
+        createFile(doprivJava, scratch);
+
+        scratch.clear();
+        scratch.add("public class Bar {");
+        scratch.add("public static void main(String... args) {");
+        scratch.add("System.out.println(\"sun.boot.class.path\" + \"=\" +");
+        scratch.add("    System.getProperty(\"sun.boot.class.path\", \"\"));");
+        scratch.add("System.setSecurityManager(new SecurityManager());");
+        scratch.add("DoPriv.main();");
+        scratch.add("}");
+        scratch.add("}");
+
+        File barJava = new File("Bar.java");
+        File barClass = getClassFile(barJava);
+        createFile(barJava, scratch);
+
+        String[] javacArgs = {barJava.getName(), doprivJava.getName()};
+        compile(javacArgs);
+        File jarFile = new File("foo.jar");
+        String[] jargs = {"cvf", jarFile.getName(), doprivClass.getName()};
+        jarTool.run(jargs);
+        doprivJava.delete();
+        doprivClass.delete();
+        TestResult tr = doExec(JAVA_CMD.getAbsolutePath(),
+                               "-Xbootclasspath/p:foo.jar",
+                               "-cp", ".", "Bar");
+        tr.assertZero("testDoPrivileged fails");
+        barJava.delete();
+        barClass.delete();
+        jarFile.delete();
+    }
+}
+
+/*
+ * support infrastructure to invoke a java class from the command line
+ */
+class LUtils {
+    static final sun.tools.jar.Main jarTool =
+            new sun.tools.jar.Main(System.out, System.err, "jar-tool");
+    static final com.sun.tools.javac.Main javac =
+            new com.sun.tools.javac.Main();
+    static final File cwd = new File(".").getAbsoluteFile();
+    static final String JAVAHOME = System.getProperty("java.home");
+    static final boolean isWindows =
+            System.getProperty("os.name", "unknown").startsWith("Windows");
+    //static final boolean isSDK = JAVAHOME.endsWith("jre");
+    static final File JAVA_BIN_FILE = new File(JAVAHOME, "bin");
+    static final File JAVA_CMD = new File(JAVA_BIN_FILE,
+            isWindows ? "java.exe" : "java");
+
+    protected LUtils() {
+    }
+
+    public static void compile(String... args) {
+        if (javac.compile(args) != 0) {
+            throw new RuntimeException("compilation fails");
+        }
+    }
+
+    static void createFile(File outFile, List<String> content) {
+        try {
+            Files.write(outFile.getAbsoluteFile().toPath(), content,
+                    Charset.defaultCharset());
+        } catch (IOException ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
+    static File getClassFile(File javaFile) {
+        return javaFile.getName().endsWith(".java")
+                ? new File(javaFile.getName().replace(".java", ".class"))
+                : null;
+    }
+
+    static String getSimpleName(File inFile) {
+        String fname = inFile.getName();
+        return fname.substring(0, fname.indexOf("."));
+    }
+
+    static TestResult doExec(String... cmds) {
+        return doExec(null, null, cmds);
+    }
+
+    /*
+     * A method which executes a java cmd and returns the results in a container
+     */
+    static TestResult doExec(Map<String, String> envToSet,
+            java.util.Set<String> envToRemove, String... cmds) {
+        String cmdStr = "";
+        for (String x : cmds) {
+            cmdStr = cmdStr.concat(x + " ");
+        }
+        ProcessBuilder pb = new ProcessBuilder(cmds);
+        Map<String, String> env = pb.environment();
+        if (envToRemove != null) {
+            for (String key : envToRemove) {
+                env.remove(key);
+            }
+        }
+        if (envToSet != null) {
+            env.putAll(envToSet);
+        }
+        BufferedReader rdr = null;
+        try {
+            List<String> outputList = new ArrayList<>();
+            pb.redirectErrorStream(true);
+            Process p = pb.start();
+            rdr = new BufferedReader(new InputStreamReader(p.getInputStream()));
+            String in = rdr.readLine();
+            while (in != null) {
+                outputList.add(in);
+                in = rdr.readLine();
+            }
+            p.waitFor();
+            p.destroy();
+
+            return new TestResult(cmdStr, p.exitValue(), outputList,
+                    env, new Throwable("current stack of the test"));
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            throw new RuntimeException(ex.getMessage());
+        }
+    }
+
+    static class TestResult {
+        String cmd;
+        int exitValue;
+        List<String> testOutput;
+        Map<String, String> env;
+        Throwable t;
+
+        public TestResult(String str, int rv, List<String> oList,
+                Map<String, String> env, Throwable t) {
+            cmd = str;
+            exitValue = rv;
+            testOutput = oList;
+            this.env = env;
+            this.t = t;
+        }
+
+        void assertZero(String message) {
+            if (exitValue != 0) {
+                System.err.println(this);
+                throw new RuntimeException(message);
+            }
+        }
+
+        @Override
+        public String toString() {
+            StringWriter sw = new StringWriter();
+            PrintWriter status = new PrintWriter(sw);
+            status.println("Cmd: " + cmd);
+            status.println("Return code: " + exitValue);
+            status.println("Environment variable:");
+            for (String x : env.keySet()) {
+                status.println("\t" + x + "=" + env.get(x));
+            }
+            status.println("Output:");
+            for (String x : testOutput) {
+                status.println("\t" + x);
+            }
+            status.println("Exception:");
+            status.println(t.getMessage());
+            t.printStackTrace(status);
+
+            return sw.getBuffer().toString();
+        }
+    }
+}
diff --git a/test/java/lang/invoke/lambda/LambdaAccessControlTest.java b/test/java/lang/invoke/lambda/LambdaAccessControlTest.java
new file mode 100644
index 0000000..361a4cf
--- /dev/null
+++ b/test/java/lang/invoke/lambda/LambdaAccessControlTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8003881
+ * @summary tests Lambda expression with a a security manager at top level
+ * @compile -XDignore.symbol.file LambdaAccessControlTest.java
+ *
+ * @run main/othervm LambdaAccessControlTest
+ */
+
+public class LambdaAccessControlTest extends LUtils {
+    public static void main(String... args) {
+        System.setSecurityManager(new SecurityManager());
+        JJ<Integer> iii = (new CC())::impl;
+        System.out.printf(">>> %s\n", iii.foo(44));
+        iii = DD::impl;
+        System.out.printf(">>> %s\n", iii.foo(44));
+        return;
+    }
+}
+/*
+ * support classes for the test
+ */
+interface II<T> {  Object foo(T x); }
+interface JJ<R extends Number> extends II<R> { }
+class CC {  String impl(int i) { return "impl:"+i; }}
+class DD {  static String impl(int i) { return "impl:"+i; }}
diff --git a/test/java/lang/invoke/remote/RemoteExample.java b/test/java/lang/invoke/remote/RemoteExample.java
index 0829a65..801d9b7 100644
--- a/test/java/lang/invoke/remote/RemoteExample.java
+++ b/test/java/lang/invoke/remote/RemoteExample.java
@@ -1,12 +1,12 @@
 /*
- * Copyright 2009-2010 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * 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.  Sun designates this
+ * published by the Free Software Foundation.  Oracle designates this
  * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
+ * 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
@@ -18,9 +18,9 @@
  * 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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 test.java.lang.invoke.remote;
 
diff --git a/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh b/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh
index 1f8d823..571a3d9 100644
--- a/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh
+++ b/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh
@@ -52,7 +52,7 @@
 runOne()
 {
    echo "$TESTJAVA/bin/java -classpath $TESTCLASSES $@"
-   $TESTJAVA/bin/java -classpath $TESTCLASSES $@
+   $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@
 }
 
 # Retry 5 times to be more resilent to system load fluctation.
diff --git a/test/java/math/BigDecimal/FloatDoubleValueTests.java b/test/java/math/BigDecimal/FloatDoubleValueTests.java
index f8f3f9a..c615b76 100644
--- a/test/java/math/BigDecimal/FloatDoubleValueTests.java
+++ b/test/java/math/BigDecimal/FloatDoubleValueTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/test/java/math/BigDecimal/StrippingZerosTest.java b/test/java/math/BigDecimal/StrippingZerosTest.java
index c76d0ca..d0b1753 100644
--- a/test/java/math/BigDecimal/StrippingZerosTest.java
+++ b/test/java/math/BigDecimal/StrippingZerosTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/test/java/net/Authenticator/B4933582.sh b/test/java/net/Authenticator/B4933582.sh
index 6618836..1dfed10 100644
--- a/test/java/net/Authenticator/B4933582.sh
+++ b/test/java/net/Authenticator/B4933582.sh
@@ -45,5 +45,5 @@
 esac
 ${TESTJAVA}${FS}bin${FS}javac -d . -classpath "${TESTSRC}${FS}..${FS}..${FS}..${FS}sun${FS}net${FS}www${FS}httptest" ${TESTSRC}${FS}B4933582.java
 rm -f cache.ser auth.save
-${TESTJAVA}${FS}bin${FS}java -classpath "${TESTSRC}${FS}..${FS}..${FS}..${FS}sun${FS}net${FS}www${FS}httptest${PS}." B4933582 first
-${TESTJAVA}${FS}bin${FS}java -classpath "${TESTSRC}${FS}..${FS}..${FS}..${FS}sun${FS}net${FS}www${FS}httptest${PS}." B4933582 second
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath "${TESTSRC}${FS}..${FS}..${FS}..${FS}sun${FS}net${FS}www${FS}httptest${PS}." B4933582 first
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath "${TESTSRC}${FS}..${FS}..${FS}..${FS}sun${FS}net${FS}www${FS}httptest${PS}." B4933582 second
diff --git a/test/java/net/CookieHandler/B6791927.java b/test/java/net/CookieHandler/B6791927.java
index 65b60cb..4b87015 100644
--- a/test/java/net/CookieHandler/B6791927.java
+++ b/test/java/net/CookieHandler/B6791927.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -37,7 +37,7 @@
         try {
             // Forces a non US locale
             Locale.setDefault(Locale.FRANCE);
-            List<HttpCookie> cookies = HttpCookie.parse("set-cookie: CUSTOMER=WILE_E_COYOTE; expires=Wednesday, 09-Nov-2019 23:12:40 GMT");
+            List<HttpCookie> cookies = HttpCookie.parse("set-cookie: CUSTOMER=WILE_E_COYOTE; expires=Sat, 09-Nov-2019 23:12:40 GMT");
             if (cookies == null || cookies.isEmpty()) {
                 throw new RuntimeException("No cookie found");
             }
diff --git a/test/java/net/CookieHandler/CookieManagerTest.java b/test/java/net/CookieHandler/CookieManagerTest.java
index ac51b42..f3d5b7a 100644
--- a/test/java/net/CookieHandler/CookieManagerTest.java
+++ b/test/java/net/CookieHandler/CookieManagerTest.java
@@ -126,7 +126,7 @@
         testPolicies[count] = CookiePolicy.ACCEPT_ORIGINAL_SERVER;
         testCases[count++] = new CookieTestCase[]{
                 new CookieTestCase("Set-Cookie",
-                "CUSTOMER=WILE:BOB; path=/; expires=Wednesday, 09-Nov-2030 23:12:40 GMT;" + "domain=." + localHostAddr,
+                "CUSTOMER=WILE:BOB; path=/; expires=Sat, 09-Nov-2030 23:12:40 GMT;" + "domain=." + localHostAddr,
                 "CUSTOMER=WILE:BOB",
                 "/"
                 ),
diff --git a/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh b/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh
index 372c04d..271b21d 100644
--- a/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh
+++ b/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh
@@ -49,4 +49,4 @@
     ;;
 esac
 
-${TESTJAVA}${FILESEP}bin${FILESEP}java -Xbootclasspath/p:${TESTCLASSES} ADatagramSocket true
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} -Xbootclasspath/p:${TESTCLASSES} ADatagramSocket true
diff --git a/test/java/net/HttpCookie/ExpiredCookieTest.java b/test/java/net/HttpCookie/ExpiredCookieTest.java
new file mode 100644
index 0000000..b43065f
--- /dev/null
+++ b/test/java/net/HttpCookie/ExpiredCookieTest.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8000525
+ */
+
+import java.net.*;
+import java.util.*;
+import java.io.*;
+import java.text.*;
+
+public class ExpiredCookieTest {
+    // lifted from HttpCookie.java
+    private final static String[] COOKIE_DATE_FORMATS = {
+        "EEE',' dd-MMM-yy HH:mm:ss 'GMT'",
+        "EEE',' dd MMM yy HH:mm:ss 'GMT'",
+        "EEE MMM dd yy HH:mm:ss 'GMT'Z",
+        "EEE',' dd-MMM-yyyy HH:mm:ss 'GMT'",
+        "EEE',' dd MMM yyyy HH:mm:ss 'GMT'",
+        "EEE MMM dd yyyy HH:mm:ss 'GMT'Z"
+    };
+    static final TimeZone GMT = TimeZone.getTimeZone("GMT");
+
+    public static void main(String[] args) throws Exception {
+        Calendar cal = Calendar.getInstance(GMT);
+
+        for (int i = 0; i < COOKIE_DATE_FORMATS.length; i++) {
+            SimpleDateFormat df = new SimpleDateFormat(COOKIE_DATE_FORMATS[i],
+                                                     Locale.US);
+            cal.set(1970, 0, 1, 0, 0, 0);
+            df.setTimeZone(GMT);
+            df.setLenient(false);
+            df.set2DigitYearStart(cal.getTime());
+            CookieManager cm = new CookieManager(
+                null, CookiePolicy.ACCEPT_ALL);
+            CookieHandler.setDefault(cm);
+            Map<String,List<String>> header = new HashMap<>();
+            List<String> values = new ArrayList<>();
+
+            cal.set(1970, 6, 9, 10, 10, 1);
+            StringBuilder datestring =
+                new StringBuilder(df.format(cal.getTime()));
+            values.add(
+                "TEST1=TEST1; Path=/; Expires=" + datestring.toString());
+
+            cal.set(1969, 6, 9, 10, 10, 2);
+            datestring = new StringBuilder(df.format(cal.getTime()));
+            values.add(
+                "TEST2=TEST2; Path=/; Expires=" + datestring.toString());
+
+            cal.set(2070, 6, 9, 10, 10, 3);
+            datestring = new StringBuilder(df.format(cal.getTime()));
+            values.add(
+                "TEST3=TEST3; Path=/; Expires=" + datestring.toString());
+
+            cal.set(2069, 6, 9, 10, 10, 4);
+            datestring = new StringBuilder(df.format(cal.getTime()));
+            values.add(
+                "TEST4=TEST4; Path=/; Expires=" + datestring.toString());
+
+            header.put("Set-Cookie", values);
+            cm.put(new URI("http://127.0.0.1/"), header);
+
+            CookieStore cookieJar =  cm.getCookieStore();
+            List <HttpCookie> cookies = cookieJar.getCookies();
+            if (COOKIE_DATE_FORMATS[i].contains("yyyy")) {
+                if (cookies.size() != 2)
+                    throw new RuntimeException(
+                        "Incorrectly parsing a bad date");
+            } else if (cookies.size() != 1) {
+                throw new RuntimeException(
+                    "Incorrectly parsing a bad date");
+            }
+        }
+    }
+}
diff --git a/test/java/net/Inet4Address/PingThis.java b/test/java/net/Inet4Address/PingThis.java
index 515a873..d302df5 100644
--- a/test/java/net/Inet4Address/PingThis.java
+++ b/test/java/net/Inet4Address/PingThis.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/net/Inet6Address/StringScope.java b/test/java/net/Inet6Address/StringScope.java
new file mode 100644
index 0000000..6b01ba8
--- /dev/null
+++ b/test/java/net/Inet6Address/StringScope.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8004675
+ * @summary  Inet6Address.getHostAddress should use string scope
+ *           identifier where available
+ */
+
+import java.net.*;
+import java.util.Enumeration;
+
+public class StringScope {
+
+    public static void main(String args[]) throws Exception {
+        Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();
+        while (e.hasMoreElements()) {
+            NetworkInterface iface = e.nextElement();
+            Enumeration<InetAddress> iadrs = iface.getInetAddresses();
+            while (iadrs.hasMoreElements()) {
+                InetAddress iadr = iadrs.nextElement();
+                if (iadr instanceof Inet6Address) {
+                    Inet6Address i6adr = (Inet6Address) iadr;
+                    NetworkInterface nif = i6adr.getScopedInterface();
+                    if (nif == null)
+                        continue;
+
+                    String nifName = nif.getName();
+                    String i6adrHostAddress = i6adr.getHostAddress();
+                    int index = i6adrHostAddress.indexOf('%');
+                    String i6adrScopeName = i6adrHostAddress.substring(index+1);
+
+                    if (!nifName.equals(i6adrScopeName))
+                        throw new RuntimeException("Expected nifName ["
+                                      + nifName + "], to equal i6adrScopeName ["
+                                      + i6adrScopeName + "] ");
+                }
+            }
+        }
+    }
+}
+
diff --git a/test/java/net/InetAddress/ptr/lookup.sh b/test/java/net/InetAddress/ptr/lookup.sh
index 2fd0831..3ff73a3 100644
--- a/test/java/net/InetAddress/ptr/lookup.sh
+++ b/test/java/net/InetAddress/ptr/lookup.sh
@@ -53,13 +53,13 @@
 
 # IPv4 reverse lookup
 echo ''
-OUT1=`$JAVA -Djava.net.preferIPv4Stack=true Lookup -q=PTR $ADDR`
+OUT1=`$JAVA ${TESTVMOPTS} -Djava.net.preferIPv4Stack=true Lookup -q=PTR $ADDR`
 echo "(IPv4) $ADDR --> $OUT1"
 
 
 # reverse lookup (default)
 echo ''
-OUT2=`$JAVA Lookup -q=PTR $ADDR`
+OUT2=`$JAVA ${TESTVMOPTS} Lookup -q=PTR $ADDR`
 echo "(default) $ADDR --> $OUT2"
 
 
diff --git a/test/java/net/ProxySelector/MultiThreadedSystemProxies.java b/test/java/net/ProxySelector/MultiThreadedSystemProxies.java
index 63a385c..59d04d8 100644
--- a/test/java/net/ProxySelector/MultiThreadedSystemProxies.java
+++ b/test/java/net/ProxySelector/MultiThreadedSystemProxies.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.sh b/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.sh
index 5b03948..df85f49 100644
--- a/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.sh
+++ b/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.sh
@@ -45,4 +45,4 @@
     ulimit -n 1024
 fi
 
-${TESTJAVA}/bin/java AcceptCauseFileDescriptorLeak
+${TESTJAVA}/bin/java ${TESTVMOPTS} AcceptCauseFileDescriptorLeak
diff --git a/test/java/net/Socket/OldSocketImpl.sh b/test/java/net/Socket/OldSocketImpl.sh
index 5f429d1..bbe055f 100644
--- a/test/java/net/Socket/OldSocketImpl.sh
+++ b/test/java/net/Socket/OldSocketImpl.sh
@@ -50,7 +50,7 @@
 # with 1.3 and in OldStyleImpl.jar
 
 # run
-${TESTJAVA}${FS}bin${FS}java -cp ${TESTSRC}${FS}OldSocketImpl.jar OldSocketImpl
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp ${TESTSRC}${FS}OldSocketImpl.jar OldSocketImpl
 result=$?
 if [ "$result" -ne "0" ]; then
     exit 1
diff --git a/test/java/net/Socks/SocksV4Test.java b/test/java/net/Socks/SocksV4Test.java
index 01546c1..b61d658 100644
--- a/test/java/net/Socks/SocksV4Test.java
+++ b/test/java/net/Socks/SocksV4Test.java
@@ -26,20 +26,26 @@
  * @bug 4727547
  * @summary SocksSocketImpl throws NullPointerException
  * @build SocksServer
- * @run main SocksV4Test
  */
 
 import java.net.*;
 
 public class SocksV4Test {
+
+    // An unresolvable host
+    static final String HOSTNAME = "doesnot.exist.invalid";
+
     public static void main(String[] args) throws Exception {
+        // sanity before running the test
+        assertUnresolvableHost(HOSTNAME);
+
         // Create a SOCKS V4 proxy
         SocksServer srvr = new SocksServer(0, true);
         srvr.start();
         Proxy sp = new Proxy(Proxy.Type.SOCKS,
                              new InetSocketAddress("localhost", srvr.getPort()));
         // Let's create an unresolved address
-        InetSocketAddress ad = new InetSocketAddress("doesnt.exist.name", 1234);
+        InetSocketAddress ad = new InetSocketAddress(HOSTNAME, 1234);
         try (Socket s = new Socket(sp)) {
             s.connect(ad, 10000);
         } catch (UnknownHostException ex) {
@@ -51,4 +57,15 @@
             srvr.terminate();
         }
     }
+
+    static void assertUnresolvableHost(String host) {
+        InetAddress addr = null;
+        try {
+            addr = InetAddress.getByName(host);
+        } catch (UnknownHostException x) {
+            // OK, expected
+        }
+        if (addr != null)
+            throw new RuntimeException("Test cannot run. resolvable address:" + addr);
+    }
 }
diff --git a/test/java/net/URL/B5086147.sh b/test/java/net/URL/B5086147.sh
index e92a8ee..e5830b9 100644
--- a/test/java/net/URL/B5086147.sh
+++ b/test/java/net/URL/B5086147.sh
@@ -47,7 +47,7 @@
 failures=0
 
 echo ''
-${TESTJAVA}${FS}bin${FS}java B5086147
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} B5086147
 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 
 if [ "$failures" != "0" ]; then
diff --git a/test/java/net/URL/runconstructor.sh b/test/java/net/URL/runconstructor.sh
index 340f1e9..5a8f090 100644
--- a/test/java/net/URL/runconstructor.sh
+++ b/test/java/net/URL/runconstructor.sh
@@ -50,7 +50,7 @@
 
 go() {
     echo ''
-    ${TESTJAVA}${FS}bin${FS}java Constructor $1
+    ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} Constructor $1
     if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 }
 
diff --git a/test/java/net/URLClassLoader/B5077773.sh b/test/java/net/URLClassLoader/B5077773.sh
index b489769..725829e 100644
--- a/test/java/net/URLClassLoader/B5077773.sh
+++ b/test/java/net/URLClassLoader/B5077773.sh
@@ -61,5 +61,5 @@
 ${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}B5077773.java
 
 WD=`pwd`
-${TESTJAVA}${FS}bin${FS}java B5077773
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} B5077773
 
diff --git a/test/java/net/URLClassLoader/getresourceasstream/test.sh b/test/java/net/URLClassLoader/getresourceasstream/test.sh
index 11aa9bf..1654f31 100644
--- a/test/java/net/URLClassLoader/getresourceasstream/test.sh
+++ b/test/java/net/URLClassLoader/getresourceasstream/test.sh
@@ -46,11 +46,11 @@
 ${TESTJAVA}/bin/javac -d . ${TESTSRC}/Test.java
 cp ${TESTSRC}/test.jar .
 
-${TESTJAVA}/bin/java Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test
 checkExit 
 
 # try with security manager
 
-${TESTJAVA}/bin/java -Djava.security.policy=file:./policy -Djava.security.manager Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.security.policy=file:./policy -Djava.security.manager Test
 checkExit 
 exit 0
diff --git a/test/java/net/URLClassLoader/sealing/checksealed.sh b/test/java/net/URLClassLoader/sealing/checksealed.sh
index c2a048a..b675eb2 100644
--- a/test/java/net/URLClassLoader/sealing/checksealed.sh
+++ b/test/java/net/URLClassLoader/sealing/checksealed.sh
@@ -56,7 +56,7 @@
 CLASSPATH=".${PS}${TESTSRC}${FS}a${PS}${TESTSRC}${FS}b.jar"
 
 ${TESTJAVA}${FS}bin${FS}javac -classpath "${CLASSPATH}" -d . ${TESTSRC}${FS}CheckSealed.java
-${TESTJAVA}${FS}bin${FS}java -cp "${CLASSPATH}" CheckSealed 1
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp "${CLASSPATH}" CheckSealed 1
 if [ $? != 0 ]; then exit 1; fi
-${TESTJAVA}${FS}bin${FS}java -cp "${CLASSPATH}" CheckSealed 2
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp "${CLASSPATH}" CheckSealed 2
 if [ $? != 0 ]; then exit 1; fi
diff --git a/test/java/net/URLConnection/6212146/test.sh b/test/java/net/URLConnection/6212146/test.sh
index 56a628a..22c6473 100644
--- a/test/java/net/URLConnection/6212146/test.sh
+++ b/test/java/net/URLConnection/6212146/test.sh
@@ -67,7 +67,7 @@
 
 WD=`pwd`
 ulimit -H -n 300
-${TESTJAVA}${FS}bin${FS}java Test ${WD}/jars/ test.jar
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} Test ${WD}/jars/ test.jar
 result=$?
 rm -rf jars
 exit $?
diff --git a/test/java/net/URLConnection/UNCTest.sh b/test/java/net/URLConnection/UNCTest.sh
index 502403b..aa9f184 100644
--- a/test/java/net/URLConnection/UNCTest.sh
+++ b/test/java/net/URLConnection/UNCTest.sh
@@ -36,7 +36,7 @@
 case "$OS" in
     Windows_95 | Windows_98 | Windows_NT )
 	${TESTJAVA}/bin/javac -d . ${TESTSRC}\\UNCTest.java
-	${TESTJAVA}/bin/java UNCTest ${UNC}
+	${TESTJAVA}/bin/java ${TESTVMOPTS} UNCTest ${UNC}
 	exit
         ;;
 
diff --git a/test/java/nio/Buffer/LimitDirectMemory.sh b/test/java/nio/Buffer/LimitDirectMemory.sh
index 38e8c0c..027d627 100644
--- a/test/java/nio/Buffer/LimitDirectMemory.sh
+++ b/test/java/nio/Buffer/LimitDirectMemory.sh
@@ -34,7 +34,7 @@
 
 runTest() {
   echo "Testing: $*"
-  ${TESTJAVA}/bin/java $*
+  ${TESTJAVA}/bin/java ${TESTVMOPTS} $*
   if [ $? -eq 0 ]
   then echo "--- passed as expected"
   else
@@ -43,10 +43,11 @@
   fi
 }
 
+
 launchFail() {
   echo "Testing: -XX:MaxDirectMemorySize=$* -cp ${TESTCLASSES} \
      LimitDirectMemory true DEFAULT DEFAULT+1M"
-  ${TESTJAVA}/bin/java -XX:MaxDirectMemorySize=$* -cp ${TESTCLASSES} \
+  ${TESTJAVA}/bin/java ${TESTVMOPTS} -XX:MaxDirectMemorySize=$* -cp ${TESTCLASSES} \
      LimitDirectMemory true DEFAULT DEFAULT+1M > ${TMP1} 2>&1
   cat ${TMP1}
   cat ${TMP1} | grep -s "Unrecognized VM option: \'MaxDirectMemorySize="
diff --git a/test/java/nio/channels/AsynchronousChannelGroup/run_any_task.sh b/test/java/nio/channels/AsynchronousChannelGroup/run_any_task.sh
index 6849315..8136634 100644
--- a/test/java/nio/channels/AsynchronousChannelGroup/run_any_task.sh
+++ b/test/java/nio/channels/AsynchronousChannelGroup/run_any_task.sh
@@ -46,7 +46,7 @@
     -C "${TESTCLASSES}" Attack.class
 
 echo "Running test ..."
-$JAVA -XX:-UseVMInterruptibleIO \
-    -Xbootclasspath/a:"${TESTCLASSES}/Privileged.jar" \
-    -classpath "${TESTCLASSES}" \
-    AsExecutor
+$JAVA ${TESTVMOPTS} \
+      -Xbootclasspath/a:"${TESTCLASSES}/Privileged.jar" \
+      -classpath "${TESTCLASSES}" \
+      AsExecutor
diff --git a/test/java/nio/channels/spi/AsynchronousChannelProvider/custom_provider.sh b/test/java/nio/channels/spi/AsynchronousChannelProvider/custom_provider.sh
index c334192..bf82465 100644
--- a/test/java/nio/channels/spi/AsynchronousChannelProvider/custom_provider.sh
+++ b/test/java/nio/channels/spi/AsynchronousChannelProvider/custom_provider.sh
@@ -51,7 +51,7 @@
 
 go() {
     echo ''
-    $JAVA $1 $2 $3 2>&1
+    $JAVA ${TESTVMOPTS} $1 $2 $3 2>&1
     if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 }
 
diff --git a/test/java/nio/charset/Charset/default.sh b/test/java/nio/charset/Charset/default.sh
index 5a91ea1..c93aa71 100644
--- a/test/java/nio/charset/Charset/default.sh
+++ b/test/java/nio/charset/Charset/default.sh
@@ -64,7 +64,7 @@
   ecs="$1"; shift
 
   echo -n "$L: "
-  cs="`LC_ALL=$L $JAVA -cp $TESTCLASSES Default`"
+  cs="`LC_ALL=$L $JAVA ${TESTVMOPTS} -cp $TESTCLASSES Default`"
   if [ $? != 0 ]; then
     exit 1
   elif [ "`tolower $cs`" != "`tolower $ecs`" ]; then
diff --git a/test/java/nio/charset/coders/CheckSJISMappingProp.sh b/test/java/nio/charset/coders/CheckSJISMappingProp.sh
index 49caa0d..fd76d5a 100644
--- a/test/java/nio/charset/coders/CheckSJISMappingProp.sh
+++ b/test/java/nio/charset/coders/CheckSJISMappingProp.sh
@@ -51,7 +51,7 @@
 }
 
 
-JAVA="${TESTJAVA}/bin/java -cp ${TESTCLASSES}"
+JAVA="${TESTJAVA}/bin/java ${TESTVMOPTS} -cp ${TESTCLASSES}"
 runTest() {
   echo "Testing:" ${1}
   LC_ALL="$1" ; export LC_ALL
diff --git a/test/java/nio/charset/spi/basic.sh b/test/java/nio/charset/spi/basic.sh
index c1bdd45..e4f89c5 100644
--- a/test/java/nio/charset/spi/basic.sh
+++ b/test/java/nio/charset/spi/basic.sh
@@ -116,7 +116,7 @@
 		     av="$av -Djava.security.manager
 		         -Djava.security.policy==$TESTSRC/charsetProvider.sp";;
     esac
-    if (set -x; $JAVA $av Test $css) 2>&1; then
+    if (set -x; $JAVA ${TESTVMOPTS} $av Test $css) 2>&1; then
       continue;
     else
       failures=`expr $failures + 1`
diff --git a/test/java/nio/file/Files/delete_on_close.sh b/test/java/nio/file/Files/delete_on_close.sh
index 7ffa009..f6a5868 100644
--- a/test/java/nio/file/Files/delete_on_close.sh
+++ b/test/java/nio/file/Files/delete_on_close.sh
@@ -51,7 +51,7 @@
 
 TMPFILE="$$.tmp"
 touch $TMPFILE
-$JAVA DeleteOnClose $TMPFILE 2>&1
+$JAVA ${TESTVMOPTS} DeleteOnClose $TMPFILE 2>&1
 if [ $? != 0 ]; then exit 1; fi
 if [ -f $TMPFILE ]; then
     echo "$TMPFILE was not deleted"
diff --git a/test/java/nio/file/Files/walkFileTree/walk_file_tree.sh b/test/java/nio/file/Files/walkFileTree/walk_file_tree.sh
index dee0dd0..6c9d7dc 100644
--- a/test/java/nio/file/Files/walkFileTree/walk_file_tree.sh
+++ b/test/java/nio/file/Files/walkFileTree/walk_file_tree.sh
@@ -56,7 +56,7 @@
 failures=0
 
 # print the file tree and compare output with find(1)
-$JAVA PrintFileTree "$ROOT" > out1
+$JAVA ${TESTVMOPTS} PrintFileTree "$ROOT" > out1
 find "$ROOT" > out2
 diff out1 out2
 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
@@ -66,26 +66,26 @@
 # not. For that reason we run PrintFileTree with the -printCycles
 # option when the output without this option differs to find(1).
 find "$ROOT" -follow > out1
-$JAVA PrintFileTree -follow "$ROOT" > out2
+$JAVA ${TESTVMOPTS} PrintFileTree -follow "$ROOT" > out2
 diff out1 out2
 if [ $? != 0 ];
   then 
     # re-run printing cycles to stdout
-    $JAVA PrintFileTree -follow -printCycles "$ROOT" > out2
+    $JAVA ${TESTVMOPTS} PrintFileTree -follow -printCycles "$ROOT" > out2
     diff out1 out2
     if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
   fi
 
 # test SKIP_SIBLINGS
-$JAVA SkipSiblings "$ROOT"
+$JAVA ${TESTVMOPTS} SkipSiblings "$ROOT"
 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 
 # test TERMINATE
-$JAVA TerminateWalk "$ROOT"
+$JAVA ${TESTVMOPTS} TerminateWalk "$ROOT"
 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 
 # test maxDepth
-$JAVA MaxDepth "$ROOT"
+$JAVA ${TESTVMOPTS} MaxDepth "$ROOT"
 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 
 # clean-up
diff --git a/test/java/nio/file/Path/MacPathTest.sh b/test/java/nio/file/Path/MacPathTest.sh
index e81c62a..e5d410b 100644
--- a/test/java/nio/file/Path/MacPathTest.sh
+++ b/test/java/nio/file/Path/MacPathTest.sh
@@ -36,4 +36,4 @@
   TESTCLASSES=.
 fi
 
-export LC_ALL=en_US.UTF-8; ${TESTJAVA}/bin/java -cp ${TESTCLASSES} MacPathTest
+export LC_ALL=en_US.UTF-8; ${TESTJAVA}/bin/java ${TESTVMOPTS} -cp ${TESTCLASSES} MacPathTest
diff --git a/test/java/rmi/MarshalledObject/compare/Compare.java b/test/java/rmi/MarshalledObject/compare/Compare.java
index 96ea46f..2032264 100644
--- a/test/java/rmi/MarshalledObject/compare/Compare.java
+++ b/test/java/rmi/MarshalledObject/compare/Compare.java
@@ -29,7 +29,6 @@
  *          not involved in location should be compared.
  * @author Ken Arnold
  *
- * @build Compare
  * @run main Compare 11 annotatedRef
  */
 
diff --git a/test/java/rmi/MarshalledObject/compare/HashCode.java b/test/java/rmi/MarshalledObject/compare/HashCode.java
index 6a0266b..768e418 100644
--- a/test/java/rmi/MarshalledObject/compare/HashCode.java
+++ b/test/java/rmi/MarshalledObject/compare/HashCode.java
@@ -27,7 +27,6 @@
  * @summary MarshalledObject with null throws NullPointerException
  * @author Ken Arnold
  *
- * @build HashCode
  * @run main HashCode 11 annotatedRef
  */
 
diff --git a/test/java/rmi/MarshalledObject/compare/NullReference.java b/test/java/rmi/MarshalledObject/compare/NullReference.java
index f8ff9a1..5210e94 100644
--- a/test/java/rmi/MarshalledObject/compare/NullReference.java
+++ b/test/java/rmi/MarshalledObject/compare/NullReference.java
@@ -27,7 +27,6 @@
  * @summary MarshalledObject with null throws NullPointerException
  * @author Ken Arnold
  *
- * @build NullReference
  * @run main NullReference
  */
 
diff --git a/test/java/rmi/Naming/DefaultRegistryPort.java b/test/java/rmi/Naming/DefaultRegistryPort.java
index 4290bf5..a4c4979 100644
--- a/test/java/rmi/Naming/DefaultRegistryPort.java
+++ b/test/java/rmi/Naming/DefaultRegistryPort.java
@@ -28,7 +28,6 @@
  * @author Dana Burns
  * @library ../testlibrary
  * @build TestLibrary
- * @build DefaultRegistryPort
  * @run main DefaultRegistryPort
  */
 
diff --git a/test/java/rmi/Naming/LookupIPv6.java b/test/java/rmi/Naming/LookupIPv6.java
index ebdd9f3..da6c62c 100644
--- a/test/java/rmi/Naming/LookupIPv6.java
+++ b/test/java/rmi/Naming/LookupIPv6.java
@@ -22,12 +22,11 @@
  */
 
 /* @test
+ * @summary Ensure that java.rmi.Naming.lookup can handle URLs containing
+ *          IPv6 addresses.
  * @bug 4402708
  *
  * @run main/othervm -Djava.net.preferIPv6Addresses=true LookupIPv6
- *
- * @summary Ensure that java.rmi.Naming.lookup can handle URLs containing
- *          IPv6 addresses.
  */
 
 import java.net.InetAddress;
diff --git a/test/java/rmi/Naming/RmiIsNoScheme.java b/test/java/rmi/Naming/RmiIsNoScheme.java
index 865a07c..fe6d1ab 100644
--- a/test/java/rmi/Naming/RmiIsNoScheme.java
+++ b/test/java/rmi/Naming/RmiIsNoScheme.java
@@ -30,7 +30,6 @@
  *
  * @library ../testlibrary
  * @build TestLibrary
- * @build RmiIsNoScheme
  * @run main/othervm RmiIsNoScheme
  */
 
diff --git a/test/java/rmi/Naming/UnderscoreHost.java b/test/java/rmi/Naming/UnderscoreHost.java
index 0d73756..b88ca62 100644
--- a/test/java/rmi/Naming/UnderscoreHost.java
+++ b/test/java/rmi/Naming/UnderscoreHost.java
@@ -29,8 +29,7 @@
   * @author Vinod Johnson
   *
   * @library ../testlibrary
-  * @build TestLibrary
-  * @build UnderscoreHost UnderscoreHost_Stub
+  * @build TestLibrary UnderscoreHost_Stub
   * @run main/othervm UnderscoreHost
  */
 
diff --git a/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java b/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java
index 0d36797..725d9ca 100644
--- a/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java
+++ b/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java
@@ -21,14 +21,13 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 4254808
  * @summary Naming assumes '/' is present in relative URL; change in URL causes regression
  * @author Dana Burns
  * @library ../../testlibrary
- * @build TestLibrary
- * @build Legal LegalRegistryNames LegalRegistryNames_Stub
+ * @build TestLibrary Legal LegalRegistryNames_Stub
  * @run main LegalRegistryNames
  */
 
diff --git a/test/java/rmi/RMISecurityManager/checkPackageAccess/CheckPackageAccess.java b/test/java/rmi/RMISecurityManager/checkPackageAccess/CheckPackageAccess.java
index 6487088..32cbe5f 100644
--- a/test/java/rmi/RMISecurityManager/checkPackageAccess/CheckPackageAccess.java
+++ b/test/java/rmi/RMISecurityManager/checkPackageAccess/CheckPackageAccess.java
@@ -28,10 +28,9 @@
  * as when the default java.lang.SecurityManager is set, which with the
  * default "java.security" file in the JDK means that access to packages in
  * the sun.* package hierarchy is denied (without explicit runtime permission
- * "accessClassInPackge.*").
+ * "accessClassInPackage.*").
  * @author Peter Jones
  *
- * @build CheckPackageAccess
  * @run main/othervm CheckPackageAccess
  */
 
diff --git a/test/java/rmi/activation/Activatable/checkActivateRef/CheckActivateRef.java b/test/java/rmi/activation/Activatable/checkActivateRef/CheckActivateRef.java
index 9bd8475..fce32f9 100644
--- a/test/java/rmi/activation/Activatable/checkActivateRef/CheckActivateRef.java
+++ b/test/java/rmi/activation/Activatable/checkActivateRef/CheckActivateRef.java
@@ -36,8 +36,7 @@
  *          functionality is in place
  *
  * @library ../../../testlibrary
- * @build TestLibrary RMID
- * @build ActivateMe CheckActivateRef_Stub CheckActivateRef
+ * @build TestLibrary RMID ActivateMe CheckActivateRef_Stub
  * @run main/othervm/policy=security.policy/timeout=240 -Djava.rmi.server.ignoreStubClasses=true CheckActivateRef
  * @run main/othervm/policy=security.policy/timeout=240 -Djava.rmi.server.ignoreStubClasses=false CheckActivateRef
  */
diff --git a/test/java/rmi/activation/Activatable/checkAnnotations/CheckAnnotations.java b/test/java/rmi/activation/Activatable/checkAnnotations/CheckAnnotations.java
index ae7b843..b6e4abd 100644
--- a/test/java/rmi/activation/Activatable/checkAnnotations/CheckAnnotations.java
+++ b/test/java/rmi/activation/Activatable/checkAnnotations/CheckAnnotations.java
@@ -28,10 +28,7 @@
  * @author Laird Dornin; code borrowed from Ann Wollrath
  *
  * @library ../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build MyRMI
- * @build CheckAnnotations
- * @build CheckAnnotations_Stub
+ * @build TestLibrary RMID MyRMI CheckAnnotations_Stub
  * @run main/othervm/policy=security.policy/timeout=480 CheckAnnotations
  */
 
diff --git a/test/java/rmi/activation/Activatable/checkImplClassLoader/CheckImplClassLoader.java b/test/java/rmi/activation/Activatable/checkImplClassLoader/CheckImplClassLoader.java
index e3a1467..3d06941 100644
--- a/test/java/rmi/activation/Activatable/checkImplClassLoader/CheckImplClassLoader.java
+++ b/test/java/rmi/activation/Activatable/checkImplClassLoader/CheckImplClassLoader.java
@@ -24,14 +24,11 @@
 /* @test
  * @bug 4289544
  * @summary ActivationGroupImpl.newInstance does not set context classloader for impl
- *
  * @author Laird Dornin; code borrowed from Ann Wollrath
  *
  * @library ../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build MyRMI
- * @build CheckImplClassLoader ActivatableImpl
- * @build ActivatableImpl ActivatableImpl_Stub
+ * @build TestLibrary RMID
+ *     MyRMI ActivatableImpl ActivatableImpl ActivatableImpl_Stub
  * @run main/othervm/policy=security.policy/timeout=150 CheckImplClassLoader
  */
 
diff --git a/test/java/rmi/activation/Activatable/checkRegisterInLog/CheckRegisterInLog.java b/test/java/rmi/activation/Activatable/checkRegisterInLog/CheckRegisterInLog.java
index 59f5c99..b46142f 100644
--- a/test/java/rmi/activation/Activatable/checkRegisterInLog/CheckRegisterInLog.java
+++ b/test/java/rmi/activation/Activatable/checkRegisterInLog/CheckRegisterInLog.java
@@ -27,8 +27,8 @@
  * @author Ann Wollrath
  *
  * @library ../../../testlibrary
- * @build RMID ActivationLibrary TestLibrary
- * @build ActivateMe CheckRegisterInLog CheckRegisterInLog_Stub
+ * @build TestLibrary RMID ActivationLibrary
+ *     ActivateMe CheckRegisterInLog_Stub
  * @run main/othervm/policy=security.policy/timeout=240 CheckRegisterInLog
  */
 
diff --git a/test/java/rmi/activation/Activatable/createPrivateActivable/CreatePrivateActivatable.java b/test/java/rmi/activation/Activatable/createPrivateActivable/CreatePrivateActivatable.java
index 4d4d073..41a2886 100644
--- a/test/java/rmi/activation/Activatable/createPrivateActivable/CreatePrivateActivatable.java
+++ b/test/java/rmi/activation/Activatable/createPrivateActivable/CreatePrivateActivatable.java
@@ -22,14 +22,12 @@
  */
 
 /* @test
- * @author Laird Dornin
  * @bug 4164971
  * @summary allow non-public activatable class and/or constructor
+ * @author Laird Dornin
  *
  * @library ../../../testlibrary
- * @build TestLibrary RMID
- * @build ActivateMe
- * @build CreatePrivateActivatable
+ * @build TestLibrary RMID ActivateMe
  * @run main/othervm/policy=security.policy/timeout=240 CreatePrivateActivatable
  */
 
diff --git a/test/java/rmi/activation/Activatable/downloadParameterClass/DownloadParameterClass.java b/test/java/rmi/activation/Activatable/downloadParameterClass/DownloadParameterClass.java
index 1bb909a..42d309b 100644
--- a/test/java/rmi/activation/Activatable/downloadParameterClass/DownloadParameterClass.java
+++ b/test/java/rmi/activation/Activatable/downloadParameterClass/DownloadParameterClass.java
@@ -32,11 +32,7 @@
  *
  * @library ../../../testlibrary
  * @build TestLibrary RMID ActivationLibrary
- * @build DownloadParameterClass
- * @build Foo
- * @build FooReceiverImpl
- * @build FooReceiverImpl_Stub
- * @build Bar
+ *     Foo FooReceiverImpl FooReceiverImpl_Stub Bar
  * @run main/othervm/policy=security.policy/timeout=240 DownloadParameterClass
  */
 
diff --git a/test/java/rmi/activation/Activatable/elucidateNoSuchMethod/ElucidateNoSuchMethod.java b/test/java/rmi/activation/Activatable/elucidateNoSuchMethod/ElucidateNoSuchMethod.java
index 3d82bfb..7ee451d 100644
--- a/test/java/rmi/activation/Activatable/elucidateNoSuchMethod/ElucidateNoSuchMethod.java
+++ b/test/java/rmi/activation/Activatable/elucidateNoSuchMethod/ElucidateNoSuchMethod.java
@@ -23,14 +23,11 @@
 
 /* @test
  * @bug 4128620
- *
  * @summary synopsis: NoSuchMethodError should be elucidated
- *
  * @author Laird Dornin
  *
  * @library ../../../testlibrary
- * @build TestLibrary RMID
- * @build ActivateMe ElucidateNoSuchMethod ElucidateNoSuchMethod_Stub
+ * @build TestLibrary RMID ActivateMe ElucidateNoSuchMethod_Stub
  * @run main/othervm/policy=security.policy/timeout=240 ElucidateNoSuchMethod
  */
 
diff --git a/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh b/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh
index 7d15638..4f758b4 100644
--- a/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh
+++ b/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh
@@ -51,5 +51,5 @@
 mkdir -p ext
 $TESTJAVA/bin/jar cf ext/ext.jar -C $TESTCLASSES ExtLoadedImpl.class -C $TESTCLASSES ExtLoadedImpl_Stub.class -C $TESTCLASSES CheckLoader.class
 
-$TESTJAVA/bin/java -cp classes -Dtest.src=$TESTSRC -Dtest.classes=$TESTCLASSES -Djava.security.policy=$TESTSRC/security.policy -Djava.ext.dirs=ext ExtLoadedImplTest
+$TESTJAVA/bin/java ${TESTVMOPTS} -cp classes -Dtest.src=$TESTSRC -Dtest.classes=$TESTCLASSES -Djava.security.policy=$TESTSRC/security.policy -Djava.ext.dirs=ext ExtLoadedImplTest
 
diff --git a/test/java/rmi/activation/Activatable/forceLogSnapshot/ForceLogSnapshot.java b/test/java/rmi/activation/Activatable/forceLogSnapshot/ForceLogSnapshot.java
index 6791148..9af0bf3 100644
--- a/test/java/rmi/activation/Activatable/forceLogSnapshot/ForceLogSnapshot.java
+++ b/test/java/rmi/activation/Activatable/forceLogSnapshot/ForceLogSnapshot.java
@@ -27,9 +27,8 @@
  * @author Laird Dornin
  *
  * @library ../../../testlibrary
- * @build ActivateMe
- * @build ForceLogSnapshot
- * @build ForceLogSnapshot_Stub
+ * @build TestLibrary RMID ActivationLibrary
+ *     ActivateMe ForceLogSnapshot_Stub
  * @run main/othervm/policy=security.policy/timeout=640 ForceLogSnapshot
  */
 
diff --git a/test/java/rmi/activation/Activatable/inactiveGroup/InactiveGroup.java b/test/java/rmi/activation/Activatable/inactiveGroup/InactiveGroup.java
index a1b02b1..238d347 100644
--- a/test/java/rmi/activation/Activatable/inactiveGroup/InactiveGroup.java
+++ b/test/java/rmi/activation/Activatable/inactiveGroup/InactiveGroup.java
@@ -29,10 +29,7 @@
  * @author Ann Wollrath
  *
  * @library ../../../testlibrary
- * @build TestLibrary RMID ActivationLibrary
- * @build ActivateMe
- * @build InactiveGroup
- * @build InactiveGroup_Stub
+ * @build TestLibrary RMID ActivationLibrary ActivateMe InactiveGroup_Stub
  * @run main/othervm/policy=security.policy/timeout=240 InactiveGroup
  */
 
diff --git a/test/java/rmi/activation/Activatable/lookupActivationSystem/LookupActivationSystem.java b/test/java/rmi/activation/Activatable/lookupActivationSystem/LookupActivationSystem.java
index eee264f..ce154c4 100644
--- a/test/java/rmi/activation/Activatable/lookupActivationSystem/LookupActivationSystem.java
+++ b/test/java/rmi/activation/Activatable/lookupActivationSystem/LookupActivationSystem.java
@@ -24,14 +24,12 @@
 /*
  * @test
  * @bug 6245733
- *
  * @summary synopsis: rmid's registry's list operation doesn't include
  * activation system
  * @author Ann Wollrath
  *
  * @library ../../../testlibrary
  * @build TestLibrary RMID ActivationLibrary
- * @build LookupActivationSystem
  * @run main/othervm/timeout=240 LookupActivationSystem
  */
 
diff --git a/test/java/rmi/activation/Activatable/nestedActivate/NestedActivate.java b/test/java/rmi/activation/Activatable/nestedActivate/NestedActivate.java
index 9ad2d54..2cd5a63 100644
--- a/test/java/rmi/activation/Activatable/nestedActivate/NestedActivate.java
+++ b/test/java/rmi/activation/Activatable/nestedActivate/NestedActivate.java
@@ -23,15 +23,11 @@
 
 /* @test
  * @bug 4138056
- *
  * @summary synopsis: Activating objects from an Activatable constructor causes deadlock
  * @author Ann Wollrath
  *
  * @library ../../../testlibrary
- * @build TestLibrary RMID ActivationLibrary
- * @build ActivateMe
- * @build NestedActivate
- * @build NestedActivate_Stub
+ * @build TestLibrary RMID ActivationLibrary ActivateMe NestedActivate_Stub
  * @run main/othervm/policy=security.policy/timeout=240 NestedActivate
  */
 
diff --git a/test/java/rmi/activation/Activatable/nonExistentActivatable/NonExistentActivatable.java b/test/java/rmi/activation/Activatable/nonExistentActivatable/NonExistentActivatable.java
index 76d68e9..625661b 100644
--- a/test/java/rmi/activation/Activatable/nonExistentActivatable/NonExistentActivatable.java
+++ b/test/java/rmi/activation/Activatable/nonExistentActivatable/NonExistentActivatable.java
@@ -23,16 +23,13 @@
 
 /* @test
  * @bug 4115296
- *
  * @summary synopsis: NoSuchObjectException not thrown for non-existent
  * activatable objects
  * @author Ann Wollrath
  *
  * @library ../../../testlibrary
  * @build TestLibrary RMID ActivationLibrary
- * @build ActivateMe
- * @build NonExistentActivatable
- * @build NonExistentActivatable_Stub
+ *     ActivateMe NonExistentActivatable_Stub
  * @run main/othervm/policy=security.policy/timeout=240 NonExistentActivatable
  */
 
diff --git a/test/java/rmi/activation/Activatable/restartCrashedService/RestartCrashedService.java b/test/java/rmi/activation/Activatable/restartCrashedService/RestartCrashedService.java
index 164a842..b403c28 100644
--- a/test/java/rmi/activation/Activatable/restartCrashedService/RestartCrashedService.java
+++ b/test/java/rmi/activation/Activatable/restartCrashedService/RestartCrashedService.java
@@ -28,10 +28,7 @@
  * @author Ann Wollrath
  *
  * @library ../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build ActivateMe
- * @build RestartCrashedService
- * @build RestartCrashedService_Stub
+ * @build TestLibrary RMID ActivateMe RestartCrashedService_Stub
  * @run main/othervm/policy=security.policy/timeout=240 RestartCrashedService
  */
 
diff --git a/test/java/rmi/activation/Activatable/restartLatecomer/RestartLatecomer.java b/test/java/rmi/activation/Activatable/restartLatecomer/RestartLatecomer.java
index 3175098..c53053e 100644
--- a/test/java/rmi/activation/Activatable/restartLatecomer/RestartLatecomer.java
+++ b/test/java/rmi/activation/Activatable/restartLatecomer/RestartLatecomer.java
@@ -28,8 +28,7 @@
  *
  * @library ../../../testlibrary
  * @build TestLibrary RMID ActivationLibrary
- * @build RestartLatecomer
- * @build RestartLatecomer_Stub
+ *     RestartLatecomer RestartLatecomer_Stub
  * @run main/othervm/policy=security.policy/timeout=240 RestartLatecomer
  */
 
diff --git a/test/java/rmi/activation/Activatable/restartService/RestartService.java b/test/java/rmi/activation/Activatable/restartService/RestartService.java
index a98ce83..973916f 100644
--- a/test/java/rmi/activation/Activatable/restartService/RestartService.java
+++ b/test/java/rmi/activation/Activatable/restartService/RestartService.java
@@ -23,15 +23,11 @@
 
 /* @test
  * @bug 4095165 4321151
-
  * @summary synopsis: activator should restart daemon services
  * @author Ann Wollrath
  *
  * @library ../../../testlibrary
- * @build TestLibrary RMID ActivationLibrary
- * @build ActivateMe
- * @build RestartService
- * @build RestartService_Stub
+ * @build TestLibrary RMID ActivationLibrary ActivateMe RestartService_Stub
  * @run main/othervm/policy=security.policy/timeout=240 RestartService
  */
 
diff --git a/test/java/rmi/activation/Activatable/shutdownGracefully/ShutdownGracefully.java b/test/java/rmi/activation/Activatable/shutdownGracefully/ShutdownGracefully.java
index 162eb38..64233bf 100644
--- a/test/java/rmi/activation/Activatable/shutdownGracefully/ShutdownGracefully.java
+++ b/test/java/rmi/activation/Activatable/shutdownGracefully/ShutdownGracefully.java
@@ -28,11 +28,8 @@
  * @author Laird Dornin; code borrowed from Ann Wollrath
  *
  * @library ../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build TestSecurityManager
- * @build RegisteringActivatable
- * @build ShutdownGracefully
- * @build ShutdownGracefully_Stub
+ * @build TestLibrary RMID
+ *     TestSecurityManager RegisteringActivatable ShutdownGracefully_Stub
  * @run main/othervm/policy=security.policy/timeout=700 ShutdownGracefully
  */
 
diff --git a/test/java/rmi/activation/Activatable/unregisterInactive/UnregisterInactive.java b/test/java/rmi/activation/Activatable/unregisterInactive/UnregisterInactive.java
index 5d8c50c..412901e 100644
--- a/test/java/rmi/activation/Activatable/unregisterInactive/UnregisterInactive.java
+++ b/test/java/rmi/activation/Activatable/unregisterInactive/UnregisterInactive.java
@@ -23,16 +23,12 @@
 
 /* @test
  * @bug 4115331
-
  * @summary synopsis: activatable object fails to go inactive after
  * unregister/inactive sequence.
  * @author Ann Wollrath
  *
  * @library ../../../testlibrary
- * @build TestLibrary RMID ActivationLibrary
- * @build ActivateMe
- * @build UnregisterInactive
- * @build UnregisterInactive_Stub
+ * @build TestLibrary RMID ActivationLibrary ActivateMe UnregisterInactive_Stub
  * @run main/othervm/policy=security.policy/timeout=240 UnregisterInactive
  */
 
diff --git a/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateFails.java b/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateFails.java
index a5a5b0d..a7d7643 100644
--- a/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateFails.java
+++ b/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateFails.java
@@ -31,11 +31,8 @@
  * @author Ann Wollrath
  *
  * @library ../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build ActivateMe
- * @build ActivateFails
- * @build ActivateFails_Stub
- * @build ShutdownThread
+ * @build TestLibrary RMID ActivationLibrary
+ *     ActivateMe ActivateFails_Stub ShutdownThread
  * @run main/othervm/policy=security.policy/timeout=240 ActivateFails
  */
 
diff --git a/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java b/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java
index f7f8643..880f1e8 100644
--- a/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java
+++ b/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java
@@ -33,9 +33,7 @@
  *
  * @library ../../../testlibrary
  * @build TestLibrary RMID ActivationLibrary
- * @build MyActivationGroupImpl
- * @build DownloadActivationGroup
- * @build DownloadActivationGroup_Stub
+ *     DownloadActivationGroup MyActivationGroupImpl DownloadActivationGroup_Stub
  * @run main/othervm/policy=security.policy/timeout=240 DownloadActivationGroup
  */
 
diff --git a/test/java/rmi/activation/ActivationGroupDesc/checkDefaultGroupName/CheckDefaultGroupName.java b/test/java/rmi/activation/ActivationGroupDesc/checkDefaultGroupName/CheckDefaultGroupName.java
index bd47502..f37cbae 100644
--- a/test/java/rmi/activation/ActivationGroupDesc/checkDefaultGroupName/CheckDefaultGroupName.java
+++ b/test/java/rmi/activation/ActivationGroupDesc/checkDefaultGroupName/CheckDefaultGroupName.java
@@ -21,16 +21,15 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 4252236
  * @summary ActivationGroupDesc should not do early binding of default classname
- * @library ../../../testlibrary
- *
- * @build CheckDefaultGroupName
- *
- * @run main CheckDefaultGroupName
  * @author Laird Dornin
+ *
+ * @library ../../../testlibrary
+ * @build TestLibrary
+ * @run main CheckDefaultGroupName
  */
 
 import java.rmi.activation.*;
diff --git a/test/java/rmi/activation/ActivationSystem/activeGroup/IdempotentActiveGroup.java b/test/java/rmi/activation/ActivationSystem/activeGroup/IdempotentActiveGroup.java
index 41670ee..391a862 100644
--- a/test/java/rmi/activation/ActivationSystem/activeGroup/IdempotentActiveGroup.java
+++ b/test/java/rmi/activation/ActivationSystem/activeGroup/IdempotentActiveGroup.java
@@ -23,15 +23,13 @@
 
 /* @test
  * @bug 4720528
- *
  * @summary synopsis: (spec) ActivationSystem.activeGroup spec should be
  * relaxed (duplicate call to activeGroup with same instantiator and
  * incarnation should not throw ActivationException; it should succeed)
  * @author Ann Wollrath
  *
  * @library ../../../testlibrary
- * @build TestLibrary RMID
- * @build IdempotentActiveGroup
+ * @build TestLibrary RMID ActivationLibrary
  * @run main/othervm/policy=security.policy/timeout=480 IdempotentActiveGroup
  */
 
diff --git a/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor.java b/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor.java
index 4f3d51e..19034e5 100644
--- a/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor.java
+++ b/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor.java
@@ -29,9 +29,8 @@
  * @author Ann Wollrath
  *
  * @library ../../../testlibrary
- * @build ActivateMe
- * @build ModifyDescriptor
- * @build ModifyDescriptor_Stub
+ * @build TestLibrary RMID ActivationLibrary
+ *     ActivateMe ModifyDescriptor_Stub
  * @run main/othervm/policy=security.policy/timeout=240 ModifyDescriptor
  */
 
diff --git a/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java b/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java
index cc78104..d987f93 100644
--- a/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java
+++ b/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java
@@ -24,14 +24,11 @@
 /* @test
  * @bug 4179055
  * @summary Some java apps need to have access to read "accessClassInPackage.sun.rmi.server"
- *
  * @author Laird Dornin
  *
  * @library ../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe ActivationLibrary
- * @build CanCreateStubs
- * @build StubClassesPermitted
- * @build StubClassesPermitted_Stub
+ * @build TestLibrary RMID ActivationLibrary
+ *     CanCreateStubs StubClassesPermitted_Stub
  * @run main/othervm/policy=security.policy/secure=java.lang.SecurityManager/timeout=240 StubClassesPermitted
  */
 
diff --git a/test/java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup.java b/test/java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup.java
index a2b4076..59fee9d 100644
--- a/test/java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup.java
+++ b/test/java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup.java
@@ -24,16 +24,12 @@
 /* @test
  * @bug 4134233
  * @bug 4213186
- *
  * @summary synopsis: ActivationSystem.unregisterGroup should unregister objects in group
  * @author Ann Wollrath
  *
  * @library ../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build ActivateMe CallbackInterface
- * @build UnregisterGroup
- * @build UnregisterGroup_Stub
- * @build Callback_Stub
+ * @build TestLibrary RMID ActivationLibrary
+ *     ActivateMe CallbackInterface UnregisterGroup_Stub Callback_Stub
  * @run main/othervm/policy=security.policy/timeout=480 UnregisterGroup
  */
 
diff --git a/test/java/rmi/activation/CommandEnvironment/NullOptions.java b/test/java/rmi/activation/CommandEnvironment/NullOptions.java
index 3ef97e8..a1ec946 100644
--- a/test/java/rmi/activation/CommandEnvironment/NullOptions.java
+++ b/test/java/rmi/activation/CommandEnvironment/NullOptions.java
@@ -27,7 +27,6 @@
  * ActivationGroupDesc.CommandEnvironment
  * @author  Ann Wollrath
  *
- * @build NullOptions
  * @run main/othervm/timeout=240 NullOptions
  */
 
diff --git a/test/java/rmi/activation/CommandEnvironment/SetChildEnv.java b/test/java/rmi/activation/CommandEnvironment/SetChildEnv.java
index d89450d..7b1a968 100644
--- a/test/java/rmi/activation/CommandEnvironment/SetChildEnv.java
+++ b/test/java/rmi/activation/CommandEnvironment/SetChildEnv.java
@@ -35,9 +35,10 @@
  * @author Adrian Colley
  *
  * @library ../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build Eliza Retireable Doctor Doctor_Stub SetChildEnv
- * @run main/othervm/timeout=240/policy=security.policy -Djava.compiler=NONE  SetChildEnv
+ * @build TestLibrary RMID ActivationLibrary
+ *     Eliza Retireable Doctor Doctor_Stub
+ * @run main/othervm/timeout=240/policy=security.policy
+ *     -Djava.compiler=NONE SetChildEnv
  */
 import java.rmi.*;
 import java.util.Properties;
diff --git a/test/java/rmi/activation/checkusage/CheckUsage.java b/test/java/rmi/activation/checkusage/CheckUsage.java
index 66ff7ad..2b514e1 100644
--- a/test/java/rmi/activation/checkusage/CheckUsage.java
+++ b/test/java/rmi/activation/checkusage/CheckUsage.java
@@ -25,7 +25,7 @@
  * @bug 4259564
  *
  * @library ../../testlibrary
- * @build TestLibrary JavaVM CheckUsage
+ * @build TestLibrary JavaVM
  * @run main/othervm CheckUsage
  */
 
diff --git a/test/java/rmi/activation/log/LogTest.java b/test/java/rmi/activation/log/LogTest.java
index 2e503b9..53efeb4 100644
--- a/test/java/rmi/activation/log/LogTest.java
+++ b/test/java/rmi/activation/log/LogTest.java
@@ -29,7 +29,6 @@
  * boundaries
  * @author Ann Wollrath
  *
- * @build LogTest
  * @run main/othervm/timeout=240 LogTest
  */
 
diff --git a/test/java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java b/test/java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java
index 345aca3..4611a83 100644
--- a/test/java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java
+++ b/test/java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java
@@ -29,8 +29,7 @@
  * @author Peter Jones
  *
  * @library ../../testlibrary
- * @build RMID ActivationLibrary
- * @build InheritedChannelNotServerSocket
+ * @build TestLibrary RMID ActivationLibrary
  * @run main/othervm/timeout=240 InheritedChannelNotServerSocket
  */
 
diff --git a/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java b/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java
index 008b391..be9234d 100644
--- a/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java
+++ b/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java
@@ -27,9 +27,7 @@
  * @author Ann Wollrath
  *
  * @library ../../testlibrary
- * @build RMID ActivationLibrary
- * @build RmidViaInheritedChannel
- * @build TestLibrary
+ * @build TestLibrary RMID ActivationLibrary
  * @run main/othervm/timeout=240 RmidViaInheritedChannel
  */
 
diff --git a/test/java/rmi/dgc/VMID/CheckVMID.java b/test/java/rmi/dgc/VMID/CheckVMID.java
index dcdc9fd..0b69ff4 100644
--- a/test/java/rmi/dgc/VMID/CheckVMID.java
+++ b/test/java/rmi/dgc/VMID/CheckVMID.java
@@ -30,7 +30,7 @@
  * @author Ann Wollrath
  *
  * @library ../../testlibrary
- * @build CheckVMID
+ * @build TestLibrary
  * @run main/othervm/policy=security.policy CheckVMID
  */
 
diff --git a/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure.java b/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure.java
index c416063..6a47245 100644
--- a/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure.java
+++ b/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure.java
@@ -30,8 +30,7 @@
  * rather than pinning it indefinitely.
  * @author Peter Jones
  *
- * @build DGCAckFailure
- * @build DGCAckFailure_Stub
+ * @build DGCAckFailure DGCAckFailure_Stub
  * @run main/othervm DGCAckFailure
  */
 
diff --git a/test/java/rmi/dgc/dgcImplInsulation/DGCImplInsulation.java b/test/java/rmi/dgc/dgcImplInsulation/DGCImplInsulation.java
index 246c2b5..4043268 100644
--- a/test/java/rmi/dgc/dgcImplInsulation/DGCImplInsulation.java
+++ b/test/java/rmi/dgc/dgcImplInsulation/DGCImplInsulation.java
@@ -31,9 +31,7 @@
  * @author Peter Jones
  *
  * @library ../../testlibrary
- * @build TestLibrary
- * @build DGCImplInsulation
- * @build DGCImplInsulation_Stub
+ * @build TestLibrary DGCImplInsulation_Stub
  * @run main/othervm/policy=security.policy DGCImplInsulation
  */
 
diff --git a/test/java/rmi/dgc/retryDirtyCalls/RetryDirtyCalls.java b/test/java/rmi/dgc/retryDirtyCalls/RetryDirtyCalls.java
index 10cb15f..b2f0af6 100644
--- a/test/java/rmi/dgc/retryDirtyCalls/RetryDirtyCalls.java
+++ b/test/java/rmi/dgc/retryDirtyCalls/RetryDirtyCalls.java
@@ -29,8 +29,7 @@
  * renewing that lease at all after the first failure.
  * @author Peter Jones (inspired by Adrian Colley's test case in 4268258)
  *
- * @build RetryDirtyCalls
- * @build RetryDirtyCalls_Stub
+ * @build RetryDirtyCalls RetryDirtyCalls_Stub
  * @run main/othervm RetryDirtyCalls
  */
 
diff --git a/test/java/rmi/invalidName/InvalidName.java b/test/java/rmi/invalidName/InvalidName.java
index 8d522f5..74da1a5 100644
--- a/test/java/rmi/invalidName/InvalidName.java
+++ b/test/java/rmi/invalidName/InvalidName.java
@@ -32,7 +32,7 @@
  * @author Laird Dornin
  *
  * @library ../testlibrary
- * @build InvalidName
+ * @build TestLibrary
  * @run main/othervm InvalidName
  */
 
diff --git a/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java b/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java
index 15b98fc..08d030e 100644
--- a/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java
+++ b/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java
@@ -27,8 +27,7 @@
  * @author Laird Dornin
  *
  * @library ../../testlibrary
- * @build StreamPipe TestParams TestLibrary JavaVM RMID
- * @build AltSecurityManager TestSecurityManager
+ * @build TestLibrary JavaVM RMID TestSecurityManager
  * @run main/othervm AltSecurityManager
  */
 
diff --git a/test/java/rmi/registry/checkusage/CheckUsage.java b/test/java/rmi/registry/checkusage/CheckUsage.java
index 71deb55..19dac5b 100644
--- a/test/java/rmi/registry/checkusage/CheckUsage.java
+++ b/test/java/rmi/registry/checkusage/CheckUsage.java
@@ -27,7 +27,7 @@
  * @author Laird Dornin
  *
  * @library ../../testlibrary
- * @build TestLibrary JavaVM CheckUsage
+ * @build TestLibrary JavaVM
  * @run main/othervm CheckUsage
  */
 
diff --git a/test/java/rmi/registry/classPathCodebase/ClassPathCodebase.java b/test/java/rmi/registry/classPathCodebase/ClassPathCodebase.java
index 9e8cbba..99ac5f0 100644
--- a/test/java/rmi/registry/classPathCodebase/ClassPathCodebase.java
+++ b/test/java/rmi/registry/classPathCodebase/ClassPathCodebase.java
@@ -30,7 +30,7 @@
  * @author Peter Jones
  *
  * @library ../../testlibrary
- * @build ClassPathCodebase Dummy TestLibrary
+ * @build TestLibrary Dummy
  * @run main/othervm/policy=security.policy ClassPathCodebase
  */
 
diff --git a/test/java/rmi/registry/interfaceHash/InterfaceHash.java b/test/java/rmi/registry/interfaceHash/InterfaceHash.java
index 7782412..2eba1d6 100644
--- a/test/java/rmi/registry/interfaceHash/InterfaceHash.java
+++ b/test/java/rmi/registry/interfaceHash/InterfaceHash.java
@@ -36,9 +36,7 @@
  *
  * @author Peter Jones
  * @library ../../testlibrary
- * @build InterfaceHash
- * @build ReferenceRegistryStub
- * @build TestLibrary
+ * @build TestLibrary ReferenceRegistryStub
  * @run main/othervm InterfaceHash
  */
 
diff --git a/test/java/rmi/registry/multipleRegistries/MultipleRegistries.java b/test/java/rmi/registry/multipleRegistries/MultipleRegistries.java
index e75a609..1945ebe 100644
--- a/test/java/rmi/registry/multipleRegistries/MultipleRegistries.java
+++ b/test/java/rmi/registry/multipleRegistries/MultipleRegistries.java
@@ -28,7 +28,6 @@
  *
  * @library ../../testlibrary
  * @build TestLibrary
- * @build MultipleRegistries
  * @run main/othervm/timeout=240 MultipleRegistries
  */
 
diff --git a/test/java/rmi/registry/readTest/readTest.sh b/test/java/rmi/registry/readTest/readTest.sh
index d7f1568..5fda0a5 100644
--- a/test/java/rmi/registry/readTest/readTest.sh
+++ b/test/java/rmi/registry/readTest/readTest.sh
@@ -76,7 +76,7 @@
     ;;  
 esac
 # trailing / after code base is important for rmi codebase property.
-${TESTJAVA}${FS}bin${FS}java -cp $TEST_CLASSPATH -Djava.rmi.server.codebase=${FILEURL}$CODEBASE/ readTest > OUT.TXT 2>&1 &
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp $TEST_CLASSPATH -Djava.rmi.server.codebase=${FILEURL}$CODEBASE/ readTest > OUT.TXT 2>&1 &
 TEST_PID=$!
 #bulk of testcase - let it run for a while
 sleep 5
diff --git a/test/java/rmi/registry/reexport/Reexport.java b/test/java/rmi/registry/reexport/Reexport.java
index 042088e..c209f7c 100644
--- a/test/java/rmi/registry/reexport/Reexport.java
+++ b/test/java/rmi/registry/reexport/Reexport.java
@@ -25,9 +25,7 @@
  * @bug 4120329
  * @summary RMI registry creation is impossible if first attempt fails.
  * @library ../../testlibrary
- * @build StreamPipe TestParams TestLibrary JavaVM
- * @build RegistryRunner RegistryRunner_Stub
- * @build Reexport
+ * @build TestLibrary JavaVM RegistryRunner RegistryRunner_Stub
  * @run main/othervm Reexport
  */
 
diff --git a/test/java/rmi/reliability/benchmark/runRmiBench.sh b/test/java/rmi/reliability/benchmark/runRmiBench.sh
index cfa23f7..98a31d1 100644
--- a/test/java/rmi/reliability/benchmark/runRmiBench.sh
+++ b/test/java/rmi/reliability/benchmark/runRmiBench.sh
@@ -27,20 +27,20 @@
 #          used to run the test under JTREG.
 #
 # @build bench.BenchInfo bench.HtmlReporter bench.Util bench.Benchmark 
-# @build bench.Reporter bench.XmlReporter bench.ConfigFormatException 
-# @build bench.Harness bench.TextReporter bench.rmi.BenchServer 
-# @build bench.rmi.DoubleArrayCalls bench.rmi.LongCalls bench.rmi.ShortCalls
-# @build bench.rmi.BenchServerImpl bench.rmi.DoubleCalls 
-# @build bench.rmi.Main bench.rmi.SmallObjTreeCalls
-# @build bench.rmi.BooleanArrayCalls bench.rmi.ExceptionCalls 
-# @build bench.rmi.NullCalls bench.rmi.BooleanCalls bench.rmi.ExportObjs 
-# @build bench.rmi.ObjArrayCalls bench.rmi.ByteArrayCalls 
-# @build bench.rmi.FloatArrayCalls bench.rmi.ObjTreeCalls
-# @build bench.rmi.ByteCalls bench.rmi.FloatCalls bench.rmi.ProxyArrayCalls
-# @build bench.rmi.CharArrayCalls bench.rmi.IntArrayCalls 
-# @build bench.rmi.RemoteObjArrayCalls bench.rmi.CharCalls bench.rmi.IntCalls
-# @build bench.rmi.ClassLoading bench.rmi.LongArrayCalls 
-# @build bench.rmi.ShortArrayCalls bench.rmi.altroot.Node
+#     bench.Reporter bench.XmlReporter bench.ConfigFormatException 
+#     bench.Harness bench.TextReporter bench.rmi.BenchServer 
+#     bench.rmi.DoubleArrayCalls bench.rmi.LongCalls bench.rmi.ShortCalls
+#     bench.rmi.BenchServerImpl bench.rmi.DoubleCalls 
+#     bench.rmi.Main bench.rmi.SmallObjTreeCalls
+#     bench.rmi.BooleanArrayCalls bench.rmi.ExceptionCalls 
+#     bench.rmi.NullCalls bench.rmi.BooleanCalls bench.rmi.ExportObjs 
+#     bench.rmi.ObjArrayCalls bench.rmi.ByteArrayCalls 
+#     bench.rmi.FloatArrayCalls bench.rmi.ObjTreeCalls
+#     bench.rmi.ByteCalls bench.rmi.FloatCalls bench.rmi.ProxyArrayCalls
+#     bench.rmi.CharArrayCalls bench.rmi.IntArrayCalls 
+#     bench.rmi.RemoteObjArrayCalls bench.rmi.CharCalls bench.rmi.IntCalls
+#     bench.rmi.ClassLoading bench.rmi.LongArrayCalls 
+#     bench.rmi.ShortArrayCalls bench.rmi.altroot.Node
 #
 # @run shell/timeout=1800 runRmiBench.sh
 #
diff --git a/test/java/rmi/reliability/benchmark/runSerialBench.sh b/test/java/rmi/reliability/benchmark/runSerialBench.sh
index aac0d3f..82a2837 100644
--- a/test/java/rmi/reliability/benchmark/runSerialBench.sh
+++ b/test/java/rmi/reliability/benchmark/runSerialBench.sh
@@ -51,7 +51,7 @@
 echo "Starting serialization benchmark "
 
 $TESTJAVA/bin/java \
-    -server \
+    ${TESTVMOPTS} \
     -cp $TESTCLASSES \
     bench.serial.Main \
     -c $TESTSRC/bench/serial/jtreg-config &
diff --git a/test/java/rmi/reliability/juicer/AppleUserImpl.java b/test/java/rmi/reliability/juicer/AppleUserImpl.java
index 2ed30c6..70b187e 100644
--- a/test/java/rmi/reliability/juicer/AppleUserImpl.java
+++ b/test/java/rmi/reliability/juicer/AppleUserImpl.java
@@ -55,11 +55,10 @@
  * has been reached.
  *
  * @library ../../testlibrary
- *
- * @build Apple AppleEvent AppleImpl AppleUserImpl
- * @build Orange OrangeEcho OrangeEchoImpl OrangeImpl
- * @build ApplicationServer
  * @build TestLibrary
+ *     Apple AppleEvent AppleImpl
+ *     Orange OrangeEcho OrangeEchoImpl OrangeImpl
+ *     ApplicationServer
  *
  * @run main/othervm/policy=security.policy AppleUserImpl -seconds 30
  *
diff --git a/test/java/rmi/server/ObjID/randomIDs/RandomIDs.java b/test/java/rmi/server/ObjID/randomIDs/RandomIDs.java
index 9c20ab4..ebe7192 100644
--- a/test/java/rmi/server/ObjID/randomIDs/RandomIDs.java
+++ b/test/java/rmi/server/ObjID/randomIDs/RandomIDs.java
@@ -30,7 +30,6 @@
  * ObjID() should still generate sequential object numbers.
  * @author Peter Jones
  *
- * @build RandomIDs
  * @run main/othervm RandomIDs random
  * @run main/othervm -Djava.rmi.server.randomIDs=true RandomIDs random
  * @run main/othervm -Djava.rmi.server.randomIDs=false RandomIDs sequential
diff --git a/test/java/rmi/server/RMIClassLoader/delegateBeforePermissionCheck/DelegateBeforePermissionCheck.java b/test/java/rmi/server/RMIClassLoader/delegateBeforePermissionCheck/DelegateBeforePermissionCheck.java
index fba4939..6187f0c 100644
--- a/test/java/rmi/server/RMIClassLoader/delegateBeforePermissionCheck/DelegateBeforePermissionCheck.java
+++ b/test/java/rmi/server/RMIClassLoader/delegateBeforePermissionCheck/DelegateBeforePermissionCheck.java
@@ -33,9 +33,7 @@
  * @author Peter Jones
  *
  * @library ../../../testlibrary
- * @build TestLibrary
- * @build DelegateBeforePermissionCheck
- * @build Foo
+ * @build TestLibrary Foo
  * @run main/othervm DelegateBeforePermissionCheck
  */
 
diff --git a/test/java/rmi/server/RMIClassLoader/delegateToContextLoader/DelegateToContextLoader.java b/test/java/rmi/server/RMIClassLoader/delegateToContextLoader/DelegateToContextLoader.java
index 51b5bd4..7ae4c5e 100644
--- a/test/java/rmi/server/RMIClassLoader/delegateToContextLoader/DelegateToContextLoader.java
+++ b/test/java/rmi/server/RMIClassLoader/delegateToContextLoader/DelegateToContextLoader.java
@@ -29,7 +29,7 @@
  * @author Peter Jones
  *
  * @library ../../../testlibrary
- * @build DelegateToContextLoader Dummy
+ * @build TestLibrary Dummy
  * @run main/othervm/policy=security.policy/timeout=120 DelegateToContextLoader
  */
 
diff --git a/test/java/rmi/server/RMIClassLoader/downloadArrayClass/DownloadArrayClass.java b/test/java/rmi/server/RMIClassLoader/downloadArrayClass/DownloadArrayClass.java
index 34a21bd..9df187a 100644
--- a/test/java/rmi/server/RMIClassLoader/downloadArrayClass/DownloadArrayClass.java
+++ b/test/java/rmi/server/RMIClassLoader/downloadArrayClass/DownloadArrayClass.java
@@ -31,11 +31,7 @@
  * @author Peter Jones
  *
  * @library ../../../testlibrary
- * @build TestLibrary
- * @build Receiver
- * @build DownloadArrayClass
- * @build DownloadArrayClass_Stub
- * @build Foo
+ * @build TestLibrary Receiver DownloadArrayClass_Stub Foo
  * @run main/othervm/policy=security.policy DownloadArrayClass
  */
 
diff --git a/test/java/rmi/server/RMIClassLoader/getClassAnnotation/NullClass.java b/test/java/rmi/server/RMIClassLoader/getClassAnnotation/NullClass.java
index 0a0cfb7..5167fc4 100644
--- a/test/java/rmi/server/RMIClassLoader/getClassAnnotation/NullClass.java
+++ b/test/java/rmi/server/RMIClassLoader/getClassAnnotation/NullClass.java
@@ -29,7 +29,6 @@
  *
  * @library ../../../testlibrary
  * @build TestLibrary
- * @build NullClass
  * @run main/othervm NullClass
  */
 
diff --git a/test/java/rmi/server/RMIClassLoader/getClassLoader/GetClassLoader.java b/test/java/rmi/server/RMIClassLoader/getClassLoader/GetClassLoader.java
index f54a5cf..10a9cc9 100644
--- a/test/java/rmi/server/RMIClassLoader/getClassLoader/GetClassLoader.java
+++ b/test/java/rmi/server/RMIClassLoader/getClassLoader/GetClassLoader.java
@@ -29,9 +29,7 @@
  * @author Ann Wollrath
  *
  * @library ../../../testlibrary
- * @build TestLibrary
- * @build GetClassLoader
- * @build Foo
+ * @build TestLibrary Foo
  * @run main/othervm/policy=security.policy GetClassLoader
  */
 
diff --git a/test/java/rmi/server/RMIClassLoader/loadProxyClasses/LoadProxyClasses.java b/test/java/rmi/server/RMIClassLoader/loadProxyClasses/LoadProxyClasses.java
index 4feed26..6d29cb2 100644
--- a/test/java/rmi/server/RMIClassLoader/loadProxyClasses/LoadProxyClasses.java
+++ b/test/java/rmi/server/RMIClassLoader/loadProxyClasses/LoadProxyClasses.java
@@ -30,8 +30,8 @@
  * @author Laird Dornin
  *
  * @library ../../../testlibrary
- * @build TestLibrary FnnClass FnnUnmarshal LoadProxyClasses NonpublicInterface
- * @build NonpublicInterface1 PublicInterface PublicInterface1
+ * @build TestLibrary FnnClass FnnUnmarshal NonpublicInterface
+ *     NonpublicInterface1 PublicInterface PublicInterface1
  * @run main/othervm/policy=security.policy LoadProxyClasses
  */
 
diff --git a/test/java/rmi/server/RMIClassLoader/noSecurityManager/NoSecurityManager.java b/test/java/rmi/server/RMIClassLoader/noSecurityManager/NoSecurityManager.java
index 182db1c..93a33b9 100644
--- a/test/java/rmi/server/RMIClassLoader/noSecurityManager/NoSecurityManager.java
+++ b/test/java/rmi/server/RMIClassLoader/noSecurityManager/NoSecurityManager.java
@@ -30,7 +30,7 @@
  * been used for the RMI class loader instance.
  * @author Peter Jones
  *
- * @build NoSecurityManager Dummy LocalDummy
+ * @build Dummy LocalDummy
  * @run main/othervm/timeout=120 NoSecurityManager
  */
 
diff --git a/test/java/rmi/server/RMIClassLoader/spi/ContextInsulation.java b/test/java/rmi/server/RMIClassLoader/spi/ContextInsulation.java
index 56cd08d..de3d79b 100644
--- a/test/java/rmi/server/RMIClassLoader/spi/ContextInsulation.java
+++ b/test/java/rmi/server/RMIClassLoader/spi/ContextInsulation.java
@@ -30,11 +30,7 @@
  * @author Peter Jones
  *
  * @library ../../../testlibrary
- * @build TestLibrary
- * @build ContextInsulation
- * @build ServiceConfiguration
- * @build TestProvider
- * @build TestProvider2
+ * @build TestLibrary ServiceConfiguration TestProvider TestProvider2
  * @run main/othervm/policy=security.policy ContextInsulation
  */
 
diff --git a/test/java/rmi/server/RMIClassLoader/spi/DefaultProperty.java b/test/java/rmi/server/RMIClassLoader/spi/DefaultProperty.java
index 4cb8169..f91ef3d 100644
--- a/test/java/rmi/server/RMIClassLoader/spi/DefaultProperty.java
+++ b/test/java/rmi/server/RMIClassLoader/spi/DefaultProperty.java
@@ -29,10 +29,7 @@
  * @author Peter Jones
  *
  * @library ../../../testlibrary
- * @build TestLibrary
- * @build DefaultProperty
- * @build ServiceConfiguration
- * @build Foo
+ * @build TestLibrary ServiceConfiguration Foo
  * @run main/othervm/policy=security.policy DefaultProperty
  */
 
diff --git a/test/java/rmi/server/RMIClassLoader/spi/Installed.java b/test/java/rmi/server/RMIClassLoader/spi/Installed.java
index 23ce956..d32a8af 100644
--- a/test/java/rmi/server/RMIClassLoader/spi/Installed.java
+++ b/test/java/rmi/server/RMIClassLoader/spi/Installed.java
@@ -29,11 +29,7 @@
  * @author Peter Jones
  *
  * @library ../../../testlibrary
- * @build TestLibrary
- * @build Installed
- * @build ServiceConfiguration
- * @build TestProvider
- * @build TestProvider2
+ * @build TestLibrary ServiceConfiguration TestProvider TestProvider2
  * @run main/othervm/policy=security.policy Installed
  */
 
diff --git a/test/java/rmi/server/RMIClassLoader/spi/InvalidProperty.java b/test/java/rmi/server/RMIClassLoader/spi/InvalidProperty.java
index e7b157c..d41cef1 100644
--- a/test/java/rmi/server/RMIClassLoader/spi/InvalidProperty.java
+++ b/test/java/rmi/server/RMIClassLoader/spi/InvalidProperty.java
@@ -29,9 +29,7 @@
  * @author Peter Jones
  *
  * @library ../../../testlibrary
- * @build TestLibrary
- * @build InvalidProperty
- * @build ServiceConfiguration
+ * @build TestLibrary ServiceConfiguration
  * @run main/othervm/policy=security.policy InvalidProperty
  */
 
diff --git a/test/java/rmi/server/RMIClassLoader/spi/Property.java b/test/java/rmi/server/RMIClassLoader/spi/Property.java
index 427e5a3..6113a6e 100644
--- a/test/java/rmi/server/RMIClassLoader/spi/Property.java
+++ b/test/java/rmi/server/RMIClassLoader/spi/Property.java
@@ -29,10 +29,7 @@
  * @author Peter Jones
  *
  * @library ../../../testlibrary
- * @build TestLibrary
- * @build Property
- * @build ServiceConfiguration
- * @build TestProvider
+ * @build TestLibrary ServiceConfiguration TestProvider
  * @run main/othervm/policy=security.policy Property
  */
 
diff --git a/test/java/rmi/server/RMIClassLoader/useCodebaseOnly/UseCodebaseOnly.java b/test/java/rmi/server/RMIClassLoader/useCodebaseOnly/UseCodebaseOnly.java
index cd79782..dc80837 100644
--- a/test/java/rmi/server/RMIClassLoader/useCodebaseOnly/UseCodebaseOnly.java
+++ b/test/java/rmi/server/RMIClassLoader/useCodebaseOnly/UseCodebaseOnly.java
@@ -31,12 +31,7 @@
  * @author Peter Jones
  *
  * @library ../../../testlibrary
- * @build TestLibrary
- * @build Receiver
- * @build UseCodebaseOnly
- * @build UseCodebaseOnly_Stub
- * @build Foo
- * @build Bar
+ * @build TestLibrary Receiver UseCodebaseOnly_Stub Foo Bar
  * @run main/othervm/policy=security.policy UseCodebaseOnly
  */
 
diff --git a/test/java/rmi/server/RMIClassLoader/useGetURLs/UseGetURLs.java b/test/java/rmi/server/RMIClassLoader/useGetURLs/UseGetURLs.java
index 295b994..d80907e 100644
--- a/test/java/rmi/server/RMIClassLoader/useGetURLs/UseGetURLs.java
+++ b/test/java/rmi/server/RMIClassLoader/useGetURLs/UseGetURLs.java
@@ -30,8 +30,7 @@
  * @author Peter Jones
  *
  * @library ../../../testlibrary
- * @build TestLibrary
- * @build UseGetURLs Dummy
+ * @build TestLibrary Dummy
  * @run main/othervm/policy=security.policy/timeout=120 UseGetURLs
  */
 
diff --git a/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/UseCustomSocketFactory.java b/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/UseCustomSocketFactory.java
index 5868c58..5f032ec 100644
--- a/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/UseCustomSocketFactory.java
+++ b/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/UseCustomSocketFactory.java
@@ -28,11 +28,7 @@
  * @author Ann Wollrath
  *
  * @library ../../../../testlibrary
- * @build Echo
- * @build EchoImpl
- * @build EchoImpl_Stub
- * @build UseCustomSocketFactory
- * @build TestLibrary
+ * @build TestLibrary Echo EchoImpl EchoImpl_Stub
  * @run main/othervm/policy=security.policy/timeout=360 UseCustomSocketFactory
  */
 
diff --git a/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/UseCustomSocketFactory.java b/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/UseCustomSocketFactory.java
index ba61068..774e823 100644
--- a/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/UseCustomSocketFactory.java
+++ b/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/UseCustomSocketFactory.java
@@ -29,12 +29,7 @@
  * @author Laird Dornin; code borrowed from Ann Wollrath
  *
  * @library ../../../../testlibrary
- * @build Hello
- * @build HelloImpl
- * @build HelloImpl_Stub
- * @build TestLibrary
- * @build UseCustomSocketFactory
- * @build Compress
+ * @build TestLibrary Compress Hello HelloImpl HelloImpl_Stub
  * @run main/othervm/policy=security.policy/timeout=240 UseCustomSocketFactory
  */
 
diff --git a/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/UseCustomSocketFactory.java b/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/UseCustomSocketFactory.java
index 13766ab..06571df 100644
--- a/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/UseCustomSocketFactory.java
+++ b/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/UseCustomSocketFactory.java
@@ -29,11 +29,7 @@
  * @author Ann Wollrath
  *
  * @library ../../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build Echo
- * @build EchoImpl
- * @build EchoImpl_Stub
- * @build UseCustomSocketFactory
+ * @build TestLibrary RMID JavaVM Echo EchoImpl EchoImpl_Stub
  * @run main/othervm/policy=security.policy/timeout=120 UseCustomSocketFactory
  */
 
diff --git a/test/java/rmi/server/RemoteObject/notExtending/NotExtending.java b/test/java/rmi/server/RemoteObject/notExtending/NotExtending.java
index 0023fc5..ef524a4 100644
--- a/test/java/rmi/server/RemoteObject/notExtending/NotExtending.java
+++ b/test/java/rmi/server/RemoteObject/notExtending/NotExtending.java
@@ -29,9 +29,7 @@
  *          (specifically: stubs) that contain the instance's RemoteRef.
  * @author Peter Jones
  *
- * @build NotExtending
- * @build NotExtending_Stub
- * @build NotExtending_Skel
+ * @build NotExtending_Stub NotExtending_Skel
  * @run main/othervm/timeout=240 NotExtending
  */
 
diff --git a/test/java/rmi/server/RemoteObject/verifyRemoteEquals/VerifyRemoteEquals.java b/test/java/rmi/server/RemoteObject/verifyRemoteEquals/VerifyRemoteEquals.java
index 8b6bcca..b89e362 100644
--- a/test/java/rmi/server/RemoteObject/verifyRemoteEquals/VerifyRemoteEquals.java
+++ b/test/java/rmi/server/RemoteObject/verifyRemoteEquals/VerifyRemoteEquals.java
@@ -21,16 +21,16 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @bug 4251010
  * @summary equals does not works on stub objects created with
  *           custom socket AndFactory
- * @library ../../../testlibrary
- *
- * @build VerifyRemoteEquals
- * @run main/othervm/timeout=40 VerifyRemoteEquals
  * @author Laird Dornin
+ *
+ * @library ../../../testlibrary
+ * @build TestLibrary
+ * @run main/othervm/timeout=40 VerifyRemoteEquals
  */
 
 import java.io.*;
diff --git a/test/java/rmi/server/RemoteServer/AddrInUse.java b/test/java/rmi/server/RemoteServer/AddrInUse.java
index 9ab8e50..34e343b 100644
--- a/test/java/rmi/server/RemoteServer/AddrInUse.java
+++ b/test/java/rmi/server/RemoteServer/AddrInUse.java
@@ -26,8 +26,6 @@
  * @summary retryServerSocket should not retry on BindException
  * @author Ann Wollrath
  *
- * @library ../../testlibrary
- * @build AddrInUse
  * @run main/othervm AddrInUse
  */
 
diff --git a/test/java/rmi/server/UnicastRemoteObject/changeHostName/ChangeHostName.java b/test/java/rmi/server/UnicastRemoteObject/changeHostName/ChangeHostName.java
index 0716c1a..523c3a0 100644
--- a/test/java/rmi/server/UnicastRemoteObject/changeHostName/ChangeHostName.java
+++ b/test/java/rmi/server/UnicastRemoteObject/changeHostName/ChangeHostName.java
@@ -31,8 +31,7 @@
  *
  * @author Ann Wollrath
  *
- * @build ChangeHostName
- * @build ChangeHostName_Stub
+ * @build ChangeHostName ChangeHostName_Stub
  * @run main/othervm ChangeHostName
  */
 
diff --git a/test/java/rmi/server/UnicastRemoteObject/exportObject/GcDuringExport.java b/test/java/rmi/server/UnicastRemoteObject/exportObject/GcDuringExport.java
index 59663db..def2806 100644
--- a/test/java/rmi/server/UnicastRemoteObject/exportObject/GcDuringExport.java
+++ b/test/java/rmi/server/UnicastRemoteObject/exportObject/GcDuringExport.java
@@ -30,6 +30,7 @@
  * @bug 6597112
  * @summary GC'ing objects whilst being exported to RMI should not cause exceptions
  * @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
+ * @run main GcDuringExport
  */
 
 import java.rmi.Remote;
diff --git a/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall.java b/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall.java
index dbe2ffe..780e7e5 100644
--- a/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall.java
+++ b/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall.java
@@ -32,14 +32,8 @@
  * @author Peter Jones
  *
  * @library ../../../testlibrary
- * @build TestLibrary
- * @build JavaVM
- * @build KeepAliveDuringCall
- * @build KeepAliveDuringCall_Stub
- * @build ShutdownMonitor
- * @build Shutdown
- * @build ShutdownImpl
- * @build ShutdownImpl_Stub
+ * @build TestLibrary JavaVM KeepAliveDuringCall_Stub
+ *     ShutdownMonitor Shutdown ShutdownImpl ShutdownImpl_Stub
  * @run main/othervm KeepAliveDuringCall
  */
 
diff --git a/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport.java b/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport.java
index 743d461..a165dd8 100644
--- a/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport.java
+++ b/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport.java
@@ -31,8 +31,7 @@
  * IOException (see fix for bugid 4017232).
  * @author Peter Jones
  *
- * @build MarshalAfterUnexport
- * @build MarshalAfterUnexport_Stub
+ * @build MarshalAfterUnexport MarshalAfterUnexport_Stub
  * @run main/othervm MarshalAfterUnexport
  */
 
diff --git a/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport2.java b/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport2.java
index ea1e482..b72efa4 100644
--- a/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport2.java
+++ b/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport2.java
@@ -33,8 +33,7 @@
  * @author Peter Jones
  * @author Ann Wollrath
  *
- * @build MarshalAfterUnexport2
- * @build MarshalAfterUnexport2_Stub
+ * @build MarshalAfterUnexport2 MarshalAfterUnexport2_Stub
  * @run main/othervm MarshalAfterUnexport2
  */
 
diff --git a/test/java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak.java b/test/java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak.java
index 60325dc..62804fe 100644
--- a/test/java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak.java
+++ b/test/java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak.java
@@ -29,10 +29,7 @@
  * @author Ann Wollrath
  *
  * @library ../../../testlibrary
- * @build UnexportLeak
- * @build UnexportLeak_Stub
- * @build TestLibrary
- * @build Ping
+ * @build TestLibrary UnexportLeak_Stub Ping
  * @run main/othervm UnexportLeak
  */
 
diff --git a/test/java/rmi/server/Unmarshal/PrimitiveClasses.java b/test/java/rmi/server/Unmarshal/PrimitiveClasses.java
index 8d7b30d..b9dfb0c 100644
--- a/test/java/rmi/server/Unmarshal/PrimitiveClasses.java
+++ b/test/java/rmi/server/Unmarshal/PrimitiveClasses.java
@@ -25,6 +25,7 @@
  * @bug 4442373
  * @summary Verify that RMI can successfully unmarshal Class objects for
  *          primitive types.
+ * @run main PrimitiveClasses
  */
 
 import java.rmi.MarshalledObject;
diff --git a/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshall.java b/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshal.java
similarity index 100%
rename from test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshall.java
rename to test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshal.java
diff --git a/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshalOnStopThread.java b/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshalOnStopThread.java
index 60dce66..95dee53 100644
--- a/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshalOnStopThread.java
+++ b/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshalOnStopThread.java
@@ -31,10 +31,8 @@
  * @author Laird Dornin
  *
  * @library ../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build CheckUnmarshall PoisonPill RuntimeExceptionParameter
- * @build CheckUnmarshalOnStopThread
- * @build CheckUnmarshalOnStopThread_Stub
+ * @build TestLibrary CheckUnmarshal CheckUnmarshalOnStopThread_Stub
+ *     PoisonPill RuntimeExceptionParameter
  * @run main/othervm/timeout=480 CheckUnmarshalOnStopThread
  */
 
diff --git a/test/java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java b/test/java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java
index 7b7317a..f15883c 100644
--- a/test/java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java
+++ b/test/java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java
@@ -35,9 +35,7 @@
  * @author Peter Jones
  *
  * @library ../../../testlibrary
- * @build FiniteGCLatency
- * @build FiniteGCLatency_Stub
- * @build TestLibrary
+ * @build TestLibrary FiniteGCLatency_Stub
  * @run main/othervm/timeout=120 FiniteGCLatency
  */
 
diff --git a/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java b/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java
index c1d5c57..b488e76 100644
--- a/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java
+++ b/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java
@@ -37,11 +37,7 @@
  * @author Peter Jones
  *
  * @library ../../../testlibrary
- * @build TestLibrary
- * @build JavaVM
- * @build LeaseCheckInterval
- * @build LeaseCheckInterval_Stub
- * @build SelfTerminator
+ * @build TestLibrary JavaVM LeaseCheckInterval_Stub SelfTerminator
  * @run main/othervm LeaseCheckInterval
  */
 
diff --git a/test/java/rmi/server/Unreferenced/marshalledObjectGet/MarshalledObjectGet.java b/test/java/rmi/server/Unreferenced/marshalledObjectGet/MarshalledObjectGet.java
index 8170168..0ae059b 100644
--- a/test/java/rmi/server/Unreferenced/marshalledObjectGet/MarshalledObjectGet.java
+++ b/test/java/rmi/server/Unreferenced/marshalledObjectGet/MarshalledObjectGet.java
@@ -30,8 +30,6 @@
  * invoked.
  * @author Peter Jones
  *
- * @library ../../../testlibrary
- * @build MarshalledObjectGet
  * @build MarshalledObjectGet_Stub
  * @run main/othervm/timeout=120 MarshalledObjectGet
  */
diff --git a/test/java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext.java b/test/java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext.java
index eb9d192..05be7ae 100644
--- a/test/java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext.java
+++ b/test/java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext.java
@@ -39,9 +39,7 @@
  * @author Laird Dornin
  *
  * @library ../../../testlibrary
- * @build UnreferencedContext
- * @build UnreferencedContext_Stub
- * @build TestLibrary
+ * @build TestLibrary UnreferencedContext_Stub
  * @run main/othervm/timeout=120 UnreferencedContext
  */
 
diff --git a/test/java/rmi/server/clientStackTrace/ClientStackTrace.java b/test/java/rmi/server/clientStackTrace/ClientStackTrace.java
index 41a2103..d685557 100644
--- a/test/java/rmi/server/clientStackTrace/ClientStackTrace.java
+++ b/test/java/rmi/server/clientStackTrace/ClientStackTrace.java
@@ -28,7 +28,7 @@
  * @author Laird Dornin
  *
  * @library ../../testlibrary
- * @build ClientStackTrace MyRemoteObject_Stub TestLibrary TestParams
+ * @build TestLibrary ClientStackTrace MyRemoteObject_Stub
  * @run main/othervm/policy=security.policy/timeout=120 ClientStackTrace
  */
 
diff --git a/test/java/rmi/server/getRemoteClass/GetRemoteClass.java b/test/java/rmi/server/getRemoteClass/GetRemoteClass.java
index 8fa4710..b6f21b4 100644
--- a/test/java/rmi/server/getRemoteClass/GetRemoteClass.java
+++ b/test/java/rmi/server/getRemoteClass/GetRemoteClass.java
@@ -28,7 +28,7 @@
  * @author Laird Dornin
  *
  * @library ../../testlibrary
- * @build GetRemoteClass TestLibrary TestParams
+ * @build TestLibrary
  * @run main/othervm GetRemoteClass
  */
 
diff --git a/test/java/rmi/server/serverStackTrace/ServerStackTrace.java b/test/java/rmi/server/serverStackTrace/ServerStackTrace.java
index 6cc9b2d..43504af 100644
--- a/test/java/rmi/server/serverStackTrace/ServerStackTrace.java
+++ b/test/java/rmi/server/serverStackTrace/ServerStackTrace.java
@@ -29,8 +29,7 @@
  * serialized with the Throwable from the server.
  * @author Peter Jones
  *
- * @build ServerStackTrace
- * @build ServerStackTrace_Stub
+ * @build ServerStackTrace ServerStackTrace_Stub
  * @run main/othervm ServerStackTrace
  */
 
diff --git a/test/java/rmi/server/serverStackTrace/SuppressStackTraces.java b/test/java/rmi/server/serverStackTrace/SuppressStackTraces.java
index 243d322..9606d12 100644
--- a/test/java/rmi/server/serverStackTrace/SuppressStackTraces.java
+++ b/test/java/rmi/server/serverStackTrace/SuppressStackTraces.java
@@ -36,10 +36,7 @@
  * for reasons of performance or confidentiality requirements.
  * @author Peter Jones
  *
- * @build SuppressStackTraces
- * @build Impl2_Stub
- * @build Impl1_Stub
- * @build Impl1_Skel
+ * @build SuppressStackTraces Impl2_Stub Impl1_Stub Impl1_Skel
  * @run main/othervm SuppressStackTraces
  */
 
diff --git a/test/java/rmi/server/useCustomRef/UseCustomRef.java b/test/java/rmi/server/useCustomRef/UseCustomRef.java
index 059c9a8..23d7847 100644
--- a/test/java/rmi/server/useCustomRef/UseCustomRef.java
+++ b/test/java/rmi/server/useCustomRef/UseCustomRef.java
@@ -31,11 +31,7 @@
  * 4180392
  *
  * @library ../../testlibrary
- * @build UseCustomRef
- * @build Ping
- * @build UseCustomRef_Stub
- * @build UseCustomRef_Skel
- * @build TestLibrary
+ * @build TestLibrary Ping UseCustomRef_Stub UseCustomRef_Skel
  * @run main/othervm/policy=security.policy/secure=java.rmi.RMISecurityManager/timeout=120 UseCustomRef
  *
  * This test was failing to run because the synthetic access
diff --git a/test/java/rmi/testlibrary/TestLibrary.java b/test/java/rmi/testlibrary/TestLibrary.java
index 734d805..07ed308 100644
--- a/test/java/rmi/testlibrary/TestLibrary.java
+++ b/test/java/rmi/testlibrary/TestLibrary.java
@@ -54,6 +54,7 @@
 import java.rmi.server.UnicastRemoteObject;
 import java.util.Enumeration;
 import java.util.Properties;
+
 import sun.rmi.registry.RegistryImpl;
 import sun.rmi.server.UnicastServerRef;
 import sun.rmi.transport.Endpoint;
@@ -92,6 +93,7 @@
     public final static int INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT = 64003;
     public final static int INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT = 64004;
     public final static int READTEST_REGISTRY_PORT = 64005;
+    private final static int MAX_SERVER_SOCKET_TRIES = 10;
 
     static void mesg(Object mesg) {
         System.err.println("TEST_LIBRARY: " + mesg.toString());
@@ -125,36 +127,15 @@
         bomb(null, e);
     }
 
-    /**
-     * Property accessors
-     */
-    private static boolean getBoolean(String name) {
-        return (new Boolean(getProperty(name, "false")).booleanValue());
-    }
-    private static Integer getInteger(String name) {
-        int val = 0;
-        Integer value = null;
-
-        String propVal = getProperty(name, null);
-        if (propVal == null) {
-            return null;
-        }
-
-        try {
-            value = new Integer(Integer.parseInt(propVal));
-        } catch (NumberFormatException nfe) {
-        }
-        return value;
-    }
     public static String getProperty(String property, String defaultVal) {
         final String prop = property;
         final String def = defaultVal;
-        return ((String) java.security.AccessController.doPrivileged
-            (new java.security.PrivilegedAction() {
-                public Object run() {
+        return java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<String>() {
+                public String run() {
                     return System.getProperty(prop, def);
                 }
-            }));
+            });
     }
 
     /**
@@ -169,9 +150,9 @@
     public static void setProperty(String property, String value) {
         final String prop = property;
         final String val = value;
-        java.security.AccessController.doPrivileged
-            (new java.security.PrivilegedAction() {
-                public Object run() {
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
                     System.setProperty(prop, val);
                     return null;
                 }
@@ -188,7 +169,7 @@
         out.println("-------------------Test environment----------" +
                     "---------");
 
-        for(Enumeration keys = System.getProperties().keys();
+        for(Enumeration<?> keys = System.getProperties().keys();
             keys.hasMoreElements();) {
 
             String property = (String) keys.nextElement();
@@ -252,7 +233,7 @@
         /*
          * Obtain the URL for the codebase.
          */
-        URL codebaseURL = dstDir.toURL();
+        URL codebaseURL = dstDir.toURI().toURL();
 
         /*
          * Specify where we will copy the class definition from, if
@@ -407,26 +388,46 @@
      */
     public static int getUnusedRandomPort() {
         int numTries = 0;
-        int unusedRandomPort = FIXED_PORT_MIN;
-        Exception ex = null;
+        IOException ex = null;
 
-        while (numTries++ < 10) {
+        while (numTries++ < MAX_SERVER_SOCKET_TRIES) {
+            int unusedRandomPort = -1;
             ex = null; //reset
 
             try (ServerSocket ss = new ServerSocket(0)) {
                 unusedRandomPort = ss.getLocalPort();
-            } catch (Exception e) {
+            } catch (IOException e) {
                 ex = e;
+                // temporarily print stack trace here until we find out why
+                // tests are failing.
+                System.err.println("TestLibrary.getUnusedRandomPort() caught "
+                        + "exception on iteration " + numTries
+                        + (numTries==MAX_SERVER_SOCKET_TRIES ? " (the final try)."
+                        : "."));
+                ex.printStackTrace();
             }
 
-            if (!isReservedPort(unusedRandomPort)) {
-                return unusedRandomPort;
+            if (unusedRandomPort >= 0) {
+                if (isReservedPort(unusedRandomPort)) {
+                    System.out.println("INFO: On try # " + numTries
+                        + (numTries==MAX_SERVER_SOCKET_TRIES ? ", the final try, ": ",")
+                        + " ServerSocket(0) returned the reserved port "
+                        + unusedRandomPort
+                        + " in TestLibrary.getUnusedRandomPort() ");
+                } else {
+                    return unusedRandomPort;
+                }
             }
         }
 
         // If we're here, then either an exception was thrown or the port is
         // a reserved port.
-        throw new RuntimeException("Error getting unused random port.", ex);
+        if (ex==null) {
+            throw new RuntimeException("Error getting unused random port. The"
+                    +" last port returned by ServerSocket(0) was a reserved port");
+        } else {
+            throw new RuntimeException("Error getting unused random port.", ex);
+        }
     }
 
     /**
diff --git a/test/java/rmi/transport/acceptLoop/CloseServerSocketOnTermination.java b/test/java/rmi/transport/acceptLoop/CloseServerSocketOnTermination.java
index a236137..b4d86c4 100644
--- a/test/java/rmi/transport/acceptLoop/CloseServerSocketOnTermination.java
+++ b/test/java/rmi/transport/acceptLoop/CloseServerSocketOnTermination.java
@@ -31,7 +31,6 @@
  * exception for which it doesn't even consult the RMIFailureHandler.
  * @author Peter Jones
  *
- * @build CloseServerSocketOnTermination
  * @run main/othervm CloseServerSocketOnTermination
  */
 
diff --git a/test/java/rmi/transport/checkFQDN/CheckFQDN.java b/test/java/rmi/transport/checkFQDN/CheckFQDN.java
index 006de5b..9660f53 100644
--- a/test/java/rmi/transport/checkFQDN/CheckFQDN.java
+++ b/test/java/rmi/transport/checkFQDN/CheckFQDN.java
@@ -33,8 +33,7 @@
  * @author Laird Dornin
  *
  * @library ../../testlibrary
- * @build CheckFQDN CheckFQDNClient CheckFQDN_Stub TellServerName
- * @build TestLibrary
+ * @build TestLibrary CheckFQDNClient CheckFQDN_Stub TellServerName
  * @run main/othervm/timeout=120 CheckFQDN
  */
 
diff --git a/test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java b/test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java
index 0ab0057..52fd7df 100644
--- a/test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java
+++ b/test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java
@@ -28,8 +28,7 @@
  * @author Laird Dornin
  *
  * @library ../../testlibrary
- * @build CheckLeaseLeak CheckLeaseLeak_Stub LeaseLeakClient LeaseLeak
- * @build TestLibrary
+ * @build TestLibrary CheckLeaseLeak_Stub LeaseLeakClient LeaseLeak
  * @run main/othervm/timeout=240 CheckLeaseLeak
  *
  */
diff --git a/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java b/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java
index 69c51de..2b1f1ee 100644
--- a/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java
+++ b/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java
@@ -31,7 +31,7 @@
  * @author Peter Jones
  *
  * @library ../../testlibrary
- * @build CloseServerSocket TestLibrary
+ * @build TestLibrary
  * @run main/othervm CloseServerSocket
  */
 
diff --git a/test/java/rmi/transport/dgcDeadLock/DGCDeadLock.java b/test/java/rmi/transport/dgcDeadLock/DGCDeadLock.java
index 97ad31d..bcd58a0 100644
--- a/test/java/rmi/transport/dgcDeadLock/DGCDeadLock.java
+++ b/test/java/rmi/transport/dgcDeadLock/DGCDeadLock.java
@@ -28,11 +28,7 @@
  * @author Laird Dornin
  *
  * @library ../../testlibrary
- * @build DGCDeadLock
- * @build Test
- * @build TestImpl
- * @build TestImpl_Stub
- * @build TestLibrary
+ * @build TestLibrary Test TestImpl TestImpl_Stub
  * @run main/othervm/policy=security.policy/timeout=360 DGCDeadLock
  */
 
diff --git a/test/java/rmi/transport/handshakeFailure/HandshakeFailure.java b/test/java/rmi/transport/handshakeFailure/HandshakeFailure.java
index df04070..ed1ba8e 100644
--- a/test/java/rmi/transport/handshakeFailure/HandshakeFailure.java
+++ b/test/java/rmi/transport/handshakeFailure/HandshakeFailure.java
@@ -31,7 +31,7 @@
  * @author Peter Jones
  *
  * @library ../../testlibrary
- * @build HandshakeFailure TestLibrary
+ * @build TestLibrary
  * @run main/othervm HandshakeFailure
  */
 
diff --git a/test/java/rmi/transport/handshakeTimeout/HandshakeTimeout.java b/test/java/rmi/transport/handshakeTimeout/HandshakeTimeout.java
index 304c175..ba492f4 100644
--- a/test/java/rmi/transport/handshakeTimeout/HandshakeTimeout.java
+++ b/test/java/rmi/transport/handshakeTimeout/HandshakeTimeout.java
@@ -34,7 +34,7 @@
  * @author Peter Jones
  *
  * @library ../../testlibrary
- * @build HandshakeTimeout TestLibrary
+ * @build TestLibrary
  * @run main/othervm HandshakeTimeout
  */
 
diff --git a/test/java/rmi/transport/httpSocket/HttpSocketTest.java b/test/java/rmi/transport/httpSocket/HttpSocketTest.java
index 1004bfb..032c4cd 100644
--- a/test/java/rmi/transport/httpSocket/HttpSocketTest.java
+++ b/test/java/rmi/transport/httpSocket/HttpSocketTest.java
@@ -27,7 +27,7 @@
  * @author Dana Burns
  *
  * @library ../../testlibrary
- * @build HttpSocketTest HttpSocketTest_Stub TestLibrary
+ * @build TestLibrary HttpSocketTest HttpSocketTest_Stub
  * @run main/othervm/policy=security.policy HttpSocketTest
  */
 
diff --git a/test/java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java b/test/java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java
index 5b21da8..4080bfa 100644
--- a/test/java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java
+++ b/test/java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java
@@ -32,7 +32,7 @@
  * @author Peter Jones
  *
  * @library ../../testlibrary
- * @build TestLibrary RapidExportUnexport
+ * @build TestLibrary
  * @run main/othervm RapidExportUnexport
  */
 
diff --git a/test/java/rmi/transport/readTimeout/ReadTimeoutTest.java b/test/java/rmi/transport/readTimeout/ReadTimeoutTest.java
index f72fea3..3a0bfa1 100644
--- a/test/java/rmi/transport/readTimeout/ReadTimeoutTest.java
+++ b/test/java/rmi/transport/readTimeout/ReadTimeoutTest.java
@@ -27,12 +27,9 @@
  * @summary Incoming connections should be subject to timeout
  * @author Adrian Colley
  *
- * @library ../../testlibrary
- * @build TestIface
- * @build TestImpl
- * @build TestImpl_Stub
- * @build ReadTimeoutTest
- * @run main/othervm/policy=security.policy/timeout=60 -Dsun.rmi.transport.tcp.readTimeout=5000 ReadTimeoutTest
+ * @build TestIface TestImpl TestImpl_Stub
+ * @run main/othervm/policy=security.policy/timeout=60
+ *     -Dsun.rmi.transport.tcp.readTimeout=5000 ReadTimeoutTest
  */
 
 /* This test sets a very short read timeout, exports an object, and then
diff --git a/test/java/rmi/transport/reuseDefaultPort/ReuseDefaultPort.java b/test/java/rmi/transport/reuseDefaultPort/ReuseDefaultPort.java
index decec58..e5e7d80 100644
--- a/test/java/rmi/transport/reuseDefaultPort/ReuseDefaultPort.java
+++ b/test/java/rmi/transport/reuseDefaultPort/ReuseDefaultPort.java
@@ -34,7 +34,7 @@
  * @author Peter Jones
  *
  * @library ../../testlibrary
- * @build ReuseDefaultPort TestLibrary
+ * @build TestLibrary
  * @run main/othervm ReuseDefaultPort
  */
 
diff --git a/test/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java b/test/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java
index 04a931d..ac48077 100644
--- a/test/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java
+++ b/test/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java
@@ -38,7 +38,6 @@
  * subsystems also not holding on to the loader in their daemon threads.]
  * @author Peter Jones
  *
- * @build RuntimeThreadInheritanceLeak
  * @build RuntimeThreadInheritanceLeak_Stub
  * @run main/othervm RuntimeThreadInheritanceLeak
  */
diff --git a/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh b/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh
index a503697..a62cba4 100644
--- a/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh
+++ b/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh
@@ -87,7 +87,7 @@
         ${TESTSRC}${FILESEP}provider${FILESEP}HashProvider.java
 
 # run the test
-${TESTJAVA}${FILESEP}bin${FILESEP}java \
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \
         -classpath "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}Deadlock.jar" \
 	-Djava.awt.headless=true \
         ClassLoaderDeadlock
diff --git a/test/java/security/Security/ClassLoaderDeadlock/Deadlock.sh b/test/java/security/Security/ClassLoaderDeadlock/Deadlock.sh
index 53555ee..e1ed144 100644
--- a/test/java/security/Security/ClassLoaderDeadlock/Deadlock.sh
+++ b/test/java/security/Security/ClassLoaderDeadlock/Deadlock.sh
@@ -62,5 +62,5 @@
 
 JAVA="${TESTJAVA}${FILESEP}bin${FILESEP}java"
 
-${JAVA} -cp "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}Deadlock.jar" Deadlock
+${JAVA} ${TESTVMOPTS} -cp "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}Deadlock.jar" Deadlock
 
diff --git a/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh b/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh
index 1109496..acf8ff2 100644
--- a/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh
+++ b/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh
@@ -100,8 +100,8 @@
 rm Deadlock2*.class
 
 # create serialized object and run the test
-${TESTJAVA}${FILESEP}bin${FILESEP}java CreateSerialized
-${TESTJAVA}${FILESEP}bin${FILESEP}java -Djava.ext.dirs=${TESTCLASSES}${FILESEP}testlib Deadlock2
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} CreateSerialized
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} -Djava.ext.dirs=${TESTCLASSES}${FILESEP}testlib Deadlock2
 STATUS=$?
 
 # clean up
diff --git a/test/java/security/Security/signedfirst/Dyn.sh b/test/java/security/Security/signedfirst/Dyn.sh
index d87e5ff..64d0dd3 100644
--- a/test/java/security/Security/signedfirst/Dyn.sh
+++ b/test/java/security/Security/signedfirst/Dyn.sh
@@ -83,7 +83,7 @@
         ${TESTSRC}${FILESEP}DynSignedProvFirst.java
 
 # run the test
-${TESTJAVA}${FILESEP}bin${FILESEP}java \
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \
         -classpath "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}exp.jar" \
         DynSignedProvFirst
 
diff --git a/test/java/security/Security/signedfirst/Static.sh b/test/java/security/Security/signedfirst/Static.sh
index 6b41adf..544a3b1 100644
--- a/test/java/security/Security/signedfirst/Static.sh
+++ b/test/java/security/Security/signedfirst/Static.sh
@@ -84,7 +84,7 @@
 
 # run the test
 cd ${TESTSRC}${FILESEP}
-${TESTJAVA}${FILESEP}bin${FILESEP}java \
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \
         -classpath "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}exp.jar" \
         -Djava.security.properties=file:${TESTSRC}${FILESEP}Static.props \
         StaticSignedProvFirst
diff --git a/test/java/security/Signature/VerifyRangeCheckOverflow.java b/test/java/security/Signature/VerifyRangeCheckOverflow.java
index 9077cc2..b68d8ca 100644
--- a/test/java/security/Signature/VerifyRangeCheckOverflow.java
+++ b/test/java/security/Signature/VerifyRangeCheckOverflow.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/security/cert/CertificateFactory/slowstream.sh b/test/java/security/cert/CertificateFactory/slowstream.sh
index fbca87e..72d3fcf 100644
--- a/test/java/security/cert/CertificateFactory/slowstream.sh
+++ b/test/java/security/cert/CertificateFactory/slowstream.sh
@@ -46,5 +46,5 @@
 esac
 
 ${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}SlowStream.java
-${TESTJAVA}${FS}bin${FS}java -Dtest.src=${TESTSRC} SlowStreamWriter | \
-        ${TESTJAVA}${FS}bin${FS}java SlowStreamReader
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dtest.src=${TESTSRC} SlowStreamWriter | \
+        ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} SlowStreamReader
diff --git a/test/java/util/AbstractCollection/ToArrayTest.java b/test/java/util/AbstractCollection/ToArrayTest.java
index 1cbf66f..fd19f16 100644
--- a/test/java/util/AbstractCollection/ToArrayTest.java
+++ b/test/java/util/AbstractCollection/ToArrayTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/util/Calendar/GenericTimeZoneNamesTest.java b/test/java/util/Calendar/GenericTimeZoneNamesTest.java
new file mode 100644
index 0000000..f2dcbe5
--- /dev/null
+++ b/test/java/util/Calendar/GenericTimeZoneNamesTest.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.*;
+import sun.util.locale.provider.TimeZoneNameUtility;
+
+public class GenericTimeZoneNamesTest {
+    private static final String[] PT = {
+        "America/Los_Angeles", "US/Pacific", "PST"
+    };
+
+    private static int errors = 0;
+
+    public static void main(String[] args) {
+        for (String tag : args) {
+            Locale locale = Locale.forLanguageTag(tag);
+            for (String tzid : PT) {
+                test(tzid, TimeZone.LONG, locale, "Pacific Time");
+                test(tzid, TimeZone.SHORT, locale, "PT");
+            }
+        }
+
+        if (errors != 0) {
+            throw new RuntimeException("test failed");
+        }
+    }
+
+    private static void test(String tzid, int style, Locale locale, String expected) {
+        // No public API to get generic time zone names (JDK 8)
+        String got = TimeZoneNameUtility.retrieveGenericDisplayName(tzid, style, locale);
+        if (!expected.equals(got)) {
+            System.err.printf("test: tzid=%s, locale=%s, style=%d, got=\"%s\", expected=\"%s\"%n",
+                              tzid, locale, style, got, expected);
+            errors++;
+        }
+    }
+}
diff --git a/test/java/util/Calendar/GenericTimeZoneNamesTest.sh b/test/java/util/Calendar/GenericTimeZoneNamesTest.sh
new file mode 100644
index 0000000..a549189
--- /dev/null
+++ b/test/java/util/Calendar/GenericTimeZoneNamesTest.sh
@@ -0,0 +1,47 @@
+#
+# Copyright (c) 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.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# @test
+# @bug 8003267
+# @summary Unit test for generic time zone names support
+# @compile -XDignore.symbol.file GenericTimeZoneNamesTest.java
+# @run shell GenericTimeZoneNamesTest.sh
+
+# This test is locale data-dependent and assumes that both JRE and CLDR
+# have the same geneic time zone names in English.
+
+STATUS=0
+echo "Locale providers: default"
+# TODO: The purpose of ja-JP is to make sure the fallback for generic
+# names works. Remove ja-JP when adding generic names to localized
+# resources.
+if ! ${TESTJAVA}/bin/java -esa -cp "${TESTCLASSES}" GenericTimeZoneNamesTest en-US ja-JP; then
+    STATUS=1
+fi
+
+echo "Locale providers: CLDR"
+if ! ${TESTJAVA}/bin/java -esa -cp "${TESTCLASSES}" -Djava.locale.providers=CLDR GenericTimeZoneNamesTest en-US; then
+   STATUS=1
+fi
+exit ${STATUS}
+
diff --git a/test/java/util/Calendar/NarrowNamesTest.java b/test/java/util/Calendar/NarrowNamesTest.java
new file mode 100644
index 0000000..7338792
--- /dev/null
+++ b/test/java/util/Calendar/NarrowNamesTest.java
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.*;
+import static java.util.GregorianCalendar.*;
+
+public class NarrowNamesTest {
+    private static final Locale US = Locale.US;
+    private static final Locale JAJPJP = new Locale("ja", "JP", "JP");
+    private static final Locale THTH = new Locale("th", "TH");
+
+    private static final String RESET_INDEX = "RESET_INDEX";
+
+    private static int errors = 0;
+
+    // This test is locale data-dependent.
+    public static void main(String[] args) {
+        test(US, ERA, "B",
+             ERA, BC, YEAR, 1);
+        test(US, ERA, "A",
+             ERA, AD, YEAR, 2012);
+        test(US, DAY_OF_WEEK, "S",
+             YEAR, 2012, MONTH, DECEMBER, DAY_OF_MONTH, 23);
+        test(US, AM_PM, "a",
+             HOUR_OF_DAY, 10);
+        test(US, AM_PM, "p",
+             HOUR_OF_DAY, 23);
+        test(JAJPJP, DAY_OF_WEEK, "\u65e5",
+             YEAR, 24, MONTH, DECEMBER, DAY_OF_MONTH, 23);
+        test(THTH, MONTH, NARROW_STANDALONE, "\u0e18.\u0e04.",
+             YEAR, 2555, MONTH, DECEMBER, DAY_OF_MONTH, 5);
+        test(THTH, DAY_OF_WEEK, "\u0e1e",
+             YEAR, 2555, MONTH, DECEMBER, DAY_OF_MONTH, 5);
+
+        testMap(US, DAY_OF_WEEK, ALL_STYLES, // shouldn't include any narrow names
+                "", // 1-based indexing for DAY_OF_WEEK
+                "Sunday",    // Sunday
+                "Monday",    // Monday
+                "Tuesday",   // Tuesday
+                "Wednesday", // Wednesday
+                "Thursday",  // Thursday
+                "Friday",    // Friday
+                "Saturday",  // Saturday
+                RESET_INDEX,
+                "", // 1-based indexing for DAY_OF_WEEK
+                "Sun",       // abb Sunday
+                "Mon",       // abb Monday
+                "Tue",       // abb Tuesday
+                "Wed",       // abb Wednesday
+                "Thu",       // abb Thursday
+                "Fri",       // abb Friday
+                "Sat"        // abb Saturday
+                );
+        testMap(US, DAY_OF_WEEK, NARROW_FORMAT); // expect null
+        testMap(US, AM_PM, ALL_STYLES,
+                "AM", "PM",
+                RESET_INDEX,
+                "a", "p");
+        testMap(JAJPJP, DAY_OF_WEEK, NARROW_STANDALONE); // expect null
+        testMap(JAJPJP, DAY_OF_WEEK, NARROW_FORMAT,
+                "", // 1-based indexing for DAY_OF_WEEK
+                "\u65e5",
+                "\u6708",
+                "\u706b",
+                "\u6c34",
+                "\u6728",
+                "\u91d1",
+                "\u571f");
+        testMap(THTH, MONTH, NARROW_FORMAT); // expect null
+        testMap(THTH, MONTH, NARROW_STANDALONE,
+                "\u0e21.\u0e04.",
+                "\u0e01.\u0e1e.",
+                "\u0e21\u0e35.\u0e04.",
+                "\u0e40\u0e21.\u0e22.",
+                "\u0e1e.\u0e04.",
+                "\u0e21\u0e34.\u0e22.",
+                "\u0e01.\u0e04.",
+                "\u0e2a.\u0e04.",
+                "\u0e01.\u0e22.",
+                "\u0e15.\u0e04.",
+                "\u0e1e.\u0e22.",
+                "\u0e18.\u0e04.");
+
+        if (errors != 0) {
+            throw new RuntimeException("test failed");
+        }
+    }
+
+    private static void test(Locale locale, int field, String expected, int... data) {
+        test(locale, field, NARROW_FORMAT, expected, data);
+    }
+
+    private static void test(Locale locale, int field, int style, String expected, int... fieldValuePairs) {
+        Calendar cal = Calendar.getInstance(locale);
+        cal.clear();
+        for (int i = 0; i < fieldValuePairs.length;) {
+            int f = fieldValuePairs[i++];
+            int v = fieldValuePairs[i++];
+            cal.set(f, v);
+        }
+        String got = cal.getDisplayName(field, style, locale);
+        if (!expected.equals(got)) {
+            System.err.printf("test: locale=%s, field=%d, value=%d, style=%d, got=\"%s\", expected=\"%s\"%n",
+                              locale, field, cal.get(field), style, got, expected);
+            errors++;
+        }
+    }
+
+    private static void testMap(Locale locale, int field, int style, String... expected) {
+        Map<String, Integer> expectedMap = null;
+        if (expected.length > 0) {
+            expectedMap = new TreeMap<>(LengthBasedComparator.INSTANCE);
+            int index = 0;
+            for (int i = 0; i < expected.length; i++) {
+                if (expected[i].isEmpty()) {
+                    index++;
+                    continue;
+                }
+                if (expected[i] == RESET_INDEX) {
+                    index = 0;
+                    continue;
+                }
+                expectedMap.put(expected[i], index++);
+            }
+        }
+        Calendar cal = Calendar.getInstance(locale);
+        Map<String, Integer> got = cal.getDisplayNames(field, style, locale);
+        if (!(expectedMap == null && got == null)
+            && !expectedMap.equals(got)) {
+            System.err.printf("testMap: locale=%s, field=%d, style=%d, expected=%s, got=%s%n",
+                              locale, field, style, expectedMap, got);
+            errors++;
+        }
+    }
+
+    /**
+     * Comparator implementation for TreeMap which iterates keys from longest
+     * to shortest.
+     */
+    private static class LengthBasedComparator implements Comparator<String> {
+        private static final LengthBasedComparator INSTANCE = new LengthBasedComparator();
+
+        private LengthBasedComparator() {
+        }
+
+        @Override
+        public int compare(String o1, String o2) {
+            int n = o2.length() - o1.length();
+            return (n == 0) ? o1.compareTo(o2) : n;
+        }
+    }
+}
diff --git a/test/java/util/Calendar/NarrowNamesTest.sh b/test/java/util/Calendar/NarrowNamesTest.sh
new file mode 100644
index 0000000..742e35a
--- /dev/null
+++ b/test/java/util/Calendar/NarrowNamesTest.sh
@@ -0,0 +1,41 @@
+#
+# Copyright (c) 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.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# @test
+# @bug 8000983
+# @summary Unit test for narrow names support
+# @build NarrowNamesTest
+# @run shell NarrowNamesTest.sh
+
+# This test is locale data-dependent and assumes that both JRE and CLDR
+# have the same narrow names.
+
+STATUS=0
+for P in "JRE,SPI" "CLDR"
+do
+    echo "Locale providers: $P"
+    if ! ${TESTJAVA}/bin/java -esa -cp "${TESTCLASSES}" -Djava.locale.providers="${P}" NarrowNamesTest; then
+        STATUS=1
+    fi
+done
+exit ${STATUS}
diff --git a/test/java/util/Currency/PropertiesTest.sh b/test/java/util/Currency/PropertiesTest.sh
index 874e7ac..6c16851 100644
--- a/test/java/util/Currency/PropertiesTest.sh
+++ b/test/java/util/Currency/PropertiesTest.sh
@@ -70,7 +70,7 @@
 
 run() {
     echo ''
-    sh -xc "${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} $*" 2>&1
+    sh -xc "${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp ${TESTCLASSES} $*" 2>&1
     if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 }
 
@@ -113,7 +113,7 @@
 
 # run
 echo ''
-sh -xc "${WRITABLEJDK}${FS}bin${FS}java -cp ${TESTCLASSES} PropertiesTest -d dump3"
+sh -xc "${WRITABLEJDK}${FS}bin${FS}java ${TESTVMOPTS} -cp ${TESTCLASSES} PropertiesTest -d dump3"
 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 
 # Cleanup
diff --git a/test/java/util/Locale/LocaleCategory.sh b/test/java/util/Locale/LocaleCategory.sh
index 34becd3..84b6119 100644
--- a/test/java/util/Locale/LocaleCategory.sh
+++ b/test/java/util/Locale/LocaleCategory.sh
@@ -69,7 +69,7 @@
 # test user.xxx.display user.xxx.format properties
 
 # run
-RUNCMD="${TESTJAVA}${FS}bin${FS}java -classpath ${TESTCLASSES} -Duser.language.display=ja -Duser.language.format=zh LocaleCategory"
+RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSES} -Duser.language.display=ja -Duser.language.format=zh LocaleCategory"
 
 echo ${RUNCMD}
 ${RUNCMD}
@@ -85,7 +85,7 @@
 # test user.xxx properties overriding user.xxx.display/format
 
 # run
-RUNCMD="${TESTJAVA}${FS}bin${FS}java -classpath ${TESTCLASSES} -Duser.language=en -Duser.language.display=ja -Duser.language.format=zh LocaleCategory"
+RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSES} -Duser.language=en -Duser.language.display=ja -Duser.language.format=zh LocaleCategory"
 
 echo ${RUNCMD}
 ${RUNCMD}
diff --git a/test/java/util/Locale/LocaleProviders.sh b/test/java/util/Locale/LocaleProviders.sh
index 59e43fc..3cf0d4e 100644
--- a/test/java/util/Locale/LocaleProviders.sh
+++ b/test/java/util/Locale/LocaleProviders.sh
@@ -96,12 +96,12 @@
 ${TESTJAVA}${FS}bin${FS}jar cvf ${SPIDIR}${FS}tznp.jar -C ${SPIDIR}${FS}dest .
 
 # get the platform default locales
-PLATDEF=`${TESTJAVA}${FS}bin${FS}java -classpath ${TESTCLASSES} LocaleProviders getPlatformLocale display`
+PLATDEF=`${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSES} LocaleProviders getPlatformLocale display`
 DEFLANG=`echo ${PLATDEF} | sed -e "s/,.*//"`
 DEFCTRY=`echo ${PLATDEF} | sed -e "s/.*,//"`
 echo "DEFLANG=${DEFLANG}"
 echo "DEFCTRY=${DEFCTRY}"
-PLATDEF=`${TESTJAVA}${FS}bin${FS}java -classpath ${TESTCLASSES} LocaleProviders getPlatformLocale format`
+PLATDEF=`${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSES} LocaleProviders getPlatformLocale format`
 DEFFMTLANG=`echo ${PLATDEF} | sed -e "s/,.*//"`
 DEFFMTCTRY=`echo ${PLATDEF} | sed -e "s/.*,//"`
 echo "DEFFMTLANG=${DEFFMTLANG}"
@@ -109,7 +109,7 @@
 
 runTest()
 {
-    RUNCMD="${TESTJAVA}${FS}bin${FS}java -classpath ${TESTCLASSES} -Djava.locale.providers=$PREFLIST LocaleProviders $METHODNAME $PARAM1 $PARAM2 $PARAM3"
+    RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSES} -Djava.locale.providers=$PREFLIST LocaleProviders $METHODNAME $PARAM1 $PARAM2 $PARAM3"
     echo ${RUNCMD}
     ${RUNCMD}
     result=$?
diff --git a/test/java/util/Map/EntryHashCode.java b/test/java/util/Map/EntryHashCode.java
index 98ef365..d3efc8c 100644
--- a/test/java/util/Map/EntryHashCode.java
+++ b/test/java/util/Map/EntryHashCode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/util/PluggableLocale/ExecTest.sh b/test/java/util/PluggableLocale/ExecTest.sh
index 18bd8d1..c01e9e8 100644
--- a/test/java/util/PluggableLocale/ExecTest.sh
+++ b/test/java/util/PluggableLocale/ExecTest.sh
@@ -119,9 +119,9 @@
 # run
 if [ "$3" = "true" ]
 then
-  RUNCMD="${TESTJAVA}${FS}bin${FS}java -Djava.ext.dirs=${EXTDIRS} $2 "
+  RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Djava.ext.dirs=${EXTDIRS} $2 "
 else
-  RUNCMD="${TESTJAVA}${FS}bin${FS}java -classpath ${CLASSPATHARG} $2 "
+  RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${CLASSPATHARG} $2 "
 fi
 
 echo ${RUNCMD}
diff --git a/test/java/util/PluggableLocale/GenericTest.java b/test/java/util/PluggableLocale/GenericTest.java
index 8be74cd..eee0f95 100644
--- a/test/java/util/PluggableLocale/GenericTest.java
+++ b/test/java/util/PluggableLocale/GenericTest.java
@@ -41,6 +41,7 @@
     com.bar.CurrencyNameProviderImpl2 currencyNP2 = new com.bar.CurrencyNameProviderImpl2();
     com.bar.LocaleNameProviderImpl localeNP = new com.bar.LocaleNameProviderImpl();
     com.bar.TimeZoneNameProviderImpl tzNP = new com.bar.TimeZoneNameProviderImpl();
+    com.bar.GenericTimeZoneNameProviderImpl tzGenNP = new com.bar.GenericTimeZoneNameProviderImpl();
     com.bar.CalendarDataProviderImpl calDataP = new com.bar.CalendarDataProviderImpl();
     com.bar.CalendarNameProviderImpl calNameP = new com.bar.CalendarNameProviderImpl();
 
@@ -73,6 +74,7 @@
         expected.addAll(Arrays.asList(currencyNP2.getAvailableLocales()));
         expected.addAll(Arrays.asList(localeNP.getAvailableLocales()));
         expected.addAll(Arrays.asList(tzNP.getAvailableLocales()));
+        expected.addAll(Arrays.asList(tzGenNP.getAvailableLocales()));
         expected.addAll(Arrays.asList(calDataP.getAvailableLocales()));
         expected.addAll(Arrays.asList(calNameP.getAvailableLocales()));
         if (!result.equals(expected)) {
diff --git a/test/java/util/PluggableLocale/TimeZoneNameProviderTest.java b/test/java/util/PluggableLocale/TimeZoneNameProviderTest.java
index cc71e6c..7ed2fc1 100644
--- a/test/java/util/PluggableLocale/TimeZoneNameProviderTest.java
+++ b/test/java/util/PluggableLocale/TimeZoneNameProviderTest.java
@@ -40,6 +40,7 @@
     TimeZoneNameProviderTest() {
         test1();
         test2();
+        test3();
         aliasTest();
     }
 
@@ -92,6 +93,7 @@
     final String pattern = "z";
     final Locale OSAKA = new Locale("ja", "JP", "osaka");
     final Locale KYOTO = new Locale("ja", "JP", "kyoto");
+    final Locale GENERIC = new Locale("ja", "JP", "generic");
 
     final String[] TIMEZONES = {
         "GMT", "America/Los_Angeles", "SystemV/PST8",
@@ -157,6 +159,29 @@
         }
     }
 
+    void test3() {
+        final String[] TZNAMES = {
+            LATIME, PST, PST8PDT, US_PACIFIC,
+            TOKYOTIME, JST, JAPAN,
+        };
+        for (String tzname : TZNAMES) {
+            TimeZone tz = TimeZone.getTimeZone(tzname);
+            for (int style : new int[] { TimeZone.LONG, TimeZone.SHORT }) {
+                String osakaStd = tz.getDisplayName(false, style, OSAKA);
+                if (osakaStd != null) {
+                    // No API for getting generic time zone names
+                    String generic = TimeZoneNameUtility.retrieveGenericDisplayName(tzname,
+                                                                                    style, GENERIC);
+                    String expected = "Generic " + osakaStd;
+                    if (!expected.equals(generic)) {
+                        throw new RuntimeException("Wrong generic name: got=\"" + generic
+                                                   + "\", expected=\"" + expected + "\"");
+                    }
+                }
+            }
+        }
+    }
+
     final String LATIME = "America/Los_Angeles";
     final String PST = "PST";
     final String PST8PDT = "PST8PDT";
diff --git a/test/java/util/PluggableLocale/TimeZoneNameProviderTest.sh b/test/java/util/PluggableLocale/TimeZoneNameProviderTest.sh
index 76a08e6..4e34ae0 100644
--- a/test/java/util/PluggableLocale/TimeZoneNameProviderTest.sh
+++ b/test/java/util/PluggableLocale/TimeZoneNameProviderTest.sh
@@ -1,5 +1,5 @@
 # 
-# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 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
@@ -23,6 +23,6 @@
 #!/bin/sh
 #
 # @test
-# @bug 4052440
+# @bug 4052440 8003267
 # @summary TimeZoneNameProvider tests
 # @run shell ExecTest.sh bar TimeZoneNameProviderTest true
diff --git a/test/java/util/PluggableLocale/barprovider.jar b/test/java/util/PluggableLocale/barprovider.jar
index deed5fa..3a6f37a 100644
--- a/test/java/util/PluggableLocale/barprovider.jar
+++ b/test/java/util/PluggableLocale/barprovider.jar
Binary files differ
diff --git a/test/java/util/PluggableLocale/providersrc/GenericTimeZoneNameProviderImpl.java b/test/java/util/PluggableLocale/providersrc/GenericTimeZoneNameProviderImpl.java
new file mode 100644
index 0000000..b005b1a
--- /dev/null
+++ b/test/java/util/PluggableLocale/providersrc/GenericTimeZoneNameProviderImpl.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ *
+ */
+
+package com.bar;
+
+import java.util.*;
+import java.util.spi.*;
+
+import com.foobar.Utils;
+
+/**
+ * Implementation class for getGenericTimeZoneName which returns "Generic "+<standard name in OSAKA>.
+ */
+public class GenericTimeZoneNameProviderImpl extends TimeZoneNameProviderImpl {
+    static final Locale jaJPGeneric = new Locale("ja", "JP", "generic");
+    static final Locale OSAKA = new Locale("ja", "JP", "osaka");
+
+    static Locale[] avail = {
+        jaJPGeneric
+    };
+
+    @Override
+    public Locale[] getAvailableLocales() {
+        return avail;
+    }
+
+    @Override
+    public String getGenericDisplayName(String id, int style, Locale locale) {
+        if (!jaJPGeneric.equals(locale)) {
+            return null;
+        }
+        String std = super.getDisplayName(id, false, style, OSAKA);
+        return (std != null) ? "Generic " + std : null;
+    }
+}
diff --git a/test/java/util/PluggableLocale/providersrc/Makefile b/test/java/util/PluggableLocale/providersrc/Makefile
index 2af6066..916fed9 100644
--- a/test/java/util/PluggableLocale/providersrc/Makefile
+++ b/test/java/util/PluggableLocale/providersrc/Makefile
@@ -38,6 +38,7 @@
     CurrencyNameProviderImpl.java \
     CurrencyNameProviderImpl2.java \
     TimeZoneNameProviderImpl.java \
+    GenericTimeZoneNameProviderImpl.java \
     LocaleNameProviderImpl.java \
     CalendarDataProviderImpl.java \
     CalendarNameProviderImpl.java \
diff --git a/test/java/util/PluggableLocale/providersrc/java.util.spi.TimeZoneNameProvider b/test/java/util/PluggableLocale/providersrc/java.util.spi.TimeZoneNameProvider
index c435e04..a72cb41 100644
--- a/test/java/util/PluggableLocale/providersrc/java.util.spi.TimeZoneNameProvider
+++ b/test/java/util/PluggableLocale/providersrc/java.util.spi.TimeZoneNameProvider
@@ -5,3 +5,4 @@
 # implementation class
 #
 com.bar.TimeZoneNameProviderImpl
+com.bar.GenericTimeZoneNameProviderImpl
diff --git a/test/java/util/ResourceBundle/Bug6299235Test.sh b/test/java/util/ResourceBundle/Bug6299235Test.sh
index ef17b41..8bcb74f 100644
--- a/test/java/util/ResourceBundle/Bug6299235Test.sh
+++ b/test/java/util/ResourceBundle/Bug6299235Test.sh
@@ -75,7 +75,7 @@
 
 cd ${TESTSRC}
 
-${TESTJAVA}/bin/java -cp ${TESTCLASSES} -Djava.ext.dirs=${NEW_EXT_DIR} Bug6299235Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} -cp ${TESTCLASSES} -Djava.ext.dirs=${NEW_EXT_DIR} Bug6299235Test
 
 if [ $? -ne 0 ]
     then
diff --git a/test/java/util/ResourceBundle/Control/MissingResourceCauseTest.sh b/test/java/util/ResourceBundle/Control/MissingResourceCauseTest.sh
index 7bb7732..d23ada5 100644
--- a/test/java/util/ResourceBundle/Control/MissingResourceCauseTest.sh
+++ b/test/java/util/ResourceBundle/Control/MissingResourceCauseTest.sh
@@ -50,7 +50,7 @@
 : ${TESTCLASS:=.}
 : ${TESTSRC:=.}
 
-${TESTJAVA}/bin/java -esa -cp ${TESTCLASS}${DEL}${TESTSRC} MissingResourceCauseTest
+${TESTJAVA}/bin/java ${TESTVMOPTS} -esa -cp ${TESTCLASS}${DEL}${TESTSRC} MissingResourceCauseTest
 STATUS=$?
 chmod 666 $UNREADABLE
 rm -f $UNREADABLE
diff --git a/test/java/util/ServiceLoader/basic.sh b/test/java/util/ServiceLoader/basic.sh
index 259b2e1..72d68fa 100644
--- a/test/java/util/ServiceLoader/basic.sh
+++ b/test/java/util/ServiceLoader/basic.sh
@@ -94,7 +94,7 @@
   cp="$1"; shift
   if [ -z "$cp" ]; then cp="$TESTCLASSES"; else cp="$TESTCLASSES$SEP$cp"; fi
   vmargs="$1"; shift
-  sh -xc "'$JAVA' -cp $cp $vmargs $T $*" 2>&1
+  sh -xc "'$JAVA' ${TESTVMOPTS} -cp $cp $vmargs $T $*" 2>&1
   if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 }
 
diff --git a/test/java/util/TimeZone/OldIDMappingTest.sh b/test/java/util/TimeZone/OldIDMappingTest.sh
index 0f776e4..f7d67ba 100644
--- a/test/java/util/TimeZone/OldIDMappingTest.sh
+++ b/test/java/util/TimeZone/OldIDMappingTest.sh
@@ -40,7 +40,7 @@
     if [ x"$I" != x ]; then
 	D="-Dsun.timezone.ids.oldmapping=${I}"
     fi
-    if ! ${JAVA} ${D} -cp ${TESTCLASSES} OldIDMappingTest -new; then
+    if ! ${JAVA} ${D} ${TESTVMOPTS} -cp ${TESTCLASSES} OldIDMappingTest -new; then
 	STATUS=1
     fi
 done
@@ -51,7 +51,7 @@
     if [ "x$I" != x ]; then
 	D="-Dsun.timezone.ids.oldmapping=${I}"
     fi
-    if ! ${JAVA} ${D} -cp ${TESTCLASSES} OldIDMappingTest -old; then
+    if ! ${JAVA} ${D} ${TESTVMOPTS} -cp ${TESTCLASSES} OldIDMappingTest -old; then
 	STATUS=1
     fi
 done
diff --git a/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh b/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh
index 226228f..4a295ce 100644
--- a/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh
+++ b/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh
@@ -53,6 +53,6 @@
 # run it with the security manager on, plus accesscontroller debugging
 # will go into infinite recursion trying to get enough permissions for
 # printing Date of failing certificate unless fix is applied.
-${TESTJAVA}/bin/java -Djava.security.manager \
+${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.security.manager \
   -Djava.security.debug=access,failure,policy \
   -cp ${TESTCLASSES}/timezonedatetest.jar TimeZoneDatePermissionCheck
diff --git a/test/java/util/concurrent/FutureTask/DoneTimedGetLoops.java b/test/java/util/concurrent/FutureTask/DoneTimedGetLoops.java
index c1b81c2..c96c43b 100644
--- a/test/java/util/concurrent/FutureTask/DoneTimedGetLoops.java
+++ b/test/java/util/concurrent/FutureTask/DoneTimedGetLoops.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/java/util/logging/CheckLockLocationTest.java b/test/java/util/logging/CheckLockLocationTest.java
index 0eb98c0..956621a 100644
--- a/test/java/util/logging/CheckLockLocationTest.java
+++ b/test/java/util/logging/CheckLockLocationTest.java
@@ -30,7 +30,6 @@
  * @run  main/othervm CheckLockLocationTest
  */
 import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.nio.file.AccessDeniedException;
 import java.nio.file.FileSystemException;
@@ -42,17 +41,22 @@
     private static final String NOT_A_DIR = "not-a-dir";
     private static final String WRITABLE_DIR = "writable-dir";
     private static final String NON_EXISTENT_DIR = "non-existent-dir";
+    private static boolean runNonWritableDirTest;
 
     public static void main(String... args) throws IOException {
         // we'll base all file creation attempts on the system temp directory,
         // %t and also try specifying non-existent directories and plain files
         // that should be directories, and non-writable directories,
         // to exercise all code paths of checking the lock location
+        // Note that on platforms like Windows that don't support
+        // setWritable() on a directory, we'll skip the non-writable
+        // directory test if setWritable(false) returns false.
+        //
         File writableDir = setup();
         // we now have three files/directories to work with:
         //    writableDir
         //    notAdir
-        //    nonWritableDir
+        //    nonWritableDir (may not be possible on some platforms)
         //    nonExistentDir (which doesn't exist)
         runTests(writableDir);
     }
@@ -79,15 +83,18 @@
         }
 
         // Test 2: creating FileHandler in non-writable directory should fail
-        try {
-            new FileHandler("%t/" + NON_WRITABLE_DIR + "/log.log");
-            throw new RuntimeException("Test failed: should not have been able"
-                    + " to create FileHandler for " + "%t/" + NON_WRITABLE_DIR
-                    + "/log.log in non-writable directory.");
-        } catch (IOException ex) {
-            // check for the right exception
-            if (!(ex instanceof AccessDeniedException)) {
-                throw new RuntimeException("Test failed: Expected exception was not an AccessDeniedException", ex);
+        if (runNonWritableDirTest) {
+            try {
+                new FileHandler("%t/" + NON_WRITABLE_DIR + "/log.log");
+                throw new RuntimeException("Test failed: should not have been able"
+                        + " to create FileHandler for " + "%t/" + NON_WRITABLE_DIR
+                        + "/log.log in non-writable directory.");
+            } catch (AccessDeniedException ex) {
+                // the right exception was thrown, so continue.
+            } catch (IOException ex) {
+                throw new RuntimeException(
+                        "Test failed: Expected exception was not an "
+                                + "AccessDeniedException", ex);
             }
         }
 
@@ -97,11 +104,11 @@
             throw new RuntimeException("Test failed: should not have been able"
                     + " to create FileHandler for " + "%t/" + NOT_A_DIR
                     + "/log.log in non-directory.");
+        } catch (FileSystemException ex) {
+            // the right exception was thrown, so continue.
         } catch (IOException ex) {
-            // check for the right exception
-            if (!(ex instanceof FileSystemException && ex.getMessage().contains("Not a directory"))) {
-                throw new RuntimeException("Test failed: Expected exception was not a FileSystemException", ex);
-            }
+            throw new RuntimeException("Test failed: exception thrown was not a "
+                    + "FileSystemException", ex);
         }
 
         // Test 4: make sure we can't create a FileHandler in a non-existent dir
@@ -110,11 +117,11 @@
             throw new RuntimeException("Test failed: should not have been able"
                     + " to create FileHandler for " + "%t/" + NON_EXISTENT_DIR
                     + "/log.log in a non-existent directory.");
+        } catch (NoSuchFileException ex) {
+            // the right exception was thrown, so continue.
         } catch (IOException ex) {
-            // check for the right exception
-            if (!(ex instanceof NoSuchFileException)) {
-                throw new RuntimeException("Test failed: Expected exception was not a NoSuchFileException", ex);
-            }
+            throw new RuntimeException("Test failed: Expected exception "
+                    + "was not a NoSuchFileException", ex);
         }
     }
 
@@ -162,10 +169,14 @@
         nonWritableDir.deleteOnExit();
 
         // make it non-writable
-        if (!nonWritableDir.setWritable(false)) {
-            throw new RuntimeException("Test setup failed: unable to make"
+        if (nonWritableDir.setWritable(false)) {
+            runNonWritableDirTest = true;
+        } else {
+            runNonWritableDirTest = false;
+            System.out.println( "Test Setup WARNING: unable to make"
                     + " working directory " + nonWritableDir.getAbsolutePath()
-                    + " non-writable.");
+                    + " non-writable on platform " + System.getProperty("os.name"));
+
         }
 
         // make sure non-existent directory really doesn't exist
@@ -199,12 +210,14 @@
     /*
      * Recursively delete all files starting at specified file
      */
-    private static void delete(File f) throws IOException {
+    private static void delete(File f) {
         if (f != null && f.isDirectory()) {
             for (File c : f.listFiles())
                 delete(c);
         }
         if (!f.delete())
-            throw new FileNotFoundException("Failed to delete file: " + f);
-    }
+            System.err.println(
+                    "WARNING: unable to delete/cleanup writable test directory: "
+                    + f );
+        }
 }
diff --git a/test/java/util/logging/LoggerResourceBundleRace.java b/test/java/util/logging/LoggerResourceBundleRace.java
index e159a2d..aabbc14 100644
--- a/test/java/util/logging/LoggerResourceBundleRace.java
+++ b/test/java/util/logging/LoggerResourceBundleRace.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
diff --git a/test/java/util/logging/LoggingDeadlock2.java b/test/java/util/logging/LoggingDeadlock2.java
index 8c83ae9..de328e7 100644
--- a/test/java/util/logging/LoggingDeadlock2.java
+++ b/test/java/util/logging/LoggingDeadlock2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
diff --git a/test/java/util/logging/LoggingDeadlock3.java b/test/java/util/logging/LoggingDeadlock3.java
index 73162d5..4bbb3d3 100644
--- a/test/java/util/logging/LoggingDeadlock3.java
+++ b/test/java/util/logging/LoggingDeadlock3.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
diff --git a/test/java/util/logging/SimpleFormatterFormat.java b/test/java/util/logging/SimpleFormatterFormat.java
index 4fafba3..a041c0d 100644
--- a/test/java/util/logging/SimpleFormatterFormat.java
+++ b/test/java/util/logging/SimpleFormatterFormat.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
diff --git a/test/java/util/prefs/CheckUserPrefsStorage.sh b/test/java/util/prefs/CheckUserPrefsStorage.sh
index 5314b12..2821069 100644
--- a/test/java/util/prefs/CheckUserPrefsStorage.sh
+++ b/test/java/util/prefs/CheckUserPrefsStorage.sh
@@ -50,14 +50,14 @@
 esac
 
 # run CheckUserPrefFirst - creates and stores a user pref
-${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} -Djava.util.prefs.userRoot=. CheckUserPrefFirst
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp ${TESTCLASSES} -Djava.util.prefs.userRoot=. CheckUserPrefFirst
 result=$?
 if [ "$result" -ne "0" ]; then
     exit 1
 fi
 
 # run CheckUserPrefLater - Looks for the stored pref
-${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} -Djava.util.prefs.userRoot=. CheckUserPrefLater
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp ${TESTCLASSES} -Djava.util.prefs.userRoot=. CheckUserPrefLater
 result=$?
 if [ "$result" -ne "0" ]; then
     exit 1
diff --git a/test/java/util/prefs/PrefsSpi.sh b/test/java/util/prefs/PrefsSpi.sh
index b140b30..877522e 100644
--- a/test/java/util/prefs/PrefsSpi.sh
+++ b/test/java/util/prefs/PrefsSpi.sh
@@ -87,17 +87,17 @@
 
 case "`uname`" in Windows*|CYGWIN* ) CPS=';';; *) CPS=':';; esac
 
-Sys "$java" "-cp" "$TESTCLASSES${CPS}extDir/PrefsSpi.jar" \
+Sys "$java" "${TESTVMOPTS}" "-cp" "$TESTCLASSES${CPS}extDir/PrefsSpi.jar" \
     -Djava.util.prefs.PreferencesFactory=StubPreferencesFactory \
     -Djava.util.prefs.userRoot=. \
     PrefsSpi "StubPreferences"
-Sys "$java" "-cp" "$TESTCLASSES" \
+Sys "$java" "${TESTVMOPTS}" "-cp" "$TESTCLASSES" \
     -Djava.util.prefs.userRoot=. \
     PrefsSpi "java.util.prefs.*"
-Sys "$java" "-cp" "$TESTCLASSES${CPS}extDir/PrefsSpi.jar" \
+Sys "$java" "${TESTVMOPTS}" "-cp" "$TESTCLASSES${CPS}extDir/PrefsSpi.jar" \
     -Djava.util.prefs.userRoot=. \
     PrefsSpi "StubPreferences"
-Sys "$java" "-cp" "$TESTCLASSES" "-Djava.ext.dirs=extDir" \
+Sys "$java" "${TESTVMOPTS}" "-cp" "$TESTCLASSES" "-Djava.ext.dirs=extDir" \
     -Djava.util.prefs.userRoot=. \
     PrefsSpi "StubPreferences"
 
diff --git a/test/java/util/spi/ResourceBundleControlProvider/UserDefaultControlTest.sh b/test/java/util/spi/ResourceBundleControlProvider/UserDefaultControlTest.sh
index c6b9123..5381426 100644
--- a/test/java/util/spi/ResourceBundleControlProvider/UserDefaultControlTest.sh
+++ b/test/java/util/spi/ResourceBundleControlProvider/UserDefaultControlTest.sh
@@ -21,4 +21,5 @@
 # questions.
 #
 
-${TESTJAVA}/bin/java -Djava.ext.dirs=${TESTSRC} -cp ${TESTCLASSES} UserDefaultControlTest
\ No newline at end of file
+${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.ext.dirs=${TESTSRC} -cp ${TESTCLASSES} UserDefaultControlTest
+
diff --git a/test/java/util/spi/ResourceBundleControlProvider/providersrc/XmlRB.xml b/test/java/util/spi/ResourceBundleControlProvider/providersrc/XmlRB.xml
index ef00b64..689df75 100644
--- a/test/java/util/spi/ResourceBundleControlProvider/providersrc/XmlRB.xml
+++ b/test/java/util/spi/ResourceBundleControlProvider/providersrc/XmlRB.xml
@@ -5,13 +5,13 @@
  
  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
+ 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
+ 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).
  
diff --git a/test/java/util/spi/ResourceBundleControlProvider/providersrc/XmlRB_ja.xml b/test/java/util/spi/ResourceBundleControlProvider/providersrc/XmlRB_ja.xml
index 08b55b2..fb273f5 100644
--- a/test/java/util/spi/ResourceBundleControlProvider/providersrc/XmlRB_ja.xml
+++ b/test/java/util/spi/ResourceBundleControlProvider/providersrc/XmlRB_ja.xml
@@ -5,13 +5,13 @@
  
  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
+ 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
+ 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).
  
diff --git a/test/java/util/zip/3GBZipFiles.sh b/test/java/util/zip/3GBZipFiles.sh
index 9caf109..65db4e2 100644
--- a/test/java/util/zip/3GBZipFiles.sh
+++ b/test/java/util/zip/3GBZipFiles.sh
@@ -1,4 +1,3 @@
-#
 # Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
@@ -83,7 +82,7 @@
     huge-*) filesize_="$hugeSize" ;;
     tiny-*) filesize_="$tinySize" ;;
   esac
-  sys "$JAVA" "-cp" "$TESTCLASSES" "FileBuilder" \
+  sys "$JAVA" ${TESTVMOPTS} "-cp" "$TESTCLASSES" "FileBuilder" \
    "$filetype_" "$filename_" "$filesize_"
 }
 
diff --git a/test/java/util/zip/ZipFile/deletetempjar.sh b/test/java/util/zip/ZipFile/deletetempjar.sh
index afa47fe..bad1a0f 100644
--- a/test/java/util/zip/ZipFile/deletetempjar.sh
+++ b/test/java/util/zip/ZipFile/deletetempjar.sh
@@ -30,7 +30,7 @@
   TESTCLASSES=.
 fi
 
-tmpfile=`$TESTJAVA/bin/java -classpath $TESTCLASSES DeleteTempJar`
+tmpfile=`$TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES DeleteTempJar`
 rc=$?
 if [ $rc != 0 ]; then
     echo Unexpected failure with exit status $rc
diff --git a/test/javax/crypto/SecretKeyFactory/FailOverTest.sh b/test/javax/crypto/SecretKeyFactory/FailOverTest.sh
index b23e2bd..ab8bb0e 100644
--- a/test/javax/crypto/SecretKeyFactory/FailOverTest.sh
+++ b/test/javax/crypto/SecretKeyFactory/FailOverTest.sh
@@ -82,6 +82,7 @@
 fi
 
 ${TESTJAVA}${FS}bin${FS}java \
+    ${TESTVMOPTS} \
     -classpath "${TESTSRC}${FS}P1.jar${PS}${TESTSRC}${FS}P2.jar${PS}." \
     FailOverTest
 result=$?
diff --git a/test/javax/print/applet/AppletPrintLookup.sh b/test/javax/print/applet/AppletPrintLookup.sh
index c49b9f0..06afe6f 100644
--- a/test/javax/print/applet/AppletPrintLookup.sh
+++ b/test/javax/print/applet/AppletPrintLookup.sh
@@ -82,7 +82,7 @@
 ${TESTJAVA}${SEP}bin${SEP}appletviewer ${TESTCLASSES}${SEP}AppletPrintLookup.html &
 
 cd  ${TESTCLASSES} 
-${TESTJAVA}${SEP}bin${SEP}java YesNo
+${TESTJAVA}${SEP}bin${SEP}java ${TESTVMOPTS} YesNo
  if [ $? -ne 0 ]
     then
       echo "Test fails!"
diff --git a/test/javax/rmi/ssl/SocketFactoryTest.java b/test/javax/rmi/ssl/SocketFactoryTest.java
index cf88fd7..76bf51a 100644
--- a/test/javax/rmi/ssl/SocketFactoryTest.java
+++ b/test/javax/rmi/ssl/SocketFactoryTest.java
@@ -26,8 +26,7 @@
  * @bug 4932837 6582235
  * @summary Test SslRMI[Client|Server]SocketFactory equals() and hashCode().
  * @author Daniel Fuchs
- * @run clean SocketFactoryTest
- * @run build SocketFactoryTest
+ *
  * @run main SocketFactoryTest
  */
 
diff --git a/test/javax/script/ProviderTest.sh b/test/javax/script/ProviderTest.sh
index 5221d00..c39a933 100644
--- a/test/javax/script/ProviderTest.sh
+++ b/test/javax/script/ProviderTest.sh
@@ -45,6 +45,6 @@
 
 echo "Running test ..."
 
-$JAVA -classpath \
+$JAVA ${TESTVMOPTS} -classpath \
   "${TESTCLASSES}${PS}${TESTCLASSES}/dummy.jar" \
   ProviderTest
diff --git a/test/javax/security/auth/Subject/doAs/Test.sh b/test/javax/security/auth/Subject/doAs/Test.sh
index cbf94e0..65ef453 100644
--- a/test/javax/security/auth/Subject/doAs/Test.sh
+++ b/test/javax/security/auth/Subject/doAs/Test.sh
@@ -71,7 +71,7 @@
 cd ${TESTSRC}${FS}
 cd $WD
 echo $WD
-${TESTJAVA}${FS}bin${FS}java -classpath "${TESTCLASSES}${FS}" \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath "${TESTCLASSES}${FS}" \
 -Djava.security.manager  \
 -Djava.security.policy=${TESTSRC}${FS}policy \
 Test
diff --git a/test/javax/swing/JComponent/7154030/bug7154030.java b/test/javax/swing/JComponent/7154030/bug7154030.java
index 5000743..ade8280 100644
--- a/test/javax/swing/JComponent/7154030/bug7154030.java
+++ b/test/javax/swing/JComponent/7154030/bug7154030.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/javax/swing/JInternalFrame/5066752/bug5066752.java b/test/javax/swing/JInternalFrame/5066752/bug5066752.java
new file mode 100644
index 0000000..09a8a7b
--- /dev/null
+++ b/test/javax/swing/JInternalFrame/5066752/bug5066752.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+  @test
+  @bug 5066752
+  @summary  Transparent JDesktopPane impossible because isOpaque() returns true
+  @author mb50250: area=JDesktopPane
+  @library ../../regtesthelpers
+  @build Util
+  @run main bug5066752
+*/
+
+import java.awt.*;
+import javax.swing.*;
+import sun.awt.*;
+
+public class bug5066752
+{
+    private static JFrame frame;
+
+    public static void main(String[] args) throws Exception {
+        SunToolkit tk = (SunToolkit)Toolkit.getDefaultToolkit();
+        Robot r = new Robot();
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                createAndShowGUI();
+            }
+        });
+        tk.realSync();
+
+        r.delay(600);
+
+        Point p = Util.getCenterPoint(frame);
+        Color color =  r.getPixelColor((int) p.getX(), (int) p.getY());
+        if (!color.equals(Color.RED)) {
+            throw new Exception("Test failed: JDesktopPane isn't transparent. Expected color is (red color): " + Color.RED + ", actual color is: " + color);
+        }
+    }
+
+    private static void createAndShowGUI() {
+        frame = new JFrame();
+
+        frame.setLayout(new BorderLayout());
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+
+        JPanel panel = new JPanel();
+        panel.setLayout(new BorderLayout());
+        panel.setBackground(Color.RED);
+        frame.add(panel, BorderLayout.CENTER);
+
+        JDesktopPane dp = new JDesktopPane();
+        dp.setOpaque(false);
+        panel.add(dp, BorderLayout.CENTER);
+
+        frame.setBounds(200, 200, 300, 200);
+        frame.setVisible(true);
+    }
+}
diff --git a/test/javax/swing/JTabbedPane/4310381/bug4310381.java b/test/javax/swing/JTabbedPane/4310381/bug4310381.java
index aa57020..ccc3bc0 100644
--- a/test/javax/swing/JTabbedPane/4310381/bug4310381.java
+++ b/test/javax/swing/JTabbedPane/4310381/bug4310381.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/javax/swing/JTable/4235420/bug4235420.java b/test/javax/swing/JTable/4235420/bug4235420.java
index 388bb07..dafd5ca 100644
--- a/test/javax/swing/JTable/4235420/bug4235420.java
+++ b/test/javax/swing/JTable/4235420/bug4235420.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/javax/swing/JTable/6788484/bug6788484.java b/test/javax/swing/JTable/6788484/bug6788484.java
index 392bc94..cf7c65b 100644
--- a/test/javax/swing/JTable/6788484/bug6788484.java
+++ b/test/javax/swing/JTable/6788484/bug6788484.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/test/javax/swing/JTable/7055065/bug7055065.java b/test/javax/swing/JTable/7055065/bug7055065.java
index 119d9a5..0e611e4 100644
--- a/test/javax/swing/JTable/7055065/bug7055065.java
+++ b/test/javax/swing/JTable/7055065/bug7055065.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/javax/swing/JTable/7188612/JTableAccessibleGetLocationOnScreen.java b/test/javax/swing/JTable/7188612/JTableAccessibleGetLocationOnScreen.java
index 51ea977..da9262f 100644
--- a/test/javax/swing/JTable/7188612/JTableAccessibleGetLocationOnScreen.java
+++ b/test/javax/swing/JTable/7188612/JTableAccessibleGetLocationOnScreen.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/javax/swing/JTextArea/7049024/bug7049024.java b/test/javax/swing/JTextArea/7049024/bug7049024.java
index e6398b2..ce9797a 100644
--- a/test/javax/swing/JTextArea/7049024/bug7049024.java
+++ b/test/javax/swing/JTextArea/7049024/bug7049024.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/test/javax/swing/RepaintManager/IconifyTest/IconifyTest.java b/test/javax/swing/RepaintManager/IconifyTest/IconifyTest.java
new file mode 100644
index 0000000..cbe6d22
--- /dev/null
+++ b/test/javax/swing/RepaintManager/IconifyTest/IconifyTest.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ * @test
+ * @bug 4665214
+ * @summary Makes sure that RepaintManager doesn't attempt to repaint
+ *          a frame when it is iconified.
+ * @author Scott Violet
+ * @run main IconifyTest
+ */
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+import sun.awt.*;
+
+public class IconifyTest {
+    private static volatile boolean windowIconifiedIsCalled = false;
+    private static volatile boolean frameIsRepainted = false;
+    static JFrame frame;
+    static JButton button;
+
+    public static void main(String[] args) throws Throwable {
+        SunToolkit toolkit = (SunToolkit) SunToolkit.getDefaultToolkit();
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame = new JFrame();
+                button = new JButton("HI");
+                frame.getContentPane().add(button);
+                frame.addWindowListener(new WindowAdapter() {
+                    public void windowIconified(WindowEvent e) {
+                        windowIconifiedIsCalled = true;
+                        RepaintManager rm = RepaintManager.currentManager(null);
+                        rm.paintDirtyRegions();
+                        button.repaint();
+                        if (!rm.getDirtyRegion(button).isEmpty()) {
+                            frameIsRepainted = true;
+                        }
+                    }
+                });
+                frame.pack();
+                frame.setVisible(true);
+            }
+        });
+        toolkit.realSync();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame.setExtendedState(Frame.ICONIFIED);
+            }
+        });
+        toolkit.realSync();
+
+        if (!windowIconifiedIsCalled) {
+            throw new Exception("Test failed: window was not iconified.");
+        }
+        if (frameIsRepainted) {
+            throw new Exception("Test failed: frame was repainted when window was iconified.");
+        }
+    }
+}
diff --git a/test/javax/swing/border/Test7022041.java b/test/javax/swing/border/Test7022041.java
index cccd90e..1a8b12c 100644
--- a/test/javax/swing/border/Test7022041.java
+++ b/test/javax/swing/border/Test7022041.java
@@ -1,11 +1,12 @@
 /*
- * Copyright 2012 Red Hat, Inc. All Rights Reserved.
  * Copyright (c) 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.
+ * 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
@@ -16,6 +17,10 @@
  * You should have received a copy of the GNU General Public License version
  * 2 along with this work; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
  */
 
 import java.awt.Color;
diff --git a/test/javax/swing/text/DefaultCaret/6938583/bug6938583.java b/test/javax/swing/text/DefaultCaret/6938583/bug6938583.java
index c5c4871..d7dc176 100644
--- a/test/javax/swing/text/DefaultCaret/6938583/bug6938583.java
+++ b/test/javax/swing/text/DefaultCaret/6938583/bug6938583.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/test/lib/security/java.policy/Ext_AllPolicy.sh b/test/lib/security/java.policy/Ext_AllPolicy.sh
index e418406..3efcce9 100644
--- a/test/lib/security/java.policy/Ext_AllPolicy.sh
+++ b/test/lib/security/java.policy/Ext_AllPolicy.sh
@@ -77,7 +77,7 @@
 ${TESTJAVA}${FS}bin${FS}jar -cvf Ext_AllPolicy.jar Ext_AllPolicy.class
 
 rm Ext_AllPolicy.class
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
         -Djava.security.manager -Djava.ext.dirs="${TESTCLASSES}" Ext_AllPolicy
 
 exit $?
diff --git a/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh b/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh
index c4b4756..558ac9c 100644
--- a/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh
+++ b/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh
@@ -41,4 +41,4 @@
 JAVA="${TESTJAVA}/bin/java"
 CP=${TESTJAVA}${FS}lib${FS}tools.jar${PS}${TESTCLASSES}
 
-${JAVA} -classpath ${CP} MonitorVmStartTerminate
+${JAVA} ${TESTVMOPTS} -classpath ${CP} MonitorVmStartTerminate
diff --git a/test/sun/management/AgentCMETest.java b/test/sun/management/AgentCMETest.java
index f8bfd53..fa47696 100644
--- a/test/sun/management/AgentCMETest.java
+++ b/test/sun/management/AgentCMETest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.sh b/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.sh
index 0cc4afa..8622fba 100644
--- a/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.sh
+++ b/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.sh
@@ -150,7 +150,7 @@
 done
 
 # Start the manager - this should connect to VM
-${TESTJAVA}/bin/java -classpath ${TESTCLASSES}:${TESTJAVA}/lib/tools.jar \
+${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTCLASSES}:${TESTJAVA}/lib/tools.jar \
   TestManager $pid $port true
 if [ $? != 0 ]; then 
     echo "Test failed"
diff --git a/test/sun/management/jmxremote/bootstrap/LocalManagementTest.sh b/test/sun/management/jmxremote/bootstrap/LocalManagementTest.sh
index 426e5d4..7338cbe 100644
--- a/test/sun/management/jmxremote/bootstrap/LocalManagementTest.sh
+++ b/test/sun/management/jmxremote/bootstrap/LocalManagementTest.sh
@@ -43,8 +43,8 @@
     rm -f ${outputfile}
 
     # Start VM with given options
-    echo "+ $JAVA $1 Test"
-    $JAVA $1 TestApplication > ${outputfile}&
+    echo "+ $JAVA ${TESTVMOPTS} $1 Test"
+    $JAVA ${TESTVMOPTS} $1 TestApplication > ${outputfile}&
     pid=$!
  
     # Wait for managed VM to startup
@@ -64,7 +64,7 @@
     done
 
     # Start the manager - this should connect to VM
-    sh -xc "$JAVA -classpath ${TESTCLASSES}:${TESTJAVA}/lib/tools.jar \
+    sh -xc "$JAVA ${TESTVMOPTS} -classpath ${TESTCLASSES}:${TESTJAVA}/lib/tools.jar \
         TestManager $pid $port"  2>&1
     if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 }
@@ -112,7 +112,7 @@
 
 # Test 4 - sanity check arguments to management-agent.jar
 echo ' '
-sh -xc "${JAVA} -javaagent:${AGENT}=com.sun.management.jmxremote.port=7775,\
+sh -xc "${JAVA} ${TESTVMOPTS} -javaagent:${AGENT}=com.sun.management.jmxremote.port=7775,\
 com.sun.management.jmxremote.authenticate=false,com.sun.management.jmxremote.ssl=false \
   TestApplication -exit" 2>&1
 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
diff --git a/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh b/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh
index 700a2b1..dfc4a85 100644
--- a/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh
+++ b/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh
@@ -104,18 +104,18 @@
 
 go() {
     echo ''
-    sh -xc "$JAVA $1 $2 $3 $4 $5 $6 $7 $8" 2>&1
+    sh -xc "$JAVA ${TESTVMOPTS} $1 $2 $3 $4 $5 $6 $7 $8" 2>&1
     if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 }
 
 # Test 1 - password file is secure - VM should start
 chmod 700 ${PASSWD}
-sh -xc "$JAVA $mp $pp Null" 2>&1
+sh -xc "$JAVA ${TESTVMOPTS} $mp $pp Null" 2>&1
 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 
 # Test 2 - password file is not secure - VM should fail to start
 chmod o+rx ${PASSWD}
-sh -xc "$JAVA $mp $pp Null" 2>&1
+sh -xc "$JAVA ${TESTVMOPTS} $mp $pp Null" 2>&1
 if [ $? = 0 ]; then failures=`expr $failures + 1`; fi
 
 # Reset the file permissions on the generated password file
diff --git a/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh b/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh
index 46927ec..0fa7654 100644
--- a/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh
+++ b/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh
@@ -101,18 +101,18 @@
 
 go() {
     echo ''
-    sh -xc "$JAVA $1 $2 $3 $4 $5 $6 $7 $8" 2>&1
+    sh -xc "$JAVA ${TESTVMOPTS} $1 $2 $3 $4 $5 $6 $7 $8" 2>&1
     if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 }
 
 # Test 1 - SSL config file is secure - VM should start
 chmod 700 ${SSL}
-sh -xc "$JAVA $mp $pp Dummy" 2>&1
+sh -xc "$JAVA ${TESTVMOPTS} $mp $pp Dummy" 2>&1
 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 
 # Test 2 - SSL config file is not secure - VM should fail to start
 chmod o+rx ${SSL}
-sh -xc "$JAVA $mp $pp Dummy" 2>&1
+sh -xc "$JAVA ${TESTVMOPTS} $mp $pp Dummy" 2>&1
 if [ $? = 0 ]; then failures=`expr $failures + 1`; fi
 
 # Reset the file permissions on the generated SSL config file
diff --git a/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh b/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh
index f52146b..886ef2f 100644
--- a/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh
+++ b/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 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
@@ -61,7 +61,7 @@
 }
 
 _app_start(){
-  ${TESTJAVA}/bin/java -server $* -cp ${_testclasses} JMXStartStopDoSomething  >> ${_logname} 2>&1 &
+  ${TESTJAVA}/bin/java ${TESTVMOPTS} $* -cp ${_testclasses} JMXStartStopDoSomething  >> ${_logname} 2>&1 &
 
   npid=`_get_pid`
   if [ "${npid}" = "" ]
@@ -103,7 +103,7 @@
 }
 
 _testme(){
-  ${TESTJAVA}/bin/java -cp ${_testclasses} JMXStartStopTest $*
+  ${TESTJAVA}/bin/java ${TESTVMOPTS} -cp ${_testclasses} JMXStartStopTest $*
 }   
 
   
diff --git a/test/sun/misc/Cleaner/exitOnThrow.sh b/test/sun/misc/Cleaner/exitOnThrow.sh
index f6090cd..7506ce4 100644
--- a/test/sun/misc/Cleaner/exitOnThrow.sh
+++ b/test/sun/misc/Cleaner/exitOnThrow.sh
@@ -39,7 +39,7 @@
   TESTCLASSES=`pwd`
 fi
 
-if $TESTJAVA/bin/java -cp $TESTCLASSES ExitOnThrow; then
+if $TESTJAVA/bin/java ${TESTVMOPTS} -cp $TESTCLASSES ExitOnThrow; then
   echo Failed: VM exited normally
   exit 1
 else
diff --git a/test/sun/net/InetAddress/nameservice/dns/cname.sh b/test/sun/net/InetAddress/nameservice/dns/cname.sh
index 9587d6a..13c922a 100644
--- a/test/sun/net/InetAddress/nameservice/dns/cname.sh
+++ b/test/sun/net/InetAddress/nameservice/dns/cname.sh
@@ -42,7 +42,7 @@
 export CLASSPATH
 JAVA="${TESTJAVA}/bin/java"
 
-sh -xc "$JAVA CanonicalName $HOST" 2>&1
+sh -xc "$JAVA ${TESTVMOPTS} CanonicalName $HOST" 2>&1
 if [ $? != 0 ]; then
     echo "DNS not configured or host doesn't resolve to CNAME record"
     exit 0
@@ -52,7 +52,7 @@
 
 go() {
     echo ''
-    sh -xc "$JAVA $1 Lookup $2" 2>&1
+    sh -xc "$JAVA ${TESTVMOPTS} $1 Lookup $2" 2>&1
     if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
 }
 
diff --git a/test/sun/net/sdp/sanity.sh b/test/sun/net/sdp/sanity.sh
index 0de2709..88d80e0 100644
--- a/test/sun/net/sdp/sanity.sh
+++ b/test/sun/net/sdp/sanity.sh
@@ -57,7 +57,7 @@
 export CLASSPATH
 
 # Probe for IP addresses plumbed to IB interfaces
-$JAVA -Djava.net.preferIPv4Stack=true ProbeIB ${IB_LINKS} > ${IB_ADDRS}
+$JAVA ${TESTVMOPTS} -Djava.net.preferIPv4Stack=true ProbeIB ${IB_LINKS} > ${IB_ADDRS}
 
 # Create sdp.conf
 SDPCONF=sdp.conf
@@ -70,4 +70,4 @@
 done
 
 # Sanity check
-$JAVA -Djava.net.preferIPv4Stack=true -Dcom.sun.sdp.conf=${SDPCONF} -Dcom.sun.sdp.debug Sanity
+$JAVA ${TESTVMOPTS} -Djava.net.preferIPv4Stack=true -Dcom.sun.sdp.conf=${SDPCONF} -Dcom.sun.sdp.debug Sanity
diff --git a/test/sun/net/www/MarkResetTest.sh b/test/sun/net/www/MarkResetTest.sh
index c3eb53a..542bfe4 100644
--- a/test/sun/net/www/MarkResetTest.sh
+++ b/test/sun/net/www/MarkResetTest.sh
@@ -52,4 +52,4 @@
 # in this directory
 cp ${TESTSRC}${FS}EncDec.doc .
 
-${TESTJAVA}${FS}bin${FS}java MarkResetTest
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} MarkResetTest
diff --git a/test/sun/net/www/MessageHeaderTest.java b/test/sun/net/www/MessageHeaderTest.java
new file mode 100644
index 0000000..aceb635
--- /dev/null
+++ b/test/sun/net/www/MessageHeaderTest.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8003948
+ * @run main MessageHeaderTest
+ */
+import java.io.*;
+import sun.net.www.MessageHeader;
+
+public class MessageHeaderTest {
+    public static void main (String[] args) throws Exception {
+        for (int i=0; i<7; i++) {
+            ByteArrayInputStream bis = new ByteArrayInputStream(headers[i].getBytes());
+            MessageHeader h = new MessageHeader(bis);
+            String before = h.toString();
+            before = before.substring(before.indexOf('{'));
+            boolean result = h.filterNTLMResponses("WWW-Authenticate");
+            String after = h.toString();
+            after = after.substring(after.indexOf('{'));
+            if (!expected[i].equals(after)) {
+                throw new RuntimeException(Integer.toString(i) + " expected != after");
+            }
+            if (result != expectedResult[i]) {
+                throw new RuntimeException(Integer.toString(i) + " result != expectedResult");
+            }
+        }
+    }
+
+    static String expected[] = {
+        "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM sdsds}",
+        "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: }",
+        "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM sdsds}",
+        "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM sdsds}",
+        "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM sdsds}{Bar: foo}",
+        "{null: HTTP/1.1 200 Ok}{WWW-Authenticate: Negotiate}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM}{Bar: foo}{WWW-Authenticate: Kerberos}",
+        "{null: HTTP/1.1 200 Ok}{Foo: foo}{Bar: }{WWW-Authenticate: NTLM blob}{Bar: foo blob}"
+    };
+
+    static boolean[] expectedResult = {
+        false, false, true, true, true, false, false
+    };
+
+    static String[] headers = {
+        "HTTP/1.1 200 Ok\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate: NTLM sdsds",
+        "HTTP/1.1 200 Ok\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate:",
+        "HTTP/1.1 200 Ok\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate: NTLM sdsds\r\nWWW-Authenticate: Negotiate",
+        "HTTP/1.1 200 Ok\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate: NTLM sdsds\r\nWWW-Authenticate: Negotiate\r\nWWW-Authenticate: Kerberos",
+        "HTTP/1.1 200 Ok\r\nWWW-Authenticate: Negotiate\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate: NTLM sdsds\r\nBar: foo\r\nWWW-Authenticate: Kerberos",
+        "HTTP/1.1 200 Ok\r\nWWW-Authenticate: Negotiate\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate: NTLM\r\nBar: foo\r\nWWW-Authenticate: Kerberos",
+        "HTTP/1.1 200 Ok\r\nFoo: foo\r\nBar:\r\nWWW-Authenticate: NTLM blob\r\nBar: foo blob"
+    };
+}
diff --git a/test/sun/net/www/http/HttpClient/RetryPost.sh b/test/sun/net/www/http/HttpClient/RetryPost.sh
index 314a007..fc563c8 100644
--- a/test/sun/net/www/http/HttpClient/RetryPost.sh
+++ b/test/sun/net/www/http/HttpClient/RetryPost.sh
@@ -50,14 +50,14 @@
 ${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}RetryPost.java
 
 # run with no option specified. Should retry POST request.
-${TESTJAVA}${FS}bin${FS}java RetryPost
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} RetryPost
 result=$?
 if [ "$result" -ne "0" ]; then
     exit 1
 fi
 
 # run with option specified. Should not retry POST request.
-${TESTJAVA}${FS}bin${FS}java -Dsun.net.http.retryPost=false RetryPost noRetry
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dsun.net.http.retryPost=false RetryPost noRetry
 result=$?
 if [ "$result" -ne "0" ]; then
     exit 1
diff --git a/test/sun/net/www/protocol/file/DirPermissionDenied.sh b/test/sun/net/www/protocol/file/DirPermissionDenied.sh
index a85f4d5..7606b3d 100644
--- a/test/sun/net/www/protocol/file/DirPermissionDenied.sh
+++ b/test/sun/net/www/protocol/file/DirPermissionDenied.sh
@@ -35,7 +35,7 @@
 mkdir -p ${TESTDIR}
 chmod 333 ${TESTDIR}
 
-$TESTJAVA/bin/java -classpath $TESTCLASSES DirPermissionDenied ${TESTDIR}
+$TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES DirPermissionDenied ${TESTDIR}
 result=$?
 
 # Add back read access for user, otherwise not removable on some systems
diff --git a/test/sun/net/www/protocol/jar/B5105410.sh b/test/sun/net/www/protocol/jar/B5105410.sh
index 3dbce7f..1fdbdd5 100644
--- a/test/sun/net/www/protocol/jar/B5105410.sh
+++ b/test/sun/net/www/protocol/jar/B5105410.sh
@@ -51,5 +51,5 @@
 
 cp ${TESTSRC}${FS}foo2.jar .
 ${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}B5105410.java
-${TESTJAVA}${FS}bin${FS}java B5105410
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} B5105410
 
diff --git a/test/sun/net/www/protocol/jar/getcontenttype.sh b/test/sun/net/www/protocol/jar/getcontenttype.sh
index da3563d..a3a1a2a 100644
--- a/test/sun/net/www/protocol/jar/getcontenttype.sh
+++ b/test/sun/net/www/protocol/jar/getcontenttype.sh
@@ -33,5 +33,5 @@
 if [ x"$TESTSRC" = x ]; then TESTSRC=.; fi
 
 # now start the test
-${TESTJAVA}/bin/java -Djava.ext.dirs=$TESTSRC -cp $TESTCLASSES GetContentType
+${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.ext.dirs=$TESTSRC -cp $TESTCLASSES GetContentType
 
diff --git a/test/sun/net/www/protocol/jar/jarbug/run.sh b/test/sun/net/www/protocol/jar/jarbug/run.sh
index 31cfbe8..72a1168 100644
--- a/test/sun/net/www/protocol/jar/jarbug/run.sh
+++ b/test/sun/net/www/protocol/jar/jarbug/run.sh
@@ -71,7 +71,7 @@
 #
 ${TESTJAVA}${FS}bin${FS}javac -d ${DEST} ${TESTSRC}${FS}src${FS}test${FS}*.java
 cd ${DEST}
-${TESTJAVA}${FS}bin${FS}java RunAllTests
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} RunAllTests
 result=$?
 if [ "$result" -ne "0" ]; then
     exit 1
diff --git a/test/sun/nio/ch/SelProvider.java b/test/sun/nio/ch/SelProvider.java
index 1674120..259a098 100644
--- a/test/sun/nio/ch/SelProvider.java
+++ b/test/sun/nio/ch/SelProvider.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
diff --git a/test/sun/rmi/log/ReliableLog/LogAlignmentTest.java b/test/sun/rmi/log/ReliableLog/LogAlignmentTest.java
index 04d2fd9..012c0b8 100644
--- a/test/sun/rmi/log/ReliableLog/LogAlignmentTest.java
+++ b/test/sun/rmi/log/ReliableLog/LogAlignmentTest.java
@@ -22,8 +22,10 @@
  */
 
 /* @test
-   @bug 4094889
-   @summary rmid can have a corrupted log
+ * @bug 4094889
+ * @summary rmid can have a corrupted log
+ *
+ * @run main LogAlignmentTest
  */
 
 /* Fault: ReliableLog used RandomAccessFile.skipBytes() to seek past the end
diff --git a/test/sun/rmi/log/ReliableLog/SnapshotSize.java b/test/sun/rmi/log/ReliableLog/SnapshotSize.java
index f1febfc..592ef5e 100644
--- a/test/sun/rmi/log/ReliableLog/SnapshotSize.java
+++ b/test/sun/rmi/log/ReliableLog/SnapshotSize.java
@@ -25,6 +25,8 @@
  * @bug 4319866
  * @summary Verify that ReliableLog.snapshotSize() returns correct snapshot
  *          file size even if LogHandler doesn't flush.
+ *
+ * @run main SnapshotSize
  */
 
 import java.io.ByteArrayOutputStream;
diff --git a/test/sun/rmi/rmic/RMIGenerator/RmicDefault.java b/test/sun/rmi/rmic/RMIGenerator/RmicDefault.java
index ad24841..5f4587e 100644
--- a/test/sun/rmi/rmic/RMIGenerator/RmicDefault.java
+++ b/test/sun/rmi/rmic/RMIGenerator/RmicDefault.java
@@ -28,7 +28,6 @@
  * @library ../../../../java/rmi/testlibrary
  *
  * @build StreamPipe
- * @build RmicDefault
  * @run main RmicDefault
  */
 
diff --git a/test/sun/rmi/rmic/classpath/RMICClassPathTest.java b/test/sun/rmi/rmic/classpath/RMICClassPathTest.java
index a79d21b..f4c64b7 100644
--- a/test/sun/rmi/rmic/classpath/RMICClassPathTest.java
+++ b/test/sun/rmi/rmic/classpath/RMICClassPathTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/sun/rmi/rmic/manifestClassPath/run.sh b/test/sun/rmi/rmic/manifestClassPath/run.sh
index 4faf141..f20ab75 100644
--- a/test/sun/rmi/rmic/manifestClassPath/run.sh
+++ b/test/sun/rmi/rmic/manifestClassPath/run.sh
@@ -114,26 +114,26 @@
 
 Success "$javac" -classpath "jars/A.jar"       Main.java MainI.java
 Success "$rmic"  -classpath "jars/A.jar${PS}." Main
-Success "$java"  -classpath "jars/A.jar${PS}." Main
+Success "$java" ${TESTVMOPTS} -classpath "jars/A.jar${PS}." Main
 
 Sys rm -f Main.class MainI.class Main_Stub.class
 
 Success "$javac" -classpath "jars/sub/B.zip"       Main.java MainI.java
 Success "$rmic"  -classpath "jars/sub/B.zip${PS}." Main
-Success "$java"  -classpath "jars/sub/B.zip${PS}." Main
+Success "$java" ${TESTVMOPTS}  -classpath "jars/sub/B.zip${PS}." Main
 
 #Sys rm -f Main.class MainI.class Main_Stub.class
 Sys rm -f Main_Stub.class				# javac -extdirs workaround
 
 #Success "$javac" -extdirs "jars" -classpath None Main.java MainI.java
 Success "$rmic"  -extdirs "jars" -classpath .    Main
-Success "$java"  -Djava.ext.dirs="jars" -cp .    Main
+Success "$java" ${TESTVMOPTS}  -Djava.ext.dirs="jars" -cp .    Main
 
 Sys rm -f Main_Stub.class
 
 #Success "$javac" -extdirs "jars/sub" -classpath None Main.java MainI.java
 Success "$rmic"  -extdirs "jars/sub" -classpath . Main
-Success "$java"  -Djava.ext.dirs="jars/sub" -cp . Main
+Success "$java" ${TESTVMOPTS}  -Djava.ext.dirs="jars/sub" -cp . Main
 
 Cleanup
 
diff --git a/test/sun/rmi/rmic/minimizeWrapperInstances/run.sh b/test/sun/rmi/rmic/minimizeWrapperInstances/run.sh
index 204947d..3c8e831 100644
--- a/test/sun/rmi/rmic/minimizeWrapperInstances/run.sh
+++ b/test/sun/rmi/rmic/minimizeWrapperInstances/run.sh
@@ -41,13 +41,13 @@
 set -ex
 
 ${TESTJAVA}/bin/rmic -classpath ${TESTCLASSES:-.} -d ${TESTCLASSES:-.} PImpl
-${TESTJAVA}/bin/java -classpath ${TESTCLASSES:-.} Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTCLASSES:-.} Test
 
 ${TESTJAVA}/bin/rmic -classpath ${TESTCLASSES:-.} -d ${TESTCLASSES:-.} -vcompat PImpl
-${TESTJAVA}/bin/java -classpath ${TESTCLASSES:-.} Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTCLASSES:-.} Test
 
 ${TESTJAVA}/bin/rmic -Xnew -classpath ${TESTCLASSES:-.} -d ${TESTCLASSES:-.} PImpl
-${TESTJAVA}/bin/java -classpath ${TESTCLASSES:-.} Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTCLASSES:-.} Test
 
 ${TESTJAVA}/bin/rmic -Xnew -classpath ${TESTCLASSES:-.} -d ${TESTCLASSES:-.} -vcompat PImpl
-${TESTJAVA}/bin/java -classpath ${TESTCLASSES:-.} Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTCLASSES:-.} Test
diff --git a/test/sun/rmi/rmic/newrmic/equivalence/run.sh b/test/sun/rmi/rmic/newrmic/equivalence/run.sh
index 8d4f419..27c8604 100644
--- a/test/sun/rmi/rmic/newrmic/equivalence/run.sh
+++ b/test/sun/rmi/rmic/newrmic/equivalence/run.sh
@@ -26,22 +26,24 @@
 # @summary This test verifies that the new implementation of rmic
 # generates equivalent classes as the old implementation, for a set
 # of sample input classes.
-# @library ../../../../../java/rmi/testlibrary
-# @build TestLibrary
 # @author Peter Jones
 #
-# @build AgentServerImpl
-# @build AppleImpl
-# @build AppleUserImpl
-# @build ComputeServerImpl
-# @build CountServerImpl
-# @build DayTimeServerImpl
-# @build G1Impl
-# @build MyObjectImpl
-# @build NotActivatableServerImpl
-# @build OrangeEchoImpl
-# @build OrangeImpl
-# @build ServerImpl
+# @library ../../../../../java/rmi/testlibrary
+#
+# @build TestLibrary
+#     AgentServerImpl
+#     AppleImpl
+#     AppleUserImpl
+#     ComputeServerImpl
+#     CountServerImpl
+#     DayTimeServerImpl
+#     G1Impl
+#     MyObjectImpl
+#     NotActivatableServerImpl
+#     OrangeEchoImpl
+#     OrangeImpl
+#     ServerImpl
+#
 # @run shell run.sh
 
 if [ "${TESTJAVA}" = "" ]
diff --git a/test/sun/rmi/rmic/oldjavacRemoved/sunToolsJavacMain.sh b/test/sun/rmi/rmic/oldjavacRemoved/sunToolsJavacMain.sh
index fbb5581..11840fa 100644
--- a/test/sun/rmi/rmic/oldjavacRemoved/sunToolsJavacMain.sh
+++ b/test/sun/rmi/rmic/oldjavacRemoved/sunToolsJavacMain.sh
@@ -37,7 +37,7 @@
 
 set -x
 
-${TESTJAVA}/bin/java -classpath ${TESTJAVA}/lib/tools.jar sun.tools.javac.Main -d ${TESTCLASSES:-.} ${TESTSRC:-.}/Foo.java
+${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTJAVA}/lib/tools.jar sun.tools.javac.Main -d ${TESTCLASSES:-.} ${TESTSRC:-.}/Foo.java
 
 result=$?
 if [ $result -eq 0 ]
diff --git a/test/sun/rmi/runtime/Log/6409194/NoConsoleOutput.java b/test/sun/rmi/runtime/Log/6409194/NoConsoleOutput.java
index e5e19fe..afcc135 100644
--- a/test/sun/rmi/runtime/Log/6409194/NoConsoleOutput.java
+++ b/test/sun/rmi/runtime/Log/6409194/NoConsoleOutput.java
@@ -31,8 +31,7 @@
  * @author Peter Jones
  *
  * @library ../../../../../java/rmi/testlibrary
- * @build JavaVM
- * @build NoConsoleOutput
+ * @build TestLibrary JavaVM
  * @run main/othervm NoConsoleOutput
  */
 
diff --git a/test/sun/rmi/runtime/Log/checkLogging/CheckLogStreams.java b/test/sun/rmi/runtime/Log/checkLogging/CheckLogStreams.java
index 34cfc48..1e95953 100644
--- a/test/sun/rmi/runtime/Log/checkLogging/CheckLogStreams.java
+++ b/test/sun/rmi/runtime/Log/checkLogging/CheckLogStreams.java
@@ -28,11 +28,7 @@
  * @author Laird Dornin
  *
  * @library ../../../../../java/rmi/testlibrary
- * @build TestLibrary
- * @build TestParams
- * @build TestFailedException
- * @build CheckLogging
- * @build CheckLogStreams
+ * @build TestLibrary CheckLogging
  * @run main/othervm -Dsun.rmi.log.useOld=true CheckLogStreams
  */
 
diff --git a/test/sun/rmi/runtime/Log/checkLogging/CheckLogging.java b/test/sun/rmi/runtime/Log/checkLogging/CheckLogging.java
index 77c236d..347725a 100644
--- a/test/sun/rmi/runtime/Log/checkLogging/CheckLogging.java
+++ b/test/sun/rmi/runtime/Log/checkLogging/CheckLogging.java
@@ -29,9 +29,6 @@
  *
  * @library ../../../../../java/rmi/testlibrary
  * @build TestLibrary
- * @build TestParams
- * @build TestFailedException
- * @build CheckLogging
  * @run main/othervm CheckLogging
  */
 
diff --git a/test/sun/rmi/server/MarshalOutputStream/marshalForeignStub/MarshalForeignStub.java b/test/sun/rmi/server/MarshalOutputStream/marshalForeignStub/MarshalForeignStub.java
index 165dfbe..bf1eb11 100644
--- a/test/sun/rmi/server/MarshalOutputStream/marshalForeignStub/MarshalForeignStub.java
+++ b/test/sun/rmi/server/MarshalOutputStream/marshalForeignStub/MarshalForeignStub.java
@@ -31,11 +31,7 @@
  * @author Ann Wollrath
  *
  * @library ../../../../../java/rmi/testlibrary
- * @build TestLibrary
- * @build TestFailedException
- * @build MarshalForeignStub
- * @build Receiver
- * @build MarshalForeignStub_Stub
+ * @build TestLibrary Receiver MarshalForeignStub_Stub
  * @run main/othervm/policy=security.policy MarshalForeignStub
  */
 
diff --git a/test/sun/rmi/transport/proxy/EagerHttpFallback.java b/test/sun/rmi/transport/proxy/EagerHttpFallback.java
index 1f54e2c..3879c66 100644
--- a/test/sun/rmi/transport/proxy/EagerHttpFallback.java
+++ b/test/sun/rmi/transport/proxy/EagerHttpFallback.java
@@ -25,6 +25,7 @@
  * @bug 4290727
  * @summary Verify that ConnectException will trigger HTTP fallback if
  *          sun.rmi.transport.proxy.eagerHttpFallback system property is set.
+ *
  * @library ../../../../java/rmi/testlibrary
  * @build TestLibrary
  * @run main/othervm EagerHttpFallback
diff --git a/test/sun/rmi/transport/tcp/DeadCachedConnection.java b/test/sun/rmi/transport/tcp/DeadCachedConnection.java
index 1372b03..7bcd5a7 100644
--- a/test/sun/rmi/transport/tcp/DeadCachedConnection.java
+++ b/test/sun/rmi/transport/tcp/DeadCachedConnection.java
@@ -25,9 +25,7 @@
  * @bug 4094891
  * @summary unable to retry call if cached connection to server is used
  * @library ../../../../java/rmi/testlibrary
- * @build DeadCachedConnection
- * @build JavaVM
- * @build TestLibrary
+ * @build TestLibrary JavaVM
  * @run main/othervm DeadCachedConnection
  */
 
diff --git a/test/sun/rmi/transport/tcp/blockAccept/BlockAcceptTest.java b/test/sun/rmi/transport/tcp/blockAccept/BlockAcceptTest.java
index af41bf0..1624f68 100644
--- a/test/sun/rmi/transport/tcp/blockAccept/BlockAcceptTest.java
+++ b/test/sun/rmi/transport/tcp/blockAccept/BlockAcceptTest.java
@@ -27,11 +27,8 @@
  * @summary RMI blocks in HttpAwareServerSocket.accept() if you telnet to it
  * @author Adrian Colley
  *
- * @library ../../../../../java/rmi/testlibrary/
- * @build TestIface
- * @build TestImpl
- * @build TestImpl_Stub
- * @build BlockAcceptTest
+ * @library ../../../../../java/rmi/testlibrary
+ * @build TestIface TestImpl TestImpl_Stub
  * @run main/othervm/policy=security.policy/timeout=60 BlockAcceptTest
  */
 
diff --git a/test/sun/rmi/transport/tcp/disableMultiplexing/DisableMultiplexing.java b/test/sun/rmi/transport/tcp/disableMultiplexing/DisableMultiplexing.java
index 51dbeec..805c798 100644
--- a/test/sun/rmi/transport/tcp/disableMultiplexing/DisableMultiplexing.java
+++ b/test/sun/rmi/transport/tcp/disableMultiplexing/DisableMultiplexing.java
@@ -28,7 +28,6 @@
  * on that port, rather than engage in the deprecated "multiplexing protocol".
  * @author Peter Jones
  *
- * @build DisableMultiplexing
  * @build DisableMultiplexing_Stub
  * @run main/othervm DisableMultiplexing
  */
diff --git a/test/sun/security/krb5/auto/KeyPermissions.java b/test/sun/security/krb5/auto/KeyPermissions.java
new file mode 100644
index 0000000..78f0eaf
--- /dev/null
+++ b/test/sun/security/krb5/auto/KeyPermissions.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8004488
+ * @summary wrong permissions checked in krb5
+ * @compile -XDignore.symbol.file KeyPermissions.java
+ * @run main/othervm KeyPermissions
+ */
+
+import java.security.AccessControlException;
+import java.security.Permission;
+import javax.security.auth.PrivateCredentialPermission;
+import sun.security.jgss.GSSUtil;
+
+public class KeyPermissions extends SecurityManager {
+
+    @Override
+    public void checkPermission(Permission perm) {
+        if (perm instanceof PrivateCredentialPermission) {
+            if (!perm.getName().startsWith("javax.security.auth.kerberos.")) {
+                throw new AccessControlException(
+                        "I don't like this", perm);
+            }
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        System.setSecurityManager(new KeyPermissions());
+        new OneKDC(null).writeJAASConf();
+        Context s = Context.fromJAAS("server");
+        s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);
+    }
+}
+
diff --git a/test/sun/security/krb5/auto/KeyTabCompat.java b/test/sun/security/krb5/auto/KeyTabCompat.java
index f676351..87a3e7e 100644
--- a/test/sun/security/krb5/auto/KeyTabCompat.java
+++ b/test/sun/security/krb5/auto/KeyTabCompat.java
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 6894072
+ * @bug 8004488
  * @compile -XDignore.symbol.file KeyTabCompat.java
  * @run main/othervm KeyTabCompat
  * @summary always refresh keytab
@@ -70,21 +71,8 @@
         s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);
         s.status();
 
-        if (s.s().getPrivateCredentials(KerberosKey.class).size() != 1) {
-            throw new Exception("There should be one KerberosKey");
+        if (s.s().getPrivateCredentials(KerberosKey.class).size() != 0) {
+            throw new Exception("There should be no KerberosKey");
         }
-
-        Thread.sleep(2000);     // make sure ktab timestamp is different
-
-        kdc.addPrincipal(OneKDC.SERVER, "pass2".toCharArray());
-        kdc.writeKtab(OneKDC.KTAB);
-
-        Context.handshake(c, s);
-        s.status();
-
-        if (s.s().getPrivateCredentials(KerberosKey.class).size() != 1) {
-            throw new Exception("There should be only one KerberosKey");
-        }
-
     }
 }
diff --git a/test/sun/security/krb5/auto/ReplayCache.java b/test/sun/security/krb5/auto/ReplayCache.java
index 1f6411c..c29219a 100644
--- a/test/sun/security/krb5/auto/ReplayCache.java
+++ b/test/sun/security/krb5/auto/ReplayCache.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright (c) 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
@@ -16,9 +16,9 @@
  * 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
  */
 
 /*
diff --git a/test/sun/security/krb5/runNameEquals.sh b/test/sun/security/krb5/runNameEquals.sh
index 15096cc..1fea362 100644
--- a/test/sun/security/krb5/runNameEquals.sh
+++ b/test/sun/security/krb5/runNameEquals.sh
@@ -81,7 +81,7 @@
 
 if [ "${NATIVE}" = "true" ] ; then
     echo "Testing native provider"
-    ${TESTJAVA}${FILESEP}bin${FILESEP}java \
+    ${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \
         -classpath ${TESTCLASSES} \
         -Dsun.security.jgss.native=true \
         ${TEST}
@@ -92,7 +92,7 @@
 fi
 
 echo "Testing java provider"
-${TESTJAVA}${FILESEP}bin${FILESEP}java \
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \
         -classpath ${TESTCLASSES} \
         -Djava.security.krb5.realm=R \
         -Djava.security.krb5.kdc=127.0.0.1 \
diff --git a/test/sun/security/krb5/tools/ktcheck.sh b/test/sun/security/krb5/tools/ktcheck.sh
index 383de8f..b1b3743 100644
--- a/test/sun/security/krb5/tools/ktcheck.sh
+++ b/test/sun/security/krb5/tools/ktcheck.sh
@@ -58,7 +58,7 @@
 
 EXTRA_OPTIONS="-Djava.security.krb5.conf=${TESTSRC}${FS}onlythree.conf"
 KTAB="${TESTJAVA}${FS}bin${FS}ktab -J${EXTRA_OPTIONS} -k $KEYTAB -f"
-CHECK="${TESTJAVA}${FS}bin${FS}java ${EXTRA_OPTIONS} KtabCheck $KEYTAB"
+CHECK="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} ${EXTRA_OPTIONS} KtabCheck $KEYTAB"
 
 echo ${EXTRA_OPTIONS}
 
diff --git a/test/sun/security/mscapi/AccessKeyStore.sh b/test/sun/security/mscapi/AccessKeyStore.sh
index 6706aa3..0998de4 100644
--- a/test/sun/security/mscapi/AccessKeyStore.sh
+++ b/test/sun/security/mscapi/AccessKeyStore.sh
@@ -42,13 +42,13 @@
 	${TESTJAVA}/bin/javac -d . ${TESTSRC}\\AccessKeyStore.java
 
 	echo "Using access.policy..."
-	${TESTJAVA}/bin/java \
+	${TESTJAVA}/bin/java ${TESTVMOPTS} \
 	    -Djava.security.manager \
 	    -Djava.security.policy==${TESTSRC}\\access.policy \
 	    AccessKeyStore
 
 	echo "Using noaccess.policy..."
-	${TESTJAVA}/bin/java \
+	${TESTJAVA}/bin/java ${TESTVMOPTS} \
 	    -Djava.security.manager \
 	    -Djava.security.policy==${TESTSRC}\\noaccess.policy \
 	    AccessKeyStore -deny
diff --git a/test/sun/security/mscapi/IsSunMSCAPIAvailable.sh b/test/sun/security/mscapi/IsSunMSCAPIAvailable.sh
index 197ee37..77e258e 100644
--- a/test/sun/security/mscapi/IsSunMSCAPIAvailable.sh
+++ b/test/sun/security/mscapi/IsSunMSCAPIAvailable.sh
@@ -40,7 +40,7 @@
     #  execute test program - rely on it to exit if platform unsupported
 
 	${TESTJAVA}/bin/javac -d . ${TESTSRC}\\IsSunMSCAPIAvailable.java
-	${TESTJAVA}/bin/java IsSunMSCAPIAvailable
+	${TESTJAVA}/bin/java ${TESTVMOPTS} IsSunMSCAPIAvailable
 	exit
 	;;
 
diff --git a/test/sun/security/mscapi/KeyStoreCompatibilityMode.sh b/test/sun/security/mscapi/KeyStoreCompatibilityMode.sh
index ee0c6c3..b6ca139 100644
--- a/test/sun/security/mscapi/KeyStoreCompatibilityMode.sh
+++ b/test/sun/security/mscapi/KeyStoreCompatibilityMode.sh
@@ -43,15 +43,15 @@
 	${TESTJAVA}/bin/javac -d . ${TESTSRC}\\KeyStoreCompatibilityMode.java
 
     # mode implicitly enabled
-	${TESTJAVA}/bin/java KeyStoreCompatibilityMode
+	${TESTJAVA}/bin/java ${TESTVMOPTS} KeyStoreCompatibilityMode
 
     # mode explicitly enabled
-	${TESTJAVA}/bin/java \
+	${TESTJAVA}/bin/java ${TESTVMOPTS} \
 	    -Dsun.security.mscapi.keyStoreCompatibilityMode="true" \
 	    KeyStoreCompatibilityMode
 
     # mode explicitly disabled
-	${TESTJAVA}/bin/java \
+	${TESTJAVA}/bin/java ${TESTVMOPTS} \
 	    -Dsun.security.mscapi.keyStoreCompatibilityMode="false" \
 	    KeyStoreCompatibilityMode -disable
 
diff --git a/test/sun/security/mscapi/PublicKeyInterop.sh b/test/sun/security/mscapi/PublicKeyInterop.sh
index 1967e63..abdad4c 100644
--- a/test/sun/security/mscapi/PublicKeyInterop.sh
+++ b/test/sun/security/mscapi/PublicKeyInterop.sh
@@ -62,7 +62,7 @@
         echo
 	echo "Running the test..."
         ${TESTJAVA}/bin/javac -d . ${TESTSRC}\\PublicKeyInterop.java
-        ${TESTJAVA}/bin/java PublicKeyInterop
+        ${TESTJAVA}/bin/java ${TESTVMOPTS} PublicKeyInterop
 
         rc=$?
 
diff --git a/test/sun/security/mscapi/RSAEncryptDecrypt.sh b/test/sun/security/mscapi/RSAEncryptDecrypt.sh
index 19add0a..ed17bd1 100644
--- a/test/sun/security/mscapi/RSAEncryptDecrypt.sh
+++ b/test/sun/security/mscapi/RSAEncryptDecrypt.sh
@@ -70,7 +70,7 @@
 	# unsupported
 
 	${TESTJAVA}/bin/javac -d . ${TESTSRC}\\RSAEncryptDecrypt.java
-	${TESTJAVA}/bin/java RSAEncryptDecrypt
+	${TESTJAVA}/bin/java ${TESTVMOPTS} RSAEncryptDecrypt
 	exit
 	;;
 
diff --git a/test/sun/security/mscapi/ShortRSAKey1024.sh b/test/sun/security/mscapi/ShortRSAKey1024.sh
index 1e01377..05db70e 100644
--- a/test/sun/security/mscapi/ShortRSAKey1024.sh
+++ b/test/sun/security/mscapi/ShortRSAKey1024.sh
@@ -89,7 +89,7 @@
         echo "Running the test..."
         ${TESTJAVA}${FS}bin${FS}javac -d . \
             ${TESTSRC}${FS}ShortRSAKeyWithinTLS.java
-        ${TESTJAVA}${FS}bin${FS}java ShortRSAKeyWithinTLS 7106773.$BITS $BITS \
+        ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} ShortRSAKeyWithinTLS 7106773.$BITS $BITS \
             TLSv1.2 TLS_DHE_RSA_WITH_AES_128_CBC_SHA
 
         rc=$?
diff --git a/test/sun/security/mscapi/SignUsingNONEwithRSA.sh b/test/sun/security/mscapi/SignUsingNONEwithRSA.sh
index c89a868..f794e29 100644
--- a/test/sun/security/mscapi/SignUsingNONEwithRSA.sh
+++ b/test/sun/security/mscapi/SignUsingNONEwithRSA.sh
@@ -61,7 +61,7 @@
         echo
 	echo "Running the test..."
         ${TESTJAVA}/bin/javac -d . ${TESTSRC}\\SignUsingNONEwithRSA.java
-        ${TESTJAVA}/bin/java SignUsingNONEwithRSA
+        ${TESTJAVA}/bin/java ${TESTVMOPTS} SignUsingNONEwithRSA
 
         rc=$?
 
diff --git a/test/sun/security/mscapi/SignUsingSHA2withRSA.sh b/test/sun/security/mscapi/SignUsingSHA2withRSA.sh
index c939fb3..2d433f1 100644
--- a/test/sun/security/mscapi/SignUsingSHA2withRSA.sh
+++ b/test/sun/security/mscapi/SignUsingSHA2withRSA.sh
@@ -61,7 +61,7 @@
         echo
 	echo "Running the test..."
         ${TESTJAVA}/bin/javac -d . ${TESTSRC}\\SignUsingSHA2withRSA.java
-        ${TESTJAVA}/bin/java SignUsingSHA2withRSA
+        ${TESTJAVA}/bin/java ${TESTVMOPTS} SignUsingSHA2withRSA
 
         rc=$?
 
diff --git a/test/sun/security/pkcs11/KeyStore/Basic.sh b/test/sun/security/pkcs11/KeyStore/Basic.sh
index 54408bd..452b629 100644
--- a/test/sun/security/pkcs11/KeyStore/Basic.sh
+++ b/test/sun/security/pkcs11/KeyStore/Basic.sh
@@ -171,7 +171,7 @@
 
 # run test
 
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
 	-classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar \
 	-DDIR=${TESTSRC}${FS}BasicData \
 	-DCUSTOM_DB_DIR=${TESTCLASSES} \
diff --git a/test/sun/security/pkcs11/KeyStore/ClientAuth.sh b/test/sun/security/pkcs11/KeyStore/ClientAuth.sh
index 0593ddf..d0996c1 100644
--- a/test/sun/security/pkcs11/KeyStore/ClientAuth.sh
+++ b/test/sun/security/pkcs11/KeyStore/ClientAuth.sh
@@ -128,7 +128,7 @@
 
 # run test
 echo "Run ClientAuth ..."
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
 	-classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar \
 	-DDIR=${TESTSRC}${FS}ClientAuthData${FS} \
 	-DCUSTOM_DB_DIR=${TESTCLASSES} \
@@ -149,7 +149,7 @@
 
 # run test with specified TLS protocol and cipher suite
 echo "Run ClientAuth TLSv1.2 TLS_DHE_RSA_WITH_AES_128_CBC_SHA"
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
 	-classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar \
 	-DDIR=${TESTSRC}${FS}ClientAuthData${FS} \
 	-DCUSTOM_DB_DIR=${TESTCLASSES} \
diff --git a/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh b/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh
index 4041c0e..3033455 100644
--- a/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh
+++ b/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh
@@ -141,7 +141,7 @@
 
 # run test
 cd ${TESTSRC}
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
 	-DDIR=${TESTSRC}${FS}BasicData${FS} \
         -classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar \
         -DCUSTOM_DB_DIR=${TESTCLASSES} \
diff --git a/test/sun/security/pkcs11/KeyStore/Solaris.sh b/test/sun/security/pkcs11/KeyStore/Solaris.sh
index 9da8ab9..5ec1ac2 100644
--- a/test/sun/security/pkcs11/KeyStore/Solaris.sh
+++ b/test/sun/security/pkcs11/KeyStore/Solaris.sh
@@ -142,7 +142,7 @@
 # run test
 
 cd ${TESTSRC}
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
 	-classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar \
 	-DDIR=${TESTSRC}${FS}BasicData${FS} \
 	-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}BasicData${FS}p11-solaris.txt \
diff --git a/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh b/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh
index ce5693f..1a749d8 100644
--- a/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh
+++ b/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh
@@ -99,7 +99,7 @@
 
 # run test
 
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
         -classpath ${TESTCLASSES} \
         -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}ConfigQuotedString-nss.txt \
         -Dtest.src=${TESTSRC} \
diff --git a/test/sun/security/pkcs11/Provider/Login.sh b/test/sun/security/pkcs11/Provider/Login.sh
index 86d8f9e..6b37ef8 100644
--- a/test/sun/security/pkcs11/Provider/Login.sh
+++ b/test/sun/security/pkcs11/Provider/Login.sh
@@ -108,7 +108,7 @@
 
 # run test
 
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
         -classpath ${TESTCLASSES} \
         -DCUSTOM_DB_DIR=${TESTCLASSES} \
         -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}Login-nss.txt \
diff --git a/test/sun/security/pkcs11/ec/TestECDSA.java b/test/sun/security/pkcs11/ec/TestECDSA.java
index a684d8a..92dac4c 100644
--- a/test/sun/security/pkcs11/ec/TestECDSA.java
+++ b/test/sun/security/pkcs11/ec/TestECDSA.java
@@ -179,7 +179,6 @@
         // SHA1withECDSA and NONEwithECDSA
         Signature s = Signature.getInstance("SHA1withECDSA", provider);
         s.initSign(privateKey);
-        s.initSign(privateKey);
         s.update(data);
         byte[] s1 = s.sign();
 
diff --git a/test/sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh b/test/sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh
index ee4035c..b09d156 100644
--- a/test/sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh
+++ b/test/sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh
@@ -82,7 +82,7 @@
  ${TESTJAVA}${FILESEP}jre${FILESEP}lib${FILESEP}security${FILESEP}tmp_pol
 
 # run the test program
-${TESTJAVA}${FILESEP}bin${FILESEP}java -Djava.security.manager \
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} -Djava.security.manager \
  GrantAllPermToExtWhenNoPolicy
 
 # save error status
diff --git a/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh b/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh
index b52db72..893bbb6 100644
--- a/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh
+++ b/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh
@@ -92,7 +92,7 @@
 ${TESTJAVA}${FS}bin${FS}javac -d ${TESTCLASSES}${FS}app \
         ${TESTSRC}${FS}GetInstance.java
 
-${TESTJAVA}${FS}bin${FS}java  \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS}  \
 -Xbootclasspath/a:"${TESTCLASSES}${FS}boot" \
 -classpath "${TESTCLASSES}${FS}app" -Djava.security.manager \
 -Djava.security.policy=GetInstance.policy \
@@ -106,7 +106,7 @@
      echo "Failed on first test"
 fi
 
-${TESTJAVA}${FS}bin${FS}java  \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS}  \
 -classpath "${TESTCLASSES}${FS}boot${PS}${TESTCLASSES}${FS}app" \
 -Djava.security.manager \
 -Djava.security.policy=GetInstance.policy \
diff --git a/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh
index c2d14c7..f29f6ce 100644
--- a/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh
+++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh
@@ -59,7 +59,7 @@
 echo "${STRING}"
 echo "========="
 
-${TESTJAVA}${FS}bin${FS}java -Djavax.net.debug=all \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Djavax.net.debug=all \
     -Dtest.src=${TESTSRC} \
     DebugReportsOneExtraByte 2>&1 | \
     grep "${STRING}"
diff --git a/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh
index fa5a410..60a3846 100644
--- a/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh
+++ b/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh
@@ -82,7 +82,7 @@
 # This is the only thing we really care about as far as
 # test status goes.
 #
-${TESTJAVA}${FILESEP}bin${FILESEP}java \
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \
     -Dtest.src=${TESTSRC} \
     -classpath "com.jar${PATHSEP}edu.jar" \
     -Djava.security.manager \
diff --git a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsProxyStackOverflow.java b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsProxyStackOverflow.java
index dc50bc9..360dfee 100644
--- a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsProxyStackOverflow.java
+++ b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsProxyStackOverflow.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
diff --git a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh
index 7696cbb..85e9c22 100644
--- a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh
+++ b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh
@@ -52,5 +52,5 @@
 
 ${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}OriginServer.java \
     ${TESTSRC}${FS}ProxyTunnelServer.java ${TESTSRC}${FS}PostThruProxy.java
-${TESTJAVA}${FS}bin${FS}java PostThruProxy ${HOSTNAME} ${TESTSRC}
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} PostThruProxy ${HOSTNAME} ${TESTSRC}
 exit
diff --git a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh
index 9e2ed3c..96c0642 100644
--- a/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh
+++ b/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh
@@ -53,5 +53,5 @@
 ${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}OriginServer.java \
     ${TESTSRC}${FS}ProxyTunnelServer.java \
     ${TESTSRC}${FS}PostThruProxyWithAuth.java
-${TESTJAVA}${FS}bin${FS}java PostThruProxyWithAuth ${HOSTNAME} ${TESTSRC}
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} PostThruProxyWithAuth ${HOSTNAME} ${TESTSRC}
 exit
diff --git a/test/sun/security/tools/jarsigner/emptymanifest.sh b/test/sun/security/tools/jarsigner/emptymanifest.sh
index 81c0937..cbb7241 100644
--- a/test/sun/security/tools/jarsigner/emptymanifest.sh
+++ b/test/sun/security/tools/jarsigner/emptymanifest.sh
@@ -65,7 +65,7 @@
 }
 EOF
 $JAVAC CrLf.java
-$JAVA CrLf > META-INF${FS}MANIFEST.MF
+$JAVA ${TESTVMOPTS} CrLf > META-INF${FS}MANIFEST.MF
 zip $JFILE META-INF${FS}MANIFEST.MF A B
 
 $KT -alias a -dname CN=a -keyalg rsa -genkey -validity 300
diff --git a/test/sun/security/tools/jarsigner/ts.sh b/test/sun/security/tools/jarsigner/ts.sh
index 3293a7d..43a3651 100644
--- a/test/sun/security/tools/jarsigner/ts.sh
+++ b/test/sun/security/tools/jarsigner/ts.sh
@@ -87,5 +87,5 @@
         $KT -alias tsbad3 -importcert
 
 $JAVAC -d . ${TESTSRC}/TimestampCheck.java
-$JAVA TimestampCheck
+$JAVA ${TESTVMOPTS} TimestampCheck
 
diff --git a/test/sun/security/tools/keytool/printssl.sh b/test/sun/security/tools/keytool/printssl.sh
index b750ffe..46de260 100644
--- a/test/sun/security/tools/keytool/printssl.sh
+++ b/test/sun/security/tools/keytool/printssl.sh
@@ -53,7 +53,7 @@
 esac
 
 ${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}PrintSSL.java || exit 10
-${TESTJAVA}${FS}bin${FS}java -Dtest.src=$TESTSRC PrintSSL | ( read PORT; ${TESTJAVA}${FS}bin${FS}keytool -printcert -sslserver localhost:$PORT )
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dtest.src=$TESTSRC PrintSSL | ( read PORT; ${TESTJAVA}${FS}bin${FS}keytool -printcert -sslserver localhost:$PORT )
 status=$?
 
 rm PrintSSL*.class
diff --git a/test/sun/security/tools/keytool/standard.sh b/test/sun/security/tools/keytool/standard.sh
index 756d2fb..c75a7a4 100644
--- a/test/sun/security/tools/keytool/standard.sh
+++ b/test/sun/security/tools/keytool/standard.sh
@@ -58,7 +58,7 @@
 
 ${TESTJAVA}${FS}bin${FS}javac -d . -XDignore.symbol.file ${TESTSRC}${FS}KeyToolTest.java || exit 10
 
-echo | ${TESTJAVA}${FS}bin${FS}java -Dfile KeyToolTest
+echo | ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dfile KeyToolTest
 status=$?
 
 rm HumanInputStream*.class
diff --git a/test/sun/security/validator/certreplace.sh b/test/sun/security/validator/certreplace.sh
index 16470a3..b45a70e 100644
--- a/test/sun/security/validator/certreplace.sh
+++ b/test/sun/security/validator/certreplace.sh
@@ -82,4 +82,4 @@
 # 5. Build and run test
 
 $JAVAC -d . ${TESTSRC}${FS}CertReplace.java
-$JAVA CertReplace certreplace.jks certreplace.certs
+$JAVA ${TESTVMOPTS} CertReplace certreplace.jks certreplace.certs
diff --git a/test/sun/security/validator/samedn.sh b/test/sun/security/validator/samedn.sh
index 9d5afd4..5d9b045 100644
--- a/test/sun/security/validator/samedn.sh
+++ b/test/sun/security/validator/samedn.sh
@@ -78,5 +78,5 @@
 # Check both, one of them might be dropped out of map in old codes.
 
 $JAVAC -d . ${TESTSRC}${FS}CertReplace.java
-$JAVA CertReplace samedn.jks samedn1.certs || exit 1
-$JAVA CertReplace samedn.jks samedn2.certs || exit 2
+$JAVA ${TESTVMOPTS} CertReplace samedn.jks samedn1.certs || exit 1
+$JAVA ${TESTVMOPTS} CertReplace samedn.jks samedn2.certs || exit 2
diff --git a/test/sun/text/resources/LocaleData b/test/sun/text/resources/LocaleData
index fe326dc..59dc0eb 100644
--- a/test/sun/text/resources/LocaleData
+++ b/test/sun/text/resources/LocaleData
@@ -7075,5 +7075,588 @@
 # bug 7189611
 CurrencyNames/es_VE/VEF=Bs.F.
 
+# rfe 8000983 (narrow names support)
+FormatData//DayNarrows/0=S
+FormatData//DayNarrows/1=M
+FormatData//DayNarrows/2=T
+FormatData//DayNarrows/3=W
+FormatData//DayNarrows/4=T
+FormatData//DayNarrows/5=F
+FormatData//DayNarrows/6=S
+FormatData//narrow.AmPmMarkers/0=a
+FormatData//narrow.AmPmMarkers/1=p
+FormatData//narrow.Eras/0=B
+FormatData//narrow.Eras/1=A
+FormatData//buddhist.narrow.Eras/0=BC
+FormatData//buddhist.narrow.Eras/1=B.E.
+FormatData//japanese.narrow.Eras/0=
+FormatData//japanese.narrow.Eras/1=M
+FormatData//japanese.narrow.Eras/2=T
+FormatData//japanese.narrow.Eras/3=S
+FormatData//japanese.narrow.Eras/4=H
+
+FormatData/ar/DayNarrows/0=\u062d
+FormatData/ar/DayNarrows/1=\u0646
+FormatData/ar/DayNarrows/2=\u062b
+FormatData/ar/DayNarrows/3=\u0631
+FormatData/ar/DayNarrows/4=\u062e
+FormatData/ar/DayNarrows/5=\u062c
+FormatData/ar/DayNarrows/6=\u0633
+
+FormatData/be/standalone.MonthNarrows/0=\u0441
+FormatData/be/standalone.MonthNarrows/1=\u043b
+FormatData/be/standalone.MonthNarrows/2=\u0441
+FormatData/be/standalone.MonthNarrows/3=\u043a
+FormatData/be/standalone.MonthNarrows/4=\u043c
+FormatData/be/standalone.MonthNarrows/5=\u0447
+FormatData/be/standalone.MonthNarrows/6=\u043b
+FormatData/be/standalone.MonthNarrows/7=\u0436
+FormatData/be/standalone.MonthNarrows/8=\u0432
+FormatData/be/standalone.MonthNarrows/9=\u043a
+FormatData/be/standalone.MonthNarrows/10=\u043b
+FormatData/be/standalone.MonthNarrows/11=\u0441
+FormatData/be/standalone.MonthNarrows/12=
+FormatData/be/DayNarrows/0=\u043d
+FormatData/be/DayNarrows/1=\u043f
+FormatData/be/DayNarrows/2=\u0430
+FormatData/be/DayNarrows/3=\u0441
+FormatData/be/DayNarrows/4=\u0447
+FormatData/be/DayNarrows/5=\u043f
+FormatData/be/DayNarrows/6=\u0441
+
+FormatData/bg/DayNarrows/0=\u043d
+FormatData/bg/DayNarrows/1=\u043f
+FormatData/bg/DayNarrows/2=\u0432
+FormatData/bg/DayNarrows/3=\u0441
+FormatData/bg/DayNarrows/4=\u0447
+FormatData/bg/DayNarrows/5=\u043f
+FormatData/bg/DayNarrows/6=\u0441
+
+FormatData/ca/standalone.MonthNarrows/0=g
+FormatData/ca/standalone.MonthNarrows/1=f
+FormatData/ca/standalone.MonthNarrows/2=m
+FormatData/ca/standalone.MonthNarrows/3=a
+FormatData/ca/standalone.MonthNarrows/4=m
+FormatData/ca/standalone.MonthNarrows/5=j
+FormatData/ca/standalone.MonthNarrows/6=j
+FormatData/ca/standalone.MonthNarrows/7=a
+FormatData/ca/standalone.MonthNarrows/8=s
+FormatData/ca/standalone.MonthNarrows/9=o
+FormatData/ca/standalone.MonthNarrows/10=n
+FormatData/ca/standalone.MonthNarrows/11=d
+FormatData/ca/standalone.MonthNarrows/12=
+FormatData/ca/DayNarrows/0=G
+# Note: "L" is a contribued item in CLDR
+FormatData/ca/DayNarrows/1=L
+FormatData/ca/DayNarrows/2=T
+FormatData/ca/DayNarrows/3=C
+FormatData/ca/DayNarrows/4=J
+FormatData/ca/DayNarrows/5=V
+FormatData/ca/DayNarrows/6=S
+FormatData/ca/standalone.DayNarrows/0=g
+FormatData/ca/standalone.DayNarrows/1=l
+FormatData/ca/standalone.DayNarrows/2=t
+FormatData/ca/standalone.DayNarrows/3=c
+FormatData/ca/standalone.DayNarrows/4=j
+FormatData/ca/standalone.DayNarrows/5=v
+FormatData/ca/standalone.DayNarrows/6=s
+
+FormatData/cs/DayNarrows/0=N
+FormatData/cs/DayNarrows/1=P
+FormatData/cs/DayNarrows/2=\u00da
+FormatData/cs/DayNarrows/3=S
+FormatData/cs/DayNarrows/4=\u010c
+FormatData/cs/DayNarrows/5=P
+FormatData/cs/DayNarrows/6=S
+
+FormatData/da/DayNarrows/0=S
+FormatData/da/DayNarrows/1=M
+FormatData/da/DayNarrows/2=T
+FormatData/da/DayNarrows/3=O
+FormatData/da/DayNarrows/4=T
+FormatData/da/DayNarrows/5=F
+FormatData/da/DayNarrows/6=L
+
+FormatData/de/DayNarrows/0=S
+FormatData/de/DayNarrows/1=M
+FormatData/de/DayNarrows/2=D
+FormatData/de/DayNarrows/3=M
+FormatData/de/DayNarrows/4=D
+FormatData/de/DayNarrows/5=F
+FormatData/de/DayNarrows/6=S
+
+FormatData/el/DayNarrows/0=\u039a
+FormatData/el/DayNarrows/1=\u0394
+FormatData/el/DayNarrows/2=\u03a4
+FormatData/el/DayNarrows/3=\u03a4
+FormatData/el/DayNarrows/4=\u03a0
+FormatData/el/DayNarrows/5=\u03a0
+FormatData/el/DayNarrows/6=\u03a3
+
+FormatData/es/DayNarrows/0=D
+FormatData/es/DayNarrows/1=L
+FormatData/es/DayNarrows/2=M
+FormatData/es/DayNarrows/3=X
+FormatData/es/DayNarrows/4=J
+FormatData/es/DayNarrows/5=V
+FormatData/es/DayNarrows/6=S
+
+FormatData/et/DayNarrows/0=P
+FormatData/et/DayNarrows/1=E
+FormatData/et/DayNarrows/2=T
+FormatData/et/DayNarrows/3=K
+FormatData/et/DayNarrows/4=N
+FormatData/et/DayNarrows/5=R
+FormatData/et/DayNarrows/6=L
+
+FormatData/fi/standalone.MonthNarrows/0=T
+FormatData/fi/standalone.MonthNarrows/1=H
+FormatData/fi/standalone.MonthNarrows/2=M
+FormatData/fi/standalone.MonthNarrows/3=H
+FormatData/fi/standalone.MonthNarrows/4=T
+FormatData/fi/standalone.MonthNarrows/5=K
+FormatData/fi/standalone.MonthNarrows/6=H
+FormatData/fi/standalone.MonthNarrows/7=E
+FormatData/fi/standalone.MonthNarrows/8=S
+FormatData/fi/standalone.MonthNarrows/9=L
+FormatData/fi/standalone.MonthNarrows/10=M
+FormatData/fi/standalone.MonthNarrows/11=J
+FormatData/fi/standalone.MonthNarrows/12=
+FormatData/fi/DayNarrows/0=S
+FormatData/fi/DayNarrows/1=M
+FormatData/fi/DayNarrows/2=T
+FormatData/fi/DayNarrows/3=K
+FormatData/fi/DayNarrows/4=T
+FormatData/fi/DayNarrows/5=P
+FormatData/fi/DayNarrows/6=L
+FormatData/fi/standalone.DayNarrows/0=S
+FormatData/fi/standalone.DayNarrows/1=M
+FormatData/fi/standalone.DayNarrows/2=T
+FormatData/fi/standalone.DayNarrows/3=K
+FormatData/fi/standalone.DayNarrows/4=T
+FormatData/fi/standalone.DayNarrows/5=P
+FormatData/fi/standalone.DayNarrows/6=L
+FormatData/fi/narrow.AmPmMarkers/0=ap.
+FormatData/fi/narrow.AmPmMarkers/1=ip.
+
+FormatData/fr/DayNarrows/0=D
+FormatData/fr/DayNarrows/1=L
+FormatData/fr/DayNarrows/2=M
+FormatData/fr/DayNarrows/3=M
+FormatData/fr/DayNarrows/4=J
+FormatData/fr/DayNarrows/5=V
+FormatData/fr/DayNarrows/6=S
+
+FormatData/hi_IN/DayNarrows/0=\u0930
+FormatData/hi_IN/DayNarrows/1=\u0938\u094b
+FormatData/hi_IN/DayNarrows/2=\u092e\u0902
+FormatData/hi_IN/DayNarrows/3=\u092c\u0941
+FormatData/hi_IN/DayNarrows/4=\u0917\u0941
+FormatData/hi_IN/DayNarrows/5=\u0936\u0941
+FormatData/hi_IN/DayNarrows/6=\u0936
+
+FormatData/hr/standalone.MonthNarrows/0=1.
+FormatData/hr/standalone.MonthNarrows/1=2.
+FormatData/hr/standalone.MonthNarrows/2=3.
+FormatData/hr/standalone.MonthNarrows/3=4.
+FormatData/hr/standalone.MonthNarrows/4=5.
+FormatData/hr/standalone.MonthNarrows/5=6.
+FormatData/hr/standalone.MonthNarrows/6=7.
+FormatData/hr/standalone.MonthNarrows/7=8.
+FormatData/hr/standalone.MonthNarrows/8=9.
+FormatData/hr/standalone.MonthNarrows/9=10.
+FormatData/hr/standalone.MonthNarrows/10=11.
+FormatData/hr/standalone.MonthNarrows/11=12.
+FormatData/hr/standalone.MonthNarrows/12=
+FormatData/hr/DayNarrows/0=N
+FormatData/hr/DayNarrows/1=P
+FormatData/hr/DayNarrows/2=U
+FormatData/hr/DayNarrows/3=S
+FormatData/hr/DayNarrows/4=\u010c
+FormatData/hr/DayNarrows/5=P
+FormatData/hr/DayNarrows/6=S
+FormatData/hr/standalone.DayNarrows/0=n
+FormatData/hr/standalone.DayNarrows/1=p
+FormatData/hr/standalone.DayNarrows/2=u
+FormatData/hr/standalone.DayNarrows/3=s
+FormatData/hr/standalone.DayNarrows/4=\u010d
+FormatData/hr/standalone.DayNarrows/5=p
+FormatData/hr/standalone.DayNarrows/6=s
+
+FormatData/hu/DayNarrows/0=V
+FormatData/hu/DayNarrows/1=H
+FormatData/hu/DayNarrows/2=K
+FormatData/hu/DayNarrows/3=Sz
+FormatData/hu/DayNarrows/4=Cs
+FormatData/hu/DayNarrows/5=P
+FormatData/hu/DayNarrows/6=Sz
+
+FormatData/is/standalone.MonthNarrows/0=j
+FormatData/is/standalone.MonthNarrows/1=f
+FormatData/is/standalone.MonthNarrows/2=m
+FormatData/is/standalone.MonthNarrows/3=a
+FormatData/is/standalone.MonthNarrows/4=m
+FormatData/is/standalone.MonthNarrows/5=j
+FormatData/is/standalone.MonthNarrows/6=j
+FormatData/is/standalone.MonthNarrows/7=\u00e1
+FormatData/is/standalone.MonthNarrows/8=s
+FormatData/is/standalone.MonthNarrows/9=o
+FormatData/is/standalone.MonthNarrows/10=n
+FormatData/is/standalone.MonthNarrows/11=d
+FormatData/is/standalone.MonthNarrows/12=
+FormatData/is/DayNarrows/0=S
+FormatData/is/DayNarrows/1=M
+FormatData/is/DayNarrows/2=\u00de
+FormatData/is/DayNarrows/3=M
+FormatData/is/DayNarrows/4=F
+FormatData/is/DayNarrows/5=F
+FormatData/is/DayNarrows/6=L
+FormatData/is/standalone.DayNarrows/0=s
+FormatData/is/standalone.DayNarrows/1=m
+FormatData/is/standalone.DayNarrows/2=\u00fe
+FormatData/is/standalone.DayNarrows/3=m
+FormatData/is/standalone.DayNarrows/4=f
+FormatData/is/standalone.DayNarrows/5=f
+FormatData/is/standalone.DayNarrows/6=l
+
+FormatData/it/DayNarrows/0=D
+FormatData/it/DayNarrows/1=L
+FormatData/it/DayNarrows/2=M
+FormatData/it/DayNarrows/3=M
+FormatData/it/DayNarrows/4=G
+FormatData/it/DayNarrows/5=V
+FormatData/it/DayNarrows/6=S
+
+FormatData/iw/DayNarrows/0=\u05d0
+FormatData/iw/DayNarrows/1=\u05d1
+FormatData/iw/DayNarrows/2=\u05d2
+FormatData/iw/DayNarrows/3=\u05d3
+FormatData/iw/DayNarrows/4=\u05d4
+FormatData/iw/DayNarrows/5=\u05d5
+FormatData/iw/DayNarrows/6=\u05e9
+FormatData/iw/standalone.DayNarrows/0=\u05d0
+FormatData/iw/standalone.DayNarrows/1=\u05d1
+FormatData/iw/standalone.DayNarrows/2=\u05d2
+FormatData/iw/standalone.DayNarrows/3=\u05d3
+FormatData/iw/standalone.DayNarrows/4=\u05d4
+FormatData/iw/standalone.DayNarrows/5=\u05d5
+FormatData/iw/standalone.DayNarrows/6=\u05e9
+
+FormatData/ja/DayNarrows/0=\u65e5
+FormatData/ja/DayNarrows/1=\u6708
+FormatData/ja/DayNarrows/2=\u706b
+FormatData/ja/DayNarrows/3=\u6c34
+FormatData/ja/DayNarrows/4=\u6728
+FormatData/ja/DayNarrows/5=\u91d1
+FormatData/ja/DayNarrows/6=\u571f
+
+FormatData/ko/DayNarrows/0=\uc77c
+FormatData/ko/DayNarrows/1=\uc6d4
+FormatData/ko/DayNarrows/2=\ud654
+FormatData/ko/DayNarrows/3=\uc218
+FormatData/ko/DayNarrows/4=\ubaa9
+FormatData/ko/DayNarrows/5=\uae08
+FormatData/ko/DayNarrows/6=\ud1a0
+
+FormatData/lt/standalone.MonthNarrows/0=S
+FormatData/lt/standalone.MonthNarrows/1=V
+FormatData/lt/standalone.MonthNarrows/2=K
+FormatData/lt/standalone.MonthNarrows/3=B
+FormatData/lt/standalone.MonthNarrows/4=G
+FormatData/lt/standalone.MonthNarrows/5=B
+FormatData/lt/standalone.MonthNarrows/6=L
+FormatData/lt/standalone.MonthNarrows/7=R
+FormatData/lt/standalone.MonthNarrows/8=R
+FormatData/lt/standalone.MonthNarrows/9=S
+FormatData/lt/standalone.MonthNarrows/10=L
+FormatData/lt/standalone.MonthNarrows/11=G
+FormatData/lt/standalone.MonthNarrows/12=
+
+FormatData/lt/DayNarrows/0=S
+FormatData/lt/DayNarrows/1=P
+FormatData/lt/DayNarrows/2=A
+FormatData/lt/DayNarrows/3=T
+FormatData/lt/DayNarrows/4=K
+FormatData/lt/DayNarrows/5=P
+FormatData/lt/DayNarrows/6=\u0160
+FormatData/lt/standalone.DayNarrows/0=S
+FormatData/lt/standalone.DayNarrows/1=P
+FormatData/lt/standalone.DayNarrows/2=A
+FormatData/lt/standalone.DayNarrows/3=T
+FormatData/lt/standalone.DayNarrows/4=K
+FormatData/lt/standalone.DayNarrows/5=P
+FormatData/lt/standalone.DayNarrows/6=\u0160
+
+FormatData/lv/DayNarrows/0=S
+FormatData/lv/DayNarrows/1=P
+FormatData/lv/DayNarrows/2=O
+FormatData/lv/DayNarrows/3=T
+FormatData/lv/DayNarrows/4=C
+FormatData/lv/DayNarrows/5=P
+FormatData/lv/DayNarrows/6=S
+
+FormatData/mk/DayNarrows/0=\u043d
+FormatData/mk/DayNarrows/1=\u043f
+FormatData/mk/DayNarrows/2=\u0432
+FormatData/mk/DayNarrows/3=\u0441
+FormatData/mk/DayNarrows/4=\u0447
+FormatData/mk/DayNarrows/5=\u043f
+FormatData/mk/DayNarrows/6=\u0441
+
+FormatData/ms/standalone.MonthNarrows/0=J
+FormatData/ms/standalone.MonthNarrows/1=F
+FormatData/ms/standalone.MonthNarrows/2=M
+FormatData/ms/standalone.MonthNarrows/3=A
+FormatData/ms/standalone.MonthNarrows/4=M
+FormatData/ms/standalone.MonthNarrows/5=J
+FormatData/ms/standalone.MonthNarrows/6=J
+FormatData/ms/standalone.MonthNarrows/7=O
+FormatData/ms/standalone.MonthNarrows/8=S
+FormatData/ms/standalone.MonthNarrows/9=O
+FormatData/ms/standalone.MonthNarrows/10=N
+FormatData/ms/standalone.MonthNarrows/11=D
+FormatData/ms/standalone.MonthNarrows/12=
+FormatData/ms/DayNarrows/0=A
+FormatData/ms/DayNarrows/1=I
+FormatData/ms/DayNarrows/2=S
+FormatData/ms/DayNarrows/3=R
+FormatData/ms/DayNarrows/4=K
+FormatData/ms/DayNarrows/5=J
+FormatData/ms/DayNarrows/6=S
+FormatData/ms/standalone.DayNarrows/0=A
+FormatData/ms/standalone.DayNarrows/1=I
+FormatData/ms/standalone.DayNarrows/2=S
+FormatData/ms/standalone.DayNarrows/3=R
+FormatData/ms/standalone.DayNarrows/4=K
+FormatData/ms/standalone.DayNarrows/5=J
+FormatData/ms/standalone.DayNarrows/6=S
+
+FormatData/mt/DayNarrows/0=\u0126
+FormatData/mt/DayNarrows/1=T
+FormatData/mt/DayNarrows/2=T
+FormatData/mt/DayNarrows/3=E
+FormatData/mt/DayNarrows/4=\u0126
+FormatData/mt/DayNarrows/5=\u0120
+FormatData/mt/DayNarrows/6=S
+
+FormatData/nl/DayNarrows/0=Z
+FormatData/nl/DayNarrows/1=M
+FormatData/nl/DayNarrows/2=D
+FormatData/nl/DayNarrows/3=W
+FormatData/nl/DayNarrows/4=D
+FormatData/nl/DayNarrows/5=V
+FormatData/nl/DayNarrows/6=Z
+
+FormatData/pl/DayNarrows/0=N
+FormatData/pl/DayNarrows/1=P
+FormatData/pl/DayNarrows/2=W
+FormatData/pl/DayNarrows/3=\u015a
+FormatData/pl/DayNarrows/4=C
+FormatData/pl/DayNarrows/5=P
+FormatData/pl/DayNarrows/6=S
+
+FormatData/pt/DayNarrows/0=D
+FormatData/pt/DayNarrows/1=S
+FormatData/pt/DayNarrows/2=T
+FormatData/pt/DayNarrows/3=Q
+FormatData/pt/DayNarrows/4=Q
+FormatData/pt/DayNarrows/5=S
+FormatData/pt/DayNarrows/6=S
+
+FormatData/ro/standalone.MonthNarrows/0=I
+FormatData/ro/standalone.MonthNarrows/1=F
+FormatData/ro/standalone.MonthNarrows/2=M
+FormatData/ro/standalone.MonthNarrows/3=A
+FormatData/ro/standalone.MonthNarrows/4=M
+FormatData/ro/standalone.MonthNarrows/5=I
+FormatData/ro/standalone.MonthNarrows/6=I
+FormatData/ro/standalone.MonthNarrows/7=A
+FormatData/ro/standalone.MonthNarrows/8=S
+FormatData/ro/standalone.MonthNarrows/9=O
+FormatData/ro/standalone.MonthNarrows/10=N
+FormatData/ro/standalone.MonthNarrows/11=D
+FormatData/ro/standalone.MonthNarrows/12=
+# commented out DayNarrows due to mostly undefined
+#FormatData/ro/DayNarrows/0=D
+#FormatData/ro/DayNarrows/1=
+#FormatData/ro/DayNarrows/2=
+#FormatData/ro/DayNarrows/3=
+#FormatData/ro/DayNarrows/4=
+#FormatData/ro/DayNarrows/5=
+#FormatData/ro/DayNarrows/6=
+FormatData/ro/standalone.DayNarrows/0=D
+FormatData/ro/standalone.DayNarrows/1=L
+FormatData/ro/standalone.DayNarrows/2=M
+FormatData/ro/standalone.DayNarrows/3=M
+FormatData/ro/standalone.DayNarrows/4=J
+FormatData/ro/standalone.DayNarrows/5=V
+FormatData/ro/standalone.DayNarrows/6=S
+
+FormatData/ru/DayNarrows/0=\u0412
+FormatData/ru/DayNarrows/1=\u041f\u043d
+FormatData/ru/DayNarrows/2=\u0412\u0442
+FormatData/ru/DayNarrows/3=\u0421
+FormatData/ru/DayNarrows/4=\u0427
+FormatData/ru/DayNarrows/5=\u041f
+# Note: "sat" is an contributed item in CLDR.
+FormatData/ru/DayNarrows/6=\u0421
+
+FormatData/ru/standalone.DayNarrows/0=\u0412
+FormatData/ru/standalone.DayNarrows/1=\u041f
+FormatData/ru/standalone.DayNarrows/2=\u0412
+FormatData/ru/standalone.DayNarrows/3=\u0421
+FormatData/ru/standalone.DayNarrows/4=\u0427
+FormatData/ru/standalone.DayNarrows/5=\u041f
+FormatData/ru/standalone.DayNarrows/6=\u0421
+
+FormatData/sk/DayNarrows/0=N
+FormatData/sk/DayNarrows/1=P
+FormatData/sk/DayNarrows/2=U
+FormatData/sk/DayNarrows/3=S
+FormatData/sk/DayNarrows/4=\u0160
+FormatData/sk/DayNarrows/5=P
+FormatData/sk/DayNarrows/6=S
+
+FormatData/sl/DayNarrows/0=n
+FormatData/sl/DayNarrows/1=p
+FormatData/sl/DayNarrows/2=t
+FormatData/sl/DayNarrows/3=s
+FormatData/sl/DayNarrows/4=\u010d
+FormatData/sl/DayNarrows/5=p
+FormatData/sl/DayNarrows/6=s
+
+FormatData/sq/DayNarrows/0=D
+FormatData/sq/DayNarrows/1=H
+FormatData/sq/DayNarrows/2=M
+FormatData/sq/DayNarrows/3=M
+FormatData/sq/DayNarrows/4=E
+FormatData/sq/DayNarrows/5=P
+FormatData/sq/DayNarrows/6=S
+
+FormatData/sr/DayNarrows/0=\u043d
+FormatData/sr/DayNarrows/1=\u043f
+FormatData/sr/DayNarrows/2=\u0443
+FormatData/sr/DayNarrows/3=\u0441
+FormatData/sr/DayNarrows/4=\u0447
+FormatData/sr/DayNarrows/5=\u043f
+FormatData/sr/DayNarrows/6=\u0441
+FormatData/sr/short.Eras/0=\u043f. \u043d. \u0435.
+FormatData/sr/short.Eras/1=\u043d. \u0435.
+FormatData/sr/narrow.Eras/0=\u043f.\u043d.\u0435.
+FormatData/sr/narrow.Eras/1=\u043d.\u0435.
+
+FormatData/sv/standalone.MonthNarrows/0=J
+FormatData/sv/standalone.MonthNarrows/1=F
+FormatData/sv/standalone.MonthNarrows/2=M
+FormatData/sv/standalone.MonthNarrows/3=A
+FormatData/sv/standalone.MonthNarrows/4=M
+FormatData/sv/standalone.MonthNarrows/5=J
+FormatData/sv/standalone.MonthNarrows/6=J
+FormatData/sv/standalone.MonthNarrows/7=A
+FormatData/sv/standalone.MonthNarrows/8=S
+FormatData/sv/standalone.MonthNarrows/9=O
+FormatData/sv/standalone.MonthNarrows/10=N
+FormatData/sv/standalone.MonthNarrows/11=D
+FormatData/sv/standalone.MonthNarrows/12=
+FormatData/sv/DayNarrows/0=S
+FormatData/sv/DayNarrows/1=M
+FormatData/sv/DayNarrows/2=T
+FormatData/sv/DayNarrows/3=O
+FormatData/sv/DayNarrows/4=T
+FormatData/sv/DayNarrows/5=F
+FormatData/sv/DayNarrows/6=L
+FormatData/sv/standalone.DayNarrows/0=S
+FormatData/sv/standalone.DayNarrows/1=M
+FormatData/sv/standalone.DayNarrows/2=T
+FormatData/sv/standalone.DayNarrows/3=O
+FormatData/sv/standalone.DayNarrows/4=T
+FormatData/sv/standalone.DayNarrows/5=F
+FormatData/sv/standalone.DayNarrows/6=L
+FormatData/sv/narrow.Eras/0=f.Kr.
+FormatData/sv/narrow.Eras/1=e.Kr.
+FormatData/sv/narrow.AmPmMarkers/0=f
+FormatData/sv/narrow.AmPmMarkers/1=e
+
+FormatData/th/standalone.MonthNarrows/0=\u0e21.\u0e04.
+FormatData/th/standalone.MonthNarrows/1=\u0e01.\u0e1e.
+FormatData/th/standalone.MonthNarrows/2=\u0e21\u0e35.\u0e04.
+FormatData/th/standalone.MonthNarrows/3=\u0e40\u0e21.\u0e22.
+FormatData/th/standalone.MonthNarrows/4=\u0e1e.\u0e04.
+FormatData/th/standalone.MonthNarrows/5=\u0e21\u0e34.\u0e22.
+FormatData/th/standalone.MonthNarrows/6=\u0e01.\u0e04.
+FormatData/th/standalone.MonthNarrows/7=\u0e2a.\u0e04.
+FormatData/th/standalone.MonthNarrows/8=\u0e01.\u0e22.
+FormatData/th/standalone.MonthNarrows/9=\u0e15.\u0e04.
+FormatData/th/standalone.MonthNarrows/10=\u0e1e.\u0e22.
+FormatData/th/standalone.MonthNarrows/11=\u0e18.\u0e04.
+FormatData/th/standalone.MonthNarrows/12=
+FormatData/th/DayNarrows/0=\u0e2d
+FormatData/th/DayNarrows/1=\u0e08
+FormatData/th/DayNarrows/2=\u0e2d
+FormatData/th/DayNarrows/3=\u0e1e
+FormatData/th/DayNarrows/4=\u0e1e
+FormatData/th/DayNarrows/5=\u0e28
+FormatData/th/DayNarrows/6=\u0e2a
+FormatData/th/narrow.Eras/0=\u0e01\u0e48\u0e2d\u0e19 \u0e04.\u0e28.
+FormatData/th/narrow.Eras/1=\u0e04.\u0e28.
+
+FormatData/tr/standalone.MonthNarrows/0=O
+FormatData/tr/standalone.MonthNarrows/1=\u015e
+FormatData/tr/standalone.MonthNarrows/2=M
+FormatData/tr/standalone.MonthNarrows/3=N
+FormatData/tr/standalone.MonthNarrows/4=M
+FormatData/tr/standalone.MonthNarrows/5=H
+FormatData/tr/standalone.MonthNarrows/6=T
+FormatData/tr/standalone.MonthNarrows/7=A
+FormatData/tr/standalone.MonthNarrows/8=E
+FormatData/tr/standalone.MonthNarrows/9=E
+FormatData/tr/standalone.MonthNarrows/10=K
+FormatData/tr/standalone.MonthNarrows/11=A
+FormatData/tr/standalone.MonthNarrows/12=
+FormatData/tr/DayNarrows/0=P
+FormatData/tr/DayNarrows/1=P
+FormatData/tr/DayNarrows/2=S
+FormatData/tr/DayNarrows/3=\u00c7
+FormatData/tr/DayNarrows/4=P
+FormatData/tr/DayNarrows/5=C
+FormatData/tr/DayNarrows/6=C
+
+FormatData/uk/DayNarrows/0=\u041d
+FormatData/uk/DayNarrows/1=\u041f
+FormatData/uk/DayNarrows/2=\u0412
+FormatData/uk/DayNarrows/3=\u0421
+FormatData/uk/DayNarrows/4=\u0427
+FormatData/uk/DayNarrows/5=\u041f
+FormatData/uk/DayNarrows/6=\u0421
+
+FormatData/vi/DayNarrows/0=CN
+FormatData/vi/DayNarrows/1=T2
+FormatData/vi/DayNarrows/2=T3
+FormatData/vi/DayNarrows/3=T4
+FormatData/vi/DayNarrows/4=T5
+FormatData/vi/DayNarrows/5=T6
+FormatData/vi/DayNarrows/6=T7
+
+FormatData/zh/standalone.MonthNarrows/0=1\u6708
+FormatData/zh/standalone.MonthNarrows/1=2\u6708
+FormatData/zh/standalone.MonthNarrows/2=3\u6708
+FormatData/zh/standalone.MonthNarrows/3=4\u6708
+FormatData/zh/standalone.MonthNarrows/4=5\u6708
+FormatData/zh/standalone.MonthNarrows/5=6\u6708
+FormatData/zh/standalone.MonthNarrows/6=7\u6708
+FormatData/zh/standalone.MonthNarrows/7=8\u6708
+FormatData/zh/standalone.MonthNarrows/8=9\u6708
+FormatData/zh/standalone.MonthNarrows/9=10\u6708
+FormatData/zh/standalone.MonthNarrows/10=11\u6708
+FormatData/zh/standalone.MonthNarrows/11=12\u6708
+FormatData/zh/standalone.MonthNarrows/12=
+FormatData/zh/DayNarrows/0=\u65e5
+FormatData/zh/DayNarrows/1=\u4e00
+FormatData/zh/DayNarrows/2=\u4e8c
+FormatData/zh/DayNarrows/3=\u4e09
+FormatData/zh/DayNarrows/4=\u56db
+FormatData/zh/DayNarrows/5=\u4e94
+FormatData/zh/DayNarrows/6=\u516d
+
 # bug 7195759
 CurrencyNames//ZMW=ZMW
diff --git a/test/sun/text/resources/LocaleDataTest.java b/test/sun/text/resources/LocaleDataTest.java
index be2efe6..bd19322 100644
--- a/test/sun/text/resources/LocaleDataTest.java
+++ b/test/sun/text/resources/LocaleDataTest.java
@@ -34,7 +34,7 @@
  *      6509039 6609737 6610748 6645271 6507067 6873931 6450945 6645268 6646611
  *      6645405 6650730 6910489 6573250 6870908 6585666 6716626 6914413 6916787
  *      6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 7101495
- *      7003124 7085757 7028073 7171028 7189611 7195759
+ *      7003124 7085757 7028073 7171028 7189611 8000983 7195759
  * @summary Verify locale data
  *
  */
diff --git a/test/sun/tools/jps/jps-V_2.sh b/test/sun/tools/jps/jps-V_2.sh
index fe0cc40..2e670d2 100644
--- a/test/sun/tools/jps/jps-V_2.sh
+++ b/test/sun/tools/jps/jps-V_2.sh
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2011,Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
diff --git a/test/tools/jar/JarBackSlash.java b/test/tools/jar/JarBackSlash.java
index 4062913..5975e4e 100644
--- a/test/tools/jar/JarBackSlash.java
+++ b/test/tools/jar/JarBackSlash.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
diff --git a/test/tools/launcher/6842838/Test6842838.sh b/test/tools/launcher/6842838/Test6842838.sh
index 6c6e9aa..b552152 100644
--- a/test/tools/launcher/6842838/Test6842838.sh
+++ b/test/tools/launcher/6842838/Test6842838.sh
@@ -68,8 +68,8 @@
 fi
 
 BADFILE=newbadjar.jar
-${JAVA_EXE} -version
-${JAVA_EXE} -cp ${TESTCLASSES} CreateBadJar ${BADFILE} "META-INF/MANIFEST.MF"
+${JAVA_EXE} ${TESTVMOPTS} -version
+${JAVA_EXE} ${TESTVMOPTS} -cp ${TESTCLASSES} CreateBadJar ${BADFILE} "META-INF/MANIFEST.MF"
 LD_PRELOAD=${LIBUMEM} ${JAVA_EXE} -jar ${BADFILE} > test.out 2>&1
 
 grep "Invalid or corrupt jarfile" test.out
diff --git a/test/tools/launcher/Arrrghs.java b/test/tools/launcher/Arrrghs.java
index 364589f..9bf9f21 100644
--- a/test/tools/launcher/Arrrghs.java
+++ b/test/tools/launcher/Arrrghs.java
@@ -27,7 +27,7 @@
  *      6894719 6968053 7151434 7146424
  * @summary Argument parsing validation.
  * @compile -XDignore.symbol.file Arrrghs.java
- * @run main Arrrghs
+ * @run main/othervm Arrrghs
  */
 
 import java.io.BufferedReader;
@@ -204,8 +204,7 @@
         // exiting the process prematurely can terminate the stderr.
         scratchpad.add(javaCmd + " -version " + inArgs);
         File batFile = new File("atest.bat");
-        java.nio.file.Files.deleteIfExists(batFile.toPath());
-        createFile(batFile, scratchpad);
+        createAFile(batFile, scratchpad);
 
         TestResult tr = doExec(batFile.getName());
 
diff --git a/test/tools/launcher/MultipleJRE.sh b/test/tools/launcher/MultipleJRE.sh
index 5c49d8b..b1ef16f 100644
--- a/test/tools/launcher/MultipleJRE.sh
+++ b/test/tools/launcher/MultipleJRE.sh
@@ -49,8 +49,8 @@
   exit 1
 fi
 
-JAVAEXE="$TESTJAVA/bin/java"
-JAVA="$TESTJAVA/bin/java -classpath $TESTCLASSES"
+JAVAEXE="$TESTJAVA/bin/java ${TESTVMOPTS}"
+JAVA="$TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES"
 JAR="$TESTJAVA/bin/jar"
 OS=`uname -s`;
 
diff --git a/test/tools/launcher/TestHelper.java b/test/tools/launcher/TestHelper.java
index e630dd5..0115f05 100644
--- a/test/tools/launcher/TestHelper.java
+++ b/test/tools/launcher/TestHelper.java
@@ -358,6 +358,51 @@
         Files.copy(src.toPath(), dst.toPath(), COPY_ATTRIBUTES, REPLACE_EXISTING);
     }
 
+    /**
+     * Attempt to create a file at the given location. If an IOException
+     * occurs then back off for a moment and try again. When a number of
+     * attempts fail, give up and throw an exception.
+     */
+    void createAFile(File aFile, List<String> contents) throws IOException {
+        IOException cause = null;
+        for (int attempts = 0; attempts < 10; attempts++) {
+            try {
+                Files.write(aFile.getAbsoluteFile().toPath(), contents,
+                    Charset.defaultCharset(), CREATE, TRUNCATE_EXISTING, WRITE);
+                if (cause != null) {
+                    /*
+                     * report attempts and errors that were encountered
+                     * for diagnostic purposes
+                     */
+                    System.err.println("Created batch file " +
+                                        aFile + " in " + (attempts + 1) +
+                                        " attempts");
+                    System.err.println("Errors encountered: " + cause);
+                    cause.printStackTrace();
+                }
+                return;
+            } catch (IOException ioe) {
+                if (cause != null) {
+                    // chain the exceptions so they all get reported for diagnostics
+                    cause.addSuppressed(ioe);
+                } else {
+                    cause = ioe;
+                }
+            }
+
+            try {
+                Thread.sleep(500);
+            } catch (InterruptedException ie) {
+                if (cause != null) {
+                    // cause should alway be non-null here
+                    ie.addSuppressed(cause);
+                }
+                throw new RuntimeException("Interrupted while creating batch file", ie);
+            }
+        }
+        throw new RuntimeException("Unable to create batch file", cause);
+    }
+
     static void createFile(File outFile, List<String> content) throws IOException {
         Files.write(outFile.getAbsoluteFile().toPath(), content,
                 Charset.defaultCharset(), CREATE_NEW);
diff --git a/test/tools/launcher/UnicodeTest.java b/test/tools/launcher/UnicodeTest.java
index d44582d..15213f1 100644
--- a/test/tools/launcher/UnicodeTest.java
+++ b/test/tools/launcher/UnicodeTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2012, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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