Skip to content

Commit bbd6e5f

Browse files
committed
Lambda unused parameter cleanup 4
1 parent 338bcbd commit bbd6e5f

18 files changed

Lines changed: 113 additions & 113 deletions

src/test/java/io/reactivex/rxjava4/internal/jdk8/MaybeFlattenStreamAsObservableTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,23 @@ public void successJust() {
4646
@Test
4747
public void successEmpty() {
4848
Maybe.just(1)
49-
.flattenStreamAsObservable(v -> Stream.of())
49+
.flattenStreamAsObservable(_ -> Stream.of())
5050
.test()
5151
.assertResult();
5252
}
5353

5454
@Test
5555
public void successMany() {
5656
Maybe.just(1)
57-
.flattenStreamAsObservable(v -> Stream.of(2, 3, 4, 5, 6))
57+
.flattenStreamAsObservable(_ -> Stream.of(2, 3, 4, 5, 6))
5858
.test()
5959
.assertResult(2, 3, 4, 5, 6);
6060
}
6161

6262
@Test
6363
public void successManyTake() {
6464
Maybe.just(1)
65-
.flattenStreamAsObservable(v -> Stream.of(2, 3, 4, 5, 6))
65+
.flattenStreamAsObservable(_ -> Stream.of(2, 3, 4, 5, 6))
6666
.take(3)
6767
.test()
6868
.assertResult(2, 3, 4);
@@ -97,7 +97,7 @@ public void error() throws Throwable {
9797
@Test
9898
public void mapperCrash() {
9999
Maybe.just(1)
100-
.flattenStreamAsObservable(v -> { throw new TestException(); })
100+
.flattenStreamAsObservable(_ -> { throw new TestException(); })
101101
.test()
102102
.assertFailure(TestException.class);
103103
}
@@ -118,7 +118,7 @@ public void fusedEmpty() {
118118
to.setInitialFusionMode(QueueFuseable.ANY);
119119

120120
Maybe.just(1)
121-
.flattenStreamAsObservable(v -> Stream.<Integer>of())
121+
.flattenStreamAsObservable(_ -> Stream.<Integer>of())
122122
.subscribe(to);
123123

124124
to.assertFuseable()
@@ -327,7 +327,7 @@ public Integer next() {
327327
});
328328

329329
Maybe.just(1)
330-
.flattenStreamAsObservable(v -> stream)
330+
.flattenStreamAsObservable(_ -> stream)
331331
.test()
332332
.assertFailure(TestException.class, 1);
333333
}
@@ -350,7 +350,7 @@ public Integer next() {
350350
});
351351

352352
Maybe.just(1)
353-
.flattenStreamAsObservable(v -> stream)
353+
.flattenStreamAsObservable(_ -> stream)
354354
.test()
355355
.assertFailure(TestException.class);
356356
}
@@ -381,7 +381,7 @@ public Integer next() {
381381
});
382382

383383
Maybe.just(1)
384-
.flattenStreamAsObservable(v -> stream)
384+
.flattenStreamAsObservable(_ -> stream)
385385
.subscribeWith(to)
386386
.assertValuesOnly(1);
387387
}
@@ -408,7 +408,7 @@ public Integer next() {
408408
});
409409

410410
Maybe.just(1)
411-
.flattenStreamAsObservable(v -> stream)
411+
.flattenStreamAsObservable(_ -> stream)
412412
.subscribeWith(to)
413413
.assertEmpty();
414414
}

