FindBugs Report

Project Information

Project: $ant.project.name

FindBugs version: 2.0.2

Code analyzed:



Metrics

22812 lines of code analyzed, in 612 classes, in 40 packages.

Metric Total Density*
High Priority Warnings 6 0.26
Medium Priority Warnings 10 0.44
Low Priority Warnings 22 0.96
Total Warnings 38 1.67

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



Contents

Summary

Warning Type Number
Bad practice Warnings 4
Correctness Warnings 1
Internationalization Warnings 5
Malicious code vulnerability Warnings 4
Multithreaded correctness Warnings 5
Dodgy code Warnings 19
Total 38

Warnings

Click on a warning row to see full context information.

Bad practice Warnings

Code Warning
FS Format string should use %n rather than \n in org.crosswire.jsword.book.sword.RawFileBackend.updateDataFile(long, File)
RV exceptional return value of java.util.concurrent.BlockingQueue.offer(Object) ignored in org.crosswire.jsword.book.filter.osis.OSISFilter.parse(String)
Se The field org.crosswire.jsword.book.basic.DefaultBookmark.books is transient but isn't set by deserialization
Se The field org.crosswire.jsword.versification.Versification.localizedBibleNames is transient but isn't set by deserialization

Correctness Warnings

Code Warning
NP Possible null pointer dereference of RawFileBackendState.incfileValue in org.crosswire.jsword.book.sword.state.RawFileBackendState.getIncfileValue() on exception path

Internationalization Warnings

Code Warning
Dm Found reliance on default encoding in org.crosswire.common.util.NetUtil.listByIndexFile(URI, URIFilter): new java.io.InputStreamReader(InputStream)
Dm Found reliance on default encoding in org.crosswire.jsword.book.sword.AbstractBackend.decipher(byte[]): String.getBytes()
Dm Found reliance on default encoding in org.crosswire.jsword.book.sword.RawFileBackend.getTextFilename(RandomAccessFile, DataIndex): new String(byte[], int, int)
Dm Found reliance on default encoding in org.crosswire.jsword.book.sword.RawLDBackend.getRawText(RawLDBackendState, DataEntry): String.getBytes()
Dm Found reliance on default encoding in org.crosswire.jsword.book.sword.SwordUtil.decode(String, byte[], int, int, String): new String(byte[], int, int)

Malicious code vulnerability Warnings

Code Warning
EI org.crosswire.jsword.book.sword.state.ZLDBackendState.getLastUncompressed() may expose internal representation by returning ZLDBackendState.lastUncompressed
EI org.crosswire.jsword.book.sword.state.ZVerseBackendState.getLastUncompressed() may expose internal representation by returning ZVerseBackendState.lastUncompressed
EI2 org.crosswire.jsword.book.sword.state.ZLDBackendState.setLastUncompressed(byte[]) may expose internal representation by storing an externally mutable object into ZLDBackendState.lastUncompressed
EI2 org.crosswire.jsword.book.sword.state.ZVerseBackendState.setLastUncompressed(byte[]) may expose internal representation by storing an externally mutable object into ZVerseBackendState.lastUncompressed

Multithreaded correctness Warnings

Code Warning
IS Inconsistent synchronization of org.crosswire.common.progress.Job.totalUnits; locked 92% of time
IS Inconsistent synchronization of org.crosswire.common.progress.Job.currentSectionName; locked 85% of time
IS Inconsistent synchronization of org.crosswire.common.progress.Job.jobMode; locked 83% of time
IS Inconsistent synchronization of org.crosswire.common.progress.Job.percent; locked 91% of time
IS Inconsistent synchronization of org.crosswire.common.progress.Job.workUnits; locked 92% of time

Dodgy code Warnings

