-
Bug
-
Resolution: Unresolved
-
P5
-
6u1
-
Cause Known
-
generic
-
generic
Suppose you have an interface like this:
public interface ParentMXBean {
String getDescription();
Set<?> getSet();
}
This is not a valid MXBean interface because Set<?> is not an allowed type. Now suppose you make a subinterface like this:
public interface ChildMXBean extends ParentMXBean {
Set<String> getSet();
}
The problematic getSet() method from ParentMXBean has been covariantly overridden with an allowed type Set<String>. ChildMXBean is a valid MXBean interface. You can register it in an MBean Server, and you can make an MXBean Proxy for it.
But if you make such a ChildMXBean proxy and then call its getDescription() method, you get an exception, "NotCompliantMBeanException: ParentMXBean: Method ParentMXBean.getSet has parameter or return type that cannot be translated into an open type". The problem is that the proxy is seeing getDescription() as defined by ParentMXBean, which triggers an analysis of the ParentMXBean interface.
public interface ParentMXBean {
String getDescription();
Set<?> getSet();
}
This is not a valid MXBean interface because Set<?> is not an allowed type. Now suppose you make a subinterface like this:
public interface ChildMXBean extends ParentMXBean {
Set<String> getSet();
}
The problematic getSet() method from ParentMXBean has been covariantly overridden with an allowed type Set<String>. ChildMXBean is a valid MXBean interface. You can register it in an MBean Server, and you can make an MXBean Proxy for it.
But if you make such a ChildMXBean proxy and then call its getDescription() method, you get an exception, "NotCompliantMBeanException: ParentMXBean: Method ParentMXBean.getSet has parameter or return type that cannot be translated into an open type". The problem is that the proxy is seeing getDescription() as defined by ParentMXBean, which triggers an analysis of the ParentMXBean interface.