From 7e47c87332a0254a2b472d7f5e3bc13f691d7b8f Mon Sep 17 00:00:00 2001 From: Laurettta Date: Wed, 11 Nov 2026 09:31:22 +0000 Subject: [PATCH] [7.x.x] Fix in-scope-prefixes failing with an exception Closes https://github.com/eXist-db/exist/issues/3436 --- .../org/exist/xquery/functions/fn/FunInScopePrefixes.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/exist-core/src/main/java/org/exist/xquery/functions/fn/FunInScopePrefixes.java b/exist-core/src/main/java/org/exist/xquery/functions/fn/FunInScopePrefixes.java index 006429da59..c3d20f28f1 100644 --- a/exist-core/src/main/java/org/exist/xquery/functions/fn/FunInScopePrefixes.java +++ b/exist-core/src/main/java/org/exist/xquery/functions/fn/FunInScopePrefixes.java @@ -219,12 +219,13 @@ public static Map collectPrefixes(XQueryContext context, NodeVal //clean up String key = null; String value = null; - for (final Entry entry : prefixes.entrySet()) { + for (final Iterator> i = prefixes.entrySet().iterator(); i.hasNext(); ) { + final Entry entry = i.next(); key = entry.getKey(); value = entry.getValue(); if ((key == null || key.isEmpty()) && (value == null || value.isEmpty())) { - prefixes.remove(key); + i.remove(); } }