This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git


The following commit(s) were added to refs/heads/master by this push:
     new 23730a0  Use isEmpty().
23730a0 is described below

commit 23730a0fb858372095913db1ab998964e32d5240
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sat Jan 16 21:48:58 2021 -0500

    Use isEmpty().
---
 .../java/org/apache/commons/collections4/map/AbstractReferenceMap.java  | 2 +-
 src/main/java/org/apache/commons/collections4/map/CompositeMap.java     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java 
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
index 84fd2d9..4fd2445 100644
--- 
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
+++ 
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
@@ -795,7 +795,7 @@ public abstract class AbstractReferenceMap<K, V> extends 
AbstractHashedMap<K, V>
 
         ReferenceBaseIterator(final AbstractReferenceMap<K, V> parent) {
             this.parent = parent;
-            index = parent.size() != 0 ? parent.data.length : 0;
+            index = !parent.isEmpty() ? parent.data.length : 0;
             // have to do this here!  size() invocation above
             // may have altered the modCount.
             expectedModCount = parent.modCount;
diff --git 
a/src/main/java/org/apache/commons/collections4/map/CompositeMap.java 
b/src/main/java/org/apache/commons/collections4/map/CompositeMap.java
index 3aad891..c9bffcf 100644
--- a/src/main/java/org/apache/commons/collections4/map/CompositeMap.java
+++ b/src/main/java/org/apache/commons/collections4/map/CompositeMap.java
@@ -139,7 +139,7 @@ public class CompositeMap<K, V> extends 
AbstractIterableMap<K, V> implements Ser
         if (map != null) {
             for (int i = composite.length - 1; i >= 0; --i) {
                 final Collection<K> intersect = 
CollectionUtils.intersection(this.composite[i].keySet(), map.keySet());
-                if (intersect.size() != 0) {
+                if (!intersect.isEmpty()) {
                     if (this.mutator == null) {
                         throw new IllegalArgumentException("Key collision 
adding Map to CompositeMap");
                     }

Reply via email to