cleanup some of the STOPSHIP comments

removing a check no longer required.
bug:3143859

Change-Id: I6a2ed242d234a4eb78b116bde81efd31e82fafaf
This commit is contained in:
Vasu Nori
2010-10-28 14:41:59 -07:00
parent 4c6e5dfa1c
commit 02fc2b01a3

View File

@@ -23,14 +23,12 @@ import android.database.CursorWindow;
*/
public abstract class SQLiteClosable {
private int mReferenceCount = 1;
private Object mLock = new Object(); // STOPSHIP remove this line
protected abstract void onAllReferencesReleased();
protected void onAllReferencesReleasedFromContainer() {}
public void acquireReference() {
synchronized(mLock) { // STOPSHIP change 'mLock' to 'this'
checkRefCount();
synchronized(this) {
if (mReferenceCount <= 0) {
throw new IllegalStateException(
"attempt to re-open an already-closed object: " + getObjInfo());
@@ -40,8 +38,7 @@ public abstract class SQLiteClosable {
}
public void releaseReference() {
synchronized(mLock) { // STOPSHIP change 'mLock' to 'this'
checkRefCount();
synchronized(this) {
mReferenceCount--;
if (mReferenceCount == 0) {
onAllReferencesReleased();
@@ -50,8 +47,7 @@ public abstract class SQLiteClosable {
}
public void releaseReferenceFromContainer() {
synchronized(mLock) { // STOPSHIP change 'mLock' to 'this'
checkRefCount();
synchronized(this) {
mReferenceCount--;
if (mReferenceCount == 0) {
onAllReferencesReleasedFromContainer();
@@ -76,12 +72,4 @@ public abstract class SQLiteClosable {
buff.append(") ");
return buff.toString();
}
// STOPSHIP remove this method before shipping
private void checkRefCount() {
if (mReferenceCount > 1000) {
throw new IllegalStateException("bad refcount: " + mReferenceCount +
". file bug against frameworks->database" + getObjInfo());
}
}
}