-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.x: WIP removes anonymous inner classes. #5174
2.x: WIP removes anonymous inner classes. #5174
Conversation
Codecov Report
@@ Coverage Diff @@
## 2.x #5174 +/- ##
===========================================
- Coverage 96% 95.96% -0.04%
+ Complexity 5663 5654 -9
===========================================
Files 621 621
Lines 39974 40247 +273
Branches 5610 5610
===========================================
+ Hits 38378 38625 +247
- Misses 630 649 +19
- Partials 966 973 +7
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far, minus a couple of private
modifiers that need to be removed.
throw ExceptionHelper.wrapOrThrow(NotificationLite.getError(buf)); | ||
} | ||
return NotificationLite.getValue(buf); | ||
private class Iterator implements java.util.Iterator<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and no private
} | ||
|
||
@Override | ||
public boolean accept(Subscriber<? super U> a, U v) { | ||
a.onNext(v); | ||
return true; | ||
} | ||
|
||
private final class RemoveFromBuffer implements Runnable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No private
@@ -557,4 +552,11 @@ public void requestOne() { | |||
|
|||
} | |||
} | |||
|
|||
private final class SingletonArrayFunc implements Function<T, R> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No private
@@ -125,5 +102,45 @@ public void cancel() { | |||
w.dispose(); | |||
} | |||
|
|||
private final class OnNext implements Runnable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No private
} | ||
} | ||
|
||
private class OnError implements Runnable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No private but final
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too.
@@ -289,5 +279,35 @@ public void request(long n) { | |||
public void cancel() { | |||
dispose(); | |||
} | |||
|
|||
private final class TimeoutTask implements Runnable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No private
} | ||
} | ||
|
||
private final class Cancellation implements Runnable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No private
@@ -839,6 +829,19 @@ public void run() { | |||
this.open = open; | |||
} | |||
} | |||
|
|||
private final class Completion implements Runnable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no private
@@ -138,4 +116,34 @@ public void otherError(Throwable e) { | |||
actual.onError(e); | |||
} | |||
} | |||
|
|||
private final class FlowableWithLatestSubscriber<U> implements FlowableSubscriber<U> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no private
@@ -298,4 +293,11 @@ public void dispose() { | |||
SubscriptionHelper.cancel(this); | |||
} | |||
} | |||
|
|||
private final class SingletonArrayFunc implements Function<T, R> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of places still require attention.
other.subscribe(otherSubscriber); | ||
} | ||
|
||
private final class DelaySubscriber implements FlowableSubscriber<U> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still private
main.subscribe(new OnCompleteSubscriber()); | ||
} | ||
|
||
private class DelaySubscription implements Subscription { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no private but final
co.connect(new DisposableConsumer(srw)); | ||
} | ||
|
||
private final class DisposableConsumer implements Consumer<Disposable> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too.
@akarnokd on it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still two missing. Look at the main page where there should be a bunch of collapsed comment along with the remaining problems in FlowableDelay
.
} | ||
} | ||
|
||
private class OnError implements Runnable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too.
} | ||
} | ||
|
||
private class OnComplete implements Runnable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too.
Great job! I'll merge this so the changes don't get too numerous. |
This is a WIP. Since the changes are big, an incremental review and PR was recommended by @akarnokd