diff --git a/processor/src/main/java/org/mapstruct/ap/model/common/Type.java b/processor/src/main/java/org/mapstruct/ap/model/common/Type.java index ae15f741f..b683a26b8 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/common/Type.java +++ b/processor/src/main/java/org/mapstruct/ap/model/common/Type.java @@ -34,6 +34,7 @@ import javax.lang.model.element.TypeElement; import javax.lang.model.type.TypeMirror; import javax.lang.model.util.Elements; import javax.lang.model.util.Types; + import org.mapstruct.ap.util.Executables; import org.mapstruct.ap.util.Filters; import org.mapstruct.ap.util.TypeUtilsJDK6Fix; @@ -76,13 +77,10 @@ public class Type extends ModelElement implements Comparable { private List alternativeTargetAccessors = null; //CHECKSTYLE:OFF - public Type(Types typeUtils, Elements elementUtils, - TypeMirror typeMirror, TypeElement typeElement, List typeParameters, - Type implementationType, - String packageName, String name, String qualifiedName, - boolean isInterface, - boolean isEnumType, boolean isIterableType, boolean isCollectionType, boolean isMapType, - boolean isImported) { + public Type(Types typeUtils, Elements elementUtils, TypeMirror typeMirror, TypeElement typeElement, + List typeParameters, Type implementationType, String packageName, String name, + String qualifiedName, boolean isInterface, boolean isEnumType, boolean isIterableType, + boolean isCollectionType, boolean isMapType, boolean isImported) { this.typeUtils = typeUtils; this.elementUtils = elementUtils; @@ -265,7 +263,7 @@ public class Type extends ModelElement implements Comparable { * @return an unmodifiable list of all getters (including 'is' for booleans). */ public List getGetters() { - if (getters == null) { + if ( getters == null ) { List members = elementUtils.getAllMembers( typeElement ); getters = Collections.unmodifiableList( Filters.getterMethodsIn( members ) ); } @@ -278,7 +276,7 @@ public class Type extends ModelElement implements Comparable { * @return an unmodifiable list of all setters */ public List getSetters() { - if (setters == null) { + if ( setters == null ) { List members = elementUtils.getAllMembers( typeElement ); setters = Collections.unmodifiableList( Filters.setterMethodsIn( members ) ); } @@ -325,13 +323,12 @@ public class Type extends ModelElement implements Comparable { return alternativeTargetAccessors; } - private boolean isCollection( TypeMirror candidate ) { + private boolean isCollection(TypeMirror candidate) { String collectionName = Collection.class.getCanonicalName(); TypeMirror collectionType = typeUtils.erasure( elementUtils.getTypeElement( collectionName ).asType() ); return TypeUtilsJDK6Fix.isSubType( typeUtils, candidate, collectionType ); } - /** * Returns the length of the shortest path in the type hierarchy between this type and the specified other type. * Returns {@code -1} if this type is not assignable to the other type. Returns {@code 0} if this type is equal to diff --git a/processor/src/main/java/org/mapstruct/ap/model/common/TypeFactory.java b/processor/src/main/java/org/mapstruct/ap/model/common/TypeFactory.java index 3f024c15b..8e18c801e 100644 --- a/processor/src/main/java/org/mapstruct/ap/model/common/TypeFactory.java +++ b/processor/src/main/java/org/mapstruct/ap/model/common/TypeFactory.java @@ -35,7 +35,6 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentNavigableMap; import java.util.concurrent.ConcurrentSkipListMap; - import javax.lang.model.element.ElementKind; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.TypeElement; @@ -188,6 +187,7 @@ public class TypeFactory { * If type represents {@code int}, it will return the type that represents {@code Class}. * * @param type the type to return the declared class type for + * * @return the type representing {@code Class}. */ public Type classTypeOf(Type type) { 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 cc99ca682..cf9090229 100644 --- a/processor/src/main/java/org/mapstruct/ap/processor/MapperCreationProcessor.java +++ b/processor/src/main/java/org/mapstruct/ap/processor/MapperCreationProcessor.java @@ -193,7 +193,7 @@ public class MapperCreationProcessor implements ModelElementProcessor