Skip to content

Commit 63cc9b4

Browse files
authored
Fix ContextUsage snippet (#544)
1 parent 88899e2 commit 63cc9b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc-snippets/api/src/main/java/otel/ContextUsage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static void contextUsage() throws Exception {
3636
try (Scope scope = context.makeCurrent()) {
3737
// The current context now contains the added value
3838
// output => context value: value
39-
System.out.println("context value: " + context.get(exampleContextKey));
39+
System.out.println("context value: " + Context.current().get(exampleContextKey));
4040
}
4141

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

0 commit comments

Comments
 (0)