mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
am b20c7ee7: am 1f99e04b: Merge "Fix JsonWriter bug"
* commit 'b20c7ee75093ae9c111daf64d9e4f8509d692824': Fix JsonWriter bug
This commit is contained in:
commit
4a885f254d
@ -108,10 +108,14 @@ public class ResearchLog {
|
|||||||
@Override
|
@Override
|
||||||
public Object call() throws Exception {
|
public Object call() throws Exception {
|
||||||
try {
|
try {
|
||||||
if (mHasWrittenData) {
|
// TODO: This is necessary to avoid an exception. Better would be to not even
|
||||||
mJsonWriter.endArray();
|
// open the JsonWriter if the file is not even opened unless there is valid data
|
||||||
mHasWrittenData = false;
|
// to write.
|
||||||
|
if (!mHasWrittenData) {
|
||||||
|
mJsonWriter.beginArray();
|
||||||
}
|
}
|
||||||
|
mJsonWriter.endArray();
|
||||||
|
mHasWrittenData = false;
|
||||||
mJsonWriter.flush();
|
mJsonWriter.flush();
|
||||||
mJsonWriter.close();
|
mJsonWriter.close();
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
@ -159,6 +163,12 @@ public class ResearchLog {
|
|||||||
public Object call() throws Exception {
|
public Object call() throws Exception {
|
||||||
try {
|
try {
|
||||||
if (mHasWrittenData) {
|
if (mHasWrittenData) {
|
||||||
|
// TODO: This is necessary to avoid an exception. Better would be to not
|
||||||
|
// even open the JsonWriter if the file is not even opened unless there is
|
||||||
|
// valid data to write.
|
||||||
|
if (!mHasWrittenData) {
|
||||||
|
mJsonWriter.beginArray();
|
||||||
|
}
|
||||||
mJsonWriter.endArray();
|
mJsonWriter.endArray();
|
||||||
mJsonWriter.close();
|
mJsonWriter.close();
|
||||||
mHasWrittenData = false;
|
mHasWrittenData = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user