src/test/java/io/reactivex/rxjava4/internal/jdk8/MaybeMapOptionalTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void successSuccess() {
3838
@Test
3939
public void successEmpty() {
4040
Maybe.just(1)
41-
.mapOptional(v -> Optional.empty())
41+
.mapOptional(_ -> Optional.empty())
4242
.test()
4343
.assertResult();
4444
}
@@ -72,7 +72,7 @@ public void error() throws Throwable {
7272
@Test
7373
public void mapperCrash() {
7474
Maybe.just(1)
75-
.mapOptional(v -> { throw new TestException(); })
75+
.mapOptional(_ -> { throw new TestException(); })
7676
.test()
7777
.assertFailure(TestException.class);
7878
}

src/test/java/io/reactivex/rxjava4/internal/jdk8/ObservableFlatMapStreamTest.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class ObservableFlatMapStreamTest extends RxJavaTest {
3636
@Test
3737
public void empty() {
3838
Observable.empty()
39-
.flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
39+
.flatMapStream(_ -> Stream.of(1, 2, 3, 4, 5))
4040
.test()
4141
.assertResult();
4242
}
@@ -45,7 +45,7 @@ public void empty() {
4545
public void emptyHidden() {
4646
Observable.empty()
4747
.hide()
48-
.flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
48+
.flatMapStream(_ -> Stream.of(1, 2, 3, 4, 5))
4949
.test()
5050
.assertResult();
5151
}
@@ -69,15 +69,15 @@ public void justHidden() {
6969
@Test
7070
public void error() {
7171
Observable.error(new TestException())
72-
.flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
72+
.flatMapStream(_ -> Stream.of(1, 2, 3, 4, 5))
7373
.test()
7474
.assertFailure(TestException.class);
7575
}
7676

7777
@Test
7878
public void supplierFusedError() {
7979
Observable.fromCallable(() -> { throw new TestException(); })
80-
.flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
80+
.flatMapStream(_ -> Stream.of(1, 2, 3, 4, 5))
8181
.test()
8282
.assertFailure(TestException.class);
8383
}
@@ -86,7 +86,7 @@ public void supplierFusedError() {
8686
public void errorHidden() {
8787
Observable.error(new TestException())
8888
.hide()
89-
.flatMapStream(v -> Stream.of(1, 2, 3, 4, 5))
89+
.flatMapStream(_ -> Stream.of(1, 2, 3, 4, 5))
9090
.test()
9191
.assertFailure(TestException.class);
9292
}
@@ -123,7 +123,7 @@ public void rangeHidden() {
123123
@Test
124124
public void rangeToEmpty() {
125125
Observable.range(1, 5)
126-
.flatMapStream(v -> Stream.of())
126+
.flatMapStream(_ -> Stream.of())
127127
.test()
128128
.assertResult();
129129
}
@@ -222,37 +222,37 @@ public void crossMapHidden() {
222222

223223
@Test
224224
public void onSubscribe() {
225-
TestHelper.checkDoubleOnSubscribeObservable(f -> f.flatMapStream(v -> Stream.of(1, 2)));
225+
TestHelper.checkDoubleOnSubscribeObservable(f -> f.flatMapStream(_ -> Stream.of(1, 2)));
226226
}
227227

228228
@Test
229229
public void mapperThrows() {
230230
Observable.just(1).hide()
231-
.concatMapStream(v -> { throw new TestException(); })
231+
.concatMapStream(_ -> { throw new TestException(); })
232232
.test()
233233
.assertFailure(TestException.class);
234234
}
235235

236236
@Test
237237
public void mapperNull() {
238238
Observable.just(1).hide()
239-
.concatMapStream(v -> null)
239+
.concatMapStream(_ -> null)
240240
.test()
241241
.assertFailure(NullPointerException.class);
242242
}
243243

244244
@Test
245245
public void streamNull() {
246246
Observable.just(1).hide()
247-
.concatMapStream(v -> Stream.of(1, null))
247+
.concatMapStream(_ -> Stream.of(1, null))
248248
.test()
249249
.assertFailure(NullPointerException.class, 1);
250250
}
251251

252252
@Test
253253
public void hasNextThrows() {
254254
Observable.just(1).hide()
255-
.concatMapStream(v -> Stream.generate(() -> { throw new TestException(); }))
255+
.concatMapStream(_ -> Stream.generate(() -> { throw new TestException(); }))
256256
.test()
257257
.assertFailure(TestException.class);
258258
}
@@ -261,7 +261,7 @@ public void hasNextThrows() {
261261
public void hasNextThrowsLater() {
262262
AtomicInteger counter = new AtomicInteger();
263263
Observable.just(1).hide()
264-
.concatMapStream(v -> Stream.generate(() -> {
264+
.concatMapStream(_ -> Stream.generate(() -> {
265265
if (counter.getAndIncrement() == 0) {
266266
return 1;
267267
}
@@ -279,7 +279,7 @@ public void mapperThrowsWhenUpstreamErrors() throws Throwable {
279279
AtomicInteger counter = new AtomicInteger();
280280

281281
TestObserver<Integer> to = ps.hide()
282-
.concatMapStream(v -> {
282+
.concatMapStream(_ -> {
283283
if (counter.getAndIncrement() == 0) {
284284
return Stream.of(1, 2);
285285
}
@@ -320,7 +320,7 @@ public Integer next() {
320320

321321
Observable.just(1)
322322
.hide()
323-
.concatMapStream(v -> stream)
323+
.concatMapStream(_ -> stream)
324324
.subscribe(to);
325325

326326
to.assertEmpty();
@@ -348,7 +348,7 @@ public Integer next() {
348348

349349
Observable.just(1)
350350
.hide()
351-
.concatMapStream(v -> stream)
351+
.concatMapStream(_ -> stream)
352352
.subscribe(to);
353353

354354
to.assertEmpty();
@@ -358,7 +358,7 @@ public Integer next() {
358358
public void asyncUpstreamFused() {
359359
UnicastSubject<Integer> us = UnicastSubject.create();
360360

361-
TestObserver<Integer> to = us.flatMapStream(v -> Stream.of(1, 2))
361+
TestObserver<Integer> to = us.flatMapStream(_ -> Stream.of(1, 2))
362362
.test();
363363

364364
assertTrue(us.hasObservers());
@@ -378,7 +378,7 @@ public void asyncUpstreamFusionBoundary() {
378378

379379
TestObserver<Integer> to = us
380380
.map(v -> v + 1)
381-
.flatMapStream(v -> Stream.of(1, 2))
381+
.flatMapStream(_ -> Stream.of(1, 2))
382382
.test();
383383

384384
assertTrue(us.hasObservers());
@@ -397,9 +397,9 @@ public void fusedPollCrash() {
397397
UnicastSubject<Integer> us = UnicastSubject.create();
398398

399399
TestObserver<Integer> to = us
400-
.map(v -> { throw new TestException(); })
400+
.map(_ -> { throw new TestException(); })
401401
.compose(TestHelper.observableStripBoundary())
402-
.flatMapStream(v -> Stream.of(1, 2))
402+
.flatMapStream(_ -> Stream.of(1, 2))
403403
.test();
404404

405405
assertTrue(us.hasObservers());
@@ -413,7 +413,7 @@ public void fusedPollCrash() {
413413

414414
@Test
415415
public void dispose() {
416-
TestHelper.checkDisposed(PublishSubject.create().flatMapStream(v -> Stream.of(1)));
416+
TestHelper.checkDisposed(PublishSubject.create().flatMapStream(_ -> Stream.of(1)));
417417
}
418418

419419
@Test
@@ -429,7 +429,7 @@ protected void subscribeActual(@NonNull Observer<? super Integer> observer) {
429429
observer.onComplete();
430430
}
431431
}
432-
.flatMapStream(v -> {
432+
.flatMapStream(_ -> {
433433
calls.getAndIncrement();
434434
throw new TestException();
435435
})
@@ -453,7 +453,7 @@ protected void subscribeActual(@NonNull Observer<? super Integer> observer) {
453453
observer.onComplete();
454454
}
455455
}
456-
.flatMapStream(v -> {
456+
.flatMapStream(_ -> {
457457
calls.getAndIncrement();
458458
return Stream.of(1);
459459
})

src/test/java/io/reactivex/rxjava4/internal/jdk8/ObservableFromStreamTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,23 +79,23 @@ public void take() {
7979
@Test
8080
public void emptyConditional() {
8181
Observable.fromStream(Stream.<Integer>of())
82-
.filter(v -> true)
82+
.filter(_ -> true)
8383
.test()
8484
.assertResult();
8585
}
8686

8787
@Test
8888
public void justConditional() {
8989
Observable.fromStream(Stream.<Integer>of(1))
90-
.filter(v -> true)
90+
.filter(_ -> true)
9191
.test()
9292
.assertResult(1);
9393
}
9494

9595
@Test
9696
public void manyConditional() {
9797
Observable.fromStream(Stream.<Integer>of(1, 2, 3, 4, 5))
98-
.filter(v -> true)
98+
.filter(_ -> true)
9999
.test()
100100
.assertResult(1, 2, 3, 4, 5);
101101
}
@@ -111,7 +111,7 @@ public void manyConditionalSkip() {
111111
@Test
112112
public void takeConditional() {
113113
Observable.fromStream(IntStream.rangeClosed(1, 10).boxed())
114-
.filter(v -> true)
114+
.filter(_ -> true)
115115
.take(5)
116116
.test()
117117
.assertResult(1, 2, 3, 4, 5);
@@ -248,7 +248,7 @@ public void streamOfNull() {
248248
@Test
249249
public void streamOfNullConditional() {
250250
Observable.fromStream(Stream.of((Integer)null))
251-
.filter(v -> true)
251+
.filter(_ -> true)
252252
.test()
253253
.assertFailure(NullPointerException.class);
254254
}
@@ -328,7 +328,7 @@ public void hasNextCrashConditional() {
328328
}
329329
return value;
330330
}))
331-
.filter(v -> true)
331+
.filter(_ -> true)
332332
.test()
333333
.assertFailure(TestException.class, 0);
334334
}
@@ -389,7 +389,7 @@ public void closeCalledAfterItemsConditional() {
389389
AtomicInteger calls = new AtomicInteger();
390390

391391
Observable.fromStream(Stream.of(1, 2, 3, 4, 5).onClose(() -> calls.getAndIncrement()))
392-
.filter(v -> true)
392+
.filter(_ -> true)
393393
.test()
394394
.assertResult(1, 2, 3, 4, 5);
395395

@@ -401,7 +401,7 @@ public void closeCalledOnCancelConditional() {
401401
AtomicInteger calls = new AtomicInteger();
402402

403403
Observable.fromStream(Stream.of(1, 2, 3, 4, 5).onClose(() -> calls.getAndIncrement()))
404-
.filter(v -> true)
404+
.filter(_ -> true)
405405
.take(3)
406406
.test()
407407
.assertResult(1, 2, 3);
@@ -420,7 +420,7 @@ public void closeCalledOnItemCrashConditional() {
420420
}
421421
return value;
422422
}).onClose(() -> calls.getAndIncrement()))
423-
.filter(v -> true)
423+
.filter(_ -> true)
424424
.test()
425425
.assertFailure(TestException.class, 0);
426426

0 commit comments

Comments
 (0)