Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-3696

@RooJavaBean annotation processing creates extraneous methods

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3.2.RELEASE
    • Fix Version/s: None
    • Component/s: @ ROO SHELL
    • Labels:
      None
    • Environment:
      CentOS 6.5

      Description

      If an abstract class implementing an interface is annotated with @RooJavaBean, the generated ITD will contain methods from the interface. This is outside the interface contract, which is that @RooJavaBean is supposed to create accessors and setters for private objects.

      This is particularly problematic if methods in the interface have generic parameters; under this case the created ITD contains errors.

      file iface1.java:

      package test;
      
      public interface Iface1 <T extends Object> {
      	public T doSomething();
      }
      

      file AbstractClass.java

      package test;
      
      import org.springframework.roo.addon.javabean.RooJavaBean;
      
      @RooJavaBean
      public abstract class AbstractClass implements Iface1<String>{
      	private int fooInt = 0;
      	
      }
      

      And the (erroneous) generated ITD AbstractClass_Roo_JavaBean.aj:

      // WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO.
      // You may push code into the target .java compilation unit if you wish to edit any member(s).
      
      package test;
      
      import test.AbstractClass;
      
      privileged aspect AbstractClass_Roo_JavaBean {
          
          public int AbstractClass.getFooInt() {
              return this.fooInt;
          }
          
          public void AbstractClass.setFooInt(int fooInt) {
              this.fooInt = fooInt;
          }
          
       public T AbstractClass.doSomething() {
              return null;
          }
          
      }
      
      

        Attachments

          Activity

            People

            • Assignee:
              jmvivo Jose Manuel Vivó ( Chema ) - DISID.
              Reporter:
              chrisowens Chris Owens
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: