diff --git a/src/main/java/com/io/yutian/aulib/serialize/SerializeHelper.java b/src/main/java/com/io/yutian/aulib/serialize/SerializeHelper.java index d93ce20..0ea423c 100644 --- a/src/main/java/com/io/yutian/aulib/serialize/SerializeHelper.java +++ b/src/main/java/com/io/yutian/aulib/serialize/SerializeHelper.java @@ -64,7 +64,7 @@ public class SerializeHelper { continue; } Object deserializeValue = deserializeValue(field, field.getType(), value); - field.set(instance, deserializeValue); + ReflectionUtil.setFieldUsingUnsafe(field, instance, deserializeValue); } return instance; } catch (Exception e) { @@ -116,8 +116,9 @@ public class SerializeHelper { map.put(key, deserializeValue(field, valueType, jsonObject.get(key))); } return map; + } else { + return deserialize(clazz, (JSONObject) value); } - return null; } private static Object serializeValue(Object value) throws SerializeException { @@ -159,8 +160,9 @@ public class SerializeHelper { jsonObject.put(key.toString(), serializeValue(map.get(key))); } return jsonObject; + } else { + return serialize(value); } - return null; } public static final Map, Class> WRAPPER_TO_PRIMITIVE = new HashMap<>(); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 97866b3..3c4df09 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,4 +1,4 @@ name: AuLib main: com.io.yutian.aulib.AuLib -version: 1.3.2 +version: 1.3.4 author: SuperYuTian \ No newline at end of file