Skip to content

Commit ec6000e

Browse files
committed
use stringListTypeRef
1 parent d12ef3f commit ec6000e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/flagsmith/flagengine/segments/SegmentEvaluator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ public class SegmentEvaluator {
2727
private static Configuration jsonPathConfiguration = Configuration
2828
.defaultConfiguration()
2929
.setOptions(Option.SUPPRESS_EXCEPTIONS);
30+
private static TypeReference<List<String>> stringListTypeRef = new TypeReference<List<String>>() {
31+
};
3032

3133
/**
3234
* Check if context is in segment.
@@ -94,8 +96,7 @@ private static Boolean contextMatchesCondition(
9496
try {
9597
// Try parsing a JSON list first
9698
conditionList = mapper.readValue(
97-
stringConditionValue, new TypeReference<List<String>>() {
98-
});
99+
stringConditionValue, stringListTypeRef);
99100
} catch (IOException e) {
100101
// As a fallback, split by comma
101102
conditionList = Arrays.asList(stringConditionValue.split(","));

0 commit comments

Comments
 (0)