maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1608113 - /maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java
Date Sat, 05 Jul 2014 19:43:46 GMT
Author: hboutemy
Date: Sat Jul  5 19:43:46 2014
New Revision: 1608113

URL: http://svn.apache.org/r1608113
Log:
code simplification

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=1608113&r1=1608112&r2=1608113&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
Sat Jul  5 19:43:46 2014
@@ -711,22 +711,7 @@ public class CheckstyleReportGenerator
             sink.tableRow();
 
             sink.tableCell();
-
-            switch( level )
-            {
-            case INFO:
-                iconTool.iconInfo( IconTool.TEXT_SIMPLE );
-                break;
-            case WARNING:
-                iconTool.iconWarning( IconTool.TEXT_SIMPLE );
-                break;
-            case ERROR:
-                iconTool.iconError( IconTool.TEXT_SIMPLE );
-                break;
-            default:
-                break;
-            }
-
+            iconTool.iconSeverity( level.getName(), IconTool.TEXT_SIMPLE );
             sink.tableCell_();
 
             sink.tableCell();
@@ -734,21 +719,16 @@ public class CheckstyleReportGenerator
             sink.tableCell_();
 
             sink.tableCell();
-
-            int line = event.getLine();
             if ( getXrefLocation() != null )
             {
-                sink
-                    .link(
-                        getXrefLocation() + "/" + filename.replaceAll( "\\.java$", ".html"
) + "#L" + line );
-            }
-            if ( line != 0 )
-            {
+                sink.link( getXrefLocation() + "/" + filename.replaceAll( "\\.java$", ".html"
) + "#L"
+                    + event.getLine() );
                 sink.text( String.valueOf( event.getLine() ) );
+                sink.link_();
             }
-            if ( getXrefLocation() != null )
+            else
             {
-                sink.link_();
+                sink.text( String.valueOf( event.getLine() ) );
             }
             sink.tableCell_();
 



Mime
View raw message