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.toolscheckstyle
- 6.14.1
+ 6.15jarcheckstyle
@@ -196,11 +196,11 @@
3.60.7.5.2015052419462.17
- 1.17.1
+ 1.18.01.7.0${java.home}/../lib/tools.jar1.7
- 6.13
+ 6.14.1
@@ -271,7 +271,7 @@
nl.jqno.equalsverifierequalsverifier
- 1.7.5
+ 1.7.7test
@@ -295,7 +295,7 @@
org.eclipse.jgitorg.eclipse.jgit
- 4.1.1.201511131810-r
+ 4.2.0.201601211800-rtest
@@ -474,6 +474,7 @@
true0error
+ project.basedir=${project.basedir}${project.build.sourceDirectory}
@@ -521,7 +522,7 @@
org.apache.maven.pluginsmaven-compiler-plugin
- 3.3
+ 3.5${java.version}
@@ -580,6 +581,14 @@
2.8.2
+ org.codehaus.mojo
+ versions-maven-plugin
+ 2.2
+
+ false
+
+
+ org.sonatype.pluginsnexus-staging-maven-plugin1.6.6
@@ -749,7 +758,7 @@
org.apache.maven.pluginsmaven-failsafe-plugin
- 2.19
+ 2.19.1com/google/**/*.java
@@ -775,7 +784,7 @@
org.apache.maven.pluginsmaven-surefire-plugin
- 2.19
+ 2.19.1-Duser.language=en -Duser.country=US -XX:-UseSplitVerifier
@@ -1008,7 +1017,7 @@
org.apache.maven.pluginsmaven-surefire-report-plugin
- 2.19
+ 2.19.1
@@ -1097,14 +1106,14 @@
maven-report0.1
- http://nemo.sonarqube.org
+ https://nemo.sonarqube.orgorg.apache.maven.pluginsmaven-pmd-plugin
- 3.5
+ ${maven.pmd.plugin.version}
@@ -1177,14 +1186,22 @@
http://mojo.codehaus.org/xml-maven-pluginhttp://www.antlr.org/antlr4-maven-plugin
+
+ http://mojo.codehaus.org/versions-maven-pluginhttp://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:checkstylehttp://iweb.dl.sourceforge.net/project/checkstyle/checkstyle/*-SNAPSHOT/checkstyle-*-SNAPSHOT-all.jar
@@ -1263,7 +1280,7 @@
org.apache.maven.pluginsmaven-shade-plugin
- 2.4.2
+ 2.4.3package
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.javanatureorg.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:
+ *
+ *
+ * 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).
+ *
+ *
+ * Non-IDE development (ease of refactoring, some clearness to distinguish
+ * static and non-static methods).
+ *
+ *
+ *
*
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':
+ *
+ * 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.
+ *
+ *
+ * @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 @@
*
+ 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:
+
+
+
+ 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).
+
+
+ Non-IDE development (ease of refactoring, some clearness to distinguish
+ static and non-static methods).
+
+ 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:
+
+
+
+ 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):
+
+
+
@@ -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.
+ 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.
+
@@ -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:
+
+
+
+ To make the annotations available to the filter.
+
+
+
+ To configure filter to suppress audit events for annotations add:
+
+
+
@@ -790,6 +890,50 @@
+
+ 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:
+
+
+
+ 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):
+
+ 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.
+
+
+
+
+
+
+
name
+
description
+
type
+
default value
+
+
+
folderPattern
+
Regular expression to match the folder path against.
+ To configure the check to report file names that contain a space:
+
+
+
+ To configure the check to force picture files to not be 'gif':
+
+
+
+ OR:
+
+
+
+ To configure the check to only allow property and xml files to be located in the resource folder:
+
+
+
+ To configure the check to only allow Java and XML files in your folders use the below.
+
+
+
+ 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.
+
+
+
+ To configure the check to only allow file names to be camel case:
+
- 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.
+ 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
+