Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public EvaluationValue evaluate(
Expression expression, Token functionToken, EvaluationValue... parameterValues) {
String string = parameterValues[0].getStringValue();
String substring = parameterValues[1].getStringValue();
return expression.convertValue(string.toUpperCase().contains(substring.toUpperCase()));
boolean result =
string != null
&& substring != null
&& string.toUpperCase().contains(substring.toUpperCase());
return expression.convertValue(result);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ void testLower(String expression, String expectedResult)
@CsvSource(
delimiter = ':',
value = {
"STR_CONTAINS(null, \"a\") : false",
"STR_CONTAINS(\"abc\", null) : false",
"STR_CONTAINS(\"\", \"\") : true",
"STR_CONTAINS(\"a\", \"a\") : true",
"STR_CONTAINS(\"Hello World\", \"Wor\") : true",
Expand Down