Skip to content

1.x: javac- and javadoc-related cleanup in components, part 2 #3951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/main/java/rx/Notification.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

/**
* An object representing a notification sent to an {@link Observable}.
* @param <T> the actual value type held by the Notification
*/
public final class Notification<T> {

Expand All @@ -29,6 +30,7 @@ public final class Notification<T> {
/**
* Creates and returns a {@code Notification} of variety {@code Kind.OnNext}, and assigns it a value.
*
* @param <T> the actual value type held by the Notification
* @param t
* the item to assign to the notification as its value
* @return an {@code OnNext} variety of {@code Notification}
Expand All @@ -40,6 +42,7 @@ public static <T> Notification<T> createOnNext(T t) {
/**
* Creates and returns a {@code Notification} of variety {@code Kind.OnError}, and assigns it an exception.
*
* @param <T> the actual value type held by the Notification
* @param e
* the exception to assign to the notification
* @return an {@code OnError} variety of {@code Notification}
Expand All @@ -51,6 +54,7 @@ public static <T> Notification<T> createOnError(Throwable e) {
/**
* Creates and returns a {@code Notification} of variety {@code Kind.OnCompleted}.
*
* @param <T> the actual value type held by the Notification
* @return an {@code OnCompleted} variety of {@code Notification}
*/
@SuppressWarnings("unchecked")
Expand All @@ -61,7 +65,7 @@ public static <T> Notification<T> createOnCompleted() {
/**
* Creates and returns a {@code Notification} of variety {@code Kind.OnCompleted}.
*
* @warn param "type" undescribed
* @param <T> the actual value type held by the Notification
* @param type
* @return an {@code OnCompleted} variety of {@code Notification}
*/
Expand Down Expand Up @@ -151,6 +155,7 @@ public boolean isOnNext() {

/**
* Forwards this notification on to a specified {@link Observer}.
* @param observer the target observer to call onXXX methods on based on the kind of this Notification instance
*/
public void accept(Observer<? super T> observer) {
if (isOnNext()) {
Expand Down
25 changes: 17 additions & 8 deletions src/main/java/rx/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ public static <T> Observable<T> amb(Observable<? extends T> o1, Observable<? ext
* Observables by means of the given aggregation function
* @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "cast" })
public static <T1, T2, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Func2<? super T1, ? super T2, ? extends R> combineFunction) {
return (Observable<R>)combineLatest(Arrays.asList(o1, o2), Functions.fromFunc(combineFunction));
}
Expand Down Expand Up @@ -628,7 +628,7 @@ public static <T1, T2, R> Observable<R> combineLatest(Observable<? extends T1> o
* Observables by means of the given aggregation function
* @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "cast" })
public static <T1, T2, T3, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Func3<? super T1, ? super T2, ? super T3, ? extends R> combineFunction) {
return (Observable<R>)combineLatest(Arrays.asList(o1, o2, o3), Functions.fromFunc(combineFunction));
}
Expand Down Expand Up @@ -658,7 +658,7 @@ public static <T1, T2, T3, R> Observable<R> combineLatest(Observable<? extends T
* Observables by means of the given aggregation function
* @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "cast" })
public static <T1, T2, T3, T4, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4,
Func4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> combineFunction) {
return (Observable<R>)combineLatest(Arrays.asList(o1, o2, o3, o4), Functions.fromFunc(combineFunction));
Expand Down Expand Up @@ -691,7 +691,7 @@ public static <T1, T2, T3, T4, R> Observable<R> combineLatest(Observable<? exten
* Observables by means of the given aggregation function
* @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "cast" })
public static <T1, T2, T3, T4, T5, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5,
Func5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> combineFunction) {
return (Observable<R>)combineLatest(Arrays.asList(o1, o2, o3, o4, o5), Functions.fromFunc(combineFunction));
Expand Down Expand Up @@ -726,7 +726,7 @@ public static <T1, T2, T3, T4, T5, R> Observable<R> combineLatest(Observable<? e
* Observables by means of the given aggregation function
* @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "cast" })
public static <T1, T2, T3, T4, T5, T6, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6,
Func6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R> combineFunction) {
return (Observable<R>)combineLatest(Arrays.asList(o1, o2, o3, o4, o5, o6), Functions.fromFunc(combineFunction));
Expand Down Expand Up @@ -763,7 +763,7 @@ public static <T1, T2, T3, T4, T5, T6, R> Observable<R> combineLatest(Observable
* Observables by means of the given aggregation function
* @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "cast" })
public static <T1, T2, T3, T4, T5, T6, T7, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6, Observable<? extends T7> o7,
Func7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R> combineFunction) {
return (Observable<R>)combineLatest(Arrays.asList(o1, o2, o3, o4, o5, o6, o7), Functions.fromFunc(combineFunction));
Expand Down Expand Up @@ -802,7 +802,7 @@ public static <T1, T2, T3, T4, T5, T6, T7, R> Observable<R> combineLatest(Observ
* Observables by means of the given aggregation function
* @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "cast" })
public static <T1, T2, T3, T4, T5, T6, T7, T8, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6, Observable<? extends T7> o7, Observable<? extends T8> o8,
Func8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> combineFunction) {
return (Observable<R>)combineLatest(Arrays.asList(o1, o2, o3, o4, o5, o6, o7, o8), Functions.fromFunc(combineFunction));
Expand Down Expand Up @@ -843,7 +843,7 @@ public static <T1, T2, T3, T4, T5, T6, T7, T8, R> Observable<R> combineLatest(Ob
* Observables by means of the given aggregation function
* @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "cast" })
public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6, Observable<? extends T7> o7, Observable<? extends T8> o8,
Observable<? extends T9> o9,
Func9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? extends R> combineFunction) {
Expand Down Expand Up @@ -1311,6 +1311,7 @@ public static <T> Observable<T> error(Throwable exception) {
* @return an Observable that emits the item from the source {@link Future}
* @see <a href="http://reactivex.io/documentation/operators/from.html">ReactiveX operators documentation: From</a>
*/
@SuppressWarnings("cast")
public static <T> Observable<T> from(Future<? extends T> future) {
return (Observable<T>)create(OnSubscribeToObservableFuture.toObservableFuture(future));
}
Expand Down Expand Up @@ -1342,6 +1343,7 @@ public static <T> Observable<T> from(Future<? extends T> future) {
* @return an Observable that emits the item from the source {@link Future}
* @see <a href="http://reactivex.io/documentation/operators/from.html">ReactiveX operators documentation: From</a>
*/
@SuppressWarnings("cast")
public static <T> Observable<T> from(Future<? extends T> future, long timeout, TimeUnit unit) {
return (Observable<T>)create(OnSubscribeToObservableFuture.toObservableFuture(future, timeout, unit));
}
Expand Down Expand Up @@ -1372,6 +1374,7 @@ public static <T> Observable<T> from(Future<? extends T> future, long timeout, T
*/
public static <T> Observable<T> from(Future<? extends T> future, Scheduler scheduler) {
// TODO in a future revision the Scheduler will become important because we'll start polling instead of blocking on the Future
@SuppressWarnings("cast")
Observable<T> o = (Observable<T>)create(OnSubscribeToObservableFuture.toObservableFuture(future));
return o.subscribeOn(scheduler);
}
Expand Down Expand Up @@ -5742,6 +5745,7 @@ public final <R> Observable<R> flatMapIterable(Func1<? super T, ? extends Iterab
* Observable
* @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
*/
@SuppressWarnings("cast")
public final <U, R> Observable<R> flatMapIterable(Func1<? super T, ? extends Iterable<? extends U>> collectionSelector,
Func2<? super T, ? super U, ? extends R> resultSelector) {
return (Observable<R>)flatMap(OperatorMapPair.convertSelector(collectionSelector), resultSelector);
Expand Down Expand Up @@ -5777,6 +5781,7 @@ public final <U, R> Observable<R> flatMapIterable(Func1<? super T, ? extends Ite
* @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
* @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
*/
@SuppressWarnings("cast")
@Beta
public final <U, R> Observable<R> flatMapIterable(Func1<? super T, ? extends Iterable<? extends U>> collectionSelector,
Func2<? super T, ? super U, ? extends R> resultSelector, int maxConcurrent) {
Expand Down Expand Up @@ -6554,6 +6559,7 @@ public final Observable<T> onErrorResumeNext(final Func1<Throwable, ? extends Ob
* @return the original Observable, with appropriately modified behavior
* @see <a href="http://reactivex.io/documentation/operators/catch.html">ReactiveX operators documentation: Catch</a>
*/
@SuppressWarnings("cast")
public final Observable<T> onErrorResumeNext(final Observable<? extends T> resumeSequence) {
return lift((Operator<T, T>)OperatorOnErrorResumeNextViaFunction.withOther(resumeSequence));
}
Expand Down Expand Up @@ -6584,6 +6590,7 @@ public final Observable<T> onErrorResumeNext(final Observable<? extends T> resum
* @return the original Observable with appropriately modified behavior
* @see <a href="http://reactivex.io/documentation/operators/catch.html">ReactiveX operators documentation: Catch</a>
*/
@SuppressWarnings("cast")
public final Observable<T> onErrorReturn(Func1<Throwable, ? extends T> resumeFunction) {
return lift((Operator<T, T>)OperatorOnErrorResumeNextViaFunction.withSingle(resumeFunction));
}
Expand Down Expand Up @@ -6620,6 +6627,7 @@ public final Observable<T> onErrorReturn(Func1<Throwable, ? extends T> resumeFun
* @return the original Observable, with appropriately modified behavior
* @see <a href="http://reactivex.io/documentation/operators/catch.html">ReactiveX operators documentation: Catch</a>
*/
@SuppressWarnings("cast")
public final Observable<T> onExceptionResumeNext(final Observable<? extends T> resumeSequence) {
return lift((Operator<T, T>)OperatorOnErrorResumeNextViaFunction.withException(resumeSequence));
}
Expand Down Expand Up @@ -10327,6 +10335,7 @@ public final <T2, R> Observable<R> zipWith(Iterable<? extends T2> other, Func2<?
* and emits the results of {@code zipFunction} applied to these pairs
* @see <a href="http://reactivex.io/documentation/operators/zip.html">ReactiveX operators documentation: Zip</a>
*/
@SuppressWarnings("cast")
public final <T2, R> Observable<R> zipWith(Observable<? extends T2> other, Func2<? super T, ? super T2, ? extends R> zipFunction) {
return (Observable<R>)zip(this, other, zipFunction);
}
Expand Down
Loading