FindBugs Report

Project Information

Project: JSword/BibleDesktop

FindBugs version: 1.3.9

Code analyzed:



Metrics

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

Metric Total Density*
High Priority Warnings 2 0.06
Medium Priority Warnings 2 0.06
Low Priority Warnings 7 0.22
Total Warnings 11 0.35

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



Contents

Summary

Warning Type Number
Bad practice Warnings 1
Correctness Warnings 2
Performance Warnings 1
Dodgy Warnings 7
Total 11

Warnings

Click on a warning row to see full context information.

Bad practice Warnings

Code Warning
Se Class org.crosswire.bibledesktop.desktop.Desktop defines non-transient non-serializable instance field actions

Correctness Warnings

Code Warning
NP Non-virtual method call in new org.crosswire.jsword.versification.system.SystemLeningrad() passes null for nonnull parameter of new org.crosswire.jsword.versification.Versification(String, BibleBook[], BibleBook[], int[][], int[][])
NP Non-virtual method call in new org.crosswire.jsword.versification.system.SystemMT() passes null for nonnull parameter of new org.crosswire.jsword.versification.Versification(String, BibleBook[], BibleBook[], int[][], int[][])

Performance Warnings

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

Dodgy Warnings

Code Warning
ICAST Result of integer multiplication cast to long in org.crosswire.jsword.book.sword.ZVerseBackend.contains(Key)
ICAST Result of integer multiplication cast to long in org.crosswire.jsword.book.sword.ZVerseBackend.getRawText(Key)
NP Load of known null value in org.crosswire.bibledesktop.passage.WholeBibleTreeNode.getNode(TreeNode, BibleBook, int, int)
RCN Redundant nullcheck of loc, which is known to be non-null in org.crosswire.jsword.book.sword.AbstractBackend.getExpandedDataPath()
RCN Redundant nullcheck of loc, which is known to be non-null in org.crosswire.jsword.book.sword.TreeKeyIndex.getExpandedDataPath()
UwF ViewManager.contextActions not initialized in constructor
UwF ViewManager.panel not initialized in constructor

Details

ICAST_INTEGER_MULTIPLY_CAST_TO_LONG: Result of integer multiplication cast to long

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; } 

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_PARAM_DEREF_NONVIRTUAL: Non-virtual method call passes null for nonnull parameter

A possibly-null value is passed to a nonnull method parameter. Either the parameter is annotated as a parameter that should always be nonnull, or analysis has shown that it will always be dereferenced.

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.

SE_BAD_FIELD: Non-transient non-serializable instance field in serializable class

This Serializable class defines a non-primitive instance field which is neither transient, Serializable, or java.lang.Object, and does not appear to implement the Externalizable interface or the readObject() and writeObject() methods.  Objects of this class will not be deserialized correctly if a non-Serializable object is stored in this field.

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.

UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR: Field not initialized in constructor

This field is never initialized within any constructor, and is therefore could be null after the object is constructed. This could be a either an error or a questionable design, since it means a null pointer exception will be generated if that field is dereferenced before being initialized.