@@ -352,10 +352,10 @@ trait Observable[+T]
352
352
* @return
353
353
* An [[rx.lang.scala.Observable ]] which produces buffers which are created and emitted when the specified [[rx.lang.scala.Observable ]]s publish certain objects.
354
354
*/
355
- def buffer [Opening , Closing ](openings : Observable [Opening ], closings : Opening => Observable [Closing ]): Observable [Seq [T ]] = {
355
+ def buffer [Opening ](openings : Observable [Opening ], closings : Opening => Observable [Any ]): Observable [Seq [T ]] = {
356
356
val opening : rx.Observable [_ <: Opening ] = openings.asJavaObservable
357
- val closing : Func1 [_ >: Opening , _ <: rx.Observable [_ <: Closing ]] = (o : Opening ) => closings(o).asJavaObservable
358
- val jObs : rx.Observable [_ <: java.util.List [_]] = asJavaObservable.buffer[Opening , Closing ](opening, closing)
357
+ val closing : Func1 [_ >: Opening , _ <: rx.Observable [_ <: Any ]] = (o : Opening ) => closings(o).asJavaObservable
358
+ val jObs : rx.Observable [_ <: java.util.List [_]] = asJavaObservable.buffer[Opening , Any ](opening, closing)
359
359
Observable .jObsOfListToScObsOfSeq(jObs.asInstanceOf [rx.Observable [_ <: java.util.List [T ]]])
360
360
}
361
361
@@ -539,9 +539,9 @@ trait Observable[+T]
539
539
* An [[rx.lang.scala.Observable ]] which produces connected non-overlapping windows, which are emitted
540
540
* when the current [[rx.lang.scala.Observable ]] created with the function argument produces an object.
541
541
*/
542
- def window [ Closing ] (closings : () => Observable [Closing ]): Observable [Observable [T ]] = {
543
- val func : Func0 [_ <: rx.Observable [_ <: Closing ]] = closings().asJavaObservable
544
- val o1 : rx.Observable [_ <: rx.Observable [_]] = asJavaObservable.window[Closing ](func)
542
+ def window (closings : () => Observable [Any ]): Observable [Observable [T ]] = {
543
+ val func : Func0 [_ <: rx.Observable [_ <: Any ]] = closings().asJavaObservable
544
+ val o1 : rx.Observable [_ <: rx.Observable [_]] = asJavaObservable.window[Any ](func)
545
545
val o2 = Observable .items(o1).map((x : rx.Observable [_]) => {
546
546
val x2 = x.asInstanceOf [rx.Observable [_ <: T ]]
547
547
toScalaObservable[T ](x2)
@@ -565,9 +565,9 @@ trait Observable[+T]
565
565
* @return
566
566
* An [[rx.lang.scala.Observable ]] which produces windows which are created and emitted when the specified [[rx.lang.scala.Observable ]]s publish certain objects.
567
567
*/
568
- def window [Opening , Closing ](openings : Observable [Opening ], closings : Opening => Observable [Closing ]) = {
568
+ def window [Opening ](openings : Observable [Opening ], closings : Opening => Observable [Any ]) = {
569
569
Observable .jObsOfJObsToScObsOfScObs(
570
- asJavaObservable.window[Opening , Closing ](openings.asJavaObservable, (op : Opening ) => closings(op).asJavaObservable))
570
+ asJavaObservable.window[Opening , Any ](openings.asJavaObservable, (op : Opening ) => closings(op).asJavaObservable))
571
571
: Observable [Observable [T ]] // SI-7818
572
572
}
573
573
@@ -1335,15 +1335,13 @@ trait Observable[+T]
1335
1335
* an observable that emits a single Closing when the group should be closed.
1336
1336
* @tparam K
1337
1337
* the type of the keys returned by the discriminator function.
1338
- * @tparam Closing
1339
- * the type of the element emitted from the closings observable.
1340
1338
* @return an Observable that emits `(key, observable)` pairs, where `observable`
1341
1339
* contains all items for which `f` returned `key` before `closings` emits a value.
1342
1340
*/
1343
- def groupByUntil [K , Closing ](f : T => K , closings : (K , Observable [T ])=> Observable [Closing ]): Observable [(K , Observable [T ])] = {
1344
- val fclosing : Func1 [_ >: rx.observables.GroupedObservable [K , _ <: T ], _ <: rx.Observable [_ <: Closing ]] =
1341
+ def groupByUntil [K ](f : T => K , closings : (K , Observable [T ])=> Observable [Any ]): Observable [(K , Observable [T ])] = {
1342
+ val fclosing : Func1 [_ >: rx.observables.GroupedObservable [K , _ <: T ], _ <: rx.Observable [_ <: Any ]] =
1345
1343
(jGrObs : rx.observables.GroupedObservable [K , _ <: T ]) => closings(jGrObs.getKey, toScalaObservable[T ](jGrObs)).asJavaObservable
1346
- val o1 = asJavaObservable.groupByUntil[K , Closing ](f, fclosing) : rx.Observable [_ <: rx.observables.GroupedObservable [K , _ <: T ]]
1344
+ val o1 = asJavaObservable.groupByUntil[K , Any ](f, fclosing) : rx.Observable [_ <: rx.observables.GroupedObservable [K , _ <: T ]]
1347
1345
val func = (o : rx.observables.GroupedObservable [K , _ <: T ]) => (o.getKey, toScalaObservable[T ](o))
1348
1346
toScalaObservable[(K , Observable [T ])](o1.map[(K , Observable [T ])](func))
1349
1347
}
@@ -1353,7 +1351,7 @@ trait Observable[+T]
1353
1351
* <p>
1354
1352
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/join_.png">
1355
1353
*
1356
- * @param inner
1354
+ * @param other
1357
1355
* the second Observable to join items from
1358
1356
* @param leftDurationSelector
1359
1357
* a function to select a duration for each item emitted by the source Observable,
@@ -1370,24 +1368,26 @@ trait Observable[+T]
1370
1368
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#join">RxJava Wiki: join()</a>
1371
1369
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229750.aspx">MSDN: Observable.Join</a>
1372
1370
*/
1373
- def join [S , LeftClosing , RightClosing , R ] (
1374
- inner : Observable [S ],
1375
- leftDurationSelector : T => Observable [LeftClosing ],
1376
- rightDurationSelector : S => Observable [RightClosing ],
1377
- resultSelector : (T ,S ) => R
1378
- ): Observable [R ] = {
1371
+ def join [S , R ] (
1372
+ other : Observable [S ],
1373
+ leftDurationSelector : T => Observable [Any ],
1374
+ rightDurationSelector : S => Observable [Any ],
1375
+ resultSelector : (T ,S ) => R
1376
+ ): Observable [R ] = {
1379
1377
1380
1378
val outer : rx.Observable [_ <: T ] = this .asJavaObservable
1381
- val left : Func1 [_ >: T , _< : rx.Observable [_ <: LeftClosing ]] = (t : T ) => leftDurationSelector(t).asJavaObservable
1382
- val right : Func1 [_ >: S , _< : rx.Observable [_ <: RightClosing ]] = (s : S ) => rightDurationSelector(s).asJavaObservable
1383
-
1384
- val o1 = outer.asInstanceOf [rx.Observable [T ]].join[S , LeftClosing , RightClosing , R ](
1385
- inner.asJavaObservable.asInstanceOf [rx.Observable [S ]],
1386
- left. asInstanceOf [Func1 [T , rx.Observable [LeftClosing ]]],
1387
- right.asInstanceOf [Func1 [S , rx.Observable [RightClosing ]]],
1388
- resultSelector.asInstanceOf [Func2 [T ,S ,R ]])
1389
-
1390
- toScalaObservable[R ](o1)
1379
+ val inner : rx.Observable [_ <: S ] = other.asJavaObservable
1380
+ val left : Func1 [_ >: T , _< : rx.Observable [_ <: Any ]] = (t : T ) => leftDurationSelector(t).asJavaObservable
1381
+ val right : Func1 [_ >: S , _< : rx.Observable [_ <: Any ]] = (s : S ) => rightDurationSelector(s).asJavaObservable
1382
+ val f : Func2 [_> : T , _ >: S , _ <: R ] = resultSelector
1383
+
1384
+ toScalaObservable[R ](
1385
+ outer.asInstanceOf [rx.Observable [T ]].join[S , Any , Any , R ](
1386
+ inner.asInstanceOf [rx.Observable [S ]],
1387
+ left. asInstanceOf [Func1 [T , rx.Observable [Any ]]],
1388
+ right.asInstanceOf [Func1 [S , rx.Observable [Any ]]],
1389
+ f.asInstanceOf [Func2 [T ,S ,R ]])
1390
+ )
1391
1391
}
1392
1392
1393
1393
/**
@@ -2177,18 +2177,15 @@ object Observable {
2177
2177
* <p>
2178
2178
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/empty.s.png">
2179
2179
*
2180
- * @param scheduler the scheduler to call the
2181
- [[rx.lang.scala.Observer#onCompleted onCompleted ]] method
2182
- * @param T the type of the items (ostensibly) emitted by the Observable
2183
2180
* @return an Observable that returns no data to the [[rx.lang.scala.Observer ]] and
2184
2181
* immediately invokes the [[rx.lang.scala.Observer ]]r's
2185
2182
* [[rx.lang.scala.Observer#onCompleted onCompleted ]] method with the
2186
2183
* specified scheduler
2187
2184
* @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#empty-error-and-never">RxJava Wiki: empty()</a>
2188
2185
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229066.aspx">MSDN: Observable.Empty Method (IScheduler)</a>
2189
2186
*/
2190
- def empty [ T ] : Observable [T ] = {
2191
- toScalaObservable(rx.Observable .empty[T ]())
2187
+ def empty : Observable [Nothing ] = {
2188
+ toScalaObservable(rx.Observable .empty[Nothing ]())
2192
2189
}
2193
2190
2194
2191
/**
@@ -2200,16 +2197,15 @@ object Observable {
2200
2197
*
2201
2198
* @param scheduler the scheduler to call the
2202
2199
[[rx.lang.scala.Observer#onCompleted onCompleted ]] method
2203
- * @param T the type of the items (ostensibly) emitted by the Observable
2204
2200
* @return an Observable that returns no data to the [[rx.lang.scala.Observer ]] and
2205
2201
* immediately invokes the [[rx.lang.scala.Observer ]]r's
2206
2202
* [[rx.lang.scala.Observer#onCompleted onCompleted ]] method with the
2207
2203
* specified scheduler
2208
2204
* @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#empty-error-and-never">RxJava Wiki: empty()</a>
2209
2205
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229066.aspx">MSDN: Observable.Empty Method (IScheduler)</a>
2210
2206
*/
2211
- def empty [ T ] (scheduler : Scheduler ): Observable [T ] = {
2212
- toScalaObservable(rx.Observable .empty[T ](scalaSchedulerToJavaScheduler(scheduler)))
2207
+ def empty (scheduler : Scheduler ): Observable [Nothing ] = {
2208
+ toScalaObservable(rx.Observable .empty[Nothing ](scalaSchedulerToJavaScheduler(scheduler)))
2213
2209
}
2214
2210
2215
2211
/**
0 commit comments