Skip to content

Commit c2fd36e

Browse files
Making Observable.synchronize an instance method rather than static
1 parent 53c30d3 commit c2fd36e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class Observable[+T](val asJava: rx.Observable[_ <: T])
176176
* Observable, and that synchronously notifies its {@link Observer}s
177177
*/
178178
def synchronize: Observable[T] = {
179-
Observable[T](JObservable.synchronize(asJava))
179+
Observable[T](asJava.synchronize)
180180
}
181181

182182
/**

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,6 +1783,13 @@ public Observable<T> synchronize() {
17831783
return create(OperationSynchronize.synchronize(this));
17841784
}
17851785

1786+
/**
1787+
* @deprecated Replaced with instance method.
1788+
*/
1789+
@Deprecated
1790+
public static <T> Observable<T> synchronize(Observable<T> source) {
1791+
return create(OperationSynchronize.synchronize(source));
1792+
}
17861793

17871794
/**
17881795
* Emits an item each time interval (containing a sequential number).

0 commit comments

Comments
 (0)