Code Warning
CI Class org.crosswire.common.util.Languages is final but declares protected field org.crosswire.common.util.Languages.log
NP Load of known null value in org.crosswire.jsword.book.sword.RawBackend.contains(Key)
NP Load of known null value in org.crosswire.jsword.book.sword.RawBackend.isWritable()
NP Load of known null value in org.crosswire.jsword.book.sword.RawBackend.readRawContent(RawBackendState, Key)
NP Load of known null value in org.crosswire.jsword.book.sword.RawLDBackend.getCardinality()
NP Load of known null value in org.crosswire.jsword.book.sword.RawLDBackend.indexOf(Key)
NP Load of known null value in org.crosswire.jsword.book.sword.ZVerseBackend.contains(Key)
RCN Redundant nullcheck of org.crosswire.common.util.MsgBase.getLocalisedResources(), which is known to be non-null in org.crosswire.common.util.MsgBase.obtainString(String)
RCN Redundant nullcheck of t, which is known to be non-null in org.crosswire.jsword.book.filter.thml.CustomHandler.endElement(String, String, String)
RCN Redundant nullcheck of t, which is known to be non-null in org.crosswire.jsword.book.filter.thml.CustomHandler.startElement(String, String, String, Attributes)
RCN Redundant nullcheck of temp, which is known to be non-null in org.crosswire.jsword.book.SentenceUtil.tokenize(String)
RCN Redundant nullcheck of text, which is known to be non-null in org.crosswire.jsword.book.sword.ConfigEntryTable.toConf(StringBuilder, Map)
RCN Redundant nullcheck of text, which is known to be non-null in org.crosswire.jsword.book.sword.ConfigEntryTable.toConf(StringBuilder, ConfigEntryType[])
RCN Redundant nullcheck of buffer, which is known to be non-null in org.crosswire.jsword.book.sword.RawBackend.getIndex(RandomAccessFile, long)
RCN Redundant nullcheck of temp, which is known to be non-null in org.crosswire.jsword.book.sword.ZLDBackend.getEntry(RawLDBackendState, DataEntry)
RCN Redundant nullcheck of temp, which is known to be non-null in org.crosswire.jsword.book.sword.ZVerseBackend.contains(Key)
RCN Redundant nullcheck of temp, which is known to be non-null in org.crosswire.jsword.book.sword.ZVerseBackend.readRawContent(ZVerseBackendState, Key)
RCN Redundant nullcheck of tempDownload, which is known to be non-null in org.crosswire.jsword.util.IndexDownloader.downloadIndex(Book, Installer)
ST Write to static field org.crosswire.common.util.Logger.level from instance method org.crosswire.common.util.Logger.setLevel(Level)

Details

CI_CONFUSED_INHERITANCE: Class is final but declares protected field

This class is declared to be final, but declares fields to be protected. Since the class is final, it can not be derived from, and the use of protected is confusing. The access modifier for the field should be changed to private or public to represent the true use for the field.

DM_DEFAULT_ENCODING: Reliance on default encoding

Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behaviour to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly.

EI_EXPOSE_REP: May expose internal representation by returning reference to mutable object

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.

EI_EXPOSE_REP2: May expose internal representation by incorporating reference to mutable object

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.

VA_FORMAT_STRING_USES_NEWLINE: Format string should use %n rather than \n

This format string include a newline character (\n). In format strings, it is generally preferable better to use %n, which will produce the platform-specific line separator.

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

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.

NP_LOAD_OF_KNOWN_NULL_VALUE: Load of known null value

The variable referenced at this point is known to be null due to an earlier check against null. Although this is valid, it might be a mistake (perhaps you intended to refer to a different variable, or perhaps the earlier check to see if the variable is null should have been a check to see if it was nonnull).

NP_NULL_ON_SOME_PATH_EXCEPTION: Possible null pointer dereference in method on exception path

A reference value which is null on some exception control path is dereferenced here.  This may lead to a NullPointerException when the code is executed.  Note that because FindBugs currently does not prune infeasible exception paths, this may be a false warning.

Also note that FindBugs considers the default case of a switch statement to be an exception path, since the default case is often infeasible.

RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE: Redundant nullcheck of value known to be non-null

This method contains a redundant check of a known non-null value against the constant null.

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.

SE_TRANSIENT_FIELD_NOT_RESTORED: Transient field that isn't set by deserialization.

This class contains a field that is updated at multiple places in the class, thus it seems to be part of the state of the class. However, since the field is marked as transient and not set in readObject or readResolve, it will contain the default value in any deserialized instance of the class.

ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD: Write to static field from instance method

This instance method writes to a static field. This is tricky to get correct if multiple instances are being manipulated, and generally bad practice.