Skip to content

Commit 99e9d0b

Browse files
[FIX] Empty results (QT4 tests, value builder)
1 parent 5e10264 commit 99e9d0b

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

basex-core/src/main/java/org/basex/query/value/ValueBuilder.java

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,21 +114,18 @@ public ValueBuilder add(final Item item) {
114114
* @return reference to this builder for convenience
115115
*/
116116
public ValueBuilder add(final Value value) {
117-
if(value.isEmpty()) {
118-
qc.checkStop();
119-
return this;
120-
}
121-
122-
final TreeSeqBuilder tree = builder;
123-
if(tree != null) {
124-
tree.add(value, qc);
125-
} else {
126-
final Value first = firstValue;
127-
if(first != null) {
128-
builder = new TreeSeqBuilder().add(first, qc).add(value, qc);
129-
firstValue = null;
117+
if(!value.isEmpty()) {
118+
final TreeSeqBuilder tree = builder;
119+
if(tree != null) {
120+
tree.add(value, qc);
130121
} else {
131-
firstValue = value;
122+
final Value first = firstValue;
123+
if(first != null) {
124+
builder = new TreeSeqBuilder().add(first, qc).add(value, qc);
125+
firstValue = null;
126+
} else {
127+
firstValue = value;
128+
}
132129
}
133130
}
134131
return this;

basex-tests/src/main/java/org/basex/tests/bxapi/xdm/XdmEmpty.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ public SeqType getType() {
2727
return SeqType.EMPTY_SEQUENCE_Z;
2828
}
2929

30+
@Override
31+
public boolean getBoolean() {
32+
return false;
33+
}
34+
3035
@Override
3136
public int size() {
3237
return 0;

0 commit comments

Comments
 (0)