Uploaded image for project: 'Maven Checkstyle Plugin'
  1. Maven Checkstyle Plugin
  2. MCHECKSTYLE-237

Changeset 1608113 introduces "Line 0" regression

    XMLWordPrintableJSON

Details

    Description

      c1608113 introduced this:

      -            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_();
      -            }
      

      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.

      Attachments

        Activity

          People

            michael-o Michael Osipov
            michael-o Michael Osipov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: