Fix PMD issue regarding Ternary operators that can be simplified
This commit is contained in:
parent
2da1b2f60d
commit
9f45dc09e3
|
@ -67,7 +67,7 @@ public class NodeListIterator implements Iterator<Node> {
|
|||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return nodeList == null ? false : index < nodeList.getLength();
|
||||
return nodeList != null && index < nodeList.getLength();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -97,7 +97,7 @@ public class PeekingIterator<E> implements Iterator<E> {
|
|||
if (exhausted) {
|
||||
return false;
|
||||
}
|
||||
return slotFilled ? true : iterator.hasNext();
|
||||
return slotFilled || iterator.hasNext();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -88,7 +88,7 @@ public class PushbackIterator<E> implements Iterator<E> {
|
|||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return !items.isEmpty() ? true : iterator.hasNext();
|
||||
return !items.isEmpty() || iterator.hasNext();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -435,7 +435,7 @@ public abstract class AbstractLinkedList<E> implements List<E> {
|
|||
* @return true if equal
|
||||
*/
|
||||
protected boolean isEqualValue(final Object value1, final Object value2) {
|
||||
return value1 == value2 || (value1 == null ? false : value1.equals(value2));
|
||||
return value1 == value2 || (value1 != null && value1.equals(value2));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -461,19 +461,19 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
|
|||
@Override
|
||||
public boolean contains(final Object obj) {
|
||||
final Collection<V> coll = getMapping();
|
||||
return coll == null ? false : coll.contains(obj);
|
||||
return coll != null && coll.contains(obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsAll(final Collection<?> other) {
|
||||
final Collection<V> coll = getMapping();
|
||||
return coll == null ? false : coll.containsAll(other);
|
||||
return coll != null && coll.containsAll(other);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
final Collection<V> coll = getMapping();
|
||||
return coll == null ? true : coll.isEmpty();
|
||||
return coll == null || coll.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue