如何修复声纳在代码分析期间抛出ArrayIndexOutOfBoundsException

时间:2015-07-07 15:34:45

标签: java sonarqube sonar-runner

如何在代码分析期间修复ArrayIndexOutOfBoundsException?我使用声纳版本2.4。我遇到许多文件的相同问题。请在下面找到完整的堆栈。

17:19:59.150 INFO  - Execute decorators...
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 7:25.061s
Final Memory: 22M/510M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
    at     org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
    at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
    at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
    at     org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
    at org.sonar.runner.api.Runner.execute(Runner.java:100)
    at org.sonar.runner.Main.executeTask(Main.java:70)
    at org.sonar.runner.Main.execute(Main.java:59)
    at org.sonar.runner.Main.main(Main.java:53)
Caused by: org.sonar.api.utils.SonarException: Fail to decorate 'org.sonar.api.resources.File@4156d9a8[key=private/gp_cmd_stop.c,deprecatedKey=gp_cmd_stop.c,path=private/gp_cmd_stop.c,dir=[root],filename=gp_cmd_stop.c,language=C]'
    at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:103)
    at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:86)
    at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:78)
    at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:78)
    at org.sonar.batch.phases.DecoratorsExecutor.execute(DecoratorsExecutor.java:70)
    at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:126)
 ...
    ... 9 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 168
    at org.sonar.plugins.core.issue.tracking.FileHashes.getHash(FileHashes.java:75)
    at org.sonar.plugins.core.issue.IssueTracking.setChecksumOnNewIssues(IssueTracking.java:69)
    at org.sonar.plugins.core.issue.IssueTracking.track(IssueTracking.java:54)
    at org.sonar.plugins.core.issue.IssueTrackingDecorator.doDecorate(IssueTrackingDecorator.java:138)
    at org.sonar.plugins.core.issue.IssueTrackingDecorator.decorate(IssueTrackingDecorator.java:112)
    at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:95)
    ... 37 more
ERROR:
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.

1 个答案:

答案 0 :(得分:1)

Questions related to SonarSource commercial plugins should be raised on http://support.sonarsource.com. If you don't have yet an account to access this SonarSource Help Desk, contact your sales representative to get one.

Best regards.