Use isEmpty().

This commit is contained in:
Gary Gregory 2021-01-16 21:48:58 -05:00
parent 2b23b7add8
commit 23730a0fb8
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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");
}