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

This commit is contained in:
Kurt Partridge 2013-02-27 00:41:11 +00:00 committed by Android (Google) Code Review
commit 64c34122f2

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);