Use isEmpty().
This commit is contained in:
parent
2b23b7add8
commit
23730a0fb8
|
@ -795,7 +795,7 @@ public abstract class AbstractReferenceMap<K, V> extends AbstractHashedMap<K, V>
|
||||||
|
|
||||||
ReferenceBaseIterator(final AbstractReferenceMap<K, V> parent) {
|
ReferenceBaseIterator(final AbstractReferenceMap<K, V> parent) {
|
||||||
this.parent = 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
|
// have to do this here! size() invocation above
|
||||||
// may have altered the modCount.
|
// may have altered the modCount.
|
||||||
expectedModCount = parent.modCount;
|
expectedModCount = parent.modCount;
|
||||||
|
|
|
@ -139,7 +139,7 @@ public class CompositeMap<K, V> extends AbstractIterableMap<K, V> implements Ser
|
||||||
if (map != null) {
|
if (map != null) {
|
||||||
for (int i = composite.length - 1; i >= 0; --i) {
|
for (int i = composite.length - 1; i >= 0; --i) {
|
||||||
final Collection<K> intersect = CollectionUtils.intersection(this.composite[i].keySet(), map.keySet());
|
final Collection<K> intersect = CollectionUtils.intersection(this.composite[i].keySet(), map.keySet());
|
||||||
if (intersect.size() != 0) {
|
if (!intersect.isEmpty()) {
|
||||||
if (this.mutator == null) {
|
if (this.mutator == null) {
|
||||||
throw new IllegalArgumentException("Key collision adding Map to CompositeMap");
|
throw new IllegalArgumentException("Key collision adding Map to CompositeMap");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue