JsonStreamParser.smali
6.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
.class public final Lcom/google/gson/JsonStreamParser;
.super Ljava/lang/Object;
.source "JsonStreamParser.java"
# interfaces
.implements Ljava/util/Iterator;
# annotations
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/lang/Object;",
"Ljava/util/Iterator",
"<",
"Lcom/google/gson/JsonElement;",
">;"
}
.end annotation
# instance fields
.field private final lock:Ljava/lang/Object;
.field private final parser:Lcom/google/gson/stream/JsonReader;
# direct methods
.method public constructor <init>(Ljava/io/Reader;)V
.registers 4
.param p1, "reader" # Ljava/io/Reader;
.prologue
.line 68
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 69
new-instance v0, Lcom/google/gson/stream/JsonReader;
invoke-direct {v0, p1}, Lcom/google/gson/stream/JsonReader;-><init>(Ljava/io/Reader;)V
iput-object v0, p0, Lcom/google/gson/JsonStreamParser;->parser:Lcom/google/gson/stream/JsonReader;
.line 70
iget-object v0, p0, Lcom/google/gson/JsonStreamParser;->parser:Lcom/google/gson/stream/JsonReader;
const/4 v1, 0x1
invoke-virtual {v0, v1}, Lcom/google/gson/stream/JsonReader;->setLenient(Z)V
.line 71
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
iput-object v0, p0, Lcom/google/gson/JsonStreamParser;->lock:Ljava/lang/Object;
.line 72
return-void
.end method
.method public constructor <init>(Ljava/lang/String;)V
.registers 3
.param p1, "json" # Ljava/lang/String;
.prologue
.line 61
new-instance v0, Ljava/io/StringReader;
invoke-direct {v0, p1}, Ljava/io/StringReader;-><init>(Ljava/lang/String;)V
invoke-direct {p0, v0}, Lcom/google/gson/JsonStreamParser;-><init>(Ljava/io/Reader;)V
.line 62
return-void
.end method
# virtual methods
.method public hasNext()Z
.registers 5
.prologue
.line 103
iget-object v2, p0, Lcom/google/gson/JsonStreamParser;->lock:Ljava/lang/Object;
monitor-enter v2
.line 105
:try_start_3
iget-object v1, p0, Lcom/google/gson/JsonStreamParser;->parser:Lcom/google/gson/stream/JsonReader;
invoke-virtual {v1}, Lcom/google/gson/stream/JsonReader;->peek()Lcom/google/gson/stream/JsonToken;
move-result-object v1
sget-object v3, Lcom/google/gson/stream/JsonToken;->END_DOCUMENT:Lcom/google/gson/stream/JsonToken;
:try_end_b
.catch Lcom/google/gson/stream/MalformedJsonException; {:try_start_3 .. :try_end_b} :catch_12
.catch Ljava/io/IOException; {:try_start_3 .. :try_end_b} :catch_1c
.catchall {:try_start_3 .. :try_end_b} :catchall_19
if-eq v1, v3, :cond_10
const/4 v1, 0x1
:goto_e
:try_start_e
monitor-exit v2
return v1
:cond_10
const/4 v1, 0x0
goto :goto_e
.line 106
:catch_12
move-exception v0
.line 107
.local v0, "e":Lcom/google/gson/stream/MalformedJsonException;
new-instance v1, Lcom/google/gson/JsonSyntaxException;
invoke-direct {v1, v0}, Lcom/google/gson/JsonSyntaxException;-><init>(Ljava/lang/Throwable;)V
throw v1
.line 111
.end local v0 # "e":Lcom/google/gson/stream/MalformedJsonException;
:catchall_19
move-exception v1
monitor-exit v2
:try_end_1b
.catchall {:try_start_e .. :try_end_1b} :catchall_19
throw v1
.line 108
:catch_1c
move-exception v0
.line 109
.local v0, "e":Ljava/io/IOException;
:try_start_1d
new-instance v1, Lcom/google/gson/JsonIOException;
invoke-direct {v1, v0}, Lcom/google/gson/JsonIOException;-><init>(Ljava/lang/Throwable;)V
throw v1
:try_end_23
.catchall {:try_start_1d .. :try_end_23} :catchall_19
.end method
.method public next()Lcom/google/gson/JsonElement;
.registers 4
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/google/gson/JsonParseException;
}
.end annotation
.prologue
.line 82
invoke-virtual {p0}, Lcom/google/gson/JsonStreamParser;->hasNext()Z
move-result v1
if-nez v1, :cond_c
.line 83
new-instance v1, Ljava/util/NoSuchElementException;
invoke-direct {v1}, Ljava/util/NoSuchElementException;-><init>()V
throw v1
.line 87
:cond_c
:try_start_c
iget-object v1, p0, Lcom/google/gson/JsonStreamParser;->parser:Lcom/google/gson/stream/JsonReader;
invoke-static {v1}, Lcom/google/gson/internal/Streams;->parse(Lcom/google/gson/stream/JsonReader;)Lcom/google/gson/JsonElement;
:try_end_11
.catch Ljava/lang/StackOverflowError; {:try_start_c .. :try_end_11} :catch_13
.catch Ljava/lang/OutOfMemoryError; {:try_start_c .. :try_end_11} :catch_1c
.catch Lcom/google/gson/JsonParseException; {:try_start_c .. :try_end_11} :catch_25
move-result-object v1
return-object v1
.line 88
:catch_13
move-exception v0
.line 89
.local v0, "e":Ljava/lang/StackOverflowError;
new-instance v1, Lcom/google/gson/JsonParseException;
const-string v2, "Failed parsing JSON source to Json"
invoke-direct {v1, v2, v0}, Lcom/google/gson/JsonParseException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw v1
.line 90
.end local v0 # "e":Ljava/lang/StackOverflowError;
:catch_1c
move-exception v0
.line 91
.local v0, "e":Ljava/lang/OutOfMemoryError;
new-instance v1, Lcom/google/gson/JsonParseException;
const-string v2, "Failed parsing JSON source to Json"
invoke-direct {v1, v2, v0}, Lcom/google/gson/JsonParseException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw v1
.line 92
.end local v0 # "e":Ljava/lang/OutOfMemoryError;
:catch_25
move-exception v0
.line 93
.local v0, "e":Lcom/google/gson/JsonParseException;
invoke-virtual {v0}, Lcom/google/gson/JsonParseException;->getCause()Ljava/lang/Throwable;
move-result-object v1
instance-of v1, v1, Ljava/io/EOFException;
if-eqz v1, :cond_33
new-instance v0, Ljava/util/NoSuchElementException;
.end local v0 # "e":Lcom/google/gson/JsonParseException;
invoke-direct {v0}, Ljava/util/NoSuchElementException;-><init>()V
:cond_33
throw v0
.end method
.method public bridge synthetic next()Ljava/lang/Object;
.registers 2
.prologue
.line 52
invoke-virtual {p0}, Lcom/google/gson/JsonStreamParser;->next()Lcom/google/gson/JsonElement;
move-result-object v0
return-object v0
.end method
.method public remove()V
.registers 2
.prologue
.line 120
new-instance v0, Ljava/lang/UnsupportedOperationException;
invoke-direct {v0}, Ljava/lang/UnsupportedOperationException;-><init>()V
throw v0
.end method