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

api/project_badges/measure can sometimes badly fail

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.4
    • Component/s: Web API
    • Labels:
      None
    • Estimate:
      Minutes
    • Edition:
      Community
    • Production Notes:
      None

      Description

      api/project_badges/measure can sometimes fail because :

      Fail to process request http://sonarcloud.io/api/project_badges/measure?project=io.chocorean.authmod%3Aauthmod&metric=code_smells
      java.lang.NullPointerException: null
      	at java.text.DecimalFormat.resetFastPathData(DecimalFormat.java:1077)
      	at java.text.DecimalFormat.checkAndSetFastPathStatus(DecimalFormat.java:1001)
      	at java.text.DecimalFormat.fastFormat(DecimalFormat.java:1579)
      	at java.text.NumberFormat.format(NumberFormat.java:292)
      	at org.sonar.server.badge.ws.SvgFormatter.formatNumeric(SvgFormatter.java:58)
      	at org.sonar.server.badge.ws.MeasureAction.generateSvg(MeasureAction.java:174)
      	at org.sonar.server.badge.ws.MeasureAction.handle(MeasureAction.java:148)
      	at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:110)
      	at org.sonar.server.ws.WebServiceFilter.doFilter(WebServiceFilter.java:88)
      

      The reason is that DecimalFormat is not thread safe (more details can be found here : https://stackoverflow.com/questions/26514290/why-does-numberformat-format-throw-an-nullpointerexception).
      We should make it thread safe to fix this issue.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sebastien.lesaint Sebastien Lesaint
              Reporter:
              julien.lancelot Julien Lancelot
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: