changeset 6276:90ad9e922042

Merge
author lana
date Tue, 18 Dec 2012 16:14:59 -0800
parents 985b523712c8 de6b54a60d60
children 7082a96c02d2
files src/share/lib/security/java.security test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshall.java
diffstat 637 files changed, 14062 insertions(+), 3414 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Dec 18 15:17:58 2012 +0000
+++ b/.hgtags	Tue Dec 18 16:14:59 2012 -0800
@@ -188,3 +188,5 @@
 26dbd73fb7662a29b3e47179fdc88a0bfa4e231e jdk8-b64
 130d3a54d28becaac0846137256c2684adb34c33 jdk8-b65
 4d337fae2250135729ee9ed2bf8baf3c60da5d6d jdk8-b66
+ce9b02a3a17edd1983201002cfa0f364e4ab7524 jdk8-b67
+53fb43e4d614c92310e1fb00ec41d1960fd9facf jdk8-b68
--- a/make/com/sun/security/Makefile	Tue Dec 18 15:17:58 2012 +0000
+++ b/make/com/sun/security/Makefile	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 16:14:59 2012 -0800
@@ -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/docs/CORE_PKGS.gmk	Tue Dec 18 15:17:58 2012 +0000
+++ b/make/docs/CORE_PKGS.gmk	Tue Dec 18 16:14:59 2012 -0800
@@ -131,6 +131,7 @@
   java.util.concurrent                           \
   java.util.concurrent.atomic                    \
   java.util.concurrent.locks                     \
+  java.util.function                             \
   java.util.jar                                  \
   java.util.logging                              \
   java.util.prefs                                \
--- a/make/java/java/FILES_java.gmk	Tue Dec 18 15:17:58 2012 +0000
+++ b/make/java/java/FILES_java.gmk	Tue Dec 18 16:14:59 2012 -0800
@@ -147,6 +147,7 @@
 	java/lang/ref/PhantomReference.java \
     java/lang/ref/ReferenceQueue.java \
     java/lang/ref/Finalizer.java \
+    java/util/Base64.java \
     java/util/BitSet.java \
     java/util/Calendar.java \
         java/util/GregorianCalendar.java \
--- a/make/java/java/Makefile	Tue Dec 18 15:17:58 2012 +0000
+++ b/make/java/java/Makefile	Tue Dec 18 16:14:59 2012 -0800
@@ -37,6 +37,8 @@
 JAVAC_MAX_WARNINGS=true
 include $(BUILDDIR)/common/Defs.gmk
 
+AUTO_FILES_JAVA_DIRS = java/util/function
+
 # windows compiler flags
 ifeq ($(PLATFORM),windows)
   OTHER_CFLAGS =
--- a/make/java/net/Makefile	Tue Dec 18 15:17:58 2012 +0000
+++ b/make/java/net/Makefile	Tue Dec 18 16:14:59 2012 -0800
@@ -77,6 +77,7 @@
     FILES_export += java/net/DualStackPlainSocketImpl.java
     FILES_export += java/net/TwoStacksPlainDatagramSocketImpl.java
     FILES_export += java/net/DualStackPlainDatagramSocketImpl.java
+    FILES_export += sun/net/www/protocol/http/ntlm/NTLMAuthSequence.java
 else
     FILES_export += java/net/PlainDatagramSocketImpl.java
 endif
--- a/make/java/nio/Makefile	Tue Dec 18 15:17:58 2012 +0000
+++ b/make/java/nio/Makefile	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/make/java/nio/mapfile-linux	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/make/java/security/Makefile	Tue Dec 18 16:14:59 2012 -0800
@@ -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/jprt.properties	Tue Dec 18 15:17:58 2012 +0000
+++ b/make/jprt.properties	Tue Dec 18 16:14:59 2012 -0800
@@ -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/sun/security/Makefile	Tue Dec 18 15:17:58 2012 +0000
+++ b/make/sun/security/Makefile	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/make/tools/src/build/tools/cldrconverter/Bundle.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/make/tools/src/build/tools/cldrconverter/BundleGenerator.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/make/tools/src/build/tools/cldrconverter/CLDRConverter.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/make/tools/src/build/tools/cldrconverter/LDMLParseHandler.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/make/tools/src/build/tools/cldrconverter/MetaZonesParseHandler.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/make/tools/src/build/tools/cldrconverter/ResourceBundleGenerator.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/makefiles/CompileDemos.gmk	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/makefiles/CompileJavaClasses.gmk	Tue Dec 18 16:14:59 2012 -0800
@@ -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/CompileNativeLibraries.gmk	Tue Dec 18 15:17:58 2012 +0000
+++ b/makefiles/CompileNativeLibraries.gmk	Tue Dec 18 16:14:59 2012 -0800
@@ -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
@@ -1645,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
@@ -1688,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
@@ -1897,6 +1897,7 @@
 		UnixAsynchronousServerSocketChannelImpl.c \
 		UnixAsynchronousSocketChannelImpl.c \
 		GnomeFileTypeDetector.c \
+		MagicFileTypeDetector.c \
 		LinuxNativeDispatcher.c \
 		LinuxWatchService.c \
 		UnixCopyFile.c \
@@ -2235,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)\
@@ -2539,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),\
@@ -2558,6 +2560,7 @@
 
 BUILD_LIBRARIES += $(BUILD_LIBJ2GSS)
 endif
+endif
 
 ##########################################################################################
 
--- a/makefiles/CopyFiles.gmk	Tue Dec 18 15:17:58 2012 +0000
+++ b/makefiles/CopyFiles.gmk	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/makefiles/CreateJars.gmk	Tue Dec 18 16:14:59 2012 -0800
@@ -446,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
 
@@ -476,9 +474,7 @@
 
     $(SUNEC_JAR_DST) : $(SUNEC_JAR_SRC)
 	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt SunEC provider..."
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(CP) $< $@
+	$(install-file)
 
 else
 
@@ -518,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,,\
@@ -545,9 +540,7 @@
 
     $(JCE_JAR_DST) : $(JCE_JAR_SRC)
 	@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt jce.jar..."
-	$(MKDIR) -p $(@D)
-	$(RM) $@
-	$(CP) $< $@
+	$(install-file)
 
 else
 
@@ -567,76 +560,86 @@
 
 ##########################################################################################
 
-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)
@@ -648,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
 
@@ -676,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)
 
@@ -897,14 +896,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)
 
@@ -922,6 +917,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 Dec 18 15:17:58 2012 +0000
+++ b/makefiles/Images.gmk	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/makefiles/Import.gmk	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/makefiles/mapfiles/libnio/mapfile-linux	Tue Dec 18 16:14:59 2012 -0800
@@ -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/share/back/debugInit.c	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/back/debugInit.c	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/back/error_messages.c	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/back/transport.c	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/java/util/jar/pack/PropMap.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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/snmp/EnumRowStatus.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/EnumRowStatus.java	Tue Dec 18 16:14:59 2012 -0800
@@ -28,10 +28,6 @@
 import java.io.Serializable;
 import java.util.Hashtable;
 
