Project Information
Project:
$ant.project.name
FindBugs version: 2.0.2
Code analyzed:
- /space/home/jsword/build/jsword/target/main/classes
Metrics
22812 lines of code analyzed,
in 612 classes,
in 40 packages.
| 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
Warnings
Click on a warning row to see full context information.
|
FS
|
Format string should use %n rather than \n in org.crosswire.jsword.book.sword.RawFileBackend.updateDataFile(long, File) |
|
Bug type VA_FORMAT_STRING_USES_NEWLINE (click for details)
In class org.crosswire.jsword.book.sword.RawFileBackend In method org.crosswire.jsword.book.sword.RawFileBackend.updateDataFile(long, File) Called method String.format(String, Object[]) Format string "%07d\r\n" At RawFileBackend.java:[line 247]
|
|
RV
|
exceptional return value of java.util.concurrent.BlockingQueue.offer(Object) ignored in org.crosswire.jsword.book.filter.osis.OSISFilter.parse(String) |
|
Bug type RV_RETURN_VALUE_IGNORED_BAD_PRACTICE (click for details)
In class org.crosswire.jsword.book.filter.osis.OSISFilter In method org.crosswire.jsword.book.filter.osis.OSISFilter.parse(String) Called method java.util.concurrent.BlockingQueue.offer(Object) At OSISFilter.java:[line 156]
|
|
Se
|
The field org.crosswire.jsword.book.basic.DefaultBookmark.books is transient but isn't set by deserialization |
|
Bug type SE_TRANSIENT_FIELD_NOT_RESTORED (click for details)
In class org.crosswire.jsword.book.basic.DefaultBookmark Field org.crosswire.jsword.book.basic.DefaultBookmark.books In DefaultBookmark.java
|
|
Se
|
The field org.crosswire.jsword.versification.Versification.localizedBibleNames is transient but isn't set by deserialization |
|
Bug type SE_TRANSIENT_FIELD_NOT_RESTORED (click for details)
In class org.crosswire.jsword.versification.Versification Field org.crosswire.jsword.versification.Versification.localizedBibleNames In Versification.java
|
|
NP
|
Possible null pointer dereference of RawFileBackendState.incfileValue in org.crosswire.jsword.book.sword.state.RawFileBackendState.getIncfileValue() on exception path |
|
Bug type NP_NULL_ON_SOME_PATH_EXCEPTION (click for details)
In class org.crosswire.jsword.book.sword.state.RawFileBackendState In method org.crosswire.jsword.book.sword.state.RawFileBackendState.getIncfileValue() Value contained in org.crosswire.jsword.book.sword.state.RawFileBackendState.incfileValue Dereferenced at RawFileBackendState.java:[line 143] Null value at RawFileBackendState.java:[line 135] Known null at RawFileBackendState.java:[line 138] Known null at RawFileBackendState.java:[line 139]
|
|
Dm
|
Found reliance on default encoding in org.crosswire.common.util.NetUtil.listByIndexFile(URI, URIFilter): new java.io.InputStreamReader(InputStream) |
|
Bug type DM_DEFAULT_ENCODING (click for details)
In class org.crosswire.common.util.NetUtil In method org.crosswire.common.util.NetUtil.listByIndexFile(URI, URIFilter) Called method new java.io.InputStreamReader(InputStream) At NetUtil.java:[line 560]
|
|
Dm
|
Found reliance on default encoding in org.crosswire.jsword.book.sword.AbstractBackend.decipher(byte[]): String.getBytes() |
|
Bug type DM_DEFAULT_ENCODING (click for details)
In class org.crosswire.jsword.book.sword.AbstractBackend In method org.crosswire.jsword.book.sword.AbstractBackend.decipher(byte[]) Called method String.getBytes() At AbstractBackend.java:[line 89]
|
|
Dm
|
Found reliance on default encoding in org.crosswire.jsword.book.sword.RawFileBackend.getTextFilename(RandomAccessFile, DataIndex): new String(byte[], int, int) |
|
Bug type DM_DEFAULT_ENCODING (click for details)
In class org.crosswire.jsword.book.sword.RawFileBackend In method org.crosswire.jsword.book.sword.RawFileBackend.getTextFilename(RandomAccessFile, DataIndex) Called method new String(byte[], int, int) At RawFileBackend.java:[line 205]
|
|
Dm
|
Found reliance on default encoding in org.crosswire.jsword.book.sword.RawLDBackend.getRawText(RawLDBackendState, DataEntry): String.getBytes() |
|
Bug type DM_DEFAULT_ENCODING (click for details)
In class org.crosswire.jsword.book.sword.RawLDBackend In method org.crosswire.jsword.book.sword.RawLDBackend.getRawText(RawLDBackendState, DataEntry) Called method String.getBytes() At RawLDBackend.java:[line 106]
|
|
Dm
|
Found reliance on default encoding in org.crosswire.jsword.book.sword.SwordUtil.decode(String, byte[], int, int, String): new String(byte[], int, int) |
|
Bug type DM_DEFAULT_ENCODING (click for details)
In class org.crosswire.jsword.book.sword.SwordUtil In method org.crosswire.jsword.book.sword.SwordUtil.decode(String, byte[], int, int, String) Called method new String(byte[], int, int) At SwordUtil.java:[line 346]
|
|
EI
|
org.crosswire.jsword.book.sword.state.ZLDBackendState.getLastUncompressed() may expose internal representation by returning ZLDBackendState.lastUncompressed |
|
Bug type EI_EXPOSE_REP (click for details)
In class org.crosswire.jsword.book.sword.state.ZLDBackendState In method org.crosswire.jsword.book.sword.state.ZLDBackendState.getLastUncompressed() Field org.crosswire.jsword.book.sword.state.ZLDBackendState.lastUncompressed At ZLDBackendState.java:[line 145]
|
|
EI
|
org.crosswire.jsword.book.sword.state.ZVerseBackendState.getLastUncompressed() may expose internal representation by returning ZVerseBackendState.lastUncompressed |
|
Bug type EI_EXPOSE_REP (click for details)
In class org.crosswire.jsword.book.sword.state.ZVerseBackendState In method org.crosswire.jsword.book.sword.state.ZVerseBackendState.getLastUncompressed() Field org.crosswire.jsword.book.sword.state.ZVerseBackendState.lastUncompressed At ZVerseBackendState.java:[line 184]
|
|
EI2
|
org.crosswire.jsword.book.sword.state.ZLDBackendState.setLastUncompressed(byte[]) may expose internal representation by storing an externally mutable object into ZLDBackendState.lastUncompressed |
|
Bug type EI_EXPOSE_REP2 (click for details)
In class org.crosswire.jsword.book.sword.state.ZLDBackendState In method org.crosswire.jsword.book.sword.state.ZLDBackendState.setLastUncompressed(byte[]) Field org.crosswire.jsword.book.sword.state.ZLDBackendState.lastUncompressed Local variable named lastUncompressed At ZLDBackendState.java:[line 159]
|
|
EI2
|
org.crosswire.jsword.book.sword.state.ZVerseBackendState.setLastUncompressed(byte[]) may expose internal representation by storing an externally mutable object into ZVerseBackendState.lastUncompressed |
|
Bug type EI_EXPOSE_REP2 (click for details)
In class org.crosswire.jsword.book.sword.state.ZVerseBackendState In method org.crosswire.jsword.book.sword.state.ZVerseBackendState.setLastUncompressed(byte[]) Field org.crosswire.jsword.book.sword.state.ZVerseBackendState.lastUncompressed Local variable named lastUncompressed At ZVerseBackendState.java:[line 208]
|
|
IS
|
Inconsistent synchronization of org.crosswire.common.progress.Job.totalUnits; locked 92% of time |
|
Bug type IS2_INCONSISTENT_SYNC (click for details)
In class org.crosswire.common.progress.Job Field org.crosswire.common.progress.Job.totalUnits Synchronized 92% of the time Unsynchronized access at Job.java:[line 150] Synchronized access at Job.java:[line 390] Synchronized access at Job.java:[line 391] Synchronized access at Job.java:[line 394] Synchronized access at Job.java:[line 212] Synchronized access at Job.java:[line 143] Synchronized access at Job.java:[line 277] Synchronized access at Job.java:[line 190] Synchronized access at Job.java:[line 82] Synchronized access at Job.java:[line 83] Synchronized access at Job.java:[line 108] Synchronized access at Job.java:[line 111] Synchronized access at Job.java:[line 113]
|
|
IS
|
Inconsistent synchronization of org.crosswire.common.progress.Job.currentSectionName; locked 85% of time |
|
Bug type IS2_INCONSISTENT_SYNC (click for details)
In class org.crosswire.common.progress.Job Field org.crosswire.common.progress.Job.currentSectionName Synchronized 85% of the time Unsynchronized access at Job.java:[line 225] Synchronized access at Job.java:[line 249] Synchronized access at Job.java:[line 245] Synchronized access at Job.java:[line 269] Synchronized access at Job.java:[line 281] Synchronized access at Job.java:[line 81] Synchronized access at Job.java:[line 99]
|
|
IS
|
Inconsistent synchronization of org.crosswire.common.progress.Job.jobMode; locked 83% of time |
|
Bug type IS2_INCONSISTENT_SYNC (click for details)
In class org.crosswire.common.progress.Job Field org.crosswire.common.progress.Job.jobMode Synchronized 83% of the time Unsynchronized access at Job.java:[line 136] Synchronized access at Job.java:[line 239] Synchronized access at Job.java:[line 239] Synchronized access at Job.java:[line 83] Synchronized access at Job.java:[line 101] Synchronized access at Job.java:[line 114]
|
|
IS
|
Inconsistent synchronization of org.crosswire.common.progress.Job.percent; locked 91% of time |
|
Bug type IS2_INCONSISTENT_SYNC (click for details)
In class org.crosswire.common.progress.Job Field org.crosswire.common.progress.Job.percent Synchronized 91% of the time Unsynchronized access at Job.java:[line 157] Synchronized access at Job.java:[line 385] Synchronized access at Job.java:[line 392] Synchronized access at Job.java:[line 394] Synchronized access at Job.java:[line 396] Synchronized access at Job.java:[line 210] Synchronized access at Job.java:[line 212] Synchronized access at Job.java:[line 213] Synchronized access at Job.java:[line 278] Synchronized access at Job.java:[line 189] Synchronized access at Job.java:[line 190] Synchronized access at Job.java:[line 191]
|
|
IS
|
Inconsistent synchronization of org.crosswire.common.progress.Job.workUnits; locked 92% of time |
|
Bug type IS2_INCONSISTENT_SYNC (click for details)
In class org.crosswire.common.progress.Job Field org.crosswire.common.progress.Job.workUnits Synchronized 92% of the time Unsynchronized access at Job.java:[line 171] Synchronized access at Job.java:[line 245] Synchronized access at Job.java:[line 386] Synchronized access at Job.java:[line 390] Synchronized access at Job.java:[line 394] Synchronized access at Job.java:[line 391] Synchronized access at Job.java:[line 208] Synchronized access at Job.java:[line 208] Synchronized access at Job.java:[line 212] Synchronized access at Job.java:[line 277] Synchronized access at Job.java:[line 183] Synchronized access at Job.java:[line 187] Synchronized access at Job.java:[line 190]
|
|
CI
|
Class org.crosswire.common.util.Languages is final but declares protected field org.crosswire.common.util.Languages.log |
|
Bug type CI_CONFUSED_INHERITANCE (click for details)
In class org.crosswire.common.util.Languages Field org.crosswire.common.util.Languages.log In Languages.java
|
|
NP
|
Load of known null value in org.crosswire.jsword.book.sword.RawBackend.contains(Key) |
|
Bug type NP_LOAD_OF_KNOWN_NULL_VALUE (click for details)
In class org.crosswire.jsword.book.sword.RawBackend In method org.crosswire.jsword.book.sword.RawBackend.contains(Key) At RawBackend.java:[line 94]
|
|
NP
|
Load of known null value in org.crosswire.jsword.book.sword.RawBackend.isWritable() |
|
Bug type NP_LOAD_OF_KNOWN_NULL_VALUE (click for details)
In class org.crosswire.jsword.book.sword.RawBackend In method org.crosswire.jsword.book.sword.RawBackend.isWritable() At RawBackend.java:[line 222]
|
|
NP
|
Load of known null value in org.crosswire.jsword.book.sword.RawBackend.readRawContent(RawBackendState, Key) |
|
Bug type NP_LOAD_OF_KNOWN_NULL_VALUE (click for details)
In class org.crosswire.jsword.book.sword.RawBackend In method org.crosswire.jsword.book.sword.RawBackend.readRawContent(RawBackendState, Key) At RawBackend.java:[line 200]
|
|
NP
|
Load of known null value in org.crosswire.jsword.book.sword.RawLDBackend.getCardinality() |
|
Bug type NP_LOAD_OF_KNOWN_NULL_VALUE (click for details)
In class org.crosswire.jsword.book.sword.RawLDBackend In method org.crosswire.jsword.book.sword.RawLDBackend.getCardinality() At RawLDBackend.java:[line 129]
|
|
NP
|
Load of known null value in org.crosswire.jsword.book.sword.RawLDBackend.indexOf(Key) |
|
Bug type NP_LOAD_OF_KNOWN_NULL_VALUE (click for details)
In class org.crosswire.jsword.book.sword.RawLDBackend In method org.crosswire.jsword.book.sword.RawLDBackend.indexOf(Key) At RawLDBackend.java:[line 169]
|
|
NP
|
Load of known null value in org.crosswire.jsword.book.sword.ZVerseBackend.contains(Key) |
|
Bug type NP_LOAD_OF_KNOWN_NULL_VALUE (click for details)
In class org.crosswire.jsword.book.sword.ZVerseBackend In method org.crosswire.jsword.book.sword.ZVerseBackend.contains(Key) At ZVerseBackend.java:[line 194]
|
|
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) |
|
Bug type RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE (click for details)
In class org.crosswire.common.util.MsgBase In method org.crosswire.common.util.MsgBase.obtainString(String) Return value of org.crosswire.common.util.MsgBase.getLocalisedResources() Redundant null check at MsgBase.java:[line 71]
|
|
RCN
|
Redundant nullcheck of t, which is known to be non-null in org.crosswire.jsword.book.filter.thml.CustomHandler.endElement(String, String, String) |
|
Bug type RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE (click for details)
In class org.crosswire.jsword.book.filter.thml.CustomHandler In method org.crosswire.jsword.book.filter.thml.CustomHandler.endElement(String, String, String) Value loaded from t Return value of org.crosswire.jsword.book.filter.thml.CustomHandler.getTag(String, String) Redundant null check at CustomHandler.java:[line 145]
|
|
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) |
|
Bug type RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE (click for details)
In class org.crosswire.jsword.book.filter.thml.CustomHandler In method org.crosswire.jsword.book.filter.thml.CustomHandler.startElement(String, String, String, Attributes) Value loaded from t Return value of org.crosswire.jsword.book.filter.thml.CustomHandler.getTag(String, String) Redundant null check at CustomHandler.java:[line 83]
|
|
RCN
|
Redundant nullcheck of temp, which is known to be non-null in org.crosswire.jsword.book.SentenceUtil.tokenize(String) |
|
Bug type RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE (click for details)
In class org.crosswire.jsword.book.SentenceUtil In method org.crosswire.jsword.book.SentenceUtil.tokenize(String) Value loaded from temp Redundant null check at SentenceUtil.java:[line 93]
|
|
RCN
|
Redundant nullcheck of text, which is known to be non-null in org.crosswire.jsword.book.sword.ConfigEntryTable.toConf(StringBuilder, Map) |
|
Bug type RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE (click for details)
In class org.crosswire.jsword.book.sword.ConfigEntryTable In method org.crosswire.jsword.book.sword.ConfigEntryTable.toConf(StringBuilder, Map) Value loaded from text Return value of org.crosswire.jsword.book.sword.ConfigEntry.toConf() Redundant null check at ConfigEntryTable.java:[line 753]
|
|
RCN
|
Redundant nullcheck of text, which is known to be non-null in org.crosswire.jsword.book.sword.ConfigEntryTable.toConf(StringBuilder, ConfigEntryType[]) |
|
Bug type RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE (click for details)
In class org.crosswire.jsword.book.sword.ConfigEntryTable In method org.crosswire.jsword.book.sword.ConfigEntryTable.toConf(StringBuilder, ConfigEntryType[]) Value loaded from text Return value of org.crosswire.jsword.book.sword.ConfigEntry.toConf() Redundant null check at ConfigEntryTable.java:[line 716]
|
|
RCN
|
Redundant nullcheck of buffer, which is known to be non-null in org.crosswire.jsword.book.sword.RawBackend.getIndex(RandomAccessFile, long) |
|
Bug type RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE (click for details)
In class org.crosswire.jsword.book.sword.RawBackend In method org.crosswire.jsword.book.sword.RawBackend.getIndex(RandomAccessFile, long) Value loaded from buffer Return value of org.crosswire.jsword.book.sword.SwordUtil.readRAF(RandomAccessFile, long, int) Redundant null check at RawBackend.java:[line 243]
|
|
RCN
|
Redundant nullcheck of temp, which is known to be non-null in org.crosswire.jsword.book.sword.ZLDBackend.getEntry(RawLDBackendState, DataEntry) |
|
Bug type RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE (click for details)
In class org.crosswire.jsword.book.sword.ZLDBackend In method org.crosswire.jsword.book.sword.ZLDBackend.getEntry(RawLDBackendState, DataEntry) Value loaded from temp Return value of org.crosswire.jsword.book.sword.SwordUtil.readRAF(RandomAccessFile, long, int) Redundant null check at ZLDBackend.java:[line 78]
|
|
RCN
|
Redundant nullcheck of temp, which is known to be non-null in org.crosswire.jsword.book.sword.ZVerseBackend.contains(Key) |
|
Bug type RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE (click for details)
In class org.crosswire.jsword.book.sword.ZVerseBackend In method org.crosswire.jsword.book.sword.ZVerseBackend.contains(Key) Value loaded from temp Return value of org.crosswire.jsword.book.sword.SwordUtil.readRAF(RandomAccessFile, long, int) Redundant null check at ZVerseBackend.java:[line 176]
|
|
RCN
|
Redundant nullcheck of temp, which is known to be non-null in org.crosswire.jsword.book.sword.ZVerseBackend.readRawContent(ZVerseBackendState, Key) |
|
Bug type RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE (click for details)
In class org.crosswire.jsword.book.sword.ZVerseBackend In method org.crosswire.jsword.book.sword.ZVerseBackend.readRawContent(ZVerseBackendState, Key) Value loaded from temp Return value of org.crosswire.jsword.book.sword.SwordUtil.readRAF(RandomAccessFile, long, int) Redundant null check at ZVerseBackend.java:[line 297] Another occurrence at ZVerseBackend.java:[line 315]
|
|
RCN
|
Redundant nullcheck of tempDownload, which is known to be non-null in org.crosswire.jsword.util.IndexDownloader.downloadIndex(Book, Installer) |
|
Bug type RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE (click for details)
In class org.crosswire.jsword.util.IndexDownloader In method org.crosswire.jsword.util.IndexDownloader.downloadIndex(Book, Installer) Value loaded from tempDownload Return value of org.crosswire.common.util.NetUtil.getTemporaryURI(String, String) Redundant null check at IndexDownloader.java:[line 72]
|
|
ST
|
Write to static field org.crosswire.common.util.Logger.level from instance method org.crosswire.common.util.Logger.setLevel(Level) |
|
Bug type ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD (click for details)
In class org.crosswire.common.util.Logger In method org.crosswire.common.util.Logger.setLevel(Level) Field org.crosswire.common.util.Logger.level At Logger.java:[line 80]
|
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.
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.
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 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.
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
- The class contains a mix of locked and unlocked accesses,
- At least one locked access was performed by one of the class's own methods, and
- 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.
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).
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.
This method contains a redundant check of a known non-null value against
the constant null.
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.
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.
This instance method writes to a static field. This is tricky to get
correct if multiple instances are being manipulated,
and generally bad practice.