Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.keycloak.common.util;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;

Expand All @@ -28,6 +29,15 @@
@SuppressWarnings("serial")
public class ConcurrentMultivaluedHashMap<K, V> extends ConcurrentHashMap<K, List<V>> implements MultivaluedMap<K, V>
{
public ConcurrentMultivaluedHashMap() {
}

public ConcurrentMultivaluedHashMap(Map<K, List<V>> map) {
if (map == null) {
throw new IllegalArgumentException("Map can not be null");
}
putAll(map);
}

@Override
public List<V> createListInstance() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ public MultivaluedMap<String, ComponentModel> getComponentsByParent() {
}

public MultivaluedMap<String, ComponentModel> getComponentsByParentAndType() {
return new MultivaluedHashMap<>(componentsByParentAndType);
return new ConcurrentMultivaluedHashMap<>(componentsByParentAndType);
}

public Map<String, ComponentModel> getComponents() {
Expand Down