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

String index out of range

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      console output:

      ERROR: Publisher hudson.plugins.sloccount.SloccountPublisher aborted due to exception
      java.lang.StringIndexOutOfBoundsException: String index out of range: -5
      at java.lang.String.substring(String.java:1937)
      at java.lang.String.substring(String.java:1904)
      at hudson.plugins.sloccount.model.Folder.simplifyName(Folder.java:22)
      at hudson.plugins.sloccount.model.SloccountReport.simplifyNames(SloccountReport.java:175)
      at hudson.plugins.sloccount.model.SloccountParser.invoke(SloccountParser.java:42)
      at hudson.plugins.sloccount.model.SloccountParser.invoke(SloccountParser.java:17)
      at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2154)
      at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:287)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)

      sloccount file:

      Have a non-directory at the top, so creating directory top_dir
      Adding /g2m_builder_test/railway-svn-code/support/cppcheck-check-Make to top_dir
      Adding /g2m_builder_test/railway-svn-code/support/cppcheck_reports.xml to top_dir
      Adding /g2m_builder_test/railway-svn-code/support/cppcheck-suppress to top_dir
      Creating filelist for driver
      Adding /g2m_builder_test/railway-svn-code/support/sloccount.sc to top_dir
      Creating filelist for test
      Categorizing files.
      Computing results.

      43 ansic test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/GhtDspApi/GhtDspDisp.c
      197 ansic test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/GhtDspApi/GhtDspEnc.c
      268 ansic test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/GhtDspApi/GhtDspCap.c
      179 ansic test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/GhtDspApi/GhtDspDec.c
      87 ansic test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/GhtDspApi/Convert.c
      636 ansic test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/GhtDspApi/dm648api.c
      387 ansic test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/GhtDspApi/GhtDspApi.c
      173 ansic test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/include/dm648api.h
      27 ansic test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/include/GhtDspCommon.h
      173 ansic test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/include/GhtDspApi.h
      5 ansic test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/GhtDspApi/Convert.h
      6 ansic test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/GhtDspApi/SdkVersion.h
      240 ansic test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/GhtDspApi/ShareStruct.h
      37 makefile test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/GhtDspApi/Makefile
      174 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/dialog/iconDecodeArea.cpp
      236 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/dialog/iconPreviewArea.cpp
      223 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/dialog/mainWindow.cpp
      12 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/main.cpp
      39 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/public/sunday.cpp
      220 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/public/yuv.cpp
      143 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/thread/Timer.cpp
      41 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/thread/Thread.cpp
      295 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/video/videoThread.cpp
      64 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/video/videoTimer.cpp
      445 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/pages.cpp
      998 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/vmsdk.cpp
      10 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/main.cpp
      181 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/SI3000Page.cpp
      143 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/public/thread/Timer.cpp
      41 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/public/thread/Thread.cpp
      26 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/dogTimer.cpp
      371 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/logicPage.cpp
      166 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/configdialog.cpp
      31 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/SDevThread.cpp
      57 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/dialog/mainWindow.h
      73 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/dialog/iconPreviewArea.h
      64 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/dialog/iconDecodeArea.h
      7 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/public/sunday.h
      22 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/public/yuv.h
      56 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/thread/Timer.h
      24 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/thread/Thread.h
      45 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/thread/Mutex.h
      43 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/thread/Sem.h
      53 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/video/videoThread.h
      22 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/video/imageDef.h
      24 cpp test /g2m_builder_test/railway-svn-code/support/test/viSdkDialog/video/videoTimer.h
      51 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/logicPage.h
      64 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/configdialog.h
      348 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/vmsdk.h
      56 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/public/thread/Timer.h
      24 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/public/thread/Thread.h
      45 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/public/thread/Mutex.h
      43 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/public/thread/Sem.h
      13 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/dogTimer.h
      76 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/sdkFunc.h
      35 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/SI3000Page.h
      16 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/SDevThread.h
      56 cpp test /g2m_builder_test/railway-svn-code/support/test/auSdkDialog/pages.h
      9 lisp top_dir /g2m_builder_test/railway-svn-code/support/sloccount.sc

        Attachments

          Activity

          Hide
          cyrilpicat Cyril Picat added a comment -

          I have the same issue on a iOS project.

          I think this might be due to filenames with a '+' inside, like all the categories we create in Objective-C.
          For example, Profile+Additions.h

          Show
          cyrilpicat Cyril Picat added a comment - I have the same issue on a iOS project. I think this might be due to filenames with a '+' inside, like all the categories we create in Objective-C. For example, Profile+Additions.h
          Hide
          cyrilpicat Cyril Picat added a comment -

          After more investigation, this is not due to the '+' but to the directory tree.

          In some cases, sloc seems to create a fake top_dir at the top and it makes the plugin fail.

          In those cases, you get the following message at the top of the sloccount.sc file:
          'Have a non-directory at the top, so creating directory top_dir'

          and entries like:
          15 objc top_dir /Users/udd/Jenkins/Workspace/jobs/MyProject dev/workspace/MyProject/main.m

          I simply prune those entries and it works again.

          So my full shell build step in Jenkins is the following:

          1. Compute basic code metrics
            sloccount --duplicates --wide --details MyProject | grep -v 'top_dir' > build/sloccount.sc
          Show
          cyrilpicat Cyril Picat added a comment - After more investigation, this is not due to the '+' but to the directory tree. In some cases, sloc seems to create a fake top_dir at the top and it makes the plugin fail. In those cases, you get the following message at the top of the sloccount.sc file: 'Have a non-directory at the top, so creating directory top_dir' and entries like: 15 objc top_dir /Users/udd/Jenkins/Workspace/jobs/MyProject dev/workspace/MyProject/main.m I simply prune those entries and it works again. So my full shell build step in Jenkins is the following: Compute basic code metrics sloccount --duplicates --wide --details MyProject | grep -v 'top_dir' > build/sloccount.sc
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Seiji Sogabe
          Path:
          src/main/java/hudson/plugins/sloccount/model/SloccountReport.java
          http://jenkins-ci.org/commit/sloccount-plugin/5bd7f990d3fe5bc6567210286ff544455a258057
          Log:
          [FIXED JENKINS-13775] String index out of range.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Seiji Sogabe Path: src/main/java/hudson/plugins/sloccount/model/SloccountReport.java http://jenkins-ci.org/commit/sloccount-plugin/5bd7f990d3fe5bc6567210286ff544455a258057 Log: [FIXED JENKINS-13775] String index out of range.
          Hide
          dogfood dogfood added a comment -

          Integrated in plugins_sloccount #28
          [FIXED JENKINS-13775] String index out of range. (Revision 5bd7f990d3fe5bc6567210286ff544455a258057)

          Result = SUCCESS
          Seiji Sogabe :
          Files :

          • src/main/java/hudson/plugins/sloccount/model/SloccountReport.java
          Show
          dogfood dogfood added a comment - Integrated in plugins_sloccount #28 [FIXED JENKINS-13775] String index out of range. (Revision 5bd7f990d3fe5bc6567210286ff544455a258057) Result = SUCCESS Seiji Sogabe : Files : src/main/java/hudson/plugins/sloccount/model/SloccountReport.java
          Hide
          mixalturek Michal Turek added a comment -

          Closing old non-closed but resolved tasks. Please reopen if the issue is still present.

          Show
          mixalturek Michal Turek added a comment - Closing old non-closed but resolved tasks. Please reopen if the issue is still present.

            People

            • Assignee:
              npiguet npiguet
              Reporter:
              karma06 wang y
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: