As the subject says.
ChangeLog:
2008-08-26 Andrew John Hughes <[EMAIL PROTECTED]>
* 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.
--
Andrew :)
Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8
Index: javax/management/DefaultLoaderRepository.java
===================================================================
RCS file:
/sources/classpath/classpath/javax/management/DefaultLoaderRepository.java,v
retrieving revision 1.2
diff -u -u -r1.2 DefaultLoaderRepository.java
--- javax/management/DefaultLoaderRepository.java 16 Jan 2007 21:25:28
-0000 1.2
+++ javax/management/DefaultLoaderRepository.java 25 Aug 2008 23:28:53
-0000
@@ -77,6 +77,8 @@
* @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 @@
* @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
{
Index: javax/management/JMX.java
===================================================================
RCS file: /sources/classpath/classpath/javax/management/JMX.java,v
retrieving revision 1.2
diff -u -u -r1.2 JMX.java
--- javax/management/JMX.java 1 Apr 2007 16:34:14 -0000 1.2
+++ javax/management/JMX.java 25 Aug 2008 23:28:53 -0000
@@ -324,6 +324,8 @@
* 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)
Index: javax/management/MBeanAttributeInfo.java
===================================================================
RCS file:
/sources/classpath/classpath/javax/management/MBeanAttributeInfo.java,v
retrieving revision 1.5
diff -u -u -r1.5 MBeanAttributeInfo.java
--- javax/management/MBeanAttributeInfo.java 6 Apr 2007 21:03:27 -0000
1.5
+++ javax/management/MBeanAttributeInfo.java 25 Aug 2008 23:28:55 -0000
@@ -117,7 +117,7 @@
{
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 @@
{
Type t = getter.getGenericReturnType();
if (t instanceof Class)
- attributeType = ((Class) t).getName();
+ attributeType = ((Class<?>) t).getName();
else
attributeType = t.toString();
isRead = true;
Index: javax/management/MBeanConstructorInfo.java
===================================================================
RCS file:
/sources/classpath/classpath/javax/management/MBeanConstructorInfo.java,v
retrieving revision 1.6
diff -u -u -r1.6 MBeanConstructorInfo.java
--- javax/management/MBeanConstructorInfo.java 11 Dec 2006 01:54:39 -0000
1.6
+++ javax/management/MBeanConstructorInfo.java 25 Aug 2008 23:28:55 -0000
@@ -75,6 +75,8 @@
* @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 @@
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);
Index: javax/management/MBeanOperationInfo.java
===================================================================
RCS file:
/sources/classpath/classpath/javax/management/MBeanOperationInfo.java,v
retrieving revision 1.5
diff -u -u -r1.5 MBeanOperationInfo.java
--- javax/management/MBeanOperationInfo.java 11 Dec 2006 01:54:39 -0000
1.5
+++ javax/management/MBeanOperationInfo.java 25 Aug 2008 23:28:55 -0000
@@ -121,14 +121,14 @@
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)
Index: javax/management/MBeanServerDelegate.java
===================================================================
RCS file:
/sources/classpath/classpath/javax/management/MBeanServerDelegate.java,v
retrieving revision 1.4
diff -u -u -r1.4 MBeanServerDelegate.java
--- javax/management/MBeanServerDelegate.java 25 Aug 2008 22:29:17 -0000
1.4
+++ javax/management/MBeanServerDelegate.java 25 Aug 2008 23:28:55 -0000
@@ -235,12 +235,11 @@
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;