Skip to content
This repository was archived by the owner on Mar 2, 2022. It is now read-only.

Commit 4589c5a

Browse files
committed
Clean up warnings on Mono
1 parent 32c0d55 commit 4589c5a

File tree

1 file changed

+21
-21
lines changed
  • src/main/scala/reactor/core/scala/publisher

1 file changed

+21
-21
lines changed

src/main/scala/reactor/core/scala/publisher/Mono.scala

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import scala.util.{Failure, Success, Try}
4848
* <p>The rx operators will offer aliases for input [[Mono]] type to preserve the "at most one"
4949
* property of the resulting [[Mono]]. For instance [[Mono.flatMap flatMap]] returns a [[Flux]] with
5050
* possibly
51-
* more than 1 emission. Its alternative enforcing [[Mono]] input is [[Mono.then then]].
51+
* more than 1 emission. Its alternative enforcing [[Mono]] input is [[Mono.`then` then]].
5252
*
5353
* <p>`Mono[Unit]` should be used for [[Publisher]] that just completes without any value.
5454
*
@@ -1318,7 +1318,7 @@ class Mono[T] private(private val jMono: JMono[T]) extends Publisher[T] with Map
13181318
* @return a new [[Mono]] completing when both publishers have completed in
13191319
* sequence
13201320
*/
1321-
final def thenEmpty(other: Publisher[Unit]) = Mono[Unit]((jMono: JMono[T]).thenEmpty(other))
1321+
final def thenEmpty(other: Publisher[Unit]): Mono[Unit] = Mono[Unit]((jMono: JMono[T]).thenEmpty(other))
13221322

13231323
/**
13241324
* Ignore element from this mono and transform the completion signal into a
@@ -1548,7 +1548,7 @@ object Mono {
15481548
def delay(duration: Duration): Mono[Long] = Mono(JMono.delay(duration)).map(Long2long)
15491549

15501550
/**
1551-
* Create a Mono which delays an onNext signal by a given `duration and completes.
1551+
* Create a Mono which delays an onNext signal by a given `duration` and completes.
15521552
* If the demand cannot be produced in time, an onError will be signalled instead.
15531553
*
15541554
* <p>
@@ -1571,7 +1571,7 @@ object Mono {
15711571
* @tparam T the reified [[Subscriber]] type
15721572
* @return a completed [[Mono]]
15731573
*/
1574-
def empty[T] = Mono[T](JMono.empty())
1574+
def empty[T]: Mono[T] = Mono[T](JMono.empty())
15751575

15761576
/**
15771577
* Create a new [[Mono]] that ignores onNext (dropping them) and only react on Completion signal.
@@ -1584,7 +1584,7 @@ object Mono {
15841584
* @tparam T the reified [[Publisher]] type
15851585
* @return a new completable [[Mono]].
15861586
*/
1587-
def empty[T](source: Publisher[T]) = Mono[Unit](JMono.empty(source).map(new Function[Void, Unit] {override def apply(t: Void): Unit = ()}))
1587+
def empty[T](source: Publisher[T]): Mono[Unit] = Mono[Unit](JMono.empty(source).map(new Function[Void, Unit] {override def apply(t: Void): Unit = ()}))
15881588

15891589
/**
15901590
* Create a [[Mono]] that completes with the specified error immediately after onSubscribe.
@@ -1597,7 +1597,7 @@ object Mono {
15971597
* @tparam T the reified [[Subscriber]] type
15981598
* @return a failed [[Mono]]
15991599
*/
1600-
def error[T](error: Throwable) = Mono[T](JMono.error(error))
1600+
def error[T](error: Throwable): Mono[T] = Mono[T](JMono.error(error))
16011601

16021602
/**
16031603
* Pick the first result coming from any of the given monos and populate a new `Mono`.
@@ -1610,7 +1610,7 @@ object Mono {
16101610
* @tparam T The type of the function result.
16111611
* @return a [[Mono]].
16121612
*/
1613-
def first[T](monos: Mono[_ <: T]*) = Mono[T](JMono.first[T](monos.map(_.jMono): _*))
1613+
def first[T](monos: Mono[_ <: T]*): Mono[T] = Mono[T](JMono.first[T](monos.map(_.jMono): _*))
16141614

