7104650: rawtype warnings in several net, nio and security source files
Summary: Also reviewed by Ulf.Zibis@gmx.de
Reviewed-by: mcimadamore, alanb, dholmes
--- a/jdk/make/sun/net/Makefile Tue Oct 25 09:27:20 2011 +0100
+++ b/jdk/make/sun/net/Makefile Wed Oct 26 13:58:46 2011 +0100
@@ -28,6 +28,7 @@
PRODUCT = sun
SUBDIRS_MAKEFLAGS += JAVAC_MAX_WARNINGS=true
SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true
+SUBDIRS_MAKEFLAGS += JAVAC_LINT_OPTIONS=-Xlint:all,-deprecation,-path
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = others spi
--- a/jdk/src/share/classes/java/net/InetAddress.java Tue Oct 25 09:27:20 2011 +0100
+++ b/jdk/src/share/classes/java/net/InetAddress.java Wed Oct 26 13:58:46 2011 +0100
@@ -876,10 +876,12 @@
nameService = java.security.AccessController.doPrivileged(
new java.security.PrivilegedExceptionAction<NameService>() {
public NameService run() {
- Iterator itr = Service.providers(NameServiceDescriptor.class);
+ // sun.misc.Service.providers returns a raw Iterator
+ @SuppressWarnings("unchecked")
+ Iterator<NameServiceDescriptor> itr =
+ Service.providers(NameServiceDescriptor.class);
while (itr.hasNext()) {
- NameServiceDescriptor nsd
- = (NameServiceDescriptor)itr.next();
+ NameServiceDescriptor nsd = itr.next();
if (providerName.
equalsIgnoreCase(nsd.getType()+","
+nsd.getProviderName())) {
--- a/jdk/src/share/classes/java/net/ServerSocket.java Tue Oct 25 09:27:20 2011 +0100
+++ b/jdk/src/share/classes/java/net/ServerSocket.java Wed Oct 26 13:58:46 2011 +0100
@@ -267,10 +267,9 @@
AccessController.doPrivileged(
new PrivilegedExceptionAction<Void>() {
public Void run() throws NoSuchMethodException {
- Class[] cl = new Class[2];
- cl[0] = SocketAddress.class;
- cl[1] = Integer.TYPE;
- impl.getClass().getDeclaredMethod("connect", cl);
+ impl.getClass().getDeclaredMethod("connect",
+ SocketAddress.class,
+ int.class);
return null;
}
});
--- a/jdk/src/share/classes/java/nio/charset/Charset.java Tue Oct 25 09:27:20 2011 +0100
+++ b/jdk/src/share/classes/java/nio/charset/Charset.java Wed Oct 26 13:58:46 2011 +0100
@@ -435,7 +435,7 @@
AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
try {
- Class epc
+ Class<?> epc
= Class.forName("sun.nio.cs.ext.ExtendedCharsets");
extendedProvider = (CharsetProvider)epc.newInstance();
} catch (ClassNotFoundException x) {
--- a/jdk/src/share/classes/java/security/Security.java Tue Oct 25 09:27:20 2011 +0100
+++ b/jdk/src/share/classes/java/security/Security.java Wed Oct 26 13:58:46 2011 +0100
@@ -814,7 +814,7 @@
public Void run() {
try {
/* Get the class via the bootstrap class loader. */
- Class cl = Class.forName(
+ Class<?> cl = Class.forName(
"java.lang.SecurityManager", false, null);
Field f = null;
boolean accessible = false;
--- a/jdk/src/share/classes/sun/nio/ch/Util.java Tue Oct 25 09:27:20 2011 +0100
+++ b/jdk/src/share/classes/sun/nio/ch/Util.java Wed Oct 26 13:58:46 2011 +0100
@@ -363,10 +363,10 @@
try {
Class<?> cl = Class.forName("java.nio.DirectByteBuffer");
Constructor<?> ctor = cl.getDeclaredConstructor(
- new Class[] { int.class,
- long.class,
- FileDescriptor.class,
- Runnable.class });
+ new Class<?>[] { int.class,
+ long.class,
+ FileDescriptor.class,
+ Runnable.class });
ctor.setAccessible(true);
directByteBufferConstructor = ctor;
} catch (ClassNotFoundException |
@@ -408,10 +408,10 @@
try {
Class<?> cl = Class.forName("java.nio.DirectByteBufferR");
Constructor<?> ctor = cl.getDeclaredConstructor(
- new Class[] { int.class,
- long.class,
- FileDescriptor.class,
- Runnable.class });
+ new Class<?>[] { int.class,
+ long.class,
+ FileDescriptor.class,
+ Runnable.class });
ctor.setAccessible(true);
directByteBufferRConstructor = ctor;
} catch (ClassNotFoundException |