From a6653458b7f1252ca6f6db8cd2d01f2e82150f13 Mon Sep 17 00:00:00 2001 From: valeriep Date: Tue, 8 Oct 2013 14:41:46 -0700 Subject: [PATCH] 8025967: addition of -Werror broke the old build Summary: Fixed and suppressed compiler warnings on rawtypes Reviewed-by: vinnie --- src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java | 2 +- src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java | 2 +- .../www/protocol/https/HttpsURLConnectionOldImpl.java | 1 + src/share/classes/java/lang/instrument/Instrumentation.java | 2 ++ src/share/classes/java/net/ContentHandler.java | 1 + src/share/classes/javax/crypto/JceSecurityManager.java | 2 +- src/share/classes/sun/instrument/InstrumentationImpl.java | 4 ++++ src/share/classes/sun/net/www/content/image/gif.java | 1 + src/share/classes/sun/net/www/content/image/jpeg.java | 1 + src/share/classes/sun/net/www/content/image/png.java | 1 + src/share/classes/sun/net/www/content/image/x_xbitmap.java | 1 + src/share/classes/sun/net/www/content/image/x_xpixmap.java | 1 + .../sun/net/www/protocol/https/HttpsURLConnectionImpl.java | 1 + src/share/classes/sun/reflect/misc/MethodUtil.java | 4 ++-- src/share/classes/sun/security/provider/AuthPolicyFile.java | 2 +- .../classes/sun/security/provider/SubjectCodeSource.java | 2 +- src/share/classes/sun/security/tools/jarsigner/Main.java | 2 +- src/share/classes/sun/security/tools/keytool/Main.java | 2 +- .../classes/sun/security/tools/policytool/PolicyTool.java | 6 +++--- 19 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java b/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java index d6ab7310a..9797aad34 100644 --- a/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java +++ b/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java @@ -237,7 +237,7 @@ final public class LdapCtxFactory implements ObjectFactory, InitialContextFactor private static String[] getTypeNames(Class currentClass, Vector v) { getClassesAux(currentClass, v); - Class[] members = currentClass.getInterfaces(); + Class[] members = currentClass.getInterfaces(); for (int i = 0; i < members.length; i++) { getClassesAux(members[i], v); } diff --git a/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java b/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java index b401c0289..122253812 100644 --- a/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java +++ b/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java @@ -237,7 +237,7 @@ public final class LdapPoolManager { !socketFactory.equals(LdapCtx.DEFAULT_SSL_FACTORY)) { try { Class socketFactoryClass = Obj.helper.loadClass(socketFactory); - Class[] interfaces = socketFactoryClass.getInterfaces(); + Class[] interfaces = socketFactoryClass.getInterfaces(); for (int i = 0; i < interfaces.length; i++) { if (interfaces[i].getCanonicalName().equals(COMPARATOR)) { foundSockCmp = true; diff --git a/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnectionOldImpl.java b/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnectionOldImpl.java index 776a84c14..f4a2a8055 100644 --- a/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnectionOldImpl.java +++ b/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnectionOldImpl.java @@ -404,6 +404,7 @@ public class HttpsURLConnectionOldImpl return delegate.getContent(); } + @SuppressWarnings("rawtypes") public Object getContent(Class[] classes) throws IOException { return delegate.getContent(classes); } diff --git a/src/share/classes/java/lang/instrument/Instrumentation.java b/src/share/classes/java/lang/instrument/Instrumentation.java index 4cdb2de9c..bedb78068 100644 --- a/src/share/classes/java/lang/instrument/Instrumentation.java +++ b/src/share/classes/java/lang/instrument/Instrumentation.java @@ -381,6 +381,7 @@ public interface Instrumentation { * * @return an array containing all the classes loaded by the JVM, zero-length if there are none */ + @SuppressWarnings("rawtypes") Class[] getAllLoadedClasses(); @@ -393,6 +394,7 @@ public interface Instrumentation { * @return an array containing all the classes for which loader is an initiating loader, * zero-length if there are none */ + @SuppressWarnings("rawtypes") Class[] getInitiatedClasses(ClassLoader loader); diff --git a/src/share/classes/java/net/ContentHandler.java b/src/share/classes/java/net/ContentHandler.java index 8c585cbf3..c658585c5 100644 --- a/src/share/classes/java/net/ContentHandler.java +++ b/src/share/classes/java/net/ContentHandler.java @@ -96,6 +96,7 @@ abstract public class ContentHandler { * @exception IOException if an I/O error occurs while reading the object. * @since 1.3 */ + @SuppressWarnings("rawtypes") public Object getContent(URLConnection urlc, Class[] classes) throws IOException { Object obj = getContent(urlc); diff --git a/src/share/classes/javax/crypto/JceSecurityManager.java b/src/share/classes/javax/crypto/JceSecurityManager.java index d4818acc8..53afe676f 100644 --- a/src/share/classes/javax/crypto/JceSecurityManager.java +++ b/src/share/classes/javax/crypto/JceSecurityManager.java @@ -230,7 +230,7 @@ final class JceSecurityManager extends SecurityManager { // See bug 4341369 & 4334690 for more info. boolean isCallerTrusted() { // Get the caller and its codebase. - Class[] context = getClassContext(); + Class[] context = getClassContext(); URL callerCodeBase = null; int i; for (i=0; i[] cls = classes; for (int i = 0; i < cls.length; i++) { diff --git a/src/share/classes/sun/net/www/content/image/jpeg.java b/src/share/classes/sun/net/www/content/image/jpeg.java index a663f130b..6073dd7be 100644 --- a/src/share/classes/sun/net/www/content/image/jpeg.java +++ b/src/share/classes/sun/net/www/content/image/jpeg.java @@ -36,6 +36,7 @@ public class jpeg extends ContentHandler { return new URLImageSource(urlc); } + @SuppressWarnings("rawtypes") public Object getContent(URLConnection urlc, Class[] classes) throws IOException { Class[] cls = classes; for (int i = 0; i < cls.length; i++) { diff --git a/src/share/classes/sun/net/www/content/image/png.java b/src/share/classes/sun/net/www/content/image/png.java index fcaa33a71..535e31a96 100644 --- a/src/share/classes/sun/net/www/content/image/png.java +++ b/src/share/classes/sun/net/www/content/image/png.java @@ -36,6 +36,7 @@ public class png extends ContentHandler { return new URLImageSource(urlc); } + @SuppressWarnings("rawtypes") public Object getContent(URLConnection urlc, Class[] classes) throws IOException { Class[] cls = classes; for (int i = 0; i < cls.length; i++) { diff --git a/src/share/classes/sun/net/www/content/image/x_xbitmap.java b/src/share/classes/sun/net/www/content/image/x_xbitmap.java index 9a3fd55f3..11e86ab9c 100644 --- a/src/share/classes/sun/net/www/content/image/x_xbitmap.java +++ b/src/share/classes/sun/net/www/content/image/x_xbitmap.java @@ -35,6 +35,7 @@ public class x_xbitmap extends ContentHandler { return new URLImageSource(urlc); } + @SuppressWarnings("rawtypes") public Object getContent(URLConnection urlc, Class[] classes) throws java.io.IOException { Class[] cls = classes; for (int i = 0; i < cls.length; i++) { diff --git a/src/share/classes/sun/net/www/content/image/x_xpixmap.java b/src/share/classes/sun/net/www/content/image/x_xpixmap.java index 8a2eb1f7f..e08609b32 100644 --- a/src/share/classes/sun/net/www/content/image/x_xpixmap.java +++ b/src/share/classes/sun/net/www/content/image/x_xpixmap.java @@ -35,6 +35,7 @@ public class x_xpixmap extends ContentHandler { return new URLImageSource(urlc); } + @SuppressWarnings("rawtypes") public Object getContent(URLConnection urlc, Class[] classes) throws java.io.IOException { Class[] cls = classes; for (int i = 0; i < cls.length; i++) { diff --git a/src/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java b/src/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java index 832854c9d..c664a69f6 100644 --- a/src/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java +++ b/src/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java @@ -434,6 +434,7 @@ public class HttpsURLConnectionImpl return delegate.getContent(); } + @SuppressWarnings("rawtypes") public Object getContent(Class[] classes) throws IOException { return delegate.getContent(classes); } diff --git a/src/share/classes/sun/reflect/misc/MethodUtil.java b/src/share/classes/sun/reflect/misc/MethodUtil.java index 24abe8667..1ec2eb6ca 100644 --- a/src/share/classes/sun/reflect/misc/MethodUtil.java +++ b/src/share/classes/sun/reflect/misc/MethodUtil.java @@ -217,7 +217,7 @@ public final class MethodUtil extends SecureClassLoader { */ private static class Signature { private String methodName; - private Class[] argClasses; + private Class[] argClasses; private volatile int hashCode = 0; @@ -299,7 +299,7 @@ public final class MethodUtil extends SecureClassLoader { new PrivilegedExceptionAction() { public Method run() throws Exception { Class t = getTrampolineClass(); - Class[] types = { + Class[] types = { Method.class, Object.class, Object[].class }; Method b = t.getDeclaredMethod("invoke", types); diff --git a/src/share/classes/sun/security/provider/AuthPolicyFile.java b/src/share/classes/sun/security/provider/AuthPolicyFile.java index ed9dce614..a13cee583 100644 --- a/src/share/classes/sun/security/provider/AuthPolicyFile.java +++ b/src/share/classes/sun/security/provider/AuthPolicyFile.java @@ -91,7 +91,7 @@ public class AuthPolicyFile extends javax.security.auth.Policy { private boolean ignoreIdentityScope = true; // for use with the reflection API - private static final Class[] PARAMS = { String.class, String.class}; + private static final Class[] PARAMS = { String.class, String.class}; /** * Initializes the Policy object and reads the default policy diff --git a/src/share/classes/sun/security/provider/SubjectCodeSource.java b/src/share/classes/sun/security/provider/SubjectCodeSource.java index 89a98129f..a92ff2790 100644 --- a/src/share/classes/sun/security/provider/SubjectCodeSource.java +++ b/src/share/classes/sun/security/provider/SubjectCodeSource.java @@ -58,7 +58,7 @@ class SubjectCodeSource extends CodeSource implements java.io.Serializable { private Subject subject; private LinkedList principals; - private static final Class[] PARAMS = { String.class }; + private static final Class[] PARAMS = { String.class }; private static final sun.security.util.Debug debug = sun.security.util.Debug.getInstance("auth", "\t[Auth Access]"); private ClassLoader sysClassLoader; diff --git a/src/share/classes/sun/security/tools/jarsigner/Main.java b/src/share/classes/sun/security/tools/jarsigner/Main.java index 72ce4617b..fe2bf5576 100644 --- a/src/share/classes/sun/security/tools/jarsigner/Main.java +++ b/src/share/classes/sun/security/tools/jarsigner/Main.java @@ -93,7 +93,7 @@ public class Main { // prefix for new signature-related files in META-INF directory private static final String SIG_PREFIX = META_INF + "SIG-"; - private static final Class[] PARAM_STRING = { String.class }; + private static final Class[] PARAM_STRING = { String.class }; private static final String NONE = "NONE"; private static final String P11KEYSTORE = "PKCS11"; diff --git a/src/share/classes/sun/security/tools/keytool/Main.java b/src/share/classes/sun/security/tools/keytool/Main.java index c5e0fe7d6..7cd92d68c 100644 --- a/src/share/classes/sun/security/tools/keytool/Main.java +++ b/src/share/classes/sun/security/tools/keytool/Main.java @@ -309,7 +309,7 @@ public final class Main { } }; - private static final Class[] PARAM_STRING = { String.class }; + private static final Class[] PARAM_STRING = { String.class }; private static final String NONE = "NONE"; private static final String P11KEYSTORE = "PKCS11"; diff --git a/src/share/classes/sun/security/tools/policytool/PolicyTool.java b/src/share/classes/sun/security/tools/policytool/PolicyTool.java index 9a325e5ac..c1f12c09b 100644 --- a/src/share/classes/sun/security/tools/policytool/PolicyTool.java +++ b/src/share/classes/sun/security/tools/policytool/PolicyTool.java @@ -77,9 +77,9 @@ public class PolicyTool { boolean modified = false; private static final boolean testing = false; - private static final Class[] TWOPARAMS = { String.class, String.class }; - private static final Class[] ONEPARAMS = { String.class }; - private static final Class[] NOPARAMS = {}; + private static final Class[] TWOPARAMS = { String.class, String.class }; + private static final Class[] ONEPARAMS = { String.class }; + private static final Class[] NOPARAMS = {}; /* * All of the policy entries are read in from the * policy file and stored here. Updates to the policy entries -- GitLab