Uploaded image for project: 'SonarHTML'
  1. SonarHTML
  2. SONARHTML-53

Fix highlighting/cpd for files containing bom characters

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 3.0
    • Component/s: None
    • Labels:
      None

      Description

      java.lang.IllegalArgumentException: Unable to register token in file [moduleKey=project, relative=external_webkit-jb-mr1/LayoutTests/fast/encoding/utf-32-big-endian-bom.html, basedir=/Users/xxx/projects/sonar-web/its/sources]
      	at org.sonar.api.batch.sensor.cpd.internal.DefaultCpdTokens.addToken(DefaultCpdTokens.java:77) ~[sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.plugins.web.core.WebTokensVisitor.highlightAndDuplicate(WebTokensVisitor.java:67) ~[sonar-web-plugin-2.6-SNAPSHOT.jar:na]
      	at org.sonar.plugins.web.core.WebTokensVisitor.startDocument(WebTokensVisitor.java:49) ~[sonar-web-plugin-2.6-SNAPSHOT.jar:na]
      	at org.sonar.plugins.web.visitor.HtmlAstScanner.scan(HtmlAstScanner.java:75) [sonar-web-plugin-2.6-SNAPSHOT.jar:na]
      	at org.sonar.plugins.web.visitor.HtmlAstScanner.scan(HtmlAstScanner.java:59) [sonar-web-plugin-2.6-SNAPSHOT.jar:na]
      	at org.sonar.plugins.web.core.WebSensor.execute(WebSensor.java:98) [sonar-web-plugin-2.6-SNAPSHOT.jar:na]
      	at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:57) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:49) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:182) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:247) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:242) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:232) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:115) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:118) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:78) [sonar-scanner-engine-shaded-6.1.jar:na]
      	at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48) [sonar-runner-batch2280344781125038639.jar:na]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_101]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_101]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_101]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_101]
      	at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87) [sonar-runner-dist-2.4.jar:na]
      	at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75) [sonar-runner-dist-2.4.jar:na]
      	at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_101]
      	at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69) [sonar-runner-dist-2.4.jar:na]
      	at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) [sonar-runner-dist-2.4.jar:na]
      	at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102) [sonar-runner-dist-2.4.jar:na]
      	at org.sonar.runner.api.Runner.execute(Runner.java:100) [sonar-runner-dist-2.4.jar:na]
      	at org.sonar.runner.Main.executeTask(Main.java:70) [sonar-runner-dist-2.4.jar:na]
      	at org.sonar.runner.Main.execute(Main.java:59) [sonar-runner-dist-2.4.jar:na]
      	at org.sonar.runner.Main.main(Main.java:53) [sonar-runner-dist-2.4.jar:na]
      Caused by: java.lang.IllegalArgumentException: 28 is not a valid line offset for pointer. File [moduleKey=project, relative=external_webkit-jb-mr1/LayoutTests/fast/encoding/utf-32-big-endian-bom.html, basedir=/Users/xxx/projects/sonar-web/its/sources] has 27 character(s) at line 1
      	
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pierre-yves.nicolas Pierre-Yves Nicolas
                Reporter:
                massimo.paladin Massimo PALADIN
              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: