AmadeusITGroup / sonar-stash

Stash (BitBucket) plugin, a pull-request decorator which allows to integrate SonarQube violations directly into your pull-request
MIT License
165 stars 82 forks source link

NPE during scan #197

Closed naushniki closed 5 years ago

naushniki commented 5 years ago
> Task :sonarqube
The use of the issues mode (sonar.analysis.mode=issues) is deprecated. This mode will be dropped in the future.
CodeNarc completed: (p1=0; p2=0; p3=0) 1044ms
Resource not found: ***
Resource not found: ***
Resource not found: ***
Resource not found: ***
Resource not found: ***
Resource not found: ***
Resource not found: ***
Resource not found: ***
Resource not found: ***
Resource not found: ***
Resource not found: ***
Resource not found: ***
Stripping trailing slash from sonar.stash.url, as it leads to invalid URLs

> Task :sonarqube FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sonarqube'.
> java.lang.NullPointerException (no error message)

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':sonarqube'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
        at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:596)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: java.lang.NullPointerException
        at org.sonar.plugins.stash.issue.MarkdownPrinter.fileNameList(MarkdownPrinter.java:147)
        at org.sonar.plugins.stash.issue.MarkdownPrinter.formatTableList(MarkdownPrinter.java:137)
        at org.sonar.plugins.stash.issue.MarkdownPrinter.printReportMarkdown(MarkdownPrinter.java:114)
        at org.sonar.plugins.stash.StashRequestFacade.postAnalysisOverview(StashRequestFacade.java:68)
        at org.sonar.plugins.stash.StashIssueReportingPostJob.postInfoAndPRsActions(StashIssueReportingPostJob.java:138)
        at org.sonar.plugins.stash.StashIssueReportingPostJob.updateStashWithSonarInfo(StashIssueReportingPostJob.java:105)
        at org.sonar.plugins.stash.StashIssueReportingPostJob.execute(StashIssueReportingPostJob.java:58)
        at org.sonar.scanner.postjob.PostJobWrapper.executeOn(PostJobWrapper.java:58)
        at org.sonar.scanner.phases.PostJobsExecutor.execute(PostJobsExecutor.java:66)
        at org.sonar.scanner.phases.PostJobsExecutor.execute(PostJobsExecutor.java:55)
        at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:94)
        at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:180)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
        at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:288)
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:283)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:261)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
        at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
        at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
        at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:121)
        at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
        at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:111)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
        at com.sun.proxy.$Proxy99.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
        at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
        at org.sonarqube.gradle.SonarQubeTask.run(SonarQubeTask.java:99)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:794)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:761)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
        ... 29 more

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.7/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 3m 40s
t-8ch commented 5 years ago

Hi @naushniki , which version of the plugin are you using?

naushniki commented 5 years ago

Sonarqube version 6.7.3 Plugin version 1.4.0-SNAPSHOT

t-8ch commented 5 years ago

Can you try it with 1.5.0 or 1.6.0-SNAPSHOT?

naushniki commented 5 years ago

Updated to ver. 1.5.0. Unfortunately, no visible difference.

Caused by: java.lang.NullPointerException
        at org.sonar.plugins.stash.issue.MarkdownPrinter.fileNameList(MarkdownPrinter.java:147)
        at org.sonar.plugins.stash.issue.MarkdownPrinter.formatTableList(MarkdownPrinter.java:137)
        at org.sonar.plugins.stash.issue.MarkdownPrinter.printReportMarkdown(MarkdownPrinter.java:114)
        at org.sonar.plugins.stash.StashRequestFacade.postAnalysisOverview(StashRequestFacade.java:68)
        at org.sonar.plugins.stash.StashIssueReportingPostJob.postInfoAndPRsActions(StashIssueReportingPostJob.java:138)
        at org.sonar.plugins.stash.StashIssueReportingPostJob.updateStashWithSonarInfo(StashIssueReportingPostJob.java:105)
        at org.sonar.plugins.stash.StashIssueReportingPostJob.execute(StashIssueReportingPostJob.java:58)
t-8ch commented 5 years ago

I am not sure how the algorithm could end up in such a state... Do you know your way around java? I am interested in

naushniki commented 5 years ago

If I understand correctly, the plugin is ran on the server. Unfortunately, I can't run debugger on the server.

t-8ch commented 5 years ago

The plugin is installed into the server, and downloaded to the client and executed there. So you could either attach a debugger to the client or try to insert some print statements at these places.

t-8ch commented 5 years ago

Alternatively you can set the property "sonar.log.level=DEBUG" and see if you can get the infos from the log.

naushniki commented 5 years ago

