aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libjava/classpath/ChangeLog.gcj7
-rw-r--r--libjava/classpath/gnu/javax/management/Server.java28
-rw-r--r--libjava/classpath/lib/gnu/javax/management/Server$ServerInfo.classbin898 -> 898 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/management/Server$ServerInputStream.classbin1219 -> 1219 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/management/Server$ServerNotificationListener.classbin1282 -> 1282 bytes
-rw-r--r--libjava/classpath/lib/gnu/javax/management/Server.classbin23261 -> 23419 bytes
6 files changed, 25 insertions, 10 deletions
diff --git a/libjava/classpath/ChangeLog.gcj b/libjava/classpath/ChangeLog.gcj
index 4aac14f..a4faec8 100644
--- a/libjava/classpath/ChangeLog.gcj
+++ b/libjava/classpath/ChangeLog.gcj
@@ -1,5 +1,12 @@
2007-02-15 Gary Benson <gbenson@redhat.com>
+ * gnu/javax/management/Server.java
+ (registerMBean): Always register objects that implement the
+ MBeanRegistration interface, and check the name returned by
+ preRegister before using it.
+
+2007-02-15 Gary Benson <gbenson@redhat.com>
+
* javax/management/ObjectName.java:
(getKeyPropertyList()): Remove cast and call
to UnmodifiableMap.
diff --git a/libjava/classpath/gnu/javax/management/Server.java b/libjava/classpath/gnu/javax/management/Server.java
index 5501b4a..aa39c75 100644
--- a/libjava/classpath/gnu/javax/management/Server.java
+++ b/libjava/classpath/gnu/javax/management/Server.java
@@ -1657,19 +1657,27 @@ public class Server
MBeanRegistration register = null;
if (obj instanceof MBeanRegistration)
register = (MBeanRegistration) obj;
- if (name == null)
+ if (name == null && register == null)
+ {
+ RuntimeException e =
+ new IllegalArgumentException("The name was null and " +
+ "the bean does not implement " +
+ "MBeanRegistration.");
+ throw new RuntimeOperationsException(e);
+ }
+ if (register != null)
{
- if (register == null)
- {
- RuntimeException e =
- new IllegalArgumentException("The name was null and " +
- "the bean does not implement " +
- "MBeanRegistration.");
- throw new RuntimeOperationsException(e);
- }
try
{
- name = register.preRegister(this, null);
+ name = register.preRegister(this, name);
+ if (name == null)
+ {
+ RuntimeException e =
+ new NullPointerException("The name returned by " +
+ "MBeanRegistration.preRegister() " +
+ "was null");
+ throw e;
+ }
if (sm != null)
sm.checkPermission(new MBeanPermission(className, null, name,
"registerMBean"));
diff --git a/libjava/classpath/lib/gnu/javax/management/Server$ServerInfo.class b/libjava/classpath/lib/gnu/javax/management/Server$ServerInfo.class
index 644d5a4..0840244 100644
--- a/libjava/classpath/lib/gnu/javax/management/Server$ServerInfo.class
+++ b/libjava/classpath/lib/gnu/javax/management/Server$ServerInfo.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/management/Server$ServerInputStream.class b/libjava/classpath/lib/gnu/javax/management/Server$ServerInputStream.class
index 536ac42..134351e 100644
--- a/libjava/classpath/lib/gnu/javax/management/Server$ServerInputStream.class
+++ b/libjava/classpath/lib/gnu/javax/management/Server$ServerInputStream.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/management/Server$ServerNotificationListener.class b/libjava/classpath/lib/gnu/javax/management/Server$ServerNotificationListener.class
index 769500c..dd98c5b 100644
--- a/libjava/classpath/lib/gnu/javax/management/Server$ServerNotificationListener.class
+++ b/libjava/classpath/lib/gnu/javax/management/Server$ServerNotificationListener.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/javax/management/Server.class b/libjava/classpath/lib/gnu/javax/management/Server.class
index 54552f0..41154ad 100644
--- a/libjava/classpath/lib/gnu/javax/management/Server.class
+++ b/libjava/classpath/lib/gnu/javax/management/Server.class
Binary files differ