Stripes

ResolverUtil does not find writeMethodName if getter and setter are declared in different classes

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Cannot Reproduce
  • Affects Version/s: Release 1.5.3
  • Fix Version/s: None
  • Component/s: ActionBean Dispatching
  • Labels:
    None

Description

Scenario:
We have the following classes:
public interface IFace {
public abstract Long getId();
}

public abstract class A implements IFace{
public abstract void setId(Long id);
}

public class MyImpl extends A {
private Long id;

public Long getId() { return id; }

public void setId(Long id) { this.id = id; }
}

Problem:
If I use the class MyImpl in an action bean, no passed property "id" can be set. With debug level activated, I can see something like this:

      • net.sourceforge.stripes.util.bean.EvaluationException: Could not write read-only property 'id' on bean of type testing.MyImpl ***

If I also add an additional line "public abstract Long getId();" to the class A, the property binding works fine. This is quite unexpected, at least for me. Additionally, no visible exception / warning seems to be shown on logging level warn or higher.

Activity

Hide
Ben Gunter added a comment - 19/May/10 8:17 AM

I just set up exactly the same scenario, tested against the current 1.5.x branch, and it worked fine. I'm running Sun JVM 1.6.0_20. What JVM are you using? We've had to contend with some JVM bugs like this in the past.

Show
Ben Gunter added a comment - 19/May/10 8:17 AM I just set up exactly the same scenario, tested against the current 1.5.x branch, and it worked fine. I'm running Sun JVM 1.6.0_20. What JVM are you using? We've had to contend with some JVM bugs like this in the past.
Hide
Marcus Kraßmann added a comment - 24/Sep/10 12:48 PM

Probably you fixed that with STS-759. After reviewing my scenario, I saw that the original getter returns <T extends Serializable>, where T is set by concrete subclasses.
Thanks for your effort

Show
Marcus Kraßmann added a comment - 24/Sep/10 12:48 PM Probably you fixed that with STS-759. After reviewing my scenario, I saw that the original getter returns <T extends Serializable>, where T is set by concrete subclasses. Thanks for your effort

People

Vote (0)
Watch (1)

Dates

  • Created:
    12/Apr/10 8:05 AM
    Updated:
    04/Jan/11 1:29 PM
    Resolved:
    24/Sep/10 12:24 PM