Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-8011

File move detection can fail on files of projects from SQ 3.X which don't have a path

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.0
    • Fix Version/s: 6.1
    • Component/s: Compute Engine
    • Labels:

      Description

      Errors such as the following:

      java.lang.NullPointerException: path can not be null
      	at java.util.Objects.requireNonNull(Objects.java:228) ~[na:1.8.0_91]
      	at org.sonar.server.computation.filemove.FileSimilarity$File.<init>(FileSimilarity.java:36) ~[sonar-server-6.0.jar:na]
      	at org.sonar.server.computation.filemove.FileMoveDetectionStep.getFile(FileMoveDetectionStep.java:236) ~[sonar-server-6.0.jar:na]
      	at org.sonar.server.computation.filemove.FileMoveDetectionStep.computeScoreMatrix(FileMoveDetectionStep.java:208) ~[sonar-server-6.0.jar:na]
      	at org.sonar.server.computation.filemove.FileMoveDetectionStep.execute(FileMoveDetectionStep.java:126) ~[sonar-server-6.0.jar:na]
      	at org.sonar.server.computation.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:64) ~[sonar-server-6.0.jar:na]
      	at org.sonar.server.computation.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:52) ~[sonar-server-6.0.jar:na]
      	at org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor.process(ReportTaskProcessor.java:75) ~[sonar-server-6.0.jar:na]
      	at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:81) [sonar-server-6.0.jar:na]
      	at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:56) [sonar-server-6.0.jar:na]
      	at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:35) [sonar-server-6.0.jar:na]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_91]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_91]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_91]
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_91]
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_91]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_91]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_91]
      	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]
      

      can occur when analyzing a project which existed when SQ 3.X was running. In such case, rows in table PROJECTS representing a FILE can exist and have a null value in the path column.

      We should handle this case and ignore such files during the file move detection step.

        Attachments

          Activity

            People

            Assignee:
            sebastien.lesaint Sebastien Lesaint
            Reporter:
            sebastien.lesaint Sebastien Lesaint
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: