infer
infer copied to clipboard
How to fix org.apache.commons.collections.CollectionUtils Check error
version: Infer version v0.17.0 cmd: infer -o ./output --keep-going -- mvn ...
.../test.java:35: error: NULL_DEREFERENCE object
testArray last assigned on line 33 could be null and is dereferenced at line 35. 33. if (CollectionUtils.isNotEmpty(testArray)) { 34. List<Integer> list = new ArrayList<>(); 35. > for (Test test: testArray) { 36. list.add(test.getName()); 37. }
here, user org.apache.commons.collections.CollectionUtils
to check [testArray] is not empty,But Infer still report a error ‘NULL_DEREFERENCE’