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

File with BOM are not correctly parsed by the CPD tokenizer

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.4
    • Component/s: Duplications, Scanner
    • Labels:
      None

      Description

      How to reproduce:

      • take a Java project with all files encoded UTF-8
      • change encoding of a file to UTF-16 with BOM

      Even after fixing SONARJAVA-2279, analysis fails with:

      Caused by: org.sonar.duplications.DuplicationsException: Unable to build statement from token : ''[309,2]
              at org.sonar.duplications.statement.StatementChunker.chunk(StatementChunker.java:50)
              at org.sonar.scanner.cpd.deprecated.JavaCpdBlockIndexer.createIndex(JavaCpdBlockIndexer.java:95)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              julien.henry Julien Henry
              Reporter:
              julien.henry Julien Henry
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: