DiskLruCache$3.smali 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. .class Lokhttp3/internal/cache/DiskLruCache$3;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # interfaces
  5. .implements Ljava/util/Iterator;
  6. # annotations
  7. .annotation system Ldalvik/annotation/EnclosingMethod;
  8. value = Lokhttp3/internal/cache/DiskLruCache;->snapshots()Ljava/util/Iterator;
  9. .end annotation
  10. .annotation system Ldalvik/annotation/InnerClass;
  11. accessFlags = 0x0
  12. name = null
  13. .end annotation
  14. .annotation system Ldalvik/annotation/Signature;
  15. value = {
  16. "Ljava/lang/Object;",
  17. "Ljava/util/Iterator<",
  18. "Lokhttp3/internal/cache/DiskLruCache$Snapshot;",
  19. ">;"
  20. }
  21. .end annotation
  22. # instance fields
  23. .field final delegate:Ljava/util/Iterator;
  24. .annotation system Ldalvik/annotation/Signature;
  25. value = {
  26. "Ljava/util/Iterator<",
  27. "Lokhttp3/internal/cache/DiskLruCache$Entry;",
  28. ">;"
  29. }
  30. .end annotation
  31. .end field
  32. .field nextSnapshot:Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  33. .field removeSnapshot:Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  34. .field final synthetic this$0:Lokhttp3/internal/cache/DiskLruCache;
  35. # direct methods
  36. .method constructor <init>(Lokhttp3/internal/cache/DiskLruCache;)V
  37. .locals 1
  38. iput-object p1, p0, Lokhttp3/internal/cache/DiskLruCache$3;->this$0:Lokhttp3/internal/cache/DiskLruCache;
  39. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  40. new-instance p1, Ljava/util/ArrayList;
  41. iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$3;->this$0:Lokhttp3/internal/cache/DiskLruCache;
  42. iget-object v0, v0, Lokhttp3/internal/cache/DiskLruCache;->lruEntries:Ljava/util/LinkedHashMap;
  43. invoke-virtual {v0}, Ljava/util/LinkedHashMap;->values()Ljava/util/Collection;
  44. move-result-object v0
  45. invoke-direct {p1, v0}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
  46. invoke-virtual {p1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
  47. move-result-object p1
  48. iput-object p1, p0, Lokhttp3/internal/cache/DiskLruCache$3;->delegate:Ljava/util/Iterator;
  49. return-void
  50. .end method
  51. # virtual methods
  52. .method public hasNext()Z
  53. .locals 4
  54. iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$3;->nextSnapshot:Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  55. const/4 v1, 0x1
  56. if-eqz v0, :cond_0
  57. return v1
  58. :cond_0
  59. iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$3;->this$0:Lokhttp3/internal/cache/DiskLruCache;
  60. monitor-enter v0
  61. :try_start_0
  62. iget-object v2, p0, Lokhttp3/internal/cache/DiskLruCache$3;->this$0:Lokhttp3/internal/cache/DiskLruCache;
  63. iget-boolean v2, v2, Lokhttp3/internal/cache/DiskLruCache;->closed:Z
  64. const/4 v3, 0x0
  65. if-eqz v2, :cond_1
  66. monitor-exit v0
  67. return v3
  68. :cond_1
  69. :goto_0
  70. iget-object v2, p0, Lokhttp3/internal/cache/DiskLruCache$3;->delegate:Ljava/util/Iterator;
  71. invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
  72. move-result v2
  73. if-eqz v2, :cond_3
  74. iget-object v2, p0, Lokhttp3/internal/cache/DiskLruCache$3;->delegate:Ljava/util/Iterator;
  75. invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
  76. move-result-object v2
  77. check-cast v2, Lokhttp3/internal/cache/DiskLruCache$Entry;
  78. invoke-virtual {v2}, Lokhttp3/internal/cache/DiskLruCache$Entry;->snapshot()Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  79. move-result-object v2
  80. if-nez v2, :cond_2
  81. goto :goto_0
  82. :cond_2
  83. iput-object v2, p0, Lokhttp3/internal/cache/DiskLruCache$3;->nextSnapshot:Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  84. monitor-exit v0
  85. return v1
  86. :cond_3
  87. monitor-exit v0
  88. return v3
  89. :catchall_0
  90. move-exception v1
  91. monitor-exit v0
  92. :try_end_0
  93. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  94. goto :goto_2
  95. :goto_1
  96. throw v1
  97. :goto_2
  98. goto :goto_1
  99. .end method
  100. .method public bridge synthetic next()Ljava/lang/Object;
  101. .locals 1
  102. invoke-virtual {p0}, Lokhttp3/internal/cache/DiskLruCache$3;->next()Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  103. move-result-object v0
  104. return-object v0
  105. .end method
  106. .method public next()Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  107. .locals 1
  108. invoke-virtual {p0}, Lokhttp3/internal/cache/DiskLruCache$3;->hasNext()Z
  109. move-result v0
  110. if-eqz v0, :cond_0
  111. iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$3;->nextSnapshot:Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  112. iput-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$3;->removeSnapshot:Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  113. const/4 v0, 0x0
  114. iput-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$3;->nextSnapshot:Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  115. iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$3;->removeSnapshot:Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  116. return-object v0
  117. :cond_0
  118. new-instance v0, Ljava/util/NoSuchElementException;
  119. invoke-direct {v0}, Ljava/util/NoSuchElementException;-><init>()V
  120. throw v0
  121. .end method
  122. .method public remove()V
  123. .locals 3
  124. iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$3;->removeSnapshot:Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  125. if-eqz v0, :cond_0
  126. const/4 v1, 0x0
  127. :try_start_0
  128. iget-object v2, p0, Lokhttp3/internal/cache/DiskLruCache$3;->this$0:Lokhttp3/internal/cache/DiskLruCache;
  129. invoke-static {v0}, Lokhttp3/internal/cache/DiskLruCache$Snapshot;->access$000(Lokhttp3/internal/cache/DiskLruCache$Snapshot;)Ljava/lang/String;
  130. move-result-object v0
  131. invoke-virtual {v2, v0}, Lokhttp3/internal/cache/DiskLruCache;->remove(Ljava/lang/String;)Z
  132. :try_end_0
  133. .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
  134. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  135. goto :goto_0
  136. :catchall_0
  137. move-exception v0
  138. iput-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$3;->removeSnapshot:Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  139. throw v0
  140. :catch_0
  141. :goto_0
  142. iput-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$3;->removeSnapshot:Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  143. return-void
  144. :cond_0
  145. new-instance v0, Ljava/lang/IllegalStateException;
  146. const-string v1, "remove() before next()"
  147. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  148. throw v0
  149. .end method