This is what happens inside fileNameList method image

naushniki commented 5 years ago

The value of issues at the beginning of MarkdownPrinter.fileNameList()

result = {AbstractMapBasedMultimap$RandomAccessWrappedList@18028}  size = 6
 0 = {DefaultPostJobContext$DefaultIssueWrapper@18031} 
  wrapped = {TrackedIssue@18057} "TrackedIssue[ruleKey=kotlin:S1451,key=01687B95680FB134F0,severity=BLOCKER,startLine=<null>,startLineOffset=<null>,endLine=<null>,endLineOffset=<null>,gap=<null>,isNew=true,creationDate=Wed Jan 23 19:40:06 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.kt,message=Add or update the header of this file.]"
   ruleKey = {RuleKey@18591} "kotlin:S1451"
   key = "01687B95680FB134F0"
   severity = "BLOCKER"
   startLine = null
   startLineOffset = null
   endLine = null
   endLineOffset = null
   gap = null
   isNew = true
   creationDate = {Date@18594} "Wed Jan 23 19:40:06 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Add or update the header of this file."
   hashes = null
  this$0 = {DefaultPostJobContext@18038} 
 1 = {DefaultPostJobContext$DefaultIssueWrapper@18032} 
  wrapped = {TrackedIssue@18055} "TrackedIssue[ruleKey=kotlin:S1451,key=01687B956919B13501,severity=BLOCKER,startLine=<null>,startLineOffset=<null>,endLine=<null>,endLineOffset=<null>,gap=<null>,isNew=true,creationDate=Wed Jan 23 19:40:06 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.kt,message=Add or update the header of this file.]"
   ruleKey = {RuleKey@18600} "kotlin:S1451"
   key = "01687B956919B13501"
   severity = "BLOCKER"
   startLine = null
   startLineOffset = null
   endLine = null
   endLineOffset = null
   gap = null
   isNew = true
   creationDate = {Date@18603} "Wed Jan 23 19:40:06 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Add or update the header of this file."
   hashes = null
  this$0 = {DefaultPostJobContext@18038} 
 2 = {DefaultPostJobContext$DefaultIssueWrapper@18033} 
  wrapped = {TrackedIssue@18053} "TrackedIssue[ruleKey=kotlin:S1451,key=01687B956775B134ED,severity=BLOCKER,startLine=<null>,startLineOffset=<null>,endLine=<null>,endLineOffset=<null>,gap=<null>,isNew=true,creationDate=Wed Jan 23 19:40:06 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.kt,message=Add or update the header of this file.]"
   ruleKey = {RuleKey@18609} "kotlin:S1451"
   key = "01687B956775B134ED"
   severity = "BLOCKER"
   startLine = null
   startLineOffset = null
   endLine = null
   endLineOffset = null
   gap = null
   isNew = true
   creationDate = {Date@18612} "Wed Jan 23 19:40:06 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Add or update the header of this file."
   hashes = null
  this$0 = {DefaultPostJobContext@18038} 
 3 = {DefaultPostJobContext$DefaultIssueWrapper@18034} 
  wrapped = {TrackedIssue@18051} "TrackedIssue[ruleKey=kotlin:S1451,key=01687B9569BBB13510,severity=BLOCKER,startLine=<null>,startLineOffset=<null>,endLine=<null>,endLineOffset=<null>,gap=<null>,isNew=true,creationDate=Wed Jan 23 19:40:06 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.kt,message=Add or update the header of this file.]"
   ruleKey = {RuleKey@18618} "kotlin:S1451"
   key = "01687B9569BBB13510"
   severity = "BLOCKER"
   startLine = null
   startLineOffset = null
   endLine = null
   endLineOffset = null
   gap = null
   isNew = true
   creationDate = {Date@18621} "Wed Jan 23 19:40:06 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Add or update the header of this file."
   hashes = null
  this$0 = {DefaultPostJobContext@18038} 
 4 = {DefaultPostJobContext$DefaultIssueWrapper@18035} 
  wrapped = {TrackedIssue@18049} "TrackedIssue[ruleKey=kotlin:S1451,key=01687B956961B13504,severity=BLOCKER,startLine=<null>,startLineOffset=<null>,endLine=<null>,endLineOffset=<null>,gap=<null>,isNew=true,creationDate=Wed Jan 23 19:40:06 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.kt,message=Add or update the header of this file.]"
   ruleKey = {RuleKey@18627} "kotlin:S1451"
   key = "01687B956961B13504"
   severity = "BLOCKER"
   startLine = null
   startLineOffset = null
   endLine = null
   endLineOffset = null
   gap = null
   isNew = true
   creationDate = {Date@18630} "Wed Jan 23 19:40:06 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Add or update the header of this file."
   hashes = null
  this$0 = {DefaultPostJobContext@18038} 
 5 = {DefaultPostJobContext$DefaultIssueWrapper@18036} 
  wrapped = {TrackedIssue@18037} "TrackedIssue[ruleKey=kotlin:S1451,key=01687B95699DB1350E,severity=BLOCKER,startLine=<null>,startLineOffset=<null>,endLine=<null>,endLineOffset=<null>,gap=<null>,isNew=true,creationDate=Wed Jan 23 19:40:06 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.kt,message=Add or update the header of this file.]"
   ruleKey = {RuleKey@18636} "kotlin:S1451"
   key = "01687B95699DB1350E"
   severity = "BLOCKER"
   startLine = null
   startLineOffset = null
   endLine = null
   endLineOffset = null
   gap = null
   isNew = true
   creationDate = {Date@18639} "Wed Jan 23 19:40:06 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Add or update the header of this file."
   hashes = null
  this$0 = {DefaultPostJobContext@18038} 
