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

Report processing fails when a language cost is configured without a language key

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.2, 5.3, 5.4
    • Fix Version/s: 5.6
    • Component/s: Compute Engine, Web
    • Labels:

      Description

      Report processing fails with an error such as the following when a language development cost is configured without a language key.

      016.02.05 12:28:52 ERROR [o.s.s.c.t.CeWorkerRunnableImpl] Failed to execute task AVKxZzs3XOSwYL28ZL1g
      java.lang.NullPointerException: null key in entry: null=org.sonar.server.computation.sqale.SqaleRatingSettings$LanguageSpecificConfiguration@1a17df9
          at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:31) ~[guava-17.0.jar:na]
          at com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:135) ~[guava-17.0.jar:na]
          at com.google.common.collect.ImmutableMap$Builder.put(ImmutableMap.java:206) ~[guava-17.0.jar:na]
          at org.sonar.server.computation.sqale.SqaleRatingSettings.buildLanguageSpecificConfigurationByLanguageKey(SqaleRatingSettings.java:54) ~[sonar-server-5.2.jar:na]
          at org.sonar.server.computation.sqale.SqaleRatingSettings.<init>(SqaleRatingSettings.java:46) ~[sonar-server-5.2.jar:na]
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_60]
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[na:1.8.0_60]
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[na:1.8.0_60]
          at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[na:1.8.0_60]
          at org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:145) ~[picocontainer-2.15.jar:na]
          at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:342) ~[picocontainer-2.15.jar:na]
          at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270) ~[picocontainer-2.15.jar:na]
          at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364) ~[picocontainer-2.15.jar:na]
          at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56) ~[picocontainer-2.15.jar:na]
          at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64) ~[picocontainer-2.15.jar:na]
          at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91) ~[picocontainer-2.15.jar:na]
          at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699) ~[picocontainer-2.15.jar:na]
          at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647) ~[picocontainer-2.15.jar:na]
          at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632) ~[picocontainer-2.15.jar:na]
      

      This can be easily reproduced because the UI does not enforce the user enter a language key such as below:

      The compute engine should defend against such case. The open question being: should it ignore the configuration error or fail?

        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: