Skip to content

Commit

Permalink
Merge pull request open-feature#63 from open-feature/fix/consistent-c…
Browse files Browse the repository at this point in the history
…tx-setter

!feat: Make evaluation accessors setters consistent
  • Loading branch information
justinabrahms authored Sep 8, 2022
2 parents b626789 + 4fa0a08 commit 35c9c7e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/dev/openfeature/javasdk/OpenFeatureAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class OpenFeatureAPI {
private FeatureProvider provider;
@Getter
@Setter
private EvaluationContext ctx;
private EvaluationContext evaluationContext;
@Getter
private List<Hook> apiHooks;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private <T> FlagEvaluationDetails<T> evaluateFlag(FlagValueType type, String key
// merge of: API.context, client.context, invocation.context
EvaluationContext mergedCtx = EvaluationContext.merge(
EvaluationContext.merge(
openfeatureApi.getCtx(),
openfeatureApi.getEvaluationContext(),
this.getEvaluationContext()
),
invocationCtx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private Client _client() {

@AfterEach void reset_ctx() {
OpenFeatureAPI api = OpenFeatureAPI.getInstance();
api.setCtx(null);
api.setEvaluationContext(null);
}

@Specification(number="1.1.1", text="The API, and any state it maintains SHOULD exist as a global singleton, even in cases wherein multiple versions of the API are present at runtime.")
Expand Down Expand Up @@ -235,7 +235,7 @@ private Client _client() {
apiCtx.add("common", "1");
apiCtx.add("common2", "1");
apiCtx.add("api", "2");
api.setCtx(apiCtx);
api.setEvaluationContext(apiCtx);

Client c = api.getClient();
EvaluationContext clientCtx = new EvaluationContext();
Expand Down

0 comments on commit 35c9c7e

Please sign in to comment.