Hi,

I was working on a Guvnor related JIRA, https://issues.jboss.org/browse/GUVNOR-1573, and found that the above does not work well for "delegated properties".

Consider the following:-

public class MotherClass {
   
    private Status status;

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

}

public class DelegationClass {

    private MotherClass delegated;

    public Status getStatus() {
        return delegated.getStatus();
    }

    public void setStatus(Status status) {
        delegated.setStatus( status );
    }

}

Method "storeGetterSetter" attempts to align a method getter\setter with a Field.

When the class being inspected is a regular class (or subclass) getters\setters normally relate to a member Field, however in the case of a delegated property (DelegationClass.getStatus, in the example) no field obviously exists and hence the stored Field is null. I've worked around this in Guvnor by using the method's return type when the ClassFieldInspector.getFieldTypesField() returns null however this should, IMO, ideally be moved to ClassFieldInspector. I haven't been so bold as to change ClassFieldInspector as it means moving from storing "Fields" in the "fieldTypesField" Map to something more generic (that can handle Method return types too) that'll probably impact alot elsewhere.

Is this a known limitation, with perhaps an existing JIRA, or shall I raise a new one?

Thanks,

Mike