Skip to content

Commit bef3852

Browse files
authored
Fix Java Context API example
Access the current context instead of the local one
1 parent 38f631e commit bef3852

File tree

1 file changed

+1
-1
lines changed
  • content/en/docs/languages/java

1 file changed

+1
-1
lines changed

content/en/docs/languages/java/api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public class ContextUsage {
147147
try (Scope scope = context.makeCurrent()) {
148148
// The current context now contains the added value
149149
// output => context value: value
150-
System.out.println("context value: " + context.get(exampleContextKey));
150+
System.out.println("context value: " + Context.current().get(exampleContextKey));
151151
}
152152

153153
// The local context var still contains the added value

0 commit comments

Comments
 (0)