FindBugs Report

Project Information

Project: JSword/BibleDesktop

FindBugs version: 2.0.0

Code analyzed:



Metrics

31828 lines of code analyzed, in 816 classes, in 51 packages.

Metric Total Density*
High Priority Warnings 8 0.25
Medium Priority Warnings 3 0.09
Total Warnings 11 0.35

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



Contents

Summary

Warning Type Number
Bad practice Warnings 2
Internationalization Warnings 8
Performance Warnings 1
Total 11

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)
Se The field org.crosswire.jsword.book.basic.DefaultBookmark.books is transient but isn't set by deserialization

Internationalization Warnings

Code Warning
Dm Found reliance on default encoding in org.crosswire.bibledesktop.book.BibleViewPane.open(): new java.io.FileReader(File)
Dm Found reliance on default encoding in org.crosswire.bibledesktop.book.BibleViewPane.saveKey(Key): new java.io.FileWriter(File)
Dm Found reliance on default encoding in org.crosswire.common.swing.ExceptionPane$CustomLister.valueChanged(ListSelectionEvent): new java.io.FileReader(File)
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(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)

Performance Warnings

Code Warning
SIC Should org.crosswire.bibledesktop.passage.WholeBibleTreeNode$WholeBibleEnumeration be a _static_ inner class?

Details

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.

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.

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.

SIC_INNER_SHOULD_BE_STATIC: Should be a static 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.