changeset 6345:bf6d0bca5ea7

Merge
author mullan
date Tue, 08 Jan 2013 19:02:55 -0500
parents 86828e84654f d9cab18f326a
children f0ed9ef84637
files make/jdk/asm/Makefile src/share/classes/sun/awt/TextureSizeConstraining.java src/share/lib/security/java.security test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshall.java
diffstat 625 files changed, 25078 insertions(+), 7226 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Jan 08 19:00:12 2013 -0500
+++ b/.hgtags	Tue Jan 08 19:02:55 2013 -0500
@@ -186,3 +186,7 @@
 50b8b17449d200c66bfd68fb4f3a9197432c9e2b jdk8-b62
 f117a3e06f78a258074674ad17601f99bcb1ce0d jdk8-b63
 26dbd73fb7662a29b3e47179fdc88a0bfa4e231e jdk8-b64
+130d3a54d28becaac0846137256c2684adb34c33 jdk8-b65
+4d337fae2250135729ee9ed2bf8baf3c60da5d6d jdk8-b66
+ce9b02a3a17edd1983201002cfa0f364e4ab7524 jdk8-b67
+53fb43e4d614c92310e1fb00ec41d1960fd9facf jdk8-b68
--- a/make/com/sun/security/Makefile	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/com/sun/security/Makefile	Tue Jan 08 19:02:55 2013 -0500
@@ -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::
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/com/sun/security/ntlm/Makefile	Tue Jan 08 19:02:55 2013 -0500
@@ -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
--- a/make/common/Release.gmk	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/common/Release.gmk	Tue Jan 08 19:02:55 2013 -0500
@@ -366,6 +366,7 @@
 	com/sun/source          \
 	com/sun/tools/classfile \
 	com/sun/tools/doclets   \
+	com/sun/tools/doclint   \
 	com/sun/tools/example/debug/expr \
 	com/sun/tools/example/debug/tty  \
 	com/sun/tools/extcheck  \
--- a/make/common/internal/Defs-langtools.gmk	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/common/internal/Defs-langtools.gmk	Tue Jan 08 19:02:55 2013 -0500
@@ -35,6 +35,7 @@
       com/sun/source                \
       com/sun/tools/classfile       \
       com/sun/tools/doclets         \
+      com/sun/tools/doclint         \
       com/sun/tools/javac           \
       com/sun/tools/javadoc         \
       com/sun/tools/javah           \
--- a/make/docs/NON_CORE_PKGS.gmk	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/docs/NON_CORE_PKGS.gmk	Tue Jan 08 19:02:55 2013 -0500
@@ -76,7 +76,8 @@
 
 JCONSOLE_PKGS    = com.sun.tools.jconsole
 
-TREEAPI_PKGS 	 = com.sun.source.tree \
+TREEAPI_PKGS 	 = com.sunsource.doctree \
+		   com.sun.source.tree \
 		   com.sun.source.util
 
 SMARTCARDIO_PKGS = javax.smartcardio
--- a/make/java/java/FILES_java.gmk	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/java/java/FILES_java.gmk	Tue Jan 08 19:02:55 2013 -0500
@@ -322,6 +322,7 @@
     java/util/concurrent/CopyOnWriteArrayList.java \
     java/util/concurrent/CopyOnWriteArraySet.java \
     java/util/concurrent/CountDownLatch.java \
+    java/util/concurrent/CountedCompleter.java \
     java/util/concurrent/CyclicBarrier.java \
     java/util/concurrent/DelayQueue.java \
     java/util/concurrent/Delayed.java \
--- a/make/java/nio/Makefile	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/java/nio/Makefile	Tue Jan 08 19:02:55 2013 -0500
@@ -69,6 +69,7 @@
 	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \
 	\
 	sun/nio/fs/GnomeFileTypeDetector.java \
+	sun/nio/fs/MimeTypesFileTypeDetector.java \
 	sun/nio/fs/PollingWatchService.java \
 	sun/nio/fs/SolarisAclFileAttributeView.java \
 	sun/nio/fs/SolarisFileStore.java \
@@ -202,6 +203,8 @@
 	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \
 	\
 	sun/nio/fs/GnomeFileTypeDetector.java \
+	sun/nio/fs/MagicFileTypeDetector.java \
+	sun/nio/fs/MimeTypesFileTypeDetector.java \
 	sun/nio/fs/LinuxDosFileAttributeView.java \
 	sun/nio/fs/LinuxFileStore.java \
 	sun/nio/fs/LinuxFileSystem.java \
@@ -239,6 +242,7 @@
 	UnixAsynchronousSocketChannelImpl.c \
 	\
 	GnomeFileTypeDetector.c \
+	MagicFileTypeDetector.c \
 	LinuxNativeDispatcher.c \
 	LinuxWatchService.c \
 	UnixCopyFile.c \
@@ -254,6 +258,7 @@
 	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \
 	\
 	sun/nio/fs/GnomeFileTypeDetector.java \
+	sun/nio/fs/MagicFileTypeDetector.java \
 	sun/nio/fs/LinuxNativeDispatcher.java \
 	sun/nio/fs/LinuxWatchService.java \
 	sun/nio/fs/UnixCopyFile.java \
@@ -277,6 +282,7 @@
 	sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \
 	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java \
 	\
+	sun/nio/fs/MimeTypesFileTypeDetector.java \
 	sun/nio/fs/BsdFileStore.java \
 	sun/nio/fs/BsdFileSystem.java \
 	sun/nio/fs/BsdFileSystemProvider.java \
--- a/make/java/nio/mapfile-linux	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/java/nio/mapfile-linux	Tue Jan 08 19:02:55 2013 -0500
@@ -130,6 +130,8 @@
 		Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGio;
 		Java_sun_nio_fs_GnomeFileTypeDetector_initializeGnomeVfs;
 		Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGnomeVfs;
+		Java_sun_nio_fs_MagicFileTypeDetector_initialize0;
+		Java_sun_nio_fs_MagicFileTypeDetector_probe0;
 		Java_sun_nio_fs_LinuxWatchService_eventSize;
 		Java_sun_nio_fs_LinuxWatchService_eventOffsets;
 		Java_sun_nio_fs_LinuxWatchService_inotifyInit;
--- a/make/java/security/Makefile	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/java/security/Makefile	Tue Jan 08 19:02:55 2013 -0500
@@ -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
--- a/make/jdk/Makefile	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/jdk/Makefile	Tue Jan 08 19:02:55 2013 -0500
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 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
@@ -23,16 +23,18 @@
 # questions.
 #
 
-#
-# Makefile for building all of java
-#
-
 BUILDDIR = ..
+PACKAGE = jdk
 PRODUCT = jdk
+JAVAC_LINT_OPTIONS=-Xlint:all
 include $(BUILDDIR)/common/Defs.gmk
 
-SUBDIRS = asm
-include $(BUILDDIR)/common/Subdirs.gmk
+#
+# Files to compile
+#
+AUTO_FILES_JAVA_DIRS = jdk
 
-all build clean clobber::
-	$(SUBDIRS-loop)
+#
+# Rules
+#
+include $(BUILDDIR)/common/Classes.gmk
--- a/make/jdk/asm/Makefile	Tue Jan 08 19:00:12 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-#
-# Copyright (c) 1995, 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 = jdk.internal.org.objectweb.asm
-PRODUCT = jdk
-JAVAC_LINT_OPTIONS=-Xlint:all
-include $(BUILDDIR)/common/Defs.gmk
-
-#
-# Files to compile
-#
-AUTO_FILES_JAVA_DIRS = jdk/internal/org/objectweb/asm
-
-#
-# Rules
-#
-include $(BUILDDIR)/common/Classes.gmk
--- a/make/jprt.properties	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/jprt.properties	Tue Jan 08 19:02:55 2013 -0500
@@ -86,7 +86,6 @@
     ${jprt.my.test.target.set:TESTNAME=jdk_jmx},                \
     ${jprt.my.test.target.set:TESTNAME=jdk_text},               \
     ${jprt.my.test.target.set:TESTNAME=jdk_tools},              \
-    ${jprt.my.test.target.set:TESTNAME=jdk_jdi},                \
     ${jprt.my.test.target.set:TESTNAME=jdk_jfr},                \
     ${jprt.my.test.target.set:TESTNAME=jdk_other}
 
@@ -103,6 +102,7 @@
     ${jprt.my.test.target.set:TESTNAME=jdk_beans1},             \
     ${jprt.my.test.target.set:TESTNAME=jdk_beans2},             \
     ${jprt.my.test.target.set:TESTNAME=jdk_beans3},             \
+    ${jprt.my.test.target.set:TESTNAME=jdk_jdi},                \
     ${jprt.my.test.target.set:TESTNAME=jdk_sound},              \
     ${jprt.my.test.target.set:TESTNAME=jdk_swing}
 
--- a/make/netbeans/jmx/build.properties	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/netbeans/jmx/build.properties	Tue Jan 08 19:02:55 2013 -0500
@@ -38,6 +38,7 @@
     com/sun/jmx/snmp/
 
 jtreg.tests=\
+    com/sun/jmx/ \
     com/sun/management/ \
     java/lang/management/ \
     javax/management/
--- a/make/sun/security/Makefile	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/sun/security/Makefile	Tue Jan 08 19:02:55 2013 -0500
@@ -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
--- a/make/tools/src/build/tools/cldrconverter/Bundle.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/tools/src/build/tools/cldrconverter/Bundle.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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;
+    }
 }
--- a/make/tools/src/build/tools/cldrconverter/BundleGenerator.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/tools/src/build/tools/cldrconverter/BundleGenerator.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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;
 }
