[ https://issues.apache.org/jira/browse/COLLECTIONS-814?focusedWorklogId=811871&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-811871 ]
ASF GitHub Bot logged work on COLLECTIONS-814: ---------------------------------------------- Author: ASF GitHub Bot Created on: 24/Sep/22 20:41 Start Date: 24/Sep/22 20:41 Worklog Time Spent: 10m Work Description: codecov-commenter commented on PR #340: URL: https://github.com/apache/commons-collections/pull/340#issuecomment-1257062009 # [Codecov](https://codecov.io/gh/apache/commons-collections/pull/340?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report > Merging [#340](https://codecov.io/gh/apache/commons-collections/pull/340?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a3490d3) into [master](https://codecov.io/gh/apache/commons-collections/commit/474713f727f49707a4ac77ed737d0205d22152ee?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (474713f) will **increase** coverage by `0.05%`. > The diff coverage is `100.00%`. ```diff @@ Coverage Diff @@ ## master #340 +/- ## ============================================ + Coverage 85.93% 85.98% +0.05% - Complexity 4669 4671 +2 ============================================ Files 289 289 Lines 13445 13447 +2 Branches 1977 1977 ============================================ + Hits 11554 11563 +9 + Misses 1327 1323 -4 + Partials 564 561 -3 ``` | [Impacted Files](https://codecov.io/gh/apache/commons-collections/pull/340?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | | |---|---|---| | [...ava/org/apache/commons/collections4/ListUtils.java](https://codecov.io/gh/apache/commons-collections/pull/340/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvY29sbGVjdGlvbnM0L0xpc3RVdGlscy5qYXZh) | `87.30% <100.00%> (+0.20%)` | :arrow_up: | | [...commons/collections4/map/AbstractReferenceMap.java](https://codecov.io/gh/apache/commons-collections/pull/340/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvY29sbGVjdGlvbnM0L21hcC9BYnN0cmFjdFJlZmVyZW5jZU1hcC5qYXZh) | `91.48% <0.00%> (+2.59%)` | :arrow_up: | :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Issue Time Tracking ------------------- Worklog Id: (was: 811871) Time Spent: 20m (was: 10m) > CollectionUtils.removeAll() not throwing proper NullPointerException(NPE) if > the first parameter is empty > --------------------------------------------------------------------------------------------------------- > > Key: COLLECTIONS-814 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-814 > Project: Commons Collections > Issue Type: Bug > Affects Versions: 4.4 > Reporter: Elia Bertolina > Priority: Major > Time Spent: 20m > Remaining Estimate: 0h > > The CollectionUtils.removeAll(Collection<E> collection, Collection<?> remove) > does not throw a NullPointerException(NPE) when the “remove” parameters is > null, but only if the “collection” parameter is empty. > In the documentation it is stated that an NPE will be thrown if any of the > parameters is null. > However, in this test case: > > {code:java} > public class CollectionUtils_failure_Test { > public void test() throws Throwable { > LinkedList<InstanceofPredicate> linkedList = new > LinkedList<InstanceofPredicate>(); > try { > Collection<InstanceofPredicate> collection = > CollectionUtils.removeAll( > (Collection<InstanceofPredicate>)linkedList, > (Collection<?>) null); > org.junit.Assert.fail(); > } catch (java.lang.NullPointerException e) { > //Exception caught and test successful > } > } > } {code} > > This is a special case (first parameter needs to be empty and the second > needs to be null) but this behavior is missing in the documentation. While > this behavior is somehow correct (removing a null Object from an empty > Collection we should obtain an empty Collection) I think throwing an NPE > would be more in line with the documentation provided. -- This message was sent by Atlassian Jira (v8.20.10#820010)