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

main
Kurt Partridge 2013-02-27 00:41:11 +00:00 committed by Android (Google) Code Review
commit 64c34122f2
1 changed files with 5 additions and 9 deletions

View File

@ -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 {