PMD: No need to nest
- PMD: No need to just call super - PMD: Simplify ternary expression to expression - PMD: Ignore empty loop warning - Fix import
This commit is contained in:
parent
5848c936b7
commit
e84ff4dff0
|
@ -17,7 +17,6 @@
|
|||
package org.apache.commons.collections4;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
|
|
@ -72,7 +72,7 @@ public final class IndexFilter {
|
|||
if (number >= size) {
|
||||
throw new IndexOutOfBoundsException(String.format("number too large %d >= %d", number, size));
|
||||
}
|
||||
return tracker.test(number) ? consumer.test(number) : true;
|
||||
return !tracker.test(number) || consumer.test(number);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -87,10 +87,8 @@ public interface IndexProducer {
|
|||
public boolean test(long word) {
|
||||
int i = wordIdx;
|
||||
while (word != 0) {
|
||||
if ((word & 1) == 1) {
|
||||
if (!consumer.test(i)) {
|
||||
return false;
|
||||
}
|
||||
if ((word & 1) == 1 && !consumer.test(i)) {
|
||||
return false;
|
||||
}
|
||||
word >>>= 1;
|
||||
i++;
|
||||
|
|
|
@ -294,9 +294,8 @@ public abstract class AbstractReferenceMap<K, V> extends AbstractHashedMap<K, V>
|
|||
@Override
|
||||
public void clear() {
|
||||
super.clear();
|
||||
// drain the queue
|
||||
while (queue.poll() != null) {
|
||||
// empty
|
||||
// Drain the queue
|
||||
while (queue.poll() != null) { // NOPMD
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,8 +20,6 @@ package org.apache.commons.collections4.properties;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
import java.util.Collection;
|
||||
|
@ -150,18 +148,6 @@ public class PropertiesFactory extends AbstractPropertiesFactory<Properties> {
|
|||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void list(final PrintStream out) {
|
||||
// Implement as super
|
||||
super.list(out);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void list(final PrintWriter out) {
|
||||
// Implement as super
|
||||
super.list(out);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws {@link UnsupportedOperationException}.
|
||||
* Caller should use try-with-resources statement.
|
||||
|
|
Loading…
Reference in New Issue