Skip to content

Commit

Permalink
Introducing default impl for Context::forEach (#3101)
Browse files Browse the repository at this point in the history
This commit polishes #3092 to add the default implementation
of `forEach`, which was missing yet overlooked by japicmp.

Relates to: #3094.
  • Loading branch information
chemicL committed Jul 1, 2022
1 parent 74444d4 commit 3cfd0a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion reactor-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ task japicmp(type: JapicmpTask) {
// TODO after a .0 release, bump the gradle.properties baseline
// TODO after a .0 release, remove the reactor-core exclusions below if any
classExcludes = [ ]
methodExcludes = [ ]
methodExcludes = [
'reactor.util.context.ContextView#forEach(java.util.function.BiConsumer)'
]
}

gradle.taskGraph.afterTask { task, state ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,7 @@ default boolean isEmpty() {
* @param action The action to be performed for each entry
* @throws NullPointerException if the specified action is null
*/
void forEach(BiConsumer<Object, Object> action);
default void forEach(BiConsumer<Object, Object> action) {
stream().forEach(entry -> action.accept(entry.getKey(), entry.getValue()));
}
}

0 comments on commit 3cfd0a7

Please sign in to comment.