Skip to content

Commit ccac9e7

Browse files
Merge pull request #1053 from benjchristensen/deprecation-cleanup
Deprecation Cleanup
2 parents d40c868 + e505cee commit ccac9e7

File tree

81 files changed

+141
-5919
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+141
-5919
lines changed

language-adaptors/rxjava-clojure/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,22 +106,22 @@ or, at the REPL:
106106
```
107107

108108
### Using rx/fn
109-
Once the namespace is required, you can use the `rx/fn` macro anywhere RxJava wants a `rx.util.functions.Func` object. The syntax is exactly the same as `clojure.core/fn`:
109+
Once the namespace is required, you can use the `rx/fn` macro anywhere RxJava wants a `rx.functions.Func` object. The syntax is exactly the same as `clojure.core/fn`:
110110

111111
```clojure
112112
(-> my-observable
113113
(.map (rx/fn [v] (* 2 v))))
114114
```
115115

116-
If you already have a plain old Clojure function you'd like to use, you can pass it to the `rx/fn*` function to get a new object that implements `rx.util.functions.Func`:
116+
If you already have a plain old Clojure function you'd like to use, you can pass it to the `rx/fn*` function to get a new object that implements `rx.functions.Func`:
117117

118118
```clojure
119119
(-> my-numbers
120120
(.reduce (rx/fn* +)))
121121
```
122122

123123
### Using rx/action
124-
The `rx/action` macro is identical to `rx/fn` except that the object returned implements `rx.util.functions.Action` interfaces. It's used in `subscribe` and other side-effect-y contexts:
124+
The `rx/action` macro is identical to `rx/fn` except that the object returned implements `rx.functions.Action` interfaces. It's used in `subscribe` and other side-effect-y contexts:
125125

126126
```clojure
127127
(-> my-observable
@@ -133,7 +133,7 @@ The `rx/action` macro is identical to `rx/fn` except that the object returned im
133133
```
134134

135135
### Using Observable/create
136-
As of 0.17, `rx.Observable/create` takes an implementation of `rx.Observable$OnSubscribe` which is basically an alias for `rx.util.functions.Action1` that takes an `rx.Subscriber` as its argument. Thus, you can just use `rx/action` when creating new observables:
136+
As of 0.17, `rx.Observable/create` takes an implementation of `rx.Observable$OnSubscribe` which is basically an alias for `rx.functions.Action1` that takes an `rx.Subscriber` as its argument. Thus, you can just use `rx/action` when creating new observables:
137137

138138
```clojure
139139
; A simple observable that emits 0..9 taking unsubscribe into account

language-adaptors/rxjava-clojure/src/main/clojure/rx/lang/clojure/chunk.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
(instance? rx.Observable action)
7474
(rx/on-next observer
7575
(.finallyDo ^rx.Observable action
76-
(reify rx.util.functions.Action0
76+
(reify rx.functions.Action0
7777
(call [this]
7878
(swap! state-atom update-in [:in-flight] disj action)
7979
(advance! state-atom)))))))

language-adaptors/rxjava-clojure/src/main/clojure/rx/lang/clojure/core.clj

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
BlockingObservable
2323
GroupedObservable]
2424
[rx.subscriptions Subscriptions]
25-
[rx.util.functions Action0 Action1 Func0 Func1 Func2]))
25+
[rx.functions Action0 Action1 Func0 Func1 Func2]))
2626

2727
(set! *warn-on-reflection* true)
2828

@@ -292,16 +292,14 @@
292292
;################################################################################
293293
; Operators
294294

295-
(defn synchronize
296-
"Synchronize execution.
295+
(defn serialize
296+
"Serialize execution.
297297
298298
See:
299-
rx.Observable/synchronize
299+
rx.Observable/serialize
300300
"
301301
([^Observable xs]
302-
(.synchronize xs))
303-
([lock ^Observable xs]
304-
(.synchronize xs lock)))
302+
(.serialize xs)))
305303

306304
(defn merge*
307305
"Merge an Observable of Observables into a single Observable
@@ -472,10 +470,10 @@
472470
empty Observable if xs is empty.
473471
474472
See:
475-
rx.Observable/takeFirst
473+
rx.Observable/take(1)
476474
"
477475
[^Observable xs]
478-
(.takeFirst xs))
476+
(.take xs 1))
479477

