Skip to content

Commit

Permalink
indexof evaluation for nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
antvaset committed Jun 17, 2024
1 parent a2a380b commit ee95bfb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ public static Object[][] dataMethod() {
"cql/CqlListOperatorsTest/Equivalent/Equivalent123AndString123",
"cql/CqlListOperatorsTest/Equivalent/EquivalentABCAnd123",
"cql/CqlListOperatorsTest/Flatten/FlattenListNullAndNull",
"cql/CqlListOperatorsTest/IndexOf/IndexOfEmptyNull",
"cql/CqlListOperatorsTest/IndexOf/IndexOfNullIn1Null",
"cql/CqlListOperatorsTest/NotEqual/NotEqual123AndABC",
"cql/CqlListOperatorsTest/NotEqual/NotEqual123AndString123",
"cql/CqlListOperatorsTest/NotEqual/NotEqualABCAnd123",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
The operator uses the notion of equivalence to determine the index. The search is linear,
and returns the index of the first element that is equivalent to the element being searched for.
If the list is empty, or no element is found, the result is -1.
If the list argument is null, the result is null.
If either argument is null, the result is null.
*/

public class IndexOfEvaluator {

public static Object indexOf(Object source, Object elementToFind, State state) {
if (source == null) {
if (source == null || elementToFind == null) {
return null;
}

Expand Down

0 comments on commit ee95bfb

Please sign in to comment.