You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make toJava(scalaFuture).toCF.obtrude* unsupported
The status quo was to allow the wrapper and the wrapped to diverge;
the as shown by:
```
@test
public void testToJavaToCompletableFutureJavaObtrudeCalledAfterScalaComplete() throws Exception {
final Promise<String> p = promise();
Future<String> sf = p.future();
final CompletionStage<String> cs = toJava(sf);
CompletableFuture<String> cf = cs.toCompletableFuture();
assertEquals("notyet", cf.getNow("notyet"));
p.success("scaladone");
assertEquals("scaladone", cf.get());
cf.obtrudeValue("javadone");
assertEquals("javadone", cf.get());
// obtrude does not mutate the underlying Scala future
assertEquals("scaladone", Await.result(sf, Duration.Inf()));
}
```
This commit throws an UOE, preferring to fail fast.
overridedefobtrudeValue(value: T):Unit=thrownewUnsupportedOperationException("obtrudeValue may not be used on the result of toJava(scalaFuture)")
78
+
79
+
overridedefobtrudeException(ex: Throwable):Unit=thrownewUnsupportedOperationException("obtrudeException may not be used on the result of toJava(scalaFuture)")
0 commit comments