Skip to content

Commit

Permalink
Fix Java Context API example
Browse files Browse the repository at this point in the history
Access the current context instead of the local one
  • Loading branch information
teofr authored Dec 10, 2024
1 parent 38f631e commit bef3852
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/en/docs/languages/java/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public class ContextUsage {
try (Scope scope = context.makeCurrent()) {
// The current context now contains the added value
// output => context value: value
System.out.println("context value: " + context.get(exampleContextKey));
System.out.println("context value: " + Context.current().get(exampleContextKey));
}

// The local context var still contains the added value
Expand Down

0 comments on commit bef3852

Please sign in to comment.