BinaryStruct now checks super class fields also

This commit is contained in:
Ziver Koc 2016-08-29 17:03:19 +02:00
parent 7176bddc15
commit 46de7e05d1
2 changed files with 9 additions and 7 deletions

View file

@ -137,8 +137,8 @@ public class JSONObjectOutputStream extends OutputStream implements ObjectOutput
}
// Add all the fields to the DataNode
for(Field field : obj.getClass().getDeclaredFields()){
if((field.getModifiers() & Modifier.STATIC) == 0 &&
(field.getModifiers() & Modifier.TRANSIENT) == 0){
if( ! Modifier.isStatic(field.getModifiers()) &&
! Modifier.isTransient(field.getModifiers())){
field.setAccessible(true);
Object fieldObj = field.get(obj);