This fixes a few JAPI errors thrown up by the 1.6 changes to javax.management.
Changelog:
2007-02-19 Andrew John Hughes <[EMAIL PROTECTED]>
* javax/management/MBeanServer.java:
(queryMBeans(ObjectName,QueryExp)): Returned
generically-typed Set.
(queryNames(ObjectName,QueryExp)): Likewise.
* javax/management/MBeanServerConnection.java:
(queryMBeans(ObjectName,QueryExp)): Returned
generically-typed Set.
(queryNames(ObjectName,QueryExp)): Likewise.
* javax/management/ObjectName.java:
Use a generically-typed TreeMap.
(ObjectName(String,Hashtable<String,String>):
Genericized.
(getKeyPropertyList()): Likewise.
* javax/management/StandardMBean.java:
Use a generically-typed interface class.
(StandardMBean(Class<?>)): Genericized.
(StandardMBean(T, Class<T>)): Likewise.
(getImplementationClass()): Likewise.
(getMBeanInterface()): Likewise.
--
Andrew :-)
Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html
public class gcj extends Freedom implements Java { ... }
Index: javax/management/MBeanServer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/management/MBeanServer.java,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 MBeanServer.java
--- javax/management/MBeanServer.java 28 Sep 2006 20:03:32 -0000 1.2
+++ javax/management/MBeanServer.java 19 Feb 2007 01:28:12 -0000
@@ -890,7 +890,7 @@ public interface MBeanServer
* arise from the execution of the query, in which
* case that particular bean will again be
excluded.
*/
- Set queryMBeans(ObjectName name, QueryExp query);
+ Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query);
/**
* <p>
@@ -929,7 +929,7 @@ public interface MBeanServer
* Note that these permissions are implied if the
* <code>queryMBeans</code> permissions are
available.
*/
- Set queryNames(ObjectName name, QueryExp query);
+ Set<ObjectName> queryNames(ObjectName name, QueryExp query);
/**
* Registers the supplied instance with the server, using the specified
Index: javax/management/MBeanServerConnection.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/management/MBeanServerConnection.java,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 MBeanServerConnection.java
--- javax/management/MBeanServerConnection.java 28 Sep 2006 20:03:32 -0000
1.1
+++ javax/management/MBeanServerConnection.java 19 Feb 2007 01:28:13 -0000
@@ -533,7 +533,7 @@ public interface MBeanServerConnection
* @throws IOException if an I/O error occurred in communicating with
* the bean server.
*/
- Set queryMBeans(ObjectName name, QueryExp query)
+ Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query)
throws IOException;
/**
@@ -560,7 +560,7 @@ public interface MBeanServerConnection
* @throws IOException if an I/O error occurred in communicating with
* the bean server.
*/
- Set queryNames(ObjectName name, QueryExp query)
+ Set<ObjectName> queryNames(ObjectName name, QueryExp query)
throws IOException;
/**
Index: javax/management/ObjectName.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/management/ObjectName.java,v
retrieving revision 1.5
diff -u -3 -p -u -r1.5 ObjectName.java
--- javax/management/ObjectName.java 13 Feb 2007 14:41:58 -0000 1.5
+++ javax/management/ObjectName.java 19 Feb 2007 01:28:13 -0000
@@ -105,7 +105,7 @@ public class ObjectName
/**
* The properties, as key-value pairs.
*/
- private TreeMap properties;
+ private TreeMap<String,String> properties;
/**
* The properties as a string (stored for ordering).
@@ -164,7 +164,7 @@ public class ObjectName
throw new MalformedObjectNameException("A name that is not a " +
"pattern must contain at " +
"least one key-value pair.");
- properties = new TreeMap();
+ properties = new TreeMap<String,String>();
for (int a = 0; a < pairs.length; ++a)
{
int sep = pairs[a].indexOf('=');
@@ -197,7 +197,7 @@ public class ObjectName
throws MalformedObjectNameException
{
this.domain = domain;
- properties = new TreeMap();
+ properties = new TreeMap<String,String>();
properties.put(key, value);
checkComponents();
}
@@ -216,7 +216,7 @@ public class ObjectName
* @throws NullPointerException if one of the parameters is
* <code>null</code>.
*/
- public ObjectName(String domain, Hashtable properties)
+ public ObjectName(String domain, Hashtable<String,String> properties)
throws MalformedObjectNameException
{
this.domain = domain;
@@ -542,7 +542,8 @@ public class ObjectName
* specifications.
* @throws NullPointerException if <code>name</code> is <code>null</code>.
*/
- public static ObjectName getInstance(String domain, Hashtable properties)
+ public static ObjectName getInstance(String domain,
+ Hashtable<String,String> properties)
throws MalformedObjectNameException
{
return new ObjectName(domain, properties);
@@ -571,9 +572,9 @@ public class ObjectName
* @return a [EMAIL PROTECTED] java.util.Hashtable}, containing each of the
object
* name's properties.
*/
- public Hashtable getKeyPropertyList()
+ public Hashtable<String,String> getKeyPropertyList()
{
- return new Hashtable(properties);
+ return new Hashtable<String,String>(properties);
}
/**
Index: javax/management/StandardMBean.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/management/StandardMBean.java,v
retrieving revision 1.6
diff -u -3 -p -u -r1.6 StandardMBean.java
--- javax/management/StandardMBean.java 12 Feb 2007 00:56:30 -0000 1.6
+++ javax/management/StandardMBean.java 19 Feb 2007 01:28:13 -0000
@@ -69,7 +69,7 @@ public class StandardMBean
/**
* The interface for this bean.
*/
- private Class iface;
+ private Class<?> iface;
/**
* The implementation of the interface.
@@ -94,7 +94,7 @@ public class StandardMBean
* in the interface that doesn't comply
* with the naming conventions.
*/
- protected StandardMBean(Class iface)
+ protected StandardMBean(Class<?> iface)
throws NotCompliantMBeanException
{
if (iface == null)
@@ -133,7 +133,7 @@ public class StandardMBean
* in the interface that doesn't comply
* with the naming conventions.
*/
- public StandardMBean(Object impl, Class iface)
+ public <T> StandardMBean(T impl, Class<T> iface)
throws NotCompliantMBeanException
{
if (impl == null)
@@ -143,8 +143,8 @@ public class StandardMBean
String className = impl.getClass().getName();
try
{
- iface = Class.forName(className + "MBean", true,
- impl.getClass().getClassLoader());
+ this.iface = Class.forName(className + "MBean", true,
+ impl.getClass().getClassLoader());
}
catch (ClassNotFoundException e)
{
@@ -154,11 +154,12 @@ public class StandardMBean
" was not found.").initCause(e));
}
}
- if (!(iface.isInstance(impl)))
+ else
+ this.iface = iface;
+ if (!(this.iface.isInstance(impl)))
throw new NotCompliantMBeanException("The instance, " + impl +
", is not an instance of " + iface);
this.impl = impl;
- this.iface = iface;
}
/**
@@ -493,7 +494,7 @@ public class StandardMBean
*
* @return the implementation class.
*/
- public Class getImplementationClass()
+ public Class<?> getImplementationClass()
{
return impl.getClass();
}
@@ -681,7 +682,7 @@ public class StandardMBean
*
* @return the management interface.
*/
- public final Class getMBeanInterface()
+ public final Class<?> getMBeanInterface()
{
return iface;
}
signature.asc
Description: Digital signature
