The following issues were found
guava/src/com/google/common/primitives/IntsMethodsForWeb.java
2 issues
Line: 25
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class IntsMethodsForWeb {}
Reported by PMD.
Line: 25
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
abstract class IntsMethodsForWeb {}
Reported by PMD.
guava/src/com/google/common/reflect/Reflection.java
2 issues
Line: 66
public static void initialize(Class<?>... classes) {
for (Class<?> clazz : classes) {
try {
Class.forName(clazz.getName(), true, clazz.getClassLoader());
} catch (ClassNotFoundException e) {
throw new AssertionError(e);
}
}
}
Reported by PMD.
Line: 87
checkArgument(interfaceType.isInterface(), "%s is not an interface", interfaceType);
Object object =
Proxy.newProxyInstance(
interfaceType.getClassLoader(), new Class<?>[] {interfaceType}, handler);
return interfaceType.cast(object);
}
private Reflection() {}
}
Reported by PMD.
guava/src/com/google/common/reflect/TypeCapture.java
2 issues
Line: 28
* @author Ben Yu
*/
@ElementTypesAreNonnullByDefault
abstract class TypeCapture<T> {
/** Returns the captured type. */
final Type capture() {
Type superclass = getClass().getGenericSuperclass();
checkArgument(superclass instanceof ParameterizedType, "%s isn't parameterized", superclass);
Reported by PMD.
Line: 32
/** Returns the captured type. */
final Type capture() {
Type superclass = getClass().getGenericSuperclass();
checkArgument(superclass instanceof ParameterizedType, "%s isn't parameterized", superclass);
return ((ParameterizedType) superclass).getActualTypeArguments()[0];
}
}
Reported by PMD.
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.
guava/src/com/google/common/collect/CompoundOrdering.java
2 issues
Line: 31
@ElementTypesAreNonnullByDefault
final class CompoundOrdering<T extends @Nullable Object> extends Ordering<T>
implements Serializable {
final Comparator<? super T>[] comparators;
CompoundOrdering(Comparator<? super T> primary, Comparator<? super T> secondary) {
this.comparators = (Comparator<? super T>[]) new Comparator[] {primary, secondary};
}
Reported by PMD.
Line: 43
@Override
public int compare(@ParametricNullness T left, @ParametricNullness T right) {
for (int i = 0; i < comparators.length; i++) {
int result = comparators[i].compare(left, right);
if (result != 0) {
return result;
}
}
Reported by PMD.
guava/src/com/google/common/primitives/Platform.java
2 issues
Line: 39
"https://stackoverflow.com/q/5189914/28465",
"https://groups.google.com/d/msg/guava-announce/zHZTFg7YF3o/rQNnwdHeEwAJ"));
}
logger.log(
java.util.logging.Level.WARNING,
"Later in 2020, we will remove GWT-RPC support for Guava types. You are seeing this"
+ " warning because you are sending a Guava type over GWT-RPC, which will break. You"
+ " can identify which type by looking at the class name in the attached stack trace.",
new Throwable());
Reported by PMD.
Line: 31
if (!Boolean.parseBoolean(System.getProperty(propertyName, "false"))) {
throw new UnsupportedOperationException(
com.google.common.base.Strings.lenientFormat(
"We are removing GWT-RPC support for Guava types. You can temporarily reenable"
+ " support by setting the system property %s to true. For more about system"
+ " properties, see %s. For more about Guava's GWT-RPC support, see %s.",
propertyName,
"https://stackoverflow.com/q/5189914/28465",
Reported by PMD.
guava/src/com/google/common/xml/XmlEscapers.java
2 issues
Line: 44
@Beta
@GwtCompatible
@ElementTypesAreNonnullByDefault
public class XmlEscapers {
private XmlEscapers() {}
private static final char MIN_ASCII_CONTROL_CHAR = 0x00;
private static final char MAX_ASCII_CONTROL_CHAR = 0x1F;
Reported by PMD.
Line: 103
return XML_ATTRIBUTE_ESCAPER;
}
private static final Escaper XML_ESCAPER;
private static final Escaper XML_CONTENT_ESCAPER;
private static final Escaper XML_ATTRIBUTE_ESCAPER;
static {
Escapers.Builder builder = Escapers.builder();
Reported by PMD.
guava-tests/test/com/google/common/util/concurrent/ServiceTest.java
2 issues
Line: 33
public class ServiceTest extends TestCase {
/** Assert on the comparison ordering of the State enum since we guarantee it. */
public void testStateOrdering() {
// List every valid (direct) state transition.
assertLessThan(NEW, STARTING);
assertLessThan(NEW, TERMINATED);
assertLessThan(STARTING, RUNNING);
Reported by PMD.
Line: 33
public class ServiceTest extends TestCase {
/** Assert on the comparison ordering of the State enum since we guarantee it. */
public void testStateOrdering() {
// List every valid (direct) state transition.
assertLessThan(NEW, STARTING);
assertLessThan(NEW, TERMINATED);
assertLessThan(STARTING, RUNNING);
Reported by PMD.
guava/src/com/google/common/collect/ForwardingImmutableCollection.java
2 issues
Line: 28
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
class ForwardingImmutableCollection {
private ForwardingImmutableCollection() {}
}
Reported by PMD.
Line: 28
*/
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
class ForwardingImmutableCollection {
private ForwardingImmutableCollection() {}
}
Reported by PMD.
guava/src/com/google/common/collect/SortedMultiset.java
2 issues
Line: 49
@GwtCompatible(emulated = true)
@ElementTypesAreNonnullByDefault
public interface SortedMultiset<E extends @Nullable Object>
extends SortedMultisetBridge<E>, SortedIterable<E> {
/**
* Returns the comparator that orders this multiset, or {@link Ordering#natural()} if the natural
* ordering of the elements is used.
*/
@Override
Reported by PMD.
Line: 20
package com.google.common.collect;
import com.google.common.annotations.GwtCompatible;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.NavigableSet;
import java.util.Set;
import javax.annotation.CheckForNull;
Reported by PMD.