maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From micha...@apache.org
Subject svn commit: r1563595 - /maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java
Date Sun, 02 Feb 2014 12:15:42 GMT
Author: michaelo
Date: Sun Feb  2 12:15:41 2014
New Revision: 1563595

URL: http://svn.apache.org/r1563595
Log:
Do not print line number of it equals to zero. As per [1], it indicates that is is not related
to a file content.

[1] http://checkstyle.sourceforge.net/apidocs/com/puppycrawl/tools/checkstyle/api/AuditEvent.html#getLine%28%29

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

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java?rev=1563595&r1=1563594&r2=1563595&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java
(original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java
Sun Feb  2 12:15:41 2014
@@ -776,13 +776,18 @@ public class CheckstyleReportGenerator
             sink.tableCell_();
 
             sink.tableCell();
+
+            int line = event.getLine();
             if ( getXrefLocation() != null )
             {
                 sink
                     .link(
-                        getXrefLocation() + "/" + filename.replaceAll( "\\.java$", ".html"
) + "#L" + event.getLine() );
+                        getXrefLocation() + "/" + filename.replaceAll( "\\.java$", ".html"
) + "#L" + line );
+            }
+            if ( line != 0 )
+            {
+                sink.text( String.valueOf( event.getLine() ) );
             }
-            sink.text( String.valueOf( event.getLine() ) );
             if ( getXrefLocation() != null )
             {
                 sink.link_();



Mime
View raw message