diff --git a/APIJSONORM/src/main/java/apijson/orm/AbstractParser.java b/APIJSONORM/src/main/java/apijson/orm/AbstractParser.java index 9fb17ee05..b45619369 100755 --- a/APIJSONORM/src/main/java/apijson/orm/AbstractParser.java +++ b/APIJSONORM/src/main/java/apijson/orm/AbstractParser.java @@ -1392,10 +1392,10 @@ public Object getValueByPath(String valuePath) { } //取出key被valuePath包含的result,再从里面获取key对应的value - Set set = queryResultMap.keySet(); JSONObject parent = null; String[] keys = null; - for (String path : set) { + for (Map.Entry entry : queryResultMap.entrySet()){ + String path = entry.getKey(); if (valuePath.startsWith(path + "/")) { try { parent = (JSONObject) queryResultMap.get(path); diff --git a/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java b/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java index 6defdd1e1..bdbadc864 100755 --- a/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java +++ b/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java @@ -1341,16 +1341,17 @@ public Object getWhere(String key, boolean exactMatch) { return where == null ? null : where.get(key); } - Set set = key == null || where == null ? null : where.keySet(); - if (set != null) { - synchronized (where) { - if (where != null) { - int index; - for (String k : set) { - index = k.indexOf(key); - if (index >= 0 && StringUtil.isName(k.substring(index)) == false) { - return where.get(k); - } + if (key == null || where == null){ + return null; + } + synchronized (where) { + if (where != null) { + int index; + for (Map.Entry entry : where.entrySet()) { + String k = entry.getKey(); + index = k.indexOf(key); + if (index >= 0 && StringUtil.isName(k.substring(index)) == false) { + return where.get(k); } } } @@ -2289,7 +2290,8 @@ public String getSetString(RequestMethod method, Map content, bo Object value; String idKey = getIdKey(); - for (String key : set) { + for (Map.Entry entry : content.entrySet()) { + String key = entry.getKey(); //避免筛选到全部 value = key == null ? null : content.get(key); if (key == null || idKey.equals(key)) { continue;