JDK-6398884 : Method in MBean interface inherited from two parent interfaces appears twice in MBeanInfo
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2006-03-15
  • Updated: 2010-07-29
  • Resolved: 2007-01-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7Resolved
Related Reports
Duplicate :  
Relates :  
Description
Suppose I have the following interfaces:

public interface Parent1 {
    public int foo();
}
public interface Parent2 {
    public int foo();
}
public interface ChildMBean extends Parent1, Parent2 {
}
public class Child implements ChildMBean {
    public int foo() {return 0;}
}

If I register this MBean, its MBeanInfo will contain two MBeanOperationInfo defining two operations both called "foo".

The behaviour is the same if I define an MXBean instead of a Standard MBean.

This bug was already present in Tiger and is present in Mustang b77.

Comments
EVALUATION ChildMBean.class.getMethods() returns two Method operations in this case, which is apparently the correct behaviour. The code should eliminate one of them, and it should probably also merge any @DescriptorKey annotations from them.
15-03-2006