Skip to content

Commit

Permalink
Make Observation#getContext() return Context
Browse files Browse the repository at this point in the history
  • Loading branch information
ttddyy committed Sep 19, 2022
1 parent 5f46c63 commit 9b20ca5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class NoopObservation implements Observation {
*/
static final NoopObservation INSTANCE = new NoopObservation();

private static final ContextView CONTEXT = new Context();
private static final Context CONTEXT = new Context();

private NoopObservation() {
}
Expand Down Expand Up @@ -89,7 +89,7 @@ public Observation start() {
}

@Override
public ContextView getContext() {
public Context getContext() {
return CONTEXT;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,12 @@ default boolean isNoop() {
Observation start();

/**
* Returns the context attached to this observation.
* Returns the context attached to this observation. This returns a mutable
* {@link Context} for this observation. However, it is strongly discouraged to modify
* the {@link Context} in the <em>parent observation</em>.
* @return corresponding context
*/
ContextView getContext();
Context getContext();

/**
* Stop the observation. Remember to call this method, otherwise timing calculations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public Observation start() {
}

@Override
public ContextView getContext() {
public Context getContext() {
return this.context;
}

Expand Down

0 comments on commit 9b20ca5

Please sign in to comment.