We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
When use a defaultValue with a long value, ex:
class MyObject { private Long myField; .... } class MyMapper { @Mapping(target="myField", source="myField", defaultValue="0L") abstract MyObject map(MyOtherObject obj); }
The generated code should not produce any compiler warnings.
class MyMapperImpl { abstract MyObject map(MyOtherObject obj) { ... if(obj.getMyField() != null) { myObject.setMyField( obj.getMyField() ); } else { obj.setMyField( (long) 0L ); // <--- This cast is unnecessary and produces a warning when compiling with -Xlint:all } } }
See expected behavior above.
1.5.5
Expected behavior
When use a defaultValue with a long value, ex:
The generated code should not produce any compiler warnings.
Actual behavior
Steps to reproduce the problem
See expected behavior above.
MapStruct Version
1.5.5