Uploaded image for project: 'SonarLint For IntelliJ'
  1. SonarLint For IntelliJ
  2. SLI-584

NPE when analyzing all files

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.1
    • Fix Version/s: 5.2
    • Component/s: None
    • Labels:
      None

      Description

      When trying to analyze multiple files, this exception might occurs:

      Initializing metadata of file file:///xxxx
      Error running SonarLint analysis
      java.lang.NullPointerException
      	at org.sonarlint.intellij.analysis.AnalysisTask.processRawIssue(AnalysisTask.java:304)
      	at org.sonarlint.intellij.analysis.AnalysisTask.lambda$run$3(AnalysisTask.java:171)
      	at org.sonarsource.sonarlint.core.analyzer.sensor.SonarLintSensorStorage.store(SonarLintSensorStorage.java:103)
      	at org.sonarsource.sonarlint.core.analyzer.sensor.DefaultSonarLintIssue.doSave(DefaultSonarLintIssue.java:164)
      	at org.sonarsource.sonarlint.core.analyzer.sensor.DefaultStorable.save(DefaultStorable.java:46)
      	at A.A.A.C.A(Unknown Source)
      	at A.A.A.C.A(Unknown Source)
      	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
      	at A.A.A.C.A(Unknown Source)
      	at A.A.A.C.execute(Unknown Source)
      	at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.executeSensor(SensorsExecutor.java:80)
      	at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.execute(SensorsExecutor.java:71)
      	at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:133)
      	at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:126)
      	at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:111)
      	at org.sonarsource.sonarlint.core.container.storage.StorageAnalyzer.analyze(StorageAnalyzer.java:75)
      	at org.sonarsource.sonarlint.core.container.storage.StorageContainerHandler.analyze(StorageContainerHandler.java:84)
      	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$0(ConnectedSonarLintEngineImpl.java:148)
      	at org.sonarsource.sonarlint.core.AbstractSonarLintEngine.withModule(AbstractSonarLintEngine.java:87)
      	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$1(ConnectedSonarLintEngineImpl.java:146)
      	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:336)
      	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:326)
      	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(ConnectedSonarLintEngineImpl.java:144)
      	at org.sonarlint.intellij.core.ConnectedSonarLintFacade.analyze(ConnectedSonarLintFacade.java:72)
      	at org.sonarlint.intellij.core.SonarLintFacade.startAnalysis(SonarLintFacade.java:63)
      	at org.sonarlint.intellij.analysis.SonarLintAnalyzer.analyzeModule(SonarLintAnalyzer.java:89)
      	at org.sonarlint.intellij.analysis.AnalysisTask.analyzePerModule(AnalysisTask.java:405)
      	at org.sonarlint.intellij.analysis.AnalysisTask.run(AnalysisTask.java:170)
      	at org.sonarlint.intellij.analysis.UserTriggeredAnalysisTask.run(UserTriggeredAnalysisTask.java:37)
      

      To reproduce:

      • select 2 files to analyze (use context menu to trigger analysis)
      • one file should not be excluded in the SCM
      • the other file should be excluded, but contain an issue

        Attachments

          Activity

            People

            Assignee:
            julien.henry Julien Henry
            Reporter:
            julien.henry Julien Henry
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: