#2016 Update Checkstyle to 8.29

Adapt checkstyle configuration with new changes:
* Move cacheFile to Checker module
* Move LineLength to Checker module
* Use SuppressWithPlainTextCommentFilter
This commit is contained in:
Filip Hrisafov 2020-02-02 00:48:45 +01:00
parent 58da2d293f
commit 95ceba1a1e
43 changed files with 14 additions and 52 deletions

1
.gitignore vendored
View File

@ -23,3 +23,4 @@ test-output
# Misc. # Misc.
.DS_Store .DS_Store
checkstyle.cache

View File

@ -15,6 +15,8 @@
<property name="basedir" value="${basedir}"/> <property name="basedir" value="${basedir}"/>
--> -->
<property name="cacheFile" value="${checkstyle.cache.file}"/>
<!-- Checks that each Java package has a Javadoc file used for commenting. --> <!-- Checks that each Java package has a Javadoc file used for commenting. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage --> <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
<!-- <!--
@ -29,6 +31,13 @@
<module name="FileLength"/> <module name="FileLength"/>
<module name="LineLength">
<property name="max" value="150"/>
<property name="fileExtensions" value="java" />
</module>
<module name="SuppressWithPlainTextCommentFilter"/>
<!-- Following interprets the header file as regular expressions. --> <!-- Following interprets the header file as regular expressions. -->
<!-- <module name="RegexpHeader"/> --> <!-- <module name="RegexpHeader"/> -->
@ -60,8 +69,6 @@
<module name="TreeWalker"> <module name="TreeWalker">
<property name="cacheFile" value="${checkstyle.cache.file}"/>
<module name="SuppressWarningsHolder"/> <module name="SuppressWarningsHolder"/>
<!-- Checks for Javadoc comments. --> <!-- Checks for Javadoc comments. -->
@ -115,9 +122,6 @@
<!-- Checks for Size Violations. --> <!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html --> <!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<property name="max" value="120"/>
</module>
<module name="MethodLength"/> <module name="MethodLength"/>
<module name="ParameterNumber"> <module name="ParameterNumber">
<property name="max" value="10"/> <property name="max" value="10"/>

View File

@ -28,7 +28,7 @@
<org.apache.maven.plugins.javadoc.version>3.1.0</org.apache.maven.plugins.javadoc.version> <org.apache.maven.plugins.javadoc.version>3.1.0</org.apache.maven.plugins.javadoc.version>
<org.springframework.version>4.0.3.RELEASE</org.springframework.version> <org.springframework.version>4.0.3.RELEASE</org.springframework.version>
<org.eclipse.tycho.compiler-jdt.version>0.26.0</org.eclipse.tycho.compiler-jdt.version> <org.eclipse.tycho.compiler-jdt.version>0.26.0</org.eclipse.tycho.compiler-jdt.version>
<com.puppycrawl.tools.checkstyle.version>8.18</com.puppycrawl.tools.checkstyle.version> <com.puppycrawl.tools.checkstyle.version>8.29</com.puppycrawl.tools.checkstyle.version>
<add.release.arguments /> <add.release.arguments />
<forkCount>1</forkCount> <forkCount>1</forkCount>
<assertj.version>3.11.1</assertj.version> <assertj.version>3.11.1</assertj.version>
@ -278,7 +278,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId> <artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version> <version>3.1.0</version>
<configuration> <configuration>
<configLocation>build-config/checkstyle.xml</configLocation> <configLocation>build-config/checkstyle.xml</configLocation>
<consoleOutput>true</consoleOutput> <consoleOutput>true</consoleOutput>

View File

