Project: /Users/agi/workspace/jomic/settings/jomic.fb
FindBugs version: 0.8.8
Code analyzed:
Click on a warning row to see full context information.
Code | Warning |
---|---|
ICAST | Integer division result cast to double in net.sf.jomic.tools.ImageTools.getRotatedImage(java.awt.image.RenderedImage,double) |
NP | Possible null pointer dereference in net.sf.jomic.ui.JomicMenuBar.createViewMenu() |
RR | net.sf.jomic.tools.FileTools.obtainComicFormat(java.io.File) ignores result of java.io.InputStream.read(byte[],int,int) |
Se | Class net.sf.jomic.comic.ComicInfoTableModel defines non-transient non-serializable instance field net.sf.jomic.comic.ComicInfoTableModel.comicModel |
Se | Class net.sf.jomic.comic.ComicInfoTableModel defines non-transient non-serializable instance field net.sf.jomic.comic.ComicInfoTableModel.stringTools |
Se | Class net.sf.jomic.comic.Conversion defines non-transient non-serializable instance field net.sf.jomic.comic.Conversion.imageTools |
Se | Class net.sf.jomic.comic.Conversion defines non-transient non-serializable instance field net.sf.jomic.comic.Conversion.stringTools |
Se | Class net.sf.jomic.tools.BasicSettings defines non-transient non-serializable instance field net.sf.jomic.tools.BasicSettings.logger |
Se | Class net.sf.jomic.tools.BasicSettings defines non-transient non-serializable instance field net.sf.jomic.tools.BasicSettings.stringTools |
Se | Class net.sf.jomic.tools.ImageRenderSettings defines non-transient non-serializable instance field net.sf.jomic.tools.ImageRenderSettings.imageTools |
Se | Class net.sf.jomic.tools.ImageRenderSettings defines non-transient non-serializable instance field net.sf.jomic.tools.ImageRenderSettings.logger |
Se | Class net.sf.jomic.tools.ImageRenderSettings defines non-transient non-serializable instance field net.sf.jomic.tools.ImageRenderSettings.stringTools |
Se | Class net.sf.jomic.ui.ImageFormatTableModel defines non-transient non-serializable instance field net.sf.jomic.ui.ImageFormatTableModel.imageTools |
SnVI | net.sf.jomic.comic.ComicInfoTableModel is Serializable; consider declaring a serialVersionUID |
SnVI | net.sf.jomic.comic.ComicViewTransferHandler is Serializable; consider declaring a serialVersionUID |
SnVI | net.sf.jomic.comic.Conversion is Serializable; consider declaring a serialVersionUID |
SnVI | net.sf.jomic.tools.BasicSettings is Serializable; consider declaring a serialVersionUID |
SnVI | net.sf.jomic.tools.ImageRenderSettings is Serializable; consider declaring a serialVersionUID |
SnVI | net.sf.jomic.ui.ImageFormatTableModel is Serializable; consider declaring a serialVersionUID |
SnVI | net.sf.jomic.ui.OpenRecentFileEvent is Serializable; consider declaring a serialVersionUID |
UCF | Useless control flow in net.sf.jomic.comic.ComicView.getRenderedImage(int,int) |
Code | Warning |
---|
Code | Warning |
---|---|
IS2 | Inconsistent synchronization of net.sf.jomic.common.Settings.baseCacheDir; locked 80% of time |
SC | net.sf.jomic.tools.ImageCache. |
Code | Warning |
---|---|
EI | net.sf.jomic.comic.ComicMustContainImagesException.getFileNames() may expose internal representation by returning net.sf.jomic.comic.ComicMustContainImagesException.otherFileNames |
EI | net.sf.jomic.tools.ConsoleIOException.getArguments() may expose internal representation by returning net.sf.jomic.tools.ConsoleIOException.arguments |
EI | net.sf.jomic.tools.ImageTools.getPossibleBlurModes() may expose internal representation by returning net.sf.jomic.tools.ImageTools.possibleBlurModes |
EI | net.sf.jomic.ui.OpenFromArchiveDialog.getFileNames() may expose internal representation by returning net.sf.jomic.ui.OpenFromArchiveDialog.fileNames |
EI2 | net.sf.jomic.comic.AbstractCreateComicTask. |
EI2 | net.sf.jomic.comic.CreateZipArchiveTask. |
EI2 | net.sf.jomic.tools.CreateImagInfoMapTask. |
EI2 | net.sf.jomic.ui.ConvertWorker. |
Code | Warning |
---|---|
SBSC | Method net.sf.jomic.comic.AbstractCreateComicTask.start() concatenates strings using + in a loop |
SBSC | Method net.sf.jomic.tools.ConsoleIOException.getFullCommand() concatenates strings using + in a loop |
SBSC | Method net.sf.jomic.tools.ErrorTools.getDetailedExceptionMessage(Throwable) concatenates strings using + in a loop |
SBSC | Method net.sf.jomic.tools.ImageTools. |
SBSC | Method net.sf.jomic.tools.StringTools.arrayToString(double[]) concatenates strings using + in a loop |
SBSC | Method net.sf.jomic.tools.StringTools.arrayToString(float[]) concatenates strings using + in a loop |
SBSC | Method net.sf.jomic.tools.StringTools.arrayToString(int[]) concatenates strings using + in a loop |
SBSC | Method net.sf.jomic.tools.StringTools.arrayToString(java.io.File[]) concatenates strings using + in a loop |
SBSC | Method net.sf.jomic.tools.StringTools.arrayToString(String[]) concatenates strings using + in a loop |
SBSC | Method net.sf.jomic.ui.AboutFrame.getLinks(String,String[]) concatenates strings using + in a loop |
SIC | Should net.sf.jomic.tools.ImageCacheRenderThread$ImageRenderTask be a _static_ inner class? |
SIC | Should net.sf.jomic.tools.ProgressFrame$CancelAction be a _static_ inner class? |
UrF | Unread field: net.sf.jomic.tools.ImageCache.unrenderableImageFiles |
Code | Warning |
---|---|
BC | Unchecked/unconfirmed cast from java.awt.event.ActionEvent to class net.roydesign.event.ApplicationEvent in net.sf.jomic.JomicMacOSX.actionPerformed(java.awt.event.ActionEvent) |
BC | Unchecked/unconfirmed cast from java.awt.event.ActionEvent to class net.roydesign.event.ApplicationEvent in net.sf.jomic.ui.JomicApplication.actionPerformed(java.awt.event.ActionEvent) |
CD | Class net.sf.jomic.common.Settings has a circular dependency with other classes. |
CD | Class net.sf.jomic.tools.FileTools has a circular dependency with other classes. |
CD | Class net.sf.jomic.tools.FileTools has a circular dependency with other classes. |
CD | Class net.sf.jomic.tools.ImageCacheRenderThread has a circular dependency with other classes. |
CD | Class net.sf.jomic.ui.GoToPageDialog has a circular dependency with other classes. |
CD | Class net.sf.jomic.ui.JomicApplication has a circular dependency with other classes. |
CD | Class net.sf.jomic.ui.JomicApplication has a circular dependency with other classes. |
CD | Class net.sf.jomic.ui.JomicMenuBar has a circular dependency with other classes. |
REC | Method com.centerkey.utils.BareBonesBrowserLaunch.openURL(String) catches Exception, but Exception is not thrown in the try block and RuntimeException is not explicitly caught |
REC | Method net.sf.jomic.ui.CreateComicWorker.construct() catches Exception, but Exception is not thrown in the try block and RuntimeException is not explicitly caught |
This cast is unchecked, and not all instances of the type casted from can be cast to the type it is being cast to. Ensure that your program logic ensures that this cast will not fail.
This class has a circular dependency with other classes. This makes building these classes difficult, as each is dependent on the other to build correctly. Consider using interfaces to break the hard dependency.
Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.
This code stores a reference to an externally mutable object into the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.
This code casts the result of an integer division operation to double. Doing division on integers loses precision. The fact that the result was cast to double suggests that this precision should have been retained. What was probably meant was to cast one or both of the operands to double before performing the division. Here is an example:
int x = 2; int y = 5; // Wrong: yields result 0.0 double value1 = x / y; // Right: yields result 0.4 double value2 = x / (double) y;
The fields of this class appear to be accessed inconsistently with respect to synchronization. This bug report indicates that the bug pattern detector judged that
A typical bug matching this bug pattern is forgetting to synchronize one of the methods in a class that is intended to be thread-safe.
You can select the nodes labeled "Unsynchronized access" to show the code locations where the detector believed that a field was accessed without synchronization.
Note that there are various sources of inaccuracy in this detector; for example, the detector cannot statically detect all situations in which a lock is held. Also, even when the detector is accurate in distinguishing locked vs. unlocked accesses, the code in question may still be correct.
This description refers to the "IS2" version of the pattern detector, which has more accurate ways of detecting locked vs. unlocked accesses than the older "IS" detector.
A reference value dereferenced here might be null at runtime.
This may lead to a NullPointerException
when the code is executed.
This method uses a try-catch block that catches Exception objects, but Exception is not thrown within the try block, and RuntimeException is not explicitly caught. It is a common bug pattern to say try { ... } catch (Exception e) { something } as a shorthand for catching a number of types of exception each of whose catch blocks is identical, but this construct also accidentally catches RuntimeException as well, masking potential bugs.
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.
The method seems to be building a String using concatenation in a loop. In each iteration, the String is converted to a StringBuffer/StringBuilder, appended to, and converted back to a String. This can lead to a cost quadratic in the number of iterations, as the growing string is recopied in each iteration.
Better performance can be obtained by using a StringBuffer (or StringBuilder in Java 1.5) explicitly.
For example:
// This is bad String s = ""; for (int i = 0; i < field.length; ++i) { s = s + field[i]; } // This is better StringBuffer buf = new StringBuffer(); for (int i = 0; i < field.length; ++i) { buf.append(field[i]); } String s = buf.toString();
The constructor starts a thread. This is likely to be wrong if the class is ever extended/subclassed, since the thread will be started before the subclass constructor is started.
This Serializable class defines a non-primitive instance field which is neither transient,
Serializable, or java.lang.Object
, and does not appear to implement
the Externalizable
interface or the
readObject()
and writeObject()
methods.
Objects of this class will not be deserialized correctly if a non-Serializable
object is stored in this field.
This class is an inner class, but does not use its embedded reference to the object which created it. This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary. If possible, the class should be be made static.
This class implements the Serializable
interface, but does
not define a serialVersionUID
field.
A change as simple as adding a reference to a .class object
will add synthetic fields to the class,
which will unfortunately change the implicit
serialVersionUID (e.g., adding a reference to String.class
will generate a static field class$java$lang$String
).
Also, different source code to bytecode compilers may use different
naming conventions for synthetic variables generated for
references to class objects or inner classes.
To ensure interoperability of Serializable across versions,
consider adding an explicit serialVersionUID.
This method contains a useless control flow statement.
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]);
This field is never read. Consider removing it from the class.