Skip to content

Commit

Permalink
Merge pull request #876 from smallrye/bug/missing-replay-checkreturnv…
Browse files Browse the repository at this point in the history
…alue-annotation

Add the missing CheckReturnValue annotations to the Multi replay operator API
  • Loading branch information
cescoffier authored Mar 17, 2022
2 parents ff046d8 + 9e2e9b3 commit c881740
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
27 changes: 26 additions & 1 deletion implementation/revapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,32 @@
"criticality": "highlight",
"minSeverity": "POTENTIALLY_BREAKING",
"minCriticality": "documented",
"differences": []
"differences": [
{
"ignore": true,
"code": "java.annotation.added",
"old": "method <T> io.smallrye.mutiny.Multi<T> io.smallrye.mutiny.groups.MultiReplay::ofMulti(io.smallrye.mutiny.Multi<T>)",
"new": "method <T> io.smallrye.mutiny.Multi<T> io.smallrye.mutiny.groups.MultiReplay::ofMulti(io.smallrye.mutiny.Multi<T>)",
"annotation": "@io.smallrye.common.annotation.CheckReturnValue",
"justification": "Not breaking. The annotation was missing and has now be added."
},
{
"ignore": true,
"code": "java.annotation.added",
"old": "method <T> io.smallrye.mutiny.Multi<T> io.smallrye.mutiny.groups.MultiReplay::ofSeedAndMulti(java.lang.Iterable<T>, io.smallrye.mutiny.Multi<T>)",
"new": "method <T> io.smallrye.mutiny.Multi<T> io.smallrye.mutiny.groups.MultiReplay::ofSeedAndMulti(java.lang.Iterable<T>, io.smallrye.mutiny.Multi<T>)",
"annotation": "@io.smallrye.common.annotation.CheckReturnValue",
"justification": "Not breaking. The annotation was missing and has now be added."
},
{
"ignore": true,
"code": "java.annotation.added",
"old": "method io.smallrye.mutiny.groups.MultiReplay io.smallrye.mutiny.groups.MultiReplay::upTo(long)",
"new": "method io.smallrye.mutiny.groups.MultiReplay io.smallrye.mutiny.groups.MultiReplay::upTo(long)",
"annotation": "@io.smallrye.common.annotation.CheckReturnValue",
"justification": "Not breaking. The annotation was missing and has now be added."
}
]
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static io.smallrye.mutiny.helpers.ParameterValidation.nonNull;
import static io.smallrye.mutiny.helpers.ParameterValidation.positive;

import io.smallrye.common.annotation.CheckReturnValue;
import io.smallrye.common.annotation.Experimental;
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.operators.multi.replay.ReplayOperator;
Expand All @@ -23,6 +24,7 @@ public class MultiReplay {
* replaying all events
* @return this group
*/
@CheckReturnValue
public MultiReplay upTo(long numberOfItemsToReplay) {
this.numberOfItemsToReplay = positive(numberOfItemsToReplay, "numberOfItemsToReplay");
return this;
Expand Down Expand Up @@ -58,6 +60,7 @@ public MultiReplay upTo(long numberOfItemsToReplay) {
* @param <T> the items type
* @return a replaying {@link Multi}
*/
@CheckReturnValue
public <T> Multi<T> ofMulti(Multi<T> upstream) {
return new ReplayOperator<>(nonNull(upstream, "upstream"), numberOfItemsToReplay);
}
Expand All @@ -74,6 +77,7 @@ public <T> Multi<T> ofMulti(Multi<T> upstream) {
* @return a replaying {@link Multi}
* @see #ofMulti(Multi)
*/
@CheckReturnValue
public <T> Multi<T> ofSeedAndMulti(Iterable<T> seed, Multi<T> upstream) {
return new ReplayOperator<>(nonNull(upstream, "upstream"), numberOfItemsToReplay, nonNull(seed, "seed"));
}
Expand Down

0 comments on commit c881740

Please sign in to comment.