-
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 FluxFromIterable
Refaster rule
#1047
Conversation
Looks good. No mutations were possible for these changes. |
1 similar comment
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 addition @dirkvbok 🚀!!! Added a commit with some minor suggestions :).
/** | ||
* Don't unnecessarily convert {@link Collection} to {@link Stream} before creating {@link Flux}. | ||
*/ | ||
static final class FluxFromIterable<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.
I think a bit more up in the file makes sense, now they are below the StepVerifier
rules. There is no strict pre-determined order yet, so right now I put it under the the "last" iterable
related rule in the file.
@@ -1899,4 +1900,19 @@ Duration after(StepVerifier.LastStep step, Duration duration) { | |||
return step.verifyTimeout(duration); | |||
} | |||
} | |||
|
|||
/** | |||
* Don't unnecessarily convert {@link Collection} to {@link Stream} before creating {@link Flux}. |
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.
* Don't unnecessarily convert {@link Collection} to {@link Stream} before creating {@link Flux}. | |
* Don't unnecessarily convert a {@link Collection} to a {@link Stream} before creating a {@link Flux}. |
*/ | ||
static final class FluxFromIterable<T> { | ||
@BeforeTemplate | ||
Flux<T> before(Collection<T> c) { |
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.
Flux<T> before(Collection<T> c) { | |
Flux<T> before(Collection<T> collection) { |
In most cases, we use the full name collection
:).
32b47d8
to
5dcd73b
Compare
Looks good. No mutations were possible for these changes. |
5dcd73b
to
da6eee2
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.
/** | ||
* Don't unnecessarily convert a {@link Collection} to a {@link Stream} before creating a {@link | ||
* Flux}. | ||
*/ |
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'll propose a slightly more generic message, that would also fit any additional @BeforeTemplate
cases.
Suggested commit message:
|
Looks good. No mutations were possible for these changes. |
da6eee2
to
d93c1b1
Compare
Looks good. No mutations were possible for these changes. |
Quality Gate passedIssues Measures |
Based on an internal discussion, we found this case for a Refaster rule;
we can omit
.stream()
on aCollection
and directly useFlux.fromIterable
.I wasn't sure about the order of rules and tests, so I placed them at the end, LMK if they need to move. :)