diff options
author | Vasu Nori <vnori@google.com> | 2010-11-29 15:09:30 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-11-29 15:09:30 -0800 |
commit | a84a744bb1804d7817093c0ab96d9cbaae3916f0 (patch) | |
tree | e61442cd63d61ef5e554ff42a3fb05cb24418484 | |
parent | 883ad9e260f4da777caf6600ff6bde37fb322003 (diff) | |
parent | b438902369ddb6785963c2bbe3d5d1d8679f7b8f (diff) | |
download | frameworks_base-a84a744bb1804d7817093c0ab96d9cbaae3916f0.zip frameworks_base-a84a744bb1804d7817093c0ab96d9cbaae3916f0.tar.gz frameworks_base-a84a744bb1804d7817093c0ab96d9cbaae3916f0.tar.bz2 |
Merge "if db close() fails due to un-closed sql statements, print useful msg"
-rw-r--r-- | core/java/android/database/sqlite/SQLiteDatabase.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java index 7efb7fd..184988b 100644 --- a/core/java/android/database/sqlite/SQLiteDatabase.java +++ b/core/java/android/database/sqlite/SQLiteDatabase.java @@ -1122,11 +1122,11 @@ public class SQLiteDatabase extends SQLiteClosable { Map.Entry<SQLiteClosable, Object> entry = iter.next(); SQLiteClosable program = entry.getKey(); if (program != null && program instanceof SQLiteProgram) { - SQLiteCompiledSql compiledSql = ((SQLiteProgram)program).mCompiledSql; - if (compiledSql.nStatement == stmtId) { - msg = compiledSql.toString(); - found = true; - } + SQLiteCompiledSql compiledSql = ((SQLiteProgram)program).mCompiledSql; + if (compiledSql.nStatement == stmtId) { + msg = compiledSql.toString(); + found = true; + } } } if (!found) { @@ -1140,8 +1140,9 @@ public class SQLiteDatabase extends SQLiteClosable { } } else { // the statement is not yet closed. most probably programming error in the app. - Log.w(TAG, "dbclose failed due to un-close()d SQL statements: " + msg); - throw e; + throw new SQLiteUnfinalizedObjectsException( + "close() on database: " + getPath() + + " failed due to un-close()d SQL statements: " + msg); } } } |