[TestPrep11] Only use mHasWrittenData to control JsonWriter#endArray() call

Change-Id: If2107e38575b009a4c372194ecd827e27bdbb2b4
main
Kurt Partridge 2013-02-15 12:56:46 -08:00
parent a5e564bea0
commit f170f145af
1 changed files with 5 additions and 9 deletions

View File

@ -107,16 +107,12 @@ public class ResearchLog {
try {
if (mHasWrittenData) {
mJsonWriter.endArray();
mJsonWriter.flush();
mJsonWriter.close();
if (DEBUG) {
Log.d(TAG, "wrote log to " + mFile);
}
mHasWrittenData = false;
} else {
if (DEBUG) {
Log.d(TAG, "close() called, but no data, not outputting");
}
}
mJsonWriter.flush();
mJsonWriter.close();
if (DEBUG) {
Log.d(TAG, "wrote log to " + mFile);
}
} catch (Exception e) {
Log.d(TAG, "error when closing ResearchLog:", e);