naushniki commented 5 years ago

Elements of allIssues at the beginning of MarkdownPrinter.printReportMarkdown()

result = {ArrayList@17920}  size = 11
 0 = {DefaultPostJobContext$DefaultIssueWrapper@17984} 
  wrapped = {TrackedIssue@17995} "TrackedIssue[ruleKey=squid:S00107,key=01687BAD432E4408D0,severity=MAJOR,startLine=76,startLineOffset=11,endLine=76,endLineOffset=36,gap=<null>,isNew=true,creationDate=Wed Jan 23 20:06:10 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.java,message=Constructor has 9 parameters, which is greater than 7 authorized.]"
   ruleKey = {RuleKey@18013} "squid:S00107"
    repository = "squid"
    rule = "S00107"
   key = "01687BAD432E4408D0"
   severity = "MAJOR"
   startLine = {Integer@18016} 76
   startLineOffset = {Integer@18017} 11
   endLine = {Integer@18016} 76
   endLineOffset = {Integer@18018} 36
   gap = null
   isNew = true
   creationDate = {Date@18019} "Wed Jan 23 20:06:10 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Constructor has 9 parameters, which is greater than 7 authorized."
   hashes = null
  this$0 = {DefaultPostJobContext@17996} 
 1 = {DefaultPostJobContext$DefaultIssueWrapper@17985} 
  wrapped = {TrackedIssue@18150} "TrackedIssue[ruleKey=squid:UselessImportCheck,key=01687BAD45C84408F4,severity=MINOR,startLine=4,startLineOffset=0,endLine=4,endLineOffset=56,gap=<null>,isNew=true,creationDate=Wed Jan 23 20:06:10 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.java,message=Remove this duplicated import.]"
   ruleKey = {RuleKey@18152} "squid:UselessImportCheck"
    repository = "squid"
    rule = "UselessImportCheck"
   key = "01687BAD45C84408F4"
   severity = "MINOR"
   startLine = {Integer@18155} 4
   startLineOffset = {Integer@18111} 0
   endLine = {Integer@18155} 4
   endLineOffset = {Integer@18156} 56
   gap = null
   isNew = true
   creationDate = {Date@18157} "Wed Jan 23 20:06:10 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Remove this duplicated import."
   hashes = null
  this$0 = {DefaultPostJobContext@17996} 
 2 = {DefaultPostJobContext$DefaultIssueWrapper@17986} 
  wrapped = {TrackedIssue@18135} "TrackedIssue[ruleKey=squid:UselessImportCheck,key=01687BAD45C84408F5,severity=MINOR,startLine=10,startLineOffset=0,endLine=10,endLineOffset=49,gap=<null>,isNew=true,creationDate=Wed Jan 23 20:06:10 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.javax.xml.bind.annotation.XmlAccessorType'.]"
   ruleKey = {RuleKey@18137} "squid:UselessImportCheck"
    repository = "squid"
    rule = "UselessImportCheck"
   key = "01687BAD45C84408F5"
   severity = "MINOR"
   startLine = {Integer@18140} 10
   startLineOffset = {Integer@18111} 0
   endLine = {Integer@18140} 10
   endLineOffset = {Integer@18141} 49
   gap = null
   isNew = true
   creationDate = {Date@18142} "Wed Jan 23 20:06:10 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Remove this unused import 'javax.xml.bind.annotation.XmlAccessorType'."
   hashes = null
  this$0 = {DefaultPostJobContext@17996} 
 3 = {DefaultPostJobContext$DefaultIssueWrapper@17987} 
  wrapped = {TrackedIssue@18121} "TrackedIssue[ruleKey=squid:UselessImportCheck,key=01687BAD45C84408F6,severity=MINOR,startLine=11,startLineOffset=0,endLine=11,endLineOffset=41,gap=<null>,isNew=true,creationDate=Wed Jan 23 20:06:10 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.javax.xml.bind.annotation.XmlType'.]"
   ruleKey = {RuleKey@18123} "squid:UselessImportCheck"
    repository = "squid"
    rule = "UselessImportCheck"
   key = "01687BAD45C84408F6"
   severity = "MINOR"
   startLine = {Integer@18017} 11
   startLineOffset = {Integer@18111} 0
   endLine = {Integer@18017} 11
   endLineOffset = {Integer@18126} 41
   gap = null
   isNew = true
   creationDate = {Date@18127} "Wed Jan 23 20:06:10 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Remove this unused import 'javax.xml.bind.annotation.XmlType'."
   hashes = null
  this$0 = {DefaultPostJobContext@17996} 
 4 = {DefaultPostJobContext$DefaultIssueWrapper@17988} 
  wrapped = {TrackedIssue@18105} "TrackedIssue[ruleKey=squid:UselessImportCheck,key=01687BAD45C84408F7,severity=MINOR,startLine=9,startLineOffset=0,endLine=9,endLineOffset=47,gap=<null>,isNew=true,creationDate=Wed Jan 23 20:06:10 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.javax.xml.bind.annotation.XmlAccessType'.]"
   ruleKey = {RuleKey@18107} "squid:UselessImportCheck"
    repository = "squid"
    rule = "UselessImportCheck"
   key = "01687BAD45C84408F7"
   severity = "MINOR"
   startLine = {Integer@18110} 9
   startLineOffset = {Integer@18111} 0
   endLine = {Integer@18110} 9
   endLineOffset = {Integer@18112} 47
   gap = null
   isNew = true
   creationDate = {Date@18113} "Wed Jan 23 20:06:10 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Remove this unused import 'javax.xml.bind.annotation.XmlAccessType'."
   hashes = null
  this$0 = {DefaultPostJobContext@17996} 
 5 = {DefaultPostJobContext$DefaultIssueWrapper@17989} 
  wrapped = {TrackedIssue@18092} "TrackedIssue[ruleKey=kotlin:S1451,key=01687BAD444C4408DA,severity=BLOCKER,startLine=<null>,startLineOffset=<null>,endLine=<null>,endLineOffset=<null>,gap=<null>,isNew=true,creationDate=Wed Jan 23 20:06:10 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.kt,message=Add or update the header of this file.]"
   ruleKey = {RuleKey@18094} "kotlin:S1451"
    repository = "kotlin"
    rule = "S1451"
   key = "01687BAD444C4408DA"
   severity = "BLOCKER"
   startLine = null
   startLineOffset = null
   endLine = null
   endLineOffset = null
   gap = null
   isNew = true
   creationDate = {Date@18097} "Wed Jan 23 20:06:10 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Add or update the header of this file."
   hashes = null
  this$0 = {DefaultPostJobContext@17996} 
 6 = {DefaultPostJobContext$DefaultIssueWrapper@17990} 
  wrapped = {TrackedIssue@18079} "TrackedIssue[ruleKey=kotlin:S1451,key=01687BAD45504408EB,severity=BLOCKER,startLine=<null>,startLineOffset=<null>,endLine=<null>,endLineOffset=<null>,gap=<null>,isNew=true,creationDate=Wed Jan 23 20:06:10 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.kt,message=Add or update the header of this file.]"
   ruleKey = {RuleKey@18081} "kotlin:S1451"
    repository = "kotlin"
    rule = "S1451"
   key = "01687BAD45504408EB"
   severity = "BLOCKER"
   startLine = null
   startLineOffset = null
   endLine = null
   endLineOffset = null
   gap = null
   isNew = true
   creationDate = {Date@18084} "Wed Jan 23 20:06:10 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Add or update the header of this file."
   hashes = null
  this$0 = {DefaultPostJobContext@17996} 
 7 = {DefaultPostJobContext$DefaultIssueWrapper@17991} 
  wrapped = {TrackedIssue@18066} "TrackedIssue[ruleKey=kotlin:S1451,key=01687BAD43BE4408D7,severity=BLOCKER,startLine=<null>,startLineOffset=<null>,endLine=<null>,endLineOffset=<null>,gap=<null>,isNew=true,creationDate=Wed Jan 23 20:06:10 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.kt,message=Add or update the header of this file.]"
   ruleKey = {RuleKey@18068} "kotlin:S1451"
    repository = "kotlin"
    rule = "S1451"
   key = "01687BAD43BE4408D7"
   severity = "BLOCKER"
   startLine = null
   startLineOffset = null
   endLine = null
   endLineOffset = null
   gap = null
   isNew = true
   creationDate = {Date@18071} "Wed Jan 23 20:06:10 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Add or update the header of this file."
   hashes = null
  this$0 = {DefaultPostJobContext@17996} 
 8 = {DefaultPostJobContext$DefaultIssueWrapper@17992} 
  wrapped = {TrackedIssue@18053} "TrackedIssue[ruleKey=kotlin:S1451,key=01687BAD45ED4408FA,severity=BLOCKER,startLine=<null>,startLineOffset=<null>,endLine=<null>,endLineOffset=<null>,gap=<null>,isNew=true,creationDate=Wed Jan 23 20:06:10 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.kt,message=Add or update the header of this file.]"
   ruleKey = {RuleKey@18055} "kotlin:S1451"
    repository = "kotlin"
    rule = "S1451"
   key = "01687BAD45ED4408FA"
   severity = "BLOCKER"
   startLine = null
   startLineOffset = null
   endLine = null
   endLineOffset = null
   gap = null
   isNew = true
   creationDate = {Date@18058} "Wed Jan 23 20:06:10 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Add or update the header of this file."
   hashes = null
  this$0 = {DefaultPostJobContext@17996} 
 9 = {DefaultPostJobContext$DefaultIssueWrapper@17993} 
  wrapped = {TrackedIssue@18040} "TrackedIssue[ruleKey=kotlin:S1451,key=01687BAD45954408EE,severity=BLOCKER,startLine=<null>,startLineOffset=<null>,endLine=<null>,endLineOffset=<null>,gap=<null>,isNew=true,creationDate=Wed Jan 23 20:06:10 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.kt,message=Add or update the header of this file.]"
   ruleKey = {RuleKey@18042} "kotlin:S1451"
    repository = "kotlin"
    rule = "S1451"
   key = "01687BAD45954408EE"
   severity = "BLOCKER"
   startLine = null
   startLineOffset = null
   endLine = null
   endLineOffset = null
   gap = null
   isNew = true
   creationDate = {Date@18045} "Wed Jan 23 20:06:10 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Add or update the header of this file."
   hashes = null
  this$0 = {DefaultPostJobContext@17996} 
 10 = {DefaultPostJobContext$DefaultIssueWrapper@17994} 
  wrapped = {TrackedIssue@18027} "TrackedIssue[ruleKey=kotlin:S1451,key=01687BAD45CE4408F8,severity=BLOCKER,startLine=<null>,startLineOffset=<null>,endLine=<null>,endLineOffset=<null>,gap=<null>,isNew=true,creationDate=Wed Jan 23 20:06:10 MSK 2019,resolution=<null>,status=OPEN,assignee=<null>,componentKey=***.kt,message=Add or update the header of this file.]"
   ruleKey = {RuleKey@18029} "kotlin:S1451"
    repository = "kotlin"
    rule = "S1451"
   key = "01687BAD45CE4408F8"
   severity = "BLOCKER"
   startLine = null
   startLineOffset = null
   endLine = null
   endLineOffset = null
   gap = null
   isNew = true
   creationDate = {Date@18032} "Wed Jan 23 20:06:10 MSK 2019"
   resolution = null
   status = "OPEN"
   assignee = null
   componentKey = ***
   message = "Add or update the header of this file."
   hashes = null
  this$0 = {DefaultPostJobContext@17996} 
t-8ch commented 5 years ago

Oh. For some reason the stacktrace you reported initially showed, that the root of the NPE was in fileNameList() in line 147. The line is this: issues.sort(issueFormatComparator);. The only way this can be the root source of an NPE would be for issues to be null.

However the stacktrace in your debugger show, that the NPE has its origin during the evaluation of the comparator.

This makes sense now.

t-8ch commented 5 years ago

The comparator blew up, because the .line() of the issue was null (because these were file-wide issues.

t-8ch commented 5 years ago

@naushniki Could you retry with the current master branch? I pushed https://github.com/AmadeusITGroup/sonar-stash/commit/57df3e618a2dccc5e66b7f1a66819a10e7d8814c which should fix this.

naushniki commented 5 years ago

This helped. Thank you very much for this super fast fix!

t-8ch commented 5 years ago

You are welcome! There will be a bugfix release shortly.

t-8ch commented 5 years ago

https://github.com/AmadeusITGroup/sonar-stash/releases/tag/1.5.1