Changes to PO
Changes to add transition and volatile
@@ -7,6 +7,7 @@ import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
public class SerializationUtils {
@@ -33,6 +34,11 @@ public class SerializationUtils {
}
Field[] declaredFields = it.getDeclaredFields();
for (Field field : declaredFields) {
+ if (Modifier.isVolatile(field.getModifiers())
+ || Modifier.isTransient(field.getModifiers())
+ || Modifier.isStatic(field.getModifiers())) {
+ continue;
+ }
Class<?> fieldType = field.getType();
return isSerializable(fieldType);
}
