[TestPrep11] Only use mHasWrittenData to control JsonWriter#endArray() call
Change-Id: If2107e38575b009a4c372194ecd827e27bdbb2b4main
parent
a5e564bea0
commit
f170f145af
|
@ -107,17 +107,13 @@ public class ResearchLog {
|
||||||
try {
|
try {
|
||||||
if (mHasWrittenData) {
|
if (mHasWrittenData) {
|
||||||
mJsonWriter.endArray();
|
mJsonWriter.endArray();
|
||||||
|
mHasWrittenData = false;
|
||||||
|
}
|
||||||
mJsonWriter.flush();
|
mJsonWriter.flush();
|
||||||
mJsonWriter.close();
|
mJsonWriter.close();
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.d(TAG, "wrote log to " + mFile);
|
Log.d(TAG, "wrote log to " + mFile);
|
||||||
}
|
}
|
||||||
mHasWrittenData = false;
|
|
||||||
} else {
|
|
||||||
if (DEBUG) {
|
|
||||||
Log.d(TAG, "close() called, but no data, not outputting");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.d(TAG, "error when closing ResearchLog:", e);
|
Log.d(TAG, "error when closing ResearchLog:", e);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
Loading…
Reference in New Issue