#76 destValue always null in CustomConverter

closed
None
5
2007-04-04
2007-03-13
No

In the MappingProcessor line 347 of method mapFromFieldMap():

Class sourceFieldClass = sourceFieldValue != null ? sourceFieldValue.getClass() : fieldMapping.getSourceFieldType(sourceObj.getClass());
destFieldValue = mapUsingCustomConverter(Class.forName(fieldMapping.getCustomConverter()), sourceFieldClass, sourceFieldValue,
destFieldType, null, fieldMapping, false);

null is passed to mapUsingCustomConverter() as value of destObj.
Because of this the custom converter always gets a null destination object.

This should be changed to destObj:

destFieldValue = mapUsingCustomConverter(Class.forName(fieldMapping.getCustomConverter()), sourceFieldClass, sourceFieldValue,
destFieldType, destObj, fieldMapping, false);

Apart from that: Congratulations for this great project.

regards,
Niklas

Discussion

  • Franz Garsombke

    Franz Garsombke - 2007-03-13
    • assigned_to: nobody --> fgarsombke
     
  • Franz Garsombke

    Franz Garsombke - 2007-03-13

    Logged In: YES
    user_id=550744
    Originator: NO

    Thanks. I will be sure to get this into the next release.

     
  • Matt Tierney

    Matt Tierney - 2007-04-01
    • status: open --> pending
     
  • Matt Tierney

    Matt Tierney - 2007-04-01

    Logged In: YES
    user_id=1236069
    Originator: NO

    I applied this to the 3.2 code base

     
  • Matt Tierney

    Matt Tierney - 2007-04-01
    • assigned_to: fgarsombke --> mhtierney
     
  • Matt Tierney

    Matt Tierney - 2007-04-04
    • status: pending --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks