From 6f4c2e70b68719a7c4e979baf9daaba3b9683f5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Karnok?= Date: Sun, 22 Dec 2019 12:51:08 +0100 Subject: [PATCH] 3.x: Remove now unnecessary unchecked warning suppressions --- .../io/reactivex/rxjava3/core/MemoryPerf.java | 4 +- .../rxjava3/core/OperatorMergePerf.java | 2 +- .../rxjava3/flowable/FlowableCollectTest.java | 2 - .../rxjava3/flowable/FlowableConcatTests.java | 1 - .../rxjava3/flowable/FlowableNullTests.java | 16 ------ .../rxjava3/flowable/FlowableTests.java | 2 - .../CompletableMaterializeTest.java | 2 - .../operators/flowable/FlowableAmbTest.java | 22 -------- .../flowable/FlowableBufferTest.java | 51 ------------------- .../flowable/FlowableCombineLatestTest.java | 13 ----- .../FlowableConcatDelayErrorTest.java | 2 - .../flowable/FlowableConcatMapEagerTest.java | 17 ------- .../flowable/FlowableConcatTest.java | 20 ++------ .../flowable/FlowableGroupByTest.java | 1 - .../flowable/FlowableMergeDelayErrorTest.java | 6 --- .../operators/flowable/FlowableMergeTest.java | 2 - .../flowable/FlowablePublishTest.java | 2 - .../flowable/FlowableTimeIntervalTest.java | 1 - .../flowable/FlowableToListTest.java | 8 --- .../flowable/FlowableToSortedListTest.java | 4 -- .../FlowableWindowWithFlowableTest.java | 2 - .../flowable/FlowableWindowWithSizeTest.java | 4 -- ...lowableWindowWithStartEndFlowableTest.java | 2 - .../flowable/FlowableWindowWithTimeTest.java | 4 -- .../flowable/FlowableWithLatestFromTest.java | 1 - .../operators/flowable/FlowableZipTest.java | 2 - .../operators/maybe/MaybeAmbTest.java | 4 -- .../maybe/MaybeConcatIterableTest.java | 5 -- .../operators/maybe/MaybeMaterializeTest.java | 3 -- .../operators/maybe/MaybeOnErrorXTest.java | 3 -- .../operators/maybe/MaybeZipIterableTest.java | 10 ---- .../observable/ObservableAmbTest.java | 2 - .../observable/ObservableBufferTest.java | 40 --------------- .../observable/ObservableCollectTest.java | 2 - .../ObservableCombineLatestTest.java | 6 --- .../ObservableConcatMapEagerTest.java | 3 -- .../observable/ObservableConcatTest.java | 11 ++-- .../ObservableMergeDelayErrorTest.java | 4 -- .../ObservableTimeIntervalTest.java | 1 - .../observable/ObservableToListTest.java | 8 --- .../ObservableToSortedListTest.java | 4 -- .../ObservableWindowWithSizeTest.java | 3 -- ...vableWindowWithStartEndObservableTest.java | 2 - .../ObservableWithLatestFromTest.java | 1 - .../observable/ObservableZipTest.java | 1 - .../operators/single/SingleAmbTest.java | 4 -- .../operators/single/SingleConcatTest.java | 2 - .../single/SingleMaterializeTest.java | 2 - .../operators/single/SingleMergeTest.java | 1 - .../single/SingleZipIterableTest.java | 11 ---- .../operators/single/SingleZipTest.java | 1 - .../io/reactivex/rxjava3/maybe/MaybeTest.java | 20 -------- .../observable/ObservableConcatTests.java | 1 - .../observable/ObservableNullTests.java | 14 ----- .../rxjava3/observable/ObservableTest.java | 2 - .../rxjava3/parallel/ParallelCollectTest.java | 4 -- .../parallel/ParallelDoOnNextTryTest.java | 2 - .../parallel/ParallelFilterTryTest.java | 2 - .../parallel/ParallelFlowableTest.java | 1 - .../rxjava3/parallel/ParallelMapTryTest.java | 2 - .../rxjava3/parallel/ParallelReduceTest.java | 4 -- .../rxjava3/single/SingleNullTests.java | 7 --- .../reactivex/rxjava3/single/SingleTest.java | 2 - .../rxjava3/tck/AmbArrayTckTest.java | 1 - .../io/reactivex/rxjava3/tck/AmbTckTest.java | 1 - ...ombineLatestIterableDelayErrorTckTest.java | 1 - .../tck/CombineLatestIterableTckTest.java | 1 - .../rxjava3/tck/ConcatArrayEagerTckTest.java | 1 - .../tck/ConcatIterableEagerTckTest.java | 1 - .../rxjava3/tck/MergeIterableTckTest.java | 1 - .../rxjava3/tck/RefCountProcessor.java | 2 +- .../rxjava3/tck/ZipIterableTckTest.java | 1 - .../testsupport/BaseTestConsumerEx.java | 2 + 73 files changed, 12 insertions(+), 388 deletions(-) diff --git a/src/jmh/java/io/reactivex/rxjava3/core/MemoryPerf.java b/src/jmh/java/io/reactivex/rxjava3/core/MemoryPerf.java index 7679ec5346..b7ed7e4ae1 100644 --- a/src/jmh/java/io/reactivex/rxjava3/core/MemoryPerf.java +++ b/src/jmh/java/io/reactivex/rxjava3/core/MemoryPerf.java @@ -184,7 +184,7 @@ public Object call() throws Exception { checkMemory(new Callable() { @Override public Object call() throws Exception { - return new io.reactivex.rxjava3.observers.TestObserver(); + return new io.reactivex.rxjava3.observers.TestObserver<>(); } }, "test-consumer", "Rx2Observable"); @@ -374,7 +374,7 @@ public Object call() throws Exception { checkMemory(new Callable() { @Override public Object call() throws Exception { - return new io.reactivex.rxjava3.observers.TestObserver(); + return new io.reactivex.rxjava3.observers.TestObserver<>(); } }, "test-consumer", "Rx2Flowable"); diff --git a/src/jmh/java/io/reactivex/rxjava3/core/OperatorMergePerf.java b/src/jmh/java/io/reactivex/rxjava3/core/OperatorMergePerf.java index 7d68316c83..560736c86c 100644 --- a/src/jmh/java/io/reactivex/rxjava3/core/OperatorMergePerf.java +++ b/src/jmh/java/io/reactivex/rxjava3/core/OperatorMergePerf.java @@ -134,7 +134,7 @@ public static class InputForMergeN { @Setup public void setup(final Blackhole bh) { this.bh = bh; - observables = new ArrayList>(); + observables = new ArrayList<>(); for (int i = 0; i < size; i++) { observables.add(Flowable.just(i)); } diff --git a/src/test/java/io/reactivex/rxjava3/flowable/FlowableCollectTest.java b/src/test/java/io/reactivex/rxjava3/flowable/FlowableCollectTest.java index ae3cd0c906..ea93877cdc 100644 --- a/src/test/java/io/reactivex/rxjava3/flowable/FlowableCollectTest.java +++ b/src/test/java/io/reactivex/rxjava3/flowable/FlowableCollectTest.java @@ -167,7 +167,6 @@ public void accept(Object o, Integer t) { assertFalse(added.get()); } - @SuppressWarnings("unchecked") @Test public void collectIntoFlowable() { Flowable.just(1, 1, 1, 1, 2) @@ -316,7 +315,6 @@ public void accept(Object o, Integer t) { assertFalse(added.get()); } - @SuppressWarnings("unchecked") @Test public void collectInto() { Flowable.just(1, 1, 1, 1, 2) diff --git a/src/test/java/io/reactivex/rxjava3/flowable/FlowableConcatTests.java b/src/test/java/io/reactivex/rxjava3/flowable/FlowableConcatTests.java index e800a9173c..5d54f9df5f 100644 --- a/src/test/java/io/reactivex/rxjava3/flowable/FlowableConcatTests.java +++ b/src/test/java/io/reactivex/rxjava3/flowable/FlowableConcatTests.java @@ -61,7 +61,6 @@ public void concatWithIterableOfFlowable() { Flowable f2 = Flowable.just("three", "four"); Flowable f3 = Flowable.just("five", "six"); - @SuppressWarnings("unchecked") Iterable> is = Arrays.asList(f1, f2, f3); List values = Flowable.concat(Flowable.fromIterable(is)).toList().blockingGet(); diff --git a/src/test/java/io/reactivex/rxjava3/flowable/FlowableNullTests.java b/src/test/java/io/reactivex/rxjava3/flowable/FlowableNullTests.java index 0e85aa8a40..668a7acf92 100644 --- a/src/test/java/io/reactivex/rxjava3/flowable/FlowableNullTests.java +++ b/src/test/java/io/reactivex/rxjava3/flowable/FlowableNullTests.java @@ -47,7 +47,6 @@ public void ambVarargsNull() { Flowable.ambArray((Publisher[])null); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void ambVarargsOneIsNull() { Flowable.ambArray(Flowable.never(), null).blockingLast(); @@ -68,7 +67,6 @@ public Iterator> iterator() { }).test().assertError(NullPointerException.class); } - @SuppressWarnings("unchecked") @Test public void ambIterableOneIsNull() { Flowable.amb(Arrays.asList(Flowable.never(), null)) @@ -101,7 +99,6 @@ public Object apply(Object[] v) { }).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void combineLatestIterableOneIsNull() { Flowable.combineLatestDelayError(Arrays.asList(Flowable.never(), null), new Function() { @@ -112,13 +109,11 @@ public Object apply(Object[] v) { }).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void combineLatestIterableFunctionNull() { Flowable.combineLatestDelayError(Arrays.asList(just1), null); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void combineLatestIterableFunctionReturnsNull() { Flowable.combineLatestDelayError(Arrays.asList(just1), new Function() { @@ -144,7 +139,6 @@ public Iterator> iterator() { }).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void concatIterableOneIsNull() { Flowable.concat(Arrays.asList(just1, null)).blockingLast(); @@ -161,7 +155,6 @@ public void concatArrayNull() { Flowable.concatArray((Publisher[])null); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void concatArrayOneIsNull() { Flowable.concatArray(just1, null).blockingLast(); @@ -480,7 +473,6 @@ public Iterator> iterator() { }, 128, 128).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void mergeIterableOneIsNull() { Flowable.merge(Arrays.asList(just1, null), 128, 128).blockingLast(); @@ -512,7 +504,6 @@ public Iterator> iterator() { }, 128, 128).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void mergeDelayErrorIterableOneIsNull() { Flowable.mergeDelayError(Arrays.asList(just1, null), 128, 128).blockingLast(); @@ -634,13 +625,11 @@ public Object apply(Object[] v) { }).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void zipIterableFunctionNull() { Flowable.zip(Arrays.asList(just1, just1), null); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void zipIterableFunctionReturnsNull() { Flowable.zip(Arrays.asList(just1, just1), new Function() { @@ -676,13 +665,11 @@ public Object apply(Object[] a) { }, true, 128).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void zipIterable2FunctionNull() { Flowable.zip(Arrays.asList(just1, just1), null, true, 128); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void zipIterable2FunctionReturnsNull() { Flowable.zip(Arrays.asList(just1, just1), new Function() { @@ -2679,7 +2666,6 @@ public void unsafeSubscribeNull() { just1.subscribe((FlowableSubscriber)null); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void combineLatestDelayErrorIterableFunctionReturnsNull() { Flowable.combineLatestDelayError(Arrays.asList(just1), new Function() { @@ -2690,7 +2676,6 @@ public Object apply(Object[] v) { }, 128).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void combineLatestDelayErrorIterableFunctionNull() { Flowable.combineLatestDelayError(Arrays.asList(just1), null, 128); @@ -2731,7 +2716,6 @@ public void doOnDisposeNull() { just1.doOnCancel(null); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void combineLatestDelayErrorIterableOneIsNull() { Flowable.combineLatestDelayError(Arrays.asList(Flowable.never(), null), new Function() { diff --git a/src/test/java/io/reactivex/rxjava3/flowable/FlowableTests.java b/src/test/java/io/reactivex/rxjava3/flowable/FlowableTests.java index 616140c6b9..3d462efe0b 100644 --- a/src/test/java/io/reactivex/rxjava3/flowable/FlowableTests.java +++ b/src/test/java/io/reactivex/rxjava3/flowable/FlowableTests.java @@ -1074,7 +1074,6 @@ public void toObservableError() { @Test public void zipIterableObject() { - @SuppressWarnings("unchecked") final List> flowables = Arrays.asList(Flowable.just(1, 2, 3), Flowable.just(1, 2, 3)); Flowable.zip(flowables, new Function() { @Override @@ -1090,7 +1089,6 @@ public Object apply(Object[] o) throws Exception { @Test public void combineLatestObject() { - @SuppressWarnings("unchecked") final List> flowables = Arrays.asList(Flowable.just(1, 2, 3), Flowable.just(1, 2, 3)); Flowable.combineLatest(flowables, new Function() { @Override diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/completable/CompletableMaterializeTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/completable/CompletableMaterializeTest.java index 23b4e25731..aa77e6a975 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/completable/CompletableMaterializeTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/completable/CompletableMaterializeTest.java @@ -24,7 +24,6 @@ public class CompletableMaterializeTest extends RxJavaTest { @Test - @SuppressWarnings("unchecked") public void error() { TestException ex = new TestException(); Completable.error(ex) @@ -34,7 +33,6 @@ public void error() { } @Test - @SuppressWarnings("unchecked") public void empty() { Completable.complete() .materialize() diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableAmbTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableAmbTest.java index 42cba044db..0657a15474 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableAmbTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableAmbTest.java @@ -102,7 +102,6 @@ public void amb() { Flowable flowable3 = createFlowable(new String[] { "3", "33", "333", "3333" }, 3000, null); - @SuppressWarnings("unchecked") Flowable f = Flowable.ambArray(flowable1, flowable2, flowable3); @@ -131,7 +130,6 @@ public void amb2() { Flowable flowable3 = createFlowable(new String[] {}, 3000, new IOException("fake exception")); - @SuppressWarnings("unchecked") Flowable f = Flowable.ambArray(flowable1, flowable2, flowable3); @@ -158,7 +156,6 @@ public void amb3() { Flowable flowable3 = createFlowable(new String[] { "3" }, 3000, null); - @SuppressWarnings("unchecked") Flowable f = Flowable.ambArray(flowable1, flowable2, flowable3); @@ -171,7 +168,6 @@ public void amb3() { inOrder.verifyNoMoreInteractions(); } - @SuppressWarnings("unchecked") @Test public void producerRequestThroughAmb() { TestSubscriber ts = new TestSubscriber<>(0L); @@ -237,7 +233,6 @@ public void backpressure() { assertEquals(Flowable.bufferSize() * 2, ts.values().size()); } - @SuppressWarnings("unchecked") @Test public void subscriptionOnlyHappensOnce() throws InterruptedException { final AtomicLong count = new AtomicLong(); @@ -262,7 +257,6 @@ public void accept(Subscription s) { assertEquals(2, count.get()); } - @SuppressWarnings("unchecked") @Test public void secondaryRequestsPropagatedToChildren() throws InterruptedException { //this aync stream should emit first @@ -302,7 +296,6 @@ public void accept(Integer t) { assertEquals(1, result); } - @SuppressWarnings("unchecked") @Test public void ambCancelsOthers() { PublishProcessor source1 = PublishProcessor.create(); @@ -347,7 +340,6 @@ public void multipleUse() { ts2.assertNoErrors(); } - @SuppressWarnings("unchecked") @Test public void ambIterable() { PublishProcessor pp1 = PublishProcessor.create(); @@ -370,7 +362,6 @@ public void ambIterable() { ts.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void ambIterable2() { PublishProcessor pp1 = PublishProcessor.create(); @@ -393,19 +384,16 @@ public void ambIterable2() { ts.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void ambArrayEmpty() { assertSame(Flowable.empty(), Flowable.ambArray()); } - @SuppressWarnings("unchecked") @Test public void ambArraySingleElement() { assertSame(Flowable.never(), Flowable.ambArray(Flowable.never())); } - @SuppressWarnings("unchecked") @Test public void disposed() { TestHelper.checkDisposed(Flowable.ambArray(Flowable.never(), Flowable.never())); @@ -442,7 +430,6 @@ public void onNextRace() { final PublishProcessor pp1 = PublishProcessor.create(); final PublishProcessor pp2 = PublishProcessor.create(); - @SuppressWarnings("unchecked") TestSubscriberEx ts = Flowable.ambArray(pp1, pp2).to(TestHelper.testConsumer()); Runnable r1 = new Runnable() { @@ -471,7 +458,6 @@ public void onCompleteRace() { final PublishProcessor pp1 = PublishProcessor.create(); final PublishProcessor pp2 = PublishProcessor.create(); - @SuppressWarnings("unchecked") TestSubscriber ts = Flowable.ambArray(pp1, pp2).test(); Runnable r1 = new Runnable() { @@ -499,7 +485,6 @@ public void onErrorRace() { final PublishProcessor pp1 = PublishProcessor.create(); final PublishProcessor pp2 = PublishProcessor.create(); - @SuppressWarnings("unchecked") TestSubscriber ts = Flowable.ambArray(pp1, pp2).test(); final Throwable ex = new TestException(); @@ -531,7 +516,6 @@ public void run() { } } - @SuppressWarnings("unchecked") @Test public void nullIterableElement() { Flowable.amb(Arrays.asList(Flowable.never(), null, Flowable.never())) @@ -575,21 +559,18 @@ public void ambWithOrder() { Flowable.just(1).ambWith(error).test().assertValue(1).assertComplete(); } - @SuppressWarnings("unchecked") @Test public void ambIterableOrder() { Flowable error = Flowable.error(new RuntimeException()); Flowable.amb(Arrays.asList(Flowable.just(1), error)).test().assertValue(1).assertComplete(); } - @SuppressWarnings("unchecked") @Test public void ambArrayOrder() { Flowable error = Flowable.error(new RuntimeException()); Flowable.ambArray(Flowable.just(1), error).test().assertValue(1).assertComplete(); } - @SuppressWarnings("unchecked") @Test public void noWinnerSuccessDispose() throws Exception { for (int i = 0; i < TestHelper.RACE_LONG_LOOPS; i++) { @@ -615,7 +596,6 @@ public void accept(Object v) throws Exception { } } - @SuppressWarnings("unchecked") @Test public void noWinnerErrorDispose() throws Exception { final TestException ex = new TestException(); @@ -642,7 +622,6 @@ public void accept(Throwable e) throws Exception { } } - @SuppressWarnings("unchecked") @Test public void noWinnerCompleteDispose() throws Exception { for (int i = 0; i < TestHelper.RACE_LONG_LOOPS; i++) { @@ -668,7 +647,6 @@ public void run() throws Exception { } } - @SuppressWarnings("unchecked") @Test public void publishersInIterable() { Publisher source = new Publisher() { diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableBufferTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableBufferTest.java index 707d98e0d4..87a0eeaf38 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableBufferTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableBufferTest.java @@ -988,7 +988,6 @@ public void onComplete() { assertFalse(s.isDisposed()); } - @SuppressWarnings("unchecked") @Test public void postCompleteBackpressure() { Flowable> source = Flowable.range(1, 10).buffer(3, 1); @@ -1064,7 +1063,6 @@ public void postCompleteBackpressure() { ts.assertNoErrors(); } - @SuppressWarnings("unchecked") @Test public void timeAndSkipOverlap() { @@ -1104,7 +1102,6 @@ public void timeAndSkipOverlap() { ts.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void timeAndSkipSkip() { @@ -1141,7 +1138,6 @@ public void timeAndSkipSkip() { ts.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void timeAndSkipOverlapScheduler() { @@ -1192,7 +1188,6 @@ public Scheduler apply(Scheduler t) { } } - @SuppressWarnings("unchecked") @Test public void timeAndSkipSkipDefaultScheduler() { RxJavaPlugins.setComputationSchedulerHandler(new Function() { @@ -1240,7 +1235,6 @@ public Scheduler apply(Scheduler t) { } } - @SuppressWarnings("unchecked") @Test public void bufferBoundaryHint() { Flowable.range(1, 5).buffer(Flowable.timer(1, TimeUnit.MINUTES), 2) @@ -1252,7 +1246,6 @@ static HashSet set(Integer... values) { return new HashSet<>(Arrays.asList(values)); } - @SuppressWarnings("unchecked") @Test public void bufferIntoCustomCollection() { Flowable.just(1, 1, 2, 2, 3, 3, 4, 4) @@ -1266,7 +1259,6 @@ public Collection get() throws Exception { .assertResult(set(1, 2), set(2, 3), set(4)); } - @SuppressWarnings("unchecked") @Test public void bufferSkipIntoCustomCollection() { Flowable.just(1, 1, 2, 2, 3, 3, 4, 4) @@ -1280,7 +1272,6 @@ public Collection get() throws Exception { .assertResult(set(1, 2), set(2, 3), set(4)); } - @SuppressWarnings("unchecked") @Test public void bufferTimeSkipDefault() { Flowable.range(1, 5).buffer(1, 1, TimeUnit.MINUTES) @@ -1307,7 +1298,6 @@ public void dispose() { } @Test - @SuppressWarnings("unchecked") public void supplierReturnsNull() { Flowable.never() .buffer(1, TimeUnit.MILLISECONDS, Schedulers.single(), Integer.MAX_VALUE, new Supplier>() { @@ -1327,7 +1317,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierReturnsNull2() { Flowable.never() .buffer(1, TimeUnit.MILLISECONDS, Schedulers.single(), 10, new Supplier>() { @@ -1347,7 +1336,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierReturnsNull3() { Flowable.never() .buffer(2, 1, TimeUnit.MILLISECONDS, Schedulers.single(), new Supplier>() { @@ -1367,7 +1355,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierThrows() { Flowable.just(1) .buffer(1, TimeUnit.SECONDS, Schedulers.single(), Integer.MAX_VALUE, new Supplier>() { @@ -1381,7 +1368,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierThrows2() { Flowable.just(1) .buffer(1, TimeUnit.SECONDS, Schedulers.single(), 10, new Supplier>() { @@ -1395,7 +1381,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierThrows3() { Flowable.just(1) .buffer(2, 1, TimeUnit.SECONDS, Schedulers.single(), new Supplier>() { @@ -1409,7 +1394,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierThrows4() { Flowable.never() .buffer(1, TimeUnit.MILLISECONDS, Schedulers.single(), Integer.MAX_VALUE, new Supplier>() { @@ -1429,7 +1413,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierThrows5() { Flowable.never() .buffer(1, TimeUnit.MILLISECONDS, Schedulers.single(), 10, new Supplier>() { @@ -1449,7 +1432,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierThrows6() { Flowable.never() .buffer(2, 1, TimeUnit.MILLISECONDS, Schedulers.single(), new Supplier>() { @@ -1468,7 +1450,6 @@ public Collection get() throws Exception { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void restartTimer() { Flowable.range(1, 5) @@ -1477,7 +1458,6 @@ public void restartTimer() { .assertResult(Arrays.asList(1, 2), Arrays.asList(3, 4), Arrays.asList(5)); } - @SuppressWarnings("unchecked") @Test public void bufferSkipError() { Flowable.error(new TestException()) @@ -1486,7 +1466,6 @@ public void bufferSkipError() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void bufferSupplierCrash2() { Flowable.range(1, 2) @@ -1504,7 +1483,6 @@ public List get() throws Exception { .assertFailure(TestException.class, Arrays.asList(1)); } - @SuppressWarnings("unchecked") @Test public void bufferSkipSupplierCrash2() { Flowable.range(1, 2) @@ -1522,7 +1500,6 @@ public List get() throws Exception { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void bufferOverlapSupplierCrash2() { Flowable.range(1, 2) @@ -1540,7 +1517,6 @@ public List get() throws Exception { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void bufferSkipOverlap() { Flowable.range(1, 5) @@ -1555,7 +1531,6 @@ public void bufferSkipOverlap() { ); } - @SuppressWarnings("unchecked") @Test public void bufferTimedExactError() { Flowable.error(new TestException()) @@ -1564,7 +1539,6 @@ public void bufferTimedExactError() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void bufferTimedSkipError() { Flowable.error(new TestException()) @@ -1573,7 +1547,6 @@ public void bufferTimedSkipError() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void bufferTimedOverlapError() { Flowable.error(new TestException()) @@ -1582,7 +1555,6 @@ public void bufferTimedOverlapError() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void bufferTimedExactEmpty() { Flowable.empty() @@ -1591,7 +1563,6 @@ public void bufferTimedExactEmpty() { .assertResult(Collections.emptyList()); } - @SuppressWarnings("unchecked") @Test public void bufferTimedSkipEmpty() { Flowable.empty() @@ -1600,7 +1571,6 @@ public void bufferTimedSkipEmpty() { .assertResult(Collections.emptyList()); } - @SuppressWarnings("unchecked") @Test public void bufferTimedOverlapEmpty() { Flowable.empty() @@ -1609,7 +1579,6 @@ public void bufferTimedOverlapEmpty() { .assertResult(Collections.emptyList()); } - @SuppressWarnings("unchecked") @Test public void bufferTimedExactSupplierCrash() { TestScheduler scheduler = new TestScheduler(); @@ -1639,7 +1608,6 @@ public List get() throws Exception { .assertFailure(TestException.class, Arrays.asList(1)); } - @SuppressWarnings("unchecked") @Test public void bufferTimedExactBoundedError() { TestScheduler scheduler = new TestScheduler(); @@ -1713,7 +1681,6 @@ public void badRequest() { TestHelper.assertBadRequestReported(PublishProcessor.create().buffer(2, 1)); } - @SuppressWarnings("unchecked") @Test public void skipError() { Flowable.error(new TestException()) @@ -1722,7 +1689,6 @@ public void skipError() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void skipSingleResult() { Flowable.just(1) @@ -1731,7 +1697,6 @@ public void skipSingleResult() { .assertResult(Arrays.asList(1)); } - @SuppressWarnings("unchecked") @Test public void skipBackpressure() { Flowable.range(1, 10) @@ -1782,7 +1747,6 @@ public void run() { } } - @SuppressWarnings("unchecked") @Test public void noCompletionCancelExact() { final AtomicInteger counter = new AtomicInteger(); @@ -1802,7 +1766,6 @@ public void run() throws Exception { assertEquals(0, counter.get()); } - @SuppressWarnings("unchecked") @Test public void noCompletionCancelSkip() { final AtomicInteger counter = new AtomicInteger(); @@ -1822,7 +1785,6 @@ public void run() throws Exception { assertEquals(0, counter.get()); } - @SuppressWarnings("unchecked") @Test public void noCompletionCancelOverlap() { final AtomicInteger counter = new AtomicInteger(); @@ -1843,7 +1805,6 @@ public void run() throws Exception { } @Test - @SuppressWarnings("unchecked") public void boundaryOpenCloseDisposedOnComplete() { PublishProcessor source = PublishProcessor.create(); @@ -1919,7 +1880,6 @@ public Publisher apply(Long a) { } @Test - @SuppressWarnings("unchecked") public void openClosemainError() { Flowable.error(new TestException()) .buffer(Flowable.never(), Functions.justFunction(Flowable.never())) @@ -1928,7 +1888,6 @@ public void openClosemainError() { } @Test - @SuppressWarnings("unchecked") public void openClosebadSource() { List errors = TestHelper.trackPluginErrors(); try { @@ -1966,7 +1925,6 @@ protected void subscribeActual(Subscriber s) { } @Test - @SuppressWarnings("unchecked") public void openCloseOpenCompletes() { PublishProcessor source = PublishProcessor.create(); @@ -1995,7 +1953,6 @@ public void openCloseOpenCompletes() { } @Test - @SuppressWarnings("unchecked") public void openCloseOpenCompletesNoBuffers() { PublishProcessor source = PublishProcessor.create(); @@ -2024,7 +1981,6 @@ public void openCloseOpenCompletesNoBuffers() { } @Test - @SuppressWarnings("unchecked") public void openCloseTake() { PublishProcessor source = PublishProcessor.create(); @@ -2048,7 +2004,6 @@ public void openCloseTake() { } @Test - @SuppressWarnings("unchecked") public void openCloseEmptyBackpressure() { PublishProcessor source = PublishProcessor.create(); @@ -2069,7 +2024,6 @@ public void openCloseEmptyBackpressure() { } @Test - @SuppressWarnings("unchecked") public void openCloseErrorBackpressure() { PublishProcessor source = PublishProcessor.create(); @@ -2090,7 +2044,6 @@ public void openCloseErrorBackpressure() { } @Test - @SuppressWarnings("unchecked") public void openCloseBadOpen() { List errors = TestHelper.trackPluginErrors(); try { @@ -2134,7 +2087,6 @@ protected void subscribeActual(Subscriber s) { } @Test - @SuppressWarnings("unchecked") public void openCloseBadClose() { List errors = TestHelper.trackPluginErrors(); try { @@ -2191,7 +2143,6 @@ public Flowable> apply(Flowable f) ); } - @SuppressWarnings("unchecked") @Test public void bufferExactBoundarySecondBufferCrash() { PublishProcessor pp = PublishProcessor.create(); @@ -2213,7 +2164,6 @@ public List get() throws Exception { ts.assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void bufferExactBoundaryBadSource() { Flowable pp = new Flowable() { @@ -2425,7 +2375,6 @@ public void timedSizeBufferAlreadyCleared() { } @Test - @SuppressWarnings("unchecked") public void bufferExactFailingSupplier() { Flowable.empty() .buffer(1, TimeUnit.SECONDS, Schedulers.computation(), 10, new Supplier>() { diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableCombineLatestTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableCombineLatestTest.java index 8ed8197138..c8e041b951 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableCombineLatestTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableCombineLatestTest.java @@ -802,7 +802,6 @@ public Long apply(Long t1, Integer t2) { @Test public void combineLatestRequestOverflow() throws InterruptedException { - @SuppressWarnings("unchecked") List> sources = Arrays.asList(Flowable.fromArray(1, 2, 3, 4), Flowable.fromArray(5, 6, 7, 8)); Flowable f = Flowable.combineLatest(sources, new Function() { @@ -864,7 +863,6 @@ public void accept(Throwable t) { assertFalse(errorOccurred.get()); } - @SuppressWarnings("unchecked") @Test public void combineLatestIterable() { Flowable source = Flowable.just(1); @@ -916,7 +914,6 @@ public String apply(Object[] args) { ts.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void firstJustError() { TestSubscriber ts = TestSubscriber.create(); @@ -936,7 +933,6 @@ public Integer apply(Object[] args) { ts.assertNotComplete(); } - @SuppressWarnings("unchecked") @Test public void secondJustError() { TestSubscriber ts = TestSubscriber.create(); @@ -956,7 +952,6 @@ public Integer apply(Object[] args) { ts.assertNotComplete(); } - @SuppressWarnings("unchecked") @Test public void oneErrors() { TestSubscriber ts = TestSubscriber.create(); @@ -976,7 +971,6 @@ public Integer apply(Object[] args) { ts.assertNotComplete(); } - @SuppressWarnings("unchecked") @Test public void twoErrors() { TestSubscriber ts = TestSubscriber.create(); @@ -996,7 +990,6 @@ public Integer apply(Object[] args) { ts.assertNotComplete(); } - @SuppressWarnings("unchecked") @Test public void bothError() { TestSubscriber ts = TestSubscriber.create(); @@ -1140,7 +1133,6 @@ public Object apply(Object[] a) throws Exception { } @Test - @SuppressWarnings("unchecked") public void combineLatestDelayErrorIterableOfSources() { Flowable.combineLatestDelayError(Arrays.asList( @@ -1156,7 +1148,6 @@ public Object apply(Object[] a) throws Exception { } @Test - @SuppressWarnings("unchecked") public void combineLatestDelayErrorIterableOfSourcesWithError() { Flowable.combineLatestDelayError(Arrays.asList( @@ -1366,7 +1357,6 @@ public Object apply(Object a, Object b) throws Exception { } } - @SuppressWarnings("unchecked") @Test public void dontSubscribeIfDone2() { List errors = TestHelper.trackPluginErrors(); @@ -1400,7 +1390,6 @@ public Object apply(Object[] a) throws Exception { } } - @SuppressWarnings("unchecked") @Test public void combine2Flowable2Errors() throws Exception { List errors = TestHelper.trackPluginErrors(); @@ -1534,7 +1523,6 @@ public Integer apply(Integer t1, Integer t2) throws Exception { } @Test - @SuppressWarnings("unchecked") public void syncFirstErrorsAfterItemDelayError() { Flowable.combineLatestDelayError(Arrays.asList( Flowable.just(21).concatWith(Flowable.error(new TestException())), @@ -1552,7 +1540,6 @@ public Object apply(Object[] a) throws Exception { .assertFailure(TestException.class, 42); } - @SuppressWarnings("unchecked") @Test public void publishersInIterable() { Publisher source = new Publisher() { diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableConcatDelayErrorTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableConcatDelayErrorTest.java index 0543eb1b0f..22e23a4391 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableConcatDelayErrorTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableConcatDelayErrorTest.java @@ -252,7 +252,6 @@ public void concatDelayErrorFlowableError() { assertTrue(cex.get(2).toString(), cex.get(2) instanceof TestException); } - @SuppressWarnings("unchecked") @Test public void concatDelayErrorIterable() { TestSubscriber ts = TestSubscriber.create(); @@ -266,7 +265,6 @@ public void concatDelayErrorIterable() { ts.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void concatDelayErrorIterableError() { TestSubscriberEx ts = new TestSubscriberEx<>(); diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableConcatMapEagerTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableConcatMapEagerTest.java index 5c052d616c..9289288ccc 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableConcatMapEagerTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableConcatMapEagerTest.java @@ -298,7 +298,6 @@ public void simple2() { ts.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void eagerness2() { final AtomicInteger count = new AtomicInteger(); @@ -323,7 +322,6 @@ public void accept(Integer t) { tsBp.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void eagerness3() { final AtomicInteger count = new AtomicInteger(); @@ -348,7 +346,6 @@ public void accept(Integer t) { tsBp.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void eagerness4() { final AtomicInteger count = new AtomicInteger(); @@ -373,7 +370,6 @@ public void accept(Integer t) { tsBp.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void eagerness5() { final AtomicInteger count = new AtomicInteger(); @@ -398,7 +394,6 @@ public void accept(Integer t) { tsBp.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void eagerness6() { final AtomicInteger count = new AtomicInteger(); @@ -423,7 +418,6 @@ public void accept(Integer t) { tsBp.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void eagerness7() { final AtomicInteger count = new AtomicInteger(); @@ -448,7 +442,6 @@ public void accept(Integer t) { tsBp.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void eagerness8() { final AtomicInteger count = new AtomicInteger(); @@ -473,7 +466,6 @@ public void accept(Integer t) { tsBp.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void eagerness9() { final AtomicInteger count = new AtomicInteger(); @@ -507,7 +499,6 @@ public void mainError() { ts.assertNotComplete(); } - @SuppressWarnings("unchecked") @Test public void innerError() { Flowable.concatArrayEager(Flowable.just(1), Flowable.error(new TestException())).subscribe(ts); @@ -517,7 +508,6 @@ public void innerError() { ts.assertNotComplete(); } - @SuppressWarnings("unchecked") @Test public void innerEmpty() { Flowable.concatArrayEager(Flowable.empty(), Flowable.empty()).subscribe(ts); @@ -552,7 +542,6 @@ public void invalidCapacityHint() { } @Test - @SuppressWarnings("unchecked") public void backpressure() { Flowable.concatArrayEager(Flowable.just(1), Flowable.just(1)).subscribe(tsBp); @@ -662,7 +651,6 @@ public void accept(long reqCount) { Assert.assertEquals(1, (long) requests.get(5)); } - @SuppressWarnings("unchecked") @Test public void capacityHint() { Flowable source = Flowable.just(1); @@ -699,7 +687,6 @@ public void flowableCapacityHint() { ts.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void badCapacityHint() throws Exception { Flowable source = Flowable.just(1); @@ -730,7 +717,6 @@ public void concatEagerZero() { .assertResult(); } - @SuppressWarnings("unchecked") @Test public void concatEagerOne() { Flowable.concatEager(Arrays.asList(Flowable.just(1))) @@ -738,7 +724,6 @@ public void concatEagerOne() { .assertResult(1); } - @SuppressWarnings("unchecked") @Test public void concatEagerTwo() { Flowable.concatEager(Arrays.asList(Flowable.just(1), Flowable.just(2))) @@ -770,7 +755,6 @@ public void ObservableCapacityHint() { ts.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void concatEagerIterable() { Flowable.concatEager(Arrays.asList(Flowable.just(1), Flowable.just(2))) @@ -1193,7 +1177,6 @@ public void arrayDelayErrorDefault() { PublishProcessor pp2 = PublishProcessor.create(); PublishProcessor pp3 = PublishProcessor.create(); - @SuppressWarnings("unchecked") TestSubscriber ts = Flowable.concatArrayEagerDelayError(pp1, pp2, pp3) .test(); diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableConcatTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableConcatTest.java index 67451d6097..208f7b1b51 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableConcatTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableConcatTest.java @@ -283,7 +283,7 @@ public void blockedObservableOfObservables() { final Flowable even = Flowable.fromArray(e); final CountDownLatch callOnce = new CountDownLatch(1); final CountDownLatch okToContinue = new CountDownLatch(1); - @SuppressWarnings("unchecked") + TestObservable> observableOfObservables = new TestObservable<>(callOnce, okToContinue, odds, even); Flowable concatF = Flowable.concat(Flowable.unsafeCreate(observableOfObservables)); concatF.subscribe(subscriber); @@ -322,7 +322,6 @@ public void concatConcurrentWithInfinity() { Subscriber subscriber = TestHelper.mockSubscriber(); - @SuppressWarnings("unchecked") TestObservable> observableOfObservables = new TestObservable<>(Flowable.unsafeCreate(w1), Flowable.unsafeCreate(w2)); Flowable concatF = Flowable.concat(Flowable.unsafeCreate(observableOfObservables)); @@ -450,7 +449,6 @@ public void concatUnsubscribeConcurrent() { Subscriber subscriber = TestHelper.mockSubscriber(); TestSubscriber ts = new TestSubscriber<>(subscriber, 0L); - @SuppressWarnings("unchecked") TestObservable> observableOfObservables = new TestObservable<>(Flowable.unsafeCreate(w1), Flowable.unsafeCreate(w2)); Flowable concatF = Flowable.concat(Flowable.unsafeCreate(observableOfObservables)); @@ -506,10 +504,12 @@ public void cancel() { private final T seed; private final int size; + @SafeVarargs TestObservable(T... values) { this(null, null, values); } + @SafeVarargs TestObservable(CountDownLatch once, CountDownLatch okToContinue, T... values) { this.values = Arrays.asList(values); this.size = this.values.size(); @@ -1055,7 +1055,6 @@ public void concat4() { .assertResult(1, 1, 1, 1); } - @SuppressWarnings("unchecked") @Test public void concatArrayDelayError() { Flowable.concatArrayDelayError(Flowable.just(1), Flowable.just(2), @@ -1064,7 +1063,6 @@ public void concatArrayDelayError() { .assertResult(1, 2, 3, 4); } - @SuppressWarnings("unchecked") @Test public void concatArrayDelayErrorWithError() { Flowable.concatArrayDelayError(Flowable.just(1), Flowable.just(2), @@ -1074,7 +1072,6 @@ public void concatArrayDelayErrorWithError() { .assertFailure(TestException.class, 1, 2, 3, 4); } - @SuppressWarnings("unchecked") @Test public void concatIterableDelayError() { Flowable.concatDelayError( @@ -1084,7 +1081,6 @@ public void concatIterableDelayError() { .assertResult(1, 2, 3, 4); } - @SuppressWarnings("unchecked") @Test public void concatIterableDelayErrorWithError() { Flowable.concatDelayError( @@ -1163,13 +1159,11 @@ public Iterable apply(Integer v) throws Exception { .assertResult(1, 2, 3, 4, 5, 1, 2, 3, 4, 5); } - @SuppressWarnings("unchecked") @Test public void emptyArray() { assertSame(Flowable.empty(), Flowable.concatArrayDelayError()); } - @SuppressWarnings("unchecked") @Test public void singleElementArray() { assertSame(Flowable.never(), Flowable.concatArrayDelayError(Flowable.never())); @@ -1200,13 +1194,11 @@ public Flowable apply(Object v) throws Exception { } - @SuppressWarnings("unchecked") @Test public void concatArrayEmpty() { assertSame(Flowable.empty(), Flowable.concatArray()); } - @SuppressWarnings("unchecked") @Test public void concatArraySingleElement() { assertSame(Flowable.never(), Flowable.concatArray(Flowable.never())); @@ -1537,7 +1529,6 @@ public Publisher apply(Integer v) throws Exception { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void noSubsequentSubscription() { final int[] calls = { 0 }; @@ -1558,7 +1549,6 @@ public void subscribe(FlowableEmitter s) throws Exception { assertEquals(1, calls[0]); } - @SuppressWarnings("unchecked") @Test public void noSubsequentSubscriptionDelayError() { final int[] calls = { 0 }; @@ -1579,7 +1569,6 @@ public void subscribe(FlowableEmitter s) throws Exception { assertEquals(1, calls[0]); } - @SuppressWarnings("unchecked") @Test public void noSubsequentSubscriptionIterable() { final int[] calls = { 0 }; @@ -1600,7 +1589,6 @@ public void subscribe(FlowableEmitter s) throws Exception { assertEquals(1, calls[0]); } - @SuppressWarnings("unchecked") @Test public void noSubsequentSubscriptionDelayErrorIterable() { final int[] calls = { 0 }; @@ -1621,7 +1609,6 @@ public void subscribe(FlowableEmitter s) throws Exception { assertEquals(1, calls[0]); } - @SuppressWarnings("unchecked") @Test public void noCancelPreviousArray() { final AtomicInteger counter = new AtomicInteger(); @@ -1640,7 +1627,6 @@ public void run() throws Exception { assertEquals(0, counter.get()); } - @SuppressWarnings("unchecked") @Test public void noCancelPreviousIterable() { final AtomicInteger counter = new AtomicInteger(); diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableGroupByTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableGroupByTest.java index a14372b959..f20f0ae0c7 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableGroupByTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableGroupByTest.java @@ -2390,7 +2390,6 @@ public Publisher apply(GroupedFlowable g) { } @Test - @SuppressWarnings("unchecked") public void valueSelectorCrashAndMissingBackpressure() { PublishProcessor pp = PublishProcessor.create(); diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableMergeDelayErrorTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableMergeDelayErrorTest.java index 7a528e8cb2..118f249091 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableMergeDelayErrorTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableMergeDelayErrorTest.java @@ -544,7 +544,6 @@ public void mergeIterable() { verify(stringSubscriber, times(2)).onNext("hello"); } - @SuppressWarnings("unchecked") @Test public void iterableMaxConcurrent() { TestSubscriber ts = TestSubscriber.create(); @@ -571,7 +570,6 @@ public void iterableMaxConcurrent() { ts.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void iterableMaxConcurrentError() { TestSubscriberEx ts = new TestSubscriberEx<>(); @@ -632,7 +630,6 @@ public void mergeArrayDelayError() { .assertResult(1, 2); } - @SuppressWarnings("unchecked") @Test public void mergeIterableDelayErrorWithError() { Flowable.mergeDelayError( @@ -678,7 +675,6 @@ public void mergeDelayErrorWithErrorMaxConcurrency() { .assertFailure(TestException.class, 1, 2); } - @SuppressWarnings("unchecked") @Test public void mergeIterableDelayErrorMaxConcurrency() { Flowable.mergeDelayError( @@ -688,7 +684,6 @@ public void mergeIterableDelayErrorMaxConcurrency() { .assertResult(1, 2); } - @SuppressWarnings("unchecked") @Test public void mergeIterableDelayErrorWithErrorMaxConcurrency() { Flowable.mergeDelayError( @@ -720,7 +715,6 @@ public void mergeDelayError3WithError() { .assertFailure(TestException.class, 1, 2, 3); } - @SuppressWarnings("unchecked") @Test public void mergeIterableDelayError() { Flowable.mergeDelayError(Arrays.asList(Flowable.just(1), Flowable.just(2))) diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableMergeTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableMergeTest.java index 6b3f72e2f9..19d0ac86a0 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableMergeTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableMergeTest.java @@ -1343,7 +1343,6 @@ public void onNext(Integer t) { } } - @SuppressWarnings("unchecked") @Test public void negativeMaxConcurrent() { try { @@ -1354,7 +1353,6 @@ public void negativeMaxConcurrent() { } } - @SuppressWarnings("unchecked") @Test public void zeroMaxConcurrent() { try { diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowablePublishTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowablePublishTest.java index ec7c88da09..0dffd13798 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowablePublishTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowablePublishTest.java @@ -1368,7 +1368,6 @@ public void badRequest() { } @Test - @SuppressWarnings("unchecked") public void splitCombineSubscriberChangeAfterOnNext() { Flowable source = Flowable.range(0, 20) .doOnSubscribe(new Consumer() { @@ -1436,7 +1435,6 @@ public boolean test(List v) throws Exception { } @Test - @SuppressWarnings("unchecked") public void splitCombineSubscriberChangeAfterOnNextFused() { Flowable source = Flowable.range(0, 20) .publish(10) diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableTimeIntervalTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableTimeIntervalTest.java index 496bce4a38..4153c92a22 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableTimeIntervalTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableTimeIntervalTest.java @@ -129,7 +129,6 @@ public void dispose() { TestHelper.checkDisposed(Flowable.just(1).timeInterval()); } - @SuppressWarnings("unchecked") @Test public void error() { Flowable.error(new TestException()) diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableToListTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableToListTest.java index 73d1455d5b..cad29e3fc8 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableToListTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableToListTest.java @@ -113,7 +113,6 @@ public void backpressureHonoredFlowable() { ts.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void capacityHintFlowable() { Flowable.range(1, 10) @@ -182,7 +181,6 @@ static void await(CyclicBarrier cb) { } } - @SuppressWarnings("unchecked") @Test public void capacityHint() { Flowable.range(1, 10) @@ -198,7 +196,6 @@ public void dispose() { TestHelper.checkDisposed(Flowable.just(1).toList()); } - @SuppressWarnings("unchecked") @Test public void error() { Flowable.error(new TestException()) @@ -208,7 +205,6 @@ public void error() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void errorSingle() { Flowable.error(new TestException()) @@ -217,7 +213,6 @@ public void errorSingle() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void collectionSupplierThrows() { Flowable.just(1) @@ -232,7 +227,6 @@ public Collection get() throws Exception { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void collectionSupplierReturnsNull() { Flowable.just(1) @@ -248,7 +242,6 @@ public Collection get() throws Exception { .assertErrorMessage(ExceptionHelper.nullWarning("The collectionSupplier returned a null Collection.")); } - @SuppressWarnings("unchecked") @Test public void singleCollectionSupplierThrows() { Flowable.just(1) @@ -262,7 +255,6 @@ public Collection get() throws Exception { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void singleCollectionSupplierReturnsNull() { Flowable.just(1) diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableToSortedListTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableToSortedListTest.java index 6012db0add..5c7278da54 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableToSortedListTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableToSortedListTest.java @@ -112,7 +112,6 @@ public int compare(Integer a, Integer b) { .assertResult(5, 4, 3, 2, 1); } - @SuppressWarnings("unchecked") @Test public void toSortedListCapacityFlowable() { Flowable.just(5, 1, 2, 4, 3).toSortedList(4).toFlowable() @@ -120,7 +119,6 @@ public void toSortedListCapacityFlowable() { .assertResult(Arrays.asList(1, 2, 3, 4, 5)); } - @SuppressWarnings("unchecked") @Test public void toSortedListComparatorCapacityFlowable() { Flowable.just(5, 1, 2, 4, 3).toSortedList(new Comparator() { @@ -178,7 +176,6 @@ static void await(CyclicBarrier cb) { } } - @SuppressWarnings("unchecked") @Test public void toSortedListCapacity() { Flowable.just(5, 1, 2, 4, 3).toSortedList(4) @@ -186,7 +183,6 @@ public void toSortedListCapacity() { .assertResult(Arrays.asList(1, 2, 3, 4, 5)); } - @SuppressWarnings("unchecked") @Test public void toSortedListComparatorCapacity() { Flowable.just(5, 1, 2, 4, 3).toSortedList(new Comparator() { diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithFlowableTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithFlowableTest.java index c17e2ccfae..66273656f9 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithFlowableTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithFlowableTest.java @@ -328,7 +328,6 @@ public Flowable apply(Flowable v) throws Exception { }, false, 1, 1, 1); } - @SuppressWarnings("unchecked") @Test public void boundaryDirectMissingBackpressure() { List errors = TestHelper.trackPluginErrors(); @@ -344,7 +343,6 @@ public void boundaryDirectMissingBackpressure() { } } - @SuppressWarnings("unchecked") @Test public void boundaryDirectMissingBackpressureNoNullPointerException() { List errors = TestHelper.trackPluginErrors(); diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithSizeTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithSizeTest.java index e9a7c77518..fbefcc953e 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithSizeTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithSizeTest.java @@ -290,7 +290,6 @@ public Flowable apply(Flowable w) { ts.assertValueCount(22); } - @SuppressWarnings("unchecked") @Test public void backpressureOuterInexact() { TestSubscriber> ts = new TestSubscriber<>(0L); @@ -364,7 +363,6 @@ public Flowable> apply(Flowable f) throws Exception { }); } - @SuppressWarnings("unchecked") @Test public void errorExact() { Flowable.error(new TestException()) @@ -373,7 +371,6 @@ public void errorExact() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void errorSkip() { Flowable.error(new TestException()) @@ -382,7 +379,6 @@ public void errorSkip() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void errorOverlap() { Flowable.error(new TestException()) diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithStartEndFlowableTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithStartEndFlowableTest.java index 55db25f654..023f6848d5 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithStartEndFlowableTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithStartEndFlowableTest.java @@ -434,7 +434,6 @@ public void accept(Flowable w) throws Throwable { } @Test - @SuppressWarnings("unchecked") public void mainWindowMissingBackpressure() { PublishProcessor source = PublishProcessor.create(); PublishProcessor boundary = PublishProcessor.create(); @@ -515,7 +514,6 @@ public void accept(Flowable v) throws Throwable { inner.get().test().assertResult(); } - @SuppressWarnings("unchecked") @Test public void closingIndicatorFunctionCrash() { diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithTimeTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithTimeTest.java index 86da1bb09c..e3d9466b3e 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithTimeTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWindowWithTimeTest.java @@ -434,7 +434,6 @@ public void skipOnError() { } @Test - @SuppressWarnings("unchecked") public void exactBackpressure() { TestScheduler scheduler = new TestScheduler(); @@ -449,7 +448,6 @@ public void exactBackpressure() { } @Test - @SuppressWarnings("unchecked") public void skipBackpressure() { TestScheduler scheduler = new TestScheduler(); @@ -464,7 +462,6 @@ public void skipBackpressure() { } @Test - @SuppressWarnings("unchecked") public void overlapBackpressure() { TestScheduler scheduler = new TestScheduler(); @@ -866,7 +863,6 @@ public Publisher> apply(Flowable f) }); } - @SuppressWarnings("unchecked") @Test public void firstWindowMissingBackpressure() { Flowable.never() diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWithLatestFromTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWithLatestFromTest.java index 544ca11bc6..655452057b 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWithLatestFromTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableWithLatestFromTest.java @@ -704,7 +704,6 @@ public Object apply(Integer a, Integer b) throws Exception { .assertFailure(NullPointerException.class); } - @SuppressWarnings("unchecked") @Test public void combineToNull2() { Flowable.just(1) diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableZipTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableZipTest.java index d40b3908c9..e4b41c8bea 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableZipTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableZipTest.java @@ -1422,7 +1422,6 @@ public Object apply(Integer a, Integer b) throws Exception { .assertResult("929"); } - @SuppressWarnings("unchecked") @Test public void zipArrayEmpty() { assertSame(Flowable.empty(), Flowable.zipArray(Functions.identity(), false, 16)); @@ -1897,7 +1896,6 @@ public Object apply(Object[] a) throws Exception { assertEquals(0, counter.get()); } - @SuppressWarnings("unchecked") @Test public void publishersInIterable() { Publisher source = new Publisher() { diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeAmbTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeAmbTest.java index af49d5353b..dec723d651 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeAmbTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeAmbTest.java @@ -50,7 +50,6 @@ public void ambLots() { .assertResult(1); } - @SuppressWarnings("unchecked") @Test public void ambFirstDone() { Maybe.amb(Arrays.asList(Maybe.just(1), Maybe.just(2))) @@ -58,7 +57,6 @@ public void ambFirstDone() { .assertResult(1); } - @SuppressWarnings("unchecked") @Test public void dispose() { PublishProcessor pp1 = PublishProcessor.create(); @@ -76,7 +74,6 @@ public void dispose() { assertFalse(pp2.hasSubscribers()); } - @SuppressWarnings("unchecked") @Test public void innerErrorRace() { for (int i = 0; i < TestHelper.RACE_DEFAULT_LOOPS; i++) { @@ -255,7 +252,6 @@ public void run() { } } - @SuppressWarnings("unchecked") @Test public void maybeSourcesInIterable() { MaybeSource source = new MaybeSource() { diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeConcatIterableTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeConcatIterableTest.java index c693e0296a..7450dc993b 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeConcatIterableTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeConcatIterableTest.java @@ -29,7 +29,6 @@ public class MaybeConcatIterableTest extends RxJavaTest { - @SuppressWarnings("unchecked") @Test public void take() { Maybe.concat(Arrays.asList(Maybe.just(1), Maybe.just(2), Maybe.just(3))) @@ -50,7 +49,6 @@ public Iterator> iterator() { .assertFailureAndMessage(TestException.class, "iterator()"); } - @SuppressWarnings("unchecked") @Test public void error() { Maybe.concat(Arrays.asList(Maybe.just(1), Maybe.error(new TestException()), Maybe.just(3))) @@ -58,7 +56,6 @@ public void error() { .assertFailure(TestException.class, 1); } - @SuppressWarnings("unchecked") @Test public void successCancelRace() { for (int i = 0; i < TestHelper.RACE_DEFAULT_LOOPS; i++) { @@ -124,7 +121,6 @@ public Maybe apply(Integer v) throws Exception { .assertFailure(NullPointerException.class); } - @SuppressWarnings("unchecked") @Test public void noSubsequentSubscription() { final int[] calls = { 0 }; @@ -144,7 +140,6 @@ public void subscribe(MaybeEmitter s) throws Exception { assertEquals(1, calls[0]); } - @SuppressWarnings("unchecked") @Test public void noSubsequentSubscriptionDelayError() { final int[] calls = { 0 }; diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeMaterializeTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeMaterializeTest.java index 57a0ed11ae..57a478d112 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeMaterializeTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeMaterializeTest.java @@ -24,7 +24,6 @@ public class MaybeMaterializeTest extends RxJavaTest { @Test - @SuppressWarnings("unchecked") public void success() { Maybe.just(1) .materialize() @@ -33,7 +32,6 @@ public void success() { } @Test - @SuppressWarnings("unchecked") public void error() { TestException ex = new TestException(); Maybe.error(ex) @@ -43,7 +41,6 @@ public void error() { } @Test - @SuppressWarnings("unchecked") public void empty() { Maybe.empty() .materialize() diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeOnErrorXTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeOnErrorXTest.java index e7d5e4b31b..f3a9b9345c 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeOnErrorXTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeOnErrorXTest.java @@ -66,7 +66,6 @@ public void onErrorCompleteFalse() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void onErrorReturnFunctionThrows() { TestHelper.assertCompositeExceptions(Maybe.error(new TestException()) @@ -79,7 +78,6 @@ public Object apply(Throwable v) throws Exception { .to(TestHelper.testConsumer()), TestException.class, IOException.class); } - @SuppressWarnings("unchecked") @Test public void onErrorCompletePredicateThrows() { TestHelper.assertCompositeExceptions(Maybe.error(new TestException()) @@ -116,7 +114,6 @@ public void onExceptionResumeNextPassthrough() { .assertFailure(AssertionError.class); } - @SuppressWarnings("unchecked") @Test public void onErrorResumeNextFunctionThrows() { TestHelper.assertCompositeExceptions(Maybe.error(new TestException()) diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeZipIterableTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeZipIterableTest.java index f06be6be57..aae11b288e 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeZipIterableTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/maybe/MaybeZipIterableTest.java @@ -38,7 +38,6 @@ public Object apply(Object[] a) throws Exception { } }; - @SuppressWarnings("unchecked") @Test public void firstError() { Maybe.zip(Arrays.asList(Maybe.error(new TestException()), Maybe.just(1)), addString) @@ -46,7 +45,6 @@ public void firstError() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void secondError() { Maybe.zip(Arrays.asList(Maybe.just(1), Maybe.error(new TestException())), addString) @@ -54,7 +52,6 @@ public void secondError() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void dispose() { PublishProcessor pp = PublishProcessor.create(); @@ -69,7 +66,6 @@ public void dispose() { assertFalse(pp.hasSubscribers()); } - @SuppressWarnings("unchecked") @Test public void zipperThrows() { Maybe.zip(Arrays.asList(Maybe.just(1), Maybe.just(2)), new Function() { @@ -82,7 +78,6 @@ public Object apply(Object[] b) throws Exception { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void zipperReturnsNull() { Maybe.zip(Arrays.asList(Maybe.just(1), Maybe.just(2)), new Function() { @@ -95,7 +90,6 @@ public Object apply(Object[] a) throws Exception { .assertFailure(NullPointerException.class); } - @SuppressWarnings("unchecked") @Test public void middleError() { PublishProcessor pp0 = PublishProcessor.create(); @@ -112,7 +106,6 @@ public void middleError() { to.assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void innerErrorRace() { for (int i = 0; i < TestHelper.RACE_DEFAULT_LOOPS; i++) { @@ -190,7 +183,6 @@ public Maybe apply(Integer v) throws Exception { .assertFailureAndMessage(TestException.class, "next()"); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void zipIterableOneIsNull() { Maybe.zip(Arrays.asList(null, Maybe.just(1)), new Function() { @@ -202,7 +194,6 @@ public Object apply(Object[] v) { .blockingGet(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void zipIterableTwoIsNull() { Maybe.zip(Arrays.asList(Maybe.just(1), null), new Function() { @@ -222,7 +213,6 @@ public void singleSourceZipperReturnsNull() { .assertFailureAndMessage(NullPointerException.class, "The zipper returned a null value"); } - @SuppressWarnings("unchecked") @Test public void maybeSourcesInIterable() { MaybeSource source = new MaybeSource() { diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableAmbTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableAmbTest.java index 239d8339ea..4e8cbd34b6 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableAmbTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableAmbTest.java @@ -374,7 +374,6 @@ public void ambWithOrder() { Observable.just(1).ambWith(error).test().assertValue(1).assertComplete(); } - @SuppressWarnings("unchecked") @Test public void ambIterableOrder() { Observable error = Observable.error(new RuntimeException()); @@ -467,7 +466,6 @@ public void run() throws Exception { } } - @SuppressWarnings("unchecked") @Test public void observableSourcesInIterable() { ObservableSource source = new ObservableSource() { diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableBufferTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableBufferTest.java index eeee099b0d..af4e7a9415 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableBufferTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableBufferTest.java @@ -764,7 +764,6 @@ public void onComplete() { assertFalse(observer.isDisposed()); } - @SuppressWarnings("unchecked") @Test public void bufferTimeSkipDefault() { Observable.range(1, 5).buffer(1, 1, TimeUnit.MINUTES) @@ -772,7 +771,6 @@ public void bufferTimeSkipDefault() { .assertResult(Arrays.asList(1, 2, 3, 4, 5)); } - @SuppressWarnings("unchecked") @Test public void bufferBoundaryHint() { Observable.range(1, 5).buffer(Observable.timer(1, TimeUnit.MINUTES), 2) @@ -784,7 +782,6 @@ static HashSet set(Integer... values) { return new HashSet<>(Arrays.asList(values)); } - @SuppressWarnings("unchecked") @Test public void bufferIntoCustomCollection() { Observable.just(1, 1, 2, 2, 3, 3, 4, 4) @@ -798,7 +795,6 @@ public Collection get() throws Exception { .assertResult(set(1, 2), set(2, 3), set(4)); } - @SuppressWarnings("unchecked") @Test public void bufferSkipIntoCustomCollection() { Observable.just(1, 1, 2, 2, 3, 3, 4, 4) @@ -813,7 +809,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierThrows() { Observable.just(1) .buffer(1, TimeUnit.SECONDS, Schedulers.single(), Integer.MAX_VALUE, new Supplier>() { @@ -827,7 +822,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierThrows2() { Observable.just(1) .buffer(1, TimeUnit.SECONDS, Schedulers.single(), 10, new Supplier>() { @@ -841,7 +835,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierThrows3() { Observable.just(1) .buffer(2, 1, TimeUnit.SECONDS, Schedulers.single(), new Supplier>() { @@ -855,7 +848,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierThrows4() { Observable.never() .buffer(1, TimeUnit.MILLISECONDS, Schedulers.single(), Integer.MAX_VALUE, new Supplier>() { @@ -875,7 +867,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierThrows5() { Observable.never() .buffer(1, TimeUnit.MILLISECONDS, Schedulers.single(), 10, new Supplier>() { @@ -895,7 +886,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierThrows6() { Observable.never() .buffer(2, 1, TimeUnit.MILLISECONDS, Schedulers.single(), new Supplier>() { @@ -915,7 +905,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierReturnsNull() { Observable.never() .buffer(1, TimeUnit.MILLISECONDS, Schedulers.single(), Integer.MAX_VALUE, new Supplier>() { @@ -935,7 +924,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierReturnsNull2() { Observable.never() .buffer(1, TimeUnit.MILLISECONDS, Schedulers.single(), 10, new Supplier>() { @@ -955,7 +943,6 @@ public Collection get() throws Exception { } @Test - @SuppressWarnings("unchecked") public void supplierReturnsNull3() { Observable.never() .buffer(2, 1, TimeUnit.MILLISECONDS, Schedulers.single(), new Supplier>() { @@ -996,7 +983,6 @@ public void dispose() { TestHelper.checkDisposed(PublishSubject.create().buffer(Observable.never(), Functions.justFunction(Observable.never()))); } - @SuppressWarnings("unchecked") @Test public void restartTimer() { Observable.range(1, 5) @@ -1005,7 +991,6 @@ public void restartTimer() { .assertResult(Arrays.asList(1, 2), Arrays.asList(3, 4), Arrays.asList(5)); } - @SuppressWarnings("unchecked") @Test public void bufferSupplierCrash2() { Observable.range(1, 2) @@ -1023,7 +1008,6 @@ public List get() throws Exception { .assertFailure(TestException.class, Arrays.asList(1)); } - @SuppressWarnings("unchecked") @Test public void bufferSkipSupplierCrash2() { Observable.range(1, 2) @@ -1041,7 +1025,6 @@ public List get() throws Exception { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void bufferSkipError() { Observable.error(new TestException()) @@ -1050,7 +1033,6 @@ public void bufferSkipError() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void bufferSkipOverlap() { Observable.range(1, 5) @@ -1065,7 +1047,6 @@ public void bufferSkipOverlap() { ); } - @SuppressWarnings("unchecked") @Test public void bufferTimedExactError() { Observable.error(new TestException()) @@ -1074,7 +1055,6 @@ public void bufferTimedExactError() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void bufferTimedSkipError() { Observable.error(new TestException()) @@ -1083,7 +1063,6 @@ public void bufferTimedSkipError() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void bufferTimedOverlapError() { Observable.error(new TestException()) @@ -1092,7 +1071,6 @@ public void bufferTimedOverlapError() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void bufferTimedExactEmpty() { Observable.empty() @@ -1101,7 +1079,6 @@ public void bufferTimedExactEmpty() { .assertResult(Collections.emptyList()); } - @SuppressWarnings("unchecked") @Test public void bufferTimedSkipEmpty() { Observable.empty() @@ -1110,7 +1087,6 @@ public void bufferTimedSkipEmpty() { .assertResult(Collections.emptyList()); } - @SuppressWarnings("unchecked") @Test public void bufferTimedOverlapEmpty() { Observable.empty() @@ -1119,7 +1095,6 @@ public void bufferTimedOverlapEmpty() { .assertResult(Collections.emptyList()); } - @SuppressWarnings("unchecked") @Test public void bufferTimedExactSupplierCrash() { TestScheduler scheduler = new TestScheduler(); @@ -1149,7 +1124,6 @@ public List get() throws Exception { .assertFailure(TestException.class, Arrays.asList(1)); } - @SuppressWarnings("unchecked") @Test public void bufferTimedExactBoundedError() { TestScheduler scheduler = new TestScheduler(); @@ -1207,7 +1181,6 @@ public void run() { } } - @SuppressWarnings("unchecked") @Test public void noCompletionCancelExact() { final AtomicInteger counter = new AtomicInteger(); @@ -1227,7 +1200,6 @@ public void run() throws Exception { assertEquals(0, counter.get()); } - @SuppressWarnings("unchecked") @Test public void noCompletionCancelSkip() { final AtomicInteger counter = new AtomicInteger(); @@ -1247,7 +1219,6 @@ public void run() throws Exception { assertEquals(0, counter.get()); } - @SuppressWarnings("unchecked") @Test public void noCompletionCancelOverlap() { final AtomicInteger counter = new AtomicInteger(); @@ -1268,7 +1239,6 @@ public void run() throws Exception { } @Test - @SuppressWarnings("unchecked") public void boundaryOpenCloseDisposedOnComplete() { PublishSubject source = PublishSubject.create(); @@ -1344,7 +1314,6 @@ public Observable apply(Long a) { } @Test - @SuppressWarnings("unchecked") public void openClosemainError() { Observable.error(new TestException()) .buffer(Observable.never(), Functions.justFunction(Observable.never())) @@ -1353,7 +1322,6 @@ public void openClosemainError() { } @Test - @SuppressWarnings("unchecked") public void openClosebadSource() { List errors = TestHelper.trackPluginErrors(); try { @@ -1391,7 +1359,6 @@ protected void subscribeActual(Observer observer) { } @Test - @SuppressWarnings("unchecked") public void openCloseOpenCompletes() { PublishSubject source = PublishSubject.create(); @@ -1420,7 +1387,6 @@ public void openCloseOpenCompletes() { } @Test - @SuppressWarnings("unchecked") public void openCloseOpenCompletesNoBuffers() { PublishSubject source = PublishSubject.create(); @@ -1449,7 +1415,6 @@ public void openCloseOpenCompletesNoBuffers() { } @Test - @SuppressWarnings("unchecked") public void openCloseTake() { PublishSubject source = PublishSubject.create(); @@ -1473,7 +1438,6 @@ public void openCloseTake() { } @Test - @SuppressWarnings("unchecked") public void openCloseBadOpen() { List errors = TestHelper.trackPluginErrors(); try { @@ -1517,7 +1481,6 @@ protected void subscribeActual(Observer observer) { } @Test - @SuppressWarnings("unchecked") public void openCloseBadClose() { List errors = TestHelper.trackPluginErrors(); try { @@ -1574,7 +1537,6 @@ public ObservableSource> apply(Observable f) ); } - @SuppressWarnings("unchecked") @Test public void bufferExactBoundarySecondBufferCrash() { PublishSubject ps = PublishSubject.create(); @@ -1596,7 +1558,6 @@ public List get() throws Exception { to.assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void bufferExactBoundaryBadSource() { Observable ps = new Observable() { @@ -1814,7 +1775,6 @@ public ObservableSource> apply(Observable o) } @Test - @SuppressWarnings("unchecked") public void bufferExactFailingSupplier() { Observable.empty() .buffer(1, TimeUnit.SECONDS, Schedulers.computation(), 10, new Supplier>() { diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableCollectTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableCollectTest.java index d28bd20e97..0568b0d474 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableCollectTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableCollectTest.java @@ -142,7 +142,6 @@ public void accept(Object o, Integer t) { assertFalse(added.get()); } - @SuppressWarnings("unchecked") @Test public void collectIntoObservable() { Observable.just(1, 1, 1, 1, 2) @@ -266,7 +265,6 @@ public void accept(Object o, Integer t) { assertFalse(added.get()); } - @SuppressWarnings("unchecked") @Test public void collectInto() { Observable.just(1, 1, 1, 1, 2) diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableCombineLatestTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableCombineLatestTest.java index c5f93d4222..3096cdabd7 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableCombineLatestTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableCombineLatestTest.java @@ -818,7 +818,6 @@ public Object apply(Object[] a) throws Exception { } @Test - @SuppressWarnings("unchecked") public void combineLatestDelayErrorIterableOfSources() { Observable.combineLatestDelayError(Arrays.asList( @@ -834,7 +833,6 @@ public Object apply(Object[] a) throws Exception { } @Test - @SuppressWarnings("unchecked") public void combineLatestDelayErrorIterableOfSourcesWithError() { Observable.combineLatestDelayError(Arrays.asList( @@ -1044,7 +1042,6 @@ public Object apply(Object a, Object b) throws Exception { } } - @SuppressWarnings("unchecked") @Test public void dontSubscribeIfDone2() { List errors = TestHelper.trackPluginErrors(); @@ -1078,7 +1075,6 @@ public Object apply(Object[] a) throws Exception { } } - @SuppressWarnings("unchecked") @Test public void combine2Observable2Errors() throws Exception { List errors = TestHelper.trackPluginErrors(); @@ -1195,7 +1191,6 @@ public Integer apply(Integer t1, Integer t2) throws Exception { } @Test - @SuppressWarnings("unchecked") public void syncFirstErrorsAfterItemDelayError() { Observable.combineLatestDelayError(Arrays.asList( Observable.just(21).concatWith(Observable.error(new TestException())), @@ -1213,7 +1208,6 @@ public Object apply(Object[] a) throws Exception { .assertFailure(TestException.class, 42); } - @SuppressWarnings("unchecked") @Test public void observableSourcesInIterable() { ObservableSource source = new ObservableSource() { diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableConcatMapEagerTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableConcatMapEagerTest.java index fe1cafe56b..6ad8b9c649 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableConcatMapEagerTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableConcatMapEagerTest.java @@ -503,7 +503,6 @@ public void concatArrayEager() throws Exception { } } - @SuppressWarnings("unchecked") @Test public void capacityHint() { Observable source = Observable.just(1); @@ -540,7 +539,6 @@ public void ObservableCapacityHint() { to.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void badCapacityHint() throws Exception { Observable source = Observable.just(1); @@ -564,7 +562,6 @@ public void mappingBadCapacityHint() throws Exception { } - @SuppressWarnings("unchecked") @Test public void concatEagerIterable() { Observable.concatEager(Arrays.asList(Observable.just(1), Observable.just(2))) diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableConcatTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableConcatTest.java index c5b00fdf7c..05df845a44 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableConcatTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableConcatTest.java @@ -271,7 +271,7 @@ public void blockedObservableOfObservables() { final Observable even = Observable.fromArray(e); final CountDownLatch callOnce = new CountDownLatch(1); final CountDownLatch okToContinue = new CountDownLatch(1); - @SuppressWarnings("unchecked") + TestObservable> observableOfObservables = new TestObservable<>(callOnce, okToContinue, odds, even); Observable concatF = Observable.concat(Observable.unsafeCreate(observableOfObservables)); concatF.subscribe(observer); @@ -310,7 +310,6 @@ public void concatConcurrentWithInfinity() { Observer observer = TestHelper.mockObserver(); - @SuppressWarnings("unchecked") TestObservable> observableOfObservables = new TestObservable<>(Observable.unsafeCreate(w1), Observable.unsafeCreate(w2)); Observable concatF = Observable.concat(Observable.unsafeCreate(observableOfObservables)); @@ -438,7 +437,6 @@ public void concatUnsubscribeConcurrent() { Observer observer = TestHelper.mockObserver(); TestObserver to = new TestObserver<>(observer); - @SuppressWarnings("unchecked") TestObservable> observableOfObservables = new TestObservable<>(Observable.unsafeCreate(w1), Observable.unsafeCreate(w2)); Observable concatF = Observable.concat(Observable.unsafeCreate(observableOfObservables)); @@ -493,10 +491,12 @@ public boolean isDisposed() { private final T seed; private final int size; + @SafeVarargs TestObservable(T... values) { this(null, null, values); } + @SafeVarargs TestObservable(CountDownLatch once, CountDownLatch okToContinue, T... values) { this.values = Arrays.asList(values); this.size = this.values.size(); @@ -799,7 +799,6 @@ public void concatArrayDelayErrorWithError() { .assertFailure(TestException.class, 1, 2, 3, 4); } - @SuppressWarnings("unchecked") @Test public void concatIterableDelayError() { Observable.concatDelayError( @@ -809,7 +808,6 @@ public void concatIterableDelayError() { .assertResult(1, 2, 3, 4); } - @SuppressWarnings("unchecked") @Test public void concatIterableDelayErrorWithError() { Observable.concatDelayError( @@ -1004,7 +1002,6 @@ public void subscribe(ObservableEmitter s) throws Exception { assertEquals(1, calls[0]); } - @SuppressWarnings("unchecked") @Test public void noSubsequentSubscriptionIterable() { final int[] calls = { 0 }; @@ -1025,7 +1022,6 @@ public void subscribe(ObservableEmitter s) throws Exception { assertEquals(1, calls[0]); } - @SuppressWarnings("unchecked") @Test public void noSubsequentSubscriptionDelayErrorIterable() { final int[] calls = { 0 }; @@ -1179,7 +1175,6 @@ public void run() throws Exception { assertEquals(0, counter.get()); } - @SuppressWarnings("unchecked") @Test public void noCancelPreviousIterable() { final AtomicInteger counter = new AtomicInteger(); diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableMergeDelayErrorTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableMergeDelayErrorTest.java index db6450d097..c4d24a69c7 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableMergeDelayErrorTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableMergeDelayErrorTest.java @@ -499,7 +499,6 @@ public void run() { } } - @SuppressWarnings("unchecked") @Test public void mergeIterableDelayError() { Observable.mergeDelayError(Arrays.asList(Observable.just(1), Observable.just(2))) @@ -515,7 +514,6 @@ public void mergeArrayDelayError() { .assertResult(1, 2); } - @SuppressWarnings("unchecked") @Test public void mergeIterableDelayErrorWithError() { Observable.mergeDelayError( @@ -561,7 +559,6 @@ public void mergeDelayErrorWithErrorMaxConcurrency() { .assertFailure(TestException.class, 1, 2); } - @SuppressWarnings("unchecked") @Test public void mergeIterableDelayErrorMaxConcurrency() { Observable.mergeDelayError( @@ -571,7 +568,6 @@ public void mergeIterableDelayErrorMaxConcurrency() { .assertResult(1, 2); } - @SuppressWarnings("unchecked") @Test public void mergeIterableDelayErrorWithErrorMaxConcurrency() { Observable.mergeDelayError( diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableTimeIntervalTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableTimeIntervalTest.java index 3b849ab978..5f935791b1 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableTimeIntervalTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableTimeIntervalTest.java @@ -128,7 +128,6 @@ public void dispose() { TestHelper.checkDisposed(Observable.just(1).timeInterval()); } - @SuppressWarnings("unchecked") @Test public void error() { Observable.error(new TestException()) diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableToListTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableToListTest.java index 1981c2b5af..020183f9fa 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableToListTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableToListTest.java @@ -85,7 +85,6 @@ public void listWithBlockingFirstObservable() { Assert.assertEquals(Arrays.asList("one", "two", "three"), actual); } - @SuppressWarnings("unchecked") @Test public void capacityHintObservable() { Observable.range(1, 10) @@ -154,7 +153,6 @@ static void await(CyclicBarrier cb) { } } - @SuppressWarnings("unchecked") @Test public void capacityHint() { Observable.range(1, 10) @@ -170,7 +168,6 @@ public void dispose() { TestHelper.checkDisposed(Observable.just(1).toList()); } - @SuppressWarnings("unchecked") @Test public void error() { Observable.error(new TestException()) @@ -180,7 +177,6 @@ public void error() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void errorSingle() { Observable.error(new TestException()) @@ -189,7 +185,6 @@ public void errorSingle() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void collectionSupplierThrows() { Observable.just(1) @@ -204,7 +199,6 @@ public Collection get() throws Exception { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void collectionSupplierReturnsNull() { Observable.just(1) @@ -220,7 +214,6 @@ public Collection get() throws Exception { .assertErrorMessage(ExceptionHelper.nullWarning("The collectionSupplier returned a null Collection.")); } - @SuppressWarnings("unchecked") @Test public void singleCollectionSupplierThrows() { Observable.just(1) @@ -234,7 +227,6 @@ public Collection get() throws Exception { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void singleCollectionSupplierReturnsNull() { Observable.just(1) diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableToSortedListTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableToSortedListTest.java index 7d01bcc3b1..19c10c6622 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableToSortedListTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableToSortedListTest.java @@ -96,7 +96,6 @@ public int compare(Integer a, Integer b) { .assertResult(5, 4, 3, 2, 1); } - @SuppressWarnings("unchecked") @Test public void toSortedListCapacityObservable() { Observable.just(5, 1, 2, 4, 3).toSortedList(4).toObservable() @@ -104,7 +103,6 @@ public void toSortedListCapacityObservable() { .assertResult(Arrays.asList(1, 2, 3, 4, 5)); } - @SuppressWarnings("unchecked") @Test public void toSortedListComparatorCapacityObservable() { Observable.just(5, 1, 2, 4, 3).toSortedList(new Comparator() { @@ -152,7 +150,6 @@ public void withFollowingFirst() { assertEquals(Arrays.asList(1, 2, 3, 4, 5), o.toSortedList().blockingGet()); } - @SuppressWarnings("unchecked") @Test public void toSortedListCapacity() { Observable.just(5, 1, 2, 4, 3).toSortedList(4) @@ -160,7 +157,6 @@ public void toSortedListCapacity() { .assertResult(Arrays.asList(1, 2, 3, 4, 5)); } - @SuppressWarnings("unchecked") @Test public void toSortedListComparatorCapacity() { Observable.just(5, 1, 2, 4, 3).toSortedList(new Comparator() { diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableWindowWithSizeTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableWindowWithSizeTest.java index a897430ab7..04099c31cb 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableWindowWithSizeTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableWindowWithSizeTest.java @@ -293,7 +293,6 @@ public ObservableSource> apply(Observable o) throws E }); } - @SuppressWarnings("unchecked") @Test public void errorExact() { Observable.error(new TestException()) @@ -302,7 +301,6 @@ public void errorExact() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void errorSkip() { Observable.error(new TestException()) @@ -311,7 +309,6 @@ public void errorSkip() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void errorOverlap() { Observable.error(new TestException()) diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableWindowWithStartEndObservableTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableWindowWithStartEndObservableTest.java index 0c7dc8056b..af67c36bf2 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableWindowWithStartEndObservableTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableWindowWithStartEndObservableTest.java @@ -498,7 +498,6 @@ public void accept(Observable v) throws Throwable { inner.get().test().assertResult(); } - @SuppressWarnings("unchecked") @Test public void closingIndicatorFunctionCrash() { @@ -524,7 +523,6 @@ public Observable apply(Integer end) throws Throwable { assertFalse(boundary.hasObservers()); } - @SuppressWarnings("unchecked") @Test public void mainError() { Observable.error(new TestException()) diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableWithLatestFromTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableWithLatestFromTest.java index a754b21b8c..c23c41fde1 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableWithLatestFromTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableWithLatestFromTest.java @@ -579,7 +579,6 @@ public Object apply(Integer a, Integer b) throws Exception { .assertFailure(NullPointerException.class); } - @SuppressWarnings("unchecked") @Test public void combineToNull2() { Observable.just(1) diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableZipTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableZipTest.java index d8c153a285..1de6190f05 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableZipTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableZipTest.java @@ -1430,7 +1430,6 @@ public Object apply(Object[] a) throws Exception { assertEquals(0, counter.get()); } - @SuppressWarnings("unchecked") @Test public void observableSourcesInIterable() { ObservableSource source = new ObservableSource() { diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleAmbTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleAmbTest.java index a6caec6171..7faf26454e 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleAmbTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleAmbTest.java @@ -71,7 +71,6 @@ public void ambWithSecondFires() { to.assertResult(2); } - @SuppressWarnings("unchecked") @Test public void ambIterableWithFirstFires() { PublishProcessor pp1 = PublishProcessor.create(); @@ -93,7 +92,6 @@ public void ambIterableWithFirstFires() { } - @SuppressWarnings("unchecked") @Test public void ambIterableWithSecondFires() { PublishProcessor pp1 = PublishProcessor.create(); @@ -272,7 +270,6 @@ public void ambWithOrder() { Single.just(1).ambWith(error).test().assertValue(1); } - @SuppressWarnings("unchecked") @Test public void ambIterableOrder() { Single error = Single.error(new RuntimeException()); @@ -343,7 +340,6 @@ public void accept(Object v, Throwable e) throws Exception { } } - @SuppressWarnings("unchecked") @Test public void singleSourcesInIterable() { SingleSource source = new SingleSource() { diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleConcatTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleConcatTest.java index eebe0c1020..348810be1f 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleConcatTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleConcatTest.java @@ -89,7 +89,6 @@ public void concatArrayEagerTest() { ts.assertComplete(); } - @SuppressWarnings("unchecked") @Test public void concatEagerIterableTest() { PublishProcessor pp1 = PublishProcessor.create(); @@ -163,7 +162,6 @@ public void subscribe(SingleEmitter s) throws Exception { assertEquals(1, calls[0]); } - @SuppressWarnings("unchecked") @Test public void noSubsequentSubscriptionIterable() { final int[] calls = { 0 }; diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleMaterializeTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleMaterializeTest.java index 00b5f8d712..4bc05ea67d 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleMaterializeTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleMaterializeTest.java @@ -24,7 +24,6 @@ public class SingleMaterializeTest extends RxJavaTest { @Test - @SuppressWarnings("unchecked") public void success() { Single.just(1) .materialize() @@ -33,7 +32,6 @@ public void success() { } @Test - @SuppressWarnings("unchecked") public void error() { TestException ex = new TestException(); Maybe.error(ex) diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleMergeTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleMergeTest.java index ee991b431b..7aba476c86 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleMergeTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleMergeTest.java @@ -72,7 +72,6 @@ public void mergeErrors() { } } - @SuppressWarnings("unchecked") @Test public void mergeDelayErrorIterable() { Single.mergeDelayError(Arrays.asList( diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleZipIterableTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleZipIterableTest.java index 948972dbcb..6fd6744479 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleZipIterableTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleZipIterableTest.java @@ -38,7 +38,6 @@ public Object apply(Object[] a) throws Exception { } }; - @SuppressWarnings("unchecked") @Test public void firstError() { Single.zip(Arrays.asList(Single.error(new TestException()), Single.just(1)), addString) @@ -46,7 +45,6 @@ public void firstError() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void secondError() { Single.zip(Arrays.asList(Single.just(1), Single.error(new TestException())), addString) @@ -54,7 +52,6 @@ public void secondError() { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void dispose() { PublishProcessor pp = PublishProcessor.create(); @@ -69,7 +66,6 @@ public void dispose() { assertFalse(pp.hasSubscribers()); } - @SuppressWarnings("unchecked") @Test public void zipperThrows() { Single.zip(Arrays.asList(Single.just(1), Single.just(2)), new Function() { @@ -82,7 +78,6 @@ public Object apply(Object[] b) throws Exception { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void zipperReturnsNull() { Single.zip(Arrays.asList(Single.just(1), Single.just(2)), new Function() { @@ -95,7 +90,6 @@ public Object apply(Object[] a) throws Exception { .assertFailure(NullPointerException.class); } - @SuppressWarnings("unchecked") @Test public void middleError() { PublishProcessor pp0 = PublishProcessor.create(); @@ -112,7 +106,6 @@ public void middleError() { to.assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void innerErrorRace() { for (int i = 0; i < TestHelper.RACE_DEFAULT_LOOPS; i++) { @@ -190,7 +183,6 @@ public Single apply(Integer v) throws Exception { .assertFailureAndMessage(TestException.class, "next()"); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void zipIterableOneIsNull() { Single.zip(Arrays.asList(null, Single.just(1)), new Function() { @@ -202,7 +194,6 @@ public Object apply(Object[] v) { .blockingGet(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void zipIterableTwoIsNull() { Single.zip(Arrays.asList(Single.just(1), null), new Function() { @@ -238,7 +229,6 @@ public Object apply(Object[] a) throws Exception { .assertResult(2); } - @SuppressWarnings("unchecked") @Test public void singleSourceZipperReturnsNull() { Single.zip(Arrays.asList(Single.just(1)), Functions.justFunction(null)) @@ -246,7 +236,6 @@ public void singleSourceZipperReturnsNull() { .assertFailureAndMessage(NullPointerException.class, "The zipper returned a null value"); } - @SuppressWarnings("unchecked") @Test public void singleSourcesInIterable() { SingleSource source = new SingleSource() { diff --git a/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleZipTest.java b/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleZipTest.java index f5ae16d0bc..79380cfa5f 100644 --- a/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleZipTest.java +++ b/src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleZipTest.java @@ -163,7 +163,6 @@ public Integer apply(Integer a, Integer b) throws Exception { assertEquals(0, counter.get()); } - @SuppressWarnings("unchecked") @Test public void noDisposeOnAllSuccess2() { final AtomicInteger counter = new AtomicInteger(); diff --git a/src/test/java/io/reactivex/rxjava3/maybe/MaybeTest.java b/src/test/java/io/reactivex/rxjava3/maybe/MaybeTest.java index e4d64764d8..c3335c0bab 100644 --- a/src/test/java/io/reactivex/rxjava3/maybe/MaybeTest.java +++ b/src/test/java/io/reactivex/rxjava3/maybe/MaybeTest.java @@ -1401,7 +1401,6 @@ public void concat4() { .assertResult(1, 2, 3, 4); } - @SuppressWarnings("unchecked") @Test public void concatIterable() { Maybe.concat(Arrays.asList(Maybe.just(1), Maybe.just(2))) @@ -1409,7 +1408,6 @@ public void concatIterable() { .assertResult(1, 2); } - @SuppressWarnings("unchecked") @Test public void concatIterableEmpty() { Maybe.concat(Arrays.asList(Maybe.empty(), Maybe.empty())) @@ -1417,7 +1415,6 @@ public void concatIterableEmpty() { .assertResult(); } - @SuppressWarnings("unchecked") @Test public void concatIterableBackpressured() { TestSubscriber ts = Maybe.concat(Arrays.asList(Maybe.just(1), Maybe.just(2))) @@ -1434,7 +1431,6 @@ public void concatIterableBackpressured() { ts.assertResult(1, 2); } - @SuppressWarnings("unchecked") @Test public void concatIterableBackpressuredNonEager() { PublishProcessor pp1 = PublishProcessor.create(); @@ -1624,7 +1620,6 @@ public void ambWithOrder() { Maybe.just(1).ambWith(error).test().assertValue(1); } - @SuppressWarnings("unchecked") @Test public void ambIterableOrder() { Maybe error = Maybe.error(new RuntimeException()); @@ -1772,7 +1767,6 @@ public void ambArray2SignalsComplete() { to.assertResult(); } - @SuppressWarnings("unchecked") @Test public void ambIterable1SignalsSuccess() { PublishProcessor pp1 = PublishProcessor.create(); @@ -1795,7 +1789,6 @@ public void ambIterable1SignalsSuccess() { to.assertResult(1); } - @SuppressWarnings("unchecked") @Test public void ambIterable2SignalsSuccess() { PublishProcessor pp1 = PublishProcessor.create(); @@ -1818,7 +1811,6 @@ public void ambIterable2SignalsSuccess() { to.assertResult(2); } - @SuppressWarnings("unchecked") @Test public void ambIterable2SignalsSuccessWithOverlap() { PublishProcessor pp1 = PublishProcessor.create(); @@ -1842,7 +1834,6 @@ public void ambIterable2SignalsSuccessWithOverlap() { to.assertResult(2); } - @SuppressWarnings("unchecked") @Test public void ambIterable1SignalsError() { PublishProcessor pp1 = PublishProcessor.create(); @@ -1864,7 +1855,6 @@ public void ambIterable1SignalsError() { to.assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void ambIterable2SignalsError() { PublishProcessor pp1 = PublishProcessor.create(); @@ -1886,7 +1876,6 @@ public void ambIterable2SignalsError() { to.assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void ambIterable2SignalsErrorWithOverlap() { PublishProcessor pp1 = PublishProcessor.create(); @@ -1909,7 +1898,6 @@ public void ambIterable2SignalsErrorWithOverlap() { to.assertFailureAndMessage(TestException.class, "2"); } - @SuppressWarnings("unchecked") @Test public void ambIterable1SignalsComplete() { PublishProcessor pp1 = PublishProcessor.create(); @@ -1931,7 +1919,6 @@ public void ambIterable1SignalsComplete() { to.assertResult(); } - @SuppressWarnings("unchecked") @Test public void ambIterable2SignalsComplete() { PublishProcessor pp1 = PublishProcessor.create(); @@ -1968,7 +1955,6 @@ public Iterator> iterator() { }).test().assertError(NullPointerException.class); } - @SuppressWarnings("unchecked") @Test public void ambIterableOneIsNull() { Maybe.amb(Arrays.asList(null, Maybe.just(1))) @@ -2188,7 +2174,6 @@ public void mergeMaybe() { .assertResult(1); } - @SuppressWarnings("unchecked") @Test public void mergeIterable() { Maybe.merge(Arrays.asList(Maybe.just(1), Maybe.just(2), Maybe.just(3))) @@ -2493,7 +2478,6 @@ public void concatArrayDelayError() { assertFalse(Maybe.concatArrayDelayError(Maybe.never()) instanceof MaybeConcatArrayDelayError); } - @SuppressWarnings("unchecked") @Test public void concatIterableDelayError() { Maybe.concatDelayError(Arrays.asList(Maybe.empty(), Maybe.just(1), Maybe.error(new TestException()))) @@ -2539,7 +2523,6 @@ public void concatEagerArray() { } - @SuppressWarnings("unchecked") @Test public void concatEagerIterable() { PublishProcessor pp1 = PublishProcessor.create(); @@ -2638,7 +2621,6 @@ public void mergeArrayDelayError() { assertSame(Flowable.empty(), Maybe.mergeArrayDelayError()); } - @SuppressWarnings("unchecked") @Test public void mergeIterableDelayError() { Maybe.mergeDelayError(Arrays.asList(Maybe.empty(), Maybe.just(1), Maybe.error(new TestException()))) @@ -2900,7 +2882,6 @@ public void zipArray() { .assertResult("[1]"); } - @SuppressWarnings("unchecked") @Test public void zipIterable() { Maybe.zip( @@ -3048,7 +3029,6 @@ public void ambWith2SignalsSuccess() { @Test public void zipIterableObject() { - @SuppressWarnings("unchecked") final List> maybes = Arrays.asList(Maybe.just(1), Maybe.just(4)); Maybe.zip(maybes, new Function() { @Override diff --git a/src/test/java/io/reactivex/rxjava3/observable/ObservableConcatTests.java b/src/test/java/io/reactivex/rxjava3/observable/ObservableConcatTests.java index a9d1afca12..f867a165d2 100644 --- a/src/test/java/io/reactivex/rxjava3/observable/ObservableConcatTests.java +++ b/src/test/java/io/reactivex/rxjava3/observable/ObservableConcatTests.java @@ -62,7 +62,6 @@ public void concatWithIterableOfObservable() { Observable o2 = Observable.just("three", "four"); Observable o3 = Observable.just("five", "six"); - @SuppressWarnings("unchecked") Iterable> is = Arrays.asList(o1, o2, o3); List values = Observable.concat(Observable.fromIterable(is)).toList().blockingGet(); diff --git a/src/test/java/io/reactivex/rxjava3/observable/ObservableNullTests.java b/src/test/java/io/reactivex/rxjava3/observable/ObservableNullTests.java index 5e02ecc3e7..9c112b0f7d 100644 --- a/src/test/java/io/reactivex/rxjava3/observable/ObservableNullTests.java +++ b/src/test/java/io/reactivex/rxjava3/observable/ObservableNullTests.java @@ -66,7 +66,6 @@ public Iterator> iterator() { }).test().assertError(NullPointerException.class); } - @SuppressWarnings("unchecked") @Test public void ambIterableOneIsNull() { Observable.amb(Arrays.asList(Observable.never(), null)) @@ -99,7 +98,6 @@ public Object apply(Object[] v) { }, 128).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void combineLatestIterableOneIsNull() { Observable.combineLatest(Arrays.asList(Observable.never(), null), new Function() { @@ -110,13 +108,11 @@ public Object apply(Object[] v) { }, 128).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void combineLatestIterableFunctionNull() { Observable.combineLatest(Arrays.asList(just1), null, 128); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void combineLatestIterableFunctionReturnsNull() { Observable.combineLatest(Arrays.asList(just1), new Function() { @@ -152,7 +148,6 @@ public Object apply(Object[] v) { }, 128).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void combineLatestDelayErrorIterableOneIsNull() { Observable.combineLatestDelayError(Arrays.asList(Observable.never(), null), new Function() { @@ -163,13 +158,11 @@ public Object apply(Object[] v) { }, 128).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void combineLatestDelayErrorIterableFunctionNull() { Observable.combineLatestDelayError(Arrays.asList(just1), null, 128); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void combineLatestDelayErrorIterableFunctionReturnsNull() { Observable.combineLatestDelayError(Arrays.asList(just1), new Function() { @@ -195,7 +188,6 @@ public Iterator> iterator() { }).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void concatIterableOneIsNull() { Observable.concat(Arrays.asList(just1, null)).blockingLast(); @@ -520,7 +512,6 @@ public Iterator> iterator() { }, 128, 128).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void mergeIterableOneIsNull() { Observable.merge(Arrays.asList(just1, null), 128, 128).blockingLast(); @@ -552,7 +543,6 @@ public Iterator> iterator() { }, 128, 128).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void mergeDelayErrorIterableOneIsNull() { Observable.mergeDelayError(Arrays.asList(just1, null), 128, 128).blockingLast(); @@ -683,13 +673,11 @@ public Object apply(Object[] v) { }).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void zipIterableFunctionNull() { Observable.zip(Arrays.asList(just1, just1), null); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void zipIterableFunctionReturnsNull() { Observable.zip(Arrays.asList(just1, just1), new Function() { @@ -725,13 +713,11 @@ public Object apply(Object[] a) { }, true, 128).blockingLast(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void zipIterable2FunctionNull() { Observable.zip(Arrays.asList(just1, just1), null, true, 128); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void zipIterable2FunctionReturnsNull() { Observable.zip(Arrays.asList(just1, just1), new Function() { diff --git a/src/test/java/io/reactivex/rxjava3/observable/ObservableTest.java b/src/test/java/io/reactivex/rxjava3/observable/ObservableTest.java index 4b888d4ed5..c3110eac3f 100644 --- a/src/test/java/io/reactivex/rxjava3/observable/ObservableTest.java +++ b/src/test/java/io/reactivex/rxjava3/observable/ObservableTest.java @@ -1120,7 +1120,6 @@ public void singleDefaultObservable() { @Test public void zipIterableObject() { - @SuppressWarnings("unchecked") final List> observables = Arrays.asList(Observable.just(1, 2, 3), Observable.just(1, 2, 3)); Observable.zip(observables, new Function() { @Override @@ -1136,7 +1135,6 @@ public Object apply(Object[] o) throws Exception { @Test public void combineLatestObject() { - @SuppressWarnings("unchecked") final List> observables = Arrays.asList(Observable.just(1, 2, 3), Observable.just(1, 2, 3)); Observable.combineLatest(observables, new Function() { @Override diff --git a/src/test/java/io/reactivex/rxjava3/parallel/ParallelCollectTest.java b/src/test/java/io/reactivex/rxjava3/parallel/ParallelCollectTest.java index 26d5af8628..1a94b3c247 100644 --- a/src/test/java/io/reactivex/rxjava3/parallel/ParallelCollectTest.java +++ b/src/test/java/io/reactivex/rxjava3/parallel/ParallelCollectTest.java @@ -45,7 +45,6 @@ public void accept(List a, Integer b) throws Exception { })); } - @SuppressWarnings("unchecked") @Test public void initialCrash() { Flowable.range(1, 5) @@ -66,7 +65,6 @@ public void accept(List a, Integer b) throws Exception { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void reducerCrash() { Flowable.range(1, 5) @@ -117,7 +115,6 @@ public void accept(List a, Integer b) throws Exception { assertFalse(pp.hasSubscribers()); } - @SuppressWarnings("unchecked") @Test public void error() { Flowable.error(new TestException()) @@ -138,7 +135,6 @@ public void accept(List a, Integer b) throws Exception { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void doubleError() { List errors = TestHelper.trackPluginErrors(); diff --git a/src/test/java/io/reactivex/rxjava3/parallel/ParallelDoOnNextTryTest.java b/src/test/java/io/reactivex/rxjava3/parallel/ParallelDoOnNextTryTest.java index 47371b3073..0ba01a05fd 100644 --- a/src/test/java/io/reactivex/rxjava3/parallel/ParallelDoOnNextTryTest.java +++ b/src/test/java/io/reactivex/rxjava3/parallel/ParallelDoOnNextTryTest.java @@ -189,7 +189,6 @@ public void accept(Integer v) throws Exception { .assertResult(1); } - @SuppressWarnings("unchecked") @Test public void doOnNextFailHandlerThrows() { TestSubscriberEx ts = Flowable.range(0, 2) @@ -336,7 +335,6 @@ public void accept(Integer v) throws Exception { .assertResult(1); } - @SuppressWarnings("unchecked") @Test public void doOnNextFailHandlerThrowsConditional() { TestSubscriberEx ts = Flowable.range(0, 2) diff --git a/src/test/java/io/reactivex/rxjava3/parallel/ParallelFilterTryTest.java b/src/test/java/io/reactivex/rxjava3/parallel/ParallelFilterTryTest.java index f2f7377942..084566a0a5 100644 --- a/src/test/java/io/reactivex/rxjava3/parallel/ParallelFilterTryTest.java +++ b/src/test/java/io/reactivex/rxjava3/parallel/ParallelFilterTryTest.java @@ -192,7 +192,6 @@ public boolean test(Integer v) throws Exception { .assertResult(1); } - @SuppressWarnings("unchecked") @Test public void filterFailHandlerThrows() { TestSubscriberEx ts = Flowable.range(0, 2) @@ -327,7 +326,6 @@ public boolean test(Integer v) throws Exception { .assertResult(1); } - @SuppressWarnings("unchecked") @Test public void filterFailHandlerThrowsConditional() { TestSubscriberEx ts = Flowable.range(0, 2) diff --git a/src/test/java/io/reactivex/rxjava3/parallel/ParallelFlowableTest.java b/src/test/java/io/reactivex/rxjava3/parallel/ParallelFlowableTest.java index 1e048a1dcc..93ffe8de7d 100644 --- a/src/test/java/io/reactivex/rxjava3/parallel/ParallelFlowableTest.java +++ b/src/test/java/io/reactivex/rxjava3/parallel/ParallelFlowableTest.java @@ -236,7 +236,6 @@ public Long apply(Long a, Long b) throws Exception { } } - @SuppressWarnings("unchecked") @Test public void toSortedList() { TestSubscriber> ts = new TestSubscriber<>(); diff --git a/src/test/java/io/reactivex/rxjava3/parallel/ParallelMapTryTest.java b/src/test/java/io/reactivex/rxjava3/parallel/ParallelMapTryTest.java index 2df4dd1462..b036b2e17f 100644 --- a/src/test/java/io/reactivex/rxjava3/parallel/ParallelMapTryTest.java +++ b/src/test/java/io/reactivex/rxjava3/parallel/ParallelMapTryTest.java @@ -167,7 +167,6 @@ public Integer apply(Integer v) throws Exception { .assertResult(1); } - @SuppressWarnings("unchecked") @Test public void mapFailHandlerThrows() { TestSubscriberEx ts = Flowable.range(0, 2) @@ -302,7 +301,6 @@ public Integer apply(Integer v) throws Exception { .assertResult(1); } - @SuppressWarnings("unchecked") @Test public void mapFailHandlerThrowsConditional() { TestSubscriberEx ts = Flowable.range(0, 2) diff --git a/src/test/java/io/reactivex/rxjava3/parallel/ParallelReduceTest.java b/src/test/java/io/reactivex/rxjava3/parallel/ParallelReduceTest.java index aac8c0af62..5646b176b1 100644 --- a/src/test/java/io/reactivex/rxjava3/parallel/ParallelReduceTest.java +++ b/src/test/java/io/reactivex/rxjava3/parallel/ParallelReduceTest.java @@ -46,7 +46,6 @@ public List apply(List a, Integer b) throws Exception { })); } - @SuppressWarnings("unchecked") @Test public void initialCrash() { Flowable.range(1, 5) @@ -68,7 +67,6 @@ public List apply(List a, Integer b) throws Exception { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void reducerCrash() { Flowable.range(1, 5) @@ -121,7 +119,6 @@ public List apply(List a, Integer b) throws Exception { assertFalse(pp.hasSubscribers()); } - @SuppressWarnings("unchecked") @Test public void error() { Flowable.error(new TestException()) @@ -143,7 +140,6 @@ public List apply(List a, Integer b) throws Exception { .assertFailure(TestException.class); } - @SuppressWarnings("unchecked") @Test public void doubleError() { List errors = TestHelper.trackPluginErrors(); diff --git a/src/test/java/io/reactivex/rxjava3/single/SingleNullTests.java b/src/test/java/io/reactivex/rxjava3/single/SingleNullTests.java index 7da2cdf95f..98ba085b19 100644 --- a/src/test/java/io/reactivex/rxjava3/single/SingleNullTests.java +++ b/src/test/java/io/reactivex/rxjava3/single/SingleNullTests.java @@ -49,7 +49,6 @@ public Iterator> iterator() { }).test().assertError(NullPointerException.class); } - @SuppressWarnings("unchecked") @Test public void ambIterableOneIsNull() { Single.amb(Arrays.asList(null, just1)) @@ -85,7 +84,6 @@ public Iterator> iterator() { }).blockingSubscribe(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void concatIterableOneIsNull() { Single.concat(Arrays.asList(just1, null)).blockingSubscribe(); @@ -249,7 +247,6 @@ public Iterator> iterator() { }).blockingSubscribe(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void mergeIterableOneIsNull() { Single.merge(Arrays.asList(null, just1)).blockingSubscribe(); @@ -384,7 +381,6 @@ public Object apply(Object[] v) { }).blockingGet(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void zipIterableOneIsNull() { Single.zip(Arrays.asList(null, just1), new Function() { @@ -395,13 +391,11 @@ public Object apply(Object[] v) { }).blockingGet(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void zipIterableOneFunctionNull() { Single.zip(Arrays.asList(just1, just1), null).blockingGet(); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void zipIterableOneFunctionReturnsNull() { Single.zip(Arrays.asList(just1, just1), new Function() { @@ -529,7 +523,6 @@ public Object apply(Object[] v) { }, (Single[])null); } - @SuppressWarnings("unchecked") @Test(expected = NullPointerException.class) public void zipIterableTwoIsNull() { Single.zip(Arrays.asList(just1, null), new Function() { diff --git a/src/test/java/io/reactivex/rxjava3/single/SingleTest.java b/src/test/java/io/reactivex/rxjava3/single/SingleTest.java index 92974c0ef2..1f7cba7e2d 100644 --- a/src/test/java/io/reactivex/rxjava3/single/SingleTest.java +++ b/src/test/java/io/reactivex/rxjava3/single/SingleTest.java @@ -510,7 +510,6 @@ public void toFutureThrows() throws Exception { @Test(expected = UnsupportedOperationException.class) public void toFlowableIterableRemove() { - @SuppressWarnings("unchecked") Iterable> f = SingleInternalHelper.iterableToFlowable(Arrays.asList(Single.just(1))); Iterator> iterator = f.iterator(); @@ -520,7 +519,6 @@ public void toFlowableIterableRemove() { @Test public void zipIterableObject() { - @SuppressWarnings("unchecked") final List> singles = Arrays.asList(Single.just(1), Single.just(4)); Single.zip(singles, new Function() { @Override diff --git a/src/test/java/io/reactivex/rxjava3/tck/AmbArrayTckTest.java b/src/test/java/io/reactivex/rxjava3/tck/AmbArrayTckTest.java index 491eccb85b..88b24a00ab 100644 --- a/src/test/java/io/reactivex/rxjava3/tck/AmbArrayTckTest.java +++ b/src/test/java/io/reactivex/rxjava3/tck/AmbArrayTckTest.java @@ -21,7 +21,6 @@ @Test public class AmbArrayTckTest extends BaseTck { - @SuppressWarnings("unchecked") @Override public Publisher createPublisher(long elements) { return diff --git a/src/test/java/io/reactivex/rxjava3/tck/AmbTckTest.java b/src/test/java/io/reactivex/rxjava3/tck/AmbTckTest.java index 2bdcf2c89f..a0d4a63764 100644 --- a/src/test/java/io/reactivex/rxjava3/tck/AmbTckTest.java +++ b/src/test/java/io/reactivex/rxjava3/tck/AmbTckTest.java @@ -23,7 +23,6 @@ @Test public class AmbTckTest extends BaseTck { - @SuppressWarnings("unchecked") @Override public Publisher createPublisher(long elements) { return diff --git a/src/test/java/io/reactivex/rxjava3/tck/CombineLatestIterableDelayErrorTckTest.java b/src/test/java/io/reactivex/rxjava3/tck/CombineLatestIterableDelayErrorTckTest.java index b309de7837..5581b9551e 100644 --- a/src/test/java/io/reactivex/rxjava3/tck/CombineLatestIterableDelayErrorTckTest.java +++ b/src/test/java/io/reactivex/rxjava3/tck/CombineLatestIterableDelayErrorTckTest.java @@ -24,7 +24,6 @@ @Test public class CombineLatestIterableDelayErrorTckTest extends BaseTck { - @SuppressWarnings("unchecked") @Override public Publisher createPublisher(long elements) { return diff --git a/src/test/java/io/reactivex/rxjava3/tck/CombineLatestIterableTckTest.java b/src/test/java/io/reactivex/rxjava3/tck/CombineLatestIterableTckTest.java index ed59b0aeb7..744d909949 100644 --- a/src/test/java/io/reactivex/rxjava3/tck/CombineLatestIterableTckTest.java +++ b/src/test/java/io/reactivex/rxjava3/tck/CombineLatestIterableTckTest.java @@ -24,7 +24,6 @@ @Test public class CombineLatestIterableTckTest extends BaseTck { - @SuppressWarnings("unchecked") @Override public Publisher createPublisher(long elements) { return diff --git a/src/test/java/io/reactivex/rxjava3/tck/ConcatArrayEagerTckTest.java b/src/test/java/io/reactivex/rxjava3/tck/ConcatArrayEagerTckTest.java index 7cf2fb3dc1..9885f3b939 100644 --- a/src/test/java/io/reactivex/rxjava3/tck/ConcatArrayEagerTckTest.java +++ b/src/test/java/io/reactivex/rxjava3/tck/ConcatArrayEagerTckTest.java @@ -23,7 +23,6 @@ @Test public class ConcatArrayEagerTckTest extends BaseTck { - @SuppressWarnings("unchecked") @Override public Publisher createPublisher(long elements) { return diff --git a/src/test/java/io/reactivex/rxjava3/tck/ConcatIterableEagerTckTest.java b/src/test/java/io/reactivex/rxjava3/tck/ConcatIterableEagerTckTest.java index 6ab7f2a7ba..e365418449 100644 --- a/src/test/java/io/reactivex/rxjava3/tck/ConcatIterableEagerTckTest.java +++ b/src/test/java/io/reactivex/rxjava3/tck/ConcatIterableEagerTckTest.java @@ -21,7 +21,6 @@ @Test public class ConcatIterableEagerTckTest extends BaseTck { - @SuppressWarnings("unchecked") @Override public Publisher createPublisher(long elements) { return diff --git a/src/test/java/io/reactivex/rxjava3/tck/MergeIterableTckTest.java b/src/test/java/io/reactivex/rxjava3/tck/MergeIterableTckTest.java index f597b70905..79d781d848 100644 --- a/src/test/java/io/reactivex/rxjava3/tck/MergeIterableTckTest.java +++ b/src/test/java/io/reactivex/rxjava3/tck/MergeIterableTckTest.java @@ -23,7 +23,6 @@ @Test public class MergeIterableTckTest extends BaseTck { - @SuppressWarnings("unchecked") @Override public Publisher createPublisher(long elements) { return diff --git a/src/test/java/io/reactivex/rxjava3/tck/RefCountProcessor.java b/src/test/java/io/reactivex/rxjava3/tck/RefCountProcessor.java index 77bdfef211..c65a0bd58f 100644 --- a/src/test/java/io/reactivex/rxjava3/tck/RefCountProcessor.java +++ b/src/test/java/io/reactivex/rxjava3/tck/RefCountProcessor.java @@ -46,7 +46,7 @@ RefCountProcessor(FlowableProcessor actual) { this.actual = actual; this.upstream = new AtomicReference<>(); - this.subscribers = new AtomicReference[]>(EMPTY); + this.subscribers = new AtomicReference<>(EMPTY); } @Override diff --git a/src/test/java/io/reactivex/rxjava3/tck/ZipIterableTckTest.java b/src/test/java/io/reactivex/rxjava3/tck/ZipIterableTckTest.java index ec4583ff07..8ef456e609 100644 --- a/src/test/java/io/reactivex/rxjava3/tck/ZipIterableTckTest.java +++ b/src/test/java/io/reactivex/rxjava3/tck/ZipIterableTckTest.java @@ -24,7 +24,6 @@ @Test public class ZipIterableTckTest extends BaseTck { - @SuppressWarnings("unchecked") @Override public Publisher createPublisher(long elements) { return diff --git a/src/test/java/io/reactivex/rxjava3/testsupport/BaseTestConsumerEx.java b/src/test/java/io/reactivex/rxjava3/testsupport/BaseTestConsumerEx.java index 2c68b0151a..8eb1d9f906 100644 --- a/src/test/java/io/reactivex/rxjava3/testsupport/BaseTestConsumerEx.java +++ b/src/test/java/io/reactivex/rxjava3/testsupport/BaseTestConsumerEx.java @@ -176,6 +176,7 @@ public final U assertErrorMessage(String message) { * @param values the expected values, asserted in order * @return this */ + @SafeVarargs public final U assertFailure(Predicate errorPredicate, T... values) { return assertSubscribed() .assertValues(values) @@ -192,6 +193,7 @@ public final U assertFailure(Predicate errorPredicate, T... values) { * @param values the expected values, asserted in order * @return this */ + @SafeVarargs public final U assertFailureAndMessage(Class error, String message, T... values) { return assertSubscribed()