Github user srdo commented on a diff in the pull request:
https://github.com/apache/storm/pull/2583#discussion_r172011662
--- Diff: storm-client/src/jvm/org/apache/storm/utils/Utils.java ---
@@ -1030,8 +1034,34 @@ private static Object normalizeConfValue(Object obj)
{
return ret;
}
- public static boolean isValidConf(Map<String, Object> topoConf) {
- return normalizeConf(topoConf).equals(normalizeConf((Map<String,
Object>) JSONValue.parse(JSONValue.toJSONString(topoConf))));
+ @SuppressWarnings("unchecked")
+ public static boolean isValidConf(Map<String, Object> topoConfIn) {
+ Map<String, Object> origTopoConf = normalizeConf(topoConfIn);
+ Map<String, Object> deserTopoConf = normalizeConf(
+ (Map<String, Object>)
JSONValue.parse(JSONValue.toJSONString(topoConfIn)));
+ return confMapDiff(origTopoConf, deserTopoConf);
+ }
+
+ @VisibleForTesting
+ static boolean confMapDiff(Map<String, Object> orig, Map<String,
Object> deser) {
--- End diff --
Nitpick: Consider renaming to something like "checkMapEquality", since this
method checks map equality and returns a boolean indicating equality.
---