#1897 Remove unused methods from class SourceMethod (#1898)

This commit is contained in:
Andrei Arlou 2019-09-14 03:43:27 +03:00 committed by GitHub
parent 7af107c9f2
commit 3868735da7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,6 @@ import javax.lang.model.element.Modifier;
import javax.lang.model.util.Types; import javax.lang.model.util.Types;
import org.mapstruct.ap.internal.model.common.Accessibility; import org.mapstruct.ap.internal.model.common.Accessibility;
import org.mapstruct.ap.internal.model.common.BuilderType;
import org.mapstruct.ap.internal.model.common.Parameter; import org.mapstruct.ap.internal.model.common.Parameter;
import org.mapstruct.ap.internal.model.common.Type; import org.mapstruct.ap.internal.model.common.Type;
import org.mapstruct.ap.internal.model.common.TypeFactory; import org.mapstruct.ap.internal.model.common.TypeFactory;
@ -77,7 +76,6 @@ public class SourceMethod implements Method {
private ExecutableElement executable; private ExecutableElement executable;
private List<Parameter> parameters; private List<Parameter> parameters;
private Type returnType = null; private Type returnType = null;
private BuilderType builderType = null;
private List<Type> exceptionTypes; private List<Type> exceptionTypes;
private Set<Mapping> mappings; private Set<Mapping> mappings;
private IterableMapping iterableMapping = null; private IterableMapping iterableMapping = null;
@ -290,12 +288,6 @@ public class SourceMethod implements Method {
&& getResultType().isAssignableTo( first( method.getSourceParameters() ).getType() ); && getResultType().isAssignableTo( first( method.getSourceParameters() ).getType() );
} }
public boolean isSame(SourceMethod method) {
return getSourceParameters().size() == 1 && method.getSourceParameters().size() == 1
&& equals( first( getSourceParameters() ).getType(), first( method.getSourceParameters() ).getType() )
&& equals( getResultType(), method.getResultType() );
}
public boolean canInheritFrom(SourceMethod method) { public boolean canInheritFrom(SourceMethod method) {
return method.getDeclaringMapper() == null return method.getDeclaringMapper() == null
&& method.isAbstract() && method.isAbstract()
@ -373,10 +365,6 @@ public class SourceMethod implements Method {
return isValueMapping; return isValueMapping;
} }
private boolean equals(Object o1, Object o2) {
return (o1 == null && o2 == null) || (o1 != null) && o1.equals( o2 );
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder( returnType.toString() ); StringBuilder sb = new StringBuilder( returnType.toString() );