From afdd0b6f98ebd86da4ca3f85e2dd0af448219067 Mon Sep 17 00:00:00 2001 From: zhumeng Date: Mon, 14 Nov 2022 15:02:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/alibaba/fastjson/JSONPath.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/alibaba/fastjson/JSONPath.java b/src/main/java/com/alibaba/fastjson/JSONPath.java index a8cc592d93..837e0fcdd9 100644 --- a/src/main/java/com/alibaba/fastjson/JSONPath.java +++ b/src/main/java/com/alibaba/fastjson/JSONPath.java @@ -873,11 +873,8 @@ private static void paths(Map values, Map paths, Map fieldValues = javaBeanSerializer.getFieldValuesMap(javaObject); for (Map.Entry entry : fieldValues.entrySet()) { String key = entry.getKey(); - - if (key instanceof String) { - String path = parent.equals("/") ? "/" + key : parent + "/" + key; - paths(values, paths, path, entry.getValue(), config); - } + String path = parent.equals("/") ? "/" + key : parent + "/" + key; + paths(values, paths, path, entry.getValue(), config); } } catch (Exception e) { throw new JSONException("toJSON error", e); @@ -4086,7 +4083,6 @@ protected void deepSet(final Object currentObject, final String propertyName, lo Map map = (Map) currentObject; if (map.containsKey(propertyName)) { - Object val = map.get(propertyName); map.put(propertyName, value); return; }