diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2015-04-03 10:30:32 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2015-04-03 10:31:05 +0200 |
commit | 4ba8d553f180183c19afbc37c13ccc9261a1802d (patch) | |
tree | d697b07536063962f6876728c18408ef90c68d2d /sonar-batch | |
parent | 5da80c81406bda003908c9ab3e02b066cbc6abb5 (diff) | |
download | sonarqube-4ba8d553f180183c19afbc37c13ccc9261a1802d.tar.gz sonarqube-4ba8d553f180183c19afbc37c13ccc9261a1802d.zip |
Don't fail but only display a warning when a CodeColorizer is buggy
Diffstat (limited to 'sonar-batch')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/source/CodeColorizers.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/source/CodeColorizers.java b/sonar-batch/src/main/java/org/sonar/batch/source/CodeColorizers.java index 9f38c69c63f..7ed223e5199 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/source/CodeColorizers.java +++ b/sonar-batch/src/main/java/org/sonar/batch/source/CodeColorizers.java @@ -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); } } } |