]> source.dussan.org Git - sonarqube.git/commitdiff
Don't fail but only display a warning when a CodeColorizer is buggy
authorJulien HENRY <julien.henry@sonarsource.com>
Fri, 3 Apr 2015 08:30:32 +0000 (10:30 +0200)
committerJulien HENRY <julien.henry@sonarsource.com>
Fri, 3 Apr 2015 08:31:05 +0000 (10:31 +0200)
sonar-batch/src/main/java/org/sonar/batch/source/CodeColorizers.java

index 9f38c69c63fffb03583520fafc5c17b0cc645896..7ed223e5199ff29d2e0995ed5ceb2623a0f84bbc 100644 (file)
@@ -70,6 +70,7 @@ public class CodeColorizers implements BatchComponent {
     if (format == null) {
       // Workaround for Java test code since Java plugin only provides highlighting for main source and no colorizer
       // TODO can be dropped when Java plugin embed its own CodeColorizerFormat of (better) provides highlighting for tests
+      // See SONARJAVA-830
       if ("java".equals(language)) {
         tokenizers = CodeColorizer.Format.JAVA.getTokenizers();
       } else {
@@ -81,7 +82,7 @@ public class CodeColorizers implements BatchComponent {
     try (Reader reader = new BufferedReader(new InputStreamReader(new BOMInputStream(new FileInputStream(file)), charset))) {
       new HighlightingRenderer().render(reader, tokenizers, highlighting);
     } catch (Exception e) {
-      throw new IllegalStateException("Unable to read source file for colorization", e);
+      LOG.warn("Unable to perform colorization of file " + file, e);
     }
   }
 }