maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Osipov (JIRA)" <j...@codehaus.org>
Subject [jira] (MCHECKSTYLE-237) Changeset 1608113 introduced "Line 0" regression
Date Sun, 06 Jul 2014 12:12:10 GMT
Michael Osipov created MCHECKSTYLE-237:
------------------------------------------

             Summary: Changeset 1608113 introduced "Line 0" regression
                 Key: MCHECKSTYLE-237
                 URL: https://jira.codehaus.org/browse/MCHECKSTYLE-237
             Project: Maven Checkstyle Plugin
          Issue Type: Bug
            Reporter: Michael Osipov


c1608113 introduced this:

{code}
-            int line = event.getLine();
             if ( getXrefLocation() != null )
             {
-                sink
-                    .link(
-                        getXrefLocation() + "/" + filename.replaceAll( "\\.java$", ".html"
) + "#L" + line );
+                sink.link( getXrefLocation() + "/" + filename.replaceAll( "\\.java$", ".html"
) + "#L"
+                    + event.getLine() );
+                sink.text( String.valueOf( event.getLine() ) );
+                sink.link_();
             }
-            if ( line != 0 )
+            else
             {
                 sink.text( String.valueOf( event.getLine() ) );
             }
-            if ( getXrefLocation() != null )
-            {
-                sink.link_();
-            }
{code}

I have intentionally added {{if ( line != 0 )}} to avoid useless Line 0 links. Moreover, {{int
line}} avoids repetitive calls to {{event.getLine()}}.

That improvement should remain.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Mime
View raw message