diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-10-14 14:31:54 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-10-14 14:31:54 +0200 |
commit | cd802907369ae4ff25e8aaa6c93c7a3d2f8bcc17 (patch) | |
tree | 348aa66ae9a0c513cffe1579aa51e0bc351748d9 /plugins/sonar-core-plugin | |
parent | 7df58c2fc0dbab0d82c5587104a9ad1d2fa369ac (diff) | |
parent | 5e7744ae006b41948359fe60841e8e66701fc5f9 (diff) | |
download | sonarqube-cd802907369ae4ff25e8aaa6c93c7a3d2f8bcc17.tar.gz sonarqube-cd802907369ae4ff25e8aaa6c93c7a3d2f8bcc17.zip |
Merge remote-tracking branch 'origin/branch-4.5'
Conflicts:
sonar-batch/src/main/java/org/sonar/batch/referential/DefaultProjectReferentialsLoader.java
sonar-batch/src/main/java/org/sonar/batch/scan/LastSnapshots.java
sonar-batch/src/test/java/org/sonar/batch/scan/LastSnapshotsTest.java
Diffstat (limited to 'plugins/sonar-core-plugin')
-rw-r--r-- | plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/SourceHashHolder.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/SourceHashHolder.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/SourceHashHolder.java index 8caec63784f..c10586fda05 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/SourceHashHolder.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/SourceHashHolder.java @@ -19,8 +19,7 @@ */ package org.sonar.plugins.core.issue; -import java.util.Collection; - +import org.apache.commons.lang.StringUtils; import org.sonar.api.batch.SonarIndex; import org.sonar.api.resources.Resource; import org.sonar.batch.scan.LastSnapshots; @@ -28,7 +27,7 @@ import org.sonar.plugins.core.issue.tracking.HashedSequence; import org.sonar.plugins.core.issue.tracking.StringText; import org.sonar.plugins.core.issue.tracking.StringTextComparator; - +import java.util.Collection; public class SourceHashHolder { @@ -66,15 +65,15 @@ public class SourceHashHolder { } public String getSource() { - if (! sourceInitialized) { - source = index.getSource(resource); + if (!sourceInitialized) { + source = StringUtils.defaultString(index.getSource(resource), ""); sourceInitialized = true; } return source; } public String getReferenceSource() { - if (! referenceSourceInitialized) { + if (!referenceSourceInitialized) { if (resource != null) { referenceSource = lastSnapshots.getSource(resource); } @@ -88,7 +87,7 @@ public class SourceHashHolder { } private void initHashesIfNull(Object required) { - if(required == null) { + if (required == null) { initHashes(); } } @@ -97,4 +96,3 @@ public class SourceHashHolder { return getHashedSource().getLinesForHash(getHashedReference().getHash(originLine)); } } - |