From 6b86301a9a8358f33e1a93ccb49ae6ddb192ada8 Mon Sep 17 00:00:00 2001 From: Jim Ma Date: Tue, 9 Jul 2024 16:36:05 +0800 Subject: [PATCH] [#1726]:Fix ConcurrentModificationException in TypeInfoSetImpl#getXmlNs --- .../glassfish/jaxb/runtime/v2/model/impl/TypeInfoSetImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/TypeInfoSetImpl.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/TypeInfoSetImpl.java index b1bbbcaab..8c45df938 100644 --- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/TypeInfoSetImpl.java +++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/TypeInfoSetImpl.java @@ -10,6 +10,7 @@ package org.glassfish.jaxb.runtime.v2.model.impl; +import java.util.concurrent.ConcurrentHashMap; import org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader; import org.glassfish.jaxb.core.v2.model.core.*; import org.glassfish.jaxb.core.v2.model.nav.Navigator; @@ -287,7 +288,7 @@ public Iterable> getAllElements() { @Override public Map getXmlNs(String namespaceUri) { if(xmlNsCache==null) { - xmlNsCache = new HashMap<>(); + xmlNsCache = new ConcurrentHashMap<>(); for (ClassInfoImpl ci : beans().values()) { XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );