From a5883821bf4bd67a54f463edff9b271a8390c1f0 Mon Sep 17 00:00:00 2001 From: ParkJeongHwan Date: Mon, 23 Sep 2019 18:05:01 +0900 Subject: [PATCH] Fixed static field issue. --- src/main/java/com/realtimetech/kson/KsonContext.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/realtimetech/kson/KsonContext.java b/src/main/java/com/realtimetech/kson/KsonContext.java index 468062c..65a61a6 100644 --- a/src/main/java/com/realtimetech/kson/KsonContext.java +++ b/src/main/java/com/realtimetech/kson/KsonContext.java @@ -3,6 +3,7 @@ import java.io.IOException; import java.lang.reflect.Array; import java.lang.reflect.Field; +import java.lang.reflect.Modifier; import java.util.Collection; import java.util.Date; import java.util.HashMap; @@ -196,7 +197,7 @@ private Field[] getAccessibleFields(Class clazz) { for (Field field : clazz.getDeclaredFields()) { field.setAccessible(true); - if (!fields.contains(field) && !field.isAnnotationPresent(Ignore.class)) { + if (!fields.contains(field) && !field.isAnnotationPresent(Ignore.class) && !Modifier.isStatic(field.getModifiers())) { fields.add(field); } }