summaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/source/HtmlSourceDecorator.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/source/HtmlSourceDecorator.java b/sonar-core/src/main/java/org/sonar/core/source/HtmlSourceDecorator.java
index 4fb4925a6f0..e8772ee357c 100644
--- a/sonar-core/src/main/java/org/sonar/core/source/HtmlSourceDecorator.java
+++ b/sonar-core/src/main/java/org/sonar/core/source/HtmlSourceDecorator.java
@@ -20,6 +20,7 @@
package org.sonar.core.source;
+import com.google.common.base.Strings;
import org.sonar.core.persistence.MyBatis;
import org.sonar.core.source.jdbc.SnapshotDataDao;
import org.sonar.core.source.jdbc.SnapshotDataDto;
@@ -48,11 +49,7 @@ public class HtmlSourceDecorator {
if (snapshotSource != null && snapshotDataEntries != null) {
DecorationDataHolder decorationDataHolder = new DecorationDataHolder();
for (SnapshotDataDto snapshotDataEntry : snapshotDataEntries) {
- if (snapshotDataEntry.isSyntaxHighlightingData()) {
- decorationDataHolder.loadSyntaxHighlightingData(snapshotDataEntry.getData());
- } else if (snapshotDataEntry.isSymbolData()) {
- decorationDataHolder.loadSymbolReferences(snapshotDataEntry.getData());
- }
+ loadSnapshotData(decorationDataHolder, snapshotDataEntry);
}
HtmlTextDecorator textDecorator = new HtmlTextDecorator();
@@ -60,4 +57,14 @@ public class HtmlSourceDecorator {
}
return null;
}
+
+ private void loadSnapshotData(DecorationDataHolder decorationDataHolder, SnapshotDataDto snapshotDataEntry) {
+ if(!Strings.isNullOrEmpty(snapshotDataEntry.getData())) {
+ if (snapshotDataEntry.isSyntaxHighlightingData()) {
+ decorationDataHolder.loadSyntaxHighlightingData(snapshotDataEntry.getData());
+ } else if (snapshotDataEntry.isSymbolData()) {
+ decorationDataHolder.loadSymbolReferences(snapshotDataEntry.getData());
+ }
+ }
+ }
}