org.jboss.resteasy.reactive.common.util.QuarkusMultivaluedHashMap Maven / Gradle / Ivy
package org.jboss.resteasy.reactive.common.util;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import jakarta.ws.rs.core.MultivaluedHashMap;
/**
* QuarkusMultivaluedHashMap without the bug in put/putAll that leaks external mutable storage into our storage.
*/
public class QuarkusMultivaluedHashMap extends MultivaluedHashMap
implements QuarkusMultivaluedMap {
private static final long serialVersionUID = 4136263572124588039L;
@Override
public List put(Key key, List value) {
if (value != null) {
// this is the storage the supertype uses
value = new LinkedList<>(value);
}
return super.put(key, value);
}
@Override
public void putAll(Map extends Key, ? extends List> m) {
for (Entry extends Key, ? extends List> entry : m.entrySet()) {
put(entry.getKey(), entry.getValue());
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy