[ROO-3696] @RooJavaBean annotation processing creates extraneous methods Created: 31/Jan/16  Updated: 01/Feb/16

Status: Open
Project: Spring Roo
Component/s: @ ROO SHELL
Affects Version/s: 1.3.2.RELEASE
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Chris Owens Assignee: Jose Manuel Vivó ( Chema ) - DISID.
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
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;
    }
    
}


Generated at Fri Nov 15 02:14:25 UTC 2019 using Jira 7.13.8#713008-sha1:1606a5c1e7006e1ab135aac81f7a9566b2dbc3a6.