-import com.sun.jmx.snmp.SnmpValue;
-import com.sun.jmx.snmp.SnmpInt;
-
-import com.sun.jmx.snmp.Enumerated;
 
 /**
  * This class is an internal class which is used to represent RowStatus
@@ -263,30 +259,30 @@
 
     // Documented in Enumerated
     //
-    protected Hashtable getIntTable() {
+    @Override
+    protected Hashtable<Integer, String> getIntTable() {
         return EnumRowStatus.getRSIntTable();
     }
 
     // Documented in Enumerated
     //
-    protected Hashtable getStringTable() {
+    @Override
+    protected Hashtable<String, Integer> getStringTable() {
         return  EnumRowStatus.getRSStringTable();
     }
 
-    static final Hashtable getRSIntTable() {
+    static Hashtable<Integer, String> getRSIntTable() {
         return intTable ;
     }
 
-    static final Hashtable getRSStringTable() {
+    static Hashtable<String, Integer> getRSStringTable() {
         return stringTable ;
     }
 
     // Initialize the mapping tables.
     //
-    final static Hashtable<Integer, String> intTable =
-            new Hashtable<Integer, String>();
-    final static Hashtable<String, Integer> stringTable =
-            new Hashtable<String, Integer>();
+    final static Hashtable<Integer, String> intTable = new Hashtable<>();
+    final static Hashtable<String, Integer> stringTable = new Hashtable<>();
     static  {
         intTable.put(new Integer(0), "unspecified");
         intTable.put(new Integer(3), "notReady");
--- a/src/share/classes/com/sun/jmx/snmp/Enumerated.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/Enumerated.java	Tue Dec 18 16:14:59 2012 -0800
@@ -54,9 +54,9 @@
     * @exception IllegalArgumentException One of the arguments passed to the method is illegal or inappropriate.
    */
   public Enumerated() throws IllegalArgumentException {
-    Enumeration e =getIntTable().keys() ;
+    Enumeration<Integer> e =getIntTable().keys();
     if (e.hasMoreElements()) {
-      value = ((Integer)e.nextElement()).intValue() ;
+      value = e.nextElement().intValue() ;
     }
     else {
       throw new IllegalArgumentException() ;
@@ -100,7 +100,7 @@
    *  to the method is illegal or inappropriate.
    */
   public Enumerated(String valueString) throws IllegalArgumentException {
-    Integer index = (Integer)getStringTable().get(valueString) ;
+    Integer index = getStringTable().get(valueString) ;
     if (index == null) {
       throw new IllegalArgumentException() ;
     }
@@ -127,7 +127,7 @@
    * @return An enumeration of Integer instances
    */
 
-  public Enumeration valueIndexes() {
+  public Enumeration<Integer> valueIndexes() {
     return getIntTable().keys() ;
   }
 
@@ -138,7 +138,7 @@
    * @return An enumeration of String instances
    */
 
-  public Enumeration valueStrings() {
+  public Enumeration<String> valueStrings() {
     return getStringTable().keys() ;
   }
 
@@ -153,6 +153,7 @@
    *
    * @return True if this and obj are the same; false otherwise
    */
+  @Override
   public boolean equals(Object obj) {
 
     return ((obj != null) &&
@@ -166,6 +167,7 @@
    *
    * @return A hash code value for this object.
    */
+  @Override
   public int hashCode() {
     String hashString = getClass().getName() + String.valueOf(value) ;
     return hashString.hashCode() ;
@@ -177,9 +179,9 @@
    *
    * @return The string for for this object.
    */
-
+  @Override
   public String toString() {
-    return (String)getIntTable().get(new Integer(value)) ;
+    return getIntTable().get(new Integer(value)) ;
   }
 
 
@@ -193,7 +195,7 @@
    * @return An hashtable for read-only purpose
    */
 
-  protected abstract Hashtable getIntTable() ;
+  protected abstract Hashtable<Integer,String>  getIntTable() ;
 
 
 
@@ -207,12 +209,12 @@
    * @return An hashtable for read-only purpose
    */
 
-  protected abstract Hashtable getStringTable() ;
+  protected abstract Hashtable<String,Integer> getStringTable() ;
 
 
   /**
    * This variable keeps the integer form of the enumerated.
-   * The string form is retreived using getIntTable().
+   * The string form is retrieved using getIntTable().
    */
   protected int value ;
 
--- a/src/share/classes/com/sun/jmx/snmp/IPAcl/AclImpl.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/AclImpl.java	Tue Dec 18 16:14:59 2012 -0800
@@ -66,7 +66,7 @@
    */
   public AclImpl (PrincipalImpl owner, String name) {
         super(owner);
-        entryList = new Vector<AclEntry>();
+        entryList = new Vector<>();
         aclName = name;
   }
 
@@ -81,6 +81,7 @@
    *            of this ACL.
    * @see java.security.Principal
    */
+  @Override
   public void setName(Principal caller, String name)
         throws NotOwnerException {
           if (!isOwner(caller))
@@ -93,6 +94,7 @@
    *
    * @return the name of this ACL.
    */
+  @Override
   public String getName(){
         return aclName;
   }
@@ -113,6 +115,7 @@
    *       this ACL.
    * @see java.security.Principal
    */
+  @Override
   public boolean addEntry(Principal caller, AclEntry entry)
         throws NotOwnerException {
           if (!isOwner(caller))
@@ -144,6 +147,7 @@
    * @see java.security.Principal
    * @see java.security.acl.AclEntry
    */
+  @Override
   public boolean removeEntry(Principal caller, AclEntry entry)
         throws NotOwnerException {
           if (!isOwner(caller))
@@ -185,8 +189,9 @@
    *     is allowed.
    * @see java.security.Principal
    */
+  @Override
   public Enumeration<Permission> getPermissions(Principal user){
-        Vector<Permission> empty = new Vector<Permission>();
+        Vector<Permission> empty = new Vector<>();
         for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
           AclEntry ent = e.nextElement();
           if (ent.getPrincipal().equals(user))
@@ -201,6 +206,7 @@
    *
    * @return an enumeration of the entries in this ACL.
    */
+  @Override
   public Enumeration<AclEntry> entries(){
         return entryList.elements();
   }
@@ -221,10 +227,11 @@
    * @see java.security.Principal
    * @see java.security.Permission
    */
+  @Override
   public boolean checkPermission(Principal user,
                                  java.security.acl.Permission perm) {
-        for (Enumeration e = entryList.elements();e.hasMoreElements();){
-          AclEntry ent = (AclEntry) e.nextElement();
+        for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
+          AclEntry ent = e.nextElement();
           if (ent.getPrincipal().equals(user))
                 if (ent.checkPermission(perm)) return true;
         }
@@ -250,7 +257,7 @@
    */
   public boolean checkPermission(Principal user, String community,
                                  java.security.acl.Permission perm) {
-        for (Enumeration e = entryList.elements();e.hasMoreElements();){
+        for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
           AclEntryImpl ent = (AclEntryImpl) e.nextElement();
           if (ent.getPrincipal().equals(user))
                 if (ent.checkPermission(perm) && ent.checkCommunity(community)) return true;
@@ -269,7 +276,7 @@
    * @see java.security.Permission
    */
   public boolean checkCommunity(String community) {
-        for (Enumeration e = entryList.elements();e.hasMoreElements();){
+        for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
           AclEntryImpl ent = (AclEntryImpl) e.nextElement();
           if (ent.checkCommunity(community)) return true;
         }
@@ -281,6 +288,7 @@
    *
    * @return a string representation of the ACL contents.
    */
+  @Override
   public String toString(){
         return ("AclImpl: "+ getName());
   }
--- a/src/share/classes/com/sun/jmx/snmp/IPAcl/JDMAclBlock.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/JDMAclBlock.java	Tue Dec 18 16:14:59 2012 -0800
@@ -28,7 +28,9 @@
 
 package com.sun.jmx.snmp.IPAcl;
 
+import java.net.InetAddress;
 import java.util.Hashtable;
+import java.util.Vector;
 
 class JDMAclBlock extends SimpleNode {
   JDMAclBlock(int id) {
@@ -51,11 +53,13 @@
    * Do no need to go through this part of the tree for
    * building TrapEntry.
    */
-   public void buildTrapEntries(Hashtable dest) {}
+   @Override
+   public void buildTrapEntries(Hashtable<InetAddress, Vector<String>> dest) {}
 
   /**
    * Do no need to go through this part of the tree for
    * building InformEntry.
    */
-   public void buildInformEntries(Hashtable dest) {}
+    @Override
+   public void buildInformEntries(Hashtable<InetAddress, Vector<String>> dest) {}
 }
--- a/src/share/classes/com/sun/jmx/snmp/IPAcl/JDMInformBlock.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/JDMInformBlock.java	Tue Dec 18 16:14:59 2012 -0800
@@ -27,7 +27,9 @@
 
 package com.sun.jmx.snmp.IPAcl;
 
+import java.net.InetAddress;
 import java.util.Hashtable;
+import java.util.Vector;
 
 class JDMInformBlock extends SimpleNode {
     JDMInformBlock(int id) {
@@ -50,11 +52,13 @@
      * Do no need to go through this part of the tree for
      * building AclEntry.
      */
+    @Override
     public void buildAclEntries(PrincipalImpl owner, AclImpl acl) {}
 
     /**
      * Do no need to go through this part of the tree for
      * building TrapEntry.
      */
-    public void buildTrapEntries(Hashtable dest) {}
+    @Override
+    public void buildTrapEntries(Hashtable<InetAddress, Vector<String>> dest) {}
 }
--- a/src/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapBlock.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapBlock.java	Tue Dec 18 16:14:59 2012 -0800
@@ -28,7 +28,9 @@
 
 package com.sun.jmx.snmp.IPAcl;
 
+import java.net.InetAddress;
 import java.util.Hashtable;
+import java.util.Vector;
 
 class JDMTrapBlock extends SimpleNode {
   JDMTrapBlock(int id) {
@@ -51,11 +53,13 @@
    * Do no need to go through this part of the tree for
    * building AclEntry.
    */
+   @Override
    public void buildAclEntries(PrincipalImpl owner, AclImpl acl) {}
 
   /**
    * Do no need to go through this part of the tree for
    * building InformEntry.
    */
-   public void buildInformEntries(Hashtable dest) {}
+   @Override
+   public void buildInformEntries(Hashtable<InetAddress, Vector<String>> dest) {}
 }
--- a/src/share/classes/com/sun/jmx/snmp/IPAcl/JJTParserState.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/JJTParserState.java	Tue Dec 18 16:14:59 2012 -0800
@@ -27,18 +27,17 @@
 
 package com.sun.jmx.snmp.IPAcl;
 
-@SuppressWarnings("unchecked")  // generated code, not worth fixing
 class JJTParserState {
-  private java.util.Stack nodes;
-  private java.util.Stack marks;
+  private java.util.Stack<Node> nodes;
+  private java.util.Stack<Integer> marks;
 
   private int sp;               // number of nodes on stack
   private int mk;               // current mark
   private boolean node_created;
 
   JJTParserState() {
-    nodes = new java.util.Stack();
-    marks = new java.util.Stack();
+    nodes = new java.util.Stack<>();
+    marks = new java.util.Stack<>();
     sp = 0;
     mk = 0;
   }
@@ -62,7 +61,7 @@
   /* Returns the root node of the AST.  It only makes sense to call
      this after a successful parse. */
   Node rootNode() {
-    return (Node)nodes.elementAt(0);
+    return nodes.elementAt(0);
   }
 
   /* Pushes a node on to the stack. */
@@ -75,14 +74,14 @@
      stack.  */
   Node popNode() {
     if (--sp < mk) {
-      mk = ((Integer)marks.pop()).intValue();
+      mk = marks.pop().intValue();
     }
-    return (Node)nodes.pop();
+    return nodes.pop();
   }
 
   /* Returns the node currently on the top of the stack. */
   Node peekNode() {
-    return (Node)nodes.peek();
+    return nodes.peek();
   }
 
   /* Returns the number of children on the stack in the current node
@@ -96,7 +95,7 @@
     while (sp > mk) {
       popNode();
     }
-    mk = ((Integer)marks.pop()).intValue();
+    mk = marks.pop().intValue();
   }
 
 
@@ -112,7 +111,7 @@
      made the children of the definite node.  Then the definite node
      is pushed on to the stack. */
   void closeNodeScope(Node n, int num) {
-    mk = ((Integer)marks.pop()).intValue();
+    mk = marks.pop().intValue();
     while (num-- > 0) {
       Node c = popNode();
       c.jjtSetParent(n);
@@ -132,7 +131,7 @@
   void closeNodeScope(Node n, boolean condition) {
     if (condition) {
       int a = nodeArity();
-      mk = ((Integer)marks.pop()).intValue();
+      mk = marks.pop().intValue();
       while (a-- > 0) {
         Node c = popNode();
         c.jjtSetParent(n);
@@ -142,7 +141,7 @@
       pushNode(n);
       node_created = true;
     } else {
-      mk = ((Integer)marks.pop()).intValue();
+      mk = marks.pop().intValue();
       node_created = false;
     }
   }
--- a/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java	Tue Dec 18 16:14:59 2012 -0800
@@ -1168,7 +1168,7 @@
       return (jj_ntk = jj_nt.kind);
   }
 
-  private java.util.Vector jj_expentries = new java.util.Vector();
+  private java.util.Vector<int[]> jj_expentries = new java.util.Vector<>();
   private int[] jj_expentry;
   private int jj_kind = -1;
   private int[] jj_lasttokens = new int[100];
@@ -1184,8 +1184,8 @@
         jj_expentry[i] = jj_lasttokens[i];
       }
       boolean exists = false;
-      for (java.util.Enumeration enumv = jj_expentries.elements(); enumv.hasMoreElements();) {
-        int[] oldentry = (int[])(enumv.nextElement());
+      for (java.util.Enumeration<int[]> enumv = jj_expentries.elements(); enumv.hasMoreElements();) {
+        int[] oldentry = enumv.nextElement();
         if (oldentry.length == jj_expentry.length) {
           exists = true;
           for (int i = 0; i < jj_expentry.length; i++) {
@@ -1236,7 +1236,7 @@
     jj_add_error_token(0, 0);
     int[][] exptokseq = new int[jj_expentries.size()][];
     for (int i = 0; i < jj_expentries.size(); i++) {
-      exptokseq[i] = (int[])jj_expentries.elementAt(i);
+      exptokseq[i] = jj_expentries.elementAt(i);
     }
     return new ParseException(token, exptokseq, tokenImage);
   }
--- a/src/share/classes/com/sun/jmx/snmp/IPAcl/SnmpAcl.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/IPAcl/SnmpAcl.java	Tue Dec 18 16:14:59 2012 -0800
@@ -126,7 +126,7 @@
      *
      * @return An enumeration of the entries in this ACL.
      */
-    public Enumeration entries() {
+    public Enumeration<AclEntry> entries() {
         return acl.entries();
     }
 
@@ -137,11 +137,11 @@
     public Enumeration<String> communities() {
         HashSet<String> set = new HashSet<String>();
         Vector<String> res = new Vector<String>();
-        for (Enumeration e = acl.entries() ; e.hasMoreElements() ;) {
+        for (Enumeration<AclEntry> e = acl.entries() ; e.hasMoreElements() ;) {
             AclEntryImpl entry = (AclEntryImpl) e.nextElement();
-            for (Enumeration cs = entry.communities();
+            for (Enumeration<String> cs = entry.communities();
                  cs.hasMoreElements() ;) {
-                set.add((String) cs.nextElement());
+                set.add(cs.nextElement());
             }
         }
         String[] objs = set.toArray(new String[0]);
@@ -316,7 +316,7 @@
      *
      * @return An enumeration of the trap destinations (enumeration of <CODE>InetAddress</CODE>).
      */
-    public Enumeration getTrapDestinations() {
+    public Enumeration<InetAddress> getTrapDestinations() {
         return trapDestList.keys();
     }
 
@@ -327,16 +327,16 @@
      *
      * @return An enumeration of trap communities for a given host (enumeration of <CODE>String</CODE>).
      */
-    public Enumeration getTrapCommunities(InetAddress i) {
-        Vector list = null;
-        if ((list = (Vector)trapDestList.get(i)) != null ) {
+    public Enumeration<String> getTrapCommunities(InetAddress i) {
+        Vector<String> list = null;
+        if ((list = trapDestList.get(i)) != null ) {
             if (SNMP_LOGGER.isLoggable(Level.FINER)) {
                 SNMP_LOGGER.logp(Level.FINER, SnmpAcl.class.getName(),
                     "getTrapCommunities", "["+i.toString()+"] is in list");
             }
             return list.elements();
         } else {
-            list = new Vector();
+            list = new Vector<>();
             if (SNMP_LOGGER.isLoggable(Level.FINER)) {
                 SNMP_LOGGER.logp(Level.FINER, SnmpAcl.class.getName(),
                     "getTrapCommunities", "["+i.toString()+"] is not in list");
@@ -350,7 +350,7 @@
      *
      * @return An enumeration of the inform destinations (enumeration of <CODE>InetAddress</CODE>).
      */
-    public Enumeration getInformDestinations() {
+    public Enumeration<InetAddress> getInformDestinations() {
         return informDestList.keys();
     }
 
@@ -361,16 +361,16 @@
      *
      * @return An enumeration of inform communities for a given host (enumeration of <CODE>String</CODE>).
      */
-    public Enumeration getInformCommunities(InetAddress i) {
-        Vector list = null;
-        if ((list = (Vector)informDestList.get(i)) != null ) {
+    public Enumeration<String> getInformCommunities(InetAddress i) {
+        Vector<String> list = null;
+        if ((list = informDestList.get(i)) != null ) {
             if (SNMP_LOGGER.isLoggable(Level.FINER)) {
                 SNMP_LOGGER.logp(Level.FINER, SnmpAcl.class.getName(),
                     "getInformCommunities", "["+i.toString()+"] is in list");
             }
             return list.elements();
         } else {
-            list = new Vector();
+            list = new Vector<>();
             if (SNMP_LOGGER.isLoggable(Level.FINER)) {
                 SNMP_LOGGER.logp(Level.FINER, SnmpAcl.class.getName(),
                     "getInformCommunities", "["+i.toString()+"] is not in list");
@@ -426,15 +426,15 @@
                 throw new IllegalArgumentException(err.getMessage());
             }
 
-            for(Enumeration e = acl.entries(); e.hasMoreElements();) {
+            for(Enumeration<AclEntry> e = acl.entries(); e.hasMoreElements();) {
                 AclEntryImpl aa = (AclEntryImpl) e.nextElement();
                 if (SNMP_LOGGER.isLoggable(Level.FINER)) {
                     SNMP_LOGGER.logp(Level.FINER, SnmpAcl.class.getName(),
                             "readAuthorizedListFile",
                             "===> " + aa.getPrincipal().toString());
                 }
-                for (Enumeration eee = aa.permissions();eee.hasMoreElements();) {
-                    java.security.acl.Permission perm = (java.security.acl.Permission)eee.nextElement();
+                for (Enumeration<java.security.acl.Permission> eee = aa.permissions();eee.hasMoreElements();) {
+                    java.security.acl.Permission perm = eee.nextElement();
                     if (SNMP_LOGGER.isLoggable(Level.FINER)) {
                         SNMP_LOGGER.logp(Level.FINER, SnmpAcl.class.getName(),
                                 "readAuthorizedListFile", "perm = " + perm);
--- a/src/share/classes/com/sun/jmx/snmp/InetAddressAcl.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/InetAddressAcl.java	Tue Dec 18 16:14:59 2012 -0800
@@ -99,7 +99,7 @@
      *
      * @return An enumeration of the trap destinations (enumeration of <CODE>InetAddress</CODE>).
      */
-    public Enumeration getTrapDestinations();
+    public Enumeration<InetAddress> getTrapDestinations();
 
     /**
      * Returns an enumeration of trap communities for a given host.
@@ -108,14 +108,14 @@
      *
      * @return An enumeration of trap communities for a given host (enumeration of <CODE>String</CODE>).
      */
-    public Enumeration getTrapCommunities(InetAddress address);
+    public Enumeration<String> getTrapCommunities(InetAddress address);
 
     /**
      * Returns an enumeration of inform destinations.
      *
      * @return An enumeration of the inform destinations (enumeration of <CODE>InetAddress</CODE>).
      */
-    public Enumeration getInformDestinations();
+    public Enumeration<InetAddress> getInformDestinations();
 
     /**
      * Returns an enumeration of inform communities for a given host.
@@ -124,5 +124,5 @@
      *
      * @return An enumeration of inform communities for a given host (enumeration of <CODE>String</CODE>).
      */
-    public Enumeration getInformCommunities(InetAddress address);
+    public Enumeration<String> getInformCommunities(InetAddress address);
 }
--- a/src/share/classes/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java	Tue Dec 18 16:14:59 2012 -0800
@@ -59,6 +59,7 @@
      * @exception IllegalAccessException The MIB cannot be initialized.
      */
 
+    @Override
     public void init() throws IllegalAccessException {
     }
 
@@ -74,6 +75,7 @@
      * @exception java.lang.Exception
      */
 
+    @Override
     public ObjectName preRegister(MBeanServer server, ObjectName name)
         throws Exception {
         return name;
@@ -87,6 +89,7 @@
      * @return The returned oid is null.
      */
 
+    @Override
     public long[] getRootOid() {
         return null;
     }
@@ -99,6 +102,7 @@
      * @exception SnmpStatusException An error occured during the operation.
      */
 
+    @Override
     public void get(SnmpMibRequest inRequest) throws SnmpStatusException {
 
         SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
@@ -108,9 +112,9 @@
         if(inRequest.getVersion() == SnmpDefinitions.snmpVersionOne)
             throw new SnmpStatusException(SnmpStatusException.noSuchName);
 
-        Enumeration l = inRequest.getElements();
+        Enumeration<SnmpVarBind> l = inRequest.getElements();
         while(l.hasMoreElements()) {
-            SnmpVarBind varbind = (SnmpVarBind) l.nextElement();
+            SnmpVarBind varbind = l.nextElement();
             varbind.setNoSuchObject();
         }
     }
@@ -128,6 +132,7 @@
      *    cannot be performed.
      */
 
+    @Override
     public void check(SnmpMibRequest inRequest) throws SnmpStatusException {
 
         SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
@@ -145,6 +150,7 @@
      * @exception SnmpStatusException An error occured during the operation.
      */
 
+    @Override
     public void set(SnmpMibRequest inRequest) throws SnmpStatusException {
 
         SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
@@ -162,6 +168,7 @@
      * @exception SnmpStatusException An error occured during the operation.
      */
 
+    @Override
     public void getNext(SnmpMibRequest inRequest) throws SnmpStatusException {
 
         SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
@@ -171,9 +178,9 @@
         if(inRequest.getVersion() == SnmpDefinitions.snmpVersionOne)
             throw new SnmpStatusException(SnmpStatusException.noSuchName);
 
-        Enumeration l = inRequest.getElements();
+        Enumeration<SnmpVarBind> l = inRequest.getElements();
         while(l.hasMoreElements()) {
-            SnmpVarBind varbind = (SnmpVarBind) l.nextElement();
+            SnmpVarBind varbind = l.nextElement();
             varbind.setEndOfMibView();
         }
     }
@@ -186,6 +193,7 @@
      * @exception SnmpStatusException An error occured during the operation.
      */
 
+    @Override
     public void getBulk(SnmpMibRequest inRequest, int nonRepeat, int maxRepeat)
         throws SnmpStatusException {
 
@@ -196,9 +204,9 @@
         if(inRequest.getVersion() == SnmpDefinitions.snmpVersionOne)
             throw new SnmpStatusException(SnmpDefinitions.snmpRspGenErr, 0);
 
-        Enumeration l = inRequest.getElements();
+        Enumeration<SnmpVarBind> l = inRequest.getElements();
         while(l.hasMoreElements()) {
-            SnmpVarBind varbind = (SnmpVarBind) l.nextElement();
+            SnmpVarBind varbind = l.nextElement();
             varbind.setEndOfMibView();
         }
     }
--- a/src/share/classes/com/sun/jmx/snmp/agent/SnmpGenericObjectServer.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/agent/SnmpGenericObjectServer.java	Tue Dec 18 16:14:59 2012 -0800
@@ -28,7 +28,6 @@
 
 // java imports
 //
-import java.util.Vector;
 import java.util.Enumeration;
 import java.util.Iterator;
 
@@ -149,8 +148,8 @@
         final long[]        idList   = new long[size];
         int   i = 0;
 
-        for (Enumeration e=req.getElements(); e.hasMoreElements();) {
-            final SnmpVarBind var= (SnmpVarBind) e.nextElement();
+        for (Enumeration<SnmpVarBind> e=req.getElements(); e.hasMoreElements();) {
+            final SnmpVarBind var= e.nextElement();
             try {
                 final long id = var.oid.getOidArc(depth);
                 nameList[i]   = meta.getAttributeName(id);
@@ -190,7 +189,7 @@
         }
 
 
-        final Iterator it = result.iterator();
+        final Iterator<?> it = result.iterator();
 
         for (int j=0; j < i; j++) {
             if (!it.hasNext()) {
@@ -312,8 +311,8 @@
         final long[]        idList   = new long[size];
         int   i = 0;
 
-        for (Enumeration e=req.getElements(); e.hasMoreElements();) {
-            final SnmpVarBind var= (SnmpVarBind) e.nextElement();
+        for (Enumeration<SnmpVarBind> e=req.getElements(); e.hasMoreElements();) {
+            final SnmpVarBind var= e.nextElement();
             try {
                 final long id = var.oid.getOidArc(depth);
                 final String attname = meta.getAttributeName(id);
@@ -330,7 +329,7 @@
             }
         }
 
-        AttributeList result = null;
+        AttributeList result;
         int errorCode = SnmpStatusException.noAccess;
 
         try {
@@ -345,7 +344,7 @@
             result = new AttributeList();
         }
 
-        final Iterator it = result.iterator();
+        final Iterator<?> it = result.iterator();
 
         for (int j=0; j < i; j++) {
             if (!it.hasNext()) {
@@ -469,8 +468,8 @@
 
         final Object data = req.getUserData();
 
-        for (Enumeration e=req.getElements(); e.hasMoreElements();) {
-            final SnmpVarBind var= (SnmpVarBind) e.nextElement();
+        for (Enumeration<SnmpVarBind> e=req.getElements(); e.hasMoreElements();) {
+            final SnmpVarBind var= e.nextElement();
             try {
                 final long id = var.oid.getOidArc(depth);
                 // call meta.check() here, and meta.check will call check()
--- a/src/share/classes/com/sun/jmx/snmp/agent/SnmpIndex.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/agent/SnmpIndex.java	Tue Dec 18 16:14:59 2012 -0800
@@ -164,11 +164,12 @@
      *
      * @return A string representation of the index.
      */
+    @Override
     public String toString() {
-        StringBuffer msg= new StringBuffer();
-        for(Enumeration e= oids.elements(); e.hasMoreElements(); ) {
-            SnmpOid val= (SnmpOid) e.nextElement();
-            msg.append( "//" + val.toString());
+        final StringBuilder msg= new StringBuilder();
+        for(Enumeration<SnmpOid> e= oids.elements(); e.hasMoreElements(); ) {
+            SnmpOid val= e.nextElement();
+            msg.append("//").append( val.toString());
         }
         return msg.toString();
     }
@@ -180,7 +181,7 @@
      * The list of OIDs.
      * @serial
      */
-    private Vector<SnmpOid> oids = new Vector<SnmpOid>();
+    private Vector<SnmpOid> oids = new Vector<>();
 
     /**
      * The number of elements in the index.
--- a/src/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java	Tue Dec 18 16:14:59 2012 -0800
@@ -42,10 +42,6 @@
 import com.sun.jmx.snmp.SnmpVarBind;
 import com.sun.jmx.snmp.SnmpDefinitions;
 import com.sun.jmx.snmp.SnmpStatusException;
-import com.sun.jmx.snmp.SnmpEngine;
-import com.sun.jmx.snmp.SnmpUnknownModelException;
-import com.sun.jmx.snmp.internal.SnmpAccessControlModel;
-import com.sun.jmx.snmp.internal.SnmpEngineImpl;
 
 /**
  * Abstract class for representing an SNMP MIB.
@@ -241,6 +237,7 @@
     // Implements the method defined in SnmpMibAgent. See SnmpMibAgent
     // for java-doc
     //
+    @Override
     public void get(SnmpMibRequest req) throws SnmpStatusException {
 
         // Builds the request tree: creation is not allowed, operation
@@ -259,8 +256,8 @@
 
         // For each sub-request stored in the request-tree, invoke the
         // get() method.
-        for (Enumeration eh=handlers.getHandlers();eh.hasMoreElements();) {
-            h = (SnmpRequestTree.Handler) eh.nextElement();
+        for (Enumeration<SnmpRequestTree.Handler> eh=handlers.getHandlers();eh.hasMoreElements();) {
+            h = eh.nextElement();
 
             // Gets the Meta node. It can be either a Group Meta or a
             // Table Meta.
@@ -270,11 +267,11 @@
             // Gets the depth of the Meta node in the OID tree
             final int depth = handlers.getOidDepth(h);
 
-            for (Enumeration rqs=handlers.getSubRequests(h);
+            for (Enumeration<SnmpMibSubRequest> rqs=handlers.getSubRequests(h);
                  rqs.hasMoreElements();) {
 
                 // Invoke the get() operation.
-                meta.get((SnmpMibSubRequest)rqs.nextElement(),depth);
+                meta.get(rqs.nextElement(),depth);
             }
         }
     }
@@ -286,6 +283,7 @@
     // Implements the method defined in SnmpMibAgent. See SnmpMibAgent
     // for java-doc
     //
+    @Override
     public void set(SnmpMibRequest req) throws SnmpStatusException {
 
         SnmpRequestTree handlers = null;
@@ -307,8 +305,8 @@
         handlers.switchCreationFlag(false);
         handlers.setPduType(reqType);
 
-        SnmpRequestTree.Handler h = null;
-        SnmpMibNode meta = null;
+        SnmpRequestTree.Handler h;
+        SnmpMibNode meta;
 
         if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
             SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMib.class.getName(),
@@ -317,8 +315,8 @@
 
         // For each sub-request stored in the request-tree, invoke the
         // get() method.
-        for (Enumeration eh=handlers.getHandlers();eh.hasMoreElements();) {
-            h = (SnmpRequestTree.Handler) eh.nextElement();
+        for (Enumeration<SnmpRequestTree.Handler> eh=handlers.getHandlers();eh.hasMoreElements();) {
+            h = eh.nextElement();
 
             // Gets the Meta node. It can be either a Group Meta or a
             // Table Meta.
@@ -328,11 +326,11 @@
             // Gets the depth of the Meta node in the OID tree
             final int depth = handlers.getOidDepth(h);
 
-            for (Enumeration rqs=handlers.getSubRequests(h);
+            for (Enumeration<SnmpMibSubRequest> rqs=handlers.getSubRequests(h);
                  rqs.hasMoreElements();) {
 
                 // Invoke the set() operation
-                meta.set((SnmpMibSubRequest)rqs.nextElement(),depth);
+                meta.set(rqs.nextElement(),depth);
             }
         }
     }
@@ -346,6 +344,7 @@
     // Implements the method defined in SnmpMibAgent. See SnmpMibAgent
     // for java-doc
     //
+    @Override
     public void check(SnmpMibRequest req) throws SnmpStatusException {
 
         final int reqType = SnmpDefinitions.pduWalkRequest;
@@ -353,8 +352,8 @@
         // is atomic.
         SnmpRequestTree handlers = getHandlers(req,true,true,reqType);
 
-        SnmpRequestTree.Handler h = null;
-        SnmpMibNode meta = null;
+        SnmpRequestTree.Handler h;
+        SnmpMibNode meta;
 
         if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
             SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMib.class.getName(),
@@ -363,8 +362,8 @@
 
         // For each sub-request stored in the request-tree, invoke the
         // check() method.
-        for (Enumeration eh=handlers.getHandlers();eh.hasMoreElements();) {
-            h = (SnmpRequestTree.Handler) eh.nextElement();
+        for (Enumeration<SnmpRequestTree.Handler> eh=handlers.getHandlers();eh.hasMoreElements();) {
+            h = eh.nextElement();
 
             // Gets the Meta node. It can be either a Group Meta or a
             // Table Meta.
@@ -374,11 +373,11 @@
             // Gets the depth of the Meta node in the OID tree
             final int depth = handlers.getOidDepth(h);
 
-            for (Enumeration rqs=handlers.getSubRequests(h);
+            for (Enumeration<SnmpMibSubRequest> rqs=handlers.getSubRequests(h);
                  rqs.hasMoreElements();) {
 
                 // Invoke the check() operation
-                meta.check((SnmpMibSubRequest)rqs.nextElement(),depth);
+                meta.check(rqs.nextElement(),depth);
             }
         }
 
@@ -398,13 +397,14 @@
     // Implements the method defined in SnmpMibAgent. See SnmpMibAgent
     // for java-doc
     //
+    @Override
     public void getNext(SnmpMibRequest req) throws SnmpStatusException {
         // Build the request tree for the operation
         // The subrequest stored in the request tree are valid GET requests
         SnmpRequestTree handlers = getGetNextHandlers(req);
 
-        SnmpRequestTree.Handler h = null;
-        SnmpMibNode meta = null;
+        SnmpRequestTree.Handler h;
+        SnmpMibNode meta;
 
         if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
             SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMib.class.getName(),
@@ -412,8 +412,8 @@
         }
 
         // Now invoke get() for each subrequest of the request tree.
-        for (Enumeration eh=handlers.getHandlers();eh.hasMoreElements();) {
-            h = (SnmpRequestTree.Handler) eh.nextElement();
+        for (Enumeration<SnmpRequestTree.Handler> eh=handlers.getHandlers();eh.hasMoreElements();) {
+            h = eh.nextElement();
 
             // Gets the Meta node. It can be either a Group Meta or a
             // Table Meta.
@@ -423,11 +423,11 @@
             // Gets the depth of the Meta node in the OID tree
             int depth = handlers.getOidDepth(h);
 
-            for (Enumeration rqs=handlers.getSubRequests(h);
+            for (Enumeration<SnmpMibSubRequest> rqs=handlers.getSubRequests(h);
                  rqs.hasMoreElements();) {
 
                 // Invoke the get() operation
-                meta.get((SnmpMibSubRequest)rqs.nextElement(),depth);
+                meta.get(rqs.nextElement(),depth);
             }
         }
     }
@@ -442,6 +442,7 @@
     // Implements the method defined in SnmpMibAgent. See SnmpMibAgent
     // for java-doc
     //
+    @Override
     public void getBulk(SnmpMibRequest req, int nonRepeat, int maxRepeat)
         throws SnmpStatusException {
 
@@ -456,10 +457,11 @@
      *
      * @return The root object identifier.
      */
+    @Override
     public long[] getRootOid() {
 
         if( rootOid == null) {
-            Vector<Integer> list= new Vector<Integer>(10);
+            Vector<Integer> list= new Vector<>(10);
 
             // Ask the tree to do the job !
             //
@@ -507,13 +509,13 @@
             new SnmpRequestTree(req,createflag,type);
 
         int index=0;
-        SnmpVarBind var = null;
+        SnmpVarBind var;
         final int ver= req.getVersion();
 
         // For each varbind in the list finds its handling node.
-        for (Enumeration e= req.getElements(); e.hasMoreElements(); index++) {
+        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements(); index++) {
 
-            var= (SnmpVarBind) e.nextElement();
+            var= e.nextElement();
 
             try {
                 // Find the handling node for this varbind.
@@ -657,10 +659,10 @@
         // request into a valid GET request, replacing the OIDs in the
         // original GET-NEXT request with the OID of the first leaf that
         // follows.
-        for (Enumeration e= req.getElements(); e.hasMoreElements(); index++) {
+        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements(); index++) {
 
-            var = (SnmpVarBind) e.nextElement();
-            SnmpOid result = null;
+            var = e.nextElement();
+            SnmpOid result;
             try {
                 // Find the node handling the OID that follows the varbind
                 // OID. `result' contains this next leaf OID.
--- a/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java	Tue Dec 18 16:14:59 2012 -0800
@@ -33,14 +33,12 @@
 import java.io.Serializable;
 import java.util.Vector;
 import java.util.Enumeration;
-import java.util.Set;
 
 // jmx imports
 //
 import javax.management.MBeanServer;
 import javax.management.MBeanRegistration;
 import javax.management.ObjectName;
-import javax.management.MalformedObjectNameException;
 import javax.management.InstanceNotFoundException;
 import javax.management.ServiceNotFoundException;
 import javax.management.ReflectionException;
@@ -94,6 +92,7 @@
      *
      * @exception java.lang.Exception
      */
+    @Override
     public abstract ObjectName preRegister(MBeanServer server,
                                            ObjectName name)
         throws java.lang.Exception;
@@ -101,18 +100,21 @@
     /**
      * Not used in this context.
      */
+    @Override
     public void postRegister (Boolean registrationDone) {
     }
 
     /**
      * Not used in this context.
      */
+    @Override
     public void preDeregister() throws java.lang.Exception {
     }
 
     /**
      * Not used in this context.
      */
+    @Override
     public void postDeregister() {
     }
 
@@ -127,6 +129,7 @@
      *
      * @exception SnmpStatusException An error occured during the operation.
      */
+    @Override
     public abstract void get(SnmpMibRequest req)
         throws SnmpStatusException;
 
@@ -141,6 +144,7 @@
      *
      * @exception SnmpStatusException An error occured during the operation.
      */
+    @Override
     public abstract void getNext(SnmpMibRequest req)
         throws SnmpStatusException;
 
@@ -164,6 +168,7 @@
      *
      * @exception SnmpStatusException An error occured during the operation.
      */
+    @Override
     public abstract void getBulk(SnmpMibRequest req, int nonRepeat,
                                  int maxRepeat)
         throws SnmpStatusException;
@@ -185,6 +190,7 @@
      *            the exception is thrown in the {@link #check(SnmpMibRequest)}
      *            method instead.
      */
+    @Override
     public abstract void set(SnmpMibRequest req)
         throws SnmpStatusException;
 
@@ -203,6 +209,7 @@
      * @exception SnmpStatusException The <CODE>set</CODE> operation
      *    cannot be performed.
      */
+    @Override
     public abstract void check(SnmpMibRequest req)
         throws SnmpStatusException;
 
@@ -226,6 +233,7 @@
      * @return The MBean server or null if the MIB is not registered in any
      *     MBean server.
      */
+    @Override
     public MBeanServer getMBeanServer() {
         return server;
     }
@@ -236,6 +244,7 @@
      *
      * @return The SNMP MIB handler.
      */
+    @Override
     public SnmpMibHandler getSnmpAdaptor() {
         return adaptor;
     }
@@ -246,6 +255,7 @@
      *
      * @param stack The SNMP MIB handler.
      */
+    @Override
     public void setSnmpAdaptor(SnmpMibHandler stack) {
         if (adaptor != null) {
             adaptor.removeMib(this);
@@ -266,6 +276,7 @@
      *
      * @since 1.5
      */
+    @Override
     public void setSnmpAdaptor(SnmpMibHandler stack, SnmpOid[] oids) {
         if (adaptor != null) {
             adaptor.removeMib(this);
@@ -288,6 +299,7 @@
      *
      * @since 1.5
      */
+    @Override
     public void setSnmpAdaptor(SnmpMibHandler stack, String contextName) {
         if (adaptor != null) {
             adaptor.removeMib(this, contextName);
@@ -309,6 +321,7 @@
      *
      * @since 1.5
      */
+    @Override
     public void setSnmpAdaptor(SnmpMibHandler stack,
                                String contextName,
                                SnmpOid[] oids) {
@@ -327,6 +340,7 @@
      *
      * @return The name of the SNMP protocol adaptor.
      */
+    @Override
     public ObjectName getSnmpAdaptorName() {
         return adaptorName;
     }
@@ -344,6 +358,7 @@
      * @exception ServiceNotFoundException This SNMP MIB is not registered
      *     in the MBean server or the requested service is not supported.
      */
+    @Override
     public void setSnmpAdaptorName(ObjectName name)
         throws InstanceNotFoundException, ServiceNotFoundException {
 
@@ -389,6 +404,7 @@
      *
      * @since 1.5
      */
+    @Override
     public void setSnmpAdaptorName(ObjectName name, SnmpOid[] oids)
         throws InstanceNotFoundException, ServiceNotFoundException {
 
@@ -434,6 +450,7 @@
      *
      * @since 1.5
      */
+    @Override
     public void setSnmpAdaptorName(ObjectName name, String contextName)
         throws InstanceNotFoundException, ServiceNotFoundException {
 
@@ -481,6 +498,7 @@
      *
      * @since 1.5
      */
+    @Override
     public void setSnmpAdaptorName(ObjectName name,
                                    String contextName, SnmpOid[] oids)
         throws InstanceNotFoundException, ServiceNotFoundException {
@@ -522,6 +540,7 @@
      * @return <CODE>true</CODE> if the MIB module is bound,
      *         <CODE>false</CODE> otherwise.
      */
+    @Override
     public boolean getBindingState() {
         if (adaptor == null)
             return false;
@@ -534,6 +553,7 @@
      *
      * @return The MIB name.
      */
+    @Override
     public String getMibName() {
         return mibName;
     }
@@ -681,7 +701,7 @@
     private Vector<SnmpVarBind> splitFrom(Vector<SnmpVarBind> original, int limit) {
 
         int max= original.size();
-        Vector<SnmpVarBind> result= new Vector<SnmpVarBind>(max - limit);
+        Vector<SnmpVarBind> result= new Vector<>(max - limit);
         int i= limit;
 
         // Ok the loop looks a bit strange. But in order to improve the
@@ -697,21 +717,12 @@
         return result;
     }
 
-    private void concatVector(SnmpMibRequest req, Vector source) {
-        for(Enumeration e= source.elements(); e.hasMoreElements(); ) {
-            SnmpVarBind var= (SnmpVarBind) e.nextElement();
-            // We need to duplicate the SnmpVarBind otherwise it is going
-            // to be overloaded by the next get Next ...
-            req.addVarBind(new SnmpVarBind(var.oid, var.value));
-        }
-    }
-
-    private void concatVector(Vector<SnmpVarBind> target, Vector<SnmpVarBind> source) {
+    private void concatVector(SnmpMibRequest req, Vector<SnmpVarBind> source) {
         for(Enumeration<SnmpVarBind> e= source.elements(); e.hasMoreElements(); ) {
             SnmpVarBind var= e.nextElement();
             // We need to duplicate the SnmpVarBind otherwise it is going
             // to be overloaded by the next get Next ...
-            target.addElement(new SnmpVarBind(var.oid, var.value));
+            req.addVarBind(new SnmpVarBind(var.oid, var.value));
         }
     }
 
--- a/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java	Tue Dec 18 16:14:59 2012 -0800
@@ -29,20 +29,13 @@
 //
 import java.io.Serializable;
 import java.util.Hashtable;
-import java.util.Enumeration;
 import java.util.Vector;
 
 // jmx imports
 //
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpValue;
 import com.sun.jmx.snmp.SnmpVarBind;
 import com.sun.jmx.snmp.SnmpStatusException;
 
-// SNMP Runtime imports
-//
-import com.sun.jmx.snmp.agent.SnmpMibOid;
-import com.sun.jmx.snmp.agent.SnmpMibNode;
 
 /**
  * Represents a node in an SNMP MIB which corresponds to a group.
@@ -174,6 +167,7 @@
      * @exception SnmpStatusException An error occurred while accessing
      *  the MIB node.
      */
+    @Override
     abstract public void get(SnmpMibSubRequest req, int depth)
         throws SnmpStatusException;
 
@@ -203,6 +197,7 @@
      * @exception SnmpStatusException An error occurred while accessing
      *  the MIB node.
      */
+    @Override
     abstract public void set(SnmpMibSubRequest req, int depth)
         throws SnmpStatusException;
 
@@ -234,6 +229,7 @@
      * @exception SnmpStatusException An error occurred while accessing
      *  the MIB node.
      */
+    @Override
     abstract public void check(SnmpMibSubRequest req, int depth)
         throws SnmpStatusException;
 
@@ -241,8 +237,8 @@
     // If we reach this node, we are below the root OID, so we just
     // return.
     // --------------------------------------------------------------------
-    public void getRootOid(Vector result) {
-        return;
+    @Override
+    public void getRootOid(Vector<Integer> result) {
     }
 
     // -------------------------------------------------------------------
@@ -264,7 +260,7 @@
      */
     void registerNestedArc(long arc) {
         Long obj = new Long(arc);
-        if (subgroups == null) subgroups = new Hashtable<Long, Long>();
+        if (subgroups == null) subgroups = new Hashtable<>();
         // registers the arc in the hashtable.
         subgroups.put(obj,obj);
     }
@@ -312,6 +308,7 @@
      * @param node The node being registered.
      *
      */
+    @Override
     void registerNode(long[] oid, int cursor ,SnmpMibNode node)
         throws IllegalAccessException {
         super.registerNode(oid,cursor,node);
@@ -325,13 +322,13 @@
     // -------------------------------------------------------------------
     // see comments in SnmpMibNode
     // -------------------------------------------------------------------
+    @Override
     void findHandlingNode(SnmpVarBind varbind,
                           long[] oid, int depth,
                           SnmpRequestTree handlers)
         throws SnmpStatusException {
 
         int length = oid.length;
-        SnmpMibNode node = null;
 
         if (handlers == null)
             throw new SnmpStatusException(SnmpStatusException.snmpRspGenErr);
@@ -349,7 +346,6 @@
             // This arc leads to a subgroup: delegates the search to the
             // method defined in SnmpMibOid
             super.findHandlingNode(varbind,oid,depth,handlers);
-            return;
         } else if (isTable(arc)) {
             // This arc leads to a table: forward the search to the table.
 
@@ -384,6 +380,7 @@
     // -------------------------------------------------------------------
     // See comments in SnmpMibNode.
     // -------------------------------------------------------------------
+    @Override
     long[] findNextHandlingNode(SnmpVarBind varbind,
                                 long[] oid, int pos, int depth,
                                 SnmpRequestTree handlers, AcmChecker checker)
--- a/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibOid.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibOid.java	Tue Dec 18 16:14:59 2012 -0800
@@ -37,7 +37,6 @@
 // jmx imports
 //
 import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpValue;
 import com.sun.jmx.snmp.SnmpVarBind;
 import com.sun.jmx.snmp.SnmpStatusException;
 
@@ -79,10 +78,11 @@
      * @exception SnmpStatusException The default implementation (if not
      *            overridden) is to generate a SnmpStatusException.
      */
+    @Override
     public void get(SnmpMibSubRequest req, int depth)
         throws SnmpStatusException {
-        for (Enumeration e= req.getElements(); e.hasMoreElements();) {
-            SnmpVarBind var= (SnmpVarBind) e.nextElement();
+        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements();) {
+            SnmpVarBind var= e.nextElement();
             SnmpStatusException x =
                 new SnmpStatusException(SnmpStatusException.noSuchObject);
             req.registerGetException(var,x);
@@ -102,10 +102,11 @@
      * @exception SnmpStatusException The default implementation (if not
      *            overridden) is to generate a SnmpStatusException.
      */
+    @Override
     public void set(SnmpMibSubRequest req, int depth)
         throws SnmpStatusException {
-        for (Enumeration e= req.getElements(); e.hasMoreElements();) {
-            SnmpVarBind var= (SnmpVarBind) e.nextElement();
+        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements();) {
+            SnmpVarBind var= e.nextElement();
             SnmpStatusException x =
                 new SnmpStatusException(SnmpStatusException.noAccess);
             req.registerSetException(var,x);
@@ -123,12 +124,13 @@
      * @param depth The depth reached in the OID tree.
      *
      * @exception SnmpStatusException The default implementation (if not
-     *            overriden) is to generate a SnmpStatusException.
+     *            overridden) is to generate a SnmpStatusException.
      */
+    @Override
     public void check(SnmpMibSubRequest req, int depth)
         throws SnmpStatusException {
-        for (Enumeration e= req.getElements(); e.hasMoreElements();) {
-            SnmpVarBind var= (SnmpVarBind) e.nextElement();
+        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements();) {
+            SnmpVarBind var= e.nextElement();
             SnmpStatusException x =
                 new SnmpStatusException(SnmpStatusException.noAccess);
             req.registerCheckException(var,x);
@@ -143,6 +145,7 @@
     //
     // ---------------------------------------------------------------------
     //
+    @Override
     void findHandlingNode(SnmpVarBind varbind,
                           long[] oid, int depth,
                           SnmpRequestTree handlers)
@@ -191,6 +194,7 @@
     //
     // ---------------------------------------------------------------------
     //
+    @Override
     long[] findNextHandlingNode(SnmpVarBind varbind,
                                 long[] oid, int pos, int depth,
                                 SnmpRequestTree handlers,
@@ -267,6 +271,7 @@
     /**
      * Computes the root OID of the MIB.
      */
+    @Override
     public void getRootOid(Vector<Integer> result) {
 
         // If a node has several children, let assume that we are one step to
@@ -359,7 +364,6 @@
             //     String.valueOf(var) + " position= " + cursor);
             children.insertElementAt(child, newPos);
             child.registerNode(oid, cursor + 1, node);
-            return;
         }
         else {
             // The node is already registered
@@ -404,7 +408,6 @@
                     }
                 }
                 children.setElementAt(node,pos);
-                return;
             } else {
                 if (child == null)
                     throw new IllegalAccessException();
@@ -469,7 +472,7 @@
 
         int max= varList.length -1 ;
         int curr= low + (max-low)/2;
-        int elmt= 0;
+        int elmt;
         while (low <= max) {
             elmt= varList[curr];
             if (cursor == elmt) {
@@ -494,7 +497,7 @@
         if (varList == null)
             return -1;
         int max= varList.length -1 ;
-        int elmt=0;
+        int elmt;
         //final int[] v = varList;
 
         //if (index > a[max])
@@ -528,7 +531,7 @@
     /**
      * Contains the list of sub nodes.
      */
-    private NonSyncVector<SnmpMibNode> children = new NonSyncVector<SnmpMibNode>(1);
+    private NonSyncVector<SnmpMibNode> children = new NonSyncVector<>(1);
 
     /**
      * The number of sub nodes.
--- a/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibRequest.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibRequest.java	Tue Dec 18 16:14:59 2012 -0800
@@ -50,7 +50,7 @@
      * @return The element of the enumeration are instances of
      *         {@link com.sun.jmx.snmp.SnmpVarBind}
      */
-    public Enumeration getElements();
+    public Enumeration<SnmpVarBind> getElements();
 
     /**
      * Returns the vector of varbind to be handled by the SNMP mib node.
--- a/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibRequestImpl.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibRequestImpl.java	Tue Dec 18 16:14:59 2012 -0800
@@ -87,6 +87,7 @@
      * Returns the local engine. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise null is returned.
      * @return the local engine.
      */
+    @Override
     public SnmpEngine getEngine() {
         return engine;
     }
@@ -95,6 +96,7 @@
      * Gets the incoming request principal. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise null is returned.
      * @return The request principal.
      **/
+    @Override
     public String getPrincipal() {
         return principal;
     }
@@ -103,6 +105,7 @@
      * Gets the incoming request security level. This level is defined in {@link com.sun.jmx.snmp.SnmpEngine SnmpEngine}. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise -1 is returned.
      * @return The security level.
      */
+    @Override
     public int getSecurityLevel() {
         return securityLevel;
     }
@@ -110,6 +113,7 @@
      * Gets the incoming request security model. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise -1 is returned.
      * @return The security model.
      */
+    @Override
     public int getSecurityModel() {
         return securityModel;
     }
@@ -117,6 +121,7 @@
      * Gets the incoming request context name. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise null is returned.
      * @return The context name.
      */
+    @Override
     public byte[] getContextName() {
         return contextName;
     }
@@ -125,6 +130,7 @@
      * Gets the incoming request context name used by Access Control Model in order to allow or deny the access to OIDs. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise null is returned.
      * @return The checked context.
      */
+    @Override
     public byte[] getAccessContextName() {
         return accessContextName;
     }
@@ -133,6 +139,7 @@
     // Implements the method defined in SnmpMibRequest interface.
     // See SnmpMibRequest for the java doc.
     // -------------------------------------------------------------------
+    @Override
     public final SnmpPdu getPdu() {
         return reqPdu;
     }
@@ -141,18 +148,21 @@
     // Implements the method defined in SnmpMibRequest interface.
     // See SnmpMibRequest for the java doc.
     // -------------------------------------------------------------------
-    public final Enumeration getElements()  {return varbinds.elements();}
+    @Override
+    public final Enumeration<SnmpVarBind> getElements()  {return varbinds.elements();}
 
     // -------------------------------------------------------------------
     // Implements the method defined in SnmpMibRequest interface.
     // See SnmpMibRequest for the java doc.
     // -------------------------------------------------------------------
+    @Override
     public final Vector<SnmpVarBind> getSubList()  {return varbinds;}
 
     // -------------------------------------------------------------------
     // Implements the method defined in SnmpMibRequest interface.
     // See SnmpMibRequest for the java doc.
     // -------------------------------------------------------------------
+    @Override
     public final int getSize()  {
         if (varbinds == null) return 0;
         return varbinds.size();
@@ -162,24 +172,28 @@
     // Implements the method defined in SnmpMibRequest interface.
     // See SnmpMibRequest for the java doc.
     // -------------------------------------------------------------------
+    @Override
     public final int         getVersion()  {return version;}
 
     // -------------------------------------------------------------------
     // Implements the method defined in SnmpMibRequest interface.
     // See SnmpMibRequest for the java doc.
     // -------------------------------------------------------------------
+    @Override
     public final int         getRequestPduVersion()  {return reqPdu.version;}
 
     // -------------------------------------------------------------------
     // Implements the method defined in SnmpMibRequest interface.
     // See SnmpMibRequest for the java doc.
     // -------------------------------------------------------------------
+    @Override
     public final Object      getUserData() {return data;}
 
     // -------------------------------------------------------------------
     // Implements the method defined in SnmpMibRequest interface.
     // See SnmpMibRequest for the java doc.
     // -------------------------------------------------------------------
+    @Override
     public final int getVarIndex(SnmpVarBind varbind) {
         return varbinds.indexOf(varbind);
     }
@@ -188,6 +202,7 @@
     // Implements the method defined in SnmpMibRequest interface.
     // See SnmpMibRequest for the java doc.
     // -------------------------------------------------------------------
+    @Override
     public void addVarBind(SnmpVarBind varbind) {
         varbinds.addElement(varbind);
     }
@@ -218,7 +233,7 @@
     // Returns the underlying vector of SNMP varbinds (used for algorithm
     // optimization).
     // -------------------------------------------------------------------
-    final Vector getVarbinds() {return varbinds;}
+    final Vector<SnmpVarBind> getVarbinds() {return varbinds;}
 
     // -------------------------------------------------------------------
     // Private variables
--- a/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibSubRequest.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibSubRequest.java	Tue Dec 18 16:14:59 2012 -0800
@@ -65,7 +65,8 @@
      * @return The elements of the enumeration are instances of
      *         {@link com.sun.jmx.snmp.SnmpVarBind}
      */
-    public Enumeration getElements();
+    @Override
+    public Enumeration<SnmpVarBind> getElements();
 
     /**
      * Return the list of varbind to be handled by the SNMP MIB node.
@@ -85,6 +86,7 @@
      * @return The elements of the vector are instances of
      *         {@link com.sun.jmx.snmp.SnmpVarBind}
      */
+    @Override
     public Vector<SnmpVarBind> getSubList();
 
     /**
--- a/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java	Tue Dec 18 16:14:59 2012 -0800
@@ -266,6 +266,7 @@
      * <p>
      *
      */
+    @Override
     public void get(SnmpMibSubRequest req, int depth)
         throws SnmpStatusException {
 
@@ -276,9 +277,9 @@
         // each varbind involved (nb: should not happen, the error
         // should have been registered earlier)
         if (isnew) {
-            SnmpVarBind     var = null;
-            for (Enumeration e= r.getElements(); e.hasMoreElements();) {
-                var      = (SnmpVarBind) e.nextElement();
+            SnmpVarBind var;
+            for (Enumeration<SnmpVarBind> e= r.getElements(); e.hasMoreElements();) {
+                var = e.nextElement();
                 r.registerGetException(var,noSuchInstanceException);
             }
         }
@@ -329,6 +330,7 @@
      * <p>
      *
      */
+    @Override
     public void check(SnmpMibSubRequest req, int depth)
         throws SnmpStatusException {
         final SnmpOid     oid    = req.getEntryOid();
@@ -389,6 +391,7 @@
      * <p>
      *
      */
+    @Override
     public void set(SnmpMibSubRequest req, int depth)
         throws SnmpStatusException {
 
@@ -755,6 +758,7 @@
      *
      * @exception IllegalArgumentException Listener parameter is null.
      */
+    @Override
     public synchronized void
         addNotificationListener(NotificationListener listener,
                                 NotificationFilter filter, Object handback)  {
@@ -768,13 +772,11 @@
 
         // looking for listener in handbackTable
         //
-        Vector<Object> handbackList =
-            handbackTable.get(listener) ;
-        Vector<NotificationFilter> filterList =
-            filterTable.get(listener) ;
+        Vector<Object> handbackList = handbackTable.get(listener) ;
+        Vector<NotificationFilter> filterList = filterTable.get(listener) ;
         if ( handbackList == null ) {
-            handbackList = new Vector<Object>() ;
-            filterList = new Vector<NotificationFilter>() ;
+            handbackList = new Vector<>() ;
+            filterList = new Vector<>() ;
             handbackTable.put(listener, handbackList) ;
             filterTable.put(listener, filterList) ;
         }
@@ -797,16 +799,14 @@
      * @exception ListenerNotFoundException The listener is not registered
      *    in the MBean.
      */
+    @Override
     public synchronized void
         removeNotificationListener(NotificationListener listener)
         throws ListenerNotFoundException {
 
         // looking for listener in handbackTable
         //
-        java.util.Vector handbackList =
-            (java.util.Vector) handbackTable.get(listener) ;
-        java.util.Vector filterList =
-            (java.util.Vector) filterTable.get(listener) ;
+        java.util.Vector<?> handbackList = handbackTable.get(listener) ;
         if ( handbackList == null ) {
             throw new ListenerNotFoundException("listener");
         }
@@ -822,6 +822,7 @@
      * notification class and the notification type sent by the
      * <CODE>SnmpMibTable</CODE>.
      */
+    @Override
     public MBeanNotificationInfo[] getNotificationInfo() {
 
         String[] types = {SnmpTableEntryNotification.SNMP_ENTRY_ADDED,
@@ -1813,9 +1814,9 @@
     //
     // ---------------------------------------------------------------------
 
-    final static void checkRowStatusFail(SnmpMibSubRequest req,
-                                         int errorStatus)
+    static void checkRowStatusFail(SnmpMibSubRequest req, int errorStatus)
         throws SnmpStatusException {
+
         final SnmpVarBind statusvb  = req.getRowStatusVarBind();
         final SnmpStatusException x = new SnmpStatusException(errorStatus);
         req.registerCheckException(statusvb,x);
@@ -1827,9 +1828,9 @@
     //
     // ---------------------------------------------------------------------
 
-    final static void setRowStatusFail(SnmpMibSubRequest req,
-                                       int errorStatus)
+    static void setRowStatusFail(SnmpMibSubRequest req, int errorStatus)
         throws SnmpStatusException {
+
         final SnmpVarBind statusvb  = req.getRowStatusVarBind();
         final SnmpStatusException x = new SnmpStatusException(errorStatus);
         req.registerSetException(statusvb,x);
@@ -1840,6 +1841,7 @@
     // Implements the method defined in SnmpMibNode.
     //
     // ---------------------------------------------------------------------
+    @Override
     final synchronized void findHandlingNode(SnmpVarBind varbind,
                                              long[] oid, int depth,
                                              SnmpRequestTree handlers)
@@ -1909,11 +1911,15 @@
     // largely inspired from the original getNext() method.
     //
     // ---------------------------------------------------------------------
+    @Override
     final synchronized long[] findNextHandlingNode(SnmpVarBind varbind,
-                                      long[] oid, int pos, int depth,
-                                      SnmpRequestTree handlers,
-                                      AcmChecker checker)
+                                                   long[] oid,
+                                                   int pos,
+                                                   int depth,
+                                                   SnmpRequestTree handlers,
+                                                   AcmChecker checker)
         throws SnmpStatusException {
+
             int length = oid.length;
 
             if (handlers == null)
@@ -1974,7 +1980,7 @@
             }
 
             // Now that we've got everything right we can begin.
-            SnmpOid entryoid = null ;
+            SnmpOid entryoid;
 
             if (pos == (length - 1)) {
                 // pos points to the last arc in the oid, and this arc is
@@ -2200,28 +2206,25 @@
 
         // loop on listener
         //
-        for(java.util.Enumeration k = handbackTable.keys();
+        for(java.util.Enumeration<NotificationListener> k = handbackTable.keys();
             k.hasMoreElements(); ) {
 
-            NotificationListener listener =
-                (NotificationListener) k.nextElement();
+            NotificationListener listener = k.nextElement();
 
             // Get the associated handback list and the associated filter list
             //
-            java.util.Vector handbackList =
-                (java.util.Vector) handbackTable.get(listener) ;
-            java.util.Vector filterList =
-                (java.util.Vector) filterTable.get(listener) ;
+            java.util.Vector<?> handbackList = handbackTable.get(listener) ;
+            java.util.Vector<NotificationFilter> filterList =
+                filterTable.get(listener) ;
 
             // loop on handback
             //
-            java.util.Enumeration f = filterList.elements();
-            for(java.util.Enumeration h = handbackList.elements();
+            java.util.Enumeration<NotificationFilter> f = filterList.elements();
+            for(java.util.Enumeration<?> h = handbackList.elements();
                 h.hasMoreElements(); ) {
 
                 Object handback = h.nextElement();
-                NotificationFilter filter =
-                    (NotificationFilter)f.nextElement();
+                NotificationFilter filter = f.nextElement();
 
                 if ((filter == null) ||
                      (filter.isNotificationEnabled(notification))) {
@@ -2300,7 +2303,7 @@
      *         OID was not found.
      *
      **/
-    private final int findObject(SnmpOid oid) {
+    private int findObject(SnmpOid oid) {
         int low= 0;
         int max= size - 1;
         SnmpOid pos;
@@ -2339,25 +2342,6 @@
      * <p>
      * @param oid The OID we would like to insert.
      *
-     * @return The position at which the OID should be inserted in
-     *         the table.
-     *
-     * @exception SnmpStatusException if the OID is already present in the
-     *            table.
-     *
-     **/
-    private final int getInsertionPoint(SnmpOid oid)
-        throws SnmpStatusException {
-        return getInsertionPoint(oid, true);
-    }
-
-    /**
-     * Search the position at which the given oid should be inserted
-     * in the OID table (tableoids).
-     *
-     * <p>
-     * @param oid The OID we would like to insert.
-     *
      * @param fail Tells whether a SnmpStatusException must be generated
      *             if the given OID is already present in the table.
      *
@@ -2371,7 +2355,7 @@
      *            table and <code>fail</code> is <code>true</code>.
      *
      **/
-    private final int getInsertionPoint(SnmpOid oid, boolean fail)
+    private int getInsertionPoint(SnmpOid oid, boolean fail)
         throws SnmpStatusException {
 
         final int failStatus = SnmpStatusException.snmpRspNotWritable;
@@ -2413,7 +2397,7 @@
      * @param pos The position at which the OID to be removed is located.
      *
      **/
-    private final void removeOid(int pos) {
+    private void removeOid(int pos) {
         if (pos >= tablecount) return;
         if (pos < 0) return;
         final int l1 = --tablecount-pos;
@@ -2431,7 +2415,7 @@
      * @param pos The position at which the OID to be added is located.
      *
      **/
-    private final void insertOid(int pos, SnmpOid oid) {
+    private void insertOid(int pos, SnmpOid oid) {
         if (pos >= tablesize || tablecount == tablesize) {
                 // Vector must be enlarged
 
@@ -2534,13 +2518,13 @@
      * The list of entries.
      * @serial
      */
-    private final Vector<Object> entries= new Vector<Object>();
+    private final Vector<Object> entries= new Vector<>();
 
     /**
      * The list of object names.
      * @serial
      */
-    private final Vector<ObjectName> entrynames= new Vector<ObjectName>();
+    private final Vector<ObjectName> entrynames= new Vector<>();
 
     /**
      * Callback handlers
@@ -2548,17 +2532,16 @@
     // final Vector callbacks = new Vector();
 
     /**
-     * Listener hastable containing the hand-back objects.
+     * Listener hashtable containing the hand-back objects.
      */
     private Hashtable<NotificationListener, Vector<Object>> handbackTable =
-            new Hashtable<NotificationListener, Vector<Object>>();
+            new Hashtable<>();
 
     /**
-     * Listener hastable containing the filter objects.
+     * Listener hashtable containing the filter objects.
      */
     private Hashtable<NotificationListener, Vector<NotificationFilter>>
-            filterTable =
-            new Hashtable<NotificationListener, Vector<NotificationFilter>>();
+            filterTable = new Hashtable<>();
 
     // PACKAGE VARIABLES
     //------------------
--- a/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java	Tue Dec 18 16:14:59 2012 -0800
@@ -25,11 +25,9 @@
 package com.sun.jmx.snmp.agent;
 
 import java.util.Vector;
-import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.Enumeration;
 import java.util.Iterator;
-import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.Arrays;
 import java.util.logging.Level;
@@ -77,7 +75,7 @@
         this.request = req;
         this.version  = req.getVersion();
         this.creationflag = creationflag;
-        this.hashtable = new Hashtable<Object, Handler>();
+        this.hashtable = new Hashtable<>();
         setPduType(pdutype);
     }
 
@@ -191,7 +189,7 @@
     // SnmSubRequest associated with an Handler node.
     //-------------------------------------------------------------------
 
-    static final class Enum implements Enumeration {
+    static final class Enum implements Enumeration<SnmpMibSubRequest> {
         Enum(SnmpRequestTree hlist,Handler h) {
             handler = h;
             this.hlist = hlist;
@@ -203,11 +201,13 @@
         private int   iter  = 0;
         private int   size  = 0;
 
+        @Override
         public boolean hasMoreElements() {
             return iter < size;
         }
 
-        public Object nextElement() throws NoSuchElementException  {
+        @Override
+        public SnmpMibSubRequest nextElement() throws NoSuchElementException  {
             if (iter == 0) {
                 if (handler.sublist != null) {
                     iter++;
@@ -216,7 +216,7 @@
             }
             iter ++;
             if (iter > size) throw new NoSuchElementException();
-            Object result = hlist.getSubRequest(handler,entry);
+            SnmpMibSubRequest result = hlist.getSubRequest(handler,entry);
             entry++;
             return result;
         }
@@ -252,7 +252,8 @@
         // Implements the method defined in SnmpMibRequest interface.
         // See SnmpMibRequest for the java doc.
         // -------------------------------------------------------------
-        public Enumeration getElements() {
+        @Override
+        public Enumeration<SnmpVarBind> getElements() {
             return varbinds.elements();
         }
 
@@ -260,6 +261,7 @@
         // Implements the method defined in SnmpMibRequest interface.
         // See SnmpMibRequest for the java doc.
         // -------------------------------------------------------------
+        @Override
         public Vector<SnmpVarBind> getSubList() {
             return varbinds;
         }
@@ -268,6 +270,7 @@
         // Implements the method defined in SnmpMibRequest interface.
         // See SnmpMibRequest for the java doc.
         // -------------------------------------------------------------
+        @Override
         public final int getSize()  {
             if (varbinds == null) return 0;
             return varbinds.size();
@@ -277,6 +280,7 @@
         // Implements the method defined in SnmpMibRequest interface.
         // See SnmpMibRequest for the java doc.
         // -------------------------------------------------------------
+        @Override
         public void addVarBind(SnmpVarBind varbind) {
             // XXX not sure we must also add the varbind in the global
             //     request? or whether we should raise an exception:
@@ -289,6 +293,7 @@
         // Implements the method defined in SnmpMibSubRequest interface.
         // See SnmpMibSubRequest for the java doc.
         // -------------------------------------------------------------
+        @Override
         public boolean isNewEntry() {
             return isnew;
         }
@@ -297,6 +302,7 @@
         // Implements the method defined in SnmpMibSubRequest interface.
         // See SnmpMibSubRequest for the java doc.
         // -------------------------------------------------------------
+        @Override
         public SnmpOid getEntryOid() {
             return entryoid;
         }
@@ -305,6 +311,7 @@
         // Implements the method defined in SnmpMibRequest interface.
         // See SnmpMibRequest for the java doc.
         // -------------------------------------------------------------
+        @Override
         public int getVarIndex(SnmpVarBind varbind) {
             if (varbind == null) return 0;
             return global.getVarIndex(varbind);
@@ -314,6 +321,7 @@
         // Implements the method defined in SnmpMibRequest interface.
         // See SnmpMibRequest for the java doc.
         // -------------------------------------------------------------
+        @Override
         public Object getUserData() { return global.getUserData(); }
 
 
@@ -322,6 +330,7 @@
         // See SnmpMibSubRequest for the java doc.
         // -------------------------------------------------------------
 
+        @Override
         public void registerGetException(SnmpVarBind var,
                                          SnmpStatusException exception)
             throws SnmpStatusException {
@@ -364,6 +373,7 @@
         // Implements the method defined in SnmpMibSubRequest interface.
         // See SnmpMibSubRequest for the java doc.
         // -------------------------------------------------------------
+        @Override
         public void registerSetException(SnmpVarBind var,
                                          SnmpStatusException exception)
             throws SnmpStatusException {
@@ -387,6 +397,7 @@
         // Implements the method defined in SnmpMibSubRequest interface.
         // See SnmpMibSubRequest for the java doc.
         // -------------------------------------------------------------
+        @Override
         public void registerCheckException(SnmpVarBind var,
                                            SnmpStatusException exception)
             throws SnmpStatusException {
@@ -410,42 +421,52 @@
         // Implements the method defined in SnmpMibRequest interface.
         // See SnmpMibRequest for the java doc.
         // -------------------------------------------------------------
+        @Override
         public int getVersion() {
             return version;
         }
 
+        @Override
         public SnmpVarBind getRowStatusVarBind() {
             return statusvb;
         }
 
+        @Override
         public SnmpPdu getPdu() {
             return global.getPdu();
         }
 
+        @Override
         public int getRequestPduVersion() {
             return global.getRequestPduVersion();
         }
 
+        @Override
         public SnmpEngine getEngine() {
             return global.getEngine();
         }
 
+        @Override
         public String getPrincipal() {
             return global.getPrincipal();
         }
 
+        @Override
         public int getSecurityLevel() {
             return global.getSecurityLevel();
         }
 
+        @Override
         public int getSecurityModel() {
             return global.getSecurityModel();
         }
 
+        @Override
         public byte[] getContextName() {
             return global.getContextName();
         }
 
+        @Override
         public byte[] getAccessContextName() {
             return global.getAccessContextName();
         }
@@ -485,7 +506,7 @@
          * Adds a varbind in this node sublist.
          */
         public void addVarbind(SnmpVarBind varbind) {
-            if (sublist == null) sublist = new Vector<SnmpVarBind>();
+            if (sublist == null) sublist = new Vector<>();
             sublist.addElement(varbind);
         }
 
@@ -503,7 +524,7 @@
                 // Vectors are null: Allocate new vectors
 
                 entryoids  = new SnmpOid[Delta];
-                entrylists = new Vector[Delta];
+                entrylists = (Vector<SnmpVarBind>[])new Vector<?>[Delta];
                 isentrynew = new boolean[Delta];
                 rowstatus  = new SnmpVarBind[Delta];
                 entrysize  = Delta;
@@ -521,7 +542,7 @@
                 // Allocate larger vectors
                 entrysize += Delta;
                 entryoids =  new SnmpOid[entrysize];
-                entrylists = new Vector[entrysize];
+                entrylists = (Vector<SnmpVarBind>[])new Vector<?>[entrysize];
                 isentrynew = new boolean[entrysize];
                 rowstatus  = new SnmpVarBind[entrysize];
 
@@ -595,7 +616,7 @@
 //              entryoids = new ArrayList();
 //              entrylists = new ArrayList();
 //              isentrynew = new ArrayList();
-                v = new Vector<SnmpVarBind>();
+                v = new Vector<>();
 //              entryoids.add(entryoid);
 //              entrylists.add(v);
 //              isentrynew.add(new Boolean(isnew));
@@ -614,7 +635,7 @@
                     // if (pos == -1 || pos >= entrycount ) {
                     // pos = getInsertionPoint(entryoids,entryoid);
                     // pos = getInsertionPoint(entryoids,entrycount,entryoid);
-                    v = new Vector<SnmpVarBind>();
+                    v = new Vector<>();
 //                  entryoids.add(pos,entryoid);
 //                  entrylists.add(pos,v);
 //                  isentrynew.add(pos,new Boolean(isnew));
@@ -775,7 +796,7 @@
     // If it is a table, there will be one subrequest per entry involved.
     //-------------------------------------------------------------------
 
-    public Enumeration getSubRequests(Handler handler) {
+    public Enumeration<SnmpMibSubRequest> getSubRequests(Handler handler) {
         return new Enum(this,handler);
     }
 
@@ -783,7 +804,7 @@
     // returns an enumeration of the Handlers stored in the Hashtable.
     //-------------------------------------------------------------------
 
-    public Enumeration getHandlers() {
+    public Enumeration<Handler> getHandlers() {
         return hashtable.elements();
     }
 
@@ -1048,7 +1069,6 @@
             handler.addVarbind(varbind);
         else
             handler.addVarbind(varbind,entryoid,isnew,statusvb);
-        return ;
     }
 
 
--- a/src/share/classes/com/sun/jmx/snmp/agent/SnmpStandardObjectServer.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/agent/SnmpStandardObjectServer.java	Tue Dec 18 16:14:59 2012 -0800
@@ -27,14 +27,7 @@
 // java imports
 //
 import java.io.Serializable;
-import java.util.Hashtable;
 import java.util.Enumeration;
-import java.util.Vector;
-
-// jmx imports
-//
-import com.sun.jmx.snmp.SnmpOid;
-import com.sun.jmx.snmp.SnmpValue;
 import com.sun.jmx.snmp.SnmpVarBind;
 import com.sun.jmx.snmp.SnmpStatusException;
 
@@ -121,8 +114,8 @@
 
         final Object data = req.getUserData();
 
-        for (Enumeration e= req.getElements(); e.hasMoreElements();) {
-            final SnmpVarBind var= (SnmpVarBind) e.nextElement();
+        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements();) {
+            final SnmpVarBind var= e.nextElement();
             try {
                 final long id = var.oid.getOidArc(depth);
                 var.value = meta.get(id, data);
@@ -182,9 +175,8 @@
 
         final Object data = req.getUserData();
 
-        for (Enumeration e= req.getElements(); e.hasMoreElements();) {
-            SnmpVarBind var = null;
-            var = (SnmpVarBind) e.nextElement();
+        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements();) {
+            SnmpVarBind var = e.nextElement();
             try {
                 // This method will generate a SnmpStatusException
                 // if `depth' is out of bounds.
@@ -248,8 +240,8 @@
 
         final Object data = req.getUserData();
 
-        for (Enumeration e= req.getElements(); e.hasMoreElements();) {
-            final SnmpVarBind var = (SnmpVarBind) e.nextElement();
+        for (Enumeration<SnmpVarBind> e= req.getElements(); e.hasMoreElements();) {
+            final SnmpVarBind var = e.nextElement();
             try {
                 // This method will generate a SnmpStatusException
                 // if `depth' is out of bounds.
--- a/src/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServer.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServer.java	Tue Dec 18 16:14:59 2012 -0800
@@ -33,7 +33,6 @@
 import java.io.ObjectInputStream;
 import java.io.IOException;
 import java.net.InetAddress;
-import java.util.Enumeration;
 import java.util.logging.Level;
 import java.util.Vector;
 import java.util.NoSuchElementException;
@@ -50,8 +49,6 @@
 import javax.management.MBeanNotificationInfo;
 import javax.management.AttributeChangeNotification;
 import javax.management.ListenerNotFoundException;
-import javax.management.loading.ClassLoaderRepository;
-import javax.management.MBeanServerFactory;
 
 import static com.sun.jmx.defaults.JmxProperties.SNMP_ADAPTOR_LOGGER;
 
@@ -225,9 +222,8 @@
     private transient Object stateLock = new Object();
 
     private transient Vector<ClientHandler>
-            clientHandlerVector = new Vector<ClientHandler>() ;
+            clientHandlerVector = new Vector<>() ;
 
-    private transient Thread fatherThread = Thread.currentThread() ;
     private transient Thread mainThread = null ;
 
     private volatile boolean stopRequested = false ;
@@ -328,6 +324,7 @@
      * Has no effect if this <CODE>CommunicatorServer</CODE> is
      * <CODE>ONLINE</CODE> or <CODE>STOPPING</CODE>.
      */
+    @Override
     public void start() {
         try {
             start(0);
@@ -346,6 +343,7 @@
      * Has no effect if this <CODE>CommunicatorServer</CODE> is
      * <CODE>OFFLINE</CODE> or  <CODE>STOPPING</CODE>.
      */
+    @Override
     public void stop() {
         synchronized (stateLock) {
             if (state == OFFLINE || state == STOPPING) {
@@ -393,6 +391,7 @@
      *
      * @return True if connector is <CODE>ONLINE</CODE>; false otherwise.
      */
+    @Override
     public boolean isActive() {
         synchronized (stateLock) {
             return (state == ONLINE);
@@ -431,6 +430,7 @@
      * @return true if the value of this MBean's State attribute is the
      *      same as the <VAR>wantedState</VAR> parameter; false otherwise.
      */
+    @Override
     public boolean waitState(int wantedState, long timeOut) {
         if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
             SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
@@ -595,6 +595,7 @@
      * @return <CODE>ONLINE</CODE>, <CODE>OFFLINE</CODE>,
      *         <CODE>STARTING</CODE> or <CODE>STOPPING</CODE>.
      */
+    @Override
     public int getState() {
         synchronized (stateLock) {
             return state ;
@@ -607,6 +608,7 @@
      * @return One of the strings "ONLINE", "OFFLINE", "STARTING" or
      *         "STOPPING".
      */
+    @Override
     public String getStateString() {
         return getStringForState(state) ;
     }
@@ -616,6 +618,7 @@
      *
      * @return The host name used by this <CODE>CommunicatorServer</CODE>.
      */
+    @Override
     public String getHost() {
         try {
             host = InetAddress.getLocalHost().getHostName();
@@ -630,6 +633,7 @@
      *
      * @return The port number used by this <CODE>CommunicatorServer</CODE>.
      */
+    @Override
     public int getPort() {
         synchronized (stateLock) {
             return port ;
@@ -645,6 +649,7 @@
      * @exception java.lang.IllegalStateException This method has been invoked
      * while the communicator was ONLINE or STARTING.
      */
+    @Override
     public void setPort(int port) throws java.lang.IllegalStateException {
         synchronized (stateLock) {
             if ((state == ONLINE) || (state == STARTING))
@@ -659,7 +664,8 @@
      * Gets the protocol being used by this <CODE>CommunicatorServer</CODE>.
      * @return The protocol as a string.
      */
-    public abstract String getProtocol() ;
+    @Override
+    public abstract String getProtocol();
 
     /**
      * Gets the number of clients that have been processed by this
@@ -754,6 +760,7 @@
      * <p>
      * The <CODE>run</CODE> method executed by this connector's main thread.
      */
+    @Override
     public void run() {
 
         // Fix jaw.00667.B
@@ -851,7 +858,7 @@
         } finally {
             synchronized (stateLock) {
                 interrupted = true;
-                Thread.currentThread().interrupted();
+                Thread.interrupted();
             }
 
             // ----------------------
@@ -970,7 +977,7 @@
             "MBeanServer argument must be MBean server where this " +
             "server is registered, or an MBeanServerForwarder " +
             "leading to that server";
-        Vector<MBeanServer> seenMBS = new Vector<MBeanServer>();
+        Vector<MBeanServer> seenMBS = new Vector<>();
         for (MBeanServer mbs = newMBS;
              mbs != bottomMBS;
              mbs = ((MBeanServerForwarder) mbs).getMBeanServer()) {
@@ -1153,8 +1160,7 @@
         state = OFFLINE;
         stopRequested = false;
         servedClientCount = 0;
-        clientHandlerVector = new Vector<ClientHandler>();
-        fatherThread = Thread.currentThread();
+        clientHandlerVector = new Vector<>();
         mainThread = null;
         notifCount = 0;
         notifInfos = null;
@@ -1184,6 +1190,7 @@
      *
      * @exception IllegalArgumentException Listener parameter is null.
      */
+    @Override
     public void addNotificationListener(NotificationListener listener,
                                         NotificationFilter filter,
                                         Object handback)
@@ -1207,6 +1214,7 @@
      *
      * @exception ListenerNotFoundException The listener is not registered.
      */
+    @Override
     public void removeNotificationListener(NotificationListener listener)
         throws ListenerNotFoundException {
 
@@ -1225,6 +1233,7 @@
      * sent when the <tt>State</tt> attribute of this CommunicatorServer
      * changes.
      */
+    @Override
     public MBeanNotificationInfo[] getNotificationInfo() {
 
         // Initialize notifInfos on first call to getNotificationInfo()
@@ -1304,6 +1313,7 @@
      *           the <CODE>MBeanServer</CODE> and re-thrown
      *           as an <CODE>MBeanRegistrationException</CODE>.
      */
+    @Override
     public ObjectName preRegister(MBeanServer server, ObjectName name)
             throws java.lang.Exception {
         objectName = name;
@@ -1325,6 +1335,7 @@
      *       successfully registered in the <CODE>MBeanServer</CODE>.
      *       The value false means that the registration phase has failed.
      */
+    @Override
     public void postRegister(Boolean registrationDone) {
         if (!registrationDone.booleanValue()) {
             synchronized (this) {
@@ -1340,6 +1351,7 @@
      *            the <CODE>MBeanServer</CODE> and re-thrown
      *            as an <CODE>MBeanRegistrationException</CODE>.
      */
+    @Override
     public void preDeregister() throws java.lang.Exception {
         synchronized (this) {
             topMBS = bottomMBS = null;
@@ -1354,22 +1366,8 @@
     /**
      * Do nothing.
      */
+    @Override
     public void postDeregister(){
     }
 
-    /**
-     * Load a class using the default loader repository
-     **/
-    Class loadClass(String className)
-        throws ClassNotFoundException {
-        try {
-            return Class.forName(className);
-        } catch (ClassNotFoundException e) {
-            final ClassLoaderRepository clr =
-                MBeanServerFactory.getClassLoaderRepository(bottomMBS);
-            if (clr == null) throw new ClassNotFoundException(className);
-            return clr.loadClass(className);
-        }
-    }
-
 }
--- a/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServer.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServer.java	Tue Dec 18 16:14:59 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, 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
@@ -47,7 +47,6 @@
 import javax.management.MBeanServer;
 import javax.management.MBeanRegistration;
 import javax.management.ObjectName;
-import javax.management.InstanceAlreadyExistsException;
 import static com.sun.jmx.defaults.JmxProperties.SNMP_ADAPTOR_LOGGER;
 import com.sun.jmx.snmp.SnmpIpAddress;
 import com.sun.jmx.snmp.SnmpMessage;
@@ -157,7 +156,7 @@
     /**
      * The IP address based ACL used by this SNMP protocol adaptor.
      */
-    private Object ipacl = null;
+    private InetAddressAcl ipacl = null;
 
     /**
      * The factory object.
@@ -199,7 +198,7 @@
     transient DatagramSocket          trapSocket      = null;
     private transient SnmpSession     informSession   = null;
     private transient DatagramPacket  packet          = null;
-    transient Vector<SnmpMibAgent>    mibs            = new Vector<SnmpMibAgent>();
+    transient Vector<SnmpMibAgent>    mibs            = new Vector<>();
     private transient SnmpMibTree     root;
 
     /**
@@ -482,8 +481,7 @@
         //
         if (acl == null && forceAcl) {
             try {
-                acl = (InetAddressAcl)
-                    new SnmpAcl("SNMP protocol adaptor IP ACL");
+                acl = new SnmpAcl("SNMP protocol adaptor IP ACL");
             } catch (UnknownHostException e) {
                 if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
                     SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
@@ -508,6 +506,7 @@
      * since its creation. This counter is not reset by the <CODE>stop</CODE>
      * method.
      */
+    @Override
     public int getServedClientCount() {
         return super.getServedClientCount();
     }
@@ -519,6 +518,7 @@
      * @return The number of managers currently being processed by this
      * SNMP protocol adaptor.
      */
+    @Override
     public int getActiveClientCount() {
         return super.getActiveClientCount();
     }
@@ -530,6 +530,7 @@
      * @return The maximum number of managers that this SNMP protocol adaptor
      *         can process concurrently.
      */
+    @Override
     public int getMaxActiveClientCount() {
         return super.getMaxActiveClientCount();
     }
@@ -543,6 +544,7 @@
      * @exception java.lang.IllegalStateException This method has been invoked
      * while the communicator was <CODE>ONLINE</CODE> or <CODE>STARTING</CODE>.
      */
+    @Override
     public void setMaxActiveClientCount(int c)
         throws java.lang.IllegalStateException {
         super.setMaxActiveClientCount(c);
@@ -554,8 +556,9 @@
      *
      * @since 1.5
      */
+    @Override
     public InetAddressAcl getInetAddressAcl() {
-        return (InetAddressAcl)ipacl;
+        return ipacl;
     }
 
     /**
@@ -564,6 +567,7 @@
      *
      * @return The port number for sending SNMP traps.
      */
+    @Override
     public Integer getTrapPort() {
         return new Integer(trapPort) ;
     }
@@ -573,6 +577,7 @@
      *
      * @param port The port number for sending SNMP traps.
      */
+    @Override
     public void setTrapPort(Integer port) {
         setTrapPort(port.intValue());
     }
@@ -595,6 +600,7 @@
      *
      * @return The port number for sending SNMP inform requests.
      */
+    @Override
     public int getInformPort() {
         return informPort;
     }
@@ -605,6 +611,7 @@
      *
      * @param port The port number for sending SNMP inform requests.
      */
+    @Override
     public void setInformPort(int port) {
         if (port < 0)
             throw new IllegalArgumentException("Inform request port "+
@@ -617,6 +624,7 @@
      *
      * @return The string "snmp".
      */
+    @Override
     public String getProtocol() {
         return "snmp";
     }
@@ -629,6 +637,7 @@
      *
      * @return The buffer size.
      */
+    @Override
     public Integer getBufferSize() {
         return new Integer(bufferSize) ;
     }
@@ -643,6 +652,7 @@
      * @exception java.lang.IllegalStateException This method has been invoked
      * while the communicator was <CODE>ONLINE</CODE> or <CODE>STARTING</CODE>.
      */
+    @Override
     public void setBufferSize(Integer s)
         throws java.lang.IllegalStateException {
         if ((state == ONLINE) || (state == STARTING)) {
@@ -658,6 +668,7 @@
      * By default, a maximum of 3 tries is used.
      * @return The maximun number of tries.
      */
+    @Override
     final public int getMaxTries() {
         return maxTries;
     }
@@ -667,6 +678,7 @@
      * request before giving up.
      * @param newMaxTries The maximun number of tries.
      */
+    @Override
     final public synchronized void setMaxTries(int newMaxTries) {
         if (newMaxTries < 0)
             throw new IllegalArgumentException();
@@ -678,6 +690,7 @@
      * By default, a timeout of 3 seconds is used.
      * @return The value of the timeout property.
      */
+    @Override
     final public int getTimeout() {
         return timeout;
     }
@@ -686,6 +699,7 @@
      * Changes the timeout to wait for an inform response from the manager.
      * @param newTimeout The timeout (in milliseconds).
      */
+    @Override
     final public synchronized void setTimeout(int newTimeout) {
         if (newTimeout < 0)
             throw new IllegalArgumentException();
@@ -697,6 +711,7 @@
      *
      * @return The factory object.
      */
+    @Override
     public SnmpPduFactory getPduFactory() {
         return pduFactory ;
     }
@@ -706,6 +721,7 @@
      *
      * @param factory The factory object (null means the default factory).
      */
+    @Override
     public void setPduFactory(SnmpPduFactory factory) {
         if (factory == null)
             pduFactory = new SnmpPduFactoryBER() ;
@@ -719,6 +735,7 @@
      * @param factory The factory object (null means no factory).
      * @see com.sun.jmx.snmp.agent.SnmpUserDataFactory
      */
+    @Override
     public void setUserDataFactory(SnmpUserDataFactory factory) {
         userDataFactory = factory ;
     }
@@ -729,6 +746,7 @@
      * @return The factory object (null means no factory).
      * @see com.sun.jmx.snmp.agent.SnmpUserDataFactory
      */
+    @Override
     public SnmpUserDataFactory getUserDataFactory() {
         return userDataFactory;
     }
@@ -745,6 +763,7 @@
      * @return <CODE>true</CODE> if authentication traps are enabled,
      *         <CODE>false</CODE> otherwise.
      */
+    @Override
     public boolean getAuthTrapEnabled() {
         return authTrapEnabled ;
     }
@@ -755,6 +774,7 @@
      *
      * @param enabled Flag indicating if traps need to be sent.
      */
+    @Override
     public void setAuthTrapEnabled(boolean enabled) {
         authTrapEnabled = enabled ;
     }
@@ -772,6 +792,7 @@
      *
      * @return <CODE>true</CODE> if responses are sent.
      */
+    @Override
     public boolean getAuthRespEnabled() {
         return authRespEnabled ;
     }
@@ -782,6 +803,7 @@
      *
      * @param enabled Flag indicating if responses need to be sent.
      */
+    @Override
     public void setAuthRespEnabled(boolean enabled) {
         authRespEnabled = enabled ;
     }
@@ -793,6 +815,7 @@
      *
      * @return The OID in string format "x.x.x.x".
      */
+    @Override
     public String getEnterpriseOid() {
         return enterpriseOid.toString() ;
     }
@@ -804,6 +827,7 @@
      *
      * @exception IllegalArgumentException The string format is incorrect
      */
+    @Override
     public void setEnterpriseOid(String oid) throws IllegalArgumentException {
         enterpriseOid = new SnmpOid(oid) ;
     }
@@ -813,11 +837,12 @@
      *
      * @return An array of MIB names.
      */
+    @Override
     public String[] getMibs() {
         String[] result = new String[mibs.size()] ;
         int i = 0 ;
-        for (Enumeration e = mibs.elements() ; e.hasMoreElements() ;) {
-            SnmpMibAgent mib = (SnmpMibAgent)e.nextElement() ;
+        for (Enumeration<SnmpMibAgent> e = mibs.elements() ; e.hasMoreElements() ;) {
+            SnmpMibAgent mib = e.nextElement() ;
             result[i++] = mib.getMibName();
         }
         return result ;
@@ -831,6 +856,7 @@
      *
      * @return The <CODE>snmpOutTraps</CODE> value.
      */
+    @Override
     public Long getSnmpOutTraps() {
         return new Long(snmpOutTraps);
     }
@@ -840,6 +866,7 @@
      *
      * @return The <CODE>snmpOutGetResponses</CODE> value.
      */
+    @Override
     public Long getSnmpOutGetResponses() {
         return new Long(snmpOutGetResponses);
     }
@@ -849,6 +876,7 @@
      *
      * @return The <CODE>snmpOutGenErrs</CODE> value.
      */
+    @Override
     public Long getSnmpOutGenErrs() {
         return new Long(snmpOutGenErrs);
     }
@@ -858,6 +886,7 @@
      *
      * @return The <CODE>snmpOutBadValues</CODE> value.
      */
+    @Override
     public Long getSnmpOutBadValues() {
         return new Long(snmpOutBadValues);
     }
@@ -867,6 +896,7 @@
      *
      * @return The <CODE>snmpOutNoSuchNames</CODE> value.
      */
+    @Override
     public Long getSnmpOutNoSuchNames() {
         return new Long(snmpOutNoSuchNames);
     }
@@ -876,6 +906,7 @@
      *
      * @return The <CODE>snmpOutTooBigs</CODE> value.
      */
+    @Override
     public Long getSnmpOutTooBigs() {
         return new Long(snmpOutTooBigs);
     }
@@ -885,6 +916,7 @@
      *
      * @return The <CODE>snmpInASNParseErrs</CODE> value.
      */
+    @Override
     public Long getSnmpInASNParseErrs() {
         return new Long(snmpInASNParseErrs);
     }
@@ -894,6 +926,7 @@
      *
      * @return The <CODE>snmpInBadCommunityUses</CODE> value.
      */
+    @Override
     public Long getSnmpInBadCommunityUses() {
         return new Long(snmpInBadCommunityUses);
     }
@@ -904,6 +937,7 @@
      *
      * @return The <CODE>snmpInBadCommunityNames</CODE> value.
      */
+    @Override
     public Long getSnmpInBadCommunityNames() {
         return new Long(snmpInBadCommunityNames);
     }
@@ -913,6 +947,7 @@
      *
      * @return The <CODE>snmpInBadVersions</CODE> value.
      */
+    @Override
     public Long getSnmpInBadVersions() {
         return new Long(snmpInBadVersions);
     }
@@ -922,6 +957,7 @@
      *
      * @return The <CODE>snmpOutPkts</CODE> value.
      */
+    @Override
     public Long getSnmpOutPkts() {
         return new Long(snmpOutPkts);
     }
@@ -931,6 +967,7 @@
      *
      * @return The <CODE>snmpInPkts</CODE> value.
      */
+    @Override
     public Long getSnmpInPkts() {
         return new Long(snmpInPkts);
     }
@@ -940,6 +977,7 @@
      *
      * @return The <CODE>snmpInGetRequests</CODE> value.
      */
+    @Override
     public Long getSnmpInGetRequests() {
         return new Long(snmpInGetRequests);
     }
@@ -949,6 +987,7 @@
      *
      * @return The <CODE>snmpInGetNexts</CODE> value.
      */
+    @Override
     public Long getSnmpInGetNexts() {
         return new Long(snmpInGetNexts);
     }
@@ -958,6 +997,7 @@
      *
      * @return The <CODE>snmpInSetRequests</CODE> value.
      */
+    @Override
     public Long getSnmpInSetRequests() {
         return new Long(snmpInSetRequests);
     }
@@ -967,6 +1007,7 @@
      *
      * @return The <CODE>snmpInTotalSetVars</CODE> value.
      */
+    @Override
     public Long getSnmpInTotalSetVars() {
         return new Long(snmpInTotalSetVars);
     }
@@ -976,6 +1017,7 @@
      *
      * @return The <CODE>snmpInTotalReqVars</CODE> value.
      */
+    @Override
     public Long getSnmpInTotalReqVars() {
         return new Long(snmpInTotalReqVars);
     }
@@ -988,6 +1030,7 @@
      *
      * @since 1.5
      */
+    @Override
     public Long getSnmpSilentDrops() {
         return new Long(snmpSilentDrops);
     }
@@ -1000,6 +1043,7 @@
      *
      * @since 1.5
      */
+    @Override
     public Long getSnmpProxyDrops() {
         return new Long(0);
     }
@@ -1027,6 +1071,7 @@
      *
      * @exception java.lang.Exception
      */
+    @Override
     public ObjectName preRegister(MBeanServer server, ObjectName name)
         throws java.lang.Exception {
 
@@ -1040,6 +1085,7 @@
     /**
      * Not used in this context.
      */
+    @Override
     public void postRegister (Boolean registrationDone) {
         super.postRegister(registrationDone);
     }
@@ -1047,6 +1093,7 @@
     /**
      * Not used in this context.
      */
+    @Override
     public void preDeregister() throws java.lang.Exception {
         super.preDeregister();
     }
@@ -1054,6 +1101,7 @@
     /**
      * Not used in this context.
      */
+    @Override
     public void postDeregister() {
         super.postDeregister();
     }
@@ -1067,6 +1115,7 @@
      *
      * @exception IllegalArgumentException If the parameter is null.
      */
+    @Override
     public SnmpMibHandler addMib(SnmpMibAgent mib)
         throws IllegalArgumentException {
         if (mib == null) {
@@ -1097,6 +1146,7 @@
      *
      * @since 1.5
      */
+    @Override
     public SnmpMibHandler addMib(SnmpMibAgent mib, SnmpOid[] oids)
         throws IllegalArgumentException {
         if (mib == null) {
@@ -1129,6 +1179,7 @@
      *
      * @since 1.5
      */
+    @Override
     public SnmpMibHandler addMib(SnmpMibAgent mib, String contextName)
         throws IllegalArgumentException {
         return addMib(mib);
@@ -1150,10 +1201,12 @@
      *
      * @since 1.5
      */
+    @Override
     public SnmpMibHandler addMib(SnmpMibAgent mib,
                                  String contextName,
                                  SnmpOid[] oids)
         throws IllegalArgumentException {
+
         return addMib(mib, oids);
     }
 
@@ -1171,6 +1224,7 @@
      *
      * @since 1.5
      */
+    @Override
     public boolean removeMib(SnmpMibAgent mib, String contextName) {
         return removeMib(mib);
     }
@@ -1183,6 +1237,7 @@
      * @return <CODE>true</CODE> if the specified <CODE>mib</CODE> was a MIB
      *         included in the SNMP MIB handler, <CODE>false</CODE> otherwise.
      */
+    @Override
     public boolean removeMib(SnmpMibAgent mib) {
         root.unregister(mib);
         return (mibs.removeElement(mib)) ;
@@ -1199,6 +1254,7 @@
      *
      * @since 1.5
      */
+    @Override
     public boolean removeMib(SnmpMibAgent mib, SnmpOid[] oids) {
         root.unregister(mib, oids);
         return (mibs.removeElement(mib)) ;
@@ -1216,6 +1272,7 @@
      *
      * @since 1.5
      */
+    @Override
     public boolean removeMib(SnmpMibAgent mib,
                              String contextName,
                              SnmpOid[] oids) {
@@ -1228,6 +1285,7 @@
     /**
      * Creates the datagram socket.
      */
+    @Override
     protected void doBind()
         throws CommunicationException, InterruptedException {
 
@@ -1255,6 +1313,7 @@
      * that port number was 0.
      * @return the actual port to which the adaptor is bound.
      **/
+    @Override
     public int getPort() {
         synchronized (this) {
             if (socket != null) return socket.getLocalPort();
@@ -1265,6 +1324,7 @@
     /**
      * Closes the datagram socket.
      */
+    @Override
     protected void doUnbind()
         throws CommunicationException, InterruptedException {
         if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
@@ -1282,12 +1342,17 @@
         closeInformSocketIfNeeded() ;
     }
 
-    void createSnmpRequestHandler(SnmpAdaptorServer server, int id,
-                                  DatagramSocket s, DatagramPacket p,
-                                  SnmpMibTree tree, Vector m, Object a,
-                                  SnmpPduFactory factory,
-                                  SnmpUserDataFactory dataFactory,
-                                  MBeanServer f, ObjectName n) {
+    private void createSnmpRequestHandler(SnmpAdaptorServer server,
+                                          int id,
+                                          DatagramSocket s,
+                                          DatagramPacket p,
+                                          SnmpMibTree tree,
+                                          Vector<SnmpMibAgent> m,
+                                          InetAddressAcl a,
+                                          SnmpPduFactory factory,
+                                          SnmpUserDataFactory dataFactory,
+                                          MBeanServer f,
+                                          ObjectName n) {
         final SnmpRequestHandler handler =
             new SnmpRequestHandler(this, id, s, p, tree, m, a, factory,
                                    dataFactory, f, n);
@@ -1298,6 +1363,7 @@
      * Reads a packet from the datagram socket and creates a request
      * handler which decodes and processes the request.
      */
+    @Override
     protected void doReceive()
         throws CommunicationException, InterruptedException {
 
@@ -1339,13 +1405,14 @@
         }
     }
 
+    @Override
     protected void doError(Exception e) throws CommunicationException {
-        return;
     }
 
     /**
      * Not used in this context.
      */
+    @Override
     protected void doProcess()
         throws CommunicationException, InterruptedException {
     }
@@ -1357,6 +1424,7 @@
      * We attempt only once...
      * @return 1
      **/
+    @Override
     protected int getBindTries() {
         return 1;
     }
@@ -1368,6 +1436,7 @@
      * Has no effect if this SNMP protocol adaptor is <CODE>OFFLINE</CODE> or
      * <CODE>STOPPING</CODE>.
      */
+    @Override
     public void stop(){
 
         final int port = getPort();
@@ -1424,6 +1493,7 @@
      * @exception SnmpStatusException If the trap exceeds the limit defined
      *            by <CODE>bufferSize</CODE>.
      */
+    @Override
     public void snmpV1Trap(int generic, int specific,
                            SnmpVarBindList varBindList)
         throws IOException, SnmpStatusException {
@@ -1499,6 +1569,7 @@
      * @exception SnmpStatusException If the trap exceeds the limit defined
      *            by <CODE>bufferSize</CODE>.
      */
+    @Override
     public void snmpV1Trap(InetAddress addr, String cs, int generic,
                            int specific, SnmpVarBindList varBindList)
         throws IOException, SnmpStatusException {
@@ -1617,6 +1688,7 @@
      *
      * @since 1.5
      */
+    @Override
     public void snmpV1Trap(SnmpPeer peer,
                            SnmpIpAddress agentAddr,
                            SnmpOid enterpOid,
@@ -1625,6 +1697,7 @@
                            SnmpVarBindList varBindList,
                            SnmpTimeticks time)
         throws IOException, SnmpStatusException {
+
         SnmpParameters p = (SnmpParameters) peer.getParams();
         snmpV1Trap(peer.getDestAddr(),
                    peer.getDestPort(),
@@ -1745,11 +1818,13 @@
      *
      * @since 1.5
      */
+    @Override
     public void snmpV2Trap(SnmpPeer peer,
                            SnmpOid trapOid,
                            SnmpVarBindList varBindList,
                            SnmpTimeticks time)
         throws IOException, SnmpStatusException {
+
         SnmpParameters p = (SnmpParameters) peer.getParams();
         snmpV2Trap(peer.getDestAddr(),
                    peer.getDestPort(),
@@ -1781,6 +1856,7 @@
      * @exception SnmpStatusException If the trap exceeds the limit defined
      *            by <CODE>bufferSize</CODE>.
      */
+    @Override
     public void snmpV2Trap(SnmpOid trapOid, SnmpVarBindList varBindList)
         throws IOException, SnmpStatusException {
 
@@ -1801,7 +1877,7 @@
 
         SnmpVarBindList fullVbl ;
         if (varBindList != null)
-            fullVbl = (SnmpVarBindList)varBindList.clone() ;
+            fullVbl = varBindList.clone() ;
         else
             fullVbl = new SnmpVarBindList(2) ;
         SnmpTimeticks sysUpTimeValue = new SnmpTimeticks(getSysUpTime()) ;
@@ -1840,6 +1916,7 @@
      * @exception SnmpStatusException If the trap exceeds the limit
      *            defined by <CODE>bufferSize</CODE>.
      */
+    @Override
     public void snmpV2Trap(InetAddress addr, String cs, SnmpOid trapOid,
                            SnmpVarBindList varBindList)
         throws IOException, SnmpStatusException {
@@ -1865,7 +1942,7 @@
 
         SnmpVarBindList fullVbl ;
         if (varBindList != null)
-            fullVbl = (SnmpVarBindList)varBindList.clone() ;
+            fullVbl = varBindList.clone() ;
         else
             fullVbl = new SnmpVarBindList(2) ;
         SnmpTimeticks sysUpTimeValue = new SnmpTimeticks(getSysUpTime()) ;
@@ -1964,12 +2041,12 @@
 
         SnmpVarBindList fullVbl ;
         if (varBindList != null)
-            fullVbl = (SnmpVarBindList)varBindList.clone() ;
+            fullVbl = varBindList.clone() ;
         else
             fullVbl = new SnmpVarBindList(2) ;
 
         // Only difference with other
-        SnmpTimeticks sysUpTimeValue = null;
+        SnmpTimeticks sysUpTimeValue;
         if(time != null)
             sysUpTimeValue = time;
         else
@@ -2002,6 +2079,7 @@
      *
      * @since 1.5
      */
+    @Override
     public void snmpPduTrap(InetAddress address, SnmpPduPacket pdu)
             throws IOException, SnmpStatusException {
 
@@ -2021,6 +2099,7 @@
      * by <CODE>bufferSize</CODE>.
      * @since 1.5
      */
+    @Override
     public void snmpPduTrap(SnmpPeer peer,
                             SnmpPduPacket pdu)
         throws IOException, SnmpStatusException {
@@ -2066,13 +2145,12 @@
         int sendingCount = 0 ;
         openTrapSocketIfNeeded() ;
         if (ipacl != null) {
-            Enumeration ed = ((InetAddressAcl)ipacl).getTrapDestinations() ;
+            Enumeration<InetAddress> ed = ipacl.getTrapDestinations() ;
             while (ed.hasMoreElements()) {
-                msg.address = (InetAddress)ed.nextElement() ;
-                Enumeration ec = ((InetAddressAcl)ipacl).
-                    getTrapCommunities(msg.address) ;
+                msg.address = ed.nextElement() ;
+                Enumeration<String> ec = ipacl.getTrapCommunities(msg.address) ;
                 while (ec.hasMoreElements()) {
-                    msg.community = ((String)ec.nextElement()).getBytes() ;
+                    msg.community = ec.nextElement().getBytes() ;
                     try {
                         sendTrapMessage(msg) ;
                         sendingCount++ ;
@@ -2164,6 +2242,7 @@
      */
     private void sendTrapMessage(SnmpMessage msg)
         throws IOException, SnmpTooBigException {
+
         byte[] buffer = new byte[bufferSize] ;
         DatagramPacket packet = new DatagramPacket(buffer, buffer.length) ;
         int encodingLength = msg.encodeMessage(buffer) ;
@@ -2245,8 +2324,10 @@
      * @exception SnmpStatusException If the inform request exceeds the
      *            limit defined by <CODE>bufferSize</CODE>.
      */
-    public Vector snmpInformRequest(SnmpInformHandler cb, SnmpOid trapOid,
-                                    SnmpVarBindList varBindList)
+    @Override
+    public Vector<SnmpInformRequest> snmpInformRequest(SnmpInformHandler cb,
+                                                       SnmpOid trapOid,
+                                                       SnmpVarBindList varBindList)
         throws IllegalStateException, IOException, SnmpStatusException {
 
         if (!isActive()) {
@@ -2263,7 +2344,7 @@
         //
         SnmpVarBindList fullVbl ;
         if (varBindList != null)
-            fullVbl = (SnmpVarBindList)varBindList.clone() ;
+            fullVbl = varBindList.clone() ;
         else
             fullVbl = new SnmpVarBindList(2) ;
         SnmpTimeticks sysUpTimeValue = new SnmpTimeticks(getSysUpTime()) ;
@@ -2277,17 +2358,16 @@
 
         // Now send the SNMP message to each destination
         //
-        Vector<SnmpInformRequest> informReqList = new Vector<SnmpInformRequest>();
-        InetAddress addr = null;
-        String cs = null;
+        Vector<SnmpInformRequest> informReqList = new Vector<>();
+        InetAddress addr;
+        String cs;
         if (ipacl != null) {
-            Enumeration ed = ((InetAddressAcl)ipacl).getInformDestinations() ;
+            Enumeration<InetAddress> ed = ipacl.getInformDestinations() ;
             while (ed.hasMoreElements()) {
-                addr = (InetAddress)ed.nextElement() ;
-                Enumeration ec = ((InetAddressAcl)ipacl).
-                    getInformCommunities(addr) ;
+                addr = ed.nextElement() ;
+                Enumeration<String> ec = ipacl.getInformCommunities(addr) ;
                 while (ec.hasMoreElements()) {
-                    cs = (String)ec.nextElement() ;
+                    cs = ec.nextElement() ;
                     informReqList.addElement(
                        informSession.makeAsyncRequest(addr, cs, cb,
                                               fullVbl,getInformPort())) ;
@@ -2330,6 +2410,7 @@
      * @exception SnmpStatusException If the inform request exceeds the
      *            limit defined by <CODE>bufferSize</CODE>.
      */
+    @Override
     public SnmpInformRequest snmpInformRequest(InetAddress addr,
                                                String cs,
                                                SnmpInformHandler cb,
@@ -2380,11 +2461,13 @@
      *
      * @since 1.5
      */
+    @Override
     public SnmpInformRequest snmpInformRequest(SnmpPeer peer,
                                                SnmpInformHandler cb,
                                                SnmpOid trapOid,
                                                SnmpVarBindList varBindList)
         throws IllegalStateException, IOException, SnmpStatusException {
+
         SnmpParameters p = (SnmpParameters) peer.getParams();
         return snmpInformRequest(peer.getDestAddr(),
                                  peer.getDestPort(),
@@ -2401,9 +2484,9 @@
      * @param protocolVersion The protocol version.
      * @param reqPduType The pdu type.
      */
-    public static final int mapErrorStatus(int errorStatus,
-                                           int protocolVersion,
-                                           int reqPduType) {
+    public static int mapErrorStatus(int errorStatus,
+                                     int protocolVersion,
+                                     int reqPduType) {
         return SnmpSubRequestHandler.mapErrorStatus(errorStatus,
                                                     protocolVersion,
                                                     reqPduType);
@@ -2416,6 +2499,7 @@
                                                 SnmpOid trapOid,
                                                 SnmpVarBindList varBindList)
         throws IllegalStateException, IOException, SnmpStatusException {
+
         if (!isActive()) {
             throw new IllegalStateException(
               "Start SNMP adaptor server before carrying out this operation");
@@ -2430,7 +2514,7 @@
         //
         SnmpVarBindList fullVbl ;
         if (varBindList != null)
-            fullVbl = (SnmpVarBindList)varBindList.clone() ;
+            fullVbl = varBindList.clone() ;
         else
             fullVbl = new SnmpVarBindList(2) ;
         SnmpTimeticks sysUpTimeValue = new SnmpTimeticks(getSysUpTime()) ;
@@ -2489,6 +2573,7 @@
      * references to the object.
      * <P>Closes the datagram socket associated to this SNMP protocol adaptor.
      */
+    @Override
     protected void finalize() {
         try {
             if (socket != null) {
@@ -2511,6 +2596,7 @@
     /**
      * Returns the string used in debug traces.
      */
+    @Override
     String makeDebugTag() {
         return "SnmpAdaptorServer["+ getProtocol() + ":" + getPort() + "]";
     }
@@ -2615,13 +2701,13 @@
         // This is for transient structures to be initialized to specific
         // default values.
         //
-        mibs      = new Vector<SnmpMibAgent>() ;
+        mibs      = new Vector<>() ;
     }
 
     /**
      * Common initializations.
      */
-    private void init(Object acl, int p, InetAddress a) {
+    private void init(InetAddressAcl acl, int p, InetAddress a) {
 
         root= new SnmpMibTree();
 
@@ -2650,6 +2736,7 @@
         return root.getAgentMib(oid);
     }
 
+    @Override
     protected Thread createMainThread() {
         final Thread t = super.createMainThread();
         t.setDaemon(true);
--- a/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java	Tue Dec 18 16:14:59 2012 -0800
@@ -140,6 +140,7 @@
      *
      * @return The string "snmp".
      */
+    @Override
     public String getProtocol();
 
     /**
@@ -636,7 +637,8 @@
      * @exception IOException An I/O error occurred while sending the inform request.
      * @exception SnmpStatusException If the inform request exceeds the limit defined by <CODE>bufferSize</CODE>.
      */
-    public Vector snmpInformRequest(SnmpInformHandler cb, SnmpOid trapOid, SnmpVarBindList varBindList)
+    public Vector<?> snmpInformRequest(SnmpInformHandler cb, SnmpOid trapOid,
+            SnmpVarBindList varBindList)
         throws IllegalStateException, IOException, SnmpStatusException;
 
     /**
--- a/src/share/classes/com/sun/jmx/snmp/daemon/SnmpMibTree.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/daemon/SnmpMibTree.java	Tue Dec 18 16:14:59 2012 -0800
@@ -125,7 +125,7 @@
             TreeNode node= retrieveChild(oid, cursor);
             if (node == null)
                 return this;
-            if (children.size() == 0) {
+            if (children.isEmpty()) {
                 // In this case, the node does not have any children. So no point to
                 // continue the search ...
                 return node;
@@ -149,24 +149,24 @@
 
         public void printTree(String ident) {
 
-            StringBuffer buff= new StringBuffer();
+            StringBuilder buff= new StringBuilder();
             if (agents == null) {
                 return;
             }
 
-            for(Enumeration e= agents.elements(); e.hasMoreElements(); ) {
-                SnmpMibAgent mib= (SnmpMibAgent) e.nextElement();
+            for(Enumeration<SnmpMibAgent> e= agents.elements(); e.hasMoreElements(); ) {
+                SnmpMibAgent mib= e.nextElement();
                 if (mib == null)
                     buff.append("empty ");
                 else
-                    buff.append(mib.getMibName() + " ");
+                    buff.append(mib.getMibName()).append(" ");
             }
             ident+= " ";
             if (children == null) {
                 return;
             }
-            for(Enumeration e= children.elements(); e.hasMoreElements(); ) {
-                TreeNode node= (TreeNode) e.nextElement();
+            for(Enumeration<TreeNode> e= children.elements(); e.hasMoreElements(); ) {
+                TreeNode node= e.nextElement();
                 node.printTree(ident);
             }
         }
@@ -185,7 +185,7 @@
         }
 
         private void removeAgentFully(SnmpMibAgent agent) {
-            Vector<TreeNode> v = new Vector<TreeNode>();
+            Vector<TreeNode> v = new Vector<>();
             for(Enumeration<TreeNode> e= children.elements();
                 e.hasMoreElements(); ) {
 
@@ -212,9 +212,9 @@
 
         }
 
-      private void setAgent(SnmpMibAgent agent) {
-        this.agent = agent;
-      }
+        private void setAgent(SnmpMibAgent agent) {
+            this.agent = agent;
+        }
 
         private void registerNode(long[] oid, int cursor, SnmpMibAgent agent) {
 
@@ -247,20 +247,20 @@
         private TreeNode retrieveChild(long[] oid, int current) {
             long theValue= oid[current];
 
-            for(Enumeration e= children.elements(); e.hasMoreElements(); ) {
-                TreeNode node= (TreeNode) e.nextElement();
+            for(Enumeration<TreeNode> e= children.elements(); e.hasMoreElements(); ) {
+                TreeNode node= e.nextElement();
                 if (node.match(theValue))
                     return node;
             }
             return null;
         }
 
-        final private boolean match(long value) {
+        private boolean match(long value) {
             return (nodeValue == value) ? true : false;
         }
 
-        private Vector<TreeNode> children= new Vector<TreeNode>();
-        private Vector<SnmpMibAgent> agents= new Vector<SnmpMibAgent>();
+        private Vector<TreeNode> children= new Vector<>();
+        private Vector<SnmpMibAgent> agents= new Vector<>();
         private long nodeValue;
         private SnmpMibAgent agent;
         private TreeNode parent;
--- a/src/share/classes/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java	Tue Dec 18 16:14:59 2012 -0800
@@ -71,9 +71,9 @@
 
 class SnmpRequestHandler extends ClientHandler implements SnmpDefinitions {
 
-    private transient DatagramSocket      socket = null ;
-    private transient DatagramPacket      packet = null ;
-    private transient Vector              mibs = null ;
+    private transient DatagramSocket       socket = null ;
+    private transient DatagramPacket       packet = null ;
+    private transient Vector<SnmpMibAgent> mibs = null ;
 
     /**
      * Contains the list of sub-requests associated to the current request.
@@ -85,7 +85,7 @@
      */
     private transient SnmpMibTree root;
 
-    private transient Object              ipacl = null ;
+    private transient InetAddressAcl      ipacl = null ;
     private transient SnmpPduFactory      pduFactory = null ;
     private transient SnmpUserDataFactory userDataFactory = null ;
     private transient SnmpAdaptorServer adaptor = null;
@@ -94,7 +94,8 @@
      */
     public SnmpRequestHandler(SnmpAdaptorServer server, int id,
                               DatagramSocket s, DatagramPacket p,
-                              SnmpMibTree tree, Vector m, Object a,
+                              SnmpMibTree tree, Vector<SnmpMibAgent> m,
+                              InetAddressAcl a,
                               SnmpPduFactory factory,
                               SnmpUserDataFactory dataFactory,
                               MBeanServer f, ObjectName n)
@@ -108,8 +109,8 @@
         socket = s;
         packet = p;
         root= tree;
-        mibs = (Vector) m.clone();
-        subs= new Hashtable<SnmpMibAgent, SnmpSubRequestHandler>(mibs.size());
+        mibs = new Vector<>(m);
+        subs= new Hashtable<>(mibs.size());
         ipacl = a;
         pduFactory = factory ;
         userDataFactory = dataFactory ;
@@ -121,6 +122,7 @@
      * back to the client.
      * Note: we overwrite 'packet' with the response bytes.
      */
+    @Override
     public void doRun() {
 
         // Trace the input packet
@@ -243,7 +245,7 @@
 
         // Transform the request message into a request pdu
         //
-        SnmpPduPacket reqPdu = null ;
+        SnmpPduPacket reqPdu;
         Object userData = null;
         try {
             reqPdu = (SnmpPduPacket)pduFactory.decodeSnmpPdu(reqMsg) ;
@@ -306,7 +308,7 @@
                         SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
                             "makeResponseMessage", "fail on element" + pos);
                     }
-                    int old= 0;
+                    int old;
                     while (true) {
                         try {
                             respPdu = reduceResponsePdu(reqPdu, respPdu, pos) ;
@@ -580,20 +582,18 @@
                                             Object userData) {
 
         int errorStatus = SnmpDefinitions.snmpRspNoError ;
-        int nbSubRequest= subs.size();
 
-        int i=0;
+        int i;
         // If it's a set request, we must first check any varBind
         //
         if (req.type == pduSetRequestPdu) {
 
             i=0;
-            for(Enumeration e= subs.elements(); e.hasMoreElements() ; i++) {
+            for(Enumeration<SnmpSubRequestHandler> e= subs.elements(); e.hasMoreElements() ; i++) {
                 // Indicate to the sub request that a check must be invoked ...
                 // OK we should have defined out own tag for that !
                 //
-                SnmpSubRequestHandler sub= (SnmpSubRequestHandler)
-                    e.nextElement();
+                SnmpSubRequestHandler sub= e.nextElement();
                 sub.setUserData(userData);
                 sub.type= pduWalkRequest;
 
@@ -618,8 +618,8 @@
         // Let's start the sub-requests.
         //
         i=0;
-        for(Enumeration e= subs.elements(); e.hasMoreElements() ;i++) {
-            SnmpSubRequestHandler sub= (SnmpSubRequestHandler) e.nextElement();
+        for(Enumeration<SnmpSubRequestHandler> e= subs.elements(); e.hasMoreElements() ;i++) {
+            SnmpSubRequestHandler sub= e.nextElement();
         /* NPCTE fix for bugId 4492741, esc 0, 16-August 2001 */
             sub.setUserData(userData);
         /* end of NPCTE fix for bugId 4492741 */
@@ -650,7 +650,7 @@
     private SnmpPduPacket turboProcessingGetSet(SnmpPduRequest req,
                                                 Object userData) {
 
-        int errorStatus = SnmpDefinitions.snmpRspNoError ;
+        int errorStatus;
         SnmpSubRequestHandler sub = subs.elements().nextElement();
         sub.setUserData(userData);
 
@@ -707,7 +707,7 @@
     private SnmpPduPacket makeGetBulkResponsePdu(SnmpPduBulk req,
                                                  Object userData) {
 
-        SnmpVarBind[] respVarBindList = null ;
+        SnmpVarBind[] respVarBindList;
 
         // RFC 1905, Section 4.2.3, p14
         int L = req.varBindList.length ;
@@ -761,7 +761,7 @@
      */
     private boolean checkPduType(SnmpPduPacket pdu) {
 
-        boolean result = true ;
+        boolean result;
 
         switch(pdu.type) {
 
@@ -798,8 +798,7 @@
         //
         if (ipacl != null) {
             if (pdu.type == SnmpDefinitions.pduSetRequestPdu) {
-                if (!((InetAddressAcl)ipacl).
-                    checkWritePermission(pdu.address, community)) {
+                if (!ipacl.checkWritePermission(pdu.address, community)) {
                     if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
                         SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
                            "checkAcl", "sender is " + pdu.address +
@@ -820,7 +819,7 @@
                 }
             }
             else {
-                if (!((InetAddressAcl)ipacl).checkReadPermission(pdu.address, community)) {
+                if (!ipacl.checkReadPermission(pdu.address, community)) {
                     if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
                         SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
                            "checkAcl", "sender is " + pdu.address +
@@ -854,7 +853,7 @@
         if (response != null) {
             SnmpAdaptorServer snmpServer = (SnmpAdaptorServer)adaptorServer ;
             snmpServer.incSnmpInBadCommunityUses(1) ;
-            if (((InetAddressAcl)ipacl).checkCommunity(community) == false)
+            if (ipacl.checkCommunity(community) == false)
                 snmpServer.incSnmpInBadCommunityNames(1) ;
         }
 
@@ -873,7 +872,7 @@
         result.port = reqPdu.port ;
         result.version = reqPdu.version ;
         result.community = reqPdu.community ;
-        result.type = result.pduGetResponsePdu ;
+        result.type = SnmpPduRequest.pduGetResponsePdu ;
         result.requestId = reqPdu.requestId ;
         result.errorStatus = SnmpDefinitions.snmpRspNoError ;
         result.errorIndex = 0 ;
@@ -904,7 +903,7 @@
     private SnmpMessage newTooBigMessage(SnmpMessage reqMsg)
         throws SnmpTooBigException {
         SnmpMessage result = null ;
-        SnmpPduPacket reqPdu = null ;
+        SnmpPduPacket reqPdu;
 
         try {
             reqPdu = (SnmpPduPacket)pduFactory.decodeSnmpPdu(reqMsg) ;
@@ -941,7 +940,7 @@
 
         // Reduction can be attempted only on bulk response
         //
-        if (req.type != req.pduGetBulkRequestPdu) {
+        if (req.type != SnmpPduPacket.pduGetBulkRequestPdu) {
             if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
                 SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
                    "reduceResponsePdu", "cannot remove anything");
@@ -961,7 +960,7 @@
         //   * when it is 0 (in fact, acceptedVbCount is not available),
         //     we split the varbindlist by 2.
         //
-        int vbCount = resp.varBindList.length ;
+        int vbCount;
         if (acceptedVbCount >= 3)
             vbCount = Math.min(acceptedVbCount - 1, resp.varBindList.length) ;
         else if (acceptedVbCount == 1)
@@ -998,7 +997,7 @@
     private void splitRequest(SnmpPduRequest req) {
 
         int nbAgents= mibs.size();
-        SnmpMibAgent agent= (SnmpMibAgent) mibs.firstElement();
+        SnmpMibAgent agent = mibs.firstElement();
         if (nbAgents == 1) {
             // Take all the oids contained in the request and
             //
@@ -1010,8 +1009,8 @@
         // to all agents
         //
         if (req.type == pduGetNextRequestPdu) {
-            for(Enumeration e= mibs.elements(); e.hasMoreElements(); ) {
-                SnmpMibAgent ag= (SnmpMibAgent) e.nextElement();
+            for(Enumeration<SnmpMibAgent> e= mibs.elements(); e.hasMoreElements(); ) {
+                final SnmpMibAgent ag= e.nextElement();
                 subs.put(ag, new SnmpSubNextRequestHandler(adaptor, ag, req));
             }
             return;
@@ -1047,8 +1046,8 @@
                                   int R) {
         // Send the getBulk to all agents
         //
-        for(Enumeration e= mibs.elements(); e.hasMoreElements(); ) {
-            SnmpMibAgent agent = (SnmpMibAgent) e.nextElement();
+        for(Enumeration<SnmpMibAgent> e= mibs.elements(); e.hasMoreElements(); ) {
+            final SnmpMibAgent agent = e.nextElement();
 
             if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
                 SNMP_ADAPTOR_LOGGER.logp(Level.FINER, dbgTag,
@@ -1064,7 +1063,6 @@
                                                    maxRepetitions,
                                                    R));
         }
-        return;
     }
 
     private SnmpPduPacket mergeResponses(SnmpPduRequest req) {
@@ -1078,8 +1076,8 @@
         // Go through the list of subrequests and concatenate.
         // Hopefully, by now all the sub-requests should be finished
         //
-        for(Enumeration e= subs.elements(); e.hasMoreElements();) {
-            SnmpSubRequestHandler sub= (SnmpSubRequestHandler) e.nextElement();
+        for(Enumeration<SnmpSubRequestHandler> e= subs.elements(); e.hasMoreElements();) {
+            SnmpSubRequestHandler sub= e.nextElement();
             sub.updateResult(result);
         }
         return newValidResponsePdu(req,result);
@@ -1092,8 +1090,8 @@
         // Go through the list of subrequests and concatenate.
         // Hopefully, by now all the sub-requests should be finished
         //
-        for(Enumeration e= subs.elements(); e.hasMoreElements();) {
-            SnmpSubRequestHandler sub= (SnmpSubRequestHandler) e.nextElement();
+        for(Enumeration<SnmpSubRequestHandler> e= subs.elements(); e.hasMoreElements();) {
+            SnmpSubRequestHandler sub= e.nextElement();
             sub.updateResult(result);
         }
 
@@ -1127,19 +1125,21 @@
         // Go through the list of subrequests and concatenate.
         // Hopefully, by now all the sub-requests should be finished
         //
-        for(Enumeration e= subs.elements(); e.hasMoreElements();) {
-            SnmpSubRequestHandler sub= (SnmpSubRequestHandler) e.nextElement();
+        for(Enumeration<SnmpSubRequestHandler> e= subs.elements(); e.hasMoreElements();) {
+            SnmpSubRequestHandler sub= e.nextElement();
             sub.updateResult(result);
         }
 
         return result;
     }
 
+    @Override
     protected String makeDebugTag() {
         return "SnmpRequestHandler[" + adaptorServer.getProtocol() + ":" +
             adaptorServer.getPort() + "]";
     }
 
+    @Override
     Thread createThread(Runnable r) {
         return null;
     }
--- a/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java	Tue Dec 18 16:14:59 2012 -0800
@@ -31,7 +31,6 @@
 // java import
 //
 import java.util.Enumeration;
-import java.util.Vector;
 import java.util.logging.Level;
 // jmx imports
 //
@@ -46,9 +45,6 @@
 //
 import static com.sun.jmx.defaults.JmxProperties.SNMP_ADAPTOR_LOGGER;
 import com.sun.jmx.snmp.agent.SnmpMibAgent;
-import com.sun.jmx.snmp.agent.SnmpMibRequest;
-import com.sun.jmx.snmp.ThreadContext;
-import com.sun.jmx.snmp.daemon.SnmpAdaptorServer;
 import com.sun.jmx.snmp.internal.SnmpIncomingRequest;
 import com.sun.jmx.snmp.ThreadContext;
 
@@ -85,6 +81,7 @@
         init(server, req, nonRepeat, maxRepeat, R);
     }
 
+    @Override
     public void run() {
 
         size= varBind.size();
@@ -259,11 +256,12 @@
      * successful. As such the method getErrorIndex or getErrorStatus should be
      * called.
      */
+    @Override
     protected void updateResult(SnmpVarBind[] result) {
         // we can assume that the run method is over ...
         //
 
-        final Enumeration e= varBind.elements();
+        final Enumeration<SnmpVarBind> e= varBind.elements();
         final int max= result.length;
 
         // First go through all the values once ...
@@ -284,7 +282,7 @@
                 continue;
             }
 
-            final SnmpVarBind element= (SnmpVarBind) e.nextElement();
+            final SnmpVarBind element= e.nextElement();
 
             if (element == null) continue;
             if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
@@ -309,7 +307,7 @@
                     return;
                 if (e.hasMoreElements() ==false)
                     return;
-                final SnmpVarBind element= (SnmpVarBind) e.nextElement();
+                final SnmpVarBind element= e.nextElement();
 
                 if (element == null) continue;
                 if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINER)) {
--- a/src/share/classes/com/sun/jmx/snmp/defaults/SnmpProperties.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/defaults/SnmpProperties.java	Tue Dec 18 16:14:59 2012 -0800
@@ -60,7 +60,7 @@
         InputStream is = new FileInputStream(file);
         props.load(is);
         is.close();
-        for (final Enumeration e = props.keys(); e.hasMoreElements() ; ) {
+        for (final Enumeration<?> e = props.keys(); e.hasMoreElements() ; ) {
             final String key = (String) e.nextElement();
             System.setProperty(key,props.getProperty(key));
         }
--- a/src/share/classes/com/sun/jmx/snmp/tasks/ThreadService.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/jmx/snmp/tasks/ThreadService.java	Tue Dec 18 16:14:59 2012 -0800
@@ -199,7 +199,7 @@
 
                 // re-init
                 this.setPriority(priority);
-                this.interrupted();
+                Thread.interrupted();
                 this.setContextClassLoader(cloader);
             }
         }
--- a/src/share/classes/com/sun/net/ssl/KeyManagerFactory.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/net/ssl/KeyManagerFactory.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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/SSLPermission.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/net/ssl/SSLPermission.java	Tue Dec 18 16:14:59 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, 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
@@ -46,8 +46,8 @@
  * convention follows the  hierarchical property naming convention.
  * Also, an asterisk
  * may appear at the end of the name, following a ".", or by itself, to
- * signify a wildcard match. For example: "foo.*" or "*" is valid,
- * "*foo" or "a*b" is not valid.
+ * signify a wildcard match. For example: "foo.*" and "*" signify a wildcard
+ * match, while "*foo" and "a*b" do not.
  * <P>
  * The following table lists all the possible SSLPermission target names,
  * and for each provides a description of what the permission allows
--- a/src/share/classes/com/sun/net/ssl/TrustManagerFactory.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/net/ssl/TrustManagerFactory.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/security/auth/PolicyFile.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/security/auth/login/ConfigFile.java	Tue Dec 18 16:14:59 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,13 +49,9 @@
  *
  * <ol>
  * <li>
- *   Loop through the <code>java.security.Security</code> properties,
+ *   Loop through the security properties,
  *   <i>login.config.url.1</i>, <i>login.config.url.2</i>, ...,
- *   <i>login.config.url.X</i>.  These properties are set
- *   in the Java security properties file, which is located in the file named
- *   &lt;JAVA_HOME&gt;/lib/security/java.security.
- *   &lt;JAVA_HOME&gt; refers to the value of the java.home system property,
- *   and specifies the directory where the JRE is installed.
+ *   <i>login.config.url.X</i>.
  *   Each property value specifies a <code>URL</code> pointing to a
  *   login configuration file to be loaded.  Read in and load
  *   each configuration.
@@ -87,6 +83,7 @@
  * <code>javax.security.auth.login.Configuration</code> class.
  *
  * @see javax.security.auth.login.LoginContext
+ * @see java.security.Security security properties
  */
 public class ConfigFile extends javax.security.auth.login.Configuration {
 
--- a/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/awt/color/ICC_Profile.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/awt/image/ColorConvertOp.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/AbstractStringBuilder.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/Class.java	Tue Dec 18 16:14:59 2012 -0800
@@ -48,6 +48,7 @@
 import java.util.Set;
 import java.util.Map;
 import java.util.HashMap;
+import java.util.Objects;
 import sun.misc.Unsafe;
 import sun.reflect.ConstantPool;
 import sun.reflect.Reflection;
@@ -3044,34 +3045,62 @@
      * @throws NullPointerException {@inheritDoc}
      * @since 1.5
      */
-    @SuppressWarnings("unchecked")
     public <A extends Annotation> A getAnnotation(Class<A> annotationClass) {
-        if (annotationClass == null)
-            throw new NullPointerException();
+        Objects.requireNonNull(annotationClass);
 
         initAnnotationsIfNecessary();
-        return (A) annotations.get(annotationClass);
+        return AnnotationSupport.getOneAnnotation(annotations, annotationClass);
     }
 
     /**
      * @throws NullPointerException {@inheritDoc}
      * @since 1.5
      */
-    public boolean isAnnotationPresent(
-        Class<? extends Annotation> annotationClass) {
-        if (annotationClass == null)
-            throw new NullPointerException();
+    public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) {
+        Objects.requireNonNull(annotationClass);
 
         return getAnnotation(annotationClass) != null;
     }
 
+    /**
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    public <A extends Annotation> A[] getAnnotations(Class<A> annotationClass) {
+        Objects.requireNonNull(annotationClass);
+
+        initAnnotationsIfNecessary();
+        return AnnotationSupport.getMultipleAnnotations(annotations, annotationClass);
+    }
 
     /**
      * @since 1.5
      */
     public Annotation[] getAnnotations() {
         initAnnotationsIfNecessary();
-        return AnnotationParser.toArray(annotations);
+        return AnnotationSupport.unpackToArray(annotations);
+    }
+
+    /**
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    public <A extends Annotation> A getDeclaredAnnotation(Class<A> annotationClass) {
+        Objects.requireNonNull(annotationClass);
+
+        initAnnotationsIfNecessary();
+        return AnnotationSupport.getOneAnnotation(declaredAnnotations, annotationClass);
+    }
+
+    /**
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    public <A extends Annotation> A[] getDeclaredAnnotations(Class<A> annotationClass) {
+        Objects.requireNonNull(annotationClass);
+
+        initAnnotationsIfNecessary();
+        return AnnotationSupport.getMultipleAnnotations(declaredAnnotations, annotationClass);
     }
 
     /**
@@ -3079,7 +3108,17 @@
      */
     public Annotation[] getDeclaredAnnotations()  {
         initAnnotationsIfNecessary();
-        return AnnotationParser.toArray(declaredAnnotations);
+        return AnnotationSupport.unpackToArray(declaredAnnotations);
+    }
+
+    /** Returns one "directly" present annotation or null */
+    <A extends Annotation> A getDirectDeclaredAnnotation(Class<A> annotationClass) {
+        Objects.requireNonNull(annotationClass);
+
+        initAnnotationsIfNecessary();
+        @SuppressWarnings("unchecked") // TODO check safe
+        A ret = (A)declaredAnnotations.get(annotationClass);
+        return ret;
     }
 
     // Annotations cache
--- a/src/share/classes/java/lang/Package.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/Package.java	Tue Dec 18 16:14:59 2012 -0800
@@ -395,6 +395,14 @@
     }
 
     /**
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    public  <A extends Annotation> A[] getAnnotations(Class<A> annotationClass) {
+        return getPackageInfo().getAnnotations(annotationClass);
+    }
+
+    /**
      * @since 1.5
      */
     public Annotation[] getAnnotations() {
@@ -402,6 +410,22 @@
     }
 
     /**
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    public <A extends Annotation> A getDeclaredAnnotation(Class<A> annotationClass) {
+        return getPackageInfo().getDeclaredAnnotation(annotationClass);
+    }
+
+    /**
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    public <A extends Annotation> A[] getDeclaredAnnotations(Class<A> annotationClass) {
+        return getPackageInfo().getDeclaredAnnotations(annotationClass);
+    }
+
+    /**
      * @since 1.5
      */
     public Annotation[] getDeclaredAnnotations()  {
--- a/src/share/classes/java/lang/RuntimePermission.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/RuntimePermission.java	Tue Dec 18 16:14:59 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, 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
@@ -41,8 +41,8 @@
  * naming convention follows the  hierarchical property naming convention.
  * Also, an asterisk
  * may appear at the end of the name, following a ".", or by itself, to
- * signify a wildcard match. For example: "loadLibrary.*" or "*" is valid,
- * "*loadLibrary" or "a*b" is not valid.
+ * signify a wildcard match. For example: "loadLibrary.*" and "*" signify a
+ * wildcard match, while "*loadLibrary" and "a*b" do not.
  * <P>
  * The following table lists all the possible RuntimePermission target names,
  * and for each provides a description of what the permission allows
--- a/src/share/classes/java/lang/String.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/String.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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/System.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/System.java	Tue Dec 18 16:14:59 2012 -0800
@@ -25,6 +25,7 @@
 package java.lang;
 
 import java.io.*;
+import java.lang.annotation.Annotation;
 import java.util.Properties;
 import java.util.PropertyPermission;
 import java.util.StringTokenizer;
@@ -1195,6 +1196,9 @@
             public AnnotationType getAnnotationType(Class<?> klass) {
                 return klass.getAnnotationType();
             }
+            public <A extends Annotation> A getDirectDeclaredAnnotation(Class<?> klass, Class<A> anno) {
+                return klass.getDirectDeclaredAnnotation(anno);
+            }
             public <E extends Enum<E>>
                     E[] getEnumConstantsShared(Class<E> klass) {
                 return klass.getEnumConstantsShared();
--- a/src/share/classes/java/lang/ThreadLocal.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/ThreadLocal.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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/annotation/ContainedBy.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/annotation/ContainedBy.java	Tue Dec 18 16:14:59 2012 -0800
@@ -26,10 +26,35 @@
 package java.lang.annotation;
 
 /**
- * A meta-annotation to indicate which annotation type should be used
- * as a container for repeated values of the annotation type modified
- * by the {@code ContainedBy} annotation.
+ * The annotation type {@code java.lang.annotation.ContainedBy} is
+ * used to indicate that the annotation type whose declaration it
+ * (meta-)annotates is <em>repeatable</em>. The value of
+ * {@code @ContainedBy} indicates the <em>containing annotation
+ * type</em> for the repeatable annotation type.
  *
+ * <p>The pair of annotation types {@code @ContainedBy} and
+ * {@link java.lang.annotation.ContainerFor @ContainerFor} are used to
+ * indicate that annotation types are repeatable. Specifically:
+ *
+ * <ul>
+ * <li>The annotation type {@code @ContainedBy} is used on the
+ * declaration of a repeatable annotation type (JLS 9.6) to indicate
+ * its containing annotation type.
+ *
+ * <li>The annotation type {@code @ContainerFor} is used on the
+ * declaration of a containing annotation type (JLS 9.6) to indicate
+ * the repeatable annotation type for which it serves as the
+ * containing annotation type.
+ * </ul>
+ *
+ * <p>
+ * An inconsistent pair of {@code @ContainedBy} and
+ * {@code @ContainerFor} annotations on a repeatable annotation type
+ * and its containing annotation type (JLS 9.6) will lead to
+ * compile-time errors and runtime exceptions when using reflection to
+ * read annotations of a repeatable type.
+ *
+ * @see java.lang.annotation.ContainerFor
  * @since 1.8
  * @jls 9.6 Annotation Types
  * @jls 9.7 Annotations
@@ -39,8 +64,8 @@
 @Target(ElementType.ANNOTATION_TYPE)
 public @interface ContainedBy {
     /**
-     * The annotation type to use to store repeated values of another
-     * annotation.
+     * Indicates the <em>containing annotation type</em> for the
+     * repeatable annotation type.
      */
     Class<? extends Annotation> value();
 }
--- a/src/share/classes/java/lang/annotation/ContainerFor.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/annotation/ContainerFor.java	Tue Dec 18 16:14:59 2012 -0800
@@ -26,10 +26,36 @@
 package java.lang.annotation;
 
 /**
- * Indicates that an annotation type is a container for repeated
- * instances of annotations of the type of the value of the
- * {@code ContainerFor}'s value element.
+ * The annotation type {@code java.lang.annotation.ContainerFor} is
+ * used to indicate that the annotation type whose declaration it
+ * (meta-)annotates is a <em>containing annotation type</em>. The
+ * value of {@code @ContainerFor} indicates the <em>repeatable
+ * annotation type</em> for the containing annotation type.
  *
+ * <p>The pair of annotation types {@link
+ * java.lang.annotation.ContainedBy @ContainedBy} and
+ * {@code @ContainerFor} are used to indicate that annotation types
+ * are repeatable. Specifically:
+ *
+ * <ul>
+ * <li>The annotation type {@code @ContainedBy} is used on the
+ * declaration of a repeatable annotation type (JLS 9.6) to indicate
+ * its containing annotation type.
+ *
+ * <li>The annotation type {@code @ContainerFor} is used on the
+ * declaration of a containing annotation type (JLS 9.6) to indicate
+ * the repeatable annotation type for which it serves as the
+ * containing annotation type.
+ * </ul>
+ *
+ * <p>
+ * An inconsistent pair of {@code @ContainedBy} and
+ * {@code @ContainerFor} annotations on a repeatable annotation type
+ * and its containing annotation type (JLS 9.6) will lead to
+ * compile-time errors and runtime exceptions when using reflection to
+ * read annotations of a repeatable type.
+ *
+ * @see java.lang.annotation.ContainedBy
  * @since 1.8
  * @jls 9.6 Annotation Types
  * @jls 9.7 Annotations
@@ -38,9 +64,10 @@
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.ANNOTATION_TYPE)
 public @interface ContainerFor {
+
     /**
-     * The repeating annotation type that the annotation type
-     * annotated with this annotation is a container for.
+     * Indicates the repeatable annotation type for the containing
+     * annotation type.
      */
     Class<? extends Annotation> value();
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/lang/annotation/InvalidContainerAnnotationError.java	Tue Dec 18 16:14:59 2012 -0800
@@ -0,0 +1,129 @@
+/*
+ * 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 java.lang.annotation;
+
+import java.util.Objects;
+
+/**
+ * Thrown to indicate that an annotation type whose declaration is
+ * (meta-)annotated with a {@link ContainerFor} annotation is not, in
+ * fact, the <em>containing annotation type of the type named by {@link
+ * ContainerFor}</em>.
+ *
+ * @see   java.lang.reflect.AnnotatedElement
+ * @since 1.8
+ * @jls   9.6 Annotation Types
+ * @jls   9.7 Annotations
+ */
+public class InvalidContainerAnnotationError extends AnnotationFormatError {
+    private static final long serialVersionUID = 5023L;
+
+    /**
+     * The instance of the erroneous container.
+     */
+    private transient Annotation container;
+
+    /**
+     * The type of the annotation that should be contained in the
+     * container.
+     */
+    private transient Class<? extends Annotation> annotationType;
+
+    /**
+     * Constructs a new InvalidContainerAnnotationError with the
+     * specified detail message.
+     *
+     * @param  message the detail message.
+     */
+    public InvalidContainerAnnotationError(String message) {
+        super(message);
+    }
+
+    /**
+     * Constructs a new InvalidContainerAnnotationError with the specified
+     * detail message and cause.  Note that the detail message associated
+     * with {@code cause} is <i>not</i> automatically incorporated in
+     * this error's detail message.
+     *
+     * @param message the detail message
+     * @param cause the cause, may be {@code null}
+     */
+    public InvalidContainerAnnotationError(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /**
+     * Constructs a new InvalidContainerAnnotationError with the
+     * specified cause and a detail message of {@code (cause == null ?
+     * null : cause.toString())} (which typically contains the class
+     * and detail message of {@code cause}).
+     *
+     * @param cause the cause, may be {@code null}
+     */
+    public InvalidContainerAnnotationError(Throwable cause) {
+        super(cause);
+    }
+
+    /**
+     * Constructs InvalidContainerAnnotationError for the specified
+     * container instance and contained annotation type.
+     *
+     * @param  message the detail message
+     * @param  cause the cause, may be {@code null}
+     * @param container the erroneous container instance, may be
+     *        {@code null}
+     * @param annotationType the annotation type intended to be
+     *        contained, may be {@code null}
+     */
+    public InvalidContainerAnnotationError(String message,
+                                           Throwable cause,
+                                           Annotation container,
+                                           Class<? extends Annotation> annotationType) {
+        super(message, cause);
+        this.container = container;
+        this.annotationType = annotationType;
+    }
+
+    /**
+     * Returns the erroneous container.
+     *
+     * @return the erroneous container, may return {@code null}
+     */
+    public Annotation getContainer() {
+        return container;
+    }
+
+    /**
+     * Returns the annotation type intended to be contained. Returns
+     * {@code null} if the annotation type intended to be contained
+     * could not be determined.
+     *
+     * @return the annotation type intended to be contained, or {@code
+     * null} if unknown
+     */
+    public Class<? extends Annotation> getAnnotationType() {
+        return annotationType;
+    }
+}
--- a/src/share/classes/java/lang/invoke/BoundMethodHandle.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/invoke/BoundMethodHandle.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java	Tue Dec 18 16:14:59 2012 -0800
@@ -25,16 +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 java.util.logging.Level;
-import java.util.logging.Logger;
 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
@@ -121,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
@@ -145,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
@@ -187,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) {
                 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);
     }
 
@@ -206,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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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/invoke/MethodHandleNatives.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/invoke/MethodHandleNatives.java	Tue Dec 18 16:14:59 2012 -0800
@@ -448,7 +448,7 @@
         case "getDriver":
         case "getDrivers":
         case "deregisterDriver":
-            return defc == java.sql.DriverManager.class;
+            return defc == getClass("java.sql.DriverManager");
         case "newUpdater":
             if (defc == java.util.concurrent.atomic.AtomicIntegerFieldUpdater.class)  return true;
             if (defc == java.util.concurrent.atomic.AtomicLongFieldUpdater.class)  return true;
@@ -482,4 +482,14 @@
         }
         return false;
     }
+
+    // avoid static dependency to a class in other modules
+    private static Class<?> getClass(String cn) {
+        try {
+            return Class.forName(cn, false,
+                                 MethodHandleNatives.class.getClassLoader());
+        } catch (ClassNotFoundException e) {
+            throw new InternalError(e);
+        }
+    }
 }
--- a/src/share/classes/java/lang/reflect/AccessibleObject.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/reflect/AccessibleObject.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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
@@ -184,12 +184,19 @@
      * @throws NullPointerException {@inheritDoc}
      * @since 1.5
      */
-    public boolean isAnnotationPresent(
-        Class<? extends Annotation> annotationClass) {
+    public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) {
         return getAnnotation(annotationClass) != null;
     }
 
     /**
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    public <T extends Annotation> T[] getAnnotations(Class<T> annotationClass) {
+        throw new AssertionError("All subclasses should override this method");
+    }
+
+    /**
      * @since 1.5
      */
     public Annotation[] getAnnotations() {
@@ -197,6 +204,28 @@
     }
 
     /**
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    public <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass) {
+        // Only annotations on classes are inherited, for all other
+        // objects getDeclaredAnnotation is the same as
+        // getAnnotation.
+        return getAnnotation(annotationClass);
+    }
+
+    /**
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    public <T extends Annotation> T[] getDeclaredAnnotations(Class<T> annotationClass) {
+        // Only annotations on classes are inherited, for all other
+        // objects getDeclaredAnnotations is the same as
+        // getAnnotations.
+        return getAnnotations(annotationClass);
+    }
+
+    /**
      * @since 1.5
      */
     public Annotation[] getDeclaredAnnotations()  {
--- a/src/share/classes/java/lang/reflect/AnnotatedElement.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/reflect/AnnotatedElement.java	Tue Dec 18 16:14:59 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, 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
@@ -45,6 +45,11 @@
  * a {@link EnumConstantNotPresentException} if the enum constant in the
  * annotation is no longer present in the enum type.
  *
+ * <p>Attempting to read annotations of a repeatable annotation type T
+ * that are contained in an annotation whose type is not, in fact, the
+ * containing annotation type of T will result in an
+ * InvalidContainerAnnotationError.
+ *
  * <p>Finally, Attempting to read a member whose definition has evolved
  * incompatibly will result in a {@link
  * java.lang.annotation.AnnotationTypeMismatchException} or an
@@ -55,6 +60,7 @@
  * @see java.lang.annotation.AnnotationFormatError
  * @see java.lang.annotation.AnnotationTypeMismatchException
  * @see java.lang.annotation.IncompleteAnnotationException
+ * @see java.lang.annotation.InvalidContainerAnnotationError
  * @since 1.5
  * @author Josh Bloch
  */
@@ -87,6 +93,23 @@
     <T extends Annotation> T getAnnotation(Class<T> annotationClass);
 
     /**
+     * Returns an array of all this element's annotations for the
+     * specified type if one or more of such annotation is present,
+     * else an array of length zero.
+     *
+     * The caller of this method is free to modify the returned array;
+     * it will have no effect on the arrays returned to other callers.
+     *
+     * @param annotationClass the Class object corresponding to the
+     *        annotation type
+     * @return all this element's annotations for the specified annotation type if
+     *     present on this element, else an array of length zero
+     * @throws NullPointerException if the given annotation class is null
+     * @since 1.8
+     */
+    <T extends Annotation> T[] getAnnotations(Class<T> annotationClass);
+
+    /**
      * Returns all annotations present on this element.  (Returns an array
      * of length zero if this element has no annotations.)  The caller of
      * this method is free to modify the returned array; it will have no
@@ -98,12 +121,48 @@
     Annotation[] getAnnotations();
 
     /**
+     * Returns this element's annotation for the specified type if
+     * such an annotation is present, else null.
+     *
+     * This method ignores inherited annotations. (Returns null if no
+     * annotations are directly present on this element.)
+     *
+     * @param annotationClass the Class object corresponding to the
+     *        annotation type
+     * @return this element's annotation for the specified annotation type if
+     *     present on this element, else null
+     * @throws NullPointerException if the given annotation class is null
+     * @since 1.8
+     */
+    <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass);
+
+   /**
+     * Returns an array of all this element's annotations for the
+     * specified type if one or more of such annotation is directly
+     * present, else an array of length zero.
+     *
+     * This method ignores inherited annotations. (Returns
+     * an array of length zero if no annotations are directly present
+     * on this element.)  The caller of this method is free to modify
+     * the returned array; it will have no effect on the arrays
+     * returned to other callers.
+     *
+     * @param annotationClass the Class object corresponding to the
+     *        annotation type
+     * @return all this element's annotations for the specified annotation type if
+     *     present on this element, else an array of length zero
+     * @throws NullPointerException if the given annotation class is null
+     * @since 1.8
+     */
+    <T extends Annotation> T[] getDeclaredAnnotations(Class<T> annotationClass);
+
+    /**
      * Returns all annotations that are directly present on this
-     * element.  Unlike the other methods in this interface, this method
-     * ignores inherited annotations.  (Returns an array of length zero if
-     * no annotations are directly present on this element.)  The caller of
-     * this method is free to modify the returned array; it will have no
-     * effect on the arrays returned to other callers.
+     * element. This method ignores inherited annotations. (Returns
+     * an array of length zero if no annotations are directly present
+     * on this element.)  The caller of this method is free to modify
+     * the returned array; it will have no effect on the arrays
+     * returned to other callers.
      *
      * @return All annotations directly present on this element
      * @since 1.5
--- a/src/share/classes/java/lang/reflect/Executable.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/reflect/Executable.java	Tue Dec 18 16:14:59 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 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
@@ -26,8 +26,11 @@
 package java.lang.reflect;
 
 import java.lang.annotation.*;
+import java.util.Collections;
 import java.util.Map;
+import java.util.Objects;
 import sun.reflect.annotation.AnnotationParser;
+import sun.reflect.annotation.AnnotationSupport;
 import sun.reflect.generics.repository.ConstructorRepository;
 
 /**
@@ -363,19 +366,28 @@
      * {@inheritDoc}
      * @throws NullPointerException  {@inheritDoc}
      */
-    @SuppressWarnings("unchecked")
     public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
-        if (annotationClass == null)
-            throw new NullPointerException();
+        Objects.requireNonNull(annotationClass);
 
-        return (T) declaredAnnotations().get(annotationClass);
+        return AnnotationSupport.getOneAnnotation(declaredAnnotations(), annotationClass);
+    }
+
+    /**
+     * {@inheritDoc}
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    public <T extends Annotation> T[] getAnnotations(Class<T> annotationClass) {
+        Objects.requireNonNull(annotationClass);
+
+        return AnnotationSupport.getMultipleAnnotations(declaredAnnotations(), annotationClass);
     }
 
     /**
      * {@inheritDoc}
      */
     public Annotation[] getDeclaredAnnotations()  {
-        return AnnotationParser.toArray(declaredAnnotations());
+        return AnnotationSupport.unpackToArray(declaredAnnotations());
     }
 
     private transient Map<Class<? extends Annotation>, Annotation> declaredAnnotations;
--- a/src/share/classes/java/lang/reflect/Field.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/lang/reflect/Field.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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
@@ -33,7 +33,9 @@
 import sun.reflect.generics.scope.ClassScope;
 import java.lang.annotation.Annotation;
 import java.util.Map;
+import java.util.Objects;
 import sun.reflect.annotation.AnnotationParser;
+import sun.reflect.annotation.AnnotationSupport;
 
 
 /**
@@ -1012,19 +1014,28 @@
      * @throws NullPointerException {@inheritDoc}
      * @since 1.5
      */
-    @SuppressWarnings("unchecked")
     public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
-        if (annotationClass == null)
-            throw new NullPointerException();
+        Objects.requireNonNull(annotationClass);
 
-        return (T) declaredAnnotations().get(annotationClass);
+        return AnnotationSupport.getOneAnnotation(declaredAnnotations(), annotationClass);
     }
 
     /**
-     * @since 1.5
+     * {@inheritDoc}
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    public <T extends Annotation> T[] getAnnotations(Class<T> annotationClass) {
+        Objects.requireNonNull(annotationClass);
+
+        return AnnotationSupport.getMultipleAnnotations(declaredAnnotations(), annotationClass);
+    }
+
+    /**
+     * {@inheritDoc}
      */
     public Annotation[] getDeclaredAnnotations()  {
-        return AnnotationParser.toArray(declaredAnnotations());
+        return AnnotationSupport.unpackToArray(declaredAnnotations());
     }
 
     private transient Map<Class<? extends Annotation>, Annotation> declaredAnnotations;
--- a/src/share/classes/java/net/AbstractPlainSocketImpl.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/net/AbstractPlainSocketImpl.java	Tue Dec 18 16:14:59 2012 -0800
@@ -411,14 +411,13 @@
      * Gets an InputStream for this socket.
      */
     protected synchronized InputStream getInputStream() throws IOException {
-        if (isClosedOrPending()) {
-            throw new IOException("Socket Closed");
-        }
-        if (shut_rd) {
-            throw new IOException("Socket input is shutdown");
-        }
-        if (socketInputStream == null) {
-            socketInputStream = new SocketInputStream(this);
+        synchronized (fdLock) {
+            if (isClosedOrPending())
+                throw new IOException("Socket Closed");
+            if (shut_rd)
+                throw new IOException("Socket input is shutdown");
+            if (socketInputStream == null)
+                socketInputStream = new SocketInputStream(this);
         }
         return socketInputStream;
     }
@@ -431,14 +430,13 @@
      * Gets an OutputStream for this socket.
      */
     protected synchronized OutputStream getOutputStream() throws IOException {
-        if (isClosedOrPending()) {
-            throw new IOException("Socket Closed");
-        }
-        if (shut_wr) {
-            throw new IOException("Socket output is shutdown");
-        }
-        if (socketOutputStream == null) {
-            socketOutputStream = new SocketOutputStream(this);
+        synchronized (fdLock) {
+            if (isClosedOrPending())
+                throw new IOException("Socket Closed");
+            if (shut_wr)
+                throw new IOException("Socket output is shutdown");
+            if (socketOutputStream == null)
+                socketOutputStream = new SocketOutputStream(this);
         }
         return socketOutputStream;
     }
--- a/src/share/classes/java/net/HttpCookie.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/net/HttpCookie.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/net/Inet6Address.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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/NetPermission.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/net/NetPermission.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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
@@ -40,8 +40,8 @@
  * convention follows the  hierarchical property naming convention.
  * Also, an asterisk
  * may appear at the end of the name, following a ".", or by itself, to
- * signify a wildcard match. For example: "foo.*" or "*" is valid,
- * "*foo" or "a*b" is not valid.
+ * signify a wildcard match. For example: "foo.*" and "*" signify a wildcard
+ * match, while "*foo" and "a*b" do not.
  * <P>
  * The following table lists all the possible NetPermission target names,
  * and for each provides a description of what the permission allows
--- a/src/share/classes/java/net/doc-files/net-properties.html	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/net/doc-files/net-properties.html	Tue Dec 18 16:14:59 2012 -0800
@@ -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/BasicPermission.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/security/BasicPermission.java	Tue Dec 18 16:14:59 2012 -0800
@@ -46,8 +46,8 @@
  * convention follows the  hierarchical property naming convention.
  * An asterisk may appear by itself, or if immediately preceded by a "."
  * may appear at the end of the name, to signify a wildcard match.
- * For example, "*" and "java.*" are valid, while "*java", "a*b",
- * and "java*" are not valid.
+ * For example, "*" and "java.*" signify a wildcard match, while "*java", "a*b",
+ * and "java*" do not.
  * <P>
  * The action string (inherited from Permission) is unused.
  * Thus, BasicPermission is commonly used as the base class for
--- a/src/share/classes/java/security/KeyStore.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/security/KeyStore.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/security/Policy.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/security/Security.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/security/cert/CertPathBuilder.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/security/cert/CertPathValidator.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/security/cert/CertStore.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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/sql/SQLPermission.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/sql/SQLPermission.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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
@@ -49,8 +49,8 @@
  * In addition, an asterisk
  * may appear at the end of the name, following a ".", or by itself, to
  * signify a wildcard match. For example: <code>loadLibrary.*</code>
- * or <code>*</code> is valid,
- * but <code>*loadLibrary</code> or <code>a*b</code> is not valid.
+ * and <code>*</code> signify a wildcard match,
+ * while <code>*loadLibrary</code> and <code>a*b</code> do not.
  * <P>
  * The following table lists all the possible <code>SQLPermission</code> target names.
  * The table gives a description of what the permission allows
--- a/src/share/classes/java/text/DateFormatSymbols.java	Tue Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/text/DateFormatSymbols.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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 Dec 18 15:17:58 2012 +0000
+++ b/src/share/classes/java/text/SimpleDateFormat.java	Tue Dec 18 16:14:59 2012 -0800
@@ -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.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/util/Base64.java	Tue Dec 18 16:14:59 2012 -0800
@@ -0,0 +1,1316 @@
+/*
+ * 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 java.util;
+
+import java.io.FilterOutputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * This class consists exclusively of static methods for obtaining
+ * encoders and decoders for the Base64 encoding scheme. The
+ * implementation of this class supports the following types of Base64
+ * as specified in
+ * <a href="http://www.ietf.org/rfc/rfc4648.txt">RFC 4648</a> and
+ * <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>.
+ *
+ * <p>
+ * <ul>
+ * <a name="basic">
+ * <li><b>Basic</b>
+ * <p> Uses "The Base64 Alphabet" as specified in Table 1 of
+ *     RFC 4648 and RFC 2045 for encoding and decoding operation.
+ *     The encoder does not add any line feed (line separator)
+ *     character. The decoder rejects data that contains characters
+ *     outside the base64 alphabet.</p></li>
+ *
+ * <a name="url">
+ * <li><b>URL and Filename safe</b>
+ * <p> Uses the "URL and Filename safe Base64 Alphabet" as specified
+ *     in Table 2 of RFC 4648 for encoding and decoding. The
+ *     encoder does not add any line feed (line separator) character.
+ *     The decoder rejects data that contains characters outside the
+ *     base64 alphabet.</p></li>
+ *
+ * <a name="mime">
+ * <li><b>MIME</b>
+ * <p> Uses the "The Base64 Alphabet" as specified in Table 1 of
+ *     RFC 2045 for encoding and decoding operation. The encoded output
+ *     must be represented in lines of no more than 76 characters each
+ *     and uses a carriage return {@code '\r'} followed immediately by
+ *     a linefeed {@code '\n'} as the line separator. All line separators
+ *     or other characters not found in the base64 alphabet table are
+ *     ignored in decoding operation.</p></li>
+ * </ul>
+ *
+ * <p> Unless otherwise noted, passing a {@code null} argument to a
+ * method of this class will cause a {@link java.lang.NullPointerException
+ * NullPointerException} to be thrown.
+ *
+ * @author  Xueming Shen
+ * @since   1.8
+ */
+
+public class Base64 {
+
+    private Base64() {}
+
+    /**
+     * Returns a {@link Encoder} that encodes using the
+     * <a href="#basic">Basic</a> type base64 encoding scheme.
+     *
+     * @return  A Base64 encoder.
+     */
+    public static Encoder getEncoder() {
+         return Encoder.RFC4648;
+    }
+
+    /**
+     * Returns a {@link