infer icon indicating copy to clipboard operation
infer copied to clipboard

How to fix org.apache.commons.collections.CollectionUtils Check error

Open felix1982 opened this issue 3 years ago • 0 comments

version: Infer version v0.17.0 cmd: infer -o ./output --keep-going -- mvn ...

.../test.java:35: error: NULL_DEREFERENCE objecttestArray 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’

felix1982 avatar Jun 15 '21 08:06 felix1982