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 2014/02/22 00:13:21 UTC

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

Author: dennisl
Date: Fri Feb 21 23:13:21 2014
New Revision: 1570749

URL: http://svn.apache.org/r1570749
Log:
Do not show the value "null" for the column when Checkstyle doesn't report a column. Use the string "n/a" instead.

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

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java?rev=1570749&r1=1570748&r2=1570749&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java Fri Feb 21 23:13:21 2014
@@ -499,8 +499,9 @@ public class CheckstyleViolationCheckMoj
             {
                 if ( logViolationsToConsole )
                 {
-                    final String logMessage = file + '[' + xpp.getAttributeValue( "", "line" ) + ':'
-                        + xpp.getAttributeValue( "", "column" ) + "] " + xpp.getAttributeValue( "", "message" );
+                    final String column = xpp.getAttributeValue( "", "column" ) == null ? "n/a" : xpp.getAttributeValue( "", "column" );
+                    final String logMessage = file + '[' + xpp.getAttributeValue( "", "line" ) + ':' + column + "] "
+                        + xpp.getAttributeValue( "", "message" );
                     if ( "info".equals( xpp.getAttributeValue( "", "severity" ) ) )
                     {
                         getLog().info( logMessage );