Apache Solr open-source search software
SOLR-14536: Fix or suppress warnings in apache/solr/common
Erick Erickson6d5b1ae7f4bf
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 6bce15f7e16..287d9fb3c56 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -290,6 +290,8 @@ Other Changes* SOLR-14538: Fix or suppress remaining warnings in apache/solr/handler (Erick Erickson)+* SOLR-14536: Fix or suppress warnings in apache/solr/common (Erick Erickson)+================== 8.5.2 ==================Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.javaindex 7cea4cf87e2..c2e7869f9fc 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java@@ -110,6 +110,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>}@Override+ @SuppressWarnings({"rawtypes"})public SolrRequest getV2Request() {return usev2 ?V1toV2ApiMapper.convert(this).useBinary(useBinaryV2).build() :@@ -294,6 +295,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>}}+ @SuppressWarnings({"rawtypes"})protected abstract static class ShardSpecificAdminRequest extends CollectionAdminRequest {protected String collection;@@ -1535,6 +1537,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>public static class RequestStatusResponse extends CollectionAdminResponse {public RequestStatusState getRequestStatus() {+ @SuppressWarnings({"rawtypes"})NamedList innerResponse = (NamedList) getResponse().get("status");return RequestStatusState.fromKey((String) innerResponse.get("state"));}@@ -2682,6 +2685,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>/*** Returns a SolrRequest to get a list of collections in the cluster*/+ @SuppressWarnings({"unchecked"})public static java.util.List<String> listCollections(SolrClient client) throws IOException, SolrServerException {CollectionAdminResponse resp = new List().process(client);return (java.util.List<String>) resp.getResponse().get("collections");diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/V1toV2ApiMapper.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/V1toV2ApiMapper.javaindex 0ec1112c214..0cfaf201b75 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/V1toV2ApiMapper.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/V1toV2ApiMapper.java@@ -84,6 +84,7 @@ public class V1toV2ApiMapper {public V2Request.Builder convert(SolrParams paramsV1) {String[] list = new String[template.variables.size()];MapWriter data = serializeToV2Format(paramsV1, list);+ @SuppressWarnings({"rawtypes"})Map o = data.toMap(new LinkedHashMap<>());return new V2Request.Builder(template.apply(s -> {int idx = template.variables.indexOf(s);diff --git a/solr/solrj/src/java/org/apache/solr/common/IteratorWriter.java b/solr/solrj/src/java/org/apache/solr/common/IteratorWriter.javaindex ec11c786d02..143506d9a70 100644--- a/solr/solrj/src/java/org/apache/solr/common/IteratorWriter.java+++ b/solr/solrj/src/java/org/apache/solr/common/IteratorWriter.java@@ -74,6 +74,7 @@ public interface IteratorWriter {return this;}}+ @SuppressWarnings({"unchecked", "rawtypes"})default List toList( List l) {try {writeIter(new ItemWriter() {diff --git a/solr/solrj/src/java/org/apache/solr/common/MapSerializable.java b/solr/solrj/src/java/org/apache/solr/common/MapSerializable.javaindex 7fadc2ebee1..f56f1b2e1c2 100644--- a/solr/solrj/src/java/org/apache/solr/common/MapSerializable.java+++ b/solr/solrj/src/java/org/apache/solr/common/MapSerializable.java@@ -26,5 +26,6 @@ public interface MapSerializable {* Do not keep a reference to the passed map and reuse it.* it may be reused by the framework*/+ @SuppressWarnings({"rawtypes"})Map toMap(Map<String, Object> map);}diff --git a/solr/solrj/src/java/org/apache/solr/common/MapWriter.java b/solr/solrj/src/java/org/apache/solr/common/MapWriter.javaindex 926cf4c360d..726641023d1 100644--- a/solr/solrj/src/java/org/apache/solr/common/MapWriter.java+++ b/solr/solrj/src/java/org/apache/solr/common/MapWriter.java@@ -40,6 +40,7 @@ public interface MapWriter extends MapSerializable , NavigableObject {}@Override+ @SuppressWarnings({"unchecked", "rawtypes"})default Map toMap(Map<String, Object> map) {try {writeMap(new EntryWriter() {diff --git a/solr/solrj/src/java/org/apache/solr/common/MapWriterMap.java b/solr/solrj/src/java/org/apache/solr/common/MapWriterMap.javaindex f6b978fded7..8b35c9642a3 100644--- a/solr/solrj/src/java/org/apache/solr/common/MapWriterMap.java+++ b/solr/solrj/src/java/org/apache/solr/common/MapWriterMap.java@@ -22,24 +22,28 @@ import java.util.List;import java.util.Map;public class MapWriterMap implements MapWriter {+ @SuppressWarnings({"rawtypes"})private final Map delegate;- public MapWriterMap(Map delegate) {+ public MapWriterMap(@SuppressWarnings({"rawtypes"})Map delegate) {this.delegate = delegate;}@Override+ @SuppressWarnings({"unchecked"})public void writeMap(EntryWriter ew) throws IOException {delegate.forEach(ew.getBiConsumer());}@Override+ @SuppressWarnings({"unchecked"})public Object _get(String path, Object def) {if (path.indexOf('/') == -1) return delegate.getOrDefault(path, def);return MapWriter.super._get(path, def);}@Override+ @SuppressWarnings({"unchecked"})public Object _get(List<String> path, Object def) {if (path.size() == 1) return delegate.getOrDefault(path.get(0), def);return MapWriter.super._get(path, def);@@ -47,6 +51,7 @@ public class MapWriterMap implements MapWriter {@Override+ @SuppressWarnings({"rawtypes"})public Map toMap(Map<String, Object> map) {return delegate;}diff --git a/solr/solrj/src/java/org/apache/solr/common/NavigableObject.java b/solr/solrj/src/java/org/apache/solr/common/NavigableObject.javaindex ccef7e2fc14..22dca2bbe40 100644--- a/solr/solrj/src/java/org/apache/solr/common/NavigableObject.java+++ b/solr/solrj/src/java/org/apache/solr/common/NavigableObject.java@@ -53,20 +53,20 @@ public interface NavigableObject {/**Iterate through the entries of a navigable Object at a certain path* @param path the json path*/- default void _forEachEntry(String path, BiConsumer fun) {+ default void _forEachEntry(String path, @SuppressWarnings({"rawtypes"})BiConsumer fun) {Utils.forEachMapEntry(this, path, fun);}/**Iterate through the entries of a navigable Object at a certain path* @param path the json path*/- default void _forEachEntry(List<String> path, BiConsumer fun) {+ default void _forEachEntry(List<String> path, @SuppressWarnings({"rawtypes"})BiConsumer fun) {Utils.forEachMapEntry(this, path, fun);}/**Iterate through each entry in this object*/- default void _forEachEntry(BiConsumer fun) {+ default void _forEachEntry(@SuppressWarnings({"rawtypes"})BiConsumer fun) {Utils.forEachMapEntry(this, fun);}diff --git a/solr/solrj/src/java/org/apache/solr/common/SolrDocumentBase.java b/solr/solrj/src/java/org/apache/solr/common/SolrDocumentBase.javaindex 21d79a97fd4..d309719febe 100644--- a/solr/solrj/src/java/org/apache/solr/common/SolrDocumentBase.java+++ b/solr/solrj/src/java/org/apache/solr/common/SolrDocumentBase.java@@ -48,6 +48,7 @@ public abstract class SolrDocumentBase<T, K> implements Map<String, T>, Serializ/*** Get a collection of values for a given field name*/+ @SuppressWarnings({"rawtypes"})public abstract Collection getFieldValues(String name);public abstract void addChildDocument(K child);diff --git a/solr/solrj/src/java/org/apache/solr/common/SolrException.java b/solr/solrj/src/java/org/apache/solr/common/SolrException.javaindex 673bae7212a..9909c2b719c 100644--- a/solr/solrj/src/java/org/apache/solr/common/SolrException.java+++ b/solr/solrj/src/java/org/apache/solr/common/SolrException.java@@ -33,7 +33,7 @@ public class SolrException extends RuntimeException {public static final String ROOT_ERROR_CLASS = "root-error-class";public static final String ERROR_CLASS = "error-class";- final private Map mdcContext;+ final private Map<String, String> mdcContext;/*** This list of valid HTTP Status error codes that Solr may return in@@ -160,13 +160,12 @@ public class SolrException extends RuntimeException {}public static void log(Logger log, String msg) {- String stackTrace = msg;- String ignore = doIgnore(null, stackTrace);+ String ignore = doIgnore(null, msg);if (ignore != null) {log.info(ignore);return;}- log.error(stackTrace);+ log.error(msg);}// public String toString() { return toStr(this); } // oops, inf loop@@ -225,8 +224,9 @@ public class SolrException extends RuntimeException {return t;}+ @SuppressWarnings({"unchecked"})public void logInfoWithMdc(Logger logger, String msg) {- Map previousMdcContext = MDC.getCopyOfContextMap();+ Map<String, String> previousMdcContext = MDC.getCopyOfContextMap();MDC.setContextMap(mdcContext);try {logger.info(msg);@@ -236,7 +236,7 @@ public class SolrException extends RuntimeException {}public void logDebugWithMdc(Logger logger, String msg) {- Map previousMdcContext = MDC.getCopyOfContextMap();+ Map<String, String> previousMdcContext = MDC.getCopyOfContextMap();MDC.setContextMap(mdcContext);try {logger.debug(msg);@@ -246,7 +246,7 @@ public class SolrException extends RuntimeException {}public void logWarnWithMdc(Logger logger, String msg) {- Map previousMdcContext = MDC.getCopyOfContextMap();+ Map<String, String> previousMdcContext = MDC.getCopyOfContextMap();MDC.setContextMap(mdcContext);try {logger.warn(msg);diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterProperties.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterProperties.javaindex 96e53718f9c..2f0779cbd06 100644--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterProperties.java+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterProperties.java@@ -108,6 +108,7 @@ public class ClusterProperties {public void setClusterProperties(Map<String, Object> properties) throws IOException, KeeperException, InterruptedException {client.atomicUpdate(ZkStateReader.CLUSTER_PROPS, zkData -> {if (zkData == null) return Utils.toJSON(convertCollectionDefaultsToNestedFormat(properties));+ @SuppressWarnings({"unchecked"})Map<String, Object> zkJson = (Map<String, Object>) Utils.fromJSON(zkData);zkJson = convertCollectionDefaultsToNestedFormat(zkJson);boolean modified = Utils.mergeJson(zkJson, convertCollectionDefaultsToNestedFormat(properties));@@ -122,6 +123,7 @@ public class ClusterProperties {* @param properties the properties to be converted* @return the converted map*/+ @SuppressWarnings({"unchecked"})static Map<String, Object> convertCollectionDefaultsToNestedFormat(Map<String, Object> properties) {if (properties.containsKey(COLLECTION_DEF)) {Map<String, Object> values = (Map<String, Object>) properties.remove(COLLECTION_DEF);@@ -161,6 +163,7 @@ public class ClusterProperties {Stat s = new Stat();try {if (client.exists(ZkStateReader.CLUSTER_PROPS, true)) {+ @SuppressWarnings({"rawtypes"})Map properties = (Map) Utils.fromJSON(client.getData(ZkStateReader.CLUSTER_PROPS, null, s, true));if (propertyValue == null) {//Don't update ZK unless absolutely necessary.@@ -176,6 +179,7 @@ public class ClusterProperties {}}} else {+ @SuppressWarnings({"rawtypes"})Map properties = new LinkedHashMap();properties.put(propertyName, propertyValue);client.create(ZkStateReader.CLUSTER_PROPS, Utils.toJSON(properties), CreateMode.PERSISTENT, true);diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZooKeeper.java b/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZooKeeper.javaindex a60a2759e90..62288c82aca 100644--- a/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZooKeeper.java+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZooKeeper.java@@ -32,6 +32,7 @@ import org.apache.zookeeper.Watcher;import org.apache.zookeeper.ZooKeeper;// we use this class to expose nasty stuff for tests+@SuppressWarnings({"try"})public class SolrZooKeeper extends ZooKeeper {final Set<Thread> spawnedThreads = new CopyOnWriteArraySet<>();diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.javaindex ae28149146a..4065d3c0d48 100644--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java@@ -243,6 +243,7 @@ public class ZkStateReader implements SolrCloseable {* @return current configuration from <code>autoscaling.json</code>. NOTE:* this data is retrieved from ZK on each call.*/+ @SuppressWarnings({"unchecked"})public AutoScalingConfig getAutoScalingConfig(Watcher watcher) throws KeeperException, InterruptedException {Stat stat = new Stat();@@ -487,6 +488,7 @@ public class ZkStateReader implements SolrCloseable {return collection.getZNodeVersion();}+ @SuppressWarnings({"unchecked"})public synchronized void createClusterStateWatchersAndUpdate() throws KeeperException,InterruptedException {// We need to fetch the current cluster state and the set of live nodes@@ -1085,6 +1087,7 @@ public class ZkStateReader implements SolrCloseable {* @param defaultValue a default value to use if no such property exists* @return the cluster property, or a default if the property is not set*/+ @SuppressWarnings({"unchecked"})public <T> T getClusterProperty(List<String> keyPath, T defaultValue) {T value = (T) Utils.getObjectByPath(clusterProperties, false, keyPath);if (value == null)@@ -1256,6 +1259,7 @@ public class ZkStateReader implements SolrCloseable {* Returns the content of /security.json from ZooKeeper as a Map* If the files doesn't exist, it returns null.*/+ @SuppressWarnings({"unchecked"})public ConfigData getSecurityProps(boolean getFresh) {if (!getFresh) {if (securityData == null) return new ConfigData(EMPTY_MAP, -1);diff --git a/solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java b/solr/solrj/src/java/org/apache/solr/common/params/SolrParams.javaindex 08022b2e4de..c729534ba40 100644--- a/solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java+++ b/solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java@@ -458,7 +458,7 @@ public abstract class SolrParams implements Serializable, MapWriter, Iterable<Ma/** Create a Map<String,String> from a NamedList given no keys are repeated */@Deprecated // Doesn't belong here (no SolrParams). Just remove.- public static Map<String,String> toMap(NamedList params) {+ public static Map<String,String> toMap(@SuppressWarnings({"rawtypes"})NamedList params) {HashMap<String,String> map = new HashMap<>();for (int i=0; i<params.size(); i++) {map.put(params.getName(i), params.getVal(i).toString());@@ -468,7 +468,7 @@ public abstract class SolrParams implements Serializable, MapWriter, Iterable<Ma/** Create a Map<String,String[]> from a NamedList */@Deprecated // Doesn't belong here (no SolrParams). Just remove.- public static Map<String,String[]> toMultiMap(NamedList params) {+ public static Map<String,String[]> toMultiMap(@SuppressWarnings({"rawtypes"})NamedList params) {HashMap<String,String[]> map = new HashMap<>();for (int i=0; i<params.size(); i++) {String name = params.getName(i);@@ -476,6 +476,7 @@ public abstract class SolrParams implements Serializable, MapWriter, Iterable<Maif (val instanceof String[]) {MultiMapSolrParams.addParam(name, (String[]) val, map);} else if (val instanceof List) {+ @SuppressWarnings({"rawtypes"})List l = (List) val;String[] s = new String[l.size()];for (int j = 0; j < l.size(); j++) {@@ -494,7 +495,7 @@ public abstract class SolrParams implements Serializable, MapWriter, Iterable<Ma* @deprecated Use {@link NamedList#toSolrParams()}.*/@Deprecated //move to NamedList to allow easier flow- public static SolrParams toSolrParams(NamedList params) {+ public static SolrParams toSolrParams(@SuppressWarnings({"rawtypes"})NamedList params) {return params.toSolrParams();}diff --git a/solr/solrj/src/java/org/apache/solr/common/util/ByteArrayUtf8CharSequence.java b/solr/solrj/src/java/org/apache/solr/common/util/ByteArrayUtf8CharSequence.javaindex 7a4abe2c303..0a65b0d62f2 100644--- a/solr/solrj/src/java/org/apache/solr/common/util/ByteArrayUtf8CharSequence.java+++ b/solr/solrj/src/java/org/apache/solr/common/util/ByteArrayUtf8CharSequence.java@@ -180,6 +180,7 @@ public class ByteArrayUtf8CharSequence implements Utf8CharSequence {return new ByteArrayUtf8CharSequence(bytes, 0, length, utf16, hashCode);}+ @SuppressWarnings({"unchecked", "rawtypes"})public static Map.Entry convertCharSeq(Map.Entry e) {if (e.getKey() instanceof Utf8CharSequence || e.getValue() instanceof Utf8CharSequence) {return new AbstractMap.SimpleEntry(convertCharSeq(e.getKey()), convertCharSeq(e.getValue()));@@ -188,6 +189,7 @@ public class ByteArrayUtf8CharSequence implements Utf8CharSequence {}+ @SuppressWarnings({"unchecked", "rawtypes"})public static Collection convertCharSeq(Collection vals) {if (vals == null) return vals;boolean needsCopy = false;@@ -200,9 +202,9 @@ public class ByteArrayUtf8CharSequence implements Utf8CharSequence {if (needsCopy) {Collection copy = null;if (vals instanceof Set){- copy = new HashSet(vals.size());+ copy = new HashSet<>(vals.size());} else {- copy = new ArrayList(vals.size());+ copy = new ArrayList<>(vals.size());}for (Object o : vals) copy.add(convertCharSeq(o));return copy;diff --git a/solr/solrj/src/java/org/apache/solr/common/util/FastJavaBinDecoder.java b/solr/solrj/src/java/org/apache/solr/common/util/FastJavaBinDecoder.javaindex 84c35bd21d9..c5ebd06f664 100644--- a/solr/solrj/src/java/org/apache/solr/common/util/FastJavaBinDecoder.java+++ b/solr/solrj/src/java/org/apache/solr/common/util/FastJavaBinDecoder.java@@ -472,9 +472,11 @@ public class FastJavaBinDecoder implements DataEntry.FastDecoder {}@Override+ @SuppressWarnings({"unchecked"})public Object readObject(StreamCodec codec, EntryImpl entry) throws IOException {SolrDocumentList solrDocs = new SolrDocumentList();if(entry.metadata != null){+ @SuppressWarnings({"rawtypes"})List list = (List) entry.metadata;solrDocs.setNumFound((Long) list.get(0));solrDocs.setStart((Long) list.get(1));@@ -779,6 +781,7 @@ public class FastJavaBinDecoder implements DataEntry.FastDecoder {}}+ @SuppressWarnings({"unchecked", "rawtypes"})private static void addObj(DataEntry e) {if (e.type().isContainer) {Object ctx = e.type() == DataEntry.Type.KEYVAL_ITER ?diff --git a/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java b/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.javaindex bd86db91ab2..fb45e883fe3 100644--- a/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java+++ b/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java@@ -351,6 +351,7 @@ public class JavaBinCodec implements PushWriter {throw new RuntimeException("Unknown type " + tagByte);}+ @SuppressWarnings({"unchecked", "rawtypes"})public boolean writeKnownType(Object val) throws IOException {if (writePrimitive(val)) return true;if (val instanceof NamedList) {@@ -752,7 +753,7 @@ public class JavaBinCodec implements PushWriter {val.writeIter(itemWriter);writeTag(END);}- public void writeIterator(Iterator iter) throws IOException {+ public void writeIterator(@SuppressWarnings({"rawtypes"})Iterator iter) throws IOException {writeTag(ITERATOR);while (iter.hasNext()) {writeVal(iter.next());@@ -770,14 +771,14 @@ public class JavaBinCodec implements PushWriter {return l;}- public void writeArray(List l) throws IOException {+ public void writeArray(@SuppressWarnings({"rawtypes"})List l) throws IOException {writeTag(ARR, l.size());for (int i = 0; i < l.size(); i++) {writeVal(l.get(i));}}- public void writeArray(Collection coll) throws IOException {+ public void writeArray(@SuppressWarnings({"rawtypes"})Collection coll) throws IOException {writeTag(ARR, coll.size());for (Object o : coll) {writeVal(o);@@ -793,11 +794,13 @@ public class JavaBinCodec implements PushWriter {}}+ @SuppressWarnings({"unchecked"})public List<Object> readArray(DataInputInputStream dis) throws IOException {int sz = readSize(dis);return readArray(dis, sz);}+ @SuppressWarnings({"rawtypes"})protected List readArray(DataInputInputStream dis, int sz) throws IOException {ArrayList<Object> l = new ArrayList<>(sz);for (int i = 0; i < sz; i++) {@@ -816,7 +819,7 @@ public class JavaBinCodec implements PushWriter {writeStr(enumFieldValue.toString());}- public void writeMapEntry(Map.Entry val) throws IOException {+ public void writeMapEntry(Map.Entry<?,?> val) throws IOException {writeTag(MAP_ENTRY);writeVal(val.getKey());writeVal(val.getValue());diff --git a/solr/solrj/src/java/org/apache/solr/common/util/JsonSchemaValidator.java b/solr/solrj/src/java/org/apache/solr/common/util/JsonSchemaValidator.javaindex b1fcc914342..178503e990c 100644--- a/solr/solrj/src/java/org/apache/solr/common/util/JsonSchemaValidator.java+++ b/solr/solrj/src/java/org/apache/solr/common/util/JsonSchemaValidator.java@@ -34,17 +34,21 @@ import java.util.function.Function;* It validates most aspects of json schema but it is NOT A FULLY COMPLIANT JSON schema parser or validator.* This validator borrow some design's idea from https://github.com/networknt/json-schema-validator*/+@SuppressWarnings({"unchecked"})public class JsonSchemaValidator {+ @SuppressWarnings({"unchecked", "rawtypes"})private List<Validator> validators;private static Set<String> KNOWN_FNAMES = new HashSet<>(Arrays.asList("description","documentation","default","additionalProperties"));+ @SuppressWarnings({"rawtypes"})public JsonSchemaValidator(String jsonString) {this((Map) Utils.fromJSONString(jsonString));}+ @SuppressWarnings({"rawtypes"})public JsonSchemaValidator(Map jsonSchema) {this.validators = new LinkedList<>();for (Object fname : jsonSchema.keySet()) {@@ -57,6 +61,7 @@ public class JsonSchemaValidator {}}+ @SuppressWarnings({"rawtypes"})static final Map<String, Function<Pair<Map,Object>, Validator>> VALIDATORS = new HashMap<>();static {@@ -74,6 +79,7 @@ public class JsonSchemaValidator {return errs.isEmpty() ? null : errs;}+ @SuppressWarnings({"unchecked", "rawtypes"})boolean validate(Object data, List<String> errs) {if (data == null) return true;for (Validator validator : validators) {@@ -88,7 +94,7 @@ public class JsonSchemaValidator {abstract class Validator<T> {@SuppressWarnings("unused")- Validator(Map schema, T properties) {};+ Validator(@SuppressWarnings({"rawtypes"})Map schema, T properties) {};abstract boolean validate(Object o, List<String> errs);}@@ -127,9 +133,10 @@ enum Type {NULL(null),UNKNOWN(Object.class);+ @SuppressWarnings({"rawtypes"})Class type;- Type(Class type) {+ Type(@SuppressWarnings({"rawtypes"})Class type) {this.type = type;}@@ -142,7 +149,7 @@ enum Type {class TypeValidator extends Validator<Object> {private Set<Type> types;- TypeValidator(Map schema, Object type) {+ TypeValidator(@SuppressWarnings({"rawtypes"})Map schema, Object type) {super(schema, type);types = new HashSet<>(1);if (type instanceof List) {@@ -172,9 +179,10 @@ class TypeValidator extends Validator<Object> {}}+@SuppressWarnings({"rawtypes"})class ItemsValidator extends Validator<Map> {private JsonSchemaValidator validator;- ItemsValidator(Map schema, Map properties) {+ ItemsValidator(@SuppressWarnings({"rawtypes"})Map schema, @SuppressWarnings({"rawtypes"})Map properties) {super(schema, properties);validator = new JsonSchemaValidator(properties);}@@ -198,7 +206,7 @@ class EnumValidator extends Validator<List<String>> {private Set<String> enumVals;- EnumValidator(Map schema, List<String> properties) {+ EnumValidator(@SuppressWarnings({"rawtypes"})Map schema, List<String> properties) {super(schema, properties);enumVals = new HashSet<>(properties);@@ -221,7 +229,7 @@ class RequiredValidator extends Validator<List<String>> {private Set<String> requiredProps;- RequiredValidator(Map schema, List<String> requiredProps) {+ RequiredValidator(@SuppressWarnings({"rawtypes"})Map schema, List<String> requiredProps) {super(schema, requiredProps);this.requiredProps = new HashSet<>(requiredProps);}@@ -233,6 +241,7 @@ class RequiredValidator extends Validator<List<String>> {boolean validate( Object o, List<String> errs, Set<String> requiredProps) {if (o instanceof Map) {+ @SuppressWarnings({"rawtypes"})Set fnames = ((Map) o).keySet();for (String requiredProp : requiredProps) {if (requiredProp.contains(".")) {@@ -257,10 +266,12 @@ class RequiredValidator extends Validator<List<String>> {}}+@SuppressWarnings({"rawtypes"})class PropertiesValidator extends Validator<Map<String, Map>> {private Map<String, JsonSchemaValidator> jsonSchemas;private boolean additionalProperties;+ @SuppressWarnings({"unchecked", "rawtypes"})PropertiesValidator(Map schema, Map<String, Map> properties) {super(schema, properties);jsonSchemas = new HashMap<>();@@ -273,6 +284,7 @@ class PropertiesValidator extends Validator<Map<String, Map>> {@Overrideboolean validate(Object o, List<String> errs) {if (o instanceof Map) {+ @SuppressWarnings({"rawtypes"})Map map = (Map) o;for (Object key : map.keySet()) {JsonSchemaValidator jsonSchema = jsonSchemas.get(key.toString());@@ -294,7 +306,7 @@ class OneOfValidator extends Validator<List<String>> {private Set<String> oneOfProps;- OneOfValidator(Map schema, List<String> oneOfProps) {+ OneOfValidator(@SuppressWarnings({"rawtypes"})Map schema, List<String> oneOfProps) {super(schema, oneOfProps);this.oneOfProps = new HashSet<>(oneOfProps);}@@ -302,6 +314,7 @@ class OneOfValidator extends Validator<List<String>> {@Overrideboolean validate(Object o, List<String> errs) {if (o instanceof Map) {+ @SuppressWarnings({"rawtypes"})Map map = (Map) o;for (Object key : map.keySet()) {if (oneOfProps.contains(key.toString())) return true;diff --git a/solr/solrj/src/java/org/apache/solr/common/util/JsonTextWriter.java b/solr/solrj/src/java/org/apache/solr/common/util/JsonTextWriter.javaindex ed8c79776f0..ec472ad79eb 100644--- a/solr/solrj/src/java/org/apache/solr/common/util/JsonTextWriter.java+++ b/solr/solrj/src/java/org/apache/solr/common/util/JsonTextWriter.java@@ -186,7 +186,7 @@ public interface JsonTextWriter extends TextWriter {_writeChar(':');}- default void writeJsonIter(Iterator val) throws IOException {+ default void writeJsonIter(@SuppressWarnings({"rawtypes"})Iterator val) throws IOException {incLevel();boolean first = true;while (val.hasNext()) {@@ -233,6 +233,7 @@ public interface JsonTextWriter extends TextWriter {}+ @SuppressWarnings({"unchecked", "rawtypes"})default void writeMap(String name, Map val, boolean excludeOuter, boolean isFirstVal) throws IOException {if (!excludeOuter) {writeMapOpener(val.size());@@ -265,13 +266,13 @@ public interface JsonTextWriter extends TextWriter {}- default void writeArray(String name, List l) throws IOException {+ default void writeArray(String name, @SuppressWarnings({"rawtypes"})List l) throws IOException {writeArrayOpener(l.size());writeJsonIter(l.iterator());writeArrayCloser();}- default void writeArray(String name, Iterator val) throws IOException {+ default void writeArray(String name, @SuppressWarnings({"rawtypes"})Iterator val) throws IOException {writeArrayOpener(-1); // no trivial way to determine array sizewriteJsonIter(val);writeArrayCloser();@@ -286,7 +287,7 @@ public interface JsonTextWriter extends TextWriter {out.append(hexdigits[(ch) & 0xf]);}- default void writeNamedList(String name, NamedList val) throws IOException {+ default void writeNamedList(String name, @SuppressWarnings({"rawtypes"})NamedList val) throws IOException {String namedListStyle = getNamedListStyle();if (val instanceof SimpleOrderedMap) {writeNamedListAsMapWithDups(name, val);@@ -309,7 +310,7 @@ public interface JsonTextWriter extends TextWriter {* Map null to "" and name mangle any repeated keys to avoid repeats in the* output.*/- default void writeNamedListAsMapMangled(String name, NamedList val) throws IOException {+ default void writeNamedListAsMapMangled(String name, @SuppressWarnings({"rawtypes"})NamedList val) throws IOException {int sz = val.size();writeMapOpener(sz);incLevel();@@ -369,7 +370,7 @@ public interface JsonTextWriter extends TextWriter {* null key is mapped to "".*/// NamedList("a"=1,"bar"="foo",null=3,null=null) => {"a":1,"bar":"foo","":3,"":null}- default void writeNamedListAsMapWithDups(String name, NamedList val) throws IOException {+ default void writeNamedListAsMapWithDups(String name, @SuppressWarnings({"rawtypes"})NamedList val) throws IOException {int sz = val.size();writeMapOpener(sz);incLevel();@@ -392,7 +393,7 @@ public interface JsonTextWriter extends TextWriter {// Represents a NamedList directly as an array of JSON objects...// NamedList("a"=1,"b"=2,null=3,null=null) => [{"a":1},{"b":2},3,null]- default void writeNamedListAsArrMap(String name, NamedList val) throws IOException {+ default void writeNamedListAsArrMap(String name, @SuppressWarnings({"rawtypes"})NamedList val) throws IOException {int sz = val.size();indent();writeArrayOpener(sz);@@ -427,7 +428,7 @@ public interface JsonTextWriter extends TextWriter {// Represents a NamedList directly as an array of JSON objects...// NamedList("a"=1,"b"=2,null=3,null=null) => [["a",1],["b",2],[null,3],[null,null]]- default void writeNamedListAsArrArr(String name, NamedList val) throws IOException {+ default void writeNamedListAsArrArr(String name, @SuppressWarnings({"rawtypes"})NamedList val) throws IOException {int sz = val.size();indent();writeArrayOpener(sz);@@ -471,7 +472,7 @@ public interface JsonTextWriter extends TextWriter {// Represents a NamedList directly as an array with keys/values// interleaved.// NamedList("a"=1,"b"=2,null=3,null=null) => ["a",1,"b",2,null,3,null,null]- default void writeNamedListAsFlat(String name, NamedList val) throws IOException {+ default void writeNamedListAsFlat(String name, @SuppressWarnings({"rawtypes"})NamedList val) throws IOException {int sz = val.size();writeArrayOpener(sz * 2);incLevel();diff --git a/solr/solrj/src/java/org/apache/solr/common/util/NamedList.java b/solr/solrj/src/java/org/apache/solr/common/util/NamedList.javaindex fbc11dfcb00..f456e353633 100644--- a/solr/solrj/src/java/org/apache/solr/common/util/NamedList.java+++ b/solr/solrj/src/java/org/apache/solr/common/util/NamedList.java@@ -62,6 +62,7 @@ import org.apache.solr.common.params.SolrParams;* </p>**/+@SuppressWarnings({"unchecked", "rawtypes"})public class NamedList<T> implements Cloneable, Serializable, Iterable<Map.Entry<String,T>> , MapWriter {private static final long serialVersionUID = 1957981902839867821L;@@ -467,9 +468,11 @@ public class NamedList<T> implements Cloneable, Serializable, Iterable<Map.Entry}@Override+ @SuppressWarnings({"unchecked"})public void putAll(Map m) {boolean isEmpty = isEmpty();for (Object o : m.entrySet()) {+ @SuppressWarnings({"rawtypes"})Map.Entry e = (Entry) o;if (isEmpty) {// we know that there are no duplicatesadd((String) e.getKey(), (T) e.getValue());@@ -485,12 +488,14 @@ public class NamedList<T> implements Cloneable, Serializable, Iterable<Map.Entry}@Override+ @SuppressWarnings({"unchecked"})public Set<String> keySet() {//TODO implement more efficientlyreturn NamedList.this.asMap(1).keySet();}@Override+ @SuppressWarnings({"unchecked", "rawtypes"})public Collection values() {//TODO implement more efficientlyreturn NamedList.this.asMap(1).values();@@ -795,7 +800,6 @@ public class NamedList<T> implements Cloneable, Serializable, Iterable<Map.Entry* If values are found for the input key that are not strings or* arrays of strings.*/- @SuppressWarnings("rawtypes")public Collection<String> removeConfigArgs(final String name)throws SolrException {List<T> objects = getAll(name);diff --git a/solr/solrj/src/java/org/apache/solr/common/util/Pair.java b/solr/solrj/src/java/org/apache/solr/common/util/Pair.javaindex 74f5b2d6ff7..05b09e850b8 100644--- a/solr/solrj/src/java/org/apache/solr/common/util/Pair.java+++ b/solr/solrj/src/java/org/apache/solr/common/util/Pair.java@@ -66,6 +66,7 @@ public class Pair<T1, T2> implements Serializable, MapWriter {ew.put("second", second);}+ @SuppressWarnings({"unchecked", "rawtypes"})public static Pair parse(Map m) {return new Pair(m.get("first"), m.get("second"));}diff --git a/solr/solrj/src/java/org/apache/solr/common/util/TextWriter.java b/solr/solrj/src/java/org/apache/solr/common/util/TextWriter.javaindex 6aa58c6a8fa..bb3975628f6 100644--- a/solr/solrj/src/java/org/apache/solr/common/util/TextWriter.java+++ b/solr/solrj/src/java/org/apache/solr/common/util/TextWriter.java@@ -93,9 +93,9 @@ public interface TextWriter extends PushWriter {void writeStr(String name, String val, boolean needsEscaping) throws IOException;- void writeMap(String name, Map val, boolean excludeOuter, boolean isFirstVal) throws IOException;+ void writeMap(String name, @SuppressWarnings({"rawtypes"})Map val, boolean excludeOuter, boolean isFirstVal) throws IOException;- void writeArray(String name, Iterator val) throws IOException;+ void writeArray(String name, @SuppressWarnings({"rawtypes"})Iterator val) throws IOException;void writeNull(String name) throws IOException;@@ -121,7 +121,7 @@ public interface TextWriter extends PushWriter {/** if this form of the method is called, val is the Solr ISO8601 based date format */void writeDate(String name, String val) throws IOException;- void writeNamedList(String name, NamedList val) throws IOException;+ void writeNamedList(String name, @SuppressWarnings({"rawtypes"})NamedList val) throws IOException;Writer getWriter();@@ -154,7 +154,7 @@ public interface TextWriter extends PushWriter {writeArray(name, Arrays.asList(val));}- default void writeArray(String name, List l) throws IOException {+ default void writeArray(String name, @SuppressWarnings({"rawtypes"})List l) throws IOException {writeArray(name, l.iterator());}diff --git a/solr/solrj/src/java/org/apache/solr/common/util/Utils.java b/solr/solrj/src/java/org/apache/solr/common/util/Utils.javaindex e32a4265f70..229417a969d 100644--- a/solr/solrj/src/java/org/apache/solr/common/util/Utils.java+++ b/solr/solrj/src/java/org/apache/solr/common/util/Utils.java@@ -89,30 +89,39 @@ import static java.util.Collections.unmodifiableSet;import static java.util.concurrent.TimeUnit.NANOSECONDS;public class Utils {+ @SuppressWarnings({"rawtypes"})public static final Function NEW_HASHMAP_FUN = o -> new HashMap<>();+ @SuppressWarnings({"rawtypes"})public static final Function NEW_LINKED_HASHMAP_FUN = o -> new LinkedHashMap<>();+ @SuppressWarnings({"rawtypes"})public static final Function NEW_ATOMICLONG_FUN = o -> new AtomicLong();+ @SuppressWarnings({"rawtypes"})public static final Function NEW_ARRAYLIST_FUN = o -> new ArrayList<>();+ @SuppressWarnings({"rawtypes"})public static final Function NEW_SYNCHRONIZED_ARRAYLIST_FUN = o -> Collections.synchronizedList(new ArrayList<>());+ @SuppressWarnings({"rawtypes"})public static final Function NEW_HASHSET_FUN = o -> new HashSet<>();private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());+ @SuppressWarnings({"rawtypes"})public static Map getDeepCopy(Map map, int maxDepth) {return getDeepCopy(map, maxDepth, true, false);}+ @SuppressWarnings({"rawtypes"})public static Map getDeepCopy(Map map, int maxDepth, boolean mutable) {return getDeepCopy(map, maxDepth, mutable, false);}+ @SuppressWarnings({"unchecked", "rawtypes"})public static Map getDeepCopy(Map map, int maxDepth, boolean mutable, boolean sorted) {if (map == null) return null;if (maxDepth < 1) return map;Map copy;if (sorted) {- copy = new TreeMap();+ copy = new TreeMap<>();} else {- copy = map instanceof LinkedHashMap ? new LinkedHashMap(map.size()) : new HashMap(map.size());+ copy = map instanceof LinkedHashMap ? new LinkedHashMap<>(map.size()) : new HashMap<>(map.size());}for (Object o : map.entrySet()) {Map.Entry e = (Map.Entry) o;@@ -121,17 +130,18 @@ public class Utils {return mutable ? copy : Collections.unmodifiableMap(copy);}- public static void forEachMapEntry(Object o, String path, BiConsumer fun) {+ public static void forEachMapEntry(Object o, String path, @SuppressWarnings({"rawtypes"})BiConsumer fun) {Object val = Utils.getObjectByPath(o, false, path);forEachMapEntry(val, fun);}- public static void forEachMapEntry(Object o, List<String> path, BiConsumer fun) {+ public static void forEachMapEntry(Object o, List<String> path, @SuppressWarnings({"rawtypes"})BiConsumer fun) {Object val = Utils.getObjectByPath(o, false, path);forEachMapEntry(val, fun);}- public static void forEachMapEntry(Object o, BiConsumer fun) {+ @SuppressWarnings({"unchecked"})+ public static void forEachMapEntry(Object o, @SuppressWarnings({"rawtypes"})BiConsumer fun) {if (o instanceof MapWriter) {MapWriter m = (MapWriter) o;try {@@ -150,6 +160,7 @@ public class Utils {}}+ @SuppressWarnings({"unchecked", "rawtypes"})private static Object makeDeepCopy(Object v, int maxDepth, boolean mutable, boolean sorted) {if (v instanceof MapWriter && maxDepth > 1) {v = ((MapWriter) v).toMap(new LinkedHashMap<>());@@ -182,10 +193,12 @@ public class Utils {}}+ @SuppressWarnings({"rawtypes"})public static Collection getDeepCopy(Collection c, int maxDepth, boolean mutable) {return getDeepCopy(c, maxDepth, mutable, false);}+ @SuppressWarnings({"unchecked", "rawtypes"})public static Collection getDeepCopy(Collection c, int maxDepth, boolean mutable, boolean sorted) {if (c == null || maxDepth < 1) return c;Collection result = c instanceof Set ?@@ -217,6 +230,7 @@ public class Utils {}@Override+ @SuppressWarnings({"unchecked", "rawtypes"})public void handleUnknownClass(Object o) {if (o instanceof MapWriter) {Map m = ((MapWriter) o).toMap(new LinkedHashMap<>());@@ -313,7 +327,7 @@ public class Utils {return new ObjectBuilder(jsonParser) {@Overridepublic Object newObject() {- return new LinkedHashMapWriter();+ return new LinkedHashMapWriter<>();}};} catch (IOException e) {@@ -326,7 +340,7 @@ public class Utils {return new ObjectBuilder(jsonParser) {@Overridepublic Object newObject() {- return new HashMap();+ return new HashMap<>();}};} catch (IOException e) {@@ -384,11 +398,13 @@ public class Utils {return getObjectByPath(root, onlyPrimitive, parts);}+ @SuppressWarnings({"unchecked"})public static boolean setObjectByPath(Object root, String hierarchy, Object value) {List<String> parts = StrUtils.splitSmart(hierarchy, '/', true);return setObjectByPath(root, parts, value);}+ @SuppressWarnings({"unchecked"})public static boolean setObjectByPath(Object root, List<String> hierarchy, Object value) {if (root == null) return false;if (!isMapLike(root)) throw new RuntimeException("must be a Map or NamedList");@@ -407,6 +423,7 @@ public class Utils {Object o = getVal(obj, s, -1);if (o == null) return false;if (idx > -1) {+ @SuppressWarnings({"rawtypes"})List l = (List) o;o = idx < l.size() ? l.get(idx) : null;}@@ -415,6 +432,7 @@ public class Utils {} else {if (idx == -2) {if (obj instanceof NamedList) {+ @SuppressWarnings({"rawtypes"})NamedList namedList = (NamedList) obj;int location = namedList.indexOf(s, 0);if (location == -1) namedList.add(s, value);@@ -426,6 +444,7 @@ public class Utils {} else {Object v = getVal(obj, s, -1);if (v instanceof List) {+ @SuppressWarnings({"rawtypes"})List list = (List) v;if (idx == -1) {list.add(value);@@ -469,6 +488,7 @@ public class Utils {} else if (o instanceof Map) {o = getVal(new MapWriterMap((Map) o), null, idx);} else {+ @SuppressWarnings({"rawtypes"})List l = (List) o;o = idx < l.size() ? l.get(idx) : null;}@@ -482,6 +502,7 @@ public class Utils {if (val instanceof IteratorWriter) {val = getValueAt((IteratorWriter) val, idx);} else {+ @SuppressWarnings({"rawtypes"})List l = (List) val;val = idx < l.size() ? l.get(idx) : null;}@@ -535,6 +556,7 @@ public class Utils {return o instanceof Map || o instanceof NamedList || o instanceof MapWriter;}+ @SuppressWarnings({"unchecked", "rawtypes"})private static Object getVal(Object obj, String key, int idx) {if (obj instanceof MapWriter) {Object[] result = new Object[1];@@ -595,6 +617,7 @@ public class Utils {}}+ @SuppressWarnings({"unchecked"})public static Map<String, Object> getJson(DistribStateManager distribStateManager, String path) throws InterruptedException, IOException, KeeperException {VersionedData data = null;try {@@ -614,6 +637,7 @@ public class Utils {* @param retryOnConnLoss whether to retry the operation automatically on connection loss, see {@link org.apache.solr.common.cloud.ZkCmdExecutor#retryOperation(ZkOperation)}* @return a Map if the node exists and contains valid JSON or an empty map if znode does not exist or has a null data*/+ @SuppressWarnings({"unchecked"})public static Map<String, Object> getJson(SolrZkClient zkClient, String path, boolean retryOnConnLoss) throws KeeperException, InterruptedException {try {byte[] bytes = zkClient.getData(path, null, null, retryOnConnLoss);@@ -663,6 +687,7 @@ public class Utils {* @param input the json with new values* @return whether there was any change made to sink or not.*/+ @SuppressWarnings({"unchecked", "rawtypes"})public static boolean mergeJson(Map<String, Object> sink, Map<String, Object> input) {boolean isModified = false;for (Map.Entry<String, Object> e : input.entrySet()) {diff --git a/solr/solrj/src/java/org/apache/solr/common/util/ValidatingJsonMap.java b/solr/solrj/src/java/org/apache/solr/common/util/ValidatingJsonMap.javaindex b5375365fea..4d76d52b248 100644--- a/solr/solrj/src/java/org/apache/solr/common/util/ValidatingJsonMap.java+++ b/solr/solrj/src/java/org/apache/solr/common/util/ValidatingJsonMap.java@@ -48,6 +48,7 @@ public class ValidatingJsonMap implements Map<String, Object>, NavigableObject {if (o == null) return " Must not be NULL";return null;};+ @SuppressWarnings({"rawtypes"})public static final PredicateWithErrMsg<Pair> ENUM_OF = pair -> {if (pair.second() instanceof Set) {Set set = (Set) pair.second();@@ -141,7 +142,8 @@ public class ValidatingJsonMap implements Map<String, Object>, NavigableObject {return delegate.entrySet();}- public Object get(String key, PredicateWithErrMsg predicate) {+ @SuppressWarnings({"unchecked"})+ public Object get(String key, @SuppressWarnings({"rawtypes"})PredicateWithErrMsg predicate) {Object v = get(key);if (predicate != null) {String msg = predicate.test(v);@@ -178,11 +180,12 @@ public class ValidatingJsonMap implements Map<String, Object>, NavigableObject {return getMap(key, null, null);}- public ValidatingJsonMap getMap(String key, PredicateWithErrMsg predicate) {+ public ValidatingJsonMap getMap(String key, @SuppressWarnings({"rawtypes"})PredicateWithErrMsg predicate) {return getMap(key, predicate, null);}+ @SuppressWarnings({"unchecked", "rawtypes"})public ValidatingJsonMap getMap(String key, PredicateWithErrMsg predicate, String message) {Object v = get(key);if (v != null && !(v instanceof Map)) {@@ -199,10 +202,12 @@ public class ValidatingJsonMap implements Map<String, Object>, NavigableObject {return wrap((Map) v);}+ @SuppressWarnings({"rawtypes"})public List getList(String key, PredicateWithErrMsg predicate) {return getList(key, predicate, null);}+ @SuppressWarnings({"unchecked", "rawtypes"})public List getList(String key, PredicateWithErrMsg predicate, Object test) {Object v = get(key);if (v != null && !(v instanceof List)) {@@ -219,6 +224,7 @@ public class ValidatingJsonMap implements Map<String, Object>, NavigableObject {return (List) v;}+ @SuppressWarnings({"unchecked", "rawtypes"})public Object get(String key, PredicateWithErrMsg<Pair> predicate, Object arg) {Object v = get(key);String test = predicate.test(new Pair(v, arg));@@ -279,6 +285,7 @@ public class ValidatingJsonMap implements Map<String, Object>, NavigableObject {}}+ @SuppressWarnings({"unchecked", "rawtypes"})public static ValidatingJsonMap getDeepCopy(Map map, int maxDepth, boolean mutable) {if (map == null) return null;if (maxDepth < 1) return ValidatingJsonMap.wrap(map);@@ -293,6 +300,7 @@ public class ValidatingJsonMap implements Map<String, Object>, NavigableObject {return mutable ? copy : new ValidatingJsonMap(Collections.unmodifiableMap(copy));}+ @SuppressWarnings({"unchecked", "rawtypes"})public static Collection getDeepCopy(Collection c, int maxDepth, boolean mutable) {if (c == null || maxDepth < 1) return c;Collection result = c instanceof Set ? new HashSet() : new ArrayList();@@ -339,6 +347,7 @@ public class ValidatingJsonMap implements Map<String, Object>, NavigableObject {return that instanceof Map && this.delegate.equals(that);}+ @SuppressWarnings({"unchecked"})public static final ValidatingJsonMap EMPTY = new ValidatingJsonMap(Collections.EMPTY_MAP);public interface PredicateWithErrMsg<T> {