[jboss-dev-forums] [Design the new POJO MicroContainer] - Fixing support for covariant return types.

adrian@jboss.org do-not-reply at jboss.com
Tue Feb 6 11:49:52 EST 2007


Java5 introduced covariant return types but we weren't supporting this properly
because MethodInfoImpl was taking into account the return type (and declaring class)
when doing the equals check.

I removed these two checks from the equals.

Covariant return types are where you override the method to return a different type.
e.g.


  | public class Something
  | {
  |    public Object getSomething() {} ;
  | }
  | 
  | public class StringSomething
  | {
  |    // StringSomethings return a String not an Object
  |    @Override
  |    public String getSomething() {} ;
  | }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012025#4012025

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012025



More information about the jboss-dev-forums mailing list