[
https://jira.codehaus.org/browse/MCHECKSTYLE-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Herve Boutemy updated MCHECKSTYLE-237:
--------------------------------------
Component/s: checkstyle:checkstyle-aggregate
checkstyle:checkstyle
> Changeset 1608113 introduces "Line 0" regression
> ------------------------------------------------
>
> Key: MCHECKSTYLE-237
> URL: https://jira.codehaus.org/browse/MCHECKSTYLE-237
> Project: Maven Checkstyle Plugin
> Issue Type: Bug
> Components: checkstyle:checkstyle, checkstyle:checkstyle-aggregate
> Affects Versions: 2.13
> Reporter: Michael Osipov
> Assignee: Michael Osipov
> Fix For: 2.13
>
>
> 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)