diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-02-23 00:41:42 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-02-23 00:41:42 +0100 |
commit | e0a45822f9a18b4b1d0d22f53b2218cd60795f6f (patch) | |
tree | 69ad0eb029b46fb0a0abbc8cfed2c79ea6816294 /plugins | |
parent | c4e7fb294ca6b445db2a59336913642dd7273f2b (diff) | |
download | sonarqube-e0a45822f9a18b4b1d0d22f53b2218cd60795f6f.tar.gz sonarqube-e0a45822f9a18b4b1d0d22f53b2218cd60795f6f.zip |
Fix some quality flaws
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SymbolReferencesSensor.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SymbolReferencesSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SymbolReferencesSensor.java index 118fe828243..e90feb4310f 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SymbolReferencesSensor.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SymbolReferencesSensor.java @@ -62,16 +62,17 @@ public class SymbolReferencesSensor implements Sensor { List<String> lines = FileUtils.readLines(symbolFile, context.fileSystem().encoding().name()); int lineNumber = 0; Symbolizable symbolizable = perspectives.as(Symbolizable.class, inputFile); - - Symbolizable.SymbolTableBuilder symbolTableBuilder = symbolizable.newSymbolTableBuilder(); - for (String line : lines) { - lineNumber++; - if (StringUtils.isBlank(line) || line.startsWith("#")) { - continue; + if (symbolizable != null) { + Symbolizable.SymbolTableBuilder symbolTableBuilder = symbolizable.newSymbolTableBuilder(); + for (String line : lines) { + lineNumber++; + if (StringUtils.isBlank(line) || line.startsWith("#")) { + continue; + } + processLine(symbolFile, lineNumber, symbolTableBuilder, line); } - processLine(symbolFile, lineNumber, symbolTableBuilder, line); + symbolizable.setSymbolTable(symbolTableBuilder.build()); } - symbolizable.setSymbolTable(symbolTableBuilder.build()); } catch (IOException e) { throw new IllegalStateException(e); } |