[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2858) NumberWrapper does not manage correctly Long or Short types

Christophe Vigouroux (JIRA) jira-events at lists.jboss.org
Mon Apr 7 11:44:21 EDT 2008


NumberWrapper does not manage correctly Long or Short types
-----------------------------------------------------------

                 Key: JBSEAM-2858
                 URL: http://jira.jboss.com/jira/browse/JBSEAM-2858
             Project: JBoss Seam
          Issue Type: Bug
          Components: Remoting
    Affects Versions: 2.0.1.GA
            Reporter: Christophe Vigouroux
         Assigned To: Shane Bryzak


The org.jboss.seam.remoting.wrapper.BeanWrapper in conjunction with org.jboss.seam.remoting.wrapper.NumberWrapper does not use setter method to set Long or Short values of a bean.

I have coded a simple bean like this one :

@Name(mySimpleBean)
public class SimpleBean
{
  private Long id;

  public Long getId();

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

I try to call a seam WebMethod that accepts "SimpleBean" as the parameter. In the xml data sent by the browser I have a well formed <number>123456</number> (for example) but when BeanWrapper tries to unmarshall the number, it doesn't find any suitable method with the NumberWrapper.conversionScore method. Indeed this method should have return "exact" only if the parameter type of my bean setId() was Integer. But I wanted it to be Long, so I've got a "nomatch" score...

Then BeanWrapper tries to find a direct field access, and it finds a suitable field in the javassist proxy class instead of my SimpleBean (didn't dig in it, but surely because it is the first class declaring the field in the type hierarchy) and set its value. But when I call the getId() method, it of course returns the unset id of the SimpleBean instance, not the one of the proxy class.

This problem is quite blocking for me because I really need my field to be a Long. I've put a dirty fix for now by declaring my field Integer. With this, I get the correct value when calling SimpleBean.getId().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list