diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-01-06 09:21:53 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-01-06 09:21:53 +0100 |
commit | 1a63ceb1d3a6a3f204b0f27505f2436834e2fa1a (patch) | |
tree | a48c4931f16c463345500dc1191fcd8fd064647a | |
parent | 6be98b208a59535af4cbbcfff3af0d49d111a6bd (diff) | |
download | sonarqube-1a63ceb1d3a6a3f204b0f27505f2436834e2fa1a.tar.gz sonarqube-1a63ceb1d3a6a3f204b0f27505f2436834e2fa1a.zip |
SONAR-7131 WS components/show empty string in Oracle handled correctly
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/component/ws/ShowData.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/component/ws/ShowData.java b/server/sonar-server/src/main/java/org/sonar/server/component/ws/ShowData.java index 407dff0a5b8..a5bb63dc54e 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/component/ws/ShowData.java +++ b/server/sonar-server/src/main/java/org/sonar/server/component/ws/ShowData.java @@ -23,6 +23,7 @@ import com.google.common.base.Function; import com.google.common.base.Splitter; import com.google.common.collect.Lists; import com.google.common.collect.Ordering; +import java.util.Collections; import java.util.List; import javax.annotation.Nonnull; import org.sonar.db.component.ComponentDto; @@ -54,7 +55,7 @@ class ShowData { private List<Long> orderedComponentIds; private Builder(SnapshotDto snapshot) { - List<String> orderedSnapshotIdsAsString = Splitter.on(".").omitEmptyStrings().splitToList(snapshot.getPath()); + List<String> orderedSnapshotIdsAsString = snapshot.getPath() == null ? Collections.<String>emptyList() : Splitter.on(".").omitEmptyStrings().splitToList(snapshot.getPath()); orderedSnapshotIds = Lists.transform(orderedSnapshotIdsAsString, StringToLongFunction.INSTANCE); snapshotOrdering = Ordering .explicit(orderedSnapshotIds) |