Skip to content

Commit

Permalink
Replacing commons deprecated MultiHashMap with MultiValueHashMap
Browse files Browse the repository at this point in the history
  • Loading branch information
aaime committed Jun 1, 2019
1 parent 45a45f3 commit 662dde3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.collections.MultiHashMap;
import org.apache.commons.collections.map.MultiValueMap;
import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.mapped.MappedXMLStreamWriter;
import org.codehaus.jettison.util.FastStack;
Expand Down Expand Up @@ -390,7 +390,7 @@ protected void init(XStream xs) {
xs.omitField(impl(DefaultCatalogFacade.class), "layerGroups");

xs.registerLocalConverter(
DefaultCatalogFacade.class, "stores", new StoreMultiHashMapConverter());
DefaultCatalogFacade.class, "stores", new StoreMultiValueMapConverter());
xs.registerLocalConverter(
DefaultCatalogFacade.class, "namespaces", new SpaceMapConverter("namespace"));
xs.registerLocalConverter(
Expand Down Expand Up @@ -1828,14 +1828,14 @@ public Object doUnmarshal(
}

/** Converter for multi hash maps containing coverage stores and data stores. */
static class StoreMultiHashMapConverter implements Converter {
static class StoreMultiValueMapConverter implements Converter {
public boolean canConvert(Class type) {
return MultiHashMap.class.equals(type);
return MultiValueMap.class.equals(type);
}

public void marshal(
Object source, HierarchicalStreamWriter writer, MarshallingContext context) {
MultiHashMap map = (MultiHashMap) source;
MultiValueMap map = (MultiValueMap) source;
for (Object v : map.values()) {
if (v instanceof DataStoreInfo) {
writer.startNode("dataStore");
Expand All @@ -1851,7 +1851,7 @@ public void marshal(
}

public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
MultiHashMap map = new MultiHashMap();
MultiValueMap map = new MultiValueMap();

while (reader.hasMoreChildren()) {
reader.moveDown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections.MultiHashMap;
import org.apache.commons.collections.map.MultiValueMap;
import org.geoserver.catalog.Catalog;
import org.geoserver.catalog.FeatureTypeInfo;
import org.geoserver.catalog.NamespaceInfo;
Expand Down Expand Up @@ -65,7 +65,7 @@ protected void write(
List featureCollections = results.getFeature();

// round up the info objects for each feature collection
MultiHashMap ns2metas = new MultiHashMap();
MultiValueMap ns2metas = new MultiValueMap();

for (Iterator fc = featureCollections.iterator(); fc.hasNext(); ) {
SimpleFeatureCollection features = (SimpleFeatureCollection) fc.next();
Expand Down

0 comments on commit 662dde3

Please sign in to comment.