diff --git a/processor/src/main/java/org/mapstruct/ap/internal/model/ForgedMethod.java b/processor/src/main/java/org/mapstruct/ap/internal/model/ForgedMethod.java index 2f73c4b9f..b385c127b 100644 --- a/processor/src/main/java/org/mapstruct/ap/internal/model/ForgedMethod.java +++ b/processor/src/main/java/org/mapstruct/ap/internal/model/ForgedMethod.java @@ -9,6 +9,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; +import java.util.Objects; import javax.lang.model.element.ExecutableElement; import org.mapstruct.ap.internal.model.common.Accessibility; @@ -57,7 +58,7 @@ public class ForgedMethod implements Method { name, sourceType, returnType, - Collections.emptyList(), + Collections.emptyList(), basedOn, null, MappingReferences.empty(), @@ -361,10 +362,10 @@ public class ForgedMethod implements Method { ForgedMethod that = (ForgedMethod) o; - if ( parameters != null ? !parameters.equals( that.parameters ) : that.parameters != null ) { + if ( !Objects.equals( parameters, that.parameters ) ) { return false; } - return returnType != null ? returnType.equals( that.returnType ) : that.returnType == null; + return Objects.equals( returnType, that.returnType ); }