diff --git a/processor/src/main/resources/org/mapstruct/ap/internal/model/NestedPropertyMappingMethod.ftl b/processor/src/main/resources/org/mapstruct/ap/internal/model/NestedPropertyMappingMethod.ftl index 917182f20..5921682eb 100644 --- a/processor/src/main/resources/org/mapstruct/ap/internal/model/NestedPropertyMappingMethod.ftl +++ b/processor/src/main/resources/org/mapstruct/ap/internal/model/NestedPropertyMappingMethod.ftl @@ -19,7 +19,6 @@ --> <#lt>private <@includeModel object=returnType/> ${name}(<#list parameters as param><@includeModel object=param/><#if param_has_next>, ) { - if ( ${sourceParameter.name} == null ) { return ${returnType.null}; } diff --git a/processor/src/test/resources/fixtures/org/mapstruct/ap/test/nestedsourceproperties/ArtistToChartEntryImpl.java b/processor/src/test/resources/fixtures/org/mapstruct/ap/test/nestedsourceproperties/ArtistToChartEntryImpl.java index 486fdd6fe..ca3a27297 100644 --- a/processor/src/test/resources/fixtures/org/mapstruct/ap/test/nestedsourceproperties/ArtistToChartEntryImpl.java +++ b/processor/src/test/resources/fixtures/org/mapstruct/ap/test/nestedsourceproperties/ArtistToChartEntryImpl.java @@ -105,7 +105,6 @@ public class ArtistToChartEntryImpl implements ArtistToChartEntry { } private String songArtistLabelStudioCity(Song song) { - if ( song == null ) { return null; } @@ -129,7 +128,6 @@ public class ArtistToChartEntryImpl implements ArtistToChartEntry { } private String songArtistLabelStudioName(Song song) { - if ( song == null ) { return null; } @@ -153,7 +151,6 @@ public class ArtistToChartEntryImpl implements ArtistToChartEntry { } private String songArtistName(Song song) { - if ( song == null ) { return null; } diff --git a/processor/src/test/resources/fixtures/org/mapstruct/ap/test/nestedtargetproperties/ChartEntryToArtistImpl.java b/processor/src/test/resources/fixtures/org/mapstruct/ap/test/nestedtargetproperties/ChartEntryToArtistImpl.java index 2e030f22b..181bb89be 100644 --- a/processor/src/test/resources/fixtures/org/mapstruct/ap/test/nestedtargetproperties/ChartEntryToArtistImpl.java +++ b/processor/src/test/resources/fixtures/org/mapstruct/ap/test/nestedtargetproperties/ChartEntryToArtistImpl.java @@ -229,7 +229,6 @@ public class ChartEntryToArtistImpl extends ChartEntryToArtist { } private String chartSongTitle(Chart chart) { - if ( chart == null ) { return null; } @@ -245,7 +244,6 @@ public class ChartEntryToArtistImpl extends ChartEntryToArtist { } private String chartSongArtistLabelStudioCity(Chart chart) { - if ( chart == null ) { return null; } @@ -273,7 +271,6 @@ public class ChartEntryToArtistImpl extends ChartEntryToArtist { } private String chartSongArtistLabelStudioName(Chart chart) { - if ( chart == null ) { return null; } @@ -301,7 +298,6 @@ public class ChartEntryToArtistImpl extends ChartEntryToArtist { } private String chartSongArtistName(Chart chart) { - if ( chart == null ) { return null; } @@ -321,7 +317,6 @@ public class ChartEntryToArtistImpl extends ChartEntryToArtist { } private List chartSongPositions(Chart chart) { - if ( chart == null ) { return null; } diff --git a/processor/src/test/resources/fixtures/org/mapstruct/ap/test/nestedtargetproperties/FishTankMapperImpl.java b/processor/src/test/resources/fixtures/org/mapstruct/ap/test/nestedtargetproperties/FishTankMapperImpl.java index 8632961c5..12e5062e9 100644 --- a/processor/src/test/resources/fixtures/org/mapstruct/ap/test/nestedtargetproperties/FishTankMapperImpl.java +++ b/processor/src/test/resources/fixtures/org/mapstruct/ap/test/nestedtargetproperties/FishTankMapperImpl.java @@ -48,7 +48,6 @@ public class FishTankMapperImpl implements FishTankMapper { } private String fishTankFishType(FishTank fishTank) { - if ( fishTank == null ) { return null; }