16151615
/**
16161616
* Pick the first result coming from any of the given monos and populate a new `Mono`.
@@ -1623,7 +1623,7 @@ object Mono {
16231623
* @tparam T The type of the function result.
16241624
* @return a [[Mono]].
16251625
*/
1626-
def first[T](monos: Iterable[_ <: Mono[_ <: T]]) = Mono[T](JMono.first[T](monos.map(_.asJava()).asJava))
1626+
def first[T](monos: Iterable[_ <: Mono[_ <: T]]): Mono[T] = Mono[T](JMono.first[T](monos.map(_.asJava()).asJava))
16271627

16281628
/**
16291629
* Expose the specified [[Publisher]] with the [[Mono]] API, and ensure it will emit 0 or 1 item.
@@ -1636,7 +1636,7 @@ object Mono {
16361636
* @tparam T the source type
16371637
* @return the next item emitted as a { @link Mono}
16381638
*/
1639-
def from[T](source: Publisher[_ <: T]) = Mono[T](JMono.from(source))
1639+
def from[T](source: Publisher[_ <: T]): Mono[T] = Mono[T](JMono.from(source))
16401640

16411641
/**
16421642
* Create a [[Mono]] producing the value for the [[Mono]] using the given supplier.
@@ -1649,7 +1649,7 @@ object Mono {
16491649
* @tparam T type of the expected value
16501650
* @return A [[Mono]].
16511651
*/
1652-
def fromCallable[T](supplier: Callable[T]) = Mono[T](JMono.fromCallable(supplier))
1652+
def fromCallable[T](supplier: Callable[T]): Mono[T] = Mono[T](JMono.fromCallable(supplier))
16531653

