Skip to content

Commit 2e46c82

Browse files
committed
Eliminate compiler warnings
1 parent f85219a commit 2e46c82

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

language-adaptors/rxjava-scala/src/examples/scala/rx/lang/scala/examples/RxScalaDemo.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,11 +555,10 @@ class RxScalaDemo extends JUnitSuite {
555555
* all elements are calculated.
556556
*/
557557
@Test def createExampleBad() {
558-
val o = Observable.create[String](observer => {
558+
val o = Observable[String](observer => {
559559
observer.onNext(calculateElement(0))
560560
observer.onNext(calculateElement(1))
561561
observer.onCompleted()
562-
Subscription {}
563562
})
564563
o.take(1).subscribe(println(_))
565564
}

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import rx.Observable.OnSubscribeFunc
2121
import rx.lang.scala.observables.ConnectableObservable
2222
import scala.concurrent.duration
2323
import java.util
24+
import java.util.concurrent.TimeUnit
2425
import collection.JavaConversions._
2526

2627

@@ -2968,9 +2969,8 @@ trait Observable[+T]
29682969
* @return an Observable that emits time interval information items
29692970
*/
29702971
def timeInterval: Observable[(Duration, T)] = {
2971-
import scala.concurrent.duration.DurationLong
29722972
toScalaObservable(asJavaObservable.timeInterval())
2973-
.map(inv => (inv.getIntervalInMilliseconds millis, inv.getValue))
2973+
.map(inv => (Duration(inv.getIntervalInMilliseconds, TimeUnit.MILLISECONDS), inv.getValue))
29742974
}
29752975

29762976
/**
@@ -2983,9 +2983,8 @@ trait Observable[+T]
29832983
* @return an Observable that emits time interval information items
29842984
*/
29852985
def timeInterval(scheduler: Scheduler): Observable[(Duration, T)] = {
2986-
import scala.concurrent.duration.DurationLong
29872986
toScalaObservable(asJavaObservable.timeInterval(scheduler.asJavaScheduler))
2988-
.map(inv => (inv.getIntervalInMilliseconds millis, inv.getValue))
2987+
.map(inv => (Duration(inv.getIntervalInMilliseconds, TimeUnit.MILLISECONDS), inv.getValue))
29892988
}
29902989

29912990
/**

0 commit comments

Comments
 (0)