Skip to content

Commit

Permalink
fixup: sonar
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Baert <[email protected]>
  • Loading branch information
toddbaert committed Oct 10, 2024
1 parent ef4dd35 commit 7a98827
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/main/java/dev/openfeature/sdk/HookSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ private EvaluationContext callBeforeHooks(FlagValueType flagValueType, HookConte
EvaluationContext context = hookCtx.getCtx();
for (Hook hook : reversedHooks) {
if (hook.supportsFlagValueType(flagValueType)) {
Optional<EvaluationContext> optional = hook.before(hookCtx, hints);
if (optional != null && optional.isPresent()) {
Optional<EvaluationContext> optional = Optional.ofNullable(hook.before(hookCtx, hints))
.orElse(Optional.empty());
if (optional.isPresent()) {
context = context.merge(optional.get());
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/test/java/dev/openfeature/sdk/testutils/TestFlagsUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
@UtilityClass
public class TestFlagsUtils {

public static String BOOLEAN_FLAG_KEY = "boolean-flag";
public static String STRING_FLAG_KEY = "string-flag";
public static String INT_FLAG_KEY = "integer-flag";
public static String FLOAT_FLAG_KEY = "float-flag";
public static String OBJECT_FLAG_KEY = "object-flag";
public static String CONTEXT_AWARE_FLAG_KEY = "context-aware";
public static String WRONG_FLAG_KEY = "wrong-flag";
public static final String BOOLEAN_FLAG_KEY = "boolean-flag";
public static final String STRING_FLAG_KEY = "string-flag";
public static final String INT_FLAG_KEY = "integer-flag";
public static final String FLOAT_FLAG_KEY = "float-flag";
public static final String OBJECT_FLAG_KEY = "object-flag";
public static final String CONTEXT_AWARE_FLAG_KEY = "context-aware";
public static final String WRONG_FLAG_KEY = "wrong-flag";

/**
* Building flags for testing purposes.
Expand Down

0 comments on commit 7a98827

Please sign in to comment.