@@ -155,7 +155,8 @@ object FutureConverters {
155155 */
156156 def failedPromise [T ](ex : Throwable ): Promise [T ] = Promise .failed(ex)
157157
158- implicit class futureToCompletionStage [T ](val f : Future [T ]) extends AnyVal {
158+ implicit def FutureOps [T ](f : Future [T ]): FutureOps [T ] = new FutureOps [T ](f)
159+ final class FutureOps [T ](val __self : Future [T ]) extends AnyVal {
159160 /**
160161 * Returns a CompletionStage that will be completed with the same value or
161162 * exception as the given Scala Future when that completes. Since the Future is a read-only
@@ -166,25 +167,23 @@ object FutureConverters {
166167 * transformations to their asynchronous counterparts, i.e.
167168 * <code>thenRun</code> will internally call <code>thenRunAsync</code>.
168169 *
169- * @param f The Scala Future which may eventually supply the completion for
170- * the returned CompletionStage
171170 * @return a CompletionStage that runs all callbacks asynchronously and does
172171 * not support the CompletableFuture interface
173172 */
174- def toJava : CompletionStage [T ] = FutureConverters .toJava(f )
173+ def toJava : CompletionStage [T ] = FutureConverters .toJava(__self )
175174 }
176175
177- implicit class completionStageToFuture [T ](val cs : CompletionStage [T ]) extends AnyVal {
176+ implicit def CompletionStageOps [T ](cs : CompletionStage [T ]): CompletionStageOps [T ] = new CompletionStageOps (cs)
177+
178+ final class CompletionStageOps [T ](val __self : CompletionStage [T ]) extends AnyVal {
178179 /**
179180 * Returns a Scala Future that will be completed with the same value or
180181 * exception as the given CompletionStage when that completes. Transformations
181182 * of the returned Future are executed asynchronously as specified by the
182183 * ExecutionContext that is given to the combinator methods.
183184 *
184- * @param cs The CompletionStage which may eventually supply the completion
185- * for the returned Scala Future
186185 * @return a Scala Future that represents the CompletionStage's completion
187186 */
188- def toScala : Future [T ] = FutureConverters .toScala(cs )
187+ def toScala : Future [T ] = FutureConverters .toScala(__self )
189188 }
190189}
0 commit comments