@ -45,7 +45,6 @@ public abstract class SimpleConversion implements ConversionProvider {
return Collections.emptyList(); return Collections.emptyList();
} }
/** /**
* Returns the conversion string from source to target. The placeholder {@code <SOURCE>} can be used to represent a * Returns the conversion string from source to target. The placeholder {@code <SOURCE>} can be used to represent a
* reference to the source value. * reference to the source value.

View File

@ -177,8 +177,6 @@ public abstract class HelperMethod implements Method {
return true; return true;
} }
/** /**
* There's currently only one parameter foreseen instead of a list of parameter * There's currently only one parameter foreseen instead of a list of parameter
* *

View File

@ -73,7 +73,6 @@ public final class LifecycleMethodResolver {
existingVariableNames ); existingVariableNames );
} }
/** /**
* @param method the method to obtain the beforeMapping methods for * @param method the method to obtain the beforeMapping methods for
* @param selectionParameters method selectionParameters * @param selectionParameters method selectionParameters

View File

@ -50,8 +50,6 @@ public class ObjectFactoryMethodResolver {
return getFactoryMethod( method, method.getResultType(), selectionParameters, ctx ); return getFactoryMethod( method, method.getResultType(), selectionParameters, ctx );
} }
/** /**
* returns a no arg factory method * returns a no arg factory method
* *

View File

@ -145,7 +145,6 @@ public class TypeFactory {
return getType( typeElement, isLiteral ); return getType( typeElement, isLiteral );
} }
/** /**
* Determines if the type with the given full qualified name is part of the classpath * Determines if the type with the given full qualified name is part of the classpath
* *
@ -597,7 +596,6 @@ public class TypeFactory {
return typeMirror; return typeMirror;
} }
/** /**
* Whether the given type is ready to be processed or not. It can be processed if it is not of kind * Whether the given type is ready to be processed or not. It can be processed if it is not of kind
* {@link TypeKind#ERROR} and all {@link AstModifyingAnnotationProcessor}s (if any) indicated that they've fully * {@link TypeKind#ERROR} and all {@link AstModifyingAnnotationProcessor}s (if any) indicated that they've fully

View File

@ -176,7 +176,6 @@ public abstract class AnnotationBasedComponentModelProcessor implements ModelEle
); );
} }
/** /**
* Removes duplicate constructor parameter annotations. If an annotation is already present on the constructor, it * Removes duplicate constructor parameter annotations. If an annotation is already present on the constructor, it
* does not have be defined on the constructor parameter, too. For example, for CDI, the javax.inject.Inject * does not have be defined on the constructor parameter, too. For example, for CDI, the javax.inject.Inject

View File

@ -86,7 +86,6 @@ public class DefaultAccessorNamingStrategy implements AccessorNamingStrategy {
return isNonBooleanGetterName || ( isBooleanGetterName && returnTypeIsBoolean ); return isNonBooleanGetterName || ( isBooleanGetterName && returnTypeIsBoolean );
} }
/** /**
* Returns {@code true} when the {@link ExecutableElement} is a setter method. A setter starts with 'set'. The * Returns {@code true} when the {@link ExecutableElement} is a setter method. A setter starts with 'set'. The
* remainder of the name is supposed to reflect the property name. * remainder of the name is supposed to reflect the property name.

View File

@ -8,7 +8,6 @@ package org.mapstruct.ap.test.accessibility.referenced.a;
import org.mapstruct.ap.test.accessibility.referenced.ReferencedSource; import org.mapstruct.ap.test.accessibility.referenced.ReferencedSource;
import org.mapstruct.ap.test.accessibility.referenced.ReferencedTarget; import org.mapstruct.ap.test.accessibility.referenced.ReferencedTarget;
/** /**
* *
* @author Sjaak Derksen * @author Sjaak Derksen

View File

@ -29,7 +29,6 @@ public class PetMapper {
.put( 3L, "cat" ) .put( 3L, "cat" )
.put( 4L, "dog" ).build(); .put( 4L, "dog" ).build();
/** /**
* method to be used when using an adder * method to be used when using an adder
* *

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.bugs._375; package org.mapstruct.ap.test.bugs._375;
/** /**
* *
* @author Sjaak Derksen * @author Sjaak Derksen

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.bugs._513; package org.mapstruct.ap.test.bugs._513;
/** /**
* *
* @author Sjaak Derksen * @author Sjaak Derksen

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.bugs._513; package org.mapstruct.ap.test.bugs._513;
/** /**
* *
* @author Sjaak Derksen * @author Sjaak Derksen

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.bugs._513; package org.mapstruct.ap.test.bugs._513;
/** /**
* *
* @author Sjaak Derksen * @author Sjaak Derksen

View File

@ -198,8 +198,6 @@ public class Issue913GetterMapperForCollectionsTest {
assertThat( domain2.getLongs() ).isEmpty(); assertThat( domain2.getLongs() ).isEmpty();
} }
/** /**
* These assert check if non-null and default mapping is working as expected. * These assert check if non-null and default mapping is working as expected.
* *

View File

@ -31,7 +31,6 @@ public class PetMapper {
.put( 3L, "cat" ) .put( 3L, "cat" )
.put( 4L, "dog" ).build(); .put( 4L, "dog" ).build();
/** /**
* method to be used when using an adder * method to be used when using an adder
* *

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.collection.adder.source; package org.mapstruct.ap.test.collection.adder.source;
/** /**
* @author Sjaak Derksen * @author Sjaak Derksen
*/ */

View File

@ -7,7 +7,6 @@ package org.mapstruct.ap.test.conversion.java8time.localdatetoxmlgregoriancalend
import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.datatype.XMLGregorianCalendar;
/** /**
* @author Andreas Gudian * @author Andreas Gudian
*/ */

View File

