2 Replies Latest reply on Mar 17, 2008 9:01 AM by Ales Justin

    KernelScopeInfo and property annotations

    Ales Justin Master

      With this addition to field injection (http://www.jboss.org/index.html?module=bb&op=viewtopic&t=131615), KernelScopeInfo needs changing of the way we add instance annotations.

       Set<PropertyInfo> propertyInfos = beanInfo.getProperties();
       if (propertyInfos != null && propertyInfos.size() > 0)
       {
       for (PropertyInfo propertyInfo : propertyInfos)
       {
       if (propertyInfo.getName().equals(propertyMetaData.getName()))
       {
       MethodInfo methodInfo = propertyInfo.getGetter();
       if (methodInfo != null)
       addAnnotations(classloader, mutable, methodInfo, propertyAnnotations);
       methodInfo = propertyInfo.getSetter();
       if (methodInfo != null)
       addAnnotations(classloader, mutable, methodInfo, propertyAnnotations);
       }
       }
       }
      

      We can add getGetterSignature and getSetterSignature on the PropertyInfo. Where in the case of FieldPI we would return FieldSignature for getSetterSignature and null for getGetterSignature.
      But that would mean introducing cyclic dependency on MDR project. :-(

      And the property lookup code should be changed to use BeanInfo.getProperty(name), unless we want to add annotations to all equally named propertys.