480478
(defn ^Observable group-by
481479
"Returns an Observable of clojure.lang.MapEntry where the key is the result of
@@ -832,7 +830,7 @@
832830
833831
See:
834832
rx.Observable/onErrorResumeNext
835-
http://netflix.github.io/RxJava/javadoc/rx/Observable.html#onErrorResumeNext(rx.util.functions.Func1)
833+
http://netflix.github.io/RxJava/javadoc/rx/Observable.html#onErrorResumeNext(rx.functions.Func1)
836834
"
837835
[p f ^Observable o]
838836
(let [p (if (class? p)

language-adaptors/rxjava-clojure/src/test/clojure/rx/lang/clojure/core_test.clj

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,14 @@
9696
(b/into []))]
9797
(is (= [2 4] result))))
9898

99-
(deftest test-syncrhonize
100-
; I'm going to believe synchronize works and just exercise it
99+
(deftest test-serialize
100+
; I'm going to believe serialize works and just exercise it
101101
; here for sanity.
102102
(is (= [1 2 3]
103103
(->> [1 2 3]
104104
(rx/seq->o)
105-
(rx/synchronize)
106-
(b/into []))))
107-
(let [lock (Object.)]
108-
(is (= [1 2 3]
109-
(->> [1 2 3]
110-
(rx/seq->o)
111-
(rx/synchronize lock)
112-
(b/into []))))))
105+
(rx/serialize)
106+
(b/into [])))))
113107

