Expected behavior
Given Foo1/Foo2 as simple beans
@Mapper
public interface FooMapper {
void updateFoo(Foo1 input, @MappingTarget Foo2 toUpdate);
}
properly generates to
@Override
public void updateFoo(Foo1 input, Foo2 toUpdate) {
if ( input == null ) {
return;
}
toUpdate.setBar( input.getBar() );
}
The expectation is to be able to add additional parameters (to be used in expressions) without SpotBugs/FindBugs reporting bugs in the generated code.
Actual behavior
@Mapper
public interface FooMapper {
void updateFoo(Foo1 input, @MappingTarget Foo2 toUpdate, boolean baz);
}
generates
@Override
public void updateFoo(Foo1 input, Foo2 toUpdate, boolean baz) {
if ( input == null ) {
return;
}
if ( input != null ) {
toUpdate.setBar( input.getBar() );
}
}
for which SpotBugs/FindBugs complains about Redundant null check RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE.
Steps to reproduce the problem
See above
MapStruct Version
1.5.3
Expected behavior
Given
Foo1/Foo2as simple beansproperly generates to
The expectation is to be able to add additional parameters (to be used in expressions) without SpotBugs/FindBugs reporting bugs in the generated code.
Actual behavior
generates
for which SpotBugs/FindBugs complains about Redundant null check
RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE.Steps to reproduce the problem
See above
MapStruct Version
1.5.3