147 lines
3.0 KiB
Smali
147 lines
3.0 KiB
Smali
.class public abstract Lio/requery/android/database/sqlite/SQLiteClosable;
|
|
.super Ljava/lang/Object;
|
|
.source "SQLiteClosable.java"
|
|
|
|
# interfaces
|
|
.implements Ljava/io/Closeable;
|
|
|
|
|
|
# instance fields
|
|
.field private mReferenceCount:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 2
|
|
iput v0, p0, Lio/requery/android/database/sqlite/SQLiteClosable;->mReferenceCount:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public acquireReference()V
|
|
.locals 3
|
|
|
|
.line 1
|
|
monitor-enter p0
|
|
|
|
.line 2
|
|
:try_start_0
|
|
iget v0, p0, Lio/requery/android/database/sqlite/SQLiteClosable;->mReferenceCount:I
|
|
|
|
if-lez v0, :cond_0
|
|
|
|
.line 3
|
|
iget v0, p0, Lio/requery/android/database/sqlite/SQLiteClosable;->mReferenceCount:I
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
iput v0, p0, Lio/requery/android/database/sqlite/SQLiteClosable;->mReferenceCount:I
|
|
|
|
.line 4
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
.line 5
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "attempt to re-open an already-closed object: "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
.line 6
|
|
monitor-exit p0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public close()V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-virtual {p0}, Lio/requery/android/database/sqlite/SQLiteClosable;->releaseReference()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method protected abstract onAllReferencesReleased()V
|
|
.end method
|
|
|
|
.method public releaseReference()V
|
|
.locals 2
|
|
|
|
.line 1
|
|
monitor-enter p0
|
|
|
|
.line 2
|
|
:try_start_0
|
|
iget v0, p0, Lio/requery/android/database/sqlite/SQLiteClosable;->mReferenceCount:I
|
|
|
|
const/4 v1, 0x1
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
iput v0, p0, Lio/requery/android/database/sqlite/SQLiteClosable;->mReferenceCount:I
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v1, 0x0
|
|
|
|
.line 3
|
|
:goto_0
|
|
monitor-exit p0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
.line 4
|
|
invoke-virtual {p0}, Lio/requery/android/database/sqlite/SQLiteClosable;->onAllReferencesReleased()V
|
|
|
|
:cond_1
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
.line 5
|
|
:try_start_1
|
|
monitor-exit p0
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
throw v0
|
|
.end method
|