weird java bug. bug:2941509

Change-Id: I70edabbdb5c715018227958b74fa1ac4e4df3f88
This commit is contained in:
Vasu Nori
2010-08-23 12:07:00 -07:00
parent d62847997b
commit 9a8bc78da7

View File

@@ -2392,10 +2392,9 @@ public class SQLiteDatabase extends SQLiteClosable {
ArrayList<DbStats> dbStatsList = new ArrayList<DbStats>();
// make a local copy of mActiveDatabases - so that this method is not competing
// for synchronization lock on mActiveDatabases
ArrayList<WeakReference<SQLiteDatabase>> tempList =
new ArrayList<WeakReference<SQLiteDatabase>>();
ArrayList<WeakReference<SQLiteDatabase>> tempList;
synchronized(mActiveDatabases) {
Collections.copy(tempList, mActiveDatabases);
tempList = (ArrayList<WeakReference<SQLiteDatabase>>)mActiveDatabases.clone();
}
for (WeakReference<SQLiteDatabase> w : tempList) {
SQLiteDatabase db = w.get();