diff --git a/src/share/classes/java/io/ObjectOutputStream.java b/src/share/classes/java/io/ObjectOutputStream.java index c851b3a641a6825d6962561b71d6158de52d9669..612bb4eb16b1768d4da4e10e3c5593eda7fe9912 100644 --- a/src/share/classes/java/io/ObjectOutputStream.java +++ b/src/share/classes/java/io/ObjectOutputStream.java @@ -1248,7 +1248,7 @@ public class ObjectOutputStream handles.assign(unshared ? null : desc); Class cl = desc.forClass(); - Class[] ifaces = cl.getInterfaces(); + Class[] ifaces = cl.getInterfaces(); bout.writeInt(ifaces.length); for (int i = 0; i < ifaces.length; i++) { bout.writeUTF(ifaces[i].getName()); diff --git a/src/share/classes/java/io/ObjectStreamClass.java b/src/share/classes/java/io/ObjectStreamClass.java index 04873c8a85dbb9b3bb8ccd0a181e24ed85c0fbe4..5667690a74909ecba02660dc9392abab1ba24d19 100644 --- a/src/share/classes/java/io/ObjectStreamClass.java +++ b/src/share/classes/java/io/ObjectStreamClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1746,7 +1746,7 @@ public class ObjectStreamClass implements Serializable { dout.writeUTF("()V"); } - Constructor[] cons = cl.getDeclaredConstructors(); + Constructor[] cons = cl.getDeclaredConstructors(); MemberSignature[] consSigs = new MemberSignature[cons.length]; for (int i = 0; i < cons.length; i++) { consSigs[i] = new MemberSignature(cons[i]); diff --git a/src/share/classes/java/lang/reflect/Proxy.java b/src/share/classes/java/lang/reflect/Proxy.java index f2e4eda4e62a295fa3ac2f3eb90628b188f0effb..20e62b642ca0be3827773ce443a53cb3ce76ee32 100644 --- a/src/share/classes/java/lang/reflect/Proxy.java +++ b/src/share/classes/java/lang/reflect/Proxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -494,9 +494,10 @@ public class Proxy implements java.io.Serializable { private final int hash; private final WeakReference>[] refs; + @SuppressWarnings("unchecked") KeyX(Class[] interfaces) { hash = Arrays.hashCode(interfaces); - refs = new WeakReference[interfaces.length]; + refs = (WeakReference>[])new WeakReference[interfaces.length]; for (int i = 0; i < interfaces.length; i++) { refs[i] = new WeakReference<>(interfaces[i]); } diff --git a/src/share/classes/java/nio/file/TempFileHelper.java b/src/share/classes/java/nio/file/TempFileHelper.java index 7c348d5c8ddd20ffe005fcd000e07d08255e7da4..8d171dee269865f905fa90325a8c01ed7fa91168 100644 --- a/src/share/classes/java/nio/file/TempFileHelper.java +++ b/src/share/classes/java/nio/file/TempFileHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,7 +81,7 @@ class TempFileHelper { String prefix, String suffix, boolean createDirectory, - FileAttribute[] attrs) + FileAttribute[] attrs) throws IOException { if (prefix == null) @@ -155,7 +155,7 @@ class TempFileHelper { static Path createTempFile(Path dir, String prefix, String suffix, - FileAttribute[] attrs) + FileAttribute[] attrs) throws IOException { return create(dir, prefix, suffix, false, attrs); @@ -167,7 +167,7 @@ class TempFileHelper { */ static Path createTempDirectory(Path dir, String prefix, - FileAttribute[] attrs) + FileAttribute[] attrs) throws IOException { return create(dir, prefix, null, true, attrs); diff --git a/src/share/classes/java/util/IdentityHashMap.java b/src/share/classes/java/util/IdentityHashMap.java index 4080821389416654d98119a0fba00dabeb30e72e..3db40588d77664e33879350628a39803094b55f0 100644 --- a/src/share/classes/java/util/IdentityHashMap.java +++ b/src/share/classes/java/util/IdentityHashMap.java @@ -1243,7 +1243,7 @@ public class IdentityHashMap if (ti >= size) { throw new ConcurrentModificationException(); } - a[ti++] = (T) new AbstractMap.SimpleEntry(unmaskNull(key), tab[si + 1]); + a[ti++] = (T) new AbstractMap.SimpleEntry<>(unmaskNull(key), tab[si + 1]); } } // fewer elements than expected or concurrent modification from other thread detected diff --git a/src/share/classes/java/util/logging/Logger.java b/src/share/classes/java/util/logging/Logger.java index efc18c520c0100f998d273fac28d6c3bff1ae9a5..1976512cac8f124ef7b077676e087c9cb9b87306 100644 --- a/src/share/classes/java/util/logging/Logger.java +++ b/src/share/classes/java/util/logging/Logger.java @@ -351,7 +351,7 @@ public class Logger { ? caller.getClassLoader() : null); if (callersClassLoader != null) { - this.callersClassLoaderRef = new WeakReference(callersClassLoader); + this.callersClassLoaderRef = new WeakReference<>(callersClassLoader); } } diff --git a/src/share/classes/java/util/logging/Logging.java b/src/share/classes/java/util/logging/Logging.java index e22a82e9d19e0fd81f25e18c0b0315a48af63696..740a533063d1542cef2ab0bbd0b0258a9404e30c 100644 --- a/src/share/classes/java/util/logging/Logging.java +++ b/src/share/classes/java/util/logging/Logging.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,11 +55,11 @@ class Logging implements LoggingMXBean { } public List getLoggerNames() { - Enumeration loggers = logManager.getLoggerNames(); + Enumeration loggers = logManager.getLoggerNames(); ArrayList array = new ArrayList<>(); for (; loggers.hasMoreElements();) { - array.add((String) loggers.nextElement()); + array.add(loggers.nextElement()); } return array; } diff --git a/src/share/classes/sun/misc/Cleaner.java b/src/share/classes/sun/misc/Cleaner.java index f23764e80de82afb422621a8ca5c1651065efefd..5e92f35d616c5ce3dccde6776d01b25ef4909c82 100644 --- a/src/share/classes/sun/misc/Cleaner.java +++ b/src/share/classes/sun/misc/Cleaner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,14 +57,14 @@ import java.security.PrivilegedAction; */ public class Cleaner - extends PhantomReference + extends PhantomReference { // Dummy reference queue, needed because the PhantomReference constructor // insists that we pass a queue. Nothing will ever be placed on this queue // since the reference handler invokes cleaners explicitly. // - private static final ReferenceQueue dummyQueue = new ReferenceQueue(); + private static final ReferenceQueue dummyQueue = new ReferenceQueue<>(); // Doubly-linked list of live cleaners, which prevents the cleaners // themselves from being GC'd before their referents @@ -119,6 +119,7 @@ public class Cleaner /** * Creates a new cleaner. * + * @param ob the referent object to be cleaned * @param thunk * The cleanup code to be run when the cleaner is invoked. The * cleanup code is run directly from the reference-handler thread, diff --git a/src/share/classes/sun/misc/ProxyGenerator.java b/src/share/classes/sun/misc/ProxyGenerator.java index dd93aa092e0c4b84892d67577ea11f95193401fb..d561df61d27413cf371b48817f903fd3cfa62e47 100644 --- a/src/share/classes/sun/misc/ProxyGenerator.java +++ b/src/share/classes/sun/misc/ProxyGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -384,7 +384,7 @@ public class ProxyGenerator { private String className; /** proxy interfaces */ - private Class[] interfaces; + private Class[] interfaces; /** proxy class access flags */ private int accessFlags; diff --git a/src/share/classes/sun/rmi/rmic/Main.java b/src/share/classes/sun/rmi/rmic/Main.java index 8e0eb3a9a6229440170ae713e9cb6a1688337ecc..f321a6e6d4c35f7a0cb1d34b1ae8365300386b0e 100644 --- a/src/share/classes/sun/rmi/rmic/Main.java +++ b/src/share/classes/sun/rmi/rmic/Main.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -494,7 +494,7 @@ public class Main implements sun.rmi.rmic.Constants { extDirsArg); BatchEnvironment result = null; try { - Class[] ctorArgTypes = {OutputStream.class,ClassPath.class,Main.class}; + Class[] ctorArgTypes = {OutputStream.class,ClassPath.class,Main.class}; Object[] ctorArgs = {out,classPath,this}; Constructor constructor = environmentClass.getConstructor(ctorArgTypes); diff --git a/src/share/classes/sun/rmi/server/LoaderHandler.java b/src/share/classes/sun/rmi/server/LoaderHandler.java index c35da195ad2b28617ddf2a2a2b27bfda86ae3fd3..96c692b8ec83f2fd3c5a57ae8de75ac7ab45892f 100644 --- a/src/share/classes/sun/rmi/server/LoaderHandler.java +++ b/src/share/classes/sun/rmi/server/LoaderHandler.java @@ -692,7 +692,7 @@ public final class LoaderHandler { * Define a proxy class in the given class loader. The proxy * class will implement the given interfaces Classes. */ - private static Class loadProxyClass(ClassLoader loader, Class[] interfaces) + private static Class loadProxyClass(ClassLoader loader, Class[] interfaces) throws ClassNotFoundException { try { @@ -719,7 +719,7 @@ public final class LoaderHandler { */ private static ClassLoader loadProxyInterfaces(String[] interfaces, ClassLoader loader, - Class[] classObjs, + Class[] classObjs, boolean[] nonpublic) throws ClassNotFoundException { diff --git a/src/share/classes/sun/rmi/server/UnicastServerRef.java b/src/share/classes/sun/rmi/server/UnicastServerRef.java index 180a62523042af6b42c0086e75c9fb77fef06aeb..8342c08264acecdcf03e6fb4dd878b20a44d653f 100644 --- a/src/share/classes/sun/rmi/server/UnicastServerRef.java +++ b/src/share/classes/sun/rmi/server/UnicastServerRef.java @@ -299,7 +299,7 @@ public class UnicastServerRef extends UnicastRef logCall(obj, method); // unmarshal parameters - Class[] types = method.getParameterTypes(); + Class[] types = method.getParameterTypes(); Object[] params = new Object[types.length]; try { diff --git a/src/share/classes/sun/rmi/server/Util.java b/src/share/classes/sun/rmi/server/Util.java index 0f82a84c9b180f2d9cd42336f8e8ae72f715b025..e37bcb9620bc8b53459867412acf37001f9342de 100644 --- a/src/share/classes/sun/rmi/server/Util.java +++ b/src/share/classes/sun/rmi/server/Util.java @@ -87,7 +87,7 @@ public final class Util { Collections.synchronizedMap(new WeakHashMap, Void>(11)); /** parameter types for stub constructor */ - private static final Class[] stubConsParamTypes = { RemoteRef.class }; + private static final Class[] stubConsParamTypes = { RemoteRef.class }; private Util() { } @@ -143,7 +143,7 @@ public final class Util { } final ClassLoader loader = implClass.getClassLoader(); - final Class[] interfaces = getRemoteInterfaces(implClass); + final Class[] interfaces = getRemoteInterfaces(implClass); final InvocationHandler handler = new RemoteObjectInvocationHandler(clientRef);