aboutsummaryrefslogtreecommitdiffstats
path: root/container-search
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-10-08 13:57:59 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2018-10-08 13:57:59 +0200
commit347372115dcb5ac7817b1b8d5c3ab4b47630b1b6 (patch)
tree116f6455d77a0721c7c2f4bcb01e64c070ca1a72 /container-search
parent174e5351aeebe2d14718c89271380b8bfa393949 (diff)
No difference between empty and not set.
Diffstat (limited to 'container-search')
-rw-r--r--container-search/src/main/java/com/yahoo/vespa/streamingvisitors/VdsVisitor.java3
-rw-r--r--container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsVisitorTestCase.java10
2 files changed, 4 insertions, 9 deletions
diff --git a/container-search/src/main/java/com/yahoo/vespa/streamingvisitors/VdsVisitor.java b/container-search/src/main/java/com/yahoo/vespa/streamingvisitors/VdsVisitor.java
index 889ea11b902..cfbea04a110 100644
--- a/container-search/src/main/java/com/yahoo/vespa/streamingvisitors/VdsVisitor.java
+++ b/container-search/src/main/java/com/yahoo/vespa/streamingvisitors/VdsVisitor.java
@@ -128,8 +128,7 @@ class VdsVisitor extends VisitorDataHandler implements Visitor {
}
private static String createSelectionString(String documentType, String selection) {
- if (selection == null) return "";
- if (selection.isEmpty()) return documentType;
+ if ((selection == null) || selection.isEmpty()) return documentType;
StringBuilder sb = new StringBuilder(documentType);
sb.append(" and ( ").append(selection).append(" )");
diff --git a/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsVisitorTestCase.java b/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsVisitorTestCase.java
index 4ffccccae10..f75b78fd36f 100644
--- a/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsVisitorTestCase.java
+++ b/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/VdsVisitorTestCase.java
@@ -231,14 +231,10 @@ public class VdsVisitorTestCase {
assertEquals(docType + " and ( id.user=="+qa.userId + " )", params.getDocumentSelection());
} else if (qa.groupName != null) {
assertEquals(docType + " and ( id.group==\""+qa.groupName+"\" )", params.getDocumentSelection());
- } else if (qa.selection != null) {
- if (qa.selection.isEmpty()) {
- assertEquals(docType, params.getDocumentSelection());
- } else {
- assertEquals(docType + " and ( " + qa.selection + " )", params.getDocumentSelection());
- }
+ } else if ((qa.selection == null) || qa.selection.isEmpty()) {
+ assertEquals(docType, params.getDocumentSelection());
} else {
- assertEquals("", params.getDocumentSelection());
+ assertEquals(docType + " and ( " + qa.selection + " )", params.getDocumentSelection());
}
assertEquals(qa.headersOnly, params.getVisitHeadersOnly());
assertEquals(qa.from, params.getFromTimestamp());