diff --git a/core-common/src/main/java/org/mapstruct/NullValueCheckStrategy.java b/core-common/src/main/java/org/mapstruct/NullValueCheckStrategy.java
index c6294ffff..c6c0dbfd5 100644
--- a/core-common/src/main/java/org/mapstruct/NullValueCheckStrategy.java
+++ b/core-common/src/main/java/org/mapstruct/NullValueCheckStrategy.java
@@ -30,12 +30,13 @@ public enum NullValueCheckStrategy {
/**
* This option includes a null check. When:
- *
+ *
+ *
*
* - a source value is directly assigned to a target
* - a source value assigned to a target by calling a type conversion on the target first
*
- *
+ *
* NOTE: mapping methods (generated or hand written) are excluded from this null check. They are intended to
* handle a null source value as 'valid' input.
*
diff --git a/parent/pom.xml b/parent/pom.xml
index b8cd6ebca..531714a9f 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -534,6 +534,9 @@
.gitignore
.factorypath
.checkstyle
+ *.yml
+ **/*.asciidoc
+ **/binding.xjb
diff --git a/processor/src/main/java/org/mapstruct/ap/internal/conversion/BigDecimalToStringConversion.java b/processor/src/main/java/org/mapstruct/ap/internal/conversion/BigDecimalToStringConversion.java
index c3b7953b0..2e19ee8aa 100644
--- a/processor/src/main/java/org/mapstruct/ap/internal/conversion/BigDecimalToStringConversion.java
+++ b/processor/src/main/java/org/mapstruct/ap/internal/conversion/BigDecimalToStringConversion.java
@@ -74,7 +74,7 @@ public class BigDecimalToStringConversion extends AbstractNumberToStringConversi
@Override
public List getRequiredHelperMethods(ConversionContext conversionContext) {
- List helpers = new ArrayList();
+ List helpers = new ArrayList();
if ( conversionContext.getNumberFormat() != null ) {
helpers.add( new CreateDecimalFormat( conversionContext.getTypeFactory() ) );
}
diff --git a/processor/src/main/java/org/mapstruct/ap/internal/conversion/BigIntegerToStringConversion.java b/processor/src/main/java/org/mapstruct/ap/internal/conversion/BigIntegerToStringConversion.java
index e55bb3eee..6b99b0fd1 100644
--- a/processor/src/main/java/org/mapstruct/ap/internal/conversion/BigIntegerToStringConversion.java
+++ b/processor/src/main/java/org/mapstruct/ap/internal/conversion/BigIntegerToStringConversion.java
@@ -81,7 +81,7 @@ public class BigIntegerToStringConversion extends AbstractNumberToStringConversi
@Override
public List getRequiredHelperMethods(ConversionContext conversionContext) {
- List helpers = new ArrayList();
+ List helpers = new ArrayList();
if ( conversionContext.getNumberFormat() != null ) {
helpers.add( new CreateDecimalFormat( conversionContext.getTypeFactory() ) );
}
diff --git a/processor/src/main/java/org/mapstruct/ap/internal/model/IterableCreation.java b/processor/src/main/java/org/mapstruct/ap/internal/model/IterableCreation.java
index e54cd98b8..a1afac6f7 100644
--- a/processor/src/main/java/org/mapstruct/ap/internal/model/IterableCreation.java
+++ b/processor/src/main/java/org/mapstruct/ap/internal/model/IterableCreation.java
@@ -27,7 +27,7 @@ import org.mapstruct.ap.internal.model.common.Type;
/**
* Model element that can be used to create a type of {@link Iterable} or {@link java.util.Map}. If an implementation
- * type is used and the target type has a constructor with {@link int} as parameter and the source parameter is of
+ * type is used and the target type has a constructor with {@code int} as parameter and the source parameter is of
* {@link java.util.Collection}, {@link java.util.Map} or {@code Array} type then MapStruct will use that constructor
* with the {@code size} / {@code length} from the source parameter.
*
diff --git a/processor/src/main/java/org/mapstruct/ap/internal/model/common/ImplementationType.java b/processor/src/main/java/org/mapstruct/ap/internal/model/common/ImplementationType.java
index 8ddb2356b..15fb300b9 100644
--- a/processor/src/main/java/org/mapstruct/ap/internal/model/common/ImplementationType.java
+++ b/processor/src/main/java/org/mapstruct/ap/internal/model/common/ImplementationType.java
@@ -68,7 +68,7 @@ public class ImplementationType {
}
/**
- * @return {@code true} if the underlying type has a constructor for {@link int} {@code initialCapacity}, {@code
+ * @return {@code true} if the underlying type has a constructor for {@code int} {@code initialCapacity}, {@code
* false} otherwise
*/
public boolean hasInitialCapacityConstructor() {
diff --git a/processor/src/main/java/org/mapstruct/ap/internal/model/common/Type.java b/processor/src/main/java/org/mapstruct/ap/internal/model/common/Type.java
index cb089e6e7..a0dad2c0e 100644
--- a/processor/src/main/java/org/mapstruct/ap/internal/model/common/Type.java
+++ b/processor/src/main/java/org/mapstruct/ap/internal/model/common/Type.java
@@ -838,10 +838,10 @@ public class Type extends ModelElement implements Comparable {
/**
* Establishes the type bound:
*
- * - {@code extends Number>}, returns Number
- * - {@code super Number>}, returns Number
- * - {@code>}, returns Object
- * - {@code, returns Number}
+ * - {@code extends Number>}, returns Number
+ * - {@code super Number>}, returns Number
+ * - {@code >}, returns Object
+ * - {@code , returns Number}
*
* @return the bound for this parameter
*/
diff --git a/processor/src/main/java/org/mapstruct/ap/internal/model/common/TypeFactory.java b/processor/src/main/java/org/mapstruct/ap/internal/model/common/TypeFactory.java
index b8a40333d..a2dc7709f 100644
--- a/processor/src/main/java/org/mapstruct/ap/internal/model/common/TypeFactory.java
+++ b/processor/src/main/java/org/mapstruct/ap/internal/model/common/TypeFactory.java
@@ -521,10 +521,10 @@ public class TypeFactory {
/**
* Establishes the type bound:
*
- * - {@code extends Number>}, returns Number
- * - {@code super Number>}, returns Number
- * - {@code>}, returns Object
- * - {@code, returns Number}
+ * - {@code extends Number>}, returns Number
+ * - {@code super Number>}, returns Number
+ * - {@code >}, returns Object
+ * - {@code , returns Number}
*
*
* @param typeMirror the type to return the bound for
diff --git a/processor/src/main/java/org/mapstruct/ap/internal/model/source/SourceReference.java b/processor/src/main/java/org/mapstruct/ap/internal/model/source/SourceReference.java
index 582e0fed7..c8374db8a 100644
--- a/processor/src/main/java/org/mapstruct/ap/internal/model/source/SourceReference.java
+++ b/processor/src/main/java/org/mapstruct/ap/internal/model/source/SourceReference.java
@@ -20,6 +20,7 @@ package org.mapstruct.ap.internal.model.source;
import static org.mapstruct.ap.internal.model.source.PropertyEntry.forSourceReference;
import static org.mapstruct.ap.internal.util.Collections.first;
+import static org.mapstruct.ap.internal.util.Collections.last;
import java.util.ArrayList;
import java.util.Arrays;
@@ -165,28 +166,23 @@ public class SourceReference {
);
}
else {
- int notFoundPropertyIndex;
- Type sourceType;
- if ( entries.isEmpty() ) {
- notFoundPropertyIndex = 0;
- sourceType = method.getParameters().get( 0 ).getType();
- }
- else {
- int lastFoundEntryIndex = entries.size() - 1;
- notFoundPropertyIndex = lastFoundEntryIndex + 1;
- sourceType = entries.get( lastFoundEntryIndex ).getType();
+ int notFoundPropertyIndex = 0;
+ Type sourceType = method.getParameters().get( 0 ).getType();
+ if ( !entries.isEmpty() ) {
+ notFoundPropertyIndex = entries.size();
+ sourceType = last( entries ).getType();
}
String mostSimilarWord = Strings.getMostSimilarWord(
sourcePropertyNames[notFoundPropertyIndex],
sourceType.getPropertyReadAccessors().keySet()
);
- String prefix = "";
- for ( int i = 0; i < notFoundPropertyIndex; i++ ) {
- prefix += sourcePropertyNames[i] + ".";
- }
+ List elements = new ArrayList(
+ Arrays.asList( sourcePropertyNames ).subList( 0, notFoundPropertyIndex )
+ );
+ elements.add( mostSimilarWord );
reportMappingError(
Message.PROPERTYMAPPING_INVALID_PROPERTY_NAME, mapping.getSourceName(),
- prefix + mostSimilarWord
+ Strings.join( elements, "." )
);
}
isValid = false;
diff --git a/processor/src/main/java/org/mapstruct/ap/internal/model/source/TargetReference.java b/processor/src/main/java/org/mapstruct/ap/internal/model/source/TargetReference.java
index e04bae36c..5e17c7cd1 100644
--- a/processor/src/main/java/org/mapstruct/ap/internal/model/source/TargetReference.java
+++ b/processor/src/main/java/org/mapstruct/ap/internal/model/source/TargetReference.java
@@ -411,12 +411,10 @@ public class TargetReference {
readAccessors
);
- String prefix = "";
- for ( int i = 0; i < index; i++ ) {
- prefix += entryNames[i] + ".";
- }
+ List elements = new ArrayList( Arrays.asList( entryNames ).subList( 0, index ) );
+ elements.add( mostSimilarProperty );
- printErrorMessage( Message.BEANMAPPING_UNKNOWN_PROPERTY_IN_RESULTTYPE, prefix + mostSimilarProperty );
+ printErrorMessage( Message.BEANMAPPING_UNKNOWN_PROPERTY_IN_RESULTTYPE, Strings.join( elements, "." ) );
}
}
diff --git a/processor/src/test/java/org/mapstruct/ap/test/collection/wildcard/BeanMapper.java b/processor/src/test/java/org/mapstruct/ap/test/collection/wildcard/BeanMapper.java
index 1f94bab64..d759020eb 100644
--- a/processor/src/test/java/org/mapstruct/ap/test/collection/wildcard/BeanMapper.java
+++ b/processor/src/test/java/org/mapstruct/ap/test/collection/wildcard/BeanMapper.java
@@ -42,7 +42,7 @@ public abstract class BeanMapper {
}
JAXBElement super BigDecimal> map(BigDecimal value) {
- return new JAXBElement( new QName( "test" ), BigDecimal.class, value );
+ return new JAXBElement( new QName( "test" ), BigDecimal.class, value );
}
}
diff --git a/processor/src/test/java/org/mapstruct/ap/test/collection/wildcard/WildCardTest.java b/processor/src/test/java/org/mapstruct/ap/test/collection/wildcard/WildCardTest.java
index e35bcc668..cf6758ece 100644
--- a/processor/src/test/java/org/mapstruct/ap/test/collection/wildcard/WildCardTest.java
+++ b/processor/src/test/java/org/mapstruct/ap/test/collection/wildcard/WildCardTest.java
@@ -153,7 +153,7 @@ public class WildCardTest {
public void shouldMapBean() {
GoodIdea aGoodIdea = new GoodIdea();
- aGoodIdea.setContent( new JAXBElement( new QName( "test" ), BigDecimal.class, BigDecimal.ONE ) );
+ aGoodIdea.setContent( new JAXBElement( new QName( "test" ), BigDecimal.class, BigDecimal.ONE ) );
aGoodIdea.setDescription( BigDecimal.ZERO );
CunningPlan aCunningPlan = BeanMapper.STM.transformA( aGoodIdea );