Skip to content

Commit 69f6498

Browse files
committed
Fix NPEs due to missing flag eval options.
1 parent 1d82637 commit 69f6498

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/src/main/java/javasdk/OpenFeatureClient.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public FlagEvaluationDetails<Boolean> getBooleanDetails(String key, Boolean defa
138138

139139
@Override
140140
public FlagEvaluationDetails<Boolean> getBooleanDetails(String key, Boolean defaultValue, EvaluationContext ctx) {
141-
return getBooleanDetails(key, defaultValue, ctx, null);
141+
return getBooleanDetails(key, defaultValue, ctx, FlagEvaluationOptions.builder().build());
142142
}
143143

144144
@Override
@@ -148,17 +148,17 @@ public FlagEvaluationDetails<Boolean> getBooleanDetails(String key, Boolean defa
148148

149149
@Override
150150
public String getStringValue(String key, String defaultValue) {
151-
return this.getStringDetails(key, defaultValue).getValue();
151+
return getStringDetails(key, defaultValue).getValue();
152152
}
153153

154154
@Override
155155
public String getStringValue(String key, String defaultValue, EvaluationContext ctx) {
156-
return this.getStringDetails(key, defaultValue, ctx).getValue();
156+
return getStringDetails(key, defaultValue, ctx).getValue();
157157
}
158158

159159
@Override
160160
public String getStringValue(String key, String defaultValue, EvaluationContext ctx, FlagEvaluationOptions options) {
161-
return this.getStringDetails(key, defaultValue, ctx, options).getValue();
161+
return getStringDetails(key, defaultValue, ctx, options).getValue();
162162
}
163163

164164
@Override
@@ -168,7 +168,7 @@ public FlagEvaluationDetails<String> getStringDetails(String key, String default
168168

169169
@Override
170170
public FlagEvaluationDetails<String> getStringDetails(String key, String defaultValue, EvaluationContext ctx) {
171-
return getStringDetails(key, defaultValue, new EvaluationContext(), null);
171+
return getStringDetails(key, defaultValue, new EvaluationContext(), FlagEvaluationOptions.builder().build());
172172
}
173173

174174
@Override
@@ -178,17 +178,17 @@ public FlagEvaluationDetails<String> getStringDetails(String key, String default
178178

179179
@Override
180180
public Integer getIntegerValue(String key, Integer defaultValue) {
181-
return this.evaluateFlag(FlagValueType.INTEGER, key, defaultValue, null, null).getValue();
181+
return getIntegerDetails(key, defaultValue).getValue();
182182
}
183183

184184
@Override
185185
public Integer getIntegerValue(String key, Integer defaultValue, EvaluationContext ctx) {
186-
return this.evaluateFlag(FlagValueType.INTEGER, key, defaultValue, ctx, null).getValue();
186+
return getIntegerDetails(key, defaultValue, ctx).getValue();
187187
}
188188

189189
@Override
190190
public Integer getIntegerValue(String key, Integer defaultValue, EvaluationContext ctx, FlagEvaluationOptions options) {
191-
return this.evaluateFlag(FlagValueType.INTEGER, key, defaultValue, ctx, options).getValue();
191+
return getIntegerDetails(key, defaultValue, ctx, options).getValue();
192192
}
193193

194194
@Override
@@ -198,7 +198,7 @@ public FlagEvaluationDetails<Integer> getIntegerDetails(String key, Integer defa
198198

199199
@Override
200200
public FlagEvaluationDetails<Integer> getIntegerDetails(String key, Integer defaultValue, EvaluationContext ctx) {
201-
return getIntegerDetails(key, defaultValue, new EvaluationContext(), null);
201+
return getIntegerDetails(key, defaultValue, ctx, FlagEvaluationOptions.builder().build());
202202
}
203203

204204
@Override

0 commit comments

Comments
 (0)