You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (JIRA)" <ji...@codehaus.org> on 2014/07/06 14:12:10 UTC
[jira] (MCHECKSTYLE-237) Changeset 1608113 introduced "Line 0"
regression
[ https://jira.codehaus.org/browse/MCHECKSTYLE-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Osipov updated MCHECKSTYLE-237:
---------------------------------------
Affects Version/s: 2.13
> Changeset 1608113 introduced "Line 0" regression
> ------------------------------------------------
>
> Key: MCHECKSTYLE-237
> URL: https://jira.codehaus.org/browse/MCHECKSTYLE-237
> Project: Maven Checkstyle Plugin
> Issue Type: Bug
> Affects Versions: 2.13
> 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)