Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6190628

Standard MBeans should support covariant return types in MBean interfaces.

    Details

    • Subcomponent:
    • Resolved In Build:
      b40
    • CPU:
      sparc
    • OS:
      solaris_9

      Description

      MBean compliance test doesn't support covariant return types in MBean interfaces.

      For instance:

      public interface ParentMBean {
          public Object getState();
          public void setState(Object state);
      }

      public interface ChildMBean extends ParentMBean {
          public String getState();
          public void setState(String state);
      }

      The code above compiles but when trying to register a ChildMBean
      in the MBeanServer the following exception is thrown:

      Exception in thread "main" javax.management.NotCompliantMBeanException: Type mismatch between parameters of get or isState, setState methods
      at com.sun.jmx.mbeanserver.Introspector.testConsistency(Introspector.java:399)
      at com.sun.jmx.mbeanserver.Introspector.introspect(Introspector.java:348)
      at com.sun.jmx.mbeanserver.Introspector.testCompliance(Introspector.java:208)
      at com.sun.jmx.mbeanserver.Introspector.testCompliance(Introspector.java:150)
      at com.sun.jmx.mbeanserver.StandardMetaDataImpl.buildMBeanInfo(StandardMetaDataImpl.java:116)
      at com.sun.jmx.mbeanserver.StandardMetaDataImpl.testCompliance(StandardMetaDataImpl.java:149)
      at com.sun.jmx.mbeanserver.MetaDataImpl.testCompliance(MetaDataImpl.java:125)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean(DefaultMBeanServerInterceptor.java:300)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean(DefaultMBeanServerInterceptor.java:211)
      at com.sun.jmx.mbeanserver.JmxMBeanServer.createMBean(JmxMBeanServer.java:301)
      at Main.main(Main.java:26)
      ###@###.### 11/4/04 09:36 GMT

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                emcmanus Eamonn McManus
                Reporter:
                lmalvent Luis-Miguel Alventosa (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: