changeset 4843:282b2ce90afe

Merge
author lana
date Fri, 16 Dec 2011 12:12:17 -0800
parents 032a91abc540 e55ac966ed95
children 75bd7295c706
files src/share/classes/java/beans/PropertyDescriptor.java src/share/native/java/util/zip/zlib-1.2.3/ChangeLog src/share/native/java/util/zip/zlib-1.2.3/README src/share/native/java/util/zip/zlib-1.2.3/compress.c src/share/native/java/util/zip/zlib-1.2.3/crc32.h src/share/native/java/util/zip/zlib-1.2.3/deflate.c src/share/native/java/util/zip/zlib-1.2.3/deflate.h src/share/native/java/util/zip/zlib-1.2.3/gzio.c src/share/native/java/util/zip/zlib-1.2.3/infback.c src/share/native/java/util/zip/zlib-1.2.3/inffast.c src/share/native/java/util/zip/zlib-1.2.3/inffast.h src/share/native/java/util/zip/zlib-1.2.3/inffixed.h src/share/native/java/util/zip/zlib-1.2.3/inflate.c src/share/native/java/util/zip/zlib-1.2.3/inflate.h src/share/native/java/util/zip/zlib-1.2.3/inftrees.c src/share/native/java/util/zip/zlib-1.2.3/inftrees.h src/share/native/java/util/zip/zlib-1.2.3/patches/ChangeLog_java src/share/native/java/util/zip/zlib-1.2.3/patches/crc32.c.diff src/share/native/java/util/zip/zlib-1.2.3/patches/inflate.c.diff src/share/native/java/util/zip/zlib-1.2.3/patches/zconf.h.diff src/share/native/java/util/zip/zlib-1.2.3/patches/zlib.h.diff src/share/native/java/util/zip/zlib-1.2.3/trees.c src/share/native/java/util/zip/zlib-1.2.3/trees.h src/share/native/java/util/zip/zlib-1.2.3/uncompr.c src/share/native/java/util/zip/zlib-1.2.3/zadler32.c src/share/native/java/util/zip/zlib-1.2.3/zconf.h src/share/native/java/util/zip/zlib-1.2.3/zcrc32.c src/share/native/java/util/zip/zlib-1.2.3/zlib.h src/share/native/java/util/zip/zlib-1.2.3/zutil.c src/share/native/java/util/zip/zlib-1.2.3/zutil.h test/java/util/ResourceBundle/Control/ExpirationTest.java test/java/util/ResourceBundle/Control/ExpirationTest.sh
diffstat 287 files changed, 16748 insertions(+), 14647 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Dec 13 18:38:39 2011 +0400
+++ b/.hgtags	Fri Dec 16 12:12:17 2011 -0800
@@ -136,3 +136,6 @@
 09fd2067f715e4505c44b01c301258a4e8f8964e jdk8-b12
 4cb2e8679b27432854690cb688ea06d3b2d8e008 jdk8-b13
 99632935785e2038b2fc836da9f2ede69dea294b jdk8-b14
+3c248d0e2c486624cc0d7aba1e4df45ae5774ff7 jdk8-b15
+b71d1acfae5240d8c1359443cd02b5ddb587231c jdk8-b17
+929597c6e777f742ad252660045ebaa4a3ea4772 jdk8-b16
--- a/make/common/Defs-embedded.gmk	Tue Dec 13 18:38:39 2011 +0400
+++ b/make/common/Defs-embedded.gmk	Fri Dec 16 12:12:17 2011 -0800
@@ -65,5 +65,12 @@
   NIO_PLATFORM_CLASSES_ROOT_DIR = $(CLOSED_PLATFORM_SRC)/classes/
 endif
 
+# For ARM sflt we need to link to a library with improved FP accuracy
+# and it must be linked after fdlibm - this places it at the end after libc
+# -z muldefs avoids linker errors for duplicate symbols.
+ifeq ($(CROSS_COMPILE_ARCH), arm)
+  EXTRA_LIBS +=  $(EXT_LIBS_PATH)/sflt_glibc_jdk.a -Xlinker -z -Xlinker muldefs
+endif
+
 endif # JAVASE_EMBEDDED
 
--- a/make/common/Defs.gmk	Tue Dec 13 18:38:39 2011 +0400
+++ b/make/common/Defs.gmk	Fri Dec 16 12:12:17 2011 -0800
@@ -202,7 +202,7 @@
 #
 # zlib version
 #
-ZLIB_VERSION = 1.2.3
+ZLIB_VERSION = 1.2.5
 
 
 #
--- a/make/common/Rules.gmk	Tue Dec 13 18:38:39 2011 +0400
+++ b/make/common/Rules.gmk	Fri Dec 16 12:12:17 2011 -0800
@@ -233,13 +233,15 @@
 	@$(MKDIR) -p $(CLASSDESTDIR)
 	@$(RM) $<.filtered
 	@$(CAT) $< | $(NAWK) 'length>0' | $(SORT) -u > $<.filtered
-	@if [ `$(CAT) $<.filtered | $(WC) -l` -ge 1 ] ; then \
-	  $(ECHO) "# Java sources to be compiled: (listed in file $<)"; \
-	  $(CAT) $<.filtered; \
-	  $(ECHO) "# Running javac:"; \
-	  $(ECHO) $(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$<.filtered; \
-	  $(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$<.filtered; \
-	fi
+	@numfiles=`$(WC) -l < $<.filtered` ; \
+	  if [ $$numfiles -ge 1 ] ; then \
+	    $(ECHO) "# Java sources to be compiled: (listed in file $<)"; \
+	    $(CAT) $<.filtered; \
+	    $(ECHO) "# Running javac: $$numfiles files; in $(CURDIR)"; \
+	    $(ECHO) $(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$<.filtered; \
+	    $(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$<.filtered; \
+	    $(ECHO) "# javac finished"; \
+	  fi
 	@$(java-vm-cleanup)
 
 clobber clean::
--- a/make/java/zip/FILES_c.gmk	Tue Dec 13 18:38:39 2011 +0400
+++ b/make/java/zip/FILES_c.gmk	Fri Dec 16 12:12:17 2011 -0800
@@ -32,7 +32,10 @@
 	zip_util.c \
 	compress.c \
 	deflate.c \
-	gzio.c \
+	gzclose.c \
+	gzlib.c \
+	gzread.c \
+	gzwrite.c \
 	infback.c \
 	inffast.c \
 	inflate.c \
--- a/make/java/zip/mapfile-vers	Tue Dec 13 18:38:39 2011 +0400
+++ b/make/java/zip/mapfile-vers	Fri Dec 16 12:12:17 2011 -0800
@@ -30,8 +30,10 @@
 		Java_java_util_jar_JarFile_getMetaInfEntryNames;
 		Java_java_util_zip_Adler32_update;
 		Java_java_util_zip_Adler32_updateBytes;
+		Java_java_util_zip_Adler32_updateByteBuffer;
 		Java_java_util_zip_CRC32_update;
 		Java_java_util_zip_CRC32_updateBytes;
+		Java_java_util_zip_CRC32_updateByteBuffer;
 		Java_java_util_zip_Deflater_deflateBytes;
 		Java_java_util_zip_Deflater_end;
 		Java_java_util_zip_Deflater_getAdler;
--- a/make/sun/splashscreen/FILES_c.gmk	Tue Dec 13 18:38:39 2011 +0400
+++ b/make/sun/splashscreen/FILES_c.gmk	Fri Dec 16 12:12:17 2011 -0800
@@ -51,7 +51,10 @@
 	gifalloc.c \
 	compress.c \
 	deflate.c \
-	gzio.c \
+	gzclose.c \
+	gzlib.c \
+	gzread.c \
+	gzwrite.c \
 	infback.c \
 	inffast.c \
 	inflate.c \
--- a/src/share/classes/com/sun/media/sound/JSSecurityManager.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/com/sun/media/sound/JSSecurityManager.java	Fri Dec 16 12:12:17 2011 -0800
@@ -34,15 +34,13 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
+import java.util.ServiceLoader;
 
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
 import javax.sound.sampled.AudioPermission;
 
-import sun.misc.Service;
-
-
 /** Managing security in the Java Sound implementation.
  * This class contains all code that uses and is used by
  * SecurityManager.doPrivileged().
@@ -80,8 +78,8 @@
         try {
             if (hasSecurityManager()) {
                 if(Printer.debug) Printer.debug("using security manager to load library");
-                PrivilegedAction action = new PrivilegedAction() {
-                        public Object run() {
+                PrivilegedAction<Void> action = new PrivilegedAction<Void>() {
+                        public Void run() {
                             System.loadLibrary(libName);
                             return null;
                         }
@@ -104,8 +102,8 @@
         if (hasSecurityManager()) {
             if(Printer.debug) Printer.debug("using JDK 1.2 security to get property");
             try{
-                PrivilegedAction action = new PrivilegedAction() {
-                        public Object run() {
+                PrivilegedAction<String> action = new PrivilegedAction<String>() {
+                        public String run() {
                             try {
                                 return System.getProperty(propertyName);
                             } catch (Throwable t) {
@@ -113,7 +111,7 @@
                             }
                         }
                     };
-                propertyValue = (String) AccessController.doPrivileged(action);
+                propertyValue = AccessController.doPrivileged(action);
             } catch( Exception e ) {
                 if(Printer.debug) Printer.debug("not using JDK 1.2 security to get properties");
                 propertyValue = System.getProperty(propertyName);
@@ -142,8 +140,8 @@
         if(hasSecurityManager()) {
             try {
                 // invoke the privileged action using 1.2 security
-                PrivilegedAction action = new PrivilegedAction() {
-                        public Object run() {
+                PrivilegedAction<Void> action = new PrivilegedAction<Void>() {
+                        public Void run() {
                             loadPropertiesImpl(properties, filename);
                             return null;
                         }
@@ -197,8 +195,8 @@
         if(hasSecurityManager()) {
             try {
                 // invoke the privileged action using 1.2 security
-                PrivilegedAction action = new PrivilegedAction() {
-                        public Object run() {
+                PrivilegedAction<ThreadGroup> action = new PrivilegedAction<ThreadGroup>() {
+                        public ThreadGroup run() {
                             try {
                                 return getTopmostThreadGroupImpl();
                             } catch (Throwable t) {
@@ -206,7 +204,7 @@
                             }
                         }
                     };
-                topmostThreadGroup = (ThreadGroup) AccessController.doPrivileged(action);
+                topmostThreadGroup = AccessController.doPrivileged(action);
                 if(Printer.debug)Printer.debug("Got topmost thread group with JDK 1.2 security");
             } catch (Exception e) {
                 if(Printer.debug)Printer.debug("Exception getting topmost thread group with JDK 1.2 security");
@@ -240,8 +238,8 @@
                                final boolean doStart) {
         Thread thread = null;
         if(hasSecurityManager()) {
-            PrivilegedAction action = new PrivilegedAction() {
-                    public Object run() {
+            PrivilegedAction<Thread> action = new PrivilegedAction<Thread>() {
+                    public Thread run() {
                         try {
                             return createThreadImpl(runnable, threadName,
                                                     isDaemon, priority,
@@ -251,7 +249,7 @@
                         }
                     }
                 };
-            thread = (Thread) AccessController.doPrivileged(action);
+            thread = AccessController.doPrivileged(action);
             if(Printer.debug) Printer.debug("created thread with JDK 1.2 security");
         } else {
             if(Printer.debug)Printer.debug("not using JDK 1.2 security");
@@ -282,11 +280,11 @@
     }
 
 
-    static List getProviders(final Class providerClass) {
-        List p = new ArrayList();
-        // Service.providers(Class) just creates "lazy" iterator instance,
-        // so it doesn't require do be called from privileged section
-        final Iterator ps = Service.providers(providerClass);
+    static <T> List<T> getProviders(final Class<T> providerClass) {
+        List<T> p = new ArrayList<>();
+        // ServiceLoader creates "lazy" iterator instance, so it doesn't,
+        // require do be called from privileged section
+        final Iterator<T> ps = ServiceLoader.load(providerClass).iterator();
 
         // the iterator's hasNext() method looks through classpath for
         // the provider class names, so it requires read permissions
@@ -301,7 +299,7 @@
                 // the iterator's next() method creates instances of the
                 // providers and it should be called in the current security
                 // context
-                Object provider = ps.next();
+                T provider = ps.next();
                 if (providerClass.isInstance(provider)) {
                     // $$mp 2003-08-22
                     // Always adding at the beginning reverses the
--- a/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java	Fri Dec 16 12:12:17 2011 -0800
@@ -25,50 +25,58 @@
 
 package com.sun.net.httpserver.spi;
 
-import java.io.FileDescriptor;
 import java.io.IOException;
 import java.net.*;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Iterator;
-import sun.misc.Service;
-import sun.misc.ServiceConfigurationError;
-import sun.security.action.GetPropertyAction;
+import java.util.ServiceLoader;
+import java.util.ServiceConfigurationError;
 import com.sun.net.httpserver.*;
 
 /**
  * Service provider class for HttpServer.
- * Sub-classes of HttpServerProvider provide an implementation of {@link HttpServer} and
- * associated classes. Applications do not normally use this class.
- * See {@link #provider()} for how providers are found and loaded.
+ * Sub-classes of HttpServerProvider provide an implementation of
+ * {@link HttpServer} and associated classes. Applications do not normally use
+ * this class. See {@link #provider()} for how providers are found and loaded.
  */
 public abstract class HttpServerProvider {
 
     /**
      * creates a HttpServer from this provider
-     * @param addr the address to bind to. May be <code>null</code>
-     * @param backlog the socket backlog. A value of <code>zero</code> means the systems default
+     *
+     * @param  addr
+     *         the address to bind to. May be {@code null}
+     *
+     * @param  backlog
+     *         the socket backlog. A value of {@code zero} means the systems default
      */
-    public abstract HttpServer createHttpServer (InetSocketAddress addr, int backlog) throws IOException;
+    public abstract HttpServer createHttpServer(InetSocketAddress addr,
+                                                int backlog)
+        throws IOException;
 
     /**
      * creates a HttpsServer from this provider
-     * @param addr the address to bind to. May be <code>null</code>
-     * @param backlog the socket backlog. A value of <code>zero</code> means the systems default
+     *
+     * @param  addr
+     *         the address to bind to. May be {@code null}
+     *
+     * @param  backlog
+     *         the socket backlog. A value of {@code zero} means the systems default
      */
-    public abstract HttpsServer createHttpsServer (InetSocketAddress addr, int backlog) throws IOException;
-
-
+    public abstract HttpsServer createHttpsServer(InetSocketAddress addr,
+                                                  int backlog)
+        throws IOException;
 
     private static final Object lock = new Object();
     private static HttpServerProvider provider = null;
 
     /**
-     * Initializes a new instance of this class.  </p>
+     * Initializes a new instance of this class.
      *
      * @throws  SecurityException
      *          If a security manager has been installed and it denies
-     *          {@link RuntimePermission}<tt>("httpServerProvider")</tt>
+     *          {@link RuntimePermission}{@code("httpServerProvider")}
      */
     protected HttpServerProvider() {
         SecurityManager sm = System.getSecurityManager();
@@ -82,21 +90,22 @@
             return false;
         try {
             Class<?> c = Class.forName(cn, true,
-                                    ClassLoader.getSystemClassLoader());
+                                       ClassLoader.getSystemClassLoader());
             provider = (HttpServerProvider)c.newInstance();
             return true;
         } catch (ClassNotFoundException |
                  IllegalAccessException |
                  InstantiationException |
                  SecurityException x) {
-            throw new ServiceConfigurationError(x);
+            throw new ServiceConfigurationError(null, x);
         }
     }
 
     private static boolean loadProviderAsService() {
-        @SuppressWarnings("unchecked")
-        Iterator<HttpServerProvider> i = Service.providers(HttpServerProvider.class,
-                                       ClassLoader.getSystemClassLoader());
+        Iterator<HttpServerProvider> i =
+            ServiceLoader.load(HttpServerProvider.class,
+                               ClassLoader.getSystemClassLoader())
+                .iterator();
         for (;;) {
             try {
                 if (!i.hasNext())
@@ -123,19 +132,19 @@
      * <ol>
      *
      *   <li><p> If the system property
-     *   <tt>com.sun.net.httpserver.HttpServerProvider</tt> is defined then it is
-     *   taken to be the fully-qualified name of a concrete provider class.
+     *   {@code com.sun.net.httpserver.HttpServerProvider} is defined then it
+     *   is taken to be the fully-qualified name of a concrete provider class.
      *   The class is loaded and instantiated; if this process fails then an
      *   unspecified unchecked error or exception is thrown.  </p></li>
      *
      *   <li><p> If a provider class has been installed in a jar file that is
      *   visible to the system class loader, and that jar file contains a
      *   provider-configuration file named
-     *   <tt>com.sun.net.httpserver.HttpServerProvider</tt> in the resource
+     *   {@code com.sun.net.httpserver.HttpServerProvider} in the resource
      *   directory <tt>META-INF/services</tt>, then the first class name
      *   specified in that file is taken.  The class is loaded and
-     *   instantiated; if this process fails then an unspecified unchecked error or exception is
-     *   thrown.  </p></li>
+     *   instantiated; if this process fails then an unspecified unchecked error
+     *   or exception is thrown.  </p></li>
      *
      *   <li><p> Finally, if no provider has been specified by any of the above
      *   means then the system-default provider class is instantiated and the
--- a/src/share/classes/com/sun/rowset/CachedRowSetImpl.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/com/sun/rowset/CachedRowSetImpl.java	Fri Dec 16 12:12:17 2011 -0800
@@ -357,7 +357,7 @@
 
         // set the Reader, this maybe overridden latter
         provider =
-        (SyncProvider)SyncFactory.getInstance(DEFAULT_SYNC_PROVIDER);
+        SyncFactory.getInstance(DEFAULT_SYNC_PROVIDER);
 
         if (!(provider instanceof RIOptimisticProvider)) {
             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidp").toString());
@@ -445,11 +445,10 @@
      * @param env a <code>Hashtable</code> object with a list of desired
      *        synchronization providers
      * @throws SQLException if the requested provider cannot be found by the
-     * synchonization factory
+     * synchronization factory
      * @see SyncProvider
      */
-
-    public CachedRowSetImpl(Hashtable env) throws SQLException {
+    public CachedRowSetImpl(@SuppressWarnings("rawtypes") Hashtable env) throws SQLException {
 
 
         try {
@@ -467,7 +466,7 @@
 
         // set the Reader, this maybe overridden latter
         provider =
-        (SyncProvider)SyncFactory.getInstance(providerName);
+        SyncFactory.getInstance(providerName);
 
         rowSetReader = provider.getRowSetReader();
         rowSetWriter = provider.getRowSetWriter();
@@ -525,7 +524,7 @@
 
         iMatchColumns = new Vector<Integer>(10);
         for(int i = 0; i < 10 ; i++) {
-           iMatchColumns.add(i,Integer.valueOf(-1));
+           iMatchColumns.add(i, -1);
         }
 
         strMatchColumns = new Vector<String>(10);
@@ -540,7 +539,7 @@
      */
     private void checkTransactionalWriter() {
         if (rowSetWriter != null) {
-            Class c = rowSetWriter.getClass();
+            Class<?> c = rowSetWriter.getClass();
             if (c != null) {
                 Class[] theInterfaces = c.getInterfaces();
                 for (int i = 0; i < theInterfaces.length; i++) {
@@ -685,7 +684,7 @@
                         obj = new SerialArray((java.sql.Array)obj);
                 }
 
-                ((Row)currentRow).initColumnObject(i, obj);
+                currentRow.initColumnObject(i, obj);
             }
             rowsFetched++;
             rvh.add(currentRow);
@@ -881,7 +880,7 @@
                 cursorPos = saveCursorPos;
             }
 
-            if ((tXWriter) && this.COMMIT_ON_ACCEPT_CHANGES) {
+            if (tXWriter) {
                 // do commit/rollback's here
                 if (!conflict) {
                     tWriter = (TransactionalWriter)rowSetWriter;
@@ -901,7 +900,7 @@
 
             if (success == true) {
                 setOriginal();
-            } else if (!(success) && !(this.COMMIT_ON_ACCEPT_CHANGES)) {
+            } else if (!(success) ) {
                 throw new SyncProviderException(resBundle.handleGetObject("cachedrowsetimpl.accfailed").toString());
             }
 
@@ -938,10 +937,8 @@
      * @see javax.sql.rowset.spi.SyncProvider
      */
     public void acceptChanges(Connection con) throws SyncProviderException{
-
       setConnection(con);
       acceptChanges();
-
     }
 
     /**
@@ -957,7 +954,7 @@
      */
     public void restoreOriginal() throws SQLException {
         Row currentRow;
-        for (Iterator i = rvh.iterator(); i.hasNext();) {
+        for (Iterator<?> i = rvh.iterator(); i.hasNext();) {
             currentRow = (Row)i.next();
             if (currentRow.getInserted() == true) {
                 i.remove();
@@ -1287,7 +1284,7 @@
         TreeMap<Integer, Object> tMap = new TreeMap<>();
 
         for (int i = 0; i<numRows; i++) {
-            tMap.put(Integer.valueOf(i), rvh.get(i));
+            tMap.put(i, rvh.get(i));
         }
 
         return (tMap.values());
@@ -1379,7 +1376,7 @@
      */
     public void setSyncProvider(String providerStr) throws SQLException {
         provider =
-        (SyncProvider)SyncFactory.getInstance(providerStr);
+        SyncFactory.getInstance(providerStr);
 
         rowSetReader = provider.getRowSetReader();
         rowSetWriter = provider.getRowSetWriter();
@@ -1880,7 +1877,7 @@
         // check for SQL NULL
         if (value == null) {
             setLastValueNull(true);
-            return (int)0;
+            return 0;
         }
 
         try {
@@ -2353,7 +2350,7 @@
             throw new SQLException(ex.getMessage());
         }
 
-        return (java.io.InputStream)asciiStream;
+        return asciiStream;
     }
 
     /**
@@ -2399,7 +2396,7 @@
 
         unicodeStream = new StringBufferInputStream(value.toString());
 
-        return (java.io.InputStream)unicodeStream;
+        return unicodeStream;
     }
 
     /**
@@ -2454,7 +2451,7 @@
 
         binaryStream = new ByteArrayInputStream((byte[])value);
 
-        return (java.io.InputStream)binaryStream;
+        return binaryStream;
 
     }
 
@@ -2958,7 +2955,7 @@
             Struct s = (Struct)value;
             map = getTypeMap();
             // look up the class in the map
-            Class c = (Class)map.get(s.getSQLTypeName());
+            Class<?> c = map.get(s.getSQLTypeName());
             if (c != null) {
                 // create new instance of the class
                 SQLData obj = null;
@@ -3091,7 +3088,7 @@
             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
         }
 
-        return (java.io.Reader)charStream;
+        return charStream;
     }
 
     /**
@@ -4006,7 +4003,7 @@
             switch (trgType) {
                 case java.sql.Types.BIT:
                     Integer i = Integer.valueOf(srcObj.toString().trim());
-                    return i.equals(Integer.valueOf((int)0)) ?
+                    return i.equals(0) ?
                     Boolean.valueOf(false) :
                         Boolean.valueOf(true);
                 case java.sql.Types.TINYINT:
@@ -4173,7 +4170,7 @@
             switch (trgType) {
                 case java.sql.Types.BIT:
                     Integer i = Integer.valueOf(srcObj.toString().trim());
-                    return i.equals(Integer.valueOf((int)0)) ?
+                    return i.equals(0) ?
                     Boolean.valueOf(false) :
                         Boolean.valueOf(true);
                 case java.sql.Types.BOOLEAN:
@@ -4358,7 +4355,7 @@
         checkIndex(columnIndex);
         // make sure the cursor is on a valid row
         checkCursor();
-        Object obj = convertNumeric(Integer.valueOf(x),
+        Object obj = convertNumeric(x,
         java.sql.Types.INTEGER,
         RowSetMD.getColumnType(columnIndex));
 
@@ -5709,7 +5706,7 @@
             Struct s = (Struct)value;
 
             // look up the class in the map
-            Class c = (Class)map.get(s.getSQLTypeName());
+            Class<?> c = map.get(s.getSQLTypeName());
             if (c != null) {
                 // create new instance of the class
                 SQLData obj = null;
@@ -6293,7 +6290,7 @@
         int colCount = RowSetMD.getColumnCount();
         Row orig;
 
-        for (Iterator i = rvh.iterator(); i.hasNext();) {
+        for (Iterator<?> i = rvh.iterator(); i.hasNext();) {
             orig = new Row(colCount, ((Row)i.next()).getOrigRow());
             crs.rvh.add(orig);
         }
@@ -6379,7 +6376,7 @@
      * @throws SQLException if an error occurs
      */
     public void setOriginal() throws SQLException {
-        for (Iterator i = rvh.iterator(); i.hasNext();) {
+        for (Iterator<?> i = rvh.iterator(); i.hasNext();) {
             Row row = (Row)i.next();
             makeRowOriginal(row);
             // remove deleted rows from the collection.
@@ -6930,7 +6927,7 @@
          }
 
          for( int i = 0;i < columnIdxes.length ;i++) {
-            iMatchColumns.set(i,Integer.valueOf(-1));
+            iMatchColumns.set(i, -1);
          }
     }
 
@@ -6998,7 +6995,7 @@
         int [] i_temp = new int[iMatchColumns.size()];
         int i_val;
 
-        i_val = ((Integer)iMatchColumns.get(0)).intValue();
+        i_val = iMatchColumns.get(0);
 
         if( i_val == -1 ) {
            throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.setmatchcols").toString());
@@ -7039,7 +7036,7 @@
            }
         }
         for(int i = 0 ;i < columnIdxes.length; i++) {
-           iMatchColumns.add(i,Integer.valueOf(columnIdxes[i]));
+           iMatchColumns.add(i,columnIdxes[i]);
         }
     }
 
@@ -7094,7 +7091,7 @@
             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols1").toString());
         } else {
             // set iMatchColumn
-            iMatchColumns.set(0, Integer.valueOf(columnIdx));
+            iMatchColumns.set(0, columnIdx);
             //strMatchColumn = null;
         }
     }
@@ -7147,7 +7144,7 @@
             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch1").toString());
         } else {
                 // that is, we are unsetting it.
-               iMatchColumns.set(0, Integer.valueOf(-1));
+               iMatchColumns.set(0, -1);
         }
     }
 
@@ -7171,7 +7168,7 @@
 
         if(!((strMatchColumns.get(0)).equals(columnName))) {
             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch").toString());
-        } else if( ((Integer)(iMatchColumns.get(0))).intValue() > 0) {
+        } else if(iMatchColumns.get(0) > 0) {
             throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch2").toString());
         } else {
             strMatchColumns.set(0, null);   // that is, we are unsetting it.
@@ -7369,7 +7366,7 @@
                     obj = new SerialArray((java.sql.Array)obj, map);
                 }
 
-                ((Row)currentRow).initColumnObject(i, obj);
+                currentRow.initColumnObject(i, obj);
             }
             rowsFetched++;
             maxRowsreached++;
--- a/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java	Fri Dec 16 12:12:17 2011 -0800
@@ -66,6 +66,7 @@
      * @param env a Hashtable containing a desired synchconizatation provider
      * name-value pair.
      */
+    @SuppressWarnings("rawtypes")
     public FilteredRowSetImpl(Hashtable env) throws SQLException {
         super(env);
     }
--- a/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java	Fri Dec 16 12:12:17 2011 -0800
@@ -695,6 +695,7 @@
         return ps;
     }
 
+    @SuppressWarnings("deprecation")
     private void decodeParams(Object[] params, PreparedStatement ps)
     throws SQLException {
 
@@ -761,14 +762,17 @@
                             ps.setUnicodeStream(i + 1,
                                                 (java.io.InputStream)param[0],
                                                 ((Integer)param[1]).intValue());
+                            break;
                         case JdbcRowSetImpl.BINARY_STREAM_PARAM:
                             ps.setBinaryStream(i + 1,
                                                (java.io.InputStream)param[0],
                                                ((Integer)param[1]).intValue());
+                            break;
                         case JdbcRowSetImpl.ASCII_STREAM_PARAM:
                             ps.setAsciiStream(i + 1,
                                               (java.io.InputStream)param[0],
                                               ((Integer)param[1]).intValue());
+                            break;
                         default:
                             throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.paramtype").toString());
                         }
@@ -3822,7 +3826,7 @@
         int [] i_temp = new int[iMatchColumns.size()];
         int i_val;
 
-        i_val = ((Integer)iMatchColumns.get(0)).intValue();
+        i_val = iMatchColumns.get(0);
 
         if( i_val == -1 ) {
            throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.setmatchcols").toString());
@@ -3996,7 +4000,7 @@
 
         if(!((strMatchColumns.get(0)).equals(columnName))) {
             throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.unsetmatch").toString());
-        } else if( ((Integer)(iMatchColumns.get(0))).intValue() > 0) {
+        } else if(iMatchColumns.get(0) > 0) {
             throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.usecolid").toString());
         } else {
             strMatchColumns.set(0, null);   // that is, we are unsetting it.
--- a/src/share/classes/com/sun/rowset/JdbcRowSetResourceBundle.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/com/sun/rowset/JdbcRowSetResourceBundle.java	Fri Dec 16 12:12:17 2011 -0800
@@ -135,6 +135,7 @@
      * @return an enumeration of keys which have messages tranlated to
      * corresponding locales.
      */
+    @SuppressWarnings("rawtypes")
     public Enumeration getKeys() {
        return propResBundle.getKeys();
     }
--- a/src/share/classes/com/sun/rowset/JoinRowSetImpl.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/com/sun/rowset/JoinRowSetImpl.java	Fri Dec 16 12:12:17 2011 -0800
@@ -233,7 +233,7 @@
               }
               int[] indexes = new int[indices.size()];
               for(int i=0; i<indices.size();i++)
-                  indexes[i] = ((Integer)indices.get(i)).intValue();
+                  indexes[i] = indices.get(i);
               cRowset.setMatchColumn(indexes);
               // Set the match column here because join will be
               // based on columnId,
@@ -413,6 +413,7 @@
      * @throws SQLException if an error occours generating a collection
      * of the originating RowSets contained within the JOIN.
      */
+    @SuppressWarnings("rawtypes")
     public Collection getRowSets() throws SQLException {
         return vecRowSetsInJOIN;
     }
@@ -893,7 +894,7 @@
 
        sz = vecRowSetsInJOIN.size();
        for(int i=0;i<sz; i++) {
-          crs = (CachedRowSetImpl)vecRowSetsInJOIN.get(i);
+          crs = vecRowSetsInJOIN.get(i);
           cols = crs.getMetaData().getColumnCount();
           tabName = tabName.concat(crs.getTableName());
           strTabName = strTabName.concat(tabName+", ");
@@ -928,7 +929,7 @@
         // rowset1.getMatchColumnName() == rowset2.getMatchColumnName()
          for(int i=0;i<sz; i++) {
              strWhereClause = strWhereClause.concat(
-               ((CachedRowSetImpl)vecRowSetsInJOIN.get(i)).getMatchColumnNames()[0]);
+               vecRowSetsInJOIN.get(i).getMatchColumnNames()[0]);
              if(i%2!=0) {
                strWhereClause = strWhereClause.concat("=");
              }  else {
@@ -4175,7 +4176,7 @@
             // Default JoinRowSet type
             this.setJoinType(JoinRowSet.INNER_JOIN);
         }
-        Integer i = (Integer)(vecJoinType.get(vecJoinType.size()-1));
+        Integer i = vecJoinType.get(vecJoinType.size()-1);
         return i.intValue();
     }
 
--- a/src/share/classes/com/sun/rowset/WebRowSetImpl.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/com/sun/rowset/WebRowSetImpl.java	Fri Dec 16 12:12:17 2011 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -101,6 +101,7 @@
      * synchronization providers for the relational and XML providers; or
      * if the Hashtanle is null
      */
+    @SuppressWarnings("rawtypes")
     public WebRowSetImpl(Hashtable env) throws SQLException {
 
         try {
@@ -117,7 +118,7 @@
             (String)env.get(javax.sql.rowset.spi.SyncFactory.ROWSET_SYNC_PROVIDER);
 
         // set the Reader, this maybe overridden latter
-        provider = (SyncProvider)SyncFactory.getInstance(providerName);
+        provider = SyncFactory.getInstance(providerName);
 
         // xmlReader = provider.getRowSetReader();
         // xmlWriter = provider.getRowSetWriter();
--- a/src/share/classes/com/sun/rowset/internal/CachedRowSetReader.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/com/sun/rowset/internal/CachedRowSetReader.java	Fri Dec 16 12:12:17 2011 -0800
@@ -363,6 +363,7 @@
      *               the given parameters are to be set
      * @throws SQLException if an access error occurs
      */
+    @SuppressWarnings("deprecation")
     private void decodeParams(Object[] params,
                               PreparedStatement pstmt) throws SQLException {
     // There is a corresponding decodeParams in JdbcRowSetImpl
@@ -428,14 +429,17 @@
                             pstmt.setUnicodeStream(i + 1,
                                                 (java.io.InputStream)param[0],
                                                 ((Integer)param[1]).intValue());
+                            break;
                         case CachedRowSetImpl.BINARY_STREAM_PARAM:
                             pstmt.setBinaryStream(i + 1,
                                                (java.io.InputStream)param[0],
                                                ((Integer)param[1]).intValue());
+                            break;
                         case CachedRowSetImpl.ASCII_STREAM_PARAM:
                             pstmt.setAsciiStream(i + 1,
                                               (java.io.InputStream)param[0],
                                               ((Integer)param[1]).intValue());
+                            break;
                         default:
                             throw new SQLException(resBundle.handleGetObject("crsreader.paramtype").toString());
                         }
--- a/src/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java	Fri Dec 16 12:12:17 2011 -0800
@@ -183,7 +183,7 @@
 /**
  * This <code>ArrayList<code> will hold the values of SyncResolver.*
  */
-    private ArrayList status;
+    private ArrayList<Integer> status;
 
 /**
  * This will check whether the same field value has changed both
@@ -305,7 +305,7 @@
 
         iColCount = rsmdWrite.getColumnCount();
         int sz= crs.size()+1;
-        status = new ArrayList(sz);
+        status = new ArrayList<>(sz);
 
         status.add(0,null);
         rsmdResolv.setColumnCount(iColCount);
@@ -338,11 +338,11 @@
             if (crs.rowDeleted()) {
                 // The row has been deleted.
                 if (conflict = (deleteOriginalRow(crs, this.crsResolve)) == true) {
-                       status.add(rows, Integer.valueOf(SyncResolver.DELETE_ROW_CONFLICT));
+                       status.add(rows, SyncResolver.DELETE_ROW_CONFLICT);
                 } else {
                       // delete happened without any occurrence of conflicts
                       // so update status accordingly
-                       status.add(rows, Integer.valueOf(SyncResolver.NO_ROW_CONFLICT));
+                       status.add(rows, SyncResolver.NO_ROW_CONFLICT);
                 }
 
            } else if (crs.rowInserted()) {
@@ -350,20 +350,20 @@
 
                 pstmtIns = con.prepareStatement(insertCmd);
                 if ( (conflict = insertNewRow(crs, pstmtIns, this.crsResolve)) == true) {
-                          status.add(rows, Integer.valueOf(SyncResolver.INSERT_ROW_CONFLICT));
+                          status.add(rows, SyncResolver.INSERT_ROW_CONFLICT);
                 } else {
                       // insert happened without any occurrence of conflicts
                       // so update status accordingly
-                       status.add(rows, Integer.valueOf(SyncResolver.NO_ROW_CONFLICT));
+                       status.add(rows, SyncResolver.NO_ROW_CONFLICT);
                 }
             } else  if (crs.rowUpdated()) {
                   // The row has been updated.
                        if ( conflict = (updateOriginalRow(crs)) == true) {
-                             status.add(rows, Integer.valueOf(SyncResolver.UPDATE_ROW_CONFLICT));
+                             status.add(rows, SyncResolver.UPDATE_ROW_CONFLICT);
                } else {
                       // update happened without any occurrence of conflicts
                       // so update status accordingly
-                      status.add(rows, Integer.valueOf(SyncResolver.NO_ROW_CONFLICT));
+                      status.add(rows, SyncResolver.NO_ROW_CONFLICT);
                }
 
             } else {
@@ -375,7 +375,7 @@
                 *  that is fine.
                 **/
                 int icolCount = crs.getMetaData().getColumnCount();
-                status.add(rows, Integer.valueOf(SyncResolver.NO_ROW_CONFLICT));
+                status.add(rows, SyncResolver.NO_ROW_CONFLICT);
 
                 this.crsResolve.moveToInsertRow();
                 for(int cols=0;cols<iColCount;cols++) {
@@ -398,7 +398,7 @@
       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(Integer.valueOf(SyncResolver.NO_ROW_CONFLICT)))) {
+          if(! ((status.get(j)).equals(SyncResolver.NO_ROW_CONFLICT))) {
               // there is at least one conflict which needs to be resolved
               boolConf = true;
              break;
@@ -540,7 +540,7 @@
 
                 // how many fields need to be updated
                 int colsNotChanged = 0;
-                Vector cols = new Vector();
+                Vector<Integer> cols = new Vector<>();
                 String updateExec = updateCmd;
                 Object orig;
                 Object curr;
@@ -566,14 +566,14 @@
                  * into a CachedRowSet so that comparison of the column values
                  * from the ResultSet and CachedRowSet are possible
                  */
-                Map map = (crs.getTypeMap() == null)?con.getTypeMap():crs.getTypeMap();
+                Map<String, Class<?>> map = (crs.getTypeMap() == null)?con.getTypeMap():crs.getTypeMap();
                 if (rsval instanceof Struct) {
 
                     Struct s = (Struct)rsval;
 
                     // look up the class in the map
-                    Class c = null;
-                    c = (Class)map.get(s.getSQLTypeName());
+                    Class<?> c = null;
+                    c = map.get(s.getSQLTypeName());
                     if (c != null) {
                         // create new instance of the class
                         SQLData obj = null;
@@ -652,7 +652,7 @@
                           updateExec += ", ";
                          }
                         updateExec += crs.getMetaData().getColumnName(i);
-                        cols.add(Integer.valueOf(i));
+                        cols.add(i);
                         updateExec += " = ? ";
                         first = false;
 
@@ -698,7 +698,7 @@
                                     updateExec += ", ";
                                  }
                                 updateExec += crs.getMetaData().getColumnName(i);
-                                cols.add(Integer.valueOf(i));
+                                cols.add(i);
                                 updateExec += " = ? ";
                                 flag = false;
                              } else {
@@ -749,7 +749,7 @@
 
                 // Comments needed here
                 for (i = 0; i < cols.size(); i++) {
-                    Object obj = crs.getObject(((Integer)cols.get(i)).intValue());
+                    Object obj = crs.getObject(cols.get(i));
                     if (obj != null)
                         pstmt.setObject(i + 1, obj);
                     else
--- a/src/share/classes/com/sun/rowset/internal/Row.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/com/sun/rowset/internal/Row.java	Fri Dec 16 12:12:17 2011 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,9 +27,7 @@
 
 import java.sql.*;
 import java.io.*;
-import java.math.*;
 import java.lang.*;
-import java.lang.reflect.*;
 import java.util.*;
 
 /**
@@ -48,6 +46,8 @@
  */
 public class Row extends BaseRow implements Serializable, Cloneable {
 
+static final long serialVersionUID = 5047859032611314762L;
+
 /**
  * An array containing the current column values for this <code>Row</code>
  * object.
@@ -115,9 +115,7 @@
  */
     public Row(int numCols, Object[] vals) {
         origVals = new Object[numCols];
-        for (int i=0; i < numCols; i++) {
-            origVals[i] = vals[i];
-        }
+        System.arraycopy(vals, 0, origVals, 0, numCols);
         currentVals = new Object[numCols];
         colsChanged = new BitSet(numCols);
         this.numCols = numCols;
--- a/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/com/sun/rowset/internal/SyncResolverImpl.java	Fri Dec 16 12:12:17 2011 -0800
@@ -65,7 +65,7 @@
      *  This ArrayList will contain the status of a row
      *  from the SyncResolver.* values else it will be null.
      */
-    private ArrayList stats;
+    private ArrayList<?> stats;
 
     /**
      * The RowSetWriter associated with the original
@@ -429,6 +429,7 @@
      * This is used to set the status of each row
      * to either of the values SyncResolver.*_CONFLICT
      **/
+    @SuppressWarnings("rawtypes")
     void setStatus(ArrayList status){
              stats = status;
     }
@@ -856,6 +857,7 @@
      * @see #toCollection(String)
      * @see java.util.TreeMap
      */
+    @SuppressWarnings("rawtypes")
     public Collection toCollection() throws SQLException {
        throw new UnsupportedOperationException();
     }
@@ -878,6 +880,7 @@
      * @see #toCollection(String)
      * @see java.util.Vector
      */
+    @SuppressWarnings("rawtypes")
     public Collection toCollection(int column) throws SQLException {
        throw new UnsupportedOperationException();
     }
@@ -900,6 +903,7 @@
      * @see #toCollection(int)
      * @see java.util.Vector
      */
+    @SuppressWarnings("rawtypes")
     public Collection toCollection(String column) throws SQLException {
         throw new UnsupportedOperationException();
     }
--- a/src/share/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java	Fri Dec 16 12:12:17 2011 -0800
@@ -55,7 +55,7 @@
      * object will use for storing the tags to be used for writing the calling
      * <code>WebRowSet</code> object as an XML document.
      */
-    private java.util.Stack stack;
+    private java.util.Stack<String> stack;
 
     private  JdbcRowSetResourceBundle resBundle;
 
@@ -94,7 +94,7 @@
     throws SQLException {
 
         // create a new stack for tag checking.
-        stack = new java.util.Stack();
+        stack = new java.util.Stack<>();
         writer = wrt;
         writeRowSet(caller);
     }
@@ -127,7 +127,7 @@
     throws SQLException {
 
         // create a new stack for tag checking.
-        stack = new java.util.Stack();
+        stack = new java.util.Stack<>();
         writer = new OutputStreamWriter(oStream);
         writeRowSet(caller);
     }
@@ -205,10 +205,10 @@
 
             //Changed to beginSection and endSection for maps for proper indentation
             beginSection("map");
-            java.util.Map typeMap = caller.getTypeMap();
+            java.util.Map<?,?> typeMap = caller.getTypeMap();
             if (typeMap != null) {
-                Iterator i = typeMap.keySet().iterator();
-                Class c;
+                Iterator<?> i = typeMap.keySet().iterator();
+                Class<?> c;
                 String type;
                 while (i.hasNext()) {
                     type = (String)i.next();
@@ -532,7 +532,7 @@
     }
 
     private String getTag() {
-        return (String)stack.pop();
+        return stack.pop();
     }
 
     private void writeNull() throws java.io.IOException {
--- a/src/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java	Fri Dec 16 12:12:17 2011 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -71,14 +71,14 @@
 
 public class XmlReaderContentHandler extends DefaultHandler {
 
-    private HashMap propMap;
-    private HashMap colDefMap;
-    private HashMap dataMap;
+    private HashMap <String, Integer> propMap;
+    private HashMap <String, Integer> colDefMap;
+    private HashMap <String, Integer> dataMap;
 
-    private HashMap typeMap;
+    private HashMap<String,Class<?>> typeMap;
 
-    private Vector updates;
-    private Vector keyCols;
+    private Vector<Object[]> updates;
+    private Vector<String> keyCols;
 
     private String columnValue;
     private String propertyValue;
@@ -438,7 +438,7 @@
         initMaps();
 
         // allocate the collection for the updates
-        updates = new Vector();
+        updates = new Vector<>();
 
         // start out with the empty string
         columnValue = "";
@@ -477,21 +477,21 @@
     private void initMaps() {
         int items, i;
 
-        propMap = new HashMap();
+        propMap = new HashMap<>();
         items = properties.length;
 
         for (i=0;i<items;i++) {
             propMap.put(properties[i], Integer.valueOf(i));
         }
 
-        colDefMap = new HashMap();
+        colDefMap = new HashMap<>();
         items = colDef.length;
 
         for (i=0;i<items;i++) {
             colDefMap.put(colDef[i], Integer.valueOf(i));
         }
 
-        dataMap = new HashMap();
+        dataMap = new HashMap<>();
         items = data.length;
 
         for (i=0;i<items;i++) {
@@ -499,7 +499,7 @@
         }
 
         //Initialize connection map here
-        typeMap = new HashMap();
+        typeMap = new HashMap<>();
     }
 
     public void startDocument() throws SAXException {
@@ -549,14 +549,14 @@
         case PROPERTIES:
 
             tempCommand = "";
-            tag = ((Integer)propMap.get(name)).intValue();
+            tag = propMap.get(name);
             if (tag == PropNullTag)
                setNullValue(true);
             else
                 setTag(tag);
             break;
         case METADATA:
-            tag = ((Integer)colDefMap.get(name)).intValue();
+            tag = colDefMap.get(name);
 
             if (tag == MetaNullTag)
                 setNullValue(true);
@@ -573,10 +573,10 @@
             tempUpdate = "";
             if(dataMap.get(name) == null) {
                 tag = NullTag;
-            } else if(((Integer)dataMap.get(name)).intValue() == EmptyStringTag) {
+            } else if(dataMap.get(name) == EmptyStringTag) {
                 tag = EmptyStringTag;
             } else {
-                 tag = ((Integer)dataMap.get(name)).intValue();
+                 tag = dataMap.get(name);
             }
 
             if (tag == NullTag) {
@@ -630,6 +630,7 @@
      *
      * @exception SAXException if a general SAX error occurs
      */
+    @SuppressWarnings("fallthrough")
     public void endElement(String uri, String lName, String qName) throws SAXException {
         int tag;
 
@@ -644,13 +645,13 @@
             }
 
             try {
-                tag = ((Integer)propMap.get(name)).intValue();
+                tag = propMap.get(name);
                 switch (tag) {
                 case KeycolsTag:
                     if (keyCols != null) {
                         int i[] = new int[keyCols.size()];
                         for (int j = 0; j < i.length; j++)
-                            i[j] = Integer.parseInt((String)keyCols.elementAt(j));
+                            i[j] = Integer.parseInt(keyCols.elementAt(j));
                         rs.setKeyColumns(i);
                     }
                     break;
@@ -723,7 +724,7 @@
             if(dataMap.get(name) == null) {
                 tag = NullTag;
             } else {
-                 tag = ((Integer)dataMap.get(name)).intValue();
+                 tag = dataMap.get(name);
             }
             switch (tag) {
             case ColTag:
@@ -820,7 +821,7 @@
         if (updates.size() > 0) {
             try {
                 Object upd[];
-                Iterator i = updates.iterator();
+                Iterator<?> i = updates.iterator();
                 while (i.hasNext()) {
                     upd = (Object [])i.next();
                     idx = ((Integer)upd[0]).intValue();
@@ -1075,7 +1076,7 @@
             break;
         case PropColumnTag:
             if (keyCols == null)
-                keyCols = new Vector();
+                keyCols = new Vector<>();
             keyCols.add(s);
             break;
         case MapTag:
--- a/src/share/classes/java/applet/Applet.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/applet/Applet.java	Fri Dec 16 12:12:17 2011 -0800
@@ -117,7 +117,7 @@
                 s.checkPermission(new AWTPermission("setAppletStub"));
             }
         }
-        this.stub = (AppletStub)stub;
+        this.stub = stub;
     }
 
     /**
@@ -210,6 +210,7 @@
      * @param   width    the new requested width for the applet.
      * @param   height   the new requested height for the applet.
      */
+    @SuppressWarnings("deprecation")
     public void resize(int width, int height) {
         Dimension d = size();
         if ((d.width != width) || (d.height != height)) {
@@ -225,6 +226,7 @@
      *
      * @param   d   an object giving the new width and height.
      */
+    @SuppressWarnings("deprecation")
     public void resize(Dimension d) {
         resize(d.width, d.height);
     }
--- a/src/share/classes/java/awt/font/StyledParagraph.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/awt/font/StyledParagraph.java	Fri Dec 16 12:12:17 2011 -0800
@@ -34,6 +34,7 @@
 import java.awt.im.InputMethodHighlight;
 import java.text.Annotation;
 import java.text.AttributedCharacterIterator;
+import java.text.AttributedCharacterIterator.Attribute;
 import java.util.Vector;
 import java.util.HashMap;
 import java.util.Map;
@@ -65,7 +66,7 @@
     // If there are multiple Decorations in the paragraph, they are
     // stored in this Vector, in order.  Otherwise this vector and
     // the decorationStarts array are null.
-    private Vector decorations;
+    private Vector<Decoration> decorations;
     // If there are multiple Decorations in the paragraph,
     // decorationStarts[i] contains the index where decoration i
     // starts.  For convenience, there is an extra entry at the
@@ -76,7 +77,7 @@
     // they are
     // stored in this Vector, in order.  Otherwise this vector and
     // the fontStarts array are null.
-    private Vector fonts;
+    private Vector<Object> fonts;
     // If there are multiple Fonts/GraphicAttributes in the paragraph,
     // fontStarts[i] contains the index where decoration i
     // starts.  For convenience, there is an extra entry at the
@@ -104,7 +105,7 @@
             final int nextRunStart = aci.getRunLimit();
             final int localIndex = index-start;
 
-            Map attributes = aci.getAttributes();
+            Map<? extends Attribute, ?> attributes = aci.getAttributes();
             attributes = addInputMethodAttrs(attributes);
             Decoration d = Decoration.getDecoration(attributes);
             addDecoration(d, localIndex);
@@ -168,7 +169,8 @@
         char ch = aci.setIndex(insertPos);
         int relativePos = Math.max(insertPos - aci.getBeginIndex() - 1, 0);
 
-        Map attributes = addInputMethodAttrs(aci.getAttributes());
+        Map<? extends Attribute, ?> attributes =
+            addInputMethodAttrs(aci.getAttributes());
         Decoration d = Decoration.getDecoration(attributes);
         if (!oldParagraph.getDecorationAt(relativePos).equals(d)) {
             return new StyledParagraph(aci, chars);
@@ -297,7 +299,7 @@
             return decoration;
         }
         int run = findRunContaining(index, decorationStarts);
-        return (Decoration) decorations.elementAt(run);
+        return decorations.elementAt(run);
     }
 
     /**
@@ -339,6 +341,7 @@
      * starts array does not have room for the index, a
      * new array is created and returned.
      */
+    @SuppressWarnings({"rawtypes", "unchecked"})
     private static int[] addToVector(Object obj,
                                      int index,
                                      Vector v,
@@ -374,7 +377,7 @@
         }
         else {
             if (!decoration.equals(d)) {
-                decorations = new Vector(INITIAL_SIZE);
+                decorations = new Vector<Decoration>(INITIAL_SIZE);
                 decorations.addElement(decoration);
                 decorations.addElement(d);
                 decorationStarts = new int[INITIAL_SIZE];
@@ -398,7 +401,7 @@
         }
         else {
             if (!font.equals(f)) {
-                fonts = new Vector(INITIAL_SIZE);
+                fonts = new Vector<Object>(INITIAL_SIZE);
                 fonts.addElement(font);
                 fonts.addElement(f);
                 fontStarts = new int[INITIAL_SIZE];
@@ -412,7 +415,8 @@
      * Resolve the given chars into Fonts using FontResolver, then add
      * font runs for each.
      */
-    private void addFonts(char[] chars, Map attributes, int start, int limit) {
+    private void addFonts(char[] chars, Map<? extends Attribute, ?> attributes,
+                          int start, int limit) {
 
         FontResolver resolver = FontResolver.getInstance();
         CodePointIterator iter = CodePointIterator.create(chars, start, limit);
@@ -426,7 +430,8 @@
      * Return a Map with entries from oldStyles, as well as input
      * method entries, if any.
      */
-    static Map addInputMethodAttrs(Map oldStyles) {
+    static Map<? extends Attribute, ?>
+           addInputMethodAttrs(Map<? extends Attribute, ?> oldStyles) {
 
         Object value = oldStyles.get(TextAttribute.INPUT_METHOD_HIGHLIGHT);
 
@@ -439,7 +444,7 @@
                 InputMethodHighlight hl;
                 hl = (InputMethodHighlight) value;
 
-                Map imStyles = null;
+                Map<? extends Attribute, ?> imStyles = null;
                 try {
                     imStyles = hl.getStyle();
                 } catch (NoSuchMethodError e) {
@@ -451,7 +456,8 @@
                 }
 
                 if (imStyles != null) {
-                    HashMap newStyles = new HashMap(5, (float)0.9);
+                    HashMap<Attribute, Object>
+                        newStyles = new HashMap<>(5, (float)0.9);
                     newStyles.putAll(oldStyles);
 
                     newStyles.putAll(imStyles);
@@ -471,7 +477,8 @@
      * If attributes does not contain a GraphicAttribute, Font, or
      * Font family entry this method returns null.
      */
-    private static Object getGraphicOrFont(Map attributes) {
+    private static Object getGraphicOrFont(
+            Map<? extends Attribute, ?> attributes) {
 
         Object value = attributes.get(TextAttribute.CHAR_REPLACEMENT);
         if (value != null) {
--- a/src/share/classes/java/awt/font/TextAttribute.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/awt/font/TextAttribute.java	Fri Dec 16 12:12:17 2011 -0800
@@ -257,7 +257,8 @@
 public final class TextAttribute extends Attribute {
 
     // table of all instances in this class, used by readResolve
-    private static final Map instanceMap = new HashMap(29);
+    private static final Map<String, TextAttribute>
+            instanceMap = new HashMap<String, TextAttribute>(29);
 
     /**
      * Constructs a <code>TextAttribute</code> with the specified name.
@@ -280,7 +281,7 @@
                 "subclass didn't correctly implement readResolve");
         }
 
-        TextAttribute instance = (TextAttribute) instanceMap.get(getName());
+        TextAttribute instance = instanceMap.get(getName());
         if (instance != null) {
             return instance;
         } else {
--- a/src/share/classes/java/awt/font/TextLayout.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/awt/font/TextLayout.java	Fri Dec 16 12:12:17 2011 -0800
@@ -55,6 +55,7 @@
 import java.text.AttributedString;
 import java.text.AttributedCharacterIterator;
 import java.text.AttributedCharacterIterator.Attribute;
+import java.text.CharacterIterator;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Hashtable;
@@ -382,7 +383,7 @@
             throw new IllegalArgumentException("Zero length string passed to TextLayout constructor.");
         }
 
-        Map attributes = null;
+        Map<? extends Attribute, ?> attributes = null;
         if (font.hasLayoutAttributes()) {
             attributes = font.getAttributes();
         }
@@ -451,7 +452,7 @@
     private static Font singleFont(char[] text,
                                    int start,
                                    int limit,
-                                   Map attributes) {
+                                   Map<? extends Attribute, ?> attributes) {
 
         if (attributes.get(TextAttribute.CHAR_REPLACEMENT) != null) {
             return null;
@@ -516,14 +517,17 @@
         text.first();
         char[] chars = new char[len];
         int n = 0;
-        for (char c = text.first(); c != text.DONE; c = text.next()) {
+        for (char c = text.first();
+             c != CharacterIterator.DONE;
+             c = text.next())
+        {
             chars[n++] = c;
         }
 
         text.first();
         if (text.getRunLimit() == limit) {
 
-            Map attributes = text.getAttributes();
+            Map<? extends Attribute, ?> attributes = text.getAttributes();
             Font font = singleFont(chars, 0, len, attributes);
             if (font != null) {
                 fastInit(chars, font, attributes, frc);
@@ -561,7 +565,9 @@
     /**
      * Initialize the paragraph-specific data.
      */
-    private void paragraphInit(byte aBaseline, CoreMetrics lm, Map paragraphAttrs, char[] text) {
+    private void paragraphInit(byte aBaseline, CoreMetrics lm,
+                               Map<? extends Attribute, ?> paragraphAttrs,
+                               char[] text) {
 
         baseline = aBaseline;
 
@@ -581,7 +587,10 @@
      * all renderable by one font (ie no embedded graphics)
      * all on one baseline
      */
-    private void fastInit(char[] chars, Font font, Map attrs, FontRenderContext frc) {
+    private void fastInit(char[] chars, Font font,
+                          Map<? extends Attribute, ?> attrs,
+                          FontRenderContext frc) {
+
         // Object vf = attrs.get(TextAttribute.ORIENTATION);
         // isVerticalLine = TextAttribute.ORIENTATION_VERTICAL.equals(vf);
         isVerticalLine = false;
@@ -619,7 +628,7 @@
             // and use it and its font to initialize the paragraph.
             // If not, use the first graphic to initialize.
 
-            Map paragraphAttrs = text.getAttributes();
+            Map<? extends Attribute, ?> paragraphAttrs = text.getAttributes();
 
             boolean haveFont = TextLine.advanceToFirstFont(text);
 
--- a/src/share/classes/java/awt/font/TextLine.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/awt/font/TextLine.java	Fri Dec 16 12:12:17 2011 -0800
@@ -43,6 +43,7 @@
 import java.awt.image.BufferedImage;
 import java.text.Annotation;
 import java.text.AttributedCharacterIterator;
+import java.text.AttributedCharacterIterator.Attribute;
 import java.text.Bidi;
 import java.text.CharacterIterator;
 import java.util.Hashtable;
@@ -318,7 +319,8 @@
             for (int i = 0, n = 0; i < fComponents.length; ++i, n += 2) {
                 tlc = fComponents[getComponentLogicalIndex(i)];
                 AffineTransform at = tlc.getBaselineTransform();
-                if (at != null && ((at.getType() & at.TYPE_TRANSLATION) != 0)) {
+                if (at != null &&
+                    ((at.getType() & AffineTransform.TYPE_TRANSLATION) != 0)) {
                     double dx = at.getTranslateX();
                     double dy = at.getTranslateY();
                     builder.moveTo(tx += dx, ty += dy);
@@ -903,7 +905,7 @@
                                               char[] chars,
                                               Font font,
                                               CoreMetrics lm,
-                                              Map attributes) {
+                                              Map<? extends Attribute, ?> attributes) {
 
         boolean isDirectionLTR = true;
         byte[] levels = null;
@@ -1250,7 +1252,10 @@
      */
     static boolean advanceToFirstFont(AttributedCharacterIterator aci) {
 
-        for (char ch = aci.first(); ch != aci.DONE; ch = aci.setIndex(aci.getRunLimit())) {
+        for (char ch = aci.first();
+             ch != CharacterIterator.DONE;
+             ch = aci.setIndex(aci.getRunLimit()))
+        {
 
             if (aci.getAttribute(TextAttribute.CHAR_REPLACEMENT) == null) {
                 return true;
--- a/src/share/classes/java/awt/font/TextMeasurer.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/awt/font/TextMeasurer.java	Fri Dec 16 12:12:17 2011 -0800
@@ -43,6 +43,7 @@
 import java.awt.Font;
 
 import java.text.AttributedCharacterIterator;
+import java.text.AttributedCharacterIterator.Attribute;
 import java.text.AttributedString;
 import java.text.Bidi;
 import java.text.BreakIterator;
@@ -176,7 +177,7 @@
             throw new Error();
         }
         if (fComponents != null) {
-            other.fComponents = (TextLineComponent[]) fComponents.clone();
+            other.fComponents = fComponents.clone();
         }
         return other;
     }
@@ -199,7 +200,10 @@
         fChars = new char[text.getEndIndex() - fStart];
 
         int n = 0;
-        for (char c = text.first(); c != text.DONE; c = text.next()) {
+        for (char c = text.first();
+             c != CharacterIterator.DONE;
+             c = text.next())
+        {
             fChars[n++] = c;
         }
 
@@ -211,7 +215,7 @@
         }
 
         text.first();
-        Map paragraphAttrs = text.getAttributes();
+        Map<? extends Attribute, ?> paragraphAttrs = text.getAttributes();
         NumericShaper shaper = AttributeValues.getNumericShaping(paragraphAttrs);
         if (shaper != null) {
             shaper.shape(fChars, 0, fChars.length);
@@ -243,7 +247,8 @@
                 GraphicAttribute graphic = (GraphicAttribute)
                                 paragraphAttrs.get(TextAttribute.CHAR_REPLACEMENT);
                 fBaseline = TextLayout.getBaselineFromGraphic(graphic);
-                Font dummyFont = new Font(new Hashtable(5, (float)0.9));
+                Hashtable<Attribute, ?> fmap = new Hashtable<>(5, (float)0.9);
+                Font dummyFont = new Font(fmap);
                 LineMetrics lm = dummyFont.getLineMetrics(" ", 0, 1, fFrc);
                 fBaselineOffsets = lm.getBaselineOffsets();
             }
--- a/src/share/classes/java/awt/geom/Path2D.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/awt/geom/Path2D.java	Fri Dec 16 12:12:17 2011 -0800
@@ -667,7 +667,8 @@
                         // Collapse out initial moveto/lineto
                         break;
                     }
-                    // NO BREAK;
+                    lineTo(coords[0], coords[1]);
+                    break;
                 case SEG_LINETO:
                     lineTo(coords[0], coords[1]);
                     break;
@@ -1392,7 +1393,8 @@
                         // Collapse out initial moveto/lineto
                         break;
                     }
-                    // NO BREAK;
+                    lineTo(coords[0], coords[1]);
+                    break;
                 case SEG_LINETO:
                     lineTo(coords[0], coords[1]);
                     break;
@@ -2456,7 +2458,7 @@
                 }
             }
         }
-        s.writeByte((byte) SERIAL_PATH_END);
+        s.writeByte(SERIAL_PATH_END);
     }
 
     final void readObject(java.io.ObjectInputStream s, boolean storedbl)
--- a/src/share/classes/java/awt/im/InputMethodHighlight.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/awt/im/InputMethodHighlight.java	Fri Dec 16 12:12:17 2011 -0800
@@ -190,6 +190,6 @@
     private boolean selected;
     private int state;
     private int variation;
-    private Map style;
+    private Map<TextAttribute, ?> style;
 
 };
--- a/src/share/classes/java/beans/BeanDescriptor.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/BeanDescriptor.java	Fri Dec 16 12:12:17 2011 -0800
@@ -37,8 +37,8 @@
 
 public class BeanDescriptor extends FeatureDescriptor {
 
-    private Reference<Class> beanClassRef;
-    private Reference<Class> customizerClassRef;
+    private Reference<? extends Class<?>> beanClassRef;
+    private Reference<? extends Class<?>> customizerClassRef;
 
     /**
      * Create a BeanDescriptor for a bean that doesn't have a customizer.
@@ -59,8 +59,8 @@
      *          the bean's Customizer.  For example sun.beans.OurButtonCustomizer.class.
      */
     public BeanDescriptor(Class<?> beanClass, Class<?> customizerClass) {
-        this.beanClassRef = getWeakReference((Class)beanClass);
-        this.customizerClassRef = getWeakReference((Class)customizerClass);
+        this.beanClassRef = getWeakReference(beanClass);
+        this.customizerClassRef = getWeakReference(customizerClass);
 
         String name = beanClass.getName();
         while (name.indexOf('.') >= 0) {
--- a/src/share/classes/java/beans/Beans.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/Beans.java	Fri Dec 16 12:12:17 2011 -0800
@@ -176,9 +176,9 @@
         // Try to find a serialized object with this name
         final String serName = beanName.replace('.','/').concat(".ser");
         final ClassLoader loader = cls;
-        ins = (InputStream)AccessController.doPrivileged
-            (new PrivilegedAction() {
-                public Object run() {
+        ins = AccessController.doPrivileged
+            (new PrivilegedAction<InputStream>() {
+                public InputStream run() {
                     if (loader == null)
                         return ClassLoader.getSystemResourceAsStream(serName);
                     else
@@ -208,7 +208,7 @@
 
         if (result == null) {
             // No serialized object, try just instantiating the class
-            Class cl;
+            Class<?> cl;
 
             try {
                 cl = ClassFinder.findClass(beanName, cls);
@@ -273,10 +273,10 @@
                     // Now get the URL correponding to the resource name.
 
                     final ClassLoader cloader = cls;
-                    objectUrl = (URL)
+                    objectUrl =
                         AccessController.doPrivileged
-                        (new PrivilegedAction() {
-                            public Object run() {
+                        (new PrivilegedAction<URL>() {
+                            public URL run() {
                                 if (cloader == null)
                                     return ClassLoader.getSystemResource
                                                                 (resourceName);
@@ -321,7 +321,7 @@
                 // now, if there is a BeanContext, add the bean, if applicable.
 
                 if (beanContext != null) {
-                    beanContext.add(result);
+                    unsafeBeanContextAdd(beanContext, result);
                 }
 
                 // If it was deserialized then it was already init-ed.
@@ -339,12 +339,16 @@
                   ((BeansAppletStub)stub).active = true;
                 } else initializer.activate(applet);
 
-            } else if (beanContext != null) beanContext.add(result);
+            } else if (beanContext != null) unsafeBeanContextAdd(beanContext, result);
         }
 
         return result;
     }
 
+    @SuppressWarnings("unchecked")
+    private static void unsafeBeanContextAdd(BeanContext beanContext, Object res) {
+        beanContext.add(res);
+    }
 
     /**
      * From a given bean, obtain an object representing a specified
@@ -489,6 +493,7 @@
     /**
      * Use the given ClassLoader rather than using the system class
      */
+    @SuppressWarnings("rawtypes")
     protected Class resolveClass(ObjectStreamClass classDesc)
         throws IOException, ClassNotFoundException {
 
@@ -504,7 +509,7 @@
 
 class BeansAppletContext implements AppletContext {
     Applet target;
-    Hashtable imageCache = new Hashtable();
+    Hashtable<URL,Object> imageCache = new Hashtable<>();
 
     BeansAppletContext(Applet target) {
         this.target = target;
@@ -549,8 +554,8 @@
         return null;
     }
 
-    public Enumeration getApplets() {
-        Vector applets = new Vector();
+    public Enumeration<Applet> getApplets() {
+        Vector<Applet> applets = new Vector<>();
         applets.addElement(target);
         return applets.elements();
     }
@@ -576,7 +581,7 @@
         return null;
     }
 
-    public Iterator getStreamKeys(){
+    public Iterator<String> getStreamKeys(){
         // We do nothing.
         return null;
     }
--- a/src/share/classes/java/beans/ChangeListenerMap.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/ChangeListenerMap.java	Fri Dec 16 12:12:17 2011 -0800
@@ -76,7 +76,7 @@
      */
     public final synchronized void add(String name, L listener) {
         if (this.map == null) {
-            this.map = new HashMap<String, L[]>();
+            this.map = new HashMap<>();
         }
         L[] array = this.map.get(name);
         int size = (array != null)
@@ -146,7 +146,7 @@
     public final void set(String name, L[] listeners) {
         if (listeners != null) {
             if (this.map == null) {
-                this.map = new HashMap<String, L[]>();
+                this.map = new HashMap<>();
             }
             this.map.put(name, listeners);
         }
@@ -167,7 +167,7 @@
         if (this.map == null) {
             return newArray(0);
         }
-        List<L> list = new ArrayList<L>();
+        List<L> list = new ArrayList<>();
 
         L[] listeners = this.map.get(null);
         if (listeners != null) {
@@ -239,6 +239,7 @@
      */
     public final L extract(L listener) {
         while (listener instanceof EventListenerProxy) {
+            @SuppressWarnings("unchecked")
             EventListenerProxy<L> proxy = (EventListenerProxy<L>) listener;
             listener = proxy.getListener();
         }
--- a/src/share/classes/java/beans/DefaultPersistenceDelegate.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/DefaultPersistenceDelegate.java	Fri Dec 16 12:12:17 2011 -0800
@@ -95,7 +95,7 @@
         this.constructor = constructorPropertyNames;
     }
 
-    private static boolean definesEquals(Class type) {
+    private static boolean definesEquals(Class<?> type) {
         try {
             return type == type.getMethod("equals", Object.class).getDeclaringClass();
         }
@@ -153,7 +153,7 @@
      */
     protected Expression instantiate(Object oldInstance, Encoder out) {
         int nArgs = constructor.length;
-        Class type = oldInstance.getClass();
+        Class<?> type = oldInstance.getClass();
         Object[] constructorArgs = new Object[nArgs];
         for(int i = 0; i < nArgs; i++) {
             try {
@@ -167,7 +167,7 @@
         return new Expression(oldInstance, oldInstance.getClass(), "new", constructorArgs);
     }
 
-    private Method findMethod(Class type, String property) {
+    private Method findMethod(Class<?> type, String property) {
         if (property == null) {
             throw new IllegalArgumentException("Property name is null");
         }
@@ -182,7 +182,7 @@
         return method;
     }
 
-    private void doProperty(Class type, PropertyDescriptor pd, Object oldInstance, Object newInstance, Encoder out) throws Exception {
+    private void doProperty(Class<?> type, PropertyDescriptor pd, Object oldInstance, Object newInstance, Encoder out) throws Exception {
         Method getter = pd.getReadMethod();
         Method setter = pd.getWriteMethod();
 
@@ -218,7 +218,7 @@
     }
 
     // Write out the properties of this instance.
-    private void initBean(Class type, Object oldInstance, Object newInstance, Encoder out) {
+    private void initBean(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         for (Field field : type.getFields()) {
             int mod = field.getModifiers();
             if (Modifier.isFinal(mod) || Modifier.isStatic(mod) || Modifier.isTransient(mod)) {
@@ -288,7 +288,7 @@
             if (d.isTransient()) {
                 continue;
             }
-            Class listenerType = d.getListenerType();
+            Class<?> listenerType = d.getListenerType();
 
 
             // The ComponentListener is added automatically, when
@@ -318,7 +318,7 @@
             }
             catch (Exception e2) {
                 try {
-                    Method m = type.getMethod("getListeners", new Class[]{Class.class});
+                    Method m = type.getMethod("getListeners", new Class<?>[]{Class.class});
                     oldL = (EventListener[])MethodUtil.invoke(m, oldInstance, new Object[]{listenerType});
                     newL = (EventListener[])MethodUtil.invoke(m, newInstance, new Object[]{listenerType});
                 }
@@ -401,7 +401,7 @@
         }
     }
 
-    private static PropertyDescriptor getPropertyDescriptor(Class type, String property) {
+    private static PropertyDescriptor getPropertyDescriptor(Class<?> type, String property) {
         try {
             for (PropertyDescriptor pd : Introspector.getBeanInfo(type).getPropertyDescriptors()) {
                 if (property.equals(pd.getName()))
--- a/src/share/classes/java/beans/Encoder.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/Encoder.java	Fri Dec 16 12:12:17 2011 -0800
@@ -47,10 +47,10 @@
 
 public class Encoder {
     private final PersistenceDelegateFinder finder = new PersistenceDelegateFinder();
-    private Map bindings = new IdentityHashMap();
+    private Map<Object, Expression> bindings = new IdentityHashMap<>();
     private ExceptionListener exceptionListener;
     boolean executeStatements = true;
-    private Map attributes;
+    private Map<Object, Object> attributes;
 
     /**
      * Write the specified object to the output stream.
@@ -227,7 +227,7 @@
      * @see #get
      */
     public Object remove(Object oldInstance) {
-        Expression exp = (Expression)bindings.remove(oldInstance);
+        Expression exp = bindings.remove(oldInstance);
         return getValue(exp);
     }
 
@@ -248,7 +248,7 @@
             oldInstance.getClass() == String.class) {
             return oldInstance;
         }
-        Expression exp = (Expression)bindings.get(oldInstance);
+        Expression exp = bindings.get(oldInstance);
         return getValue(exp);
     }
 
@@ -337,7 +337,7 @@
     // Package private method for setting an attributes table for the encoder
     void setAttribute(Object key, Object value) {
         if (attributes == null) {
-            attributes = new HashMap();
+            attributes = new HashMap<>();
         }
         attributes.put(key, value);
     }
--- a/src/share/classes/java/beans/EventHandler.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/EventHandler.java	Fri Dec 16 12:12:17 2011 -0800
@@ -385,14 +385,14 @@
             if (target != null) {
                 getter = Statement.getMethod(target.getClass(),
                                       "get" + NameGenerator.capitalize(first),
-                                      new Class[]{});
+                                      new Class<?>[]{});
                 if (getter == null) {
                     getter = Statement.getMethod(target.getClass(),
                                    "is" + NameGenerator.capitalize(first),
-                                   new Class[]{});
+                                   new Class<?>[]{});
                 }
                 if (getter == null) {
-                    getter = Statement.getMethod(target.getClass(), first, new Class[]{});
+                    getter = Statement.getMethod(target.getClass(), first, new Class<?>[]{});
                 }
             }
             if (getter == null) {
@@ -450,12 +450,12 @@
 
             if (eventPropertyName == null) {     // Nullary method.
                 newArgs = new Object[]{};
-                argTypes = new Class[]{};
+                argTypes = new Class<?>[]{};
             }
             else {
                 Object input = applyGetters(arguments[0], getEventPropertyName());
                 newArgs = new Object[]{input};
-                argTypes = new Class[]{input == null ? null :
+                argTypes = new Class<?>[]{input == null ? null :
                                        input.getClass()};
             }
             try {
@@ -674,6 +674,7 @@
      *
      * @see EventHandler
      */
+    @SuppressWarnings("unchecked")
     public static <T> T create(Class<T> listenerInterface,
                                Object target, String action,
                                String eventPropertyName,
@@ -688,7 +689,7 @@
                           "listenerInterface must be non-null");
         }
         return (T)Proxy.newProxyInstance(target.getClass().getClassLoader(),
-                                         new Class[] {listenerInterface},
+                                         new Class<?>[] {listenerInterface},
                                          eventHandler);
     }
 }
--- a/src/share/classes/java/beans/EventSetDescriptor.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/EventSetDescriptor.java	Fri Dec 16 12:12:17 2011 -0800
@@ -45,7 +45,7 @@
     private MethodDescriptor getMethodDescriptor;
 
     private Reference<Method[]> listenerMethodsRef;
-    private Reference<Class> listenerTypeRef;
+    private Reference<? extends Class<?>> listenerTypeRef;
 
     private boolean unicast;
     private boolean inDefaultEventSet = true;
@@ -91,7 +91,7 @@
         }
     }
 
-    private static String getListenerClassName(Class cls) {
+    private static String getListenerClassName(Class<?> cls) {
         String className = cls.getName();
         return className.substring(className.lastIndexOf('.') + 1);
     }
@@ -182,7 +182,7 @@
         }
     }
 
-    private static Method getMethod(Class cls, String name, int args)
+    private static Method getMethod(Class<?> cls, String name, int args)
         throws IntrospectionException {
         if (name == null) {
             return null;
@@ -295,7 +295,7 @@
                 : null;
     }
 
-    private void setListenerType(Class cls) {
+    private void setListenerType(Class<?> cls) {
         this.listenerTypeRef = getWeakReference(cls);
     }
 
--- a/src/share/classes/java/beans/FeatureDescriptor.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/FeatureDescriptor.java	Fri Dec 16 12:12:17 2011 -0800
@@ -51,7 +51,7 @@
 public class FeatureDescriptor {
     private static final String TRANSIENT = "transient";
 
-    private Reference<Class> classRef;
+    private Reference<? extends Class<?>> classRef;
 
     /**
      * Constructs a <code>FeatureDescriptor</code>.
@@ -284,7 +284,7 @@
      */
     private Hashtable<String, Object> getTable() {
         if (this.table == null) {
-            this.table = new Hashtable<String, Object>();
+            this.table = new Hashtable<>();
         }
         return this.table;
     }
@@ -317,11 +317,11 @@
 
     // Package private methods for recreating the weak/soft referent
 
-    void setClass0(Class cls) {
+    void setClass0(Class<?> cls) {
         this.classRef = getWeakReference(cls);
     }
 
-    Class getClass0() {
+    Class<?> getClass0() {
         return (this.classRef != null)
                 ? this.classRef.get()
                 : null;
@@ -336,7 +336,7 @@
      */
     static <T> Reference<T> getSoftReference(T object) {
         return (object != null)
-                ? new SoftReference<T>(object)
+                ? new SoftReference<>(object)
                 : null;
     }
 
@@ -349,7 +349,7 @@
      */
     static <T> Reference<T> getWeakReference(T object) {
         return (object != null)
-                ? new WeakReference<T>(object)
+                ? new WeakReference<>(object)
                 : null;
     }
 
@@ -363,7 +363,7 @@
      * @see Method#getGenericReturnType
      * @see Method#getReturnType
      */
-    static Class getReturnType(Class base, Method method) {
+    static Class<?> getReturnType(Class<?> base, Method method) {
         if (base == null) {
             base = method.getDeclaringClass();
         }
@@ -380,7 +380,7 @@
      * @see Method#getGenericParameterTypes
      * @see Method#getParameterTypes
      */
-    static Class[] getParameterTypes(Class base, Method method) {
+    static Class<?>[] getParameterTypes(Class<?> base, Method method) {
         if (base == null) {
             base = method.getDeclaringClass();
         }
@@ -425,7 +425,7 @@
     void appendTo(StringBuilder sb) {
     }
 
-    static void appendTo(StringBuilder sb, String name, Reference reference) {
+    static void appendTo(StringBuilder sb, String name, Reference<?> reference) {
         if (reference != null) {
             appendTo(sb, name, reference.get());
         }
--- a/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Fri Dec 16 12:12:17 2011 -0800
@@ -40,7 +40,7 @@
 
 public class IndexedPropertyDescriptor extends PropertyDescriptor {
 
-    private Reference<Class> indexedPropertyTypeRef;
+    private Reference<? extends Class<?>> indexedPropertyTypeRef;
     private Reference<Method> indexedReadMethodRef;
     private Reference<Method> indexedWriteMethodRef;
 
@@ -175,14 +175,14 @@
     public synchronized Method getIndexedReadMethod() {
         Method indexedReadMethod = getIndexedReadMethod0();
         if (indexedReadMethod == null) {
-            Class cls = getClass0();
+            Class<?> cls = getClass0();
             if (cls == null ||
                 (indexedReadMethodName == null && indexedReadMethodRef == null)) {
                 // the Indexed readMethod was explicitly set to null.
                 return null;
             }
             if (indexedReadMethodName == null) {
-                Class type = getIndexedPropertyType0();
+                Class<?> type = getIndexedPropertyType0();
                 if (type == boolean.class || type == null) {
                     indexedReadMethodName = Introspector.IS_PREFIX + getBaseName();
                 } else {
@@ -190,7 +190,7 @@
                 }
             }
 
-            Class[] args = { int.class };
+            Class<?>[] args = { int.class };
             indexedReadMethod = Introspector.findMethod(cls, indexedReadMethodName, 1, args);
             if (indexedReadMethod == null) {
                 // no "is" method, so look for a "get" method.
@@ -240,7 +240,7 @@
     public synchronized Method getIndexedWriteMethod() {
         Method indexedWriteMethod = getIndexedWriteMethod0();
         if (indexedWriteMethod == null) {
-            Class cls = getClass0();
+            Class<?> cls = getClass0();
             if (cls == null ||
                 (indexedWriteMethodName == null && indexedWriteMethodRef == null)) {
                 // the Indexed writeMethod was explicitly set to null.
@@ -250,14 +250,14 @@
             // We need the indexed type to ensure that we get the correct method.
             // Cannot use the getIndexedPropertyType method since that could
             // result in an infinite loop.
-            Class type = getIndexedPropertyType0();
+            Class<?> type = getIndexedPropertyType0();
             if (type == null) {
                 try {
                     type = findIndexedPropertyType(getIndexedReadMethod(), null);
                     setIndexedPropertyType(type);
                 } catch (IntrospectionException ex) {
                     // Set iprop type to be the classic type
-                    Class propType = getPropertyType();
+                    Class<?> propType = getPropertyType();
                     if (propType.isArray()) {
                         type = propType.getComponentType();
                     }
@@ -268,7 +268,7 @@
                 indexedWriteMethodName = Introspector.SET_PREFIX + getBaseName();
             }
 
-            Class[] args = (type == null) ? null : new Class[] { int.class, type };
+            Class<?>[] args = (type == null) ? null : new Class<?>[] { int.class, type };
             indexedWriteMethod = Introspector.findMethod(cls, indexedWriteMethodName, 2, args);
             if (indexedWriteMethod != null) {
                 if (!indexedWriteMethod.getReturnType().equals(void.class)) {
@@ -289,7 +289,7 @@
         throws IntrospectionException {
 
         // If the indexed property type has not been set, then set it.
-        Class type = findIndexedPropertyType(getIndexedReadMethod(),
+        Class<?> type = findIndexedPropertyType(getIndexedReadMethod(),
                                              writeMethod);
         setIndexedPropertyType(type);
         setIndexedWriteMethod0(writeMethod);
@@ -319,7 +319,7 @@
      *         or {@code null} if the type cannot be determined
      */
     public synchronized Class<?> getIndexedPropertyType() {
-        Class type = getIndexedPropertyType0();
+        Class<?> type = getIndexedPropertyType0();
         if (type == null) {
             try {
                 type = findIndexedPropertyType(getIndexedReadMethod(),
@@ -334,11 +334,11 @@
 
     // Private methods which set get/set the Reference objects
 
-    private void setIndexedPropertyType(Class type) {
+    private void setIndexedPropertyType(Class<?> type) {
         this.indexedPropertyTypeRef = getWeakReference(type);
     }
 
-    private Class getIndexedPropertyType0() {
+    private Class<?> getIndexedPropertyType0() {
         return (this.indexedPropertyTypeRef != null)
                 ? this.indexedPropertyTypeRef.get()
                 : null;
@@ -356,10 +356,10 @@
                 : null;
     }
 
-    private Class findIndexedPropertyType(Method indexedReadMethod,
+    private Class<?> findIndexedPropertyType(Method indexedReadMethod,
                                           Method indexedWriteMethod)
         throws IntrospectionException {
-        Class indexedPropertyType = null;
+        Class<?> indexedPropertyType = null;
 
         if (indexedReadMethod != null) {
             Class params[] = getParameterTypes(getClass0(), indexedReadMethod);
@@ -389,7 +389,7 @@
             }
             indexedPropertyType = params[1];
         }
-        Class propertyType = getPropertyType();
+        Class<?> propertyType = getPropertyType();
         if (propertyType != null && (!propertyType.isArray() ||
                                      propertyType.getComponentType() != indexedPropertyType)) {
             throw new IntrospectionException("type mismatch between indexed and non-indexed methods: "
--- a/src/share/classes/java/beans/Introspector.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/Introspector.java	Fri Dec 16 12:12:17 2011 -0800
@@ -97,13 +97,13 @@
     // Static Caches to speed up introspection.
     private static final WeakCache<Class<?>, Method[]> declaredMethodCache = new WeakCache<>();
 
-    private Class beanClass;
+    private Class<?> beanClass;
     private BeanInfo explicitBeanInfo;
     private BeanInfo superBeanInfo;
     private BeanInfo additionalBeanInfo[];
 
     private boolean propertyChangeSource = false;
-    private static Class eventListenerType = EventListener.class;
+    private static Class<EventListener> eventListenerType = EventListener.class;
 
     // These should be removed.
     private String defaultEventName;
@@ -111,14 +111,14 @@
     private int defaultEventIndex = -1;
     private int defaultPropertyIndex = -1;
 
-    // Methods maps from Method objects to MethodDescriptors
-    private Map methods;
+    // Methods maps from Method names to MethodDescriptors
+    private Map<String, MethodDescriptor> methods;
 
     // properties maps from String names to PropertyDescriptors
-    private Map properties;
+    private Map<String, PropertyDescriptor> properties;
 
     // events maps from String names to EventSetDescriptors
-    private Map events;
+    private Map<String, EventSetDescriptor> events;
 
     private final static EventSetDescriptor[] EMPTY_EVENTSETDESCRIPTORS = new EventSetDescriptor[0];
 
@@ -364,14 +364,14 @@
     //                  Private implementation methods
     //======================================================================
 
-    private Introspector(Class beanClass, Class stopClass, int flags)
+    private Introspector(Class<?> beanClass, Class<?> stopClass, int flags)
                                             throws IntrospectionException {
         this.beanClass = beanClass;
 
         // Check stopClass is a superClass of startClass.
         if (stopClass != null) {
             boolean isSuper = false;
-            for (Class c = beanClass.getSuperclass(); c != null; c = c.getSuperclass()) {
+            for (Class<?> c = beanClass.getSuperclass(); c != null; c = c.getSuperclass()) {
                 if (c == stopClass) {
                     isSuper = true;
                 }
@@ -386,7 +386,7 @@
             explicitBeanInfo = findExplicitBeanInfo(beanClass);
         }
 
-        Class superClass = beanClass.getSuperclass();
+        Class<?> superClass = beanClass.getSuperclass();
         if (superClass != stopClass) {
             int newFlags = flags;
             if (newFlags == IGNORE_IMMEDIATE_BEANINFO) {
@@ -432,7 +432,7 @@
      * @param beanClass  the class type of the bean
      * @return Instance of an explicit BeanInfo class or null if one isn't found.
      */
-    private static BeanInfo findExplicitBeanInfo(Class beanClass) {
+    private static BeanInfo findExplicitBeanInfo(Class<?> beanClass) {
         return ThreadGroupContext.getContext().getBeanInfoFinder().find(beanClass);
     }
 
@@ -482,8 +482,8 @@
                     continue;
                 }
                 String name = method.getName();
-                Class argTypes[] = method.getParameterTypes();
-                Class resultType = method.getReturnType();
+                Class<?>[] argTypes = method.getParameterTypes();
+                Class<?> resultType = method.getReturnType();
                 int argCount = argTypes.length;
                 PropertyDescriptor pd = null;
 
@@ -541,8 +541,8 @@
         processPropertyDescriptors();
 
         // Allocate and populate the result array.
-        PropertyDescriptor result[] = new PropertyDescriptor[properties.size()];
-        result = (PropertyDescriptor[])properties.values().toArray(result);
+        PropertyDescriptor result[] =
+                properties.values().toArray(new PropertyDescriptor[properties.size()]);
 
         // Set the default index.
         if (defaultPropertyName != null) {
@@ -556,16 +556,16 @@
         return result;
     }
 
-    private HashMap pdStore = new HashMap();
+    private HashMap<String, List<PropertyDescriptor>> pdStore = new HashMap<>();
 
     /**
      * Adds the property descriptor to the list store.
      */
     private void addPropertyDescriptor(PropertyDescriptor pd) {
         String propName = pd.getName();
-        List list = (List)pdStore.get(propName);
+        List<PropertyDescriptor> list = pdStore.get(propName);
         if (list == null) {
-            list = new ArrayList();
+            list = new ArrayList<>();
             pdStore.put(propName, list);
         }
         if (this.beanClass != pd.getClass0()) {
@@ -620,25 +620,25 @@
      */
     private void processPropertyDescriptors() {
         if (properties == null) {
-            properties = new TreeMap();
+            properties = new TreeMap<>();
         }
 
-        List list;
+        List<PropertyDescriptor> list;
 
         PropertyDescriptor pd, gpd, spd;
         IndexedPropertyDescriptor ipd, igpd, ispd;
 
-        Iterator it = pdStore.values().iterator();
+        Iterator<List<PropertyDescriptor>> it = pdStore.values().iterator();
         while (it.hasNext()) {
             pd = null; gpd = null; spd = null;
             ipd = null; igpd = null; ispd = null;
 
-            list = (List)it.next();
+            list = it.next();
 
             // First pass. Find the latest getter method. Merge properties
             // of previous getter methods.
             for (int i = 0; i < list.size(); i++) {
-                pd = (PropertyDescriptor)list.get(i);
+                pd = list.get(i);
                 if (pd instanceof IndexedPropertyDescriptor) {
                     ipd = (IndexedPropertyDescriptor)pd;
                     if (ipd.getIndexedReadMethod() != null) {
@@ -667,7 +667,7 @@
             // Second pass. Find the latest setter method which
             // has the same type as the getter method.
             for (int i = 0; i < list.size(); i++) {
-                pd = (PropertyDescriptor)list.get(i);
+                pd = list.get(i);
                 if (pd instanceof IndexedPropertyDescriptor) {
                     ipd = (IndexedPropertyDescriptor)pd;
                     if (ipd.getIndexedWriteMethod() != null) {
@@ -785,7 +785,7 @@
             // which does not have getter and setter methods.
             // See regression bug 4984912.
             if ( (pd == null) && (list.size() > 0) ) {
-                pd = (PropertyDescriptor) list.get(0);
+                pd = list.get(0);
             }
 
             if (pd != null) {
@@ -804,8 +804,8 @@
                                                        PropertyDescriptor pd) {
         PropertyDescriptor result = null;
 
-        Class propType = pd.getPropertyType();
-        Class ipropType = ipd.getIndexedPropertyType();
+        Class<?> propType = pd.getPropertyType();
+        Class<?> ipropType = ipd.getIndexedPropertyType();
 
         if (propType.isArray() && propType.getComponentType() == ipropType) {
             if (pd.getClass0().isAssignableFrom(ipd.getClass0())) {
@@ -839,7 +839,7 @@
                 if (write == null && read != null) {
                     write = findMethod(result.getClass0(),
                                        SET_PREFIX + NameGenerator.capitalize(result.getName()), 1,
-                                       new Class[] { FeatureDescriptor.getReturnType(result.getClass0(), read) });
+                                       new Class<?>[] { FeatureDescriptor.getReturnType(result.getClass0(), read) });
                     if (write != null) {
                         try {
                             result.setWriteMethod(write);
@@ -879,7 +879,7 @@
      */
     private EventSetDescriptor[] getTargetEventInfo() throws IntrospectionException {
         if (events == null) {
-            events = new HashMap();
+            events = new HashMap<>();
         }
 
         // Check if the bean has its own BeanInfo that will provide
@@ -930,9 +930,9 @@
             // Find all suitable "add", "remove" and "get" Listener methods
             // The name of the listener type is the key for these hashtables
             // i.e, ActionListener
-            Map adds = null;
-            Map removes = null;
-            Map gets = null;
+            Map<String, Method> adds = null;
+            Map<String, Method> removes = null;
+            Map<String, Method> gets = null;
 
             for (int i = 0; i < methodList.length; i++) {
                 Method method = methodList[i];
@@ -951,8 +951,8 @@
                     continue;
                 }
 
-                Class argTypes[] = FeatureDescriptor.getParameterTypes(beanClass, method);
-                Class resultType = FeatureDescriptor.getReturnType(beanClass, method);
+                Class<?>[] argTypes = FeatureDescriptor.getParameterTypes(beanClass, method);
+                Class<?> resultType = FeatureDescriptor.getReturnType(beanClass, method);
 
                 if (name.startsWith(ADD_PREFIX) && argTypes.length == 1 &&
                     resultType == Void.TYPE &&
@@ -961,7 +961,7 @@
                     if (listenerName.length() > 0 &&
                         argTypes[0].getName().endsWith(listenerName)) {
                         if (adds == null) {
-                            adds = new HashMap();
+                            adds = new HashMap<>();
                         }
                         adds.put(listenerName, method);
                     }
@@ -973,7 +973,7 @@
                     if (listenerName.length() > 0 &&
                         argTypes[0].getName().endsWith(listenerName)) {
                         if (removes == null) {
-                            removes = new HashMap();
+                            removes = new HashMap<>();
                         }
                         removes.put(listenerName, method);
                     }
@@ -986,7 +986,7 @@
                     if (listenerName.length() > 0 &&
                         resultType.getComponentType().getName().endsWith(listenerName)) {
                         if (gets == null) {
-                            gets = new HashMap();
+                            gets = new HashMap<>();
                         }
                         gets.put(listenerName, method);
                     }
@@ -996,26 +996,26 @@
             if (adds != null && removes != null) {
                 // Now look for matching addFooListener+removeFooListener pairs.
                 // Bonus if there is a matching getFooListeners method as well.
-                Iterator keys = adds.keySet().iterator();
+                Iterator<String> keys = adds.keySet().iterator();
                 while (keys.hasNext()) {
-                    String listenerName = (String) keys.next();
+                    String listenerName = keys.next();
                     // Skip any "add" which doesn't have a matching "remove" or
                     // a listener name that doesn't end with Listener
                     if (removes.get(listenerName) == null || !listenerName.endsWith("Listener")) {
                         continue;
                     }
                     String eventName = decapitalize(listenerName.substring(0, listenerName.length()-8));
-                    Method addMethod = (Method)adds.get(listenerName);
-                    Method removeMethod = (Method)removes.get(listenerName);
+                    Method addMethod = adds.get(listenerName);
+                    Method removeMethod = removes.get(listenerName);
                     Method getMethod = null;
                     if (gets != null) {
-                        getMethod = (Method)gets.get(listenerName);
+                        getMethod = gets.get(listenerName);
                     }
-                    Class argType = FeatureDescriptor.getParameterTypes(beanClass, addMethod)[0];
+                    Class<?> argType = FeatureDescriptor.getParameterTypes(beanClass, addMethod)[0];
 
                     // generate a list of Method objects for each of the target methods:
                     Method allMethods[] = getPublicDeclaredMethods(argType);
-                    List validMethods = new ArrayList(allMethods.length);
+                    List<Method> validMethods = new ArrayList<>(allMethods.length);
                     for (int i = 0; i < allMethods.length; i++) {
                         if (allMethods[i] == null) {
                             continue;
@@ -1025,7 +1025,7 @@
                             validMethods.add(allMethods[i]);
                         }
                     }
-                    Method[] methods = (Method[])validMethods.toArray(new Method[validMethods.size()]);
+                    Method[] methods = validMethods.toArray(new Method[validMethods.size()]);
 
                     EventSetDescriptor esd = new EventSetDescriptor(eventName, argType,
                                                                     methods, addMethod,
@@ -1048,7 +1048,7 @@
         } else {
             // Allocate and populate the result array.
             result = new EventSetDescriptor[events.size()];
-            result = (EventSetDescriptor[])events.values().toArray(result);
+            result = events.values().toArray(result);
 
             // Set the default index.
             if (defaultEventName != null) {
@@ -1067,7 +1067,7 @@
         if (esd.getName().equals("propertyChange")) {
             propertyChangeSource = true;
         }
-        EventSetDescriptor old = (EventSetDescriptor)events.get(key);
+        EventSetDescriptor old = events.get(key);
         if (old == null) {
             events.put(key, esd);
             return;
@@ -1082,7 +1082,7 @@
      */
     private MethodDescriptor[] getTargetMethodInfo() {
         if (methods == null) {
-            methods = new HashMap(100);
+            methods = new HashMap<>(100);
         }
 
         // Check if the bean has its own BeanInfo that will provide
@@ -1135,7 +1135,7 @@
 
         // Allocate and populate the result array.
         MethodDescriptor result[] = new MethodDescriptor[methods.size()];
-        result = (MethodDescriptor[])methods.values().toArray(result);
+        result = methods.values().toArray(result);
 
         return result;
     }
@@ -1146,7 +1146,7 @@
         // This method gets called a *lot, so we try to be efficient.
         String name = md.getName();
 
-        MethodDescriptor old = (MethodDescriptor)methods.get(name);
+        MethodDescriptor old = methods.get(name);
         if (old == null) {
             // This is the common case.
             methods.put(name, md);
@@ -1179,7 +1179,7 @@
         // This is very rare.
 
         String longKey = makeQualifiedMethodName(name, p1);
-        old = (MethodDescriptor)methods.get(longKey);
+        old = methods.get(longKey);
         if (old == null) {
             methods.put(longKey, md);
             return;
@@ -1250,7 +1250,7 @@
     /*
      * Internal method to return *public* methods within a class.
      */
-    private static Method[] getPublicDeclaredMethods(Class clz) {
+    private static Method[] getPublicDeclaredMethods(Class<?> clz) {
         // Looking up Class.getDeclaredMethods is relatively expensive,
         // so we cache the results.
         if (!ReflectUtil.isPackageAccessible(clz)) {
@@ -1280,14 +1280,14 @@
      * Internal support for finding a target methodName with a given
      * parameter list on a given class.
      */
-    private static Method internalFindMethod(Class start, String methodName,
+    private static Method internalFindMethod(Class<?> start, String methodName,
                                                  int argCount, Class args[]) {
         // For overriden methods we need to find the most derived version.
         // So we start with the given class and walk up the superclass chain.
 
         Method method = null;
 
-        for (Class cl = start; cl != null; cl = cl.getSuperclass()) {
+        for (Class<?> cl = start; cl != null; cl = cl.getSuperclass()) {
             Method methods[] = getPublicDeclaredMethods(cl);
             for (int i = 0; i < methods.length; i++) {
                 method = methods[i];
@@ -1338,7 +1338,7 @@
     /**
      * Find a target methodName on a given class.
      */
-    static Method findMethod(Class cls, String methodName, int argCount) {
+    static Method findMethod(Class<?> cls, String methodName, int argCount) {
         return findMethod(cls, methodName, argCount, null);
     }
 
@@ -1354,7 +1354,7 @@
      * @param args Array of argument types for the method.
      * @return the method or null if not found
      */
-    static Method findMethod(Class cls, String methodName, int argCount,
+    static Method findMethod(Class<?> cls, String methodName, int argCount,
                              Class args[]) {
         if (methodName == null) {
             return null;
@@ -1368,7 +1368,7 @@
      * or "implements" b.
      * Note tht either or both "Class" objects may represent interfaces.
      */
-    static  boolean isSubclass(Class a, Class b) {
+    static  boolean isSubclass(Class<?> a, Class<?> b) {
         // We rely on the fact that for any given java class or
         // primtitive type there is a unqiue Class object, so
         // we can use object equivalence in the comparisons.
@@ -1378,12 +1378,12 @@
         if (a == null || b == null) {
             return false;
         }
-        for (Class x = a; x != null; x = x.getSuperclass()) {
+        for (Class<?> x = a; x != null; x = x.getSuperclass()) {
             if (x == b) {
                 return true;
             }
             if (b.isInterface()) {
-                Class interfaces[] = x.getInterfaces();
+                Class<?>[] interfaces = x.getInterfaces();
                 for (int i = 0; i < interfaces.length; i++) {
                     if (isSubclass(interfaces[i], b)) {
                         return true;
@@ -1397,7 +1397,7 @@
     /**
      * Return true iff the given method throws the given exception.
      */
-    private boolean throwsException(Method method, Class exception) {
+    private boolean throwsException(Method method, Class<?> exception) {
         Class exs[] = method.getExceptionTypes();
         for (int i = 0; i < exs.length; i++) {
             if (exs[i] == exception) {
@@ -1412,12 +1412,12 @@
      * First try the classloader of "sibling", then try the system
      * classloader then the class loader of the current Thread.
      */
-    static Object instantiate(Class sibling, String className)
+    static Object instantiate(Class<?> sibling, String className)
                  throws InstantiationException, IllegalAccessException,
                                                 ClassNotFoundException {
         // First check with sibling's classloader (if any).
         ClassLoader cl = sibling.getClassLoader();
-        Class cls = ClassFinder.findClass(className, cl);
+        Class<?> cls = ClassFinder.findClass(className, cl);
         return cls.newInstance();
     }
 
@@ -1452,7 +1452,7 @@
         this.properties = properties;
         this.defaultProperty = defaultProperty;
         this.methods = methods;
-        this.targetBeanInfoRef = new SoftReference<BeanInfo>(targetBeanInfo);
+        this.targetBeanInfoRef = new SoftReference<>(targetBeanInfo);
     }
 
     /**
--- a/src/share/classes/java/beans/MetaData.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/MetaData.java	Fri Dec 16 12:12:17 2011 -0800
@@ -93,7 +93,7 @@
     }
 
     protected Expression instantiate(Object oldInstance, Encoder out) {
-        Enum e = (Enum) oldInstance;
+        Enum<?> e = (Enum<?>) oldInstance;
         return new Expression(e, Enum.class, "valueOf", new Object[]{e.getDeclaringClass(), e.name()});
     }
 }
@@ -118,7 +118,7 @@
 
     protected Expression instantiate(Object oldInstance, Encoder out) {
         // System.out.println("instantiate: " + type + " " + oldInstance);
-        Class oldClass = oldInstance.getClass();
+        Class<?> oldClass = oldInstance.getClass();
         return new Expression(oldInstance, Array.class, "newInstance",
                    new Object[]{oldClass.getComponentType(),
                                 new Integer(Array.getLength(oldInstance))});
@@ -152,14 +152,14 @@
 
 class ProxyPersistenceDelegate extends PersistenceDelegate {
     protected Expression instantiate(Object oldInstance, Encoder out) {
-        Class type = oldInstance.getClass();
+        Class<?> type = oldInstance.getClass();
         java.lang.reflect.Proxy p = (java.lang.reflect.Proxy)oldInstance;
         // This unappealing hack is not required but makes the
         // representation of EventHandlers much more concise.
         java.lang.reflect.InvocationHandler ih = java.lang.reflect.Proxy.getInvocationHandler(p);
         if (ih instanceof EventHandler) {
             EventHandler eh = (EventHandler)ih;
-            Vector args = new Vector();
+            Vector<Object> args = new Vector<>();
             args.add(type.getInterfaces()[0]);
             args.add(eh.getTarget());
             args.add(eh.getAction());
@@ -200,7 +200,7 @@
     }
 
     protected Expression instantiate(Object oldInstance, Encoder out) {
-        Class c = (Class)oldInstance;
+        Class<?> c = (Class)oldInstance;
         // As of 1.3 it is not possible to call Class.forName("int"),
         // so we have to generate different code for primitive types.
         // This is needed for arrays whose subtype may be primitive.
@@ -362,8 +362,8 @@
         if ((oldInstance instanceof List) || (oldInstance instanceof Set) || (oldInstance instanceof Map)) {
             return oldInstance.equals(newInstance);
         }
-        Collection oldC = (Collection) oldInstance;
-        Collection newC = (Collection) newInstance;
+        Collection<?> oldC = (Collection<?>) oldInstance;
+        Collection<?> newC = (Collection<?>) newInstance;
         return (oldC.size() == newC.size()) && oldC.containsAll(newC);
     }
 
@@ -387,21 +387,21 @@
 
     static final class SingletonList_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            List list = (List) oldInstance;
+            List<?> list = (List<?>) oldInstance;
             return new Expression(oldInstance, Collections.class, "singletonList", new Object[]{list.get(0)});
         }
     }
 
     static final class SingletonSet_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            Set set = (Set) oldInstance;
+            Set<?> set = (Set<?>) oldInstance;
             return new Expression(oldInstance, Collections.class, "singleton", new Object[]{set.iterator().next()});
         }
     }
 
     static final class SingletonMap_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            Map map = (Map) oldInstance;
+            Map<?,?> map = (Map<?,?>) oldInstance;
             Object key = map.keySet().iterator().next();
             return new Expression(oldInstance, Collections.class, "singletonMap", new Object[]{key, map.get(key)});
         }
@@ -409,98 +409,98 @@
 
     static final class UnmodifiableCollection_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            List list = new ArrayList((Collection) oldInstance);
+            List<?> list = new ArrayList<>((Collection<?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "unmodifiableCollection", new Object[]{list});
         }
     }
 
     static final class UnmodifiableList_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            List list = new LinkedList((Collection) oldInstance);
+            List<?> list = new LinkedList<>((Collection<?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "unmodifiableList", new Object[]{list});
         }
     }
 
     static final class UnmodifiableRandomAccessList_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            List list = new ArrayList((Collection) oldInstance);
+            List<?> list = new ArrayList<>((Collection<?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "unmodifiableList", new Object[]{list});
         }
     }
 
     static final class UnmodifiableSet_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            Set set = new HashSet((Set) oldInstance);
+            Set<?> set = new HashSet<>((Set<?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "unmodifiableSet", new Object[]{set});
         }
     }
 
     static final class UnmodifiableSortedSet_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            SortedSet set = new TreeSet((SortedSet) oldInstance);
+            SortedSet<?> set = new TreeSet<>((SortedSet<?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "unmodifiableSortedSet", new Object[]{set});
         }
     }
 
     static final class UnmodifiableMap_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            Map map = new HashMap((Map) oldInstance);
+            Map<?,?> map = new HashMap<>((Map<?,?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "unmodifiableMap", new Object[]{map});
         }
     }
 
     static final class UnmodifiableSortedMap_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            SortedMap map = new TreeMap((SortedMap) oldInstance);
+            SortedMap<?,?> map = new TreeMap<>((SortedMap<?,?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "unmodifiableSortedMap", new Object[]{map});
         }
     }
 
     static final class SynchronizedCollection_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            List list = new ArrayList((Collection) oldInstance);
+            List<?> list = new ArrayList<>((Collection<?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "synchronizedCollection", new Object[]{list});
         }
     }
 
     static final class SynchronizedList_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            List list = new LinkedList((Collection) oldInstance);
+            List<?> list = new LinkedList<>((Collection<?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "synchronizedList", new Object[]{list});
         }
     }
 
     static final class SynchronizedRandomAccessList_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            List list = new ArrayList((Collection) oldInstance);
+            List<?> list = new ArrayList<>((Collection<?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "synchronizedList", new Object[]{list});
         }
     }
 
     static final class SynchronizedSet_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            Set set = new HashSet((Set) oldInstance);
+            Set<?> set = new HashSet<>((Set<?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "synchronizedSet", new Object[]{set});
         }
     }
 
     static final class SynchronizedSortedSet_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            SortedSet set = new TreeSet((SortedSet) oldInstance);
+            SortedSet<?> set = new TreeSet<>((SortedSet<?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "synchronizedSortedSet", new Object[]{set});
         }
     }
 
     static final class SynchronizedMap_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            Map map = new HashMap((Map) oldInstance);
+            Map<?,?> map = new HashMap<>((Map<?,?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "synchronizedMap", new Object[]{map});
         }
     }
 
     static final class SynchronizedSortedMap_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
-            SortedMap map = new TreeMap((SortedMap) oldInstance);
+            SortedMap<?,?> map = new TreeMap<>((SortedMap<?,?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "synchronizedSortedMap", new Object[]{map});
         }
     }
@@ -508,7 +508,7 @@
     static final class CheckedCollection_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
             Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
-            List list = new ArrayList((Collection) oldInstance);
+            List<?> list = new ArrayList<>((Collection<?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "checkedCollection", new Object[]{list, type});
         }
     }
@@ -516,7 +516,7 @@
     static final class CheckedList_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
             Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
-            List list = new LinkedList((Collection) oldInstance);
+            List<?> list = new LinkedList<>((Collection<?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "checkedList", new Object[]{list, type});
         }
     }
@@ -524,7 +524,7 @@
     static final class CheckedRandomAccessList_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
             Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
-            List list = new ArrayList((Collection) oldInstance);
+            List<?> list = new ArrayList<>((Collection<?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "checkedList", new Object[]{list, type});
         }
     }
@@ -532,7 +532,7 @@
     static final class CheckedSet_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
             Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
-            Set set = new HashSet((Set) oldInstance);
+            Set<?> set = new HashSet<>((Set<?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "checkedSet", new Object[]{set, type});
         }
     }
@@ -540,7 +540,7 @@
     static final class CheckedSortedSet_PersistenceDelegate extends java_util_Collections {
         protected Expression instantiate(Object oldInstance, Encoder out) {
             Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
-            SortedSet set = new TreeSet((SortedSet) oldInstance);
+            SortedSet<?> set = new TreeSet<>((SortedSet<?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "checkedSortedSet", new Object[]{set, type});
         }
     }
@@ -549,7 +549,7 @@
         protected Expression instantiate(Object oldInstance, Encoder out) {
             Object keyType   = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.keyType");
             Object valueType = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.valueType");
-            Map map = new HashMap((Map) oldInstance);
+            Map<?,?> map = new HashMap<>((Map<?,?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "checkedMap", new Object[]{map, keyType, valueType});
         }
     }
@@ -558,7 +558,7 @@
         protected Expression instantiate(Object oldInstance, Encoder out) {
             Object keyType   = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.keyType");
             Object valueType = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.valueType");
-            SortedMap map = new TreeMap((SortedMap) oldInstance);
+            SortedMap<?,?> map = new TreeMap<>((SortedMap<?,?>) oldInstance);
             return new Expression(oldInstance, Collections.class, "checkedSortedMap", new Object[]{map, keyType, valueType});
         }
     }
@@ -605,13 +605,13 @@
 // Collection
 class java_util_Collection_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
-        java.util.Collection oldO = (java.util.Collection)oldInstance;
-        java.util.Collection newO = (java.util.Collection)newInstance;
+        java.util.Collection<?> oldO = (java.util.Collection)oldInstance;
+        java.util.Collection<?> newO = (java.util.Collection)newInstance;
 
         if (newO.size() != 0) {
             invokeStatement(oldInstance, "clear", new Object[]{}, out);
         }
-        for (Iterator i = oldO.iterator(); i.hasNext();) {
+        for (Iterator<?> i = oldO.iterator(); i.hasNext();) {
             invokeStatement(oldInstance, "add", new Object[]{i.next()}, out);
         }
     }
@@ -620,8 +620,8 @@
 // List
 class java_util_List_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
-        java.util.List oldO = (java.util.List)oldInstance;
-        java.util.List newO = (java.util.List)newInstance;
+        java.util.List<?> oldO = (java.util.List<?>)oldInstance;
+        java.util.List<?> newO = (java.util.List<?>)newInstance;
         int oldSize = oldO.size();
         int newSize = (newO == null) ? 0 : newO.size();
         if (oldSize < newSize) {
@@ -656,8 +656,8 @@
 class java_util_Map_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         // System.out.println("Initializing: " + newInstance);
-        java.util.Map oldMap = (java.util.Map)oldInstance;
-        java.util.Map newMap = (java.util.Map)newInstance;
+        java.util.Map<?,?> oldMap = (java.util.Map)oldInstance;
+        java.util.Map<?,?> newMap = (java.util.Map)newInstance;
         // Remove the new elements.
         // Do this first otherwise we undo the adding work.
         if (newMap != null) {
@@ -746,9 +746,9 @@
         int style = Font.PLAIN;
         int size = 12;
 
-        Map basic = font.getAttributes();
-        Map clone = new HashMap(basic.size());
-        for (Object key : basic.keySet()) {
+        Map<TextAttribute, ?> basic = font.getAttributes();
+        Map<TextAttribute, Object> clone = new HashMap<>(basic.size());
+        for (TextAttribute key : basic.keySet()) {
             Object value = basic.get(key);
             if (value != null) {
                 clone.put(key, value);
@@ -784,7 +784,7 @@
                 }
             }
         }
-        Class type = font.getClass();
+        Class<?> type = font.getClass();
         if (count == clone.size()) {
             return new Expression(font, type, "new", new Object[]{family, style, size});
         }
@@ -832,7 +832,7 @@
         if (args == null) {
             throw new IllegalStateException("Unsupported KeyStroke: " + key);
         }
-        Class type = key.getClass();
+        Class<?> type = key.getClass();
         String name = type.getName();
         // get short name of the class
         int index = name.lastIndexOf('.') + 1;
@@ -1057,12 +1057,12 @@
     protected void initialize(Class<?> type, Object oldInstance,
                               Object newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
-        Hashtable tab = (Hashtable)ReflectionUtils.getPrivateField(oldInstance,
+        Hashtable<?,?> tab = (Hashtable<?,?>)ReflectionUtils.getPrivateField(oldInstance,
                                                                    java.awt.CardLayout.class,
                                                                    "tab",
                                                                    out.getExceptionListener());
         if (tab != null) {
-            for(Enumeration e = tab.keys(); e.hasMoreElements();) {
+            for(Enumeration<?> e = tab.keys(); e.hasMoreElements();) {
                 Object child = e.nextElement();
                 invokeStatement(oldInstance, "addLayoutComponent",
                                 new Object[]{child, (String)tab.get(child)}, out);
@@ -1076,12 +1076,12 @@
     protected void initialize(Class<?> type, Object oldInstance,
                               Object newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
-        Hashtable comptable = (Hashtable)ReflectionUtils.getPrivateField(oldInstance,
+        Hashtable<?,?> comptable = (Hashtable<?,?>)ReflectionUtils.getPrivateField(oldInstance,
                                                  java.awt.GridBagLayout.class,
                                                  "comptable",
                                                  out.getExceptionListener());
         if (comptable != null) {
-            for(Enumeration e = comptable.keys(); e.hasMoreElements();) {
+            for(Enumeration<?> e = comptable.keys(); e.hasMoreElements();) {
                 Object child = e.nextElement();
                 invokeStatement(oldInstance, "addLayoutComponent",
                                 new Object[]{child, comptable.get(child)}, out);
@@ -1119,8 +1119,8 @@
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         // Note, the "size" property will be set here.
         super.initialize(type, oldInstance, newInstance, out);
-        javax.swing.DefaultListModel m = (javax.swing.DefaultListModel)oldInstance;
-        javax.swing.DefaultListModel n = (javax.swing.DefaultListModel)newInstance;
+        javax.swing.DefaultListModel<?> m = (javax.swing.DefaultListModel<?>)oldInstance;
+        javax.swing.DefaultListModel<?> n = (javax.swing.DefaultListModel<?>)newInstance;
         for (int i = n.getSize(); i < m.getSize(); i++) {
             invokeStatement(oldInstance, "add", // Can also use "addElement".
                     new Object[]{m.getElementAt(i)}, out);
@@ -1132,7 +1132,7 @@
 class javax_swing_DefaultComboBoxModel_PersistenceDelegate extends DefaultPersistenceDelegate {
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         super.initialize(type, oldInstance, newInstance, out);
-        javax.swing.DefaultComboBoxModel m = (javax.swing.DefaultComboBoxModel)oldInstance;
+        javax.swing.DefaultComboBoxModel<?> m = (javax.swing.DefaultComboBoxModel<?>)oldInstance;
         for (int i = 0; i < m.getSize(); i++) {
             invokeStatement(oldInstance, "addElement", new Object[]{m.getElementAt(i)}, out);
         }
@@ -1275,7 +1275,7 @@
 
 class MetaData {
     private static final Map<String,Field> fields = Collections.synchronizedMap(new WeakHashMap<String, Field>());
-    private static Hashtable internalPersistenceDelegates = new Hashtable();
+    private static Hashtable<String, PersistenceDelegate> internalPersistenceDelegates = new Hashtable<>();
 
     private static PersistenceDelegate nullPersistenceDelegate = new NullPersistenceDelegate();
     private static PersistenceDelegate enumPersistenceDelegate = new EnumPersistenceDelegate();
@@ -1308,6 +1308,7 @@
         internalPersistenceDelegates.put("java.util.RegularEnumSet", new java_util_EnumSet_PersistenceDelegate());
     }
 
+    @SuppressWarnings("rawtypes")
     public synchronized static PersistenceDelegate getPersistenceDelegate(Class type) {
         if (type == null) {
             return nullPersistenceDelegate;
@@ -1342,7 +1343,7 @@
         String typeName = type.getName();
         PersistenceDelegate pd = (PersistenceDelegate)getBeanAttribute(type, "persistenceDelegate");
         if (pd == null) {
-            pd = (PersistenceDelegate)internalPersistenceDelegates.get(typeName);
+            pd = internalPersistenceDelegates.get(typeName);
             if (pd != null) {
                 return pd;
             }
@@ -1369,7 +1370,7 @@
         return (pd != null) ? pd : defaultPersistenceDelegate;
     }
 
-    private static String[] getConstructorProperties(Class type) {
+    private static String[] getConstructorProperties(Class<?> type) {
         String[] names = null;
         int length = 0;
         for (Constructor<?> constructor : type.getConstructors()) {
@@ -1402,7 +1403,7 @@
         return true;
     }
 
-    private static Object getBeanAttribute(Class type, String attribute) {
+    private static Object getBeanAttribute(Class<?> type, String attribute) {
         try {
             return Introspector.getBeanInfo(type).getBeanDescriptor().getValue(attribute);
         } catch (IntrospectionException exception) {
--- a/src/share/classes/java/beans/MethodDescriptor.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/MethodDescriptor.java	Fri Dec 16 12:12:17 2011 -0800
@@ -42,7 +42,7 @@
 
     private String[] paramNames;
 
-    private List params;
+    private List<WeakReference<Class<?>>> params;
 
     private ParameterDescriptor parameterDescriptors[];
 
@@ -81,10 +81,10 @@
     public synchronized Method getMethod() {
         Method method = getMethod0();
         if (method == null) {
-            Class cls = getClass0();
+            Class<?> cls = getClass0();
             String name = getName();
             if ((cls != null) && (name != null)) {
-                Class[] params = getParams();
+                Class<?>[] params = getParams();
                 if (params == null) {
                     for (int i = 0; i < 3; i++) {
                         // Find methods for up to 2 params. We are guessing here.
@@ -121,15 +121,15 @@
                 : null;
     }
 
-    private synchronized void setParams(Class[] param) {
+    private synchronized void setParams(Class<?>[] param) {
         if (param == null) {
             return;
         }
         paramNames = new String[param.length];
-        params = new ArrayList(param.length);
+        params = new ArrayList<>(param.length);
         for (int i = 0; i < param.length; i++) {
             paramNames[i] = param[i].getName();
-            params.add(new WeakReference(param[i]));
+            params.add(new WeakReference<Class<?>>(param[i]));
         }
     }
 
@@ -138,12 +138,12 @@
         return paramNames;
     }
 
-    private synchronized Class[] getParams() {
-        Class[] clss = new Class[params.size()];
+    private synchronized Class<?>[] getParams() {
+        Class<?>[] clss = new Class<?>[params.size()];
 
         for (int i = 0; i < params.size(); i++) {
-            Reference ref = (Reference)params.get(i);
-            Class cls = (Class)ref.get();
+            Reference<? extends Class<?>> ref = (Reference<? extends Class<?>>)params.get(i);
+            Class<?> cls = ref.get();
             if (cls == null) {
                 return null;
             } else {
--- a/src/share/classes/java/beans/NameGenerator.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/NameGenerator.java	Fri Dec 16 12:12:17 2011 -0800
@@ -43,12 +43,12 @@
  */
 class NameGenerator {
 
-    private Map valueToName;
-    private Map nameToCount;
+    private Map<Object, String> valueToName;
+    private Map<String, Integer> nameToCount;
 
     public NameGenerator() {
-        valueToName = new IdentityHashMap();
-        nameToCount = new HashMap();
+        valueToName = new IdentityHashMap<>();
+        nameToCount = new HashMap<>();
     }
 
     /**
@@ -63,6 +63,7 @@
     /**
      * Returns the root name of the class.
      */
+    @SuppressWarnings("rawtypes")
     public static String unqualifiedClassName(Class type) {
         if (type.isArray()) {
             return unqualifiedClassName(type.getComponentType())+"Array";
@@ -97,15 +98,15 @@
             return unqualifiedClassName((Class)instance);
         }
         else {
-            String result = (String)valueToName.get(instance);
+            String result = valueToName.get(instance);
             if (result != null) {
                 return result;
             }
-            Class type = instance.getClass();
+            Class<?> type = instance.getClass();
             String className = unqualifiedClassName(type);
 
-            Object size = nameToCount.get(className);
-            int instanceNumber = (size == null) ? 0 : ((Integer)size).intValue() + 1;
+            Integer size = nameToCount.get(className);
+            int instanceNumber = (size == null) ? 0 : (size).intValue() + 1;
             nameToCount.put(className, new Integer(instanceNumber));
 
             result = className + instanceNumber;
--- a/src/share/classes/java/beans/PersistenceDelegate.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/PersistenceDelegate.java	Fri Dec 16 12:12:17 2011 -0800
@@ -207,7 +207,7 @@
                               Object oldInstance, Object newInstance,
                               Encoder out)
     {
-        Class superType = type.getSuperclass();
+        Class<?> superType = type.getSuperclass();
         PersistenceDelegate info = out.getPersistenceDelegate(superType);
         info.initialize(superType, oldInstance, newInstance, out);
     }
--- a/src/share/classes/java/beans/PropertyChangeSupport.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/PropertyChangeSupport.java	Fri Dec 16 12:12:17 2011 -0800
@@ -431,7 +431,7 @@
                     listeners = entry.getValue();
                 } else {
                     if (children == null) {
-                        children = new Hashtable<String, PropertyChangeSupport>();
+                        children = new Hashtable<>();
                     }
                     PropertyChangeSupport pcs = new PropertyChangeSupport(this.source);
                     pcs.map.set(null, entry.getValue());
@@ -460,6 +460,7 @@
 
         ObjectInputStream.GetField fields = s.readFields();
 
+        @SuppressWarnings("unchecked")
         Hashtable<String, PropertyChangeSupport> children = (Hashtable<String, PropertyChangeSupport>) fields.get("children", null);
         this.source = fields.get("source", null);
         fields.get("propertyChangeSupportSerializedDataVersion", 2);
--- a/src/share/classes/java/beans/PropertyDescriptor.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/PropertyDescriptor.java	Fri Dec 16 12:12:17 2011 -0800
@@ -35,10 +35,10 @@
  */
 public class PropertyDescriptor extends FeatureDescriptor {
 
-    private Reference<Class> propertyTypeRef;
+    private Reference<? extends Class<?>> propertyTypeRef;
     private Reference<Method> readMethodRef;
     private Reference<Method> writeMethodRef;
-    private Reference<Class> propertyEditorClassRef;
+    private Reference<? extends Class<?>> propertyEditorClassRef;
 
     private boolean bound;
     private boolean constrained;
@@ -186,11 +186,11 @@
         return type;
     }
 
-    private void setPropertyType(Class type) {
+    private void setPropertyType(Class<?> type) {
         this.propertyTypeRef = getWeakReference(type);
     }
 
-    private Class getPropertyType0() {
+    private Class<?> getPropertyType0() {
         return (this.propertyTypeRef != null)
                 ? this.propertyTypeRef.get()
                 : null;
@@ -344,7 +344,7 @@
     /**
      * Overridden to ensure that a super class doesn't take precedent
      */
-    void setClass0(Class clz) {
+    void setClass0(Class<?> clz) {
         if (getClass0() != null && clz.isAssignableFrom(getClass0())) {
             // dont replace a subclass with a superclass
             return;
@@ -402,7 +402,7 @@
      * @param propertyEditorClass  The Class for the desired PropertyEditor.
      */
     public void setPropertyEditorClass(Class<?> propertyEditorClass) {
-        this.propertyEditorClassRef = getWeakReference((Class)propertyEditorClass);
+        this.propertyEditorClassRef = getWeakReference(propertyEditorClass);
     }
 
     /**
@@ -442,7 +442,7 @@
             Constructor<?> ctor = null;
             if (bean != null) {
                 try {
-                    ctor = cls.getConstructor(new Class[] { Object.class });
+                    ctor = cls.getConstructor(new Class<?>[] { Object.class });
                 } catch (Exception ex) {
                     // Fall through
                 }
@@ -639,7 +639,7 @@
         Class<?> propertyType = null;
         try {
             if (readMethod != null) {
-                Class[] params = getParameterTypes(getClass0(), readMethod);
+                Class<?>[] params = getParameterTypes(getClass0(), readMethod);
                 if (params.length != 0) {
                     throw new IntrospectionException("bad read method arg count: "
                                                      + readMethod);
@@ -651,7 +651,7 @@
                 }
             }
             if (writeMethod != null) {
-                Class params[] = getParameterTypes(getClass0(), writeMethod);
+                Class<?>[] params = getParameterTypes(getClass0(), writeMethod);
                 if (params.length != 1) {
                     throw new IntrospectionException("bad write method arg count: "
                                                      + writeMethod);
--- a/src/share/classes/java/beans/PropertyEditorSupport.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/PropertyEditorSupport.java	Fri Dec 16 12:12:17 2011 -0800
@@ -251,7 +251,7 @@
     public synchronized void addPropertyChangeListener(
                                 PropertyChangeListener listener) {
         if (listeners == null) {
-            listeners = new java.util.Vector();
+            listeners = new java.util.Vector<>();
         }
         listeners.addElement(listener);
     }
@@ -278,25 +278,30 @@
      * Report that we have been modified to any interested listeners.
      */
     public void firePropertyChange() {
-        java.util.Vector targets;
+        java.util.Vector<PropertyChangeListener> targets;
         synchronized (this) {
             if (listeners == null) {
                 return;
             }
-            targets = (java.util.Vector) listeners.clone();
+            targets = unsafeClone(listeners);
         }
         // Tell our listeners that "everything" has changed.
         PropertyChangeEvent evt = new PropertyChangeEvent(source, null, null, null);
 
         for (int i = 0; i < targets.size(); i++) {
-            PropertyChangeListener target = (PropertyChangeListener)targets.elementAt(i);
+            PropertyChangeListener target = targets.elementAt(i);
             target.propertyChange(evt);
         }
     }
 
+    @SuppressWarnings("unchecked")
+    private <T> java.util.Vector<T> unsafeClone(java.util.Vector<T> v) {
+        return (java.util.Vector<T>)v.clone();
+    }
+
     //----------------------------------------------------------------------
 
     private Object value;
     private Object source;
-    private java.util.Vector listeners;
+    private java.util.Vector<PropertyChangeListener> listeners;
 }
--- a/src/share/classes/java/beans/ReflectionUtils.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/ReflectionUtils.java	Fri Dec 16 12:12:17 2011 -0800
@@ -32,10 +32,12 @@
  */
 class ReflectionUtils {
 
+    @SuppressWarnings("rawtypes")
     public static boolean isPrimitive(Class type) {
         return primitiveTypeFor(type) != null;
     }
 
+    @SuppressWarnings("rawtypes")
     public static Class primitiveTypeFor(Class wrapper) {
         if (wrapper == Boolean.class) return Boolean.TYPE;
         if (wrapper == Byte.class) return Byte.TYPE;
@@ -58,6 +60,7 @@
      * @param el an exception listener to handle exceptions; or null
      * @return value of the field; null if not found or an error is encountered
      */
+    @SuppressWarnings("rawtypes")
     public static Object getPrivateField(Object instance, Class cls,
                                          String name, ExceptionListener el) {
         try {
--- a/src/share/classes/java/beans/SimpleBeanInfo.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/SimpleBeanInfo.java	Fri Dec 16 12:12:17 2011 -0800
@@ -116,10 +116,10 @@
      */
     public java.awt.Image loadImage(final String resourceName) {
         try {
-            final Class c = getClass();
+            final Class<?> c = getClass();
             java.awt.image.ImageProducer ip = (java.awt.image.ImageProducer)
                 java.security.AccessController.doPrivileged(
-                new java.security.PrivilegedAction() {
+                new java.security.PrivilegedAction<Object>() {
                     public Object run() {
                         java.net.URL url;
                         if ((url = c.getResource(resourceName)) == null) {
--- a/src/share/classes/java/beans/Statement.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/Statement.java	Fri Dec 16 12:12:17 2011 -0800
@@ -212,7 +212,7 @@
         if (target == Class.class && methodName.equals("forName")) {
             return ClassFinder.resolveClass((String)arguments[0], this.loader);
         }
-        Class[] argClasses = new Class[arguments.length];
+        Class<?>[] argClasses = new Class<?>[arguments.length];
         for(int i = 0; i < arguments.length; i++) {
             argClasses[i] = (arguments[i] == null) ? null : arguments[i].getClass();
         }
--- a/src/share/classes/java/beans/VetoableChangeSupport.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/VetoableChangeSupport.java	Fri Dec 16 12:12:17 2011 -0800
@@ -420,7 +420,7 @@
                     listeners = entry.getValue();
                 } else {
                     if (children == null) {
-                        children = new Hashtable<String, VetoableChangeSupport>();
+                        children = new Hashtable<>();
                     }
                     VetoableChangeSupport vcs = new VetoableChangeSupport(this.source);
                     vcs.map.set(null, entry.getValue());
@@ -449,7 +449,8 @@
 
         ObjectInputStream.GetField fields = s.readFields();
 
-        Hashtable<String, VetoableChangeSupport> children = (Hashtable<String, VetoableChangeSupport>) fields.get("children", null);
+        @SuppressWarnings("unchecked")
+        Hashtable<String, VetoableChangeSupport> children = (Hashtable<String, VetoableChangeSupport>)fields.get("children", null);
         this.source = fields.get("source", null);
         fields.get("vetoableChangeSupportSerializedDataVersion", 2);
 
--- a/src/share/classes/java/beans/XMLEncoder.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/XMLEncoder.java	Fri Dec 16 12:12:17 2011 -0800
@@ -287,8 +287,8 @@
         this.declaration = declaration;
         this.indentation = indentation;
         this.out = new OutputStreamWriter(out, cs.newEncoder());
-        valueToExpression = new IdentityHashMap<Object, ValueData>();
-        targetToStatementList = new IdentityHashMap<Object, List<Statement>>();
+        valueToExpression = new IdentityHashMap<>();
+        targetToStatementList = new IdentityHashMap<>();
         nameGenerator = new NameGenerator();
     }
 
@@ -334,7 +334,7 @@
     private List<Statement> statementList(Object target) {
         List<Statement> list = targetToStatementList.get(target);
         if (list == null) {
-            list = new ArrayList<Statement>();
+            list = new ArrayList<>();
             targetToStatementList.put(target, list);
         }
         return list;
@@ -604,7 +604,7 @@
                 return;
             }
 
-            Class primitiveType = ReflectionUtils.primitiveTypeFor(value.getClass());
+            Class<?> primitiveType = ReflectionUtils.primitiveTypeFor(value.getClass());
             if (primitiveType != null && target == value.getClass() &&
                 methodName.equals("new")) {
                 String primitiveTypeName = primitiveType.getName();
--- a/src/share/classes/java/beans/beancontext/BeanContext.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/beancontext/BeanContext.java	Fri Dec 16 12:12:17 2011 -0800
@@ -53,6 +53,7 @@
  * @see java.util.Collection
  */
 
+@SuppressWarnings("rawtypes")
 public interface BeanContext extends BeanContextChild, Collection, DesignMode, Visibility {
 
     /**
--- a/src/share/classes/java/beans/beancontext/BeanContextMembershipEvent.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/beans/beancontext/BeanContextMembershipEvent.java	Fri Dec 16 12:12:17 2011 -0800
@@ -65,6 +65,7 @@
      * @throws NullPointerException if <CODE>changes</CODE> is <CODE>null</CODE>
      */
 
+    @SuppressWarnings("rawtypes")
     public BeanContextMembershipEvent(BeanContext bc, Collection changes) {
         super(bc);
 
@@ -117,6 +118,7 @@
      * Gets the array of children affected by this event.
      * @return the array of children effected
      */
+    @SuppressWarnings("rawtypes")
     public Iterator iterator() { return children.iterator(); }
 
     /*
@@ -127,5 +129,6 @@
     * The list of children affected by this
     * event notification.
     */
+    @SuppressWarnings("rawtypes")
     protected Collection children;
 }
--- a/src/share/classes/java/io/ExpiringCache.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/io/ExpiringCache.java	Fri Dec 16 12:12:17 2011 -0800
@@ -35,7 +35,7 @@
 
 class ExpiringCache {
     private long millisUntilExpiration;
-    private Map  map;
+    private Map<String,Entry> map;
     // Clear out old entries every few queries
     private int queryCount;
     private int queryOverflow = 300;
@@ -61,10 +61,11 @@
         this(30000);
     }
 
+    @SuppressWarnings("serial")
     ExpiringCache(long millisUntilExpiration) {
         this.millisUntilExpiration = millisUntilExpiration;
-        map = new LinkedHashMap() {
-            protected boolean removeEldestEntry(Map.Entry eldest) {
+        map = new LinkedHashMap<String,Entry>() {
+            protected boolean removeEldestEntry(Map.Entry<String,Entry> eldest) {
               return size() > MAX_ENTRIES;
             }
           };
@@ -99,7 +100,7 @@
     }
 
     private Entry entryFor(String key) {
-        Entry entry = (Entry) map.get(key);
+        Entry entry = map.get(key);
         if (entry != null) {
             long delta = System.currentTimeMillis() - entry.timestamp();
             if (delta < 0 || delta >= millisUntilExpiration) {
@@ -111,12 +112,11 @@
     }
 
     private void cleanup() {
-        Set keySet = map.keySet();
+        Set<String> keySet = map.keySet();
         // Avoid ConcurrentModificationExceptions
         String[] keys = new String[keySet.size()];
         int i = 0;
-        for (Iterator iter = keySet.iterator(); iter.hasNext(); ) {
-            String key = (String) iter.next();
+        for (String key: keySet) {
             keys[i++] = key;
         }
         for (int j = 0; j < keys.length; j++) {
--- a/src/share/classes/java/io/File.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/io/File.java	Fri Dec 16 12:12:17 2011 -0800
@@ -2006,7 +2006,7 @@
         throws IOException
     {
         s.defaultWriteObject();
-        s.writeChar(this.separatorChar); // Add the separator character
+        s.writeChar(separatorChar); // Add the separator character
     }
 
     /**
--- a/src/share/classes/java/io/LineNumberInputStream.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/io/LineNumberInputStream.java	Fri Dec 16 12:12:17 2011 -0800
@@ -87,6 +87,7 @@
      * @see        java.io.FilterInputStream#in
      * @see        java.io.LineNumberInputStream#getLineNumber()
      */
+    @SuppressWarnings("fallthrough")
     public int read() throws IOException {
         int c = pushBack;
 
--- a/src/share/classes/java/io/LineNumberReader.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/io/LineNumberReader.java	Fri Dec 16 12:12:17 2011 -0800
@@ -120,6 +120,7 @@
      * @throws  IOException
      *          If an I/O error occurs
      */
+    @SuppressWarnings("fallthrough")
     public int read() throws IOException {
         synchronized (lock) {
             int c = super.read();
@@ -159,6 +160,7 @@
      * @throws  IOException
      *          If an I/O error occurs
      */
+    @SuppressWarnings("fallthrough")
     public int read(char cbuf[], int off, int len) throws IOException {
         synchronized (lock) {
             int n = super.read(cbuf, off, len);
--- a/src/share/classes/java/io/ObjectInputStream.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/io/ObjectInputStream.java	Fri Dec 16 12:12:17 2011 -0800
@@ -689,9 +689,9 @@
         boolean hasNonPublicInterface = false;
 
         // define proxy in class loader of non-public interface(s), if any
-        Class[] classObjs = new Class[interfaces.length];
+        Class<?>[] classObjs = new Class<?>[interfaces.length];
         for (int i = 0; i < interfaces.length; i++) {
-            Class cl = Class.forName(interfaces[i], false, latestLoader);
+            Class<?> cl = Class.forName(interfaces[i], false, latestLoader);
             if ((cl.getModifiers() & Modifier.PUBLIC) == 0) {
                 if (hasNonPublicInterface) {
                     if (nonPublicLoader != cl.getClassLoader()) {
@@ -1229,7 +1229,7 @@
      * "enableSubclassImplementation" SerializablePermission is checked.
      */
     private void verifySubclass() {
-        Class cl = getClass();
+        Class<?> cl = getClass();
         if (cl == ObjectInputStream.class) {
             return;
         }
@@ -1473,12 +1473,12 @@
      * ClassNotFoundException will be associated with the class' handle in the
      * handle table).
      */
-    private Class readClass(boolean unshared) throws IOException {
+    private Class<?> readClass(boolean unshared) throws IOException {
         if (bin.readByte() != TC_CLASS) {
             throw new InternalError();
         }
         ObjectStreamClass desc = readClassDesc(false);
-        Class cl = desc.forClass();
+        Class<?> cl = desc.forClass();
         passHandle = handles.assign(unshared ? unsharedMarker : cl);
 
         ClassNotFoundException resolveEx = desc.getResolveException();
@@ -1542,7 +1542,7 @@
             ifaces[i] = bin.readUTF();
         }
 
-        Class cl = null;
+        Class<?> cl = null;
         ClassNotFoundException resolveEx = null;
         bin.setBlockDataMode(true);
         try {
@@ -1586,7 +1586,7 @@
                 "failed to read class descriptor").initCause(ex);
         }
 
-        Class cl = null;
+        Class<?> cl = null;
         ClassNotFoundException resolveEx = null;
         bin.setBlockDataMode(true);
         try {
@@ -1643,7 +1643,7 @@
         int len = bin.readInt();
 
         Object array = null;
-        Class cl, ccl = null;
+        Class<?> cl, ccl = null;
         if ((cl = desc.forClass()) != null) {
             ccl = cl.getComponentType();
             array = Array.newInstance(ccl, len);
@@ -1696,7 +1696,7 @@
      * Reads in and returns enum constant, or null if enum type is
      * unresolvable.  Sets passHandle to enum constant's assigned handle.
      */
-    private Enum readEnum(boolean unshared) throws IOException {
+    private Enum<?> readEnum(boolean unshared) throws IOException {
         if (bin.readByte() != TC_ENUM) {
             throw new InternalError();
         }
@@ -1713,24 +1713,26 @@
         }
 
         String name = readString(false);
-        Enum en = null;
-        Class cl = desc.forClass();
+        Enum<?> result = null;
+        Class<?> cl = desc.forClass();
         if (cl != null) {
             try {
-                en = Enum.valueOf(cl, name);
+                @SuppressWarnings("unchecked")
+                Enum<?> en = Enum.valueOf((Class)cl, name);
+                result = en;
             } catch (IllegalArgumentException ex) {
                 throw (IOException) new InvalidObjectException(
                     "enum constant " + name + " does not exist in " +
                     cl).initCause(ex);
             }
             if (!unshared) {
-                handles.setObject(enumHandle, en);
+                handles.setObject(enumHandle, result);
             }
         }
 
         handles.finish(enumHandle);
         passHandle = enumHandle;
-        return en;
+        return result;
     }
 
     /**
@@ -1941,7 +1943,7 @@
         throws IOException
     {
         // REMIND: is isInstance check necessary?
-        Class cl = desc.forClass();
+        Class<?> cl = desc.forClass();
         if (cl != null && obj != null && !cl.isInstance(obj)) {
             throw new ClassCastException();
         }
@@ -2140,7 +2142,7 @@
          * class descriptor, returns -1.  Throws IllegalArgumentException if
          * neither incoming nor local class descriptor contains a match.
          */
-        private int getFieldOffset(String name, Class type) {
+        private int getFieldOffset(String name, Class<?> type) {
             ObjectStreamField field = desc.getField(name, type);
             if (field != null) {
                 return field.getOffset();
@@ -2838,6 +2840,7 @@
             return readUTFBody(readUnsignedShort());
         }
 
+        @SuppressWarnings("deprecation")
         public String readLine() throws IOException {
             return din.readLine();      // deprecated, not worth optimizing
         }
--- a/src/share/classes/java/io/ObjectOutputStream.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/io/ObjectOutputStream.java	Fri Dec 16 12:12:17 2011 -0800
@@ -1034,7 +1034,7 @@
      * "enableSubclassImplementation" SerializablePermission is checked.
      */
     private void verifySubclass() {
-        Class cl = getClass();
+        Class<?> cl = getClass();
         if (cl == ObjectOutputStream.class) {
             return;
         }
@@ -1060,22 +1060,22 @@
      * override security-sensitive non-final methods.  Returns true if subclass
      * is "safe", false otherwise.
      */
-    private static boolean auditSubclass(final Class subcl) {
+    private static boolean auditSubclass(final Class<?> subcl) {
         Boolean result = AccessController.doPrivileged(
             new PrivilegedAction<Boolean>() {
                 public Boolean run() {
-                    for (Class cl = subcl;
+                    for (Class<?> cl = subcl;
                          cl != ObjectOutputStream.class;
                          cl = cl.getSuperclass())
                     {
                         try {
                             cl.getDeclaredMethod(
-                                "writeUnshared", new Class[] { Object.class });
+                                "writeUnshared", new Class<?>[] { Object.class });
                             return Boolean.FALSE;
                         } catch (NoSuchMethodException ex) {
                         }
                         try {
-                            cl.getDeclaredMethod("putFields", (Class[]) null);
+                            cl.getDeclaredMethod("putFields", (Class<?>[]) null);
                             return Boolean.FALSE;
                         } catch (NoSuchMethodException ex) {
                         }
@@ -1122,11 +1122,11 @@
 
             // check for replacement object
             Object orig = obj;
-            Class cl = obj.getClass();
+            Class<?> cl = obj.getClass();
             ObjectStreamClass desc;
             for (;;) {
                 // REMIND: skip this check for strings/arrays?
-                Class repCl;
+                Class<?> repCl;
                 desc = ObjectStreamClass.lookup(cl, true);
                 if (!desc.hasWriteReplaceMethod() ||
                     (obj = desc.invokeWriteReplace(obj)) == null ||
@@ -1169,7 +1169,7 @@
             } else if (cl.isArray()) {
                 writeArray(obj, desc, unshared);
             } else if (obj instanceof Enum) {
-                writeEnum((Enum) obj, desc, unshared);
+                writeEnum((Enum<?>) obj, desc, unshared);
             } else if (obj instanceof Serializable) {
                 writeOrdinaryObject(obj, desc, unshared);
             } else {
@@ -1204,7 +1204,7 @@
     /**
      * Writes representation of given class to stream.
      */
-    private void writeClass(Class cl, boolean unshared) throws IOException {
+    private void writeClass(Class<?> cl, boolean unshared) throws IOException {
         bout.writeByte(TC_CLASS);
         writeClassDesc(ObjectStreamClass.lookup(cl, true), false);
         handles.assign(unshared ? null : cl);
@@ -1237,7 +1237,7 @@
         bout.writeByte(TC_PROXYCLASSDESC);
         handles.assign(unshared ? null : desc);
 
-        Class cl = desc.forClass();
+        Class<?> cl = desc.forClass();
         Class[] ifaces = cl.getInterfaces();
         bout.writeInt(ifaces.length);
         for (int i = 0; i < ifaces.length; i++) {
@@ -1269,7 +1269,7 @@
             writeClassDescriptor(desc);
         }
 
-        Class cl = desc.forClass();
+        Class<?> cl = desc.forClass();
         bout.setBlockDataMode(true);
         annotateClass(cl);
         bout.setBlockDataMode(false);
@@ -1306,7 +1306,7 @@
         writeClassDesc(desc, false);
         handles.assign(unshared ? null : array);
 
-        Class ccl = desc.forClass().getComponentType();
+        Class<?> ccl = desc.forClass().getComponentType();
         if (ccl.isPrimitive()) {
             if (ccl == Integer.TYPE) {
                 int[] ia = (int[]) array;
@@ -1377,7 +1377,7 @@
     /**
      * Writes given enum constant to stream.
      */
-    private void writeEnum(Enum en,
+    private void writeEnum(Enum<?> en,
                            ObjectStreamClass desc,
                            boolean unshared)
         throws IOException
@@ -1700,7 +1700,7 @@
          * types, and any other non-null type matches assignable types only.
          * Throws IllegalArgumentException if no matching field found.
          */
-        private int getFieldOffset(String name, Class type) {
+        private int getFieldOffset(String name, Class<?> type) {
             ObjectStreamField field = desc.getField(name, type);
             if (field == null) {
                 throw new IllegalArgumentException("no such field " + name +
--- a/src/share/classes/java/io/ObjectStreamClass.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/io/ObjectStreamClass.java	Fri Dec 16 12:12:17 2011 -0800
@@ -144,7 +144,7 @@
     private volatile ClassDataSlot[] dataLayout;
 
     /** serialization-appropriate constructor, or null if none */
-    private Constructor cons;
+    private Constructor<?> cons;
     /** class-defined writeObject method, or null if none */
     private Method writeObjectMethod;
     /** class-defined readObject method, or null if none */
@@ -1308,9 +1308,9 @@
      * Access checks are disabled on the returned constructor (if any), since
      * the defining class may still be non-public.
      */
-    private static Constructor getExternalizableConstructor(Class<?> cl) {
+    private static Constructor<?> getExternalizableConstructor(Class<?> cl) {
         try {
-            Constructor cons = cl.getDeclaredConstructor((Class<?>[]) null);
+            Constructor<?> cons = cl.getDeclaredConstructor((Class<?>[]) null);
             cons.setAccessible(true);
             return ((cons.getModifiers() & Modifier.PUBLIC) != 0) ?
                 cons : null;
@@ -1324,7 +1324,7 @@
      * superclass, or null if none found.  Access checks are disabled on the
      * returned constructor (if any).
      */
-    private static Constructor getSerializableConstructor(Class<?> cl) {
+    private static Constructor<?> getSerializableConstructor(Class<?> cl) {
         Class<?> initCl = cl;
         while (Serializable.class.isAssignableFrom(initCl)) {
             if ((initCl = initCl.getSuperclass()) == null) {
@@ -1332,7 +1332,7 @@
             }
         }
         try {
-            Constructor cons = initCl.getDeclaredConstructor((Class<?>[]) null);
+            Constructor<?> cons = initCl.getDeclaredConstructor((Class<?>[]) null);
             int mods = cons.getModifiers();
             if ((mods & Modifier.PRIVATE) != 0 ||
                 ((mods & (Modifier.PUBLIC | Modifier.PROTECTED)) == 0 &&
@@ -1802,7 +1802,7 @@
             signature = getClassSignature(field.getType());
         }
 
-        public MemberSignature(Constructor cons) {
+        public MemberSignature(Constructor<?> cons) {
             member = cons;
             name = cons.getName();
             signature = getMethodSignature(
--- a/src/share/classes/java/io/RandomAccessFile.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/io/RandomAccessFile.java	Fri Dec 16 12:12:17 2011 -0800
@@ -1049,6 +1049,7 @@
      * @param      s   a string of bytes to be written.
      * @exception  IOException  if an I/O error occurs.
      */
+    @SuppressWarnings("deprecation")
     public final void writeBytes(String s) throws IOException {
         int len = s.length();
         byte[] b = new byte[len];
--- a/src/share/classes/java/io/SequenceInputStream.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/io/SequenceInputStream.java	Fri Dec 16 12:12:17 2011 -0800
@@ -44,7 +44,7 @@
  */
 public
 class SequenceInputStream extends InputStream {
-    Enumeration e;
+    Enumeration<? extends InputStream> e;
     InputStream in;
 
     /**
@@ -85,7 +85,7 @@
      * @param   s2   the second input stream to read.
      */
     public SequenceInputStream(InputStream s1, InputStream s2) {
-        Vector  v = new Vector(2);
+        Vector<InputStream> v = new Vector<>(2);
 
         v.addElement(s1);
         v.addElement(s2);
--- a/src/share/classes/java/lang/ClassLoader.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/lang/ClassLoader.java	Fri Dec 16 12:12:17 2011 -0800
@@ -258,7 +258,7 @@
     private final Set<ProtectionDomain> domains;
 
     // Invoked by the VM to record every loaded class with this loader.
-    void addClass(Class c) {
+    void addClass(Class<?> c) {
         classes.addElement(c);
     }
 
@@ -402,7 +402,7 @@
     {
         synchronized (getClassLoadingLock(name)) {
             // First, check if the class has already been loaded
-            Class c = findLoadedClass(name);
+            Class<?> c = findLoadedClass(name);
             if (c == null) {
                 long t0 = System.nanoTime();
                 try {
@@ -468,7 +468,7 @@
     }
 
     // This method is invoked by the virtual machine to load a class.
-    private Class loadClassInternal(String name)
+    private Class<?> loadClassInternal(String name)
         throws ClassNotFoundException
     {
         // For backward compatibility, explicitly lock on 'this' when
@@ -483,7 +483,7 @@
     }
 
     // Invoked by the VM after loading class with this loader.
-    private void checkPackageAccess(Class cls, ProtectionDomain pd) {
+    private void checkPackageAccess(Class<?> cls, ProtectionDomain pd) {
         final SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
             final String name = cls.getName();
@@ -669,9 +669,9 @@
         return source;
     }
 
-    private Class defineTransformedClass(String name, byte[] b, int off, int len,
-                                         ProtectionDomain pd,
-                                         ClassFormatError cfe, String source)
+    private Class<?> defineTransformedClass(String name, byte[] b, int off, int len,
+                                            ProtectionDomain pd,
+                                            ClassFormatError cfe, String source)
       throws ClassFormatError
     {
         // Class format error - try to transform the bytecode and
@@ -679,7 +679,7 @@
         //
         ClassFileTransformer[] transformers =
             ClassFileTransformer.getTransformers();
-        Class c = null;
+        Class<?> c = null;
 
         if (transformers != null) {
             for (ClassFileTransformer transformer : transformers) {
@@ -704,7 +704,7 @@
         return c;
     }
 
-    private void postDefineClass(Class c, ProtectionDomain pd)
+    private void postDefineClass(Class<?> c, ProtectionDomain pd)
     {
         if (pd.getCodeSource() != null) {
             Certificate certs[] = pd.getCodeSource().getCertificates();
@@ -784,7 +784,7 @@
     {
         protectionDomain = preDefineClass(name, protectionDomain);
 
-        Class c = null;
+        Class<?> c = null;
         String source = defineClassSourceLocation(protectionDomain);
 
         try {
@@ -882,7 +882,7 @@
 
         protectionDomain = preDefineClass(name, protectionDomain);
 
-        Class c = null;
+        Class<?> c = null;
         String source = defineClassSourceLocation(protectionDomain);
 
         try {
@@ -899,15 +899,15 @@
         return c;
     }
 
-    private native Class defineClass0(String name, byte[] b, int off, int len,
-                                      ProtectionDomain pd);
+    private native Class<?> defineClass0(String name, byte[] b, int off, int len,
+                                         ProtectionDomain pd);
 
-    private native Class defineClass1(String name, byte[] b, int off, int len,
-                                      ProtectionDomain pd, String source);
+    private native Class<?> defineClass1(String name, byte[] b, int off, int len,
+                                         ProtectionDomain pd, String source);
 
-    private native Class defineClass2(String name, java.nio.ByteBuffer b,
-                                      int off, int len, ProtectionDomain pd,
-                                      String source);
+    private native Class<?> defineClass2(String name, java.nio.ByteBuffer b,
+                                         int off, int len, ProtectionDomain pd,
+                                         String source);
 
     // true if the name is null or has the potential to be a valid binary name
     private boolean checkName(String name) {
@@ -1010,7 +1010,7 @@
         resolveClass0(c);
     }
 
-    private native void resolveClass0(Class c);
+    private native void resolveClass0(Class<?> c);
 
     /**
      * Finds a class with the specified <a href="#name">binary name</a>,
@@ -1041,7 +1041,7 @@
         if (system == null) {
             if (!checkName(name))
                 throw new ClassNotFoundException(name);
-            Class cls = findBootstrapClass(name);
+            Class<?> cls = findBootstrapClass(name);
             if (cls == null) {
                 throw new ClassNotFoundException(name);
             }
@@ -1054,7 +1054,7 @@
      * Returns a class loaded by the bootstrap class loader;
      * or return null if not found.
      */
-    private Class findBootstrapClassOrNull(String name)
+    private Class<?> findBootstrapClassOrNull(String name)
     {
         if (!checkName(name)) return null;
 
@@ -1062,7 +1062,7 @@
     }
 
     // return null if not found
-    private native Class findBootstrapClass(String name);
+    private native Class<?> findBootstrapClass(String name);
 
     /**
      * Returns the class with the given <a href="#name">binary name</a> if this
@@ -1084,7 +1084,7 @@
         return findLoadedClass0(name);
     }
 
-    private native final Class findLoadedClass0(String name);
+    private native final Class<?> findLoadedClass0(String name);
 
     /**
      * Sets the signers of a class.  This should be invoked after defining a
@@ -1528,7 +1528,7 @@
     // invocation and the desired invoker.
     static ClassLoader getCallerClassLoader() {
         // NOTE use of more generic Reflection.getCallerClass()
-        Class caller = Reflection.getCallerClass(3);
+        Class<?> caller = Reflection.getCallerClass(3);
         // This can be null if the VM is requesting it
         if (caller == null) {
             return null;
@@ -1722,7 +1722,7 @@
         private int jniVersion;
         // the class from which the library is loaded, also indicates
         // the loader this native library belongs.
-        private Class fromClass;
+        private Class<?> fromClass;
         // the canonicalized name of the native library.
         String name;
 
@@ -1730,7 +1730,7 @@
         native long find(String name);
         native void unload();
 
-        public NativeLibrary(Class fromClass, String name) {
+        public NativeLibrary(Class<?> fromClass, String name) {
             this.name = name;
             this.fromClass = fromClass;
         }
@@ -1758,7 +1758,7 @@
         }
         // Invoked in the VM to determine the context class in
         // JNI_Load/JNI_Unload
-        static Class getFromClass() {
+        static Class<?> getFromClass() {
             return ClassLoader.nativeLibraryContext.peek().fromClass;
         }
     }
@@ -1813,7 +1813,7 @@
     }
 
     // Invoked in the java.lang.Runtime class to implement load and loadLibrary.
-    static void loadLibrary(Class fromClass, String name,
+    static void loadLibrary(Class<?> fromClass, String name,
                             boolean isAbsolute) {
         ClassLoader loader =
             (fromClass == null) ? null : fromClass.getClassLoader();
@@ -1860,7 +1860,7 @@
         throw new UnsatisfiedLinkError("no " + name + " in java.library.path");
     }
 
-    private static boolean loadLibrary0(Class fromClass, final File file) {
+    private static boolean loadLibrary0(Class<?> fromClass, final File file) {
         boolean exists = AccessController.doPrivileged(
             new PrivilegedAction<Object>() {
                 public Object run() {
@@ -2194,8 +2194,8 @@
             return parent;
         }
 
-        Constructor ctor = Class.forName(cls, true, parent)
-            .getDeclaredConstructor(new Class[] { ClassLoader.class });
+        Constructor<?> ctor = Class.forName(cls, true, parent)
+            .getDeclaredConstructor(new Class<?>[] { ClassLoader.class });
         ClassLoader sys = (ClassLoader) ctor.newInstance(
             new Object[] { parent });
         Thread.currentThread().setContextClassLoader(sys);
--- a/src/share/classes/java/lang/Enum.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/lang/Enum.java	Fri Dec 16 12:12:17 2011 -0800
@@ -173,8 +173,8 @@
      * method is the order in which the constants are declared.
      */
     public final int compareTo(E o) {
-        Enum other = (Enum)o;
-        Enum self = this;
+        Enum<?> other = (Enum<?>)o;
+        Enum<E> self = this;
         if (self.getClass() != other.getClass() && // optimization
             self.getDeclaringClass() != other.getDeclaringClass())
             throw new ClassCastException();
@@ -193,10 +193,11 @@
      * @return the Class object corresponding to this enum constant's
      *     enum type
      */
+    @SuppressWarnings("unchecked")
     public final Class<E> getDeclaringClass() {
-        Class clazz = getClass();
-        Class zuper = clazz.getSuperclass();
-        return (zuper == Enum.class) ? clazz : zuper;
+        Class<?> clazz = getClass();
+        Class<?> zuper = clazz.getSuperclass();
+        return (zuper == Enum.class) ? (Class<E>)clazz : (Class<E>)zuper;
     }
 
     /**
--- a/src/share/classes/java/lang/Package.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/lang/Package.java	Fri Dec 16 12:12:17 2011 -0800
@@ -608,5 +608,5 @@
     private final String implVendor;
     private final URL sealBase;
     private transient final ClassLoader loader;
-    private transient Class packageInfo;
+    private transient Class<?> packageInfo;
 }
--- a/src/share/classes/java/lang/Runtime.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/lang/Runtime.java	Fri Dec 16 12:12:17 2011 -0800
@@ -780,7 +780,7 @@
         load0(System.getCallerClass(), filename);
     }
 
-    synchronized void load0(Class fromClass, String filename) {
+    synchronized void load0(Class<?> fromClass, String filename) {
         SecurityManager security = System.getSecurityManager();
         if (security != null) {
             security.checkLink(filename);
@@ -833,7 +833,7 @@
         loadLibrary0(System.getCallerClass(), libname);
     }
 
-    synchronized void loadLibrary0(Class fromClass, String libname) {
+    synchronized void loadLibrary0(Class<?> fromClass, String libname) {
         SecurityManager security = System.getSecurityManager();
         if (security != null) {
             security.checkLink(libname);
--- a/src/share/classes/java/lang/SecurityManager.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/lang/SecurityManager.java	Fri Dec 16 12:12:17 2011 -0800
@@ -400,7 +400,7 @@
      */
     @Deprecated
     protected Class<?> currentLoadedClass() {
-        Class c = currentLoadedClass0();
+        Class<?> c = currentLoadedClass0();
         if ((c != null) && hasAllPermission())
             c = null;
         return c;
@@ -1715,7 +1715,7 @@
         checkPermission(new SecurityPermission(target));
     }
 
-    private native Class currentLoadedClass0();
+    private native Class<?> currentLoadedClass0();
 
     /**
      * Returns the thread group into which to instantiate any new
--- a/src/share/classes/java/lang/String.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/lang/String.java	Fri Dec 16 12:12:17 2011 -0800
@@ -1245,6 +1245,9 @@
             }
             return n1 - n2;
         }
+
+        /** Replaces the de-serialized object. */
+        private Object readResolve() { return CASE_INSENSITIVE_ORDER; }
     }
 
     /**
--- a/src/share/classes/java/lang/System.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/lang/System.java	Fri Dec 16 12:12:17 2011 -0800
@@ -1171,13 +1171,13 @@
     private static void setJavaLangAccess() {
         // Allow privileged classes outside of java.lang
         sun.misc.SharedSecrets.setJavaLangAccess(new sun.misc.JavaLangAccess(){
-            public sun.reflect.ConstantPool getConstantPool(Class klass) {
+            public sun.reflect.ConstantPool getConstantPool(Class<?> klass) {
                 return klass.getConstantPool();
             }
-            public void setAnnotationType(Class klass, AnnotationType type) {
+            public void setAnnotationType(Class<?> klass, AnnotationType type) {
                 klass.setAnnotationType(type);
             }
-            public AnnotationType getAnnotationType(Class klass) {
+            public AnnotationType getAnnotationType(Class<?> klass) {
                 return klass.getAnnotationType();
             }
             public <E extends Enum<E>>
--- a/src/share/classes/java/lang/Thread.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/lang/Thread.java	Fri Dec 16 12:12:17 2011 -0800
@@ -1650,7 +1650,7 @@
      * security-sensitive non-final methods, or else the
      * "enableContextClassLoaderOverride" RuntimePermission is checked.
      */
-    private static boolean isCCLOverridden(Class cl) {
+    private static boolean isCCLOverridden(Class<?> cl) {
         if (cl == Thread.class)
             return false;
 
@@ -1670,21 +1670,21 @@
      * override security-sensitive non-final methods.  Returns true if the
      * subclass overrides any of the methods, false otherwise.
      */
-    private static boolean auditSubclass(final Class subcl) {
+    private static boolean auditSubclass(final Class<?> subcl) {
         Boolean result = AccessController.doPrivileged(
             new PrivilegedAction<Boolean>() {
                 public Boolean run() {
-                    for (Class cl = subcl;
+                    for (Class<?> cl = subcl;
                          cl != Thread.class;
                          cl = cl.getSuperclass())
                     {
                         try {
-                            cl.getDeclaredMethod("getContextClassLoader", new Class[0]);
+                            cl.getDeclaredMethod("getContextClassLoader", new Class<?>[0]);
                             return Boolean.TRUE;
                         } catch (NoSuchMethodException ex) {
                         }
                         try {
-                            Class[] params = {ClassLoader.class};
+                            Class<?>[] params = {ClassLoader.class};
                             cl.getDeclaredMethod("setContextClassLoader", params);
                             return Boolean.TRUE;
                         } catch (NoSuchMethodException ex) {
--- a/src/share/classes/java/lang/ThreadGroup.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/lang/ThreadGroup.java	Fri Dec 16 12:12:17 2011 -0800
@@ -670,6 +670,7 @@
      *     {@link Thread#suspend} for details.
      */
     @Deprecated
+    @SuppressWarnings("deprecation")
     public final void suspend() {
         if (stopOrSuspend(true))
             Thread.currentThread().suspend();
@@ -682,6 +683,7 @@
      * if (and only if) the current thread is found to be in this thread
      * group or one of its subgroups.
      */
+    @SuppressWarnings("deprecation")
     private boolean stopOrSuspend(boolean suspend) {
         boolean suicide = false;
         Thread us = Thread.currentThread();
@@ -731,6 +733,7 @@
      *       deadlock-prone.  See {@link Thread#suspend} for details.
      */
     @Deprecated
+    @SuppressWarnings("deprecation")
     public final void resume() {
         int ngroupsSnapshot;
         ThreadGroup[] groupsSnapshot;
--- a/src/share/classes/java/lang/instrument/ClassDefinition.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/lang/instrument/ClassDefinition.java	Fri Dec 16 12:12:17 2011 -0800
@@ -40,12 +40,12 @@
     /**
      *  The class to redefine
      */
-    private final   Class   mClass;
+    private final Class<?> mClass;
 
     /**
      *  The replacement class file bytes
      */
-    private final   byte[]  mClassFile;
+    private final byte[]   mClassFile;
 
     /**
      *  Creates a new <code>ClassDefinition</code> binding using the supplied
--- a/src/share/classes/java/lang/management/ManagementFactory.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/lang/management/ManagementFactory.java	Fri Dec 16 12:12:17 2011 -0800
@@ -576,7 +576,7 @@
                                Class<T> mxbeanInterface)
             throws java.io.IOException {
 
-        final Class interfaceClass = mxbeanInterface;
+        final Class<?> interfaceClass = mxbeanInterface;
         // Only allow MXBean interfaces from rt.jar loaded by the
         // bootstrap class loader
         final ClassLoader loader =
--- a/src/share/classes/java/lang/management/PlatformComponent.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/lang/management/PlatformComponent.java	Fri Dec 16 12:12:17 2011 -0800
@@ -314,7 +314,7 @@
     private final String domain;
     private final String type;
     private final Set<String> keyProperties;
-    private final MXBeanFetcher fetcher;
+    private final MXBeanFetcher<?> fetcher;
     private final PlatformComponent[] subComponents;
     private final boolean singleton;
 
@@ -322,7 +322,7 @@
                               String domain, String type,
                               Set<String> keyProperties,
                               boolean singleton,
-                              MXBeanFetcher fetcher,
+                              MXBeanFetcher<?> fetcher,
                               PlatformComponent... subComponents) {
         this.mxbeanInterfaceName = intfName;
         this.domain = domain;
@@ -373,7 +373,7 @@
     <T extends PlatformManagedObject>
         List<T> getMXBeans(Class<T> mxbeanInterface)
     {
-        return fetcher.getMXBeans();
+        return (List<T>) fetcher.getMXBeans();
     }
 
     <T extends PlatformManagedObject> T getSingletonMXBean(Class<T> mxbeanInterface)
@@ -382,7 +382,7 @@
             throw new IllegalArgumentException(mxbeanInterfaceName +
                 " can have zero or more than one instances");
 
-        List<T> list = fetcher.getMXBeans();
+        List<T> list = getMXBeans(mxbeanInterface);
         assert list.size() == 1;
         return list.isEmpty() ? null : list.get(0);
     }
--- a/src/share/classes/java/net/HttpCookie.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/net/HttpCookie.java	Fri Dec 16 12:12:17 2011 -0800
@@ -31,17 +31,15 @@
 import java.text.SimpleDateFormat;
 import java.util.TimeZone;
 import java.util.Date;
-
-import java.lang.NullPointerException;  // for javadoc
 import java.util.Locale;
 import java.util.Objects;
 
 /**
- * An HttpCookie object represents an http cookie, which carries state
+ * An HttpCookie object represents an HTTP cookie, which carries state
  * information between server and user agent. Cookie is widely adopted
  * to create stateful sessions.
  *
- * <p>There are 3 http cookie specifications:
+ * <p> There are 3 HTTP cookie specifications:
  * <blockquote>
  *   Netscape draft<br>
  *   RFC 2109 - <a href="http://www.ietf.org/rfc/rfc2109.txt">
@@ -50,25 +48,19 @@
  * <i>http://www.ietf.org/rfc/rfc2965.txt</i></a>
  * </blockquote>
  *
- * <p>HttpCookie class can accept all these 3 forms of syntax.
+ * <p> HttpCookie class can accept all these 3 forms of syntax.
  *
  * @author Edward Wang
  * @since 1.6
  */
 public final class HttpCookie implements Cloneable {
-    /* ---------------- Fields -------------- */
+    // ---------------- Fields --------------
 
-    //
     // The value of the cookie itself.
-    //
-
-    private String name;        // NAME= ... "$Name" style is reserved
+    private final String name;  // NAME= ... "$Name" style is reserved
     private String value;       // value of NAME
 
-    //
     // Attributes encoded in the header's cookie fields.
-    //
-
     private String comment;     // Comment=VALUE ... describes cookie's use
     private String commentURL;  // CommentURL="http URL" ... describes cookie's use
     private boolean toDiscard;  // Discard ... discard cookie unconditionally
@@ -80,70 +72,61 @@
     private boolean httpOnly;   // HttpOnly ... i.e. not accessible to scripts
     private int version = 1;    // Version=1 ... RFC 2965 style
 
-    //
     // Hold the creation time (in seconds) of the http cookie for later
     // expiration calculation
-    //
-    private long whenCreated = 0;
+    private final long whenCreated;
 
-
-    //
     // Since the positive and zero max-age have their meanings,
     // this value serves as a hint as 'not specify max-age'
-    //
     private final static long MAX_AGE_UNSPECIFIED = -1;
 
-
-    //
     // date formats used by Netscape's cookie draft
     // as well as formats seen on various sites
-    //
     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"
     };
 
-    //
     // constant strings represent set-cookie header token
-    //
     private final static String SET_COOKIE = "set-cookie:";
     private final static String SET_COOKIE2 = "set-cookie2:";
 
-
-    /* ---------------- Ctors -------------- */
+    // ---------------- Ctors --------------
 
     /**
      * Constructs a cookie with a specified name and value.
      *
-     * <p>The name must conform to RFC 2965. That means it can contain
+     * <p> The name must conform to RFC 2965. That means it can contain
      * only ASCII alphanumeric characters and cannot contain commas,
      * semicolons, or white space or begin with a $ character. The cookie's
      * name cannot be changed after creation.
      *
-     * <p>The value can be anything the server chooses to send. Its
+     * <p> The value can be anything the server chooses to send. Its
      * value is probably of interest only to the server. The cookie's
      * value can be changed after creation with the
-     * <code>setValue</code> method.
+     * {@code setValue} method.
      *
-     * <p>By default, cookies are created according to the RFC 2965
+     * <p> By default, cookies are created according to the RFC 2965
      * cookie specification. The version can be changed with the
-     * <code>setVersion</code> method.
+     * {@code setVersion} method.
      *
      *
-     * @param name                      a <code>String</code> specifying the name of the cookie
+     * @param  name
+     *         a {@code String} specifying the name of the cookie
      *
-     * @param value                     a <code>String</code> specifying the value of the cookie
+     * @param  value
+     *         a {@code String} specifying the value of the cookie
      *
-     * @throws IllegalArgumentException if the cookie name contains illegal characters
-     *                                  or it is one of the tokens reserved for use
-     *                                  by the cookie protocol
-     * @throws NullPointerException     if <tt>name</tt> is <tt>null</tt>
+     * @throws  IllegalArgumentException
+     *          if the cookie name contains illegal characters or it is one of
+     *          the tokens reserved for use by the cookie protocol
+     * @throws  NullPointerException
+     *          if {@code name} is {@code null}
+     *
      * @see #setValue
      * @see #setVersion
-     *
      */
-
     public HttpCookie(String name, String value) {
         name = name.trim();
         if (name.length() == 0 || !isToken(name) || isReserved(name)) {
@@ -159,23 +142,25 @@
         portlist = null;
     }
 
-
     /**
      * Constructs cookies from set-cookie or set-cookie2 header string.
      * RFC 2965 section 3.2.2 set-cookie2 syntax indicates that one header line
      * may contain more than one cookie definitions, so this is a static
      * utility method instead of another constructor.
      *
-     * @param header    a <tt>String</tt> specifying the set-cookie header.
-     *                  The header should start with "set-cookie", or "set-cookie2"
-     *                  token; or it should have no leading token at all.
-     * @return          a List of cookie parsed from header line string
-     * @throws IllegalArgumentException if header string violates the cookie
-     *                                  specification's syntax, or the cookie
-     *                                  name contains llegal characters, or
-     *                                  the cookie name is one of the tokens
-     *                                  reserved for use by the cookie protocol
-     * @throws NullPointerException     if the header string is <tt>null</tt>
+     * @param  header
+     *         a {@code String} specifying the set-cookie header. The header
+     *         should start with "set-cookie", or "set-cookie2" token; or it
+     *         should have no leading token at all.
+     *
+     * @return  a List of cookie parsed from header line string
+     *
+     * @throws  IllegalArgumentException
+     *          if header string violates the cookie specification's syntax, or
+     *          the cookie name contains illegal characters, or the cookie name
+     *          is one of the tokens reserved for use by the cookie protocol
+     * @throws  NullPointerException
+     *          if the header string is {@code null}
      */
     public static List<HttpCookie> parse(String header) {
         int version = guessCookieVersion(header);
@@ -187,10 +172,9 @@
             header = header.substring(SET_COOKIE.length());
         }
 
-
-        List<HttpCookie> cookies = new java.util.ArrayList<HttpCookie>();
-        // The Netscape cookie may have a comma in its expires attribute,
-        // while the comma is the delimiter in rfc 2965/2109 cookie header string.
+        List<HttpCookie> cookies = new java.util.ArrayList<>();
+        // The Netscape cookie may have a comma in its expires attribute, while
+        // the comma is the delimiter in rfc 2965/2109 cookie header string.
         // so the parse logic is slightly different
         if (version == 0) {
             // Netscape draft cookie
@@ -212,17 +196,13 @@
         return cookies;
     }
 
-
-
-
-    /* ---------------- Public operations -------------- */
-
+    // ---------------- Public operations --------------
 
     /**
-     * Reports whether this http cookie has expired or not.
+     * Reports whether this HTTP cookie has expired or not.
      *
-     * @return  <tt>true</tt> to indicate this http cookie has expired;
-     *          otherwise, <tt>false</tt>
+     * @return  {@code true} to indicate this HTTP cookie has expired;
+     *          otherwise, {@code false}
      */
     public boolean hasExpired() {
         if (maxAge == 0) return true;
@@ -240,155 +220,123 @@
     }
 
     /**
-     *
      * Specifies a comment that describes a cookie's purpose.
      * The comment is useful if the browser presents the cookie
-     * to the user. Comments
-     * are not supported by Netscape Version 0 cookies.
+     * to the user. Comments are not supported by Netscape Version 0 cookies.
      *
-     * @param purpose           a <code>String</code> specifying the comment
-     *                          to display to the user
+     * @param  purpose
+     *         a {@code String} specifying the comment to display to the user
      *
-     * @see #getComment
-     *
+     * @see  #getComment
      */
-
     public void setComment(String purpose) {
         comment = purpose;
     }
 
-
-
-
     /**
      * Returns the comment describing the purpose of this cookie, or
-     * <code>null</code> if the cookie has no comment.
+     * {@code null} if the cookie has no comment.
      *
-     * @return                  a <code>String</code> containing the comment,
-     *                          or <code>null</code> if none
+     * @return  a {@code String} containing the comment, or {@code null} if none
      *
-     * @see #setComment
-     *
+     * @see  #setComment
      */
-
     public String getComment() {
         return comment;
     }
 
-
     /**
+     * Specifies a comment URL that describes a cookie's purpose.
+     * The comment URL is useful if the browser presents the cookie
+     * to the user. Comment URL is RFC 2965 only.
      *
-     * Specifies a comment url that describes a cookie's purpose.
-     * The comment url is useful if the browser presents the cookie
-     * to the user. Comment url is RFC 2965 only.
+     * @param  purpose
+     *         a {@code String} specifying the comment URL to display to the user
      *
-     * @param purpose           a <code>String</code> specifying the comment url
-     *                          to display to the user
-     *
-     * @see #getCommentURL
-     *
+     * @see  #getCommentURL
      */
-
     public void setCommentURL(String purpose) {
         commentURL = purpose;
     }
 
-
-
-
     /**
-     * Returns the comment url describing the purpose of this cookie, or
-     * <code>null</code> if the cookie has no comment url.
+     * Returns the comment URL describing the purpose of this cookie, or
+     * {@code null} if the cookie has no comment URL.
      *
-     * @return                  a <code>String</code> containing the comment url,
-     *                          or <code>null</code> if none
+     * @return  a {@code String} containing the comment URL, or {@code null}
+     *          if none
      *
-     * @see #setCommentURL
-     *
+     * @see  #setCommentURL
      */
-
     public String getCommentURL() {
         return commentURL;
     }
 
-
     /**
      * Specify whether user agent should discard the cookie unconditionally.
      * This is RFC 2965 only attribute.
      *
-     * @param discard   <tt>true</tt> indicates to discard cookie unconditionally
+     * @param  discard
+     *         {@code true} indicates to discard cookie unconditionally
      *
-     * @see #getDiscard
+     * @see  #getDiscard
      */
-
     public void setDiscard(boolean discard) {
         toDiscard = discard;
     }
 
-
-
-
     /**
-     * Return the discard attribute of the cookie
+     * Returns the discard attribute of the cookie
      *
-     * @return  a <tt>boolean</tt> to represent this cookie's discard attribute
+     * @return  a {@code boolean} to represent this cookie's discard attribute
      *
-     * @see #setDiscard
+     * @see  #setDiscard
      */
-
     public boolean getDiscard() {
         return toDiscard;
     }
 
-
     /**
      * Specify the portlist of the cookie, which restricts the port(s)
      * to which a cookie may be sent back in a Cookie header.
      *
-     * @param ports     a <tt>String</tt> specify the port list, which is
-     *                  comma seperated series of digits
-     * @see #getPortlist
+     * @param  ports
+     *         a {@code String} specify the port list, which is comma separated
+     *         series of digits
+     *
+     * @see  #getPortlist
      */
-
     public void setPortlist(String ports) {
         portlist = ports;
     }
 
-
-
-
     /**
-     * Return the port list attribute of the cookie
+     * Returns the port list attribute of the cookie
      *
-     * @return  a <tt>String</tt> contains the port list
-     *          or <tt>null</tt> if none
-     * @see #setPortlist
+     * @return  a {@code String} contains the port list or {@code null} if none
+     *
+     * @see  #setPortlist
      */
-
     public String getPortlist() {
         return portlist;
     }
 
     /**
-     *
      * Specifies the domain within which this cookie should be presented.
      *
-     * <p>The form of the domain name is specified by RFC 2965. A domain
-     * name begins with a dot (<code>.foo.com</code>) and means that
+     * <p> The form of the domain name is specified by RFC 2965. A domain
+     * name begins with a dot ({@code .foo.com}) and means that
      * the cookie is visible to servers in a specified Domain Name System
-     * (DNS) zone (for example, <code>www.foo.com</code>, but not
-     * <code>a.b.foo.com</code>). By default, cookies are only returned
+     * (DNS) zone (for example, {@code www.foo.com}, but not
+     * {@code a.b.foo.com}). By default, cookies are only returned
      * to the server that sent them.
      *
+     * @param  pattern
+     *         a {@code String} containing the domain name within which this
+     *         cookie is visible; form is according to RFC 2965
      *
-     * @param pattern           a <code>String</code> containing the domain name
-     *                          within which this cookie is visible;
-     *                          form is according to RFC 2965
-     *
-     * @see #getDomain
-     *
+     * @see  #getDomain
      */
-
     public void setDomain(String pattern) {
         if (pattern != null)
             domain = pattern.toLowerCase();
@@ -396,261 +344,187 @@
             domain = pattern;
     }
 
-
-
-
-
     /**
-     * Returns the domain name set for this cookie. The form of
-     * the domain name is set by RFC 2965.
+     * Returns the domain name set for this cookie. The form of the domain name
+     * is set by RFC 2965.
      *
-     * @return                  a <code>String</code> containing the domain name
+     * @return  a {@code String} containing the domain name
      *
-     * @see #setDomain
-     *
+     * @see  #setDomain
      */
-
     public String getDomain() {
         return domain;
     }
 
-
     /**
      * Sets the maximum age of the cookie in seconds.
      *
-     * <p>A positive value indicates that the cookie will expire
+     * <p> A positive value indicates that the cookie will expire
      * after that many seconds have passed. Note that the value is
      * the <i>maximum</i> age when the cookie will expire, not the cookie's
      * current age.
      *
-     * <p>A negative value means
-     * that the cookie is not stored persistently and will be deleted
-     * when the Web browser exits. A zero value causes the cookie
-     * to be deleted.
+     * <p> A negative value means that the cookie is not stored persistently
+     * and will be deleted when the Web browser exits. A zero value causes the
+     * cookie to be deleted.
      *
-     * @param expiry            an integer specifying the maximum age of the
-     *                          cookie in seconds; if zero, the cookie
-     *                          should be discarded immediately;
-     *                          otherwise, the cookie's max age is unspecified.
+     * @param  expiry
+     *         an integer specifying the maximum age of the cookie in seconds;
+     *         if zero, the cookie should be discarded immediately; otherwise,
+     *         the cookie's max age is unspecified.
      *
-     * @see #getMaxAge
-     *
+     * @see  #getMaxAge
      */
     public void setMaxAge(long expiry) {
         maxAge = expiry;
     }
 
-
-
-
     /**
-     * Returns the maximum age of the cookie, specified in seconds.
-     * By default, <code>-1</code> indicating the cookie will persist
-     * until browser shutdown.
+     * Returns the maximum age of the cookie, specified in seconds. By default,
+     * {@code -1} indicating the cookie will persist until browser shutdown.
      *
+     * @return  an integer specifying the maximum age of the cookie in seconds
      *
-     * @return                  an integer specifying the maximum age of the
-     *                          cookie in seconds
-     *
-     *
-     * @see #setMaxAge
-     *
+     * @see  #setMaxAge
      */
-
     public long getMaxAge() {
         return maxAge;
     }
 
-
-
-
     /**
-     * Specifies a path for the cookie
-     * to which the client should return the cookie.
+     * Specifies a path for the cookie to which the client should return
+     * the cookie.
      *
-     * <p>The cookie is visible to all the pages in the directory
+     * <p> The cookie is visible to all the pages in the directory
      * you specify, and all the pages in that directory's subdirectories.
      * A cookie's path must include the servlet that set the cookie,
      * for example, <i>/catalog</i>, which makes the cookie
      * visible to all directories on the server under <i>/catalog</i>.
      *
-     * <p>Consult RFC 2965 (available on the Internet) for more
+     * <p> Consult RFC 2965 (available on the Internet) for more
      * information on setting path names for cookies.
      *
+     * @param  uri
+     *         a {@code String} specifying a path
      *
-     * @param uri               a <code>String</code> specifying a path
-     *
-     *
-     * @see #getPath
-     *
+     * @see  #getPath
      */
-
     public void setPath(String uri) {
         path = uri;
     }
 
-
-
-
     /**
-     * Returns the path on the server
-     * to which the browser returns this cookie. The
-     * cookie is visible to all subpaths on the server.
+     * Returns the path on the server to which the browser returns this cookie.
+     * The cookie is visible to all subpaths on the server.
      *
+     * @return  a {@code String} specifying a path that contains a servlet name,
+     *          for example, <i>/catalog</i>
      *
-     * @return          a <code>String</code> specifying a path that contains
-     *                  a servlet name, for example, <i>/catalog</i>
-     *
-     * @see #setPath
-     *
+     * @see  #setPath
      */
-
     public String getPath() {
         return path;
     }
 
-
-
-
-
     /**
      * Indicates whether the cookie should only be sent using a secure protocol,
      * such as HTTPS or SSL.
      *
-     * <p>The default value is <code>false</code>.
+     * <p> The default value is {@code false}.
      *
-     * @param flag      If <code>true</code>, the cookie can only be sent over
-     *                  a secure protocol like https.
-     *                  If <code>false</code>, it can be sent over any protocol.
+     * @param  flag
+     *         If {@code true}, the cookie can only be sent over a secure
+     *         protocol like HTTPS. If {@code false}, it can be sent over
+     *         any protocol.
      *
-     * @see #getSecure
-     *
+     * @see  #getSecure
      */
-
     public void setSecure(boolean flag) {
         secure = flag;
     }
 
-
-
-
     /**
-     * Returns <code>true</code> if sending this cookie should be
-     * restricted to a secure protocol, or <code>false</code> if the
-     * it can be sent using any protocol.
+     * Returns {@code true} if sending this cookie should be restricted to a
+     * secure protocol, or {@code false} if the it can be sent using any
+     * protocol.
      *
-     * @return          <code>false</code> if the cookie can be sent over
-     *                  any standard protocol; otherwise, <code>true</code>
+     * @return  {@code false} if the cookie can be sent over any standard
+     *          protocol; otherwise, <code>true</code>
      *
-     * @see #setSecure
-     *
+     * @see  #setSecure
      */
-
     public boolean getSecure() {
         return secure;
     }
 
-
-
-
-
     /**
      * Returns the name of the cookie. The name cannot be changed after
      * creation.
      *
-     * @return          a <code>String</code> specifying the cookie's name
-     *
+     * @return  a {@code String} specifying the cookie's name
      */
-
     public String getName() {
         return name;
     }
 
-
-
-
-
     /**
-     *
      * Assigns a new value to a cookie after the cookie is created.
      * If you use a binary value, you may want to use BASE64 encoding.
      *
-     * <p>With Version 0 cookies, values should not contain white
-     * space, brackets, parentheses, equals signs, commas,
-     * double quotes, slashes, question marks, at signs, colons,
-     * and semicolons. Empty values may not behave the same way
-     * on all browsers.
+     * <p> With Version 0 cookies, values should not contain white space,
+     * brackets, parentheses, equals signs, commas, double quotes, slashes,
+     * question marks, at signs, colons, and semicolons. Empty values may not
+     * behave the same way on all browsers.
      *
-     * @param newValue          a <code>String</code> specifying the new value
+     * @param  newValue
+     *         a {@code String} specifying the new value
      *
-     *
-     * @see #getValue
-     *
+     * @see  #getValue
      */
-
     public void setValue(String newValue) {
         value = newValue;
     }
 
-
-
-
     /**
      * Returns the value of the cookie.
      *
-     * @return                  a <code>String</code> containing the cookie's
-     *                          present value
+     * @return  a {@code String} containing the cookie's present value
      *
-     * @see #setValue
-     *
+     * @see  #setValue
      */
-
     public String getValue() {
         return value;
     }
 
-
-
-
     /**
-     * Returns the version of the protocol this cookie complies
-     * with. Version 1 complies with RFC 2965/2109,
-     * and version 0 complies with the original
-     * cookie specification drafted by Netscape. Cookies provided
-     * by a browser use and identify the browser's cookie version.
+     * Returns the version of the protocol this cookie complies with. Version 1
+     * complies with RFC 2965/2109, and version 0 complies with the original
+     * cookie specification drafted by Netscape. Cookies provided by a browser
+     * use and identify the browser's cookie version.
      *
+     * @return  0 if the cookie complies with the original Netscape
+     *          specification; 1 if the cookie complies with RFC 2965/2109
      *
-     * @return                  0 if the cookie complies with the
-     *                          original Netscape specification; 1
-     *                          if the cookie complies with RFC 2965/2109
-     *
-     * @see #setVersion
-     *
+     * @see  #setVersion
      */
-
     public int getVersion() {
         return version;
     }
 
-
-
-
     /**
      * Sets the version of the cookie protocol this cookie complies
      * with. Version 0 complies with the original Netscape cookie
      * specification. Version 1 complies with RFC 2965/2109.
      *
+     * @param  v
+     *         0 if the cookie should comply with the original Netscape
+     *         specification; 1 if the cookie should comply with RFC 2965/2109
      *
-     * @param v                 0 if the cookie should comply with
-     *                          the original Netscape specification;
-     *                          1 if the cookie should comply with RFC 2965/2109
+     * @throws  IllegalArgumentException
+     *          if {@code v} is neither 0 nor 1
      *
-     * @throws IllegalArgumentException if <tt>v</tt> is neither 0 nor 1
-     *
-     * @see #getVersion
-     *
+     * @see  #getVersion
      */
-
     public void setVersion(int v) {
         if (v != 0 && v != 1) {
             throw new IllegalArgumentException("cookie version should be 0 or 1");
@@ -664,11 +538,11 @@
      * attribute. This means that the cookie should not be accessible to
      * scripting engines, like javascript.
      *
-     * @return {@code true} if this cookie should be considered http only.
-     * @see #setHttpOnly(boolean)
+     * @return  {@code true} if this cookie should be considered HTTPOnly
+     *
+     * @see  #setHttpOnly(boolean)
      */
-    public boolean isHttpOnly()
-    {
+    public boolean isHttpOnly() {
         return httpOnly;
     }
 
@@ -677,24 +551,25 @@
      * {@code true} it means the cookie should not be accessible to scripting
      * engines like javascript.
      *
-     * @param httpOnly if {@code true} make the cookie HTTP only, i.e.
-     *                 only visible as part of an HTTP request.
-     * @see #isHttpOnly()
+     * @param  httpOnly
+     *         if {@code true} make the cookie HTTP only, i.e. only visible as
+     *         part of an HTTP request.
+     *
+     * @see  #isHttpOnly()
      */
-    public void setHttpOnly(boolean httpOnly)
-    {
+    public void setHttpOnly(boolean httpOnly) {
         this.httpOnly = httpOnly;
     }
 
     /**
-     * The utility method to check whether a host name is in a domain
-     * or not.
+     * The utility method to check whether a host name is in a domain or not.
      *
-     * <p>This concept is described in the cookie specification.
+     * <p> This concept is described in the cookie specification.
      * To understand the concept, some terminologies need to be defined first:
      * <blockquote>
      * effective host name = hostname if host name contains dot<br>
-     * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or = hostname.local if not
+     * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+     * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or = hostname.local if not
      * </blockquote>
      * <p>Host A's name domain-matches host B's if:
      * <blockquote><ul>
@@ -731,9 +606,13 @@
      *   host is example.local, and example.local domain-matches .local.</li>
      * </ul></blockquote>
      *
-     * @param domain    the domain name to check host name with
-     * @param host      the host name in question
-     * @return          <tt>true</tt> if they domain-matches; <tt>false</tt> if not
+     * @param  domain
+     *         the domain name to check host name with
+     *
+     * @param  host
+     *         the host name in question
+     *
+     * @return  {@code true} if they domain-matches; {@code false} if not
      */
     public static boolean domainMatches(String domain, String host) {
         if (domain == null || host == null)
@@ -745,7 +624,8 @@
         if (embeddedDotInDomain == 0)
             embeddedDotInDomain = domain.indexOf('.', 1);
         if (!isLocalDomain
-            && (embeddedDotInDomain == -1 || embeddedDotInDomain == domain.length() - 1))
+            && (embeddedDotInDomain == -1 ||
+                embeddedDotInDomain == domain.length() - 1))
             return false;
 
         // if the host name contains no dot and the domain name
@@ -779,7 +659,6 @@
         return false;
     }
 
-
     /**
      * Constructs a cookie header string representation of this cookie,
      * which is in the format defined by corresponding cookie specification,
@@ -796,17 +675,15 @@
         }
     }
 
-
     /**
-     * Test the equality of two http cookies.
+     * Test the equality of two HTTP cookies.
      *
-     * <p> The result is <tt>true</tt> only if two cookies
-     * come from same domain (case-insensitive),
-     * have same name (case-insensitive),
-     * and have same path (case-sensitive).
+     * <p> The result is {@code true} only if two cookies come from same domain
+     * (case-insensitive), have same name (case-insensitive), and have same path
+     * (case-sensitive).
      *
-     * @return          <tt>true</tt> if 2 http cookies equal to each other;
-     *                  otherwise, <tt>false</tt>
+     * @return  {@code true} if two HTTP cookies equal to each other;
+     *          otherwise, {@code false}
      */
     @Override
     public boolean equals(Object obj) {
@@ -825,19 +702,17 @@
                Objects.equals(getPath(), other.getPath());
     }
 
-
     /**
-     * Return hash code of this http cookie. The result is the sum of
-     * hash code value of three significant components of this cookie:
-     * name, domain, and path.
-     * That is, the hash code is the value of the expression:
+     * Returns the hash code of this HTTP cookie. The result is the sum of
+     * hash code value of three significant components of this cookie: name,
+     * domain, and path. That is, the hash code is the value of the expression:
      * <blockquote>
      * getName().toLowerCase().hashCode()<br>
      * + getDomain().toLowerCase().hashCode()<br>
      * + getPath().hashCode()
      * </blockquote>
      *
-     * @return          this http cookie's hash code
+     * @return  this HTTP cookie's hash code
      */
     @Override
     public int hashCode() {
@@ -851,7 +726,7 @@
     /**
      * Create and return a copy of this object.
      *
-     * @return          a clone of this http cookie
+     * @return  a clone of this HTTP cookie
      */
     @Override
     public Object clone() {
@@ -862,8 +737,7 @@
         }
     }
 
-
-    /* ---------------- Private operations -------------- */
+    // ---------------- Private operations --------------
 
     // Note -- disabled for now to allow full Netscape compatibility
     // from RFC 2068, token special case characters
@@ -872,15 +746,14 @@
     private static final String tspecials = ",;";
 
     /*
-     * Tests a string and returns true if the string counts as a
-     * token.
+     * Tests a string and returns true if the string counts as a token.
      *
-     * @param value             the <code>String</code> to be tested
+     * @param  value
+     *         the {@code String} to be tested
      *
-     * @return                  <code>true</code> if the <code>String</code> is
-     *                          a token; <code>false</code> if it is not
+     * @return  {@code true} if the {@code String} is a token;
+     *          {@code false} if it is not
      */
-
     private static boolean isToken(String value) {
         int len = value.length();
 
@@ -893,11 +766,12 @@
         return true;
     }
 
-
     /*
-     * @param name      the name to be tested
-     * @return          <tt>true</tt> if the name is reserved by cookie
-     *                  specification, <tt>false</tt> if it is not
+     * @param  name
+     *         the name to be tested
+     *
+     * @return  {@code true} if the name is reserved by cookie specification,
+     *          {@code false} if it is not
      */
     private static boolean isReserved(String name) {
         if (name.equalsIgnoreCase("Comment")
@@ -919,16 +793,16 @@
         return false;
     }
 
-
     /*
      * Parse header string to cookie object.
      *
-     * @param header    header string; should contain only one NAME=VALUE pair
+     * @param  header
+     *         header string; should contain only one NAME=VALUE pair
      *
-     * @return          an HttpCookie being extracted
+     * @return  an HttpCookie being extracted
      *
-     * @throws IllegalArgumentException if header string violates the cookie
-     *                                  specification
+     * @throws  IllegalArgumentException
+     *          if header string violates the cookie specification
      */
     private static HttpCookie parseInternal(String header)
     {
@@ -974,69 +848,97 @@
         return cookie;
     }
 
-
     /*
      * assign cookie attribute value to attribute name;
      * use a map to simulate method dispatch
      */
     static interface CookieAttributeAssignor {
-            public void assign(HttpCookie cookie, String attrName, String attrValue);
+            public void assign(HttpCookie cookie,
+                               String attrName,
+                               String attrValue);
     }
-    static java.util.Map<String, CookieAttributeAssignor> assignors = null;
+    static final java.util.Map<String, CookieAttributeAssignor> assignors =
+            new java.util.HashMap<>();
     static {
-        assignors = new java.util.HashMap<String, CookieAttributeAssignor>();
-        assignors.put("comment", new CookieAttributeAssignor(){
-                public void assign(HttpCookie cookie, String attrName, String attrValue) {
-                    if (cookie.getComment() == null) cookie.setComment(attrValue);
+        assignors.put("comment", new CookieAttributeAssignor() {
+                public void assign(HttpCookie cookie,
+                                   String attrName,
+                                   String attrValue) {
+                    if (cookie.getComment() == null)
+                        cookie.setComment(attrValue);
                 }
             });
-        assignors.put("commenturl", new CookieAttributeAssignor(){
-                public void assign(HttpCookie cookie, String attrName, String attrValue) {
-                    if (cookie.getCommentURL() == null) cookie.setCommentURL(attrValue);
+        assignors.put("commenturl", new CookieAttributeAssignor() {
+                public void assign(HttpCookie cookie,
+                                   String attrName,
+                                   String attrValue) {
+                    if (cookie.getCommentURL() == null)
+                        cookie.setCommentURL(attrValue);
                 }
             });
-        assignors.put("discard", new CookieAttributeAssignor(){
-                public void assign(HttpCookie cookie, String attrName, String attrValue) {
+        assignors.put("discard", new CookieAttributeAssignor() {
+                public void assign(HttpCookie cookie,
+                                   String attrName,
+                                   String attrValue) {
                     cookie.setDiscard(true);
                 }
             });
         assignors.put("domain", new CookieAttributeAssignor(){
-                public void assign(HttpCookie cookie, String attrName, String attrValue) {
-                    if (cookie.getDomain() == null) cookie.setDomain(attrValue);
+                public void assign(HttpCookie cookie,
+                                   String attrName,
+                                   String attrValue) {
+                    if (cookie.getDomain() == null)
+                        cookie.setDomain(attrValue);
                 }
             });
         assignors.put("max-age", new CookieAttributeAssignor(){
-                public void assign(HttpCookie cookie, String attrName, String attrValue) {
+                public void assign(HttpCookie cookie,
+                                   String attrName,
+                                   String attrValue) {
                     try {
                         long maxage = Long.parseLong(attrValue);
-                        if (cookie.getMaxAge() == MAX_AGE_UNSPECIFIED) cookie.setMaxAge(maxage);
+                        if (cookie.getMaxAge() == MAX_AGE_UNSPECIFIED)
+                            cookie.setMaxAge(maxage);
                     } catch (NumberFormatException ignored) {
-                        throw new IllegalArgumentException("Illegal cookie max-age attribute");
+                        throw new IllegalArgumentException(
+                                "Illegal cookie max-age attribute");
                     }
                 }
             });
         assignors.put("path", new CookieAttributeAssignor(){
-                public void assign(HttpCookie cookie, String attrName, String attrValue) {
-                    if (cookie.getPath() == null) cookie.setPath(attrValue);
+                public void assign(HttpCookie cookie,
+                                   String attrName,
+                                   String attrValue) {
+                    if (cookie.getPath() == null)
+                        cookie.setPath(attrValue);
                 }
             });
         assignors.put("port", new CookieAttributeAssignor(){
-                public void assign(HttpCookie cookie, String attrName, String attrValue) {
-                    if (cookie.getPortlist() == null) cookie.setPortlist(attrValue == null ? "" : attrValue);
+                public void assign(HttpCookie cookie,
+                                   String attrName,
+                                   String attrValue) {
+                    if (cookie.getPortlist() == null)
+                        cookie.setPortlist(attrValue == null ? "" : attrValue);
                 }
             });
         assignors.put("secure", new CookieAttributeAssignor(){
-                public void assign(HttpCookie cookie, String attrName, String attrValue) {
+                public void assign(HttpCookie cookie,
+                                   String attrName,
+                                   String attrValue) {
                     cookie.setSecure(true);
                 }
             });
         assignors.put("httponly", new CookieAttributeAssignor(){
-                public void assign(HttpCookie cookie, String attrName, String attrValue) {
+                public void assign(HttpCookie cookie,
+                                   String attrName,
+                                   String attrValue) {
                     cookie.setHttpOnly(true);
                 }
             });
         assignors.put("version", new CookieAttributeAssignor(){
-                public void assign(HttpCookie cookie, String attrName, String attrValue) {
+                public void assign(HttpCookie cookie,
+                                   String attrName,
+                                   String attrValue) {
                     try {
                         int version = Integer.parseInt(attrValue);
                         cookie.setVersion(version);
@@ -1046,7 +948,9 @@
                 }
             });
         assignors.put("expires", new CookieAttributeAssignor(){ // Netscape only
-                public void assign(HttpCookie cookie, String attrName, String attrValue) {
+                public void assign(HttpCookie cookie,
+                                   String attrName,
+                                   String attrValue) {
                     if (cookie.getMaxAge() == MAX_AGE_UNSPECIFIED) {
                         cookie.setMaxAge(cookie.expiryDate2DeltaSeconds(attrValue));
                     }
@@ -1054,8 +958,8 @@
             });
     }
     private static void assignAttribute(HttpCookie cookie,
-                                       String attrName,
-                                       String attrValue)
+                                        String attrName,
+                                        String attrValue)
     {
         // strip off the surrounding "-sign if there's any
         attrValue = stripOffSurroundingQuote(attrValue);
@@ -1073,11 +977,7 @@
      * as Netscape spec, but without leading "Cookie:" token.
      */
     private String toNetscapeHeaderString() {
-        StringBuilder sb = new StringBuilder();
-
-        sb.append(getName() + "=" + getValue());
-
-        return sb.toString();
+        return getName() + "=" + getValue();
     }
 
     /*
@@ -1101,15 +1001,16 @@
     static final TimeZone GMT = TimeZone.getTimeZone("GMT");
 
     /*
-     * @param dateString        a date string in one of the formats
-     *                          defined in Netscape cookie spec
+     * @param  dateString
+     *         a date string in one of the formats defined in Netscape cookie spec
      *
-     * @return                  delta seconds between this cookie's creation
-     *                          time and the time specified by dateString
+     * @return  delta seconds between this cookie's creation time and the time
+     *          specified by dateString
      */
     private long expiryDate2DeltaSeconds(String dateString) {
         for (int i = 0; i < COOKIE_DATE_FORMATS.length; i++) {
-            SimpleDateFormat df = new SimpleDateFormat(COOKIE_DATE_FORMATS[i], Locale.US);
+            SimpleDateFormat df = new SimpleDateFormat(COOKIE_DATE_FORMATS[i],
+                                                       Locale.US);
             df.setTimeZone(GMT);
             try {
                 Date date = df.parse(dateString);
@@ -1121,8 +1022,6 @@
         return 0;
     }
 
-
-
     /*
      * try to guess the cookie version through set-cookie header string
      */
@@ -1184,10 +1083,10 @@
      *   2) but not the comma surrounding by double-quotes, which is the comma
      *      inside port list or embeded URIs.
      *
-     * @param header            the cookie header string to split
+     * @param  header
+     *         the cookie header string to split
      *
-     * @return                  list of strings; never null
-     *
+     * @return  list of strings; never null
      */
     private static List<String> splitMultiCookies(String header) {
         List<String> cookies = new java.util.ArrayList<String>();
@@ -1197,7 +1096,8 @@
         for (p = 0, q = 0; p < header.length(); p++) {
             char c = header.charAt(p);
             if (c == '"') quoteCount++;
-            if (c == ',' && (quoteCount % 2 == 0)) {      // it is comma and not surrounding by double-quotes
+            if (c == ',' && (quoteCount % 2 == 0)) {
+                // it is comma and not surrounding by double-quotes
                 cookies.add(header.substring(q, p));
                 q = p + 1;
             }
--- a/src/share/classes/java/net/InetAddress.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/net/InetAddress.java	Fri Dec 16 12:12:17 2011 -0800
@@ -32,6 +32,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.ArrayList;
+import java.util.ServiceLoader;
 import java.security.AccessController;
 import java.io.ObjectStreamException;
 import java.io.IOException;
@@ -39,7 +40,6 @@
 import sun.security.action.*;
 import sun.net.InetAddressCachePolicy;
 import sun.net.util.IPAddressUtil;
-import sun.misc.Service;
 import sun.net.spi.nameservice.*;
 
 /**
@@ -876,10 +876,9 @@
                 nameService = java.security.AccessController.doPrivileged(
                     new java.security.PrivilegedExceptionAction<NameService>() {
                         public NameService run() {
-                            // sun.misc.Service.providers returns a raw Iterator
-                            @SuppressWarnings("unchecked")
                             Iterator<NameServiceDescriptor> itr =
-                                Service.providers(NameServiceDescriptor.class);
+                                ServiceLoader.load(NameServiceDescriptor.class)
+                                    .iterator();
                             while (itr.hasNext()) {
                                 NameServiceDescriptor nsd = itr.next();
                                 if (providerName.
--- a/src/share/classes/java/rmi/MarshalledObject.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/rmi/MarshalledObject.java	Fri Dec 16 12:12:17 2011 -0800
@@ -156,6 +156,7 @@
             (locBytes == null ? null : new ByteArrayInputStream(locBytes));
         MarshalledObjectInputStream in =
             new MarshalledObjectInputStream(bin, lin);
+        @SuppressWarnings("unchecked")
         T obj = (T) in.readObject();
         in.close();
         return obj;
@@ -190,7 +191,7 @@
             return true;
 
         if (obj != null && obj instanceof MarshalledObject) {
-            MarshalledObject other = (MarshalledObject) obj;
+            MarshalledObject<?> other = (MarshalledObject<?>) obj;
 
             // if either is a ref to null, both must be
             if (objBytes == null || other.objBytes == null)
--- a/src/share/classes/java/rmi/dgc/VMID.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/rmi/dgc/VMID.java	Fri Dec 16 12:12:17 2011 -0800
@@ -118,7 +118,7 @@
         StringBuffer result = new StringBuffer();
         if (addr != null)
             for (int i = 0; i < addr.length; ++ i) {
-                int x = (int) (addr[i] & 0xFF);
+                int x = addr[i] & 0xFF;
                 result.append((x < 0x10 ? "0" : "") +
                               Integer.toString(x, 16));
             }
--- a/src/share/classes/java/rmi/server/LogStream.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/rmi/server/LogStream.java	Fri Dec 16 12:12:17 2011 -0800
@@ -39,7 +39,7 @@
 public class LogStream extends PrintStream {
 
     /** table mapping known log names to log stream objects */
-    private static Hashtable    known = new Hashtable(5);
+    private static Map<String,LogStream> known = new HashMap<>(5);
     /** default output stream for new logs */
     private static PrintStream  defaultStream = System.err;
 
@@ -90,7 +90,7 @@
     public static LogStream log(String name) {
         LogStream stream;
         synchronized (known) {
-            stream = (LogStream)known.get(name);
+            stream = known.get(name);
             if (stream == null) {
                 stream = new LogStream(name, defaultStream);
             }
--- a/src/share/classes/java/rmi/server/RemoteObject.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/rmi/server/RemoteObject.java	Fri Dec 16 12:12:17 2011 -0800
@@ -436,7 +436,7 @@
              */
             String internalRefClassName =
                 RemoteRef.packagePrefix + "." + refClassName;
-            Class refClass = Class.forName(internalRefClassName);
+            Class<?> refClass = Class.forName(internalRefClassName);
             try {
                 ref = (RemoteRef) refClass.newInstance();
 
--- a/src/share/classes/java/sql/Date.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/sql/Date.java	Fri Dec 16 12:12:17 2011 -0800
@@ -150,6 +150,7 @@
      * <P>
      * @return a String in yyyy-mm-dd format
      */
+    @SuppressWarnings("deprecation")
     public String toString () {
         int year = super.getYear() + 1900;
         int month = super.getMonth() + 1;
--- a/src/share/classes/java/sql/DriverManager.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/sql/DriverManager.java	Fri Dec 16 12:12:17 2011 -0800
@@ -80,7 +80,7 @@
 
 
     // List of registered JDBC drivers
-    private final static CopyOnWriteArrayList<DriverInfo> registeredDrivers = new CopyOnWriteArrayList<DriverInfo>();
+    private final static CopyOnWriteArrayList<DriverInfo> registeredDrivers = new CopyOnWriteArrayList<>();
     private static volatile int loginTimeout = 0;
     private static volatile java.io.PrintWriter logWriter = null;
     private static volatile java.io.PrintStream logStream = null;
@@ -357,7 +357,7 @@
      * @return the list of JDBC Drivers loaded by the caller's class loader
      */
     public static java.util.Enumeration<Driver> getDrivers() {
-        java.util.Vector<Driver> result = new java.util.Vector<Driver>();
+        java.util.Vector<Driver> result = new java.util.Vector<>();
 
         // Gets the classloader of the code that called this method, may
         // be null.
@@ -621,15 +621,18 @@
         this.driver = driver;
     }
 
+    @Override
     public boolean equals(Object other) {
         return (other instanceof DriverInfo)
                 && this.driver == ((DriverInfo) other).driver;
     }
 
+    @Override
     public int hashCode() {
         return driver.hashCode();
     }
 
+    @Override
     public String toString() {
         return ("driver[className="  + driver + "]");
     }
--- a/src/share/classes/java/sql/Time.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/sql/Time.java	Fri Dec 16 12:12:17 2011 -0800
@@ -115,6 +115,7 @@
      *
      * @return a <code>String</code> in hh:mm:ss format
      */
+    @SuppressWarnings("deprecation")
     public String toString () {
         int hour = super.getHours();
         int minute = super.getMinutes();
--- a/src/share/classes/java/sql/Timestamp.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/sql/Timestamp.java	Fri Dec 16 12:12:17 2011 -0800
@@ -271,6 +271,7 @@
      * @return a <code>String</code> object in
      *           <code>yyyy-mm-dd hh:mm:ss.fffffffff</code> format
      */
+    @SuppressWarnings("deprecation")
     public String toString () {
 
         int year = super.getYear() + 1900;
--- a/src/share/classes/java/util/Currency.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/Currency.java	Fri Dec 16 12:12:17 2011 -0800
@@ -189,7 +189,7 @@
     private static final int VALID_FORMAT_VERSION = 1;
 
     static {
-        AccessController.doPrivileged(new PrivilegedAction() {
+        AccessController.doPrivileged(new PrivilegedAction<Object>() {
             public Object run() {
                 String homeDir = System.getProperty("java.home");
                 try {
@@ -431,7 +431,9 @@
             }
         }
 
-        return (Set<Currency>) available.clone();
+        @SuppressWarnings("unchecked")
+        Set<Currency> result = (Set<Currency>) available.clone();
+        return result;
     }
 
     /**
--- a/src/share/classes/java/util/Date.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/Date.java	Fri Dec 16 12:12:17 2011 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -770,7 +770,7 @@
      */
     @Deprecated
     public int getDay() {
-        return normalize().getDayOfWeek() - gcal.SUNDAY;
+        return normalize().getDayOfWeek() - BaseCalendar.SUNDAY;
     }
 
     /**
@@ -1027,7 +1027,7 @@
         BaseCalendar.Date date = normalize();
         StringBuilder sb = new StringBuilder(28);
         int index = date.getDayOfWeek();
-        if (index == gcal.SUNDAY) {
+        if (index == BaseCalendar.SUNDAY) {
             index = 8;
         }
         convertToAbbr(sb, wtb[index]).append(' ');                        // EEE
@@ -1039,7 +1039,7 @@
         CalendarUtils.sprintf0d(sb, date.getSeconds(), 2).append(' '); // ss
         TimeZone zi = date.getZone();
         if (zi != null) {
-            sb.append(zi.getDisplayName(date.isDaylightTime(), zi.SHORT, Locale.US)); // zzz
+            sb.append(zi.getDisplayName(date.isDaylightTime(), TimeZone.SHORT, Locale.US)); // zzz
         } else {
             sb.append("GMT");
         }
@@ -1237,7 +1237,7 @@
             }
             GregorianCalendar gc = new GregorianCalendar(tz);
             gc.clear();
-            gc.set(gc.MILLISECOND, ms);
+            gc.set(GregorianCalendar.MILLISECOND, ms);
             gc.set(y, m-1, d, hh, mm, ss);
             fastTime = gc.getTimeInMillis();
             BaseCalendar cal = getCalendarSystem(fastTime);
--- a/src/share/classes/java/util/Formatter.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/Formatter.java	Fri Dec 16 12:12:17 2011 -0800
@@ -2879,7 +2879,7 @@
         }
 
         public String toString() {
-            StringBuilder sb = new StringBuilder('%');
+            StringBuilder sb = new StringBuilder("%");
             // Flags.UPPERCASE is set internally for legal conversions.
             Flags dupf = f.dup().remove(Flags.UPPERCASE);
             sb.append(dupf.toString());
--- a/src/share/classes/java/util/GregorianCalendar.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/GregorianCalendar.java	Fri Dec 16 12:12:17 2011 -0800
@@ -947,7 +947,7 @@
             }
 
             if (month >= 0) {
-                set(MONTH, (int) (month % 12));
+                set(MONTH, month % 12);
             } else {
                 // month < 0
                 month %= 12;
@@ -1313,8 +1313,8 @@
                 }
 
                 // the first day of week of the month.
-                long monthDay1st = calsys.getDayOfWeekDateOnOrBefore(month1 + 6,
-                                                                     getFirstDayOfWeek());
+                long monthDay1st = BaseCalendar.getDayOfWeekDateOnOrBefore(month1 + 6,
+                                                                           getFirstDayOfWeek());
                 // if the week has enough days to form a week, the
                 // week starts from the previous month.
                 if ((int)(monthDay1st - month1) >= getMinimalDaysInFirstWeek()) {
@@ -1407,7 +1407,7 @@
                     return;
                 }
                 long fd = getCurrentFixedDate();
-                long dowFirst = calsys.getDayOfWeekDateOnOrBefore(fd, getFirstDayOfWeek());
+                long dowFirst = BaseCalendar.getDayOfWeekDateOnOrBefore(fd, getFirstDayOfWeek());
                 fd += amount;
                 if (fd < dowFirst) {
                     fd += 7;
@@ -1926,7 +1926,7 @@
      * Returns the millisecond offset from the beginning of this
      * year. This Calendar object must have been normalized.
      */
-    private final long getYearOffsetInMillis() {
+    private long getYearOffsetInMillis() {
         long t = (internalGet(DAY_OF_YEAR) - 1) * 24;
         t += internalGet(HOUR_OF_DAY);
         t *= 60;
@@ -2485,8 +2485,8 @@
                         if (cdate.isLeapYear()) {
                             nextJan1++;
                         }
-                        long nextJan1st = calsys.getDayOfWeekDateOnOrBefore(nextJan1 + 6,
-                                                                            getFirstDayOfWeek());
+                        long nextJan1st = BaseCalendar.getDayOfWeekDateOnOrBefore(nextJan1 + 6,
+                                                                                  getFirstDayOfWeek());
                         int ndays = (int)(nextJan1st - nextJan1);
                         if (ndays >= getMinimalDaysInFirstWeek() && fixedDate >= (nextJan1st - 7)) {
                             // The first days forms a week in which the date is included.
@@ -2518,8 +2518,8 @@
                         calForJan1 = gcal;
                     }
 
-                    long nextJan1st = calForJan1.getDayOfWeekDateOnOrBefore(nextJan1 + 6,
-                                                                            getFirstDayOfWeek());
+                    long nextJan1st = BaseCalendar.getDayOfWeekDateOnOrBefore(nextJan1 + 6,
+                                                                              getFirstDayOfWeek());
                     int ndays = (int)(nextJan1st - nextJan1);
                     if (ndays >= getMinimalDaysInFirstWeek() && fixedDate >= (nextJan1st - 7)) {
                         // The first days forms a week in which the date is included.
@@ -2543,11 +2543,11 @@
      * @param fixedDate the fixed date of the last day of the period
      * @return the number of weeks of the given period
      */
-    private final int getWeekNumber(long fixedDay1, long fixedDate) {
+    private int getWeekNumber(long fixedDay1, long fixedDate) {
         // We can always use `gcal' since Julian and Gregorian are the
         // same thing for this calculation.
-        long fixedDay1st = gcal.getDayOfWeekDateOnOrBefore(fixedDay1 + 6,
-                                                           getFirstDayOfWeek());
+        long fixedDay1st = Gregorian.getDayOfWeekDateOnOrBefore(fixedDay1 + 6,
+                                                                getFirstDayOfWeek());
         int ndays = (int)(fixedDay1st - fixedDay1);
         assert ndays <= 7;
         if (ndays >= getMinimalDaysInFirstWeek()) {
@@ -2818,16 +2818,16 @@
                 }
             } else {
                 if (isFieldSet(fieldMask, WEEK_OF_MONTH)) {
-                    long firstDayOfWeek = cal.getDayOfWeekDateOnOrBefore(fixedDate + 6,
-                                                                         getFirstDayOfWeek());
+                    long firstDayOfWeek = BaseCalendar.getDayOfWeekDateOnOrBefore(fixedDate + 6,
+                                                                                  getFirstDayOfWeek());
                     // If we have enough days in the first week, then
                     // move to the previous week.
                     if ((firstDayOfWeek - fixedDate) >= getMinimalDaysInFirstWeek()) {
                         firstDayOfWeek -= 7;
                     }
                     if (isFieldSet(fieldMask, DAY_OF_WEEK)) {
-                        firstDayOfWeek = cal.getDayOfWeekDateOnOrBefore(firstDayOfWeek + 6,
-                                                                        internalGet(DAY_OF_WEEK));
+                        firstDayOfWeek = BaseCalendar.getDayOfWeekDateOnOrBefore(firstDayOfWeek + 6,
+                                                                                 internalGet(DAY_OF_WEEK));
                     }
                     // In lenient mode, we treat days of the previous
                     // months as a part of the specified
@@ -2850,15 +2850,15 @@
                         dowim = 1;
                     }
                     if (dowim >= 0) {
-                        fixedDate = cal.getDayOfWeekDateOnOrBefore(fixedDate + (7 * dowim) - 1,
-                                                                   dayOfWeek);
+                        fixedDate = BaseCalendar.getDayOfWeekDateOnOrBefore(fixedDate + (7 * dowim) - 1,
+                                                                            dayOfWeek);
                     } else {
                         // Go to the first day of the next week of
                         // the specified week boundary.
                         int lastDate = monthLength(month, year) + (7 * (dowim + 1));
                         // Then, get the day of week date on or before the last date.
-                        fixedDate = cal.getDayOfWeekDateOnOrBefore(fixedDate + lastDate - 1,
-                                                                   dayOfWeek);
+                        fixedDate = BaseCalendar.getDayOfWeekDateOnOrBefore(fixedDate + lastDate - 1,
+                                                                            dayOfWeek);
                     }
                 }
             }
@@ -2877,8 +2877,8 @@
                 fixedDate += internalGet(DAY_OF_YEAR);
                 fixedDate--;
             } else {
-                long firstDayOfWeek = cal.getDayOfWeekDateOnOrBefore(fixedDate + 6,
-                                                                     getFirstDayOfWeek());
+                long firstDayOfWeek = BaseCalendar.getDayOfWeekDateOnOrBefore(fixedDate + 6,
+                                                                              getFirstDayOfWeek());
                 // If we have enough days in the first week, then move
                 // to the previous week.
                 if ((firstDayOfWeek - fixedDate) >= getMinimalDaysInFirstWeek()) {
@@ -2887,8 +2887,8 @@
                 if (isFieldSet(fieldMask, DAY_OF_WEEK)) {
                     int dayOfWeek = internalGet(DAY_OF_WEEK);
                     if (dayOfWeek != getFirstDayOfWeek()) {
-                        firstDayOfWeek = cal.getDayOfWeekDateOnOrBefore(firstDayOfWeek + 6,
-                                                                        dayOfWeek);
+                        firstDayOfWeek = BaseCalendar.getDayOfWeekDateOnOrBefore(firstDayOfWeek + 6,
+                                                                                 dayOfWeek);
                     }
                 }
                 fixedDate = firstDayOfWeek + 7 * ((long)internalGet(WEEK_OF_YEAR) - 1);
@@ -2903,7 +2903,7 @@
      * in sync). Otherwise, a cloned object is returned after calling
      * complete() in lenient mode.
      */
-    private final GregorianCalendar getNormalizedCalendar() {
+    private GregorianCalendar getNormalizedCalendar() {
         GregorianCalendar gc;
         if (isFullyNormalized()) {
             gc = this;
@@ -2920,7 +2920,7 @@
      * Returns the Julian calendar system instance (singleton). 'jcal'
      * and 'jeras' are set upon the return.
      */
-    synchronized private static final BaseCalendar getJulianCalendarSystem() {
+    synchronized private static BaseCalendar getJulianCalendarSystem() {
         if (jcal == null) {
             jcal = (JulianCalendar) CalendarSystem.forName("julian");
             jeras = jcal.getEras();
@@ -2958,7 +2958,7 @@
      * or Julian).
      * @param fixedDate the fixed date representation of the date
      */
-    private final long getFixedDateJan1(BaseCalendar.Date date, long fixedDate) {
+    private long getFixedDateJan1(BaseCalendar.Date date, long fixedDate) {
         assert date.getNormalizedYear() == gregorianCutoverYear ||
             date.getNormalizedYear() == gregorianCutoverYearJulian;
         if (gregorianCutoverYear != gregorianCutoverYearJulian) {
@@ -2984,7 +2984,7 @@
      * or Julian).
      * @param fixedDate the fixed date representation of the date
      */
-    private final long getFixedDateMonth1(BaseCalendar.Date date, long fixedDate) {
+    private long getFixedDateMonth1(BaseCalendar.Date date, long fixedDate) {
         assert date.getNormalizedYear() == gregorianCutoverYear ||
             date.getNormalizedYear() == gregorianCutoverYearJulian;
         BaseCalendar.Date gCutover = getGregorianCutoverDate();
@@ -3023,7 +3023,7 @@
      *
      * @param fd the fixed date
      */
-    private final BaseCalendar.Date getCalendarDate(long fd) {
+    private BaseCalendar.Date getCalendarDate(long fd) {
         BaseCalendar cal = (fd >= gregorianCutoverDate) ? gcal : getJulianCalendarSystem();
         BaseCalendar.Date d = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.NO_TIMEZONE);
         cal.getCalendarDateFromFixedDate(d, fd);
@@ -3034,7 +3034,7 @@
      * Returns the Gregorian cutover date as a BaseCalendar.Date. The
      * date is a Gregorian date.
      */
-    private final BaseCalendar.Date getGregorianCutoverDate() {
+    private BaseCalendar.Date getGregorianCutoverDate() {
         return getCalendarDate(gregorianCutoverDate);
     }
 
@@ -3042,7 +3042,7 @@
      * Returns the day before the Gregorian cutover date as a
      * BaseCalendar.Date. The date is a Julian date.
      */
-    private final BaseCalendar.Date getLastJulianDate() {
+    private BaseCalendar.Date getLastJulianDate() {
         return getCalendarDate(gregorianCutoverDate - 1);
     }
 
@@ -3052,7 +3052,7 @@
      *
      * @see #isLeapYear(int)
      */
-    private final int monthLength(int month, int year) {
+    private int monthLength(int month, int year) {
         return isLeapYear(year) ? LEAP_MONTH_LENGTH[month] : MONTH_LENGTH[month];
     }
 
@@ -3062,7 +3062,7 @@
      *
      * @see #isLeapYear(int)
      */
-    private final int monthLength(int month) {
+    private int monthLength(int month) {
         int year = internalGet(YEAR);
         if (internalGetEra() == BCE) {
             year = 1 - year;
@@ -3070,7 +3070,7 @@
         return monthLength(month, year);
     }
 
-    private final int actualMonthLength() {
+    private int actualMonthLength() {
         int year = cdate.getNormalizedYear();
         if (year != gregorianCutoverYear && year != gregorianCutoverYearJulian) {
             return calsys.getMonthLength(cdate);
@@ -3094,7 +3094,7 @@
      * Returns the length (in days) of the specified year. The year
      * must be normalized.
      */
-    private final int yearLength(int year) {
+    private int yearLength(int year) {
         return isLeapYear(year) ? 366 : 365;
     }
 
@@ -3102,7 +3102,7 @@
      * Returns the length (in days) of the year provided by
      * internalGet(YEAR).
      */
-    private final int yearLength() {
+    private int yearLength() {
         int year = internalGet(YEAR);
         if (internalGetEra() == BCE) {
             year = 1 - year;
@@ -3116,7 +3116,7 @@
      * 3, we want it to go to Feb 28.  Adjustments which might run into this
      * problem call this method to retain the proper month.
      */
-    private final void pinDayOfMonth() {
+    private void pinDayOfMonth() {
         int year = internalGet(YEAR);
         int monthLen;
         if (year > gregorianCutoverYear || year < gregorianCutoverYearJulian) {
@@ -3135,14 +3135,14 @@
      * Returns the fixed date value of this object. The time value and
      * calendar fields must be in synch.
      */
-    private final long getCurrentFixedDate() {
+    private long getCurrentFixedDate() {
         return (calsys == gcal) ? cachedFixedDate : calsys.getFixedDate(cdate);
     }
 
     /**
      * Returns the new value after 'roll'ing the specified value and amount.
      */
-    private static final int getRolledValue(int value, int amount, int min, int max) {
+    private static int getRolledValue(int value, int amount, int min, int max) {
         assert value >= min && value <= max;
         int range = max - min + 1;
         amount %= range;
@@ -3160,7 +3160,7 @@
      * Returns the ERA.  We need a special method for this because the
      * default ERA is CE, but a zero (unset) ERA is BCE.
      */
-    private final int internalGetEra() {
+    private int internalGetEra() {
         return isSet(ERA) ? internalGet(ERA) : CE;
     }
 
--- a/src/share/classes/java/util/JapaneseImperialCalendar.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/JapaneseImperialCalendar.java	Fri Dec 16 12:12:17 2011 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -260,8 +260,9 @@
             // max value could be one year short. For example, if it's
             // Showa 63 January 8, 63 is the actual max value since
             // Showa 64 January 8 doesn't exist.
-            if (!(lgd.getMonth() == BaseCalendar.JANUARY && lgd.getDayOfMonth() == 1))
+            if (!(lgd.getMonth() == BaseCalendar.JANUARY && lgd.getDayOfMonth() == 1)) {
                 y--;
+            }
             year = Math.min(y, year);
         }
         LEAST_MAX_VALUES[YEAR] = year; // Max year could be smaller than this value.
@@ -294,7 +295,7 @@
      * @param zone the given time zone.
      * @param aLocale the given locale.
      */
-    public JapaneseImperialCalendar(TimeZone zone, Locale aLocale) {
+    JapaneseImperialCalendar(TimeZone zone, Locale aLocale) {
         super(zone, aLocale);
         jdate = jcal.newCalendarDate(zone);
         setTimeInMillis(System.currentTimeMillis());
@@ -792,8 +793,8 @@
                 }
 
                 // the first day of week of the month.
-                long monthDay1st = jcal.getDayOfWeekDateOnOrBefore(month1 + 6,
-                                                                   getFirstDayOfWeek());
+                long monthDay1st = LocalGregorianCalendar.getDayOfWeekDateOnOrBefore(month1 + 6,
+                                                                                     getFirstDayOfWeek());
                 // if the week has enough days to form a week, the
                 // week starts from the previous month.
                 if ((int)(monthDay1st - month1) >= getMinimalDaysInFirstWeek()) {
@@ -884,7 +885,7 @@
                     return;
                 }
                 long fd = cachedFixedDate;
-                long dowFirst = jcal.getDayOfWeekDateOnOrBefore(fd, getFirstDayOfWeek());
+                long dowFirst = LocalGregorianCalendar.getDayOfWeekDateOnOrBefore(fd, getFirstDayOfWeek());
                 fd += amount;
                 if (fd < dowFirst) {
                     fd += 7;
@@ -963,8 +964,9 @@
                     Era era = eras[index];
                     name = (style == SHORT) ? era.getAbbreviation() : era.getName();
                 } else {
-                    if (field == DAY_OF_WEEK)
+                    if (field == DAY_OF_WEEK) {
                         --index;
+                    }
                     name = strings[index];
                 }
             }
@@ -1000,7 +1002,7 @@
     private Map<String,Integer> getDisplayNamesImpl(int field, int style, Locale locale) {
         ResourceBundle rb = LocaleData.getDateFormatData(locale);
         String key = getKey(field, style);
-        Map<String,Integer> map = new HashMap<String,Integer>();
+        Map<String,Integer> map = new HashMap<>();
         if (key != null) {
             String[] strings = rb.getStringArray(key);
             if (field == YEAR) {
@@ -1392,8 +1394,8 @@
                         jcal.normalize(jd);
                         long jan1 = jcal.getFixedDate(d);
                         long nextJan1 = jcal.getFixedDate(jd);
-                        long nextJan1st = jcal.getDayOfWeekDateOnOrBefore(nextJan1 + 6,
-                                                                          getFirstDayOfWeek());
+                        long nextJan1st = LocalGregorianCalendar.getDayOfWeekDateOnOrBefore(nextJan1 + 6,
+                                                                                            getFirstDayOfWeek());
                         int ndays = (int)(nextJan1st - nextJan1);
                         if (ndays >= getMinimalDaysInFirstWeek()) {
                             nextJan1st -= 7;
@@ -1523,7 +1525,7 @@
      * beyond the limit. The given CalendarDate object must have been
      * normalized before calling this method.
      */
-    private final long getYearOffsetInMillis(CalendarDate date) {
+    private long getYearOffsetInMillis(CalendarDate date) {
         long t = (jcal.getDayOfYear(date) - 1) * ONE_DAY;
         return t + date.getTimeOfDay() - date.getZoneOffset();
     }
@@ -1755,7 +1757,7 @@
                                 d.setMonth(pd.getMonth()).setDayOfMonth(pd.getDayOfMonth());
                             }
                         } else {
-                            d.setMonth(jcal.JANUARY).setDayOfMonth(1);
+                            d.setMonth(LocalGregorianCalendar.JANUARY).setDayOfMonth(1);
                         }
                         jcal.normalize(d);
                         prevJan1 = jcal.getFixedDate(d);
@@ -1780,8 +1782,8 @@
                         if (jdate.isLeapYear()) {
                             nextJan1++;
                         }
-                        long nextJan1st = jcal.getDayOfWeekDateOnOrBefore(nextJan1 + 6,
-                                                                          getFirstDayOfWeek());
+                        long nextJan1st = LocalGregorianCalendar.getDayOfWeekDateOnOrBefore(nextJan1 + 6,
+                                                                                            getFirstDayOfWeek());
                         int ndays = (int)(nextJan1st - nextJan1);
                         if (ndays >= getMinimalDaysInFirstWeek() && fixedDate >= (nextJan1st - 7)) {
                             // The first days forms a week in which the date is included.
@@ -1793,7 +1795,7 @@
                     long nextJan1;
                     if (jdate.getYear() == 1) {
                         d.addYear(+1);
-                        d.setMonth(jcal.JANUARY).setDayOfMonth(1);
+                        d.setMonth(LocalGregorianCalendar.JANUARY).setDayOfMonth(1);
                         nextJan1 = jcal.getFixedDate(d);
                     } else {
                         int nextEraIndex = getEraIndex(d) + 1;
@@ -1803,8 +1805,8 @@
                         jcal.normalize(d);
                         nextJan1 = jcal.getFixedDate(d);
                     }
-                    long nextJan1st = jcal.getDayOfWeekDateOnOrBefore(nextJan1 + 6,
-                                                                      getFirstDayOfWeek());
+                    long nextJan1st = LocalGregorianCalendar.getDayOfWeekDateOnOrBefore(nextJan1 + 6,
+                                                                                        getFirstDayOfWeek());
                     int ndays = (int)(nextJan1st - nextJan1);
                     if (ndays >= getMinimalDaysInFirstWeek() && fixedDate >= (nextJan1st - 7)) {
                         // The first days forms a week in which the date is included.
@@ -1828,11 +1830,11 @@
      * @param fixedDate the fixed date of the last day of the period
      * @return the number of weeks of the given period
      */
-    private final int getWeekNumber(long fixedDay1, long fixedDate) {
+    private int getWeekNumber(long fixedDay1, long fixedDate) {
         // We can always use `jcal' since Julian and Gregorian are the
         // same thing for this calculation.
-        long fixedDay1st = jcal.getDayOfWeekDateOnOrBefore(fixedDay1 + 6,
-                                                           getFirstDayOfWeek());
+        long fixedDay1st = LocalGregorianCalendar.getDayOfWeekDateOnOrBefore(fixedDay1 + 6,
+                                                                             getFirstDayOfWeek());
         int ndays = (int)(fixedDay1st - fixedDay1);
         assert ndays <= 7;
         if (ndays >= getMinimalDaysInFirstWeek()) {
@@ -2026,10 +2028,12 @@
         if (year == MIN_VALUES[YEAR]) {
             CalendarDate dx = jcal.getCalendarDate(Long.MIN_VALUE, getZone());
             int m = dx.getMonth() - 1;
-            if (month < m)
+            if (month < m) {
                 month = m;
-            if (month == m)
+            }
+            if (month == m) {
                 firstDayOfMonth = dx.getDayOfMonth();
+            }
         }
 
         LocalGregorianCalendar.Date date = jcal.newCalendarDate(TimeZone.NO_TIMEZONE);
@@ -2058,16 +2062,16 @@
                 }
             } else {
                 if (isFieldSet(fieldMask, WEEK_OF_MONTH)) {
-                    long firstDayOfWeek = jcal.getDayOfWeekDateOnOrBefore(fixedDate + 6,
-                                                                          getFirstDayOfWeek());
+                    long firstDayOfWeek = LocalGregorianCalendar.getDayOfWeekDateOnOrBefore(fixedDate + 6,
+                                                                                            getFirstDayOfWeek());
                     // If we have enough days in the first week, then
                     // move to the previous week.
                     if ((firstDayOfWeek - fixedDate) >= getMinimalDaysInFirstWeek()) {
                         firstDayOfWeek -= 7;
                     }
                     if (isFieldSet(fieldMask, DAY_OF_WEEK)) {
-                        firstDayOfWeek = jcal.getDayOfWeekDateOnOrBefore(firstDayOfWeek + 6,
-                                                                         internalGet(DAY_OF_WEEK));
+                        firstDayOfWeek = LocalGregorianCalendar.getDayOfWeekDateOnOrBefore(firstDayOfWeek + 6,
+                                                                                           internalGet(DAY_OF_WEEK));
                     }
                     // In lenient mode, we treat days of the previous
                     // months as a part of the specified
@@ -2090,15 +2094,15 @@
                         dowim = 1;
                     }
                     if (dowim >= 0) {
-                        fixedDate = jcal.getDayOfWeekDateOnOrBefore(fixedDate + (7 * dowim) - 1,
-                                                                    dayOfWeek);
+                        fixedDate = LocalGregorianCalendar.getDayOfWeekDateOnOrBefore(fixedDate + (7 * dowim) - 1,
+                                                                                      dayOfWeek);
                     } else {
                         // Go to the first day of the next week of
                         // the specified week boundary.
                         int lastDate = monthLength(month, year) + (7 * (dowim + 1));
                         // Then, get the day of week date on or before the last date.
-                        fixedDate = jcal.getDayOfWeekDateOnOrBefore(fixedDate + lastDate - 1,
-                                                                    dayOfWeek);
+                        fixedDate = LocalGregorianCalendar.getDayOfWeekDateOnOrBefore(fixedDate + lastDate - 1,
+                                                                                      dayOfWeek);
                     }
                 }
             }
@@ -2112,8 +2116,8 @@
                 fixedDate += internalGet(DAY_OF_YEAR);
                 fixedDate--;
             } else {
-                long firstDayOfWeek = jcal.getDayOfWeekDateOnOrBefore(fixedDate + 6,
-                                                                      getFirstDayOfWeek());
+                long firstDayOfWeek = LocalGregorianCalendar.getDayOfWeekDateOnOrBefore(fixedDate + 6,
+                                                                                        getFirstDayOfWeek());
                 // If we have enough days in the first week, then move
                 // to the previous week.
                 if ((firstDayOfWeek - fixedDate) >= getMinimalDaysInFirstWeek()) {
@@ -2122,8 +2126,8 @@
                 if (isFieldSet(fieldMask, DAY_OF_WEEK)) {
                     int dayOfWeek = internalGet(DAY_OF_WEEK);
                     if (dayOfWeek != getFirstDayOfWeek()) {
-                        firstDayOfWeek = jcal.getDayOfWeekDateOnOrBefore(firstDayOfWeek + 6,
-                                                                         dayOfWeek);
+                        firstDayOfWeek = LocalGregorianCalendar.getDayOfWeekDateOnOrBefore(firstDayOfWeek + 6,
+                                                                                           dayOfWeek);
                     }
                 }
                 fixedDate = firstDayOfWeek + 7 * ((long)internalGet(WEEK_OF_YEAR) - 1);
@@ -2140,7 +2144,7 @@
      * calculated. The date has to be in the cut-over year.
      * @param fixedDate the fixed date representation of the date
      */
-    private final long getFixedDateJan1(LocalGregorianCalendar.Date date, long fixedDate) {
+    private long getFixedDateJan1(LocalGregorianCalendar.Date date, long fixedDate) {
         Era era = date.getEra();
         if (date.getEra() != null && date.getYear() == 1) {
             for (int eraIndex = getEraIndex(date); eraIndex > 0; eraIndex--) {
@@ -2154,7 +2158,7 @@
             }
         }
         CalendarDate d = gcal.newCalendarDate(TimeZone.NO_TIMEZONE);
-        d.setDate(date.getNormalizedYear(), gcal.JANUARY, 1);
+        d.setDate(date.getNormalizedYear(), Gregorian.JANUARY, 1);
         return gcal.getFixedDate(d);
     }
 
@@ -2166,7 +2170,7 @@
      * calculated. The date must be in the era transition year.
      * @param fixedDate the fixed date representation of the date
      */
-    private final long getFixedDateMonth1(LocalGregorianCalendar.Date date,
+    private long getFixedDateMonth1(LocalGregorianCalendar.Date date,
                                           long fixedDate) {
         int eraIndex = getTransitionEraIndex(date);
         if (eraIndex != -1) {
@@ -2187,7 +2191,7 @@
      *
      * @param fd the fixed date
      */
-    private static final LocalGregorianCalendar.Date getCalendarDate(long fd) {
+    private static LocalGregorianCalendar.Date getCalendarDate(long fd) {
         LocalGregorianCalendar.Date d = jcal.newCalendarDate(TimeZone.NO_TIMEZONE);
         jcal.getCalendarDateFromFixedDate(d, fd);
         return d;
@@ -2199,7 +2203,7 @@
      *
      * @see #isLeapYear(int)
      */
-    private final int monthLength(int month, int gregorianYear) {
+    private int monthLength(int month, int gregorianYear) {
         return CalendarUtils.isGregorianLeapYear(gregorianYear) ?
             GregorianCalendar.LEAP_MONTH_LENGTH[month] : GregorianCalendar.MONTH_LENGTH[month];
     }
@@ -2210,13 +2214,13 @@
      *
      * @see #isLeapYear(int)
      */
-    private final int monthLength(int month) {
+    private int monthLength(int month) {
         assert jdate.isNormalized();
         return jdate.isLeapYear() ?
             GregorianCalendar.LEAP_MONTH_LENGTH[month] : GregorianCalendar.MONTH_LENGTH[month];
     }
 
-    private final int actualMonthLength() {
+    private int actualMonthLength() {
         int length = jcal.getMonthLength(jdate);
         int eraIndex = getTransitionEraIndex(jdate);
         if (eraIndex == -1) {
@@ -2239,7 +2243,7 @@
      * January 3, then the era index for Heisei is returned. If the
      * given date is not in any transition month, then -1 is returned.
      */
-    private static final int getTransitionEraIndex(LocalGregorianCalendar.Date date) {
+    private static int getTransitionEraIndex(LocalGregorianCalendar.Date date) {
         int eraIndex = getEraIndex(date);
         CalendarDate transitionDate = eras[eraIndex].getSinceDate();
         if (transitionDate.getYear() == date.getNormalizedYear() &&
@@ -2256,7 +2260,7 @@
         return -1;
     }
 
-    private final boolean isTransitionYear(int normalizedYear) {
+    private boolean isTransitionYear(int normalizedYear) {
         for (int i = eras.length - 1; i > 0; i--) {
             int transitionYear = eras[i].getSinceDate().getYear();
             if (normalizedYear == transitionYear) {
@@ -2269,7 +2273,7 @@
         return false;
     }
 
-    private static final int getEraIndex(LocalGregorianCalendar.Date date) {
+    private static int getEraIndex(LocalGregorianCalendar.Date date) {
         Era era = date.getEra();
         for (int i = eras.length - 1; i > 0; i--) {
             if (eras[i] == era) {
@@ -2284,7 +2288,7 @@
      * in sync). Otherwise, a cloned object is returned after calling
      * complete() in lenient mode.
      */
-    private final JapaneseImperialCalendar getNormalizedCalendar() {
+    private JapaneseImperialCalendar getNormalizedCalendar() {
         JapaneseImperialCalendar jc;
         if (isFullyNormalized()) {
             jc = this;
@@ -2303,7 +2307,7 @@
      * 3, we want it to go to Feb 28.  Adjustments which might run into this
      * problem call this method to retain the proper month.
      */
-    private final void pinDayOfMonth(LocalGregorianCalendar.Date date) {
+    private void pinDayOfMonth(LocalGregorianCalendar.Date date) {
         int year = date.getYear();
         int dom = date.getDayOfMonth();
         if (year != getMinimum(YEAR)) {
@@ -2347,7 +2351,7 @@
     /**
      * Returns the new value after 'roll'ing the specified value and amount.
      */
-    private static final int getRolledValue(int value, int amount, int min, int max) {
+    private static int getRolledValue(int value, int amount, int min, int max) {
         assert value >= min && value <= max;
         int range = max - min + 1;
         amount %= range;
@@ -2365,7 +2369,7 @@
      * Returns the ERA.  We need a special method for this because the
      * default ERA is the current era, but a zero (unset) ERA means before Meiji.
      */
-    private final int internalGetEra() {
+    private int internalGetEra() {
         return isSet(ERA) ? internalGet(ERA) : eras.length - 1;
     }
 
--- a/src/share/classes/java/util/PropertyPermission.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/PropertyPermission.java	Fri Dec 16 12:12:17 2011 -0800
@@ -305,7 +305,7 @@
                 switch(a[i-matchlen]) {
                 case ',':
                     seencomma = true;
-                    /*FALLTHROUGH*/
+                    break;
                 case ' ': case '\r': case '\n':
                 case '\f': case '\t':
                     break;
@@ -442,7 +442,7 @@
      * Key is property name; value is PropertyPermission.
      * Not serialized; see serialization section at end of class.
      */
-    private transient Map perms;
+    private transient Map<String, Permission> perms;
 
     /**
      * Boolean saying if "*" is in the collection.
@@ -458,7 +458,7 @@
      */
 
     public PropertyPermissionCollection() {
-        perms = new HashMap(32);     // Capacity for default policy
+        perms = new HashMap<>(32);     // Capacity for default policy
         all_allowed = false;
     }
 
@@ -593,7 +593,7 @@
      * @return an enumeration of all the PropertyPermission objects.
      */
 
-    public Enumeration elements() {
+    public Enumeration<Permission> elements() {
         // Convert Iterator of Map values into an Enumeration
         synchronized (this) {
             return Collections.enumeration(perms.values());
@@ -633,7 +633,7 @@
         // Don't call out.defaultWriteObject()
 
         // Copy perms into a Hashtable
-        Hashtable permissions = new Hashtable(perms.size()*2);
+        Hashtable<String, Permission> permissions = new Hashtable<>(perms.size()*2);
         synchronized (this) {
             permissions.putAll(perms);
         }
@@ -660,8 +660,10 @@
         all_allowed = gfields.get("all_allowed", false);
 
         // Get permissions
-        Hashtable permissions = (Hashtable)gfields.get("permissions", null);
-        perms = new HashMap(permissions.size()*2);
+        @SuppressWarnings("unchecked")
+        Hashtable<String, Permission> permissions =
+            (Hashtable<String, Permission>)gfields.get("permissions", null);
+        perms = new HashMap<>(permissions.size()*2);
         perms.putAll(permissions);
     }
 }
--- a/src/share/classes/java/util/ResourceBundle.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/ResourceBundle.java	Fri Dec 16 12:12:17 2011 -0800
@@ -294,7 +294,7 @@
     /**
      * Queue for reference objects referring to class loaders or bundles.
      */
-    private static final ReferenceQueue referenceQueue = new ReferenceQueue();
+    private static final ReferenceQueue<Object> referenceQueue = new ReferenceQueue<>();
 
     /**
      * The parent bundle of this bundle.
@@ -389,12 +389,13 @@
             if (parent != null) {
                 obj = parent.getObject(key);
             }
-            if (obj == null)
+            if (obj == null) {
                 throw new MissingResourceException("Can't find resource for bundle "
                                                    +this.getClass().getName()
                                                    +", key "+key,
                                                    this.getClass().getName(),
                                                    key);
+            }
         }
         return obj;
     }
@@ -418,7 +419,7 @@
     private static ClassLoader getLoader() {
         Class[] stack = getClassContext();
         /* Magic number 2 identifies our caller's caller */
-        Class c = stack[2];
+        Class<?> c = stack[2];
         ClassLoader cl = (c == null) ? null : c.getClassLoader();
         if (cl == null) {
             // When the caller's loader is the boot class loader, cl is null
@@ -488,7 +489,7 @@
      * null, but the base name and the locale must have a non-null
      * value.
      */
-    private static final class CacheKey implements Cloneable {
+    private static class CacheKey implements Cloneable {
         // These three are the actual keys for lookup in Map.
         private String name;
         private Locale locale;
@@ -583,8 +584,7 @@
                         // treat it as unequal
                         && (loader != null)
                         && (loader == otherEntry.loaderRef.get());
-            } catch (NullPointerException e) {
-            } catch (ClassCastException e) {
+            } catch (    NullPointerException | ClassCastException e) {
             }
             return false;
         }
@@ -669,11 +669,11 @@
      * garbage collected when nobody else is using them. The ResourceBundle
      * class has no reason to keep class loaders alive.
      */
-    private static final class LoaderReference extends WeakReference<ClassLoader>
-                                               implements CacheKeyReference {
+    private static class LoaderReference extends WeakReference<ClassLoader>
+                                         implements CacheKeyReference {
         private CacheKey cacheKey;
 
-        LoaderReference(ClassLoader referent, ReferenceQueue q, CacheKey key) {
+        LoaderReference(ClassLoader referent, ReferenceQueue<Object> q, CacheKey key) {
             super(referent, q);
             cacheKey = key;
         }
@@ -687,11 +687,11 @@
      * References to bundles are soft references so that they can be garbage
      * collected when they have no hard references.
      */
-    private static final class BundleReference extends SoftReference<ResourceBundle>
-                                               implements CacheKeyReference {
+    private static class BundleReference extends SoftReference<ResourceBundle>
+                                         implements CacheKeyReference {
         private CacheKey cacheKey;
 
-        BundleReference(ResourceBundle referent, ReferenceQueue q, CacheKey key) {
+        BundleReference(ResourceBundle referent, ReferenceQueue<Object> q, CacheKey key) {
             super(referent, q);
             cacheKey = key;
         }
@@ -1331,8 +1331,8 @@
      * Checks if the given <code>List</code> is not null, not empty,
      * not having null in its elements.
      */
-    private static final boolean checkList(List a) {
-        boolean valid = (a != null && a.size() != 0);
+    private static boolean checkList(List<?> a) {
+        boolean valid = (a != null && !a.isEmpty());
         if (valid) {
             int size = a.size();
             for (int i = 0; valid && i < size; i++) {
@@ -1342,12 +1342,12 @@
         return valid;
     }
 
-    private static final ResourceBundle findBundle(CacheKey cacheKey,
-                                                   List<Locale> candidateLocales,
-                                                   List<String> formats,
-                                                   int index,
-                                                   Control control,
-                                                   ResourceBundle baseBundle) {
+    private static ResourceBundle findBundle(CacheKey cacheKey,
+                                             List<Locale> candidateLocales,
+                                             List<String> formats,
+                                             int index,
+                                             Control control,
+                                             ResourceBundle baseBundle) {
         Locale targetLocale = candidateLocales.get(index);
         ResourceBundle parent = null;
         if (index != candidateLocales.size() - 1) {
@@ -1419,10 +1419,10 @@
         return parent;
     }
 
-    private static final ResourceBundle loadBundle(CacheKey cacheKey,
-                                                   List<String> formats,
-                                                   Control control,
-                                                   boolean reload) {
+    private static ResourceBundle loadBundle(CacheKey cacheKey,
+                                             List<String> formats,
+                                             Control control,
+                                             boolean reload) {
 
         // Here we actually load the bundle in the order of formats
         // specified by the getFormats() value.
@@ -1459,7 +1459,7 @@
         return bundle;
     }
 
-    private static final boolean isValidBundle(ResourceBundle bundle) {
+    private static boolean isValidBundle(ResourceBundle bundle) {
         return bundle != null && bundle != NONEXISTENT_BUNDLE;
     }
 
@@ -1467,7 +1467,7 @@
      * Determines whether any of resource bundles in the parent chain,
      * including the leaf, have expired.
      */
-    private static final boolean hasValidParentChain(ResourceBundle bundle) {
+    private static boolean hasValidParentChain(ResourceBundle bundle) {
         long now = System.currentTimeMillis();
         while (bundle != null) {
             if (bundle.expired) {
@@ -1488,9 +1488,9 @@
     /**
      * Throw a MissingResourceException with proper message
      */
-    private static final void throwMissingResourceException(String baseName,
-                                                            Locale locale,
-                                                            Throwable cause) {
+    private static void throwMissingResourceException(String baseName,
+                                                      Locale locale,
+                                                      Throwable cause) {
         // If the cause is a MissingResourceException, avoid creating
         // a long chain. (6355009)
         if (cause instanceof MissingResourceException) {
@@ -1513,8 +1513,8 @@
      * cache or its parent has expired. <code>bundle.expire</code> is true
      * upon return if the bundle in the cache has expired.
      */
-    private static final ResourceBundle findBundleInCache(CacheKey cacheKey,
-                                                          Control control) {
+    private static ResourceBundle findBundleInCache(CacheKey cacheKey,
+                                                    Control control) {
         BundleReference bundleRef = cacheList.get(cacheKey);
         if (bundleRef == null) {
             return null;
@@ -1620,9 +1620,9 @@
      * the bundle before this call, the one found in the cache is
      * returned.
      */
-    private static final ResourceBundle putBundleInCache(CacheKey cacheKey,
-                                                         ResourceBundle bundle,
-                                                         Control control) {
+    private static ResourceBundle putBundleInCache(CacheKey cacheKey,
+                                                   ResourceBundle bundle,
+                                                   Control control) {
         setExpirationTime(cacheKey, control);
         if (cacheKey.expirationTime != Control.TTL_DONT_CACHE) {
             CacheKey key = (CacheKey) cacheKey.clone();
@@ -1653,7 +1653,7 @@
         return bundle;
     }
 
-    private static final void setExpirationTime(CacheKey cacheKey, Control control) {
+    private static void setExpirationTime(CacheKey cacheKey, Control control) {
         long ttl = control.getTimeToLive(cacheKey.getName(),
                                          cacheKey.getLocale());
         if (ttl >= 0) {
@@ -2350,18 +2350,27 @@
                     if (script.length() == 0 && region.length() > 0) {
                         // Supply script for users who want to use zh_Hans/zh_Hant
                         // as bundle names (recommended for Java7+)
-                        if (region.equals("TW") || region.equals("HK") || region.equals("MO")) {
+                        switch (region) {
+                        case "TW":
+                        case "HK":
+                        case "MO":
                             script = "Hant";
-                        } else if (region.equals("CN") || region.equals("SG")) {
+                            break;
+                        case "CN":
+                        case "SG":
                             script = "Hans";
+                            break;
                         }
                     } else if (script.length() > 0 && region.length() == 0) {
                         // Supply region(country) for users who still package Chinese
                         // bundles using old convension.
-                        if (script.equals("Hans")) {
+                        switch (script) {
+                        case "Hans":
                             region = "CN";
-                        } else if (script.equals("Hant")) {
+                            break;
+                        case "Hant":
                             region = "TW";
+                            break;
                         }
                     }
                 }
@@ -2562,6 +2571,7 @@
             ResourceBundle bundle = null;
             if (format.equals("java.class")) {
                 try {
+                    @SuppressWarnings("unchecked")
                     Class<? extends ResourceBundle> bundleClass
                         = (Class<? extends ResourceBundle>)loader.loadClass(bundleName);
 
--- a/src/share/classes/java/util/concurrent/atomic/AtomicBoolean.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicBoolean.java	Fri Dec 16 12:12:17 2011 -0800
@@ -54,10 +54,10 @@
     private static final long valueOffset;
 
     static {
-      try {
-        valueOffset = unsafe.objectFieldOffset
-            (AtomicBoolean.class.getDeclaredField("value"));
-      } catch (Exception ex) { throw new Error(ex); }
+        try {
+            valueOffset = unsafe.objectFieldOffset
+                (AtomicBoolean.class.getDeclaredField("value"));
+        } catch (Exception ex) { throw new Error(ex); }
     }
 
     private volatile int value;
--- a/src/share/classes/java/util/concurrent/atomic/AtomicInteger.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicInteger.java	Fri Dec 16 12:12:17 2011 -0800
@@ -57,10 +57,10 @@
     private static final long valueOffset;
 
     static {
-      try {
-        valueOffset = unsafe.objectFieldOffset
-            (AtomicInteger.class.getDeclaredField("value"));
-      } catch (Exception ex) { throw new Error(ex); }
+        try {
+            valueOffset = unsafe.objectFieldOffset
+                (AtomicInteger.class.getDeclaredField("value"));
+        } catch (Exception ex) { throw new Error(ex); }
     }
 
     private volatile int value;
@@ -247,8 +247,7 @@
 
 
     /**
-     * Returns the value of this {@code AtomicInteger} as an
-     * {@code int}.
+     * Returns the value of this {@code AtomicInteger} as an {@code int}.
      */
     public int intValue() {
         return get();
--- a/src/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java	Fri Dec 16 12:12:17 2011 -0800
@@ -35,7 +35,6 @@
 
 package java.util.concurrent.atomic;
 import sun.misc.Unsafe;
-import java.util.*;
 
 /**
  * An {@code int} array in which elements may be updated atomically.
--- a/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java	Fri Dec 16 12:12:17 2011 -0800
@@ -135,7 +135,6 @@
      */
     public abstract void lazySet(T obj, int newValue);
 
-
     /**
      * Gets the current value held in the field of the given object managed
      * by this updater.
@@ -266,11 +265,11 @@
         private static final Unsafe unsafe = Unsafe.getUnsafe();
         private final long offset;
         private final Class<T> tclass;
-        private final Class cclass;
+        private final Class<?> cclass;
 
         AtomicIntegerFieldUpdaterImpl(Class<T> tclass, String fieldName) {
             Field field = null;
-            Class caller = null;
+            Class<?> caller = null;
             int modifiers = 0;
             try {
                 field = tclass.getDeclaredField(fieldName);
@@ -283,7 +282,7 @@
                 throw new RuntimeException(ex);
             }
 
-            Class fieldt = field.getType();
+            Class<?> fieldt = field.getType();
             if (fieldt != int.class)
                 throw new IllegalArgumentException("Must be integer type");
 
--- a/src/share/classes/java/util/concurrent/atomic/AtomicLong.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicLong.java	Fri Dec 16 12:12:17 2011 -0800
@@ -71,10 +71,10 @@
     private static native boolean VMSupportsCS8();
 
     static {
-      try {
-        valueOffset = unsafe.objectFieldOffset
-            (AtomicLong.class.getDeclaredField("value"));
-      } catch (Exception ex) { throw new Error(ex); }
+        try {
+            valueOffset = unsafe.objectFieldOffset
+                (AtomicLong.class.getDeclaredField("value"));
+        } catch (Exception ex) { throw new Error(ex); }
     }
 
     private volatile long value;
@@ -270,8 +270,7 @@
     }
 
     /**
-     * Returns the value of this {@code AtomicLong} as a {@code long}
-     * value.
+     * Returns the value of this {@code AtomicLong} as a {@code long}.
      */
     public long longValue() {
         return get();
@@ -287,8 +286,8 @@
     }
 
     /**
-     * Returns the value of this {@code AtomicLong} as a {@code
-     * double} after a widening primitive conversion.
+     * Returns the value of this {@code AtomicLong} as a {@code double}
+     * after a widening primitive conversion.
      * @jls 5.1.2 Widening Primitive Conversions
      */
     public double doubleValue() {
--- a/src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicLongArray.java	Fri Dec 16 12:12:17 2011 -0800
@@ -35,7 +35,6 @@
 
 package java.util.concurrent.atomic;
 import sun.misc.Unsafe;
-import java.util.*;
 
 /**
  * A {@code long} array in which elements may be updated atomically.
@@ -136,7 +135,6 @@
         unsafe.putOrderedLong(array, checkedByteOffset(i), newValue);
     }
 
-
     /**
      * Atomically sets the element at position {@code i} to the given value
      * and returns the old value.
--- a/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java	Fri Dec 16 12:12:17 2011 -0800
@@ -265,11 +265,11 @@
         private static final Unsafe unsafe = Unsafe.getUnsafe();
         private final long offset;
         private final Class<T> tclass;
-        private final Class cclass;
+        private final Class<?> cclass;
 
         CASUpdater(Class<T> tclass, String fieldName) {
             Field field = null;
-            Class caller = null;
+            Class<?> caller = null;
             int modifiers = 0;
             try {
                 field = tclass.getDeclaredField(fieldName);
@@ -282,7 +282,7 @@
                 throw new RuntimeException(ex);
             }
 
-            Class fieldt = field.getType();
+            Class<?> fieldt = field.getType();
             if (fieldt != long.class)
                 throw new IllegalArgumentException("Must be long type");
 
@@ -348,11 +348,11 @@
         private static final Unsafe unsafe = Unsafe.getUnsafe();
         private final long offset;
         private final Class<T> tclass;
-        private final Class cclass;
+        private final Class<?> cclass;
 
         LockedUpdater(Class<T> tclass, String fieldName) {
             Field field = null;
-            Class caller = null;
+            Class<?> caller = null;
             int modifiers = 0;
             try {
                 field = tclass.getDeclaredField(fieldName);
@@ -365,7 +365,7 @@
                 throw new RuntimeException(ex);
             }
 
-            Class fieldt = field.getType();
+            Class<?> fieldt = field.getType();
             if (fieldt != long.class)
                 throw new IllegalArgumentException("Must be long type");
 
--- a/src/share/classes/java/util/concurrent/atomic/AtomicReference.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicReference.java	Fri Dec 16 12:12:17 2011 -0800
@@ -51,10 +51,10 @@
     private static final long valueOffset;
 
     static {
-      try {
-        valueOffset = unsafe.objectFieldOffset
-            (AtomicReference.class.getDeclaredField("value"));
-      } catch (Exception ex) { throw new Error(ex); }
+        try {
+            valueOffset = unsafe.objectFieldOffset
+                (AtomicReference.class.getDeclaredField("value"));
+        } catch (Exception ex) { throw new Error(ex); }
     }
 
     private volatile V value;
--- a/src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java	Fri Dec 16 12:12:17 2011 -0800
@@ -113,6 +113,7 @@
         return getRaw(checkedByteOffset(i));
     }
 
+    @SuppressWarnings("unchecked")
     private E getRaw(long offset) {
         return (E) unsafe.getObjectVolatile(array, offset);
     }
@@ -150,7 +151,7 @@
     public final E getAndSet(int i, E newValue) {
         long offset = checkedByteOffset(i);
         while (true) {
-            E current = (E) getRaw(offset);
+            E current = getRaw(offset);
             if (compareAndSetRaw(offset, current, newValue))
                 return current;
         }
--- a/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Fri Dec 16 12:12:17 2011 -0800
@@ -183,7 +183,7 @@
         private final long offset;
         private final Class<T> tclass;
         private final Class<V> vclass;
-        private final Class cclass;
+        private final Class<?> cclass;
 
         /*
          * Internal type checks within all update methods contain
@@ -201,8 +201,8 @@
                                         Class<V> vclass,
                                         String fieldName) {
             Field field = null;
-            Class fieldClass = null;
-            Class caller = null;
+            Class<?> fieldClass = null;
+            Class<?> caller = null;
             int modifiers = 0;
             try {
                 field = tclass.getDeclaredField(fieldName);
@@ -280,6 +280,7 @@
             unsafe.putOrderedObject(obj, offset, newValue);
         }
 
+        @SuppressWarnings("unchecked")
         public V get(T obj) {
             if (obj == null || obj.getClass() != tclass || cclass != null)
                 targetCheck(obj);
--- a/src/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/concurrent/atomic/AtomicStampedReference.java	Fri Dec 16 12:12:17 2011 -0800
@@ -155,7 +155,6 @@
              casPair(current, Pair.of(newReference, newStamp)));
     }
 
-
     /**
      * Unconditionally sets the value of both the reference and stamp.
      *
--- a/src/share/classes/java/util/jar/JarVerifier.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/jar/JarVerifier.java	Fri Dec 16 12:12:17 2011 -0800
@@ -90,7 +90,7 @@
     private Object csdomain = new Object();
 
     /** collect -DIGEST-MANIFEST values for blacklist */
-    private List manifestDigests;
+    private List<Object> manifestDigests;
 
     public JarVerifier(byte rawBytes[]) {
         manifestRawBytes = rawBytes;
@@ -99,7 +99,7 @@
         sigFileData = new Hashtable(11);
         pendingBlocks = new ArrayList();
         baos = new ByteArrayOutputStream();
-        manifestDigests = new ArrayList();
+        manifestDigests = new ArrayList<>();
     }
 
     /**
@@ -872,7 +872,7 @@
         eagerValidation = eager;
     }
 
-    public synchronized List getManifestDigests() {
+    public synchronized List<Object> getManifestDigests() {
         return Collections.unmodifiableList(manifestDigests);
     }
 
--- a/src/share/classes/java/util/jar/JavaUtilJarAccessImpl.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/jar/JavaUtilJarAccessImpl.java	Fri Dec 16 12:12:17 2011 -0800
@@ -57,7 +57,7 @@
         jar.setEagerValidation(eager);
     }
 
-    public List getManifestDigests(JarFile jar) {
+    public List<Object> getManifestDigests(JarFile jar) {
         return jar.getManifestDigests();
     }
 }
--- a/src/share/classes/java/util/zip/Adler32.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/zip/Adler32.java	Fri Dec 16 12:12:17 2011 -0800
@@ -25,16 +25,23 @@
 
 package java.util.zip;
 
+import java.nio.ByteBuffer;
+import sun.nio.ch.DirectBuffer;
+
 /**
  * A class that can be used to compute the Adler-32 checksum of a data
  * stream. An Adler-32 checksum is almost as reliable as a CRC-32 but
  * can be computed much faster.
  *
+ * <p> Passing a {@code null} argument to a method in this class will cause
+ * a {@link NullPointerException} to be thrown.
+ *
  * @see         Checksum
  * @author      David Connelly
  */
 public
 class Adler32 implements Checksum {
+
     private int adler = 1;
 
     /**
@@ -75,6 +82,39 @@
         adler = updateBytes(adler, b, 0, b.length);
     }
 
+
+    /**
+     * Updates the checksum with the bytes from the specified buffer.
+     *
+     * The checksum is updated using
+     * buffer.{@link java.nio.Buffer#remaining() remaining()}
+     * bytes starting at
+     * buffer.{@link java.nio.Buffer#position() position()}
+     * Upon return, the buffer's position will be updated to its
+     * limit; its limit will not have been changed.
+     *
+     * @param buffer the ByteBuffer to update the checksum with
+     * @since 1.8
+     */
+    public void update(ByteBuffer buffer) {
+        int pos = buffer.position();
+        int limit = buffer.limit();
+        assert (pos <= limit);
+        int rem = limit - pos;
+        if (rem <= 0)
+            return;
+        if (buffer instanceof DirectBuffer) {
+            adler = updateByteBuffer(adler, ((DirectBuffer)buffer).address(), pos, rem);
+        } else if (buffer.hasArray()) {
+            adler = updateBytes(adler, buffer.array(), pos + buffer.arrayOffset(), rem);
+        } else {
+            byte[] b = new byte[rem];
+            buffer.get(b);
+            adler = updateBytes(adler, b, 0, b.length);
+        }
+        buffer.position(limit);
+    }
+
     /**
      * Resets the checksum to initial value.
      */
@@ -92,4 +132,6 @@
     private native static int update(int adler, int b);
     private native static int updateBytes(int adler, byte[] b, int off,
                                           int len);
+    private native static int updateByteBuffer(int adler, long addr,
+                                               int off, int len);
 }
--- a/src/share/classes/java/util/zip/CRC32.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/java/util/zip/CRC32.java	Fri Dec 16 12:12:17 2011 -0800
@@ -25,9 +25,15 @@
 
 package java.util.zip;
 
+import java.nio.ByteBuffer;
+import sun.nio.ch.DirectBuffer;
+
 /**
  * A class that can be used to compute the CRC-32 of a data stream.
  *
+ * <p> Passing a {@code null} argument to a method in this class will cause
+ * a {@link NullPointerException} to be thrown.
+ *
  * @see         Checksum
  * @author      David Connelly
  */
@@ -75,6 +81,38 @@
     }
 
     /**
+     * Updates the checksum with the bytes from the specified buffer.
+     *
+     * The checksum is updated using
+     * buffer.{@link java.nio.Buffer#remaining() remaining()}
+     * bytes starting at
+     * buffer.{@link java.nio.Buffer#position() position()}
+     * Upon return, the buffer's position will
+     * be updated to its limit; its limit will not have been changed.
+     *
+     * @param buffer the ByteBuffer to update the checksum with
+     * @since 1.8
+     */
+    public void update(ByteBuffer buffer) {
+        int pos = buffer.position();
+        int limit = buffer.limit();
+        assert (pos <= limit);
+        int rem = limit - pos;
+        if (rem <= 0)
+            return;
+        if (buffer instanceof DirectBuffer) {
+            crc = updateByteBuffer(crc, ((DirectBuffer)buffer).address(), pos, rem);
+        } else if (buffer.hasArray()) {
+            crc = updateBytes(crc, buffer.array(), pos + buffer.arrayOffset(), rem);
+        } else {
+            byte[] b = new byte[rem];
+            buffer.get(b);
+            crc = updateBytes(crc, b, 0, b.length);
+        }
+        buffer.position(limit);
+    }
+
+    /**
      * Resets CRC-32 to initial value.
      */
     public void reset() {
@@ -90,4 +128,7 @@
 
     private native static int update(int crc, int b);
     private native static int updateBytes(int crc, byte[] b, int off, int len);
+
+    private native static int updateByteBuffer(int adler, long addr,
+                                               int off, int len);
 }
--- a/src/share/classes/javax/script/ScriptEngineManager.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/javax/script/ScriptEngineManager.java	Fri Dec 16 12:12:17 2011 -0800
@@ -25,11 +25,9 @@
 
 package javax.script;
 import java.util.*;
-import java.net.URL;
-import java.io.*;
 import java.security.*;
-import sun.misc.Service;
-import sun.misc.ServiceConfigurationError;
+import java.util.ServiceLoader;
+import java.util.ServiceConfigurationError;
 import sun.reflect.Reflection;
 import sun.security.util.SecurityConstants;
 
@@ -102,13 +100,15 @@
     }
 
     private void initEngines(final ClassLoader loader) {
-        Iterator itr = null;
+        Iterator<ScriptEngineFactory> itr = null;
         try {
+            ServiceLoader<ScriptEngineFactory> sl;
             if (loader != null) {
-                itr = Service.providers(ScriptEngineFactory.class, loader);
+                sl = ServiceLoader.load(ScriptEngineFactory.class, loader);
             } else {
-                itr = Service.installedProviders(ScriptEngineFactory.class);
+                sl = ServiceLoader.loadInstalled(ScriptEngineFactory.class);
             }
+            itr = sl.iterator();
         } catch (ServiceConfigurationError err) {
             System.err.println("Can't find ScriptEngineFactory providers: " +
                           err.getMessage());
@@ -124,7 +124,7 @@
         try {
             while (itr.hasNext()) {
                 try {
-                    ScriptEngineFactory fact = (ScriptEngineFactory) itr.next();
+                    ScriptEngineFactory fact = itr.next();
                     engineSpis.add(fact);
                 } catch (ServiceConfigurationError err) {
                     System.err.println("ScriptEngineManager providers.next(): "
@@ -441,7 +441,7 @@
     // Note that this code is same as ClassLoader.getCallerClassLoader().
     // But, that method is package private and hence we can't call here.
     private ClassLoader getCallerClassLoader() {
-        Class caller = Reflection.getCallerClass(3);
+        Class<?> caller = Reflection.getCallerClass(3);
         if (caller == null) {
             return null;
         }
--- a/src/share/classes/javax/security/auth/kerberos/ServicePermission.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/javax/security/auth/kerberos/ServicePermission.java	Fri Dec 16 12:12:17 2011 -0800
@@ -369,7 +369,7 @@
                 switch(a[i-matchlen]) {
                 case ',':
                     seencomma = true;
-                    /*FALLTHROUGH*/
+                    break;
                 case ' ': case '\r': case '\n':
                 case '\f': case '\t':
                     break;
--- a/src/share/classes/javax/sql/StatementEvent.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/javax/sql/StatementEvent.java	Fri Dec 16 12:12:17 2011 -0800
@@ -42,6 +42,7 @@
  */
 public class StatementEvent extends EventObject {
 
+        static final long serialVersionUID = -8089573731826608315L;
         private SQLException            exception;
         private PreparedStatement       statement;
 
--- a/src/share/classes/javax/sql/rowset/BaseRowSet.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/javax/sql/rowset/BaseRowSet.java	Fri Dec 16 12:12:17 2011 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -619,8 +619,8 @@
         checkforRowSetInterface();
         if (listeners.isEmpty() == false) {
             RowSetEvent event = new RowSetEvent((RowSet)this);
-            for (Iterator i = listeners.iterator(); i.hasNext(); ) {
-                ((RowSetListener)i.next()).cursorMoved(event);
+            for (RowSetListener rsl : listeners) {
+                rsl.cursorMoved(event);
             }
         }
     }
@@ -644,8 +644,8 @@
         checkforRowSetInterface();
         if (listeners.isEmpty() == false) {
                 RowSetEvent event = new RowSetEvent((RowSet)this);
-                for (Iterator i = listeners.iterator(); i.hasNext(); ) {
-                        ((RowSetListener)i.next()).rowChanged(event);
+                for (RowSetListener rsl : listeners) {
+                    rsl.rowChanged(event);
                 }
         }
     }
@@ -669,8 +669,8 @@
         checkforRowSetInterface();
         if (listeners.isEmpty() == false) {
                 RowSetEvent event = new RowSetEvent((RowSet)this);
-                for (Iterator i = listeners.iterator(); i.hasNext(); ) {
-                        ((RowSetListener)i.next()).rowSetChanged(event);
+                for (RowSetListener rsl : listeners) {
+                    rsl.rowSetChanged(event);
                 }
         }
 }
--- a/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java	Fri Dec 16 12:12:17 2011 -0800
@@ -97,7 +97,7 @@
      */
     private void checkColType(int SQLType) throws SQLException {
         try {
-            Class c = java.sql.Types.class;
+            Class<?> c = java.sql.Types.class;
             Field[] publicFields = c.getFields();
             int fieldValue = 0;
             for (int i = 0; i < publicFields.length; i++) {
@@ -1091,5 +1091,7 @@
          *@serial
          */
         public boolean writable = true;
+
+        static final long serialVersionUID = 5490834817919311283L;
     }
 }
--- a/src/share/classes/javax/sql/rowset/RowSetProvider.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/javax/sql/rowset/RowSetProvider.java	Fri Dec 16 12:12:17 2011 -0800
@@ -181,7 +181,7 @@
 
         trace("***In newInstance()");
         try {
-            Class providerClass = getFactoryClass(factoryClassName, cl, false);
+            Class<?> providerClass = getFactoryClass(factoryClassName, cl, false);
             RowSetFactory instance = (RowSetFactory) providerClass.newInstance();
             if (debug) {
                 trace("Created new instance of " + providerClass +
@@ -229,7 +229,7 @@
      * context class loader followed by the current class loader.
      *  @return The class which was loaded
      */
-    static private Class getFactoryClass(String factoryClassName, ClassLoader cl,
+    static private Class<?> getFactoryClass(String factoryClassName, ClassLoader cl,
             boolean doFallback) throws ClassNotFoundException {
         try {
             if (cl == null) {
--- a/src/share/classes/javax/sql/rowset/serial/SQLInputImpl.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/javax/sql/rowset/serial/SQLInputImpl.java	Fri Dec 16 12:12:17 2011 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,9 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-
 package javax.sql.rowset.serial;
 
 import java.sql.*;
-import javax.sql.*;
-import java.io.*;
-import java.math.*;
 import java.util.Map;
 
 /**
@@ -91,7 +87,7 @@
      * <code>SQLData</code> (the Java class that defines how the UDT
      * will be mapped).
      */
-    private Map map;
+    private Map<String,Class<?>> map;
 
 
     /**
@@ -279,7 +275,7 @@
 
         if (attrib == null) {
             lastValueWasNull = true;
-            return (int)0;
+            return 0;
         } else {
             lastValueWasNull = false;
             return attrib.intValue();
@@ -591,7 +587,7 @@
      * position; or if there are no further values in the stream.
      */
     public Object readObject() throws SQLException {
-        Object attrib = (Object)getNextAttribute();
+        Object attrib = getNextAttribute();
 
         if (attrib == null) {
             lastValueWasNull = true;
@@ -601,7 +597,7 @@
             if (attrib instanceof Struct) {
                 Struct s = (Struct)attrib;
                 // look up the class in the map
-                Class c = (Class)map.get(s.getSQLTypeName());
+                Class<?> c = map.get(s.getSQLTypeName());
                 if (c != null) {
                     // create new instance of the class
                     SQLData obj = null;
@@ -620,10 +616,10 @@
                     SQLInputImpl sqlInput = new SQLInputImpl(attribs, map);
                     // read the values...
                     obj.readSQL(sqlInput, s.getSQLTypeName());
-                    return (Object)obj;
+                    return obj;
                 }
             }
-            return (Object)attrib;
+            return attrib;
         }
     }
 
--- a/src/share/classes/javax/sql/rowset/serial/SQLOutputImpl.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/javax/sql/rowset/serial/SQLOutputImpl.java	Fri Dec 16 12:12:17 2011 -0800
@@ -60,6 +60,7 @@
      * A reference to an existing vector that
      * contains the attributes of a <code>Struct</code> object.
      */
+    @SuppressWarnings("rawtypes")
     private Vector attribs;
 
     /**
@@ -70,6 +71,7 @@
      * method will in turn call the appropriate
      * <code>SQLOutputImpl</code> writer methods.
      */
+    @SuppressWarnings("rawtypes")
     private Map map;
 
     /**
@@ -121,6 +123,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeString(String x) throws SQLException {
         //System.out.println("Adding :"+x);
         attribs.add(x);
@@ -136,6 +139,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeBoolean(boolean x) throws SQLException {
         attribs.add(Boolean.valueOf(x));
     }
@@ -150,6 +154,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeByte(byte x) throws SQLException {
         attribs.add(Byte.valueOf(x));
     }
@@ -164,6 +169,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeShort(short x) throws SQLException {
         attribs.add(Short.valueOf(x));
     }
@@ -178,6 +184,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeInt(int x) throws SQLException {
         attribs.add(Integer.valueOf(x));
     }
@@ -192,6 +199,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeLong(long x) throws SQLException {
         attribs.add(Long.valueOf(x));
     }
@@ -206,6 +214,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeFloat(float x) throws SQLException {
         attribs.add(new Float(x));
     }
@@ -220,6 +229,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeDouble(double x) throws SQLException{
         attribs.add(new Double(x));
     }
@@ -234,6 +244,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeBigDecimal(java.math.BigDecimal x) throws SQLException{
         attribs.add(x);
     }
@@ -249,6 +260,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeBytes(byte[] x) throws SQLException {
         attribs.add(x);
     }
@@ -263,6 +275,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeDate(java.sql.Date x) throws SQLException {
         attribs.add(x);
     }
@@ -277,6 +290,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeTime(java.sql.Time x) throws SQLException {
         attribs.add(x);
     }
@@ -291,6 +305,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeTimestamp(java.sql.Timestamp x) throws SQLException {
         attribs.add(x);
     }
@@ -305,6 +320,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeCharacterStream(java.io.Reader x) throws SQLException {
          BufferedReader bufReader = new BufferedReader(x);
          try {
@@ -334,6 +350,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeAsciiStream(java.io.InputStream x) throws SQLException {
          BufferedReader bufReader = new BufferedReader(new InputStreamReader(x));
          try {
@@ -363,6 +380,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeBinaryStream(java.io.InputStream x) throws SQLException {
          BufferedReader bufReader = new BufferedReader(new InputStreamReader(x));
          try {
@@ -414,6 +432,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeObject(SQLData x) throws SQLException {
 
         /*
@@ -434,7 +453,7 @@
          * the name of this class otherwise we don't know
          * what to re-instantiate during readSQL()
          */
-        attribs.add(new SerialStruct((SQLData)x, map));
+        attribs.add(new SerialStruct(x, map));
     }
 
     /**
@@ -448,6 +467,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeRef(Ref x) throws SQLException {
         if (x == null) {
             attribs.add(x);
@@ -467,6 +487,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeBlob(Blob x) throws SQLException {
         if (x == null) {
             attribs.add(x);
@@ -486,6 +507,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeClob(Clob x) throws SQLException {
         if (x == null) {
             attribs.add(x);
@@ -511,6 +533,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeStruct(Struct x) throws SQLException {
         SerialStruct s = new SerialStruct(x,map);;
         attribs.add(s);
@@ -528,6 +551,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeArray(Array x) throws SQLException {
         if (x == null) {
             attribs.add(x);
@@ -547,6 +571,7 @@
      *        use by a <code>SQLData</code> object attempting to write the attribute
      *        values of a UDT to the database.
      */
+    @SuppressWarnings("unchecked")
     public void writeURL(java.net.URL url) throws SQLException {
         if (url == null) {
             attribs.add(url);
@@ -570,6 +595,7 @@
    * @exception SQLException if a database access error occurs
    * @since 1.6
    */
+   @SuppressWarnings("unchecked")
    public void writeNString(String x) throws SQLException {
         throw new UnsupportedOperationException("Operation not supported");
     }
@@ -583,6 +609,7 @@
    * @exception SQLException if a database access error occurs
    * @since 1.6
    */
+   @SuppressWarnings("unchecked")
    public void writeNClob(NClob x) throws SQLException {
         throw new UnsupportedOperationException("Operation not supported");
     }
@@ -597,6 +624,7 @@
    * @exception SQLException if a database access error occurs
    * @since 1.6
    */
+   @SuppressWarnings("unchecked")
    public void writeRowId(RowId x) throws SQLException {
         throw new UnsupportedOperationException("Operation not supported");
     }
@@ -611,6 +639,7 @@
    * @exception SQLException if a database access error occurs
    * @since 1.6
    */
+   @SuppressWarnings("unchecked")
    public void writeSQLXML(SQLXML x) throws SQLException {
         throw new UnsupportedOperationException("Operation not supported");
     }
--- a/src/share/classes/javax/sql/rowset/serial/SerialArray.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/javax/sql/rowset/serial/SerialArray.java	Fri Dec 16 12:12:17 2011 -0800
@@ -186,10 +186,8 @@
 
             case java.sql.Types.JAVA_OBJECT:
                 for (int i = 0; i < len; i++) {
-                elements[i] = new SerialJavaObject((Object)elements[i]);
+                elements[i] = new SerialJavaObject(elements[i]);
             }
-        default:
-            ;
         }
   }
 
@@ -285,11 +283,10 @@
 
         case java.sql.Types.JAVA_OBJECT:
             for (int i = 0; i < len; i++) {
-                elements[i] = new SerialJavaObject((Object)elements[i]);
+                elements[i] = new SerialJavaObject(elements[i]);
             }
+            break;
 
-        default:
-            ;
         }
 
 
--- a/src/share/classes/javax/sql/rowset/serial/SerialBlob.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/javax/sql/rowset/serial/SerialBlob.java	Fri Dec 16 12:12:17 2011 -0800
@@ -207,7 +207,7 @@
      */
     public java.io.InputStream getBinaryStream() throws SerialException {
          InputStream stream = new ByteArrayInputStream(buf);
-         return (java.io.InputStream)stream;
+         return stream;
     }
 
     /**
--- a/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java	Fri Dec 16 12:12:17 2011 -0800
@@ -142,14 +142,14 @@
      * object. When there are multiple warnings, each warning is chained to the
      * previous warning.
      */
-    java.util.Vector chain;
+    java.util.Vector<RowSetWarning> chain;
 
     /**
      * Registers the given warning.
      */
     private void setWarning(RowSetWarning e) {
         if (chain == null) {
-            chain = new java.util.Vector();
+            chain = new java.util.Vector<>();
         }
         chain.add(e);
     }
--- a/src/share/classes/javax/sql/rowset/serial/SerialRef.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/javax/sql/rowset/serial/SerialRef.java	Fri Dec 16 12:12:17 2011 -0800
@@ -109,7 +109,7 @@
     public Object getObject(java.util.Map<String,Class<?>> map)
         throws SerialException
     {
-        map = new Hashtable(map);
+        map = new Hashtable<String, Class<?>>(map);
         if (object != null) {
             return map.get(object);
         } else {
--- a/src/share/classes/javax/sql/rowset/serial/SerialStruct.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/javax/sql/rowset/serial/SerialStruct.java	Fri Dec 16 12:12:17 2011 -0800
@@ -139,7 +139,7 @@
         //set the type name
         SQLTypeName = in.getSQLTypeName();
 
-        Vector tmp = new Vector();
+        Vector<Object> tmp = new Vector<>();
         in.writeSQL(new SQLOutputImpl(tmp, map));
         attribs = tmp.toArray();
 
@@ -220,7 +220,7 @@
      *        that defines how the UDT is to be mapped
      * @throws SerialException if an error occurs
      */
-    private void mapToSerial(Map map) throws SerialException {
+    private void mapToSerial(Map<String,Class<?>> map) throws SerialException {
 
         try {
 
--- a/src/share/classes/javax/sql/rowset/spi/SyncFactory.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/javax/sql/rowset/spi/SyncFactory.java	Fri Dec 16 12:12:17 2011 -0800
@@ -257,7 +257,7 @@
      * See section 2.0 of the class comment for <code>SyncFactory</code> for an
      * explanation of how a provider can be added to this registry.
      */
-    private static Hashtable implementations;
+    private static Hashtable<String, SyncProvider> implementations;
     /**
      * Internal sync object used to maintain the SPI as a singleton
      */
@@ -344,7 +344,7 @@
         Properties properties = new Properties();
 
         if (implementations == null) {
-            implementations = new Hashtable();
+            implementations = new Hashtable<>();
 
             try {
 
@@ -445,7 +445,7 @@
         String key = null;
         String[] propertyNames = null;
 
-        for (Enumeration e = p.propertyNames(); e.hasMoreElements();) {
+        for (Enumeration<?> e = p.propertyNames(); e.hasMoreElements();) {
 
             String str = (String) e.nextElement();
 
@@ -541,7 +541,7 @@
         }
 
         // Attempt to invoke classname from registered SyncProvider list
-        Class c = null;
+        Class<?> c = null;
         try {
             ClassLoader cl = Thread.currentThread().getContextClassLoader();
 
@@ -740,7 +740,7 @@
      */
     private static Properties parseJNDIContext() throws NamingException {
 
-        NamingEnumeration bindings = ic.listBindings("");
+        NamingEnumeration<?> bindings = ic.listBindings("");
         Properties properties = new Properties();
 
         // Hunt one level below context for available SyncProvider objects
@@ -755,7 +755,7 @@
      * scan the current context using a re-entrant call to this method until all
      * bindings have been enumerated.
      */
-    private static void enumerateBindings(NamingEnumeration bindings,
+    private static void enumerateBindings(NamingEnumeration<?> bindings,
             Properties properties) throws NamingException {
 
         boolean syncProviderObj = false; // move to parameters ?
--- a/src/share/classes/sun/awt/im/CompositionArea.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/awt/im/CompositionArea.java	Fri Dec 16 12:12:17 2011 -0800
@@ -313,4 +313,7 @@
           compositionWindow.pack();
     }
 
+    // Proclaim serial compatibility with 1.7.0
+    private static final long serialVersionUID = -1057247068746557444L;
+
 }
--- a/src/share/classes/sun/awt/im/CompositionAreaHandler.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/awt/im/CompositionAreaHandler.java	Fri Dec 16 12:12:17 2011 -0800
@@ -257,7 +257,7 @@
      */
     InputMethodRequests getClientInputMethodRequests() {
         if (clientComponent != null) {
-            return (InputMethodRequests) clientComponent.getInputMethodRequests();
+            return clientComponent.getInputMethodRequests();
         }
 
         return null;
--- a/src/share/classes/sun/awt/im/InputContext.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/awt/im/InputContext.java	Fri Dec 16 12:12:17 2011 -0800
@@ -79,7 +79,7 @@
     private boolean inputMethodCreationFailed;
 
     // holding bin for previously used input method instances, but not the current one
-    private HashMap usedInputMethods;
+    private HashMap<InputMethodLocator, InputMethod> usedInputMethods;
 
     // the current client component is kept until the user focusses on a different
     // client component served by the same input context. When that happens, we call
@@ -106,7 +106,7 @@
     // cache location notification
     private Rectangle clientWindowLocation = null;
     // holding the state of clientWindowNotificationEnabled of only non-current input methods
-    private HashMap perInputMethodState;
+    private HashMap<InputMethod, Boolean> perInputMethodState;
 
     // Input Method selection hot key stuff
     private static AWTKeyStroke inputMethodSelectionKey;
@@ -219,6 +219,7 @@
     /**
      * @see java.awt.im.InputContext#dispatchEvent
      */
+    @SuppressWarnings("fallthrough")
     public void dispatchEvent(AWTEvent event) {
 
         if (event instanceof InputMethodEvent) {
@@ -394,7 +395,7 @@
             isInputMethodActive = true;
 
             if (perInputMethodState != null) {
-                Boolean state = (Boolean) perInputMethodState.remove(inputMethod);
+                Boolean state = perInputMethodState.remove(inputMethod);
                 if (state != null) {
                     clientWindowNotificationEnabled = state.booleanValue();
                 }
@@ -549,10 +550,10 @@
 
             // keep the input method instance around for future use
             if (usedInputMethods == null) {
-                usedInputMethods = new HashMap(5);
+                usedInputMethods = new HashMap<>(5);
             }
             if (perInputMethodState == null) {
-                perInputMethodState = new HashMap(5);
+                perInputMethodState = new HashMap<>(5);
             }
             usedInputMethods.put(inputMethodLocator.deriveLocator(null), inputMethod);
             perInputMethodState.put(inputMethod,
@@ -689,10 +690,10 @@
         }
         inputMethodLocator = null;
         if (usedInputMethods != null && !usedInputMethods.isEmpty()) {
-            Iterator iterator = usedInputMethods.values().iterator();
+            Iterator<InputMethod> iterator = usedInputMethods.values().iterator();
             usedInputMethods = null;
             while (iterator.hasNext()) {
-                ((InputMethod) iterator.next()).dispose();
+                iterator.next().dispose();
             }
         }
 
@@ -830,13 +831,13 @@
 
         // see whether we have a previously used input method
         if (usedInputMethods != null) {
-            inputMethodInstance = (InputMethod) usedInputMethods.remove(locator.deriveLocator(null));
+            inputMethodInstance = usedInputMethods.remove(locator.deriveLocator(null));
             if (inputMethodInstance != null) {
                 if (locale != null) {
                     inputMethodInstance.setLocale(locale);
                 }
                 inputMethodInstance.setCharacterSubsets(characterSubsets);
-                Boolean state = (Boolean) perInputMethodState.remove(inputMethodInstance);
+                Boolean state = perInputMethodState.remove(inputMethodInstance);
                 if (state != null) {
                     enableClientWindowNotification(inputMethodInstance, state.booleanValue());
                 }
@@ -919,7 +920,7 @@
         // method becomes the current one.
         if (requester != inputMethod) {
             if (perInputMethodState == null) {
-                perInputMethodState = new HashMap(5);
+                perInputMethodState = new HashMap<>(5);
             }
             perInputMethodState.put(requester, Boolean.valueOf(enable));
             return;
@@ -1029,7 +1030,7 @@
      * Initializes the input method selection key definition in preference trees
      */
     private void initializeInputMethodSelectionKey() {
-        AccessController.doPrivileged(new PrivilegedAction() {
+        AccessController.doPrivileged(new PrivilegedAction<Object>() {
             public Object run() {
                 // Look in user's tree
                 Preferences root = Preferences.userRoot();
--- a/src/share/classes/sun/awt/im/InputMethodContext.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/awt/im/InputMethodContext.java	Fri Dec 16 12:12:17 2011 -0800
@@ -72,12 +72,11 @@
     static {
         // check whether we should use below-the-spot input
         // get property from command line
-        String inputStyle = (String) AccessController.doPrivileged
+        String inputStyle = AccessController.doPrivileged
                 (new GetPropertyAction("java.awt.im.style", null));
         // get property from awt.properties file
         if (inputStyle == null) {
-            inputStyle = Toolkit.getDefaultToolkit().
-                    getProperty("java.awt.im.style", null);
+            inputStyle = Toolkit.getProperty("java.awt.im.style", null);
         }
         belowTheSpotInputRequested = "below-the-spot".equals(inputStyle);
     }
--- a/src/share/classes/sun/awt/im/InputMethodJFrame.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/awt/im/InputMethodJFrame.java	Fri Dec 16 12:12:17 2011 -0800
@@ -68,4 +68,7 @@
             return super.getInputContext();
         }
     }
+
+    // Proclaim serial compatibility with 1.7.0
+    private static final long serialVersionUID = -4705856747771842549L;
 }
--- a/src/share/classes/sun/awt/im/InputMethodManager.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/awt/im/InputMethodManager.java	Fri Dec 16 12:12:17 2011 -0800
@@ -270,7 +270,7 @@
     // IM preference stuff
     private static final String preferredIMNode = "/sun/awt/im/preferredInputMethod";
     private static final String descriptorKey = "descriptor";
-    private Hashtable preferredLocatorCache = new Hashtable();
+    private Hashtable<String, InputMethodLocator> preferredLocatorCache = new Hashtable<>();
     private Preferences userRoot;
 
     ExecutableInputMethodManager() {
@@ -430,7 +430,7 @@
         synchronized (javaInputMethodLocatorList) {
             javaInputMethodLocatorList.clear();
             try {
-                AccessController.doPrivileged(new PrivilegedExceptionAction() {
+                AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                     public Object run() {
                         for (InputMethodDescriptor descriptor :
                             ServiceLoader.loadInstalled(InputMethodDescriptor.class)) {
@@ -611,7 +611,7 @@
         }
 
         // look for the cached preference first.
-        preferredLocator = (InputMethodLocator)preferredLocatorCache.get(locale.toString().intern());
+        preferredLocator = preferredLocatorCache.get(locale.toString().intern());
         if (preferredLocator != null) {
             return preferredLocator;
         }
@@ -767,8 +767,8 @@
     }
 
     private Preferences getUserRoot() {
-        return (Preferences)AccessController.doPrivileged(new PrivilegedAction() {
-            public Object run() {
+        return AccessController.doPrivileged(new PrivilegedAction<Preferences>() {
+            public Preferences run() {
                 return Preferences.userRoot();
             }
         });
--- a/src/share/classes/sun/awt/im/SimpleInputMethodWindow.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/awt/im/SimpleInputMethodWindow.java	Fri Dec 16 12:12:17 2011 -0800
@@ -61,4 +61,7 @@
             return super.getInputContext();
         }
     }
+
+    // Proclaim serial compatibility with 1.7.0
+    private static final long serialVersionUID = 5093376647036461555L;
 }
--- a/src/share/classes/sun/awt/image/BufImgSurfaceData.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/awt/image/BufImgSurfaceData.java	Fri Dec 16 12:12:17 2011 -0800
@@ -323,8 +323,8 @@
     }
 
     public RenderLoops getRenderLoops(SunGraphics2D sg2d) {
-        if (sg2d.paintState <= sg2d.PAINT_ALPHACOLOR &&
-            sg2d.compositeState <= sg2d.COMP_ISCOPY)
+        if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR &&
+            sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY)
         {
             return solidloops;
         }
--- a/src/share/classes/sun/instrument/InstrumentationImpl.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/instrument/InstrumentationImpl.java	Fri Dec 16 12:12:17 2011 -0800
@@ -136,7 +136,7 @@
     }
 
     public void
-    retransformClasses(Class<?>[] classes) {
+    retransformClasses(Class<?>... classes) {
         if (!isRetransformClassesSupported()) {
             throw new UnsupportedOperationException(
               "retransformClasses is not supported in this environment");
@@ -150,7 +150,7 @@
     }
 
     public void
-    redefineClasses(ClassDefinition[]   definitions)
+    redefineClasses(ClassDefinition...  definitions)
             throws  ClassNotFoundException {
         if (!isRedefineClassesSupported()) {
             throw new UnsupportedOperationException("redefineClasses is not supported in this environment");
@@ -321,7 +321,7 @@
 
         try {
             m = javaAgentClass.getDeclaredMethod( methodname,
-                                 new Class[] {
+                                 new Class<?>[] {
                                      String.class,
                                      java.lang.instrument.Instrumentation.class
                                  }
@@ -336,7 +336,7 @@
             // now try the declared 1-arg method
             try {
                 m = javaAgentClass.getDeclaredMethod(methodname,
-                                                 new Class[] { String.class });
+                                                 new Class<?>[] { String.class });
             } catch (NoSuchMethodException x) {
                 // ignore this exception because we'll try
                 // two arg inheritance next
@@ -347,7 +347,7 @@
             // now try the inherited 2-arg method
             try {
                 m = javaAgentClass.getMethod( methodname,
-                                 new Class[] {
+                                 new Class<?>[] {
                                      String.class,
                                      java.lang.instrument.Instrumentation.class
                                  }
@@ -363,7 +363,7 @@
             // finally try the inherited 1-arg method
             try {
                 m = javaAgentClass.getMethod(methodname,
-                                             new Class[] { String.class });
+                                             new Class<?>[] { String.class });
             } catch (NoSuchMethodException x) {
                 // none of the methods exists so we throw the
                 // first NoSuchMethodException as per 5.0
@@ -411,7 +411,7 @@
     private byte[]
     transform(  ClassLoader         loader,
                 String              classname,
-                Class               classBeingRedefined,
+                Class<?>            classBeingRedefined,
                 ProtectionDomain    protectionDomain,
                 byte[]              classfileBuffer,
                 boolean             isRetransformer) {
--- a/src/share/classes/sun/instrument/TransformerManager.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/instrument/TransformerManager.java	Fri Dec 16 12:12:17 2011 -0800
@@ -169,7 +169,7 @@
     public byte[]
     transform(  ClassLoader         loader,
                 String              classname,
-                Class               classBeingRedefined,
+                Class<?>            classBeingRedefined,
                 ProtectionDomain    protectionDomain,
                 byte[]              classfileBuffer) {
         boolean someoneTouchedTheBytecode = false;
--- a/src/share/classes/sun/java2d/SunGraphics2D.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/java2d/SunGraphics2D.java	Fri Dec 16 12:12:17 2011 -0800
@@ -941,7 +941,7 @@
                 }
             }
         }
-        Class paintClass = paint.getClass();
+        Class<? extends Paint> paintClass = paint.getClass();
         if (paintClass == GradientPaint.class) {
             paintState = PAINT_GRADIENT;
         } else if (paintClass == LinearGradientPaint.class) {
@@ -1280,7 +1280,7 @@
         interpolationHint = -1;
         interpolationType = AffineTransformOp.TYPE_NEAREST_NEIGHBOR;
         boolean customHintPresent = false;
-        Iterator iter = hints.keySet().iterator();
+        Iterator<?> iter = hints.keySet().iterator();
         while (iter.hasNext()) {
             Object key = iter.next();
             if (key == SunHints.KEY_RENDERING ||
@@ -1311,7 +1311,7 @@
      */
     public void addRenderingHints(Map<?,?> hints) {
         boolean customHintPresent = false;
-        Iterator iter = hints.keySet().iterator();
+        Iterator<?> iter = hints.keySet().iterator();
         while (iter.hasNext()) {
             Object key = iter.next();
             if (key == SunHints.KEY_RENDERING ||
--- a/src/share/classes/sun/java2d/SurfaceData.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/java2d/SurfaceData.java	Fri Dec 16 12:12:17 2011 -0800
@@ -520,8 +520,8 @@
     }
 
     public boolean canRenderParallelograms(SunGraphics2D sg2d) {
-        if (sg2d.paintState <= sg2d.PAINT_ALPHACOLOR) {
-            if (sg2d.compositeState == sg2d.COMP_XOR) {
+        if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR) {
+            if (sg2d.compositeState == SunGraphics2D.COMP_XOR) {
                 if (havePgramXORLoop == LOOP_UNKNOWN) {
                     FillParallelogram loop =
                         FillParallelogram.locate(SurfaceType.AnyColor,
@@ -531,9 +531,9 @@
                         (loop != null) ? LOOP_FOUND : LOOP_NOTFOUND;
                 }
                 return havePgramXORLoop == LOOP_FOUND;
-            } else if (sg2d.compositeState <= sg2d.COMP_ISCOPY &&
+            } else if (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY &&
                        sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON &&
-                       sg2d.clipState != sg2d.CLIP_SHAPE)
+                       sg2d.clipState != SunGraphics2D.CLIP_SHAPE)
             {
                 if (havePgramSolidLoop == LOOP_UNKNOWN) {
                     FillParallelogram loop =
@@ -551,8 +551,8 @@
 
     public void validatePipe(SunGraphics2D sg2d) {
         sg2d.imagepipe = imagepipe;
-        if (sg2d.compositeState == sg2d.COMP_XOR) {
-            if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR) {
+        if (sg2d.compositeState == SunGraphics2D.COMP_XOR) {
+            if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR) {
                 sg2d.drawpipe = paintViaShape;
                 sg2d.fillpipe = paintViaShape;
                 sg2d.shapepipe = paintShape;
@@ -576,7 +576,7 @@
                     converter = colorViaShape;
                     sg2d.shapepipe = colorPrimitives;
                 }
-                if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+                if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
                     sg2d.drawpipe = converter;
                     sg2d.fillpipe = converter;
                     // REMIND: We should not be changing text strategies
@@ -589,11 +589,11 @@
                     // which is not defined for XOR.
                     sg2d.textpipe = outlineTextRenderer;
                 } else {
-                    if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
+                    if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
                         sg2d.drawpipe = converter;
                         sg2d.fillpipe = converter;
                     } else {
-                        if (sg2d.strokeState != sg2d.STROKE_THIN) {
+                        if (sg2d.strokeState != SunGraphics2D.STROKE_THIN) {
                             sg2d.drawpipe = converter;
                         } else {
                             sg2d.drawpipe = colorPrimitives;
@@ -604,9 +604,9 @@
                 }
                 // assert(sg2d.surfaceData == this);
             }
-        } else if (sg2d.compositeState == sg2d.COMP_CUSTOM) {
+        } else if (sg2d.compositeState == SunGraphics2D.COMP_CUSTOM) {
             if (sg2d.antialiasHint == SunHints.INTVAL_ANTIALIAS_ON) {
-                if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+                if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
                     sg2d.drawpipe = AAClipCompViaShape;
                     sg2d.fillpipe = AAClipCompViaShape;
                     sg2d.shapepipe = AAClipCompViaShape;
@@ -621,7 +621,7 @@
                 sg2d.drawpipe = compViaShape;
                 sg2d.fillpipe = compViaShape;
                 sg2d.shapepipe = compShape;
-                if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+                if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
                     sg2d.textpipe = clipCompText;
                 } else {
                     sg2d.textpipe = compText;
@@ -631,7 +631,7 @@
             sg2d.alphafill = getMaskFill(sg2d);
             // assert(sg2d.surfaceData == this);
             if (sg2d.alphafill != null) {
-                if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+                if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
                     sg2d.drawpipe = AAClipColorViaShape;
                     sg2d.fillpipe = AAClipColorViaShape;
                     sg2d.shapepipe = AAClipColorViaShape;
@@ -644,8 +644,8 @@
                     sg2d.drawpipe = converter;
                     sg2d.fillpipe = converter;
                     sg2d.shapepipe = converter;
-                    if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR ||
-                        sg2d.compositeState > sg2d.COMP_ISCOPY)
+                    if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR ||
+                        sg2d.compositeState > SunGraphics2D.COMP_ISCOPY)
                     {
                         sg2d.textpipe = colorText;
                     } else {
@@ -653,7 +653,7 @@
                     }
                 }
             } else {
-                if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+                if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
                     sg2d.drawpipe = AAClipPaintViaShape;
                     sg2d.fillpipe = AAClipPaintViaShape;
                     sg2d.shapepipe = AAClipPaintViaShape;
@@ -665,9 +665,9 @@
                     sg2d.textpipe = paintText;
                 }
             }
-        } else if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR ||
-                   sg2d.compositeState > sg2d.COMP_ISCOPY ||
-                   sg2d.clipState == sg2d.CLIP_SHAPE)
+        } else if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR ||
+                   sg2d.compositeState > SunGraphics2D.COMP_ISCOPY ||
+                   sg2d.clipState == SunGraphics2D.CLIP_SHAPE)
         {
             sg2d.drawpipe = paintViaShape;
             sg2d.fillpipe = paintViaShape;
@@ -675,13 +675,13 @@
             sg2d.alphafill = getMaskFill(sg2d);
             // assert(sg2d.surfaceData == this);
             if (sg2d.alphafill != null) {
-                if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+                if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
                     sg2d.textpipe = clipColorText;
                 } else {
                     sg2d.textpipe = colorText;
                 }
             } else {
-                if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+                if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
                     sg2d.textpipe = clipPaintText;
                 } else {
                     sg2d.textpipe = paintText;
@@ -700,11 +700,11 @@
                 converter = colorViaShape;
                 sg2d.shapepipe = colorPrimitives;
             }
-            if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
+            if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
                 sg2d.drawpipe = converter;
                 sg2d.fillpipe = converter;
             } else {
-                if (sg2d.strokeState != sg2d.STROKE_THIN) {
+                if (sg2d.strokeState != SunGraphics2D.STROKE_THIN) {
                     sg2d.drawpipe = converter;
                 } else {
                     sg2d.drawpipe = colorPrimitives;
@@ -817,7 +817,7 @@
 
     private static CompositeType getFillCompositeType(SunGraphics2D sg2d) {
         CompositeType compType = sg2d.imageComp;
-        if (sg2d.compositeState == sg2d.COMP_ISCOPY) {
+        if (sg2d.compositeState == SunGraphics2D.COMP_ISCOPY) {
             if (compType == CompositeType.SrcOverNoEa) {
                 compType = CompositeType.OpaqueSrcOverNoEa;
             } else {
--- a/src/share/classes/sun/java2d/SurfaceDataProxy.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/java2d/SurfaceDataProxy.java	Fri Dec 16 12:12:17 2011 -0800
@@ -71,7 +71,7 @@
 
     static {
         cachingAllowed = true;
-        String manimg = (String)AccessController.doPrivileged(
+        String manimg = AccessController.doPrivileged(
             new GetPropertyAction("sun.java2d.managedimages"));
         if (manimg != null && manimg.equals("false")) {
             cachingAllowed = false;
@@ -79,7 +79,7 @@
         }
 
         defaultThreshold = 1;
-        String num = (String)AccessController.doPrivileged(
+        String num = AccessController.doPrivileged(
             new GetPropertyAction("sun.java2d.accthreshold"));
         if (num != null) {
             try {
--- a/src/share/classes/sun/java2d/loops/GraphicsPrimitive.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/java2d/loops/GraphicsPrimitive.java	Fri Dec 16 12:12:17 2011 -0800
@@ -328,7 +328,7 @@
 
     static {
         GetPropertyAction gpa = new GetPropertyAction("sun.java2d.trace");
-        String trace = (String)AccessController.doPrivileged(gpa);
+        String trace = AccessController.doPrivileged(gpa);
         if (trace != null) {
             boolean verbose = false;
             int traceflags = 0;
@@ -391,9 +391,9 @@
     private static PrintStream getTraceOutputFile() {
         if (traceout == null) {
             if (tracefile != null) {
-                Object o =
-                    AccessController.doPrivileged(new PrivilegedAction() {
-                        public Object run() {
+                FileOutputStream o = AccessController.doPrivileged(
+                    new PrivilegedAction<FileOutputStream>() {
+                        public FileOutputStream run() {
                             try {
                                 return new FileOutputStream(tracefile);
                             } catch (FileNotFoundException e) {
@@ -402,7 +402,7 @@
                         }
                     });
                 if (o != null) {
-                    traceout = new PrintStream((OutputStream) o);
+                    traceout = new PrintStream(o);
                 } else {
                     traceout = System.err;
                 }
@@ -415,8 +415,8 @@
 
     public static class TraceReporter extends Thread {
         public static void setShutdownHook() {
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
+            AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                public Void run() {
                     TraceReporter t = new TraceReporter();
                     t.setContextClassLoader(null);
                     Runtime.getRuntime().addShutdownHook(t);
--- a/src/share/classes/sun/java2d/loops/SurfaceType.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/java2d/loops/SurfaceType.java	Fri Dec 16 12:12:17 2011 -0800
@@ -56,7 +56,7 @@
 public final class SurfaceType {
 
     private static int unusedUID = 1;
-    private static HashMap surfaceUIDMap = new HashMap(100);
+    private static HashMap<String, Integer> surfaceUIDMap = new HashMap<>(100);
 
     /*
      * CONSTANTS USED BY ALL PRIMITIVES TO DESCRIBE THE SURFACES
@@ -402,7 +402,7 @@
     }
 
     public synchronized static final int makeUniqueID(String desc) {
-        Integer i = (Integer) surfaceUIDMap.get((Object) desc);
+        Integer i = surfaceUIDMap.get(desc);
 
         if (i == null) {
             if (unusedUID > 255) {
--- a/src/share/classes/sun/java2d/opengl/OGLBufImgOps.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/java2d/opengl/OGLBufImgOps.java	Fri Dec 16 12:12:17 2011 -0800
@@ -78,12 +78,12 @@
         }
 
         SurfaceData srcData =
-            dstData.getSourceSurfaceData(img, sg.TRANSFORM_ISIDENT,
+            dstData.getSourceSurfaceData(img, SunGraphics2D.TRANSFORM_ISIDENT,
                                          CompositeType.SrcOver, null);
         if (!(srcData instanceof OGLSurfaceData)) {
             // REMIND: this hack tries to ensure that we have a cached texture
             srcData =
-                dstData.getSourceSurfaceData(img, sg.TRANSFORM_ISIDENT,
+                dstData.getSourceSurfaceData(img, SunGraphics2D.TRANSFORM_ISIDENT,
                                              CompositeType.SrcOver, null);
             if (!(srcData instanceof OGLSurfaceData)) {
                 return false;
--- a/src/share/classes/sun/java2d/opengl/OGLDrawImage.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/java2d/opengl/OGLDrawImage.java	Fri Dec 16 12:12:17 2011 -0800
@@ -60,7 +60,7 @@
             SurfaceData dstData = sg.surfaceData;
             SurfaceData srcData =
                 dstData.getSourceSurfaceData(img,
-                                             sg.TRANSFORM_GENERIC,
+                                             SunGraphics2D.TRANSFORM_GENERIC,
                                              sg.imageComp,
                                              bgColor);
 
--- a/src/share/classes/sun/java2d/opengl/OGLPaints.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/java2d/opengl/OGLPaints.java	Fri Dec 16 12:12:17 2011 -0800
@@ -123,14 +123,16 @@
             }
 
             SurfaceData srcData =
-                dstData.getSourceSurfaceData(bi, sg2d.TRANSFORM_ISIDENT,
+                dstData.getSourceSurfaceData(bi,
+                                             SunGraphics2D.TRANSFORM_ISIDENT,
                                              CompositeType.SrcOver, null);
             if (!(srcData instanceof OGLSurfaceData)) {
                 // REMIND: this is a hack that attempts to cache the system
                 //         memory image from the TexturePaint instance into an
                 //         OpenGL texture...
                 srcData =
-                    dstData.getSourceSurfaceData(bi, sg2d.TRANSFORM_ISIDENT,
+                    dstData.getSourceSurfaceData(bi,
+                                                 SunGraphics2D.TRANSFORM_ISIDENT,
                                                  CompositeType.SrcOver, null);
                 if (!(srcData instanceof OGLSurfaceData)) {
                     return false;
--- a/src/share/classes/sun/java2d/opengl/OGLSurfaceData.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/java2d/opengl/OGLSurfaceData.java	Fri Dec 16 12:12:17 2011 -0800
@@ -428,18 +428,18 @@
         // by the CompositeType.SrcNoEa (any color) test below.)
 
         if (/* CompositeType.SrcNoEa (any color) */
-            (sg2d.compositeState <= sg2d.COMP_ISCOPY &&
-             sg2d.paintState <= sg2d.PAINT_ALPHACOLOR)        ||
+            (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY &&
+             sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR)         ||
 
             /* CompositeType.SrcOver (any color) */
-            (sg2d.compositeState == sg2d.COMP_ALPHA    &&
-             sg2d.paintState <= sg2d.PAINT_ALPHACOLOR &&
+            (sg2d.compositeState == SunGraphics2D.COMP_ALPHA   &&
+             sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR &&
              (((AlphaComposite)sg2d.composite).getRule() ==
-              AlphaComposite.SRC_OVER))                       ||
+              AlphaComposite.SRC_OVER))                                 ||
 
             /* CompositeType.Xor (any color) */
-            (sg2d.compositeState == sg2d.COMP_XOR &&
-             sg2d.paintState <= sg2d.PAINT_ALPHACOLOR))
+            (sg2d.compositeState == SunGraphics2D.COMP_XOR &&
+             sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR))
         {
             textpipe = oglTextPipe;
         } else {
@@ -454,12 +454,12 @@
         OGLRenderer nonTxPipe = null;
 
         if (sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON) {
-            if (sg2d.paintState <= sg2d.PAINT_ALPHACOLOR) {
-                if (sg2d.compositeState <= sg2d.COMP_XOR) {
+            if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR) {
+                if (sg2d.compositeState <= SunGraphics2D.COMP_XOR) {
                     txPipe = oglTxRenderPipe;
                     nonTxPipe = oglRenderPipe;
                 }
-            } else if (sg2d.compositeState <= sg2d.COMP_ALPHA) {
+            } else if (sg2d.compositeState <= SunGraphics2D.COMP_ALPHA) {
                 if (OGLPaints.isValid(sg2d)) {
                     txPipe = oglTxRenderPipe;
                     nonTxPipe = oglRenderPipe;
@@ -467,7 +467,7 @@
                 // custom paints handled by super.validatePipe() below
             }
         } else {
-            if (sg2d.paintState <= sg2d.PAINT_ALPHACOLOR) {
+            if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR) {
                 if (graphicsConfig.isCapPresent(CAPS_PS30) &&
                     (sg2d.imageComp == CompositeType.SrcOverNoEa ||
                      sg2d.imageComp == CompositeType.SrcOver))
@@ -484,7 +484,7 @@
                     sg2d.drawpipe = aaConverter;
                     sg2d.fillpipe = aaConverter;
                     sg2d.shapepipe = aaConverter;
-                } else if (sg2d.compositeState == sg2d.COMP_XOR) {
+                } else if (sg2d.compositeState == SunGraphics2D.COMP_XOR) {
                     // install the solid pipes when AA and XOR are both enabled
                     txPipe = oglTxRenderPipe;
                     nonTxPipe = oglRenderPipe;
@@ -494,10 +494,10 @@
         }
 
         if (txPipe != null) {
-            if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
+            if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
                 sg2d.drawpipe = txPipe;
                 sg2d.fillpipe = txPipe;
-            } else if (sg2d.strokeState != sg2d.STROKE_THIN) {
+            } else if (sg2d.strokeState != SunGraphics2D.STROKE_THIN) {
                 sg2d.drawpipe = txPipe;
                 sg2d.fillpipe = nonTxPipe;
             } else {
@@ -524,7 +524,7 @@
 
     @Override
     protected MaskFill getMaskFill(SunGraphics2D sg2d) {
-        if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR) {
+        if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR) {
             /*
              * We can only accelerate non-Color MaskFill operations if
              * all of the following conditions hold true:
@@ -548,8 +548,8 @@
     public boolean copyArea(SunGraphics2D sg2d,
                             int x, int y, int w, int h, int dx, int dy)
     {
-        if (sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE &&
-            sg2d.compositeState < sg2d.COMP_XOR)
+        if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE &&
+            sg2d.compositeState < SunGraphics2D.COMP_XOR)
         {
             x += sg2d.transX;
             y += sg2d.transY;
--- a/src/share/classes/sun/java2d/pipe/AAShapePipe.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/java2d/pipe/AAShapePipe.java	Fri Dec 16 12:12:17 2011 -0800
@@ -144,7 +144,7 @@
     public void renderPath(SunGraphics2D sg, Shape s, BasicStroke bs) {
         boolean adjust = (bs != null &&
                           sg.strokeHint != SunHints.INTVAL_STROKE_PURE);
-        boolean thin = (sg.strokeState <= sg.STROKE_THINDASHED);
+        boolean thin = (sg.strokeState <= SunGraphics2D.STROKE_THINDASHED);
 
         Region clip = sg.getCompClip();
         int abox[] = new int[4];
--- a/src/share/classes/sun/java2d/pipe/BufferedPaints.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/java2d/pipe/BufferedPaints.java	Fri Dec 16 12:12:17 2011 -0800
@@ -247,7 +247,7 @@
         BufferedImage bi = paint.getImage();
         SurfaceData dstData = sg2d.surfaceData;
         SurfaceData srcData =
-            dstData.getSourceSurfaceData(bi, sg2d.TRANSFORM_ISIDENT,
+            dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT,
                                          CompositeType.SrcOver, null);
         boolean filter =
             (sg2d.interpolationType !=
--- a/src/share/classes/sun/java2d/pipe/BufferedRenderPipe.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/java2d/pipe/BufferedRenderPipe.java	Fri Dec 16 12:12:17 2011 -0800
@@ -508,9 +508,9 @@
     }
 
     public void draw(SunGraphics2D sg2d, Shape s) {
-        if (sg2d.strokeState == sg2d.STROKE_THIN) {
+        if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
             if (s instanceof Polygon) {
-                if (sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE) {
+                if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
                     Polygon p = (Polygon)s;
                     drawPolygon(sg2d, p.xpoints, p.ypoints, p.npoints);
                     return;
@@ -518,7 +518,7 @@
             }
             Path2D.Float p2df;
             int transx, transy;
-            if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE) {
+            if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
                 if (s instanceof Path2D.Float) {
                     p2df = (Path2D.Float)s;
                 } else {
@@ -532,7 +532,7 @@
                 transy = 0;
             }
             drawPath(sg2d, p2df, transx, transy);
-        } else if (sg2d.strokeState < sg2d.STROKE_CUSTOM) {
+        } else if (sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM) {
             ShapeSpanIterator si = LoopPipe.getStrokeSpans(sg2d, s);
             try {
                 fillSpans(sg2d, si, 0, 0);
@@ -547,11 +547,11 @@
     public void fill(SunGraphics2D sg2d, Shape s) {
         int transx, transy;
 
-        if (sg2d.strokeState == sg2d.STROKE_THIN) {
+        if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
             // Here we are able to use fillPath() for
             // high-quality fills.
             Path2D.Float p2df;
-            if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE) {
+            if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
                 if (s instanceof Path2D.Float) {
                     p2df = (Path2D.Float)s;
                 } else {
@@ -569,7 +569,7 @@
         }
 
         AffineTransform at;
-        if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE) {
+        if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
             // Transform (translation) will be done by FillSpans (we could
             // delegate to fillPolygon() here, but most hardware accelerated
             // libraries cannot handle non-convex polygons, so we will use
--- a/src/share/classes/sun/java2d/pipe/DrawImage.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/java2d/pipe/DrawImage.java	Fri Dec 16 12:12:17 2011 -0800
@@ -146,7 +146,7 @@
         int imgh = img.getHeight(null);
         boolean checkfinalxform;
 
-        if (sg.transformState <= sg.TRANSFORM_ANY_TRANSLATE &&
+        if (sg.transformState <= SunGraphics2D.TRANSFORM_ANY_TRANSLATE &&
             (txtype == AffineTransform.TYPE_IDENTITY ||
              txtype == AffineTransform.TYPE_TRANSLATION))
         {
@@ -166,7 +166,7 @@
                 return;
             }
             checkfinalxform = false;
-        } else if (sg.transformState <= sg.TRANSFORM_TRANSLATESCALE &&
+        } else if (sg.transformState <= SunGraphics2D.TRANSFORM_TRANSLATESCALE &&
                    ((txtype & (AffineTransform.TYPE_FLIP |
                                AffineTransform.TYPE_MASK_ROTATION |
                                AffineTransform.TYPE_GENERAL_TRANSFORM)) == 0))
@@ -344,14 +344,14 @@
         Region clip = sg.getCompClip();
         SurfaceData dstData = sg.surfaceData;
         SurfaceData srcData = dstData.getSourceSurfaceData(img,
-                                                           sg.TRANSFORM_GENERIC,
+                                                           SunGraphics2D.TRANSFORM_GENERIC,
                                                            sg.imageComp,
                                                            bgColor);
 
         if (srcData == null) {
             img = getBufferedImage(img);
             srcData = dstData.getSourceSurfaceData(img,
-                                                   sg.TRANSFORM_GENERIC,
+                                                   SunGraphics2D.TRANSFORM_GENERIC,
                                                    sg.imageComp,
                                                    bgColor);
             if (srcData == null) {
@@ -372,7 +372,7 @@
             sx1 = sy1 = 0;
 
             srcData = dstData.getSourceSurfaceData(img,
-                                                   sg.TRANSFORM_GENERIC,
+                                                   SunGraphics2D.TRANSFORM_GENERIC,
                                                    sg.imageComp,
                                                    bgColor);
         }
@@ -398,7 +398,7 @@
             sx1 = sy1 = 0;
 
             srcData = dstData.getSourceSurfaceData(img,
-                                                   sg.TRANSFORM_GENERIC,
+                                                   SunGraphics2D.TRANSFORM_GENERIC,
                                                    sg.imageComp,
                                                    null);
             srcType = srcData.getSurfaceType();
@@ -449,7 +449,7 @@
         SurfaceType dstType = dstData.getSurfaceType();
         MaskBlit maskblit;
         Blit blit;
-        if (sg.compositeState <= sg.COMP_ALPHA) {
+        if (sg.compositeState <= SunGraphics2D.COMP_ALPHA) {
             /* NOTE: We either have, or we can make,
              * a MaskBlit for any alpha composite type
              */
@@ -565,7 +565,7 @@
         while (true) {
             SurfaceData srcData =
                 dstData.getSourceSurfaceData(img,
-                                             sg.TRANSFORM_ISIDENT,
+                                             SunGraphics2D.TRANSFORM_ISIDENT,
                                              sg.imageComp,
                                              bgColor);
             if (srcData == null) {
@@ -628,7 +628,7 @@
         while (true) {
             SurfaceData srcData =
                 dstData.getSourceSurfaceData(img,
-                                             sg.TRANSFORM_TRANSLATESCALE,
+                                             SunGraphics2D.TRANSFORM_TRANSLATESCALE,
                                              sg.imageComp,
                                              bgColor);
 
@@ -800,11 +800,11 @@
 
     public static boolean isSimpleTranslate(SunGraphics2D sg) {
         int ts = sg.transformState;
-        if (ts <= sg.TRANSFORM_INT_TRANSLATE) {
+        if (ts <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
             // Integer translates are always "simple"
             return true;
         }
-        if (ts >= sg.TRANSFORM_TRANSLATESCALE) {
+        if (ts >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
             // Scales and beyond are always "not simple"
             return false;
         }
@@ -846,8 +846,11 @@
         }
         int type = tx.getType();
         boolean needTrans =
-            ((type&(tx.TYPE_MASK_ROTATION|tx.TYPE_GENERAL_TRANSFORM)) != 0);
-        if (! needTrans && type != tx.TYPE_TRANSLATION && type != tx.TYPE_IDENTITY)
+                ((type & (AffineTransform.TYPE_MASK_ROTATION |
+                          AffineTransform.TYPE_GENERAL_TRANSFORM)) != 0);
+        if (! needTrans &&
+              type != AffineTransform.TYPE_TRANSLATION &&
+              type != AffineTransform.TYPE_IDENTITY)
         {
             double[] mtx = new double[4];
             tx.getMatrix(mtx);
@@ -861,7 +864,7 @@
                 Raster raster = bImg.getRaster();
                 IndexColorModel icm = (IndexColorModel) cm;
                 // Just need to make sure that we have a transparent pixel
-                if (needTrans && cm.getTransparency() == cm.OPAQUE) {
+                if (needTrans && cm.getTransparency() == Transparency.OPAQUE) {
                     // Fix 4221407
                     if (raster instanceof sun.awt.image.BytePackedRaster) {
                         dstCM = ColorModel.getRGBdefault();
@@ -892,7 +895,7 @@
                     }   /* raster instanceof sun.awt.image.BytePackedRaster */
                 } /* if (cm.getTransparency() == cm.OPAQUE) */
             } /* if (cm instanceof IndexColorModel) */
-            else if (needTrans && cm.getTransparency() == cm.OPAQUE) {
+            else if (needTrans && cm.getTransparency() == Transparency.OPAQUE) {
                 // Need a bitmask transparency
                 // REMIND: for now, use full transparency since no loops
                 // for bitmask
@@ -902,7 +905,7 @@
         else {
 
             if (cm instanceof IndexColorModel ||
-                (needTrans && cm.getTransparency() == cm.OPAQUE))
+                (needTrans && cm.getTransparency() == Transparency.OPAQUE))
             {
                 // Need a bitmask transparency
                 // REMIND: for now, use full transparency since no loops
--- a/src/share/classes/sun/java2d/pipe/GlyphListPipe.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/java2d/pipe/GlyphListPipe.java	Fri Dec 16 12:12:17 2011 -0800
@@ -54,7 +54,7 @@
         }
 
         float devx, devy;
-        if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
+        if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
             double origin[] = {x + info.originX, y + info.originY};
             sg2d.transform.transform(origin, 0, origin, 0, 1);
             devx = (float)origin[0];
@@ -90,7 +90,7 @@
                                         sg2d, data, offset, length, ix, iy);
             return;
         }
-        if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
+        if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
             double origin[] = {ix + info.originX, iy + info.originY};
             sg2d.transform.transform(origin, 0, origin, 0, 1);
             x = (float) origin[0];
@@ -122,7 +122,7 @@
             SurfaceData.outlineTextRenderer.drawGlyphVector(sg2d, gv, x, y);
             return;
         }
-        if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
+        if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
             double origin[] = {x, y};
             sg2d.transform.transform(origin, 0, origin, 0, 1);
             x = (float) origin[0];
--- a/src/share/classes/sun/java2d/pipe/LoopPipe.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/java2d/pipe/LoopPipe.java	Fri Dec 16 12:12:17 2011 -0800
@@ -171,11 +171,11 @@
 
 
     public void draw(SunGraphics2D sg2d, Shape s) {
-        if (sg2d.strokeState == sg2d.STROKE_THIN) {
+        if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
             Path2D.Float p2df;
             int transX;
             int transY;
-            if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE) {
+            if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
                 if (s instanceof Path2D.Float) {
                     p2df = (Path2D.Float)s;
                 } else {
@@ -193,7 +193,7 @@
             return;
         }
 
-        if (sg2d.strokeState == sg2d.STROKE_CUSTOM) {
+        if (sg2d.strokeState == SunGraphics2D.STROKE_CUSTOM) {
             fill(sg2d, sg2d.stroke.createStrokedShape(s));
             return;
         }
@@ -271,7 +271,7 @@
             sr.setRule(PathIterator.WIND_NON_ZERO);
 
             BasicStroke bs = (BasicStroke) sg2d.stroke;
-            boolean thin = (sg2d.strokeState <= sg2d.STROKE_THINDASHED);
+            boolean thin = (sg2d.strokeState <= SunGraphics2D.STROKE_THINDASHED);
             boolean normalize =
                 (sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE);
 
@@ -288,11 +288,11 @@
     }
 
     public void fill(SunGraphics2D sg2d, Shape s) {
-        if (sg2d.strokeState == sg2d.STROKE_THIN) {
+        if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
             Path2D.Float p2df;
             int transX;
             int transY;
-            if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE) {
+            if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
                 if (s instanceof Path2D.Float) {
                     p2df = (Path2D.Float)s;
                 } else {
@@ -314,7 +314,7 @@
         try {
             sr.setOutputArea(sg2d.getCompClip());
             AffineTransform at =
-                ((sg2d.transformState == sg2d.TRANSFORM_ISIDENT)
+                ((sg2d.transformState == SunGraphics2D.TRANSFORM_ISIDENT)
                  ? null
                  : sg2d.transform);
             sr.appendPath(s.getPathIterator(at));
@@ -328,7 +328,7 @@
         // REMIND: Eventually, the plan is that it will not be possible for
         // fs to be null since the FillSpans loop will be the fundamental
         // loop implemented for any destination type...
-        if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+        if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
             si = sg2d.clipRegion.filter(si);
             // REMIND: Region.filter produces a Java-only iterator
             // with no native counterpart...
--- a/src/share/classes/sun/java2d/pipe/RenderingEngine.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/java2d/pipe/RenderingEngine.java	Fri Dec 16 12:12:17 2011 -0800
@@ -117,16 +117,16 @@
             return reImpl;
         }
 
-        reImpl = (RenderingEngine)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
+        reImpl =
+            AccessController.doPrivileged(new PrivilegedAction<RenderingEngine>() {
+                public RenderingEngine run() {
                     final String ductusREClass = "sun.dc.DuctusRenderingEngine";
                     String reClass =
                         System.getProperty("sun.java2d.renderer", ductusREClass);
                     if (reClass.equals(ductusREClass)) {
                         try {
-                            Class cls = Class.forName(ductusREClass);
-                            return cls.newInstance();
+                            Class<?> cls = Class.forName(ductusREClass);
+                            return (RenderingEngine) cls.newInstance();
                         } catch (ReflectiveOperationException ignored) {
                             // not found
                         }
@@ -153,7 +153,7 @@
 
         GetPropertyAction gpa =
             new GetPropertyAction("sun.java2d.renderer.trace");
-        String reTrace = (String) AccessController.doPrivileged(gpa);
+        String reTrace = AccessController.doPrivileged(gpa);
         if (reTrace != null) {
             reImpl = new Tracer(reImpl);
         }
--- a/src/share/classes/sun/launcher/LauncherHelper.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/launcher/LauncherHelper.java	Fri Dec 16 12:12:17 2011 -0800
@@ -428,7 +428,7 @@
             if (t != null) {
                 t.printStackTrace();
             } else {
-                Thread.currentThread().dumpStack();
+                Thread.dumpStack();
             }
         }
         System.exit(1);
--- a/src/share/classes/sun/management/counter/perf/PerfInstrumentation.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/management/counter/perf/PerfInstrumentation.java	Fri Dec 16 12:12:17 2011 -0800
@@ -169,17 +169,15 @@
         Matcher matcher = pattern.matcher("");
         List<Counter> matches = new ArrayList<Counter>();
 
-        Iterator iter = map.entrySet().iterator();
-        while (iter.hasNext()) {
-            Map.Entry me = (Map.Entry) iter.next();
-            String name = (String) me.getKey();
+        for (Map.Entry<String,Counter> me: map.entrySet()) {
+            String name = me.getKey();
 
             // apply pattern to counter name
             matcher.reset(name);
 
             // if the pattern matches, then add Counter to list
             if (matcher.lookingAt()) {
-                matches.add((Counter)me.getValue());
+                matches.add(me.getValue());
             }
         }
         return matches;
--- a/src/share/classes/sun/management/jmxremote/ConnectorBootstrap.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/management/jmxremote/ConnectorBootstrap.java	Fri Dec 16 12:12:17 2011 -0800
@@ -233,16 +233,14 @@
                         "the access file [" + accessFile + "] as the " +
                         "authenticated Subject is null");
             }
-            final Set principals = subject.getPrincipals();
-            for (Iterator i = principals.iterator(); i.hasNext();) {
-                final Principal p = (Principal) i.next();
+            final Set<Principal> principals = subject.getPrincipals();
+            for (Principal p: principals) {
                 if (properties.containsKey(p.getName())) {
                     return;
                 }
             }
             final Set<String> principalsStr = new HashSet<String>();
-            for (Iterator i = principals.iterator(); i.hasNext();) {
-                final Principal p = (Principal) i.next();
+            for (Principal p: principals) {
                 principalsStr.add(p.getName());
             }
             throw new SecurityException(
@@ -653,7 +651,7 @@
                 }
                 TrustManagerFactory tmf = TrustManagerFactory.getInstance(
                         TrustManagerFactory.getDefaultAlgorithm());
-                tmf.init((KeyStore) ts);
+                tmf.init(ts);
 
                 SSLContext ctx = SSLContext.getInstance("SSL");
                 ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
--- a/src/share/classes/sun/misc/BASE64Decoder.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/misc/BASE64Decoder.java	Fri Dec 16 12:12:17 2011 -0800
@@ -102,6 +102,7 @@
     /**
      * Decode one BASE64 atom into 1, 2, or 3 bytes of data.
      */
+    @SuppressWarnings("fallthrough")
     protected void decodeAtom(PushbackInputStream inStream, OutputStream outStream, int rem)
         throws java.io.IOException
     {
--- a/src/share/classes/sun/misc/CEFormatException.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/misc/CEFormatException.java	Fri Dec 16 12:12:17 2011 -0800
@@ -28,7 +28,9 @@
 import java.io.IOException;
 
 public class CEFormatException extends IOException {
-        public CEFormatException(String s) {
-                super(s);
-        }
+    static final long serialVersionUID = -7139121221067081482L;
+    public CEFormatException(String s) {
+        super(s);
+    }
 }
+
--- a/src/share/classes/sun/misc/CEStreamExhausted.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/misc/CEStreamExhausted.java	Fri Dec 16 12:12:17 2011 -0800
@@ -27,4 +27,7 @@
 import java.io.IOException;
 
 /** This exception is thrown when EOF is reached */
-public class CEStreamExhausted extends IOException { };
+public class CEStreamExhausted extends IOException {
+    static final long serialVersionUID = -5889118049525891904L;
+}
+
--- a/src/share/classes/sun/misc/ClassLoaderUtil.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/misc/ClassLoaderUtil.java	Fri Dec 16 12:12:17 2011 -0800
@@ -79,9 +79,9 @@
 
             URLClassPath ucp = SharedSecrets.getJavaNetAccess()
                                                 .getURLClassPath(classLoader);
-            ArrayList loaders = ucp.loaders;
-            Stack urls = ucp.urls;
-            HashMap lmap = ucp.lmap;
+            ArrayList<?> loaders = ucp.loaders;
+            Stack<?> urls = ucp.urls;
+            HashMap<?,?> lmap = ucp.lmap;
 
             /*
              *The urls variable in the URLClassPath object holds URLs that have not yet
--- a/src/share/classes/sun/misc/CompoundEnumeration.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/misc/CompoundEnumeration.java	Fri Dec 16 12:12:17 2011 -0800
@@ -33,10 +33,10 @@
  * enumerations.
  */
 public class CompoundEnumeration<E> implements Enumeration<E> {
-    private Enumeration[] enums;
+    private Enumeration<E>[] enums;
     private int index = 0;
 
-    public CompoundEnumeration(Enumeration[] enums) {
+    public CompoundEnumeration(Enumeration<E>[] enums) {
         this.enums = enums;
     }
 
@@ -58,6 +58,6 @@
         if (!next()) {
             throw new NoSuchElementException();
         }
-        return (E)enums[index].nextElement();
+        return enums[index].nextElement();
     }
 }
--- a/src/share/classes/sun/misc/ExtensionDependency.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/misc/ExtensionDependency.java	Fri Dec 16 12:12:17 2011 -0800
@@ -70,7 +70,7 @@
 public class ExtensionDependency {
 
     /* Callbak interfaces to delegate installation of missing extensions */
-    private static Vector providers;
+    private static Vector<ExtensionInstallationProvider> providers;
 
     /**
      * <p>
@@ -83,7 +83,7 @@
         (ExtensionInstallationProvider eip)
     {
         if (providers == null) {
-            providers = new Vector();
+            providers = new Vector<>();
         }
         providers.add(eip);
     }
@@ -93,7 +93,7 @@
      * Unregister a previously installed installation provider
      * </p>
      */
-    public synchronized  static void removeExtensionInstallationProvider
+    public synchronized static void removeExtensionInstallationProvider
         (ExtensionInstallationProvider eip)
     {
         providers.remove(eip);
@@ -348,14 +348,16 @@
                                        ExtensionInfo instInfo)
         throws ExtensionInstallationException
     {
-
-        Vector currentProviders;
+        Vector<ExtensionInstallationProvider> currentProviders;
         synchronized(providers) {
-            currentProviders = (Vector) providers.clone();
+            @SuppressWarnings("unchecked")
+            Vector<ExtensionInstallationProvider> tmp =
+                (Vector<ExtensionInstallationProvider>) providers.clone();
+            currentProviders = tmp;
         }
-        for (Enumeration e=currentProviders.elements();e.hasMoreElements();) {
-            ExtensionInstallationProvider eip =
-                (ExtensionInstallationProvider) e.nextElement();
+        for (Enumeration<ExtensionInstallationProvider> e = currentProviders.elements();
+                e.hasMoreElements();) {
+            ExtensionInstallationProvider eip = e.nextElement();
 
             if (eip!=null) {
                 // delegate the installation to the provider
--- a/src/share/classes/sun/misc/ExtensionInstallationException.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/misc/ExtensionInstallationException.java	Fri Dec 16 12:12:17 2011 -0800
@@ -34,6 +34,8 @@
 
 public class ExtensionInstallationException extends Exception {
 
+    static final long serialVersionUID = 3139688306909345924L;
+
     /*
      * <p>
      * Construct a new exception with an exception reason
--- a/src/share/classes/sun/misc/FloatingDecimal.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/misc/FloatingDecimal.java	Fri Dec 16 12:12:17 2011 -0800
@@ -325,7 +325,7 @@
             // can do int arithmetic rather than long!
             int  ivalue = (int)lvalue;
             ndigits = 10;
-            digits = (char[])(perThreadBuffer.get());
+            digits = perThreadBuffer.get();
             digitno = ndigits-1;
             c = ivalue%10;
             ivalue /= 10;
@@ -345,7 +345,7 @@
             // same algorithm as above (same bugs, too )
             // but using long arithmetic.
             ndigits = 20;
-            digits = (char[])(perThreadBuffer.get());
+            digits = perThreadBuffer.get();
             digitno = ndigits-1;
             c = (int)(lvalue%10L);
             lvalue /= 10L;
@@ -477,9 +477,9 @@
         }
         // Begin to unpack
         // Discover obvious special cases of NaN and Infinity.
-        binExp = (int)( (fBits&singleExpMask) >> singleExpShift );
+        binExp = (fBits&singleExpMask) >> singleExpShift;
         fractBits = fBits&singleFractMask;
-        if ( binExp == (int)(singleExpMask>>singleExpShift) ) {
+        if ( binExp == (singleExpMask>>singleExpShift) ) {
             isExceptional = true;
             if ( fractBits == 0L ){
                 digits =  infinity;
@@ -900,7 +900,7 @@
     }
 
     public String toJavaFormatString() {
-        char result[] = (char[])(perThreadBuffer.get());
+        char result[] = perThreadBuffer.get();
         int i = getChars(result);
         return new String(result, 0, i);
     }
@@ -978,14 +978,14 @@
     }
 
     // Per-thread buffer for string/stringbuffer conversion
-    private static ThreadLocal perThreadBuffer = new ThreadLocal() {
-            protected synchronized Object initialValue() {
+    private static ThreadLocal<char[]> perThreadBuffer = new ThreadLocal<char[]>() {
+            protected synchronized char[] initialValue() {
                 return new char[26];
             }
         };
 
     public void appendTo(Appendable buf) {
-          char result[] = (char[])(perThreadBuffer.get());
+          char result[] = perThreadBuffer.get();
           int i = getChars(result);
         if (buf instanceof StringBuilder)
             ((StringBuilder) buf).append(result, 0, i);
@@ -995,6 +995,7 @@
             assert false;
     }
 
+    @SuppressWarnings("fallthrough")
     public static FloatingDecimal
     readJavaFormatString( String in ) throws NumberFormatException {
         boolean isNegative = false;
@@ -2209,7 +2210,7 @@
                     // exponent correctly, even in the case of
                     // Double.MAX_VALUE overflowing to infinity.
 
-                    significand = (( ((long)exponent +
+                    significand = (( (exponent +
                                      (long)DoubleConsts.EXP_BIAS) <<
                                      (DoubleConsts.SIGNIFICAND_WIDTH-1))
                                    & DoubleConsts.EXP_BIT_MASK) |
--- a/src/share/classes/sun/misc/FormattedFloatingDecimal.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/misc/FormattedFloatingDecimal.java	Fri Dec 16 12:12:17 2011 -0800
@@ -333,7 +333,7 @@
             // can do int arithmetic rather than long!
             int  ivalue = (int)lvalue;
             ndigits = 10;
-            digits = (char[])(perThreadBuffer.get());
+            digits = perThreadBuffer.get();
             digitno = ndigits-1;
             c = ivalue%10;
             ivalue /= 10;
@@ -353,7 +353,7 @@
             // same algorithm as above (same bugs, too )
             // but using long arithmetic.
             ndigits = 20;
-            digits = (char[])(perThreadBuffer.get());
+            digits = perThreadBuffer.get();
             digitno = ndigits-1;
             c = (int)(lvalue%10L);
             lvalue /= 10L;
@@ -554,9 +554,9 @@
         }
         // Begin to unpack
         // Discover obvious special cases of NaN and Infinity.
-        binExp = (int)( (fBits&singleExpMask) >> singleExpShift );
+        binExp = (fBits&singleExpMask) >> singleExpShift;
         fractBits = fBits&singleFractMask;
-        if ( binExp == (int)(singleExpMask>>singleExpShift) ) {
+        if ( binExp == (singleExpMask>>singleExpShift) ) {
             isExceptional = true;
             if ( fractBits == 0L ){
                 digits =  infinity;
@@ -1140,8 +1140,8 @@
     }
 
     // Per-thread buffer for string/stringbuffer conversion
-    private static ThreadLocal perThreadBuffer = new ThreadLocal() {
-            protected synchronized Object initialValue() {
+    private static ThreadLocal<char[]> perThreadBuffer = new ThreadLocal<char[]>() {
+            protected synchronized char[] initialValue() {
                 return new char[26];
             }
         };
--- a/src/share/classes/sun/misc/InvalidJarIndexException.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/misc/InvalidJarIndexException.java	Fri Dec 16 12:12:17 2011 -0800
@@ -38,6 +38,8 @@
 public
 class InvalidJarIndexException extends RuntimeException {
 
+    static final long serialVersionUID = -6159797516569680148L;
+
     /**
      * Constructs an <code>InvalidJarIndexException</code> with no
      * detail message.
--- a/src/share/classes/sun/misc/JarIndex.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/misc/JarIndex.java	Fri Dec 16 12:12:17 2011 -0800
@@ -48,13 +48,13 @@
      * The hash map that maintains mappings from
      * package/classe/resource to jar file list(s)
      */
-    private HashMap indexMap;
+    private HashMap<String,LinkedList<String>> indexMap;
 
     /**
      * The hash map that maintains mappings from
      * jar file to package/class/resource lists
      */
-    private HashMap jarMap;
+    private HashMap<String,LinkedList<String>> jarMap;
 
     /*
      * An ordered list of jar file names.
@@ -78,8 +78,8 @@
      * Constructs a new, empty jar index.
      */
     public JarIndex() {
-        indexMap = new HashMap();
-        jarMap = new HashMap();
+        indexMap = new HashMap<>();
+        jarMap = new HashMap<>();
     }
 
     /**
@@ -150,10 +150,11 @@
      * Add the key, value pair to the hashmap, the value will
      * be put in a linked list which is created if necessary.
      */
-    private void addToList(String key, String value, HashMap t) {
-        LinkedList list = (LinkedList)t.get(key);
+    private void addToList(String key, String value,
+                           HashMap<String,LinkedList<String>> t) {
+        LinkedList<String> list = t.get(key);
         if (list == null) {
-            list = new LinkedList();
+            list = new LinkedList<>();
             list.add(value);
             t.put(key, list);
         } else if (!list.contains(value)) {
@@ -166,13 +167,13 @@
      *
      * @param fileName the key of the mapping
      */
-    public LinkedList get(String fileName) {
-        LinkedList jarFiles = null;
-        if ((jarFiles = (LinkedList)indexMap.get(fileName)) == null) {
+    public LinkedList<String> get(String fileName) {
+        LinkedList<String> jarFiles = null;
+        if ((jarFiles = indexMap.get(fileName)) == null) {
             /* try the package name again */
             int pos;
             if((pos = fileName.lastIndexOf("/")) != -1) {
-                jarFiles = (LinkedList)indexMap.get(fileName.substring(0, pos));
+                jarFiles = indexMap.get(fileName.substring(0, pos));
             }
         }
         return jarFiles;
@@ -235,9 +236,9 @@
             ZipFile zrf = new ZipFile(currentJar.replace
                                       ('/', File.separatorChar));
 
-            Enumeration entries = zrf.entries();
+            Enumeration<? extends ZipEntry> entries = zrf.entries();
             while(entries.hasMoreElements()) {
-                ZipEntry entry = (ZipEntry) entries.nextElement();
+                ZipEntry entry = entries.nextElement();
                 String fileName = entry.getName();
 
                 // Skip the META-INF directory, the index, and manifest.
@@ -282,11 +283,11 @@
                 /* print out the jar file name */
                 String jar = jarFiles[i];
                 bw.write(jar + "\n");
-                LinkedList jarlist = (LinkedList)jarMap.get(jar);
+                LinkedList<String> jarlist = jarMap.get(jar);
                 if (jarlist != null) {
-                    Iterator listitr = jarlist.iterator();
+                    Iterator<String> listitr = jarlist.iterator();
                     while(listitr.hasNext()) {
-                        bw.write((String)(listitr.next()) + "\n");
+                        bw.write(listitr.next() + "\n");
                     }
                 }
                 bw.write("\n");
@@ -309,7 +310,7 @@
         String currentJar = null;
 
         /* an ordered list of jar file names */
-        Vector jars = new Vector();
+        Vector<String> jars = new Vector<>();
 
         /* read until we see a .jar line */
         while((line = br.readLine()) != null && !line.endsWith(".jar"));
@@ -328,7 +329,7 @@
             }
         }
 
-        jarFiles = (String[])jars.toArray(new String[jars.size()]);
+        jarFiles = jars.toArray(new String[jars.size()]);
     }
 
     /**
@@ -342,14 +343,14 @@
      *
      */
     public void merge(JarIndex toIndex, String path) {
-        Iterator itr = indexMap.entrySet().iterator();
+        Iterator<Map.Entry<String,LinkedList<String>>> itr = indexMap.entrySet().iterator();
         while(itr.hasNext()) {
-            Map.Entry e = (Map.Entry)itr.next();
-            String packageName = (String)e.getKey();
-            LinkedList from_list = (LinkedList)e.getValue();
-            Iterator listItr = from_list.iterator();
+            Map.Entry<String,LinkedList<String>> e = itr.next();
+            String packageName = e.getKey();
+            LinkedList<String> from_list = e.getValue();
+            Iterator<String> listItr = from_list.iterator();
             while(listItr.hasNext()) {
-                String jarName = (String)listItr.next();
+                String jarName = listItr.next();
                 if (path != null) {
                     jarName = path.concat(jarName);
                 }
--- a/src/share/classes/sun/misc/JavaLangAccess.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/misc/JavaLangAccess.java	Fri Dec 16 12:12:17 2011 -0800
@@ -31,19 +31,19 @@
 
 public interface JavaLangAccess {
     /** Return the constant pool for a class. */
-    ConstantPool getConstantPool(Class klass);
+    ConstantPool getConstantPool(Class<?> klass);
 
     /**
      * Set the AnnotationType instance corresponding to this class.
      * (This method only applies to annotation types.)
      */
-    void setAnnotationType(Class klass, AnnotationType annotationType);
+    void setAnnotationType(Class<?> klass, AnnotationType annotationType);
 
     /**
      * Get the AnnotationType instance corresponding to this class.
      * (This method only applies to annotation types.)
      */
-    AnnotationType getAnnotationType(Class klass);
+    AnnotationType getAnnotationType(Class<?> klass);
 
     /**
      * Returns the elements of an enum class or null if the
--- a/src/share/classes/sun/misc/JavaUtilJarAccess.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/misc/JavaUtilJarAccess.java	Fri Dec 16 12:12:17 2011 -0800
@@ -40,5 +40,5 @@
     public Enumeration<String> entryNames(JarFile jar, CodeSource[] cs);
     public Enumeration<JarEntry> entries2(JarFile jar);
     public void setEagerValidation(JarFile jar, boolean eager);
-    public List getManifestDigests(JarFile jar);
+    public List<Object> getManifestDigests(JarFile jar);
 }
--- a/src/share/classes/sun/misc/LRUCache.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/misc/LRUCache.java	Fri Dec 16 12:12:17 2011 -0800
@@ -52,7 +52,9 @@
 
     public V forName(N name) {
         if (oa == null) {
-            oa = (V[])new Object[size];
+            @SuppressWarnings("unchecked")
+            V[] temp = (V[])new Object[size];
+            oa = temp;
         } else {
             for (int i = 0; i < oa.length; i++) {
                 V ob = oa[i];
--- a/src/share/classes/sun/misc/Launcher.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/misc/Launcher.java	Fri Dec 16 12:12:17 2011 -0800
@@ -295,7 +295,7 @@
         /**
          * Override loadClass so we can checkPackageAccess.
          */
-        public Class loadClass(String name, boolean resolve)
+        public Class<?> loadClass(String name, boolean resolve)
             throws ClassNotFoundException
         {
             int i = name.lastIndexOf('.');
@@ -473,7 +473,7 @@
         public URLStreamHandler createURLStreamHandler(String protocol) {
             String name = PREFIX + "." + protocol + ".Handler";
             try {
-                Class c = Class.forName(name);
+                Class<?> c = Class.forName(name);
                 return (URLStreamHandler)c.newInstance();
             } catch (ReflectiveOperationException e) {
                 throw new InternalError("could not load " + protocol +
--- a/src/share/classes/sun/misc/ProxyGenerator.java	Tue Dec 13 18:38:39 2011 +0400
+++ b/src/share/classes/sun/misc/ProxyGenerator.java	Fri Dec 16 12:12:17 2011 -0800
@@ -351,7 +351,7 @@
         try {
             hashCodeMethod = Object.class.getMethod("hashCode");
             equalsMethod =
-                Object.class.getMethod("equals", new Class[] { Object.class });
+                Object.class.getMethod("equals", new Class<?>[] { Object.class });
             toStringMethod = Object.class.getMethod("toString");
         } catch (NoSuchMethodException e) {
             throw new NoSuchMethodError(e.getMessage());
@@ -559,11 +559,11 @@
      * passed to the invocation handler's "invoke" method for a given
      * set of duplicate methods.
      */
-    private void addProxyMethod(Method m, Class fromClass) {
+    private void addProxyMethod(Method m, Class<?> fromClass) {
         String name = m.getName();
-        Class[] parameterTypes = m.getParameterTypes();
-        Class returnType = m.getReturnType();
-        Class[] exceptionTypes = m.getExceptionTypes();
+        Class<?>[] parameterTypes = m.getParameterTypes();
+        Class<?> returnType = m.getReturnType();
+        Class<?>[] exceptionTypes = m.getExceptionTypes();
 
         String sig = name + getParameterDescriptors(parameterTypes);
         List<ProxyMethod> sigmethods = proxyMethods.get(sig);
@@ -581,7 +581,7 @@
                         exceptionTypes, pm.exceptionTypes, legalExceptions);
                     collectCompatibleTypes(
                         pm.exceptionTypes, exceptionTypes, legalExceptions);
-                    pm.exceptionTypes = new Class[legalExceptions.size()];
+                    pm.exceptionTypes = new Class<?>[legalExceptions.size()];
                     pm.exceptionTypes =
                         legalExceptions.toArray(pm.exceptionTypes);
                     return;
@@ -848,15 +848,15 @@
     private class ProxyMethod {
 
         public String methodName;
-        public Class[] parameterTypes;
-        public Class returnType;
-        public Class[] exceptionTypes;
-        public Class fromClass;
+        public Class<?>[] parameterTypes;
+        public Class<?> returnType;
+        public Class<?>[] exceptionTypes;
+        public Class<?> fromClass;
         public String methodFieldName;
 
-        private ProxyMethod(String methodName, Class[] parameterTypes,
-                            Class returnType, Class[] exceptionTypes,
-                            Class fromClass)
+        private ProxyMethod(String methodName, Class<?>[] parameterTypes,
+                            Class<?> returnType, Class<?>[] exceptionTypes,
+                            Class<?> fromClass)
         {
             this.methodName = methodName;
             this.parameterTypes = parameterTypes;
@@ -1001,7 +1001,7 @@
          * invocation handler's "invoke" method.  The code is written
          * to the supplied stream.
          */
-        private void codeWrapArgument(Class type, int slot,
+        private void codeWrapArgument(Class<?> type, int slot,
                                       DataOutputStream out)
             throws IOException
         {
@@ -1042,7 +1042,7 @@
          * Object) to its correct type.  The code is written to the
          * supplied stream.
          */
-        private void codeUnwrapReturnValue(Class type, DataOutputStream out)
+        private void codeUnwrapReturnValue(Class<?> type, DataOutputStream out)
             throws IOException
         {
             if (type.isPrimitive()) {
@@ -1391,7 +1391,7 @@
      * the supplied stream.  Note that the code generated by this method
      * may caused the checked ClassNotFoundException to be thrown.
      */
-    private void codeClassForName(Class cl, DataOutputStream out)
+    private void codeClassForName(Class<?> cl, DataOutputStream out)
         throws IOException
     {
         code_ldc(cp.getString(cl.getName()), out);
@@ -1422,8 +1422,8 @@
      * Return the "method descriptor" string for a method with the given
      * parameter types and return type.  See JVMS section 4.3.3.
      */
-    private static String getMethodDescriptor(Class[] parameterTypes,
-                                              Class returnType)
+    private static String getMethodDescriptor(Class<?>[] parameterTypes,
+                                              Class<?> returnType)
     {
         return getParameterDescriptors(parameterTypes) +
             ((returnType == void.class) ? "V" : getFieldType(returnType));
@@ -1436,7 +1436,7 @@
      * string is useful for constructing string keys for methods without
      * regard to their return type.
      */
-    private static String getParameterDescriptors(Class[] parameterTypes) {
+    private static String getParameterDescriptors(Class<?>[] parameterTypes) {
         StringBuilder desc = new StringBuilder("(");
         for (int i = 0; i < parameterTypes.length; i++) {
             desc.append(getFieldType(parameterTypes[i]));
@@ -1450,7 +1450,7 @@
      * a field descriptor, a parameter descriptor, or a return descriptor
      * other than "void".  See JVMS section 4.3.2.
      */
-    private static String getFieldType(Class type) {
+    private static String getFieldType(Class<?> type) {