Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialization issues when complied against and running on Android API/SDK 28 #288

Open
simonpoole opened this issue Aug 26, 2019 · 0 comments

Comments

@simonpoole
Copy link

I've run in to a couple of problems since we started compiling against the Android API 28 (as all of us have to do latest November). Interesting enough the issues are only present when actually running on an API 28 device.

In particular serializing TreeMap, Date (actually fails in Calendar) and the output of Collections.synchronizedList (OK that maybe was never a good idea and I've removed that) fails with an NPE.

Typical example:

58	08-26 16:15:20.537 I/SaveThread(13297): saving tasks.res
59	08-26 16:15:20.588 E/SaveThread(13297): failed to save tasks.res
60	08-26 16:15:20.588 E/SaveThread(13297): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Field.get(java.lang.Object)' on a null object reference
61	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTClazzInfo$FSTFieldInfo.getObjectValue(FSTClazzInfo.java:873)
62	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectFields(FSTObjectOutput.java:660)
63	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput$3.defaultWriteObject(FSTObjectOutput.java:916)
64	08-26 16:15:20.588 E/SaveThread(13297): at java.util.Calendar.writeObject(Calendar.java:3513)
65	08-26 16:15:20.588 E/SaveThread(13297): at java.lang.reflect.Method.invoke(Native Method)
66	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectCompatibleRecursive(FSTObjectOutput.java:566)
67	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectCompatibleRecursive(FSTObjectOutput.java:562)
68	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectCompatible(FSTObjectOutput.java:554)
69	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:450)
70	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:369)
71	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectFields(FSTObjectOutput.java:664)
72	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectCompatibleRecursive(FSTObjectOutput.java:576)
73	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectCompatibleRecursive(FSTObjectOutput.java:562)
74	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectCompatible(FSTObjectOutput.java:554)
75	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:450)
76	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:369)
77	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectFields(FSTObjectOutput.java:664)
78	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.defaultWriteObject(FSTObjectOutput.java:546)
79	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:458)
80	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectInternal(FSTObjectOutput.java:327)
81	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.serializers.FSTArrayListSerializer.writeObject(FSTArrayListSerializer.java:49)
82	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:476)
83	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:369)
84	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectFields(FSTObjectOutput.java:664)
85	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.defaultWriteObject(FSTObjectOutput.java:546)
86	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:458)
87	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:369)
88	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectFields(FSTObjectOutput.java:664)
89	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.defaultWriteObject(FSTObjectOutput.java:546)
90	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:458)
91	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:369)
92	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectFields(FSTObjectOutput.java:664)
93	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.defaultWriteObject(FSTObjectOutput.java:546)
94	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:458)
95	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObjectInternal(FSTObjectOutput.java:327)
96	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObject(FSTObjectOutput.java:294)
97	08-26 16:15:20.588 E/SaveThread(13297): at org.nustaq.serialization.FSTObjectOutput.writeObject(FSTObjectOutput.java:204)
98	08-26 16:15:20.588 E/SaveThread(13297): at de.blau.android.util.SavingHelper$SaveThread.run(SavingHelper.java:134)
99	08-26 16:15:20.588 E/SaveThread(13297): at java.lang.Thread.run(Thread.java:764)

It is noticeable that these are all cases in which FST falls back to the standard Java serialization. I have workarounds for the above cases, but yet another NPE might be lurking just around the corner.

@simonpoole simonpoole changed the title Serialization issues when complied agains and running on Android API/SDK 28 Serialization issues when complied against and running on Android API/SDK 28 Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant