Skip to content

Commit a6b620b

Browse files
committed
[bugfix] try-with resources on map.merge
1 parent 8f0a956 commit a6b620b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ public AbstractMapType merge(final Iterable<AbstractMapType> others) {
8282

8383
@Override
8484
public AbstractMapType merge(final Iterable<AbstractMapType> others, final BinaryOperator<Sequence> mergeFn) {
85-
final MapType map = new MapType(context, collator, key, value);
86-
return map.merge(others, mergeFn);
85+
try (final MapType map = new MapType(context, collator, key, value)) {
86+
return map.merge(others, mergeFn);
87+
}
8788
}
8889

8990
@Override

0 commit comments

Comments
 (0)