|
This finalize() method does not make a call to its
superclass's finalize() method. So, any finalizer
actions defined for the superclass will not be performed.
Add a call to super.finalize() .
Repository: findbugs
Key: FI_MISSING_SUPER_CALL
Available since 07 Jan 2014
|
|
The only thing this finalize() method does is call
the superclass's finalize() method, making it
redundant. Delete it.
Repository: findbugs
Key: FI_USELESS
Available since 07 Jan 2014
|
|
This empty finalize() method explicitly negates the
effect of any finalizer defined by its superclass. Any finalizer
actions defined for the superclass will not be performed.
Unless this is intended, delete this method.
Repository: findbugs
Key: FI_NULLIFY_SUPER
Available since 07 Jan 2014
|
|
This finalizer nulls out fields. This is usually an error, as it does not aid garbage collection,
and the object is going to be garbage collected anyway.
Repository: findbugs
Key: FI_FINALIZER_NULLS_FIELDS
Available since 07 Jan 2014
|
|
This finalizer does nothing except null out fields. This is completely pointless, and requires that
the object be garbage collected, finalized, and then garbage collected again. You should just remove the finalize
method.
Repository: findbugs
Key: FI_FINALIZER_ONLY_NULLS_FIELDS
Available since 07 Jan 2014
|
|
This class implements the java.util.Iterator interface.
However, its next() method is not capable of throwing
java.util.NoSuchElementException . The next()
method should be changed so it throws NoSuchElementException
if is called when there are no more elements to return.
Repository: findbugs
Key: IT_NO_SUCH_ELEMENT
Available since 07 Jan 2014
|
|
The method in the subclass doesn't override a similar method in a superclass because the type of a parameter doesn't exactly match
the type of the corresponding parameter in the superclass. For example, if you have:
import alpha.Foo;
public class A {
public int f(Foo x) { return 17; }
}
----
import beta.Foo;
public class B extends A {
public int f(Foo x) { return 42; }
public int f(alpha.Foo x) { return 27; }
}
The f(Foo) method defined in class B doesn't
override the
f(Foo) method defined in class A , because the argument
types are Foo 's from different packages.
In this case, the subclass does define a method with a signature identical to the method in the superclass,
so this is presumably understood. However, such methods are exceptionally confusing. You should strongly consider
removing or deprecating the method with the similar but not identical signature.
Repository: findbugs
Key: NM_WRONG_PACKAGE_INTENTIONAL
Available since 07 Jan 2014
|
|
This method returns a value that is not checked. The return value should be checked
since it can indicate an unusual or unexpected function execution. For
example, the File.delete() method returns false
if the file could not be successfully deleted (rather than
throwing an Exception).
If you don't check the result, you won't notice if the method invocation
signals unexpected behavior by returning an atypical return value.
Repository: findbugs
Key: RV_RETURN_VALUE_IGNORED_BAD_PRACTICE
Available since 07 Jan 2014
|
|
This method ignores the return value of one of the variants of
java.io.InputStream.read() which can return multiple bytes.
If the return value is not checked, the caller will not be able to correctly
handle the case where fewer bytes were read than the caller requested.
This is a particularly insidious kind of bug, because in many programs,
reads from input streams usually do read the full amount of data requested,
causing the program to fail only sporadically.
Repository: findbugs
Key: RR_NOT_CHECKED
Available since 07 Jan 2014
|
|
This method ignores the return value of
java.io.InputStream.skip() which can skip multiple bytes.
If the return value is not checked, the caller will not be able to correctly
handle the case where fewer bytes were skipped than the caller requested.
This is a particularly insidious kind of bug, because in many programs,
skips from input streams usually do skip the full amount of data requested,
causing the program to fail only sporadically. With Buffered streams, however,
skip() will only skip data in the buffer, and will routinely fail to skip the
requested number of bytes.
Repository: findbugs
Key: SR_NOT_CHECKED
Available since 07 Jan 2014
|
|
This code invokes a method that requires a security permission check.
If this code will be granted security permissions, but might be invoked by code that does not
have security permissions, then the invocation needs to occur inside a doPrivileged block.
Repository: findbugs
Key: DP_DO_INSIDE_DO_PRIVILEGED
Available since 07 Jan 2014
|
|
Never call System.runFinalizersOnExit
or Runtime.runFinalizersOnExit for any reason: they are among the most
dangerous methods in the Java libraries. -- Joshua Bloch
Repository: findbugs
Key: DM_RUN_FINALIZERS_ON_EXIT
Available since 07 Jan 2014
|
|
The method creates a database resource (such as a database connection
or row set), does not assign it to any
fields, pass it to other methods, or return it, and does not appear to close
the object on all paths out of the method. Failure to
close database resources on all paths out of a method may
result in poor performance, and could cause the application to
have problems communicating with the database.
Repository: findbugs
Key: ODR_OPEN_DATABASE_RESOURCE
Available since 07 Jan 2014
|
|
The method creates a database resource (such as a database connection
or row set), does not assign it to any
fields, pass it to other methods, or return it, and does not appear to close
the object on all exception paths out of the method. Failure to
close database resources on all paths out of a method may
result in poor performance, and could cause the application to
have problems communicating with the database.
Repository: findbugs
Key: ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH
Available since 07 Jan 2014
|
|
The method creates an IO stream object, does not assign it to any
fields, pass it to other methods that might close it,
or return it, and does not appear to close
the stream on all paths out of the method. This may result in
a file descriptor leak. It is generally a good
idea to use a finally block to ensure that streams are
closed.
Repository: findbugs
Key: OS_OPEN_STREAM
Available since 07 Jan 2014
|
|
The method creates an IO stream object, does not assign it to any
fields, pass it to other methods, or return it, and does not appear to close
it on all possible exception paths out of the method.
This may result in a file descriptor leak. It is generally a good
idea to use a finally block to ensure that streams are
closed.
Repository: findbugs
Key: OS_OPEN_STREAM_EXCEPTION_PATH
Available since 07 Jan 2014
|
|
This method might drop an exception. In general, exceptions
should be handled or reported in some way, or they should be thrown
out of the method.
Repository: findbugs
Key: DE_MIGHT_DROP
Available since 07 Jan 2014
|
|
This method might ignore an exception. In general, exceptions
should be handled or reported in some way, or they should be thrown
out of the method.
Repository: findbugs
Key: DE_MIGHT_IGNORE
Available since 07 Jan 2014
|
|
A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen.
This method can be invoked as though it returned a value of type boolean, and
the compiler will insert automatic unboxing of the Boolean value. If a null value is returned,
this will result in a NullPointerException.
Repository: findbugs
Key: NP_BOOLEAN_RETURN_NULL
Available since 07 Jan 2014
|
|
This class allocates an object that is based on a class that only supplies static methods. This object
does not need to be created, just access the static methods directly using the class name as a qualifier.
Repository: findbugs
Key: ISC_INSTANTIATE_STATIC_CLASS
Available since 07 Jan 2014
|
|
This Serializable class is an inner class of a non-serializable class.
Thus, attempts to serialize it will also attempt to associate instance of the outer
class with which it is associated, leading to a runtime error.
If possible, making the inner class a static inner class should solve the
problem. Making the outer class serializable might also work, but that would
mean serializing an instance of the inner class would always also serialize the instance
of the outer class, which it often not what you really want.
Repository: findbugs
Key: SE_BAD_FIELD_INNER_CLASS
Available since 07 Jan 2014
|
|
A non-serializable value is stored into a non-transient field
of a serializable class.
Repository: findbugs
Key: SE_BAD_FIELD_STORE
Available since 07 Jan 2014
|
|
This code creates a java.util.Random object, uses it to generate one random number, and then discards
the Random object. This produces mediocre quality random numbers and is inefficient.
If possible, rewrite the code so that the Random object is created once and saved, and each time a new random number
is required invoke a method on the existing Random object to obtain it.
If it is important that the generated Random numbers not be guessable, you must not create a new Random for each random
number; the values are too easily guessable. You should strongly consider using a java.security.SecureRandom instead
(and avoid allocating a new SecureRandom for each random number needed).
Repository: findbugs
Key: DMI_RANDOM_USED_ONLY_ONCE
Available since 07 Jan 2014
|
|
This Serializable class is an inner class. Any attempt to serialize
it will also serialize the associated outer instance. The outer instance is serializable,
so this won't fail, but it might serialize a lot more data than intended.
If possible, making the inner class a static inner class (also known as a nested class) should solve the
problem.
Repository: findbugs
Key: SE_INNER_CLASS
Available since 07 Jan 2014
|
|
This class defines a serialVersionUID field that is not final.
The field should be made final
if it is intended to specify
the version UID for purposes of serialization.
Repository: findbugs
Key: SE_NONFINAL_SERIALVERSIONID
Available since 07 Jan 2014
|