Skip to content

Commit 26cc54c

Browse files
author
Chris Brody
committed
Add missing catch statements to MultiThreadReadWriteTest.java
1 parent e867cf8 commit 26cc54c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/main/java/net/zetetic/tests/MultiThreadReadWriteTest.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ public void run() {
7575
new Object[]{"one for the money", "two for the show"});
7676
}
7777
} catch (SQLiteException ex) { Log.e(TAG, "caught exception, bailing", ex); }
78-
// FIX: ADD CATCH #1:
79-
// catch (IllegalStateException ex) { Log.e(TAG, "caught exception, bailing", ex); }
78+
catch (IllegalStateException ex) { Log.e(TAG, "caught exception, bailing", ex); }
8079

8180
closeDatabase(writer, accessType);
8281
Log.i(TAG, String.format("writer thread %d terminating", id));
@@ -116,8 +115,7 @@ synchronized void logRecordsBetween(SQLiteDatabase reader, int start, int end) {
116115
results = reader.rawQuery("select rowid, * from t1 where rowid between ? and ?",
117116
new String[]{String.valueOf(start), String.valueOf(end)});
118117
} catch (IllegalStateException ex) { Log.e(TAG, "caught exception, bailing", ex); }
119-
// FIX: ADD CATCH #2:
120-
// catch (SQLiteException ex) { Log.e(TAG, "caught exception, bailing", ex); }
118+
catch (SQLiteException ex) { Log.e(TAG, "caught exception, bailing", ex); }
121119

122120
if (results != null) {
123121
Log.i(TAG, String.format("reader thread %d - writing results %d to %d", id, start, end));
@@ -139,8 +137,7 @@ synchronized int getCurrentTableCount(SQLiteDatabase database) {
139137
try {
140138
cursor = database.rawQuery("select count(*) from t1;", new String[]{});
141139
} catch (IllegalStateException ex) { Log.e(TAG, "caught exception, bailing with count = " + count, ex); return 0; }
142-
// FIX: ADD CATCH #3:
143-
// catch (SQLiteException ex) { Log.e(TAG, "caught exception, bailing", ex); return 0; }
140+
catch (SQLiteException ex) { Log.e(TAG, "caught exception, bailing", ex); return 0; }
144141

145142
// II. Attempt to get the count from the cursor:
146143
if (cursor != null) {

0 commit comments

Comments
 (0)