@@ -54,43 +54,43 @@ public BrokenExampleWhiteboxTest() {
54
54
}
55
55
56
56
public class MySubscriber <T > implements Subscriber <T > {
57
- private volatile Subscription subscription ;
57
+ private volatile Subscription subscription ;
58
58
59
59
public boolean triggerDemand (final long n ) {
60
- final Subscription s = subscription ;
61
- if (s == null ) return false ;
62
- else {
63
- try {
64
- s .request (n );
65
- } catch (final Throwable t ) {
66
- // Subscription.request is not allowed to throw according to rule 3.16
67
- (new IllegalStateException (s + " violated the Reactive Streams rule 3.16 by throwing an exception from request." , t )).printStackTrace (System .err );
68
- return false ;
69
- }
70
- return true ;
60
+ final Subscription s = subscription ;
61
+ if (s == null ) return false ;
62
+ else {
63
+ try {
64
+ s .request (n );
65
+ } catch (final Throwable t ) {
66
+ // Subscription.request is not allowed to throw according to rule 3.16
67
+ (new IllegalStateException (s + " violated the Reactive Streams rule 3.16 by throwing an exception from request." , t )).printStackTrace (System .err );
68
+ return false ;
71
69
}
70
+ return true ;
72
71
}
72
+ }
73
73
74
- @ Override
75
- public void onSubscribe (Subscription subscription ) {
76
- this .subscription = subscription ;
77
- subscription .request (1 ); //a value of Long.MAX_VALUE may be considered as effectively unbounded
78
- }
74
+ @ Override
75
+ public void onSubscribe (Subscription subscription ) {
76
+ this .subscription = subscription ;
77
+ subscription .request (1 ); //a value of Long.MAX_VALUE may be considered as effectively unbounded
78
+ }
79
79
80
- @ Override
81
- public void onNext (T item ) {
82
- System .out .println ("Got : " + item );
83
- subscription .request (1 ); //a value of Long.MAX_VALUE may be considered as effectively unbounded
84
- }
80
+ @ Override
81
+ public void onNext (T item ) {
82
+ System .out .println ("Got : " + item );
83
+ subscription .request (1 ); //a value of Long.MAX_VALUE may be considered as effectively unbounded
84
+ }
85
85
86
- @ Override
87
- public void onError (Throwable t ) {
88
- t .printStackTrace ();
89
- }
86
+ @ Override
87
+ public void onError (Throwable t ) {
88
+ t .printStackTrace ();
89
+ }
90
90
91
- @ Override
92
- public void onComplete () {
93
- System .out .println ("Done" );
94
- }
91
+ @ Override
92
+ public void onComplete () {
93
+ System .out .println ("Done" );
95
94
}
95
+ }
96
96
}
0 commit comments