--- a/make/tools/src/build/tools/cldrconverter/CLDRConverter.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/tools/src/build/tools/cldrconverter/CLDRConverter.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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) {
--- a/make/tools/src/build/tools/cldrconverter/LDMLParseHandler.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/tools/src/build/tools/cldrconverter/LDMLParseHandler.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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)) {
--- a/make/tools/src/build/tools/cldrconverter/MetaZonesParseHandler.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/tools/src/build/tools/cldrconverter/MetaZonesParseHandler.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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":
--- a/make/tools/src/build/tools/cldrconverter/ResourceBundleGenerator.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/make/tools/src/build/tools/cldrconverter/ResourceBundleGenerator.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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() {");
+                if (fmt != null) {
+                    out.print(fmt.toString());
                 }
-                out.println("    @Override\n" +
-                            "    protected final Object[][] getContents() {\n" +
-                            "        final Object[][] data = new Object[][] {");
+                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[] {");
--- a/makefiles/CompileDemos.gmk	Tue Jan 08 19:00:12 2013 -0500
+++ b/makefiles/CompileDemos.gmk	Tue Jan 08 19:02:55 2013 -0500
@@ -166,9 +166,9 @@
 $(eval $(call SetupDemo,SwingApplet,jfc,,SwingApplet,,,README* *.html))
 $(eval $(call SetupDemo,TableExample,jfc,,TableExample,,,README*))
 $(eval $(call SetupDemo,TransparentRuler,jfc,,transparentruler.Ruler,,,README*))
-$(eval $(call SetupDemo,jconsole-plugin,scripting,-cp $(JDK_OUTPUTDIR)/lib/jconsole.jar,,,,*.xml *.txt,,,,Main-Class: \n))
+$(eval $(call SetupDemo,jconsole-plugin,scripting,,,,,*.xml *.txt,,,,Main-Class: \n))
 $(eval $(call SetupDemo,FullThreadDump,management,,FullThreadDump,,,README*))
-$(eval $(call SetupDemo,JTop,management,-cp $(JDK_OUTPUTDIR)/lib/jconsole.jar,JTop,,,README*))
+$(eval $(call SetupDemo,JTop,management,,JTop,,,README*))
 $(eval $(call SetupDemo,MemoryMonitor,management,,MemoryMonitor,,,README*))
 $(eval $(call SetupDemo,VerboseGC,management,,VerboseGC,,,README*))
 $(eval $(call SetupDemo,zipfs,nio,,,,,README* *.java,,,,Main-Class: \n))
@@ -194,15 +194,6 @@
 
 ##################################################################################################
 
-# Why do we install a demo jar into the main jre/lib/ext????????????????
-$(JDK_OUTPUTDIR)/lib/ext/zipfs.jar : $(JDK_OUTPUTDIR)/demo/nio/zipfs/zipfs.jar
-		$(MKDIR) -p $(@D)
-		$(CP) $< $@
-
-BUILD_DEMOS += $(JDK_OUTPUTDIR)/lib/ext/zipfs.jar
-
-##################################################################################################
-
 # In the old makefiles, j2dbench was not compiled. 
 #$(eval $(call SetupDemo,J2DBench,java2d,/src,,j2dbench/J2DBench))
 
--- a/makefiles/CompileJavaClasses.gmk	Tue Jan 08 19:00:12 2013 -0500
+++ b/makefiles/CompileJavaClasses.gmk	Tue Jan 08 19:02:55 2013 -0500
@@ -121,6 +121,7 @@
 	     sun/nio/fs/LinuxFileStore.java \
 	     sun/nio/fs/LinuxFileSystem.java \
 	     sun/nio/fs/LinuxFileSystemProvider.java \
+	     sun/nio/fs/MagicFileTypeDetector.java \
 	     sun/nio/fs/LinuxNativeDispatcher.java \
 	     sun/nio/fs/LinuxUserDefinedFileAttributeView.java \
 	     sun/nio/fs/LinuxWatchService.java
@@ -220,24 +221,10 @@
 EXFILES+=-linux-arm.java \
 	 -linux-ppc.java
 
-# TODO: Is this necessary?
 ifeq ($(OPENJDK_TARGET_OS), windows)
     EXFILES+=sun/nio/ch/AbstractPollSelectorImpl.java \
-	sun/nio/ch/DevPollArrayWrapper.java \
-	sun/nio/ch/DevPollSelectorImpl.java \
-        sun/nio/ch/DevPollSelectorProvider.java \
-	sun/nio/ch/InheritedChannel.java \
         sun/nio/ch/PollSelectorProvider.java \
-        sun/nio/ch/PollSelectorImpl.java \
-	sun/nio/ch/Port.java \
-	sun/nio/ch/SimpleAsynchronousFileChannelImpl.java \
-	sun/nio/ch/SolarisAsynchronousChannelProvider.java \
-	sun/nio/ch/SolarisEventPort.java \
-	sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java \
-	sun/nio/ch/UnixAsynchronousSocketChannelImpl.java
-    EXFILES+=sun/net/sdp/SdpProvider.java
-else
-    EXFILES+=sun/net/www/protocol/http/ntlm/NTLMAuthSequence.java
+	sun/nio/ch/SimpleAsynchronousFileChannelImpl.java
 endif
 
 # Exclude nimbus files from rt.jar
@@ -338,29 +325,14 @@
 
 ##########################################################################################
 
-#
-# This is an empty jar (only contains manifest) and fits poorly into framework...
-#   create simple rule instead
-#
-MANAGEMENT_AGENT_JAR_DEPS := $(JDK_TOPDIR)/src/share/classes/sun/management/manifest
-
-$(JDK_OUTPUTDIR)/lib/management-agent.jar : $(JDK_TOPDIR)/src/share/classes/sun/management/manifest
-	$(JAR) cfm $@ $(JDK_TOPDIR)/src/share/classes/sun/management/manifest
-
-JARS += $(JDK_OUTPUTDIR)/lib/management-agent.jar
-
-##########################################################################################
-
 ifndef OPENJDK
 
-$(eval $(call SetupJavaCompilation,BUILD_ALTCLASSES_JAR,\
+    $(eval $(call SetupJavaCompilation,BUILD_ALTCLASSES,\
 		SETUP:=GENERATE_JDKBYTECODE,\
 		SRC:=$(JDK_TOPDIR)/src/closed/share/altclasses, \
-		BIN:=$(JDK_OUTPUTDIR)/altclasses_classes,\
-		JAR:=$(JDK_OUTPUTDIR)/lib/alt-rt.jar))
+		BIN:=$(JDK_OUTPUTDIR)/altclasses_classes))
 
-$(BUILD_ALTCLASSES_JAR): $(BUILD_JDK)
-JARS += $(JDK_OUTPUTDIR)/lib/alt-rt.jar
+    $(BUILD_ALTCLASSES): $(BUILD_JDK)
 
 endif
 
@@ -383,7 +355,7 @@
      SERVER_DIR:=$(SJAVAC_SERVER_DIR),\
      SERVER_JVM:=$(SJAVAC_SERVER_JAVA)))
 
-$(eval $(call SetupJavaCompilation,BUILD_JOBJC_JAR,\
+$(eval $(call SetupJavaCompilation,BUILD_JOBJC,\
 		SETUP:=GENERATE_15BYTECODE,\
 		DISABLE_SJAVAC:=true,\
 		SRC:=$(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/java \
@@ -395,11 +367,9 @@
 		JAR:=$(JDK_OUTPUTDIR)/lib/JObjC.jar, \
 		JARINDEX := true))
 
-$(BUILD_JOBJC_JAR) : $(BUILD_JDK)
+$(BUILD_JOBJC) : $(BUILD_JDK)
 
-JARS += $(JDK_OUTPUTDIR)/lib/JObjC.jar
-
-$(eval $(call SetupJavaCompilation,BUILD_JOBJC_HEADERS_JAR,\
+$(eval $(call SetupJavaCompilation,BUILD_JOBJC_HEADERS,\
 		SETUP:=GENERATE_JDKBYTECODE,\
 		SRC:=$(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/java \
 		     $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/java \
@@ -409,16 +379,15 @@
 		BIN:=$(JDK_OUTPUTDIR)/jobjc_classes_headers,\
 		HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers_jobjc))
 
-$(BUILD_JOBJC_HEADERS_JAR) : $(BUILD_JDK)
-
-JARS += $(BUILD_JOBJC_HEADERS_JAR)
+$(BUILD_JOBJC_HEADERS) : $(BUILD_JDK)
 
 endif
 
 ##########################################################################################
 
 # copy with -a to preserve timestamps so dependencies down the line aren't messed up
-all: $(BUILD_JDK) $(JARS) $(COPY_EXTRA) $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin \
+all: $(BUILD_JDK) $(BUILD_ALTCLASSES) $(BUILD_JOBJC) $(BUILD_JOBJC_HEADERS) $(COPY_EXTRA) \
+	$(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin \
 	$(JDK_OUTPUTDIR)/gensrc_headers/_the.jdk.base.headers
 
 .PHONY: all
--- a/makefiles/CompileLaunchers.gmk	Tue Jan 08 19:00:12 2013 -0500
+++ b/makefiles/CompileLaunchers.gmk	Tue Jan 08 19:02:55 2013 -0500
@@ -238,7 +238,7 @@
     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jar.Main"$(COMMA) }'))
 
 $(eval $(call SetupLauncher,jarsigner,\
-    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.jarSigner.Main"$(COMMA) }'))
+    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.jarsigner.Main"$(COMMA) }'))
 
 $(eval $(call SetupLauncher,javac,\
     -DEXPAND_CLASSPATH_WILDCARDS \
--- a/makefiles/CompileNativeLibraries.gmk	Tue Jan 08 19:00:12 2013 -0500
+++ b/makefiles/CompileNativeLibraries.gmk	Tue Jan 08 19:02:55 2013 -0500
@@ -104,7 +104,7 @@
 		LANG:=C,\
 		CFLAGS:=$(CFLAGS_JDKLIB) \
 			-I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include,\
-		LDFLAGS:=-nostdlib -r -arch i386 -arch x86_64,\
+		LDFLAGS:=-nostdlib -r -arch x86_64,\
 		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libfdlibm))
 
 $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) : $(BUILD_LIBFDLIBM)
@@ -125,7 +125,7 @@
 
 LIBVERIFY_OPTIMIZATION:=HIGH
 ifneq ($(findstring $(OPENJDK_TARGET_OS),solaris linux),)
-    ifeq ($(ENABLE_DEBUG_SYMBOLS), yes)
+    ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
         LIBVERIFY_OPTIMIZATION:=LOW
     endif
 endif
@@ -240,7 +240,7 @@
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN), \
 		LDFLAGS_SUFFIX_posix:=-ljvm -lverify, \
-		LDFLAGS_SUFFIX_solaris:=-lnsl -lsocket -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc,\
+		LDFLAGS_SUFFIX_solaris:=-lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc,\
 		LDFLAGS_SUFFIX_linux:=$(LIBDL) $(BUILD_LIBFDLIBM),\
 		LDFLAGS_SUFFIX_macosx:=-L$(JDK_OUTPUTDIR)/objs/ -lfdlibm \
                                          -framework CoreFoundation \
@@ -905,57 +905,34 @@
 
 ##########################################################################################
 
-BUILD_LIBZIP_FILES:=\
-        CRC32.c \
-	Adler32.c \
-	Deflater.c \
-	Inflater.c \
-	ZipFile.c \
-	zip_util.c
-
+BUILD_LIBZIP_EXCLUDES :=
 ifeq ($(USE_EXTERNAL_LIBZ),true)
-	LIBZ:=-lz
+    LIBZ := -lz
+    LIBZIP_EXCLUDES += zlib-1.2.5
 else
-BUILD_LIBZIP_FILES += \
-	compress.c \
-	deflate.c \
-	gzclose.c \
-	gzlib.c \
-	gzread.c \
-	gzwrite.c \
-	infback.c \
-	inffast.c \
-	inflate.c \
-	inftrees.c \
-	trees.c \
-	uncompr.c \
-	zadler32.c \
-	zcrc32.c \
-	zutil.c
-LIBZ_INCLUDE:=-I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
+    ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
 endif
 
-BUILD_LIBZIP_REORDER:=
+BUILD_LIBZIP_REORDER :=
 ifeq ($(OPENJDK_TARGET_OS), solaris)
     ifneq ($(OPENJDK_TARGET_CPU), x86_64)
-        BUILD_LIBZIP_REORDER:=$(JDK_TOPDIR)/makefiles/mapfiles/libzip/reorder-$(OPENJDK_TARGET_CPU)
+        BUILD_LIBZIP_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libzip/reorder-$(OPENJDK_TARGET_CPU)
     endif
 endif
 
 ifeq ($(LIBZIP_CAN_USE_MMAP), true)
-     BUILD_LIBZIP_MMAP:=-DUSE_MMAP
+     BUILD_LIBZIP_MMAP := -DUSE_MMAP
 endif
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBZIP,\
                 LIBRARY:=zip,\
                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
-                SRC:=$(JDK_TOPDIR)/src/share/native/java/util/zip \
-                     $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5,\
-		INCLUDE_FILES:=$(BUILD_LIBZIP_FILES), \
 		LANG:=C,\
 		OPTIMIZATION:=LOW, \
+		SRC:=$(JDK_TOPDIR)/src/share/native/java/util/zip,\
+		EXCLUDES:=$(LIBZIP_EXCLUDES),\
 		CFLAGS:=$(CFLAGS_JDKLIB) \
-                        $(LIBZ_INCLUDE) \
+                        $(ZLIB_CPPFLAGS) \
 		        -I$(JDK_TOPDIR)/src/share/native/java/io \
                         -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io,\
 		CFLAGS_posix:=$(BUILD_LIBZIP_MMAP) -UDEBUG,\
@@ -1238,15 +1215,7 @@
     $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS,\
                 LIBRARY:=lcms,\
                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
-                SRC:=$(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms \
-		     $(JDK_TOPDIR)/src/share/native/sun/java2d/,\
-		INCLUDE_FILES:=cmscam02.c cmscgats.c cmscnvrt.c cmserr.c \
-			       cmsgamma.c cmsgmt.c cmsintrp.c cmsio0.c \
-			       cmsio1.c cmslut.c cmsmd5.c cmsmtrx.c \
-			       cmsnamed.c cmsopt.c cmshalf.c cmspack.c cmspcs.c \
-			       cmsplugin.c cmsps2.c cmssamp.c cmssm.c \
-			       cmstypes.c cmsvirt.c cmswtpnt.c cmsxform.c \
-			       LCMS.c,\
+                SRC:=$(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms,\
 		LANG:=C,\
 		OPTIMIZATION:=LOW, \
 		CFLAGS:=$(filter-out -xc99=%none,$(CFLAGS_JDKLIB)) \
@@ -1676,7 +1645,7 @@
 
 LIBMANAGEMENT_OPTIMIZATION:=HIGH
 ifneq ($(findstring $(OPENJDK_TARGET_OS),solaris linux),)
-    ifeq ($(ENABLE_DEBUG_SYMBOLS), yes)
+    ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
         LIBMANAGEMENT_OPTIMIZATION:=LOW
     endif
 endif
@@ -1719,7 +1688,7 @@
 
 LIBHPROF_OPTIMIZATION:=HIGHEST
 ifneq ($(findstring $(OPENJDK_TARGET_OS),solaris linux),)
-    ifeq ($(ENABLE_DEBUG_SYMBOLS), yes)
+    ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
         LIBHPROF_OPTIMIZATION:=LOW
     endif
 endif
@@ -1928,6 +1897,7 @@
 		UnixAsynchronousServerSocketChannelImpl.c \
 		UnixAsynchronousSocketChannelImpl.c \
 		GnomeFileTypeDetector.c \
+		MagicFileTypeDetector.c \
 		LinuxNativeDispatcher.c \
 		LinuxWatchService.c \
 		UnixCopyFile.c \
@@ -2006,7 +1976,7 @@
 ##########################################################################################
 
 ifeq ($(OPENJDK_TARGET_OS_API),posix)
-  # TODO make this work on macosx
+
   ifneq ($(OPENJDK_TARGET_OS),macosx)
 
     SCTP_WERROR := -Werror
@@ -2034,7 +2004,6 @@
 		LDFLAGS_SUFFIX_posix:=-lnio -lnet,\
 		LDFLAGS_SUFFIX_solaris:=-lsocket -ljava -ljvm -lc,\
 		LDFLAGS_SUFFIX_macosx:=-ljava -ljvm,\
-		INCLUDE_FILES:=SctpNet.c SctpChannelImpl.c SctpServerChannelImpl.c,\
 		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsctp))
 
     BUILD_LIBRARIES += $(BUILD_LIBSCTP)
@@ -2105,7 +2074,7 @@
 
 ifneq ($(USE_EXTERNAL_LIBZ),true)
 	BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
-	LIBJLI_CFLAGS += $(LIBZ_INCLUDE)
+	LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
 	BUILD_LIBJLI_FILES += \
 		inflate.c \
 		inftrees.c \
@@ -2267,7 +2236,7 @@
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
 		LDFLAGS_SUFFIX_linux:=-lc -lpthread,\
 		LDFLAGS_SUFFIX_windows:=$(WIN_JAVA_LIB) advapi32.lib user32.lib version.lib, \
-		LDFLAGS_SUFFIX:=-lm $(LDFLAGS_JDKLIB_SUFFIX),\
+		LDFLAGS_SUFFIX_posix:=-lm -ljava -ljvm,\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc,\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
@@ -2416,8 +2385,14 @@
 	$(JDK_TOPDIR)/src/share/native/sun/awt/giflib \
 	$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \
 	$(JDK_TOPDIR)/src/share/native/sun/awt/libpng \
-	$(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen \
-        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
+	$(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen
+
+ifneq ($(OPENJDK_TARGET_OS), macosx)
+    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
+else
+    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen
+endif
+
 
 LIBSPLASHSCREEN_CFLAGS:=-DSPLASHSCREEN -DPNG_NO_MMX_CODE \
 	$(foreach dir,$(LIBSPLASHSCREEN_DIRS),-I$(dir))
@@ -2443,104 +2418,11 @@
 	LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
 endif
 
-LIBSPLASHSCREEN_FILES:=\
-	java_awt_SplashScreen.c \
-	splashscreen_gfx_impl.c \
-	splashscreen_gif.c \
-	splashscreen_impl.c \
-	splashscreen_jpeg.c \
-	splashscreen_png.c \
-	png.c \
-	pngerror.c \
-	pngget.c \
-	pngmem.c  \
-	pngpread.c \
-	pngread.c \
-	pngrio.c \
-	pngrtran.c \
-	pngrutil.c \
-	pngset.c \
-	pngtrans.c \
-	pngwio.c \
-	pngwrite.c \
-	pngwtran.c \
-	pngwutil.c \
-	dgif_lib.c \
-	gif_err.c \
-	gifalloc.c \
-	jcomapi.c \
-	jdapimin.c \
-	jdapistd.c \
-	jdcoefct.c \
-	jdcolor.c \
-	jddctmgr.c \
-	jdhuff.c \
-	jdinput.c \
-	jdmainct.c \
-	jdmarker.c \
-	jdmaster.c \
-	jdmerge.c \
-	jdphuff.c \
-	jdpostct.c \
-	jdsample.c \
-	jerror.c \
-	jidctflt.c \
-	jidctfst.c \
-	jidctint.c \
-	jidctred.c \
-	jmemmgr.c \
-	jmemnobs.c \
-	jquant1.c \
-	jquant2.c \
-	jutils.c \
-	jcapimin.c \
-	jcapistd.c \
-	jccoefct.c \
-	jccolor.c \
-	jcdctmgr.c \
-	jchuff.c \
-	jcinit.c \
-	jcmainct.c \
-	jcmarker.c \
-	jcmaster.c \
-	jcparam.c \
-	jcphuff.c \
-	jcprepct.c \
-	jcsample.c \
-	jctrans.c \
-	jdtrans.c \
-	jfdctflt.c \
-	jfdctfst.c \
-	jfdctint.c
-
-ifneq ($(OPENJDK_TARGET_OS), macosx)
-LIBSPLASHSCREEN_FILES += splashscreen_sys.c
-else
-LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen
-LIBSPLASHSCREEN_FILES += splashscreen_sys.m
-endif
-
 LIBSPLASHSCREEN_LDFLAGS_SUFFIX:=
 
 ifneq ($(USE_EXTERNAL_LIBZ),true)
 	LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
-	LIBSPLASHSCREEN_CFLAGS += $(LIBZ_INCLUDE)
-	LIBSPLASHSCREEN_FILES += \
-		compress.c \
-		deflate.c \
-		gzclose.c \
-		gzlib.c \
-		gzread.c \
-		gzwrite.c \
-		infback.c \
-		inffast.c \
-		inflate.c \
-		inftrees.c \
-		trees.c \
-		uncompr.c \
-		zadler32.c \
-		zcrc32.c \
-		zutil.c
+	LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
 endif
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
@@ -2560,7 +2442,7 @@
 		LIBRARY:=splashscreen,\
                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(LIBSPLASHSCREEN_DIRS),\
-		INCLUDE_FILES:=$(LIBSPLASHSCREEN_FILES),\
+		EXCLUDE_FILES:=imageioJPEG.c jpegdecoder.c pngtest.c,\
 		LANG:=C,\
 		OPTIMIZATION:=LOW, \
 		CFLAGS:=$(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB),\
@@ -2658,6 +2540,7 @@
 ##########################################################################################
 
 ifneq ($(OPENJDK_TARGET_OS), windows)
+ifneq ($(OPENJDK_TARGET_OS), macosx)
 $(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS,\
 		LIBRARY:=j2gss,\
                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
@@ -2677,20 +2560,20 @@
 
 BUILD_LIBRARIES += $(BUILD_LIBJ2GSS)
 endif
+endif
 
 ##########################################################################################
 
 BUILD_LIBKRB5_NAME:=
 ifeq ($(OPENJDK_TARGET_OS), windows)
      BUILD_LIBKRB5_NAME:=w2k_lsa_auth
-     BUILD_LIBKRB5_FILES:=NativeCreds.c WindowsDirectory.c
      BUILD_LIBKRB5_SRC:=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/krb5
      BUILD_LIBKRB5_LIBS:=advapi32.lib Secur32.lib netapi32.lib kernel32.lib user32.lib \
 			 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib \
 			 ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib
 else ifeq ($(OPENJDK_TARGET_OS), macosx)
      BUILD_LIBKRB5_NAME:=osxkrb5
-     BUILD_LIBKRB5_FILES:=nativeccache.c
+     BUILD_LIBKRB5_SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/krb5
      BUILD_LIBKRB5_LIBS:=-framework Kerberos
 endif
 
@@ -2698,9 +2581,7 @@
 $(eval $(call SetupNativeCompilation,BUILD_LIBKRB5,\
 		LIBRARY:=$(BUILD_LIBKRB5_NAME),\
                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
-		SRC:=$(JDK_TOPDIR)/src/share/native/sun/security/krb5 \
-                     $(BUILD_LIBKRB5_SRC) ,\
-		INCLUDE_FILES:=$(BUILD_LIBKRB5_FILES),\
+		SRC:=$(BUILD_LIBKRB5_SRC),\
 		LANG:=C,\
 		OPTIMIZATION:=LOW, \
 		CFLAGS:=$(CFLAGS_JDKLIB) \
@@ -3071,18 +2952,11 @@
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
 
-LIBAPPLESCRIPTENGINE_FILES:=\
-	AppleScriptEngine.m \
-        AppleScriptExecutionContext.m \
-        AS_NS_ConversionUtils.m \
-        NS_Java_ConversionUtils.m
-
 $(eval $(call SetupNativeCompilation,BUILD_LIBAPPLESCRIPTENGINE,\
 		LIBRARY:=AppleScriptEngine,\
                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(JDK_TOPDIR)/src/macosx/native/apple/applescript,\
 		LANG:=C,\
-		INCLUDE_FILES:=$(LIBAPPLESCRIPTENGINE_FILES),\
 		OPTIMIZATION:=LOW, \
 		CFLAGS:=$(CFLAGS_JDKLIB) \
 			-I$(JDK_TOPDIR)/src/macosx/native/apple/applescript \
@@ -3107,18 +2981,11 @@
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
 
-LIBOSXAPP_FILES:=\
-	NSApplicationAWT.m \
-	QueuingApplicationDelegate.m \
-	PropertiesUtilities.m \
-	ThreadUtilities.m
-
 $(eval $(call SetupNativeCompilation,BUILD_LIBOSXAPP,\
 		LIBRARY:=osxapp,\
                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(JDK_TOPDIR)/src/macosx/native/sun/osxapp,\
 		LANG:=C,\
-		INCLUDE_FILES:=$(LIBOSXAPP_FILES),\
 		OPTIMIZATION:=LOW, \
 		CFLAGS:=$(CFLAGS_JDKLIB) \
 			-I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
@@ -3151,14 +3018,6 @@
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
 
-LIBOSX_FILES:=\
-    Dispatch.m \
-    CFileManager.m \
-    KeystoreImpl.m \
-    JavaAppLauncher.m \
-    MacOSXPreferencesFile.m \
-    SCDynamicStoreConfig.m
-
 LIBOSX_DIRS:=\
   $(JDK_TOPDIR)/src/macosx/native/com/apple/concurrent \
   $(JDK_TOPDIR)/src/macosx/native/java/util \
@@ -3171,7 +3030,6 @@
                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(LIBOSX_DIRS),\
 		LANG:=C,\
-		INCLUDE_FILES:=$(LIBOSX_FILES),\
 		OPTIMIZATION:=LOW, \
 		CFLAGS:=$(CFLAGS_JDKLIB) \
                         $(foreach dir,$(LIBOSX_DIRS),-I$(dir)) \
@@ -3341,22 +3199,11 @@
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
 
-LIBOSXUI_FILES:=\
-        AquaFileView.m \
-        AquaLookAndFeel.m \
-        AquaNativeResources.m \
-        JRSUIConstantSync.m \
-        JRSUIController.m \
-        JRSUIFocus.m \
-        ScreenPopupFactory.m \
-        ScreenMenu.m
-
 $(eval $(call SetupNativeCompilation,BUILD_LIBOSXUI,\
 		LIBRARY:=osxui,\
                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
 		SRC:=$(JDK_TOPDIR)/src/macosx/native/com/apple/laf,\
 		LANG:=C,\
-		INCLUDE_FILES:=$(LIBOSXUI_FILES),\
 		OPTIMIZATION:=LOW, \
 		CFLAGS:=$(CFLAGS_JDKLIB) \
                         -I$(JDK_TOPDIR)/src/macosx/native/com/apple/laf \
--- a/makefiles/CopyFiles.gmk	Tue Jan 08 19:00:12 2013 -0500
+++ b/makefiles/CopyFiles.gmk	Tue Jan 08 19:02:55 2013 -0500
@@ -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) $@
--- a/makefiles/CreateJars.gmk	Tue Jan 08 19:00:12 2013 -0500
+++ b/makefiles/CreateJars.gmk	Tue Jan 08 19:02:55 2013 -0500
@@ -420,6 +420,23 @@
 JARS+=$(IMAGES_OUTPUTDIR)/lib/jsse.jar
 
 ##########################################################################################
+# Create manifest for security jars
+
+#
+# Include these extra attributes for now, should probably take out.
+#
+JCE_MANIFEST := $(IMAGES_OUTPUTDIR)/lib/_the.security.manifest.mf
+$(JCE_MANIFEST): $(MAINMANIFEST)
+	$(MKDIR) -p $(@D)
+	$(RM) $@ $@.tmp
+	$(SED) -e "s#@@RELEASE@@#$(JDK_VERSION)#"       \
+               -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
+               $(MAINMANIFEST) >> $@.tmp
+	$(ECHO) "Extension-Name: javax.crypto" >> $@.tmp
+	$(ECHO) "Implementation-Vendor-Id: com.sun" >> $@.tmp
+	$(MV) $@.tmp $@
+
+##########################################################################################
 
 SUNPKCS11_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunpkcs11.jar
 
@@ -429,9 +446,7 @@
 
     $(SUNPKCS11_JAR_DST) : $(SUNPKCS11_JAR_SRC)
 	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunPKCS11 provider..."
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(CP) $< $@
+	$(install-file)
 
 else
 
@@ -440,8 +455,11 @@
 	SUFFIXES:=.class,\
 	INCLUDES:=sun/security/pkcs11,\
 	JAR:=$(SUNPKCS11_JAR_DST), \
+        MANIFEST:=$(JCE_MANIFEST), \
 	SKIP_METAINF := true))
 
+    $(SUNPKCS11_JAR_DST): $(JCE_MANIFEST)
+
 endif
 
 JARS += $(SUNPKCS11_JAR_DST)
@@ -452,23 +470,24 @@
 
 ifndef OPENJDK
 
-SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
+    SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
 
-$(SUNEC_JAR_DST) : $(SUNEC_JAR_SRC)
+    $(SUNEC_JAR_DST) : $(SUNEC_JAR_SRC)
 	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunEC provider..."
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(CP) $< $@
+	$(install-file)
 
 else
 
-$(eval $(call SetupArchive,BUILD_SUNEC_JAR,,\
+    $(eval $(call SetupArchive,BUILD_SUNEC_JAR,,\
 		SRCS:=$(JDK_OUTPUTDIR)/classes, \
 		SUFFIXES:=.class,\
 		INCLUDES:=sun/security/ec,\
 		JAR:=$(SUNEC_JAR_DST), \
+                MANIFEST:=$(JCE_MANIFEST), \
 		SKIP_METAINF := true))
 
+    $(SUNEC_JAR_DST): $(JCE_MANIFEST)
+
 endif
 
 JARS += $(SUNEC_JAR_DST)
@@ -495,9 +514,8 @@
 
     $(SUNJCE_PROVIDER_JAR_DST) : $(SUNJCE_PROVIDER_JAR_SRC)
 	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunJCE provider..."
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(CP) $< $@
+	$(install-file)
+
 else
 
     $(eval $(call SetupArchive,BUILD_SUNJCE_PROVIDER_JAR,,\
@@ -505,9 +523,11 @@
 		SUFFIXES:=.class,\
 		INCLUDES:= com/sun/crypto/provider,\
 		JAR:=$(SUNJCE_PROVIDER_JAR_DST), \
-		MANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf, \
-		EXTRA_MANIFEST_ATTR := Extension-Name: javax.crypto\nImplementation-Vendor-Id: com.sun, \
+                MANIFEST:=$(JCE_MANIFEST), \
 		SKIP_METAINF := true))
+
+    $(SUNJCE_PROVIDER_JAR_DST): $(JCE_MANIFEST)
+
 endif
 
 JARS += $(SUNJCE_PROVIDER_JAR_DST)
@@ -516,100 +536,110 @@
 
 ifndef OPENJDK
 
-JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
+    JCE_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
 
-$(JCE_JAR_DST) : $(JCE_JAR_SRC)
+    $(JCE_JAR_DST) : $(JCE_JAR_SRC)
 	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt jce.jar..."
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(CP) $< $@
+	$(install-file)
 
 else
 
-$(eval $(call SetupArchive,BUILD_JCE_JAR,,\
+    $(eval $(call SetupArchive,BUILD_JCE_JAR,,\
 		SRCS:=$(JDK_OUTPUTDIR)/classes, \
 		SUFFIXES:=.class,\
 		INCLUDES:= javax/crypto sun/security/internal,\
 		JAR:=$(JCE_JAR_DST), \
-		MANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf, \
-		EXTRA_MANIFEST_ATTR := Extension-Name: javax.crypto\nImplementation-Vendor-Id: com.sun, \
+                MANIFEST:=$(JCE_MANIFEST), \
 		SKIP_METAINF := true))
+
+    $(JCE_JAR_DST): $(JCE_MANIFEST)
+
 endif
 
 JARS += $(JCE_JAR_DST)
 
 ##########################################################################################
 
-ifdef OPENJDK
+US_EXPORT_POLICY_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/security/US_export_policy.jar
 
-#
-# TODO fix so that SetupArchive does not write files into SRCS
-#   then we don't need this extra copying
-#
-# NOTE:  We currently do not place restrictions on our limited export
-# policy.  This was not a typo.
-#
-US_EXPORT_POLICY_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/security/US_export_policy.jar
-US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
-US_EXPORT_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/US_export_policy_jar.tmp
+ifndef OPENJDK
 
-$(US_EXPORT_POLICY_JAR_TMP)/% : $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(CP) $< $@
 
-US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
+    $(US_EXPORT_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar
+	$(ECHO) $(LOG_INFO) Copying $(@F)
+	$(install-file)
 
-$(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR,$(US_EXPORT_POLICY_JAR_DEPS),\
+else
+
+    #
+    # TODO fix so that SetupArchive does not write files into SRCS
+    #   then we don't need this extra copying
+    #
+    # NOTE:  We currently do not place restrictions on our limited export
+    # policy.  This was not a typo.
+    #
+    US_EXPORT_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
+    US_EXPORT_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/US_export_policy_jar.tmp
+
+    $(US_EXPORT_POLICY_JAR_TMP)/% : $(US_EXPORT_POLICY_JAR_SRC_DIR)/%
+	$(install-file)
+
+    US_EXPORT_POLICY_JAR_DEPS := $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy
+
+    $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR,$(US_EXPORT_POLICY_JAR_DEPS),\
 		SRCS:=$(US_EXPORT_POLICY_JAR_TMP), \
 		SUFFIXES:= .policy,\
 		JAR:=$(US_EXPORT_POLICY_JAR_DST), \
 		EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \
 		SKIP_METAINF := true))
 
+endif
+
 JARS += $(US_EXPORT_POLICY_JAR_DST)
 
-endif
-
 ##########################################################################################
 
+LOCAL_POLICY_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/security/local_policy.jar
 
-ifdef OPENJDK
+ifndef OPENJDK
 
-#
-# TODO fix so that SetupArchive does not write files into SRCS
-#   then we don't need this extra copying
-#
-LOCAL_POLICY_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/security/local_policy.jar
-LOCAL_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/local_policy_jar.tmp
+    $(LOCAL_POLICY_JAR_DST): $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar
+	$(ECHO) $(LOG_INFO) Copying $(@F)
+	$(install-file)
 
-ifeq ($(UNLIMITED_CRYPTO), true)
-    LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
-    LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/default_local.policy
-    LOCAL_POLICY_JAR_ATTR := Crypto-Strength: unlimited
 else
-    LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/limited
-    LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy \
-			 $(LOCAL_POLICY_JAR_TMP)/default_local.policy
-    LOCAL_POLICY_JAR_ATTR := Crypto-Strength: limited
-endif
 
-$(LOCAL_POLICY_JAR_TMP)/% : $(LOCAL_POLICY_JAR_SRC_DIR)/%
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(CP) $< $@
+    #
+    # TODO fix so that SetupArchive does not write files into SRCS
+    #   then we don't need this extra copying
+    #
+    LOCAL_POLICY_JAR_TMP := $(IMAGES_OUTPUTDIR)/local_policy_jar.tmp
 
-$(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR,$(LOCAL_POLICY_JAR_DEPS),\
+    ifeq ($(UNLIMITED_CRYPTO), true)
+        LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/unlimited
+        LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/default_local.policy
+        LOCAL_POLICY_JAR_ATTR := Crypto-Strength: unlimited
+    else
+        LOCAL_POLICY_JAR_SRC_DIR := $(JDK_TOPDIR)/make/javax/crypto/policy/limited
+        LOCAL_POLICY_JAR_DEPS := $(LOCAL_POLICY_JAR_TMP)/exempt_local.policy \
+                                 $(LOCAL_POLICY_JAR_TMP)/default_local.policy
+        LOCAL_POLICY_JAR_ATTR := Crypto-Strength: limited
+    endif
+
+    $(LOCAL_POLICY_JAR_TMP)/% : $(LOCAL_POLICY_JAR_SRC_DIR)/%
+	$(install-file)
+
+    $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR,$(LOCAL_POLICY_JAR_DEPS),\
 		SRCS:=$(LOCAL_POLICY_JAR_TMP),\
 		SUFFIXES:= .policy,\
 		JAR:=$(LOCAL_POLICY_JAR_DST), \
 		EXTRA_MANIFEST_ATTR := $(LOCAL_POLICY_JAR_ATTR), \
 		SKIP_METAINF := true))
 
+endif
+
 JARS += $(LOCAL_POLICY_JAR_DST)
 
-endif
-
 ##########################################################################################
 
 ifeq ($(OPENJDK_TARGET_OS),windows)
@@ -621,9 +651,7 @@
 
 $(SUNMSCAPI_JAR_DST) : $(SUNMSCAPI_JAR_SRC)
 	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunMSCAPI provider..."
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(CP) $< $@
+	$(install-file)
 
 else
 
@@ -649,9 +677,7 @@
 
 $(UCRYPTO_JAR_DST) : $(UCRYPTO_JAR_SRC)
 	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..."
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(CP) $< $@
+	$(install-file)
 
 JARS += $(UCRYPTO_JAR_DST)
 
@@ -703,6 +729,7 @@
 	com/sun/source          \
 	com/sun/tools/classfile \
 	com/sun/tools/doclets   \
+	com/sun/tools/doclint   \
 	com/sun/tools/example/debug/expr \
 	com/sun/tools/example/debug/tty  \
 	com/sun/tools/extcheck  \
@@ -870,14 +897,10 @@
 			$(LAUNCHER_SRC_FILES)))
 
 $(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/share/bin/%
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(CP) $< $@
+	$(install-file)
 
 $(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/%
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(CP) $< $@
+	$(install-file)
 
 $(IMAGES_OUTPUTDIR)/src.zip: $(LAUNCHER_ZIP_SRC)
 
@@ -895,6 +918,55 @@
 
 ##########################################################################################
 
+#
+# This is an empty jar (only contains manifest) and fits poorly into framework...
+#   create simple rule instead
+#
+$(IMAGES_OUTPUTDIR)/lib/management-agent.jar : $(JDK_TOPDIR)/src/share/classes/sun/management/manifest
+	$(JAR) cfm $@ $<
+
+JARS += $(IMAGES_OUTPUTDIR)/lib/management-agent.jar
+
+##########################################################################################
+
+$(IMAGES_OUTPUTDIR)/lib/ext/zipfs.jar : $(JDK_OUTPUTDIR)/demo/nio/zipfs/zipfs.jar
+	$(install-file)
+
+JARS += $(IMAGES_OUTPUTDIR)/lib/ext/zipfs.jar
+
+##########################################################################################
+
+ifeq ($(OPENJDK_TARGET_OS),macosx)
+    $(eval $(call SetupArchive,BUILD_JOBJC_JAR,,\
+		SRCS:=$(JDK_OUTPUTDIR)/jobjc_classes,\
+		JAR:=$(IMAGES_OUTPUTDIR)/lib/JObjC.jar, \
+		JARINDEX:=true))
+
+    JARS += $(IMAGES_OUTPUTDIR)/lib/JObjC.jar
+endif
+
+##########################################################################################
+
+ifndef OPENJDK
+    $(eval $(call SetupArchive,BUILD_ALT_RT_JAR,,\
+		SRCS:=$(JDK_OUTPUTDIR)/altclasses_classes,\
+		JAR:=$(IMAGES_OUTPUTDIR)/lib/alt-rt.jar))
+
+    JARS += $(IMAGES_OUTPUTDIR)/lib/alt-rt.jar
+endif
+
+##########################################################################################
+
+# This file is imported from hotspot in Import.gmk. Copying it into images/lib so that
+# all jars can be found in one place when creating images in Images.gmk. It needs to be
+# done here so that clean targets can be simple and accurate.
+$(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar: $(JDK_OUTPUTDIR)/lib/sa-jdi.jar
+	$(install-file)
+
+JARS += $(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar
+
+##########################################################################################
+
 -include $(CUSTOM_MAKE_DIR)/CreateJars.gmk
 
 ##########################################################################################
--- a/makefiles/Images.gmk	Tue Jan 08 19:00:12 2013 -0500
+++ b/makefiles/Images.gmk	Tue Jan 08 19:02:55 2013 -0500
@@ -211,10 +211,11 @@
 endif
 
 # Find all files to copy from $(JDK_OUTPUTDIR)/lib
+# Jar files are not expected to be here
 ALL_JDKOUT_LIB_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \
-                       \( -name "_the*" -o -name "javac_state " \) )
+                       \( -name "_the*" -o -name "javac_state " -o -name "*.jar" \) )
 # Find all files to copy from $(IMAGES_OUTPUTDIR)/lib
-# This might not exist if building overlay-images
+# This is were the jar files are and might not exist if building overlay-images
 ifneq ($(wildcard $(IMAGES_OUTPUTDIR)/lib),)
     ALL_IMAGES_LIB_LIST := $(shell $(FIND) $(IMAGES_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \
                        \( -name "_the*" -o -name "javac_state " \) )
--- a/makefiles/Import.gmk	Tue Jan 08 19:00:12 2013 -0500
+++ b/makefiles/Import.gmk	Tue Jan 08 19:02:55 2013 -0500
@@ -231,22 +231,6 @@
 endef
 endif
 
-ifndef OPENJDK
-
-IMPORT_TARGET_FILES += \
-            $(JDK_OUTPUTDIR)/lib/security/US_export_policy.jar \
-            $(JDK_OUTPUTDIR)/lib/security/local_policy.jar
-
-$(JDK_OUTPUTDIR)/lib/security/local_policy.jar: $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar
-	$(ECHO) $(LOG_INFO) Copying $(@F)
-	$(install-file)
-
-$(JDK_OUTPUTDIR)/lib/security/US_export_policy.jar: $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar
-	$(ECHO) $(LOG_INFO) Copying $(@F)
-	$(install-file)
-
-endif # OPENJDK
-
 #######
 
 all: $(IMPORT_TARGET_FILES)
--- a/makefiles/mapfiles/libnio/mapfile-linux	Tue Jan 08 19:00:12 2013 -0500
+++ b/makefiles/mapfiles/libnio/mapfile-linux	Tue Jan 08 19:02:55 2013 -0500
@@ -130,6 +130,8 @@
 		Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGio;
 		Java_sun_nio_fs_GnomeFileTypeDetector_initializeGnomeVfs;
 		Java_sun_nio_fs_GnomeFileTypeDetector_probeUsingGnomeVfs;
+		Java_sun_nio_fs_MagicFileTypeDetector_initialize0;
+		Java_sun_nio_fs_MagicFileTypeDetector_probe0;
 		Java_sun_nio_fs_LinuxWatchService_eventSize;
 		Java_sun_nio_fs_LinuxWatchService_eventOffsets;
 		Java_sun_nio_fs_LinuxWatchService_inotifyInit;
--- a/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java	Tue Jan 08 19:02:55 2013 -0500
@@ -714,7 +714,8 @@
 
             "PopupMenu.font", menuFont,
             "PopupMenu.background", menuBackgroundColor,
-            "PopupMenu.translucentBackground", translucentWhite,
+            // Fix for 7154516: make popups opaque
+            "PopupMenu.translucentBackground", white,
             "PopupMenu.foreground", menuForegroundColor,
             "PopupMenu.selectionBackground", menuSelectedBackgroundColor,
             "PopupMenu.selectionForeground", menuSelectedForegroundColor,
--- a/src/macosx/classes/sun/awt/CGraphicsConfig.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/classes/sun/awt/CGraphicsConfig.java	Tue Jan 08 19:02:55 2013 -0500
@@ -31,13 +31,16 @@
 
 import sun.java2d.SurfaceData;
 import sun.java2d.opengl.CGLLayer;
+import sun.lwawt.LWGraphicsConfig;
 import sun.lwawt.macosx.CPlatformView;
 
-public class CGraphicsConfig extends GraphicsConfiguration {
+public abstract class CGraphicsConfig extends GraphicsConfiguration
+        implements LWGraphicsConfig {
+
     private final CGraphicsDevice device;
     private ColorModel colorModel;
 
-    public CGraphicsConfig(CGraphicsDevice device) {
+    protected CGraphicsConfig(CGraphicsDevice device) {
         this.device = device;
     }
 
@@ -84,88 +87,20 @@
         return new AffineTransform(xscale, 0.0, 0.0, yscale, 0.0, 0.0);
     }
 
-
-    /**
-     * The following methods are invoked from CToolkit.java and
-     * LWWindowPeer.java rather than having the native
-     * implementations hardcoded in those classes.  This way the appropriate
-     * actions are taken based on the peer's GraphicsConfig, whether it is
-     * an CGLGraphicsConfig or something else.
-     */
-
     /**
      * Creates a new SurfaceData that will be associated with the given
      * LWWindowPeer.
      */
-    public SurfaceData createSurfaceData(CPlatformView pView) {
-        throw new UnsupportedOperationException("not implemented");
-    }
+    public abstract SurfaceData createSurfaceData(CPlatformView pView);
 
     /**
      * Creates a new SurfaceData that will be associated with the given
      * CGLLayer.
      */
-    public SurfaceData createSurfaceData(CGLLayer layer) {
-        throw new UnsupportedOperationException("not implemented");
-    }
-
-    /**
-     * Creates a new hidden-acceleration image of the given width and height
-     * that is associated with the target Component.
-     */
-    public Image createAcceleratedImage(Component target,
-                                        int width, int height)
-    {
-        throw new UnsupportedOperationException("not implemented");
-    }
-
-    /**
-     * The following methods correspond to the multibuffering methods in
-     * LWWindowPeer.java...
-     */
-
-    /**
-     * Attempts to create a native backbuffer for the given peer.  If
-     * the requested configuration is not natively supported, an AWTException
-     * is thrown.  Otherwise, if the backbuffer creation is successful, a
-     * handle to the native backbuffer is returned.
-     */
-    public long createBackBuffer(CPlatformView pView,
-                                 int numBuffers, BufferCapabilities caps)
-        throws AWTException
-    {
-        throw new UnsupportedOperationException("not implemented");
-    }
-
-    public void destroyBackBuffer(long backBuffer)
-        throws AWTException
-    {
-        throw new UnsupportedOperationException("not implemented");
-    }
-
-    /**
-     * Creates a VolatileImage that essentially wraps the target Component's
-     * backbuffer, using the provided backbuffer handle.
-     */
-    public VolatileImage createBackBufferImage(Component target,
-                                               long backBuffer)
-    {
-        throw new UnsupportedOperationException("not implemented");
-    }
-
-    /**
-     * Performs the native flip operation for the given target Component.
-     */
-    public void flip(CPlatformView delegate,
-                     Component target, VolatileImage xBackBuffer,
-                     int x1, int y1, int x2, int y2,
-                     BufferCapabilities.FlipContents flipAction)
-    {
-        throw new UnsupportedOperationException("not implemented");
-    }
+    public abstract SurfaceData createSurfaceData(CGLLayer layer);
 
     @Override
-    public boolean isTranslucencyCapable() {
+    public final boolean isTranslucencyCapable() {
         //we know for sure we have capable config :)
         return true;
     }
--- a/src/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java	Tue Jan 08 19:02:55 2013 -0500
@@ -27,7 +27,6 @@
 
 import java.awt.AWTException;
 import java.awt.BufferCapabilities;
-import java.awt.Color;
 import java.awt.Component;
 import java.awt.Graphics;
 import java.awt.Graphics2D;
@@ -48,13 +47,10 @@
 
 import sun.awt.CGraphicsConfig;
 import sun.awt.CGraphicsDevice;
-import sun.awt.TextureSizeConstraining;
 import sun.awt.image.OffScreenImage;
 import sun.awt.image.SunVolatileImage;
-import sun.awt.image.SurfaceManager;
 import sun.java2d.Disposer;
 import sun.java2d.DisposerRecord;
-import sun.java2d.SunGraphics2D;
 import sun.java2d.Surface;
 import sun.java2d.SurfaceData;
 import sun.java2d.opengl.OGLContext.OGLContextCaps;
@@ -63,18 +59,19 @@
 import sun.java2d.pipe.hw.ContextCapabilities;
 import static sun.java2d.opengl.OGLSurfaceData.*;
 import static sun.java2d.opengl.OGLContext.OGLContextCaps.*;
-import sun.java2d.opengl.CGLSurfaceData.CGLVSyncOffScreenSurfaceData;
 import sun.java2d.pipe.hw.AccelDeviceEventListener;
 import sun.java2d.pipe.hw.AccelDeviceEventNotifier;
 
+import sun.lwawt.LWComponentPeer;
 import sun.lwawt.macosx.CPlatformView;
 
-public class CGLGraphicsConfig extends CGraphicsConfig
-    implements OGLGraphicsConfig, TextureSizeConstraining
+public final class CGLGraphicsConfig extends CGraphicsConfig
+    implements OGLGraphicsConfig
 {
-    //private static final int kOpenGLSwapInterval = RuntimeOptions.getCurrentOptions().OpenGLSwapInterval;
+    //private static final int kOpenGLSwapInterval =
+    // RuntimeOptions.getCurrentOptions().OpenGLSwapInterval;
     private static final int kOpenGLSwapInterval = 0; // TODO
-    protected static boolean cglAvailable;
+    private static boolean cglAvailable;
     private static ImageCapabilities imageCaps = new CGLImageCaps();
 
     private int pixfmt;
@@ -82,7 +79,7 @@
     private long pConfigInfo;
     private ContextCapabilities oglCaps;
     private OGLContext context;
-    private Object disposerReferent = new Object();
+    private final Object disposerReferent = new Object();
 
     public static native int getDefaultPixFmt(int screennum);
     private static native boolean initCGL();
@@ -94,7 +91,7 @@
         cglAvailable = initCGL();
     }
 
-    protected CGLGraphicsConfig(CGraphicsDevice device, int pixfmt,
+    private CGLGraphicsConfig(CGraphicsDevice device, int pixfmt,
                                 long configInfo, ContextCapabilities oglCaps)
     {
         super(device);
@@ -170,11 +167,13 @@
      * Returns true if the provided capability bit is present for this config.
      * See OGLContext.java for a list of supported capabilities.
      */
-    public final boolean isCapPresent(int cap) {
+    @Override
+    public boolean isCapPresent(int cap) {
         return ((oglCaps.getCaps() & cap) != 0);
     }
 
-    public final long getNativeConfigInfo() {
+    @Override
+    public long getNativeConfigInfo() {
         return pConfigInfo;
     }
 
@@ -183,7 +182,8 @@
      *
      * @see sun.java2d.pipe.hw.BufferedContextProvider#getContext
      */
-    public final OGLContext getContext() {
+    @Override
+    public OGLContext getContext() {
         return context;
     }
 
@@ -257,145 +257,83 @@
         return ("CGLGraphicsConfig[dev="+screen+",pixfmt="+pixfmt+"]");
     }
 
-
-    /**
-     * The following methods are invoked from ComponentModel.java rather
-     * than having the Mac OS X-dependent implementations hardcoded in that
-     * class.  This way the appropriate actions are taken based on the peer's
-     * GraphicsConfig, whether it is a CGraphicsConfig or a
-     * CGLGraphicsConfig.
-     */
-
-    /**
-     * Creates a new SurfaceData that will be associated with the given
-     * LWWindowPeer.
-     */
     @Override
     public SurfaceData createSurfaceData(CPlatformView pView) {
         return CGLSurfaceData.createData(pView);
     }
 
-    /**
-     * Creates a new SurfaceData that will be associated with the given
-     * CGLLayer.
-     */
     @Override
     public SurfaceData createSurfaceData(CGLLayer layer) {
         return CGLSurfaceData.createData(layer);
     }
 
-    /**
-     * Creates a new hidden-acceleration image of the given width and height
-     * that is associated with the target Component.
-     */
     @Override
     public Image createAcceleratedImage(Component target,
                                         int width, int height)
     {
         ColorModel model = getColorModel(Transparency.OPAQUE);
-        WritableRaster wr =
-            model.createCompatibleWritableRaster(width, height);
+        WritableRaster wr = model.createCompatibleWritableRaster(width, height);
         return new OffScreenImage(target, model, wr,
                                   model.isAlphaPremultiplied());
     }
 
-    /**
-     * The following methods correspond to the multibuffering methods in
-     * CWindowPeer.java...
-     */
-
-    /**
-     * Attempts to create a OGL-based backbuffer for the given peer.  If
-     * the requested configuration is not natively supported, an AWTException
-     * is thrown.  Otherwise, if the backbuffer creation is successful, a
-     * value of 1 is returned.
-     */
     @Override
-    public long createBackBuffer(CPlatformView pView,
-                                 int numBuffers, BufferCapabilities caps)
-        throws AWTException
-    {
-        if (numBuffers > 2) {
-            throw new AWTException(
-                "Only double or single buffering is supported");
+    public void assertOperationSupported(final int numBuffers,
+                                         final BufferCapabilities caps)
+            throws AWTException {
+        // Assume this method is never called with numBuffers != 2, as 0 is
+        // unsupported, and 1 corresponds to a SingleBufferStrategy which
+        // doesn't depend on the peer. Screen is considered as a separate
+        // "buffer".
+        if (numBuffers != 2) {
+            throw new AWTException("Only double buffering is supported");
         }
-        BufferCapabilities configCaps = getBufferCapabilities();
+        final BufferCapabilities configCaps = getBufferCapabilities();
         if (!configCaps.isPageFlipping()) {
             throw new AWTException("Page flipping is not supported");
         }
         if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
             throw new AWTException("FlipContents.PRIOR is not supported");
         }
-
-        // non-zero return value means backbuffer creation was successful
-        // (checked in CPlatformWindow.flip(), etc.)
-        return 1;
     }
 
-    /**
-     * Destroys the backbuffer object represented by the given handle value.
-     */
     @Override
-    public void destroyBackBuffer(long backBuffer) {
+    public Image createBackBuffer(final LWComponentPeer<?, ?> peer) {
+        final Rectangle r = peer.getBounds();
+        // It is possible for the component to have size 0x0, adjust it to
+        // be at least 1x1 to avoid IAE
+        final int w = Math.max(1, r.width);
+        final int h = Math.max(1, r.height);
+        final int transparency = peer.isTranslucent() ? Transparency.TRANSLUCENT
+                                                      : Transparency.OPAQUE;
+        return new SunVolatileImage(this, w, h, transparency, null);
     }
 
-    /**
-     * Creates a VolatileImage that essentially wraps the target Component's
-     * backbuffer (the provided backbuffer handle is essentially ignored).
-     */
     @Override
-    public VolatileImage createBackBufferImage(Component target,
-                                               long backBuffer)
-    {
-        return new SunVolatileImage(target,
-                                    target.getWidth(), target.getHeight(),
-                                    Boolean.TRUE);
+    public void destroyBackBuffer(final Image backBuffer) {
+        if (backBuffer != null) {
+            backBuffer.flush();
+        }
     }
 
-    /**
-     * Performs the native OGL flip operation for the given target Component.
-     */
     @Override
-    public void flip(CPlatformView pView,
-                     Component target, VolatileImage xBackBuffer,
-                     int x1, int y1, int x2, int y2,
-                     BufferCapabilities.FlipContents flipAction)
-    {
-        if (flipAction == BufferCapabilities.FlipContents.COPIED) {
-            SurfaceManager vsm = SurfaceManager.getManager(xBackBuffer);
-            SurfaceData sd = vsm.getPrimarySurfaceData();
-
-            if (sd instanceof CGLVSyncOffScreenSurfaceData) {
-                CGLVSyncOffScreenSurfaceData vsd =
-                    (CGLVSyncOffScreenSurfaceData)sd;
-                SurfaceData bbsd = vsd.getFlipSurface();
-                Graphics2D bbg =
-                    new SunGraphics2D(bbsd, Color.black, Color.white, null);
-                try {
-                    bbg.drawImage(xBackBuffer, 0, 0, null);
-                } finally {
-                    bbg.dispose();
-                }
-            } else {
-                pView.drawImageOnPeer(xBackBuffer, x1, y1, x2, y2);
-                return;
-            }
-        } else if (flipAction == BufferCapabilities.FlipContents.PRIOR) {
-            // not supported by CGL...
-            return;
+    public void flip(final LWComponentPeer<?, ?> peer, final Image backBuffer,
+                     final int x1, final int y1, final int x2, final int y2,
+                     final BufferCapabilities.FlipContents flipAction) {
+        final Graphics g = peer.getGraphics();
+        try {
+            g.drawImage(backBuffer, x1, y1, x2, y2, x1, y1, x2, y2, null);
+        } finally {
+            g.dispose();
         }
-
-        OGLSurfaceData.swapBuffers(pView.getAWTView());
-
         if (flipAction == BufferCapabilities.FlipContents.BACKGROUND) {
-            Graphics g = xBackBuffer.getGraphics();
+            final Graphics2D bg = (Graphics2D) backBuffer.getGraphics();
             try {
-                g.setColor(target.getBackground());
-                g.fillRect(0, 0,
-                           xBackBuffer.getWidth(),
-                           xBackBuffer.getHeight());
+                bg.setBackground(peer.getBackground());
+                bg.clearRect(0, 0, backBuffer.getWidth(null),
+                             backBuffer.getHeight(null));
             } finally {
-                g.dispose();
+                bg.dispose();
             }
         }
     }
@@ -429,15 +367,10 @@
         return imageCaps;
     }
 
-    /**
-     * {@inheritDoc}
-     *
-     * @see sun.java2d.pipe.hw.AccelGraphicsConfig#createCompatibleVolatileImage
-     */
-    public VolatileImage
-        createCompatibleVolatileImage(int width, int height,
-                                      int transparency, int type)
-    {
+    @Override
+    public VolatileImage createCompatibleVolatileImage(int width, int height,
+                                                       int transparency,
+                                                       int type) {
         if (type == FLIP_BACKBUFFER || type == WINDOW || type == UNDEFINED ||
             transparency == Transparency.BITMASK)
         {
@@ -473,15 +406,18 @@
      *
      * @see sun.java2d.pipe.hw.AccelGraphicsConfig#getContextCapabilities
      */
+    @Override
     public ContextCapabilities getContextCapabilities() {
         return oglCaps;
     }
 
+    @Override
     public void addDeviceEventListener(AccelDeviceEventListener l) {
         int screen = getDevice().getCoreGraphicsScreen();
         AccelDeviceEventNotifier.addListener(l, screen);
     }
 
+    @Override
     public void removeDeviceEventListener(AccelDeviceEventListener l) {
         AccelDeviceEventNotifier.removeListener(l);
     }
--- a/src/macosx/classes/sun/lwawt/LWCanvasPeer.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/classes/sun/lwawt/LWCanvasPeer.java	Tue Jan 08 19:02:55 2013 -0500
@@ -26,12 +26,9 @@
 
 package sun.lwawt;
 
-import java.awt.AWTException;
-import java.awt.BufferCapabilities;
 import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.GraphicsConfiguration;
-import java.awt.Image;
 import java.awt.peer.CanvasPeer;
 
 import javax.swing.JComponent;
@@ -42,35 +39,10 @@
     LWCanvasPeer(final T target, final PlatformComponent platformComponent) {
         super(target, platformComponent);
     }
-    // ---- PEER METHODS ---- //
-
-    @Override
-    public void createBuffers(int numBuffers, BufferCapabilities caps)
-            throws AWTException {
-        // TODO
-    }
-
-    @Override
-    public Image getBackBuffer() {
-        // TODO
-        return null;
-    }
-
-    @Override
-    public void flip(int x1, int y1, int x2, int y2,
-                     BufferCapabilities.FlipContents flipAction) {
-        // TODO
-    }
-
-    @Override
-    public void destroyBuffers() {
-        // TODO
-    }
 
     @Override
     public final GraphicsConfiguration getAppropriateGraphicsConfiguration(
-            GraphicsConfiguration gc)
-    {
+            final GraphicsConfiguration gc) {
         // TODO
         return gc;
     }
--- a/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Tue Jan 08 19:02:55 2013 -0500
@@ -138,6 +138,11 @@
      */
     static final char WIDE_CHAR = '0';
 
+    /**
+     * The back buffer provide user with a BufferStrategy.
+     */
+    private Image backBuffer;
+
     private final class DelegateContainer extends Container {
         {
             enableEvents(0xFFFFFFFF);
@@ -389,6 +394,7 @@
     }
 
     protected void disposeImpl() {
+        destroyBuffers();
         LWContainerPeer cp = getContainerPeer();
         if (cp != null) {
             cp.removeChildPeer(this);
@@ -415,6 +421,12 @@
         return getWindowPeer().getGraphicsConfiguration();
     }
 
+
+    // Just a helper method
+    public final LWGraphicsConfig getLWGC() {
+        return (LWGraphicsConfig) getGraphicsConfiguration();
+    }
+
     /*
      * Overridden in LWWindowPeer to replace its surface
      * data and back buffer.
@@ -506,31 +518,45 @@
         return getGraphicsConfiguration().getColorModel();
     }
 
-    @Override
-    public void createBuffers(int numBuffers, BufferCapabilities caps)
-            throws AWTException {
-        throw new AWTException("Back buffers are only supported for " +
-                "Window or Canvas components.");
-    }
-
-    /*
-     * To be overridden in LWWindowPeer and LWCanvasPeer.
-     */
-    @Override
-    public Image getBackBuffer() {
-        // Return null or throw AWTException?
-        return null;
+    public boolean isTranslucent() {
+        // Translucent windows of the top level are supported only
+        return false;
     }
 
     @Override
-    public void flip(int x1, int y1, int x2, int y2,
-                     BufferCapabilities.FlipContents flipAction) {
-        // Skip silently or throw AWTException?
+    public final void createBuffers(int numBuffers, BufferCapabilities caps)
+            throws AWTException {
+        getLWGC().assertOperationSupported(numBuffers, caps);
+        final Image buffer = getLWGC().createBackBuffer(this);
+        synchronized (getStateLock()) {
+            backBuffer = buffer;
+        }
     }
 
     @Override
-    public void destroyBuffers() {
-        // Do nothing
+    public final Image getBackBuffer() {
+        synchronized (getStateLock()) {
+            if (backBuffer != null) {
+                return backBuffer;
+            }
+        }
+        throw new IllegalStateException("Buffers have not been created");
+    }
+
+    @Override
+    public final void flip(int x1, int y1, int x2, int y2,
+                     BufferCapabilities.FlipContents flipAction) {
+        getLWGC().flip(this, getBackBuffer(), x1, y1, x2, y2, flipAction);
+    }
+
+    @Override
+    public final void destroyBuffers() {
+        final Image oldBB;
+        synchronized (getStateLock()) {
+            oldBB = backBuffer;
+            backBuffer = null;
+        }
+        getLWGC().destroyBackBuffer(oldBB);
     }
 
     // Helper method
@@ -642,7 +668,7 @@
         }
     }
 
-    protected final Color getBackground() {
+    public final Color getBackground() {
         synchronized (getStateLock()) {
             return background;
         }
@@ -982,19 +1008,17 @@
     }
 
     @Override
-    public Image createImage(ImageProducer producer) {
+    public final Image createImage(final ImageProducer producer) {
         return new ToolkitImage(producer);
     }
 
     @Override
-    public Image createImage(int w, int h) {
-        CGraphicsConfig gc = (CGraphicsConfig)getGraphicsConfiguration();
-        return gc.createAcceleratedImage(getTarget(), w, h);
+    public final Image createImage(final int width, final int height) {
+        return getLWGC().createAcceleratedImage(getTarget(), width, height);
     }
 
     @Override
-    public VolatileImage createVolatileImage(int w, int h) {
-        // TODO: is it a right/complete implementation?
+    public final VolatileImage createVolatileImage(final int w, final int h) {
         return new SunVolatileImage(getTarget(), w, h);
     }
 
@@ -1105,8 +1129,6 @@
      * of target.setLocation() or as a result of user actions (window is
      * dragged with mouse).
      *
-     * To be overridden in LWWindowPeer to update its GraphicsConfig.
-     *
      * This method could be called on the toolkit thread.
      */
     protected final void handleMove(final int x, final int y,
@@ -1122,13 +1144,19 @@
      * Called when this peer's size has been changed either as a result of
      * target.setSize() or as a result of user actions (window is resized).
      *
-     * To be overridden in LWWindowPeer to update its SurfaceData and
-     * GraphicsConfig.
-     *
      * This method could be called on the toolkit thread.
      */
     protected final void handleResize(final int w, final int h,
                                       final boolean updateTarget) {
+        Image oldBB = null;
+        synchronized (getStateLock()) {
+            if (backBuffer != null) {
+                oldBB = backBuffer;
+                backBuffer = getLWGC().createBackBuffer(this);
+            }
+        }
+        getLWGC().destroyBackBuffer(oldBB);
+
         if (updateTarget) {
             AWTAccessor.getComponentAccessor().setSize(getTarget(), w, h);
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/macosx/classes/sun/lwawt/LWGraphicsConfig.java	Tue Jan 08 19:02:55 2013 -0500
@@ -0,0 +1,97 @@
+/*
+ * 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;
+
+import java.awt.AWTException;
+import java.awt.BufferCapabilities;
+import java.awt.Component;
+import java.awt.Image;
+
+/**
+ * As lwawt can be used on different platforms with different graphic
+ * configurations, the general set of methods is necessary. This interface
+ * collects the methods that should be provided by GraphicsConfiguration,
+ * simplifying use by the LWAWT.
+ *
+ * @author Sergey Bylokhov
+ */
+public interface LWGraphicsConfig {
+
+    /*
+     * A GraphicsConfiguration must implements following methods to indicate
+     * that it imposes certain limitations on the maximum size of supported
+     * textures.
+     */
+
+    /**
+     * Returns the maximum width of any texture image. By default return {@code
+     * Integer.MAX_VALUE}.
+     */
+    int getMaxTextureWidth();
+
+    /**
+     * Returns the maximum height of any texture image. By default return {@code
+     * Integer.MAX_VALUE}.
+     */
+    int getMaxTextureHeight();
+
+    /*
+     * The following methods correspond to the multi-buffering methods in
+     * LWComponentPeer.java.
+     */
+
+    /**
+     * Checks that the requested configuration is natively supported; if not, an
+     * AWTException is thrown.
+     */
+    void assertOperationSupported(int numBuffers, BufferCapabilities caps)
+            throws AWTException;
+
+    /**
+     * Creates a back buffer for the given peer and returns the image wrapper.
+     */
+    Image createBackBuffer(LWComponentPeer<?, ?> peer);
+
+    /**
+     * Destroys the back buffer object.
+     */
+    void destroyBackBuffer(Image backBuffer);
+
+    /**
+     * Performs the native flip operation for the given target Component. Our
+     * flip is implemented through normal drawImage() to the graphic object,
+     * because of our components uses a graphic object of the container(in this
+     * case we also apply necessary constrains)
+     */
+    void flip(LWComponentPeer<?, ?> peer, Image backBuffer, int x1, int y1,
+              int x2, int y2, BufferCapabilities.FlipContents flipAction);
+
+    /**
+     * Creates a new hidden-acceleration image of the given width and height
+     * that is associated with the target Component.
+     */
+    Image createAcceleratedImage(Component target, int width, int height);
+}
--- a/src/macosx/classes/sun/lwawt/LWToolkit.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/classes/sun/lwawt/LWToolkit.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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
--- a/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Tue Jan 08 19:02:55 2013 -0500
@@ -27,7 +27,6 @@
 
 import java.awt.*;
 import java.awt.event.*;
-import java.awt.image.BufferedImage;
 import java.awt.peer.*;
 import java.util.List;
 
@@ -48,7 +47,8 @@
         SIMPLEWINDOW,
         FRAME,
         DIALOG,
-        EMBEDDEDFRAME
+        EMBEDDED_FRAME,
+        VIEW_EMBEDDED_FRAME
     }
 
     private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.lwawt.focus.LWWindowPeer");
@@ -75,17 +75,6 @@
     private SurfaceData surfaceData;
     private final Object surfaceDataLock = new Object();
 
-    private int backBufferCount;
-    private BufferCapabilities backBufferCaps;
-
-    // The back buffer is used for two purposes:
-    // 1. To render all the lightweight peers
-    // 2. To provide user with a BufferStrategy
-    // Need to check if a single back buffer can be used for both
-// TODO: VolatileImage
-//    private VolatileImage backBuffer;
-    private volatile BufferedImage backBuffer;
-
     private volatile int windowState = Frame.NORMAL;
 
     // check that the mouse is over the window
@@ -120,6 +109,8 @@
 
     private volatile boolean textured;
 
+    private final PeerType peerType;
+
     /**
      * Current modal blocker or null.
      *
@@ -128,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;
@@ -227,7 +219,6 @@
         if (isGrabbing()) {
             ungrab();
         }
-        destroyBuffers();
         platformWindow.dispose();
         super.disposeImpl();
     }
@@ -258,8 +249,10 @@
     }
 
     @Override
-    public GraphicsConfiguration getGraphicsConfiguration() {
-        return graphicsConfig;
+    public final GraphicsConfiguration getGraphicsConfiguration() {
+        synchronized (getStateLock()) {
+            return graphicsConfig;
+        }
     }
 
     @Override
@@ -285,49 +278,12 @@
     }
 
     @Override
-    public void createBuffers(int numBuffers, BufferCapabilities caps)
-        throws AWTException
-    {
-        try {
-            // Assume this method is never called with numBuffers <= 1, as 0 is
-            // unsupported, and 1 corresponds to a SingleBufferStrategy which
-            // doesn't depend on the peer. Screen is considered as a separate
-            // "buffer", that's why numBuffers - 1
-            assert numBuffers > 1;
+    public void setBounds(int x, int y, int w, int h, int op) {
 
-            replaceSurfaceData(numBuffers - 1, caps, false);
-        } catch (InvalidPipeException z) {
-            throw new AWTException(z.toString());
+        if((op & NO_EMBEDDED_CHECK) == 0 && getPeerType() == PeerType.VIEW_EMBEDDED_FRAME) {
+            return;
         }
-    }
 
-    @Override
-    public final Image getBackBuffer() {
-        synchronized (getStateLock()) {
-            return backBuffer;
-        }
-    }
-
-    @Override
-    public void flip(int x1, int y1, int x2, int y2,
-                     BufferCapabilities.FlipContents flipAction)
-    {
-        platformWindow.flip(x1, y1, x2, y2, flipAction);
-    }
-
-    @Override
-    public final void destroyBuffers() {
-        final Image oldBB = getBackBuffer();
-        synchronized (getStateLock()) {
-            backBuffer = null;
-        }
-        if (oldBB != null) {
-            oldBB.flush();
-        }
-    }
-
-    @Override
-    public void setBounds(int x, int y, int w, int h, int op) {
         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
@@ -343,16 +299,14 @@
             h = MINIMUM_HEIGHT;
         }
 
-        if (graphicsConfig instanceof TextureSizeConstraining) {
-            final int maxW = ((TextureSizeConstraining)graphicsConfig).getMaxTextureWidth();
-            final int maxH = ((TextureSizeConstraining)graphicsConfig).getMaxTextureHeight();
+        final int maxW = getLWGC().getMaxTextureWidth();
+        final int maxH = getLWGC().getMaxTextureHeight();
 
-            if (w > maxW) {
-                w = maxW;
-            }
-            if (h > maxH) {
-                h = maxH;
-            }
+        if (w > maxW) {
+            w = maxW;
+        }
+        if (h > maxH) {
+            h = maxH;
         }
 
         // Don't post ComponentMoved/Resized and Paint events
@@ -431,21 +385,14 @@
             min = new Dimension(MINIMUM_WIDTH, MINIMUM_HEIGHT);
         }
 
-        final int maxW, maxH;
-        if (graphicsConfig instanceof TextureSizeConstraining) {
-            maxW = ((TextureSizeConstraining)graphicsConfig).getMaxTextureWidth();
-            maxH = ((TextureSizeConstraining)graphicsConfig).getMaxTextureHeight();
-        } else {
-            maxW = maxH = Integer.MAX_VALUE;
-        }
-
         final Dimension max;
         if (getTarget().isMaximumSizeSet()) {
             max = getTarget().getMaximumSize();
-            max.width = Math.min(max.width, maxW);
-            max.height = Math.min(max.height, maxH);
+            max.width = Math.min(max.width, getLWGC().getMaxTextureWidth());
+            max.height = Math.min(max.height, getLWGC().getMaxTextureHeight());
         } else {
-            max = new Dimension(maxW, maxH);
+            max = new Dimension(getLWGC().getMaxTextureWidth(),
+                                getLWGC().getMaxTextureHeight());
         }
 
         platformWindow.setSizeConstraints(min.width, min.height, max.width, max.height);
@@ -1014,21 +961,10 @@
         replaceSurfaceData(true);
     }
 
-    private void replaceSurfaceData(boolean blit) {
-        replaceSurfaceData(backBufferCount, backBufferCaps, blit);
-    }
-
-    private void replaceSurfaceData(int newBackBufferCount,
-                                    BufferCapabilities newBackBufferCaps,
-                                    boolean blit) {
+    private void replaceSurfaceData(final boolean blit) {
         synchronized (surfaceDataLock) {
             final SurfaceData oldData = getSurfaceData();
             surfaceData = platformWindow.replaceSurfaceData();
-            // TODO: volatile image
-    //        VolatileImage oldBB = backBuffer;
-            BufferedImage oldBB = backBuffer;
-            backBufferCount = newBackBufferCount;
-            backBufferCaps = newBackBufferCaps;
             final Rectangle size = getSize();
             if (getSurfaceData() != null && oldData != getSurfaceData()) {
                 clearBackground(size.width, size.height);
@@ -1043,35 +979,6 @@
                 // This can only happen when this peer is being created
                 oldData.flush();
             }
-
-            // TODO: volatile image
-    //        backBuffer = (VolatileImage)delegate.createBackBuffer();
-            backBuffer = (BufferedImage) platformWindow.createBackBuffer();
-            if (backBuffer != null) {
-                Graphics g = backBuffer.getGraphics();
-                try {
-                    Rectangle r = getBounds();
-                    if (g instanceof Graphics2D) {
-                        ((Graphics2D) g).setComposite(AlphaComposite.Src);
-                    }
-                    g.setColor(nonOpaqueBackground);
-                    g.fillRect(0, 0, r.width, r.height);
-                    if (g instanceof SunGraphics2D) {
-                        SG2DConstraint((SunGraphics2D) g, getRegion());
-                    }
-                    if (!isTextured()) {
-                        g.setColor(getBackground());
-                        g.fillRect(0, 0, r.width, r.height);
-                    }
-                    if (oldBB != null) {
-                        // Draw the old back buffer to the new one
-                        g.drawImage(oldBB, 0, 0, null);
-                        oldBB.flush();
-                    }
-                } finally {
-                    g.dispose();
-                }
-            }
         }
     }
 
@@ -1092,14 +999,6 @@
         }
     }
 
-    public int getBackBufferCount() {
-        return backBufferCount;
-    }
-
-    public BufferCapabilities getBackBufferCaps() {
-        return backBufferCaps;
-    }
-
     /*
      * Request the window insets from the delegate and compares it
      * with the current one. This method is mostly called by the
@@ -1320,6 +1219,10 @@
         return this == grabbingWindow;
     }
 
+    public PeerType getPeerType() {
+        return peerType;
+    }
+
     @Override
     public String toString() {
         return super.toString() + " [target is " + getTarget() + "]";
--- a/src/macosx/classes/sun/lwawt/PlatformWindow.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/classes/sun/lwawt/PlatformWindow.java	Tue Jan 08 19:02:55 2013 -0500
@@ -97,17 +97,6 @@
      */
     public SurfaceData replaceSurfaceData();
 
-    /*
-     * Creates a new image to serve as a back buffer.
-     */
-    public Image createBackBuffer();
-
-    /*
-     * Move the given part of the back buffer to the front buffer.
-     */
-    public void flip(int x1, int y1, int x2, int y2,
-                     BufferCapabilities.FlipContents flipAction);
-
     public void setModalBlocked(boolean blocked);
 
     public void toFront();
@@ -162,4 +151,6 @@
     public long getLayerPtr();
 
     public LWWindowPeer getPeer();
+
+    public boolean isUnderMouse();
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CMouseInfoPeer.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/classes/sun/lwawt/macosx/CMouseInfoPeer.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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);
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java	Tue Jan 08 19:02:55 2013 -0500
@@ -25,19 +25,13 @@
 
 package sun.lwawt.macosx;
 
+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.lwawt.LWWindowPeer;
-
-import sun.java2d.opengl.CGLLayer;
-import sun.java2d.SurfaceData;
-
-import sun.awt.CGraphicsConfig;
-import sun.awt.CGraphicsDevice;
-import sun.awt.CausedFocusEvent;
-
-import java.awt.*;
-import java.awt.BufferCapabilities.FlipContents;
-
 import sun.util.logging.PlatformLogger;
 
 /*
@@ -113,22 +107,6 @@
     }
 
     @Override
-    public Image createBackBuffer() {
-        Rectangle r = peer.getBounds();
-        Image im = null;
-        if (!r.isEmpty()) {
-            int transparency = peer.isTranslucent() ? Transparency.TRANSLUCENT : Transparency.OPAQUE;
-            im = peer.getGraphicsConfiguration().createCompatibleImage(r.width, r.height, transparency);
-        }
-        return im;
-    }
-
-    @Override
-    public void flip(int x1, int y1, int x2, int y2, FlipContents flipAction) {
-        throw new RuntimeException("Not implemented");
-    }
-
-    @Override
     public void setVisible(boolean visible) {}
 
     @Override
@@ -153,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
@@ -211,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");
+    }
 }
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java	Tue Jan 08 19:02:55 2013 -0500
@@ -26,9 +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;
 
@@ -38,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;
@@ -60,7 +66,7 @@
 
     public long getAWTView() {
         return ptr;
-    }
+        }
 
     public boolean isOpaque() {
         return !peer.isTranslucent();
@@ -115,26 +121,6 @@
     // ----------------------------------------------------------------------
     // PAINTING METHODS
     // ----------------------------------------------------------------------
-
-    public void drawImageOnPeer(VolatileImage xBackBuffer, int x1, int y1, int x2, int y2) {
-        Graphics g = peer.getGraphics();
-        try {
-            g.drawImage(xBackBuffer, x1, y1, x2, y2, x1, y1, x2, y2, null);
-        } finally {
-            g.dispose();
-        }
-    }
-
-    public Image createBackBuffer() {
-        Rectangle r = peer.getBounds();
-        Image im = null;
-        if (!r.isEmpty()) {
-            int transparency = (isOpaque() ? Transparency.OPAQUE : Transparency.TRANSLUCENT);
-            im = peer.getGraphicsConfiguration().createCompatibleImage(r.width, r.height, transparency);
-        }
-        return im;
-    }
-
     public SurfaceData replaceSurfaceData() {
         if (!LWCToolkit.getSunAwtDisableCALayers()) {
             surfaceData = windowLayer.replaceSurfaceData();
@@ -179,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();
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Tue Jan 08 19:02:55 2013 -0500
@@ -25,7 +25,6 @@
 
 package sun.lwawt.macosx;
 
-import java.awt.BufferCapabilities.FlipContents;
 import java.awt.*;
 import java.awt.Dialog.ModalityType;
 import java.awt.event.*;
@@ -65,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");
@@ -212,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);
     }
 
     /*
@@ -258,7 +254,7 @@
         validateSurface();
     }
 
-    protected int getInitialStyleBits() {
+    private int getInitialStyleBits() {
         // defaults style bits
         int styleBits = DECORATED | HAS_SHADOW | CLOSEABLE | MINIMIZABLE | ZOOMABLE | RESIZABLE;
 
@@ -285,7 +281,6 @@
             final boolean resizable = isFrame ? ((Frame)target).isResizable() : (isDialog ? ((Dialog)target).isResizable() : false);
             styleBits = SET(styleBits, RESIZABLE, resizable);
             if (!resizable) {
-                styleBits = SET(styleBits, RESIZABLE, false);
                 styleBits = SET(styleBits, ZOOMABLE, false);
             }
         }
@@ -380,7 +375,7 @@
     }
 
     // this is the counter-point to -[CWindow _nativeSetStyleBit:]
-    protected void setStyleBits(final int mask, final boolean value) {
+    private void setStyleBits(final int mask, final boolean value) {
         nativeSetNSWindowStyleBits(getNSWindowPtr(), mask, value ? mask : 0);
     }
 
@@ -402,11 +397,6 @@
     }
 
     @Override // PlatformWindow
-    public Image createBackBuffer() {
-        return contentView.createBackBuffer();
-    }
-
-    @Override // PlatformWindow
     public void dispose() {
         if (owner != null) {
             CWrapper.NSWindow.removeChildWindow(owner.getNSWindowPtr(), getNSWindowPtr());
@@ -417,12 +407,6 @@
     }
 
     @Override // PlatformWindow
-    public void flip(int x1, int y1, int x2, int y2, FlipContents flipAction) {
-        // TODO: not implemented
-        (new RuntimeException("unimplemented")).printStackTrace();
-    }
-
-    @Override // PlatformWindow
     public FontMetrics getFontMetrics(Font f) {
         // TODO: not implemented
         (new RuntimeException("unimplemented")).printStackTrace();
@@ -442,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
@@ -668,15 +643,8 @@
     }
 
     @Override
-    public void setResizable(boolean resizable) {
+    public void setResizable(final boolean resizable) {
         setStyleBits(RESIZABLE, resizable);
-
-        // Re-apply the size constraints and the size to ensure the space
-        // occupied by the grow box is counted properly
-        peer.updateMinimumSize();
-
-        Rectangle bounds = peer.getBounds();
-        setBounds(bounds.x, bounds.y, bounds.width, bounds.height);
     }
 
     @Override
@@ -853,6 +821,11 @@
         return peer;
     }
 
+    @Override
+    public boolean isUnderMouse() {
+        return contentView.isUnderMouse();
+    }
+
     public CPlatformView getContentView() {
         return contentView;
     }
@@ -889,7 +862,8 @@
         responder.handleWindowFocusEvent(gained, oppositePeer);
     }
 
-    private void deliverMoveResizeEvent(int x, int y, int width, int height) {
+    private void deliverMoveResizeEvent(int x, int y, int width, int height,
+                                        boolean byUser) {
         // when the content view enters the full-screen mode, the native
         // move/resize notifications contain a bounds smaller than
         // the whole screen and therefore we ignore the native notifications
@@ -901,7 +875,7 @@
         final Rectangle oldB = nativeBounds;
         nativeBounds = new Rectangle(x, y, width, height);
         peer.notifyReshape(x, y, width, height);
-        if (!oldB.getSize().equals(nativeBounds.getSize()) ) {
+        if (byUser && !oldB.getSize().equals(nativeBounds.getSize())) {
             flushBuffers();
         }
         //TODO validateSurface already called from notifyReshape
--- a/src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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) {}
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/macosx/classes/sun/lwawt/macosx/CViewPlatformEmbeddedFrame.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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();
+    }
+}
--- a/src/macosx/classes/sun/lwawt/macosx/CWrapper.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/classes/sun/lwawt/macosx/CWrapper.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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 {
--- a/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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();
         }
     }
 
--- a/src/macosx/native/sun/awt/AWTSurfaceLayers.m	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/native/sun/awt/AWTSurfaceLayers.m	Tue Jan 08 19:02:55 2013 -0500
@@ -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);
 }
--- a/src/macosx/native/sun/awt/AWTView.m	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/native/sun/awt/AWTView.m	Tue Jan 08 19:02:55 2013 -0500
@@ -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;
+}
+
+
--- a/src/macosx/native/sun/awt/AWTWindow.m	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/native/sun/awt/AWTWindow.m	Tue Jan 08 19:02:55 2013 -0500
@@ -160,6 +160,10 @@
         BOOL resizable = IS(bits, RESIZABLE);
         [self updateMinMaxSize:resizable];
         [self.nsWindow setShowsResizeIndicator:resizable];
+        // Zoom button should be disabled, if the window is not resizable,
+        // otherwise button should be restored to initial state.
+        BOOL zoom = resizable && IS(bits, ZOOMABLE);
+        [[self.nsWindow standardWindowButton:NSWindowZoomButton] setEnabled:zoom];
     }
 
     if (IS(mask, HAS_SHADOW)) {
@@ -445,12 +449,13 @@
 
     NSRect frame = ConvertNSScreenRect(env, [self.nsWindow frame]);
 
-    static JNF_MEMBER_CACHE(jm_deliverMoveResizeEvent, jc_CPlatformWindow, "deliverMoveResizeEvent", "(IIII)V");
+    static JNF_MEMBER_CACHE(jm_deliverMoveResizeEvent, jc_CPlatformWindow, "deliverMoveResizeEvent", "(IIIIZ)V");
     JNFCallVoidMethod(env, platformWindow, jm_deliverMoveResizeEvent,
                       (jint)frame.origin.x,
                       (jint)frame.origin.y,
                       (jint)frame.size.width,
-                      (jint)frame.size.height);
+                      (jint)frame.size.height,
+                      (jboolean)[self.nsWindow inLiveResize]);
     (*env)->DeleteLocalRef(env, platformWindow);
 }
 
@@ -784,7 +789,7 @@
 
         // calls methods on NSWindow to change other properties, based on the mask
         if (mask & MASK(_METHOD_PROP_BITMASK)) {
-            [window setPropertiesForStyleBits:bits mask:mask];
+            [window setPropertiesForStyleBits:newBits mask:mask];
         }
 
         window.styleBits = newBits;
@@ -1151,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
  */
@@ -1198,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)
 {
--- a/src/macosx/native/sun/awt/CCursorManager.m	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/native/sun/awt/CCursorManager.m	Tue Jan 08 19:02:55 2013 -0500
@@ -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);
--- a/src/macosx/native/sun/awt/CWrapper.m	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/native/sun/awt/CWrapper.m	Tue Jan 08 19:02:55 2013 -0500
@@ -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;
--- a/src/macosx/native/sun/awt/awt.m	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/native/sun/awt/awt.m	Tue Jan 08 19:02:55 2013 -0500
@@ -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 {
--- a/src/macosx/native/sun/java2d/opengl/CGLLayer.m	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/native/sun/java2d/opengl/CGLLayer.m	Tue Jan 08 19:02:55 2013 -0500
@@ -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);
--- a/src/macosx/native/sun/osxapp/ThreadUtilities.h	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/native/sun/osxapp/ThreadUtilities.h	Tue Jan 08 19:02:55 2013 -0500
@@ -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);
--- a/src/macosx/native/sun/osxapp/ThreadUtilities.m	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/macosx/native/sun/osxapp/ThreadUtilities.m	Tue Jan 08 19:02:55 2013 -0500
@@ -245,6 +245,14 @@
     }
 }
 
++ (void)performOnMainThreadWaiting:(BOOL)wait block:(void (^)())block {
+    if ([NSThread isMainThread] && wait == YES) {
+        block(); 
+    } else { 
+        [JNFRunLoop performOnMainThreadWaiting:wait withBlock:block]; 
+    }
+}
+
 @end
 
 
--- a/src/share/back/debugInit.c	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/back/debugInit.c	Tue Jan 08 19:02:55 2013 -0500
@@ -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
@@ -37,6 +37,7 @@
 #include "debugLoop.h"
 #include "bag.h"
 #include "invoker.h"
+#include "sys.h"
 
 /* How the options get to OnLoad: */
 #define XDEBUG "-Xdebug"
@@ -201,6 +202,8 @@
     jint              jvmtiCompileTimeMajorVersion;
     jint              jvmtiCompileTimeMinorVersion;
     jint              jvmtiCompileTimeMicroVersion;
+    char              *boot_path = NULL;
+    char              npt_lib[MAXPATHLEN];
 
     /* See if it's already loaded */
     if ( gdata!=NULL && gdata->isLoaded==JNI_TRUE ) {
@@ -227,18 +230,6 @@
     vmInitialized = JNI_FALSE;
     gdata->vmDead = JNI_FALSE;
 
-    /* Npt and Utf function init */
-    NPT_INITIALIZE(&(gdata->npt), NPT_VERSION, NULL);
-    if (gdata->npt == NULL) {
-        ERROR_MESSAGE(("JDWP: unable to initialize NPT library"));
-        return JNI_ERR;
-    }
-    gdata->npt->utf = (gdata->npt->utfInitialize)(NULL);
-    if (gdata->npt->utf == NULL) {
-        ERROR_MESSAGE(("JDWP: UTF function initialization failed"));
-        return JNI_ERR;
-    }
-
     /* Get the JVMTI Env, IMPORTANT: Do this first! For jvmtiAllocate(). */
     error = JVM_FUNC_PTR(vm,GetEnv)
                 (vm, (void **)&(gdata->jvmti), JVMTI_VERSION_1);
@@ -277,6 +268,24 @@
         forceExit(1); /* Kill entire process, no core dump wanted */
     }
 
+    JVMTI_FUNC_PTR(gdata->jvmti, GetSystemProperty)
+        (gdata->jvmti, (const char *)"sun.boot.library.path",
+         &boot_path);
+
+    dbgsysBuildLibName(npt_lib, sizeof(npt_lib), boot_path, NPT_LIBNAME);
+    /* Npt and Utf function init */
+    NPT_INITIALIZE(npt_lib, &(gdata->npt), NPT_VERSION, NULL);
+    jvmtiDeallocate(boot_path);
+    if (gdata->npt == NULL) {
+        ERROR_MESSAGE(("JDWP: unable to initialize NPT library"));
+        return JNI_ERR;
+    }
+    gdata->npt->utf = (gdata->npt->utfInitialize)(NULL);
+    if (gdata->npt->utf == NULL) {
+        ERROR_MESSAGE(("JDWP: UTF function initialization failed"));
+        return JNI_ERR;
+    }
+
     /* Parse input options */
     if (!parseOptions(options)) {
         /* No message necessary, should have been printed out already */
--- a/src/share/back/error_messages.c	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/back/error_messages.c	Tue Jan 08 19:02:55 2013 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -70,8 +70,13 @@
     len = (int)strlen((char*)utf8buf);
 
     /* Convert to platform encoding (ignore errors, dangerous area) */
-    (void)(gdata->npt->utf8ToPlatform)(gdata->npt->utf,
-           utf8buf, len, pbuf, MAX_MESSAGE_LEN);
+    if (gdata->npt != NULL) {
+        (void)(gdata->npt->utf8ToPlatform)(gdata->npt->utf,
+               utf8buf, len, pbuf, MAX_MESSAGE_LEN);
+    } else {
+        /* May be called before NPT is initialized so don't fault */
+        strncpy(pbuf, (char*)utf8buf, len);
+    }
     (void)fprintf(fp, "%s%s%s", prefix, pbuf, suffix);
 }
 
--- a/src/share/back/transport.c	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/back/transport.c	Tue Jan 08 19:02:55 2013 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2008, 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
@@ -144,7 +144,9 @@
     /* First, look in sun.boot.library.path. This should find the standard
      *  dt_socket and dt_shmem transport libraries, or any library
      *  that was delivered with the J2SE.
-     *  Note: Java property sun.boot.library.path contains a single directory.
+     *  Note: Since 6819213 fixed, Java property sun.boot.library.path can
+     *  contain multiple paths. Dll_dir is the first entry and
+     *  -Dsun.boot.library.path entries are appended.
      */
     libdir = gdata->property_sun_boot_library_path;
     if (libdir == NULL) {
--- a/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java	Tue Jan 08 19:02:55 2013 -0500
@@ -30,14 +30,10 @@
 import java.awt.image.BufferedImage;
 import java.awt.image.DataBuffer;
 import java.awt.image.WritableRaster;
-import java.io.BufferedInputStream;
-import java.io.DataInputStream;
 import java.io.EOFException;
-import java.io.InputStream;
 import java.io.IOException;
 import java.nio.ByteOrder;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 import javax.imageio.IIOException;
@@ -48,6 +44,11 @@
 import javax.imageio.spi.ImageReaderSpi;
 import javax.imageio.stream.ImageInputStream;
 import com.sun.imageio.plugins.common.ReaderUtil;
+import java.awt.image.ColorModel;
+import java.awt.image.IndexColorModel;
+import java.awt.image.MultiPixelPackedSampleModel;
+import java.awt.image.PixelInterleavedSampleModel;
+import java.awt.image.SampleModel;
 
 public class GIFImageReader extends ImageReader {
 
@@ -194,6 +195,36 @@
         return imageMetadata.imageHeight;
     }
 
+    // We don't check all parameters as ImageTypeSpecifier.createIndexed do
+    // since this method is private and we pass consistent data here
+    private ImageTypeSpecifier createIndexed(byte[] r, byte[] g, byte[] b,
+                                             int bits) {
+        ColorModel colorModel;
+        if (imageMetadata.transparentColorFlag) {
+            // Some files erroneously have a transparent color index
+            // of 255 even though there are fewer than 256 colors.
+            int idx = Math.min(imageMetadata.transparentColorIndex,
+                    r.length - 1);
+            colorModel = new IndexColorModel(bits, r.length, r, g, b, idx);
+        } else {
+            colorModel = new IndexColorModel(bits, r.length, r, g, b);
+        }
+
+        SampleModel sampleModel;
+        if (bits == 8) {
+            int[] bandOffsets = {0};
+            sampleModel =
+                    new PixelInterleavedSampleModel(DataBuffer.TYPE_BYTE,
+                    1, 1, 1, 1,
+                    bandOffsets);
+        } else {
+            sampleModel =
+                    new MultiPixelPackedSampleModel(DataBuffer.TYPE_BYTE,
+                    1, 1, bits);
+        }
+        return new ImageTypeSpecifier(colorModel, sampleModel);
+    }
+
     public Iterator getImageTypes(int imageIndex) throws IIOException {
         checkIndex(imageIndex);
 
@@ -239,22 +270,7 @@
             b[i] = colorTable[rgbIndex++];
         }
 
-        byte[] a = null;
-        if (imageMetadata.transparentColorFlag) {
-            a = new byte[lutLength];
-            Arrays.fill(a, (byte)255);
-
-            // Some files erroneously have a transparent color index
-            // of 255 even though there are fewer than 256 colors.
-            int idx = Math.min(imageMetadata.transparentColorIndex,
-                               lutLength - 1);
-            a[idx] = (byte)0;
-        }
-
-        int[] bitsPerSample = new int[1];
-        bitsPerSample[0] = bits;
-        l.add(ImageTypeSpecifier.createIndexed(r, g, b, a, bits,
-                                               DataBuffer.TYPE_BYTE));
+        l.add(createIndexed(r, g, b, bits));
         return l.iterator();
     }
 
--- a/src/share/classes/com/sun/java/util/jar/pack/PropMap.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/com/sun/java/util/jar/pack/PropMap.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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);
+            }
+        }
+    }
 }
--- a/src/share/classes/com/sun/jmx/remote/internal/ClientCommunicatorAdmin.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/com/sun/jmx/remote/internal/ClientCommunicatorAdmin.java	Tue Jan 08 19:02:55 2013 -0500
@@ -115,6 +115,7 @@
                     // restarted is failed by another thread
                     throw ioe;
                 }
+                return;
             } else {
                 state = RE_CONNECTING;
                 lock.notifyAll();
@@ -195,7 +196,7 @@
                     if (e instanceof IOException &&
                         !(e instanceof InterruptedIOException)) {
                         try {
-                            restart((IOException)e);
+                            gotIOException((IOException)e);
                         } catch (Exception ee) {
                             logger.warning("Checker-run",
                                            "Failed to check connection: "+ e);
--- a/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java	Tue Jan 08 19:02:55 2013 -0500
@@ -51,6 +51,7 @@
 
 import com.sun.jmx.remote.util.ClassLogger;
 import com.sun.jmx.remote.util.EnvHelp;
+import java.rmi.UnmarshalException;
 
 
 public abstract class ClientNotifForwarder {
@@ -594,10 +595,7 @@
                 }
 
                 return nr;
-            } catch (ClassNotFoundException e) {
-                logger.trace("NotifFetcher.fetchNotifs", e);
-                return fetchOneNotif();
-            } catch (NotSerializableException e) {
+            } catch (ClassNotFoundException | NotSerializableException | UnmarshalException e) {
                 logger.trace("NotifFetcher.fetchNotifs", e);
                 return fetchOneNotif();
             } catch (IOException ioe) {
@@ -619,17 +617,18 @@
            timeout.  This allows us to skip sequence numbers for
            notifications that don't match our filters.  Then we ask
            for one notification.  If that produces a
-           ClassNotFoundException or a NotSerializableException, we
-           increase our sequence number and ask again.  Eventually we
-           will either get a successful notification, or a return with
-           0 notifications.  In either case we can return a
+           ClassNotFoundException, NotSerializableException or
+           UnmarshalException, we increase our sequence number and ask again.
+           Eventually we will either get a successful notification, or a
+           return with 0 notifications.  In either case we can return a
            NotificationResult.  This algorithm works (albeit less
            well) even if the server implementation doesn't optimize a
            request for 0 notifications to skip sequence numbers for
            notifications that don't match our filters.
 
-           If we had at least one ClassNotFoundException, then we
-           must emit a JMXConnectionNotification.LOST_NOTIFS.
+           If we had at least one
+           ClassNotFoundException/NotSerializableException/UnmarshalException,
+           then we must emit a JMXConnectionNotification.LOST_NOTIFS.
         */
         private NotificationResult fetchOneNotif() {
             ClientNotifForwarder cnf = ClientNotifForwarder.this;
@@ -668,23 +667,20 @@
                 try {
                     // 1 notif to skip possible missing class
                     result = cnf.fetchNotifs(startSequenceNumber, 1, 0L);
+                } catch (ClassNotFoundException | NotSerializableException | UnmarshalException e) {
+                    logger.warning("NotifFetcher.fetchOneNotif",
+                                   "Failed to deserialize a notification: "+e.toString());
+                    if (logger.traceOn()) {
+                        logger.trace("NotifFetcher.fetchOneNotif",
+                                     "Failed to deserialize a notification.", e);
+                    }
+
+                    notFoundCount++;
+                    startSequenceNumber++;
                 } catch (Exception e) {
-                    if (e instanceof ClassNotFoundException
-                        || e instanceof NotSerializableException) {
-                        logger.warning("NotifFetcher.fetchOneNotif",
-                                     "Failed to deserialize a notification: "+e.toString());
-                        if (logger.traceOn()) {
-                            logger.trace("NotifFetcher.fetchOneNotif",
-                                         "Failed to deserialize a notification.", e);
-                        }
-
-                        notFoundCount++;
-                        startSequenceNumber++;
-                    } else {
-                        if (!shouldStop())
-                            logger.trace("NotifFetcher.fetchOneNotif", e);
-                        return null;
-                    }
+                    if (!shouldStop())
+                        logger.trace("NotifFetcher.fetchOneNotif", e);
+                    return null;
                 }
             }
 
@@ -692,7 +688,7 @@
                 final String msg =
                     "Dropped " + notFoundCount + " notification" +
                     (notFoundCount == 1 ? "" : "s") +
-                    " because classes were missing locally";
+                    " because classes were missing locally or incompatible";
                 lostNotifs(msg, notFoundCount);
                 // Even if result.getEarliestSequenceNumber() is now greater than
                 // it was initially, meaning some notifs have been dropped
--- a/src/share/classes/com/sun/jmx/remote/internal/IIOPHelper.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/com/sun/jmx/remote/internal/IIOPHelper.java	Tue Jan 08 19:02:55 2013 -0500
@@ -26,13 +26,8 @@
 package com.sun.jmx.remote.internal;
 
 import java.util.Properties;
+import java.io.IOException;
 import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.NoSuchObjectException;
-
-import java.util.Properties;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
 import java.rmi.NoSuchObjectException;
 
 import java.security.AccessController;
@@ -115,9 +110,10 @@
      * Connects the Stub to the given ORB.
      */
     public static void connect(Object stub, Object orb)
-        throws RemoteException
+        throws IOException
     {
-        ensureAvailable();
+        if (proxy == null)
+            throw new IOException("Connection to ORB failed, RMI/IIOP not available");
         proxy.connect(stub, orb);
     }
 
@@ -125,15 +121,17 @@
      * Returns true if the given object is an ORB.
      */
     public static boolean isOrb(Object obj) {
-        ensureAvailable();
-        return proxy.isOrb(obj);
+        return (proxy == null) ? false : proxy.isOrb(obj);
     }
 
     /**
      * Creates, and returns, a new ORB instance.
      */
-    public static Object createOrb(String[] args, Properties props) {
-        ensureAvailable();
+    public static Object createOrb(String[] args, Properties props)
+        throws IOException
+    {
+        if (proxy == null)
+            throw new IOException("ORB initialization failed, RMI/IIOP not available");
         return proxy.createOrb(args, props);
     }
 
@@ -166,24 +164,27 @@
     /**
      * Makes a server object ready to receive remote calls
      */
-    public static void exportObject(Remote obj) throws RemoteException {
-        ensureAvailable();
+    public static void exportObject(Remote obj) throws IOException {
+        if (proxy == null)
+            throw new IOException("RMI object cannot be exported, RMI/IIOP not available");
         proxy.exportObject(obj);
     }
 
     /**
      * Deregisters a server object from the runtime.
      */
-    public static void unexportObject(Remote obj) throws NoSuchObjectException {
-        ensureAvailable();
+    public static void unexportObject(Remote obj) throws IOException {
+        if (proxy == null)
+            throw new NoSuchObjectException("Object not exported");
         proxy.unexportObject(obj);
     }
 
     /**
      * Returns a stub for the given server object.
      */
-    public static Remote toStub(Remote obj) throws NoSuchObjectException {
-        ensureAvailable();
+    public static Remote toStub(Remote obj) throws IOException {
+        if (proxy == null)
+            throw new NoSuchObjectException("Object not exported");
         return proxy.toStub(obj);
     }
 }
--- a/src/share/classes/com/sun/net/ssl/KeyManagerFactory.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/com/sun/net/ssl/KeyManagerFactory.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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;
--- a/src/share/classes/com/sun/net/ssl/TrustManagerFactory.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/com/sun/net/ssl/TrustManagerFactory.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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;
--- a/src/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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();
--- a/src/share/classes/com/sun/security/auth/PolicyFile.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/com/sun/security/auth/PolicyFile.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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 {
--- a/src/share/classes/com/sun/security/auth/login/ConfigFile.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/com/sun/security/auth/login/ConfigFile.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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
@@ -25,45 +25,39 @@
 
 package com.sun.security.auth.login;
 
-import javax.security.auth.AuthPermission;
 import javax.security.auth.login.AppConfigurationEntry;
-import java.io.*;
-import java.util.*;
+import javax.security.auth.login.Configuration;
 import java.net.URI;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.text.MessageFormat;
-import sun.security.util.Debug;
-import sun.security.util.ResourcesMgr;
-import sun.security.util.PropertyExpander;
+
+// NOTE: As of JDK 8, this class instantiates
+// sun.security.provider.ConfigSpiFile and forwards all methods to that
+// implementation. All implementation fixes and enhancements should be made to
+// sun.security.provider.ConfigSpiFile and not this class.
+// See JDK-8005117 for more information.
 
 /**
  * This class represents a default implementation for
- * <code>javax.security.auth.login.Configuration</code>.
+ * {@code javax.security.auth.login.Configuration}.
  *
  * <p> This object stores the runtime login configuration representation,
  * and is the amalgamation of multiple static login
  * configurations that resides in files.
  * The algorithm for locating the login configuration file(s) and reading their
- * information into this <code>Configuration</code> object is:
+ * information into this {@code Configuration} object is:
  *
  * <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.
- *   Each property value specifies a <code>URL</code> pointing to a
+ *   <i>login.config.url.X</i>.
+ *   Each property value specifies a {@code URL} pointing to a
  *   login configuration file to be loaded.  Read in and load
  *   each configuration.
  *
  * <li>
- *   The <code>java.lang.System</code> property
+ *   The {@code java.lang.System} property
  *   <i>java.security.auth.login.config</i>
- *   may also be set to a <code>URL</code> pointing to another
+ *   may also be set to a {@code URL} pointing to another
  *   login configuration file
  *   (which is the case when a user uses the -D switch at runtime).
  *   If this property is defined, and its use is allowed by the
@@ -84,592 +78,63 @@
  *
  * <p> The configuration syntax supported by this implementation
  * is exactly that syntax specified in the
- * <code>javax.security.auth.login.Configuration</code> class.
+ * {@code javax.security.auth.login.Configuration} class.
  *
  * @see javax.security.auth.login.LoginContext
+ * @see java.security.Security security properties
  */
-public class ConfigFile extends javax.security.auth.login.Configuration {
+public class ConfigFile extends Configuration {
 
-    private StreamTokenizer st;
-    private int lookahead;
-    private int linenum;
-    private HashMap<String, LinkedList<AppConfigurationEntry>> configuration;
-    private boolean expandProp = true;
-    private URL url;
-
-    private static Debug debugConfig = Debug.getInstance("configfile");
-    private static Debug debugParser = Debug.getInstance("configparser");
+    private sun.security.provider.ConfigSpiFile configFile;
 
     /**
-     * Create a new <code>Configuration</code> object.
+     * Create a new {@code Configuration} object.
+     *
+     * @throws SecurityException if the {@code Configuration} can not be
+     *                           initialized
      */
     public ConfigFile() {
-        try {
-            init(url);
-        } catch (IOException ioe) {
-            throw (SecurityException)
-                new SecurityException(ioe.getMessage()).initCause(ioe);
-        }
+        configFile = new sun.security.provider.ConfigSpiFile();
     }
 
     /**
-     * Create a new <code>Configuration</code> object from the specified URI.
+     * Create a new {@code Configuration} object from the specified {@code URI}.
      *
-     * @param uri Create a new Configuration object from this URI.
+     * @param uri the {@code URI}
+     * @throws SecurityException if the {@code Configuration} can not be
+     *                           initialized
+     * @throws NullPointerException if {@code uri} is null
      */
     public ConfigFile(URI uri) {
-        // only load config from the specified URI
-        try {
-            url = uri.toURL();
-            init(url);
-        } catch (MalformedURLException mue) {
-            throw (SecurityException)
-                new SecurityException(mue.getMessage()).initCause(mue);
-        } catch (IOException ioe) {
-            throw (SecurityException)
-                new SecurityException(ioe.getMessage()).initCause(ioe);
-        }
+        configFile = new sun.security.provider.ConfigSpiFile(uri);
     }
 
     /**
-     * Read and initialize the entire login Configuration.
+     * Retrieve an entry from the {@code Configuration} using an application
+     * name as an index.
      *
-     * <p>
-     *
-     * @exception IOException if the Configuration can not be initialized. <p>
-     * @exception SecurityException if the caller does not have permission
-     *                          to initialize the Configuration.
+     * @param applicationName the name used to index the {@code Configuration}
+     * @return an array of {@code AppConfigurationEntry} which correspond to
+     *         the stacked configuration of {@code LoginModule}s for this
+     *         application, or null if this application has no configured
+     *         {@code LoginModule}s.
      */
-    private void init(URL url) throws IOException {
+    @Override
+    public AppConfigurationEntry[] getAppConfigurationEntry
+        (String applicationName) {
 
-        boolean initialized = false;
-        FileReader fr = null;
-        String sep = File.separator;
-
-        if ("false".equals(System.getProperty("policy.expandProperties"))) {
-            expandProp = false;
-        }
-
-        // new configuration
-        HashMap<String, LinkedList<AppConfigurationEntry>> newConfig =
-                new HashMap<>();
-
-        if (url != null) {
-
-            /**
-             * If the caller specified a URI via Configuration.getInstance,
-             * we only read from that URI
-             */
-            if (debugConfig != null) {
-                debugConfig.println("reading " + url);
-            }
-            init(url, newConfig);
-            configuration = newConfig;
-            return;
-        }
-
-        /**
-         * Caller did not specify URI via Configuration.getInstance.
-         * Read from URLs listed in the java.security properties file.
-         */
-
-        String allowSys = java.security.Security.getProperty
-                                                ("policy.allowSystemProperty");
-
-        if ("true".equalsIgnoreCase(allowSys)) {
-            String extra_config = System.getProperty
-                                        ("java.security.auth.login.config");
-            if (extra_config != null) {
-                boolean overrideAll = false;
-                if (extra_config.startsWith("=")) {
-                    overrideAll = true;
-                    extra_config = extra_config.substring(1);
-                }
-                try {
-                    extra_config = PropertyExpander.expand(extra_config);
-                } catch (PropertyExpander.ExpandException peee) {
-                    MessageFormat form = new MessageFormat
-                        (ResourcesMgr.getString
-                                ("Unable.to.properly.expand.config",
-                                "sun.security.util.AuthResources"));
-                    Object[] source = {extra_config};
-                    throw new IOException(form.format(source));
-                }
-
-                URL configURL = null;
-                try {
-                    configURL = new URL(extra_config);
-                } catch (java.net.MalformedURLException mue) {
-                    File configFile = new File(extra_config);
-                    if (configFile.exists()) {
-                        configURL = configFile.toURI().toURL();
-                    } else {
-                        MessageFormat form = new MessageFormat
-                            (ResourcesMgr.getString
-                                ("extra.config.No.such.file.or.directory.",
-                                "sun.security.util.AuthResources"));
-                        Object[] source = {extra_config};
-                        throw new IOException(form.format(source));
-                    }
-                }
-
-                if (debugConfig != null) {
-                    debugConfig.println("reading "+configURL);
-                }
-                init(configURL, newConfig);
-                initialized = true;
-                if (overrideAll) {
-                    if (debugConfig != null) {
-                        debugConfig.println("overriding other policies!");
-                    }
-                    configuration = newConfig;
-                    return;
-                }
-            }
-        }
-
-        int n = 1;
-        String config_url;
-        while ((config_url = java.security.Security.getProperty
-                                        ("login.config.url."+n)) != null) {
-            try {
-                config_url = PropertyExpander.expand
-                        (config_url).replace(File.separatorChar, '/');
-                if (debugConfig != null) {
-                    debugConfig.println("\tReading config: " + config_url);
-                }
-                init(new URL(config_url), newConfig);
-                initialized = true;
-            } catch (PropertyExpander.ExpandException peee) {
-                MessageFormat form = new MessageFormat
-                        (ResourcesMgr.getString
-                                ("Unable.to.properly.expand.config",
-                                "sun.security.util.AuthResources"));
-                Object[] source = {config_url};
-                throw new IOException(form.format(source));
-            }
-            n++;
-        }
-
-        if (initialized == false && n == 1 && config_url == null) {
-
-            // get the config from the user's home directory
-            if (debugConfig != null) {
-                debugConfig.println("\tReading Policy " +
-                                "from ~/.java.login.config");
-            }
-            config_url = System.getProperty("user.home");
-            String userConfigFile = config_url +
-                      File.separatorChar + ".java.login.config";
-
-            // No longer throws an exception when there's no config file
-            // at all. Returns an empty Configuration instead.
-            if (new File(userConfigFile).exists()) {
-                init(new File(userConfigFile).toURI().toURL(),
-                    newConfig);
-            }
-        }
-
-        configuration = newConfig;
-    }
-
-    private void init(URL config,
-        HashMap<String, LinkedList<AppConfigurationEntry>> newConfig)
-        throws IOException {
-
-        InputStreamReader isr = null;
-        try {
-            isr = new InputStreamReader(getInputStream(config), "UTF-8");
-            readConfig(isr, newConfig);
-        } catch (FileNotFoundException fnfe) {
-            if (debugConfig != null) {
-                debugConfig.println(fnfe.toString());
-            }
-            throw new IOException(ResourcesMgr.getString
-                    ("Configuration.Error.No.such.file.or.directory",
-                    "sun.security.util.AuthResources"));
-        } finally {
-            if (isr != null) {
-                isr.close();
-            }
-        }
+        return configFile.engineGetAppConfigurationEntry(applicationName);
     }
 
     /**
-     * Retrieve an entry from the Configuration using an application name
-     * as an index.
-     *
-     * <p>
-     *
-     * @param applicationName the name used to index the Configuration.
-     * @return an array of AppConfigurationEntries which correspond to
-     *          the stacked configuration of LoginModules for this
-     *          application, or null if this application has no configured
-     *          LoginModules.
-     */
-    public AppConfigurationEntry[] getAppConfigurationEntry
-    (String applicationName) {
-
-        LinkedList<AppConfigurationEntry> list = null;
-        synchronized (configuration) {
-            list = configuration.get(applicationName);
-        }
-
-        if (list == null || list.size() == 0)
-            return null;
-
-        AppConfigurationEntry[] entries =
-                                new AppConfigurationEntry[list.size()];
-        Iterator<AppConfigurationEntry> iterator = list.iterator();
-        for (int i = 0; iterator.hasNext(); i++) {
-            AppConfigurationEntry e = iterator.next();
-            entries[i] = new AppConfigurationEntry(e.getLoginModuleName(),
-                                                e.getControlFlag(),
-                                                e.getOptions());
-        }
-        return entries;
-    }
-
-    /**
-     * Refresh and reload the Configuration by re-reading all of the
+     * Refresh and reload the {@code Configuration} by re-reading all of the
      * login configurations.
      *
-     * <p>
-     *
-     * @exception SecurityException if the caller does not have permission
-     *                          to refresh the Configuration.
+     * @throws SecurityException if the caller does not have permission
+     *                           to refresh the {@code Configuration}
      */
+    @Override
     public synchronized void refresh() {
-
-        java.lang.SecurityManager sm = System.getSecurityManager();
-        if (sm != null)
-            sm.checkPermission(new AuthPermission("refreshLoginConfiguration"));
-
-        java.security.AccessController.doPrivileged
-            (new java.security.PrivilegedAction<Void>() {
-            public Void run() {
-                try {
-                    init(url);
-                } catch (java.io.IOException ioe) {
-                    throw (SecurityException) new SecurityException
-                                (ioe.getLocalizedMessage()).initCause(ioe);
-                }
-                return null;
-            }
-        });
-    }
-
-    private void readConfig(Reader reader,
-        HashMap<String, LinkedList<AppConfigurationEntry>> newConfig)
-        throws IOException {
-
-        int linenum = 1;
-
-        if (!(reader instanceof BufferedReader))
-            reader = new BufferedReader(reader);
-
-        st = new StreamTokenizer(reader);
-        st.quoteChar('"');
-        st.wordChars('$', '$');
-        st.wordChars('_', '_');
-        st.wordChars('-', '-');
-        st.lowerCaseMode(false);
-        st.slashSlashComments(true);
-        st.slashStarComments(true);
-        st.eolIsSignificant(true);
-
-        lookahead = nextToken();
-        while (lookahead != StreamTokenizer.TT_EOF) {
-            parseLoginEntry(newConfig);
-        }
-    }
-
-    private void parseLoginEntry(
-        HashMap<String, LinkedList<AppConfigurationEntry>> newConfig)
-        throws IOException {
-
-        String appName;
-        String moduleClass;
-        String sflag;
-        AppConfigurationEntry.LoginModuleControlFlag controlFlag;
-        LinkedList<AppConfigurationEntry> configEntries = new LinkedList<>();
-
-        // application name
-        appName = st.sval;
-        lookahead = nextToken();
-
-        if (debugParser != null) {
-            debugParser.println("\tReading next config entry: " + appName);
-        }
-
-        match("{");
-
-        // get the modules
-        while (peek("}") == false) {
-            // get the module class name
-            moduleClass = match("module class name");
-
-            // controlFlag (required, optional, etc)
-            sflag = match("controlFlag");
-            if (sflag.equalsIgnoreCase("REQUIRED"))
-                controlFlag =
-                        AppConfigurationEntry.LoginModuleControlFlag.REQUIRED;
-            else if (sflag.equalsIgnoreCase("REQUISITE"))
-                controlFlag =
-                        AppConfigurationEntry.LoginModuleControlFlag.REQUISITE;
-            else if (sflag.equalsIgnoreCase("SUFFICIENT"))
-                controlFlag =
-                        AppConfigurationEntry.LoginModuleControlFlag.SUFFICIENT;
-            else if (sflag.equalsIgnoreCase("OPTIONAL"))
-                controlFlag =
-                        AppConfigurationEntry.LoginModuleControlFlag.OPTIONAL;
-            else {
-                MessageFormat form = new MessageFormat(ResourcesMgr.getString
-                        ("Configuration.Error.Invalid.control.flag.flag",
-                        "sun.security.util.AuthResources"));
-                Object[] source = {sflag};
-                throw new IOException(form.format(source));
-            }
-
-            // get the args
-            HashMap<String, String> options = new HashMap<>();
-            String key;
-            String value;
-            while (peek(";") == false) {
-                key = match("option key");
-                match("=");
-                try {
-                    value = expand(match("option value"));
-                } catch (PropertyExpander.ExpandException peee) {
-                    throw new IOException(peee.getLocalizedMessage());
-                }
-                options.put(key, value);
-            }
-
-            lookahead = nextToken();
-
-            // create the new element
-            if (debugParser != null) {
-                debugParser.println("\t\t" + moduleClass + ", " + sflag);
-                java.util.Iterator<String> i = options.keySet().iterator();
-                while (i.hasNext()) {
-                    key = i.next();
-                    debugParser.println("\t\t\t" +
-                                        key +
-                                        "=" +
-                                        options.get(key));
-                }
-            }
-            AppConfigurationEntry entry = new AppConfigurationEntry
-                                                        (moduleClass,
-                                                        controlFlag,
-                                                        options);
-            configEntries.add(entry);
-        }
-
-        match("}");
-        match(";");
-
-        // add this configuration entry
-        if (newConfig.containsKey(appName)) {
-            MessageFormat form = new MessageFormat(ResourcesMgr.getString
-                ("Configuration.Error.Can.not.specify.multiple.entries.for.appName",
-                "sun.security.util.AuthResources"));
-            Object[] source = {appName};
-            throw new IOException(form.format(source));
-        }
-        newConfig.put(appName, configEntries);
-    }
-
-    private String match(String expect) throws IOException {
-
-        String value = null;
-
-        switch(lookahead) {
-        case StreamTokenizer.TT_EOF:
-
-            MessageFormat form1 = new MessageFormat(ResourcesMgr.getString
-                ("Configuration.Error.expected.expect.read.end.of.file.",
-                "sun.security.util.AuthResources"));
-            Object[] source1 = {expect};
-            throw new IOException(form1.format(source1));
-
-        case '"':
-        case StreamTokenizer.TT_WORD:
-
-            if (expect.equalsIgnoreCase("module class name") ||
-                expect.equalsIgnoreCase("controlFlag") ||
-                expect.equalsIgnoreCase("option key") ||
-                expect.equalsIgnoreCase("option value")) {
-                value = st.sval;
-                lookahead = nextToken();
-            } else {
-                MessageFormat form = new MessageFormat(ResourcesMgr.getString
-                        ("Configuration.Error.Line.line.expected.expect.found.value.",
-                        "sun.security.util.AuthResources"));
-                Object[] source = {new Integer(linenum), expect, st.sval};
-                throw new IOException(form.format(source));
-            }
-            break;
-
-        case '{':
-
-            if (expect.equalsIgnoreCase("{")) {
-                lookahead = nextToken();
-            } else {
-                MessageFormat form = new MessageFormat(ResourcesMgr.getString
-                        ("Configuration.Error.Line.line.expected.expect.",
-                        "sun.security.util.AuthResources"));
-                Object[] source = {new Integer(linenum), expect, st.sval};
-                throw new IOException(form.format(source));
-            }
-            break;
-
-        case ';':
-
-            if (expect.equalsIgnoreCase(";")) {
-                lookahead = nextToken();
-            } else {
-                MessageFormat form = new MessageFormat(ResourcesMgr.getString
-                        ("Configuration.Error.Line.line.expected.expect.",
-                        "sun.security.util.AuthResources"));
-                Object[] source = {new Integer(linenum), expect, st.sval};
-                throw new IOException(form.format(source));
-            }
-            break;
-
-        case '}':
-
-            if (expect.equalsIgnoreCase("}")) {
-                lookahead = nextToken();
-            } else {
-                MessageFormat form = new MessageFormat(ResourcesMgr.getString
-                        ("Configuration.Error.Line.line.expected.expect.",
-                        "sun.security.util.AuthResources"));
-                Object[] source = {new Integer(linenum), expect, st.sval};
-                throw new IOException(form.format(source));
-            }
-            break;
-
-        case '=':
-
-            if (expect.equalsIgnoreCase("=")) {
-                lookahead = nextToken();
-            } else {
-                MessageFormat form = new MessageFormat(ResourcesMgr.getString
-                        ("Configuration.Error.Line.line.expected.expect.",
-                        "sun.security.util.AuthResources"));
-                Object[] source = {new Integer(linenum), expect, st.sval};
-                throw new IOException(form.format(source));
-            }
-            break;
-
-        default:
-            MessageFormat form = new MessageFormat(ResourcesMgr.getString
-                        ("Configuration.Error.Line.line.expected.expect.found.value.",
-                        "sun.security.util.AuthResources"));
-            Object[] source = {new Integer(linenum), expect, st.sval};
-            throw new IOException(form.format(source));
-        }
-        return value;
-    }
-
-    private boolean peek(String expect) {
-        boolean found = false;
-
-        switch (lookahead) {
-        case ',':
-            if (expect.equalsIgnoreCase(","))
-                found = true;
-            break;
-        case ';':
-            if (expect.equalsIgnoreCase(";"))
-                found = true;
-            break;
-        case '{':
-            if (expect.equalsIgnoreCase("{"))
-                found = true;
-            break;
-        case '}':
-            if (expect.equalsIgnoreCase("}"))
-                found = true;
-            break;
-        default:
-        }
-        return found;
-    }
-
-    private int nextToken() throws IOException {
-        int tok;
-        while ((tok = st.nextToken()) == StreamTokenizer.TT_EOL) {
-            linenum++;
-        }
-        return tok;
-    }
-
-    /*
-     * Fast path reading from file urls in order to avoid calling
-     * FileURLConnection.connect() which can be quite slow the first time
-     * it is called. We really should clean up FileURLConnection so that
-     * this is not a problem but in the meantime this fix helps reduce
-     * start up time noticeably for the new launcher. -- DAC
-     */
-    private InputStream getInputStream(URL url) throws IOException {
-        if ("file".equalsIgnoreCase(url.getProtocol())) {
-            // Compatibility notes:
-            //
-            // Code changed from
-            //   String path = url.getFile().replace('/', File.separatorChar);
-            //   return new FileInputStream(path);
-            //
-            // The original implementation would search for "/tmp/a%20b"
-            // when url is "file:///tmp/a%20b". This is incorrect. The
-            // current codes fix this bug and searches for "/tmp/a b".
-            // For compatibility reasons, when the file "/tmp/a b" does
-            // not exist, the file named "/tmp/a%20b" will be tried.
-            //
-            // This also means that if both file exists, the behavior of
-            // this method is changed, and the current codes choose the
-            // correct one.
-            try {
-                return url.openStream();
-            } catch (Exception e) {
-                String file = url.getPath();
-                if (url.getHost().length() > 0) {  // For Windows UNC
-                    file = "//" + url.getHost() + file;
-                }
-                if (debugConfig != null) {
-                    debugConfig.println("cannot read " + url +
-                            ", try " + file);
-                }
-                return new FileInputStream(file);
-            }
-        } else {
-            return url.openStream();
-        }
-    }
-
-    private String expand(String value)
-        throws PropertyExpander.ExpandException, IOException {
-
-        if ("".equals(value)) {
-            return value;
-        }
-
-        if (expandProp) {
-
-            String s = PropertyExpander.expand(value);
-
-            if (s == null || s.length() == 0) {
-                MessageFormat form = new MessageFormat(ResourcesMgr.getString
-                        ("Configuration.Error.Line.line.system.property.value.expanded.to.empty.value",
-                        "sun.security.util.AuthResources"));
-                Object[] source = {new Integer(linenum), value};
-                throw new IOException(form.format(source));
-            }
-            return s;
-        } else {
-            return value;
-        }
+        configFile.engineRefresh();
     }
 }
--- a/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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;
--- a/src/share/classes/java/awt/color/ICC_Profile.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/awt/color/ICC_Profile.java	Tue Jan 08 19:02:55 2013 -0500
@@ -1435,7 +1435,15 @@
 
         int renderingIntent = intFromBigEndian(theHeader, icHdrRenderingIntent);
                                                  /* set the rendering intent */
-        return renderingIntent;
+
+        /* According to ICC spec, only the least-significant 16 bits shall be
+         * used to encode the rendering intent. The most significant 16 bits
+         * shall be set to zero. Thus, we are ignoring two most significant
+         * bytes here.
+         *
+         *  See http://www.color.org/ICC1v42_2006-05.pdf, section 7.2.15.
+         */
+        return (0xffff & renderingIntent);
     }
 
 
--- a/src/share/classes/java/awt/image/ColorConvertOp.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/awt/image/ColorConvertOp.java	Tue Jan 08 19:02:55 2013 -0500
@@ -732,10 +732,16 @@
     private int getRenderingIntent (ICC_Profile profile) {
         byte[] header = profile.getData(ICC_Profile.icSigHead);
         int index = ICC_Profile.icHdrRenderingIntent;
-        return (((header[index]   & 0xff) << 24) |
-                ((header[index+1] & 0xff) << 16) |
-                ((header[index+2] & 0xff) <<  8) |
-                 (header[index+3] & 0xff));
+
+        /* According to ICC spec, only the least-significant 16 bits shall be
+         * used to encode the rendering intent. The most significant 16 bits
+         * shall be set to zero. Thus, we are ignoring two most significant
+         * bytes here.
+         *
+         *  See http://www.color.org/ICC1v42_2006-05.pdf, section 7.2.15.
+         */
+        return ((header[index+2] & 0xff) <<  8) |
+                (header[index+3] & 0xff);
     }
 
     /**
--- a/src/share/classes/java/lang/AbstractStringBuilder.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/lang/AbstractStringBuilder.java	Tue Jan 08 19:02:55 2013 -0500
@@ -177,11 +177,10 @@
         ensureCapacityInternal(newLength);
 
         if (count < newLength) {
-            for (; count < newLength; count++)
-                value[count] = '\0';
-        } else {
-            count = newLength;
+            Arrays.fill(value, count, newLength, '\0');
         }
+
+        count = newLength;
     }
 
     /**
@@ -1308,8 +1307,7 @@
      *            {@code null}.
      */
     public int indexOf(String str, int fromIndex) {
-        return String.indexOf(value, 0, count,
-                              str.toCharArray(), 0, str.length(), fromIndex);
+        return String.indexOf(value, 0, count, str, fromIndex);
     }
 
     /**
@@ -1352,8 +1350,7 @@
      *          {@code null}.
      */
     public int lastIndexOf(String str, int fromIndex) {
-        return String.lastIndexOf(value, 0, count,
-                              str.toCharArray(), 0, str.length(), fromIndex);
+        return String.lastIndexOf(value, 0, count, str, fromIndex);
     }
 
     /**
--- a/src/share/classes/java/lang/Class.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/lang/Class.java	Tue Jan 08 19:02:55 2013 -0500
@@ -506,6 +506,7 @@
      * returns {@code false} otherwise.
      * @return {@code true} if and only if this class is a synthetic class as
      *         defined by the Java Language Specification.
+     * @jls 13.1 The Form of a Binary
      * @since 1.5
      */
     public boolean isSynthetic() {
--- a/src/share/classes/java/lang/String.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/lang/String.java	Tue Jan 08 19:02:55 2013 -0500
@@ -1706,6 +1706,24 @@
     }
 
     /**
+     * Code shared by String and AbstractStringBuilder to do searches. The
+     * source is the character array being searched, and the target
+     * is the string being searched for.
+     *
+     * @param   source       the characters being searched.
+     * @param   sourceOffset offset of the source string.
+     * @param   sourceCount  count of the source string.
+     * @param   target       the characters being searched for.
+     * @param   fromIndex    the index to begin searching from.
+     */
+    static int indexOf(char[] source, int sourceOffset, int sourceCount,
+            String target, int fromIndex) {
+        return indexOf(source, sourceOffset, sourceCount,
+                       target.value, 0, target.value.length,
+                       fromIndex);
+    }
+
+    /**
      * Code shared by String and StringBuffer to do searches. The
      * source is the character array being searched, and the target
      * is the string being searched for.
@@ -1797,6 +1815,24 @@
     }
 
     /**
+     * Code shared by String and AbstractStringBuilder to do searches. The
+     * source is the character array being searched, and the target
+     * is the string being searched for.
+     *
+     * @param   source       the characters being searched.
+     * @param   sourceOffset offset of the source string.
+     * @param   sourceCount  count of the source string.
+     * @param   target       the characters being searched for.
+     * @param   fromIndex    the index to begin searching from.
+     */
+    static int lastIndexOf(char[] source, int sourceOffset, int sourceCount,
+            String target, int fromIndex) {
+        return lastIndexOf(source, sourceOffset, sourceCount,
+                       target.value, 0, target.value.length,
+                       fromIndex);
+    }
+
+    /**
      * Code shared by String and StringBuffer to do searches. The
      * source is the character array being searched, and the target
      * is the string being searched for.
--- a/src/share/classes/java/lang/ThreadLocal.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/lang/ThreadLocal.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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
--- a/src/share/classes/java/lang/invoke/BoundMethodHandle.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/lang/invoke/BoundMethodHandle.java	Tue Jan 08 19:02:55 2013 -0500
@@ -25,7 +25,7 @@
 
 package java.lang.invoke;
 
-import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.*;
+import static jdk.internal.org.objectweb.asm.Opcodes.*;
 import static java.lang.invoke.LambdaForm.basicTypes;
 import static java.lang.invoke.MethodHandleNatives.Constants.REF_invokeStatic;
 import static java.lang.invoke.MethodHandleStatics.*;
@@ -40,9 +40,9 @@
 import sun.invoke.util.ValueConversions;
 import sun.invoke.util.Wrapper;
 
-import com.sun.xml.internal.ws.org.objectweb.asm.ClassWriter;
-import com.sun.xml.internal.ws.org.objectweb.asm.MethodVisitor;
-import com.sun.xml.internal.ws.org.objectweb.asm.Type;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Type;
 
 /**
  * The flavor of method handle which emulates an invoke instruction
--- a/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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);
--- a/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Tue Jan 08 19:02:55 2013 -0500
@@ -34,7 +34,7 @@
 import java.io.*;
 import java.util.*;
 
-import com.sun.xml.internal.ws.org.objectweb.asm.*;
+import jdk.internal.org.objectweb.asm.*;
 
 import java.lang.reflect.*;
 import static java.lang.invoke.MethodHandleStatics.*;
--- a/src/share/classes/java/lang/reflect/Constructor.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/lang/reflect/Constructor.java	Tue Jan 08 19:02:55 2013 -0500
@@ -66,6 +66,8 @@
     private transient ConstructorRepository genericInfo;
     private byte[]              annotations;
     private byte[]              parameterAnnotations;
+    // This is set by the vm at Constructor creation
+    private byte[]              typeAnnotations;
 
     // Generics infrastructure
     // Accessor for factory
@@ -138,6 +140,8 @@
         res.root = this;
         // Might as well eagerly propagate this if already present
         res.constructorAccessor = constructorAccessor;
+
+        res.typeAnnotations = typeAnnotations;
         return res;
     }
 
@@ -407,6 +411,7 @@
 
     /**
      * {@inheritDoc}
+     * @jls 13.1 The Form of a Binary
      * @since 1.5
      */
     @Override
--- a/src/share/classes/java/lang/reflect/Executable.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/lang/reflect/Executable.java	Tue Jan 08 19:02:55 2013 -0500
@@ -324,6 +324,7 @@
      * @return true if and only if this executable is a synthetic
      * construct as defined by
      * <cite>The Java&trade; Language Specification</cite>.
+     * @jls 13.1 The Form of a Binary
      */
     public boolean isSynthetic() {
         return Modifier.isSynthetic(getModifiers());
--- a/src/share/classes/java/lang/reflect/Field.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/lang/reflect/Field.java	Tue Jan 08 19:02:55 2013 -0500
@@ -80,6 +80,8 @@
     // currently only two levels deep (i.e., one root Field and
     // potentially many Field objects pointing to it.)
     private Field               root;
+    // This is set by the vm at Field creation
+    private byte[]              typeAnnotations;
 
     // Generics infrastructure
 
@@ -144,6 +146,8 @@
         // Might as well eagerly propagate this if already present
         res.fieldAccessor = fieldAccessor;
         res.overrideFieldAccessor = overrideFieldAccessor;
+
+        res.typeAnnotations = typeAnnotations;
         return res;
     }
 
--- a/src/share/classes/java/lang/reflect/Member.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/lang/reflect/Member.java	Tue Jan 08 19:02:55 2013 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2006, 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
@@ -87,6 +87,7 @@
      *
      * @return true if and only if this member was introduced by
      * the compiler.
+     * @jls 13.1 The Form of a Binary
      * @since 1.5
      */
     public boolean isSynthetic();
--- a/src/share/classes/java/lang/reflect/Method.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/lang/reflect/Method.java	Tue Jan 08 19:02:55 2013 -0500
@@ -79,7 +79,8 @@
     // currently only two levels deep (i.e., one root Method and
     // potentially many Method objects pointing to it.)
     private Method              root;
-
+    // This is set by the vm at Method creation
+    private byte[]              typeAnnotations;
 
     // Generics infrastructure
     private String getGenericSignature() {return signature;}
@@ -150,6 +151,8 @@
         res.root = this;
         // Might as well eagerly propagate this if already present
         res.methodAccessor = methodAccessor;
+
+        res.typeAnnotations = typeAnnotations;
         return res;
     }
 
@@ -497,6 +500,7 @@
 
     /**
      * {@inheritDoc}
+     * @jls 13.1 The Form of a Binary
      * @since 1.5
      */
     @Override
@@ -504,6 +508,22 @@
         return super.isSynthetic();
     }
 
+    /**
+     * Returns {@code true} if this method is a default
+     * method; returns {@code false} otherwise.
+     *
+     * A default method is a non-abstract method, that is, a method
+     * with a body, declared in an interface type.
+     *
+     * @return true if and only if this method is a default
+     * method as defined by the Java Language Specification.
+     * @since 1.8
+     */
+    public boolean isDefault() {
+        return (getModifiers() & Modifier.ABSTRACT) == 0 &&
+            getDeclaringClass().isInterface();
+    }
+
     // NOTE that there is no synchronization used here. It is correct
     // (though not efficient) to generate more than one MethodAccessor
     // for a given Method. However, avoiding synchronization will
--- a/src/share/classes/java/net/HttpCookie.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/net/HttpCookie.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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
             }
--- a/src/share/classes/java/net/Inet6Address.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/net/Inet6Address.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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();
     }
 }
--- a/src/share/classes/java/net/URLConnection.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/net/URLConnection.java	Tue Jan 08 19:02:55 2013 -0500
@@ -129,15 +129,6 @@
  * <a href="http://www.ietf.org/rfc/rfc2616.txt">http://www.ietf.org/rfc/rfc2616.txt</a>
  * </pre></blockquote>
  *
- * Note about <code>fileNameMap</code>: In versions prior to JDK 1.1.6,
- * field <code>fileNameMap</code> of <code>URLConnection</code> was public.
- * In JDK 1.1.6 and later, <code>fileNameMap</code> is private; accessor
- * and mutator methods {@link #getFileNameMap() getFileNameMap} and
- * {@link #setFileNameMap(java.net.FileNameMap) setFileNameMap} are added
- * to access it.  This change is also described on the <a href=
- * "http://java.sun.com/products/jdk/1.2/compatibility.html">
- * Compatibility</a> page.
- *
  * Invoking the <tt>close()</tt> methods on the <tt>InputStream</tt> or <tt>OutputStream</tt> of an
  * <tt>URLConnection</tt> after a request may free network resources associated with this
  * instance, unless particular protocol specifications specify different behaviours
@@ -305,8 +296,7 @@
      * Loads filename map (a mimetable) from a data file. It will
      * first try to load the user-specific table, defined
      * by &quot;content.types.user.table&quot; property. If that fails,
-     * it tries to load the default built-in table at
-     * lib/content-types.properties under java home.
+     * it tries to load the default built-in table.
      *
      * @return the FileNameMap
      * @since 1.2
--- a/src/share/classes/java/net/doc-files/net-properties.html	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/net/doc-files/net-properties.html	Tue Jan 08 19:02:55 2013 -0500
@@ -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>
--- a/src/share/classes/java/security/KeyStore.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/security/KeyStore.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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;
--- a/src/share/classes/java/security/Policy.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/security/Policy.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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 {
--- a/src/share/classes/java/security/Security.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/security/Security.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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
  */
 
--- a/src/share/classes/java/security/cert/CertPathBuilder.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/security/cert/CertPathBuilder.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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 =
--- a/src/share/classes/java/security/cert/CertPathValidator.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/security/cert/CertPathValidator.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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 =
--- a/src/share/classes/java/security/cert/CertStore.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/security/cert/CertStore.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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;
--- a/src/share/classes/java/text/DateFormatSymbols.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/text/DateFormatSymbols.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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");
--- a/src/share/classes/java/text/SimpleDateFormat.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/text/SimpleDateFormat.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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.
--- a/src/share/classes/java/util/Base64.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/util/Base64.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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>
@@ -901,7 +901,7 @@
                     shiftto -= 6;
                     if (shiftto < 0) {
                         if (dl < dp + 3)
-                            return dp;
+                            return dp - dp0;
                         da[dp++] = (byte)(bits >> 16);
                         da[dp++] = (byte)(bits >>  8);
                         da[dp++] = (byte)(bits);
@@ -912,7 +912,7 @@
                 }
                 if (shiftto == 6) {
                     if (dl - dp < 1)
-                        return dp;
+                        return dp - dp0;
                     if (padding && (sp + 1 != sl || sa[sp++] != '='))
                         throw new IllegalArgumentException(
                             "Input buffer has wrong 4-byte ending unit");
@@ -920,7 +920,7 @@
                     mark = sp;
                 } else if (shiftto == 0) {
                     if (dl - dp < 2)
-                        return dp;
+                        return dp - dp0;
                     if (padding && sp != sl)
                         throw new IllegalArgumentException(
                             "Input buffer has wrong 4-byte ending unit");
@@ -969,7 +969,7 @@
                     shiftto -= 6;
                     if (shiftto < 0) {
                         if (dl < dp + 3)
-                            return dp;
+                            return dp - dp0;
                         dst.put(dp++, (byte)(bits >> 16));
                         dst.put(dp++, (byte)(bits >>  8));
                         dst.put(dp++, (byte)(bits));
@@ -980,7 +980,7 @@
                 }
                 if (shiftto == 6) {
                     if (dl - dp < 1)
-                        return dp;
+                        return dp - dp0;
                     if (padding && (sp + 1 != sl || src.get(sp++) != '='))
                         throw new IllegalArgumentException(
                             "Input buffer has wrong 4-byte ending unit");
@@ -988,7 +988,7 @@
                      mark = sp;
                 } else if (shiftto == 0) {
                     if (dl - dp < 2)
-                        return dp;
+                        return dp - dp0;
                     if (padding && sp != sl)
                         throw new IllegalArgumentException(
                             "Input buffer has wrong 4-byte ending unit");
--- a/src/share/classes/java/util/Calendar.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/util/Calendar.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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
--- a/src/share/classes/java/util/Currency.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/util/Currency.java	Tue Jan 08 19:02:55 2013 -0500
@@ -56,12 +56,13 @@
  * no public constructor. You obtain a <code>Currency</code> instance using
  * the <code>getInstance</code> methods.
  * <p>
- * Users can supersede the Java runtime currency data by creating a properties
- * file named <code>&lt;JAVA_HOME&gt;/lib/currency.properties</code>.  The contents
- * of the properties file are key/value pairs of the ISO 3166 country codes
- * and the ISO 4217 currency data respectively.  The value part consists of
- * three ISO 4217 values of a currency, i.e., an alphabetic code, a numeric
- * code, and a minor unit.  Those three ISO 4217 values are separated by commas.
+ * Users can supersede the Java runtime currency data by means of the system
+ * property {@code java.util.currency.data}. If this system property is
+ * defined then its value is the location of a properties file, the contents of
+ * which are key/value pairs of the ISO 3166 country codes and the ISO 4217
+ * currency data respectively.  The value part consists of three ISO 4217 values
+ * of a currency, i.e., an alphabetic code, a numeric code, and a minor unit.
+ * Those three ISO 4217 values are separated by commas.
  * The lines which start with '#'s are considered comment lines. An optional UTC
  * timestamp may be specified per currency entry if users need to specify a
  * cutover date indicating when the new data comes into effect. The timestamp is
@@ -246,10 +247,13 @@
                 }
 
                 // look for the properties file for overrides
+                String propsFile = System.getProperty("java.util.currency.data");
+                if (propsFile == null) {
+                    propsFile = homeDir + File.separator + "lib" +
+                        File.separator + "currency.properties";
+                }
                 try {
-                    File propFile = new File(homeDir + File.separator +
-                                             "lib" + File.separator +
-                                             "currency.properties");
+                    File propFile = new File(propsFile);
                     if (propFile.exists()) {
                         Properties props = new Properties();
                         try (FileReader fr = new FileReader(propFile)) {
--- a/src/share/classes/java/util/JapaneseImperialCalendar.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/util/JapaneseImperialCalendar.java	Tue Jan 08 19:02:55 2013 -0500
@@ -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);
+                        }
                     }
                 }
             }
--- a/src/share/classes/java/util/Properties.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/util/Properties.java	Tue Jan 08 19:02:55 2013 -0500
@@ -1188,7 +1188,7 @@
                         provider = loadProviderAsService(cl);
                         if (provider != null)
                             return provider;
-                        throw new InternalError("No fallback");
+                        return new jdk.internal.util.xml.BasicXmlPropertiesProvider();
                 }});
         }
 
--- a/src/share/classes/java/util/TimeZone.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/util/TimeZone.java	Tue Jan 08 19:02:55 2013 -0500
@@ -43,12 +43,12 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.concurrent.ConcurrentHashMap;
+import sun.misc.JavaAWTAccess;
 import sun.misc.SharedSecrets;
-import sun.misc.JavaAWTAccess;
 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;
                 }
--- a/src/share/classes/java/util/TreeMap.java	Tue Jan 08 19:00:12 2013 -0500
+++ b/src/share/classes/java/util/TreeMap.java	Tue Jan 08 19:02:55 2013 -0500
@@ -1759,7 +1759,7 @@
 
         public Set<Map.Entry<K,V>> entrySet() {
             EntrySetView es = entrySetView;
-            return (es != null) ? es : new AscendingEntrySetView();
+            return (es != null) ? es : (entrySetView = new AscendingEntrySetView());
         }
 
         TreeMap.Entry<K,V> subLowest()       { return absLowest(); }
@@ -1840,7 +1840,7 @@
 
         public Set<Map.Entry<K,V>> entrySet() {
             EntrySetView es = entrySetView;
-            return (es != null) ? es : new DescendingEntrySetView();
+            return (es != null) ? es : (entrySetView = new DescendingEntrySetView());
         }
 
         TreeMap.Entry<K,V> subLowest()       { return absHighest(); }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/util/concurrent/CountedCompleter.java	Tue Jan 08 19:02:55 2013 -0500
@@ -0,0 +1,743 @@
+/*
+ * 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.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+package java.util.concurrent;
+
+/**
+ * A {@link ForkJoinTask} with a completion action performed when
+ * triggered and there are no remaining pending
+ * actions. CountedCompleters are in general more robust in the
+ * presence of subtask stalls and blockage than are other forms of
+ * ForkJoinTasks, but are less intuitive to program.  Uses of
+ * CountedCompleter are similar to those of other completion based
+ * components (such as {@link java.nio.channels.CompletionHandler})
+ * except that multiple <em>pending</em> completions may be necessary
+ * to trigger the completion action {@link #onCompletion}, not just one.
+ * Unless initialized otherwise, the {@linkplain #getPendingCount pending
+ * count} starts at zero, but may be (atomically) changed using
+ * methods {@link #setPendingCount}, {@link #addToPendingCount}, and
+ * {@link #compareAndSetPendingCount}. Upon invocation of {@link
+ * #tryComplete}, if the pending action count is nonzero, it is
+ * decremented; otherwise, the completion action is performed, and if
+ * this completer itself has a completer, the process is continued
+ * with its completer.  As is the case with related synchronization
+ * components such as {@link java.util.concurrent.Phaser Phaser} and
+ * {@link java.util.concurrent.Semaphore Semaphore}, these methods
+ * affect only internal counts; they do not establish any further
+ * internal bookkeeping. In particular, the identities of pending
+ * tasks are not maintained. As illustrated below, you can create
+ * subclasses that do record some or all pending tasks or their
+ * results when needed.  As illustrated below, utility methods
+ * supporting customization of completion traversals are also
+ * provided. However, because CountedCompleters provide only basic
+ * synchronization mechanisms, it may be useful to create further
+ * abstract subclasses that maintain linkages, fields, and additional
+ * support methods appropriate for a set of related usages.
+ *
+ * <p>A concrete CountedCompleter class must define method {@link
+ * #compute}, that should in most cases (as illustrated below), invoke
+ * {@code tryComplete()} once before returning. The class may also
+ * optionally override method {@link #onCompletion} to perform an
+ * action upon normal completion, and method {@link
+ * #onExceptionalCompletion} to perform an action upon any exception.
+ *
+ * <p>CountedCompleters most often do not bear results, in which case
+ * they are normally declared as {@code CountedCompleter<Void>}, and
+ * will always return {@code null} as a result value.  In other cases,
+ * you should override method {@link #getRawResult} to provide a
+ * result from {@code join(), invoke()}, and related methods.  In
+ * general, this method should return the value of a field (or a
+ * function of one or more fields) of the CountedCompleter object that
+ * holds the result upon completion. Method {@link #setRawResult} by
+ * default plays no role in CountedCompleters.  It is possible, but
+ * rarely applicable, to override this method to maintain other
+ * objects or fields holding result data.
+ *
+ * <p>A CountedCompleter that does not itself have a completer (i.e.,
+ * one for which {@link #getCompleter} returns {@code null}) can be
+ * used as a regular ForkJoinTask with this added functionality.
+ * However, any completer that in turn has another completer serves
+ * only as an internal helper for other computations, so its own task
+ * status (as reported in methods such as {@link ForkJoinTask#isDone})
+ * is arbitrary; this status changes only upon explicit invocations of
+ * {@link #complete}, {@link ForkJoinTask#cancel}, {@link
+ * ForkJoinTask#completeExceptionally} or upon exceptional completion
+ * of method {@code compute}. Upon any exceptional completion, the
+ * exception may be relayed to a task's completer (and its completer,
+ * and so on), if one exists and it has not otherwise already
+ * completed. Similarly, cancelling an internal CountedCompleter has
+ * only a local effect on that completer, so is not often useful.
+ *
+ * <p><b>Sample Usages.</b>
+ *
+ * <p><b>Parallel recursive decomposition.</b> CountedCompleters may
+ * be arranged in trees similar to those often used with {@link
+ * RecursiveAction}s, although the constructions involved in setting
+ * them up typically vary. Here, the completer of each task is its
+ * parent in the computation tree. Even though they entail a bit more
+ * bookkeeping, CountedCompleters may be better choices when applying
+ * a possibly time-consuming operation (that cannot be further
+ * subdivided) to each element of an array or collection; especially
+ * when the operation takes a significantly different amount of time
+ * to complete for some elements than others, either because of
+ * intrinsic variation (for example I/O) or auxiliary effects such as
+ * garbage collection.  Because CountedCompleters provide their own
+ * continuations, other threads need not block waiting to perform
+ * them.
+ *
+ * <p>For example, here is an initial version of a class that uses
+ * divide-by-two recursive decomposition to divide work into single
+ * pieces (leaf tasks). Even when work is split into individual calls,