Menu

#333 BeanUtils.getParametersAsString() cannot handle _list types

2.3 (pre-release)
closed
7
2010-07-10
2010-06-25
jborleffs
No

BeanUtils.getParametersAsString() uses a basic conversion method, which is fine for basic types, but not for complex types like _list. When an instance of List.Value is passed, conversion leads to a result like "org.xins.common.types.standard.List$Value@aef".

To overcome this, I have changed the implementation as follows:

String stringValue = null;
if (paramValue instanceof List.Value) {
stringValue = List.toString((List.Value) paramValue);
stringValue = stringValue.replaceAll("&", "%26");
} else {
stringValue = String.valueOf(paramValue);
}

Discussion

  • jborleffs

    jborleffs - 2010-06-28

    The real problem is that List.Value doesn't override Object.toString(). I have attached a patched version of the List class that you might want to consider. The BeanUtils.getParametersAsString() can be left as is when using this patch.

     
  • Anthony Goubard

    Anthony Goubard - 2010-06-30
    • assigned_to: nobody --> agoubard
     
  • Anthony Goubard

    Anthony Goubard - 2010-06-30
    • assigned_to: agoubard --> nobody
     
  • Anthony Goubard

    Anthony Goubard - 2010-06-30

    I have done a diff between the submitted file and the current file but didn't found any difference.

     
  • jborleffs

    jborleffs - 2010-06-30

    Correct file

     
  • jborleffs

    jborleffs - 2010-06-30

    Sorry, attached the wrong file. Uploaded the correct class file (org.xins.common.types.standard.List) that is used for the _list type.

     
  • jborleffs

    jborleffs - 2010-07-01
    • priority: 5 --> 3
     
  • jborleffs

    jborleffs - 2010-07-01
    • priority: 3 --> 7
     
  • Anthony Goubard

    Anthony Goubard - 2010-07-10
    • assigned_to: nobody --> agoubard
     
  • Anthony Goubard

    Anthony Goubard - 2010-07-10

    Fixed, will be in 2.3 final.

     
  • Anthony Goubard

    Anthony Goubard - 2010-07-10
    • status: open --> closed
     

Log in to post a comment.