#1088 Refactor constructor ForgedMethod (#1888)

This commit is contained in:
Andrei Arlou 2019-09-14 03:03:13 +03:00 committed by GitHub
parent e068564017
commit f95648cef8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Objects;
import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.ExecutableElement;
import org.mapstruct.ap.internal.model.common.Accessibility; import org.mapstruct.ap.internal.model.common.Accessibility;
@ -57,7 +58,7 @@ public class ForgedMethod implements Method {
name, name,
sourceType, sourceType,
returnType, returnType,
Collections.<Parameter>emptyList(), Collections.emptyList(),
basedOn, basedOn,
null, null,
MappingReferences.empty(), MappingReferences.empty(),
@ -361,10 +362,10 @@ public class ForgedMethod implements Method {
ForgedMethod that = (ForgedMethod) o; ForgedMethod that = (ForgedMethod) o;
if ( parameters != null ? !parameters.equals( that.parameters ) : that.parameters != null ) { if ( !Objects.equals( parameters, that.parameters ) ) {
return false; return false;
} }
return returnType != null ? returnType.equals( that.returnType ) : that.returnType == null; return Objects.equals( returnType, that.returnType );
} }