summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2008-08-25 23:49:43 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2008-08-25 23:49:43 +0000
commitf21f421eb22f3bf70e1512ef3ed3c232cfae54c4 (patch)
tree9806afe73b79579fe648db3c4bf9fbe948c80f19
parentbb8cb9c04769df4025c51bf776727c89aefb72a4 (diff)
downloadclasspath-f21f421eb22f3bf70e1512ef3ed3c232cfae54c4.tar.gz
Fix warnings due to generics.
2008-08-26 Andrew John Hughes <gnu_andrew@member.fsf.org> * javax/management/DefaultLoaderRepository.java, * javax/management/JMX.java, * javax/management/MBeanAttributeInfo.java, * javax/management/MBeanConstructorInfo.java, * javax/management/MBeanOperationInfo.java, * javax/management/MBeanServerDelegate.java: Fix warnings due to generics.
-rw-r--r--ChangeLog10
-rw-r--r--javax/management/DefaultLoaderRepository.java4
-rw-r--r--javax/management/JMX.java2
-rw-r--r--javax/management/MBeanAttributeInfo.java4
-rw-r--r--javax/management/MBeanConstructorInfo.java4
-rw-r--r--javax/management/MBeanOperationInfo.java4
-rw-r--r--javax/management/MBeanServerDelegate.java5
7 files changed, 25 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 3192fae89..f32bb0904 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-08-26 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * javax/management/DefaultLoaderRepository.java,
+ * javax/management/JMX.java,
+ * javax/management/MBeanAttributeInfo.java,
+ * javax/management/MBeanConstructorInfo.java,
+ * javax/management/MBeanOperationInfo.java,
+ * javax/management/MBeanServerDelegate.java:
+ Fix warnings due to generics.
+
2008-08-25 Andrew John Hughes <gnu_andrew@member.fsf.org>
* javax/management/MBeanPermission.java,
diff --git a/javax/management/DefaultLoaderRepository.java b/javax/management/DefaultLoaderRepository.java
index b905af22f..38f7d0206 100644
--- a/javax/management/DefaultLoaderRepository.java
+++ b/javax/management/DefaultLoaderRepository.java
@@ -77,6 +77,8 @@ import java.util.List;
* @throws ClassNotFoundException if all the class loaders fail
* to load the class.
*/
+ // API issue with lack of <?> on Class
+ @SuppressWarnings("unchecked")
public static Class loadClass(String name)
throws ClassNotFoundException
{
@@ -124,6 +126,8 @@ import java.util.List;
* @throws ClassNotFoundException if all the class loaders fail
* to load the class.
*/
+ // API issue with lack of <?> on Class
+ @SuppressWarnings("unchecked")
public static Class loadClassWithout(ClassLoader exclude, String name)
throws ClassNotFoundException
{
diff --git a/javax/management/JMX.java b/javax/management/JMX.java
index a435d3e6b..e5fb2586f 100644
--- a/javax/management/JMX.java
+++ b/javax/management/JMX.java
@@ -324,6 +324,8 @@ public class JMX
* server using the given name.
* @see #newMXBeanProxy(MBeanServerConnection, ObjectName, Class)
*/
+ // Suppress warnings as we know an instance of T will be returned.
+ @SuppressWarnings("unchecked")
public static <T> T newMXBeanProxy(MBeanServerConnection conn,
ObjectName name, Class<T> iface,
boolean bcast)
diff --git a/javax/management/MBeanAttributeInfo.java b/javax/management/MBeanAttributeInfo.java
index 2e8475ea0..85e4e453b 100644
--- a/javax/management/MBeanAttributeInfo.java
+++ b/javax/management/MBeanAttributeInfo.java
@@ -117,7 +117,7 @@ public class MBeanAttributeInfo
{
Type t = setter.getGenericParameterTypes()[0];
if (t instanceof Class)
- attributeType = ((Class) t).getName();
+ attributeType = ((Class<?>) t).getName();
else
attributeType = t.toString();
isRead = false;
@@ -127,7 +127,7 @@ public class MBeanAttributeInfo
{
Type t = getter.getGenericReturnType();
if (t instanceof Class)
- attributeType = ((Class) t).getName();
+ attributeType = ((Class<?>) t).getName();
else
attributeType = t.toString();
isRead = true;
diff --git a/javax/management/MBeanConstructorInfo.java b/javax/management/MBeanConstructorInfo.java
index 15c8227c2..041f3e904 100644
--- a/javax/management/MBeanConstructorInfo.java
+++ b/javax/management/MBeanConstructorInfo.java
@@ -75,6 +75,8 @@ public class MBeanConstructorInfo
* @param desc a description of the attribute.
* @param cons the constructor.
*/
+ // API issue with lack of <?> on Constructor
+ @SuppressWarnings("unchecked")
public MBeanConstructorInfo(String desc, Constructor cons)
{
super(cons.getName(), desc);
@@ -85,7 +87,7 @@ public class MBeanConstructorInfo
Type t = paramTypes[a];
if (t instanceof Class)
signature[a] = new MBeanParameterInfo(null,
- ((Class) t).getName(),
+ ((Class<?>) t).getName(),
null);
else
signature[a] = new MBeanParameterInfo(null, t.toString(), null);
diff --git a/javax/management/MBeanOperationInfo.java b/javax/management/MBeanOperationInfo.java
index 6495072e6..03220c15e 100644
--- a/javax/management/MBeanOperationInfo.java
+++ b/javax/management/MBeanOperationInfo.java
@@ -121,14 +121,14 @@ public class MBeanOperationInfo
Type t = paramTypes[a];
if (t instanceof Class)
signature[a] = new MBeanParameterInfo(null,
- ((Class) t).getName(),
+ ((Class<?>) t).getName(),
null);
else
signature[a] = new MBeanParameterInfo(null, t.toString(), null);
}
Type retType = method.getGenericReturnType();
if (retType instanceof Class)
- type = ((Class) retType).getName();
+ type = ((Class<?>) retType).getName();
else
type = retType.toString();
if (method.getReturnType() == Void.TYPE)
diff --git a/javax/management/MBeanServerDelegate.java b/javax/management/MBeanServerDelegate.java
index 1337e2dcc..c55faa3d0 100644
--- a/javax/management/MBeanServerDelegate.java
+++ b/javax/management/MBeanServerDelegate.java
@@ -235,12 +235,11 @@ public class MBeanServerDelegate
public void removeNotificationListener(NotificationListener listener)
throws ListenerNotFoundException
{
- Iterator it = listeners.iterator();
+ Iterator<ListenerData> it = listeners.iterator();
boolean foundOne = false;
while (it.hasNext())
{
- ListenerData data = (ListenerData) it.next();
- if (data.getListener() == listener)
+ if (it.next().getListener() == listener)
{
it.remove();
foundOne = true;