Project Information
Project:
$ant.project.name
FindBugs version: 3.0.0
Code analyzed:
- /space/home/jsword/build/jsword/target/main/classes
Metrics
24770 lines of code analyzed,
in 641 classes,
in 40 packages.
High Priority Warnings |
9 |
0.36 |
Medium Priority Warnings |
20 |
0.81 |
Low Priority Warnings |
43 |
1.74 |
Total Warnings
|
72
|
2.91
|
(* 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 231]
|
HE
|
org.crosswire.jsword.passage.TreeKey defines equals but not hashCode |
|
Bug type HE_EQUALS_NO_HASHCODE (click for details)
In class org.crosswire.jsword.passage.TreeKey In method org.crosswire.jsword.passage.TreeKey.equals(Object) At TreeKey.java:[lines 157-178]
|
Nm
|
Confusing to have methods org.crosswire.common.util.WebResource.shutdown() and org.crosswire.jsword.book.sword.state.OpenFileStateManager.shutDown() |
|
Bug type NM_CONFUSING (click for details)
In class org.crosswire.common.util.WebResource In method org.crosswire.common.util.WebResource.shutdown() In class org.crosswire.jsword.book.sword.state.OpenFileStateManager In method org.crosswire.jsword.book.sword.state.OpenFileStateManager.shutDown() At WebResource.java:[lines 158-159]
|
OS
|
new org.crosswire.jsword.versification.FileVersificationMapping(Versification) may fail to close stream |
|
Bug type OS_OPEN_STREAM (click for details)
In class org.crosswire.jsword.versification.FileVersificationMapping In method new org.crosswire.jsword.versification.FileVersificationMapping(Versification) Need to close java.io.Reader At FileVersificationMapping.java:[line 61]
|
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 204]
|
RV
|
Exceptional return value of java.io.File.mkdirs() ignored in org.crosswire.jsword.book.MetaDataLocator.getFile(URI) |
|
Bug type RV_RETURN_VALUE_IGNORED_BAD_PRACTICE (click for details)
In class org.crosswire.jsword.book.MetaDataLocator In method org.crosswire.jsword.book.MetaDataLocator.getFile(URI) Called method java.io.File.mkdirs() At MetaDataLocator.java:[line 85]
|
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
|
org.crosswire.jsword.book.BookData$BookVerseContent is serializable but also an inner class of a non-serializable class |
|
Bug type SE_BAD_FIELD_INNER_CLASS (click for details)
In class org.crosswire.jsword.book.BookData$BookVerseContent At BookData.java:[line 524]
|
SI
|
Static initializer for org.crosswire.jsword.index.lucene.InstalledIndex creates instance before all static final fields assigned |
|
Bug type SI_INSTANCE_BEFORE_FINALS_ASSIGNED (click for details)
In class org.crosswire.jsword.index.lucene.InstalledIndex In method org.crosswire.jsword.index.lucene.InstalledIndex.<static initializer for InstalledIndex>() Stored into field org.crosswire.jsword.index.lucene.InstalledIndex.myInstance Constructor is new org.crosswire.jsword.index.lucene.InstalledIndex() Value loaded from field org.crosswire.jsword.index.lucene.InstalledIndex.log At InstalledIndex.java:[line 184]
|
Dm
|
Use of non-localized String.toUpperCase() or String.toLowerCase() in org.crosswire.common.util.IOUtil.unpackZip(File, File, boolean, String[]) |
|
Bug type DM_CONVERT_CASE (click for details)
In class org.crosswire.common.util.IOUtil In method org.crosswire.common.util.IOUtil.unpackZip(File, File, boolean, String[]) At IOUtil.java:[line 96]
|
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 586]
|
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 85]
|
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 189]
|
Dm
|
Found reliance on default encoding in org.crosswire.jsword.book.sword.RawLDBackend.getRawText(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(DataEntry) Called method String.getBytes() At RawLDBackend.java:[line 104]
|
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 354]
|
Dm
|
Found reliance on default encoding in org.crosswire.jsword.bridge.ConfParser.parse(): new java.io.PrintWriter(OutputStream) |
|
Bug type DM_DEFAULT_ENCODING (click for details)
In class org.crosswire.jsword.bridge.ConfParser In method org.crosswire.jsword.bridge.ConfParser.parse() Called method new java.io.PrintWriter(OutputStream) At ConfParser.java:[line 58]
|
Dm
|
Found reliance on default encoding in org.crosswire.jsword.examples.GatherAllReferences.main(String[]): new java.io.FileWriter(String) |
|
Bug type DM_DEFAULT_ENCODING (click for details)
In class org.crosswire.jsword.examples.GatherAllReferences In method org.crosswire.jsword.examples.GatherAllReferences.main(String[]) Called method new java.io.FileWriter(String) At GatherAllReferences.java:[line 61]
|
Dm
|
Found reliance on default encoding in new org.crosswire.jsword.versification.FileVersificationMapping(Versification): new java.io.InputStreamReader(InputStream) |
|
Bug type DM_DEFAULT_ENCODING (click for details)
In class org.crosswire.jsword.versification.FileVersificationMapping In method new org.crosswire.jsword.versification.FileVersificationMapping(Versification) Called method new java.io.InputStreamReader(InputStream) At FileVersificationMapping.java:[line 61]
|
Dm
|
Found reliance on default encoding in org.crosswire.jsword.versification.VersificationToKJVMapper.trace(): new java.io.PrintStream(OutputStream) |
|
Bug type DM_DEFAULT_ENCODING (click for details)
In class org.crosswire.jsword.versification.VersificationToKJVMapper In method org.crosswire.jsword.versification.VersificationToKJVMapper.trace() Called method new java.io.PrintStream(OutputStream) At VersificationToKJVMapper.java:[line 580]
|
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 143]
|
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 170]
|
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 157]
|
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 194]
|
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 190] Synchronized access at Job.java:[line 108] Synchronized access at Job.java:[line 111] Synchronized access at Job.java:[line 113] Synchronized access at Job.java:[line 395] Synchronized access at Job.java:[line 396] Synchronized access at Job.java:[line 399] Synchronized access at Job.java:[line 277] Synchronized access at Job.java:[line 143] Synchronized access at Job.java:[line 82] Synchronized access at Job.java:[line 83] Synchronized access at Job.java:[line 212]
|
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 99] 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 249] Synchronized access at Job.java:[line 245]
|
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 101] Synchronized access at Job.java:[line 114] Synchronized access at Job.java:[line 83] Synchronized access at Job.java:[line 239] Synchronized access at Job.java:[line 239]
|
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 189] Synchronized access at Job.java:[line 190] Synchronized access at Job.java:[line 191] Synchronized access at Job.java:[line 390] Synchronized access at Job.java:[line 397] Synchronized access at Job.java:[line 399] Synchronized access at Job.java:[line 401] Synchronized access at Job.java:[line 278] Synchronized access at Job.java:[line 210] Synchronized access at Job.java:[line 212] Synchronized access at Job.java:[line 213]
|
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 183] Synchronized access at Job.java:[line 187] Synchronized access at Job.java:[line 190] Synchronized access at Job.java:[line 391] Synchronized access at Job.java:[line 395] Synchronized access at Job.java:[line 399] Synchronized access at Job.java:[line 396] Synchronized access at Job.java:[line 277] Synchronized access at Job.java:[line 245] Synchronized access at Job.java:[line 208] Synchronized access at Job.java:[line 208] Synchronized access at Job.java:[line 212]
|
Dm
|
org.crosswire.jsword.index.lucene.LuceneIndex.find(String) invokes toString() method on a String |
|
Bug type DM_STRING_TOSTRING (click for details)
In class org.crosswire.jsword.index.lucene.LuceneIndex In method org.crosswire.jsword.index.lucene.LuceneIndex.find(String) At LuceneIndex.java:[line 268]
|
Dm
|
org.crosswire.jsword.index.lucene.LuceneIndex.generateSearchIndexImpl(Progress, List, IndexWriter, Key, int, IndexPolicy) invokes toString() method on a String |
|
Bug type DM_STRING_TOSTRING (click for details)
In class org.crosswire.jsword.index.lucene.LuceneIndex In method org.crosswire.jsword.index.lucene.LuceneIndex.generateSearchIndexImpl(Progress, List, IndexWriter, Key, int, IndexPolicy) At LuceneIndex.java:[line 372]
|
SBSC
|
org.crosswire.common.xml.XMLUtil.recloseTags(String) concatenates strings using + in a loop |
|
Bug type SBSC_USE_STRINGBUFFER_CONCATENATION (click for details)
In class org.crosswire.common.xml.XMLUtil In method org.crosswire.common.xml.XMLUtil.recloseTags(String) At XMLUtil.java:[line 310]
|
SIC
|
Should org.crosswire.jsword.book.BookData$BookVerseContent be a _static_ inner class? |
|
Bug type SIC_INNER_SHOULD_BE_STATIC (click for details)
In class org.crosswire.jsword.book.BookData$BookVerseContent At BookData.java:[line 524]
|
SIC
|
The class org.crosswire.jsword.book.sword.state.OpenFileStateManager$2 could be refactored into a named _static_ inner class |
|
Bug type SIC_INNER_SHOULD_BE_STATIC_ANON (click for details)
In class org.crosswire.jsword.book.sword.state.OpenFileStateManager$2 At OpenFileStateManager.java:[lines 68-72]
|
SIC
|
Should org.crosswire.jsword.versification.BibleNames$NameList be a _static_ inner class? |
|
Bug type SIC_INNER_SHOULD_BE_STATIC (click for details)
In class org.crosswire.jsword.versification.BibleNames$NameList At BibleNames.java:[lines 211-420]
|
UPM
|
Private method org.crosswire.common.util.CWProject.reset() is never called |
|
Bug type UPM_UNCALLED_PRIVATE_METHOD (click for details)
In class org.crosswire.common.util.CWProject In method org.crosswire.common.util.CWProject.reset() At CWProject.java:[lines 81-82]
|
BC
|
Unchecked/unconfirmed cast from org.crosswire.jsword.passage.VerseKey to org.crosswire.jsword.passage.VerseRange in org.crosswire.jsword.versification.QualifiedKey.create(VerseKey) |
|
Bug type BC_UNCONFIRMED_CAST (click for details)
In class org.crosswire.jsword.versification.QualifiedKey In method org.crosswire.jsword.versification.QualifiedKey.create(VerseKey) Actual type org.crosswire.jsword.passage.VerseKey Expected org.crosswire.jsword.passage.VerseRange Value loaded from k At QualifiedKey.java:[line 131]
|
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
|
DLS
|
Dead store of null to buf in org.crosswire.common.util.IniSection.more(BufferedReader, String) |
|
Bug type DLS_DEAD_LOCAL_STORE_OF_NULL (click for details)
In class org.crosswire.common.util.IniSection In method org.crosswire.common.util.IniSection.more(BufferedReader, String) Local variable named buf At IniSection.java:[line 687]
|
DLS
|
Dead store to buffer in org.crosswire.common.util.IOUtil.getZipEntry(String) |
|
Bug type DLS_DEAD_LOCAL_STORE (click for details)
In class org.crosswire.common.util.IOUtil In method org.crosswire.common.util.IOUtil.getZipEntry(String) Local variable named buffer At IOUtil.java:[line 158]
|
DLS
|
Dead store to x in org.crosswire.common.util.StringUtil.split(String) |
|
Bug type DLS_DEAD_LOCAL_STORE (click for details)
In class org.crosswire.common.util.StringUtil In method org.crosswire.common.util.StringUtil.split(String) Local variable named x At StringUtil.java:[line 233]
|
DLS
|
Dead store to x in org.crosswire.common.util.StringUtil.split(String, char) |
|
Bug type DLS_DEAD_LOCAL_STORE (click for details)
In class org.crosswire.common.util.StringUtil In method org.crosswire.common.util.StringUtil.split(String, char) Local variable named x At StringUtil.java:[line 404]
|
DLS
|
Dead store to x in org.crosswire.common.util.StringUtil.split(String, char, int) |
|
Bug type DLS_DEAD_LOCAL_STORE (click for details)
In class org.crosswire.common.util.StringUtil In method org.crosswire.common.util.StringUtil.split(String, char, int) Local variable named x At StringUtil.java:[line 500]
|
DLS
|
Dead store to x in org.crosswire.common.util.StringUtil.split(String, int) |
|
Bug type DLS_DEAD_LOCAL_STORE (click for details)
In class org.crosswire.common.util.StringUtil In method org.crosswire.common.util.StringUtil.split(String, int) Local variable named x At StringUtil.java:[line 320]
|
DLS
|
Dead store to x in org.crosswire.common.util.StringUtil.split(String, String, int) |
|
Bug type DLS_DEAD_LOCAL_STORE (click for details)
In class org.crosswire.common.util.StringUtil In method org.crosswire.common.util.StringUtil.split(String, String, int) Local variable named x At StringUtil.java:[line 649]
|
DLS
|
Dead store to cell in org.crosswire.jsword.book.BookData.getOsisContent(boolean) |
|
Bug type DLS_DEAD_LOCAL_STORE (click for details)
In class org.crosswire.jsword.book.BookData In method org.crosswire.jsword.book.BookData.getOsisContent(boolean) Local variable named cell At BookData.java:[line 203]
|
DLS
|
Dead store to end in org.crosswire.jsword.book.sword.RawLDBackend.dumpIdxRaf() |
|
Bug type DLS_DEAD_LOCAL_STORE (click for details)
In class org.crosswire.jsword.book.sword.RawLDBackend In method org.crosswire.jsword.book.sword.RawLDBackend.dumpIdxRaf() Local variable named end At RawLDBackend.java:[line 529]
|
DLS
|
Dead store to end in org.crosswire.jsword.book.sword.RawLDBackend.toIMP() |
|
Bug type DLS_DEAD_LOCAL_STORE (click for details)
In class org.crosswire.jsword.book.sword.RawLDBackend In method org.crosswire.jsword.book.sword.RawLDBackend.toIMP() Local variable named end At RawLDBackend.java:[line 581]
|
DLS
|
Dead store to end in org.crosswire.jsword.book.sword.ZLDBackend.dumpIdxRaf() |
|
Bug type DLS_DEAD_LOCAL_STORE (click for details)
In class org.crosswire.jsword.book.sword.ZLDBackend In method org.crosswire.jsword.book.sword.ZLDBackend.dumpIdxRaf() Local variable named end At ZLDBackend.java:[line 142]
|
DLS
|
Dead store of null to ref in org.crosswire.jsword.examples.Speed.run() |
|
Bug type DLS_DEAD_LOCAL_STORE_OF_NULL (click for details)
In class org.crosswire.jsword.examples.Speed In method org.crosswire.jsword.examples.Speed.run() Local variable named ref At Speed.java:[line 115]
|
DLS
|
Dead store of null to results in org.crosswire.jsword.examples.Speed.run() |
|
Bug type DLS_DEAD_LOCAL_STORE_OF_NULL (click for details)
In class org.crosswire.jsword.examples.Speed In method org.crosswire.jsword.examples.Speed.run() Local variable named results At Speed.java:[line 106]
|
ICAST
|
Result of integer multiplication cast to long in org.crosswire.jsword.book.sword.state.OpenFileStateManager$1.run() |
|
Bug type ICAST_INTEGER_MULTIPLY_CAST_TO_LONG (click for details)
In class org.crosswire.jsword.book.sword.state.OpenFileStateManager$1 In method org.crosswire.jsword.book.sword.state.OpenFileStateManager$1.run() At OpenFileStateManager.java:[line 84]
|
NP
|
Load of known null value in org.crosswire.jsword.book.sword.RawBackend.getRawTextLength(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.getRawTextLength(Key) Value loaded from initState At RawBackend.java:[line 103]
|
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() Value loaded from rawBackendState At RawBackend.java:[line 223]
|
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) Value loaded from initState At RawBackend.java:[line 201]
|
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() Value loaded from state At RawLDBackend.java:[line 127]
|
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) Value loaded from state At RawLDBackend.java:[line 170]
|
NP
|
Load of known null value in org.crosswire.jsword.book.sword.ZVerseBackend.getRawTextLength(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.getRawTextLength(Key) Value loaded from rafBook At ZVerseBackend.java:[line 199]
|
NP
|
Load of known null value in org.crosswire.jsword.examples.ReadEverything.main(String[]) |
|
Bug type NP_LOAD_OF_KNOWN_NULL_VALUE (click for details)
In class org.crosswire.jsword.examples.ReadEverything In method org.crosswire.jsword.examples.ReadEverything.main(String[]) Value loaded from filter At ReadEverything.java:[line 60]
|
RCN
|
Redundant nullcheck of org.crosswire.common.util.IniSection.charset, which is known to be non-null in org.crosswire.common.util.IniSection.save() |
|
Bug type RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE (click for details)
In class org.crosswire.common.util.IniSection In method org.crosswire.common.util.IniSection.save() Value loaded from field org.crosswire.common.util.IniSection.charset Redundant null check at IniSection.java:[line 449]
|
RCN
|
Redundant nullcheck of org.crosswire.common.util.IniSection.configFile, which is known to be non-null in org.crosswire.common.util.IniSection.save() |
|
Bug type RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE (click for details)
In class org.crosswire.common.util.IniSection In method org.crosswire.common.util.IniSection.save() Value loaded from field org.crosswire.common.util.IniSection.configFile Redundant null check at IniSection.java:[line 449]
|
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 70]
|
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 155]
|
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 87]
|
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 91]
|
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 244]
|
RCN
|
Redundant nullcheck of org.crosswire.jsword.book.sword.SwordBookMetaData.bookType, which is known to be non-null in org.crosswire.jsword.book.sword.SwordBookMetaData.adjustBookType() |
|
Bug type RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE (click for details)
In class org.crosswire.jsword.book.sword.SwordBookMetaData In method org.crosswire.jsword.book.sword.SwordBookMetaData.adjustBookType() Value loaded from field org.crosswire.jsword.book.sword.SwordBookMetaData.bookType Redundant null check at SwordBookMetaData.java:[line 883]
|
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 83]
|
RCN
|
Redundant nullcheck of temp, which is known to be non-null in org.crosswire.jsword.book.sword.ZVerseBackend.getRawTextLength(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.getRawTextLength(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 184]
|
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 305] Another occurrence at ZVerseBackend.java:[line 323]
|
RCN
|
Redundant nullcheck of org.crosswire.jsword.book.BookData.getOsisFragment(), which is known to be non-null in org.crosswire.jsword.examples.ReadEverything.testReadSingle(Book, Key, int) |
|
Bug type RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE (click for details)
In class org.crosswire.jsword.examples.ReadEverything In method org.crosswire.jsword.examples.ReadEverything.testReadSingle(Book, Key, int) Return value of org.crosswire.jsword.book.BookData.getOsisFragment() Redundant null check at ReadEverything.java:[line 120]
|
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 74]
|
ST
|
Write to static field org.crosswire.jsword.versification.BibleNames.englishBibleNames from instance method new org.crosswire.jsword.versification.BibleNames() |
|
Bug type ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD (click for details)
In class org.crosswire.jsword.versification.BibleNames In method new org.crosswire.jsword.versification.BibleNames() Field org.crosswire.jsword.versification.BibleNames.englishBibleNames At BibleNames.java:[line 156]
|
This cast is unchecked, and not all instances of the type casted from can be cast to
the type it is being cast to. Check that your program logic ensures that this
cast will not fail.
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.
The code stores null into a local variable, and the stored value is not
read. This store may have been introduced to assist the garbage collector, but
as of Java SE 6.0, this is no longer needed or useful.
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.
A String is being converted to upper or lowercase, using the platform's default encoding. This may
result in improper conversions when used with international characters. Use the
- String.toUpperCase( Locale l )
- String.toLowerCase( Locale l )
versions instead.
Calling String.toString()
is just a redundant operation.
Just use the String.
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.
This class overrides equals(Object)
, but does not
override hashCode()
. Therefore, the class may violate the
invariant that equal objects must have equal hashcodes.
This code performs integer multiply and then converts the result to a long,
as in:
long convertDaysToMilliseconds(int days) { return 1000*3600*24*days; }
If the multiplication is done using long arithmetic, you can avoid
the possibility that the result will overflow. For example, you
could fix the above code to:
long convertDaysToMilliseconds(int days) { return 1000L*3600*24*days; }
or
static final long MILLISECONDS_PER_DAY = 24L*3600*1000;
long convertDaysToMilliseconds(int days) { return days * MILLISECONDS_PER_DAY; }
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,
- The class is not annotated as javax.annotation.concurrent.NotThreadSafe,
- 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 referenced methods have names that differ only by capitalization.
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).
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.
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.
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();
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.
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.
The class's static initializer creates an instance of the class
before all of the static final fields are assigned.
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
made into a static inner class. Since anonymous inner
classes cannot be marked as static, doing this will require refactoring
the inner class so that it is a named inner class.
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
made static.
This instance method writes to a static field. This is tricky to get
correct if multiple instances are being manipulated,
and generally bad practice.
This private method is never called. Although it is
possible that the method will be invoked through reflection,
it is more likely that the method is never used, and should be
removed.