114108
(let [expected-result [[1 3 5] [2 4 6]]
115109
sleepy-o #(f/future-generator*

language-adaptors/rxjava-groovy/src/test/groovy/rx/lang/groovy/ObservableTests.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def class ObservableTests {
322322

323323
Observable.from("one", "two", "three", "four", "five", "six")
324324
.groupBy({String s -> s.length()})
325-
.mapMany({
325+
.flatMap({
326326
groupObservable ->
327327

328328
return groupObservable.map({

language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/Observable.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ trait Observable[+T]
268268
* @return an Observable that is a chronologically well-behaved version of the source
269269
* Observable, and that synchronously notifies its [[rx.lang.scala.Observer]]s
270270
*/
271-
def synchronize: Observable[T] = {
272-
toScalaObservable[T](asJavaObservable.synchronize)
271+
def serialize: Observable[T] = {
272+
toScalaObservable[T](asJavaObservable.serialize)
273273
}
274274

275275
/**

rxjava-contrib/rxjava-quasar/src/main/java/rx/quasar/BlockingObservable.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@
1515
*/
1616
package rx.quasar;
1717

18-
import co.paralleluniverse.fibers.SuspendExecution;
19-
import co.paralleluniverse.fibers.Suspendable;
20-
import co.paralleluniverse.strands.AbstractFuture;
21-
import co.paralleluniverse.strands.ConditionSynchronizer;
22-
import co.paralleluniverse.strands.SimpleConditionSynchronizer;
23-
import co.paralleluniverse.strands.Strand;
24-
import co.paralleluniverse.strands.channels.Channels;
25-
import co.paralleluniverse.strands.channels.DelegatingReceivePort;
26-
import co.paralleluniverse.strands.channels.ProducerException;
27-
import co.paralleluniverse.strands.channels.ReceivePort;
2818
import java.util.concurrent.Future;
2919
import java.util.concurrent.TimeUnit;
3020
import java.util.concurrent.atomic.AtomicBoolean;
@@ -38,6 +28,16 @@
3828
import rx.functions.Action1;
3929
import rx.functions.Func1;
4030
import rx.observers.SafeSubscriber;
31+
import co.paralleluniverse.fibers.SuspendExecution;
32+
import co.paralleluniverse.fibers.Suspendable;
33+
import co.paralleluniverse.strands.AbstractFuture;
34+
import co.paralleluniverse.strands.ConditionSynchronizer;
35+
import co.paralleluniverse.strands.SimpleConditionSynchronizer;
36+
import co.paralleluniverse.strands.Strand;
37+
import co.paralleluniverse.strands.channels.Channels;
38+
import co.paralleluniverse.strands.channels.DelegatingReceivePort;
39+
import co.paralleluniverse.strands.channels.ProducerException;
40+
import co.paralleluniverse.strands.channels.ReceivePort;
4141

4242
/**
4343
* An extension of {@link Observable} that provides blocking operators, compatible with both threads and fibers.

rxjava-contrib/rxjava-quasar/src/main/java/rx/quasar/ChannelObservable.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
* limitations under the License.
1515
*/package rx.quasar;
1616

17+
import java.util.concurrent.ExecutionException;
18+
import java.util.concurrent.TimeUnit;
19+
import java.util.concurrent.TimeoutException;
20+
21+
import rx.Observable;
22+
import rx.Observer;
23+
import rx.Scheduler;
1724
import co.paralleluniverse.fibers.FiberAsync;
1825
import co.paralleluniverse.fibers.SuspendExecution;
1926
import co.paralleluniverse.fibers.Suspendable;
@@ -22,12 +29,6 @@
2229
import co.paralleluniverse.strands.channels.Channels;
2330
import co.paralleluniverse.strands.channels.ReceivePort;
2431
import co.paralleluniverse.strands.channels.SendPort;
25-
import java.util.concurrent.ExecutionException;
26-
import java.util.concurrent.TimeUnit;
27-
import java.util.concurrent.TimeoutException;
28-
import rx.Observable;
29-
import rx.Observer;
30-
import rx.Scheduler;
3132

3233
/**
3334
* This class contains static methods that connect {@link Observable}s and {@link Channel}s.

rxjava-contrib/rxjava-quasar/src/main/java/rx/quasar/NewFiberScheduler.java

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

18-
import co.paralleluniverse.fibers.DefaultFiberScheduler;
19-
import co.paralleluniverse.fibers.Fiber;
20-
import co.paralleluniverse.fibers.FiberScheduler;
21-
import co.paralleluniverse.fibers.SuspendExecution;
22-
import co.paralleluniverse.strands.SuspendableRunnable;
23-
2418
import java.util.concurrent.TimeUnit;
2519
import java.util.concurrent.atomic.AtomicReference;
2620

2721
import rx.Scheduler;
2822
import rx.Subscription;
23+
import rx.functions.Action0;
2924
import rx.subscriptions.CompositeSubscription;
3025
import rx.subscriptions.Subscriptions;
31-
import rx.functions.Action0;
26+
import co.paralleluniverse.fibers.DefaultFiberScheduler;
27+
import co.paralleluniverse.fibers.Fiber;
28+
import co.paralleluniverse.fibers.FiberScheduler;
29+
import co.paralleluniverse.fibers.SuspendExecution;
30+
import co.paralleluniverse.strands.SuspendableRunnable;
3231

3332
/**
3433
* Schedules work on a new fiber.

rxjava-contrib/rxjava-quasar/src/main/java/rx/quasar/OnSubscribeFromChannel.java

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

18-
import co.paralleluniverse.fibers.Suspendable;
19-
import co.paralleluniverse.strands.channels.ReceivePort;
2018
import rx.Observable.OnSubscribe;
2119
import rx.Subscriber;
20+
import co.paralleluniverse.fibers.Suspendable;
21+
import co.paralleluniverse.strands.channels.ReceivePort;
2222

2323
/**
2424
* Converts a {@link ReceivePort} into an Observable that emits each message received on the channel.

rxjava-contrib/rxjava-quasar/src/main/java/rx/quasar/RxSuspendableClassifier.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
*/
1616
package rx.quasar;
1717

18-
import co.paralleluniverse.fibers.instrument.MethodDatabase;
19-
import co.paralleluniverse.fibers.instrument.SimpleSuspendableClassifier;
20-
import co.paralleluniverse.fibers.instrument.SuspendableClassifier;
2118
import java.util.Arrays;
2219
import java.util.HashSet;
2320
import java.util.Set;
2421

22+
import co.paralleluniverse.fibers.instrument.MethodDatabase;
23+
import co.paralleluniverse.fibers.instrument.SimpleSuspendableClassifier;
24+
import co.paralleluniverse.fibers.instrument.SuspendableClassifier;
25+
2526
public class RxSuspendableClassifier implements SuspendableClassifier {
2627
private static final Set<String> CORE_PACKAGES = new HashSet<String>(Arrays.asList(new String[]{
2728
"rx", "rx.joins", "rx.observables", "rx.observers", "rx.operators", "rx.plugins", "rx.schedulers",

rxjava-contrib/rxjava-quasar/src/test/java/rx/quasar/BlockingObservableTest.java

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

18-
import co.paralleluniverse.strands.channels.ProducerException;
19-
import co.paralleluniverse.strands.channels.ReceivePort;
20-
import static org.junit.Assert.*;
21-
22-
import java.util.Iterator;
23-
import java.util.NoSuchElementException;
18+
import static org.junit.Assert.assertEquals;
19+
import static org.junit.Assert.fail;
2420

2521
import org.junit.Assert;
2622
import org.junit.Before;
@@ -32,10 +28,12 @@
3228
import rx.Observer;
3329
import rx.Subscriber;
3430
import rx.Subscription;
31+
import rx.functions.Action1;
32+
import rx.functions.Func1;
3533
import rx.subscriptions.BooleanSubscription;
3634
import rx.subscriptions.Subscriptions;
37-
import rx.util.functions.Action1;
38-
import rx.util.functions.Func1;
35+
import co.paralleluniverse.strands.channels.ProducerException;
36+
import co.paralleluniverse.strands.channels.ReceivePort;
3937

4038
public class BlockingObservableTest {
4139

rxjava-contrib/rxjava-quasar/src/test/java/rx/quasar/ChannelObservableTest.java

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,35 @@
1515
*/
1616
package rx.quasar;
1717

18-
import co.paralleluniverse.fibers.Fiber;
19-
import co.paralleluniverse.fibers.SuspendExecution;
20-
import co.paralleluniverse.fibers.Suspendable;
21-
import co.paralleluniverse.strands.Strand;
22-
import co.paralleluniverse.strands.SuspendableCallable;
23-
import co.paralleluniverse.strands.channels.Channel;
24-
import co.paralleluniverse.strands.channels.Channels;
25-
import co.paralleluniverse.strands.channels.ProducerException;
26-
import co.paralleluniverse.strands.channels.ReceivePort;
18+
import static org.hamcrest.CoreMatchers.equalTo;
19+
import static org.hamcrest.CoreMatchers.instanceOf;
20+
import static org.hamcrest.CoreMatchers.is;
21+
import static org.hamcrest.CoreMatchers.nullValue;
22+
import static org.junit.Assert.assertThat;
23+
import static org.junit.Assert.assertTrue;
24+
import static org.junit.Assert.fail;
25+
2726
import java.util.ArrayList;
2827
import java.util.Arrays;
2928
import java.util.Queue;
3029
import java.util.concurrent.ConcurrentLinkedQueue;
3130
import java.util.concurrent.ExecutionException;
3231
import java.util.concurrent.atomic.AtomicBoolean;
33-
import static org.hamcrest.CoreMatchers.*;
34-
import static org.junit.Assert.*;
32+
3533
import org.junit.Test;
34+
3635
import rx.Observable;
3736
import rx.Observer;
3837
import rx.subjects.PublishSubject;
38+
import co.paralleluniverse.fibers.Fiber;
39+
import co.paralleluniverse.fibers.SuspendExecution;
40+
import co.paralleluniverse.fibers.Suspendable;
41+
import co.paralleluniverse.strands.Strand;
42+
import co.paralleluniverse.strands.SuspendableCallable;
43+
import co.paralleluniverse.strands.channels.Channel;
44+
import co.paralleluniverse.strands.channels.Channels;
45+
import co.paralleluniverse.strands.channels.ProducerException;
46+
import co.paralleluniverse.strands.channels.ReceivePort;
3947

4048
public class ChannelObservableTest {
4149
@Test

rxjava-contrib/rxjava-quasar/src/test/java/rx/quasar/NewFiberSchedulerTest.java

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

18-
import org.junit.Rule;
19-
import org.junit.rules.TestRule;
20-
import org.junit.rules.Timeout;
2118
import rx.Scheduler;
2219
import rx.schedulers.AbstractSchedulerConcurrencyTests;
2320

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

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -52,43 +52,6 @@ private Notification(Kind kind, T value, Throwable e) {
5252
this.kind = kind;
5353
}
5454

55-
/**
56-
* A constructor used to represent an onNext notification.
57-
*
58-
* @param value
59-
* The data passed to the onNext method.
60-
*/
61-
@Deprecated
62-
public Notification(T value) {
63-
this.value = value;
64-
this.throwable = null;
65-
this.kind = Kind.OnNext;
66-
}
67-
68-
/**
69-
* A constructor used to represent an onError notification.
70-
*
71-
* @param exception
72-
* The exception passed to the onError notification.
73-
* @deprecated Because type Throwable can't disambiguate the constructors if both onNext and onError are type "Throwable"
74-
*/
75-
@Deprecated
76-
public Notification(Throwable exception) {
77-
this.throwable = exception;
78-
this.value = null;
79-
this.kind = Kind.OnError;
80-
}
81-
82-
/**
83-
* A constructor used to represent an onCompleted notification.
84-
*/
85-
@Deprecated
86-
public Notification() {
87-
this.throwable = null;
88-
this.value = null;
89-
this.kind = Kind.OnCompleted;
90-
}
91-
9255
/**
9356
* Retrieves the exception associated with an onError notification.
9457
*

0 commit comments

Comments
 (0)