diff options
author | Jean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com> | 2013-04-16 16:15:52 +0200 |
---|---|---|
committer | Jean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com> | 2013-04-16 16:15:52 +0200 |
commit | fb7248d86bc6b540567a2dcc8ee9cad6a615e254 (patch) | |
tree | 3c200b20f86272128d774bb6c90ad920c496d3df /sonar-core | |
parent | 0375b26acba1f97b715864a52c08dca3b9413b72 (diff) | |
download | sonarqube-fb7248d86bc6b540567a2dcc8ee9cad6a615e254.tar.gz sonarqube-fb7248d86bc6b540567a2dcc8ee9cad6a615e254.zip |
SONAR-3893 Fixed snapshot data persistence issue
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/source/HtmlSourceDecorator.java | 17 |
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()); + } + } + } } |