Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21419

Can't open sloccount table portlet

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: sloccount-plugin
    • Labels:
      None
    • Environment:
      windows 7, Jenkins 1.547, sloccount 1.11
    • Similar Issues:

      Description

      When every you attempt to open a SLOCCount report, you get this exception

      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      at java.lang.String.substring(Unknown Source)
      at hudson.plugins.sloccount.model.SloccountReport.extractFolder(SloccountReport.java:73)
      at hudson.plugins.sloccount.model.SloccountReport.add(SloccountReport.java:51)
      at hudson.plugins.sloccount.model.SloccountParser.parseLine(SloccountParser.java:122)
      at hudson.plugins.sloccount.model.SloccountParser.parse(SloccountParser.java:89)
      at hudson.plugins.sloccount.model.SloccountParser.parse(SloccountParser.java:78)
      at hudson.plugins.sloccount.model.SloccountParser.parseFiles(SloccountParser.java:62)
      at hudson.plugins.sloccount.SloccountResult.lazyLoad(SloccountResult.java:102)
      at hudson.plugins.sloccount.SloccountResult.getReport(SloccountResult.java:43)
      ... 110 more

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Michal Turek
          Path:
          src/main/java/hudson/plugins/sloccount/SloccountResult.java
          src/main/java/hudson/plugins/sloccount/model/Folder.java
          src/main/java/hudson/plugins/sloccount/model/SloccountReport.java
          src/test/java/hudson/plugins/sloccount/model/SloccountReportTest.java
          http://jenkins-ci.org/commit/sloccount-plugin/63baeefe669e13127dbb453ff5b7896690d30ccf
          Log:
          JENKINS-21419 Can't open sloccount table portlet

          • Links to specific folders in folder details don't work.
          • All Windows backslashes are now replaced by Unix slashes at the very beginning. Only unix slashes are considered in the rest of the code, which significantly simplifies it and prevents possible errors.
          • SloccountReport.extractFolder() is now used in FolderFileFilter.include() to fix the same issue that was present in extractFolder().
          • Constant DIRECTORY_SEPARATOR constant is used instead of hardcoded "/".
          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michal Turek Path: src/main/java/hudson/plugins/sloccount/SloccountResult.java src/main/java/hudson/plugins/sloccount/model/Folder.java src/main/java/hudson/plugins/sloccount/model/SloccountReport.java src/test/java/hudson/plugins/sloccount/model/SloccountReportTest.java http://jenkins-ci.org/commit/sloccount-plugin/63baeefe669e13127dbb453ff5b7896690d30ccf Log: JENKINS-21419 Can't open sloccount table portlet Links to specific folders in folder details don't work. All Windows backslashes are now replaced by Unix slashes at the very beginning. Only unix slashes are considered in the rest of the code, which significantly simplifies it and prevents possible errors. SloccountReport.extractFolder() is now used in FolderFileFilter.include() to fix the same issue that was present in extractFolder(). Constant DIRECTORY_SEPARATOR constant is used instead of hardcoded "/".
          Hide
          mixalturek Michal Turek added a comment -

          The issue should be fixed now, version 1.12 released.

          Show
          mixalturek Michal Turek added a comment - The issue should be fixed now, version 1.12 released.
          Hide
          moncreaff Greg Moncreaff added a comment -

          will test today.

          FYI this is a windows install.

          A lot of the tools (build steps) are run in shell scripts, so mixing of path separators is quite likely.

          Thanks for the quicker than quick turn-around!

          Show
          moncreaff Greg Moncreaff added a comment - will test today. FYI this is a windows install. A lot of the tools (build steps) are run in shell scripts, so mixing of path separators is quite likely. Thanks for the quicker than quick turn-around!
          Hide
          moncreaff Greg Moncreaff added a comment -

          Fix looks good!

          Show
          moncreaff Greg Moncreaff added a comment - Fix looks good!
          Hide
          mixalturek Michal Turek added a comment -

          Great

          Show
          mixalturek Michal Turek added a comment - Great

            People

            • Assignee:
              mixalturek Michal Turek
              Reporter:
              moncreaff Greg Moncreaff
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: