BeanTypeInfo  cannot process interface inheritance more than two level
----------------------------------------------------------------------

         Key: XFIRE-311
         URL: http://jira.codehaus.org/browse/XFIRE-311
     Project: XFire
        Type: Bug

  Components: Aegis Module  
    Versions: 1.0    
 Environment: JDK 1.4.2
    Reporter: Flier Lu
 Assigned to: Dan Diephouse 


BeanTypeInfo.getInterfacePropertyDescriptors() direct use Class.getInterfaces() 
to fetch inherited interface, but this method is not recursive, so if the 
interface inheritance more than two level, the grandfather interface will be 
ignore, we must process this in recursive, like this

    protected void getInterfaces(Set interfaces, Class clazz, boolean recursive)
    {     
      Class[] clazzInterfaces = clazz.getInterfaces();
      
      if (recursive)
      {
        for (int i=0; i<clazzInterfaces.length; i++)
        {
          getInterfaces(interfaces, clazzInterfaces[i], recursive);
        }
      }
      
      interfaces.addAll(Arrays.asList(clazzInterfaces));
    }
    
    protected Class[] getInterfaces(Class clazz, boolean recursive)
    {
      Set interfaces = new LinkedHashSet();
      
      getInterfaces(interfaces, clazz, recursive);
      
      return (Class[]) interfaces.toArray(new Class[interfaces.size()]);
    }

and change the Class.getInterfaces() to Class[] interfaces = 
getInterfaces(clazz, true);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to