Skip to content

Commit d2f8f2a

Browse files
Merge pull request ReactiveX#255 from jmhofer/fix-build-warnings
Cleaning up - fixing a lot of build warnings (mostly javadoc)
2 parents a3cb1cb + 1ad2093 commit d2f8f2a

22 files changed

+83
-74
lines changed

rxjava-core/src/main/java/rx/Notification.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ public boolean hasException() {
9696
}
9797

9898
/**
99-
* The kind of notification: OnNext, OnError, OnCompleted
99+
* Retrieves the kind of the notification: OnNext, OnError, OnCompleted
100100
*
101-
* @return
101+
* @return the kind of the notification: OnNext, OnError, OnCompleted
102102
*/
103103
public Kind getKind() {
104104
return kind;

rxjava-core/src/main/java/rx/Observable.java

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,8 @@ public void onNext(T args) {
589589
* <p>
590590
* This is similar to {@link #subscribe(Observer)} but blocks. Because it blocks it does not need the {@link Observer#onCompleted()} or {@link Observer#onError(Exception)} methods.
591591
*
592-
* @param onNext
593-
* {@link Action1}
592+
* @param o
593+
* onNext {@link Action1 action}
594594
* @throws RuntimeException
595595
* if error occurs
596596
*/
@@ -901,7 +901,7 @@ public static <T> Observable<T> where(Observable<T> that, Func1<T, Boolean> pred
901901
* @param <T>
902902
* the type of items in the {@link Iterable} sequence and the type emitted by the resulting Observable
903903
* @return an Observable that emits each item in the source {@link Iterable} sequence
904-
* @see {@link #toObservable(Iterable)}
904+
* @see #toObservable(Iterable)
905905
*/
906906
public static <T> Observable<T> from(Iterable<T> iterable) {
907907
return toObservable(iterable);
@@ -915,7 +915,7 @@ public static <T> Observable<T> from(Iterable<T> iterable) {
915915
* @param <T>
916916
* the type of items in the Array, and the type of items emitted by the resulting Observable
917917
* @return an Observable that emits each item in the source Array
918-
* @see {@link #toObservable(Object...)}
918+
* @see #toObservable(Object...)
919919
*/
920920
public static <T> Observable<T> from(T... items) {
921921
return toObservable(items);
@@ -1219,7 +1219,7 @@ public R call(T t1) {
12191219
* @return an Observable that emits a sequence that is the result of applying the transformation
12201220
* function to each item emitted by the source Observable and merging the results of
12211221
* the Observables obtained from this transformation
1222-
* @see {@link #flatMap(Observable, Func1)}
1222+
* @see #flatMap(Observable, Func1)
12231223
*/
12241224
public static <T, R> Observable<R> mapMany(Observable<T> sequence, Func1<T, Observable<R>> func) {
12251225
return create(OperationMap.mapMany(sequence, func));
@@ -1407,7 +1407,7 @@ public static <T> Observable<T> finallyDo(Observable<T> source, Action0 action)
14071407
* @return an Observable that emits a sequence that is the result of applying the transformation
14081408
* function to each item emitted by the source Observable and merging the results of
14091409
* the Observables obtained from this transformation
1410-
* @see {@link #mapMany(Observable, Func1)}
1410+
* @see #mapMany(Observable, Func1)
14111411
*/
14121412
public static <T, R> Observable<R> flatMap(Observable<T> sequence, Func1<T, Observable<R>> func) {
14131413
return mapMany(sequence, func);
@@ -1435,7 +1435,7 @@ public static <T, R> Observable<R> flatMap(Observable<T> sequence, Func1<T, Obse
14351435
* @return an Observable that emits a sequence that is the result of applying the transformation
14361436
* function to each item emitted by the source Observable and merging the results of
14371437
* the Observables obtained from this transformation
1438-
* @see {@link #mapMany(Observable, Func1)}
1438+
* @see #mapMany(Observable, Func1)
14391439
*/
14401440
public static <T, R> Observable<R> flatMap(Observable<T> sequence, final Object func) {
14411441
return mapMany(sequence, func);
@@ -2038,24 +2038,24 @@ public static <T> Observable<T> takeLast(final Observable<T> items, final int co
20382038
}
20392039

20402040
/**
2041-
* Returns a specified number of contiguous values from the start of an observable sequence.
2041+
* Returns the values from the start of an observable sequence while a given predicate remains true.
20422042
*
20432043
* @param items
20442044
* @param predicate
20452045
* a function to test each source element for a condition
2046-
* @return
2046+
* @return the values from the start of the given sequence
20472047
*/
20482048
public static <T> Observable<T> takeWhile(final Observable<T> items, Func1<T, Boolean> predicate) {
20492049
return create(OperationTakeWhile.takeWhile(items, predicate));
20502050
}
20512051

20522052
/**
2053-
* Returns a specified number of contiguous values from the start of an observable sequence.
2053+
* Returns the values from the start of an observable sequence while a given predicate remains true.
20542054
*
20552055
* @param items
20562056
* @param predicate
20572057
* a function to test each source element for a condition
2058-
* @return
2058+
* @return the values from the start of the given sequence
20592059
*/
20602060
public static <T> Observable<T> takeWhile(final Observable<T> items, Object predicate) {
20612061
@SuppressWarnings("rawtypes")
@@ -2075,7 +2075,7 @@ public Boolean call(T t) {
20752075
* @param items
20762076
* @param predicate
20772077
* a function to test each element for a condition; the second parameter of the function represents the index of the source element; otherwise, false.
2078-
* @return
2078+
* @return the values from the start of the given sequence
20792079
*/
20802080
public static <T> Observable<T> takeWhileWithIndex(final Observable<T> items, Func2<T, Integer, Boolean> predicate) {
20812081
return create(OperationTakeWhile.takeWhileWithIndex(items, predicate));
@@ -2110,7 +2110,7 @@ public Observable<Timestamped<T>> timestamp() {
21102110
*
21112111
* @param that
21122112
* the source Observable
2113-
* @returna Future that expects a single item emitted by the source Observable
2113+
* @return a Future that expects a single item emitted by the source Observable
21142114
*/
21152115
public static <T> Future<T> toFuture(final Observable<T> that) {
21162116
return OperationToFuture.toFuture(that);
@@ -2424,7 +2424,7 @@ public static <T> Observable<T> toObservable(T... items) {
24242424
* @param sequence
24252425
* @throws ClassCastException
24262426
* if T objects do not implement Comparable
2427-
* @return
2427+
* @return an observable containing the sorted list
24282428
*/
24292429
public static <T> Observable<List<T>> toSortedList(Observable<T> sequence) {
24302430
return create(OperationToObservableSortedList.toSortedList(sequence));
@@ -2437,7 +2437,7 @@ public static <T> Observable<List<T>> toSortedList(Observable<T> sequence) {
24372437
*
24382438
* @param sequence
24392439
* @param sortFunction
2440-
* @return
2440+
* @return an observable containing the sorted list
24412441
*/
24422442
public static <T> Observable<List<T>> toSortedList(Observable<T> sequence, Func2<T, T, Integer> sortFunction) {
24432443
return create(OperationToObservableSortedList.toSortedList(sequence, sortFunction));
@@ -2450,7 +2450,7 @@ public static <T> Observable<List<T>> toSortedList(Observable<T> sequence, Func2
24502450
*
24512451
* @param sequence
24522452
* @param sortFunction
2453-
* @return
2453+
* @return an observable containing the sorted list
24542454
*/
24552455
public static <T> Observable<List<T>> toSortedList(Observable<T> sequence, final Object sortFunction) {
24562456
@SuppressWarnings("rawtypes")
@@ -2801,7 +2801,7 @@ public Boolean call(T t1) {
28012801
* @return an Observable that emits a sequence that is the result of applying the transformation
28022802
* function to each item in the input sequence and merging the results of the
28032803
* Observables obtained from this transformation.
2804-
* @see {@link #mapMany(Func1)}
2804+
* @see #mapMany(Func1)
28052805
*/
28062806
public <R> Observable<R> flatMap(Func1<T, Observable<R>> func) {
28072807
return mapMany(func);
@@ -2822,7 +2822,7 @@ public <R> Observable<R> flatMap(Func1<T, Observable<R>> func) {
28222822
* @return an Observable that emits a sequence that is the result of applying the transformation'
28232823
* function to each item in the input sequence and merging the results of the
28242824
* Observables obtained from this transformation.
2825-
* @see {@link #mapMany(Object)}
2825+
* @see #mapMany(Object)
28262826
*/
28272827
public <R> Observable<R> flatMap(final Object callback) {
28282828
return mapMany(callback);
@@ -2973,7 +2973,7 @@ public R call(T t1) {
29732973
* @return an Observable that emits a sequence that is the result of applying the transformation
29742974
* function to each item in the input sequence and merging the results of the
29752975
* Observables obtained from this transformation.
2976-
* @see {@link #flatMap(Func1)}
2976+
* @see #flatMap(Func1)
29772977
*/
29782978
public <R> Observable<R> mapMany(Func1<T, Observable<R>> func) {
29792979
return mapMany(this, func);
@@ -2994,7 +2994,7 @@ public <R> Observable<R> mapMany(Func1<T, Observable<R>> func) {
29942994
* @return an Observable that emits a sequence that is the result of applying the transformation'
29952995
* function to each item in the input sequence and merging the results of the
29962996
* Observables obtained from this transformation.
2997-
* @see {@link #flatMap(Object))}
2997+
* @see #flatMap(Object)
29982998
*/
29992999
public <R> Observable<R> mapMany(final Object callback) {
30003000
@SuppressWarnings("rawtypes")
@@ -3490,18 +3490,18 @@ public Observable<T> take(final int num) {
34903490
*
34913491
* @param predicate
34923492
* a function to test each source element for a condition
3493-
* @return
3493+
* @return the values from the start of the given sequence
34943494
*/
34953495
public Observable<T> takeWhile(final Func1<T, Boolean> predicate) {
34963496
return takeWhile(this, predicate);
34973497
}
34983498

34993499
/**
3500-
* Returns a specified number of contiguous values from the start of an observable sequence.
3500+
* Returns an Observable that items emitted by the source Observable as long as a specified condition is true.
35013501
*
35023502
* @param predicate
35033503
* a function to test each source element for a condition
3504-
* @return
3504+
* @return the values from the start of the given sequence
35053505
*/
35063506
public Observable<T> takeWhile(final Object predicate) {
35073507
return takeWhile(this, predicate);
@@ -3512,7 +3512,7 @@ public Observable<T> takeWhile(final Object predicate) {
35123512
*
35133513
* @param predicate
35143514
* a function to test each element for a condition; the second parameter of the function represents the index of the source element; otherwise, false.
3515-
* @return
3515+
* @return the values from the start of the given sequence
35163516
*/
35173517
public Observable<T> takeWhileWithIndex(final Func2<T, Integer, Boolean> predicate) {
35183518
return takeWhileWithIndex(this, predicate);
@@ -3523,7 +3523,7 @@ public Observable<T> takeWhileWithIndex(final Func2<T, Integer, Boolean> predica
35233523
*
35243524
* @param predicate
35253525
* a function to test each element for a condition; the second parameter of the function represents the index of the source element; otherwise, false.
3526-
* @return
3526+
* @return the values from the start of the given sequence
35273527
*/
35283528
public Observable<T> takeWhileWithIndex(final Object predicate) {
35293529
return takeWhileWithIndex(this, predicate);
@@ -3561,7 +3561,7 @@ public <E> Observable<T> takeUntil(Observable<E> other) {
35613561
* <p>
35623562
* This will throw an exception if the Observable emits more than 1 value. If more than 1 are expected then use <code>toList().toFuture()</code>.
35633563
*
3564-
* @returna Future that expects a single item emitted by the source Observable
3564+
* @return a Future that expects a single item emitted by the source Observable
35653565
*/
35663566
public Future<T> toFuture() {
35673567
return toFuture(this);
@@ -3594,7 +3594,7 @@ public Observable<List<T>> toList() {
35943594
*
35953595
* @throws ClassCastException
35963596
* if T objects do not implement Comparable
3597-
* @return
3597+
* @return an observable containing the sorted list
35983598
*/
35993599
public Observable<List<T>> toSortedList() {
36003600
return toSortedList(this);
@@ -3606,7 +3606,7 @@ public Observable<List<T>> toSortedList() {
36063606
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/toSortedList.png">
36073607
*
36083608
* @param sortFunction
3609-
* @return
3609+
* @return an observable containing the sorted list
36103610
*/
36113611
public Observable<List<T>> toSortedList(Func2<T, T, Integer> sortFunction) {
36123612
return toSortedList(this, sortFunction);
@@ -3618,7 +3618,7 @@ public Observable<List<T>> toSortedList(Func2<T, T, Integer> sortFunction) {
36183618
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/toSortedList.png">
36193619
*
36203620
* @param sortFunction
3621-
* @return
3621+
* @return an observable containing the sorted list
36223622
*/
36233623
public Observable<List<T>> toSortedList(final Object sortFunction) {
36243624
return toSortedList(this, sortFunction);
@@ -3705,7 +3705,7 @@ public Iterable<T> mostRecent(T initialValue) {
37053705
* NOTE: If strong reasons for not depending on package names comes up then the implementation of this method can change to looking for a marker interface.
37063706
*
37073707
* @param f
3708-
* @return
3708+
* @return {@code true} if the given function is an internal implementation, and {@code false} otherwise.
37093709
*/
37103710
private boolean isInternalImplementation(Object o) {
37113711
if (o == null) {

rxjava-core/src/main/java/rx/concurrency/SleepingAction.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616
package rx.concurrency;
1717

18-
import java.util.concurrent.TimeUnit;
19-
2018
import rx.Scheduler;
2119
import rx.Subscription;
2220
import rx.util.functions.Func2;

rxjava-core/src/main/java/rx/observables/GroupedObservable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/**
2424
* An {@link Observable} that has been grouped by a key whose value can be obtained using {@link #getKey()} <p>
2525
*
26-
* @see {@link Observable#groupBy(Observable, Func1)}
26+
* @see Observable#groupBy(Observable, Func1)
2727
*
2828
* @param <K>
2929
* @param <T>

rxjava-core/src/main/java/rx/operators/OperationDematerialize.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
/**
3030
* Dematerializes the explicit notification values of an observable sequence as implicit notifications.
31-
* See http://msdn.microsoft.com/en-us/library/hh229047(v=vs.103).aspx for the Microsoft Rx equivalent.
31+
* See <a href="http://msdn.microsoft.com/en-us/library/hh229047(v=vs.103).aspx">here</a> for the Microsoft Rx equivalent.
3232
*/
3333
public final class OperationDematerialize {
3434

@@ -38,7 +38,7 @@ public final class OperationDematerialize {
3838
* @param sequence
3939
* An observable sequence containing explicit notification values which have to be turned into implicit notifications.
4040
* @return An observable sequence exhibiting the behavior corresponding to the source sequence's notification values.
41-
* @see http://msdn.microsoft.com/en-us/library/hh229047(v=vs.103).aspx
41+
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229047(v=vs.103).aspx">Observable.Dematerialize(TSource) Method </a>
4242
*/
4343
public static <T> Func1<Observer<T>, Subscription> dematerialize(final Observable<Notification<T>> sequence) {
4444
return new DematerializeObservable<T>(sequence);

rxjava-core/src/main/java/rx/operators/OperationFinally.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package rx.operators;
1717

18-
import static org.junit.Assert.*;
1918
import static org.mockito.Mockito.*;
2019

2120
import org.junit.Before;
@@ -24,7 +23,6 @@
2423
import rx.Observable;
2524
import rx.Observer;
2625
import rx.Subscription;
27-
import rx.util.AtomicObservableSubscription;
2826
import rx.util.functions.Action0;
2927
import rx.util.functions.Func1;
3028

@@ -103,19 +101,24 @@ public void onNext(T args) {
103101
public static class UnitTest {
104102
private Action0 aAction0;
105103
private Observer<String> aObserver;
104+
105+
@SuppressWarnings("unchecked") // mocking has to be unchecked, unfortunately
106106
@Before
107107
public void before() {
108108
aAction0 = mock(Action0.class);
109109
aObserver = mock(Observer.class);
110110
}
111+
111112
private void checkActionCalled(Observable<String> input) {
112113
Observable.create(finallyDo(input, aAction0)).subscribe(aObserver);
113114
verify(aAction0, times(1)).call();
114115
}
116+
115117
@Test
116118
public void testFinallyCalledOnComplete() {
117119
checkActionCalled(Observable.toObservable(new String[] {"1", "2", "3"}));
118120
}
121+
119122
@Test
120123
public void testFinallyCalledOnError() {
121124
checkActionCalled(Observable.<String>error(new RuntimeException("expected")));

rxjava-core/src/main/java/rx/operators/OperationMaterialize.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@
3333
* <p>
3434
* In other words, converts a sequence of OnNext, OnError and OnCompleted events into a sequence of ObservableNotifications containing the OnNext, OnError and OnCompleted values.
3535
* <p>
36-
* See http://msdn.microsoft.com/en-us/library/hh229453(v=VS.103).aspx for the Microsoft Rx equivalent.
36+
* See <a href="http://msdn.microsoft.com/en-us/library/hh229453(v=VS.103).aspx">here</a> for the Microsoft Rx equivalent.
3737
*/
3838
public final class OperationMaterialize {
3939

4040
/**
4141
* Materializes the implicit notifications of an observable sequence as explicit notification values.
4242
*
43-
* @param source
43+
* @param sequence
4444
* An observable sequence of elements to project.
4545
* @return An observable sequence whose elements are the result of materializing the notifications of the given sequence.
46-
* @see http://msdn.microsoft.com/en-us/library/hh229453(v=VS.103).aspx
46+
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229453(v=VS.103).aspx">Observable.Materialize(TSource) Method </a>
4747
*/
4848
public static <T> Func1<Observer<Notification<T>>, Subscription> materialize(final Observable<T> sequence) {
4949
return new MaterializeObservable<T>(sequence);

rxjava-core/src/main/java/rx/operators/OperationMerge.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ public final class OperationMerge {
4444
/**
4545
* Flattens the observable sequences from the list of Observables into one observable sequence without any transformation.
4646
*
47-
* @param source
47+
* @param o
4848
* An observable sequence of elements to project.
4949
* @return An observable sequence whose elements are the result of flattening the output from the list of Observables.
50-
* @see http://msdn.microsoft.com/en-us/library/hh229099(v=vs.103).aspx
50+
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229099(v=vs.103).aspx">Observable.Merge(TSource) Method (IObservable(TSource)[])</a>
5151
*/
5252
public static <T> Func1<Observer<T>, Subscription> merge(final Observable<Observable<T>> o) {
5353
// wrap in a Func so that if a chain is built up, then asynchronously subscribed to twice we will have 2 instances of Take<T> rather than 1 handing both, which is not thread-safe.

rxjava-core/src/main/java/rx/operators/OperationMergeDelayError.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ public final class OperationMergeDelayError {
5151
* onError or onComplete so as to allow all successful
5252
* onNext calls to be received.
5353
*
54-
* @param source
54+
* @param sequences
5555
* An observable sequence of elements to project.
5656
* @return An observable sequence whose elements are the result of flattening the output from the list of Observables.
57-
* @see http://msdn.microsoft.com/en-us/library/hh229099(v=vs.103).aspx
57+
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229099(v=vs.103).aspx">Observable.Merge(TSource) Method (IObservable(TSource)[])</a>
5858
*/
5959
public static <T> Func1<Observer<T>, Subscription> mergeDelayError(final Observable<Observable<T>> sequences) {
6060
// wrap in a Func so that if a chain is built up, then asynchronously subscribed to twice we will have 2 instances of Take<T> rather than 1 handing both, which is not thread-safe.

0 commit comments

Comments
 (0)