publicissapient-france/selma

Mapping primitive with withIgnoreNullValue = true does not compile

Closed this issue · 2 comments

When input object have primitive attribute (long for example) and the mapper interface use the "withIgnoreNullValue = true" parameter, the generated code fail to compile. It generates the following code :

if (inObject.getId() != null) {
  out.setId(inObject.getId() + "");
}

And corresponding error message, which is right :
Error:(XX, XX) java: incomparable types: long and <nulltype>

Removing the null check for primitives looks like an obvious fix. Hope it's easy to do.

Can you give it a test in snapshot builds ?

Hi, sorry for the delay !
I just checked it with last 1.1-SNAPSHOT and it works as expected.
Keep up the good work.