SonarQube Plugins
  1. SonarQube Plugins
  2. SONARPLUGINS-1315

NPE on Artifact-Size plugin on C# projects

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: ARTIFACT-SIZE-0.2
    • Fix Version/s: ARTIFACT-SIZE-0.3
    • Component/s: Artifact Size
    • Labels:
      None
    • Number of attachments :
      0

      Description

      C# multi-module projects are handled with the ProjectBuilder extension, which creates sub-modules that do not contain MavenProject objects (~= POM) like it is the case in the Java world.
      This produces the following exception:

      [INFO]  Sensor org.sonar.plugins.artifactsize.ArtifactSizeSensor@dc420b...
      Exception in thread "main" org.sonar.batch.bootstrapper.BootstrapException: java.lang.NullPointerException
              at org.sonar.runner.Runner.delegateExecution(Runner.java:155)
              at org.sonar.runner.Runner.execute(Runner.java:58)
              at org.sonar.runner.Main.main(Main.java:52)
      Caused by: java.lang.NullPointerException
              at org.sonar.plugins.artifactsize.ArtifactSizeSensor.searchArtifactFile(ArtifactSizeSensor.java:77)
              at org.sonar.plugins.artifactsize.ArtifactSizeSensor.analyse(ArtifactSizeSensor.java:53)
              at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:63)
              at org.sonar.batch.phases.Phases.execute(Phases.java:93)
              at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:145)
              at org.sonar.batch.bootstrap.Module.start(Module.java:89)
              at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:106)
              at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:101)
              at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:96)
              at org.sonar.batch.bootstrap.Module.start(Module.java:89)
              at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:96)
              at org.sonar.batch.bootstrap.Module.start(Module.java:89)
              at org.sonar.batch.Batch.execute(Batch.java:74)
              at org.sonar.runner.Launcher.executeBatch(Launcher.java:60)
              at org.sonar.runner.Launcher.execute(Launcher.java:53)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:592)
              at org.sonar.runner.Runner.delegateExecution(Runner.java:152)
              ... 2 more
      

      Currently, for people who want to analyse both Java and C# projects, it is therefore impossible to use the Artifact-Size plugin.
      To fix this, checks should be done to prevent NPE.

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Fabrice Bellingard
              Reporter:
              Fabrice Bellingard
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: