Skip to content

Commit 9cb3547

Browse files
[MOD] fn:type-of($jnode). qtspecs#2498
1 parent 7a4f90e commit 9cb3547

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

basex-core/src/main/java/org/basex/query/func/fn/FnTypeOf.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import org.basex.query.*;
44
import org.basex.query.value.*;
55
import org.basex.query.value.item.*;
6-
import org.basex.query.value.node.*;
76
import org.basex.query.value.type.*;
87
import org.basex.util.*;
98
import org.basex.util.hash.*;
@@ -31,15 +30,11 @@ private String toString(final Value value) {
3130

3231
final TokenSet types = new TokenSet();
3332
for(final Value item : value) {
34-
String type = null;
35-
if(item instanceof final JNode jnode) {
36-
type = new TokenBuilder().add(QueryText.JNODE).add('(').add(toString(jnode.value)).
37-
add(')').toString();
38-
} else {
39-
type = item.type.toString();
40-
if(item.type instanceof FType) {
41-
type = type.replaceAll("\\(.*", "(*)").replace("record", "map");
42-
}
33+
String type = item.type.toString();
34+
if(item.type instanceof FType) {
35+
type = type.replaceAll("\\(.*", "(*)").replace("record", "map");
36+
} else if(item.type.instanceOf(NodeType.JNODE)) {
37+
type = type.replaceAll("\\(.*", "()");
4338
}
4439
types.add(type);
4540
}

0 commit comments

Comments
 (0)