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

Fail fast when more than one Language is declared with a specific key

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.1
    • Component/s: None
    • Edition:
      Community

      Description

      Currently, when two or more languages declare the same key, a technical error such as the following is raised during report processing in the CE:

      2016.02.09 23:11:32 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVLIFssKMknfTONm_V08
      java.lang.IllegalArgumentException: Multiple entries with same key: js=JavaScript and js=JS
              at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:150) ~[guava-17.0.jar:na]
              at com.google.common.collect.RegularImmutableMap.checkNoConflictInBucket(RegularImmutableMap.java:104) ~[guava-17.0.jar:na]
              at com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:70) ~[guava-17.0.jar:na]
              at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:254) ~[guava-17.0.jar:na]
              at com.google.common.collect.Maps.uniqueIndex(Maps.java:1166) ~[guava-17.0.jar:na]
              at com.google.common.collect.Maps.uniqueIndex(Maps.java:1140) ~[guava-17.0.jar:na]
              at org.sonar.server.computation.language.LanguageRepositoryImpl.<init>(LanguageRepositoryImpl.java:46) ~[sonar-server-5.3.jar:na]
      

      Multiple languages with the same key are obviously not expected and such case should rather be detected at startup which would fail and, if possible, report the plugins declaring conflicting languages.

        Attachments

          Activity

            People

            Assignee:
            duarte.meneses Duarte Meneses
            Reporter:
            sebastien.lesaint Sebastien Lesaint
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: