Skip to content

Commit 0cff93d

Browse files
committed
Revert createExampleBad and import scala.concurrent.duration.MILLISECONDS
1 parent 2e46c82 commit 0cff93d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

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

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,7 +21,6 @@ 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
2524
import collection.JavaConversions._
2625

2726

@@ -80,7 +79,7 @@ trait Observable[+T]
8079
{
8180
import scala.collection.JavaConverters._
8281
import scala.collection.Seq
83-
import scala.concurrent.duration.{Duration, TimeUnit}
82+
import scala.concurrent.duration.{Duration, TimeUnit, MILLISECONDS}
8483
import rx.functions._
8584
import rx.lang.scala.observables.BlockingObservable
8685
import ImplicitFunctionConversions._
@@ -2970,7 +2969,7 @@ trait Observable[+T]
29702969
*/
29712970
def timeInterval: Observable[(Duration, T)] = {
29722971
toScalaObservable(asJavaObservable.timeInterval())
2973-
.map(inv => (Duration(inv.getIntervalInMilliseconds, TimeUnit.MILLISECONDS), inv.getValue))
2972+
.map(inv => (Duration(inv.getIntervalInMilliseconds, MILLISECONDS), inv.getValue))
29742973
}
29752974

29762975
/**
@@ -2984,7 +2983,7 @@ trait Observable[+T]
29842983
*/
29852984
def timeInterval(scheduler: Scheduler): Observable[(Duration, T)] = {
29862985
toScalaObservable(asJavaObservable.timeInterval(scheduler.asJavaScheduler))
2987-
.map(inv => (Duration(inv.getIntervalInMilliseconds, TimeUnit.MILLISECONDS), inv.getValue))
2986+
.map(inv => (Duration(inv.getIntervalInMilliseconds, MILLISECONDS), inv.getValue))
29882987
}
29892988

29902989
/**

0 commit comments

Comments
 (0)