You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by de...@apache.org on 2012/02/02 11:21:19 UTC

svn commit: r1239515 - /maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java

Author: dennisl
Date: Thu Feb  2 10:21:19 2012
New Revision: 1239515

URL: http://svn.apache.org/viewvc?rev=1239515&view=rev
Log:
[MCHECKSTYLE-152] encoding property in maven plugin is never set correctly to charset property of the checkstyle itself.
Submitted by: Svetlomira Manova
Reviewed by: Dennis Lundberg

Modified:
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java?rev=1239515&r1=1239514&r2=1239515&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/DefaultCheckstyleExecutor.java Thu Feb  2 10:21:19 2012
@@ -255,22 +255,23 @@ public class DefaultCheckstyleExecutor
                                        "File encoding has not been set, using platform encoding " + effectiveEncoding
                                            + ", i.e. build is platform dependent!" );
             }
+
+            if ( "Checker".equals( config.getName() )
+                    || "com.puppycrawl.tools.checkstyle.Checker".equals( config.getName() ) )
+            {
+                if ( config instanceof DefaultConfiguration )
+                {
+                    ( (DefaultConfiguration) config ).addAttribute( "charset", effectiveEncoding );
+                }
+                else
+                {
+                    request.getLog().warn( "Failed to configure file encoding on module " + config );
+                }
+            }
             Configuration[] modules = config.getChildren();
             for ( int i = 0; i < modules.length; i++ )
             {
                 Configuration module = modules[i];
-                if ( "Checker".equals( module.getName() )
-                    || "com.puppycrawl.tools.checkstyle.Checker".equals( module.getName() ) )
-                {
-                    if ( module instanceof DefaultConfiguration )
-                    {
-                        ( (DefaultConfiguration) module ).addAttribute( "charset", effectiveEncoding );
-                    }
-                    else
-                    {
-                        request.getLog().warn( "Failed to configure file encoding on module " + module );
-                    }
-                }
                 if ( "TreeWalker".equals( module.getName() )
                     || "com.puppycrawl.tools.checkstyle.TreeWalker".equals( module.getName() ) )
                 {