You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by eo...@apache.org on 2019/04/21 12:38:07 UTC

[maven-checkstyle-plugin] branch MCHECKSTYLE-366 updated: Fix its

This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch MCHECKSTYLE-366
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git


The following commit(s) were added to refs/heads/MCHECKSTYLE-366 by this push:
     new 3a9d4ba  Fix its
3a9d4ba is described below

commit 3a9d4ba6bfaf7b2a6f314e72d82373a73989eee2
Author: Enrico Olivelli <eo...@apache.org>
AuthorDate: Sun Apr 21 14:37:59 2019 +0200

    Fix its
---
 src/it/MCHECKSTYLE-137/checkstyle.xml                  |  6 ++----
 src/it/MCHECKSTYLE-137/src/main/java/org/MyClass.java  | 17 +++++++----------
 .../resources/com/company/build-tools/checkstyle.xml   |  1 -
 .../empty-logging-check/nb-configuration.xml           | 18 ++++++++++++++++++
 .../maven/plugins/checkstyle/EmptyLoggingCheck.java    |  5 +++--
 5 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/src/it/MCHECKSTYLE-137/checkstyle.xml b/src/it/MCHECKSTYLE-137/checkstyle.xml
index 58fcec8..d4316c3 100644
--- a/src/it/MCHECKSTYLE-137/checkstyle.xml
+++ b/src/it/MCHECKSTYLE-137/checkstyle.xml
@@ -87,7 +87,7 @@ under the License.
 <!-- blows up with eclipse-cs 5.6.0
         <module name="DoubleCheckedLocking"/>
 -->
-	<module name="EmptyStatement"/>	      
+	<module name="EmptyStatement"/>
         <module name="EqualsHashCode"/>
         <module name="HiddenField">
 	    <property name="tokens" value="VARIABLE_DEF"/>
@@ -96,7 +96,6 @@ under the License.
         <module name="InnerAssignment"/>
         <module name="MissingSwitchDefault"/>
         <module name="SimplifyBooleanExpression"/>
-        <module name="SimplifyBooleanReturn"/>
         <module name="StringLiteralEquality"/>
         <module name="NestedIfDepth">
             <property name="max" value="3"/>
@@ -115,7 +114,6 @@ under the License.
         <module name="MultipleVariableDeclarations"/>
         <module name="UnnecessaryParentheses"/>
         <module name="FinalClass"/>
-        <module name="HideUtilityClassConstructor"/>
         <module name="InterfaceIsType"/>
         <module name="ThrowsCount">
             <property name="max" value="5"/>
@@ -123,7 +121,7 @@ under the License.
         <module name="VisibilityModifier">
             <property name="protectedAllowed" value="true"/>
             <property name="packageAllowed" value="true"/>
-            <!-- Allow public members with 'Rule' on the end of their names to allow for 
+            <!-- Allow public members with 'Rule' on the end of their names to allow for
                  JUnit rules. Too bad we can't make this see the @nnotations.
              -->
             <property name="publicMemberPattern" value="^.*Rule$"/>
diff --git a/src/it/MCHECKSTYLE-137/src/main/java/org/MyClass.java b/src/it/MCHECKSTYLE-137/src/main/java/org/MyClass.java
index cc9677b..272b913 100644
--- a/src/it/MCHECKSTYLE-137/src/main/java/org/MyClass.java
+++ b/src/it/MCHECKSTYLE-137/src/main/java/org/MyClass.java
@@ -18,16 +18,13 @@ package org;
  * specific language governing permissions and limitations
  * under the License.
  */
+public class MyClass {
 
-public class MyClass
-{
     public static boolean singleCharHiragana(int v1, char v2) {
-        if (v1 != 12 || c == 'の') 
-            {
-                return true;
-            } 
-        else
-            {
-                return false;
-            }
+        if (v1 != 12 || c == 'の') {
+            return true;
+        } else {
+            return false;
+        }
+    }
 }
diff --git a/src/it/MCHECKSTYLE-169/build-tools/src/main/resources/com/company/build-tools/checkstyle.xml b/src/it/MCHECKSTYLE-169/build-tools/src/main/resources/com/company/build-tools/checkstyle.xml
index bdfae83..bedb23f 100644
--- a/src/it/MCHECKSTYLE-169/build-tools/src/main/resources/com/company/build-tools/checkstyle.xml
+++ b/src/it/MCHECKSTYLE-169/build-tools/src/main/resources/com/company/build-tools/checkstyle.xml
@@ -27,7 +27,6 @@ under the License.
     <property name="file" value="${checkstyle.suppressions.file}"/>
   </module>
     <module name="TreeWalker">
-        <property name="cacheFile" value="${checkstyle.cache.file}"/>
         <module name="LeftCurly">
           <property name="option" value="nl"/>
         </module>
diff --git a/src/it/MCHECKSTYLE-338/empty-logging-check/nb-configuration.xml b/src/it/MCHECKSTYLE-338/empty-logging-check/nb-configuration.xml
new file mode 100644
index 0000000..ec4540c
--- /dev/null
+++ b/src/it/MCHECKSTYLE-338/empty-logging-check/nb-configuration.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-shared-configuration>
+    <!--
+This file contains additional configuration written by modules in the NetBeans IDE.
+The configuration is intended to be shared among all the users of project and
+therefore it is assumed to be part of version control checkout.
+Without this configuration present, some functionality in the IDE may be limited or fail altogether.
+-->
+    <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
+        <!--
+Properties that influence various parts of the IDE, especially code formatting and the like. 
+You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
+That way multiple projects can share the same settings (useful for formatting rules for example).
+Any value defined here will override the pom.xml file value but is only applicable to the current project.
+-->
+        <netbeans.compile.on.save>none</netbeans.compile.on.save>
+    </properties>
+</project-shared-configuration>
diff --git a/src/it/MCHECKSTYLE-338/empty-logging-check/src/main/java/org/apache/maven/plugins/checkstyle/EmptyLoggingCheck.java b/src/it/MCHECKSTYLE-338/empty-logging-check/src/main/java/org/apache/maven/plugins/checkstyle/EmptyLoggingCheck.java
index a424235..10d3b3e 100644
--- a/src/it/MCHECKSTYLE-338/empty-logging-check/src/main/java/org/apache/maven/plugins/checkstyle/EmptyLoggingCheck.java
+++ b/src/it/MCHECKSTYLE-338/empty-logging-check/src/main/java/org/apache/maven/plugins/checkstyle/EmptyLoggingCheck.java
@@ -26,6 +26,7 @@ import java.util.TreeSet;
 
 import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck;
 import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
+import com.puppycrawl.tools.checkstyle.api.FileText;
 import com.puppycrawl.tools.checkstyle.api.LocalizedMessage;
 import com.puppycrawl.tools.checkstyle.api.SeverityLevel;
 
@@ -34,10 +35,10 @@ public class EmptyLoggingCheck
 {
 
     @Override
-    protected void processFiltered( File file, List<String> lines )
+    protected void processFiltered( File file, FileText lines )
         throws CheckstyleException
     {
-        addMessages( new TreeSet<>( Collections.singleton( new LocalizedMessage( 0, 0, getMessageBundle(),
+        addMessages( new TreeSet<LocalizedMessage>( Collections.singleton( new LocalizedMessage( 0, 0, getMessageBundle(),
                                                          "EmptyLoggingCheck on file " + file.getName(), new Object[0],
                                                          SeverityLevel.ERROR, getId(), getClass(), null ) ) ) );
     }