Skip to content

Commit 447521c

Browse files
committed
[bugfix] Map containsReference and contains should be recursive in nature
1 parent c5c9575 commit 447521c

File tree

1 file changed

+2
-2
lines changed
  • exist-core/src/main/java/org/exist/xquery/functions/map

1 file changed

+2
-2
lines changed

exist-core/src/main/java/org/exist/xquery/functions/map/MapType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ public boolean contains(AtomicValue key) {
283283
public boolean containsReference(final Item item) {
284284
for (final Iterator<Sequence> it = map.values().iterator(); it.hasNext();) {
285285
final Sequence value = it.next();
286-
if (value == item) {
286+
if (value == item || value.containsReference(item)) {
287287
return true;
288288
}
289289
}
@@ -294,7 +294,7 @@ public boolean containsReference(final Item item) {
294294
public boolean contains(final Item item) {
295295
for (final Iterator<Sequence> it = map.values().iterator(); it.hasNext();) {
296296
final Sequence value = it.next();
297-
if (value.equals(item)) {
297+
if (value.equals(item) || value.contains(item)) {
298298
return true;
299299
}
300300
}

0 commit comments

Comments
 (0)