Stripes

Setter methods fail when a bean overrides a method with a subclass

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: Release 1.5.3
  • Fix Version/s: Release 1.5.4, Release 1.6
  • Component/s: Validation
  • Labels:
    None
  • Environment:
    All OS, Java 6

Description

A property cannot be set on a bean when that bean extends (or implements) an abstract class (or interface) that defines the getter to return a super class of the one defined by the concrete class.

This is related to validation bugs that I've seen before, as well as the following sun bug.

http://bugs.sun.com/view_bug.do?bug_id=6794807

For example

abstract class Test { public abstract Object getId(); }

public class TestImpl extends Test {

private String id;

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

@Override
public String getId() {return id;}

}

In this case, stripes cannot set the ID because Introspector finds no setter that takes an Object argument.

Activity

Hide
Scott Archer added a comment - 24/Sep/10 11:03 AM

I'm attaching a patch that I believe will resolve this bug.

Show
Scott Archer added a comment - 24/Sep/10 11:03 AM I'm attaching a patch that I believe will resolve this bug.
Hide
Scott Archer added a comment - 24/Sep/10 11:03 AM

Patch to possibly fix this bug.

Show
Scott Archer added a comment - 24/Sep/10 11:03 AM Patch to possibly fix this bug.
Hide
Scott Archer added a comment - 24/Sep/10 11:40 AM

My patch is flawed. Still working on it.

Show
Scott Archer added a comment - 24/Sep/10 11:40 AM My patch is flawed. Still working on it.
Hide
Ben Gunter added a comment - 24/Sep/10 12:05 PM

Fixed for 1.5.4.

Show
Ben Gunter added a comment - 24/Sep/10 12:05 PM Fixed for 1.5.4.

People

Vote (1)
Watch (1)

Dates

  • Created:
    17/Aug/10 4:18 PM
    Updated:
    04/Jan/11 1:28 PM
    Resolved:
    24/Sep/10 12:05 PM