The following issues were found
guava/src/com/google/common/escape/Escaper.java
2 issues
Line: 88
*/
public abstract String escape(String string);
private final Function<String, String> asFunction =
new Function<String, String>() {
@Override
public String apply(String from) {
return escape(from);
}
Reported by PMD.
Line: 88
*/
public abstract String escape(String string);
private final Function<String, String> asFunction =
new Function<String, String>() {
@Override
public String apply(String from) {
return escape(from);
}
Reported by PMD.
guava/src/com/google/common/escape/CharEscaper.java
2 issues
Line: 99
* @return the escaped form of {@code string}
* @throws NullPointerException if {@code string} is null
*/
protected final String escapeSlow(String s, int index) {
int slen = s.length();
// Get a destination buffer and setup some loop variables.
char[] dest = Platform.charBufferFromThreadLocal();
int destSize = dest.length;
Reported by PMD.
Line: 104
// Get a destination buffer and setup some loop variables.
char[] dest = Platform.charBufferFromThreadLocal();
int destSize = dest.length;
int destIndex = 0;
int lastEscape = 0;
// Loop through the rest of the string, replacing when needed into the
// destination buffer, which gets grown as needed as well.
Reported by PMD.
guava/src/com/google/common/math/BigDecimalMath.java
2 issues
Line: 54
* @since 30.0
*/
public static double roundToDouble(BigDecimal x, RoundingMode mode) {
return BigDecimalToDoubleRounder.INSTANCE.roundToDouble(x, mode);
}
private static class BigDecimalToDoubleRounder extends ToDoubleRounder<BigDecimal> {
static final BigDecimalToDoubleRounder INSTANCE = new BigDecimalToDoubleRounder();
Reported by PMD.
Line: 74
@Override
BigDecimal toX(double d, RoundingMode mode) {
return new BigDecimal(d);
}
@Override
BigDecimal minus(BigDecimal a, BigDecimal b) {
return a.subtract(b);
Reported by PMD.
android/guava/src/com/google/common/collect/SortedLists.java
2 issues
Line: 271
* otherwise the index determined by the {@code KeyAbsentBehavior}.
*/
public static <E extends @Nullable Object> int binarySearch(
List<? extends E> list,
@ParametricNullness E key,
Comparator<? super E> comparator,
KeyPresentBehavior presentBehavior,
KeyAbsentBehavior absentBehavior) {
checkNotNull(comparator);
Reported by PMD.
Line: 286
// TODO(lowasser): benchmark when it's best to do a linear search
int lower = 0;
int upper = list.size() - 1;
while (lower <= upper) {
int middle = (lower + upper) >>> 1;
int c = comparator.compare(key, list.get(middle));
if (c < 0) {
Reported by PMD.
android/guava/src/com/google/common/io/AppendableWriter.java
2 issues
Line: 37
@GwtIncompatible
@ElementTypesAreNonnullByDefault
class AppendableWriter extends Writer {
private final Appendable target;
private boolean closed;
/**
* Creates a new writer that appends everything it writes to {@code target}.
*
Reported by PMD.
Line: 38
@ElementTypesAreNonnullByDefault
class AppendableWriter extends Writer {
private final Appendable target;
private boolean closed;
/**
* Creates a new writer that appends everything it writes to {@code target}.
*
* @param target target to which to append output
Reported by PMD.
android/guava/src/com/google/common/hash/PrimitiveSink.java
2 issues
Line: 73
PrimitiveSink putBytes(ByteBuffer bytes);
/** Puts a short into this sink. */
PrimitiveSink putShort(short s);
/** Puts an int into this sink. */
PrimitiveSink putInt(int i);
/** Puts a long into this sink. */
Reported by PMD.
Line: 31
@Beta
@CanIgnoreReturnValue
@ElementTypesAreNonnullByDefault
public interface PrimitiveSink {
/**
* Puts a byte into this sink.
*
* @param b a byte
* @return this instance
Reported by PMD.
android/guava/src/com/google/common/hash/AbstractByteHasher.java
2 issues
Line: 36
*/
@CanIgnoreReturnValue
@ElementTypesAreNonnullByDefault
abstract class AbstractByteHasher extends AbstractHasher {
private final ByteBuffer scratch = ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN);
/** Updates this hasher with the given byte. */
protected abstract void update(byte b);
Reported by PMD.
Line: 37
@CanIgnoreReturnValue
@ElementTypesAreNonnullByDefault
abstract class AbstractByteHasher extends AbstractHasher {
private final ByteBuffer scratch = ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN);
/** Updates this hasher with the given byte. */
protected abstract void update(byte b);
/** Updates this hasher with the given bytes. */
Reported by PMD.
android/guava/src/com/google/common/graph/UndirectedMultiNetworkConnections.java
2 issues
Line: 63
@Override
public Set<N> adjacentNodes() {
return Collections.unmodifiableSet(adjacentNodesMultiset().elementSet());
}
private Multiset<N> adjacentNodesMultiset() {
Multiset<N> adjacentNodes = getReference(adjacentNodesReference);
if (adjacentNodes == null) {
Reported by PMD.
Line: 80
return new MultiEdgesConnecting<E>(incidentEdgeMap, node) {
@Override
public int size() {
return adjacentNodesMultiset().count(node);
}
};
}
@Override
Reported by PMD.
android/guava/src/com/google/common/util/concurrent/GwtFuturesCatchingSpecialization.java
2 issues
Line: 27
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class GwtFuturesCatchingSpecialization {
/*
* This server copy of the class is empty. The corresponding GWT copy contains alternative
* versions of catching() and catchingAsync() with slightly different signatures from the ones
* found in Futures.java.
*/
Reported by PMD.
Line: 27
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class GwtFuturesCatchingSpecialization {
/*
* This server copy of the class is empty. The corresponding GWT copy contains alternative
* versions of catching() and catchingAsync() with slightly different signatures from the ones
* found in Futures.java.
*/
Reported by PMD.
android/guava/src/com/google/common/escape/Escaper.java
2 issues
Line: 88
*/
public abstract String escape(String string);
private final Function<String, String> asFunction =
new Function<String, String>() {
@Override
public String apply(String from) {
return escape(from);
}
Reported by PMD.
Line: 88
*/
public abstract String escape(String string);
private final Function<String, String> asFunction =
new Function<String, String>() {
@Override
public String apply(String from) {
return escape(from);
}
Reported by PMD.