-
Notifications
You must be signed in to change notification settings - Fork 39
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
Introduce {Mono,Flux}OfType
Refaster rules
#810
Conversation
{Mono,Flux}OfType
Refaster rules
Looks good. No mutations were possible for these changes. |
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.
Nice! Will finalize review later.
Refaster.<S>clazz()::isInstance, | ||
x -> Refaster.<S>clazz().isAssignableFrom(x.getClass()))) |
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.
We can introduce a separate rule to prefer the first over the second. (I have this change locally already, but need to leave the train now 😅.)
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.
I filed #811 for this.
37f7f17
to
a781fb2
Compare
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.
Refaster.<S>clazz()::isInstance, | ||
x -> Refaster.<S>clazz().isAssignableFrom(x.getClass()))) |
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.
I filed #811 for this.
Mono<S> before(Mono<T> mono) { | ||
return mono.filter( | ||
Refaster.anyOf( | ||
Refaster.<S>clazz()::isInstance, |
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.
Instead of Refaster.<S>clazz()
we can use a Class<S> clazz
parameter, in which case non-literal class references are also captured.
Looks good. No mutations were possible for these changes. |
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.
The latest changes LGTM, thanks @Stephan202 💪
|
||
@AfterTemplate | ||
Mono<S> after(Mono<T> mono, Class<S> clazz) { | ||
return mono.ofType(clazz); |
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.
nice, didn't know this existed, will rewrite some uses in our code 😄 🚀
a781fb2
to
f9f7d25
Compare
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.
Rebased onto master
! Looks good 🚀
Looks good. No mutations were possible for these changes. |
f9f7d25
to
788d555
Compare
Looks good. No mutations were possible for these changes. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Since semantically this should be equivalent.
Suggested commit message: