@@ -243,7 +243,7 @@ public void request(long n)
243
243
@ Override
244
244
public void cancel ()
245
245
{
246
- cancel (new Cancelled ( ));
246
+ cancel (new Suppressed ( "Subscription was cancelled manually" ));
247
247
}
248
248
249
249
public void cancel (Throwable cause )
@@ -270,7 +270,8 @@ public void cancel(Throwable cause)
270
270
// Publisher succeeded -> cancel(COMPLETED)
271
271
// 1.5 If a Publisher terminates successfully (finite stream) it MUST signal an onComplete.
272
272
273
- // Subscriber
273
+ // Subscriber notes
274
+ //
274
275
// 2.13 In the case that this rule is violated, any associated Subscription to the Subscriber
275
276
// MUST be considered as cancelled, and the caller MUST raise this error condition in a
276
277
// fashion that is adequate for the runtime environment.
@@ -279,7 +280,7 @@ public void cancel(Throwable cause)
279
280
280
281
// Subscription notes
281
282
//
282
- // Subscription.cancel -> cancel(new Cancelled( ))
283
+ // Subscription.cancel -> cancel(new Suppressed("Subscription was cancelled manually" ))
283
284
// It's not clearly specified in the specification, but according to:
284
285
// - the issue: https://github.com/reactive-streams/reactive-streams-jvm/issues/458
285
286
// - TCK test 'untested_spec108_possiblyCanceledSubscriptionShouldNotReceiveOnErrorOrOnCompleteSignals'
@@ -302,12 +303,4 @@ private static class Suppressed extends Throwable
302
303
super (cause .getMessage (), cause );
303
304
}
304
305
}
305
-
306
- private static class Cancelled extends Suppressed
307
- {
308
- Cancelled ()
309
- {
310
- super ("Subscription was cancelled" );
311
- }
312
- }
313
306
}
0 commit comments