Fixed
Pinned fields
Click on the next to a field label to start pinning.
Details
Assignee
Alban AuzeillAlban AuzeillReporter
Michael GumowskiMichael GumowskiLabels
Components
Fix versions
Due date
Jan 21, 2021Priority
Normal
Details
Details
Assignee
Alban Auzeill
Alban AuzeillReporter
Michael Gumowski
Michael GumowskiLabels
Components
Fix versions
Due date
Jan 21, 2021
Priority

Sentry
Sentry
Sentry
Created January 14, 2021 at 9:50 AM
Updated October 16, 2024 at 2:07 PM
Resolved January 25, 2021 at 10:50 AM
The SE engine is reporting FPs when using Apache commons collection's MapUtils methods which prevent null to be considered.
We should add new hardcoded method behaviors for the following methods:
org.apache.commons.collections4.MapUtils.isEmpty(Map<?, ?>) org.apache.commons.collections4.MapUtils.isNotEmpty(Map<?, ?>) org.apache.commons.collections4.ListUtils.defaultIfNull(List<T>, List<T>) org.apache.commons.collections4.IterableUtils.isEmpty(Iterable<?>) org.apache.commons.collections4.IteratorUtils.isEmpty(Iterator<?>)
public class A { void foo(@javax.annotation.Nullable java.util.Map<String, String> map, String o) { if (org.apache.commons.collections4.MapUtils.isNotEmpty(map)) { map.clear(); // FP S2259 - NPE is not possible } if (!org.apache.commons.collections4.MapUtils.isEmpty(map)) { map.clear(); // FP S2259 - NPE is not possible } } }