16541654
/**
16551655
* Unchecked cardinality conversion of [[Publisher]] as [[Mono]], supporting
@@ -1728,7 +1728,7 @@ object Mono {
17281728
* @tparam T the source type of the ignored data
17291729
* @return a new completable [[Mono]].
17301730
*/
1731-
def ignoreElements[T](source: Publisher[T]) = Mono[T](
1731+
def ignoreElements[T](source: Publisher[T]): Mono[T] = Mono[T](
17321732
JMono.ignoreElements(source)
17331733
)
17341734

@@ -1743,7 +1743,7 @@ object Mono {
17431743
* @tparam T the type of the produced item
17441744
* @return a [[Mono]].
17451745
*/
1746-
def just[T](data: T) = Mono[T](JMono.just(data))
1746+
def just[T](data: T): Mono[T] = Mono[T](JMono.just(data))
17471747

17481748
/**
17491749
* Create a new [[Mono]] that emits the specified item if [[Option.isDefined]] otherwise only emits
@@ -1757,7 +1757,7 @@ object Mono {
17571757
* @tparam T the type of the produced item
17581758
* @return a [[Mono]].
17591759
*/
1760-
def justOrEmpty[T](data: Option[_ <: T]) = Mono[T](
1760+
def justOrEmpty[T](data: Option[_ <: T]): Mono[T] = Mono[T](
17611761
JMono.justOrEmpty[T](data)
17621762
)
17631763

@@ -1773,7 +1773,7 @@ object Mono {
17731773
* @tparam T the type of the produced item
17741774
* @return a [[Mono]].
17751775
*/
1776-
def justOrEmpty[T](data: T) = Mono[T](
1776+
def justOrEmpty[T](data: T): Mono[T] = Mono[T](
17771777
JMono.justOrEmpty(data)
17781778
)
17791779

@@ -2080,7 +2080,7 @@ object Mono {
20802080
*/
20812081
def when(sources: Iterable[_ <: Publisher[Unit] with MapablePublisher[Unit]]): Mono[Unit] = {
20822082
new Mono[Unit](
2083-
JMono.when(sources.map(s => s.map((t: Unit) => None.orNull: Void)).asJava).map((t: Void) => ())
2083+
JMono.when(sources.map(s => s.map((t: Unit) => None.orNull: Void)).asJava).map((_: Void) => ())
20842084
)
20852085
}
20862086

@@ -2128,7 +2128,7 @@ object Mono {
21282128
*/
21292129
def when(sources: (Publisher[Unit] with MapablePublisher[Unit])*): Mono[Unit] = {
21302130
new Mono[Unit](
2131-
JMono.when(sources.map(s => s.map((T: Unit) => None.orNull: Void)).asJava).map((t: Void) => ())
2131+
JMono.when(sources.map(s => s.map((T: Unit) => None.orNull: Void)).asJava).map((_: Void) => ())
21322132
)
21332133
}
21342134

@@ -2285,7 +2285,7 @@ object Mono {
22852285
* @tparam T6 type of the value from source6
22862286
* @return a [[Mono]].
22872287
*/
2288-
def whenDelayError[T1, T2, T3, T4, T5, T6](p1: Mono[_ <: T1], p2: Mono[_ <: T2], p3: Mono[_ <: T3], p4: Mono[_ <: T4], p5: Mono[_ <: T5], p6: Mono[_ <: T6]) = Mono[(T1, T2, T3, T4, T5, T6)](
2288+
def whenDelayError[T1, T2, T3, T4, T5, T6](p1: Mono[_ <: T1], p2: Mono[_ <: T2], p3: Mono[_ <: T3], p4: Mono[_ <: T4], p5: Mono[_ <: T5], p6: Mono[_ <: T6]): Mono[(T1, T2, T3, T4, T5, T6)] = Mono[(T1, T2, T3, T4, T5, T6)](
22892289
JMono.whenDelayError[T1, T2, T3, T4, T5, T6](p1.jMono, p2.jMono, p3.jMono, p4.jMono, p5.jMono, p6.jMono).map(new Function[Tuple6[T1, T2, T3, T4, T5, T6], (T1, T2, T3, T4, T5, T6)] {
22902290
override def apply(t: Tuple6[T1, T2, T3, T4, T5, T6]): (T1, T2, T3, T4, T5, T6) = tupleSix2ScalaTuple6(t)
22912291
})
@@ -2305,8 +2305,8 @@ object Mono {
23052305
* @param sources The sources to use.
23062306
* @return a [[Mono]].
23072307
*/
2308-
def whenDelayError(sources: Iterable[_ <: Publisher[Unit] with MapablePublisher[Unit]]) = Mono[Unit](
2309-
JMono.whenDelayError(sources.map(s => s.map((t: Unit) => None.orNull: Void)).asJava).map((t: Void) => ())
2308+
def whenDelayError(sources: Iterable[_ <: Publisher[Unit] with MapablePublisher[Unit]]): Mono[Unit] = Mono[Unit](
2309+
JMono.whenDelayError(sources.map(s => s.map((t: Unit) => None.orNull: Void)).asJava).map((_: Void) => ())
23102310
)
23112311

23122312
/**
@@ -2325,7 +2325,7 @@ object Mono {
23252325
* @tparam R the combined result
23262326
* @return a [[Mono]].
23272327
*/
2328-
def whenDelayError[R](monos: Iterable[_ <: Mono[_]], combinator: (Array[Any] => _ <: R)) ={
2328+
def whenDelayError[R](monos: Iterable[_ <: Mono[_]], combinator: (Array[Any] => _ <: R)): Mono[R] ={
23292329
val combinatorFunction = new Function[Array[Object], R] {
23302330
override def apply(t: Array[Object]): R = {
23312331
val v = t.map { v => v: Any }
@@ -2350,7 +2350,7 @@ object Mono {
23502350
*/
23512351
def whenDelayError(sources: (Publisher[Unit] with MapablePublisher[Unit])*): Mono[Unit] = Mono[Unit](
23522352
JMono.whenDelayError(sources.map(s => s.map((t: Unit) => None.orNull: Void)).toArray: _*)
2353-
.map((t: Void) => ())
2353+
.map((_: Void) => ())
23542354
)
23552355

23562356
/**

0 commit comments

Comments
 (0)