Skip to content

Commit

Permalink
[#1726]:Fix ConcurrentModificationException in TypeInfoSetImpl#getXmlNs
Browse files Browse the repository at this point in the history
  • Loading branch information
jimma committed Jul 9, 2024
1 parent b7d1ff7 commit 6b86301
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -287,7 +288,7 @@ public Iterable<? extends ElementInfoImpl<T,C,F,M>> getAllElements() {
@Override
public Map<String,String> getXmlNs(String namespaceUri) {
if(xmlNsCache==null) {
xmlNsCache = new HashMap<>();
xmlNsCache = new ConcurrentHashMap<>();

for (ClassInfoImpl<T, C, F, M> ci : beans().values()) {
XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
Expand Down

0 comments on commit 6b86301

Please sign in to comment.