diff -Nru checkstyle-6.14.1/.checkstyle checkstyle-6.15/.checkstyle --- checkstyle-6.14.1/.checkstyle 2015-12-21 14:47:35.000000000 +0000 +++ checkstyle-6.15/.checkstyle 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ - - - - - - - - - - diff -Nru checkstyle-6.14.1/circle.yml checkstyle-6.15/circle.yml --- checkstyle-6.14.1/circle.yml 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/circle.yml 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1,45 @@ +checkout: + post: + - git clone https://github.com/checkstyle/contribution +dependencies: + # we to override as 'mvn dependecy:go-ofline' does not download all dependencies + override: + - mvn install -Passembly + - eval $TESTER_DEPENDENCIES +machine: + java: + version: oraclejdk8 + environment: + CMD1: "cd contribution/checkstyle-tester" + DEP1: " && sed -i.'' 's/^guava/#guava/' projects-to-test-on.properties" + # we need this to let pass 'mvn site' on no-projects mode to download all dependecies + DEP2: " && echo 'class ClassEmpty{}' > src/main/java/EmptyClass.java" + DEP3: " && ./launch.sh -Dcheckstyle.config.location=my_check.xml" + TESTER_DEPENDENCIES: $CMD1$DEP1$DEP2$DEP3 + CMD2: " && sed -i.'' 's/^openjdk/#openjdk/' projects-for-circle.properties" + CMD3: " && sed -i.'' s/projects-to-test-on.properties/projects-for-circle.properties/ launch.sh" + CMD4: " && ./launch.sh -Dcheckstyle.config.location=checks-nonjavadoc-error.xml" + OPENJDK: " && sed -i.'' 's/#openjdk/openjdk/' projects-for-circle.properties" + INFINISPAN: " && sed -i.'' 's/#infinispan/infinispan/' projects-for-circle.properties" + PROTONPACK: " && sed -i.'' 's/#protonpack/protonpack/' projects-for-circle.properties" + JOOL: " && sed -i.'' 's/#jOOL/jOOL/' projects-for-circle.properties" + TAPESTRY: " && sed -i.'' 's/#tapestry5/tapestry5/' projects-for-circle.properties" + COMMONS: " && sed -i.'' 's/#apache-commons/apache-commons/' projects-for-circle.properties" + LUCENE: " && sed -i.'' 's/#lucene-solr/lucene-solr/' projects-for-circle.properties" + STORM: " && sed -i.'' 's/#storm/storm/' projects-for-circle.properties" + HADOOP: " && sed -i.'' 's/#hadoop/hadoop/' projects-for-circle.properties" + CASSANDRA: " && sed -i.'' 's/#cassandra/cassandra/' projects-for-circle.properties" + SCOUTER: " && sed -i.'' 's/#scouter/scouter/' projects-for-circle.properties" + GROOVY: " && sed -i.'' 's/#groovy/groovy/' projects-for-circle.properties" + # Test over openjdk7 + TEST_1: $CMD1$CMD2$OPENJDK$CMD3$CMD4 + # Test over infinispan, protonpack, jOOL, lucene-solr + TEST_2: $CMD1$CMD2$INFINISPAN$PROTONPACK$JOOL$LUCENE$CMD3$CMD4 + # Test over tapestry5, storm, cassandra + TEST_3: $CMD1$CMD2$TAPESTRY$STORM$CASSANDRA$CMD3$CMD4 + # Test over apache-commons, hadoop, scouter, groovy + TEST_4: $CMD1$CMD2$COMMONS$HADOOP$SCOUTER$GROOVY$CMD3$CMD4 +test: + override: + - case $CIRCLE_NODE_INDEX in 0) eval $TEST_1 ;; 1) eval $TEST_2 ;; 2) eval $TEST_3 ;; 3) eval $TEST_4 ;; esac: + parallel: true diff -Nru checkstyle-6.14.1/.classpath checkstyle-6.15/.classpath --- checkstyle-6.14.1/.classpath 2015-12-29 15:24:36.000000000 +0000 +++ checkstyle-6.15/.classpath 2016-01-30 16:08:52.000000000 +0000 @@ -6,9 +6,9 @@ - + @@ -18,31 +18,39 @@ - + - + - + - - + + + + + + + - + + - + + + diff -Nru checkstyle-6.14.1/config/checkstyle_checks.xml checkstyle-6.15/config/checkstyle_checks.xml --- checkstyle-6.14.1/config/checkstyle_checks.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/config/checkstyle_checks.xml 2016-01-30 23:19:28.000000000 +0000 @@ -93,6 +93,25 @@ + + + + + + + + + + + + + + + + + + + @@ -206,6 +225,7 @@ - + + + diff -Nru checkstyle-6.14.1/config/checkstyle_sevntu_checks.xml checkstyle-6.15/config/checkstyle_sevntu_checks.xml --- checkstyle-6.14.1/config/checkstyle_sevntu_checks.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/config/checkstyle_sevntu_checks.xml 2016-01-30 23:19:28.000000000 +0000 @@ -5,10 +5,11 @@ "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> + - + @@ -139,5 +140,6 @@ + diff -Nru checkstyle-6.14.1/config/deploy-settings.xml checkstyle-6.15/config/deploy-settings.xml --- checkstyle-6.14.1/config/deploy-settings.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/config/deploy-settings.xml 2016-01-30 23:19:28.000000000 +0000 @@ -1,9 +1,10 @@ + sonatype-nexus-snapshots ${env.CI_DEPLOY_USERNAME} ${env.CI_DEPLOY_PASSWORD} - \ No newline at end of file + diff -Nru checkstyle-6.14.1/config/java.header checkstyle-6.15/config/java.header --- checkstyle-6.14.1/config/java.header 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/config/java.header 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/config/suppressions.xml checkstyle-6.15/config/suppressions.xml --- checkstyle-6.14.1/config/suppressions.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/config/suppressions.xml 2016-01-30 23:19:28.000000000 +0000 @@ -74,7 +74,7 @@ files="AbstractClassNameCheckTest.java|AbstractTypeAwareCheckTest.java|AbstractJavadocCheckTest.java|AbstractViolationReporterTest.java"/> - + @@ -89,9 +89,8 @@ - - + + @@ -122,7 +121,7 @@ - + diff -Nru checkstyle-6.14.1/debian/changelog checkstyle-6.15/debian/changelog --- checkstyle-6.14.1/debian/changelog 2016-01-03 15:38:44.000000000 +0000 +++ checkstyle-6.15/debian/changelog 2016-02-04 20:52:02.000000000 +0000 @@ -1,3 +1,11 @@ +checkstyle (6.15-1) unstable; urgency=medium + + * Team upload. + * New upstream release + * Standards-Version updated to 3.9.7 (no changes) + + -- Emmanuel Bourg Thu, 04 Feb 2016 21:51:50 +0100 + checkstyle (6.14.1-1) unstable; urgency=medium * Team upload. diff -Nru checkstyle-6.14.1/debian/control checkstyle-6.15/debian/control --- checkstyle-6.14.1/debian/control 2016-01-03 11:50:45.000000000 +0000 +++ checkstyle-6.15/debian/control 2016-02-04 20:37:44.000000000 +0000 @@ -20,7 +20,7 @@ libmaven-javadoc-plugin-java, maven-debian-helper (>= 1.0), maven-repo-helper (>= 1.1) -Standards-Version: 3.9.6 +Standards-Version: 3.9.7 Vcs-Git: git://anonscm.debian.org/pkg-java/checkstyle.git Vcs-Browser: http://anonscm.debian.org/cgit/pkg-java/checkstyle.git Homepage: http://checkstyle.sourceforge.net diff -Nru checkstyle-6.14.1/pom.xml checkstyle-6.15/pom.xml --- checkstyle-6.14.1/pom.xml 2015-12-30 14:07:33.000000000 +0000 +++ checkstyle-6.15/pom.xml 2016-01-31 15:25:08.000000000 +0000 @@ -22,7 +22,7 @@ com.puppycrawl.tools checkstyle - 6.14.1 + 6.15 jar checkstyle @@ -196,11 +196,11 @@ 3.6 0.7.5.201505241946 2.17 - 1.17.1 + 1.18.0 1.7.0 ${java.home}/../lib/tools.jar 1.7 - 6.13 + 6.14.1 @@ -271,7 +271,7 @@ nl.jqno.equalsverifier equalsverifier - 1.7.5 + 1.7.7 test @@ -295,7 +295,7 @@ org.eclipse.jgit org.eclipse.jgit - 4.1.1.201511131810-r + 4.2.0.201601211800-r test @@ -474,6 +474,7 @@ true 0 error + project.basedir=${project.basedir} ${project.build.sourceDirectory} @@ -521,7 +522,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.3 + 3.5 ${java.version} ${java.version} @@ -580,6 +581,14 @@ 2.8.2 + org.codehaus.mojo + versions-maven-plugin + 2.2 + + false + + + org.sonatype.plugins nexus-staging-maven-plugin 1.6.6 @@ -749,7 +758,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 2.19 + 2.19.1 com/google/**/*.java @@ -775,7 +784,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.19 + 2.19.1 -Duser.language=en -Duser.country=US -XX:-UseSplitVerifier @@ -1008,7 +1017,7 @@ org.apache.maven.plugins maven-surefire-report-plugin - 2.19 + 2.19.1 @@ -1097,14 +1106,14 @@ maven-report 0.1 - http://nemo.sonarqube.org + https://nemo.sonarqube.org org.apache.maven.plugins maven-pmd-plugin - 3.5 + ${maven.pmd.plugin.version} @@ -1177,14 +1186,22 @@ http://mojo.codehaus.org/xml-maven-plugin http://www.antlr.org/antlr4-maven-plugin + + http://mojo.codehaus.org/versions-maven-plugin http://maven.apache.org/plugins/maven-release-plugin/ + + http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ + + http://www.mojohaus.org/build-helper-maven-plugin/build-helper-maven-plugin + + https://github.com/checkstyle/checkstyle/issues/1555 - http://nemo.sonarqube.org/project/index/com.puppycrawl.tools:checkstyle + https://nemo.sonarqube.org/project/index/com.puppycrawl.tools:checkstyle http://iweb.dl.sourceforge.net/project/checkstyle/checkstyle/*-SNAPSHOT/checkstyle-*-SNAPSHOT-all.jar @@ -1263,7 +1280,7 @@ org.apache.maven.plugins maven-shade-plugin - 2.4.2 + 2.4.3 package diff -Nru checkstyle-6.14.1/.project checkstyle-6.15/.project --- checkstyle-6.14.1/.project 2015-12-29 15:20:37.000000000 +0000 +++ checkstyle-6.15/.project 2016-01-30 16:05:33.000000000 +0000 @@ -15,15 +15,9 @@ - - net.sf.eclipsecs.core.CheckstyleBuilder - - - org.eclipse.jdt.core.javanature org.eclipse.m2e.core.maven2Nature - net.sf.eclipsecs.core.CheckstyleNature diff -Nru checkstyle-6.14.1/README.md checkstyle-6.15/README.md --- checkstyle-6.14.1/README.md 2015-12-29 16:49:00.000000000 +0000 +++ checkstyle-6.15/README.md 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,8 @@ [![][travis img]][travis] [![][appveyor img]][appveyor] [![][teamcity img]][teamcity] +[![][codeship img]][codeship] +[![][circleci img]][circleci] [![][coverage img]][coverage] [![][mavenbadge img]][mavenbadge] @@ -98,3 +100,9 @@ [teamcity]:https://teamcity.jetbrains.com/viewType.html?buildTypeId=Checkstyle_IdeaInspectionsMaster [teamcity img]:https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/Checkstyle_IdeaInspectionsMaster.svg?label=TeamCity%20inspections + +[codeship]: https://codeship.com/projects/124310 +[codeship img]:https://codeship.com/projects/67b814a0-8fee-0133-9b59-02a170289b8c/status?branch=master + +[circleci]: https://circleci.com/gh/checkstyle/checkstyle/tree/master +[circleci img]: https://circleci.com/gh/checkstyle/checkstyle/tree/master.svg?style=svg diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/base/BaseCheckTestSupport.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/base/BaseCheckTestSupport.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/base/BaseCheckTestSupport.java 2015-12-29 16:38:36.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/base/BaseCheckTestSupport.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/base/BaseIndentationCheckSupport.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/base/BaseIndentationCheckSupport.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/base/BaseIndentationCheckSupport.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/base/BaseIndentationCheckSupport.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -126,7 +126,7 @@ final int indentInComment = getIndentFromComment(comment); final boolean isWarnComment = isWarnComment(comment); - boolean result; + final boolean result; final CommentType type = getCommentType(comment); switch (type) { case MULTILEVEL: diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/base/ConfigValidationTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/base/ConfigValidationTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/base/ConfigValidationTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/base/ConfigValidationTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule21filename/OuterTypeFilenameTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule21filename/OuterTypeFilenameTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule21filename/OuterTypeFilenameTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule21filename/OuterTypeFilenameTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,6 +19,8 @@ package com.google.checkstyle.test.chapter2filebasic.rule21filename; +import static com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck.MSG_KEY; + import java.io.File; import java.io.IOException; @@ -65,7 +67,7 @@ public void outerTypeFilenameTest3() throws Exception { final String[] expected = { - "3: " + getCheckMessage(OuterTypeFilenameCheck.class, "type.file.mismatch"), + "3: " + getCheckMessage(OuterTypeFilenameCheck.class, MSG_KEY), }; final Configuration checkConfig = getCheckConfig("OuterTypeFilename"); diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule231filetab/FileTabCharacterTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule231filetab/FileTabCharacterTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule231filetab/FileTabCharacterTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule231filetab/FileTabCharacterTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule232specialescape/IllegalTokenTextTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule232specialescape/IllegalTokenTextTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule232specialescape/IllegalTokenTextTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule232specialescape/IllegalTokenTextTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule233nonascii/AvoidEscapedUnicodeCharactersTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule233nonascii/AvoidEscapedUnicodeCharactersTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule233nonascii/AvoidEscapedUnicodeCharactersTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule233nonascii/AvoidEscapedUnicodeCharactersTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,6 +19,8 @@ package com.google.checkstyle.test.chapter2filebasic.rule233nonascii; +import static com.puppycrawl.tools.checkstyle.checks.AvoidEscapedUnicodeCharactersCheck.MSG_KEY; + import java.io.File; import java.io.IOException; @@ -39,16 +41,13 @@ @Test public void unicodeEscapesTest() throws Exception { - final String msg = getCheckMessage(AvoidEscapedUnicodeCharactersCheck.class, - "forbid.escaped.unicode.char"); - final String[] expected = { - "5: " + msg, - "15: " + msg, - "25: " + msg, - "33: " + msg, - "35: " + msg, - "36: " + msg, + "5: " + getCheckMessage(AvoidEscapedUnicodeCharactersCheck.class, MSG_KEY), + "15: " + getCheckMessage(AvoidEscapedUnicodeCharactersCheck.class, MSG_KEY), + "25: " + getCheckMessage(AvoidEscapedUnicodeCharactersCheck.class, MSG_KEY), + "33: " + getCheckMessage(AvoidEscapedUnicodeCharactersCheck.class, MSG_KEY), + "35: " + getCheckMessage(AvoidEscapedUnicodeCharactersCheck.class, MSG_KEY), + "36: " + getCheckMessage(AvoidEscapedUnicodeCharactersCheck.class, MSG_KEY), }; final Configuration checkConfig = getCheckConfig("AvoidEscapedUnicodeCharacters"); diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule32packagestate/LineLengthTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule32packagestate/LineLengthTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule32packagestate/LineLengthTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule32packagestate/LineLengthTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule331nowildcard/AvoidStarImportTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule331nowildcard/AvoidStarImportTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule331nowildcard/AvoidStarImportTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule331nowildcard/AvoidStarImportTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/NoLineWrapTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/NoLineWrapTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/NoLineWrapTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/NoLineWrapTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule333orderingandspacing/CustomImportOrderTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule333orderingandspacing/CustomImportOrderTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule333orderingandspacing/CustomImportOrderTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule333orderingandspacing/CustomImportOrderTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule341onetoplevel/OneTopLevelClassTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule341onetoplevel/OneTopLevelClassTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule341onetoplevel/OneTopLevelClassTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule341onetoplevel/OneTopLevelClassTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3421overloadsplit/OverloadMethodsDeclarationOrderTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3421overloadsplit/OverloadMethodsDeclarationOrderTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3421overloadsplit/OverloadMethodsDeclarationOrderTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3421overloadsplit/OverloadMethodsDeclarationOrderTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3sourcefile/EmptyLineSeparatorTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3sourcefile/EmptyLineSeparatorTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3sourcefile/EmptyLineSeparatorTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3sourcefile/EmptyLineSeparatorTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule411bracesareused/NeedBracesTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule411bracesareused/NeedBracesTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule411bracesareused/NeedBracesTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule411bracesareused/NeedBracesTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/LeftCurlyTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/LeftCurlyTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/LeftCurlyTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/LeftCurlyTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/RightCurlyTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/RightCurlyTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/RightCurlyTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/RightCurlyTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyBlockTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyBlockTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyBlockTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyBlockTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyCatchBlockTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyCatchBlockTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyCatchBlockTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyCatchBlockTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule43onestatement/OneStatementPerLineTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule43onestatement/OneStatementPerLineTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule43onestatement/OneStatementPerLineTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule43onestatement/OneStatementPerLineTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -80,7 +80,12 @@ "multiple.statements.line"); final String[] expected = { - "24:6: " + msg, + "31:6: " + msg, + "36:58: " + msg, + "37:58: " + msg, + "37:74: " + msg, + "38:50: " + msg, + "42:91: " + msg, }; final Configuration checkConfig = getCheckConfig("OneStatementPerLine"); diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/LineLengthTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/LineLengthTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/LineLengthTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/LineLengthTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/MethodParamPadTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/MethodParamPadTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/MethodParamPadTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/MethodParamPadTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/OperatorWrapTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/OperatorWrapTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/OperatorWrapTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/OperatorWrapTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/SeparatorWrapTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/SeparatorWrapTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/SeparatorWrapTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/SeparatorWrapTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule461verticalwhitespace/EmptyLineSeparatorTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule461verticalwhitespace/EmptyLineSeparatorTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule461verticalwhitespace/EmptyLineSeparatorTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule461verticalwhitespace/EmptyLineSeparatorTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/GenericWhitespaceTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/GenericWhitespaceTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/GenericWhitespaceTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/GenericWhitespaceTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAroundTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAroundTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAroundTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAroundTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4821onevariableperline/MultipleVariableDeclarationsTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4821onevariableperline/MultipleVariableDeclarationsTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4821onevariableperline/MultipleVariableDeclarationsTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4821onevariableperline/MultipleVariableDeclarationsTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4822variabledistance/VariableDeclarationUsageDistanceTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4822variabledistance/VariableDeclarationUsageDistanceTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4822variabledistance/VariableDeclarationUsageDistanceTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4822variabledistance/VariableDeclarationUsageDistanceTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4832nocstylearray/ArrayTypeStyleTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4832nocstylearray/ArrayTypeStyleTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4832nocstylearray/ArrayTypeStyleTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4832nocstylearray/ArrayTypeStyleTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,6 +19,8 @@ package com.google.checkstyle.test.chapter4formatting.rule4832nocstylearray; +import static com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck.MSG_KEY; + import java.io.File; import java.io.IOException; @@ -39,15 +41,13 @@ @Test public void arrayTypeStyleTest() throws Exception { - final String msg = getCheckMessage(ArrayTypeStyleCheck.class, "array.type.style"); - final String[] expected = { - "9:23: " + msg, - "15:44: " + msg, - "21:20: " + msg, - "22:23: " + msg, - "41:16: " + msg, - "42:19: " + msg, + "9:23: " + getCheckMessage(ArrayTypeStyleCheck.class, MSG_KEY), + "15:44: " + getCheckMessage(ArrayTypeStyleCheck.class, MSG_KEY), + "21:20: " + getCheckMessage(ArrayTypeStyleCheck.class, MSG_KEY), + "22:23: " + getCheckMessage(ArrayTypeStyleCheck.class, MSG_KEY), + "41:16: " + getCheckMessage(ArrayTypeStyleCheck.class, MSG_KEY), + "42:19: " + getCheckMessage(ArrayTypeStyleCheck.class, MSG_KEY), }; final Configuration checkConfig = getCheckConfig("ArrayTypeStyle"); diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4841indentation/IndentationTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4841indentation/IndentationTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4841indentation/IndentationTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4841indentation/IndentationTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4842fallthrough/FallThroughTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4842fallthrough/FallThroughTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4842fallthrough/FallThroughTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4842fallthrough/FallThroughTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4843defaultcasepresent/MissingSwitchDefaultTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4843defaultcasepresent/MissingSwitchDefaultTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4843defaultcasepresent/MissingSwitchDefaultTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4843defaultcasepresent/MissingSwitchDefaultTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule485annotations/AnnotationLocationTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule485annotations/AnnotationLocationTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule485annotations/AnnotationLocationTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule485annotations/AnnotationLocationTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/CommentsIndentationTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/CommentsIndentationTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/CommentsIndentationTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/CommentsIndentationTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule487modifiers/ModifierOrderTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule487modifiers/ModifierOrderTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule487modifiers/ModifierOrderTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule487modifiers/ModifierOrderTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule488numericliterals/UpperEllTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule488numericliterals/UpperEllTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter4formatting/rule488numericliterals/UpperEllTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter4formatting/rule488numericliterals/UpperEllTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule51identifiernames/CatchParameterNameTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule51identifiernames/CatchParameterNameTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule51identifiernames/CatchParameterNameTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule51identifiernames/CatchParameterNameTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule521packagenames/PackageNameTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule521packagenames/PackageNameTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule521packagenames/PackageNameTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule521packagenames/PackageNameTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule522typenames/TypeNameTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule522typenames/TypeNameTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule522typenames/TypeNameTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule522typenames/TypeNameTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule523methodnames/MethodNameTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule523methodnames/MethodNameTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule523methodnames/MethodNameTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule523methodnames/MethodNameTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule525nonconstantfieldnames/MemberNameTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule525nonconstantfieldnames/MemberNameTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule525nonconstantfieldnames/MemberNameTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule525nonconstantfieldnames/MemberNameTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/ParameterNameTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/ParameterNameTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/ParameterNameTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/ParameterNameTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/LocalVariableNameTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/LocalVariableNameTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/LocalVariableNameTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/LocalVariableNameTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/ClassTypeParameterNameTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/ClassTypeParameterNameTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/ClassTypeParameterNameTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/ClassTypeParameterNameTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/InterfaceTypeParameterNameTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/InterfaceTypeParameterNameTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/InterfaceTypeParameterNameTest.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/InterfaceTypeParameterNameTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1,57 @@ +//////////////////////////////////////////////////////////////////////////////// +// checkstyle: Checks Java source code for adherence to a set of rules. +// Copyright (C) 2001-2016 the original author or authors. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//////////////////////////////////////////////////////////////////////////////// + +package com.google.checkstyle.test.chapter5naming.rule528typevariablenames; + +import java.io.File; +import java.io.IOException; + +import org.junit.Test; + +import com.google.checkstyle.test.base.BaseCheckTestSupport; +import com.puppycrawl.tools.checkstyle.api.Configuration; + +public class InterfaceTypeParameterNameTest extends BaseCheckTestSupport { + + private static final String MSG_KEY = "name.invalidPattern"; + + @Override + protected String getPath(String fileName) throws IOException { + return super.getPath("chapter5naming" + File.separator + "rule528typevariablenames" + + File.separator + fileName); + } + + @Test + public void testInterfaceDefault() throws Exception { + final Configuration configuration = getCheckConfig("InterfaceTypeParameterName"); + final String format = configuration.getAttribute("format"); + + final String[] expected = { + "48:15: " + getCheckMessage(configuration.getMessages(), MSG_KEY, "Input", format), + "76:25: " + getCheckMessage(configuration.getMessages(), MSG_KEY, "Request", format), + "80:25: " + getCheckMessage(configuration.getMessages(), MSG_KEY, "TRequest", format), + }; + + final String filePath = getPath("InputInterfaceTypeParameterName.java"); + + final Integer[] warnList = getLinesWithWarn(filePath); + verify(configuration, filePath, expected, warnList); + } + +} diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/MethodTypeParameterNameTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/MethodTypeParameterNameTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/MethodTypeParameterNameTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/MethodTypeParameterNameTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule53camelcase/AbbreviationAsWordInNameTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule53camelcase/AbbreviationAsWordInNameTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter5naming/rule53camelcase/AbbreviationAsWordInNameTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter5naming/rule53camelcase/AbbreviationAsWordInNameTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule62donotignoreexceptions/EmptyBlockTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule62donotignoreexceptions/EmptyBlockTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule62donotignoreexceptions/EmptyBlockTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule62donotignoreexceptions/EmptyBlockTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule64finalizers/NoFinalizerTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule64finalizers/NoFinalizerTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule64finalizers/NoFinalizerTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule64finalizers/NoFinalizerTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/SingleLineJavadocTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/SingleLineJavadocTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/SingleLineJavadocTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/SingleLineJavadocTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/JavadocParagraphTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/JavadocParagraphTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/JavadocParagraphTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/JavadocParagraphTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/AtclauseOrderTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/AtclauseOrderTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/AtclauseOrderTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/AtclauseOrderTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/JavadocTagContinuationIndentationTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/JavadocTagContinuationIndentationTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/JavadocTagContinuationIndentationTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/JavadocTagContinuationIndentationTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/NonEmptyAtclauseDescriptionTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/NonEmptyAtclauseDescriptionTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/NonEmptyAtclauseDescriptionTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/NonEmptyAtclauseDescriptionTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule72thesummaryfragment/SummaryJavadocTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule72thesummaryfragment/SummaryJavadocTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule72thesummaryfragment/SummaryJavadocTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule72thesummaryfragment/SummaryJavadocTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/JavadocMethodTest.java checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/JavadocMethodTest.java --- checkstyle-6.14.1/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/JavadocMethodTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/JavadocMethodTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/it/resources/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/InputInterfaceTypeParameterName.java checkstyle-6.15/src/it/resources/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/InputInterfaceTypeParameterName.java --- checkstyle-6.14.1/src/it/resources/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/InputInterfaceTypeParameterName.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/it/resources/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/InputInterfaceTypeParameterName.java 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1,86 @@ +package com.google.checkstyle.test.chapter5naming.rule528typevariablenames; + +import java.io.Serializable; + +public class InputInterfaceTypeParameterName +{ + public void foo() { } + + void foo(int i) { + } +} + +class OtherClass { + + foo getOne() { + return null;//comment + } + + /*comment*/Tfo$o2T getTwo(Tfo$o2T a) { + return null; + } + + foo getShadow() { + return null; + } + + static class Junk { + <_fo extends foo> void getMoreFoo() { + } + } +} + +class MoreOtherClass { + + void getMore() { + new Other() { + void getMoreFoo() { + } + }; + +// Other o = new Other() { +// void getMoreFoo() { +// } +// }; + } +} + +interface Boo { // warn + Input boo(); +} + +interface FooInterface { + T foo(); +} + +interface FooInterface2 { + Input foo(); +} + +interface FooInterface3 { + Input foo(); +} + +interface FooInterface4 { + Input foo(); +} + +interface FooInterface5 { + Input foo(); +} + +interface FooInterface6 { + Input foo(); +} + +interface FooInterface7 { // warn + Input foo(); +} + +interface FooInterface8 { // warn + Input foo(); +} + +class Input { + +} diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTask.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTask.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTask.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTask.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/ant/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/ant/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/ant/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/ant/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractFileSetCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractFileSetCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractFileSetCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractFileSetCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractLoader.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractLoader.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractLoader.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractLoader.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractViolationReporter.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractViolationReporter.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractViolationReporter.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractViolationReporter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/AuditEvent.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/AuditEvent.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/AuditEvent.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/AuditEvent.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/AuditListener.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/AuditListener.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/AuditListener.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/AuditListener.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/AutomaticBean.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/AutomaticBean.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/AutomaticBean.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/AutomaticBean.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -116,6 +116,8 @@ * is called for each {@link Configuration#getChildren child Configuration} * of {@code configuration}. * + * @param config the configuration to use. + * @throws CheckstyleException if there is a configuration error. * @see Configurable */ @Override @@ -187,6 +189,9 @@ /** * Implements the Contextualizable interface using bean introspection. + * + * @param context the context. + * @throws CheckstyleException if there is a contextualization error. * @see Contextualizable */ @Override diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/Check.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/Check.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/Check.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/Check.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/CheckstyleException.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/CheckstyleException.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/CheckstyleException.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/CheckstyleException.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/Comment.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/Comment.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/Comment.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/Comment.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/Configurable.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/Configurable.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/Configurable.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/Configurable.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/Configuration.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/Configuration.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/Configuration.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/Configuration.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/Context.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/Context.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/Context.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/Context.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/Contextualizable.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/Contextualizable.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/Contextualizable.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/Contextualizable.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/DetailAST.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/DetailAST.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/DetailAST.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/DetailAST.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/DetailNode.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/DetailNode.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/DetailNode.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/DetailNode.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -176,7 +176,7 @@ **/ private String[] extractCComment(int startLineNo, int startColNo, int endLineNo, int endColNo) { - String[] returnValue; + final String[] returnValue; if (startLineNo == endLineNo) { returnValue = new String[1]; returnValue[0] = line(startLineNo - 1).substring(startColNo, diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/FileSetCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/FileSetCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/FileSetCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/FileSetCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/FileText.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/FileText.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/FileText.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/FileText.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/Filter.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/Filter.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/Filter.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/Filter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/FilterSet.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/FilterSet.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/FilterSet.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/FilterSet.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/FullIdent.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/FullIdent.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/FullIdent.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/FullIdent.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/JavadocTokenTypes.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/JavadocTokenTypes.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/JavadocTokenTypes.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/JavadocTokenTypes.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/LineColumn.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/LineColumn.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/LineColumn.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/LineColumn.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessage.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessage.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessage.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessage.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessages.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessages.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessages.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessages.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/MessageDispatcher.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/MessageDispatcher.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/MessageDispatcher.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/MessageDispatcher.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/Scope.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/Scope.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/Scope.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/Scope.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelCounter.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelCounter.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelCounter.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelCounter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/SeverityLevel.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/SeverityLevel.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/SeverityLevel.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/SeverityLevel.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/TextBlock.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/TextBlock.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/TextBlock.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/TextBlock.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/TokenTypes.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/TokenTypes.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/api/TokenTypes.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/api/TokenTypes.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/AuditEventDefaultFormatter.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/AuditEventDefaultFormatter.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/AuditEventDefaultFormatter.java 2015-12-30 13:23:15.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/AuditEventDefaultFormatter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/AuditEventFormatter.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/AuditEventFormatter.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/AuditEventFormatter.java 2015-12-30 13:23:15.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/AuditEventFormatter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractDeclarationCollector.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractDeclarationCollector.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractDeclarationCollector.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractDeclarationCollector.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractFormatCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractFormatCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractFormatCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractFormatCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractOptionCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractOptionCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractOptionCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractOptionCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractTypeAwareCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractTypeAwareCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractTypeAwareCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractTypeAwareCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingDeprecatedCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingDeprecatedCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingDeprecatedCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingDeprecatedCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/PackageAnnotationCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/PackageAnnotationCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/PackageAnnotationCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/PackageAnnotationCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -46,6 +46,12 @@ */ public class PackageAnnotationCheck extends Check { + /** + * A key is pointing to the warning message text in "messages.properties" + * file. + */ + public static final String MSG_KEY = "annotation.package.location"; + @Override public int[] getDefaultTokens() { return getRequiredTokens(); @@ -71,7 +77,7 @@ getFileContents().inPackageInfo(); if (containsAnnotation && !inPackageInfo) { - log(ast.getLine(), "annotation.package.location"); + log(ast.getLine(), MSG_KEY); } } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/ArrayTypeStyleCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/ArrayTypeStyleCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/ArrayTypeStyleCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/ArrayTypeStyleCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -32,6 +32,12 @@ * @author lkuehne */ public class ArrayTypeStyleCheck extends Check { + /** + * A key is pointing to the warning message text in "messages.properties" + * file. + */ + public static final String MSG_KEY = "array.type.style"; + /** Controls whether to use Java or C style. */ private boolean javaStyle = true; @@ -70,7 +76,7 @@ || variableAST.getColumnNo() > ast.getColumnNo(); if (isJavaStyle != javaStyle) { - log(ast.getLineNo(), ast.getColumnNo(), "array.type.style"); + log(ast.getLineNo(), ast.getColumnNo(), MSG_KEY); } } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -106,6 +106,12 @@ */ public class AvoidEscapedUnicodeCharactersCheck extends Check { + /** + * A key is pointing to the warning message text in "messages.properties" + * file. + */ + public static final String MSG_KEY = "forbid.escaped.unicode.char"; + /** Regular expression for Unicode chars. */ private static final Pattern UNICODE_REGEXP = Pattern.compile("\\\\u[a-fA-F0-9]{4}"); @@ -216,7 +222,7 @@ && isOnlyUnicodeValidChars(literal, UNICODE_CONTROL) || allowNonPrintableEscapes && isOnlyUnicodeValidChars(literal, NON_PRINTABLE_CHARS))) { - log(ast.getLineNo(), "forbid.escaped.unicode.char"); + log(ast.getLineNo(), MSG_KEY); } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/AvoidNestedBlocksCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/AvoidNestedBlocksCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/AvoidNestedBlocksCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/AvoidNestedBlocksCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/BlockOption.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/BlockOption.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/BlockOption.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/BlockOption.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyBlockCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyBlockCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyBlockCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyBlockCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -153,7 +153,7 @@ if (leftCurly != null) { if (option == BlockOption.STMT) { - boolean emptyBlock; + final boolean emptyBlock; if (leftCurly.getType() == TokenTypes.LCURLY) { emptyBlock = leftCurly.getNextSibling().getType() != TokenTypes.CASE_GROUP; } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/LeftCurlyCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/LeftCurlyCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/LeftCurlyCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/LeftCurlyCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -177,7 +177,7 @@ @Override public void visitToken(DetailAST ast) { - DetailAST startToken; + final DetailAST startToken; DetailAST brace; switch (ast.getType()) { diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/LeftCurlyOption.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/LeftCurlyOption.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/LeftCurlyOption.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/LeftCurlyOption.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/NeedBracesCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/NeedBracesCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/NeedBracesCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/NeedBracesCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -265,7 +265,7 @@ * @return true if current statement is single-line statement. */ private static boolean isSingleLineStatement(DetailAST statement) { - boolean result; + final boolean result; switch (statement.getType()) { case TokenTypes.LITERAL_IF: diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -318,7 +318,7 @@ // Attempt to locate the tokens to do the check boolean shouldCheckLastRcurly = false; DetailAST rcurly = null; - DetailAST lcurly; + final DetailAST lcurly; DetailAST nextToken; switch (ast.getType()) { diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyOption.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyOption.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyOption.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyOption.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AbstractIllegalCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AbstractIllegalCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AbstractIllegalCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AbstractIllegalCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AbstractIllegalMethodCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AbstractIllegalMethodCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AbstractIllegalMethodCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AbstractIllegalMethodCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AbstractNestedDepthCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AbstractNestedDepthCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AbstractNestedDepthCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AbstractNestedDepthCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AbstractSuperCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AbstractSuperCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AbstractSuperCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AbstractSuperCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ArrayTrailingCommaCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ArrayTrailingCommaCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ArrayTrailingCommaCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ArrayTrailingCommaCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidInlineConditionalsCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidInlineConditionalsCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidInlineConditionalsCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidInlineConditionalsCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/CovariantEqualsCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/CovariantEqualsCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/CovariantEqualsCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/CovariantEqualsCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/DeclarationOrderCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/DeclarationOrderCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/DeclarationOrderCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/DeclarationOrderCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/DefaultComesLastCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/DefaultComesLastCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/DefaultComesLastCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/DefaultComesLastCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EmptyStatementCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EmptyStatementCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EmptyStatementCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EmptyStatementCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -376,7 +376,7 @@ * @return true if the object is of String type. */ private boolean isCalledOnStringFieldOrVariable(DetailAST objCalledOn) { - boolean result; + final boolean result; final DetailAST previousSiblingAst = objCalledOn.getPreviousSibling(); if (previousSiblingAst == null) { result = isStringFieldOrVariable(objCalledOn); diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsHashCodeCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsHashCodeCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsHashCodeCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsHashCodeCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ExplicitInitializationCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ExplicitInitializationCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ExplicitInitializationCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ExplicitInitializationCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -161,7 +161,7 @@ */ private boolean isTerminated(final DetailAST ast, boolean useBreak, boolean useContinue) { - boolean terminated; + final boolean terminated; switch (ast.getType()) { case TokenTypes.LITERAL_RETURN: @@ -249,7 +249,7 @@ * @return true if loop is terminated. */ private boolean checkLoop(final DetailAST ast) { - DetailAST loopBody; + final DetailAST loopBody; if (ast.getType() == TokenTypes.LITERAL_DO) { final DetailAST lparen = ast.findFirstToken(TokenTypes.DO_WHILE); loopBody = lparen.getPreviousSibling(); diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheck.java 2015-12-26 21:19:24.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -115,6 +115,10 @@ /** Scope Deque. */ private final Deque scopeStack = new ArrayDeque<>(); + /** Uninitialized variables of previous scope. */ + private final Deque> prevScopeUninitializedVariables = + new ArrayDeque<>(); + /** Controls whether to check enhanced for-loop variable. */ private boolean validateEnhancedForLoopVariable; @@ -180,6 +184,7 @@ if (ast.getParent().getType() != TokenTypes.CASE_GROUP || ast.getParent().getParent().findFirstToken(TokenTypes.CASE_GROUP) == ast.getParent()) { + storePrevScopeUninitializedVariableData(); scopeStack.push(new ScopeData()); } break; @@ -223,10 +228,17 @@ scope = scopeStack.pop().scope; break; case TokenTypes.SLIST: + final Deque prevScopeUnitializedVariableData = + prevScopeUninitializedVariables.peek(); if (ast.getParent().getType() != TokenTypes.CASE_GROUP - || findLastToken(ast.getParent().getParent(), TokenTypes.CASE_GROUP, - TokenTypes.SLIST) == ast.getParent()) { + || findLastChildWhichContainsSpecifiedToken(ast.getParent().getParent(), + TokenTypes.CASE_GROUP, TokenTypes.SLIST) == ast.getParent()) { scope = scopeStack.pop().scope; + prevScopeUninitializedVariables.pop(); + } + final DetailAST parent = ast.getParent(); + if (shouldUpdateUninitializedVariables(parent)) { + updateUninitializedVariables(prevScopeUnitializedVariableData); } break; default: @@ -240,6 +252,64 @@ } /** + * Store un-initialized variables in a temporary stack for future use. + */ + private void storePrevScopeUninitializedVariableData() { + final ScopeData scopeData = scopeStack.peek(); + final Deque prevScopeUnitializedVariableData = + new ArrayDeque<>(); + for (DetailAST variable : scopeData.uninitializedVariables) { + prevScopeUnitializedVariableData.push(variable); + } + prevScopeUninitializedVariables.push(prevScopeUnitializedVariableData); + } + + /** + * Update current scope data uninitialized variable according to the previous scope data. + * @param prevScopeUnitializedVariableData variable for previous stack of uninitialized + * variables + */ + private void updateUninitializedVariables(Deque + prevScopeUnitializedVariableData) { + // Check for only previous scope + for (DetailAST variable : prevScopeUnitializedVariableData) { + for (ScopeData scopeData : scopeStack) { + final DetailAST storedVariable = scopeData.scope.get(variable.getText()); + if (storedVariable != null && isSameVariables(storedVariable, variable) + && !scopeData.uninitializedVariables.contains(storedVariable)) { + scopeData.uninitializedVariables.push(variable); + } + } + } + // Check for rest of the scope + for (Deque unitializedVariableData : prevScopeUninitializedVariables) { + for (DetailAST variable : unitializedVariableData) { + for (ScopeData scopeData : scopeStack) { + final DetailAST storedVariable = scopeData.scope.get(variable.getText()); + if (storedVariable != null + && isSameVariables(storedVariable, variable) + && !scopeData.uninitializedVariables.contains(storedVariable)) { + scopeData.uninitializedVariables.push(variable); + } + } + } + } + } + + /** + * If token is LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, or LITERAL_ELSE, then do not + * update the uninitialized variables. + * @param ast token to be checked + * @return true if should be updated, else false + */ + private boolean shouldUpdateUninitializedVariables(DetailAST ast) { + return ast.getType() != TokenTypes.LITERAL_TRY + && ast.getType() != TokenTypes.LITERAL_CATCH + && ast.getType() != TokenTypes.LITERAL_FINALLY + && ast.getType() != TokenTypes.LITERAL_ELSE; + } + + /** * Returns the last child token that makes a specified type and contains containType in * its branch. * @param ast token to be tested @@ -247,7 +317,8 @@ * @param containType the token type which has to be present in the branch * @return the matching token, or null if no match */ - public DetailAST findLastToken(DetailAST ast, int childType, int containType) { + public DetailAST findLastChildWhichContainsSpecifiedToken(DetailAST ast, int childType, + int containType) { DetailAST returnValue = null; for (DetailAST astIterator = ast.getFirstChild(); astIterator != null; astIterator = astIterator.getNextSibling()) { diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/HiddenFieldCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/HiddenFieldCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/HiddenFieldCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/HiddenFieldCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTypeCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTypeCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTypeCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTypeCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/InnerAssignmentCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/InnerAssignmentCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/InnerAssignmentCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/InnerAssignmentCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MagicNumberCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MagicNumberCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MagicNumberCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MagicNumberCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingCtorCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingCtorCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingCtorCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingCtorCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingSwitchDefaultCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingSwitchDefaultCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingSwitchDefaultCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingSwitchDefaultCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleStringLiteralsCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleStringLiteralsCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleStringLiteralsCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleStringLiteralsCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleVariableDeclarationsCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleVariableDeclarationsCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleVariableDeclarationsCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleVariableDeclarationsCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedIfDepthCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedIfDepthCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedIfDepthCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedIfDepthCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedTryDepthCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedTryDepthCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedTryDepthCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedTryDepthCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NoCloneCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NoCloneCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NoCloneCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NoCloneCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NoFinalizerCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NoFinalizerCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NoFinalizerCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/NoFinalizerCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/OneStatementPerLineCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/OneStatementPerLineCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/OneStatementPerLineCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/OneStatementPerLineCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,6 +19,9 @@ package com.puppycrawl.tools.checkstyle.checks.coding; +import java.util.ArrayDeque; +import java.util.Deque; + import com.puppycrawl.tools.checkstyle.api.Check; import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -73,6 +76,11 @@ public static final String MSG_KEY = "multiple.statements.line"; /** + * Counts number of semicolons in nested lambdas. + */ + private final Deque countOfSemiInLambda = new ArrayDeque<>(); + + /** * Hold the line-number where the last statement ended. */ private int lastStatementEnd = -1; @@ -87,6 +95,16 @@ */ private boolean inForHeader; + /** + * Holds if current token is inside lambda. + */ + private boolean isInLambda; + + /** + * Hold the line-number where the last lambda statement ended. + */ + private int lambdaStatementEnd = -1; + @Override public int[] getDefaultTokens() { return getAcceptableTokens(); @@ -95,8 +113,10 @@ @Override public int[] getAcceptableTokens() { return new int[] { - TokenTypes.SEMI, TokenTypes.FOR_INIT, + TokenTypes.SEMI, + TokenTypes.FOR_INIT, TokenTypes.FOR_ITERATOR, + TokenTypes.LAMBDA, }; } @@ -110,27 +130,22 @@ inForHeader = false; lastStatementEnd = -1; forStatementEnd = -1; + isInLambda = false; } @Override public void visitToken(DetailAST ast) { switch (ast.getType()) { case TokenTypes.SEMI: - DetailAST currentStatement = ast; - final boolean hasResourcesPrevSibling = - currentStatement.getPreviousSibling() != null - && currentStatement.getPreviousSibling().getType() == TokenTypes.RESOURCES; - if (!hasResourcesPrevSibling && isMultilineStatement(currentStatement)) { - currentStatement = ast.getPreviousSibling(); - } - if (!inForHeader - && isOnTheSameLine(currentStatement, lastStatementEnd, forStatementEnd)) { - log(ast, MSG_KEY); - } + checkIfSemicolonIsInDifferentLineThanPrevious(ast); break; case TokenTypes.FOR_ITERATOR: forStatementEnd = ast.getLineNo(); break; + case TokenTypes.LAMBDA: + isInLambda = true; + countOfSemiInLambda.push(0); + break; default: inForHeader = true; break; @@ -143,26 +158,66 @@ case TokenTypes.SEMI: lastStatementEnd = ast.getLineNo(); forStatementEnd = -1; + lambdaStatementEnd = -1; break; case TokenTypes.FOR_ITERATOR: inForHeader = false; break; + case TokenTypes.LAMBDA: + countOfSemiInLambda.pop(); + if (countOfSemiInLambda.isEmpty()) { + isInLambda = false; + } + lambdaStatementEnd = ast.getLineNo(); + break; default: break; } } /** + * Checks if given semicolon is in different line than previous. + * @param ast semicolon to check + */ + private void checkIfSemicolonIsInDifferentLineThanPrevious(DetailAST ast) { + DetailAST currentStatement = ast; + final boolean hasResourcesPrevSibling = + currentStatement.getPreviousSibling() != null + && currentStatement.getPreviousSibling().getType() == TokenTypes.RESOURCES; + if (!hasResourcesPrevSibling && isMultilineStatement(currentStatement)) { + currentStatement = ast.getPreviousSibling(); + } + if (isInLambda) { + int countOfSemiInCurrentLambda = countOfSemiInLambda.pop(); + countOfSemiInCurrentLambda++; + countOfSemiInLambda.push(countOfSemiInCurrentLambda); + if (!inForHeader && countOfSemiInCurrentLambda > 1 + && isOnTheSameLine(currentStatement, + lastStatementEnd, forStatementEnd, + lambdaStatementEnd)) { + log(ast, MSG_KEY); + } + } + else if (!inForHeader && isOnTheSameLine(currentStatement, lastStatementEnd, + forStatementEnd, lambdaStatementEnd)) { + log(ast, MSG_KEY); + } + } + + /** * Checks whether two statements are on the same line. * @param ast token for the current statement. * @param lastStatementEnd the line-number where the last statement ended. * @param forStatementEnd the line-number where the last 'for-loop' * statement ended. + * @param lambdaStatementEnd the line-number where the last lambda + * statement ended. * @return true if two statements are on the same line. */ private static boolean isOnTheSameLine(DetailAST ast, int lastStatementEnd, - int forStatementEnd) { - return lastStatementEnd == ast.getLineNo() && forStatementEnd != ast.getLineNo(); + int forStatementEnd, int lambdaStatementEnd) { + return lastStatementEnd == ast.getLineNo() && forStatementEnd != ast.getLineNo() + && lambdaStatementEnd != ast.getLineNo(); } /** diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/OverloadMethodsDeclarationOrderCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/OverloadMethodsDeclarationOrderCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/OverloadMethodsDeclarationOrderCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/OverloadMethodsDeclarationOrderCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/PackageDeclarationCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/PackageDeclarationCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/PackageDeclarationCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/PackageDeclarationCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/RequireThisCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/RequireThisCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/RequireThisCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/RequireThisCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -38,7 +38,9 @@ * That is references to instance variables and methods of the present * object are explicitly of the form "this.varName" or * "this.methodName(args)". - *

+ *

+ * + *

Warning: the Check is very controversial and not that actual nowadays.

* *

Examples of use: *

@@ -53,6 +55,19 @@
  * </module>
  * 
* + *

Rationale:

+ *
    + *
  1. + * The same notation/habit for C++ and Java (C++ have global methods, so having + * "this." do make sense in it to distinguish call of method of class + * instead of global). + *
  2. + *
  3. + * Non-IDE development (ease of refactoring, some clearness to distinguish + * static and non-static methods). + *
  4. + *
+ * *

Limitations: Nothing is currently done about static variables * or catch-blocks. Static methods invoked on a class name seem to be OK; * both the class name and the method name have a DOT parent. @@ -374,7 +389,8 @@ private AbstractFrame checkMethod(DetailAST ast) { final AbstractFrame frame = findFrame(ast, true); if (frame != null - && ((ClassFrame) frame).hasInstanceMethod(ast)) { + && ((ClassFrame) frame).hasInstanceMethod(ast) + && !((ClassFrame) frame).hasStaticMethod(ast)) { return frame; } return null; @@ -478,12 +494,12 @@ return frameName; } - /** Check whether the frame contains a given name. + /** Check whether the frame contains a field or a variable with the given name. * @param nameToFind the IDENT ast of the name we're looking for * @return whether it was found */ - boolean contains(DetailAST nameToFind) { - return containsName(varIdents, nameToFind); + boolean containsFieldOrVariable(DetailAST nameToFind) { + return containsFieldOrVariableDef(varIdents, nameToFind); } /** Check whether the frame contains a given name. @@ -492,10 +508,10 @@ * @return whether it was found. */ protected AbstractFrame getIfContains(DetailAST nameToFind, boolean lookForMethod) { - AbstractFrame frame; + final AbstractFrame frame; if (!lookForMethod - && contains(nameToFind)) { + && containsFieldOrVariable(nameToFind)) { frame = this; } else { @@ -512,7 +528,7 @@ * @return true if the set contains a declaration with the text of the specified * IDENT ast and it is declared in a proper position. */ - protected boolean containsName(Set set, DetailAST ident) { + protected boolean containsFieldOrVariableDef(Set set, DetailAST ident) { boolean result = false; for (DetailAST ast: set) { if (isProperDefinition(ident, ast)) { @@ -642,25 +658,33 @@ * instance member of the class */ public boolean hasInstanceMember(final DetailAST ident) { - return containsName(instanceMembers, ident); + return containsFieldOrVariableDef(instanceMembers, ident); } /** * Checks if a given name is a known instance method of the class. - * @param ident the IDENT ast of the name to check - * @return true is the given name is a name of a known + * @param ident the IDENT ast of the method call to check + * @return true if the given ast is correspondent to a known * instance method of the class */ public boolean hasInstanceMethod(final DetailAST ident) { - return containsName(instanceMethods, ident); + return containsMethodDef(instanceMethods, ident); + } + + /** + * Checks if a given name is a known static method of the class. + * @param ident the IDENT ast of the method call to check + * @return true is the given ast is correspondent to a known + * instance method of the class + */ + public boolean hasStaticMethod(final DetailAST ident) { + return containsMethodDef(staticMethods, ident); } @Override - boolean contains(DetailAST nameToFind) { - return containsName(instanceMembers, nameToFind) - || containsName(instanceMethods, nameToFind) - || containsName(staticMembers, nameToFind) - || containsName(staticMethods, nameToFind); + boolean containsFieldOrVariable(DetailAST nameToFind) { + return containsFieldOrVariableDef(instanceMembers, nameToFind) + || containsFieldOrVariableDef(staticMembers, nameToFind); } @Override @@ -673,7 +697,8 @@ protected AbstractFrame getIfContains(DetailAST nameToFind, boolean lookForMethod) { AbstractFrame frame = null; - if (contains(nameToFind)) { + if (lookForMethod && containsMethod(nameToFind) + || containsFieldOrVariable(nameToFind)) { frame = this; } else if (getParent() != null) { @@ -681,6 +706,54 @@ } return frame; } + + /** + * Check whether the frame contains a given method. + * @param methodToFind the AST of the method to find. + * @return true, if a method with the same name and number of parameters is found. + */ + private boolean containsMethod(DetailAST methodToFind) { + return containsMethodDef(instanceMethods, methodToFind) + || containsMethodDef(staticMethods, methodToFind); + } + + /** + * Whether the set contains a method definition with the + * same name and number of parameters. + * @param set the set of definitions. + * @param ident the specified method call IDENT ast. + * @return true if the set contains a definition with the + * same name and number of parameters. + */ + private boolean containsMethodDef(Set set, DetailAST ident) { + boolean result = false; + for (DetailAST ast: set) { + if (isSimilarSignature(ident, ast)) { + result = true; + break; + } + } + return result; + } + + /** + * Whether the method definition has the same name and number of parameters. + * @param ident the specified method call IDENT ast. + * @param ast the ast of a method definition to compare with. + * @return true if a method definition has the same name and number of parameters + * as the method call. + */ + private boolean isSimilarSignature(DetailAST ident, DetailAST ast) { + boolean result = false; + if (ident.getText().equals(ast.getText())) { + final int paramsNumber = ast.getParent().findFirstToken(TokenTypes.PARAMETERS) + .getChildCount(); + final int argsNumber = ident.getParent().findFirstToken(TokenTypes.ELIST) + .getChildCount(); + result = paramsNumber == argsNumber; + } + return result; + } } /** diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ReturnCountCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ReturnCountCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ReturnCountCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ReturnCountCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanExpressionCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanExpressionCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanExpressionCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanExpressionCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanReturnCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanReturnCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanReturnCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanReturnCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/StringLiteralEqualityCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/StringLiteralEqualityCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/StringLiteralEqualityCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/StringLiteralEqualityCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperCloneCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperCloneCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperCloneCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperCloneCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperFinalizeCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperFinalizeCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperFinalizeCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperFinalizeCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessaryParenthesesCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessaryParenthesesCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessaryParenthesesCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessaryParenthesesCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -268,7 +268,7 @@ if (!isVariableMatchesIgnorePattern(variable.getText())) { final DetailAST semicolonAst = ast.getNextSibling(); - Entry entry; + final Entry entry; if (validateBetweenScopes) { entry = calculateDistanceBetweenScopes(semicolonAst, variable); } @@ -572,7 +572,7 @@ DetailAST firstNodeInsideBlock = null; if (!isVariableInOperatorExpr(block, variable)) { - DetailAST currentNode; + final DetailAST currentNode; // Find currentNode for DO-WHILE block. if (block.getType() == TokenTypes.LITERAL_DO) { diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/InterfaceIsTypeCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/InterfaceIsTypeCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/InterfaceIsTypeCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/InterfaceIsTypeCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/MutableExceptionCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/MutableExceptionCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/MutableExceptionCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/MutableExceptionCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/OneTopLevelClassCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/OneTopLevelClassCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/OneTopLevelClassCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/OneTopLevelClassCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -163,7 +163,7 @@ */ private static String getAnnotationName(DetailAST annotation) { final DetailAST dotAst = annotation.findFirstToken(TokenTypes.DOT); - String name; + final String name; if (dotAst == null) { name = annotation.findFirstToken(TokenTypes.IDENT).getText(); } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/VisibilityModifierCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/VisibilityModifierCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/VisibilityModifierCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/VisibilityModifierCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -649,7 +649,7 @@ * @return String representation of given type's name. */ private static String getTypeName(DetailAST type, boolean isCanonicalName) { - String typeName; + final String typeName; if (isCanonicalName) { typeName = getCanonicalName(type); } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/FileContentsHolder.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/FileContentsHolder.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/FileContentsHolder.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/FileContentsHolder.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/FinalParametersCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/FinalParametersCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/FinalParametersCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/FinalParametersCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/AbstractHeaderCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/AbstractHeaderCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/AbstractHeaderCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/AbstractHeaderCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/HeaderCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/HeaderCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/HeaderCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/HeaderCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -42,20 +42,21 @@ * @author o_sukhodolsky */ public class RegexpHeaderCheck extends AbstractHeaderCheck { - /** Empty array to avoid instantiations. */ - private static final int[] EMPTY_INT_ARRAY = new int[0]; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - private static final String MSG_HEADER_MISSING = "header.missing"; + public static final String MSG_HEADER_MISSING = "header.missing"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - private static final String MSG_HEADER_MISMATCH = "header.mismatch"; + public static final String MSG_HEADER_MISMATCH = "header.mismatch"; + + /** Empty array to avoid instantiations. */ + private static final int[] EMPTY_INT_ARRAY = new int[0]; /** The compiled regular expressions. */ private final List headerRegexps = Lists.newArrayList(); diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/AccessResult.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/AccessResult.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/AccessResult.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/AccessResult.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStarImportCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStarImportCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStarImportCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStarImportCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStaticImportCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStaticImportCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStaticImportCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStaticImportCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/Guard.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/Guard.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/Guard.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/Guard.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/IllegalImportCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/IllegalImportCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/IllegalImportCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/IllegalImportCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlLoader.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlLoader.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlLoader.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlLoader.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -249,7 +249,7 @@ for (int i = 0; i < packageGroups.length; i++) { String pkg = packageGroups[i]; final StringBuilder pkgBuilder = new StringBuilder(pkg); - Pattern grp; + final Pattern grp; // if the pkg name is the wildcard, make it match zero chars // from any name, so it will always be used as last resort. @@ -532,7 +532,7 @@ */ private static int compare(String string1, String string2, boolean caseSensitive) { - int result; + final int result; if (caseSensitive) { result = string1.compareTo(string2); } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderOption.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderOption.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderOption.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderOption.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/PkgControl.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/PkgControl.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/PkgControl.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/PkgControl.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -112,7 +112,7 @@ * @return an {@link AccessResult}. */ AccessResult checkAccess(final String forImport, final String inPkg) { - AccessResult result; + final AccessResult result; final AccessResult returnValue = localCheckAccess(forImport, inPkg); if (returnValue != AccessResult.UNKNOWN) { result = returnValue; diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/RedundantImportCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/RedundantImportCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/RedundantImportCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/RedundantImportCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/AbstractExpressionHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/AbstractExpressionHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/AbstractExpressionHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/AbstractExpressionHandler.java 2016-01-30 23:19:29.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -31,31 +31,6 @@ * @author jrichard */ public abstract class AbstractExpressionHandler { - - /** - * A key is pointing to the warning message text in "messages.properties" - * file. - */ - public static final String MSG_ERROR = "indentation.error"; - - /** - * A key is pointing to the warning message text in "messages.properties" - * file. - */ - public static final String MSG_ERROR_MULTI = "indentation.error.multi"; - - /** - * A key is pointing to the warning message text in "messages.properties" - * file. - */ - public static final String MSG_CHILD_ERROR = "indentation.child.error"; - - /** - * A key is pointing to the warning message text in "messages.properties" - * file. - */ - public static final String MSG_CHILD_ERROR_MULTI = "indentation.child.error.multi"; - /** * The instance of {@code IndentationCheck} using this handler. */ @@ -162,9 +137,9 @@ else { typeStr = " " + subtypeName; } - String messageKey = MSG_ERROR; + String messageKey = IndentationCheck.MSG_ERROR; if (expectedIndent.isMultiLevel()) { - messageKey = MSG_ERROR_MULTI; + messageKey = IndentationCheck.MSG_ERROR_MULTI; } indentCheck.indentationLog(ast.getLineNo(), messageKey, typeName + typeStr, actualIndent, expectedIndent); @@ -180,9 +155,9 @@ private void logChildError(int line, int actualIndent, IndentLevel expectedIndent) { - String messageKey = MSG_CHILD_ERROR; + String messageKey = IndentationCheck.MSG_CHILD_ERROR; if (expectedIndent.isMultiLevel()) { - messageKey = MSG_CHILD_ERROR_MULTI; + messageKey = IndentationCheck.MSG_CHILD_ERROR_MULTI; } indentCheck.indentationLog(line, messageKey, typeName, actualIndent, expectedIndent); @@ -253,7 +228,7 @@ */ protected final int getLineStart(String line) { int index = 0; - while (Character.isWhitespace(line.charAt(index))) { + while (index < line.length() && Character.isWhitespace(line.charAt(index))) { index++; } return CommonUtils.lengthExpandedTabs( @@ -353,9 +328,11 @@ */ private void checkLineIndent(int lineNum, IndentLevel indentLevel) { final String line = indentCheck.getLine(lineNum - 1); - final int start = getLineStart(line); - if (indentLevel.isGreaterThan(start)) { - logChildError(lineNum, start, indentLevel); + if (!line.isEmpty()) { + final int start = getLineStart(line); + if (indentLevel.isGreaterThan(start)) { + logChildError(lineNum, start, indentLevel); + } } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ArrayInitHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ArrayInitHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ArrayInitHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ArrayInitHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/BlockParentHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/BlockParentHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/BlockParentHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/BlockParentHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CaseHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CaseHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CaseHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CaseHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CatchHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CatchHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CatchHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CatchHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ClassDefHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ClassDefHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ClassDefHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ClassDefHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -565,7 +565,7 @@ * @return token which begins the line. */ private static DetailAST findTokenWhichBeginsTheLine(DetailAST root) { - DetailAST tokenWhichBeginsTheLine; + final DetailAST tokenWhichBeginsTheLine; if (isUsingOfObjectReferenceToInvokeMethod(root)) { tokenWhichBeginsTheLine = findStartTokenOfMethodCallChain(root); } @@ -726,7 +726,7 @@ */ private static boolean areSameLevelIndented(DetailAST comment, DetailAST prevStmt, DetailAST nextStmt) { - boolean result; + final boolean result; if (prevStmt == null) { result = comment.getColumnNo() == nextStmt.getColumnNo(); } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/DoWhileHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/DoWhileHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/DoWhileHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/DoWhileHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ElseHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ElseHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ElseHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ElseHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/FinallyHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/FinallyHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/FinallyHandler.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/FinallyHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ForHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ForHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ForHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ForHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/HandlerFactory.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/HandlerFactory.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/HandlerFactory.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/HandlerFactory.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -137,7 +137,7 @@ */ public AbstractExpressionHandler getHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent) { - AbstractExpressionHandler resultHandler; + final AbstractExpressionHandler resultHandler; final AbstractExpressionHandler handler = createdHandlers.get(ast); if (handler != null) { diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/IfHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/IfHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/IfHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/IfHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ImportHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ImportHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ImportHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ImportHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -80,6 +80,30 @@ * @author maxvetrenko */ public class IndentationCheck extends Check { + /** + * A key is pointing to the warning message text in "messages.properties" + * file. + */ + public static final String MSG_ERROR = "indentation.error"; + + /** + * A key is pointing to the warning message text in "messages.properties" + * file. + */ + public static final String MSG_ERROR_MULTI = "indentation.error.multi"; + + /** + * A key is pointing to the warning message text in "messages.properties" + * file. + */ + public static final String MSG_CHILD_ERROR = "indentation.child.error"; + + /** + * A key is pointing to the warning message text in "messages.properties" + * file. + */ + public static final String MSG_CHILD_ERROR_MULTI = "indentation.child.error.multi"; + /** Default indentation amount - based on Sun. */ private static final int DEFAULT_INDENTATION = 4; diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentLevel.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentLevel.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentLevel.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentLevel.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndexHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndexHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndexHandler.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndexHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LabelHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LabelHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LabelHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LabelHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LambdaHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LambdaHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LambdaHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LambdaHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LineSet.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LineSet.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LineSet.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LineSet.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LineWrappingHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LineWrappingHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LineWrappingHandler.java 2015-12-26 15:21:13.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/LineWrappingHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -33,17 +33,11 @@ * lineWrappingIndentation parameter. * * @author maxvetrenko - * + * @author liscju */ public class LineWrappingHandler { /** - * A key is pointing to the warning message text in "messages.properties" - * file. - */ - private static final String MSG_INDENTATION_ERROR = "indentation.error"; - - /** * The current instance of {@code IndentationCheck} class using this * handler. This field used to get access to private fields of * IndentationCheck instance. @@ -222,10 +216,13 @@ while (firstNodesOnLines.size() > 1) { final DetailAST node = itr.next(); - if (node.getLineNo() < lastAnnotationLine - || node.getLineNo() == lastAnnotationLine) { + if (node.getLineNo() <= lastAnnotationLine) { final DetailAST parentNode = node.getParent(); - if (node.getType() == TokenTypes.AT + final boolean isCurrentNodeCloseAnnotationAloneInLine = + node.getLineNo() == lastAnnotationLine + && node.equals(lastAnnotationNode); + if (isCurrentNodeCloseAnnotationAloneInLine + || node.getType() == TokenTypes.AT && parentNode.getParent().getType() == TokenTypes.MODIFIERS) { logWarningMessage(node, firstNodeIndent); } @@ -266,14 +263,14 @@ if (forceStrictCondition) { if (currentNode.getColumnNo() != currentIndent) { indentCheck.indentationLog(currentNode.getLineNo(), - MSG_INDENTATION_ERROR, currentNode.getText(), + IndentationCheck.MSG_ERROR, currentNode.getText(), currentNode.getColumnNo(), currentIndent); } } else { if (currentNode.getColumnNo() < currentIndent) { indentCheck.indentationLog(currentNode.getLineNo(), - MSG_INDENTATION_ERROR, currentNode.getText(), + IndentationCheck.MSG_ERROR, currentNode.getText(), currentNode.getColumnNo(), currentIndent); } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/MemberDefHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/MemberDefHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/MemberDefHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/MemberDefHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/MethodCallHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/MethodCallHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/MethodCallHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/MethodCallHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -43,7 +43,7 @@ @Override protected IndentLevel getIndentImpl() { - IndentLevel indentLevel; + final IndentLevel indentLevel; // if inside a method call's params, this could be part of // an expression, so get the previous line's start if (getParent() instanceof MethodCallHandler) { diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/MethodDefHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/MethodDefHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/MethodDefHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/MethodDefHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/NewHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/NewHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/NewHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/NewHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ObjectBlockHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ObjectBlockHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ObjectBlockHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/ObjectBlockHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/PackageDefHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/PackageDefHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/PackageDefHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/PackageDefHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/PrimordialHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/PrimordialHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/PrimordialHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/PrimordialHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/SlistHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/SlistHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/SlistHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/SlistHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/StaticInitHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/StaticInitHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/StaticInitHandler.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/StaticInitHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/SwitchHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/SwitchHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/SwitchHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/SwitchHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/SynchronizedHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/SynchronizedHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/SynchronizedHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/SynchronizedHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/TryHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/TryHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/TryHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/TryHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/WhileHandler.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/WhileHandler.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/WhileHandler.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/WhileHandler.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -43,6 +43,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocLexer; import com.puppycrawl.tools.checkstyle.grammars.javadoc.JavadocParser; +import com.puppycrawl.tools.checkstyle.utils.BlockCommentPosition; import com.puppycrawl.tools.checkstyle.utils.JavadocUtils; /** @@ -53,12 +54,12 @@ /** * Error message key for common javadoc errors. */ - public static final String PARSE_ERROR_MESSAGE_KEY = "javadoc.parse.error"; + public static final String MSG_KEY_PARSE_ERROR = "javadoc.parse.error"; /** * Unrecognized error from antlr parser. */ - public static final String UNRECOGNIZED_ANTLR_ERROR_MESSAGE_KEY = + public static final String MSG_KEY_UNRECOGNIZED_ANTLR_ERROR = "javadoc.unrecognized.antlr.error"; /** * Message key of error message. Missed close HTML tag breaks structure @@ -67,14 +68,19 @@ * {@code "no viable alternative at input 'b \n *\n'"} and it is not * clear that error is about missed close HTML tag. */ - static final String JAVADOC_MISSED_HTML_CLOSE = "javadoc.missed.html.close"; + public static final String MSG_JAVADOC_MISSED_HTML_CLOSE = "javadoc.missed.html.close"; /** * Message key of error message. */ - static final String JAVADOC_WRONG_SINGLETON_TAG = + public static final String MSG_JAVADOC_WRONG_SINGLETON_TAG = "javadoc.wrong.singleton.html.tag"; /** + * Parse error while rule recognition. + */ + public static final String MSG_JAVADOC_PARSE_RULE_ERROR = "javadoc.parse.rule.error"; + + /** * Key is "line:column". Value is {@link DetailNode} tree. Map is stored in {@link ThreadLocal} * to guarantee basic thread safety and avoid shared, mutable state when not necessary. */ @@ -168,14 +174,15 @@ @Override public final void visitToken(DetailAST blockCommentNode) { - if (JavadocUtils.isJavadocComment(blockCommentNode)) { + if (JavadocUtils.isJavadocComment(blockCommentNode) + && isCorrectJavadocPosition(blockCommentNode)) { // store as field, to share with child Checks blockCommentAst = blockCommentNode; final String treeCacheKey = blockCommentNode.getLineNo() + ":" + blockCommentNode.getColumnNo(); - ParseStatus result; + final ParseStatus result; if (TREE_CACHE.get().containsKey(treeCacheKey)) { result = TREE_CACHE.get().get(treeCacheKey); @@ -207,6 +214,29 @@ } /** + * Checks Javadoc comment it's in right place. + * From Javadoc util documentation: + * "Placement of comments - Documentation comments are recognized only when placed + * immediately before class, interface, constructor, method, or field + * declarations -- see the class example, method example, and field example. + * Documentation comments placed in the body of a method are ignored. Only one + * documentation comment per declaration statement is recognized by the Javadoc tool." + * + * @param blockComment Block comment AST + * @return true if Javadoc is in right place + */ + private static boolean isCorrectJavadocPosition(DetailAST blockComment) { + return BlockCommentPosition.isOnClass(blockComment) + || BlockCommentPosition.isOnInterface(blockComment) + || BlockCommentPosition.isOnEnum(blockComment) + || BlockCommentPosition.isOnMethod(blockComment) + || BlockCommentPosition.isOnField(blockComment) + || BlockCommentPosition.isOnConstructor(blockComment) + || BlockCommentPosition.isOnEnumConstant(blockComment) + || BlockCommentPosition.isOnAnnotationDef(blockComment); + } + + /** * Parses Javadoc comment as DetailNode tree. * @param javadocCommentAst * DetailAST of Javadoc comment @@ -242,7 +272,7 @@ // There are cases when antlr error listener does not handle syntax error if (parseErrorMessage == null) { parseErrorMessage = new ParseErrorMessage(javadocCommentAst.getLineNo(), - UNRECOGNIZED_ANTLR_ERROR_MESSAGE_KEY, + MSG_KEY_UNRECOGNIZED_ANTLR_ERROR, javadocCommentAst.getColumnNo(), ex.getMessage()); } @@ -413,7 +443,7 @@ * @return token type from JavadocTokenTypes */ private static int getTokenType(ParseTree node) { - int tokenType; + final int tokenType; if (node.getChildCount() == 0) { tokenType = ((TerminalNode) node).getSymbol().getType(); @@ -556,11 +586,6 @@ private static class DescriptiveErrorListener extends BaseErrorListener { /** - * Parse error while rule recognition. - */ - private static final String JAVADOC_PARSE_RULE_ERROR = "javadoc.parse.rule.error"; - - /** * Offset is line number of beginning of the Javadoc comment. Log * messages should have line number in scope of file, not in scope of * Javadoc comment. @@ -609,15 +634,15 @@ final int lineNumber = offset + line; final Token token = (Token) offendingSymbol; - if (JAVADOC_MISSED_HTML_CLOSE.equals(msg)) { + if (MSG_JAVADOC_MISSED_HTML_CLOSE.equals(msg)) { errorMessage = new ParseErrorMessage(lineNumber, - JAVADOC_MISSED_HTML_CLOSE, charPositionInLine, token.getText()); + MSG_JAVADOC_MISSED_HTML_CLOSE, charPositionInLine, token.getText()); throw new ParseCancellationException(msg); } - else if (JAVADOC_WRONG_SINGLETON_TAG.equals(msg)) { + else if (MSG_JAVADOC_WRONG_SINGLETON_TAG.equals(msg)) { errorMessage = new ParseErrorMessage(lineNumber, - JAVADOC_WRONG_SINGLETON_TAG, charPositionInLine, token.getText()); + MSG_JAVADOC_WRONG_SINGLETON_TAG, charPositionInLine, token.getText()); throw new ParseCancellationException(msg); } @@ -628,7 +653,7 @@ CaseFormat.UPPER_UNDERSCORE, ruleName); errorMessage = new ParseErrorMessage(lineNumber, - JAVADOC_PARSE_RULE_ERROR, charPositionInLine, msg, upperCaseRuleName); + MSG_JAVADOC_PARSE_RULE_ERROR, charPositionInLine, msg, upperCaseRuleName); } } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -183,13 +183,10 @@ * @return parent type. */ private static int getParentType(DetailAST commentBlock) { - int type = 0; final DetailAST parentNode = commentBlock.getParent(); - if (parentNode != null) { - type = parentNode.getType(); - if (type == TokenTypes.TYPE || type == TokenTypes.MODIFIERS) { - type = parentNode.getParent().getType(); - } + int type = parentNode.getType(); + if (type == TokenTypes.TYPE || type == TokenTypes.MODIFIERS) { + type = parentNode.getParent().getType(); } return type; } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/HtmlTag.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/HtmlTag.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/HtmlTag.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/HtmlTag.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/InvalidJavadocTag.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/InvalidJavadocTag.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/InvalidJavadocTag.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/InvalidJavadocTag.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -346,11 +346,6 @@ @Override protected final void processAST(DetailAST ast) { - if ((ast.getType() == TokenTypes.METHOD_DEF || ast.getType() == TokenTypes.CTOR_DEF) - && getMethodsNumberOfLine(ast) <= minLineCount - || hasAllowedAnnotations(ast)) { - return; - } final Scope theScope = calculateScope(ast); if (shouldCheck(ast, theScope)) { final FileContents contents = getFileContents(); @@ -395,7 +390,7 @@ * @return Some javadoc. */ private static int getMethodsNumberOfLine(DetailAST methodDef) { - int numberOfLines; + final int numberOfLines; final DetailAST lcurly = methodDef.getLastChild(); final DetailAST rcurly = lcurly.getLastChild(); @@ -430,7 +425,20 @@ return allowMissingJavadoc || allowMissingPropertyJavadoc && (CheckUtils.isSetterMethod(ast) || CheckUtils.isGetterMethod(ast)) - || matchesSkipRegex(ast); + || matchesSkipRegex(ast) + || isContentsAllowMissingJavadoc(ast); + } + + /** + * Checks if the Javadoc can be missing if the method or constructor is + * below the minimum line count or has a special annotation. + * + * @param ast the tree node for the method or constructor. + * @return True if this method or constructor doesn't need Javadoc. + */ + private boolean isContentsAllowMissingJavadoc(DetailAST ast) { + return (ast.getType() == TokenTypes.METHOD_DEF || ast.getType() == TokenTypes.CTOR_DEF) + && (getMethodsNumberOfLine(ast) <= minLineCount || hasAllowedAnnotations(ast)); } /** diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImpl.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImpl.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImpl.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImpl.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocPackageCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocPackageCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocPackageCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocPackageCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocParagraphCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocParagraphCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocParagraphCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocParagraphCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -49,22 +49,22 @@ extends Check { /** Message property key for the Unclosed HTML message. */ - public static final String JAVADOC_MISSING = "javadoc.missing"; + public static final String MSG_JAVADOC_MISSING = "javadoc.missing"; /** Message property key for the Unclosed HTML message. */ - public static final String EMPTY = "javadoc.empty"; + public static final String MSG_EMPTY = "javadoc.empty"; /** Message property key for the Unclosed HTML message. */ - public static final String NO_PERIOD = "javadoc.noPeriod"; + public static final String MSG_NO_PERIOD = "javadoc.noPeriod"; /** Message property key for the Unclosed HTML message. */ - public static final String INCOMPLETE_TAG = "javadoc.incompleteTag"; + public static final String MSG_INCOMPLETE_TAG = "javadoc.incompleteTag"; /** Message property key for the Unclosed HTML message. */ - public static final String UNCLOSED_HTML = "javadoc.unclosedHtml"; + public static final String MSG_UNCLOSED_HTML = "javadoc.unclosedHtml"; /** Message property key for the Extra HTML message. */ - public static final String EXTRA_HTML = "javadoc.extraHtml"; + public static final String MSG_EXTRA_HTML = "javadoc.extraHtml"; /** HTML tags that do not require a close tag. */ private static final Set SINGLE_TAGS = ImmutableSortedSet.of( @@ -200,7 +200,7 @@ // made sense to make another check just to ensure that the // package-info.java file actually contains package Javadocs. if (getFileContents().inPackageInfo()) { - log(ast.getLineNo(), JAVADOC_MISSING); + log(ast.getLineNo(), MSG_JAVADOC_MISSING); } return; } @@ -235,7 +235,7 @@ && !getEndOfSentencePattern().matcher(commentText).find() && !(commentText.startsWith("{@inheritDoc}") && JavadocTagInfo.INHERIT_DOC.isValidOn(ast))) { - log(comment.getStartLineNo(), NO_PERIOD); + log(comment.getStartLineNo(), MSG_NO_PERIOD); } } @@ -248,7 +248,7 @@ final String commentText = getCommentText(comment.getText()); if (commentText.isEmpty()) { - log(comment.getStartLineNo(), EMPTY); + log(comment.getStartLineNo(), MSG_EMPTY); } } @@ -351,7 +351,7 @@ final HtmlTag tag = parser.nextTag(); if (tag.isIncompleteTag()) { - log(tag.getLineNo(), INCOMPLETE_TAG, + log(tag.getLineNo(), MSG_INCOMPLETE_TAG, text[tag.getLineNo() - lineNo]); return; } @@ -365,7 +365,7 @@ // No corresponding open tag was found on the stack. log(tag.getLineNo(), tag.getPosition(), - EXTRA_HTML, + MSG_EXTRA_HTML, tag); } else { @@ -390,7 +390,7 @@ if (!isSingleTag(htmlTag) && !htmlTag.getId().equals(lastFound) && !typeParameters.contains(htmlTag.getId())) { - log(htmlTag.getLineNo(), htmlTag.getPosition(), UNCLOSED_HTML, htmlTag); + log(htmlTag.getLineNo(), htmlTag.getPosition(), MSG_UNCLOSED_HTML, htmlTag); lastFound = htmlTag.getId(); } } @@ -431,7 +431,7 @@ lastFound = lastOpenTag.getId(); log(lastOpenTag.getLineNo(), lastOpenTag.getPosition(), - UNCLOSED_HTML, + MSG_UNCLOSED_HTML, lastOpenTag); } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagContinuationIndentationCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagContinuationIndentationCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagContinuationIndentationCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagContinuationIndentationCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfo.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfo.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfo.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfo.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTag.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTag.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTag.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTag.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTags.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTags.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTags.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTags.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -52,37 +52,37 @@ * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String JAVADOC_MISSING = "javadoc.missing"; + public static final String MSG_JAVADOC_MISSING = "javadoc.missing"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String UNKNOWN_TAG = "javadoc.unknownTag"; + public static final String MSG_UNKNOWN_TAG = "javadoc.unknownTag"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String TAG_FORMAT = "type.tagFormat"; + public static final String MSG_TAG_FORMAT = "type.tagFormat"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String MISSING_TAG = "type.missingTag"; + public static final String MSG_MISSING_TAG = "type.missingTag"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String UNUSED_TAG = "javadoc.unusedTag"; + public static final String MSG_UNUSED_TAG = "javadoc.unusedTag"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String UNUSED_TAG_GENERAL = "javadoc.unusedTagGeneral"; + public static final String MSG_UNUSED_TAG_GENERAL = "javadoc.unusedTagGeneral"; /** Open angle bracket literal. */ private static final String OPEN_ANGLE_BRACKET = "<"; @@ -189,7 +189,7 @@ final int lineNo = ast.getLineNo(); final TextBlock textBlock = contents.getJavadocBefore(lineNo); if (textBlock == null) { - log(lineNo, JAVADOC_MISSING); + log(lineNo, MSG_JAVADOC_MISSING); } else { final List tags = getJavadocTags(textBlock); @@ -253,7 +253,7 @@ JavadocUtils.JavadocTagType.BLOCK); if (!allowUnknownTags) { for (final InvalidJavadocTag tag : tags.getInvalidTags()) { - log(tag.getLine(), tag.getCol(), UNKNOWN_TAG, + log(tag.getLine(), tag.getCol(), MSG_UNKNOWN_TAG, tag.getName()); } } @@ -281,12 +281,12 @@ if (tag.getTagName().equals(tagName)) { tagCount++; if (!formatPattern.matcher(tag.getFirstArg()).find()) { - log(lineNo, TAG_FORMAT, tagPrefix + tagName, format); + log(lineNo, MSG_TAG_FORMAT, tagPrefix + tagName, format); } } } if (tagCount == 0) { - log(lineNo, MISSING_TAG, tagPrefix + tagName); + log(lineNo, MSG_MISSING_TAG, tagPrefix + tagName); } } @@ -309,7 +309,7 @@ } } if (!found) { - log(lineNo, MISSING_TAG, JavadocTagInfo.PARAM.getText() + log(lineNo, MSG_MISSING_TAG, JavadocTagInfo.PARAM.getText() + " " + OPEN_ANGLE_BRACKET + typeParamName + CLOSE_ANGLE_BRACKET); } } @@ -332,7 +332,7 @@ final String typeParamName = matcher.group(1).trim(); if (!typeParamNames.contains(typeParamName)) { log(tag.getLineNo(), tag.getColumnNo(), - UNUSED_TAG, + MSG_UNUSED_TAG, JavadocTagInfo.PARAM.getText(), OPEN_ANGLE_BRACKET + typeParamName + CLOSE_ANGLE_BRACKET); } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -42,7 +42,7 @@ * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String JAVADOC_MISSING = "javadoc.missing"; + public static final String MSG_JAVADOC_MISSING = "javadoc.missing"; /** The scope to check. */ private Scope scope = Scope.PRIVATE; @@ -110,7 +110,7 @@ contents.getJavadocBefore(ast.getLineNo()); if (textBlock == null) { - log(ast, JAVADOC_MISSING); + log(ast, MSG_JAVADOC_MISSING); } } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/NonEmptyAtclauseDescriptionCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/NonEmptyAtclauseDescriptionCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/NonEmptyAtclauseDescriptionCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/NonEmptyAtclauseDescriptionCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -67,13 +67,13 @@ * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String SUMMARY_FIRST_SENTENCE = "summary.first.sentence"; + public static final String MSG_SUMMARY_FIRST_SENTENCE = "summary.first.sentence"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String SUMMARY_JAVADOC = "summary.javaDoc"; + public static final String MSG_SUMMARY_JAVADOC = "summary.javaDoc"; /** * This regexp is used to convert multiline javadoc to single line without stars. */ @@ -131,12 +131,14 @@ String firstSentence = getFirstSentence(ast); final int endOfSentence = firstSentence.lastIndexOf(period); if (endOfSentence == -1) { - log(ast.getLineNumber(), SUMMARY_FIRST_SENTENCE); + if (!firstSentence.trim().startsWith("{@inheritDoc}")) { + log(ast.getLineNumber(), MSG_SUMMARY_FIRST_SENTENCE); + } } else { firstSentence = firstSentence.substring(0, endOfSentence); if (containsForbiddenFragment(firstSentence)) { - log(ast.getLineNumber(), SUMMARY_JAVADOC); + log(ast.getLineNumber(), MSG_SUMMARY_JAVADOC); } } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/TagParser.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/TagParser.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/TagParser.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/TagParser.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/WriteTagCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/WriteTagCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/WriteTagCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/WriteTagCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -72,19 +72,19 @@ * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String MISSING_TAG = "type.missingTag"; + public static final String MSG_MISSING_TAG = "type.missingTag"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WRITE_TAG = "javadoc.writeTag"; + public static final String MSG_WRITE_TAG = "javadoc.writeTag"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String TAG_FORMAT = "type.tagFormat"; + public static final String MSG_TAG_FORMAT = "type.tagFormat"; /** Compiled regexp to match tag. **/ private Pattern tagRegExp; @@ -161,7 +161,7 @@ final TextBlock cmt = contents.getJavadocBefore(lineNo); if (cmt == null) { - log(lineNo, MISSING_TAG, tag); + log(lineNo, MSG_MISSING_TAG, tag); } else { checkTag(lineNo, cmt.getText()); @@ -190,12 +190,12 @@ logTag(lineNo + i - comment.length, tag, content); } else { - log(lineNo + i - comment.length, TAG_FORMAT, tag, tagFormat); + log(lineNo + i - comment.length, MSG_TAG_FORMAT, tag, tagFormat); } } } if (tagCount == 0) { - log(lineNo, MISSING_TAG, tag); + log(lineNo, MSG_MISSING_TAG, tag); } } @@ -213,7 +213,7 @@ final String originalSeverity = getSeverity(); setSeverity(tagSeverityLevel.getName()); - log(line, WRITE_TAG, tagName, tagValue); + log(line, MSG_WRITE_TAG, tagName, tagValue); setSeverity(originalSeverity); } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/LineSeparatorOption.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/LineSeparatorOption.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/LineSeparatorOption.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/LineSeparatorOption.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractClassCouplingCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractClassCouplingCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractClassCouplingCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractClassCouplingCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractComplexityCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractComplexityCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractComplexityCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractComplexityCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/BooleanExpressionComplexityCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/BooleanExpressionComplexityCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/BooleanExpressionComplexityCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/BooleanExpressionComplexityCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/JavaNCSSCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/JavaNCSSCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/JavaNCSSCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/JavaNCSSCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -339,7 +339,7 @@ * @return true if the expression is countable, false otherwise */ private static boolean isExpressionCountable(DetailAST ast) { - boolean countable; + final boolean countable; //count expressions only if they are direct child to a slist (method // body, for loop...) diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/NPathComplexityCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/NPathComplexityCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/NPathComplexityCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/NPathComplexityCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/modifier/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/modifier/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/modifier/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/modifier/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/modifier/RedundantModifierCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/modifier/RedundantModifierCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/modifier/RedundantModifierCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/modifier/RedundantModifierCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -256,13 +256,15 @@ final DetailAST classModifiers = parent.findFirstToken(TokenTypes.MODIFIERS); checkFinal = checkFinal || classModifiers.branchContains(TokenTypes.FINAL); - break; + parent = null; } - if (parent.getType() == TokenTypes.LITERAL_NEW) { + else if (parent.getType() == TokenTypes.LITERAL_NEW) { checkFinal = true; - break; + parent = null; + } + else { + parent = parent.getParent(); } - parent = parent.getParent(); } if (checkFinal && !isAnnotatedWithSafeVarargs(ast)) { DetailAST modifier = modifiers.getFirstChild(); diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractAccessControlNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractAccessControlNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractAccessControlNameCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractAccessControlNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -48,13 +48,13 @@ * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String ILLEGAL_ABSTRACT_CLASS_NAME = "illegal.abstract.class.name"; + public static final String MSG_ILLEGAL_ABSTRACT_CLASS_NAME = "illegal.abstract.class.name"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String NO_ABSTRACT_CLASS_MODIFIER = "no.abstract.class.modifier"; + public static final String MSG_NO_ABSTRACT_CLASS_MODIFIER = "no.abstract.class.modifier"; /** Whether to ignore checking the modifier. */ private boolean ignoreModifier; @@ -125,12 +125,12 @@ // if class has abstract modifier if (!ignoreName && !isMatchingClassName(className)) { log(ast.getLineNo(), ast.getColumnNo(), - ILLEGAL_ABSTRACT_CLASS_NAME, className, format); + MSG_ILLEGAL_ABSTRACT_CLASS_NAME, className, format); } } else if (!ignoreModifier && isMatchingClassName(className)) { log(ast.getLineNo(), ast.getColumnNo(), - NO_ABSTRACT_CLASS_MODIFIER, className); + MSG_NO_ABSTRACT_CLASS_MODIFIER, className); } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractNameCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractTypeParameterNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractTypeParameterNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractTypeParameterNameCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractTypeParameterNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/CatchParameterNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/CatchParameterNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/CatchParameterNameCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/CatchParameterNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ClassTypeParameterNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ClassTypeParameterNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ClassTypeParameterNameCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ClassTypeParameterNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ConstantNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ConstantNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ConstantNameCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ConstantNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalFinalVariableNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalFinalVariableNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalFinalVariableNameCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalFinalVariableNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodTypeParameterNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodTypeParameterNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodTypeParameterNameCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodTypeParameterNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/TypeNameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/TypeNameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/TypeNameCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/TypeNameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -32,6 +32,12 @@ * @author maxvetrenko */ public class OuterTypeFilenameCheck extends Check { + /** + * A key is pointing to the warning message text in "messages.properties" + * file. + */ + public static final String MSG_KEY = "type.file.mismatch"; + /** Pattern matching any file extension with dot included. */ private static final Pattern FILE_EXTENSION_PATTERN = Pattern.compile("\\.[^\\.]*$"); @@ -102,7 +108,7 @@ @Override public void finishTree(DetailAST rootAST) { if (!validFirst && !hasPublic && wrongType != null) { - log(wrongType.getLineNo(), "type.file.mismatch"); + log(wrongType.getLineNo(), MSG_KEY); } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/CommentSuppressor.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/CommentSuppressor.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/CommentSuppressor.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/CommentSuppressor.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/DetectorOptions.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/DetectorOptions.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/DetectorOptions.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/DetectorOptions.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/MatchSuppressor.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/MatchSuppressor.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/MatchSuppressor.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/MatchSuppressor.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/MultilineDetector.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/MultilineDetector.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/MultilineDetector.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/MultilineDetector.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -35,24 +35,24 @@ * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String REGEXP_EXCEEDED = "regexp.exceeded"; + public static final String MSG_REGEXP_EXCEEDED = "regexp.exceeded"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String REGEXP_MINIMUM = "regexp.minimum"; + public static final String MSG_REGEXP_MINIMUM = "regexp.minimum"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String EMPTY = "regexp.empty"; + public static final String MSG_EMPTY = "regexp.empty"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String STACKOVERFLOW = "regexp.StackOverflowError"; + public static final String MSG_STACKOVERFLOW = "regexp.StackOverflowError"; /** The detection options to use. */ private final DetectorOptions options; @@ -80,7 +80,7 @@ resetState(); if (Strings.isNullOrEmpty(options.getFormat())) { - options.getReporter().log(0, EMPTY); + options.getReporter().log(0, MSG_EMPTY); } else { matcher = options.getPattern().matcher(fileText.getFullText()); @@ -100,7 +100,7 @@ if (currentMatches > options.getMaximum()) { if (options.getMessage().isEmpty()) { options.getReporter().log(start.getLine(), - REGEXP_EXCEEDED, matcher.pattern().toString()); + MSG_REGEXP_EXCEEDED, matcher.pattern().toString()); } else { options.getReporter() @@ -115,7 +115,7 @@ // OK http://blog.igorminar.com/2008/05/catching-stackoverflowerror-and-bug-in.html // http://programmers.stackexchange.com/questions/ // 209099/is-it-ever-okay-to-catch-stackoverflowerror-in-java - options.getReporter().log(0, STACKOVERFLOW, matcher.pattern().toString()); + options.getReporter().log(0, MSG_STACKOVERFLOW, matcher.pattern().toString()); } } @@ -124,7 +124,7 @@ private void finish() { if (currentMatches < options.getMinimum()) { if (options.getMessage().isEmpty()) { - options.getReporter().log(0, REGEXP_MINIMUM, + options.getReporter().log(0, MSG_REGEXP_MINIMUM, options.getMinimum(), options.getFormat()); } else { diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/NeverSuppress.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/NeverSuppress.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/NeverSuppress.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/NeverSuppress.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpOnFilenameCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpOnFilenameCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpOnFilenameCheck.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpOnFilenameCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1,384 @@ +//////////////////////////////////////////////////////////////////////////////// +// checkstyle: Checks Java source code for adherence to a set of rules. +// Copyright (C) 2001-2016 the original author or authors. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//////////////////////////////////////////////////////////////////////////////// + +package com.puppycrawl.tools.checkstyle.checks.regexp; + +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.regex.Pattern; + +import com.google.common.io.Files; +import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck; +import com.puppycrawl.tools.checkstyle.api.CheckstyleException; +import com.puppycrawl.tools.checkstyle.utils.CommonUtils; + +/** + *

+ * Implementation of a check that looks for a file name and/or path match (or + * mis-match) against specified patterns. It can also be used to verify files + * match specific naming patterns not covered by other checks (Ex: properties, + * xml, etc.). + *

+ * + *

+ * When customizing the check, the properties are applied in a specific order. + * The fileExtensions property first picks only files that match any of the + * specific extensions supplied. Once files are matched against the + * fileExtensions, the match property is then used in conjuction with the + * patterns to determine if the check is looking for a match or mis-match on + * those files. If the fileNamePattern is supplied, the matching is only applied + * to the fileNamePattern and not the folderPattern. If no fileNamePattern is + * supplied, then matching is applied to the folderPattern only and will result + * in all files in a folder to be reported on violations. If no folderPattern is + * supplied, then all folders that checkstyle finds are examined for violations. + * The ignoreFileNameExtensions property drops the file extension and applies + * the fileNamePattern only to the rest of file name. For example, if the file + * is named 'test.java' and this property is turned on, the pattern is only + * applied to 'test'. + *

+ * + *

+ * If this check is configured with no properties, then the default behavior of + * this check is to report file names with spaces in them. When at least one + * pattern property is supplied, the entire check is under the user's control to + * allow them to fully customize the behavior. + *

+ * + *

+ * It is recommended that if you create your own pattern, to also specify a + * custom error message. This allows the error message printed to be clear what + * the violation is, especially if multiple RegexpOnFilename checks are used. + * Argument 0 for the message populates the check's folderPattern. Argument 1 + * for the message populates the check's fileNamePattern. The file name is not + * passed as an argument since it is part of CheckStyle's default error + * messages. + *

+ * + *

+ * Check have following options: + *

+ *
    + *
  • + * folderPattern - Regular expression to match the folder path against. Default + * value is null.
  • + * + *
  • + * fileNamePattern - Regular expression to match the file name against. Default + * value is null.
  • + * + *
  • + * match - Whether to look for a match or mis-match on the file name, if the + * fileNamePattern is supplied, otherwise it is applied on the folderPattern. + * Default value is true.
  • + * + *
  • + * ignoreFileNameExtensions - Whether to ignore the file extension for the file + * name match. Default value is false.
  • + * + *
  • + * fileExtensions - File type extension of files to process. If this is + * specified, then only files that match these types are examined with the other + * patterns. Default value is {}.
  • + *
+ *
+ * + *

+ * To configure the check to report file names that contain a space: + *

+ * + *
+ * <module name="RegexpOnFilename"/>
+ * 
+ *

+ * To configure the check to force picture files to not be 'gif': + *

+ * + *
+ * <module name="RegexpOnFilename">
+ *   <property name="fileNamePattern" value="\\.gif$"/>
+ * </module>
+ * 
+ *

+ * OR: + *

+ * + *
+ * <module name="RegexpOnFilename">
+ *   <property name="fileNamePattern" value="."/>
+ *   <property name="fileExtensions" value="gif"/>
+ * </module>
+ * 
+ * + *

+ * To configure the check to only allow property and xml files to be located in + * the resource folder: + *

+ * + *
+ * <module name="RegexpOnFilename">
+ *   <property name="folderPattern"
+ *     value="[\\/]src[\\/]\\w+[\\/]resources[\\/]"/>
+ *   <property name="match" value="false"/>
+ *   <property name="fileExtensions" value="properties, xml"/>
+ * </module>
+ * 
+ * + *

+ * To configure the check to only allow Java and XML files in your folders use + * the below. + *

+ * + *
+ * <module name="RegexpOnFilename">
+ *   <property name="fileNamePattern" value="\\.(java|xml)$"/>
+ *   <property name="match" value="false"/>
+ * </module>
+ * 
+ *

+ * To configure the check to only allow Java and XML files only in your source + * folder and ignore any other folders: + *

+ * + *

+ * Note: 'folderPattern' must be specified if checkstyle is analyzing + * more than the normal source folder, like the 'bin' folder where class files + * can be located. + *

+ * + *
+ * <module name="RegexpOnFilename">
+ *   <property name="folderPattern" value="[\\/]src[\\/]"/>
+ *   <property name="fileNamePattern" value="\\.(java|xml)$"/>
+ *   <property name="match" value="false"/>
+ * </module>
+ * 
+ *

+ * To configure the check to only allow file names to be camel case: + *

+ * + *
+ * <module name="RegexpOnFilename">
+ *   <property name="fileNamePattern"
+ *     value="^([A-Z][a-z0-9]+\.?)+$"/>
+ *   <property name="match" value="false"/>
+ *   <property name="ignoreFileNameExtensions" value="true"/>
+ * </module>
+ * 
+ * + * @author Richard Veach + */ +public class RegexpOnFilenameCheck extends AbstractFileSetCheck { + /** + * A key is pointing to the warning message text in "messages.properties" + * file. + */ + public static final String MSG_MATCH = "regexp.filename.match"; + /** + * A key is pointing to the warning message text in "messages.properties" + * file. + */ + public static final String MSG_MISMATCH = "regexp.filename.mismatch"; + + /** Compiled regexp to match a folder. */ + private Pattern folderPattern; + /** Compiled regexp to match a file. */ + private Pattern fileNamePattern; + /** Whether to look for a file name match or mismatch. */ + private boolean match = true; + /** Whether to ignore the file's extension when looking for matches. */ + private boolean ignoreFileNameExtensions; + + /** + * Setter for folder format. + * + * @param folderPattern format of folder. + * @throws org.apache.commons.beanutils.ConversionException if unable to + * create Pattern object. + */ + public void setFolderPattern(String folderPattern) { + this.folderPattern = CommonUtils.createPattern(folderPattern); + } + + /** + * Setter for file name format. + * + * @param fileNamePattern format of file. + * @throws org.apache.commons.beanutils.ConversionException if unable to + * create Pattern object. + */ + public void setFileNamePattern(String fileNamePattern) { + this.fileNamePattern = CommonUtils.createPattern(fileNamePattern); + } + + /** + * Sets whether the check should look for a file name match or mismatch. + * + * @param match check's option for matching file names. + */ + public void setMatch(boolean match) { + this.match = match; + } + + /** + * Sets whether file name matching should drop the file extension or not. + * + * @param ignoreFileNameExtensions check's option for ignoring file extension. + */ + public void setIgnoreFileNameExtensions(boolean ignoreFileNameExtensions) { + this.ignoreFileNameExtensions = ignoreFileNameExtensions; + } + + @Override + public void init() { + if (fileNamePattern == null && folderPattern == null) { + fileNamePattern = CommonUtils.createPattern("\\s"); + } + } + + @Override + protected void processFiltered(File file, List lines) throws CheckstyleException { + final String fileName = getFileName(file); + final String folderPath = getFolderPath(file); + + if (isMatchFolder(folderPath) && isMatchFile(fileName)) { + log(); + } + } + + /** + * Retrieves the file name from the given {@code file}. + * + * @param file Input file to examine. + * @return The file name. + */ + private String getFileName(File file) { + String fileName = file.getName(); + + if (ignoreFileNameExtensions) { + fileName = Files.getNameWithoutExtension(fileName); + } + + return fileName; + } + + /** + * Retrieves the folder path from the given {@code file}. + * + * @param file Input file to examine. + * @return The folder path. + * @throws CheckstyleException if there is an error getting the canonical + * path of the {@code file}. + */ + private static String getFolderPath(File file) throws CheckstyleException { + try { + return file.getParentFile().getCanonicalPath(); + } + catch (IOException ex) { + throw new CheckstyleException("unable to create canonical path names for " + + file.getAbsolutePath(), ex); + } + } + + /** + * Checks if the given {@code folderPath} matches the specified + * {@link #folderPattern}. + * + * @param folderPath Input folder path to examine. + * @return true if they do match. + */ + private boolean isMatchFolder(String folderPath) { + final boolean result; + + // null pattern always matches, regardless of value of 'match' + if (folderPattern == null) { + result = true; + } + else { + final boolean useMatch; + + // null pattern means 'match' applies to the folderPattern matching + if (fileNamePattern == null) { + useMatch = match; + } + else { + useMatch = true; + } + + result = folderPattern.matcher(folderPath).find() == useMatch; + } + + return result; + } + + /** + * Checks if the given {@code fileName} matches the specified + * {@link #fileNamePattern}. + * + * @param fileName Input file name to examine. + * @return true if they do match. + */ + private boolean isMatchFile(String fileName) { + final boolean result; + + // null pattern always matches, regardless of value of 'match' + if (fileNamePattern == null) { + result = true; + } + else { + result = fileNamePattern.matcher(fileName).find() == match; + } + + return result; + } + + /** Logs the errors for the check. */ + private void log() { + final String folder = getStringOrDefault(folderPattern, ""); + final String fileName = getStringOrDefault(fileNamePattern, ""); + + if (match) { + log(0, MSG_MATCH, folder, fileName); + } + else { + log(0, MSG_MISMATCH, folder, fileName); + } + } + + /** + * Retrieves the String form of the {@code pattern} or {@code defaultString} + * if null. + * + * @param pattern The pattern to convert. + * @param defaultString The result to use if {@code pattern} is null. + * @return The String form of the {@code pattern}. + */ + private static String getStringOrDefault(Pattern pattern, String defaultString) { + final String result; + + if (pattern == null) { + result = defaultString; + } + else { + result = pattern.toString(); + } + + return result; + } +} diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/SinglelineDetector.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/SinglelineDetector.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/SinglelineDetector.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/SinglelineDetector.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -27,6 +27,18 @@ * @author oliver */ class SinglelineDetector { + /** + * A key is pointing to the warning message text in "messages.properties" + * file. + */ + public static final String MSG_REGEXP_EXCEEDED = "regexp.exceeded"; + + /** + * A key is pointing to the warning message text in "messages.properties" + * file. + */ + public static final String MSG_REGEXP_MINIMUM = "regexp.minimum"; + /** The detection options to use. */ private final DetectorOptions options; /** Tracks the number of matches. */ @@ -58,7 +70,7 @@ private void finish() { if (currentMatches < options.getMinimum()) { if (options.getMessage().isEmpty()) { - options.getReporter().log(0, "regexp.minimum", + options.getReporter().log(0, MSG_REGEXP_MINIMUM, options.getMinimum(), options.getFormat()); } else { @@ -107,7 +119,7 @@ currentMatches++; if (currentMatches > options.getMaximum()) { if (options.getMessage().isEmpty()) { - options.getReporter().log(lineNo, "regexp.exceeded", + options.getReporter().log(lineNo, MSG_REGEXP_EXCEEDED, matcher.pattern().toString()); } else { diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolder.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolder.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolder.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolder.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -29,6 +29,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; +import com.puppycrawl.tools.checkstyle.api.AuditEvent; import com.puppycrawl.tools.checkstyle.api.Check; import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -142,16 +143,17 @@ /** * Checks for a suppression of a check with the given source name and * location in the last file processed. - * @param sourceName the source name of the check - * @param line the line number of the check - * @param column the column number of the check + * @param event audit event. * @return whether the check with the given name is suppressed at the given * source location */ - public static boolean isSuppressed(String sourceName, int line, - int column) { + public static boolean isSuppressed(AuditEvent event) { final List entries = ENTRIES.get(); + final String sourceName = event.getSourceName(); final String checkAlias = getAlias(sourceName); + final int line = event.getLine(); + final int column = event.getColumn(); + boolean suppressed = false; for (Entry entry : entries) { final boolean afterStart = entry.getFirstLine() < line @@ -164,11 +166,13 @@ final boolean nameMatches = ALL_WARNING_MATCHING_ID.equals(entry.getCheckName()) || entry.getCheckName().equalsIgnoreCase(checkAlias); - if (afterStart && beforeEnd && nameMatches) { - return true; + final boolean idMatches = event.getModuleId() != null + && event.getModuleId().equals(entry.getCheckName()); + if (afterStart && beforeEnd && (nameMatches || idMatches)) { + suppressed = true; } } - return false; + return suppressed; } @Override @@ -329,7 +333,7 @@ * @return returns ast - parent of given */ private static DetailAST getAcceptableParent(DetailAST child) { - DetailAST result; + final DetailAST result; final DetailAST parent = child.getParent(); switch (parent.getType()) { case TokenTypes.ANNOTATION_DEF: diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -166,8 +166,8 @@ for (Integer lineNo : lines) { final String line = getLines()[lineNo - 1]; - String lineBefore; - TextBlock comment; + final String lineBefore; + final TextBlock comment; if (cppComments.containsKey(lineNo)) { comment = cppComments.get(lineNo); lineBefore = line.substring(0, comment.getStartColNo()); @@ -197,7 +197,7 @@ * @return true if the comment if legal. */ private boolean isLegalComment(final TextBlock comment) { - boolean legal; + final boolean legal; // multi-line comment can not be legal if (legalComment == null || comment.getStartLineNo() != comment.getEndLineNo()) { diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -48,7 +48,7 @@ /** * Localization key for IO exception occurred on file open. */ - public static final String IO_EXCEPTION_KEY = "unable.open.cause"; + public static final String MSG_IO_EXCEPTION_KEY = "unable.open.cause"; /** * Pattern matching single space. @@ -77,7 +77,7 @@ } } catch (IOException ex) { - log(0, IO_EXCEPTION_KEY, file.getPath(), + log(0, MSG_IO_EXCEPTION_KEY, file.getPath(), ex.getLocalizedMessage()); } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/AbstractParenPadCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/AbstractParenPadCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/AbstractParenPadCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/AbstractParenPadCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -34,32 +34,32 @@ *

* @author Oliver Burn */ -abstract class AbstractParenPadCheck +public abstract class AbstractParenPadCheck extends Check { /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WS_FOLLOWED = "ws.followed"; + public static final String MSG_WS_FOLLOWED = "ws.followed"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WS_NOT_FOLLOWED = "ws.notFollowed"; + public static final String MSG_WS_NOT_FOLLOWED = "ws.notFollowed"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WS_PRECEDED = "ws.preceded"; + public static final String MSG_WS_PRECEDED = "ws.preceded"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WS_NOT_PRECEDED = "ws.notPreceded"; + public static final String MSG_WS_NOT_PRECEDED = "ws.notPreceded"; /** Open parenthesis literal. */ private static final char OPEN_PARENTHESIS = '('; @@ -94,12 +94,12 @@ if (after < line.length()) { if (option == PadOption.NOSPACE && Character.isWhitespace(line.charAt(after))) { - log(ast.getLineNo(), after, WS_FOLLOWED, OPEN_PARENTHESIS); + log(ast.getLineNo(), after, MSG_WS_FOLLOWED, OPEN_PARENTHESIS); } else if (option == PadOption.SPACE && !Character.isWhitespace(line.charAt(after)) && line.charAt(after) != CLOSE_PARENTHESIS) { - log(ast.getLineNo(), after, WS_NOT_FOLLOWED, OPEN_PARENTHESIS); + log(ast.getLineNo(), after, MSG_WS_NOT_FOLLOWED, OPEN_PARENTHESIS); } } } @@ -115,13 +115,13 @@ if (option == PadOption.NOSPACE && Character.isWhitespace(line.charAt(before)) && !CommonUtils.hasWhitespaceBefore(before, line)) { - log(ast.getLineNo(), before, WS_PRECEDED, CLOSE_PARENTHESIS); + log(ast.getLineNo(), before, MSG_WS_PRECEDED, CLOSE_PARENTHESIS); } else if (option == PadOption.SPACE && !Character.isWhitespace(line.charAt(before)) && line.charAt(before) != OPEN_PARENTHESIS) { log(ast.getLineNo(), ast.getColumnNo(), - WS_NOT_PRECEDED, CLOSE_PARENTHESIS); + MSG_WS_NOT_PRECEDED, CLOSE_PARENTHESIS); } } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForInitializerPadCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForInitializerPadCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForInitializerPadCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForInitializerPadCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForIteratorPadCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForIteratorPadCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForIteratorPadCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForIteratorPadCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -57,13 +57,13 @@ * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WS_FOLLOWED = "ws.followed"; + public static final String MSG_WS_FOLLOWED = "ws.followed"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WS_NOT_FOLLOWED = "ws.notFollowed"; + public static final String MSG_WS_NOT_FOLLOWED = "ws.notFollowed"; /** Semicolon literal. */ private static final String SEMICOLON = ";"; @@ -111,11 +111,11 @@ if (after < line.length()) { if (option == PadOption.NOSPACE && Character.isWhitespace(line.charAt(after))) { - log(semi.getLineNo(), after, WS_FOLLOWED, SEMICOLON); + log(semi.getLineNo(), after, MSG_WS_FOLLOWED, SEMICOLON); } else if (option == PadOption.SPACE && !Character.isWhitespace(line.charAt(after))) { - log(semi.getLineNo(), after, WS_NOT_FOLLOWED, SEMICOLON); + log(semi.getLineNo(), after, MSG_WS_NOT_FOLLOWED, SEMICOLON); } } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/FileTabCharacterCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/FileTabCharacterCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/FileTabCharacterCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/FileTabCharacterCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -34,13 +34,13 @@ * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String CONTAINS_TAB = "containsTab"; + public static final String MSG_CONTAINS_TAB = "containsTab"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String FILE_CONTAINS_TAB = "file.containsTab"; + public static final String MSG_FILE_CONTAINS_TAB = "file.containsTab"; /** Indicates whether to report once per file, or for each line. */ private boolean eachLine; @@ -53,10 +53,10 @@ final int tabPosition = line.indexOf('\t'); if (tabPosition != -1) { if (eachLine) { - log(lineNum, tabPosition + 1, CONTAINS_TAB); + log(lineNum, tabPosition + 1, MSG_CONTAINS_TAB); } else { - log(lineNum, tabPosition + 1, FILE_CONTAINS_TAB); + log(lineNum, tabPosition + 1, MSG_FILE_CONTAINS_TAB); break; } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/GenericWhitespaceCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/GenericWhitespaceCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/GenericWhitespaceCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/GenericWhitespaceCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -73,25 +73,25 @@ * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WS_PRECEDED = "ws.preceded"; + public static final String MSG_WS_PRECEDED = "ws.preceded"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WS_FOLLOWED = "ws.followed"; + public static final String MSG_WS_FOLLOWED = "ws.followed"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WS_NOT_PRECEDED = "ws.notPreceded"; + public static final String MSG_WS_NOT_PRECEDED = "ws.notPreceded"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WS_ILLEGAL_FOLLOW = "ws.illegalFollow"; + public static final String MSG_WS_ILLEGAL_FOLLOW = "ws.illegalFollow"; /** Open angle bracket literal. */ private static final String OPEN_ANGLE_BRACKET = "<"; @@ -151,7 +151,7 @@ if (before >= 0 && Character.isWhitespace(line.charAt(before)) && !CommonUtils.hasWhitespaceBefore(before, line)) { - log(ast.getLineNo(), before, WS_PRECEDED, CLOSE_ANGLE_BRACKET); + log(ast.getLineNo(), before, MSG_WS_PRECEDED, CLOSE_ANGLE_BRACKET); } if (after < line.length()) { @@ -186,14 +186,14 @@ if (indexOfAmp >= 0 && containsWhitespaceBetween(after, indexOfAmp, line)) { if (indexOfAmp - after == 0) { - log(ast.getLineNo(), after, WS_NOT_PRECEDED, "&"); + log(ast.getLineNo(), after, MSG_WS_NOT_PRECEDED, "&"); } else if (indexOfAmp - after != 1) { - log(ast.getLineNo(), after, WS_FOLLOWED, CLOSE_ANGLE_BRACKET); + log(ast.getLineNo(), after, MSG_WS_FOLLOWED, CLOSE_ANGLE_BRACKET); } } else if (line.charAt(after) == ' ') { - log(ast.getLineNo(), after, WS_FOLLOWED, CLOSE_ANGLE_BRACKET); + log(ast.getLineNo(), after, MSG_WS_FOLLOWED, CLOSE_ANGLE_BRACKET); } } @@ -212,11 +212,11 @@ // +--- whitespace not allowed if (isGenericBeforeMethod(ast)) { if (Character.isWhitespace(charAfter)) { - log(ast.getLineNo(), after, WS_FOLLOWED, CLOSE_ANGLE_BRACKET); + log(ast.getLineNo(), after, MSG_WS_FOLLOWED, CLOSE_ANGLE_BRACKET); } } else if (!isCharacterValidAfterGenericEnd(charAfter)) { - log(ast.getLineNo(), after, WS_ILLEGAL_FOLLOW, CLOSE_ANGLE_BRACKET); + log(ast.getLineNo(), after, MSG_WS_ILLEGAL_FOLLOW, CLOSE_ANGLE_BRACKET); } } @@ -266,19 +266,19 @@ || grandparent.getType() == TokenTypes.METHOD_DEF)) { // Require whitespace if (!Character.isWhitespace(line.charAt(before))) { - log(ast.getLineNo(), before, WS_NOT_PRECEDED, OPEN_ANGLE_BRACKET); + log(ast.getLineNo(), before, MSG_WS_NOT_PRECEDED, OPEN_ANGLE_BRACKET); } } // Whitespace not required else if (Character.isWhitespace(line.charAt(before)) && !CommonUtils.hasWhitespaceBefore(before, line)) { - log(ast.getLineNo(), before, WS_PRECEDED, OPEN_ANGLE_BRACKET); + log(ast.getLineNo(), before, MSG_WS_PRECEDED, OPEN_ANGLE_BRACKET); } } if (after < line.length() && Character.isWhitespace(line.charAt(after))) { - log(ast.getLineNo(), after, WS_FOLLOWED, OPEN_ANGLE_BRACKET); + log(ast.getLineNo(), after, MSG_WS_FOLLOWED, OPEN_ANGLE_BRACKET); } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/MethodParamPadCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/MethodParamPadCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/MethodParamPadCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/MethodParamPadCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -74,19 +74,19 @@ * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String LINE_PREVIOUS = "line.previous"; + public static final String MSG_LINE_PREVIOUS = "line.previous"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WS_PRECEDED = "ws.preceded"; + public static final String MSG_WS_PRECEDED = "ws.preceded"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WS_NOT_PRECEDED = "ws.notPreceded"; + public static final String MSG_WS_NOT_PRECEDED = "ws.notPreceded"; /** * Whether whitespace is allowed if the method identifier is at a @@ -136,18 +136,18 @@ final String line = getLines()[parenAST.getLineNo() - 1]; if (CommonUtils.hasWhitespaceBefore(parenAST.getColumnNo(), line)) { if (!allowLineBreaks) { - log(parenAST, LINE_PREVIOUS, parenAST.getText()); + log(parenAST, MSG_LINE_PREVIOUS, parenAST.getText()); } } else { final int before = parenAST.getColumnNo() - 1; if (option == PadOption.NOSPACE && Character.isWhitespace(line.charAt(before))) { - log(parenAST, WS_PRECEDED, parenAST.getText()); + log(parenAST, MSG_WS_PRECEDED, parenAST.getText()); } else if (option == PadOption.SPACE && !Character.isWhitespace(line.charAt(before))) { - log(parenAST, WS_NOT_PRECEDED, parenAST.getText()); + log(parenAST, MSG_WS_NOT_PRECEDED, parenAST.getText()); } } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoLineWrapCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoLineWrapCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoLineWrapCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoLineWrapCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -145,7 +145,7 @@ * @return node before ast. */ private static DetailAST getWhitespaceFollowedNode(DetailAST ast) { - DetailAST whitespaceFollowedAst; + final DetailAST whitespaceFollowedAst; switch (ast.getType()) { case TokenTypes.TYPECAST: whitespaceFollowedAst = ast.findFirstToken(TokenTypes.RPAREN); @@ -277,7 +277,7 @@ * @return previous node by text order. */ private static DetailAST getIndexOpPreviousElement(DetailAST ast) { - DetailAST result; + final DetailAST result; final DetailAST firstChild = ast.getFirstChild(); if (firstChild.getType() == TokenTypes.INDEX_OP) { // second or higher array index diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/OperatorWrapCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/OperatorWrapCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/OperatorWrapCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/OperatorWrapCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -99,13 +99,13 @@ * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String LINE_NEW = "line.new"; + public static final String MSG_LINE_NEW = "line.new"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String LINE_PREVIOUS = "line.previous"; + public static final String MSG_LINE_PREVIOUS = "line.previous"; /** The policy to enforce. */ private WrapOption option = WrapOption.NL; @@ -222,11 +222,11 @@ if (option == WrapOption.NL && !text.equals(currentLine.trim()) && StringUtils.isBlank(currentLine.substring(colNo + text.length()))) { - log(lineNo, colNo, LINE_NEW, text); + log(lineNo, colNo, MSG_LINE_NEW, text); } else if (option == WrapOption.EOL && CommonUtils.hasWhitespaceBefore(colNo - 1, currentLine)) { - log(lineNo, colNo, LINE_PREVIOUS, text); + log(lineNo, colNo, MSG_LINE_PREVIOUS, text); } } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/PadOption.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/PadOption.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/PadOption.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/PadOption.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/ParenPadCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/ParenPadCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/ParenPadCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/ParenPadCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SeparatorWrapCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SeparatorWrapCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SeparatorWrapCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SeparatorWrapCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -89,13 +89,13 @@ * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String LINE_PREVIOUS = "line.previous"; + public static final String MSG_LINE_PREVIOUS = "line.previous"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String LINE_NEW = "line.new"; + public static final String MSG_LINE_NEW = "line.new"; /** The policy to enforce. */ private WrapOption option = WrapOption.EOL; @@ -155,11 +155,11 @@ if (option == WrapOption.EOL && substringBeforeToken.isEmpty()) { - log(lineNo, colNo, LINE_PREVIOUS, text); + log(lineNo, colNo, MSG_LINE_PREVIOUS, text); } else if (option == WrapOption.NL && substringAfterToken.isEmpty()) { - log(lineNo, colNo, LINE_NEW, text); + log(lineNo, colNo, MSG_LINE_NEW, text); } } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/TypecastParenPadCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/TypecastParenPadCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/TypecastParenPadCheck.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/TypecastParenPadCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAfterCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAfterCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAfterCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAfterCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -61,13 +61,13 @@ * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WS_NOT_FOLLOWED = "ws.notFollowed"; + public static final String MSG_WS_NOT_FOLLOWED = "ws.notFollowed"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WS_TYPECAST = "ws.typeCast"; + public static final String MSG_WS_TYPECAST = "ws.typeCast"; @Override public int[] getDefaultTokens() { @@ -96,7 +96,7 @@ if (!isFollowedByWhitespace(targetAST, line)) { log(targetAST.getLineNo(), targetAST.getColumnNo() + targetAST.getText().length(), - WS_TYPECAST); + MSG_WS_TYPECAST); } } else { @@ -104,7 +104,7 @@ final Object[] message = {ast.getText()}; log(ast.getLineNo(), ast.getColumnNo() + ast.getText().length(), - WS_NOT_FOLLOWED, + MSG_WS_NOT_FOLLOWED, message); } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAroundCheck.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAroundCheck.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAroundCheck.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAroundCheck.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -152,13 +152,13 @@ * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WS_NOT_PRECEDED = "ws.notPreceded"; + public static final String MSG_WS_NOT_PRECEDED = "ws.notPreceded"; /** * A key is pointing to the warning message text in "messages.properties" * file. */ - public static final String WS_NOT_FOLLOWED = "ws.notFollowed"; + public static final String MSG_WS_NOT_FOLLOWED = "ws.notFollowed"; /** Whether or not empty constructor bodies are allowed. */ private boolean allowEmptyConstructors; @@ -355,7 +355,7 @@ if (before >= 0 && !Character.isWhitespace(line.charAt(before))) { log(ast.getLineNo(), ast.getColumnNo(), - WS_NOT_PRECEDED, ast.getText()); + MSG_WS_NOT_PRECEDED, ast.getText()); } if (after >= line.length()) { @@ -370,7 +370,7 @@ && !isAnonymousInnerClassEnd(currentType, nextChar)) { log(ast.getLineNo(), ast.getColumnNo() + ast.getText().length(), - WS_NOT_FOLLOWED, ast.getText()); + MSG_WS_NOT_FOLLOWED, ast.getText()); } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WrapOption.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WrapOption.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WrapOption.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WrapOption.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/DefaultConfiguration.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/DefaultConfiguration.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/DefaultConfiguration.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/DefaultConfiguration.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/DefaultContext.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/DefaultContext.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/DefaultContext.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/DefaultContext.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/DefaultLogger.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/DefaultLogger.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/DefaultLogger.java 2015-12-30 13:23:15.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/DefaultLogger.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -113,6 +113,8 @@ /** * Print an Emacs compliant line on the error stream. * If the column number is non zero, then also display it. + * + * @param event the event details * @see AuditListener **/ @Override diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/Definitions.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/Definitions.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/Definitions.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/Definitions.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/doclets/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/doclets/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/doclets/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/doclets/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/doclets/TokenTypesDoclet.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/doclets/TokenTypesDoclet.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/doclets/TokenTypesDoclet.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/doclets/TokenTypesDoclet.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/CsvFilter.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/CsvFilter.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/CsvFilter.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/CsvFilter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/IntFilter.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/IntFilter.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/IntFilter.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/IntFilter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/IntMatchFilter.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/IntMatchFilter.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/IntMatchFilter.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/IntMatchFilter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/IntRangeFilter.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/IntRangeFilter.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/IntRangeFilter.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/IntRangeFilter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/SeverityMatchFilter.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/SeverityMatchFilter.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/SeverityMatchFilter.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/SeverityMatchFilter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressElement.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressElement.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressElement.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressElement.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -451,6 +451,10 @@ match = messageMatcher.find(); } } + else if (event.getModuleId() != null) { + final Matcher idMatcher = tagCheckRegexp.matcher(event.getModuleId()); + match = idMatcher.find(); + } return match; } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilter.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilter.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilter.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,6 +19,10 @@ package com.puppycrawl.tools.checkstyle.filters; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.URL; import java.util.Objects; import com.puppycrawl.tools.checkstyle.api.AuditEvent; @@ -26,6 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import com.puppycrawl.tools.checkstyle.api.Filter; import com.puppycrawl.tools.checkstyle.api.FilterSet; +import com.puppycrawl.tools.checkstyle.utils.CommonUtils; /** *

@@ -33,21 +38,32 @@ * column, as specified in a suppression file. *

* @author Rick Giles + * @author liscju */ public class SuppressionFilter extends AutomaticBean implements Filter { + /** Filename of supression file. */ + private String file; + /** Tells whether config file existence is optional. */ + private boolean optional; /** Set of individual suppresses. */ private FilterSet filters = new FilterSet(); /** - * Loads the suppressions for a file. + * Sets name of the supression file. * @param fileName name of the suppressions file. - * @throws CheckstyleException if there is an error. */ - public void setFile(String fileName) - throws CheckstyleException { - filters = SuppressionsLoader.loadSuppressions(fileName); + public void setFile(String fileName) { + file = fileName; + } + + /** + * Sets whether config file existence is optional. + * @param optional tells if config file existence is optional. + */ + public void setOptional(boolean optional) { + this.optional = optional; } @Override @@ -71,4 +87,50 @@ public int hashCode() { return Objects.hash(filters); } + + @Override + protected void finishLocalSetup() throws CheckstyleException { + if (file != null) { + if (optional) { + if (suppressionSourceExists(file)) { + filters = SuppressionsLoader.loadSuppressions(file); + } + else { + filters = new FilterSet(); + } + } + else { + filters = SuppressionsLoader.loadSuppressions(file); + } + } + } + + /** + * Checks if suppression source with given fileName exists. + * @param fileName name of the suppressions file. + * @return true if suppression file exists, otherwise false + */ + private static boolean suppressionSourceExists(String fileName) { + boolean suppressionSourceExists = true; + InputStream sourceInput = null; + try { + final URI uriByFilename = CommonUtils.getUriByFilename(fileName); + final URL url = uriByFilename.toURL(); + sourceInput = url.openStream(); + } + catch (CheckstyleException | IOException ignored) { + suppressionSourceExists = false; + } + finally { + if (sourceInput != null) { + try { + sourceInput.close(); + } + catch (IOException ignored) { + suppressionSourceExists = false; + } + } + } + return suppressionSourceExists; + } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoader.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoader.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoader.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoader.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWarningsFilter.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWarningsFilter.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWarningsFilter.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWarningsFilter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -34,7 +34,6 @@ implements Filter { @Override public boolean accept(AuditEvent event) { - return !SuppressWarningsHolder.isSuppressed(event.getSourceName(), - event.getLine(), event.getColumn()); + return !SuppressWarningsHolder.isSuppressed(event); } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilter.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilter.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilter.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -415,7 +415,13 @@ if (tagMatcher.find()) { match = true; } - else if (tagMessageRegexp != null) { + else if (tagMessageRegexp == null) { + if (event.getModuleId() != null) { + final Matcher idMatcher = tagCheckRegexp.matcher(event.getModuleId()); + match = idMatcher.find(); + } + } + else { final Matcher messageMatcher = tagMessageRegexp.matcher(event.getMessage()); match = messageMatcher.find(); } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/grammars/CommentListener.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/grammars/CommentListener.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/grammars/CommentListener.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/grammars/CommentListener.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/grammars/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/grammars/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/grammars/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/grammars/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/BaseCellEditor.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/BaseCellEditor.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/BaseCellEditor.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/BaseCellEditor.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/CodeSelector.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/CodeSelector.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/CodeSelector.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/CodeSelector.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -72,7 +72,6 @@ editor.requestFocusInWindow(); editor.setCaretPosition(start); editor.moveCaretPosition(end); - editor.transferFocusBackward(); } /** diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/JTreeTable.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/JTreeTable.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/JTreeTable.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/JTreeTable.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -21,7 +21,9 @@ import java.awt.Component; import java.awt.Dimension; +import java.awt.FontMetrics; import java.awt.event.ActionEvent; +import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.EventObject; import java.util.List; @@ -37,6 +39,7 @@ import javax.swing.tree.TreePath; import com.google.common.collect.ImmutableList; +import com.google.common.primitives.Ints; import com.puppycrawl.tools.checkstyle.api.DetailAST; /** @@ -96,28 +99,79 @@ setRowHeight(getRowHeight()); } + setColumnsInitialWidth(); + final Action expand = new AbstractAction() { private static final long serialVersionUID = -5859674518660156121L; - @Override - public void actionPerformed(ActionEvent event) { - final TreePath selected = tree.getSelectionPath(); - final DetailAST ast = (DetailAST) selected.getLastPathComponent(); - new CodeSelector(ast, editor, linePositionMap).select(); - - if (tree.isExpanded(selected)) { - tree.collapsePath(selected); - } - else { - tree.expandPath(selected); - } - tree.setSelectionPath(selected); - } - }; + @Override + public void actionPerformed(ActionEvent event) { + doExpandByEnter(); + } + }; final KeyStroke stroke = KeyStroke.getKeyStroke("ENTER"); final String command = "expand/collapse"; getInputMap().put(stroke, command); getActionMap().put(command, expand); + + addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent event) { + if (event.getClickCount() == 2) { + makeCodeSelection(); + } + } + }); + } + + /** + * Do expansion of a tree node after pressing ENTER. + */ + private void doExpandByEnter() { + final TreePath selected = makeCodeSelection(); + + if (tree.isExpanded(selected)) { + tree.collapsePath(selected); + } + else { + tree.expandPath(selected); + } + tree.setSelectionPath(selected); + } + + /** + * Make selection of code in a text area. + * @return selected TreePath. + */ + private TreePath makeCodeSelection() { + final TreePath selected = tree.getSelectionPath(); + final DetailAST ast = (DetailAST) selected.getLastPathComponent(); + new CodeSelector(ast, editor, linePositionMap).select(); + return selected; + } + + /** + * Set initial value of width for columns in table. + */ + private void setColumnsInitialWidth() { + final FontMetrics fontMetrics = getFontMetrics(getFont()); + // Six character string to contain "Column" column. + final int widthOfSixCharacterString = fontMetrics.stringWidth("XXXXXX"); + // Padding must be added to width for columns to make them fully + // visible in table header. + final int padding = 10; + final int widthOfColumnContainingSixCharacterString = + widthOfSixCharacterString + padding; + getColumn("Line").setMaxWidth(widthOfColumnContainingSixCharacterString); + getColumn("Column").setMaxWidth(widthOfColumnContainingSixCharacterString); + final int preferredTreeColumnWidth = + Ints.checkedCast(Math.round(getPreferredSize().getWidth() * 0.6)); + getColumn("Tree").setPreferredWidth(preferredTreeColumnWidth); + // Twenty eight character string to contain "Type" column + final int widthOfTwentyEightCharacterString = + fontMetrics.stringWidth("XXXXXXXXXXXXXXXXXXXXXXXXXXXX"); + final int preferredTypeColumnWidth = widthOfTwentyEightCharacterString + padding; + getColumn("Type").setPreferredWidth(preferredTypeColumnWidth); } /** @@ -157,6 +211,8 @@ /** * Overridden to pass the new rowHeight to the tree. + * + * @param newRowHeight new row height */ @Override public final void setRowHeight(int newRowHeight) { @@ -223,6 +279,9 @@ *

By returning false we are also enforcing the policy that * the tree will never be editable (at least by a key sequence). * + * @param event the event the editor should use to consider + * whether to begin editing or not + * @return true if editing can be started * @see TableCellEditor */ @Override diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/ListToTreeSelectionModelWrapper.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/ListToTreeSelectionModelWrapper.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/ListToTreeSelectionModelWrapper.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/ListToTreeSelectionModelWrapper.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/MainFrame.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/MainFrame.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/MainFrame.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/MainFrame.java 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1,199 @@ +//////////////////////////////////////////////////////////////////////////////// +// checkstyle: Checks Java source code for adherence to a set of rules. +// Copyright (C) 2001-2016 the original author or authors. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//////////////////////////////////////////////////////////////////////////////// + +package com.puppycrawl.tools.checkstyle.gui; + +import java.awt.BorderLayout; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.KeyEvent; +import java.io.File; +import java.io.IOException; + +import javax.swing.AbstractAction; +import javax.swing.JButton; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JSplitPane; +import javax.swing.JTextArea; +import javax.swing.filechooser.FileFilter; + +import antlr.ANTLRException; +import com.puppycrawl.tools.checkstyle.api.DetailAST; + +/** + * Displays information about a parse tree. + * The user can change the file that is parsed and displayed + * using a JFileChooser. + * + * @author Lars Kühne + * @author Vladislav Lisetskiy + */ +public class MainFrame extends JFrame { + + private static final long serialVersionUID = 7970053543351871890L; + /** Checkstyle frame model. */ + private final transient MainFrameModel model = new MainFrameModel(); + /** Reload action. */ + private final ReloadAction reloadAction = new ReloadAction(); + /** Parse tree model. */ + private transient ParseTreeTableModel parseTreeTableModel; + /** Code text area. */ + private JTextArea textArea; + /** Tree table. */ + private JTreeTable treeTable; + + /** Create a new MainFrame. */ + public MainFrame() { + createContent(); + } + + /** Create content of this MainFrame. */ + private void createContent() { + setLayout(new BorderLayout()); + + textArea = new JTextArea(20, 15); + textArea.setEditable(false); + final JScrollPane textAreaScrollPane = new JScrollPane(textArea); + + parseTreeTableModel = new ParseTreeTableModel(null); + treeTable = new JTreeTable(parseTreeTableModel); + treeTable.setEditor(textArea); + treeTable.setLinePositionMap(model.getLinesToPosition()); + final JScrollPane treeTableScrollPane = new JScrollPane(treeTable); + + final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, treeTableScrollPane, + textAreaScrollPane); + add(splitPane, BorderLayout.CENTER); + splitPane.setResizeWeight(0.7); + + add(createButtonsPanel(), BorderLayout.PAGE_END); + + pack(); + } + + /** + * Create buttons panel. + * @return buttons panel. + */ + private JPanel createButtonsPanel() { + final JButton openFileButton = new JButton(new FileSelectionAction()); + openFileButton.setMnemonic(KeyEvent.VK_S); + openFileButton.setText("Open File"); + + reloadAction.setEnabled(false); + final JButton reloadFileButton = new JButton(reloadAction); + reloadFileButton.setMnemonic(KeyEvent.VK_R); + reloadFileButton.setText("Reload File"); + + final JPanel buttonPanel = new JPanel(); + buttonPanel.setLayout(new GridLayout(1, 2)); + buttonPanel.add(openFileButton); + buttonPanel.add(reloadFileButton); + + return buttonPanel; + } + + /** + * Open file and load it. + * @param sourceFile the file to open. + */ + public void openFile(File sourceFile) { + if (sourceFile != null) { + try { + setTitle("Checkstyle : " + sourceFile.getName()); + final DetailAST parseTree = model.parseFile(sourceFile); + parseTreeTableModel.setParseTree(parseTree); + reloadAction.setEnabled(true); + + final String[] sourceLines = model.getFileText(sourceFile).toLinesArray(); + + // clear for each new file + model.clearLinesToPosition(); + // starts line counting at 1 + model.addLineToPosition(0); + + // clean the text area before inserting the lines of the new file + textArea.setText(""); + + // insert the contents of the file to the text area + for (final String element : sourceLines) { + model.addLineToPosition(textArea.getText().length()); + textArea.append(element + System.lineSeparator()); + } + + treeTable.setLinePositionMap(model.getLinesToPosition()); + } + catch (final IOException | ANTLRException ex) { + JOptionPane.showMessageDialog(this, + "Could not parse" + sourceFile + ": " + ex.getMessage()); + } + } + } + + /** + * Handler for file selection action events. + */ + private class FileSelectionAction extends AbstractAction { + private static final long serialVersionUID = 1762396148873280589L; + + @Override + public void actionPerformed(ActionEvent event) { + final JFileChooser fileChooser = new JFileChooser(model.getLastDirectory()); + final FileFilter filter = new JavaFileFilter(); + fileChooser.setFileFilter(filter); + + final int returnCode = fileChooser.showOpenDialog(MainFrame.this); + if (returnCode == JFileChooser.APPROVE_OPTION) { + final File file = fileChooser.getSelectedFile(); + openFile(file); + } + } + } + + /** + * Handler for reload action events. + */ + private class ReloadAction extends AbstractAction { + private static final long serialVersionUID = -890320994114628011L; + + @Override + public void actionPerformed(ActionEvent event) { + openFile(model.getCurrentFile()); + } + } + + /** + * Filter for Java files. + */ + private static class JavaFileFilter extends FileFilter { + @Override + public boolean accept(File file) { + return file.isDirectory() || file.getName().endsWith(".java"); + } + + @Override + public String getDescription() { + return "Java Source File"; + } + } +} diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/MainFrameModel.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/MainFrameModel.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/MainFrameModel.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/MainFrameModel.java 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1,113 @@ +//////////////////////////////////////////////////////////////////////////////// +// checkstyle: Checks Java source code for adherence to a set of rules. +// Copyright (C) 2001-2016 the original author or authors. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//////////////////////////////////////////////////////////////////////////////// + +package com.puppycrawl.tools.checkstyle.gui; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import antlr.ANTLRException; + +import com.google.common.collect.ImmutableList; +import com.puppycrawl.tools.checkstyle.TreeWalker; +import com.puppycrawl.tools.checkstyle.api.DetailAST; +import com.puppycrawl.tools.checkstyle.api.FileContents; +import com.puppycrawl.tools.checkstyle.api.FileText; + +/** + * Model for checkstyle frame. + * @author Vladislav Lisetskiy + */ +public class MainFrameModel { + + /** Lines to position map. */ + private final List linesToPosition = new ArrayList<>(); + + /** The file which is being parsed. */ + private File currentFile; + + /** + * Parse a file and return the parse tree. + * @param file the file to parse. + * @return the root node of the parse tree. + * @throws IOException if the file could not be read. + * @throws ANTLRException if the file is not a Java source. + */ + public DetailAST parseFile(File file) throws IOException, ANTLRException { + currentFile = file; + final FileText text = getFileText(file); + final FileContents contents = new FileContents(text); + return TreeWalker.parse(contents); + } + + /** + * Get FileText from a file. + * @param file the file to get the FileText from. + * @return the FileText. + * @throws IOException if the file could not be read. + */ + public FileText getFileText(File file) throws IOException { + return new FileText(file.getAbsoluteFile(), + System.getProperty("file.encoding", "UTF-8")); + } + + /** + * Get the directory of the last loaded file. + * @return directory of the last loaded file. + */ + public File getLastDirectory() { + File lastDirectory = null; + if (currentFile != null) { + lastDirectory = new File(currentFile.getParent()); + } + return lastDirectory; + } + + /** + * Get current file. + * @return current file. + */ + public File getCurrentFile() { + return currentFile; + } + + /** + * Get lines to position map. + * @return lines to position map. + */ + public List getLinesToPosition() { + return ImmutableList.copyOf(linesToPosition); + } + + /** + * Add a new value into lines to position map. + * @param value Value to be added into position map. + */ + public void addLineToPosition(int value) { + linesToPosition.add(value); + } + + /** Clear lines to position map. */ + public void clearLinesToPosition() { + linesToPosition.clear(); + } + +} diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/Main.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/Main.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/Main.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/Main.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,14 +19,11 @@ package com.puppycrawl.tools.checkstyle.gui; -import java.awt.EventQueue; import java.io.File; -import javax.swing.JFrame; +import javax.swing.SwingUtilities; import javax.swing.WindowConstants; -import com.puppycrawl.tools.checkstyle.api.DetailAST; - /** * Entry point for starting the checkstyle GUI. * @@ -34,12 +31,6 @@ */ public final class Main { - /** Frame's name. */ - private static final String FRAME_NAME = "CheckStyle"; - - /** Main frame. */ - private static JFrame frame; - /** Hidden constructor of the current utility class. */ private Main() { // no code @@ -49,64 +40,20 @@ * Entry point. * @param args the command line arguments. */ - public static void main(String... args) { - frame = new JFrame(FRAME_NAME); - final ParseTreeInfoPanel panel = new ParseTreeInfoPanel(); - frame.getContentPane().add(panel); - if (args.length >= 1) { - final File file = new File(args[0]); - panel.openFile(file, frame); - } - frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); - - final Runnable runner = new FrameShower(frame); - EventQueue.invokeLater(runner); - } - - /** - * Method is used for testing in the past. - * @param ast tree to display - */ - public static void displayAst(DetailAST ast) { - final JFrame testFrame = new JFrame(FRAME_NAME); - final ParseTreeInfoPanel panel = new ParseTreeInfoPanel(); - testFrame.getContentPane().add(panel); - panel.openAst(ast); - testFrame.setSize(1500, 800); - testFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); - testFrame.setVisible(true); - } - - /** - * @return Main GUI's frame. - */ - static JFrame getFrame() { - return frame; - } - - /** - * Http://findbugs.sourceforge.net/bugDescriptions.html#SW_SWING_METHODS_INVOKED_IN_SWING_THREAD - */ - private static class FrameShower implements Runnable { - /** - * Frame. - */ - private final JFrame frame; - - /** - * @param frame JFrame component. - */ - FrameShower(JFrame frame) { - this.frame = frame; - } - - /** - * Display a frame. - */ - @Override - public void run() { - frame.pack(); - frame.setVisible(true); - } + public static void main(final String... args) { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + final MainFrame mainFrame = new MainFrame(); + + if (args.length > 0) { + final File sourceFile = new File(args[0]); + mainFrame.openFile(sourceFile); + } + mainFrame.setTitle("Checkstyle"); + mainFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + mainFrame.setVisible(true); + } + }); } } diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/ParseTreeInfoPanel.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/ParseTreeInfoPanel.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/ParseTreeInfoPanel.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/ParseTreeInfoPanel.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,317 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//////////////////////////////////////////////////////////////////////////////// - -package com.puppycrawl.tools.checkstyle.gui; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.GridLayout; -import java.awt.event.ActionEvent; -import java.awt.event.KeyEvent; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.JButton; -import javax.swing.JFileChooser; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; -import javax.swing.SwingUtilities; -import javax.swing.filechooser.FileFilter; - -import antlr.ANTLRException; - -import com.puppycrawl.tools.checkstyle.TreeWalker; -import com.puppycrawl.tools.checkstyle.api.DetailAST; -import com.puppycrawl.tools.checkstyle.api.FileContents; -import com.puppycrawl.tools.checkstyle.api.FileText; - -/** - * Displays information about a parse tree. - * The user can change the file that is parsed and displayed - * through a JFileChooser. - * - * @author Lars Kühne - */ -public class ParseTreeInfoPanel extends JPanel { - private static final long serialVersionUID = -4243405131202059043L; - - /** Parse tree model. */ - private final transient ParseTreeTableModel parseTreeTableModel; - /** JTextArea component. */ - private final JTextArea textArea; - /** Reload action. */ - private final ReloadAction reloadAction; - /** Lines to position map. */ - private final List linesToPosition = new ArrayList<>(); - /** Tree table. */ - private final JTreeTable treeTable; - /** Last directory. */ - private File lastDirectory; - /** Current file. */ - private File currentFile; - - /** - * Create a new ParseTreeInfoPanel instance. - */ - public ParseTreeInfoPanel() { - setLayout(new BorderLayout()); - - parseTreeTableModel = new ParseTreeTableModel(null); - treeTable = new JTreeTable(parseTreeTableModel); - final JScrollPane scrollPane = new JScrollPane(treeTable); - add(scrollPane, BorderLayout.PAGE_START); - - final JButton fileSelectionButton = - new JButton(new FileSelectionAction()); - - reloadAction = new ReloadAction(); - reloadAction.setEnabled(false); - final JButton reloadButton = new JButton(reloadAction); - - textArea = new JTextArea(20, 15); - textArea.setEditable(false); - treeTable.setEditor(textArea); - treeTable.setLinePositionMap(linesToPosition); - - final JScrollPane sp2 = new JScrollPane(textArea); - add(sp2, BorderLayout.CENTER); - - final JPanel pane = new JPanel(new GridLayout(1, 2)); - add(pane, BorderLayout.PAGE_END); - pane.add(fileSelectionButton); - pane.add(reloadButton); - - } - - /** - * Opens the input parse tree ast. - * @param parseTree DetailAST tree. - */ - public void openAst(DetailAST parseTree) { - parseTreeTableModel.setParseTree(parseTree); - reloadAction.setEnabled(true); - - // clear for each new file - clearLinesToPosition(); - // starts line counting at 1 - addLineToPosition(0); - // insert the contents of the file to the text area - - // clean the text area before inserting the lines of the new file - if (!textArea.getText().isEmpty()) { - textArea.replaceRange("", 0, textArea.getText().length()); - } - - // move back to the top of the file - textArea.moveCaretPosition(0); - } - - /** - * Opens file and loads it into text area. - * @param file File to open. - * @param parent Component for displaying errors if file can't be open. - */ - public void openFile(File file, final Component parent) { - if (file != null) { - try { - Main.getFrame().setTitle("Checkstyle : " + file.getName()); - final FileText text = new FileText(file.getAbsoluteFile(), - getEncoding()); - final DetailAST parseTree = parseFile(text); - parseTreeTableModel.setParseTree(parseTree); - currentFile = file; - lastDirectory = file.getParentFile(); - reloadAction.setEnabled(true); - - final String[] sourceLines = text.toLinesArray(); - - // clear for each new file - clearLinesToPosition(); - // starts line counting at 1 - addLineToPosition(0); - - //clean the text area before inserting the lines of the new file - if (!textArea.getText().isEmpty()) { - textArea.replaceRange("", 0, textArea.getText() - .length()); - } - - // insert the contents of the file to the text area - for (final String element : sourceLines) { - addLineToPosition(textArea.getText().length()); - textArea.append(element + System.lineSeparator()); - } - - // move back to the top of the file - textArea.moveCaretPosition(0); - treeTable.setLinePositionMap(linesToPosition); - } - catch (final IOException | ANTLRException ex) { - showErrorDialog( - parent, - "Could not parse" + file + ": " + ex.getMessage()); - } - } - } - - /** - * Parses a file and returns the parse tree. - * @param text the file to parse - * @return the root node of the parse tree - * @throws ANTLRException if the file is not a Java source - */ - private static DetailAST parseFile(FileText text) - throws ANTLRException { - final FileContents contents = new FileContents(text); - return TreeWalker.parse(contents); - } - - /** - * Returns the configured file encoding. - * This can be set using the {@code file.encoding} system property. - * It defaults to UTF-8. - * @return the configured file encoding - */ - private static String getEncoding() { - return System.getProperty("file.encoding", "UTF-8"); - } - - /** - * Opens dialog with error. - * @param parent Component for displaying errors. - * @param msg Error message to display. - */ - private static void showErrorDialog(final Component parent, final String msg) { - final Runnable showError = new FrameShower(parent, msg); - SwingUtilities.invokeLater(showError); - } - - /** - * Adds a new value into lines to position map. - * @param value Value to be added into position map. - */ - private void addLineToPosition(int value) { - linesToPosition.add(value); - } - - /** Clears lines to position map. */ - private void clearLinesToPosition() { - linesToPosition.clear(); - } - - /** - * Http://findbugs.sourceforge.net/bugDescriptions.html#SW_SWING_METHODS_INVOKED_IN_SWING_THREAD - */ - private static class FrameShower implements Runnable { - /** - * Frame. - */ - private final Component parent; - - /** - * Frame. - */ - private final String msg; - - /** - * @param parent Frame's component. - * @param msg Message to show. - */ - FrameShower(Component parent, final String msg) { - this.parent = parent; - this.msg = msg; - } - - /** - * Display a frame. - */ - @Override - public void run() { - JOptionPane.showMessageDialog(parent, msg); - } - } - - /** - * Filter for Java files. - */ - private static class JavaFileFilter extends FileFilter { - @Override - public boolean accept(File file) { - return file != null && (file.isDirectory() || file.getName().endsWith(".java")); - } - - @Override - public String getDescription() { - return "Java Source Code"; - } - } - - /** - * Handler for file selection action events. - */ - private class FileSelectionAction extends AbstractAction { - private static final long serialVersionUID = -1926935338069418119L; - - /** Default constructor to setup current action. */ - FileSelectionAction() { - super("Select Java File"); - putValue(Action.MNEMONIC_KEY, KeyEvent.VK_S); - } - - @Override - public void actionPerformed(ActionEvent event) { - final JFileChooser chooser = new JFileChooser(lastDirectory); - final FileFilter filter = new JavaFileFilter(); - chooser.setFileFilter(filter); - final Component parent = - SwingUtilities.getRoot(ParseTreeInfoPanel.this); - chooser.showDialog(parent, "Open"); - final File file = chooser.getSelectedFile(); - openFile(file, parent); - - } - } - - /** - * Handler for reload action events. - */ - private class ReloadAction extends AbstractAction { - private static final long serialVersionUID = -1021880396046355863L; - - /** Default constructor to setup current action. */ - ReloadAction() { - super("Reload Java File"); - putValue(Action.MNEMONIC_KEY, KeyEvent.VK_R); - } - - @Override - public void actionPerformed(ActionEvent event) { - final Component parent = - SwingUtilities.getRoot(ParseTreeInfoPanel.this); - openFile(currentFile, parent); - } - } - -} diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/ParseTreeTableModel.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/ParseTreeTableModel.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/ParseTreeTableModel.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/ParseTreeTableModel.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -104,7 +104,7 @@ * @return the type for column number {@code column}. */ public Class getColumnClass(int column) { - Class columnClass; + final Class columnClass; switch (column) { case 0: @@ -136,7 +136,7 @@ */ public Object getValueAt(Object node, int column) { final DetailAST ast = (DetailAST) node; - Object value; + final Object value; switch (column) { case 1: diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/TreeTableCellRenderer.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/TreeTableCellRenderer.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/TreeTableCellRenderer.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/TreeTableCellRenderer.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -81,6 +81,8 @@ /** * Sets the row height of the tree, and forwards the row height to * the table. + * + * @param newRowHeight the height of each cell, in pixels */ @Override public void setRowHeight(int newRowHeight) { @@ -95,6 +97,11 @@ /** * This is overridden to set the height to match that of the JTable. + * + * @param x the new x-coordinate of this component + * @param y the new y-coordinate of this component + * @param w the new width of this component + * @param h the new height of this component */ @Override public void setBounds(int x, int y, int w, int h) { @@ -104,6 +111,8 @@ /** * Subclassed to translate the graphics such that the last visible * row will be drawn at 0,0. + * + * @param graph the Graphics context in which to paint */ @Override public void paint(Graphics graph) { @@ -113,6 +122,16 @@ /** * TreeCellRenderer method. Overridden to update the visible row. + * + * @param table the JTable that is asking the + * renderer to draw; can be null + * @param value the value of the cell to be rendered. + * @param isSelected true if the cell is to be rendered with the + * selection highlighted; otherwise false + * @param hasFocus if true, render cell appropriately. + * @param row the row index of the cell being drawn. + * @param column the column index of the cell being drawn + * @return The component used for drawing the cell. * @see TableCellRenderer */ @Override diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/TreeTableModelAdapter.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/TreeTableModelAdapter.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/gui/TreeTableModelAdapter.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/gui/TreeTableModelAdapter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/Main.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/Main.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/Main.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/Main.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -324,8 +324,8 @@ throws FileNotFoundException { // setup the output stream - OutputStream out; - boolean closeOutputStream; + final OutputStream out; + final boolean closeOutputStream; if (outputLocation == null) { out = System.out; closeOutputStream = false; @@ -336,7 +336,7 @@ } // setup a listener - AuditListener listener; + final AuditListener listener; if (XML_FORMAT_NAME.equals(format)) { listener = new XMLLogger(out, closeOutputStream); diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/ModuleFactory.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/ModuleFactory.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/ModuleFactory.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/ModuleFactory.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/PackageNamesLoader.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/PackageNamesLoader.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/PackageNamesLoader.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/PackageNamesLoader.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/PackageObjectFactory.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/PackageObjectFactory.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/PackageObjectFactory.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/PackageObjectFactory.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/PropertiesExpander.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/PropertiesExpander.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/PropertiesExpander.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/PropertiesExpander.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/PropertyCacheFile.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/PropertyCacheFile.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/PropertyCacheFile.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/PropertyCacheFile.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/PropertyResolver.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/PropertyResolver.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/PropertyResolver.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/PropertyResolver.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -327,7 +327,7 @@ */ private void notifyBegin(DetailAST rootAST, FileContents contents, AstState astState) { - Set checks; + final Set checks; if (astState == AstState.WITH_COMMENTS) { checks = commentChecks; @@ -348,7 +348,7 @@ * @param astState state of AST. */ private void notifyEnd(DetailAST rootAST, AstState astState) { - Set checks; + final Set checks; if (astState == AstState.WITH_COMMENTS) { checks = commentChecks; diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtility.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtility.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtility.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtility.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/utils/BlockCommentPosition.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/utils/BlockCommentPosition.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/utils/BlockCommentPosition.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/utils/BlockCommentPosition.java 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1,217 @@ +//////////////////////////////////////////////////////////////////////////////// +// checkstyle: Checks Java source code for adherence to a set of rules. +// Copyright (C) 2001-2016 the original author or authors. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//////////////////////////////////////////////////////////////////////////////// + +package com.puppycrawl.tools.checkstyle.utils; + +import com.puppycrawl.tools.checkstyle.api.DetailAST; +import com.puppycrawl.tools.checkstyle.api.TokenTypes; + +/** + * Utility class that has methods to check javadoc comment position in java file. + * @author bizmailov + * + */ +public final class BlockCommentPosition { + + /** + * Forbid new instances. + */ + private BlockCommentPosition() { + } + + /** + * Node is on class definition. + * @param blockComment DetailAST + * @return true if node is before class + */ + public static boolean isOnClass(DetailAST blockComment) { + return isOnPlainToken(blockComment, TokenTypes.CLASS_DEF, TokenTypes.LITERAL_CLASS) + || isOnTokenWithModifiers(blockComment, TokenTypes.CLASS_DEF) + || isOnTokenWithAnnotation(blockComment, TokenTypes.CLASS_DEF); + } + + /** + * Node is on interface definition. + * @param blockComment DetailAST + * @return true if node is before interface + */ + public static boolean isOnInterface(DetailAST blockComment) { + return isOnPlainToken(blockComment, TokenTypes.INTERFACE_DEF, TokenTypes.LITERAL_INTERFACE) + || isOnTokenWithModifiers(blockComment, TokenTypes.INTERFACE_DEF) + || isOnTokenWithAnnotation(blockComment, TokenTypes.INTERFACE_DEF); + } + + /** + * Node is on enum definition. + * @param blockComment DetailAST + * @return true if node is before enum + */ + public static boolean isOnEnum(DetailAST blockComment) { + return isOnPlainToken(blockComment, TokenTypes.ENUM_DEF, TokenTypes.ENUM) + || isOnTokenWithModifiers(blockComment, TokenTypes.ENUM_DEF) + || isOnTokenWithAnnotation(blockComment, TokenTypes.ENUM_DEF); + } + + /** + * Node is on annotation definition. + * @param blockComment DetailAST + * @return true if node is before annotation + */ + public static boolean isOnAnnotationDef(DetailAST blockComment) { + return isOnPlainToken(blockComment, TokenTypes.ANNOTATION_DEF, TokenTypes.AT) + || isOnTokenWithModifiers(blockComment, TokenTypes.ANNOTATION_DEF) + || isOnTokenWithAnnotation(blockComment, TokenTypes.ANNOTATION_DEF); + } + + /** + * Node is on method declaration. + * @param blockComment DetailAST + * @return true if node is before method + */ + public static boolean isOnMethod(DetailAST blockComment) { + return isOnPlainClassMember(blockComment, TokenTypes.METHOD_DEF) + || isOnTokenWithModifiers(blockComment, TokenTypes.METHOD_DEF) + || isOnTokenWithAnnotation(blockComment, TokenTypes.METHOD_DEF); + } + + /** + * Node is on field declaration. + * @param blockComment DetailAST + * @return true if node is before field + */ + public static boolean isOnField(DetailAST blockComment) { + return isOnPlainClassMember(blockComment, TokenTypes.VARIABLE_DEF) + || isOnTokenWithModifiers(blockComment, TokenTypes.VARIABLE_DEF) + || isOnTokenWithAnnotation(blockComment, TokenTypes.VARIABLE_DEF); + } + + /** + * Node is on constructor. + * @param blockComment DetailAST + * @return true if node is before constructor + */ + public static boolean isOnConstructor(DetailAST blockComment) { + return isOnPlainToken(blockComment, TokenTypes.CTOR_DEF, TokenTypes.IDENT) + || isOnTokenWithModifiers(blockComment, TokenTypes.CTOR_DEF) + || isOnTokenWithAnnotation(blockComment, TokenTypes.CTOR_DEF); + } + + /** + * Node is on enum constant. + * @param blockComment DetailAST + * @return true if node is before enum constant + */ + public static boolean isOnEnumConstant(DetailAST blockComment) { + final boolean isOnPlainConst = blockComment.getParent() != null + && blockComment.getParent().getType() == TokenTypes.ENUM_CONSTANT_DEF + && getPrevSiblingSkipComments(blockComment).getType() == TokenTypes.ANNOTATIONS + && getPrevSiblingSkipComments(blockComment).getChildCount() == 0; + final boolean isOnConstWithAnnotation = !isOnPlainConst && blockComment.getParent() != null + && blockComment.getParent().getType() == TokenTypes.ANNOTATION + && blockComment.getParent().getParent().getParent().getType() + == TokenTypes.ENUM_CONSTANT_DEF; + return isOnPlainConst || isOnConstWithAnnotation; + } + + /** + * Checks that block comment is on specified token without any modifiers. + * @param blockComment block comment start DetailAST + * @param parentTokenType parent token type + * @param nextTokenType next token type + * @return true if block comment is on specified token without modifiers + */ + private static boolean isOnPlainToken(DetailAST blockComment, + int parentTokenType, int nextTokenType) { + return blockComment.getParent() != null + && blockComment.getParent().getType() == parentTokenType + && getPrevSiblingSkipComments(blockComment).getChildCount() == 0 + && getNextSiblingSkipComments(blockComment).getType() == nextTokenType; + } + + /** + * Checks that block comment is on specified token with modifiers. + * @param blockComment block comment start DetailAST + * @param tokenType parent token type + * @return true if block comment is on specified token with modifiers + */ + private static boolean isOnTokenWithModifiers(DetailAST blockComment, int tokenType) { + return blockComment.getParent() != null + && blockComment.getParent().getType() == TokenTypes.MODIFIERS + && blockComment.getParent().getParent().getType() == tokenType + && getPrevSiblingSkipComments(blockComment) == null; + } + + /** + * Checks that block comment is on specified token with annotation. + * @param blockComment block comment start DetailAST + * @param tokenType parent token type + * @return true if block comment is on specified token with annotation + */ + private static boolean isOnTokenWithAnnotation(DetailAST blockComment, int tokenType) { + return blockComment.getParent() != null + && blockComment.getParent().getType() == TokenTypes.ANNOTATION + && getPrevSiblingSkipComments(blockComment.getParent()) == null + && blockComment.getParent().getParent().getType() == TokenTypes.MODIFIERS + && blockComment.getParent().getParent().getParent().getType() == tokenType + && getPrevSiblingSkipComments(blockComment) == null; + } + + /** + * Checks that block comment is on specified class member without any modifiers. + * @param blockComment block comment start DetailAST + * @param memberType parent token type + * @return true if block comment is on specified token without modifiers + */ + private static boolean isOnPlainClassMember(DetailAST blockComment, int memberType) { + return blockComment.getParent() != null + && blockComment.getParent().getType() == TokenTypes.TYPE + && blockComment.getParent().getParent().getType() == memberType + // previous parent sibling is always TokenTypes.MODIFIERS + && blockComment.getParent().getPreviousSibling().getChildCount() == 0; + } + + /** + * Get next sibling node skipping any comment nodes. + * @param node current node + * @return next sibling + */ + private static DetailAST getNextSiblingSkipComments(DetailAST node) { + DetailAST result = node.getNextSibling(); + while (result.getType() == TokenTypes.SINGLE_LINE_COMMENT + || result.getType() == TokenTypes.BLOCK_COMMENT_BEGIN) { + result = result.getNextSibling(); + } + return result; + } + + /** + * Get previous sibling node skipping any comments. + * @param node current node + * @return previous sibling + */ + private static DetailAST getPrevSiblingSkipComments(DetailAST node) { + DetailAST result = node.getPreviousSibling(); + while (result != null + && (result.getType() == TokenTypes.SINGLE_LINE_COMMENT + || result.getType() == TokenTypes.BLOCK_COMMENT_BEGIN)) { + result = result.getPreviousSibling(); + } + return result; + } +} diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/utils/CheckUtils.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/utils/CheckUtils.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/utils/CheckUtils.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/utils/CheckUtils.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/utils/CommonUtils.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/utils/CommonUtils.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/utils/CommonUtils.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/utils/CommonUtils.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtils.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtils.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtils.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtils.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -439,7 +439,7 @@ * @return name, of the javadocTagSection's tag. */ public static String getTagName(DetailNode javadocTagSection) { - String javadocTagName; + final String javadocTagName; if (javadocTagSection.getType() == JavadocTokenTypes.JAVADOC_INLINE_TAG) { javadocTagName = getNextSibling( getFirstChild(javadocTagSection)).getText(); diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/utils/package-info.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/utils/package-info.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/utils/package-info.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/utils/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtils.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtils.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtils.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtils.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/utils/TokenUtils.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/utils/TokenUtils.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/utils/TokenUtils.java 2015-12-29 16:38:36.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/utils/TokenUtils.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/XMLLogger.java checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/XMLLogger.java --- checkstyle-6.14.1/src/main/java/com/puppycrawl/tools/checkstyle/XMLLogger.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/java/com/puppycrawl/tools/checkstyle/XMLLogger.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -225,7 +225,7 @@ */ private static String encodeAmpersand(String value, int ampPosition) { final int nextSemi = value.indexOf(';', ampPosition); - String result; + final String result; if (nextSemi < 0 || !isReference(value.substring(ampPosition, nextSemi + 1))) { result = "&"; diff -Nru checkstyle-6.14.1/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_de.properties checkstyle-6.15/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_de.properties --- checkstyle-6.14.1/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_de.properties 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_de.properties 2016-01-30 23:19:28.000000000 +0000 @@ -5,3 +5,6 @@ duplicate.regexp=Duplikat gefunden nach dem Muster ''{0}''. regexp.empty = Leer (null) Muster. regexp.StackOverflowError = java.util.regex.Matcher verursachte eine java.lang.StackOverflowError für Muster ''{1}'' (Sie werden das Scannen eines Binär-Datei anstelle von Text?). + +regexp.filename.match=Datei- Spiel Ordner Muster ''{0}'' und Dateimuster ''{1}''. +regexp.filename.mismatch=Datei nicht übereinstimmen Ordner Muster ''{0}'' und Dateimuster ''{1}''. diff -Nru checkstyle-6.14.1/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_es.properties checkstyle-6.15/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_es.properties --- checkstyle-6.14.1/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_es.properties 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_es.properties 2016-01-30 23:19:28.000000000 +0000 @@ -5,3 +5,6 @@ duplicate.regexp = Encontrado patrón duplicado ''{0}''. regexp.empty = Vacío (nulo) patrón. regexp.StackOverflowError = java.util.regex.Matcher causó una java.lang.StackOverflowError para el patrón ''{1}'' (se le puede escanear un archivo binario en lugar de texto?). + +regexp.filename.match=Archivo patrón carpeta partido ''{0}'' y el archivo de patrón ''{1}''. +regexp.filename.mismatch=Archivo no coincida con el patrón carpeta ''{0}'' y archivo de patrones ''{1}''. diff -Nru checkstyle-6.14.1/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_fi.properties checkstyle-6.15/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_fi.properties --- checkstyle-6.14.1/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_fi.properties 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_fi.properties 2016-01-30 23:19:28.000000000 +0000 @@ -6,3 +6,5 @@ regexp.empty = Tyhjä (null) kuvio. regexp.StackOverflowError = java.util.regex.Matcher aiheutti java.lang.StackOverflowError lauseketta ''{1}'' (saatat olla skannaus binaaritiedoston tekstin sijasta?). +regexp.filename.match=Tiedoston ottelu kansio malli ''{0}'' ja tiedostojen malli ''{1}''. +regexp.filename.mismatch=Tiedostoa ei vastaa kansiota mallia ''{0}'' ja tiedostojen malli ''{1}''. diff -Nru checkstyle-6.14.1/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_fr.properties checkstyle-6.15/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_fr.properties --- checkstyle-6.14.1/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_fr.properties 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_fr.properties 2016-01-30 23:19:28.000000000 +0000 @@ -5,3 +5,6 @@ duplicate.regexp = Trouvé modèle double ''{0}''. regexp.empty = Vide (null) motif. regexp.StackOverflowError = java.util.regex.Matcher provoqué une java.lang.StackOverflowError pour le modèle ''{1}'' (vous pouvez numériser un fichier binaire au lieu du texte?). + +regexp.filename.match=Fichier dossier de match de modèle ''{0}'' et le fichier modèle ''{1}''. +regexp.filename.mismatch=Fichier non correspondre dossier motif ''{0}'' et le fichier modèle ''{1}''. diff -Nru checkstyle-6.14.1/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_ja.properties checkstyle-6.15/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_ja.properties --- checkstyle-6.14.1/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_ja.properties 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_ja.properties 2016-01-30 23:19:28.000000000 +0000 @@ -5,3 +5,6 @@ duplicate.regexp = 見ã¤ã‹ã£ãŸé‡è¤‡ãƒ‘ターン ''{0}''。 regexp.empty = 空(NULL)ã®ãƒ‘ターン。 regexp.StackOverflowError = java.util.regex.Matcherã¯ã€ãƒ‘ターンã®ãŸã‚java.lang.StackOverflowErrorã‚’ ã«èµ·å›  ''{1}''(ã‚ãªãŸãŒãƒ†ã‚­ã‚¹ãƒˆã®ä»£ã‚ã‚Šã«ãƒã‚¤ãƒŠãƒªãƒ•ã‚¡ã‚¤ãƒ«ã‚’スキャンã—ã¦ã„ã‚‹å¯èƒ½æ€§ãŒã‚ã‚Šã¾ã™ã‹ï¼Ÿï¼‰ã€‚ + +regexp.filename.match=ファイルã®ãƒžãƒƒãƒãƒ•ã‚©ãƒ«ãƒ€ãƒ‘ターン ''{0}'' ã¨ãƒ•ã‚¡ã‚¤ãƒ«ãƒ‘ターン ''{1}''。 +regexp.filename.mismatch=フォルダパターン ''{0}'' ã¨ãƒ•ã‚¡ã‚¤ãƒ«ãƒ‘ターン'ã¨ä¸€è‡´ã—ã¾ã›ãƒ•ã‚¡ã‚¤ãƒ« ''{1}''。 diff -Nru checkstyle-6.14.1/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages.properties checkstyle-6.15/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages.properties --- checkstyle-6.14.1/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages.properties 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages.properties 2016-01-30 23:19:28.000000000 +0000 @@ -8,3 +8,5 @@ regexp.empty=Empty (null) pattern. regexp.StackOverflowError=java.util.regex.Matcher caused a java.lang.StackOverflowError for pattern ''{1}'' (you may be scanning a binary file instead of text?). +regexp.filename.match=File match folder pattern ''{0}'' and file pattern ''{1}''. +regexp.filename.mismatch=File not match folder pattern ''{0}'' and file pattern ''{1}''. diff -Nru checkstyle-6.14.1/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_pt.properties checkstyle-6.15/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_pt.properties --- checkstyle-6.14.1/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_pt.properties 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_pt.properties 2016-01-30 23:19:28.000000000 +0000 @@ -5,3 +5,6 @@ duplicate.regexp = Encontrado padrão duplicado ''{0}''. regexp.empty = Empty (null) padrão. regexp.StackOverflowError = java.util.regex.Matcher causou uma java.lang.StackOverflowError para o padrão ''{1}'' (você pode estar verificando um arquivo binário em vez de texto?). + +regexp.filename.match=Arquivo padrão pasta jogo ''{0}'' e arquivo padrão ''{1}''. +regexp.filename.mismatch=Arquivo não correspondem ao padrão pasta ''{0}'' e arquivo padrão ''{1}''. diff -Nru checkstyle-6.14.1/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_tr.properties checkstyle-6.15/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_tr.properties --- checkstyle-6.14.1/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_tr.properties 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/main/resources/com/puppycrawl/tools/checkstyle/checks/regexp/messages_tr.properties 2016-01-30 23:19:28.000000000 +0000 @@ -5,3 +5,6 @@ duplicate.regexp = Tekrarlanmýþbir kalıp bulundu: ''{0}''. regexp.empty = BoÅŸ (null) desen. regexp.StackOverflowError = java.util.regex.Matcher model için bir java.lang.StackOverflowError neden ''{1}'' (metin yerine bir ikili dosya tarıyor olabilir?). + +regexp.filename.match=Dosya maç klasör model ''{0}'' ve dosya deseni ''{1}''. +regexp.filename.mismatch=Klasör deseni ''{0}'' ve dosya deseni ' eÅŸleÅŸmiyor Dosya ''{1}''. diff -Nru checkstyle-6.14.1/src/main/resources/google_checks.xml checkstyle-6.15/src/main/resources/google_checks.xml --- checkstyle-6.14.1/src/main/resources/google_checks.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/main/resources/google_checks.xml 2016-01-30 23:19:28.000000000 +0000 @@ -128,6 +128,11 @@ + + + + =\\d+)|(\\d+(,\\d+)*?))( warn)?)"); + Pattern.compile(".*?(//indent:(\\d+)" + + " exp:((>=\\d+)|(\\d+(,\\d+)*?))( warn)?)$"); private static final Pattern GET_INDENT_FROM_COMMENT_REGEX = Pattern.compile("//indent:(\\d+).*?"); @@ -108,7 +105,7 @@ lineNumber)); } } - else if (NONEMPTY_LINE_REGEX.matcher(line).matches()) { + else if (!line.isEmpty()) { throw new IllegalStateException(String.format(Locale.ROOT, "File \"%1$s\" has no indentation comment or its format " + "malformed. Error on line: %2$d", @@ -332,6 +329,24 @@ } @Test + public void testAnnotationClosingParenthesisEndsInSameIndentationAsOpening() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class); + + checkConfig.addAttribute("basicOffset", "4"); + checkConfig.addAttribute("forceStrictCondition", "true"); + checkConfig.addAttribute("tabWidth", "4"); + + final String[] expected = { + "19: " + getCheckMessage(MSG_ERROR, ")", 16, 0), + "22: " + getCheckMessage(MSG_ERROR, ")", 8, 4), + }; + + verifyWarns(checkConfig, + getPath("InputAnnotationClosingParenthesisEndsInSameIndentationAsOpening.java"), + expected); + } + + @Test public void testAnonClassesFromGuava() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class); @@ -1621,4 +1636,22 @@ final String[] expected = EMPTY_EXPECTED; verifyWarns(checkConfig, getNonCompilablePath("InputLambda2.java"), expected, 0); } + + @Test + public void testSeparatedStatements() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class); + checkConfig.addAttribute("tabWidth", "4"); + final String fileName = getPath("InputSeparatedStatements.java"); + final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY; + verifyWarns(checkConfig, fileName, expected); + } + + @Test + public void testSeparatedLineWithJustSpaces() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class); + checkConfig.addAttribute("tabWidth", "4"); + final String fileName = getPath("InputSeparatedStatementWithSpaces.java"); + final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY; + verify(checkConfig, fileName, expected); + } } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/LineSetTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/LineSetTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/LineSetTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/LineSetTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/NewHandlerTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/NewHandlerTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/NewHandlerTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/NewHandlerTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,10 +19,10 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck.JAVADOC_MISSED_HTML_CLOSE; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck.JAVADOC_WRONG_SINGLETON_TAG; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck.PARSE_ERROR_MESSAGE_KEY; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck.UNRECOGNIZED_ANTLR_ERROR_MESSAGE_KEY; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck.MSG_JAVADOC_MISSED_HTML_CLOSE; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck.MSG_JAVADOC_WRONG_SINGLETON_TAG; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck.MSG_KEY_PARSE_ERROR; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck.MSG_KEY_UNRECOGNIZED_ANTLR_ERROR; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; @@ -32,6 +32,8 @@ import java.util.List; import java.util.Map; +import org.apache.commons.lang3.ArrayUtils; +import org.junit.Assert; import org.junit.Test; import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport; @@ -39,7 +41,10 @@ import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.TreeWalker; import com.puppycrawl.tools.checkstyle.api.DetailNode; +import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; import com.puppycrawl.tools.checkstyle.api.TokenTypes; +import com.puppycrawl.tools.checkstyle.internal.TestUtils; +import com.puppycrawl.tools.checkstyle.utils.BlockCommentPosition; public class AbstractJavadocCheckTest extends BaseCheckTestSupport { @Override @@ -52,7 +57,7 @@ public void testNumberFormatException() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(TempCheck.class); final String[] expected = { - "3: " + getCheckMessage(PARSE_ERROR_MESSAGE_KEY, 52, "no viable " + "3: " + getCheckMessage(MSG_KEY_PARSE_ERROR, 52, "no viable " + "alternative at input '

  • a' {@link EntityEntry} (by way of {@link #;' " + "while parsing HTML_TAG"), }; @@ -63,7 +68,7 @@ public void testCustomTag() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(TempCheck.class); final String[] expected = { - "4: " + getCheckMessage(UNRECOGNIZED_ANTLR_ERROR_MESSAGE_KEY, 4, "null"), + "4: " + getCheckMessage(MSG_KEY_UNRECOGNIZED_ANTLR_ERROR, 4, "null"), }; verify(checkConfig, getPath("InputCustomTag.java"), expected); } @@ -72,8 +77,8 @@ public void testParsingErrors() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(TempCheck.class); final String[] expected = { - "4: " + getCheckMessage(JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"), - "8: " + getCheckMessage(JAVADOC_WRONG_SINGLETON_TAG, 35, "img"), + "4: " + getCheckMessage(MSG_JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"), + "8: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 35, "img"), }; verify(checkConfig, getPath("InputParsingErrors.java"), expected); } @@ -96,7 +101,7 @@ public void testAntlrError() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(TempCheck.class); final String[] expected = { - "3: " + getCheckMessage(UNRECOGNIZED_ANTLR_ERROR_MESSAGE_KEY, 0, null), + "3: " + getCheckMessage(MSG_KEY_UNRECOGNIZED_ANTLR_ERROR, 0, null), }; verify(checkConfig, getPath("InputTestInvalidAtSeeReference.java"), expected); } @@ -106,11 +111,11 @@ final DefaultConfiguration checkConfig = createCheckConfig(TempCheck.class); final Map> expectedMessages = new LinkedHashMap<>(2); expectedMessages.put(getPath("InputParsingErrors.java"), asList( - "4: " + getCheckMessage(JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"), - "8: " + getCheckMessage(JAVADOC_WRONG_SINGLETON_TAG, 35, "img") + "4: " + getCheckMessage(MSG_JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"), + "8: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 35, "img") )); expectedMessages.put(getPath("InputTestInvalidAtSeeReference.java"), singletonList( - "3: " + getCheckMessage(UNRECOGNIZED_ANTLR_ERROR_MESSAGE_KEY, 0, null) + "3: " + getCheckMessage(MSG_KEY_UNRECOGNIZED_ANTLR_ERROR, 0, null) )); verify(createChecker(checkConfig), new File[] { new File(getPath("InputParsingErrors.java")), @@ -122,12 +127,47 @@ throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(TempCheck.class); final String[] expected = { - "4: " + getCheckMessage(JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"), - "7: " + getCheckMessage(UNRECOGNIZED_ANTLR_ERROR_MESSAGE_KEY, 4, null), + "4: " + getCheckMessage(MSG_JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"), + "7: " + getCheckMessage(MSG_KEY_UNRECOGNIZED_ANTLR_ERROR, 4, null), }; verify(checkConfig, getPath("InputTestUnclosedTagAndInvalidAtSeeReference.java"), expected); } + @Test + public void testPosition() + throws Exception { + JavadocCatchCheck.clearCounter(); + final DefaultConfiguration checkConfig = createCheckConfig(JavadocCatchCheck.class); + final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY; + verify(checkConfig, getPath("InputJavadocPosition.java"), expected); + Assert.assertEquals(58, JavadocCatchCheck.javadocsNumber); + } + + @Test + public void testPositionWithSinglelineComments() + throws Exception { + JavadocCatchCheck.clearCounter(); + final DefaultConfiguration checkConfig = createCheckConfig(JavadocCatchCheck.class); + final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY; + verify(checkConfig, getPath("InputJavadocPositionWithSinglelineComments.java"), expected); + Assert.assertEquals(58, JavadocCatchCheck.javadocsNumber); + } + + @Test + public void testPositionOnlyComments() + throws Exception { + JavadocCatchCheck.clearCounter(); + final DefaultConfiguration checkConfig = createCheckConfig(JavadocCatchCheck.class); + final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY; + verify(checkConfig, getPath("InputJavadocPositionOnlyComments.java"), expected); + Assert.assertEquals(0, JavadocCatchCheck.javadocsNumber); + } + + @Test + public void testBlockCommentPositionHasPrivateConstr() throws Exception { + TestUtils.assertUtilsClassHasPrivateConstructor(BlockCommentPosition.class); + } + private static class TempCheck extends AbstractJavadocCheck { @Override @@ -150,4 +190,33 @@ // do nothing } } + + private static class JavadocCatchCheck extends AbstractJavadocCheck { + private static int javadocsNumber; + + static void clearCounter() { + javadocsNumber = 0; + } + + @Override + public int[] getDefaultJavadocTokens() { + return new int[]{JavadocTokenTypes.JAVADOC}; + } + + @Override + public int[] getAcceptableTokens() { + return new int[] {TokenTypes.BLOCK_COMMENT_BEGIN }; + } + + @Override + public int[] getRequiredTokens() { + return new int[] {TokenTypes.BLOCK_COMMENT_BEGIN }; + } + + @Override + public void visitJavadocToken(DetailNode ast) { + Assert.assertEquals(ast.toString(), "Javadoc", ast.getText()); + javadocsNumber++; + } + } } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractTypeAwareCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractTypeAwareCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractTypeAwareCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractTypeAwareCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -571,4 +571,14 @@ }; verify(checkConfig, getPath("InputJavadocMethodIgnoreNameRegex.java"), expected); } + + @Test + public void testMethodsNotSkipWrittenJavadocs() throws Exception { + checkConfig.addAttribute("allowedAnnotations", "MyAnnotation"); + final String[] expected = { + "7:8: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "BAD"), + "17:8: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "BAD"), + }; + verify(checkConfig, getPath("InputJavadocMethodsNotSkipWritten.java"), expected); + } } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImplTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImplTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImplTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImplTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocPackageCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocPackageCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocPackageCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocPackageCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocParagraphCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocParagraphCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocParagraphCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocParagraphCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,12 +19,12 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.EMPTY; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.EXTRA_HTML; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.INCOMPLETE_TAG; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.JAVADOC_MISSING; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.NO_PERIOD; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.UNCLOSED_HTML; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.MSG_EMPTY; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.MSG_EXTRA_HTML; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.MSG_INCOMPLETE_TAG; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.MSG_JAVADOC_MISSING; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.MSG_NO_PERIOD; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.MSG_UNCLOSED_HTML; import static org.junit.Assert.assertArrayEquals; import java.io.File; @@ -72,30 +72,32 @@ final DefaultConfiguration checkConfig = createCheckConfig(JavadocStyleCheck.class); final String[] expected = { - "20: " + getCheckMessage(NO_PERIOD), - "53: " + getCheckMessage(NO_PERIOD), - "63:11: " + getCheckMessage(UNCLOSED_HTML, "This guy is missing end of bold tag"), - "66:7: " + getCheckMessage(EXTRA_HTML, "Extra tag shouldn't be here"), - "68:19: " + getCheckMessage(UNCLOSED_HTML, "dummy."), - "74: " + getCheckMessage(NO_PERIOD), - "75:23: " + getCheckMessage(UNCLOSED_HTML, "should fail"), - "81: " + getCheckMessage(NO_PERIOD), - "82:31: " + getCheckMessage(UNCLOSED_HTML, "should fail"), - "88: " + getCheckMessage(NO_PERIOD), - "89:31: " + getCheckMessage(EXTRA_HTML, ""), - "90: " + getCheckMessage(INCOMPLETE_TAG, " * should fail <"), - "109:39: " + getCheckMessage(EXTRA_HTML, ""), - "186:8: " + getCheckMessage(UNCLOSED_HTML, "
    "), - "193: " + getCheckMessage(NO_PERIOD), - "238: " + getCheckMessage(NO_PERIOD), - "335:33: " + getCheckMessage(EXTRA_HTML, ""), - "361:37: " + getCheckMessage(UNCLOSED_HTML, ""), - "372: " + getCheckMessage(NO_PERIOD), - "378:15: " + getCheckMessage(UNCLOSED_HTML, "Note: it's unterminated tag.

    "), - "382: " + getCheckMessage(NO_PERIOD), - "386: " + getCheckMessage(NO_PERIOD), - "393: " + getCheckMessage(NO_PERIOD), - "405: " + getCheckMessage(NO_PERIOD), + "20: " + getCheckMessage(MSG_NO_PERIOD), + "53: " + getCheckMessage(MSG_NO_PERIOD), + "63:11: " + getCheckMessage(MSG_UNCLOSED_HTML, + "This guy is missing end of bold tag"), + "66:7: " + getCheckMessage(MSG_EXTRA_HTML, "Extra tag shouldn't be here"), + "68:19: " + getCheckMessage(MSG_UNCLOSED_HTML, "dummy."), + "74: " + getCheckMessage(MSG_NO_PERIOD), + "75:23: " + getCheckMessage(MSG_UNCLOSED_HTML, "should fail"), + "81: " + getCheckMessage(MSG_NO_PERIOD), + "82:31: " + getCheckMessage(MSG_UNCLOSED_HTML, "should fail"), + "88: " + getCheckMessage(MSG_NO_PERIOD), + "89:31: " + getCheckMessage(MSG_EXTRA_HTML, ""), + "90: " + getCheckMessage(MSG_INCOMPLETE_TAG, " * should fail <"), + "109:39: " + getCheckMessage(MSG_EXTRA_HTML, ""), + "186:8: " + getCheckMessage(MSG_UNCLOSED_HTML, "
    "), + "193: " + getCheckMessage(MSG_NO_PERIOD), + "238: " + getCheckMessage(MSG_NO_PERIOD), + "335:33: " + getCheckMessage(MSG_EXTRA_HTML, ""), + "361:37: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), + "372: " + getCheckMessage(MSG_NO_PERIOD), + "378:15: " + getCheckMessage(MSG_UNCLOSED_HTML, + "Note: it's unterminated tag.

    "), + "382: " + getCheckMessage(MSG_NO_PERIOD), + "386: " + getCheckMessage(MSG_NO_PERIOD), + "393: " + getCheckMessage(MSG_NO_PERIOD), + "405: " + getCheckMessage(MSG_NO_PERIOD), }; verify(checkConfig, getPath("InputJavadocStyle.java"), expected); @@ -108,18 +110,18 @@ checkConfig.addAttribute("checkFirstSentence", "true"); checkConfig.addAttribute("checkHtml", "false"); final String[] expected = { - "20: " + getCheckMessage(NO_PERIOD), - "53: " + getCheckMessage(NO_PERIOD), - "74: " + getCheckMessage(NO_PERIOD), - "81: " + getCheckMessage(NO_PERIOD), - "88: " + getCheckMessage(NO_PERIOD), - "193: " + getCheckMessage(NO_PERIOD), - "238: " + getCheckMessage(NO_PERIOD), - "372: " + getCheckMessage(NO_PERIOD), - "382: " + getCheckMessage(NO_PERIOD), - "386: " + getCheckMessage(NO_PERIOD), - "393: " + getCheckMessage(NO_PERIOD), - "405: " + getCheckMessage(NO_PERIOD), + "20: " + getCheckMessage(MSG_NO_PERIOD), + "53: " + getCheckMessage(MSG_NO_PERIOD), + "74: " + getCheckMessage(MSG_NO_PERIOD), + "81: " + getCheckMessage(MSG_NO_PERIOD), + "88: " + getCheckMessage(MSG_NO_PERIOD), + "193: " + getCheckMessage(MSG_NO_PERIOD), + "238: " + getCheckMessage(MSG_NO_PERIOD), + "372: " + getCheckMessage(MSG_NO_PERIOD), + "382: " + getCheckMessage(MSG_NO_PERIOD), + "386: " + getCheckMessage(MSG_NO_PERIOD), + "393: " + getCheckMessage(MSG_NO_PERIOD), + "405: " + getCheckMessage(MSG_NO_PERIOD), }; verify(checkConfig, getPath("InputJavadocStyle.java"), expected); @@ -134,20 +136,20 @@ checkConfig.addAttribute("endOfSentenceFormat", "([.][ \t\n\r\f<])|([.]$)"); final String[] expected = { - "20: " + getCheckMessage(NO_PERIOD), - "32: " + getCheckMessage(NO_PERIOD), - "39: " + getCheckMessage(NO_PERIOD), - "53: " + getCheckMessage(NO_PERIOD), - "74: " + getCheckMessage(NO_PERIOD), - "81: " + getCheckMessage(NO_PERIOD), - "88: " + getCheckMessage(NO_PERIOD), - "193: " + getCheckMessage(NO_PERIOD), - "238: " + getCheckMessage(NO_PERIOD), - "372: " + getCheckMessage(NO_PERIOD), - "382: " + getCheckMessage(NO_PERIOD), - "386: " + getCheckMessage(NO_PERIOD), - "393: " + getCheckMessage(NO_PERIOD), - "405: " + getCheckMessage(NO_PERIOD), + "20: " + getCheckMessage(MSG_NO_PERIOD), + "32: " + getCheckMessage(MSG_NO_PERIOD), + "39: " + getCheckMessage(MSG_NO_PERIOD), + "53: " + getCheckMessage(MSG_NO_PERIOD), + "74: " + getCheckMessage(MSG_NO_PERIOD), + "81: " + getCheckMessage(MSG_NO_PERIOD), + "88: " + getCheckMessage(MSG_NO_PERIOD), + "193: " + getCheckMessage(MSG_NO_PERIOD), + "238: " + getCheckMessage(MSG_NO_PERIOD), + "372: " + getCheckMessage(MSG_NO_PERIOD), + "382: " + getCheckMessage(MSG_NO_PERIOD), + "386: " + getCheckMessage(MSG_NO_PERIOD), + "393: " + getCheckMessage(MSG_NO_PERIOD), + "405: " + getCheckMessage(MSG_NO_PERIOD), }; verify(checkConfig, getPath("InputJavadocStyle.java"), expected); @@ -159,18 +161,20 @@ checkConfig.addAttribute("checkFirstSentence", "false"); checkConfig.addAttribute("checkHtml", "true"); final String[] expected = { - "63:11: " + getCheckMessage(UNCLOSED_HTML, "This guy is missing end of bold tag"), - "66:7: " + getCheckMessage(EXTRA_HTML, "Extra tag shouldn't be here"), - "68:19: " + getCheckMessage(UNCLOSED_HTML, "dummy."), - "75:23: " + getCheckMessage(UNCLOSED_HTML, "should fail"), - "82:31: " + getCheckMessage(UNCLOSED_HTML, "should fail"), - "89:31: " + getCheckMessage(EXTRA_HTML, ""), - "90: " + getCheckMessage(INCOMPLETE_TAG, " * should fail <"), - "109:39: " + getCheckMessage(EXTRA_HTML, ""), - "186:8: " + getCheckMessage(UNCLOSED_HTML, "
    "), - "335:33: " + getCheckMessage(EXTRA_HTML, ""), - "361:37: " + getCheckMessage(UNCLOSED_HTML, ""), - "378:15: " + getCheckMessage(UNCLOSED_HTML, "Note: it's unterminated tag.

    "), + "63:11: " + getCheckMessage(MSG_UNCLOSED_HTML, + "This guy is missing end of bold tag"), + "66:7: " + getCheckMessage(MSG_EXTRA_HTML, "Extra tag shouldn't be here"), + "68:19: " + getCheckMessage(MSG_UNCLOSED_HTML, "dummy."), + "75:23: " + getCheckMessage(MSG_UNCLOSED_HTML, "should fail"), + "82:31: " + getCheckMessage(MSG_UNCLOSED_HTML, "should fail"), + "89:31: " + getCheckMessage(MSG_EXTRA_HTML, ""), + "90: " + getCheckMessage(MSG_INCOMPLETE_TAG, " * should fail <"), + "109:39: " + getCheckMessage(MSG_EXTRA_HTML, ""), + "186:8: " + getCheckMessage(MSG_UNCLOSED_HTML, "
    "), + "335:33: " + getCheckMessage(MSG_EXTRA_HTML, ""), + "361:37: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), + "378:15: " + getCheckMessage(MSG_UNCLOSED_HTML, + "Note: it's unterminated tag.

    "), }; verify(checkConfig, getPath("InputJavadocStyle.java"), expected); @@ -204,15 +208,15 @@ checkConfig.addAttribute("checkEmptyJavadoc", "true"); checkConfig.addAttribute("scope", "public"); final String[] expected = { - "88: " + getCheckMessage(NO_PERIOD), - "89:31: " + getCheckMessage(EXTRA_HTML, "
    "), - "90: " + getCheckMessage(INCOMPLETE_TAG, " * should fail <"), - "205: " + getCheckMessage(EMPTY), - "230: " + getCheckMessage(EMPTY), - "238: " + getCheckMessage(NO_PERIOD), - "335:33: " + getCheckMessage(EXTRA_HTML, ""), - "382: " + getCheckMessage(NO_PERIOD), - "386: " + getCheckMessage(NO_PERIOD), + "88: " + getCheckMessage(MSG_NO_PERIOD), + "89:31: " + getCheckMessage(MSG_EXTRA_HTML, "
    "), + "90: " + getCheckMessage(MSG_INCOMPLETE_TAG, " * should fail <"), + "205: " + getCheckMessage(MSG_EMPTY), + "230: " + getCheckMessage(MSG_EMPTY), + "238: " + getCheckMessage(MSG_NO_PERIOD), + "335:33: " + getCheckMessage(MSG_EXTRA_HTML, ""), + "382: " + getCheckMessage(MSG_NO_PERIOD), + "386: " + getCheckMessage(MSG_NO_PERIOD), }; verify(checkConfig, getPath("InputJavadocStyle.java"), expected); @@ -228,18 +232,18 @@ checkConfig.addAttribute("checkEmptyJavadoc", "true"); checkConfig.addAttribute("scope", "protected"); final String[] expected = { - "74: " + getCheckMessage(NO_PERIOD), - "75:23: " + getCheckMessage(UNCLOSED_HTML, "should fail"), - "88: " + getCheckMessage(NO_PERIOD), - "89:31: " + getCheckMessage(EXTRA_HTML, "
    "), - "90: " + getCheckMessage(INCOMPLETE_TAG, " * should fail <"), - "205: " + getCheckMessage(EMPTY), - "211: " + getCheckMessage(EMPTY), - "230: " + getCheckMessage(EMPTY), - "238: " + getCheckMessage(NO_PERIOD), - "335:33: " + getCheckMessage(EXTRA_HTML, ""), - "382: " + getCheckMessage(NO_PERIOD), - "386: " + getCheckMessage(NO_PERIOD), + "74: " + getCheckMessage(MSG_NO_PERIOD), + "75:23: " + getCheckMessage(MSG_UNCLOSED_HTML, "should fail"), + "88: " + getCheckMessage(MSG_NO_PERIOD), + "89:31: " + getCheckMessage(MSG_EXTRA_HTML, ""), + "90: " + getCheckMessage(MSG_INCOMPLETE_TAG, " * should fail <"), + "205: " + getCheckMessage(MSG_EMPTY), + "211: " + getCheckMessage(MSG_EMPTY), + "230: " + getCheckMessage(MSG_EMPTY), + "238: " + getCheckMessage(MSG_NO_PERIOD), + "335:33: " + getCheckMessage(MSG_EXTRA_HTML, ""), + "382: " + getCheckMessage(MSG_NO_PERIOD), + "386: " + getCheckMessage(MSG_NO_PERIOD), }; verify(checkConfig, getPath("InputJavadocStyle.java"), expected); @@ -255,23 +259,23 @@ checkConfig.addAttribute("checkEmptyJavadoc", "true"); checkConfig.addAttribute("scope", "package"); final String[] expected = { - "74: " + getCheckMessage(NO_PERIOD), - "75:23: " + getCheckMessage(UNCLOSED_HTML, "should fail"), - "81: " + getCheckMessage(NO_PERIOD), - "82:31: " + getCheckMessage(UNCLOSED_HTML, "should fail"), - "88: " + getCheckMessage(NO_PERIOD), - "89:31: " + getCheckMessage(EXTRA_HTML, ""), - "90: " + getCheckMessage(INCOMPLETE_TAG, " * should fail <"), - "205: " + getCheckMessage(EMPTY), - "211: " + getCheckMessage(EMPTY), - "218: " + getCheckMessage(EMPTY), - "230: " + getCheckMessage(EMPTY), - "238: " + getCheckMessage(NO_PERIOD), - "335:33: " + getCheckMessage(EXTRA_HTML, ""), - "382: " + getCheckMessage(NO_PERIOD), - "386: " + getCheckMessage(NO_PERIOD), - "393: " + getCheckMessage(NO_PERIOD), - "405: " + getCheckMessage(NO_PERIOD), + "74: " + getCheckMessage(MSG_NO_PERIOD), + "75:23: " + getCheckMessage(MSG_UNCLOSED_HTML, "should fail"), + "81: " + getCheckMessage(MSG_NO_PERIOD), + "82:31: " + getCheckMessage(MSG_UNCLOSED_HTML, "should fail"), + "88: " + getCheckMessage(MSG_NO_PERIOD), + "89:31: " + getCheckMessage(MSG_EXTRA_HTML, ""), + "90: " + getCheckMessage(MSG_INCOMPLETE_TAG, " * should fail <"), + "205: " + getCheckMessage(MSG_EMPTY), + "211: " + getCheckMessage(MSG_EMPTY), + "218: " + getCheckMessage(MSG_EMPTY), + "230: " + getCheckMessage(MSG_EMPTY), + "238: " + getCheckMessage(MSG_NO_PERIOD), + "335:33: " + getCheckMessage(MSG_EXTRA_HTML, ""), + "382: " + getCheckMessage(MSG_NO_PERIOD), + "386: " + getCheckMessage(MSG_NO_PERIOD), + "393: " + getCheckMessage(MSG_NO_PERIOD), + "405: " + getCheckMessage(MSG_NO_PERIOD), }; verify(checkConfig, getPath("InputJavadocStyle.java"), expected); @@ -284,11 +288,11 @@ checkConfig.addAttribute("checkHtml", "false"); checkConfig.addAttribute("checkEmptyJavadoc", "true"); final String[] expected = { - "205: " + getCheckMessage(EMPTY), - "211: " + getCheckMessage(EMPTY), - "218: " + getCheckMessage(EMPTY), - "225: " + getCheckMessage(EMPTY), - "230: " + getCheckMessage(EMPTY), + "205: " + getCheckMessage(MSG_EMPTY), + "211: " + getCheckMessage(MSG_EMPTY), + "218: " + getCheckMessage(MSG_EMPTY), + "225: " + getCheckMessage(MSG_EMPTY), + "230: " + getCheckMessage(MSG_EMPTY), }; verify(checkConfig, getPath("InputJavadocStyle.java"), expected); @@ -302,21 +306,23 @@ checkConfig.addAttribute("scope", "private"); checkConfig.addAttribute("excludeScope", "protected"); final String[] expected = { - "20: " + getCheckMessage(NO_PERIOD), - "53: " + getCheckMessage(NO_PERIOD), - "63:11: " + getCheckMessage(UNCLOSED_HTML, "This guy is missing end of bold tag"), - "66:7: " + getCheckMessage(EXTRA_HTML, "Extra tag shouldn't be here"), - "68:19: " + getCheckMessage(UNCLOSED_HTML, "dummy."), - "81: " + getCheckMessage(NO_PERIOD), - "82:31: " + getCheckMessage(UNCLOSED_HTML, "should fail"), - "109:39: " + getCheckMessage(EXTRA_HTML, ""), - "186:8: " + getCheckMessage(UNCLOSED_HTML, "
    "), - "193: " + getCheckMessage(NO_PERIOD), - "361:37: " + getCheckMessage(UNCLOSED_HTML, ""), - "372: " + getCheckMessage(NO_PERIOD), - "378:15: " + getCheckMessage(UNCLOSED_HTML, "Note: it's unterminated tag.

    "), - "393: " + getCheckMessage(NO_PERIOD), - "405: " + getCheckMessage(NO_PERIOD), + "20: " + getCheckMessage(MSG_NO_PERIOD), + "53: " + getCheckMessage(MSG_NO_PERIOD), + "63:11: " + getCheckMessage(MSG_UNCLOSED_HTML, + "This guy is missing end of bold tag"), + "66:7: " + getCheckMessage(MSG_EXTRA_HTML, "Extra tag shouldn't be here"), + "68:19: " + getCheckMessage(MSG_UNCLOSED_HTML, "dummy."), + "81: " + getCheckMessage(MSG_NO_PERIOD), + "82:31: " + getCheckMessage(MSG_UNCLOSED_HTML, "should fail"), + "109:39: " + getCheckMessage(MSG_EXTRA_HTML, ""), + "186:8: " + getCheckMessage(MSG_UNCLOSED_HTML, "
    "), + "193: " + getCheckMessage(MSG_NO_PERIOD), + "361:37: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), + "372: " + getCheckMessage(MSG_NO_PERIOD), + "378:15: " + getCheckMessage(MSG_UNCLOSED_HTML, + "Note: it's unterminated tag.

    "), + "393: " + getCheckMessage(MSG_NO_PERIOD), + "405: " + getCheckMessage(MSG_NO_PERIOD), }; verify(checkConfig, getPath("InputJavadocStyle.java"), expected); @@ -327,7 +333,7 @@ final DefaultConfiguration checkConfig = createCheckConfig(JavadocStyleCheck.class); final String[] expected = { - "1: " + getCheckMessage(NO_PERIOD), + "1: " + getCheckMessage(MSG_NO_PERIOD), }; verify(createChecker(checkConfig), @@ -341,7 +347,7 @@ final DefaultConfiguration checkConfig = createCheckConfig(JavadocStyleCheck.class); final String[] expected = { - "1: " + getCheckMessage(NO_PERIOD), + "1: " + getCheckMessage(MSG_NO_PERIOD), }; verify(createChecker(checkConfig), @@ -367,7 +373,7 @@ final DefaultConfiguration checkConfig = createCheckConfig(JavadocStyleCheck.class); final String[] expected = { - "1: " + getCheckMessage(JAVADOC_MISSING), + "1: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(createChecker(checkConfig), @@ -396,8 +402,8 @@ checkConfig.addAttribute("checkEmptyJavadoc", "false"); checkConfig.addAttribute("checkHtml", "false"); final String[] expected = { - "88: " + getCheckMessage(NO_PERIOD), - "386: " + getCheckMessage(NO_PERIOD), + "88: " + getCheckMessage(MSG_NO_PERIOD), + "386: " + getCheckMessage(MSG_NO_PERIOD), }; verify(checkConfig, getPath("InputJavadocStyle.java"), expected); } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagContinuationIndentationCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagContinuationIndentationCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagContinuationIndentationCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagContinuationIndentationCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfoTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfoTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfoTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfoTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,11 +19,11 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.JAVADOC_MISSING; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.MISSING_TAG; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.TAG_FORMAT; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.UNKNOWN_TAG; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.UNUSED_TAG; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.MSG_JAVADOC_MISSING; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.MSG_MISSING_TAG; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.MSG_TAG_FORMAT; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.MSG_UNKNOWN_TAG; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.MSG_UNUSED_TAG; import static org.junit.Assert.assertArrayEquals; import java.io.File; @@ -73,9 +73,9 @@ final DefaultConfiguration checkConfig = createCheckConfig(JavadocTypeCheck.class); final String[] expected = { - "8: " + getCheckMessage(JAVADOC_MISSING), - "302: " + getCheckMessage(JAVADOC_MISSING), - "327: " + getCheckMessage(JAVADOC_MISSING), + "8: " + getCheckMessage(MSG_JAVADOC_MISSING), + "302: " + getCheckMessage(MSG_JAVADOC_MISSING), + "327: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputTags.java"), expected); } @@ -85,9 +85,9 @@ final DefaultConfiguration checkConfig = createCheckConfig(JavadocTypeCheck.class); final String[] expected = { - "14: " + getCheckMessage(JAVADOC_MISSING), - "21: " + getCheckMessage(JAVADOC_MISSING), - "27: " + getCheckMessage(JAVADOC_MISSING), + "14: " + getCheckMessage(MSG_JAVADOC_MISSING), + "21: " + getCheckMessage(MSG_JAVADOC_MISSING), + "27: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputInner.java"), expected); } @@ -97,10 +97,10 @@ final DefaultConfiguration checkConfig = createCheckConfig(JavadocTypeCheck.class); final String[] expected = { - "7: " + getCheckMessage(JAVADOC_MISSING), - "9: " + getCheckMessage(JAVADOC_MISSING), - "14: " + getCheckMessage(JAVADOC_MISSING), - "34: " + getCheckMessage(JAVADOC_MISSING), + "7: " + getCheckMessage(MSG_JAVADOC_MISSING), + "9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "14: " + getCheckMessage(MSG_JAVADOC_MISSING), + "34: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputPublicOnly.java"), expected); } @@ -111,7 +111,7 @@ createCheckConfig(JavadocTypeCheck.class); checkConfig.addAttribute("scope", Scope.PROTECTED.getName()); final String[] expected = { - "7: " + getCheckMessage(JAVADOC_MISSING), + "7: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputPublicOnly.java"), expected); } @@ -122,8 +122,8 @@ createCheckConfig(JavadocTypeCheck.class); checkConfig.addAttribute("scope", Scope.PUBLIC.getName()); final String[] expected = { - "7: " + getCheckMessage(JAVADOC_MISSING), - "38: " + getCheckMessage(JAVADOC_MISSING), + "7: " + getCheckMessage(MSG_JAVADOC_MISSING), + "38: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputScopeInnerInterfaces.java"), expected); } @@ -134,10 +134,10 @@ createCheckConfig(JavadocTypeCheck.class); checkConfig.addAttribute("scope", Scope.PROTECTED.getName()); final String[] expected = { - "7: " + getCheckMessage(JAVADOC_MISSING), - "29: " + getCheckMessage(JAVADOC_MISSING), - "38: " + getCheckMessage(JAVADOC_MISSING), - "65: " + getCheckMessage(JAVADOC_MISSING), + "7: " + getCheckMessage(MSG_JAVADOC_MISSING), + "29: " + getCheckMessage(MSG_JAVADOC_MISSING), + "38: " + getCheckMessage(MSG_JAVADOC_MISSING), + "65: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputScopeInnerInterfaces.java"), expected); } @@ -150,9 +150,9 @@ "scope", Scope.getInstance("package").getName()); final String[] expected = { - "18: " + getCheckMessage(JAVADOC_MISSING), - "20: " + getCheckMessage(JAVADOC_MISSING), - "22: " + getCheckMessage(JAVADOC_MISSING), + "18: " + getCheckMessage(MSG_JAVADOC_MISSING), + "20: " + getCheckMessage(MSG_JAVADOC_MISSING), + "22: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputScopeInnerClasses.java"), expected); } @@ -165,7 +165,7 @@ "scope", Scope.getInstance("public").getName()); final String[] expected = { - "18: " + getCheckMessage(JAVADOC_MISSING), + "18: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputScopeInnerClasses.java"), expected); } @@ -176,7 +176,7 @@ createCheckConfig(JavadocTypeCheck.class); checkConfig.addAttribute("authorFormat", "\\S"); final String[] expected = { - "13: " + getCheckMessage(MISSING_TAG, "@author"), + "13: " + getCheckMessage(MSG_MISSING_TAG, "@author"), }; verify(checkConfig, getPath("InputWhitespace.java"), expected); } @@ -188,9 +188,9 @@ createCheckConfig(JavadocTypeCheck.class); checkConfig.addAttribute("authorFormat", "0*"); final String[] expected = { - "22: " + getCheckMessage(MISSING_TAG, "@author"), - "58: " + getCheckMessage(MISSING_TAG, "@author"), - "94: " + getCheckMessage(MISSING_TAG, "@author"), + "22: " + getCheckMessage(MSG_MISSING_TAG, "@author"), + "58: " + getCheckMessage(MSG_MISSING_TAG, "@author"), + "94: " + getCheckMessage(MSG_MISSING_TAG, "@author"), }; verify(checkConfig, getPath("InputJavadoc.java"), expected); } @@ -202,15 +202,15 @@ createCheckConfig(JavadocTypeCheck.class); checkConfig.addAttribute("authorFormat", "ABC"); final String[] expected = { - "13: " + getCheckMessage(TAG_FORMAT, "@author", "ABC"), - "22: " + getCheckMessage(MISSING_TAG, "@author"), - "31: " + getCheckMessage(TAG_FORMAT, "@author", "ABC"), - "49: " + getCheckMessage(TAG_FORMAT, "@author", "ABC"), - "58: " + getCheckMessage(MISSING_TAG, "@author"), - "67: " + getCheckMessage(TAG_FORMAT, "@author", "ABC"), - "85: " + getCheckMessage(TAG_FORMAT, "@author", "ABC"), - "94: " + getCheckMessage(MISSING_TAG, "@author"), - "103: " + getCheckMessage(TAG_FORMAT, "@author", "ABC"), + "13: " + getCheckMessage(MSG_TAG_FORMAT, "@author", "ABC"), + "22: " + getCheckMessage(MSG_MISSING_TAG, "@author"), + "31: " + getCheckMessage(MSG_TAG_FORMAT, "@author", "ABC"), + "49: " + getCheckMessage(MSG_TAG_FORMAT, "@author", "ABC"), + "58: " + getCheckMessage(MSG_MISSING_TAG, "@author"), + "67: " + getCheckMessage(MSG_TAG_FORMAT, "@author", "ABC"), + "85: " + getCheckMessage(MSG_TAG_FORMAT, "@author", "ABC"), + "94: " + getCheckMessage(MSG_MISSING_TAG, "@author"), + "103: " + getCheckMessage(MSG_TAG_FORMAT, "@author", "ABC"), }; verify(checkConfig, getPath("InputJavadoc.java"), expected); } @@ -222,7 +222,7 @@ createCheckConfig(JavadocTypeCheck.class); checkConfig.addAttribute("versionFormat", "\\S"); final String[] expected = { - "13: " + getCheckMessage(MISSING_TAG, "@version"), + "13: " + getCheckMessage(MSG_MISSING_TAG, "@version"), }; verify(checkConfig, getPath("InputWhitespace.java"), expected); } @@ -234,9 +234,9 @@ createCheckConfig(JavadocTypeCheck.class); checkConfig.addAttribute("versionFormat", "^\\p{Digit}+\\.\\p{Digit}+$"); final String[] expected = { - "22: " + getCheckMessage(MISSING_TAG, "@version"), - "58: " + getCheckMessage(MISSING_TAG, "@version"), - "94: " + getCheckMessage(MISSING_TAG, "@version"), + "22: " + getCheckMessage(MSG_MISSING_TAG, "@version"), + "58: " + getCheckMessage(MSG_MISSING_TAG, "@version"), + "94: " + getCheckMessage(MSG_MISSING_TAG, "@version"), }; verify(checkConfig, getPath("InputJavadoc.java"), expected); } @@ -248,18 +248,18 @@ createCheckConfig(JavadocTypeCheck.class); checkConfig.addAttribute("versionFormat", "\\$Revision.*\\$"); final String[] expected = { - "13: " + getCheckMessage(TAG_FORMAT, "@version", "\\$Revision.*\\$"), - "22: " + getCheckMessage(MISSING_TAG, "@version"), - "31: " + getCheckMessage(TAG_FORMAT, "@version", "\\$Revision.*\\$"), - "40: " + getCheckMessage(TAG_FORMAT, "@version", "\\$Revision.*\\$"), - "49: " + getCheckMessage(TAG_FORMAT, "@version", "\\$Revision.*\\$"), - "58: " + getCheckMessage(MISSING_TAG, "@version"), - "67: " + getCheckMessage(TAG_FORMAT, "@version", "\\$Revision.*\\$"), - "76: " + getCheckMessage(TAG_FORMAT, "@version", "\\$Revision.*\\$"), - "85: " + getCheckMessage(TAG_FORMAT, "@version", "\\$Revision.*\\$"), - "94: " + getCheckMessage(MISSING_TAG, "@version"), - "103: " + getCheckMessage(TAG_FORMAT, "@version", "\\$Revision.*\\$"), - "112: " + getCheckMessage(TAG_FORMAT, "@version", "\\$Revision.*\\$"), + "13: " + getCheckMessage(MSG_TAG_FORMAT, "@version", "\\$Revision.*\\$"), + "22: " + getCheckMessage(MSG_MISSING_TAG, "@version"), + "31: " + getCheckMessage(MSG_TAG_FORMAT, "@version", "\\$Revision.*\\$"), + "40: " + getCheckMessage(MSG_TAG_FORMAT, "@version", "\\$Revision.*\\$"), + "49: " + getCheckMessage(MSG_TAG_FORMAT, "@version", "\\$Revision.*\\$"), + "58: " + getCheckMessage(MSG_MISSING_TAG, "@version"), + "67: " + getCheckMessage(MSG_TAG_FORMAT, "@version", "\\$Revision.*\\$"), + "76: " + getCheckMessage(MSG_TAG_FORMAT, "@version", "\\$Revision.*\\$"), + "85: " + getCheckMessage(MSG_TAG_FORMAT, "@version", "\\$Revision.*\\$"), + "94: " + getCheckMessage(MSG_MISSING_TAG, "@version"), + "103: " + getCheckMessage(MSG_TAG_FORMAT, "@version", "\\$Revision.*\\$"), + "112: " + getCheckMessage(MSG_TAG_FORMAT, "@version", "\\$Revision.*\\$"), }; verify(checkConfig, getPath("InputJavadoc.java"), expected); } @@ -269,16 +269,16 @@ final DefaultConfiguration checkConfig = createCheckConfig(JavadocTypeCheck.class); final String[] expected = { - "3: " + getCheckMessage(JAVADOC_MISSING), - "15: " + getCheckMessage(JAVADOC_MISSING), - "27: " + getCheckMessage(JAVADOC_MISSING), - "39: " + getCheckMessage(JAVADOC_MISSING), - "52: " + getCheckMessage(JAVADOC_MISSING), - "63: " + getCheckMessage(JAVADOC_MISSING), - "75: " + getCheckMessage(JAVADOC_MISSING), - "87: " + getCheckMessage(JAVADOC_MISSING), - "99: " + getCheckMessage(JAVADOC_MISSING), - "111: " + getCheckMessage(JAVADOC_MISSING), + "3: " + getCheckMessage(MSG_JAVADOC_MISSING), + "15: " + getCheckMessage(MSG_JAVADOC_MISSING), + "27: " + getCheckMessage(MSG_JAVADOC_MISSING), + "39: " + getCheckMessage(MSG_JAVADOC_MISSING), + "52: " + getCheckMessage(MSG_JAVADOC_MISSING), + "63: " + getCheckMessage(MSG_JAVADOC_MISSING), + "75: " + getCheckMessage(MSG_JAVADOC_MISSING), + "87: " + getCheckMessage(MSG_JAVADOC_MISSING), + "99: " + getCheckMessage(MSG_JAVADOC_MISSING), + "111: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputNoJavadoc.java"), @@ -291,7 +291,7 @@ createCheckConfig(JavadocTypeCheck.class); checkConfig.addAttribute("tokens", "INTERFACE_DEF"); final String[] expected = { - "4: " + getCheckMessage(JAVADOC_MISSING), + "4: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputNoJavadocOnInterface.java"), expected); } @@ -302,8 +302,8 @@ createCheckConfig(JavadocTypeCheck.class); checkConfig.addAttribute("scope", Scope.PROTECTED.getName()); final String[] expected = { - "3: " + getCheckMessage(JAVADOC_MISSING), - "15: " + getCheckMessage(JAVADOC_MISSING), + "3: " + getCheckMessage(MSG_JAVADOC_MISSING), + "15: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputNoJavadoc.java"), @@ -317,14 +317,14 @@ checkConfig.addAttribute("scope", Scope.PRIVATE.getName()); checkConfig.addAttribute("excludeScope", Scope.PROTECTED.getName()); final String[] expected = { - "27: " + getCheckMessage(JAVADOC_MISSING), - "39: " + getCheckMessage(JAVADOC_MISSING), - "52: " + getCheckMessage(JAVADOC_MISSING), - "63: " + getCheckMessage(JAVADOC_MISSING), - "75: " + getCheckMessage(JAVADOC_MISSING), - "87: " + getCheckMessage(JAVADOC_MISSING), - "99: " + getCheckMessage(JAVADOC_MISSING), - "111: " + getCheckMessage(JAVADOC_MISSING), + "27: " + getCheckMessage(MSG_JAVADOC_MISSING), + "39: " + getCheckMessage(MSG_JAVADOC_MISSING), + "52: " + getCheckMessage(MSG_JAVADOC_MISSING), + "63: " + getCheckMessage(MSG_JAVADOC_MISSING), + "75: " + getCheckMessage(MSG_JAVADOC_MISSING), + "87: " + getCheckMessage(MSG_JAVADOC_MISSING), + "99: " + getCheckMessage(MSG_JAVADOC_MISSING), + "111: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputNoJavadoc.java"), @@ -336,10 +336,10 @@ final DefaultConfiguration checkConfig = createCheckConfig(JavadocTypeCheck.class); final String[] expected = { - "7:4: " + getCheckMessage(UNUSED_TAG, "@param", ""), - "11: " + getCheckMessage(MISSING_TAG, "@param "), - "44:8: " + getCheckMessage(UNUSED_TAG, "@param", ""), - "47: " + getCheckMessage(MISSING_TAG, "@param "), + "7:4: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), + "11: " + getCheckMessage(MSG_MISSING_TAG, "@param "), + "44:8: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), + "47: " + getCheckMessage(MSG_MISSING_TAG, "@param "), }; verify(checkConfig, getPath("InputTypeParamsTags.java"), expected); } @@ -350,8 +350,8 @@ createCheckConfig(JavadocTypeCheck.class); checkConfig.addAttribute("allowMissingParamTags", "true"); final String[] expected = { - "7:4: " + getCheckMessage(UNUSED_TAG, "@param", ""), - "44:8: " + getCheckMessage(UNUSED_TAG, "@param", ""), + "7:4: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), + "44:8: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), }; verify(checkConfig, getPath("InputTypeParamsTags.java"), expected); } @@ -361,7 +361,7 @@ final DefaultConfiguration checkConfig = createCheckConfig(JavadocTypeCheck.class); final String[] expected = { - "5:4: " + getCheckMessage(UNKNOWN_TAG, "mytag"), + "5:4: " + getCheckMessage(MSG_UNKNOWN_TAG, "mytag"), }; verify(checkConfig, getPath("InputBadTag.java"), diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,7 +19,7 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck.JAVADOC_MISSING; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck.MSG_JAVADOC_MISSING; import static org.junit.Assert.assertArrayEquals; import java.io.File; @@ -70,10 +70,10 @@ final DefaultConfiguration checkConfig = createCheckConfig(JavadocVariableCheck.class); final String[] expected = { - "11:5: " + getCheckMessage(JAVADOC_MISSING), - "304:5: " + getCheckMessage(JAVADOC_MISSING), - "311:5: " + getCheckMessage(JAVADOC_MISSING), - "330:5: " + getCheckMessage(JAVADOC_MISSING), + "11:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "304:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "311:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "330:5: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputTags.java"), expected); } @@ -84,9 +84,9 @@ final DefaultConfiguration checkConfig = createCheckConfig(JavadocVariableCheck.class); final String[] expected = { - "17:9: " + getCheckMessage(JAVADOC_MISSING), - "24:9: " + getCheckMessage(JAVADOC_MISSING), - "30:13: " + getCheckMessage(JAVADOC_MISSING), + "17:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "24:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "30:13: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputInner.java"), expected); } @@ -107,13 +107,13 @@ final DefaultConfiguration checkConfig = createCheckConfig(JavadocVariableCheck.class); final String[] expected = { - "11:9: " + getCheckMessage(JAVADOC_MISSING), - "16:13: " + getCheckMessage(JAVADOC_MISSING), - "36:9: " + getCheckMessage(JAVADOC_MISSING), - "43:5: " + getCheckMessage(JAVADOC_MISSING), - "44:5: " + getCheckMessage(JAVADOC_MISSING), - "45:5: " + getCheckMessage(JAVADOC_MISSING), - "46:5: " + getCheckMessage(JAVADOC_MISSING), + "11:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "16:13: " + getCheckMessage(MSG_JAVADOC_MISSING), + "36:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "43:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "44:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "45:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "46:5: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputPublicOnly.java"), expected); } @@ -125,7 +125,7 @@ createCheckConfig(JavadocVariableCheck.class); checkConfig.addAttribute("scope", Scope.PUBLIC.getName()); final String[] expected = { - "46:5: " + getCheckMessage(JAVADOC_MISSING), + "46:5: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputPublicOnly.java"), expected); } @@ -135,43 +135,43 @@ final DefaultConfiguration checkConfig = createCheckConfig(JavadocVariableCheck.class); final String[] expected = { - "5:5: " + getCheckMessage(JAVADOC_MISSING), - "6:5: " + getCheckMessage(JAVADOC_MISSING), - "7:5: " + getCheckMessage(JAVADOC_MISSING), - "8:5: " + getCheckMessage(JAVADOC_MISSING), - "16:9: " + getCheckMessage(JAVADOC_MISSING), - "17:9: " + getCheckMessage(JAVADOC_MISSING), - "18:9: " + getCheckMessage(JAVADOC_MISSING), - "19:9: " + getCheckMessage(JAVADOC_MISSING), - "28:9: " + getCheckMessage(JAVADOC_MISSING), - "29:9: " + getCheckMessage(JAVADOC_MISSING), - "30:9: " + getCheckMessage(JAVADOC_MISSING), - "31:9: " + getCheckMessage(JAVADOC_MISSING), - "40:9: " + getCheckMessage(JAVADOC_MISSING), - "41:9: " + getCheckMessage(JAVADOC_MISSING), - "42:9: " + getCheckMessage(JAVADOC_MISSING), - "43:9: " + getCheckMessage(JAVADOC_MISSING), - "53:5: " + getCheckMessage(JAVADOC_MISSING), - "54:5: " + getCheckMessage(JAVADOC_MISSING), - "55:5: " + getCheckMessage(JAVADOC_MISSING), - "56:5: " + getCheckMessage(JAVADOC_MISSING), - "64:9: " + getCheckMessage(JAVADOC_MISSING), - "65:9: " + getCheckMessage(JAVADOC_MISSING), - "66:9: " + getCheckMessage(JAVADOC_MISSING), - "67:9: " + getCheckMessage(JAVADOC_MISSING), - "76:9: " + getCheckMessage(JAVADOC_MISSING), - "77:9: " + getCheckMessage(JAVADOC_MISSING), - "78:9: " + getCheckMessage(JAVADOC_MISSING), - "79:9: " + getCheckMessage(JAVADOC_MISSING), - "88:9: " + getCheckMessage(JAVADOC_MISSING), - "89:9: " + getCheckMessage(JAVADOC_MISSING), - "90:9: " + getCheckMessage(JAVADOC_MISSING), - "91:9: " + getCheckMessage(JAVADOC_MISSING), - "100:9: " + getCheckMessage(JAVADOC_MISSING), - "101:9: " + getCheckMessage(JAVADOC_MISSING), - "102:9: " + getCheckMessage(JAVADOC_MISSING), - "103:9: " + getCheckMessage(JAVADOC_MISSING), - "113:9: " + getCheckMessage(JAVADOC_MISSING), + "5:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "6:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "7:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "8:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "16:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "17:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "18:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "19:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "28:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "29:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "30:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "31:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "40:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "41:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "42:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "43:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "53:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "54:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "55:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "56:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "64:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "65:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "66:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "67:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "76:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "77:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "78:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "79:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "88:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "89:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "90:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "91:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "100:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "101:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "102:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "103:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "113:9: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputNoJavadoc.java"), @@ -184,10 +184,10 @@ createCheckConfig(JavadocVariableCheck.class); checkConfig.addAttribute("scope", Scope.PROTECTED.getName()); final String[] expected = { - "5:5: " + getCheckMessage(JAVADOC_MISSING), - "6:5: " + getCheckMessage(JAVADOC_MISSING), - "16:9: " + getCheckMessage(JAVADOC_MISSING), - "17:9: " + getCheckMessage(JAVADOC_MISSING), + "5:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "6:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "16:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "17:9: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputNoJavadoc.java"), @@ -201,39 +201,39 @@ checkConfig.addAttribute("scope", Scope.PRIVATE.getName()); checkConfig.addAttribute("excludeScope", Scope.PROTECTED.getName()); final String[] expected = { - "7:5: " + getCheckMessage(JAVADOC_MISSING), - "8:5: " + getCheckMessage(JAVADOC_MISSING), - "18:9: " + getCheckMessage(JAVADOC_MISSING), - "19:9: " + getCheckMessage(JAVADOC_MISSING), - "28:9: " + getCheckMessage(JAVADOC_MISSING), - "29:9: " + getCheckMessage(JAVADOC_MISSING), - "30:9: " + getCheckMessage(JAVADOC_MISSING), - "31:9: " + getCheckMessage(JAVADOC_MISSING), - "40:9: " + getCheckMessage(JAVADOC_MISSING), - "41:9: " + getCheckMessage(JAVADOC_MISSING), - "42:9: " + getCheckMessage(JAVADOC_MISSING), - "43:9: " + getCheckMessage(JAVADOC_MISSING), - "53:5: " + getCheckMessage(JAVADOC_MISSING), - "54:5: " + getCheckMessage(JAVADOC_MISSING), - "55:5: " + getCheckMessage(JAVADOC_MISSING), - "56:5: " + getCheckMessage(JAVADOC_MISSING), - "64:9: " + getCheckMessage(JAVADOC_MISSING), - "65:9: " + getCheckMessage(JAVADOC_MISSING), - "66:9: " + getCheckMessage(JAVADOC_MISSING), - "67:9: " + getCheckMessage(JAVADOC_MISSING), - "76:9: " + getCheckMessage(JAVADOC_MISSING), - "77:9: " + getCheckMessage(JAVADOC_MISSING), - "78:9: " + getCheckMessage(JAVADOC_MISSING), - "79:9: " + getCheckMessage(JAVADOC_MISSING), - "88:9: " + getCheckMessage(JAVADOC_MISSING), - "89:9: " + getCheckMessage(JAVADOC_MISSING), - "90:9: " + getCheckMessage(JAVADOC_MISSING), - "91:9: " + getCheckMessage(JAVADOC_MISSING), - "100:9: " + getCheckMessage(JAVADOC_MISSING), - "101:9: " + getCheckMessage(JAVADOC_MISSING), - "102:9: " + getCheckMessage(JAVADOC_MISSING), - "103:9: " + getCheckMessage(JAVADOC_MISSING), - "113:9: " + getCheckMessage(JAVADOC_MISSING), + "7:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "8:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "18:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "19:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "28:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "29:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "30:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "31:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "40:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "41:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "42:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "43:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "53:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "54:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "55:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "56:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "64:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "65:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "66:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "67:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "76:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "77:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "78:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "79:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "88:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "89:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "90:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "91:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "100:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "101:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "102:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "103:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "113:9: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputNoJavadoc.java"), @@ -247,42 +247,42 @@ createCheckConfig(JavadocVariableCheck.class); checkConfig.addAttribute("ignoreNamePattern", "log|logger"); final String[] expected = { - "5:5: " + getCheckMessage(JAVADOC_MISSING), - "6:5: " + getCheckMessage(JAVADOC_MISSING), - "7:5: " + getCheckMessage(JAVADOC_MISSING), - "8:5: " + getCheckMessage(JAVADOC_MISSING), - "16:9: " + getCheckMessage(JAVADOC_MISSING), - "17:9: " + getCheckMessage(JAVADOC_MISSING), - "18:9: " + getCheckMessage(JAVADOC_MISSING), - "19:9: " + getCheckMessage(JAVADOC_MISSING), - "28:9: " + getCheckMessage(JAVADOC_MISSING), - "29:9: " + getCheckMessage(JAVADOC_MISSING), - "30:9: " + getCheckMessage(JAVADOC_MISSING), - "31:9: " + getCheckMessage(JAVADOC_MISSING), - "40:9: " + getCheckMessage(JAVADOC_MISSING), - "41:9: " + getCheckMessage(JAVADOC_MISSING), - "42:9: " + getCheckMessage(JAVADOC_MISSING), - "43:9: " + getCheckMessage(JAVADOC_MISSING), - "53:5: " + getCheckMessage(JAVADOC_MISSING), - "54:5: " + getCheckMessage(JAVADOC_MISSING), - "55:5: " + getCheckMessage(JAVADOC_MISSING), - "56:5: " + getCheckMessage(JAVADOC_MISSING), - "64:9: " + getCheckMessage(JAVADOC_MISSING), - "65:9: " + getCheckMessage(JAVADOC_MISSING), - "66:9: " + getCheckMessage(JAVADOC_MISSING), - "67:9: " + getCheckMessage(JAVADOC_MISSING), - "76:9: " + getCheckMessage(JAVADOC_MISSING), - "77:9: " + getCheckMessage(JAVADOC_MISSING), - "78:9: " + getCheckMessage(JAVADOC_MISSING), - "79:9: " + getCheckMessage(JAVADOC_MISSING), - "88:9: " + getCheckMessage(JAVADOC_MISSING), - "89:9: " + getCheckMessage(JAVADOC_MISSING), - "90:9: " + getCheckMessage(JAVADOC_MISSING), - "91:9: " + getCheckMessage(JAVADOC_MISSING), - "100:9: " + getCheckMessage(JAVADOC_MISSING), - "101:9: " + getCheckMessage(JAVADOC_MISSING), - "102:9: " + getCheckMessage(JAVADOC_MISSING), - "103:9: " + getCheckMessage(JAVADOC_MISSING), + "5:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "6:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "7:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "8:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "16:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "17:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "18:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "19:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "28:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "29:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "30:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "31:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "40:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "41:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "42:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "43:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "53:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "54:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "55:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "56:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "64:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "65:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "66:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "67:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "76:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "77:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "78:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "79:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "88:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "89:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "90:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "91:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "100:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "101:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "102:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "103:9: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputNoJavadoc.java"), @@ -296,43 +296,43 @@ createCheckConfig(JavadocVariableCheck.class); checkConfig.addAttribute("ignoreNamePattern", ""); final String[] expected = { - "5:5: " + getCheckMessage(JAVADOC_MISSING), - "6:5: " + getCheckMessage(JAVADOC_MISSING), - "7:5: " + getCheckMessage(JAVADOC_MISSING), - "8:5: " + getCheckMessage(JAVADOC_MISSING), - "16:9: " + getCheckMessage(JAVADOC_MISSING), - "17:9: " + getCheckMessage(JAVADOC_MISSING), - "18:9: " + getCheckMessage(JAVADOC_MISSING), - "19:9: " + getCheckMessage(JAVADOC_MISSING), - "28:9: " + getCheckMessage(JAVADOC_MISSING), - "29:9: " + getCheckMessage(JAVADOC_MISSING), - "30:9: " + getCheckMessage(JAVADOC_MISSING), - "31:9: " + getCheckMessage(JAVADOC_MISSING), - "40:9: " + getCheckMessage(JAVADOC_MISSING), - "41:9: " + getCheckMessage(JAVADOC_MISSING), - "42:9: " + getCheckMessage(JAVADOC_MISSING), - "43:9: " + getCheckMessage(JAVADOC_MISSING), - "53:5: " + getCheckMessage(JAVADOC_MISSING), - "54:5: " + getCheckMessage(JAVADOC_MISSING), - "55:5: " + getCheckMessage(JAVADOC_MISSING), - "56:5: " + getCheckMessage(JAVADOC_MISSING), - "64:9: " + getCheckMessage(JAVADOC_MISSING), - "65:9: " + getCheckMessage(JAVADOC_MISSING), - "66:9: " + getCheckMessage(JAVADOC_MISSING), - "67:9: " + getCheckMessage(JAVADOC_MISSING), - "76:9: " + getCheckMessage(JAVADOC_MISSING), - "77:9: " + getCheckMessage(JAVADOC_MISSING), - "78:9: " + getCheckMessage(JAVADOC_MISSING), - "79:9: " + getCheckMessage(JAVADOC_MISSING), - "88:9: " + getCheckMessage(JAVADOC_MISSING), - "89:9: " + getCheckMessage(JAVADOC_MISSING), - "90:9: " + getCheckMessage(JAVADOC_MISSING), - "91:9: " + getCheckMessage(JAVADOC_MISSING), - "100:9: " + getCheckMessage(JAVADOC_MISSING), - "101:9: " + getCheckMessage(JAVADOC_MISSING), - "102:9: " + getCheckMessage(JAVADOC_MISSING), - "103:9: " + getCheckMessage(JAVADOC_MISSING), - "113:9: " + getCheckMessage(JAVADOC_MISSING), + "5:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "6:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "7:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "8:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "16:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "17:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "18:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "19:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "28:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "29:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "30:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "31:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "40:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "41:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "42:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "43:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "53:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "54:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "55:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "56:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "64:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "65:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "66:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "67:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "76:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "77:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "78:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "79:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "88:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "89:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "90:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "91:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "100:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "101:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "102:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "103:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "113:9: " + getCheckMessage(MSG_JAVADOC_MISSING), }; verify(checkConfig, getPath("InputNoJavadoc.java"), diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/NonEmptyAtclauseDescriptionCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/NonEmptyAtclauseDescriptionCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/NonEmptyAtclauseDescriptionCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/NonEmptyAtclauseDescriptionCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,8 +19,8 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck.SUMMARY_FIRST_SENTENCE; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck.SUMMARY_JAVADOC; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck.MSG_SUMMARY_FIRST_SENTENCE; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck.MSG_SUMMARY_JAVADOC; import static org.junit.Assert.assertArrayEquals; import java.io.File; @@ -69,13 +69,13 @@ checkConfig.addAttribute("forbiddenSummaryFragments", "^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"); final String[] expected = { - "14: " + getCheckMessage(SUMMARY_FIRST_SENTENCE), - "37: " + getCheckMessage(SUMMARY_FIRST_SENTENCE), - "47: " + getCheckMessage(SUMMARY_JAVADOC), - "58: " + getCheckMessage(SUMMARY_JAVADOC), - "69: " + getCheckMessage(SUMMARY_FIRST_SENTENCE), - "83: " + getCheckMessage(SUMMARY_JAVADOC), - "103: " + getCheckMessage(SUMMARY_FIRST_SENTENCE), + "14: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), + "37: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), + "47: " + getCheckMessage(MSG_SUMMARY_JAVADOC), + "58: " + getCheckMessage(MSG_SUMMARY_JAVADOC), + "69: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), + "83: " + getCheckMessage(MSG_SUMMARY_JAVADOC), + "103: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), }; verify(checkConfig, getPath("InputIncorrectSummaryJavaDoc.java"), expected); } @@ -84,8 +84,8 @@ public void testPeriod() throws Exception { checkConfig.addAttribute("period", "_"); final String[] expected = { - "5: " + getCheckMessage(SUMMARY_FIRST_SENTENCE), - "10: " + getCheckMessage(SUMMARY_FIRST_SENTENCE), + "5: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), + "10: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), }; verify(checkConfig, getPath("InputSummaryJavadocPeriod.java"), expected); @@ -102,10 +102,10 @@ @Test public void testDefaultConfiguration() throws Exception { final String[] expected = { - "14: " + getCheckMessage(SUMMARY_FIRST_SENTENCE), - "37: " + getCheckMessage(SUMMARY_FIRST_SENTENCE), - "69: " + getCheckMessage(SUMMARY_FIRST_SENTENCE), - "103: " + getCheckMessage(SUMMARY_FIRST_SENTENCE), + "14: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), + "37: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), + "69: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), + "103: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), }; createChecker(checkConfig); diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/WriteTagCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/WriteTagCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/WriteTagCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/WriteTagCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,9 +19,9 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.MISSING_TAG; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.TAG_FORMAT; -import static com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.WRITE_TAG; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.MSG_MISSING_TAG; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.MSG_TAG_FORMAT; +import static com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.MSG_WRITE_TAG; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -72,7 +72,7 @@ checkConfig.addAttribute("tag", "@author"); checkConfig.addAttribute("tagFormat", "\\S"); final String[] expected = { - "10: " + getCheckMessage(WRITE_TAG, "@author", "Daniel Grenner"), + "10: " + getCheckMessage(MSG_WRITE_TAG, "@author", "Daniel Grenner"), }; verify(checkConfig, getPath("InputWriteTag.java"), expected); } @@ -81,7 +81,7 @@ public void testMissingFormat() throws Exception { checkConfig.addAttribute("tag", "@author"); final String[] expected = { - "10: " + getCheckMessage(WRITE_TAG, "@author", "Daniel Grenner"), + "10: " + getCheckMessage(MSG_WRITE_TAG, "@author", "Daniel Grenner"), }; verify(checkConfig, getPath("InputWriteTag.java"), expected); } @@ -91,7 +91,7 @@ checkConfig.addAttribute("tag", "@incomplete"); checkConfig.addAttribute("tagFormat", "\\S"); final String[] expected = { - "11: " + getCheckMessage(WRITE_TAG, "@incomplete", + "11: " + getCheckMessage(MSG_WRITE_TAG, "@incomplete", "This class needs more code..."), }; verify(checkConfig, getPath("InputWriteTag.java"), expected); @@ -102,8 +102,8 @@ checkConfig.addAttribute("tag", "@doubletag"); checkConfig.addAttribute("tagFormat", "\\S"); final String[] expected = { - "12: " + getCheckMessage(WRITE_TAG, "@doubletag", "first text"), - "13: " + getCheckMessage(WRITE_TAG, "@doubletag", "second text"), + "12: " + getCheckMessage(MSG_WRITE_TAG, "@doubletag", "first text"), + "13: " + getCheckMessage(MSG_WRITE_TAG, "@doubletag", "second text"), }; verify(checkConfig, getPath("InputWriteTag.java"), expected); } @@ -113,7 +113,7 @@ checkConfig.addAttribute("tag", "@emptytag"); checkConfig.addAttribute("tagFormat", ""); final String[] expected = { - "14: " + getCheckMessage(WRITE_TAG, "@emptytag", ""), + "14: " + getCheckMessage(MSG_WRITE_TAG, "@emptytag", ""), }; verify(checkConfig, getPath("InputWriteTag.java"), expected); } @@ -122,7 +122,7 @@ public void testMissingTag() throws Exception { checkConfig.addAttribute("tag", "@missingtag"); final String[] expected = { - "16: " + getCheckMessage(MISSING_TAG, "@missingtag"), + "16: " + getCheckMessage(MSG_MISSING_TAG, "@missingtag"), }; verify(checkConfig, getPath("InputWriteTag.java"), expected); } @@ -135,8 +135,8 @@ "INTERFACE_DEF, CLASS_DEF, METHOD_DEF, CTOR_DEF"); checkConfig.addAttribute("severity", "ignore"); final String[] expected = { - "19: " + getCheckMessage(WRITE_TAG, "@todo", "Add a constructor comment"), - "30: " + getCheckMessage(WRITE_TAG, "@todo", "Add a comment"), + "19: " + getCheckMessage(MSG_WRITE_TAG, "@todo", "Add a constructor comment"), + "30: " + getCheckMessage(MSG_WRITE_TAG, "@todo", "Add a comment"), }; verify(checkConfig, getPath("InputWriteTag.java"), expected); } @@ -147,7 +147,7 @@ checkConfig.addAttribute("tagFormat", "\\S"); checkConfig.addAttribute("severity", "ignore"); final String[] expected = { - "10: " + getCheckMessage(WRITE_TAG, "@author", "Daniel Grenner"), + "10: " + getCheckMessage(MSG_WRITE_TAG, "@author", "Daniel Grenner"), }; verify(checkConfig, getPath("InputWriteTag.java"), expected); } @@ -176,7 +176,7 @@ checkConfig.addAttribute("tag", "@author"); checkConfig.addAttribute("tagFormat", "ABC"); final String[] expected = { - "10: " + getCheckMessage(TAG_FORMAT, "@author", "ABC"), + "10: " + getCheckMessage(MSG_TAG_FORMAT, "@author", "ABC"), }; verify(checkConfig, getPath("InputWriteTag.java"), expected); } @@ -190,12 +190,12 @@ checkConfig.addAttribute("tokens", "ANNOTATION_DEF, ENUM_DEF, ANNOTATION_FIELD_DEF, ENUM_CONSTANT_DEF"); final String[] expected = { - "9: " + getCheckMessage(WRITE_TAG, "@incomplete", "This enum needs more code..."), - "13: " + getCheckMessage(WRITE_TAG, "@incomplete", + "9: " + getCheckMessage(MSG_WRITE_TAG, "@incomplete", "This enum needs more code..."), + "13: " + getCheckMessage(MSG_WRITE_TAG, "@incomplete", "This enum constant needs more code..."), - "19: " + getCheckMessage(WRITE_TAG, "@incomplete", + "19: " + getCheckMessage(MSG_WRITE_TAG, "@incomplete", "This annotation needs more code..."), - "23: " + getCheckMessage(WRITE_TAG, "@incomplete", + "23: " + getCheckMessage(MSG_WRITE_TAG, "@incomplete", "This annotation field needs more code..."), }; verify(checkConfig, getPath("InputWriteTag2.java"), expected); diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/BooleanExpressionComplexityCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/BooleanExpressionComplexityCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/BooleanExpressionComplexityCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/BooleanExpressionComplexityCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/JavaNCSSCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/JavaNCSSCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/JavaNCSSCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/JavaNCSSCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/NPathComplexityCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/NPathComplexityCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/NPathComplexityCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/NPathComplexityCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/RedundantModifierCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/RedundantModifierCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/RedundantModifierCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/RedundantModifierCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,8 +19,8 @@ package com.puppycrawl.tools.checkstyle.checks.naming; -import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck.ILLEGAL_ABSTRACT_CLASS_NAME; -import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck.NO_ABSTRACT_CLASS_MODIFIER; +import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck.MSG_ILLEGAL_ABSTRACT_CLASS_NAME; +import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck.MSG_NO_ABSTRACT_CLASS_MODIFIER; import java.io.File; import java.io.IOException; @@ -49,10 +49,11 @@ final String pattern = "^Abstract.+$"; final String[] expected = { - "3:1: " + getCheckMessage(ILLEGAL_ABSTRACT_CLASS_NAME, "InputAbstractClassName", + "3:1: " + getCheckMessage(MSG_ILLEGAL_ABSTRACT_CLASS_NAME, "InputAbstractClassName", pattern), - "6:1: " + getCheckMessage(ILLEGAL_ABSTRACT_CLASS_NAME, "NonAbstractClassName", pattern), - "10:5: " + getCheckMessage(ILLEGAL_ABSTRACT_CLASS_NAME, "NonAbstractInnerClass", + "6:1: " + getCheckMessage(MSG_ILLEGAL_ABSTRACT_CLASS_NAME, "NonAbstractClassName", + pattern), + "10:5: " + getCheckMessage(MSG_ILLEGAL_ABSTRACT_CLASS_NAME, "NonAbstractInnerClass", pattern), }; @@ -69,10 +70,11 @@ checkConfig.addAttribute("format", pattern); final String[] expected = { - "3:1: " + getCheckMessage(ILLEGAL_ABSTRACT_CLASS_NAME, "InputAbstractClassName", + "3:1: " + getCheckMessage(MSG_ILLEGAL_ABSTRACT_CLASS_NAME, "InputAbstractClassName", + pattern), + "9:1: " + getCheckMessage(MSG_ILLEGAL_ABSTRACT_CLASS_NAME, "AbstractClassOther", pattern), - "9:1: " + getCheckMessage(ILLEGAL_ABSTRACT_CLASS_NAME, "AbstractClassOther", pattern), - "21:1: " + getCheckMessage(ILLEGAL_ABSTRACT_CLASS_NAME, "AbstractClassName2", + "21:1: " + getCheckMessage(MSG_ILLEGAL_ABSTRACT_CLASS_NAME, "AbstractClassName2", pattern), }; @@ -86,8 +88,8 @@ checkConfig.addAttribute("ignoreModifier", "false"); final String[] expected = { - "18:1: " + getCheckMessage(NO_ABSTRACT_CLASS_MODIFIER, "AbstractClass"), - "22:5: " + getCheckMessage(NO_ABSTRACT_CLASS_MODIFIER, "AbstractInnerClass"), + "18:1: " + getCheckMessage(MSG_NO_ABSTRACT_CLASS_MODIFIER, "AbstractClass"), + "22:5: " + getCheckMessage(MSG_NO_ABSTRACT_CLASS_MODIFIER, "AbstractInnerClass"), }; verify(checkConfig, getPath("InputAbstractClassName.java"), expected); @@ -102,13 +104,14 @@ final String pattern = "^Abstract.+$"; final String[] expected = { - "3:1: " + getCheckMessage(ILLEGAL_ABSTRACT_CLASS_NAME, "InputAbstractClassName", + "3:1: " + getCheckMessage(MSG_ILLEGAL_ABSTRACT_CLASS_NAME, "InputAbstractClassName", + pattern), + "6:1: " + getCheckMessage(MSG_ILLEGAL_ABSTRACT_CLASS_NAME, "NonAbstractClassName", pattern), - "6:1: " + getCheckMessage(ILLEGAL_ABSTRACT_CLASS_NAME, "NonAbstractClassName", pattern), - "10:5: " + getCheckMessage(ILLEGAL_ABSTRACT_CLASS_NAME, "NonAbstractInnerClass", + "10:5: " + getCheckMessage(MSG_ILLEGAL_ABSTRACT_CLASS_NAME, "NonAbstractInnerClass", pattern), - "18:1: " + getCheckMessage(NO_ABSTRACT_CLASS_MODIFIER, "AbstractClass"), - "22:5: " + getCheckMessage(NO_ABSTRACT_CLASS_MODIFIER, "AbstractInnerClass"), + "18:1: " + getCheckMessage(MSG_NO_ABSTRACT_CLASS_MODIFIER, "AbstractClass"), + "22:5: " + getCheckMessage(MSG_NO_ABSTRACT_CLASS_MODIFIER, "AbstractInnerClass"), }; verify(checkConfig, getPath("InputAbstractClassName.java"), expected); @@ -119,7 +122,7 @@ final DefaultConfiguration checkConfig = createCheckConfig(AbstractClassNameCheck.class); final String[] expected = { - "9:5: " + getCheckMessage(NO_ABSTRACT_CLASS_MODIFIER, "AbstractClass"), + "9:5: " + getCheckMessage(MSG_NO_ABSTRACT_CLASS_MODIFIER, "AbstractClass"), }; verify(checkConfig, getPath("InputAbstractClassNameFormerFalsePositive.java"), expected); diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/CatchParameterNameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/CatchParameterNameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/CatchParameterNameCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/CatchParameterNameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ClassTypeParameterNameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ClassTypeParameterNameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ClassTypeParameterNameCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ClassTypeParameterNameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ConstantNameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ConstantNameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ConstantNameCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ConstantNameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalFinalVariableNameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalFinalVariableNameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalFinalVariableNameCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalFinalVariableNameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodTypeParameterNameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodTypeParameterNameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodTypeParameterNameCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodTypeParameterNameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/TypeNameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/TypeNameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/TypeNameCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/TypeNameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,6 +19,7 @@ package com.puppycrawl.tools.checkstyle.checks; +import static com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck.MSG_KEY; import static org.junit.Assert.assertArrayEquals; import java.io.File; @@ -108,7 +109,7 @@ public void testWrongDefault() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(OuterTypeFilenameCheck.class); final String[] expected = { - "4: " + getCheckMessage("type.file.mismatch"), + "4: " + getCheckMessage(MSG_KEY), }; verify(checkConfig, getPath("InputOuterTypeFilename5.java"), expected); } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,10 +19,10 @@ package com.puppycrawl.tools.checkstyle.checks.regexp; -import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.EMPTY; -import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.REGEXP_EXCEEDED; -import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.REGEXP_MINIMUM; -import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.STACKOVERFLOW; +import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.MSG_EMPTY; +import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.MSG_REGEXP_EXCEEDED; +import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.MSG_REGEXP_MINIMUM; +import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.MSG_STACKOVERFLOW; import java.io.File; import java.io.IOException; @@ -60,7 +60,7 @@ final String illegal = "System\\.(out)|(err)\\.print(ln)?\\("; checkConfig.addAttribute("format", illegal); final String[] expected = { - "69: " + getCheckMessage(REGEXP_EXCEEDED, illegal), + "69: " + getCheckMessage(MSG_REGEXP_EXCEEDED, illegal), }; verify(checkConfig, getPath("InputSemantic.java"), expected); } @@ -84,7 +84,7 @@ checkConfig.addAttribute("format", illegal); checkConfig.addAttribute("ignoreCase", "true"); final String[] expected = { - "69: " + getCheckMessage(REGEXP_EXCEEDED, illegal), + "69: " + getCheckMessage(MSG_REGEXP_EXCEEDED, illegal), }; verify(checkConfig, getPath("InputSemantic.java"), expected); } @@ -103,9 +103,9 @@ final String illegal = "^import"; checkConfig.addAttribute("format", illegal); final String[] expected = { - "7: " + getCheckMessage(REGEXP_EXCEEDED, illegal), - "8: " + getCheckMessage(REGEXP_EXCEEDED, illegal), - "9: " + getCheckMessage(REGEXP_EXCEEDED, illegal), + "7: " + getCheckMessage(MSG_REGEXP_EXCEEDED, illegal), + "8: " + getCheckMessage(MSG_REGEXP_EXCEEDED, illegal), + "9: " + getCheckMessage(MSG_REGEXP_EXCEEDED, illegal), }; verify(checkConfig, getPath("InputSemantic.java"), expected); } @@ -116,8 +116,8 @@ checkConfig.addAttribute("format", illegal); checkConfig.addAttribute("maximum", "0"); final String[] expected = { - "1: " + getCheckMessage(REGEXP_EXCEEDED, illegal), - "3: " + getCheckMessage(REGEXP_EXCEEDED, illegal), + "1: " + getCheckMessage(MSG_REGEXP_EXCEEDED, illegal), + "3: " + getCheckMessage(MSG_REGEXP_EXCEEDED, illegal), }; final File file = temporaryFolder.newFile(); @@ -136,7 +136,7 @@ public void testEmptyFormat() throws Exception { checkConfig.addAttribute("format", null); final String[] expected = { - "0: " + getCheckMessage(EMPTY), + "0: " + getCheckMessage(MSG_EMPTY), }; verify(checkConfig, getPath("InputSemantic.java"), expected); } @@ -147,7 +147,7 @@ checkConfig.addAttribute("format", "(x|y)*"); final String[] expected = { - "0: " + getCheckMessage(STACKOVERFLOW), + "0: " + getCheckMessage(MSG_STACKOVERFLOW), }; final File file = temporaryFolder.newFile(); @@ -162,7 +162,7 @@ checkConfig.addAttribute("format", illegal); checkConfig.addAttribute("minimum", "5"); final String[] expected = { - "0: " + getCheckMessage(REGEXP_MINIMUM, "5", illegal), + "0: " + getCheckMessage(MSG_REGEXP_MINIMUM, "5", illegal), }; final File file = temporaryFolder.newFile(); diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpOnFilenameCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpOnFilenameCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpOnFilenameCheckTest.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpOnFilenameCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1,241 @@ +//////////////////////////////////////////////////////////////////////////////// +// checkstyle: Checks Java source code for adherence to a set of rules. +// Copyright (C) 2001-2016 the original author or authors. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +//////////////////////////////////////////////////////////////////////////////// + +package com.puppycrawl.tools.checkstyle.checks.regexp; + +import static com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck.MSG_MATCH; +import static com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck.MSG_MISMATCH; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.io.File; +import java.io.IOException; + +import org.apache.commons.lang3.ArrayUtils; +import org.junit.Test; + +import com.puppycrawl.tools.checkstyle.BaseFileSetCheckTestSupport; +import com.puppycrawl.tools.checkstyle.DefaultConfiguration; +import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + +public class RegexpOnFilenameCheckTest extends BaseFileSetCheckTestSupport { + @Override + protected String getPath(String filename) throws IOException { + return super.getPath("checks" + File.separator + "regexp" + File.separator + filename); + } + + @Test + public void testDefaultConfigurationOnValidInput() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + verify(checkConfig, getPath("InputSemantic.java"), ArrayUtils.EMPTY_STRING_ARRAY); + } + + @Test + public void testDefaultProperties() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + final String path = getPath("Input Space.properties"); + final String[] expected = { + "0: " + getCheckMessage(MSG_MATCH, "", "\\s"), + }; + verify(checkConfig, path, expected); + } + + @Test + public void testMatchFileMatches() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("match", "true"); + checkConfig.addAttribute("fileNamePattern", ".*\\.java"); + final String path = getPath("InputSemantic.java"); + final String[] expected = { + "0: " + getCheckMessage(MSG_MATCH, "", ".*\\.java"), + }; + verify(checkConfig, path, expected); + } + + @Test + public void testMatchFileNotMatches() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("match", "true"); + checkConfig.addAttribute("fileNamePattern", "BAD.*"); + verify(checkConfig, getPath("InputSemantic.java"), ArrayUtils.EMPTY_STRING_ARRAY); + } + + @Test + public void testNotMatchFileMatches() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("match", "false"); + checkConfig.addAttribute("fileNamePattern", ".*\\.properties"); + final String path = getPath("InputSemantic.java"); + final String[] expected = { + "0: " + getCheckMessage(MSG_MISMATCH, "", ".*\\.properties"), + }; + verify(checkConfig, path, expected); + } + + @Test + public void testNotMatchFileNotMatches() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("match", "false"); + checkConfig.addAttribute("fileNamePattern", ".*\\.java"); + verify(checkConfig, getPath("InputSemantic.java"), ArrayUtils.EMPTY_STRING_ARRAY); + } + + @Test + public void testMatchFolderMatches() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("match", "true"); + checkConfig.addAttribute("folderPattern", ".*[\\\\/]resources[\\\\/].*"); + final String path = getPath("InputSemantic.java"); + final String[] expected = { + "0: " + getCheckMessage(MSG_MATCH, ".*[\\\\/]resources[\\\\/].*", ""), + }; + verify(checkConfig, path, expected); + } + + @Test + public void testMatchFolderNotMatches() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("match", "true"); + checkConfig.addAttribute("folderPattern", "BAD.*"); + verify(checkConfig, getPath("InputSemantic.java"), ArrayUtils.EMPTY_STRING_ARRAY); + } + + @Test + public void testNotMatchFolderMatches() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("match", "false"); + checkConfig.addAttribute("folderPattern", ".*[\\\\/]gov[\\\\/].*"); + final String path = getPath("InputSemantic.java"); + final String[] expected = { + "0: " + getCheckMessage(MSG_MISMATCH, ".*[\\\\/]gov[\\\\/].*", ""), + }; + verify(checkConfig, path, expected); + } + + @Test + public void testNotMatchFolderNotMatches() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("match", "false"); + checkConfig.addAttribute("folderPattern", ".*[\\\\/]resources[\\\\/].*"); + verify(checkConfig, getPath("InputSemantic.java"), ArrayUtils.EMPTY_STRING_ARRAY); + } + + @Test + public void testMatchFolderAndFileMatches() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("match", "true"); + checkConfig.addAttribute("folderPattern", ".*[\\\\/]resources[\\\\/].*"); + checkConfig.addAttribute("fileNamePattern", ".*\\.java"); + final String path = getPath("InputSemantic.java"); + final String[] expected = { + "0: " + getCheckMessage(MSG_MATCH, ".*[\\\\/]resources[\\\\/].*", ".*\\.java"), + }; + verify(checkConfig, path, expected); + } + + @Test + public void testMatchFolderAndFileNotMatchesBoth() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("match", "true"); + checkConfig.addAttribute("folderPattern", "BAD.*"); + checkConfig.addAttribute("fileNamePattern", ".*\\.properties"); + verify(checkConfig, getPath("InputSemantic.java"), ArrayUtils.EMPTY_STRING_ARRAY); + } + + @Test + public void testMatchFolderAndFileNotMatchesFile() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("match", "true"); + checkConfig.addAttribute("folderPattern", ".*[\\\\/]resources[\\\\/].*"); + checkConfig.addAttribute("fileNamePattern", ".*\\.properties"); + verify(checkConfig, getPath("InputSemantic.java"), ArrayUtils.EMPTY_STRING_ARRAY); + } + + @Test + public void testMatchFolderAndFileNotMatchesFolder() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("match", "true"); + checkConfig.addAttribute("folderPattern", "BAD.*"); + checkConfig.addAttribute("fileNamePattern", ".*\\.java"); + verify(checkConfig, getPath("InputSemantic.java"), ArrayUtils.EMPTY_STRING_ARRAY); + } + + @Test + public void testNotMatchFolderAndFileMatches() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("match", "false"); + checkConfig.addAttribute("folderPattern", ".*[\\\\/]com[\\\\/].*"); + checkConfig.addAttribute("fileNamePattern", ".*\\.dat"); + final String path = getPath("InputSemantic.java"); + final String[] expected = { + "0: " + getCheckMessage(MSG_MISMATCH, ".*[\\\\/]com[\\\\/].*", ".*\\.dat"), + }; + verify(checkConfig, path, expected); + } + + @Test + public void testNotMatchFolderAndFileNotMatchesFolder() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("match", "false"); + checkConfig.addAttribute("folderPattern", ".*[\\\\/]javastrangefolder[\\\\/].*"); + checkConfig.addAttribute("fileNamePattern", ".*\\.dat"); + verify(checkConfig, getPath("InputSemantic.java"), ArrayUtils.EMPTY_STRING_ARRAY); + } + + @Test + public void testNotMatchFolderAndFileNotMatchesFile() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("match", "false"); + checkConfig.addAttribute("folderPattern", ".*[\\\\/]govstrangefolder[\\\\/].*"); + checkConfig.addAttribute("fileNamePattern", ".*\\.java"); + verify(checkConfig, getPath("InputSemantic.java"), ArrayUtils.EMPTY_STRING_ARRAY); + } + + @Test + public void testIgnoreExtension() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("fileNamePattern", ".*\\.java"); + checkConfig.addAttribute("ignoreFileNameExtensions", "true"); + verify(checkConfig, getPath("InputSemantic.java"), ArrayUtils.EMPTY_STRING_ARRAY); + } + + @Test + public void testIgnoreExtensionNoExtension() throws Exception { + final DefaultConfiguration checkConfig = createCheckConfig(RegexpOnFilenameCheck.class); + checkConfig.addAttribute("fileNamePattern", "\\."); + checkConfig.addAttribute("ignoreFileNameExtensions", "true"); + verify(checkConfig, getPath("InputNoExtension"), ArrayUtils.EMPTY_STRING_ARRAY); + } + + @Test + public void testException() throws Exception { + // escape character needed for testing IOException from File.getCanonicalPath on all OSes + final File file = new File(getPath("") + "\u0000" + File.separatorChar + "Test"); + try { + final RegexpOnFilenameCheck check = new RegexpOnFilenameCheck(); + check.setFileNamePattern("BAD"); + check.process(file, null); + fail("CheckstyleException expected"); + } + catch (CheckstyleException ex) { + assertEquals("unable to create canonical path names for " + file.getAbsolutePath(), + ex.getMessage()); + } + } +} diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,8 +19,8 @@ package com.puppycrawl.tools.checkstyle.checks.regexp; -import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.REGEXP_EXCEEDED; -import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.REGEXP_MINIMUM; +import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.MSG_REGEXP_EXCEEDED; +import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.MSG_REGEXP_MINIMUM; import java.io.File; import java.io.IOException; @@ -51,7 +51,7 @@ final String illegal = "System\\.(out)|(err)\\.print(ln)?\\("; checkConfig.addAttribute("format", illegal); final String[] expected = { - "69: " + getCheckMessage(REGEXP_EXCEEDED, illegal), + "69: " + getCheckMessage(MSG_REGEXP_EXCEEDED, illegal), }; verify(checkConfig, getPath("InputSemantic.java"), expected); } @@ -77,7 +77,7 @@ checkConfig.addAttribute("maximum", "0"); final String[] expected = { - "69: " + getCheckMessage(REGEXP_EXCEEDED, illegal), + "69: " + getCheckMessage(MSG_REGEXP_EXCEEDED, illegal), }; verify(checkConfig, getPath("InputSemantic.java"), expected); } @@ -97,7 +97,7 @@ checkConfig.addAttribute("format", illegal); checkConfig.addAttribute("minimum", "500"); final String[] expected = { - "0: " + getCheckMessage(REGEXP_MINIMUM, "500", illegal), + "0: " + getCheckMessage(MSG_REGEXP_MINIMUM, "500", illegal), }; verify(checkConfig, getPath("InputSemantic.java"), expected); diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,8 +19,8 @@ package com.puppycrawl.tools.checkstyle.checks.regexp; -import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.REGEXP_EXCEEDED; -import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.REGEXP_MINIMUM; +import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.MSG_REGEXP_EXCEEDED; +import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.MSG_REGEXP_MINIMUM; import static org.junit.Assert.assertArrayEquals; import java.io.File; @@ -58,7 +58,7 @@ final String illegal = "System\\.(out)|(err)\\.print(ln)?\\("; checkConfig.addAttribute("format", illegal); final String[] expected = { - "69: " + getCheckMessage(REGEXP_EXCEEDED, illegal), + "69: " + getCheckMessage(MSG_REGEXP_EXCEEDED, illegal), }; verify(checkConfig, getPath("InputSemantic.java"), expected); } @@ -82,7 +82,7 @@ checkConfig.addAttribute("format", illegal); checkConfig.addAttribute("ignoreCase", "true"); final String[] expected = { - "69: " + getCheckMessage(REGEXP_EXCEEDED, illegal), + "69: " + getCheckMessage(MSG_REGEXP_EXCEEDED, illegal), }; verify(checkConfig, getPath("InputSemantic.java"), expected); } @@ -113,7 +113,7 @@ checkConfig.addAttribute("format", illegal); checkConfig.addAttribute("ignoreComments", "false"); final String[] expected = { - "4: " + getCheckMessage(REGEXP_EXCEEDED, illegal), + "4: " + getCheckMessage(MSG_REGEXP_EXCEEDED, illegal), }; verify(checkConfig, getPath("InputTrailingComment.java"), expected); } @@ -134,7 +134,7 @@ checkConfig.addAttribute("format", illegal); checkConfig.addAttribute("ignoreComments", "false"); final String[] expected = { - "19: " + getCheckMessage(REGEXP_EXCEEDED, illegal), + "19: " + getCheckMessage(MSG_REGEXP_EXCEEDED, illegal), }; verify(checkConfig, getPath("InputTrailingComment.java"), expected); } @@ -173,7 +173,7 @@ checkConfig.addAttribute("format", illegal); checkConfig.addAttribute("ignoreComments", "true"); final String[] expected = { - "22: " + getCheckMessage(REGEXP_EXCEEDED, illegal), + "22: " + getCheckMessage(MSG_REGEXP_EXCEEDED, illegal), }; verify(checkConfig, getPath("InputTrailingComment.java"), expected); } @@ -184,7 +184,7 @@ checkConfig.addAttribute("format", illegal); checkConfig.addAttribute("ignoreComments", "true"); final String[] expected = { - "23: " + getCheckMessage(REGEXP_EXCEEDED, illegal), + "23: " + getCheckMessage(MSG_REGEXP_EXCEEDED, illegal), }; verify(checkConfig, getPath("InputTrailingComment.java"), expected); } @@ -236,7 +236,7 @@ checkConfig.addAttribute("minimum", "1"); checkConfig.addAttribute("maximum", "1000"); final String[] expected = { - "0: " + getCheckMessage(REGEXP_MINIMUM, 1, required), + "0: " + getCheckMessage(MSG_REGEXP_MINIMUM, 1, required), }; verify(checkConfig, getPath("InputSemantic.java"), expected); } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolderTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolderTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolderTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolderTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -44,9 +44,13 @@ import org.powermock.modules.junit4.PowerMockRunner; import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport; +import com.puppycrawl.tools.checkstyle.Checker; +import com.puppycrawl.tools.checkstyle.api.AuditEvent; import com.puppycrawl.tools.checkstyle.api.Configuration; import com.puppycrawl.tools.checkstyle.api.DetailAST; +import com.puppycrawl.tools.checkstyle.api.LocalizedMessage; import com.puppycrawl.tools.checkstyle.api.TokenTypes; +import com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck; @RunWith(PowerMockRunner.class) @PrepareForTest({ SuppressWarningsHolder.class, SuppressWarningsHolderTest.class }) @@ -140,7 +144,12 @@ entries.setAccessible(true); entries.set(holder, threadLocal); - assertFalse(SuppressWarningsHolder.isSuppressed("SourceName", 100, 10)); + final Checker source = new Checker(); + final LocalizedMessage message = + new LocalizedMessage(100, 10, null, null, null, "id", MemberNameCheck.class, "message"); + final AuditEvent event = new AuditEvent(source, "fileName", message); + + assertFalse(SuppressWarningsHolder.isSuppressed(event)); } @Test @@ -164,11 +173,24 @@ entries.setAccessible(true); entries.set(holder, threadLocal); - assertFalse(SuppressWarningsHolder.isSuppressed("SourceName", 100, 10)); - - assertTrue(SuppressWarningsHolder.isSuppressed("SourceName", 100, 150)); - - assertTrue(SuppressWarningsHolder.isSuppressed("SourceName", 200, 1)); + final Checker source = new Checker(); + final LocalizedMessage firstMessageForTest = + new LocalizedMessage(100, 10, null, null, null, "id", MemberNameCheck.class, "msg"); + final AuditEvent firstEventForTest = + new AuditEvent(source, "fileName", firstMessageForTest); + assertFalse(SuppressWarningsHolder.isSuppressed(firstEventForTest)); + + final LocalizedMessage secondMessageForTest = + new LocalizedMessage(100, 150, null, null, null, "id", MemberNameCheck.class, "msg"); + final AuditEvent secondEventForTest = + new AuditEvent(source, "fileName", secondMessageForTest); + assertTrue(SuppressWarningsHolder.isSuppressed(secondEventForTest)); + + final LocalizedMessage thirdMessageForTest = + new LocalizedMessage(200, 1, null, null, null, "id", MemberNameCheck.class, "msg"); + final AuditEvent thirdEventForTest = + new AuditEvent(source, "fileName", thirdMessageForTest); + assertTrue(SuppressWarningsHolder.isSuppressed(thirdEventForTest)); } @Test diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,7 +19,7 @@ package com.puppycrawl.tools.checkstyle.checks; -import static com.puppycrawl.tools.checkstyle.checks.UniquePropertiesCheck.IO_EXCEPTION_KEY; +import static com.puppycrawl.tools.checkstyle.checks.UniquePropertiesCheck.MSG_IO_EXCEPTION_KEY; import static com.puppycrawl.tools.checkstyle.checks.UniquePropertiesCheck.MSG_KEY; import static org.junit.Assert.assertEquals; @@ -124,7 +124,7 @@ retrievedMessage); assertEquals("Message '" + message.getMessage() + "' is not valid", message.getMessage(), - getCheckMessage(IO_EXCEPTION_KEY, fileName, getFileNotFoundDetail(file))); + getCheckMessage(MSG_IO_EXCEPTION_KEY, fileName, getFileNotFoundDetail(file))); } @Test diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForInitializerPadCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForInitializerPadCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForInitializerPadCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForInitializerPadCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForIteratorPadCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForIteratorPadCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForIteratorPadCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForIteratorPadCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,8 +19,8 @@ package com.puppycrawl.tools.checkstyle.checks.whitespace; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck.WS_FOLLOWED; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck.WS_NOT_FOLLOWED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck.MSG_WS_FOLLOWED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck.MSG_WS_NOT_FOLLOWED; import static org.junit.Assert.assertArrayEquals; import java.io.File; @@ -60,9 +60,9 @@ @Test public void testDefault() throws Exception { final String[] expected = { - "27:31: " + getCheckMessage(WS_FOLLOWED, ";"), - "43:32: " + getCheckMessage(WS_FOLLOWED, ";"), - "55:11: " + getCheckMessage(WS_FOLLOWED, ";"), + "27:31: " + getCheckMessage(MSG_WS_FOLLOWED, ";"), + "43:32: " + getCheckMessage(MSG_WS_FOLLOWED, ";"), + "55:11: " + getCheckMessage(MSG_WS_FOLLOWED, ";"), }; verify(checkConfig, getPath("InputForWhitespace.java"), expected); } @@ -71,7 +71,7 @@ public void testSpaceOption() throws Exception { checkConfig.addAttribute("option", PadOption.SPACE.toString()); final String[] expected = { - "23:31: " + getCheckMessage(WS_NOT_FOLLOWED, ";"), + "23:31: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ";"), }; verify(checkConfig, getPath("InputForWhitespace.java"), expected); } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/FileTabCharacterCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/FileTabCharacterCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/FileTabCharacterCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/FileTabCharacterCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,8 +19,8 @@ package com.puppycrawl.tools.checkstyle.checks.whitespace; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck.CONTAINS_TAB; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck.FILE_CONTAINS_TAB; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck.MSG_CONTAINS_TAB; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck.MSG_FILE_CONTAINS_TAB; import java.io.File; import java.io.IOException; @@ -51,7 +51,7 @@ public void testDefault() throws Exception { final DefaultConfiguration checkConfig = createConfig(false); final String[] expected = { - "19:25: " + getCheckMessage(FILE_CONTAINS_TAB), + "19:25: " + getCheckMessage(MSG_FILE_CONTAINS_TAB), }; final File[] files = { new File(getPath("InputSimple.java")), @@ -64,14 +64,14 @@ public void testVerbose() throws Exception { final DefaultConfiguration checkConfig = createConfig(true); final String[] expected = { - "19:25: " + getCheckMessage(CONTAINS_TAB), - "145:35: " + getCheckMessage(CONTAINS_TAB), - "146:64: " + getCheckMessage(CONTAINS_TAB), - "154:9: " + getCheckMessage(CONTAINS_TAB), - "155:10: " + getCheckMessage(CONTAINS_TAB), - "156:1: " + getCheckMessage(CONTAINS_TAB), - "157:3: " + getCheckMessage(CONTAINS_TAB), - "158:3: " + getCheckMessage(CONTAINS_TAB), + "19:25: " + getCheckMessage(MSG_CONTAINS_TAB), + "145:35: " + getCheckMessage(MSG_CONTAINS_TAB), + "146:64: " + getCheckMessage(MSG_CONTAINS_TAB), + "154:9: " + getCheckMessage(MSG_CONTAINS_TAB), + "155:10: " + getCheckMessage(MSG_CONTAINS_TAB), + "156:1: " + getCheckMessage(MSG_CONTAINS_TAB), + "157:3: " + getCheckMessage(MSG_CONTAINS_TAB), + "158:3: " + getCheckMessage(MSG_CONTAINS_TAB), }; final File[] files = { new File(getPath("InputSimple.java")), diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/GenericWhitespaceCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/GenericWhitespaceCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/GenericWhitespaceCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/GenericWhitespaceCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,10 +19,10 @@ package com.puppycrawl.tools.checkstyle.checks.whitespace; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck.WS_FOLLOWED; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck.WS_ILLEGAL_FOLLOW; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck.WS_NOT_PRECEDED; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck.WS_PRECEDED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck.MSG_WS_FOLLOWED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck.MSG_WS_ILLEGAL_FOLLOW; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck.MSG_WS_NOT_PRECEDED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck.MSG_WS_PRECEDED; import static org.junit.Assert.assertArrayEquals; import java.io.File; @@ -80,32 +80,32 @@ @Test public void testDefault() throws Exception { final String[] expected = { - "16:13: " + getCheckMessage(WS_PRECEDED, "<"), - "16:15: " + getCheckMessage(WS_FOLLOWED, "<"), - "16:23: " + getCheckMessage(WS_PRECEDED, ">"), - "16:43: " + getCheckMessage(WS_PRECEDED, "<"), - "16:45: " + getCheckMessage(WS_FOLLOWED, "<"), - "16:53: " + getCheckMessage(WS_PRECEDED, ">"), - "17:13: " + getCheckMessage(WS_PRECEDED, "<"), - "17:15: " + getCheckMessage(WS_FOLLOWED, "<"), - "17:20: " + getCheckMessage(WS_PRECEDED, "<"), - "17:22: " + getCheckMessage(WS_FOLLOWED, "<"), - "17:30: " + getCheckMessage(WS_PRECEDED, ">"), - "17:32: " + getCheckMessage(WS_FOLLOWED, ">"), - "17:32: " + getCheckMessage(WS_PRECEDED, ">"), - "17:52: " + getCheckMessage(WS_PRECEDED, "<"), - "17:54: " + getCheckMessage(WS_FOLLOWED, "<"), - "17:59: " + getCheckMessage(WS_PRECEDED, "<"), - "17:61: " + getCheckMessage(WS_FOLLOWED, "<"), - "17:69: " + getCheckMessage(WS_PRECEDED, ">"), - "17:71: " + getCheckMessage(WS_FOLLOWED, ">"), - "17:71: " + getCheckMessage(WS_PRECEDED, ">"), - "30:17: " + getCheckMessage(WS_NOT_PRECEDED, "<"), - "30:21: " + getCheckMessage(WS_ILLEGAL_FOLLOW, ">"), - "42:21: " + getCheckMessage(WS_PRECEDED, "<"), - "42:30: " + getCheckMessage(WS_FOLLOWED, ">"), - "60:60: " + getCheckMessage(WS_NOT_PRECEDED, "&"), - "63:60: " + getCheckMessage(WS_FOLLOWED, ">"), + "16:13: " + getCheckMessage(MSG_WS_PRECEDED, "<"), + "16:15: " + getCheckMessage(MSG_WS_FOLLOWED, "<"), + "16:23: " + getCheckMessage(MSG_WS_PRECEDED, ">"), + "16:43: " + getCheckMessage(MSG_WS_PRECEDED, "<"), + "16:45: " + getCheckMessage(MSG_WS_FOLLOWED, "<"), + "16:53: " + getCheckMessage(MSG_WS_PRECEDED, ">"), + "17:13: " + getCheckMessage(MSG_WS_PRECEDED, "<"), + "17:15: " + getCheckMessage(MSG_WS_FOLLOWED, "<"), + "17:20: " + getCheckMessage(MSG_WS_PRECEDED, "<"), + "17:22: " + getCheckMessage(MSG_WS_FOLLOWED, "<"), + "17:30: " + getCheckMessage(MSG_WS_PRECEDED, ">"), + "17:32: " + getCheckMessage(MSG_WS_FOLLOWED, ">"), + "17:32: " + getCheckMessage(MSG_WS_PRECEDED, ">"), + "17:52: " + getCheckMessage(MSG_WS_PRECEDED, "<"), + "17:54: " + getCheckMessage(MSG_WS_FOLLOWED, "<"), + "17:59: " + getCheckMessage(MSG_WS_PRECEDED, "<"), + "17:61: " + getCheckMessage(MSG_WS_FOLLOWED, "<"), + "17:69: " + getCheckMessage(MSG_WS_PRECEDED, ">"), + "17:71: " + getCheckMessage(MSG_WS_FOLLOWED, ">"), + "17:71: " + getCheckMessage(MSG_WS_PRECEDED, ">"), + "30:17: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "<"), + "30:21: " + getCheckMessage(MSG_WS_ILLEGAL_FOLLOW, ">"), + "42:21: " + getCheckMessage(MSG_WS_PRECEDED, "<"), + "42:30: " + getCheckMessage(MSG_WS_FOLLOWED, ">"), + "60:60: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "&"), + "63:60: " + getCheckMessage(MSG_WS_FOLLOWED, ">"), }; verify(checkConfig, getPath("InputGenericWhitespace.java"), expected); } @@ -131,7 +131,7 @@ @Test public void testMethodReferences2() throws Exception { final String[] expected = { - "7:69: " + getCheckMessage(WS_FOLLOWED, ">"), + "7:69: " + getCheckMessage(MSG_WS_FOLLOWED, ">"), }; verify(checkConfig, getNonCompilablePath("InputGenericWhitespaceMethodRef.java"), expected); } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/MethodParamPadCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/MethodParamPadCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/MethodParamPadCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/MethodParamPadCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,9 +19,9 @@ package com.puppycrawl.tools.checkstyle.checks.whitespace; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck.LINE_PREVIOUS; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck.WS_NOT_PRECEDED; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck.WS_PRECEDED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck.MSG_LINE_PREVIOUS; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck.MSG_WS_NOT_PRECEDED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck.MSG_WS_PRECEDED; import static org.junit.Assert.assertArrayEquals; import java.io.File; @@ -60,24 +60,24 @@ @Test public void testDefault() throws Exception { final String[] expected = { - "11:32: " + getCheckMessage(WS_PRECEDED, "("), - "13:15: " + getCheckMessage(WS_PRECEDED, "("), - "17:9: " + getCheckMessage(LINE_PREVIOUS, "("), - "20:13: " + getCheckMessage(LINE_PREVIOUS, "("), - "27:24: " + getCheckMessage(WS_PRECEDED, "("), - "32:9: " + getCheckMessage(LINE_PREVIOUS, "("), - "36:39: " + getCheckMessage(WS_PRECEDED, "("), - "38:13: " + getCheckMessage(LINE_PREVIOUS, "("), - "42:16: " + getCheckMessage(WS_PRECEDED, "("), - "44:13: " + getCheckMessage(LINE_PREVIOUS, "("), - "50:21: " + getCheckMessage(WS_PRECEDED, "("), - "52:13: " + getCheckMessage(LINE_PREVIOUS, "("), - "56:18: " + getCheckMessage(WS_PRECEDED, "("), - "58:13: " + getCheckMessage(LINE_PREVIOUS, "("), - "61:36: " + getCheckMessage(WS_PRECEDED, "("), - "63:13: " + getCheckMessage(LINE_PREVIOUS, "("), - "74:15: " + getCheckMessage(WS_PRECEDED, "("), - "79:13: " + getCheckMessage(LINE_PREVIOUS, "("), + "11:32: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "13:15: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "17:9: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), + "20:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), + "27:24: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "32:9: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), + "36:39: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "38:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), + "42:16: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "44:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), + "50:21: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "52:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), + "56:18: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "58:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), + "61:36: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "63:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), + "74:15: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "79:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), }; verify(checkConfig, getPath("InputMethodParamPad.java"), expected); } @@ -86,15 +86,15 @@ public void testAllowLineBreaks() throws Exception { checkConfig.addAttribute("allowLineBreaks", "true"); final String[] expected = { - "11:32: " + getCheckMessage(WS_PRECEDED, "("), - "13:15: " + getCheckMessage(WS_PRECEDED, "("), - "27:24: " + getCheckMessage(WS_PRECEDED, "("), - "36:39: " + getCheckMessage(WS_PRECEDED, "("), - "42:16: " + getCheckMessage(WS_PRECEDED, "("), - "50:21: " + getCheckMessage(WS_PRECEDED, "("), - "56:18: " + getCheckMessage(WS_PRECEDED, "("), - "61:36: " + getCheckMessage(WS_PRECEDED, "("), - "74:15: " + getCheckMessage(WS_PRECEDED, "("), + "11:32: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "13:15: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "27:24: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "36:39: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "42:16: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "50:21: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "56:18: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "61:36: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "74:15: " + getCheckMessage(MSG_WS_PRECEDED, "("), }; verify(checkConfig, getPath("InputMethodParamPad.java"), expected); } @@ -103,28 +103,28 @@ public void testSpaceOption() throws Exception { checkConfig.addAttribute("option", "space"); final String[] expected = { - "6:31: " + getCheckMessage(WS_NOT_PRECEDED, "("), - "8:14: " + getCheckMessage(WS_NOT_PRECEDED, "("), - "17:9: " + getCheckMessage(LINE_PREVIOUS, "("), - "20:13: " + getCheckMessage(LINE_PREVIOUS, "("), - "23:23: " + getCheckMessage(WS_NOT_PRECEDED, "("), - "32:9: " + getCheckMessage(LINE_PREVIOUS, "("), - "35:58: " + getCheckMessage(WS_NOT_PRECEDED, "("), - "38:13: " + getCheckMessage(LINE_PREVIOUS, "("), - "41:15: " + getCheckMessage(WS_NOT_PRECEDED, "("), - "44:13: " + getCheckMessage(LINE_PREVIOUS, "("), - "47:28: " + getCheckMessage(WS_NOT_PRECEDED, "("), - "49:20: " + getCheckMessage(WS_NOT_PRECEDED, "("), - "52:13: " + getCheckMessage(LINE_PREVIOUS, "("), - "54:56: " + getCheckMessage(WS_NOT_PRECEDED, "("), - "55:17: " + getCheckMessage(WS_NOT_PRECEDED, "("), - "58:13: " + getCheckMessage(LINE_PREVIOUS, "("), - "60:35: " + getCheckMessage(WS_NOT_PRECEDED, "("), - "63:13: " + getCheckMessage(LINE_PREVIOUS, "("), - "66:25: " + getCheckMessage(WS_NOT_PRECEDED, "("), - "69:66: " + getCheckMessage(WS_NOT_PRECEDED, "("), - "70:57: " + getCheckMessage(WS_NOT_PRECEDED, "("), - "79:13: " + getCheckMessage(LINE_PREVIOUS, "("), + "6:31: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + "8:14: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + "17:9: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), + "20:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), + "23:23: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + "32:9: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), + "35:58: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + "38:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), + "41:15: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + "44:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), + "47:28: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + "49:20: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + "52:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), + "54:56: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + "55:17: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + "58:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), + "60:35: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + "63:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), + "66:25: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + "69:66: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + "70:57: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + "79:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "("), }; verify(checkConfig, getPath("InputMethodParamPad.java"), expected); } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoLineWrapCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoLineWrapCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoLineWrapCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoLineWrapCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/OperatorWrapCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/OperatorWrapCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/OperatorWrapCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/OperatorWrapCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,8 +19,8 @@ package com.puppycrawl.tools.checkstyle.checks.whitespace; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck.LINE_NEW; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck.LINE_PREVIOUS; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck.MSG_LINE_NEW; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck.MSG_LINE_PREVIOUS; import java.io.File; import java.io.IOException; @@ -52,11 +52,11 @@ public void testDefault() throws Exception { final String[] expected = { - "15:19: " + getCheckMessage(LINE_NEW, "+"), - "16:15: " + getCheckMessage(LINE_NEW, "-"), - "24:18: " + getCheckMessage(LINE_NEW, "&&"), - "39:30: " + getCheckMessage(LINE_NEW, "&"), - "52:30: " + getCheckMessage(LINE_NEW, "&"), + "15:19: " + getCheckMessage(MSG_LINE_NEW, "+"), + "16:15: " + getCheckMessage(MSG_LINE_NEW, "-"), + "24:18: " + getCheckMessage(MSG_LINE_NEW, "&&"), + "39:30: " + getCheckMessage(MSG_LINE_NEW, "&"), + "52:30: " + getCheckMessage(MSG_LINE_NEW, "&"), }; verify(checkConfig, getPath("InputOpWrap.java"), expected); } @@ -66,9 +66,9 @@ throws Exception { checkConfig.addAttribute("option", WrapOption.EOL.toString()); final String[] expected = { - "18:13: " + getCheckMessage(LINE_PREVIOUS, "-"), - "22:13: " + getCheckMessage(LINE_PREVIOUS, "&&"), - "27:13: " + getCheckMessage(LINE_PREVIOUS, "&&"), + "18:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "-"), + "22:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "&&"), + "27:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "&&"), }; verify(checkConfig, getPath("InputOpWrap.java"), expected); } @@ -79,7 +79,7 @@ checkConfig.addAttribute("tokens", "ASSIGN"); checkConfig.addAttribute("option", WrapOption.EOL.toString()); final String[] expected = { - "33:13: " + getCheckMessage(LINE_PREVIOUS, "="), + "33:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "="), }; verify(checkConfig, getPath("InputOpWrap.java"), expected); } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/ParenPadCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/ParenPadCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/ParenPadCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/ParenPadCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,10 +19,10 @@ package com.puppycrawl.tools.checkstyle.checks.whitespace; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck.WS_FOLLOWED; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck.WS_NOT_FOLLOWED; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck.WS_NOT_PRECEDED; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck.WS_PRECEDED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck.MSG_WS_FOLLOWED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck.MSG_WS_NOT_FOLLOWED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck.MSG_WS_NOT_PRECEDED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck.MSG_WS_PRECEDED; import java.io.File; import java.io.IOException; @@ -48,15 +48,15 @@ final DefaultConfiguration checkConfig = createCheckConfig(ParenPadCheck.class); final String[] expected = { - "58:12: " + getCheckMessage(WS_FOLLOWED, "("), - "58:36: " + getCheckMessage(WS_PRECEDED, ")"), - "74:13: " + getCheckMessage(WS_FOLLOWED, "("), - "74:18: " + getCheckMessage(WS_PRECEDED, ")"), - "232:27: " + getCheckMessage(WS_PRECEDED, ")"), - "241:24: " + getCheckMessage(WS_FOLLOWED, "("), - "241:30: " + getCheckMessage(WS_PRECEDED, ")"), - "277:18: " + getCheckMessage(WS_FOLLOWED, "("), - "277:23: " + getCheckMessage(WS_PRECEDED, ")"), + "58:12: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "58:36: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "74:13: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "74:18: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "232:27: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "241:24: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "241:30: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "277:18: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "277:23: " + getCheckMessage(MSG_WS_PRECEDED, ")"), }; verify(checkConfig, getPath("InputWhitespace.java"), expected); } @@ -68,39 +68,39 @@ createCheckConfig(ParenPadCheck.class); checkConfig.addAttribute("option", PadOption.SPACE.toString()); final String[] expected = { - "29:20: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "29:23: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "37:22: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "37:26: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "41:15: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "41:33: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "76:20: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "76:21: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "97:22: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "97:28: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "98:14: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "98:18: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "150:28: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "150:32: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "153:16: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "153:20: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "160:21: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "160:34: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "162:20: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "165:10: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "178:14: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "178:36: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "225:14: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "235:14: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "235:39: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "252:21: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "252:93: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "273:26: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "273:36: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "275:29: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "275:42: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "276:18: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "276:33: " + getCheckMessage(WS_NOT_PRECEDED, ")"), + "29:20: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "29:23: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "37:22: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "37:26: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "41:15: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "41:33: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "76:20: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "76:21: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "97:22: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "97:28: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "98:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "98:18: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "150:28: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "150:32: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "153:16: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "153:20: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "160:21: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "160:34: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "162:20: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "165:10: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "178:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "178:36: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "225:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "235:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "235:39: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "252:21: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "252:93: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "273:26: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "273:36: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "275:29: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "275:42: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "276:18: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "276:33: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), }; verify(checkConfig, getPath("InputWhitespace.java"), expected); } @@ -111,13 +111,13 @@ final DefaultConfiguration checkConfig = createCheckConfig(ParenPadCheck.class); final String[] expected = { - "17:34: " + getCheckMessage(WS_PRECEDED, ")"), - "20:35: " + getCheckMessage(WS_PRECEDED, ")"), - "40:14: " + getCheckMessage(WS_FOLLOWED, "("), - "40:36: " + getCheckMessage(WS_PRECEDED, ")"), - "43:14: " + getCheckMessage(WS_FOLLOWED, "("), - "48:27: " + getCheckMessage(WS_PRECEDED, ")"), - "51:26: " + getCheckMessage(WS_PRECEDED, ")"), + "17:34: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "20:35: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "40:14: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "40:36: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "43:14: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "48:27: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "51:26: " + getCheckMessage(MSG_WS_PRECEDED, ")"), }; verify(checkConfig, getPath("InputForWhitespace.java"), expected); } @@ -129,15 +129,15 @@ createCheckConfig(ParenPadCheck.class); checkConfig.addAttribute("option", PadOption.SPACE.toString()); final String[] expected = { - "11:14: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "11:35: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "14:14: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "14:34: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "17:14: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "20:14: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "23:14: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "27:14: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "32:14: " + getCheckMessage(WS_NOT_FOLLOWED, "("), + "11:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "11:35: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "14:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "14:34: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "17:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "20:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "23:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "27:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "32:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), }; verify(checkConfig, getPath("InputForWhitespace.java"), expected); } @@ -158,70 +158,70 @@ createCheckConfig(ParenPadCheck.class); checkConfig.addAttribute("option", PadOption.NOSPACE.toString()); final String[] expected = { - "44:27: " + getCheckMessage(WS_FOLLOWED, "("), - "44:27: " + getCheckMessage(WS_PRECEDED, ")"), - "45:18: " + getCheckMessage(WS_FOLLOWED, "("), - "48:27: " + getCheckMessage(WS_FOLLOWED, "("), - "49:19: " + getCheckMessage(WS_FOLLOWED, "("), - "49:19: " + getCheckMessage(WS_PRECEDED, ")"), - "52:27: " + getCheckMessage(WS_FOLLOWED, "("), - "53:21: " + getCheckMessage(WS_FOLLOWED, "("), - "54:18: " + getCheckMessage(WS_FOLLOWED, "("), - "54:52: " + getCheckMessage(WS_FOLLOWED, "("), - "54:52: " + getCheckMessage(WS_PRECEDED, ")"), - "57:26: " + getCheckMessage(WS_FOLLOWED, "("), - "58:22: " + getCheckMessage(WS_FOLLOWED, "("), - "59:24: " + getCheckMessage(WS_FOLLOWED, "("), - "60:26: " + getCheckMessage(WS_FOLLOWED, "("), - "60:51: " + getCheckMessage(WS_FOLLOWED, "("), - "60:57: " + getCheckMessage(WS_FOLLOWED, "("), - "61:29: " + getCheckMessage(WS_FOLLOWED, "("), - "62:43: " + getCheckMessage(WS_FOLLOWED, "("), - "63:41: " + getCheckMessage(WS_FOLLOWED, "("), - "65:43: " + getCheckMessage(WS_FOLLOWED, "("), - "78:28: " + getCheckMessage(WS_FOLLOWED, "("), - "78:28: " + getCheckMessage(WS_PRECEDED, ")"), - "79:19: " + getCheckMessage(WS_PRECEDED, ")"), - "82:33: " + getCheckMessage(WS_PRECEDED, ")"), - "83:19: " + getCheckMessage(WS_FOLLOWED, "("), - "83:19: " + getCheckMessage(WS_PRECEDED, ")"), - "86:29: " + getCheckMessage(WS_PRECEDED, ")"), - "87:35: " + getCheckMessage(WS_PRECEDED, ")"), - "88:51: " + getCheckMessage(WS_FOLLOWED, "("), - "88:51: " + getCheckMessage(WS_PRECEDED, ")"), - "88:53: " + getCheckMessage(WS_PRECEDED, ")"), - "90:38: " + getCheckMessage(WS_PRECEDED, ")"), - "91:32: " + getCheckMessage(WS_PRECEDED, ")"), - "92:35: " + getCheckMessage(WS_PRECEDED, ")"), - "93:30: " + getCheckMessage(WS_PRECEDED, ")"), - "94:60: " + getCheckMessage(WS_PRECEDED, ")"), - "94:62: " + getCheckMessage(WS_PRECEDED, ")"), - "94:69: " + getCheckMessage(WS_PRECEDED, ")"), - "95:34: " + getCheckMessage(WS_PRECEDED, ")"), - "96:47: " + getCheckMessage(WS_PRECEDED, ")"), - "97:42: " + getCheckMessage(WS_PRECEDED, ")"), - "99:44: " + getCheckMessage(WS_PRECEDED, ")"), - "112:17: " + getCheckMessage(WS_FOLLOWED, "("), - "113:23: " + getCheckMessage(WS_FOLLOWED, "("), - "113:25: " + getCheckMessage(WS_FOLLOWED, "("), - "113:31: " + getCheckMessage(WS_PRECEDED, ")"), - "114:26: " + getCheckMessage(WS_FOLLOWED, "("), - "114:28: " + getCheckMessage(WS_FOLLOWED, "("), - "114:34: " + getCheckMessage(WS_PRECEDED, ")"), - "114:50: " + getCheckMessage(WS_PRECEDED, ")"), - "115:26: " + getCheckMessage(WS_FOLLOWED, "("), - "115:28: " + getCheckMessage(WS_FOLLOWED, "("), - "115:35: " + getCheckMessage(WS_PRECEDED, ")"), - "115:53: " + getCheckMessage(WS_PRECEDED, ")"), - "115:55: " + getCheckMessage(WS_PRECEDED, ")"), - "119:17: " + getCheckMessage(WS_FOLLOWED, "("), - "119:22: " + getCheckMessage(WS_PRECEDED, ")"), - "123:30: " + getCheckMessage(WS_FOLLOWED, "("), - "123:44: " + getCheckMessage(WS_PRECEDED, ")"), - "126:22: " + getCheckMessage(WS_FOLLOWED, "("), - "126:22: " + getCheckMessage(WS_PRECEDED, ")"), - "130:19: " + getCheckMessage(WS_FOLLOWED, "("), - "130:19: " + getCheckMessage(WS_PRECEDED, ")"), + "44:27: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "44:27: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "45:18: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "48:27: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "49:19: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "49:19: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "52:27: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "53:21: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "54:18: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "54:52: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "54:52: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "57:26: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "58:22: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "59:24: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "60:26: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "60:51: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "60:57: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "61:29: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "62:43: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "63:41: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "65:43: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "78:28: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "78:28: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "79:19: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "82:33: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "83:19: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "83:19: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "86:29: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "87:35: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "88:51: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "88:51: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "88:53: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "90:38: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "91:32: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "92:35: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "93:30: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "94:60: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "94:62: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "94:69: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "95:34: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "96:47: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "97:42: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "99:44: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "112:17: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "113:23: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "113:25: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "113:31: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "114:26: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "114:28: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "114:34: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "114:50: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "115:26: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "115:28: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "115:35: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "115:53: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "115:55: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "119:17: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "119:22: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "123:30: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "123:44: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "126:22: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "126:22: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "130:19: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "130:19: " + getCheckMessage(MSG_WS_PRECEDED, ")"), }; verify(checkConfig, getPath("InputParenPad.java"), expected); } @@ -232,11 +232,11 @@ createCheckConfig(ParenPadCheck.class); checkConfig.addAttribute("tokens", "METHOD_CALL"); final String[] expected = { - "90:38: " + getCheckMessage(WS_PRECEDED, ")"), - "112:17: " + getCheckMessage(WS_FOLLOWED, "("), - "113:23: " + getCheckMessage(WS_FOLLOWED, "("), - "115:53: " + getCheckMessage(WS_PRECEDED, ")"), - "115:55: " + getCheckMessage(WS_PRECEDED, ")"), + "90:38: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "112:17: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "113:23: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "115:53: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "115:55: " + getCheckMessage(MSG_WS_PRECEDED, ")"), }; verify(checkConfig, getPath("InputParenPad.java"), expected); } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SeparatorWrapCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SeparatorWrapCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SeparatorWrapCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SeparatorWrapCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,8 +19,8 @@ package com.puppycrawl.tools.checkstyle.checks.whitespace; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck.LINE_NEW; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck.LINE_PREVIOUS; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck.MSG_LINE_NEW; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck.MSG_LINE_PREVIOUS; import java.io.File; import java.io.IOException; @@ -56,7 +56,7 @@ checkConfig.addAttribute("option", "NL"); checkConfig.addAttribute("tokens", "DOT"); final String[] expected = { - "31:10: " + getCheckMessage(LINE_NEW, "."), + "31:10: " + getCheckMessage(MSG_LINE_NEW, "."), }; verify(checkConfig, getPath("InputSeparatorWrap.java"), expected); } @@ -66,7 +66,7 @@ checkConfig.addAttribute("option", "EOL"); checkConfig.addAttribute("tokens", "COMMA"); final String[] expected = { - "39:17: " + getCheckMessage(LINE_PREVIOUS, ","), + "39:17: " + getCheckMessage(MSG_LINE_PREVIOUS, ","), }; verify(checkConfig, getPath("InputSeparatorWrap.java"), expected); } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/TypecastParenPadCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/TypecastParenPadCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/TypecastParenPadCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/TypecastParenPadCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,10 +19,10 @@ package com.puppycrawl.tools.checkstyle.checks.whitespace; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck.WS_FOLLOWED; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck.WS_NOT_FOLLOWED; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck.WS_NOT_PRECEDED; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck.WS_PRECEDED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck.MSG_WS_FOLLOWED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck.MSG_WS_NOT_FOLLOWED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck.MSG_WS_NOT_PRECEDED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck.MSG_WS_PRECEDED; import java.io.File; import java.io.IOException; @@ -49,8 +49,8 @@ final DefaultConfiguration checkConfig = createCheckConfig(TypecastParenPadCheck.class); final String[] expected = { - "89:14: " + getCheckMessage(WS_FOLLOWED, "("), - "89:21: " + getCheckMessage(WS_PRECEDED, ")"), + "89:14: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "89:21: " + getCheckMessage(MSG_WS_PRECEDED, ")"), }; verify(checkConfig, getPath("InputWhitespace.java"), expected); } @@ -62,14 +62,14 @@ createCheckConfig(TypecastParenPadCheck.class); checkConfig.addAttribute("option", PadOption.SPACE.toString()); final String[] expected = { - "87:21: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "87:27: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "88:14: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "88:20: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "90:14: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "90:20: " + getCheckMessage(WS_NOT_PRECEDED, ")"), - "241:18: " + getCheckMessage(WS_NOT_FOLLOWED, "("), - "241:21: " + getCheckMessage(WS_NOT_PRECEDED, ")"), + "87:21: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "87:27: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "88:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "88:20: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "90:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "90:20: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + "241:18: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "241:21: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), }; verify(checkConfig, getPath("InputWhitespace.java"), expected); } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAfterCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAfterCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAfterCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAfterCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,8 +19,8 @@ package com.puppycrawl.tools.checkstyle.checks.whitespace; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck.WS_NOT_FOLLOWED; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck.WS_TYPECAST; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck.MSG_WS_NOT_FOLLOWED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck.MSG_WS_TYPECAST; import static org.junit.Assert.assertArrayEquals; import java.io.File; @@ -57,8 +57,8 @@ @Test public void testDefault() throws Exception { final String[] expected = { - "42:40: " + getCheckMessage(WS_NOT_FOLLOWED, ","), - "71:30: " + getCheckMessage(WS_NOT_FOLLOWED, ","), + "42:40: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), + "71:30: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), }; verify(checkConfig, getPath("InputSimple.java"), expected); } @@ -66,7 +66,7 @@ @Test public void testCast() throws Exception { final String[] expected = { - "88:21: " + getCheckMessage(WS_TYPECAST), + "88:21: " + getCheckMessage(MSG_WS_TYPECAST), }; verify(checkConfig, getPath("InputWhitespace.java"), expected); } @@ -74,9 +74,9 @@ @Test public void testSemi() throws Exception { final String[] expected = { - "54:23: " + getCheckMessage(WS_NOT_FOLLOWED, ";"), - "54:29: " + getCheckMessage(WS_NOT_FOLLOWED, ";"), - "103:19: " + getCheckMessage(WS_NOT_FOLLOWED, ";"), + "54:23: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ";"), + "54:29: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ";"), + "103:19: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ";"), }; verify(checkConfig, getPath("InputBraces.java"), expected); } @@ -84,8 +84,8 @@ @Test public void testEmptyForIterator() throws Exception { final String[] expected = { - "14:31: " + getCheckMessage(WS_NOT_FOLLOWED, ";"), - "17:31: " + getCheckMessage(WS_NOT_FOLLOWED, ";"), + "14:31: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ";"), + "17:31: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ";"), }; verify(checkConfig, getPath("InputForWhitespace.java"), expected); } @@ -93,9 +93,9 @@ @Test public void testTypeArgumentAndParameterCommas() throws Exception { final String[] expected = { - "11:21: " + getCheckMessage(WS_NOT_FOLLOWED, ","), - "11:23: " + getCheckMessage(WS_NOT_FOLLOWED, ","), - "11:41: " + getCheckMessage(WS_NOT_FOLLOWED, ","), + "11:21: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), + "11:23: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), + "11:41: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), }; verify(checkConfig, getPath("InputGenerics.java"), expected); } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAroundCheckTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAroundCheckTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAroundCheckTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAroundCheckTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,8 +19,8 @@ package com.puppycrawl.tools.checkstyle.checks.whitespace; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck.WS_NOT_FOLLOWED; -import static com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck.WS_NOT_PRECEDED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck.MSG_WS_NOT_FOLLOWED; +import static com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck.MSG_WS_NOT_PRECEDED; import static org.junit.Assert.assertArrayEquals; import java.io.File; @@ -65,42 +65,42 @@ public void testIt() throws Exception { final String[] expected = { - "16:22: " + getCheckMessage(WS_NOT_PRECEDED, "="), - "16:23: " + getCheckMessage(WS_NOT_FOLLOWED, "="), - "18:24: " + getCheckMessage(WS_NOT_FOLLOWED, "="), - "26:14: " + getCheckMessage(WS_NOT_PRECEDED, "="), - "27:10: " + getCheckMessage(WS_NOT_PRECEDED, "="), - "27:11: " + getCheckMessage(WS_NOT_FOLLOWED, "="), - "28:10: " + getCheckMessage(WS_NOT_PRECEDED, "+="), - "28:12: " + getCheckMessage(WS_NOT_FOLLOWED, "+="), - "29:13: " + getCheckMessage(WS_NOT_FOLLOWED, "-="), - "37:21: " + getCheckMessage(WS_NOT_FOLLOWED, "synchronized"), - "39:12: " + getCheckMessage(WS_NOT_FOLLOWED, "try"), - "39:12: " + getCheckMessage(WS_NOT_PRECEDED, "{"), - "41:14: " + getCheckMessage(WS_NOT_FOLLOWED, "catch"), - "41:34: " + getCheckMessage(WS_NOT_PRECEDED, "{"), - "58:11: " + getCheckMessage(WS_NOT_FOLLOWED, "if"), - "76:19: " + getCheckMessage(WS_NOT_FOLLOWED, "return"), - "97:29: " + getCheckMessage(WS_NOT_PRECEDED, "?"), - "97:30: " + getCheckMessage(WS_NOT_FOLLOWED, "?"), - "97:34: " + getCheckMessage(WS_NOT_PRECEDED, ":"), - "97:35: " + getCheckMessage(WS_NOT_FOLLOWED, ":"), - "98:15: " + getCheckMessage(WS_NOT_PRECEDED, "=="), - "98:17: " + getCheckMessage(WS_NOT_FOLLOWED, "=="), - "104:20: " + getCheckMessage(WS_NOT_FOLLOWED, "*"), - "104:21: " + getCheckMessage(WS_NOT_PRECEDED, "*"), - "119:18: " + getCheckMessage(WS_NOT_PRECEDED, "%"), - "120:20: " + getCheckMessage(WS_NOT_FOLLOWED, "%"), - "121:18: " + getCheckMessage(WS_NOT_PRECEDED, "%"), - "121:19: " + getCheckMessage(WS_NOT_FOLLOWED, "%"), - "123:18: " + getCheckMessage(WS_NOT_PRECEDED, "/"), - "124:20: " + getCheckMessage(WS_NOT_FOLLOWED, "/"), - "125:18: " + getCheckMessage(WS_NOT_PRECEDED, "/"), - "125:19: " + getCheckMessage(WS_NOT_FOLLOWED, "/"), - "153:15: " + getCheckMessage(WS_NOT_FOLLOWED, "assert"), - "156:20: " + getCheckMessage(WS_NOT_PRECEDED, ":"), - "156:21: " + getCheckMessage(WS_NOT_FOLLOWED, ":"), - "262:14: " + getCheckMessage(WS_NOT_FOLLOWED, "}"), + "16:22: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "="), + "16:23: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), + "18:24: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), + "26:14: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "="), + "27:10: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "="), + "27:11: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), + "28:10: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "+="), + "28:12: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "+="), + "29:13: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "-="), + "37:21: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "synchronized"), + "39:12: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "try"), + "39:12: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "41:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "catch"), + "41:34: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "58:11: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "if"), + "76:19: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "return"), + "97:29: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "?"), + "97:30: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "?"), + "97:34: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ":"), + "97:35: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ":"), + "98:15: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "=="), + "98:17: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "=="), + "104:20: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "*"), + "104:21: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "*"), + "119:18: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "%"), + "120:20: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "%"), + "121:18: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "%"), + "121:19: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "%"), + "123:18: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "/"), + "124:20: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "/"), + "125:18: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "/"), + "125:19: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "/"), + "153:15: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "assert"), + "156:20: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ":"), + "156:21: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ":"), + "262:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "}"), }; verify(checkConfig, getPath("InputWhitespace.java"), expected); } @@ -109,12 +109,12 @@ public void testIt2() throws Exception { final String[] expected = { - "153:27: " + getCheckMessage(WS_NOT_FOLLOWED, "="), - "154:27: " + getCheckMessage(WS_NOT_FOLLOWED, "="), - "155:27: " + getCheckMessage(WS_NOT_FOLLOWED, "="), - "156:27: " + getCheckMessage(WS_NOT_FOLLOWED, "="), - "157:27: " + getCheckMessage(WS_NOT_FOLLOWED, "="), - "158:27: " + getCheckMessage(WS_NOT_FOLLOWED, "="), + "153:27: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), + "154:27: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), + "155:27: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), + "156:27: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), + "157:27: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), + "158:27: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), }; verify(checkConfig, getPath("InputSimple.java"), expected); } @@ -123,14 +123,14 @@ public void testIt3() throws Exception { final String[] expected = { - "37:14: " + getCheckMessage(WS_NOT_FOLLOWED, "while"), - "54:12: " + getCheckMessage(WS_NOT_FOLLOWED, "for"), + "37:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "while"), + "54:12: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "for"), // + ":58:23: ';' is not followed by whitespace.", // + ":58:29: ';' is not followed by whitespace.", - "111:27: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "111:27: " + getCheckMessage(WS_NOT_PRECEDED, "}"), - "114:40: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "114:40: " + getCheckMessage(WS_NOT_PRECEDED, "}"), + "111:27: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "111:27: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), + "114:40: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "114:40: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), }; verify(checkConfig, getPath("InputBraces.java"), expected); } @@ -141,8 +141,8 @@ checkConfig.addAttribute("allowEmptyMethods", "true"); checkConfig.addAttribute("allowEmptyConstructors", "true"); final String[] expected = { - "37:14: " + getCheckMessage(WS_NOT_FOLLOWED, "while"), - "54:12: " + getCheckMessage(WS_NOT_FOLLOWED, "for"), + "37:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "while"), + "54:12: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "for"), }; verify(checkConfig, getPath("InputBraces.java"), expected); } @@ -151,8 +151,8 @@ public void testGenericsTokensAreFlagged() throws Exception { final String[] expected = { - "6:67: " + getCheckMessage(WS_NOT_PRECEDED, "&"), - "6:68: " + getCheckMessage(WS_NOT_FOLLOWED, "&"), + "6:67: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "&"), + "6:68: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "&"), }; verify(checkConfig, getPath("InputGenerics.java"), expected); } @@ -168,7 +168,7 @@ public void testIgnoreEnhancedForColon() throws Exception { checkConfig.addAttribute("ignoreEnhancedForColon", "false"); final String[] expected = { - "19:20: " + getCheckMessage(WS_NOT_PRECEDED, ":"), + "19:20: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ":"), }; verify(checkConfig, getPath("InputWhitespaceAround.java"), expected); @@ -178,12 +178,12 @@ public void testEmptyTypes() throws Exception { checkConfig.addAttribute("allowEmptyTypes", "true"); final String[] expected = { - "29:95: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "29:95: " + getCheckMessage(WS_NOT_PRECEDED, "}"), - "30:33: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "30:33: " + getCheckMessage(WS_NOT_PRECEDED, "}"), - "31:21: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "31:21: " + getCheckMessage(WS_NOT_PRECEDED, "}"), + "29:95: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "29:95: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), + "30:33: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "30:33: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), + "31:21: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "31:21: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), }; verify(checkConfig, getPath("InputEmptyTypesAndCycles.java"), expected); @@ -193,16 +193,16 @@ public void testEmptyLoops() throws Exception { checkConfig.addAttribute("allowEmptyLoops", "true"); final String[] expected = { - "40:65: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "40:65: " + getCheckMessage(WS_NOT_PRECEDED, "}"), - "42:17: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "42:17: " + getCheckMessage(WS_NOT_PRECEDED, "}"), - "44:20: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "44:20: " + getCheckMessage(WS_NOT_PRECEDED, "}"), - "50:44: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "50:44: " + getCheckMessage(WS_NOT_PRECEDED, "}"), - "60:18: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "60:18: " + getCheckMessage(WS_NOT_PRECEDED, "}"), + "40:65: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "40:65: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), + "42:17: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "42:17: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), + "44:20: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "44:20: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), + "50:44: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "50:44: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), + "60:18: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "60:18: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), }; verify(checkConfig, getPath("InputEmptyTypesAndCycles.java"), expected); @@ -211,7 +211,7 @@ @Test public void testSwitchWhitespaceAround() throws Exception { final String[] expected = { - "6:15: " + getCheckMessage(WS_NOT_FOLLOWED, "switch"), + "6:15: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "switch"), }; verify(checkConfig, getPath("InputSwitchWhitespaceAround.java"), expected); } @@ -219,7 +219,7 @@ @Test public void testDoWhileWhitespaceAround() throws Exception { final String[] expected = { - "9:16: " + getCheckMessage(WS_NOT_FOLLOWED, "while"), + "9:16: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "while"), }; verify(checkConfig, getPath("InputDoWhileWhitespaceAround.java"), expected); } @@ -297,21 +297,21 @@ public void testAllowEmptyTypesIsSetToFalseAndNonEmptyClasses() throws Exception { checkConfig.addAttribute("allowEmptyTypes", "false"); final String[] expected = { - "6:52: " + getCheckMessage(WS_NOT_PRECEDED, "{"), - "10:20: " + getCheckMessage(WS_NOT_PRECEDED, "{"), - "14:32: " + getCheckMessage(WS_NOT_PRECEDED, "{"), - "18:18: " + getCheckMessage(WS_NOT_PRECEDED, "{"), - "20:24: " + getCheckMessage(WS_NOT_PRECEDED, "{"), - "20:25: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "20:31: " + getCheckMessage(WS_NOT_PRECEDED, "}"), - "22:31: " + getCheckMessage(WS_NOT_FOLLOWED, "}"), - "24:18: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "24:18: " + getCheckMessage(WS_NOT_PRECEDED, "}"), - "26:69: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "26:69: " + getCheckMessage(WS_NOT_PRECEDED, "}"), - "28:24: " + getCheckMessage(WS_NOT_PRECEDED, "{"), - "31:13: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "31:13: " + getCheckMessage(WS_NOT_PRECEDED, "}"), + "6:52: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "10:20: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "14:32: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "18:18: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "20:24: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "20:25: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "20:31: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), + "22:31: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "}"), + "24:18: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "24:18: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), + "26:69: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "26:69: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), + "28:24: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "31:13: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "31:13: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), }; verify(checkConfig, getPath("InputAllowEmptyTypesAndNonEmptyClasses.java"), expected); @@ -321,17 +321,17 @@ public void testAllowEmptyTypesIsSetToTrueAndNonEmptyClasses() throws Exception { checkConfig.addAttribute("allowEmptyTypes", "true"); final String[] expected = { - "6:52: " + getCheckMessage(WS_NOT_PRECEDED, "{"), - "10:20: " + getCheckMessage(WS_NOT_PRECEDED, "{"), - "14:32: " + getCheckMessage(WS_NOT_PRECEDED, "{"), - "18:18: " + getCheckMessage(WS_NOT_PRECEDED, "{"), - "20:24: " + getCheckMessage(WS_NOT_PRECEDED, "{"), - "20:25: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "20:31: " + getCheckMessage(WS_NOT_PRECEDED, "}"), - "22:31: " + getCheckMessage(WS_NOT_FOLLOWED, "}"), - "28:24: " + getCheckMessage(WS_NOT_PRECEDED, "{"), - "31:13: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "31:13: " + getCheckMessage(WS_NOT_PRECEDED, "}"), + "6:52: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "10:20: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "14:32: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "18:18: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "20:24: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "20:25: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "20:31: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), + "22:31: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "}"), + "28:24: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "31:13: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "31:13: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), }; verify(checkConfig, getPath("InputAllowEmptyTypesAndNonEmptyClasses.java"), expected); @@ -340,12 +340,12 @@ @Test public void testNotAllowEmptyLambdaExpressionsByDefault() throws Exception { final String[] expected = { - "7:28: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "7:28: " + getCheckMessage(WS_NOT_PRECEDED, "}"), - "12:29: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "12:30: " + getCheckMessage(WS_NOT_PRECEDED, "}"), - "13:29: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "13:43: " + getCheckMessage(WS_NOT_PRECEDED, "}"), + "7:28: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "7:28: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), + "12:29: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "12:30: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), + "13:29: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "13:43: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), }; verify(checkConfig, getNonCompilablePath("InputAllowEmptyLambdaExpressions.java"), expected); @@ -355,10 +355,10 @@ public void testAllowEmptyLambdaExpressionsWithAllowEmptyLambdaParameter() throws Exception { checkConfig.addAttribute("allowEmptyLambdas", "true"); final String[] expected = { - "12:29: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "12:30: " + getCheckMessage(WS_NOT_PRECEDED, "}"), - "13:29: " + getCheckMessage(WS_NOT_FOLLOWED, "{"), - "13:43: " + getCheckMessage(WS_NOT_PRECEDED, "}"), + "12:29: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "12:30: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), + "13:29: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "13:43: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), }; verify(checkConfig, getNonCompilablePath("InputAllowEmptyLambdaExpressions.java"), expected); diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/DebugAuditAdapter.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/DebugAuditAdapter.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/DebugAuditAdapter.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/DebugAuditAdapter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/DebugChecker.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/DebugChecker.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/DebugChecker.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/DebugChecker.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/DebugFilter.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/DebugFilter.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/DebugFilter.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/DebugFilter.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/DefaultConfigurationTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/DefaultConfigurationTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/DefaultConfigurationTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/DefaultConfigurationTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/DefaultLoggerTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/DefaultLoggerTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/DefaultLoggerTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/DefaultLoggerTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/DefinitionsTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/DefinitionsTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/DefinitionsTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/DefinitionsTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/doclets/TokenTypesDocletTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/doclets/TokenTypesDocletTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/doclets/TokenTypesDocletTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/doclets/TokenTypesDocletTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -149,7 +149,7 @@ private static RootDoc getRootDoc(JavadocTool javadocTool, ListBuffer options, ListBuffer names) throws Exception { final Method getRootDocImpl = getMethodGetRootDocImplByReflection(); - RootDoc rootDoc; + final RootDoc rootDoc; if (System.getProperty("java.version").startsWith("1.7.")) { rootDoc = (RootDoc) getRootDocImpl.invoke(javadocTool, "", "UTF-8", new ModifierFilter(ModifierFilter.ALL_ACCESS), diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/CsvFilterTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/CsvFilterTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/CsvFilterTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/CsvFilterTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/FilterSetTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/FilterSetTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/FilterSetTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/FilterSetTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/IntMatchFilterTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/IntMatchFilterTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/IntMatchFilterTest.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/IntMatchFilterTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/IntRangeFilterTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/IntRangeFilterTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/IntRangeFilterTest.java 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/IntRangeFilterTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/SeverityMatchFilterTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/SeverityMatchFilterTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/SeverityMatchFilterTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/SeverityMatchFilterTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressElementTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressElementTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressElementTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressElementTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilterTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilterTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilterTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilterTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -217,8 +217,13 @@ new DefaultConfiguration("configuration"); final DefaultConfiguration checksConfig = createCheckConfig(TreeWalker.class); checksConfig.addChild(createCheckConfig(FileContentsHolder.class)); - checksConfig.addChild(createCheckConfig(MemberNameCheck.class)); - checksConfig.addChild(createCheckConfig(ConstantNameCheck.class)); + final DefaultConfiguration memberNameCheckConfig = createCheckConfig(MemberNameCheck.class); + memberNameCheckConfig.addAttribute("id", "ignore"); + checksConfig.addChild(memberNameCheckConfig); + final DefaultConfiguration constantNameCheckConfig = + createCheckConfig(ConstantNameCheck.class); + constantNameCheckConfig.addAttribute("id", null); + checksConfig.addChild(constantNameCheckConfig); checksConfig.addChild(createCheckConfig(IllegalCatchCheck.class)); checkerConfig.addChild(checksConfig); if (checkConfig != null) { @@ -307,4 +312,27 @@ final SuppressionCommentFilter filter = new SuppressionCommentFilter(); Assert.assertTrue(filter.accept(auditEvent)); } + + @Test + public void testSuppressById() throws Exception { + final DefaultConfiguration filterConfig = + createFilterConfig(SuppressionCommentFilter.class); + filterConfig.addAttribute("offCommentFormat", "CSOFF (\\w+) \\(\\w+\\)"); + filterConfig.addAttribute("onCommentFormat", "CSON (\\w+)"); + filterConfig.addAttribute("checkFormat", "$1"); + final String[] suppressedViolationMessages = { + "6:17: Name 'A1' must match pattern '^[a-z][a-zA-Z0-9]*$'.", + "12:9: Name 'line_length' must match pattern '^[a-z][a-zA-Z0-9]*$'.", + }; + final String[] expectedViolationMessages = { + "6:17: Name 'A1' must match pattern '^[a-z][a-zA-Z0-9]*$'.", + "9:30: Name 'abc' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.", + "12:9: Name 'line_length' must match pattern '^[a-z][a-zA-Z0-9]*$'.", + "15:18: Name 'ID' must match pattern '^[a-z][a-zA-Z0-9]*$'.", + }; + + verify(createChecker(filterConfig), + getPath("InputSuppressByIdWithCommentFilter.java"), + removeSuppressed(expectedViolationMessages, suppressedViolationMessages)); + } } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilterTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilterTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilterTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilterTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,14 +19,34 @@ package com.puppycrawl.tools.checkstyle.filters; -import org.junit.Assert; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.URL; + import org.junit.Test; +import org.junit.runner.RunWith; + +import org.mockito.BDDMockito; +import org.mockito.Mockito; + +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; import com.puppycrawl.tools.checkstyle.api.AuditEvent; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; +import com.puppycrawl.tools.checkstyle.utils.CommonUtils; + import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; +@RunWith(PowerMockRunner.class) +@PrepareForTest({SuppressionFilter.class, CommonUtils.class}) public class SuppressionFilterTest { @Test public void testEqualsAndHashCode() { @@ -39,13 +59,122 @@ @Test public void testAccept() throws CheckstyleException { - final SuppressionFilter filter = new SuppressionFilter(); - filter.setFile("src/test/resources/com/puppycrawl/tools/checkstyle/filters/" - + "suppressions_none.xml"); + final String fileName = "src/test/resources/com/puppycrawl/tools/checkstyle/filters/" + + "suppressions_none.xml"; + final boolean optional = false; + final SuppressionFilter filter = createSupressionFilter(fileName, optional); final AuditEvent ev = new AuditEvent(this, "ATest.java", null); - Assert.assertTrue(filter.accept(ev)); + assertTrue(filter.accept(ev)); + } + + @Test + public void testAcceptOnNullFile() throws CheckstyleException { + final String fileName = null; + final boolean optional = false; + final SuppressionFilter filter = createSupressionFilter(fileName, optional); + + final AuditEvent ev = new AuditEvent(this, "AnyJava.java", null); + + assertTrue(filter.accept(ev)); + } + + @Test + public void testNonExistanceSuppressionFileWithFalseOptional() throws Exception { + final String fileName = "src/test/resources/com/puppycrawl/tools/checkstyle/filters/" + + "non_existance_suppresion_file.xml"; + try { + final boolean optional = false; + createSupressionFilter(fileName, optional); + fail("Exception is expected"); + } + catch (CheckstyleException ex) { + assertEquals("Unable to find: " + fileName, ex.getMessage()); + } + } + + @Test + public void testExistanceInvalidSuppressionFileWithTrueOptional() throws Exception { + final String fileName = "src/test/resources/com/puppycrawl/tools/checkstyle/filters/" + + "suppressions_invalid_file.xml"; + try { + final boolean optional = true; + createSupressionFilter(fileName, optional); + fail("Exception is expected"); + } + catch (CheckstyleException ex) { + assertEquals("Unable to parse " + fileName + " - invalid files or checks format", + ex.getMessage()); + } + } + + @Test + public void testExistingSuppressionFileWithTrueOptional() throws Exception { + final String fileName = "src/test/resources/com/puppycrawl/tools/checkstyle/filters/" + + "suppressions_none.xml"; + final boolean optional = true; + final SuppressionFilter filter = createSupressionFilter(fileName, optional); + + final AuditEvent ev = new AuditEvent(this, "AnyFile.java", null); + + assertTrue(filter.accept(ev)); } + @Test + public void testExistingConfigWithTrueOptionalThrowsIoErrorWhileClosing() + throws Exception { + final InputStream inputStream = PowerMockito.mock(InputStream.class); + Mockito.doThrow(IOException.class).when(inputStream).close(); + + final URL url = PowerMockito.mock(URL.class); + BDDMockito.given(url.openStream()).willReturn(inputStream); + + final URI uri = PowerMockito.mock(URI.class); + BDDMockito.given(uri.toURL()).willReturn(url); + + PowerMockito.mockStatic(CommonUtils.class); + + final String fileName = "src/test/resources/com/puppycrawl/tools/checkstyle/filters/" + + "suppressions_none.xml"; + BDDMockito.given(CommonUtils.getUriByFilename(fileName)).willReturn(uri); + + final boolean optional = true; + final SuppressionFilter filter = createSupressionFilter(fileName, optional); + final AuditEvent ev = new AuditEvent(this, "AnyFile.java", null); + assertTrue(filter.accept(ev)); + } + + @Test + public void testNonExistanceSuppressionFileWithTrueOptional() throws Exception { + final String fileName = "src/test/resources/com/puppycrawl/tools/checkstyle/filters/" + + "non_existance_suppresion_file.xml"; + final boolean optional = true; + final SuppressionFilter filter = createSupressionFilter(fileName, optional); + + final AuditEvent ev = new AuditEvent(this, "AnyFile.java", null); + + assertTrue(filter.accept(ev)); + } + + @Test + public void testNonExistanceSuppressionUrlWithTrueOptional() throws Exception { + final String fileName = + "http://checkstyle.sourceforge.net/non_existing_suppression.xml"; + final boolean optional = true; + final SuppressionFilter filter = createSupressionFilter(fileName, optional); + + final AuditEvent ev = new AuditEvent(this, "AnyFile.java", null); + + assertTrue(filter.accept(ev)); + } + + private static SuppressionFilter createSupressionFilter(String fileName, boolean optional) + throws CheckstyleException { + final SuppressionFilter suppressionFilter = new SuppressionFilter(); + suppressionFilter.setFile(fileName); + suppressionFilter.setOptional(optional); + suppressionFilter.finishLocalSetup(); + return suppressionFilter; + } } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoaderTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoaderTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoaderTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoaderTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWarningsFilterTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWarningsFilterTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWarningsFilterTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWarningsFilterTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -125,11 +125,19 @@ "com.puppycrawl.tools.checkstyle.checks.sizes." + "ParameterNumberCheck=paramnum"); checksConfig.addChild(holderConfig); - checksConfig.addChild(createCheckConfig(MemberNameCheck.class)); - checksConfig.addChild(createCheckConfig(ConstantNameCheck.class)); + final DefaultConfiguration memberNameCheckConfig = createCheckConfig(MemberNameCheck.class); + memberNameCheckConfig.addAttribute("id", "ignore"); + checksConfig.addChild(memberNameCheckConfig); + final DefaultConfiguration constantNameCheckConfig = + createCheckConfig(ConstantNameCheck.class); + constantNameCheckConfig.addAttribute("id", ""); + checksConfig.addChild(constantNameCheckConfig); checksConfig.addChild(createCheckConfig(ParameterNumberCheck.class)); checksConfig.addChild(createCheckConfig(IllegalCatchCheck.class)); - checksConfig.addChild(createCheckConfig(UncommentedMainCheck.class)); + final DefaultConfiguration uncommentedMainCheckConfig = + createCheckConfig(UncommentedMainCheck.class); + uncommentedMainCheckConfig.addAttribute("id", "ignore"); + checksConfig.addChild(uncommentedMainCheckConfig); checksConfig.addChild(createCheckConfig(JavadocTypeCheck.class)); checkerConfig.addChild(checksConfig); if (checkConfig != null) { @@ -152,4 +160,23 @@ coll.removeAll(Arrays.asList(remove)); return coll.toArray(new String[coll.size()]); } + + @Test + public void testSuppressById() throws Exception { + final DefaultConfiguration filterConfig = + createFilterConfig(SuppressWarningsFilter.class); + final String[] suppressedViolationMessages = { + "6:17: Name 'A1' must match pattern '^[a-z][a-zA-Z0-9]*$'.", + "8: Uncommented main method found.", + }; + final String[] expectedViolationMessages = { + "3: Missing a Javadoc comment.", + "6:17: Name 'A1' must match pattern '^[a-z][a-zA-Z0-9]*$'.", + "8: Uncommented main method found.", + }; + + verify(createChecker(filterConfig), + getPath("InputSuppressByIdWithWarningsFilter.java"), + removeSuppressed(expectedViolationMessages, suppressedViolationMessages)); + } } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilterTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilterTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilterTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilterTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -217,8 +217,13 @@ new DefaultConfiguration("configuration"); final DefaultConfiguration checksConfig = createCheckConfig(TreeWalker.class); checksConfig.addChild(createCheckConfig(FileContentsHolder.class)); - checksConfig.addChild(createCheckConfig(MemberNameCheck.class)); - checksConfig.addChild(createCheckConfig(ConstantNameCheck.class)); + final DefaultConfiguration memberNameCheckConfig = createCheckConfig(MemberNameCheck.class); + memberNameCheckConfig.addAttribute("id", "ignore"); + checksConfig.addChild(memberNameCheckConfig); + final DefaultConfiguration constantNameCheckConfig = + createCheckConfig(ConstantNameCheck.class); + constantNameCheckConfig.addAttribute("id", null); + checksConfig.addChild(constantNameCheckConfig); checksConfig.addChild(createCheckConfig(IllegalCatchCheck.class)); checkerConfig.addChild(checksConfig); if (checkConfig != null) { @@ -311,4 +316,27 @@ final String[] suppressed = ArrayUtils.EMPTY_STRING_ARRAY; verifySuppressed(filterConfig, suppressed); } + + @Test + public void testSuppressById() throws Exception { + final DefaultConfiguration filterConfig = + createFilterConfig(SuppressWithNearbyCommentFilter.class); + filterConfig.addAttribute("commentFormat", "@cs-: (\\w+) \\(\\w+\\)"); + filterConfig.addAttribute("checkFormat", "$1"); + filterConfig.addAttribute("influenceFormat", "0"); + final String[] suppressedViolationMessages = { + "5:17: Name 'A1' must match pattern '^[a-z][a-zA-Z0-9]*$'.", + "9:9: Name 'line_length' must match pattern '^[a-z][a-zA-Z0-9]*$'.", + }; + final String[] expectedViolationMessages = { + "5:17: Name 'A1' must match pattern '^[a-z][a-zA-Z0-9]*$'.", + "7:30: Name 'abc' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.", + "9:9: Name 'line_length' must match pattern '^[a-z][a-zA-Z0-9]*$'.", + "11:18: Name 'ID' must match pattern '^[a-z][a-zA-Z0-9]*$'.", + }; + + verify(createChecker(filterConfig), + getPath("InputSuppressByIdWithNearbyCommentFilter.java"), + removeSuppressed(expectedViolationMessages, suppressedViolationMessages)); + } } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/comments/AllBlockCommentsTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/comments/AllBlockCommentsTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/comments/AllBlockCommentsTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/comments/AllBlockCommentsTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/comments/AllSinglelineCommentsTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/comments/AllSinglelineCommentsTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/comments/AllSinglelineCommentsTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/comments/AllSinglelineCommentsTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/comments/CommentsTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/comments/CommentsTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/comments/CommentsTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/comments/CommentsTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/comments/CompareTreesWithComments.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/comments/CompareTreesWithComments.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/comments/CompareTreesWithComments.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/comments/CompareTreesWithComments.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -56,7 +56,7 @@ } private static boolean isAstEquals(DetailAST expected, DetailAST actual) { - boolean result; + final boolean result; if (expected == actual) { result = true; } diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/EmbeddedNullCharTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/EmbeddedNullCharTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/EmbeddedNullCharTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/EmbeddedNullCharTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/GeneratedJava14LexerTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/GeneratedJava14LexerTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/GeneratedJava14LexerTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/GeneratedJava14LexerTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/HexFloatsTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/HexFloatsTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/HexFloatsTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/HexFloatsTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7DiamondTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7DiamondTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7DiamondTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7DiamondTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7MultiCatchTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7MultiCatchTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7MultiCatchTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7MultiCatchTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7NumericalLiteralsTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7NumericalLiteralsTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7NumericalLiteralsTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7NumericalLiteralsTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7StringSwitchTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7StringSwitchTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7StringSwitchTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7StringSwitchTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7TryWithResourcesTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7TryWithResourcesTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7TryWithResourcesTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/Java7TryWithResourcesTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/java8/AnnotationTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/java8/AnnotationTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/java8/AnnotationTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/java8/AnnotationTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/java8/DefaultMethodsTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/java8/DefaultMethodsTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/java8/DefaultMethodsTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/java8/DefaultMethodsTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/java8/LambdaTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/java8/LambdaTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/java8/LambdaTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/java8/LambdaTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/java8/MethodReferencesTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/java8/MethodReferencesTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/java8/MethodReferencesTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/java8/MethodReferencesTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/javadoc/JavadocParseTreeTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/javadoc/JavadocParseTreeTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/javadoc/JavadocParseTreeTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/javadoc/JavadocParseTreeTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/javadoc/ParseTreeBuilder.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/javadoc/ParseTreeBuilder.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/javadoc/ParseTreeBuilder.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/javadoc/ParseTreeBuilder.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/LineCommentAtTheEndOfFileTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/LineCommentAtTheEndOfFileTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/LineCommentAtTheEndOfFileTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/LineCommentAtTheEndOfFileTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/MultiDimensionalArraysInGenericsTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/MultiDimensionalArraysInGenericsTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/MultiDimensionalArraysInGenericsTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/MultiDimensionalArraysInGenericsTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/UnicodeEscapeTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/UnicodeEscapeTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/UnicodeEscapeTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/UnicodeEscapeTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/VarargTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/VarargTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/grammars/VarargTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/grammars/VarargTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllChecksTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllChecksTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllChecksTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllChecksTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -19,6 +19,8 @@ package com.puppycrawl.tools.checkstyle.internal; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; import java.util.Arrays; import java.util.HashSet; import java.util.Locale; @@ -163,6 +165,43 @@ } } + @Test + public void testAllCheckstyleModulesHaveMessage() throws Exception { + for (Class module : CheckUtil.getCheckstyleChecks()) { + Assert.assertFalse(module.getSimpleName() + + " should have atleast one 'MSG_*' field for error messages", CheckUtil + .getCheckMessages(module).isEmpty()); + } + } + + @Test + public void testAllCheckstyleMessages() throws Exception { + for (Class module : CheckUtil.getCheckstyleChecks()) { + for (Field message : CheckUtil.getCheckMessages(module)) { + Assert.assertEquals(module.getSimpleName() + "." + message.getName() + + " should be 'public static final'", Modifier.PUBLIC | Modifier.STATIC + | Modifier.FINAL, message.getModifiers()); + + // below is required for package/private classes + if (!message.isAccessible()) { + message.setAccessible(true); + } + + final String result = CheckUtil.getCheckMessage(module, message.get(null) + .toString()); + + Assert.assertNotNull(module.getSimpleName() + " should have text for the message '" + + message.getName() + "'", result); + Assert.assertFalse( + module.getSimpleName() + " should have non-empty text for the message '" + + message.getName() + "'", result.trim().isEmpty()); + Assert.assertFalse(module.getSimpleName() + + " should have non-TODO text for the message '" + message.getName() + "'", + result.trim().startsWith("TODO")); + } + } + } + /** * Checks that an array is a subset of other array. * @param array to check whether it is a subset. diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/internal/CheckUtil.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/internal/CheckUtil.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/internal/CheckUtil.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/internal/CheckUtil.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -21,9 +21,13 @@ import java.io.File; import java.io.IOException; +import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.text.MessageFormat; import java.util.Arrays; import java.util.HashSet; +import java.util.Locale; +import java.util.Properties; import java.util.Set; import javax.xml.parsers.DocumentBuilder; @@ -38,6 +42,9 @@ import com.google.common.reflect.ClassPath; import com.puppycrawl.tools.checkstyle.api.AutomaticBean; import com.puppycrawl.tools.checkstyle.api.Filter; +import com.puppycrawl.tools.checkstyle.checks.regexp.RegexpMultilineCheck; +import com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineCheck; +import com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck; import com.puppycrawl.tools.checkstyle.utils.TokenUtils; public final class CheckUtil { @@ -203,6 +210,65 @@ && className.endsWith("Filter"); } + /** + * Get's the check's messages. + * @param module class to examine. + * @return a set of checkstyle's module message fields. + * @throws ClassNotFoundException if the attempt to read a protected class fails. + */ + public static Set getCheckMessages(Class module) throws ClassNotFoundException { + final Set checkstyleMessages = new HashSet<>(); + + // get all fields from current class + final Field[] fields = module.getDeclaredFields(); + + for (Field field : fields) { + if (field.getName().startsWith("MSG_")) { + checkstyleMessages.add(field); + } + } + + // deep scan class through hierarchy + final Class superModule = module.getSuperclass(); + + if (superModule != null) { + checkstyleMessages.addAll(getCheckMessages(superModule)); + } + + // special cases that require additional classes + if (module == RegexpMultilineCheck.class) { + checkstyleMessages.addAll(getCheckMessages(Class + .forName("com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector"))); + } + else if (module == RegexpSinglelineCheck.class + || module == RegexpSinglelineJavaCheck.class) { + checkstyleMessages.addAll(getCheckMessages(Class + .forName("com.puppycrawl.tools.checkstyle.checks.regexp.SinglelineDetector"))); + } + + return checkstyleMessages; + } + + /** + * Gets the check message 'as is' from appropriate 'messages.properties' + * file. + * + * @param messageKey the key of message in 'messages.properties' file. + * @param arguments the arguments of message in 'messages.properties' file. + * @return the check's formatted message. + */ + public static String getCheckMessage(Class module, String messageKey, Object... arguments) { + final Properties pr = new Properties(); + try { + pr.load(module.getResourceAsStream("messages.properties")); + } + catch (IOException ex) { + return null; + } + final MessageFormat formatter = new MessageFormat(pr.getProperty(messageKey), Locale.ROOT); + return formatter.format(arguments); + } + public static String getTokenText(int[] tokens, int... subtractions) { if (Arrays.equals(tokens, TokenUtils.getAllTokenIds()) && subtractions.length == 0) { return "TokenTypes."; diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/internal/CommitValidationTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/internal/CommitValidationTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/internal/CommitValidationTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/internal/CommitValidationTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -138,7 +138,7 @@ } private static List getCommitsToCheck() throws Exception { - List commits; + final List commits; try (Repository repo = new FileRepositoryBuilder().findGitDir().build()) { final RevCommitsPair revCommitsPair = resolveRevCommitsPair(repo); if (COMMITS_RESOLUTION_MODE == CommitsResolutionMode.BY_COUNTER) { @@ -168,8 +168,8 @@ RevCommitsPair revCommitIteratorPair; try (RevWalk revWalk = new RevWalk(repo)) { - Iterator first; - Iterator second; + final Iterator first; + final Iterator second; final ObjectId headId = repo.resolve(Constants.HEAD); final RevCommit headCommit = revWalk.parseCommit(headId); diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/internal/TestUtils.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/internal/TestUtils.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/internal/TestUtils.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/internal/TestUtils.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/internal/XDocsPagesTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/internal/XDocsPagesTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/internal/XDocsPagesTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/internal/XDocsPagesTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,7 @@ import java.io.File; import java.io.IOException; import java.io.StringReader; +import java.lang.reflect.Field; import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; @@ -98,6 +99,7 @@ "name=\"SuppressWithNearbyCommentFilter\"", "name=\"SuppressWarningsFilter\"", "name=\"RegexpHeader\"", + "name=\"RegexpOnFilename\"", "name=\"RegexpSingleline\"", "name=\"RegexpMultiline\"", "name=\"JavadocPackage\"", @@ -296,7 +298,7 @@ } private static void validateCheckSection(ModuleFactory moduleFactory, String fileName, - String sectionName, Node section) { + String sectionName, Node section) throws Exception { Object instance = null; try { @@ -317,10 +319,15 @@ continue; } + // optional sections that can be skipped if they have nothing to report if (subSectionPos == 1 && !"Properties".equals(subSectionName)) { validatePropertySection(fileName, sectionName, null, instance); subSectionPos++; } + if (subSectionPos == 4 && !"Error Messages".equals(subSectionName)) { + validateErrorSection(fileName, sectionName, null, instance); + subSectionPos++; + } Assert.assertEquals(fileName + " section '" + sectionName + "' should be in order", getSubSectionName(subSectionPos), @@ -338,9 +345,12 @@ validateUsageExample(fileName, sectionName, subSection); break; case 4: - validatePackageSection(fileName, sectionName, subSection, instance); + validateErrorSection(fileName, sectionName, subSection, instance); break; case 5: + validatePackageSection(fileName, sectionName, subSection, instance); + break; + case 6: validateParentSection(fileName, sectionName, subSection); break; default: @@ -368,9 +378,12 @@ result = "Example of Usage"; break; case 4: - result = "Package"; + result = "Error Messages"; break; case 5: + result = "Package"; + break; + case 6: result = "Parent Module"; break; default: @@ -479,6 +492,64 @@ } } } + + private static void validateErrorSection(String fileName, String sectionName, Node subSection, + Object instance) throws Exception { + final Class clss = instance.getClass(); + final Set fields = CheckUtil.getCheckMessages(clss); + final Set list = new TreeSet<>(); + + for (Field field : fields) { + // below is required for package/private classes + if (!field.isAccessible()) { + field.setAccessible(true); + } + + list.add(field.get(null).toString()); + } + + final StringBuilder expectedText = new StringBuilder(); + + for (String s : list) { + expectedText.append(s); + expectedText.append("\n"); + } + + if (expectedText.length() > 0) { + expectedText.append("All messages can be customized if the default message doesn't " + + "suite you.\nPlease see the documentation to learn how to."); + } + + if (subSection == null) { + Assert.assertEquals(fileName + " section '" + sectionName + + "' should have the expected error keys", "", expectedText.toString()); + } + else { + Assert.assertEquals(fileName + " section '" + sectionName + + "' should have the expected error keys", expectedText.toString().trim(), + subSection.getTextContent().replaceAll("\n\\s+", "\n").trim()); + + for (Node node : XmlUtil.findChildElementsByTag(subSection, "a")) { + final String url = node.getAttributes().getNamedItem("href").getTextContent(); + final String linkText = node.getTextContent().trim(); + final String expectedUrl; + + if ("see the documentation".equals(linkText)) { + expectedUrl = "config.html#Custom_messages"; + } + else { + expectedUrl = "https://github.com/search?q=" + + "path%3Asrc%2Fmain%2Fresources%2F" + + clss.getPackage().getName().replace(".", "%2F") + + "+filename%3Amessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22" + + linkText + "%22"; + } + + Assert.assertEquals(fileName + " section '" + sectionName + + "' should have matching url for '" + linkText + "'", expectedUrl, url); + } + } + } private static void validateUsageExample(String fileName, String sectionName, Node subSection) { final String text = subSection.getTextContent().replace("Checkstyle Style", "") diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/internal/XDocUtil.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/internal/XDocUtil.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/internal/XDocUtil.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/internal/XDocUtil.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/internal/XmlUtil.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/internal/XmlUtil.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/internal/XmlUtil.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/internal/XmlUtil.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/PackageNamesLoaderTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/PackageNamesLoaderTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/PackageNamesLoaderTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/PackageNamesLoaderTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/PackageObjectFactoryTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/PackageObjectFactoryTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/PackageObjectFactoryTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/PackageObjectFactoryTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/PropertiesExpanderTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/PropertiesExpanderTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/PropertiesExpanderTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/PropertiesExpanderTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/PropertyCacheFileTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/PropertyCacheFileTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/PropertyCacheFileTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/PropertyCacheFileTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtilityTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtilityTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtilityTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtilityTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/utils/CheckUtilsTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/utils/CheckUtilsTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/utils/CheckUtilsTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/utils/CheckUtilsTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/utils/CommonUtilsTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/utils/CommonUtilsTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/utils/CommonUtilsTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/utils/CommonUtilsTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtilsTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtilsTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtilsTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtilsTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtilsTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtilsTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtilsTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtilsTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/utils/TokenUtilsTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/utils/TokenUtilsTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/utils/TokenUtilsTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/utils/TokenUtilsTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/XMLLoggerTest.java checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/XMLLoggerTest.java --- checkstyle-6.14.1/src/test/java/com/puppycrawl/tools/checkstyle/XMLLoggerTest.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/java/com/puppycrawl/tools/checkstyle/XMLLoggerTest.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/blocks/InputEmptyCatchBlock.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/blocks/InputEmptyCatchBlock.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/blocks/InputEmptyCatchBlock.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/blocks/InputEmptyCatchBlock.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/InputFinalLocalVariable.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/InputFinalLocalVariable.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/InputFinalLocalVariable.java 2015-12-26 21:19:24.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/InputFinalLocalVariable.java 2016-01-30 23:19:28.000000000 +0000 @@ -281,3 +281,155 @@ } } } + +class Class3 { + public void test1() { + final boolean b = true; + int shouldBeFinal; //Violation + + if (b) { + shouldBeFinal = 1; + } + else { + shouldBeFinal = 2; + } + } + + public void test2() { + final int b = 10; + int shouldBeFinal; //Violation + + switch (b) { + case 0: + shouldBeFinal = 1; + break; + default: + shouldBeFinal = 2; + break; + } + } + + public void test3() { + int x; // No Violation + try { + x = 0; + } catch (final Exception e) { + x = 1; + } + + int y; // No Violation + try { + y = 0; + } finally { + y = 1; + } + } + + public void test4() { + final boolean b = false; + int x; // No Violation + if (b) { + x = 1; + } else { + x = 2; + } + + if(b) { + x = 3; + } + } + + public void test5() { + final boolean b = false; + int shouldBeFinal; //Violation + if(b) { + } + if (b) { + shouldBeFinal = 1; + } else { + shouldBeFinal = 2; + } + } +} + +class class4 { + public void foo() { + int shouldBeFinal; //violation + class Bar { + void bar () { + int shouldBeFinal; //Violation + final boolean b = false; + if (b) { + shouldBeFinal = 1; + } else { + shouldBeFinal = 2; + } + } + } + } +} + +class class5 { + public void test1(){ + final boolean b = false; + int shouldBeFinal; //Violation + if(b){ + if(b){ + shouldBeFinal = 1; + } else { + shouldBeFinal = 2; + } + } + } + public void test2() { + final int b = 10; + int shouldBeFinal; //Violation + + switch (b) { + case 0: + switch (b) { + case 0: + shouldBeFinal = 1; + break; + default: + shouldBeFinal = 2; + break; + } + break; + default: + shouldBeFinal = 3; + break; + } + } + public void test3() { + int x; //No Violation + try { + x = 0; + try { + x = 0; + } catch (final Exception e) { + x = 1; + } + } catch (final Exception e) { + x = 1; + } + } + public void test4() { + int shouldBeFinal; //violation + class Bar { + void bar () { + int shouldBeFinal; //Violation + final boolean b = false; + if (b) { + if (b) { + shouldBeFinal = 1; + } else { + shouldBeFinal = 2; + } + } else { + shouldBeFinal = 2; + } + } + } + } +} diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/InputRequireThis.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/InputRequireThis.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/InputRequireThis.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/InputRequireThis.java 2016-01-30 23:19:28.000000000 +0000 @@ -123,3 +123,14 @@ } } } + +class Issue2539{ + void foo(int i) {} + static void foo(double i) {} + void foo() {} + + void bar() { + foo(1); + foo(); + } +} diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputAnnotationClosingParenthesisEndsInSameIndentationAsOpening.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputAnnotationClosingParenthesisEndsInSameIndentationAsOpening.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputAnnotationClosingParenthesisEndsInSameIndentationAsOpening.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputAnnotationClosingParenthesisEndsInSameIndentationAsOpening.java 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1,24 @@ +package com.puppycrawl.tools.checkstyle.checks.indentation; //indent:0 exp:0 + +@interface SimpleType { //indent:0 exp:0 + Class value(); //indent:4 exp:4 +} //indent:0 exp:0 + +@SimpleType( //indent:0 exp:0 + value = Boolean.class //indent:4 exp:4 +) //indent:0 exp:0 +public class InputAnnotationClosingParenthesisEndsInSameIndentationAsOpening { //indent:0 exp:0 +} //indent:0 exp:0 + +@SimpleType( value = Boolean.class //indent:0 exp:0 +) //indent:0 exp:0 +class InputAnnotationClosingParenthesisJustLineAfterOpeningSameIndentationAsOpening { //indent:0 exp:0 +} //indent:0 exp:0 + +@SimpleType( value = Boolean.class //indent:0 exp:0 + ) //indent:16 exp:0 warn +class InputAnnotationClosingParenthesHasBadIndentation { //indent:0 exp:0 + @SimpleType( value = Boolean.class //indent:4 exp:4 + ) //indent:8 exp:4 warn + Boolean booleanField; //indent:4 exp:4 +} //indent:0 exp:0 \ No newline at end of file diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputFromGuava.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputFromGuava.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputFromGuava.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputFromGuava.java 2016-01-30 23:19:29.000000000 +0000 @@ -216,7 +216,7 @@ { //indent:2 exp:2 return null; //indent:4 exp:4 } //indent:2 exp:2 - + private static class ValueReference { //indent:2 exp:2 } //indent:2 exp:2 @@ -239,7 +239,7 @@ } //indent:4 exp:4 } //indent:2 exp:2 - + private static class StrongValueReference { //indent:2 exp:2 public StrongValueReference(int value) //indent:4 exp:4 @@ -248,7 +248,7 @@ } //indent:4 exp:4 } //indent:2 exp:2 - + private static class WeightedStrongValueReference { //indent:2 exp:2 public WeightedStrongValueReference(int value, int weight) //indent:4 exp:4 diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputSeparatedStatements.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputSeparatedStatements.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputSeparatedStatements.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputSeparatedStatements.java 2016-01-30 23:19:29.000000000 +0000 @@ -0,0 +1,12 @@ +package com.puppycrawl.tools.checkstyle.checks.indentation;//indent:0 exp:0 + +import java.io.*//indent:0 exp:0 + + ;//indent:4 exp:4 + +import java.util.*//indent:0 exp:0 + //indent:4 exp:4 + ;//indent:4 exp:4 + +public class InputSeparatedStatements {//indent:0 exp:0 +}//indent:0 exp:0 diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputSeparatedStatementWithSpaces.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputSeparatedStatementWithSpaces.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputSeparatedStatementWithSpaces.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/InputSeparatedStatementWithSpaces.java 2016-01-30 23:19:29.000000000 +0000 @@ -0,0 +1,10 @@ +// test file has no expected comments to test out blank line with just spaces +package com.puppycrawl.tools.checkstyle.checks.indentation; + +import java.util.* + // next line should be empty with just spaces, indented correctly + + ; + +public class InputSeparatedStatementWithSpaces { +} \ No newline at end of file diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputCorrectSummaryJavaDoc.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputCorrectSummaryJavaDoc.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputCorrectSummaryJavaDoc.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputCorrectSummaryJavaDoc.java 2016-01-30 23:19:28.000000000 +0000 @@ -29,6 +29,9 @@ */ void foo6() {} + /** {@inheritDoc} */ + void foo7() {} + /** * */ diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputJavadocMethodsNotSkipWritten.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputJavadocMethodsNotSkipWritten.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputJavadocMethodsNotSkipWritten.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputJavadocMethodsNotSkipWritten.java 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1,28 @@ +package com.puppycrawl.tools.checkstyle.checks.javadoc; + +public class InputJavadocMethodsNotSkipWritten { + /** + * Description. + * + * @param BAD + * This param doesn't exist. + */ + @MyAnnotation + public void InputJavadocMethodsNotSkipWritten() { + } + + /** + * Description. + * + * @param BAD + * This param doesn't exist. + */ + @MyAnnotation + public void test() { + } + + /** Description. */ + @MyAnnotation + public void test2() { + } +} diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputJavadocPosition.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputJavadocPosition.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputJavadocPosition.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputJavadocPosition.java 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1,241 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +///////////// +// CLASSES // +///////////// + +/**Javadoc*/ +class/**nope*/ A/**nope*/{ + /**Javadoc*/ + protected/**nope*/ class/**nope*/ B/**nope*/{/**nope*/} + + /**Javadoc*/ + private/**nope*/ static/**nope*/ class/**nope*/ C/**nope*/{/**nope*/} + + /**Javadoc*/ + @Component/**nope*/ class/**nope*/ D/**nope*/{/**nope*/} + + /**Javadoc*/ + @Component/**nope*/ private/**nope*/ class/**nope*/ E/**nope*/{/**nope*/} + + /**Javadoc*/ + private/**nope*/ @Component/**nope*/ class/**nope*/ F/**nope*/{/**nope*/} +} + +////////////////// +// CONSTRUCTORS // +////////////////// + +/**Javadoc*/ +class/**nope*/ AA/**nope*/{ + /**Javadoc*/ + AA/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +/**Javadoc*/ +class/**nope*/ BB/**nope*/{ + /**Javadoc*/ + private/**nope1*/ BB/**nope2*/(/**nope3*/)/**nope4*/{/**nope5*/}/**nope6*/ +} + +class/**nope*/ DD/**nope*/{ + /**Javadoc*/ + @Component/**nope*/ DD/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +class/**nope*/ EE/**nope*/{ + /**Javadoc*/ + @Component/**nope*/ private/**nope*/ EE/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +class/**nope*/ FF/**nope*/{ + /**Javadoc*/ + private/**nope*/ @Component/**nope*/ FF/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +///////////// +// METHODS // +///////////// + +class AAA { + /**Javadoc*/ + void/**nope*/ a/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +class BBB { + /**Javadoc*/ + private/**nope*/ void/**nope*/ a/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +class CCC { + /**Javadoc*/ + static/**nope*/ private/**nope*/ void/**nope*/ a/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +class DDD { + /**Javadoc*/ + @Component/**nope*/ void/**nope*/ a/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +class EEE { + /**Javadoc*/ + @Component/**nope*/ private/**nope*/ void/**nope*/ a/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +class FFF { + /**Javadoc*/ + static/**nope*/ @Component/**nope*/ private/**nope*/ void/**nope*/ a/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +class GGG { + /**Javadoc*/ + void/**nope*/ a/**nope*/(@Component/**nope*/int/**nope*/ a/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +//////////////// +// INTERFACES // +//////////////// + +/**Javadoc*/ +interface/**nope*/ AAAA/**nope*/ {} + +/**Javadoc*/ +abstract/**nope*/ interface/**nope*/ BBBB/**nope*/ {/**nope*/} + +/**Javadoc*/ +@Component/**nope*/ interface/**nope*/ CCCC/**nope*/ {/**nope*/} + +/**Javadoc*/ +@Component/**nope*/ abstract/**nope*/ interface/**nope*/ DDDD/**nope*/ {/**nope*/} + +/**Javadoc*/ +abstract/**nope*/ @Component/**nope*/ interface/**nope*/ EEEE/**nope*/ {/**nope*/} + +/////////// +// ENUMS // +/////////// + +/**Javadoc*/ +enum/**nope*/ AAAAA/**nope*/ {} + +class ASD { + /**Javadoc*/ + private/**nope*/ enum/**nope*/ BBBBB/**nope*/ {/**nope*/} + + /**Javadoc*/ + @Component/**nope*/ enum/**nope*/ CCCCC/**nope*/ {/**nope*/} + + /**Javadoc*/ + @Component/**nope*/ private/**nope*/ enum/**nope*/ DDDDD/**nope*/ {/**nope*/} + + /**Javadoc*/ + private/**nope*/ @Component/**nope*/ enum/**nope*/ EEEEE/**nope*/ {/**nope*/} +} + +//////////// +// FIELDS // +//////////// + +class AAAAAA { + /**Javadoc*/ + int/**nope*/ a/**nope*/; + /**Javadoc*/ + private/**nope*/ int/**nope*/ b/**nope*/; + /**Javadoc*/ + private/**nope*/ final/**nope*/ int/**nope*/ c/**nope*/=1; + /**Javadoc*/ + private/**nope*/ static/**nope*/ final/**nope*/ int/**nope*/ d/**nope*/=1; +} + +class BBBBBB { + /**Javadoc*/ + int/**nope*/ a/**nope*/=/**nope*/1/**nope*/; + /**Javadoc*/ + private/**nope*/ int/**nope*/ b/**nope*/=/**nope*/1/**nope*/; + /**Javadoc*/ + private/**nope*/ final/**nope*/ int/**nope*/ c/**nope*/=/**nope*/1/**nope*/; + /**Javadoc*/ + private/**nope*/ static/**nope*/ final/**nope*/ int/**nope*/ d/**nope*/=/**nope*/1/**nope*/; +} + + +class CCCCCC { + /**Javadoc*/ + Object/**nope*/ a/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; + /**Javadoc*/ + private/**nope*/ Object/**nope*/ b/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; + /**Javadoc*/ + private/**nope*/ final/**nope*/ Object/**nope*/ c/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; + /**Javadoc*/ + private/**nope*/ static/**nope*/ final/**nope*/ Object/**nope*/ d/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; +} + +class DDDDDD { + /**Javadoc*/ + @Component/**nope*/ Object/**nope*/ a/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; + /**Javadoc*/ + @Component/**nope*/ private/**nope*/ Object/**nope*/ b/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; + /**Javadoc*/ + @Component/**nope*/ private/**nope*/ final/**nope*/ Object/**nope*/ c/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; + /**Javadoc*/ + @Component/**nope*/ private/**nope*/ static/**nope*/ final/**nope*/ Object/**nope*/ d/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; +} + +class EEEEEE { + /**Javadoc*/ + private/**nope*/ @Component/**nope*/ Object/**nope*/ b/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; + /**Javadoc*/ + private/**nope*/ @Component/**nope*/ final/**nope*/ Object/**nope*/ c/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; + /**Javadoc*/ + private/**nope*/ @Component/**nope*/ static/**nope*/ final/**nope*/ Object/**nope*/ d/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; +} + +///////////////// +// ENUM CONSTS // +///////////////// + +enum AAAAAAA { + /**Javadoc*/ + ONE/**nope*/, + /**Javadoc*/ + TWO/**nope*/ +} + +enum BBBBBBB { + /**Javadoc*/ + ONE/**nope*/(/**nope*/1/**nope*/)/**nope*/, + /**Javadoc*/ + TWO/**nope*/(/**nope*/2/**nope*/)/**nope*/; + BBBBBBB(int i){} +} + +enum CCCCCCC { + /**Javadoc*/ + @Component/**nope*/ ONE/**nope*/(/**nope*/1/**nope*/)/**nope*/, + /**Javadoc*/ + @Component/**nope*/ TWO/**nope*/(/**nope*/2/**nope*/)/**nope*/; + CCCCCCC(int i){} +} + +/**Javadoc*/ +@Retention(/**nope*/RetentionPolicy/**nope*/./**nope*/RUNTIME/**nope4*/)/**nope*/ +@Target(/**nope*/{/**nope*/ElementType/**nope*/./**nope*/CONSTRUCTOR/**nope*/, /**nope*/ElementType/**nope*/./**nope*/FIELD/**nope*/ + , /**nope*/ElementType/**nope*/./**nope*/LOCAL_VARIABLE/**nope*/, /**nope*/ElementType/**nope*/./**nope*/METHOD + , /**nope*/ElementType/**nope*/./**nope*/PARAMETER/**nope*/, /**nope*/ElementType/**nope*/./**nope*/TYPE/**nope*/}/**nope*/)/**nope*/ +@interface/**nope*/ Component/**nope*/ {/**nope*/ +} + +/**Javadoc*/ +@interface/**nope*/ MyAnnotation/**nope*/ {/**nope*/ +} + +class MyTemp1 { + /**Javadoc*/ //noise + private @interface/**nope*/ MyAnnotation3/**nope*/ {/**nope*/ + } +} + +/**nope*/ diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputJavadocPositionOnlyComments.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputJavadocPositionOnlyComments.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputJavadocPositionOnlyComments.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputJavadocPositionOnlyComments.java 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1,3 @@ +package com.puppycrawl.tools.checkstyle.checks.javadoc; +/** Javadoc for import */ +import java.io.Serializable; diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputJavadocPositionWithSinglelineComments.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputJavadocPositionWithSinglelineComments.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputJavadocPositionWithSinglelineComments.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/InputJavadocPositionWithSinglelineComments.java 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1,242 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +///////////// +// CLASSES // +///////////// + +/**Javadoc*/ /*noise*/ //noise +class/**nope*/ V/**nope*/{ + /**Javadoc*/ //noise + protected/**nope*/ class/**nope*/ N/**nope*/{/**nope*/} + + /**Javadoc*/ //noise + private/**nope*/ static/**nope*/ class/**nope*/ X/**nope*/{/**nope*/} + + /**Javadoc*/ //noise + @Component2/**nope*/ class/**nope*/ Z/**nope*/{/**nope*/} + + /**Javadoc*/ //noise + @Component2/**nope*/ private/**nope*/ class/**nope*/ Y/**nope*/{/**nope*/} + + /**Javadoc*/ //noise + private/**nope*/ @Component2/**nope*/ class/**nope*/ M/**nope*/{/**nope*/} +} + +////////////////// +// CONSTRUCTORS // +////////////////// + +/**Javadoc*/ //noise +class/**nope*/ VV/**nope*/{ + /**Javadoc*/ //noise + VV/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +/**Javadoc*/ //noise +class/**nope*/ NN/**nope*/{ + /**Javadoc*/ //noise + private/**nope1*/ NN/**nope2*/(/**nope3*/)/**nope4*/{/**nope5*/}/**nope6*/ +} + +class/**nope*/ ZZ/**nope*/{ + /**Javadoc*/ //noise + @Component2/**nope*/ ZZ/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +class/**nope*/ YY/**nope*/{ + /**Javadoc*/ //noise + @Component2/**nope*/ private/**nope*/ YY/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +class/**nope*/ MM/**nope*/{ + /**Javadoc*/ //noise + private/**nope*/ @Component2/**nope*/ MM/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +///////////// +// METHODS // +///////////// + +class VVV { + /**Javadoc*/ //noise + void/**nope*/ a/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +class NNN { + /**Javadoc*/ //noise + private/**nope*/ void/**nope*/ a/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +class XXX { + /**Javadoc*/ //noise + static/**nope*/ private/**nope*/ void/**nope*/ a/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +class ZZZ { + /**Javadoc*/ //noise + @Component2/**nope*/ void/**nope*/ a/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +class YYY { + /**Javadoc*/ //noise + @Component2/**nope*/ private/**nope*/ void/**nope*/ a/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +class MMM { + /**Javadoc*/ //noise + static/**nope*/ @Component2/**nope*/ private/**nope*/ void/**nope*/ a/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +class LKJ { + /**Javadoc*/ //noise + void/**nope*/ a/**nope*/(@Component2/**nope*/int/**nope*/ a/**nope*/)/**nope*/{/**nope*/}/**nope*/ +} + +//////////////// +// INTERFACES // +//////////////// + +/**Javadoc*/ //noise +interface/**nope*/ VVVV/**nope*/ {} + +/**Javadoc*/ //noise +abstract/**nope*/ interface/**nope*/ NNNN/**nope*/ {/**nope*/} + +/**Javadoc*/ //noise +@Component2/**nope*/ interface/**nope*/ XXXX/**nope*/ {/**nope*/} + +/**Javadoc*/ //noise +@Component2/**nope*/ abstract/**nope*/ interface/**nope*/ ZZZZ/**nope*/ {/**nope*/} + +/**Javadoc*/ //noise +abstract/**nope*/ @Component2/**nope*/ interface/**nope*/ YYYY/**nope*/ {/**nope*/} + +/////////// +// ENUMS // +/////////// + +/**Javadoc*/ //noise +enum/**nope*/ VVVVV/**nope*/ {} + +class VSZ { + /**Javadoc*/ //noise + private/**nope*/ enum/**nope*/ NNNNN/**nope*/ {/**nope*/} + + /**Javadoc*/ //noise + @Component2/**nope*/ enum/**nope*/ XXXXX/**nope*/ {/**nope*/} + + /**Javadoc*/ //noise + @Component2/**nope*/ private/**nope*/ enum/**nope*/ ZZZZZ/**nope*/ {/**nope*/} + + /**Javadoc*/ //noise + private/**nope*/ @Component2/**nope*/ enum/**nope*/ YYYYY/**nope*/ {/**nope*/} +} + +//////////// +// FIELDS // +//////////// + +class VVVVVV { + /**Javadoc*/ //noise + int/**nope*/ a/**nope*/; + /**Javadoc*/ //noise + private/**nope*/ int/**nope*/ b/**nope*/; + /**Javadoc*/ //noise + private/**nope*/ final/**nope*/ int/**nope*/ c/**nope*/=1; + /**Javadoc*/ //noise + private/**nope*/ static/**nope*/ final/**nope*/ int/**nope*/ d/**nope*/=1; +} + +class NNNNNN { + /**Javadoc*/ //noise + int/**nope*/ a/**nope*/=/**nope*/1/**nope*/; + /**Javadoc*/ //noise + private/**nope*/ int/**nope*/ b/**nope*/=/**nope*/1/**nope*/; + /**Javadoc*/ //noise + private/**nope*/ final/**nope*/ int/**nope*/ c/**nope*/=/**nope*/1/**nope*/; + /**Javadoc*/ //noise + private/**nope*/ static/**nope*/ final/**nope*/ int/**nope*/ d/**nope*/=/**nope*/1/**nope*/; +} + + +class XXXXXX { + /**Javadoc*/ //noise + Object/**nope*/ a/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; + /**Javadoc*/ //noise + private/**nope*/ Object/**nope*/ b/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; + /**Javadoc*/ //noise + private/**nope*/ final/**nope*/ Object/**nope*/ c/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; + /**Javadoc*/ //noise + private/**nope*/ static/**nope*/ final/**nope*/ Object/**nope*/ d/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; +} + +class ZZZZZZ { + /**Javadoc*/ //noise + @Component2/**nope*/ Object/**nope*/ a/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; + /**Javadoc*/ //noise + @Component2/**nope*/ private/**nope*/ Object/**nope*/ b/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; + /**Javadoc*/ //noise + @Component2/**nope*/ private/**nope*/ final/**nope*/ Object/**nope*/ c/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; + /**Javadoc*/ //noise + @Component2/**nope*/ private/**nope*/ static/**nope*/ final/**nope*/ Object/**nope*/ d/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; +} + +class YYYYYY { + /*noise*/ /**Javadoc*/ //noise + private/**nope*/ @Component2/**nope*/ Object/**nope*/ b/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; + /**Javadoc*/ //noise + private/**nope*/ @Component2/**nope*/ final/**nope*/ Object/**nope*/ c/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; + /**Javadoc*/ //noise + private/**nope*/ @Component2/**nope*/ static/**nope*/ final/**nope*/ Object/**nope*/ d/**nope*/ =/**nope*/ new/**nope*/ Object/**nope*/(/**nope*/)/**nope*/{/**nope*/}/**nope*/; +} + +///////////////// +// ENUM CONSTS // +///////////////// + +enum VVVVVVV { + /**Javadoc*/ //noise + ONY/**nope*/, + /**Javadoc*/ //noise + TWO/**nope*/ +} + +enum NNNNNNN { + /**Javadoc*/ /*noise*/ //noise + ONY/**nope*/(/**nope*/1/**nope*/)/**nope*/, + /**Javadoc*/ //noise + TWO/**nope*/(/**nope*/2/**nope*/)/**nope*/; + NNNNNNN(int i){} +} + +enum XXXXXXX { + /**Javadoc*/ //noise + @Component2/**nope*/ ONY/**nope*/(/**nope*/1/**nope*/)/**nope*/, + /**Javadoc*/ //noise + @Component2/**nope*/ TWO/**nope*/(/**nope*/2/**nope*/)/**nope*/; + XXXXXXX(int i){} +} + + +/**Javadoc*/ //noise +@Retention(/**nope*/RetentionPolicy/**nope*/./**nope*/RUNTIME/**nope4*/)/**nope*/ +@Target(/**nope*/{/**nope*/ElementType/**nope*/./**nope*/CONSTRUCTOR/**nope*/, /**nope*/ElementType/**nope*/./**nope*/FIELD/**nope*/ + , /**nope*/ElementType/**nope*/./**nope*/LOCAL_VARIABLE/**nope*/, /**nope*/ElementType/**nope*/./**nope*/METHOD + , /**nope*/ElementType/**nope*/./**nope*/PARAMETER/**nope*/, /**nope*/ElementType/**nope*/./**nope*/TYPE/**nope*/}/**nope*/)/**nope*/ +@interface/**nope*/ Component2/**nope*/ {/**nope*/ +} + +/**Javadoc*/ //noise +@interface/**nope*/ MyAnnotation2/**nope*/ {/**nope*/ +} + +class MyTemp2 { + /**Javadoc*/ //noise + private @interface/**nope*/ MyAnnotation3/**nope*/ {/**nope*/ + } +} + +/**nope*/ diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/Input Space.properties checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/Input Space.properties --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/Input Space.properties 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/Input Space.properties 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1 @@ +this=bad diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparatorHeader.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparatorHeader.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparatorHeader.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparatorHeader.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparator.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparator.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparator.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparator.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparatorMultipleEmptyLines.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparatorMultipleEmptyLines.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparatorMultipleEmptyLines.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/InputEmptyLineSeparatorMultipleEmptyLines.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/configs/java2.header checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/configs/java2.header --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/configs/java2.header 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/configs/java2.header 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// //testvdfvcheckstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/configs/java.header checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/configs/java.header --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/configs/java.header 2015-11-13 05:06:18.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/configs/java.header 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/filters/InputSuppressByIdWithCommentFilter.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/filters/InputSuppressByIdWithCommentFilter.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/filters/InputSuppressByIdWithCommentFilter.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/filters/InputSuppressByIdWithCommentFilter.java 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1,16 @@ +package com.puppycrawl.tools.checkstyle.filters; + +public class InputSuppressByIdWithCommentFilter { + + //CSOFF ignore (reason) + private int A1; + + // @cs-: ignore (No NPE here) + private static final int abc = 5; + + + int line_length = 100; + //CSON ignore + + private long ID = 1; +} diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/filters/InputSuppressByIdWithNearbyCommentFilter.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/filters/InputSuppressByIdWithNearbyCommentFilter.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/filters/InputSuppressByIdWithNearbyCommentFilter.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/filters/InputSuppressByIdWithNearbyCommentFilter.java 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1,12 @@ +package com.puppycrawl.tools.checkstyle.filters; + +public class InputSuppressByIdWithNearbyCommentFilter { + + private int A1; // @cs-: ignore (reason) + + private static final int abc = 5; // @cs-: violation (No NPE here) + + int line_length = 100; // Suppression @cs-: ignore (reason) + + private long ID = 1; // Suppression @cs-: +} diff -Nru checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/filters/InputSuppressByIdWithWarningsFilter.java checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/filters/InputSuppressByIdWithWarningsFilter.java --- checkstyle-6.14.1/src/test/resources/com/puppycrawl/tools/checkstyle/filters/InputSuppressByIdWithWarningsFilter.java 1970-01-01 00:00:00.000000000 +0000 +++ checkstyle-6.15/src/test/resources/com/puppycrawl/tools/checkstyle/filters/InputSuppressByIdWithWarningsFilter.java 2016-01-30 23:19:28.000000000 +0000 @@ -0,0 +1,13 @@ +package com.puppycrawl.tools.checkstyle.filters; + +public class InputSuppressByIdWithWarningsFilter { + + @SuppressWarnings("checkstyle:ignore") + private int A1 = 1; + + @SuppressWarnings("checkstyle:ignore") + public static void main(String[] args) { + + } + +} diff -Nru checkstyle-6.14.1/src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/InputOneStatementPerLine.java checkstyle-6.15/src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/InputOneStatementPerLine.java --- checkstyle-6.14.1/src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/InputOneStatementPerLine.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/InputOneStatementPerLine.java 2016-01-30 23:19:28.000000000 +0000 @@ -10,9 +10,16 @@ * Two import statements and one 'empty' statement * which are not on the same line are legal. */ +import java.awt.event.ActionEvent; import java.lang.annotation.Annotation; ; import java.lang.String; +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.stream.Collectors; + +import javax.swing.JCheckBox; public class InputOneStatementPerLine { /** @@ -22,4 +29,33 @@ * and rises violation. */ ;; //warn + static { + new JCheckBox().addActionListener((final ActionEvent e) -> {good();}); + List ints = new LinkedList(); + ints.stream().map( t -> { return t * 2;} ).filter( t -> { return false;}); + ints.stream().map( t -> { int m = t * 2; return m; } ); //warn + ints.stream().map( t -> { int m = t * 2; return m; } ); int i = 3; //warn + ints.stream().map( t -> t * 2); int k = 4; //warn + ints.stream().map( t -> t * 2); + List ints2 = new LinkedList(); + ints.stream().map( t -> { return ints2.stream().map(w -> { return w * 2; });}); + ints.stream().map( t -> { return ints2.stream().map(w -> { int m = w * 2; return m; });}); //warn + ints.stream().map( t -> { + return ints2.stream().map( + w -> { + int m = w * 2; + return m; + }); + }); + ints.stream().map( t -> { + int k = 0; + for (int i = 0;i < 10;i++) { + k = i + k; + } + return k; + }); + } + + private static void good() { + } } diff -Nru checkstyle-6.14.1/src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/design/package-info.java checkstyle-6.15/src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/design/package-info.java --- checkstyle-6.14.1/src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/design/package-info.java 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/design/package-info.java 2016-01-30 23:19:28.000000000 +0000 @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. -// Copyright (C) 2001-2015 the original author or authors. +// Copyright (C) 2001-2016 the original author or authors. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public diff -Nru checkstyle-6.14.1/src/xdocs/checks.xml checkstyle-6.15/src/xdocs/checks.xml --- checkstyle-6.14.1/src/xdocs/checks.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/checks.xml 2016-01-30 23:19:28.000000000 +0000 @@ -638,6 +638,10 @@ any file type. + RegexpOnFilename + Implementation of a check that matches based on file and/or folder path. + + RegexpSingleline Implementation of a check that looks for a single line in any file type. diff -Nru checkstyle-6.14.1/src/xdocs/config_annotation.xml checkstyle-6.15/src/xdocs/config_annotation.xml --- checkstyle-6.14.1/src/xdocs/config_annotation.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/config_annotation.xml 2016-01-30 23:19:28.000000000 +0000 @@ -160,6 +160,23 @@
+ + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.annotation

@@ -252,6 +269,35 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.annotation

@@ -282,6 +328,27 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.annotation

@@ -350,6 +417,23 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.annotation

@@ -379,6 +463,7 @@ Java Language Specification, section 7.4.1.

+

To configure the check:

<module name="PackageAnnotation"/> @@ -394,6 +479,19 @@
+ + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.annotation

@@ -513,6 +611,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.annotation

@@ -608,6 +719,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks

diff -Nru checkstyle-6.14.1/src/xdocs/config_blocks.xml checkstyle-6.15/src/xdocs/config_blocks.xml --- checkstyle-6.14.1/src/xdocs/config_blocks.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/config_blocks.xml 2016-01-30 23:19:28.000000000 +0000 @@ -125,6 +125,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.blocks

@@ -227,6 +240,23 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.blocks

@@ -357,6 +387,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.blocks

@@ -498,6 +541,27 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.blocks

@@ -650,6 +714,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.blocks

@@ -772,6 +849,31 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.blocks

diff -Nru checkstyle-6.14.1/src/xdocs/config_coding.xml checkstyle-6.15/src/xdocs/config_coding.xml --- checkstyle-6.14.1/src/xdocs/config_coding.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/config_coding.xml 2016-01-30 23:19:28.000000000 +0000 @@ -67,6 +67,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -114,6 +127,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -220,6 +246,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -337,6 +376,31 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -382,6 +446,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -424,6 +501,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -505,6 +595,23 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -556,6 +663,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -608,6 +728,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -725,6 +858,23 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -846,6 +996,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -1050,6 +1213,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -1115,6 +1291,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -1218,6 +1407,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -1315,6 +1517,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -1384,6 +1599,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -1479,6 +1707,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -1599,6 +1840,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -1670,6 +1924,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -1880,6 +2147,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -1919,6 +2199,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -1974,6 +2267,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -2081,6 +2387,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -2200,6 +2519,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -2250,6 +2582,23 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -2315,6 +2664,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -2379,6 +2741,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -2443,6 +2818,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -2496,6 +2884,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -2539,6 +2940,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -2615,6 +3029,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -2666,6 +3093,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -2710,6 +3150,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -2752,6 +3205,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -2773,6 +3239,25 @@ "this.methodName(args)" and that those references don't rely on the default behavior when "this." is absent.

+ +

+ Warning: the Check is very controversial and not that actual nowadays. +

+ +

+ Rationale: +

+
    +
  1. + The same notation/habit for C++ and Java (C++ have global methods, so having + "this." do make sense in it to distinguish call of method of class + instead of global). +
  2. +
  3. + Non-IDE development (ease of refactoring, some clearness to distinguish + static and non-static methods). +
  4. +
@@ -2825,6 +3310,23 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -2942,6 +3444,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -2991,6 +3506,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -3052,6 +3580,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -3103,6 +3644,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -3148,6 +3702,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -3194,6 +3761,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -3296,6 +3876,39 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding @@ -3500,6 +4113,23 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.coding diff -Nru checkstyle-6.14.1/src/xdocs/config_design.xml checkstyle-6.15/src/xdocs/config_design.xml --- checkstyle-6.14.1/src/xdocs/config_design.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/config_design.xml 2016-01-30 23:19:28.000000000 +0000 @@ -146,6 +146,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.design @@ -190,6 +203,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.design @@ -260,6 +286,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.design @@ -299,6 +338,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.design @@ -376,6 +428,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.design @@ -456,6 +521,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.design @@ -538,6 +616,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.design @@ -633,6 +724,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.design @@ -925,6 +1029,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.design diff -Nru checkstyle-6.14.1/src/xdocs/config_filters.xml checkstyle-6.15/src/xdocs/config_filters.xml --- checkstyle-6.14.1/src/xdocs/config_filters.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/config_filters.xml 2016-01-30 23:19:28.000000000 +0000 @@ -317,6 +317,53 @@ //resume ... +

+ It is possible to specify an ID of checks, so that it can be leveraged by the + SuppressionCommentFilter to skip validations. The following examples show how to skip + validations near code that is surrounded with // CSOFF <ID> (reason) + and // CSON <ID>, where ID is the ID of checks you want to suppress. +

+

+ Examples of Checkstyle checks configuration: +

+ +<module name="RegexpSinglelineJava"> + <property name="id" value="ignore"/> + <property name="format" value="^.*@Ignore\s*$"/> + <property name="message" value="@Ignore should have a reason."/> +</module> + +<module name="RegexpSinglelineJava"> + <property name="id" value="systemout"/> + <property name="format" value="^.*System\.(out|err).*$"/> + <property name="message" value="Don't use System.out/err, use SLF4J instead."/> +</module> + +

+ Example of SuppressionCommentFilter configuration (checkFormat which is set to '$1' + points that ID of the checks is in the first group of offCommentFormat and + onCommentFormat regular expressions): +

+ +<module name="SuppressionCommentFilter"> + <property name="offCommentFormat" value="CSOFF (\w+) \(\w+\)"/> + <property name="onCommentFormat" value="CSON (\w+)"/> + <property name="checkFormat" value="$1"/> +</module> + + +// CSOFF ignore (test has not been emplemented yet) +@Ignore // should NOT fail RegexpSinglelineJava +@Test +public void testMethod() { } +// CSON ignore + +// CSOFF systemout (debug) +public static void foo() { + System.out.println("Debug info."); // should NOT fail RegexpSinglelineJava +} +// CSON systemout +
    @@ -342,7 +389,8 @@ audit events for Check errors according to a suppressions XML document in a file. If there is no configured - suppressions file, the Filter accepts all audit events. + suppressions file or the optional is set to true and + suppressions file was not found the Filter accepts all audit events.

    @@ -374,6 +422,18 @@ string none + + optional + + Tells what to do when the file is not existing. If + optional is set to false the file must exist, or else + it ends with error. On the other hand if optional is + true and file is not found, the filter accept all + audit events. + + boolean + false + @@ -386,6 +446,7 @@ <module name="SuppressionFilter"> <property name="file" value="config/suppressions.xml"/> + <property name="optional" value="false"/> </module>

    @@ -599,6 +660,45 @@ @SuppressWarnings({"NoWhitespaceAfter"}) private int [] ARRAY; // should NOT fail MemberNameCheck and NoWhitespaceAfterCheck +

    + It is possible to specify an ID of checks, so that it can be leveraged by the + SuppressWarningsFilter to skip validations. The following examples show how to skip + validations near code that has @SuppressWarnings("checkstyle:<ID>") or + just @SuppressWarnings("<ID>") annotation, where ID is the ID of checks + you want to suppress. +

    +

    + Example of Checkstyle check configuration: +

    + +<module name="RegexpSinglelineJava"> + <property name="id" value="systemout"/> + <property name="format" value="^.*System\.(out|err).*$"/> + <property name="message" value="Don't use System.out/err, use SLF4J instead."/> +</module> + +

    + To make the annotations available to the filter. +

    + +<module name="TreeWalker"> + ... + <module name="SuppressWarningsHolder" /> + ... +</module> + +

    + To configure filter to suppress audit events for annotations add: +

    + +<module name="SuppressWarningsFilter" /> + + +@SuppressWarnings("checkstyle:systemout") +public static void foo() { + System.out.println("Debug info."); // should NOT fail RegexpSinglelineJava +} +
      @@ -790,6 +890,50 @@ public static final int [] array; // @cs.suppress ConstantName | NoWhitespaceAfter +

      + It is possible to specify an ID of checks, so that it can be leveraged by the + SuppressWithNearbyCommentFilter to skip validations. The following examples + show how to skip validations near code that has comment like + // @cs-: <ID/> (reason), where ID is the ID of checks you want to + suppress. +

      +

      + Examples of Checkstyle checks configuration: +

      + +<module name="RegexpSinglelineJava"> + <property name="id" value="ignore"/> + <property name="format" value="^.*@Ignore\s*$"/> + <property name="message" value="@Ignore should have a reason."/> +</module> + +<module name="RegexpSinglelineJava"> + <property name="id" value="systemout"/> + <property name="format" value="^.*System\.(out|err).*$"/> + <property name="message" value="Don't use System.out/err, use SLF4J instead."/> +</module> + +

      + Example of SuppressWithNearbyCommentFilter configuration (checkFormat which + is set to '$1' points that ID of the checks is in the first group of + commentFormat regular expressions): +

      + +<module name="SuppressWithNearbyCommentFilter"> + <property name="commentFormat" value="@cs-: (\w+) \(\w+\)"/> + <property name="checkFormat" value="$1"/> + <property name="influenceFormat" value="0"/> +</module> + + +@Ignore // @cs-: ignore (test has not been implemented yet) +@Test +public void testMethod() { } + +public static void foo() { + System.out.println("Debug info."); // @cs-: systemout (should not fail RegexpSinglelineJava) +} +
        diff -Nru checkstyle-6.14.1/src/xdocs/config_header.xml checkstyle-6.15/src/xdocs/config_header.xml --- checkstyle-6.14.1/src/xdocs/config_header.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/config_header.xml 2016-01-30 23:19:28.000000000 +0000 @@ -148,6 +148,23 @@
      + + +

      + All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

      +
      +

      com.puppycrawl.tools.checkstyle.checks.header

      @@ -334,6 +351,23 @@
    + + +

    + All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

    +
    +

    com.puppycrawl.tools.checkstyle.checks.header diff -Nru checkstyle-6.14.1/src/xdocs/config_imports.xml checkstyle-6.15/src/xdocs/config_imports.xml --- checkstyle-6.14.1/src/xdocs/config_imports.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/config_imports.xml 2016-01-30 23:19:28.000000000 +0000 @@ -106,6 +106,18 @@

+ + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+

com.puppycrawl.tools.checkstyle.checks.imports

@@ -184,6 +196,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.imports

@@ -515,6 +540,35 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.imports @@ -587,6 +641,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.imports @@ -698,6 +765,27 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.imports @@ -930,6 +1018,23 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.imports @@ -987,6 +1092,27 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.imports @@ -1097,6 +1223,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.imports diff -Nru checkstyle-6.14.1/src/xdocs/config_javadoc.xml checkstyle-6.15/src/xdocs/config_javadoc.xml --- checkstyle-6.14.1/src/xdocs/config_javadoc.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/config_javadoc.xml 2016-01-30 23:19:28.000000000 +0000 @@ -95,6 +95,39 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.javadoc @@ -399,6 +432,47 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.javadoc @@ -474,6 +548,23 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.javadoc @@ -569,6 +660,51 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.javadoc @@ -772,6 +908,39 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.javadoc @@ -833,6 +1002,39 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.javadoc @@ -995,6 +1197,39 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.javadoc @@ -1109,6 +1344,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.javadoc @@ -1152,6 +1400,39 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.javadoc @@ -1228,6 +1509,39 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.javadoc @@ -1310,6 +1624,43 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.javadoc @@ -1421,6 +1772,27 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.javadoc diff -Nru checkstyle-6.14.1/src/xdocs/config_metrics.xml checkstyle-6.15/src/xdocs/config_metrics.xml --- checkstyle-6.14.1/src/xdocs/config_metrics.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/config_metrics.xml 2016-01-30 23:19:28.000000000 +0000 @@ -127,6 +127,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.metrics @@ -214,6 +227,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.metrics @@ -298,6 +324,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.metrics @@ -490,6 +529,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.metrics @@ -597,6 +649,27 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.metrics @@ -757,6 +830,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.metrics diff -Nru checkstyle-6.14.1/src/xdocs/config_misc.xml checkstyle-6.15/src/xdocs/config_misc.xml --- checkstyle-6.14.1/src/xdocs/config_misc.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/config_misc.xml 2016-01-30 23:19:28.000000000 +0000 @@ -84,6 +84,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks @@ -227,6 +240,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks @@ -456,6 +482,23 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.indentation @@ -740,6 +783,31 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks @@ -886,6 +954,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks @@ -1024,6 +1105,31 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.indentation @@ -1119,6 +1225,23 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks @@ -1163,6 +1286,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks @@ -1244,6 +1380,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks @@ -1373,6 +1522,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks @@ -1505,6 +1667,23 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks @@ -1580,6 +1759,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks @@ -1644,6 +1836,23 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks @@ -1698,6 +1907,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks diff -Nru checkstyle-6.14.1/src/xdocs/config_modifier.xml checkstyle-6.15/src/xdocs/config_modifier.xml --- checkstyle-6.14.1/src/xdocs/config_modifier.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/config_modifier.xml 2016-01-30 23:19:28.000000000 +0000 @@ -92,6 +92,23 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.modifier

@@ -267,6 +284,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.modifier

diff -Nru checkstyle-6.14.1/src/xdocs/config_naming.xml checkstyle-6.15/src/xdocs/config_naming.xml --- checkstyle-6.14.1/src/xdocs/config_naming.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/config_naming.xml 2016-01-30 23:19:28.000000000 +0000 @@ -148,6 +148,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.naming

@@ -221,6 +234,23 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.naming

@@ -303,6 +333,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.naming

@@ -358,6 +401,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.naming

@@ -447,6 +503,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.naming

@@ -498,6 +567,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.naming

@@ -567,6 +649,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.naming

@@ -650,6 +745,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.naming

@@ -742,6 +850,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.naming

@@ -845,6 +966,23 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.naming

@@ -900,6 +1038,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.naming

@@ -968,6 +1119,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.naming

@@ -1062,6 +1226,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.naming

@@ -1143,6 +1320,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.naming

@@ -1261,6 +1451,19 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.naming

diff -Nru checkstyle-6.14.1/src/xdocs/config_regexp.xml checkstyle-6.15/src/xdocs/config_regexp.xml --- checkstyle-6.14.1/src/xdocs/config_regexp.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/config_regexp.xml 2016-01-30 23:19:28.000000000 +0000 @@ -446,6 +446,27 @@ + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.regexp @@ -541,6 +562,223 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+ + +

+ com.puppycrawl.tools.checkstyle.checks.regexp +

+
+ + +

+ Checker +

+
+ + +
+ +

+ Implementation of a check that looks for a file name and/or path match (or mis-match) + against specified patterns. It can also be used to verify files match specific naming + patterns not covered by other checks (Ex: properties, xml, etc.). +

+

+ When customizing the check, the properties are applied in a specific order. + The fileExtensions property first picks only files that match any of the + specific extensions supplied. + Once files are matched against the fileExtensions, the match property is then + used in conjuction with the patterns to determine if the check is looking + for a match or mis-match on those files. If the fileNamePattern is + supplied, the matching is only applied to the fileNamePattern and not the + folderPattern. If no fileNamePattern is supplied, then matching is applied + to the folderPattern only and will result in all files in a folder to be + reported on violations. If no folderPattern is supplied, then all folders + that checkstyle finds are examined for violations. + The ignoreFileNameExtensions property drops the file extension and applies + the fileNamePattern only to the rest of file name. For example, if the file is + named 'test.java' and this property is turned on, the pattern is only applied + to 'test'. +

+

+ If this check is configured with no properties, then the default behavior + of this check is to report file names with spaces in them. + When at least one pattern property is supplied, the entire check is under + the user's control to allow them to fully customize the behavior. +

+

+ It is recommended that if you create your own pattern, to also + specify a custom error message. This allows the error message printed + to be clear what the violation is, especially if multiple RegexpOnFilename + checks are used. + Argument 0 for the message populates the check's folderPattern. + Argument 1 for the message populates the check's fileNamePattern. + The file name is not passed as an argument since it is part of CheckStyle's + default error messages. +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
namedescriptiontypedefault value
folderPatternRegular expression to match the folder path against.regular expressionnull
fileNamePatternRegular expression to match the file name against.regular expressionnull
matchWhether to look for a match or mis-match on the file name, if the + fileNamePattern is supplied, otherwise it is applied on the folderPattern.Booleantrue
ignoreFileNameExtensionsWhether to ignore the file extension for the file name match.Booleanfalse
fileExtensionsFile type extension of files to process. If this is specified, then + only files that match these types are examined with the other patterns.String Set{}
+
+ + +

+ To configure the check to report file names that contain a space: +

+ +<module name="RegexpOnFilename"/> + +

+ To configure the check to force picture files to not be 'gif': +

+ +<module name="RegexpOnFilename"> + <property name="fileNamePattern" value="\\.gif$"/> +</module> + +

+ OR: +

+ +<module name="RegexpOnFilename"> + <property name="fileNamePattern" value="."/> + <property name="fileExtensions" value="gif"/> +</module> + +

+ To configure the check to only allow property and xml files to be located in the resource folder: +

+ +<module name="RegexpOnFilename"> + <property name="folderPattern" value="[\\/]src[\\/]\\w+[\\/]resources[\\/]"/> + <property name="match" value="false"/> + <property name="fileExtensions" value="properties, xml"/> +</module> + +

+ To configure the check to only allow Java and XML files in your folders use the below. +

+ +<module name="RegexpOnFilename"> + <property name="fileNamePattern" value="\\.(java|xml)$"/> + <property name="match" value="false"/> +</module> + +

+ To configure the check to only allow Java and XML files only in your source folder + and ignore any other folders:
+ Note: 'folderPattern' must be specified if checkstyle is analyzing more than + the normal source folder, like the 'bin' folder where class files can be located. +

+ +<module name="RegexpOnFilename"> + <property name="folderPattern" value="[\\/]src[\\/]"/> + <property name="fileNamePattern" value="\\.(java|xml)$"/> + <property name="match" value="false"/> +</module> + +

+ To configure the check to only allow file names to be camel case: +

+ +<module name="RegexpOnFilename"> + <property name="fileNamePattern" value="^([A-Z][a-z0-9]+\.?)+$"/> + <property name="match" value="false"/> + <property name="ignoreFileNameExtensions" value="true"/> +</module> + +
+ + + + + + + +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.regexp @@ -669,6 +907,25 @@ + +

+ +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.regexp @@ -773,6 +1030,25 @@ + +

+ +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.regexp diff -Nru checkstyle-6.14.1/src/xdocs/config_sizes.xml checkstyle-6.15/src/xdocs/config_sizes.xml --- checkstyle-6.14.1/src/xdocs/config_sizes.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/config_sizes.xml 2016-01-30 23:19:28.000000000 +0000 @@ -73,6 +73,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.sizes @@ -156,6 +169,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.sizes @@ -229,6 +255,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.sizes @@ -333,6 +372,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.sizes @@ -445,6 +497,35 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.sizes @@ -560,6 +641,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.sizes @@ -631,6 +725,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.sizes @@ -746,6 +853,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.sizes diff -Nru checkstyle-6.14.1/src/xdocs/config_whitespace.xml checkstyle-6.15/src/xdocs/config_whitespace.xml --- checkstyle-6.14.1/src/xdocs/config_whitespace.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/config_whitespace.xml 2016-01-30 23:19:28.000000000 +0000 @@ -81,6 +81,25 @@ + +

+ +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.whitespace @@ -158,6 +177,25 @@ + +

+ +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.whitespace @@ -305,6 +343,27 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.whitespace @@ -400,6 +459,23 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.whitespace @@ -476,6 +552,31 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.whitespace @@ -605,6 +706,27 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.whitespace @@ -710,6 +832,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.whitespace @@ -847,6 +982,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.whitespace @@ -943,6 +1091,19 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.whitespace @@ -1085,6 +1246,25 @@ + +

+ +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.whitespace @@ -1253,6 +1433,31 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.whitespace @@ -1373,6 +1578,23 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.whitespace @@ -1443,6 +1665,31 @@ + +

+

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.whitespace @@ -1528,6 +1775,25 @@ + +

+ +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.whitespace @@ -1765,6 +2031,25 @@ + +

+ +

+ All messages can be customized if the default message doesn't suite you. + Please see the documentation to learn how to. +

+
+

com.puppycrawl.tools.checkstyle.checks.whitespace diff -Nru checkstyle-6.14.1/src/xdocs/config.xml checkstyle-6.15/src/xdocs/config.xml --- checkstyle-6.14.1/src/xdocs/config.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/config.xml 2016-01-30 23:19:28.000000000 +0000 @@ -619,7 +619,7 @@

- Each check configuration element can zero or more message elements. Every check uses one or + Each check configuration element can have zero or more message elements. Every check uses one or more distinct message keys to log violations. If you want to customize a certain message you need to specify the message key in the key attribute of the message element. @@ -637,12 +637,11 @@

The obvious question is how do you know which message keys a - Check uses, so that you can override them? Well, that is the - tricky part. To find out which keys a Check uses you currently - need to look into the Check's source code, in conjunction with - the Check's messages.properties file. - Tools/plugins might come to the rescue on this topic, so have a - look there. + Check uses, so that you can override them? You can examine all + keys in the check's specific configuration + documentation. Each check has a section called 'Error Messages'. + This section lists every key the check uses and links to the default + message used by checkstyle.

diff -Nru checkstyle-6.14.1/src/xdocs/google_style.xml checkstyle-6.15/src/xdocs/google_style.xml --- checkstyle-6.14.1/src/xdocs/google_style.xml 2015-12-26 15:05:48.000000000 +0000 +++ checkstyle-6.15/src/xdocs/google_style.xml 2016-01-30 23:19:28.000000000 +0000 @@ -1201,6 +1201,11 @@ src="images/ok_green.png" alt="" /> ClassTypeParameterName +
+ + InterfaceTypeParameterName test +
+ config +
+ test diff -Nru checkstyle-6.14.1/src/xdocs/index.xml.vm checkstyle-6.15/src/xdocs/index.xml.vm --- checkstyle-6.14.1/src/xdocs/index.xml.vm 2015-12-29 16:49:00.000000000 +0000 +++ checkstyle-6.15/src/xdocs/index.xml.vm 2016-01-30 23:19:28.000000000 +0000 @@ -106,8 +106,8 @@

@@ -244,7 +244,7 @@ SonarQube Freddy Mallet (initial author) SonarQube Home Page - Demo site + Demo site jEdit @@ -273,6 +273,12 @@ JArchitect Home Page Imports XML result files from CheckStyle. + + SBT + Andrew Johnson + sbt-checkstyle-plugin Project Page + SBT plugin for running Checkstyle on Java source files in an SBT project + diff -Nru checkstyle-6.14.1/src/xdocs/releasenotes.xml checkstyle-6.15/src/xdocs/releasenotes.xml --- checkstyle-6.14.1/src/xdocs/releasenotes.xml 2015-12-30 13:32:34.000000000 +0000 +++ checkstyle-6.15/src/xdocs/releasenotes.xml 2016-01-31 14:29:29.000000000 +0000 @@ -15,6 +15,75 @@ +

+

New:

+
    +
  • + new Check: RegexpOnFilename. Author: rnveach, Roman Ivanov #2546 +
  • +
  • + SuppressionFilter: new option 'optional' to allow skip SuppressionFilter if config file does not exist. Author: liscju #1002 +
  • +
  • + Add possibility to specify a unique ID to all Regexp checks. Author: Andrei Selkin #1008 +
  • +
+

Bug fixes:

+
    +
  • + StringIndexOutOfBoundsException in Indentation check. Author: rnveach #2645 +
  • +
  • + AbstractJavadocCheck should process only doc comments placed before class, interface, constructor, method, or field declarations. Author: Baratali Izmailov #325 +
  • +
  • + SummaryJavadoc: false "end with a period" reports when inheritDoc is used . Author: rnveach #2805 +
  • +
  • + JavadocMethod: allowedAnnotations hides bad javadocs. Author: rnveach #2806 +
  • +
  • + FinalLocalVariable doesn't report variable when condition separates 2 assignments. Author: Bhavik Patel #2807 +
  • +
  • + Config of Google Style does not include InterfaceTypeParameterName check. Author: Andrei Selkin #2792 +
  • +
  • + Indentation on annotation parameters is wrong. Author: liscju #1349 +
  • +
  • + OneStatementPerLine check and lambda expression. Author: liscju #2688 +
  • +
  • + Gui should have a splitter bettween tree and code and prefered columns size. Author: liscju #2767 +
  • +
  • + RequireThis reports false-positive when an instance method is overloaded with a static one. Author: Vladislav Lisetskiy #2539 +
  • +
+

Notes:

+
    +
  • + Add checkstyle messages to xdocs. Author: rnveach #2836 +
  • +
  • + Setup 'Circle CI' to run checkstyle-tester project on JDK sources. Author: Vladislav Lisetskiy, Roman Ivanov #2815 +
  • +
  • + Enforce Checks of sevntu.checkstyle (released version) over Checkstyle source code. Author: Yasser Aziza #2661 +
  • +
  • + Use Codeship CI for testing. Author: Roman Ivanov #2727 +
  • +
  • + Refactor gui package. Author: Vladislav Lisetskiy, Roman Ivanov #2609 +
  • +
  • + doc: Add sbt-checkstyle-plugin to list of active tools. Author: Andrew Johnson +
  • +
+
+

Bug fixes: