[jboss-dev-forums] [Design of JBossXB] - Re: annotations on properties declared in interfaces

alex.loubyansky@jboss.com do-not-reply at jboss.com
Fri Oct 26 10:46:04 EDT 2007


The following test which fails for me can be used to demonstrate the issue.

   public void testMain() throws Exception
  |    {
  |       Configuration configuration = new PropertyConfiguration();
  |       BeanInfo beanInfo = configuration.getBeanInfo(MyClass.class);
  |       PropertyInfo property = beanInfo.getProperty("property");
  |       assertEquals("java.lang.String", property.getType().getName());
  |    }
  |    
  |    public static interface MyInterface<T extends Object>
  |    {
  |       T getProperty();
  |       void setProperty(T value);
  |    }
  |    
  |    public static class MyClass implements MyInterface<String>
  |    {
  |       public String getProperty()
  |       {
  |          return null;
  |       }
  | 
  |       public void setProperty(String value)
  |       {
  |       }      
  |    }

The result is
junit.framework.ComparisonFailure: expected:<...String> but was:<...Object>

Is this expected? I suspect others may not necessarily get the same result on their machaines otherwise I wouldn't see new ejb tests added in the metadata project?

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

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



More information about the jboss-dev-forums mailing list