Skip to content

Commit 33c7b97

Browse files
authored
[4.x]: Fix wrong example for Config.onChange (#8607) (#8608)
1 parent 30d29e9 commit 33c7b97

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/src/main/asciidoc/se/config/mutability-support.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ method on the node of interest.
145145
include::{sourcedir}/se/config/MutabilitySupportSnippets.java[tag=snippet_3, indent=0]
146146
----
147147
<1> Navigate to the `Config` node on which you want to register.
148-
<2> Invoke the `onChange` method, passing a function (`Function<Config, Boolean>`).
149-
The config system invokes that function each time the subtree rooted at the
148+
<2> Invoke the `onChange` method, passing a consumer (`Consumer<Config>`).
149+
The config system invokes that consumer each time the subtree rooted at the
150150
`greeting` node changes. The `changedNode` is a new instance of `Config`
151151
representing the updated subtree rooted at `greeting`.
152152

docs/src/main/java/io/helidon/docs/se/config/MutabilitySupportSnippets.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void snippet_2() {
5050
void snippet_3(Config config) {
5151
// tag::snippet_3[]
5252
config.get("greeting") // <1>
53-
.onChange((changedNode) -> { // <2>
53+
.onChange(changedNode -> { // <2>
5454
System.out.println("Node " + changedNode.key() + " has changed!");
5555
});
5656
// end::snippet_3[]

0 commit comments

Comments
 (0)