@ -7,7 +7,6 @@ package org.mapstruct.ap.test.erroneous.ambiguousannotatedfactorymethod;
import org.mapstruct.ObjectFactory; import org.mapstruct.ObjectFactory;
/** /**
* @author Remo Meier * @author Remo Meier
*/ */

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.erroneous.ambiguousannotatedfactorymethod; package org.mapstruct.ap.test.erroneous.ambiguousannotatedfactorymethod;
/** /**
* @author Remo Meier * @author Remo Meier
*/ */

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.erroneous.ambiguousannotatedfactorymethod; package org.mapstruct.ap.test.erroneous.ambiguousannotatedfactorymethod;
/** /**
* @author Remo Meier * @author Remo Meier
*/ */

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.erroneous.ambiguousannotatedfactorymethod; package org.mapstruct.ap.test.erroneous.ambiguousannotatedfactorymethod;
/** /**
* @author Remo Meier * @author Remo Meier
*/ */

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.erroneous.ambiguousfactorymethod; package org.mapstruct.ap.test.erroneous.ambiguousfactorymethod;
/** /**
* @author Sjaak Derksen * @author Sjaak Derksen
*/ */

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.erroneous.ambiguousfactorymethod; package org.mapstruct.ap.test.erroneous.ambiguousfactorymethod;
/** /**
* @author Sjaak Derksen * @author Sjaak Derksen
*/ */

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.erroneous.ambiguousfactorymethod; package org.mapstruct.ap.test.erroneous.ambiguousfactorymethod;
/** /**
* @author Sjaak Derksen * @author Sjaak Derksen
*/ */

View File

@ -7,7 +7,6 @@ package org.mapstruct.ap.test.erroneous.ambiguousfactorymethod.a;
import org.mapstruct.ap.test.erroneous.ambiguousfactorymethod.Bar; import org.mapstruct.ap.test.erroneous.ambiguousfactorymethod.Bar;
/** /**
* @author Sjaak Derksen * @author Sjaak Derksen
*/ */

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.generics; package org.mapstruct.ap.test.generics;
/** /**
* @author Andreas Gudian * @author Andreas Gudian
*/ */

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.generics; package org.mapstruct.ap.test.generics;
/** /**
* @author Andreas Gudian * @author Andreas Gudian
* *

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.nestedsourceproperties._target; package org.mapstruct.ap.test.nestedsourceproperties._target;
/** /**
* @author Sjaak Derksen * @author Sjaak Derksen
*/ */

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.nestedsourceproperties._target; package org.mapstruct.ap.test.nestedsourceproperties._target;
/** /**
* @author Sjaak Derksen * @author Sjaak Derksen
*/ */

View File

@ -7,7 +7,6 @@ package org.mapstruct.ap.test.nestedsourceproperties.source;
import java.util.List; import java.util.List;
/** /**
* @author Sjaak Derksen * @author Sjaak Derksen
*/ */

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.nullcheck; package org.mapstruct.ap.test.nullcheck;
/** /**
* @author Sjaak Derksen * @author Sjaak Derksen
*/ */

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.references; package org.mapstruct.ap.test.references;
/** /**
* @author Andreas Gudian * @author Andreas Gudian
* *

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.selection.primitives; package org.mapstruct.ap.test.selection.primitives;
/** /**
* @author Sjaak Derksen * @author Sjaak Derksen
* *

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.source.constants; package org.mapstruct.ap.test.source.constants;
/** /**
* *
* @author Sjaak Derksen * @author Sjaak Derksen

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.source.constants; package org.mapstruct.ap.test.source.constants;
/** /**
* *
* @author Sjaak Derksen * @author Sjaak Derksen

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.source.constants; package org.mapstruct.ap.test.source.constants;
/** /**
* *
* @author Sjaak Derksen * @author Sjaak Derksen

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.template; package org.mapstruct.ap.test.template;
/** /**
* @author Sjaak Derksen * @author Sjaak Derksen
*/ */

View File

@ -5,7 +5,6 @@
*/ */
package org.mapstruct.ap.test.template; package org.mapstruct.ap.test.template;
/** /**
* @author Sjaak Derksen * @author Sjaak Derksen
*/ */

View File

@ -57,7 +57,6 @@ public class GeneratedSource implements TestRule {
GeneratedSource.compilingStatement.remove(); GeneratedSource.compilingStatement.remove();
} }
/** /**
* Adds more mappers that need to be compared. * Adds more mappers that need to be compared.
* *

View File

@ -7,6 +7,8 @@
<!-- Based on sun_checks.xml from the CheckStyle distribution --> <!-- Based on sun_checks.xml from the CheckStyle distribution -->
<module name="Checker"> <module name="Checker">
<property name="cacheFile" value="${checkstyle.cache.file}"/>
<!-- <!--
If you set the basedir property below, then all reported file If you set the basedir property below, then all reported file
names will be relative to the specified directory. See names will be relative to the specified directory. See
@ -56,8 +58,6 @@
<module name="TreeWalker"> <module name="TreeWalker">
<property name="cacheFile" value="${checkstyle.cache.file}"/>
<!-- Checks for Naming Conventions. --> <!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html --> <!-- See http://checkstyle.sf.net/config_naming.html -->
<!-- <module name="ConstantName"/> <!-- <module name="ConstantName"/>