FindBugs Report

Project Information

Project: JSword/BibleDesktop

FindBugs version: 1.3.4

Code analyzed:



Metrics

30846 lines of code analyzed, in 774 classes, in 48 packages.

Metric Total Density*
High Priority Warnings 0.00
Medium Priority Warnings 8 0.26
Low Priority Warnings 6 0.19
Total Warnings 14 0.45

(* Defects per Thousand lines of non-commenting source statements)



Contents

Summary

Warning Type Number
Bad practice Warnings 6
Multithreaded correctness Warnings 4
Dodgy Warnings 4
Total 14

Warnings

Click on a warning row to see full context information.

Bad practice Warnings

Code Warning
RV org.crosswire.common.util.CWProject.migrateUserProjectDir(URI, URI) ignores exceptional return value of java.io.File.renameTo(File)
RV org.crosswire.common.util.IOUtil.unpackZip(File, File) ignores exceptional return value of java.io.File.mkdirs()
RV org.crosswire.common.util.NetUtil.makeDirectory(URI) ignores exceptional return value of java.io.File.mkdirs()
RV org.crosswire.jsword.book.sword.SwordBookPath.migrate(File, File) ignores exceptional return value of java.io.File.mkdirs()
RV new org.crosswire.jsword.index.lucene.LuceneIndex(Book, URI, boolean) ignores exceptional return value of java.io.File.renameTo(File)
RV org.crosswire.jsword.index.lucene.LuceneIndexManager.deleteIndex(Book) ignores exceptional return value of java.io.File.renameTo(File)

Multithreaded correctness Warnings

Code Warning
IS Inconsistent synchronization of org.crosswire.bibledesktop.book.BooksListModel.books; locked 88% of time
LI Incorrect lazy initialization of static field org.crosswire.common.util.CallContext.resolver in org.crosswire.common.util.CallContext.instance()
LI Incorrect lazy initialization of static field org.crosswire.common.util.Logger.level in org.crosswire.common.util.Logger.initialize()
LI Incorrect lazy initialization of static field org.crosswire.jsword.book.filter.FilterFactory.deft in org.crosswire.jsword.book.filter.FilterFactory.<static initializer>()

Dodgy Warnings

Code Warning
DLS Dead store to availableBooks in org.crosswire.jsword.examples.APIExamples.installBook()
DLS Dead store to installer in org.crosswire.jsword.examples.APIExamples.installBook()
DLS Dead store to name in org.crosswire.jsword.examples.APIExamples.installBook()
IC Initialization circularity between org.crosswire.jsword.passage.RestrictionType and org.crosswire.jsword.passage.RestrictionType$2

Details

DLS_DEAD_LOCAL_STORE: Dead store to local variable

This instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruction. Often, this indicates an error, because the value computed is never used.

Note that Sun's javac compiler often generates dead stores for final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives.

IC_INIT_CIRCULARITY: Initialization circularity

A circularity was detected in the static initializers of the two classes referenced by the bug instance.  Many kinds of unexpected behavior may arise from such circularity.

IS2_INCONSISTENT_SYNC: Inconsistent synchronization

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

  1. The class contains a mix of locked and unlocked accesses,
  2. At least one locked access was performed by one of the class's own methods, and
  3. The number of unsynchronized field accesses (reads and writes) was no more than one third of all accesses, with writes being weighed twice as high as reads

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.

LI_LAZY_INIT_STATIC: Incorrect lazy initialization of static field

This method contains an unsynchronized lazy initialization of a non-volatile static field. Because the compiler or processor may reorder instructions, threads are not guaranteed to see a completely initialized object, if the method can be called by multiple threads. You can make the field volatile to correct the problem. For more information, see the Java Memory Model web site.

RV_RETURN_VALUE_IGNORED_BAD_PRACTICE: Method ignores exceptional return value

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.