|
Class is a JUnit TestCase and defines a suite() method.
However, the suite method needs to be declared as either
public static junit.framework.Test suite()
or
public static junit.framework.TestSuite suite()
Repository: findbugs
Key: IJU_BAD_SUITE_METHOD
Available since 07 Jan 2014
|
|
Class is a JUnit TestCase and implements the setUp method. The setUp method should call
super.setUp(), but doesn't.
Repository: findbugs
Key: IJU_SETUP_NO_SUPER
Available since 07 Jan 2014
|
|
Class is a JUnit TestCase and implements the tearDown method. The tearDown method should call
super.tearDown(), but doesn't.
Repository: findbugs
Key: IJU_TEARDOWN_NO_SUPER
Available since 07 Jan 2014
|
|
Class is a JUnit TestCase but has not implemented any test methods
Repository: findbugs
Key: IJU_NO_TESTS
Available since 07 Jan 2014
|
|
Class is a JUnit TestCase and implements the suite() method.
The suite method should be declared as being static, but isn't.
Repository: findbugs
Key: IJU_SUITE_NOT_STATIC
Available since 07 Jan 2014
|
|
In order for the readResolve method to be recognized by the serialization
mechanism, it must not be declared as a static method.
Repository: findbugs
Key: SE_READ_RESOLVE_IS_STATIC
Available since 07 Jan 2014
|
|
One of the arguments is uncompatible with the corresponding format string specifier.
As a result, this will generate a runtime exception when executed.
For example, String.format("%d", "1") will generate an exception, since
the String "1" is incompatible with the format specifier %d.
Repository: findbugs
Key: VA_FORMAT_STRING_BAD_CONVERSION
Available since 07 Jan 2014
|
|
This anonymous class defined a method that is not directly invoked and does not override
a method in a superclass. Since methods in other classes cannot directly invoke methods
declared in an anonymous class, it seems that this method is uncallable. The method
might simply be dead code, but it is also possible that the method is intended to
override a method declared in a superclass, and due to an typo or other error the method does not,
in fact, override the method it is intended to.
Repository: findbugs
Key: UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS
Available since 07 Jan 2014
|
|
This constructor reads a field which has not yet been assigned a value.
This is often caused when the programmer mistakenly uses the field instead
of one of the constructor's parameters.
Repository: findbugs
Key: UR_UNINIT_READ
Available since 07 Jan 2014
|
|
This method is invoked in the constructor of of the superclass. At this point, the fields of the class have not yet initialized. To make this more concrete, consider the following classes:
abstract class A {
int hashCode;
abstract Object getValue();
A() {
hashCode = getValue().hashCode();
}
}
class B extends A {
Object value;
B(Object v) {
this.value = v;
}
Object getValue() {
return value;
}
}
When a B is constructed, the constructor for the A class is invoked before the constructor for B sets value. Thus, when the constructor for A invokes getValue, an uninitialized value is read for value.
Repository: findbugs
Key: UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR
Available since 07 Jan 2014
|
|
Type check performed using the instanceof operator where it can be statically determined whether the object
is of the type requested.
Repository: findbugs
Key: SIO_SUPERFLUOUS_INSTANCEOF
Available since 07 Jan 2014
|
|
This method invokes the Thread.currentThread() call, just to call the interrupted() method. As interrupted() is a
static method, is more simple and clear to use Thread.interrupted().
Repository: findbugs
Key: STI_INTERRUPTED_ON_CURRENTTHREAD
Available since 07 Jan 2014
|
|
This field is never written. All reads of it will return the default value. Check for errors (should it have been initialized?), or remove it if it is useless.
Repository: findbugs
Key: UWF_UNWRITTEN_FIELD
Available since 07 Jan 2014
|
|
A class defines an equals(Object) method but not a hashCode() method,
and thus doesn't fulfill the requirement that equal objects have equal hashCodes.
An instance of this class is used in a hash data structure, making the need to
fix this problem of highest importance.
Repository: findbugs
Key: HE_USE_OF_UNHASHABLE_CLASS
Available since 07 Jan 2014
|
|
This statement assigns to a local variable in a return statement. This assignment
has effect. Please verify that this statement does the right thing.
Repository: findbugs
Key: DLS_DEAD_LOCAL_STORE_IN_RETURN
Available since 07 Jan 2014
|
|
This method contains a useless control flow statement in which control
flow follows to the same or following line regardless of whether or not
the branch is taken.
Often, this is caused by inadvertently using an empty statement as the
body of an if statement, e.g.:
if (argv.length == 1);
System.out.println("Hello, " + argv[0]);
Repository: findbugs
Key: UCF_USELESS_CONTROL_FLOW_NEXT_LINE
Available since 07 Jan 2014
|
|
This method uses using pointer equality to compare two references that seem to be of
different types. The result of this comparison will always be false at runtime.
Repository: findbugs
Key: EC_UNRELATED_TYPES_USING_POINTER_EQUALITY
Available since 07 Jan 2014
|
|
This call doesn't make sense. For any collection c , calling c.containsAll(c) should
always be true, and c.retainAll(c) should have no effect.
Repository: findbugs
Key: DMI_VACUOUS_SELF_COLLECTION_CALL
Available since 07 Jan 2014
|
|
A value specified as carrying a type qualifier annotation is
consumed in a location or locations requiring that the value not
carry that annotation.
More precisely, a value annotated with a type qualifier specifying when=ALWAYS
is guaranteed to reach a use or uses where the same type qualifier specifies when=NEVER.
For example, say that @NonNegative is a nickname for
the type qualifier annotation @Negative(when=When.NEVER).
The following code will generate this warning because
the return statement requires a @NonNegative value,
but receives one that is marked as @Negative.
public @NonNegative Integer example(@Negative Integer value) {
return value;
}
Repository: findbugs
Key: TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED
Available since 07 Jan 2014
|
|
A value specified as not carrying a type qualifier annotation is guaranteed
to be consumed in a location or locations requiring that the value does
carry that annotation.
More precisely, a value annotated with a type qualifier specifying when=NEVER
is guaranteed to reach a use or uses where the same type qualifier specifies when=ALWAYS.
TODO: example
Repository: findbugs
Key: TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED
Available since 07 Jan 2014
|
|
There is a statement or branch on an exception path
that if executed guarantees that
a value is null at this point, and that
value that is guaranteed to be dereferenced
(except on forward paths involving runtime exceptions).
Repository: findbugs
Key: NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH
Available since 07 Jan 2014
|
|
A value is used in a way that requires it to be always be a value denoted by a type qualifier, but
there is an explicit annotation stating that it is not known where the value is required to have that type qualifier.
Either the usage or the annotation is incorrect.
Repository: findbugs
Key: TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALWAYS_SINK
Available since 07 Jan 2014
|
|
A value is used in a way that requires it to be never be a value denoted by a type qualifier, but
there is an explicit annotation stating that it is not known where the value is prohibited from having that type qualifier.
Either the usage or the annotation is incorrect.
Repository: findbugs
Key: TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK
Available since 07 Jan 2014
|
|
A value that is annotated as possibility being an instance of
the values denoted by the type qualifier, and the value is guaranteed to be used
in a way that prohibits values denoted by that type qualifier.
Repository: findbugs
Key: TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK
Available since 07 Jan 2014
|
|
A value that is annotated as possibility not being an instance of
the values denoted by the type qualifier, and the value is guaranteed to be used
in a way that requires values denoted by that type qualifier.
Repository: findbugs
Key: TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK
Available since 07 Jan 2014
|