SonarQube Java
  1. SonarQube Java
  2. SONARJAVA-14

findbugs-result.xml contains invalid character entity

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1
    • Component/s: Findbugs
    • Labels:
      None
    • Number of attachments :
      4

      Description

      The new Findbugs version produces a findbugs-result.xml with invalid character entity, or the FindbugsXmlReportParser can't handle the entity.

      My class that can't be analysed contains a String s1 = '\uffff' + "_YELLOW_FLAG" (used for sorting, to be placed last). The String s2 = '\u0000' + "_GREEN_FLAG" seems to be handled correctly.

      The string s1 produces the xml element: <String value="￿_YELLOW_FLAG" role="STRING_CONSTANT"> which causes the problem.

      This error occurred after upgrading from Sonar3.0 to Sonar3.2, I guess it comes from the use of Findbugs 2?

      1. code-snippet.java
        0.2 kB
        Johan Kindgren
      2. findbugs-result-snippet.xml
        0.2 kB
        Johan Kindgren
      3. sonar-stacktrace.txt
        5 kB
        Johan Kindgren

        Issue Links

          Activity

          Hide
          Freddy Mallet added a comment -

          Perhaps this issue also relates to SONAR-2594 (fixed in Sonar 3.2)

          Show
          Freddy Mallet added a comment - Perhaps this issue also relates to SONAR-2594 (fixed in Sonar 3.2)
          Hide
          Johan Kindgren added a comment -

          If SONAR-2594 is fixed in 3.2, I hope that it wouldn't affect me? (Since the analysis started to fail after upgrading to 3.2?)

          I'm guessing that it has something to do with the FindbugsXmlReportParser, that can't handle the xml entities in the report generated by Findbugs. Didn't Sonar 3.2 include a new version of Findbugs?

          Show
          Johan Kindgren added a comment - If SONAR-2594 is fixed in 3.2, I hope that it wouldn't affect me? (Since the analysis started to fail after upgrading to 3.2?) I'm guessing that it has something to do with the FindbugsXmlReportParser, that can't handle the xml entities in the report generated by Findbugs. Didn't Sonar 3.2 include a new version of Findbugs?
          Hide
          Johan Kindgren added a comment -

          Added a test-project (using maven) to verify the problem.
          Activate the profile "Sonar way with Findbugs" when building the sample project.
          When using a 3.0 server, everything works fine. When using a 3.2 server, the build fails.

          Show
          Johan Kindgren added a comment - Added a test-project (using maven) to verify the problem. Activate the profile "Sonar way with Findbugs" when building the sample project. When using a 3.0 server, everything works fine. When using a 3.2 server, the build fails.
          Hide
          Evgeny Mandrikov added a comment -

          I can reproduce this issue with Sonar 3.1.1, but not with 3.0, so indeed - it relates to upgrade of Findbugs. Also I can imagine that resolution of SONAR-1880 will help us to solve this issue as it was the case for PMD (SONAR-3346).

          Show
          Evgeny Mandrikov added a comment - I can reproduce this issue with Sonar 3.1.1, but not with 3.0, so indeed - it relates to upgrade of Findbugs. Also I can imagine that resolution of SONAR-1880 will help us to solve this issue as it was the case for PMD ( SONAR-3346 ).
          Hide
          Evgeny Mandrikov added a comment -

          BTW, this issue means that Findbugs 2.0 and 2.0.1 produces invalid XML (&#65535; not a valid XML entity).

          Show
          Evgeny Mandrikov added a comment - BTW, this issue means that Findbugs 2.0 and 2.0.1 produces invalid XML (&#65535; not a valid XML entity).

            People

            • Assignee:
              Evgeny Mandrikov
              Reporter:
              Johan Kindgren
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: