EndConsumerHelper.smali
7.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
270
.class public final Lio/reactivex/internal/util/EndConsumerHelper;
.super Ljava/lang/Object;
.source "EndConsumerHelper.java"
# direct methods
.method private constructor <init>()V
.locals 2
.line 37
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 38
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "No instances!"
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public static composeMessage(Ljava/lang/String;)Ljava/lang/String;
.locals 2
.line 137
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "It is not allowed to subscribe with a(n) "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, " multiple times. Please create a fresh instance of "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p0, " and subscribe that to the target source instead."
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
return-object p0
.end method
.method public static reportDoubleSubscription(Ljava/lang/Class;)V
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/lang/Class<",
"*>;)V"
}
.end annotation
.line 148
new-instance v0, Lio/reactivex/exceptions/ProtocolViolationException;
invoke-virtual {p0}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object p0
invoke-static {p0}, Lio/reactivex/internal/util/EndConsumerHelper;->composeMessage(Ljava/lang/String;)Ljava/lang/String;
move-result-object p0
invoke-direct {v0, p0}, Lio/reactivex/exceptions/ProtocolViolationException;-><init>(Ljava/lang/String;)V
invoke-static {v0}, Lio/reactivex/plugins/RxJavaPlugins;->onError(Ljava/lang/Throwable;)V
return-void
.end method
.method public static setOnce(Ljava/util/concurrent/atomic/AtomicReference;Lio/reactivex/disposables/Disposable;Ljava/lang/Class;)Z
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/concurrent/atomic/AtomicReference<",
"Lio/reactivex/disposables/Disposable;",
">;",
"Lio/reactivex/disposables/Disposable;",
"Ljava/lang/Class<",
"*>;)Z"
}
.end annotation
const-string v0, "next is null"
.line 75
invoke-static {p1, v0}, Lio/reactivex/internal/functions/ObjectHelper;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
const/4 v0, 0x0
.line 76
invoke-virtual {p0, v0, p1}, Ljava/util/concurrent/atomic/AtomicReference;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;)Z
move-result v0
if-nez v0, :cond_1
.line 77
invoke-interface {p1}, Lio/reactivex/disposables/Disposable;->dispose()V
.line 78
invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
move-result-object p0
sget-object p1, Lio/reactivex/internal/disposables/DisposableHelper;->DISPOSED:Lio/reactivex/internal/disposables/DisposableHelper;
if-eq p0, p1, :cond_0
.line 79
invoke-static {p2}, Lio/reactivex/internal/util/EndConsumerHelper;->reportDoubleSubscription(Ljava/lang/Class;)V
:cond_0
const/4 p0, 0x0
return p0
:cond_1
const/4 p0, 0x1
return p0
.end method
.method public static setOnce(Ljava/util/concurrent/atomic/AtomicReference;Lorg/reactivestreams/Subscription;Ljava/lang/Class;)Z
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/concurrent/atomic/AtomicReference<",
"Lorg/reactivestreams/Subscription;",
">;",
"Lorg/reactivestreams/Subscription;",
"Ljava/lang/Class<",
"*>;)Z"
}
.end annotation
const-string v0, "next is null"
.line 120
invoke-static {p1, v0}, Lio/reactivex/internal/functions/ObjectHelper;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
const/4 v0, 0x0
.line 121
invoke-virtual {p0, v0, p1}, Ljava/util/concurrent/atomic/AtomicReference;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;)Z
move-result v0
if-nez v0, :cond_1
.line 122
invoke-interface {p1}, Lorg/reactivestreams/Subscription;->cancel()V
.line 123
invoke-virtual {p0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
move-result-object p0
sget-object p1, Lio/reactivex/internal/subscriptions/SubscriptionHelper;->CANCELLED:Lio/reactivex/internal/subscriptions/SubscriptionHelper;
if-eq p0, p1, :cond_0
.line 124
invoke-static {p2}, Lio/reactivex/internal/util/EndConsumerHelper;->reportDoubleSubscription(Ljava/lang/Class;)V
:cond_0
const/4 p0, 0x0
return p0
:cond_1
const/4 p0, 0x1
return p0
.end method
.method public static validate(Lio/reactivex/disposables/Disposable;Lio/reactivex/disposables/Disposable;Ljava/lang/Class;)Z
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lio/reactivex/disposables/Disposable;",
"Lio/reactivex/disposables/Disposable;",
"Ljava/lang/Class<",
"*>;)Z"
}
.end annotation
const-string v0, "next is null"
.line 53
invoke-static {p1, v0}, Lio/reactivex/internal/functions/ObjectHelper;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
if-eqz p0, :cond_1
.line 55
invoke-interface {p1}, Lio/reactivex/disposables/Disposable;->dispose()V
.line 56
sget-object p1, Lio/reactivex/internal/disposables/DisposableHelper;->DISPOSED:Lio/reactivex/internal/disposables/DisposableHelper;
if-eq p0, p1, :cond_0
.line 57
invoke-static {p2}, Lio/reactivex/internal/util/EndConsumerHelper;->reportDoubleSubscription(Ljava/lang/Class;)V
:cond_0
const/4 p0, 0x0
return p0
:cond_1
const/4 p0, 0x1
return p0
.end method
.method public static validate(Lorg/reactivestreams/Subscription;Lorg/reactivestreams/Subscription;Ljava/lang/Class;)Z
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lorg/reactivestreams/Subscription;",
"Lorg/reactivestreams/Subscription;",
"Ljava/lang/Class<",
"*>;)Z"
}
.end annotation
const-string v0, "next is null"
.line 98
invoke-static {p1, v0}, Lio/reactivex/internal/functions/ObjectHelper;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
if-eqz p0, :cond_1
.line 100
invoke-interface {p1}, Lorg/reactivestreams/Subscription;->cancel()V
.line 101
sget-object p1, Lio/reactivex/internal/subscriptions/SubscriptionHelper;->CANCELLED:Lio/reactivex/internal/subscriptions/SubscriptionHelper;
if-eq p0, p1, :cond_0
.line 102
invoke-static {p2}, Lio/reactivex/internal/util/EndConsumerHelper;->reportDoubleSubscription(Ljava/lang/Class;)V
:cond_0
const/4 p0, 0x0
return p0
:cond_1
const/4 p0, 0x1
return p0
.end method