Cache$2.smali
.class Lokhttp3/Cache$2;
.super Ljava/lang/Object;
.source "Cache.java"
# interfaces
.implements Ljava/util/Iterator;
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lokhttp3/Cache;->urls()Ljava/util/Iterator;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/lang/Object;",
"Ljava/util/Iterator<",
"Ljava/lang/String;",
">;"
}
.end annotation
# instance fields
.field canRemove:Z
.field final delegate:Ljava/util/Iterator;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Iterator<",
"Lokhttp3/internal/cache/DiskLruCache$Snapshot;",
">;"
}
.end annotation
.end field
.field nextUrl:Ljava/lang/String;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end field
.field final synthetic this$0:Lokhttp3/Cache;
# direct methods
.method static constructor <clinit>()V
.registers 1
return-void
.end method
.method constructor <init>(Lokhttp3/Cache;)V
.registers 3
.param p1, "this$0" # Lokhttp3/Cache;
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 328
iput-object p1, p0, Lokhttp3/Cache$2;->this$0:Lokhttp3/Cache;
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 329
iget-object v0, p0, Lokhttp3/Cache$2;->this$0:Lokhttp3/Cache;
iget-object v0, v0, Lokhttp3/Cache;->cache:Lokhttp3/internal/cache/DiskLruCache;
invoke-virtual {v0}, Lokhttp3/internal/cache/DiskLruCache;->snapshots()Ljava/util/Iterator;
move-result-object v0
iput-object v0, p0, Lokhttp3/Cache$2;->delegate:Ljava/util/Iterator;
return-void
.end method
# virtual methods
.method public hasNext()Z
.registers 6
.line 335
iget-object v0, p0, Lokhttp3/Cache$2;->nextUrl:Ljava/lang/String;
const/4 v1, 0x1
if-eqz v0, :cond_6
return v1
.line 337
:cond_6
const/4 v0, 0x0
iput-boolean v0, p0, Lokhttp3/Cache$2;->canRemove:Z
.line 338
:goto_9
iget-object v2, p0, Lokhttp3/Cache$2;->delegate:Ljava/util/Iterator;
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_37
.line 339
iget-object v2, p0, Lokhttp3/Cache$2;->delegate:Ljava/util/Iterator;
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lokhttp3/internal/cache/DiskLruCache$Snapshot;
.line 341
.local v2, "snapshot":Lokhttp3/internal/cache/DiskLruCache$Snapshot;
:try_start_19
invoke-virtual {v2, v0}, Lokhttp3/internal/cache/DiskLruCache$Snapshot;->getSource(I)Lokio/Source;
move-result-object v3
invoke-static {v3}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource;
move-result-object v3
.line 342
.local v3, "metadata":Lokio/BufferedSource;
invoke-interface {v3}, Lokio/BufferedSource;->readUtf8LineStrict()Ljava/lang/String;
move-result-object v4
iput-object v4, p0, Lokhttp3/Cache$2;->nextUrl:Ljava/lang/String;
:try_end_27
.catch Ljava/io/IOException; {:try_start_19 .. :try_end_27} :catch_31
.catchall {:try_start_19 .. :try_end_27} :catchall_2c
.line 343
nop
.line 348
invoke-virtual {v2}, Lokhttp3/internal/cache/DiskLruCache$Snapshot;->close()V
.line 343
return v1
.line 348
.end local v3 # "metadata":Lokio/BufferedSource;
:catchall_2c
move-exception v0
invoke-virtual {v2}, Lokhttp3/internal/cache/DiskLruCache$Snapshot;->close()V
throw v0
.line 344
:catch_31
move-exception v3
.line 348
invoke-virtual {v2}, Lokhttp3/internal/cache/DiskLruCache$Snapshot;->close()V
.line 349
nop
.line 350
.end local v2 # "snapshot":Lokhttp3/internal/cache/DiskLruCache$Snapshot;
goto :goto_9
.line 352
:cond_37
return v0
.end method
.method public bridge synthetic next()Ljava/lang/Object;
.registers 2
.line 328
invoke-virtual {p0}, Lokhttp3/Cache$2;->next()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public next()Ljava/lang/String;
.registers 3
.line 356
invoke-virtual {p0}, Lokhttp3/Cache$2;->hasNext()Z
move-result v0
if-eqz v0, :cond_f
.line 357
iget-object v0, p0, Lokhttp3/Cache$2;->nextUrl:Ljava/lang/String;
.line 358
.local v0, "result":Ljava/lang/String;
const/4 v1, 0x0
iput-object v1, p0, Lokhttp3/Cache$2;->nextUrl:Ljava/lang/String;
.line 359
const/4 v1, 0x1
iput-boolean v1, p0, Lokhttp3/Cache$2;->canRemove:Z
.line 360
return-object v0
.line 356
.end local v0 # "result":Ljava/lang/String;
:cond_f
new-instance v0, Ljava/util/NoSuchElementException;
invoke-direct {v0}, Ljava/util/NoSuchElementException;-><init>()V
throw v0
.end method
.method public remove()V
.registers 3
.line 364
iget-boolean v0, p0, Lokhttp3/Cache$2;->canRemove:Z
if-eqz v0, :cond_a
.line 365
iget-object v0, p0, Lokhttp3/Cache$2;->delegate:Ljava/util/Iterator;
invoke-interface {v0}, Ljava/util/Iterator;->remove()V
.line 366
return-void
.line 364
:cond_a
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "remove() before next()"
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method