diff --git a/processor/src/main/java/org/mapstruct/ap/model/MappingMethod.java b/processor/src/main/java/org/mapstruct/ap/model/MappingMethod.java index 5acad89d9..14e217d4b 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/MappingMethod.java +++ b/processor/src/main/java/org/mapstruct/ap/model/MappingMethod.java @@ -27,7 +27,7 @@ import org.mapstruct.ap.model.common.Accessibility; import org.mapstruct.ap.model.common.ModelElement; import org.mapstruct.ap.model.common.Parameter; import org.mapstruct.ap.model.common.Type; -import org.mapstruct.ap.model.source.BasicMethod; +import org.mapstruct.ap.model.source.Method; import org.mapstruct.ap.util.Strings; /** @@ -43,7 +43,7 @@ public abstract class MappingMethod extends ModelElement { private final Parameter targetParameter; private final Accessibility accessibility; - protected MappingMethod(BasicMethod method) { + protected MappingMethod(Method method) { this.name = method.getName(); this.parameters = method.getParameters(); this.returnType = method.getReturnType(); diff --git a/processor/src/main/java/org/mapstruct/ap/model/source/BuiltInMethod.java b/processor/src/main/java/org/mapstruct/ap/model/source/BuiltInMethod.java index 3d05c84a5..18c7ec2b1 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/source/BuiltInMethod.java +++ b/processor/src/main/java/org/mapstruct/ap/model/source/BuiltInMethod.java @@ -38,7 +38,7 @@ import org.mapstruct.ap.util.Strings; * * @author Sjaak Derksen */ -public abstract class BuiltInMethod extends ModelElement implements BasicMethod { +public abstract class BuiltInMethod extends ModelElement implements Method { /** @@ -64,7 +64,7 @@ public abstract class BuiltInMethod extends ModelElement implements BasicMethod } /** - * {@inheritDoc} {@link BasicMethod} + * {@inheritDoc} {@link Method} * * Default the targetType should be assignable to the returnType and the sourceType to the parameter, * excluding generic type variables. When the implementor sees a need for this, this method can be overridden. @@ -79,7 +79,7 @@ public abstract class BuiltInMethod extends ModelElement implements BasicMethod } /** - * {@inheritDoc} {@link BasicMethod} + * {@inheritDoc} {@link Method} * * @return all parameters are source parameters for build-in methods. */ @@ -89,7 +89,7 @@ public abstract class BuiltInMethod extends ModelElement implements BasicMethod } /** - * {@inheritDoc} {@link BasicMethod} + * {@inheritDoc} {@link Method} * * declaring mapper is always null, being the MapperImpl itself. This method should not be overridden by * implementors @@ -101,7 +101,7 @@ public abstract class BuiltInMethod extends ModelElement implements BasicMethod } /** - * {@inheritDoc} {@link BasicMethod} + * {@inheritDoc} {@link Method} */ @Override public List getParameters() { diff --git a/processor/src/main/java/org/mapstruct/ap/model/source/BasicMethod.java b/processor/src/main/java/org/mapstruct/ap/model/source/Method.java similarity index 98% rename from processor/src/main/java/org/mapstruct/ap/model/source/BasicMethod.java rename to processor/src/main/java/org/mapstruct/ap/model/source/Method.java index fbbf4312c..7c5bc69b3 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/source/BasicMethod.java +++ b/processor/src/main/java/org/mapstruct/ap/model/source/Method.java @@ -31,7 +31,7 @@ import org.mapstruct.ap.model.common.Type; * There are 2 known implementors: {@link BuiltInMethod} and {@link Method} * @author Sjaak Derksen */ -public interface BasicMethod { +public interface Method { /** * Checks whether the provided sourceType and provided targetType match with the parameter respectively diff --git a/processor/src/main/java/org/mapstruct/ap/model/source/SourceMethod.java b/processor/src/main/java/org/mapstruct/ap/model/source/SourceMethod.java index 1a29ef602..34276f0fe 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/source/SourceMethod.java +++ b/processor/src/main/java/org/mapstruct/ap/model/source/SourceMethod.java @@ -42,7 +42,7 @@ import org.mapstruct.ap.util.Strings; * * @author Gunnar Morling */ -public class SourceMethod implements BasicMethod { +public class SourceMethod implements Method { private final Type declaringMapper; private final ExecutableElement executable; @@ -143,7 +143,7 @@ public class SourceMethod implements BasicMethod { } /** - * {@inheritDoc} {@link BasicMethod} + * {@inheritDoc} {@link Method} */ @Override public Type getDeclaringMapper() { @@ -155,7 +155,7 @@ public class SourceMethod implements BasicMethod { } /** - * {@inheritDoc} {@link BasicMethod} + * {@inheritDoc} {@link Method} */ @Override public String getName() { @@ -163,7 +163,7 @@ public class SourceMethod implements BasicMethod { } /** - * {@inheritDoc} {@link BasicMethod} + * {@inheritDoc} {@link Method} */ @Override public List getParameters() { @@ -171,7 +171,7 @@ public class SourceMethod implements BasicMethod { } /** - * {@inheritDoc} {@link BasicMethod} + * {@inheritDoc} {@link Method} */ @Override public List getSourceParameters() { @@ -201,7 +201,7 @@ public class SourceMethod implements BasicMethod { } /** - * {@inheritDoc} {@link BasicMethod} + * {@inheritDoc} {@link Method} */ @Override public Type getReturnType() { @@ -247,7 +247,7 @@ public class SourceMethod implements BasicMethod { } /** - * {@inheritDoc} {@link BasicMethod} + * {@inheritDoc} {@link Method} */ @Override public Parameter getTargetParameter() { @@ -322,7 +322,7 @@ public class SourceMethod implements BasicMethod { } /** - * {@inheritDoc} {@link BasicMethod} + * {@inheritDoc} {@link Method} */ @Override public boolean matches( Type sourceType, Type targetType ) { diff --git a/processor/src/main/java/org/mapstruct/ap/processor/MapperCreationProcessor.java b/processor/src/main/java/org/mapstruct/ap/processor/MapperCreationProcessor.java index 1ae05aca3..b7fe29276 100644 --- a/processor/src/main/java/org/mapstruct/ap/processor/MapperCreationProcessor.java +++ b/processor/src/main/java/org/mapstruct/ap/processor/MapperCreationProcessor.java @@ -56,7 +56,7 @@ import org.mapstruct.ap.model.TypeConversion; import org.mapstruct.ap.model.common.Parameter; import org.mapstruct.ap.model.common.Type; import org.mapstruct.ap.model.common.TypeFactory; -import org.mapstruct.ap.model.source.BasicMethod; +import org.mapstruct.ap.model.source.Method; import org.mapstruct.ap.model.source.Mapping; import org.mapstruct.ap.model.source.SourceMethod; import org.mapstruct.ap.option.Options; @@ -760,7 +760,7 @@ public class MapperCreationProcessor implements ModelElementProcessor T getBestMatch(SourceMethod mappingMethod, String mappedElement, + private T getBestMatch(SourceMethod mappingMethod, String mappedElement, Iterable methods, Type parameterType, Type returnType) { List candidatesWithMathingTargetType = new ArrayList(); @@ -814,7 +814,7 @@ public class MapperCreationProcessor implements ModelElementProcessor int addToCandidateListIfMinimal(List candidatesWithBestMathingType, + private int addToCandidateListIfMinimal(List candidatesWithBestMathingType, int bestMatchingTypeDistance, T method, int currentTypeDistance) { if ( currentTypeDistance == bestMatchingTypeDistance ) { candidatesWithBestMathingType.add( method );