| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
g/TR/html4/loose.dtd"> | 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
g/TR/html4/loose.dtd"> |
| 2 <html><head><title>FindBugs Bug Descriptions (Unabridged)</title> | 2 <html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 3 <title>FindBugs Bug Descriptions (Unabridged)</title> |
| 3 <link rel="stylesheet" type="text/css" href="findbugs.css"/> | 4 <link rel="stylesheet" type="text/css" href="findbugs.css"/> |
| 4 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/> | 5 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/> |
| 5 </head><body> | 6 </head><body> |
| 6 | 7 |
| 7 <table width="100%"><tr> | 8 <table width="100%"><tr> |
| 8 | 9 |
| 9 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%"> | 10 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%"> |
| 10 <table width="100%" cellspacing="0" border="0"> | 11 <table width="100%" cellspacing="0" border="0"> |
| 11 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="Fin
dBugs"></a></td></tr> | 12 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="Fin
dBugs"></a></td></tr> |
| 12 | 13 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 32 | 33 |
| 33 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr> | 34 <tr><td><a class="sidebar" href="downloads.html"><b>Downloads</b></a></td></tr> |
| 34 | 35 |
| 35 <tr><td> </td></tr> | 36 <tr><td> </td></tr> |
| 36 | 37 |
| 37 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs
Swag</b></a></td></tr> | 38 <tr><td><a class="sidebar" href="http://www.cafeshops.com/findbugs"><b>FindBugs
Swag</b></a></td></tr> |
| 38 | 39 |
| 39 <tr><td> </td></tr> | 40 <tr><td> </td></tr> |
| 40 | 41 |
| 41 <tr><td><b>Development</b></td></tr> | 42 <tr><td><b>Development</b></td></tr> |
| 42 <tr><td><font size="-1"> <a class="sidebar" href="http://sourceforge.net/tr
acker/?group_id=96405">Open bugs</a></font></td></tr> | 43 <tr><td><font size="-1"> <a class="sidebar" href="http://sourceforge.net/p/
findbugs/bugs/">Open bugs</a></font></td></tr> |
| 43 <tr><td><font size="-1"> <a class="sidebar" href="reportingBugs.html">Repor
ting bugs</a></font></td></tr> | 44 <tr><td><font size="-1"> <a class="sidebar" href="reportingBugs.html">Repor
ting bugs</a></font></td></tr> |
| 44 <tr><td><font size="-1"> <a class="sidebar" href="contributing.html">Contri
buting</a></font></td></tr> | 45 <tr><td><font size="-1"> <a class="sidebar" href="contributing.html">Contri
buting</a></font></td></tr> |
| 45 <tr><td><font size="-1"> <a class="sidebar" href="team.html">Dev team</a></
font></td></tr> | 46 <tr><td><font size="-1"> <a class="sidebar" href="team.html">Dev team</a></
font></td></tr> |
| 46 <tr><td><font size="-1"> <a class="sidebar" href="api/index.html">API</a> <
a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></
tr> | 47 <tr><td><font size="-1"> <a class="sidebar" href="api/index.html">API</a> <
a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></
tr> |
| 47 <tr><td><font size="-1"> <a class="sidebar" href="Changes.html">Change log<
/a></font></td></tr> | 48 <tr><td><font size="-1"> <a class="sidebar" href="Changes.html">Change log<
/a></font></td></tr> |
| 48 <tr><td><font size="-1"> <a class="sidebar" href="http://sourceforge.net/pr
ojects/findbugs">SF project page</a></font></td></tr> | 49 <tr><td><font size="-1"> <a class="sidebar" href="http://sourceforge.net/pr
ojects/findbugs">SF project page</a></font></td></tr> |
| 49 <tr><td><font size="-1"> <a class="sidebar" href="http://code.google.com/p/
findbugs/source/browse/">Browse source</a></font></td></tr> | 50 <tr><td><font size="-1"> <a class="sidebar" href="http://code.google.com/p/
findbugs/source/browse/">Browse source</a></font></td></tr> |
| 50 <tr><td><font size="-1"> <a class="sidebar" href="http://code.google.com/p/
findbugs/source/list">Latest code changes</a></font></td></tr> | 51 <tr><td><font size="-1"> <a class="sidebar" href="http://code.google.com/p/
findbugs/source/list">Latest code changes</a></font></td></tr> |
| 51 </table> | 52 </table> |
| 52 </td> | 53 </td> |
| 53 <td align="left" valign="top"> | 54 <td align="left" valign="top"> |
| 54 <h1>FindBugs Bug Descriptions (Unabridged)</h1> | 55 <h1>FindBugs Bug Descriptions (Unabridged)</h1> |
| 55 <p>This document lists all of the bug patterns reported by the | 56 <p>This document lists all of the bug patterns reported by the |
| 56 latest development version of | 57 latest development version of |
| 57 <a href="http://findbugs.sourceforge.net">FindBugs</a>. Note that this may
include | 58 <a href="http://findbugs.sourceforge.net">FindBugs</a>. Note that this may
include |
| 58 bug patterns not available in any released version of FindBugs, | 59 bug patterns not available in any released version of FindBugs, |
| 59 as well as bug patterns that are not enabled by default. | 60 as well as bug patterns that are not enabled by default. |
| 60 <h2>Summary</h2> | 61 <h2>Summary</h2> |
| 61 <table width="100%"> | 62 <table width="100%"> |
| 62 <tr bgcolor="#b9b9fe"><th>Description</th><th>Category</th></tr> | 63 <tr bgcolor="#b9b9fe"><th>Description</th><th>Category</th></tr> |
| 63 <tr bgcolor="#eeeeee"><td><a href="#AM_CREATES_EMPTY_JAR_FILE_ENTRY">AM: Creates
an empty jar file entry</a></td><td>Bad practice</td></tr> | 64 <tr bgcolor="#eeeeee"><td><a href="#AM_CREATES_EMPTY_JAR_FILE_ENTRY">AM: Creates
an empty jar file entry</a></td><td>Bad practice</td></tr> |
| 64 <tr bgcolor="#ffffff"><td><a href="#AM_CREATES_EMPTY_ZIP_FILE_ENTRY">AM: Creates
an empty zip file entry</a></td><td>Bad practice</td></tr> | 65 <tr bgcolor="#ffffff"><td><a href="#AM_CREATES_EMPTY_ZIP_FILE_ENTRY">AM: Creates
an empty zip file entry</a></td><td>Bad practice</td></tr> |
| 65 <tr bgcolor="#eeeeee"><td><a href="#BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS
">BC: Equals method should not assume anything about the type of its argument</a
></td><td>Bad practice</td></tr> | 66 <tr bgcolor="#eeeeee"><td><a href="#BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS
">BC: Equals method should not assume anything about the type of its argument</a
></td><td>Bad practice</td></tr> |
| 66 <tr bgcolor="#ffffff"><td><a href="#BIT_SIGNED_CHECK">BIT: Check for sign of bit
wise operation</a></td><td>Bad practice</td></tr> | 67 <tr bgcolor="#ffffff"><td><a href="#BIT_SIGNED_CHECK">BIT: Check for sign of bit
wise operation</a></td><td>Bad practice</td></tr> |
| 67 <tr bgcolor="#eeeeee"><td><a href="#CN_IDIOM">CN: Class implements Cloneable but
does not define or use clone method</a></td><td>Bad practice</td></tr> | 68 <tr bgcolor="#eeeeee"><td><a href="#CN_IDIOM">CN: Class implements Cloneable but
does not define or use clone method</a></td><td>Bad practice</td></tr> |
| 68 <tr bgcolor="#ffffff"><td><a href="#CN_IDIOM_NO_SUPER_CALL">CN: clone method doe
s not call super.clone()</a></td><td>Bad practice</td></tr> | 69 <tr bgcolor="#ffffff"><td><a href="#CN_IDIOM_NO_SUPER_CALL">CN: clone method doe
s not call super.clone()</a></td><td>Bad practice</td></tr> |
| 69 <tr bgcolor="#eeeeee"><td><a href="#CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE">CN: C
lass defines clone() but doesn't implement Cloneable</a></td><td>Bad practice</t
d></tr> | 70 <tr bgcolor="#eeeeee"><td><a href="#CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE">CN: C
lass defines clone() but doesn't implement Cloneable</a></td><td>Bad practice</t
d></tr> |
| 70 <tr bgcolor="#ffffff"><td><a href="#CNT_ROUGH_CONSTANT_VALUE">CNT: Rough value o
f known constant found</a></td><td>Bad practice</td></tr> | 71 <tr bgcolor="#ffffff"><td><a href="#CNT_ROUGH_CONSTANT_VALUE">CNT: Rough value o
f known constant found</a></td><td>Bad practice</td></tr> |
| 71 <tr bgcolor="#eeeeee"><td><a href="#CO_ABSTRACT_SELF">Co: Abstract class defines
covariant compareTo() method</a></td><td>Bad practice</td></tr> | 72 <tr bgcolor="#eeeeee"><td><a href="#CO_ABSTRACT_SELF">Co: Abstract class defines
covariant compareTo() method</a></td><td>Bad practice</td></tr> |
| 73 <tr bgcolor="#ffffff"><td><a href="#CO_COMPARETO_INCORRECT_FLOATING">Co: compare
To()/compare() incorrectly handles float or double value</a></td><td>Bad practic
e</td></tr> |
| 74 <tr bgcolor="#eeeeee"><td><a href="#CO_COMPARETO_RESULTS_MIN_VALUE">Co: compareT
o()/compare() returns Integer.MIN_VALUE</a></td><td>Bad practice</td></tr> |
| 72 <tr bgcolor="#ffffff"><td><a href="#CO_SELF_NO_OBJECT">Co: Covariant compareTo()
method defined</a></td><td>Bad practice</td></tr> | 75 <tr bgcolor="#ffffff"><td><a href="#CO_SELF_NO_OBJECT">Co: Covariant compareTo()
method defined</a></td><td>Bad practice</td></tr> |
| 73 <tr bgcolor="#eeeeee"><td><a href="#DE_MIGHT_DROP">DE: Method might drop excepti
on</a></td><td>Bad practice</td></tr> | 76 <tr bgcolor="#eeeeee"><td><a href="#DE_MIGHT_DROP">DE: Method might drop excepti
on</a></td><td>Bad practice</td></tr> |
| 74 <tr bgcolor="#ffffff"><td><a href="#DE_MIGHT_IGNORE">DE: Method might ignore exc
eption</a></td><td>Bad practice</td></tr> | 77 <tr bgcolor="#ffffff"><td><a href="#DE_MIGHT_IGNORE">DE: Method might ignore exc
eption</a></td><td>Bad practice</td></tr> |
| 75 <tr bgcolor="#eeeeee"><td><a href="#DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS">DMI:
Adding elements of an entry set may fail due to reuse of Entry objects</a></td>
<td>Bad practice</td></tr> | 78 <tr bgcolor="#eeeeee"><td><a href="#DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS">DMI:
Adding elements of an entry set may fail due to reuse of Entry objects</a></td>
<td>Bad practice</td></tr> |
| 76 <tr bgcolor="#ffffff"><td><a href="#DMI_RANDOM_USED_ONLY_ONCE">DMI: Random objec
t created and used only once</a></td><td>Bad practice</td></tr> | 79 <tr bgcolor="#ffffff"><td><a href="#DMI_RANDOM_USED_ONLY_ONCE">DMI: Random objec
t created and used only once</a></td><td>Bad practice</td></tr> |
| 77 <tr bgcolor="#eeeeee"><td><a href="#DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION">DMI
: Don't use removeAll to clear a collection</a></td><td>Bad practice</td></tr> | 80 <tr bgcolor="#eeeeee"><td><a href="#DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION">DMI
: Don't use removeAll to clear a collection</a></td><td>Bad practice</td></tr> |
| 78 <tr bgcolor="#ffffff"><td><a href="#DM_EXIT">Dm: Method invokes System.exit(...)
</a></td><td>Bad practice</td></tr> | 81 <tr bgcolor="#ffffff"><td><a href="#DM_EXIT">Dm: Method invokes System.exit(...)
</a></td><td>Bad practice</td></tr> |
| 79 <tr bgcolor="#eeeeee"><td><a href="#DM_RUN_FINALIZERS_ON_EXIT">Dm: Method invoke
s dangerous method runFinalizersOnExit</a></td><td>Bad practice</td></tr> | 82 <tr bgcolor="#eeeeee"><td><a href="#DM_RUN_FINALIZERS_ON_EXIT">Dm: Method invoke
s dangerous method runFinalizersOnExit</a></td><td>Bad practice</td></tr> |
| 80 <tr bgcolor="#ffffff"><td><a href="#ES_COMPARING_PARAMETER_STRING_WITH_EQ">ES: C
omparison of String parameter using == or !=</a></td><td>Bad practice</td></tr> | 83 <tr bgcolor="#ffffff"><td><a href="#ES_COMPARING_PARAMETER_STRING_WITH_EQ">ES: C
omparison of String parameter using == or !=</a></td><td>Bad practice</td></tr> |
| 81 <tr bgcolor="#eeeeee"><td><a href="#ES_COMPARING_STRINGS_WITH_EQ">ES: Comparison
of String objects using == or !=</a></td><td>Bad practice</td></tr> | 84 <tr bgcolor="#eeeeee"><td><a href="#ES_COMPARING_STRINGS_WITH_EQ">ES: Comparison
of String objects using == or !=</a></td><td>Bad practice</td></tr> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 97 <tr bgcolor="#eeeeee"><td><a href="#HE_EQUALS_USE_HASHCODE">HE: Class defines eq
uals() and uses Object.hashCode()</a></td><td>Bad practice</td></tr> | 100 <tr bgcolor="#eeeeee"><td><a href="#HE_EQUALS_USE_HASHCODE">HE: Class defines eq
uals() and uses Object.hashCode()</a></td><td>Bad practice</td></tr> |
| 98 <tr bgcolor="#ffffff"><td><a href="#HE_HASHCODE_NO_EQUALS">HE: Class defines has
hCode() but not equals()</a></td><td>Bad practice</td></tr> | 101 <tr bgcolor="#ffffff"><td><a href="#HE_HASHCODE_NO_EQUALS">HE: Class defines has
hCode() but not equals()</a></td><td>Bad practice</td></tr> |
| 99 <tr bgcolor="#eeeeee"><td><a href="#HE_HASHCODE_USE_OBJECT_EQUALS">HE: Class def
ines hashCode() and uses Object.equals()</a></td><td>Bad practice</td></tr> | 102 <tr bgcolor="#eeeeee"><td><a href="#HE_HASHCODE_USE_OBJECT_EQUALS">HE: Class def
ines hashCode() and uses Object.equals()</a></td><td>Bad practice</td></tr> |
| 100 <tr bgcolor="#ffffff"><td><a href="#HE_INHERITS_EQUALS_USE_HASHCODE">HE: Class i
nherits equals() and uses Object.hashCode()</a></td><td>Bad practice</td></tr> | 103 <tr bgcolor="#ffffff"><td><a href="#HE_INHERITS_EQUALS_USE_HASHCODE">HE: Class i
nherits equals() and uses Object.hashCode()</a></td><td>Bad practice</td></tr> |
| 101 <tr bgcolor="#eeeeee"><td><a href="#IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZ
ATION">IC: Superclass uses subclass during initialization</a></td><td>Bad practi
ce</td></tr> | 104 <tr bgcolor="#eeeeee"><td><a href="#IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZ
ATION">IC: Superclass uses subclass during initialization</a></td><td>Bad practi
ce</td></tr> |
| 102 <tr bgcolor="#ffffff"><td><a href="#IMSE_DONT_CATCH_IMSE">IMSE: Dubious catching
of IllegalMonitorStateException</a></td><td>Bad practice</td></tr> | 105 <tr bgcolor="#ffffff"><td><a href="#IMSE_DONT_CATCH_IMSE">IMSE: Dubious catching
of IllegalMonitorStateException</a></td><td>Bad practice</td></tr> |
| 103 <tr bgcolor="#eeeeee"><td><a href="#ISC_INSTANTIATE_STATIC_CLASS">ISC: Needless
instantiation of class that only supplies static methods</a></td><td>Bad practic
e</td></tr> | 106 <tr bgcolor="#eeeeee"><td><a href="#ISC_INSTANTIATE_STATIC_CLASS">ISC: Needless
instantiation of class that only supplies static methods</a></td><td>Bad practic
e</td></tr> |
| 104 <tr bgcolor="#ffffff"><td><a href="#IT_NO_SUCH_ELEMENT">It: Iterator next() meth
od can't throw NoSuchElementException</a></td><td>Bad practice</td></tr> | 107 <tr bgcolor="#ffffff"><td><a href="#IT_NO_SUCH_ELEMENT">It: Iterator next() meth
od can't throw NoSuchElementException</a></td><td>Bad practice</td></tr> |
| 105 <tr bgcolor="#eeeeee"><td><a href="#J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_S
ESSION">J2EE: Store of non serializable object into HttpSession</a></td><td>Bad
practice</td></tr> | 108 <tr bgcolor="#eeeeee"><td><a href="#J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_S
ESSION">J2EE: Store of non serializable object into HttpSession</a></td><td>Bad
practice</td></tr> |
| 106 <tr bgcolor="#ffffff"><td><a href="#JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS">JC
IP: Fields of immutable classes should be final</a></td><td>Bad practice</td></t
r> | 109 <tr bgcolor="#ffffff"><td><a href="#JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS">JC
IP: Fields of immutable classes should be final</a></td><td>Bad practice</td></t
r> |
| 110 <tr bgcolor="#eeeeee"><td><a href="#ME_ENUM_FIELD_SETTER">ME: Public enum method
unconditionally sets its field</a></td><td>Bad practice</td></tr> |
| 111 <tr bgcolor="#ffffff"><td><a href="#ME_MUTABLE_ENUM_FIELD">ME: Enum field is pub
lic and mutable</a></td><td>Bad practice</td></tr> |
| 107 <tr bgcolor="#eeeeee"><td><a href="#NP_BOOLEAN_RETURN_NULL">NP: Method with Bool
ean return type returns explicit null</a></td><td>Bad practice</td></tr> | 112 <tr bgcolor="#eeeeee"><td><a href="#NP_BOOLEAN_RETURN_NULL">NP: Method with Bool
ean return type returns explicit null</a></td><td>Bad practice</td></tr> |
| 108 <tr bgcolor="#ffffff"><td><a href="#NP_CLONE_COULD_RETURN_NULL">NP: Clone method
may return null</a></td><td>Bad practice</td></tr> | 113 <tr bgcolor="#ffffff"><td><a href="#NP_CLONE_COULD_RETURN_NULL">NP: Clone method
may return null</a></td><td>Bad practice</td></tr> |
| 109 <tr bgcolor="#eeeeee"><td><a href="#NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT">NP: e
quals() method does not check for null argument</a></td><td>Bad practice</td></t
r> | 114 <tr bgcolor="#eeeeee"><td><a href="#NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT">NP: e
quals() method does not check for null argument</a></td><td>Bad practice</td></t
r> |
| 110 <tr bgcolor="#ffffff"><td><a href="#NP_TOSTRING_COULD_RETURN_NULL">NP: toString
method may return null</a></td><td>Bad practice</td></tr> | 115 <tr bgcolor="#ffffff"><td><a href="#NP_TOSTRING_COULD_RETURN_NULL">NP: toString
method may return null</a></td><td>Bad practice</td></tr> |
| 111 <tr bgcolor="#eeeeee"><td><a href="#NM_CLASS_NAMING_CONVENTION">Nm: Class names
should start with an upper case letter</a></td><td>Bad practice</td></tr> | 116 <tr bgcolor="#eeeeee"><td><a href="#NM_CLASS_NAMING_CONVENTION">Nm: Class names
should start with an upper case letter</a></td><td>Bad practice</td></tr> |
| 112 <tr bgcolor="#ffffff"><td><a href="#NM_CLASS_NOT_EXCEPTION">Nm: Class is not der
ived from an Exception, even though it is named as such</a></td><td>Bad practice
</td></tr> | 117 <tr bgcolor="#ffffff"><td><a href="#NM_CLASS_NOT_EXCEPTION">Nm: Class is not der
ived from an Exception, even though it is named as such</a></td><td>Bad practice
</td></tr> |
| 113 <tr bgcolor="#eeeeee"><td><a href="#NM_CONFUSING">Nm: Confusing method names</a>
</td><td>Bad practice</td></tr> | 118 <tr bgcolor="#eeeeee"><td><a href="#NM_CONFUSING">Nm: Confusing method names</a>
</td><td>Bad practice</td></tr> |
| 114 <tr bgcolor="#ffffff"><td><a href="#NM_FIELD_NAMING_CONVENTION">Nm: Field names
should start with a lower case letter</a></td><td>Bad practice</td></tr> | 119 <tr bgcolor="#ffffff"><td><a href="#NM_FIELD_NAMING_CONVENTION">Nm: Field names
should start with a lower case letter</a></td><td>Bad practice</td></tr> |
| 115 <tr bgcolor="#eeeeee"><td><a href="#NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER">Nm: Us
e of identifier that is a keyword in later versions of Java</a></td><td>Bad prac
tice</td></tr> | 120 <tr bgcolor="#eeeeee"><td><a href="#NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER">Nm: Us
e of identifier that is a keyword in later versions of Java</a></td><td>Bad prac
tice</td></tr> |
| 116 <tr bgcolor="#ffffff"><td><a href="#NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER"
>Nm: Use of identifier that is a keyword in later versions of Java</a></td><td>B
ad practice</td></tr> | 121 <tr bgcolor="#ffffff"><td><a href="#NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER"
>Nm: Use of identifier that is a keyword in later versions of Java</a></td><td>B
ad practice</td></tr> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 <tr bgcolor="#eeeeee"><td><a href="#BC_IMPOSSIBLE_DOWNCAST">BC: Impossible downc
ast</a></td><td>Correctness</td></tr> | 156 <tr bgcolor="#eeeeee"><td><a href="#BC_IMPOSSIBLE_DOWNCAST">BC: Impossible downc
ast</a></td><td>Correctness</td></tr> |
| 152 <tr bgcolor="#ffffff"><td><a href="#BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY">BC: Impos
sible downcast of toArray() result</a></td><td>Correctness</td></tr> | 157 <tr bgcolor="#ffffff"><td><a href="#BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY">BC: Impos
sible downcast of toArray() result</a></td><td>Correctness</td></tr> |
| 153 <tr bgcolor="#eeeeee"><td><a href="#BC_IMPOSSIBLE_INSTANCEOF">BC: instanceof wil
l always return false</a></td><td>Correctness</td></tr> | 158 <tr bgcolor="#eeeeee"><td><a href="#BC_IMPOSSIBLE_INSTANCEOF">BC: instanceof wil
l always return false</a></td><td>Correctness</td></tr> |
| 154 <tr bgcolor="#ffffff"><td><a href="#BIT_ADD_OF_SIGNED_BYTE">BIT: Bitwise add of
signed byte value</a></td><td>Correctness</td></tr> | 159 <tr bgcolor="#ffffff"><td><a href="#BIT_ADD_OF_SIGNED_BYTE">BIT: Bitwise add of
signed byte value</a></td><td>Correctness</td></tr> |
| 155 <tr bgcolor="#eeeeee"><td><a href="#BIT_AND">BIT: Incompatible bit masks</a></td
><td>Correctness</td></tr> | 160 <tr bgcolor="#eeeeee"><td><a href="#BIT_AND">BIT: Incompatible bit masks</a></td
><td>Correctness</td></tr> |
| 156 <tr bgcolor="#ffffff"><td><a href="#BIT_AND_ZZ">BIT: Check to see if ((...) & 0)
== 0</a></td><td>Correctness</td></tr> | 161 <tr bgcolor="#ffffff"><td><a href="#BIT_AND_ZZ">BIT: Check to see if ((...) & 0)
== 0</a></td><td>Correctness</td></tr> |
| 157 <tr bgcolor="#eeeeee"><td><a href="#BIT_IOR">BIT: Incompatible bit masks</a></td
><td>Correctness</td></tr> | 162 <tr bgcolor="#eeeeee"><td><a href="#BIT_IOR">BIT: Incompatible bit masks</a></td
><td>Correctness</td></tr> |
| 158 <tr bgcolor="#ffffff"><td><a href="#BIT_IOR_OF_SIGNED_BYTE">BIT: Bitwise OR of s
igned byte value</a></td><td>Correctness</td></tr> | 163 <tr bgcolor="#ffffff"><td><a href="#BIT_IOR_OF_SIGNED_BYTE">BIT: Bitwise OR of s
igned byte value</a></td><td>Correctness</td></tr> |
| 159 <tr bgcolor="#eeeeee"><td><a href="#BIT_SIGNED_CHECK_HIGH_BIT">BIT: Check for si
gn of bitwise operation</a></td><td>Correctness</td></tr> | 164 <tr bgcolor="#eeeeee"><td><a href="#BIT_SIGNED_CHECK_HIGH_BIT">BIT: Check for si
gn of bitwise operation</a></td><td>Correctness</td></tr> |
| 160 <tr bgcolor="#ffffff"><td><a href="#BOA_BADLY_OVERRIDDEN_ADAPTER">BOA: Class ove
rrides a method implemented in super class Adapter wrongly</a></td><td>Correctne
ss</td></tr> | 165 <tr bgcolor="#ffffff"><td><a href="#BOA_BADLY_OVERRIDDEN_ADAPTER">BOA: Class ove
rrides a method implemented in super class Adapter wrongly</a></td><td>Correctne
ss</td></tr> |
| 161 <tr bgcolor="#eeeeee"><td><a href="#ICAST_BAD_SHIFT_AMOUNT">BSHIFT: 32 bit int s
hifted by an amount not in the range -31..31</a></td><td>Correctness</td></tr> | 166 <tr bgcolor="#eeeeee"><td><a href="#BSHIFT_WRONG_ADD_PRIORITY">BSHIFT: Possible
bad parsing of shift operation</a></td><td>Correctness</td></tr> |
| 162 <tr bgcolor="#ffffff"><td><a href="#BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR"
>Bx: Primitive value is unboxed and coerced for ternary operator</a></td><td>Cor
rectness</td></tr> | 167 <tr bgcolor="#ffffff"><td><a href="#ICAST_BAD_SHIFT_AMOUNT">BSHIFT: 32 bit int s
hifted by an amount not in the range -31..31</a></td><td>Correctness</td></tr> |
| 163 <tr bgcolor="#eeeeee"><td><a href="#CO_COMPARETO_RESULTS_MIN_VALUE">Co: compareT
o()/compare() returns Integer.MIN_VALUE</a></td><td>Correctness</td></tr> | 168 <tr bgcolor="#eeeeee"><td><a href="#CAA_COVARIANT_ARRAY_ELEMENT_STORE">CAA: Poss
ibly incompatible element is stored in covariant array</a></td><td>Correctness</
td></tr> |
| 164 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_LOCAL_INCREMENT_IN_RETURN">DLS: Use
less increment in return statement</a></td><td>Correctness</td></tr> | 169 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_LOCAL_INCREMENT_IN_RETURN">DLS: Use
less increment in return statement</a></td><td>Correctness</td></tr> |
| 165 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_STORE_OF_CLASS_LITERAL">DLS: Dead s
tore of class literal</a></td><td>Correctness</td></tr> | 170 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_STORE_OF_CLASS_LITERAL">DLS: Dead s
tore of class literal</a></td><td>Correctness</td></tr> |
| 166 <tr bgcolor="#ffffff"><td><a href="#DLS_OVERWRITTEN_INCREMENT">DLS: Overwritten
increment</a></td><td>Correctness</td></tr> | 171 <tr bgcolor="#ffffff"><td><a href="#DLS_OVERWRITTEN_INCREMENT">DLS: Overwritten
increment</a></td><td>Correctness</td></tr> |
| 167 <tr bgcolor="#eeeeee"><td><a href="#DMI_ARGUMENTS_WRONG_ORDER">DMI: Reversed met
hod arguments</a></td><td>Correctness</td></tr> | 172 <tr bgcolor="#eeeeee"><td><a href="#DMI_ARGUMENTS_WRONG_ORDER">DMI: Reversed met
hod arguments</a></td><td>Correctness</td></tr> |
| 168 <tr bgcolor="#ffffff"><td><a href="#DMI_BAD_MONTH">DMI: Bad constant value for m
onth</a></td><td>Correctness</td></tr> | 173 <tr bgcolor="#ffffff"><td><a href="#DMI_BAD_MONTH">DMI: Bad constant value for m
onth</a></td><td>Correctness</td></tr> |
| 169 <tr bgcolor="#eeeeee"><td><a href="#DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE">DMI:
BigDecimal constructed from double that isn't represented precisely</a></td><td
>Correctness</td></tr> | 174 <tr bgcolor="#eeeeee"><td><a href="#DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE">DMI:
BigDecimal constructed from double that isn't represented precisely</a></td><td
>Correctness</td></tr> |
| 170 <tr bgcolor="#ffffff"><td><a href="#DMI_CALLING_NEXT_FROM_HASNEXT">DMI: hasNext
method invokes next</a></td><td>Correctness</td></tr> | 175 <tr bgcolor="#ffffff"><td><a href="#DMI_CALLING_NEXT_FROM_HASNEXT">DMI: hasNext
method invokes next</a></td><td>Correctness</td></tr> |
| 171 <tr bgcolor="#eeeeee"><td><a href="#DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVE
S">DMI: Collections should not contain themselves</a></td><td>Correctness</td></
tr> | 176 <tr bgcolor="#eeeeee"><td><a href="#DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVE
S">DMI: Collections should not contain themselves</a></td><td>Correctness</td></
tr> |
| 172 <tr bgcolor="#ffffff"><td><a href="#DMI_DOH">DMI: D'oh! A nonsensical method inv
ocation</a></td><td>Correctness</td></tr> | 177 <tr bgcolor="#ffffff"><td><a href="#DMI_DOH">DMI: D'oh! A nonsensical method inv
ocation</a></td><td>Correctness</td></tr> |
| 173 <tr bgcolor="#eeeeee"><td><a href="#DMI_INVOKING_HASHCODE_ON_ARRAY">DMI: Invocat
ion of hashCode on an array</a></td><td>Correctness</td></tr> | 178 <tr bgcolor="#eeeeee"><td><a href="#DMI_INVOKING_HASHCODE_ON_ARRAY">DMI: Invocat
ion of hashCode on an array</a></td><td>Correctness</td></tr> |
| 174 <tr bgcolor="#ffffff"><td><a href="#DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INT">DMI:
Double.longBitsToDouble invoked on an int</a></td><td>Correctness</td></tr> | 179 <tr bgcolor="#ffffff"><td><a href="#DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INT">DMI:
Double.longBitsToDouble invoked on an int</a></td><td>Correctness</td></tr> |
| 175 <tr bgcolor="#eeeeee"><td><a href="#DMI_VACUOUS_SELF_COLLECTION_CALL">DMI: Vacuo
us call to collections</a></td><td>Correctness</td></tr> | 180 <tr bgcolor="#eeeeee"><td><a href="#DMI_VACUOUS_SELF_COLLECTION_CALL">DMI: Vacuo
us call to collections</a></td><td>Correctness</td></tr> |
| 176 <tr bgcolor="#ffffff"><td><a href="#DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION"
>Dm: Can't use reflection to check for presence of annotation without runtime re
tention</a></td><td>Correctness</td></tr> | 181 <tr bgcolor="#ffffff"><td><a href="#DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION"
>Dm: Can't use reflection to check for presence of annotation without runtime re
tention</a></td><td>Correctness</td></tr> |
| 177 <tr bgcolor="#eeeeee"><td><a href="#DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF
_SCHEDULED_THREAD_POOL_EXECUTOR">Dm: Futile attempt to change max pool size of S
cheduledThreadPoolExecutor</a></td><td>Correctness</td></tr> | 182 <tr bgcolor="#eeeeee"><td><a href="#DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF
_SCHEDULED_THREAD_POOL_EXECUTOR">Dm: Futile attempt to change max pool size of S
cheduledThreadPoolExecutor</a></td><td>Correctness</td></tr> |
| 178 <tr bgcolor="#ffffff"><td><a href="#DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO
_CORE_THREADS">Dm: Creation of ScheduledThreadPoolExecutor with zero core thread
s</a></td><td>Correctness</td></tr> | 183 <tr bgcolor="#ffffff"><td><a href="#DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO
_CORE_THREADS">Dm: Creation of ScheduledThreadPoolExecutor with zero core thread
s</a></td><td>Correctness</td></tr> |
| 179 <tr bgcolor="#eeeeee"><td><a href="#DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD">Dm: Use
less/vacuous call to EasyMock method</a></td><td>Correctness</td></tr> | 184 <tr bgcolor="#eeeeee"><td><a href="#DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD">Dm: Use
less/vacuous call to EasyMock method</a></td><td>Correctness</td></tr> |
| 180 <tr bgcolor="#ffffff"><td><a href="#EC_ARRAY_AND_NONARRAY">EC: equals() used to
compare array and nonarray</a></td><td>Correctness</td></tr> | 185 <tr bgcolor="#ffffff"><td><a href="#DM_INVALID_MIN_MAX">Dm: Incorrect combinatio
n of Math.max and Math.min</a></td><td>Correctness</td></tr> |
| 181 <tr bgcolor="#eeeeee"><td><a href="#EC_BAD_ARRAY_COMPARE">EC: Invocation of equa
ls() on an array, which is equivalent to ==</a></td><td>Correctness</td></tr> | 186 <tr bgcolor="#eeeeee"><td><a href="#EC_ARRAY_AND_NONARRAY">EC: equals() used to
compare array and nonarray</a></td><td>Correctness</td></tr> |
| 182 <tr bgcolor="#ffffff"><td><a href="#EC_INCOMPATIBLE_ARRAY_COMPARE">EC: equals(..
.) used to compare incompatible arrays</a></td><td>Correctness</td></tr> | 187 <tr bgcolor="#ffffff"><td><a href="#EC_BAD_ARRAY_COMPARE">EC: Invocation of equa
ls() on an array, which is equivalent to ==</a></td><td>Correctness</td></tr> |
| 183 <tr bgcolor="#eeeeee"><td><a href="#EC_NULL_ARG">EC: Call to equals(null)</a></t
d><td>Correctness</td></tr> | 188 <tr bgcolor="#eeeeee"><td><a href="#EC_INCOMPATIBLE_ARRAY_COMPARE">EC: equals(..
.) used to compare incompatible arrays</a></td><td>Correctness</td></tr> |
| 184 <tr bgcolor="#ffffff"><td><a href="#EC_UNRELATED_CLASS_AND_INTERFACE">EC: Call t
o equals() comparing unrelated class and interface</a></td><td>Correctness</td><
/tr> | 189 <tr bgcolor="#ffffff"><td><a href="#EC_NULL_ARG">EC: Call to equals(null)</a></t
d><td>Correctness</td></tr> |
| 185 <tr bgcolor="#eeeeee"><td><a href="#EC_UNRELATED_INTERFACES">EC: Call to equals(
) comparing different interface types</a></td><td>Correctness</td></tr> | 190 <tr bgcolor="#eeeeee"><td><a href="#EC_UNRELATED_CLASS_AND_INTERFACE">EC: Call t
o equals() comparing unrelated class and interface</a></td><td>Correctness</td><
/tr> |
| 186 <tr bgcolor="#ffffff"><td><a href="#EC_UNRELATED_TYPES">EC: Call to equals() com
paring different types</a></td><td>Correctness</td></tr> | 191 <tr bgcolor="#ffffff"><td><a href="#EC_UNRELATED_INTERFACES">EC: Call to equals(
) comparing different interface types</a></td><td>Correctness</td></tr> |
| 187 <tr bgcolor="#eeeeee"><td><a href="#EC_UNRELATED_TYPES_USING_POINTER_EQUALITY">E
C: Using pointer equality to compare different types</a></td><td>Correctness</td
></tr> | 192 <tr bgcolor="#eeeeee"><td><a href="#EC_UNRELATED_TYPES">EC: Call to equals() com
paring different types</a></td><td>Correctness</td></tr> |
| 188 <tr bgcolor="#ffffff"><td><a href="#EQ_ALWAYS_FALSE">Eq: equals method always re
turns false</a></td><td>Correctness</td></tr> | 193 <tr bgcolor="#ffffff"><td><a href="#EC_UNRELATED_TYPES_USING_POINTER_EQUALITY">E
C: Using pointer equality to compare different types</a></td><td>Correctness</td
></tr> |
| 189 <tr bgcolor="#eeeeee"><td><a href="#EQ_ALWAYS_TRUE">Eq: equals method always ret
urns true</a></td><td>Correctness</td></tr> | 194 <tr bgcolor="#eeeeee"><td><a href="#EQ_ALWAYS_FALSE">Eq: equals method always re
turns false</a></td><td>Correctness</td></tr> |
| 190 <tr bgcolor="#ffffff"><td><a href="#EQ_COMPARING_CLASS_NAMES">Eq: equals method
compares class names rather than class objects</a></td><td>Correctness</td></tr> | 195 <tr bgcolor="#ffffff"><td><a href="#EQ_ALWAYS_TRUE">Eq: equals method always ret
urns true</a></td><td>Correctness</td></tr> |
| 191 <tr bgcolor="#eeeeee"><td><a href="#EQ_DONT_DEFINE_EQUALS_FOR_ENUM">Eq: Covarian
t equals() method defined for enum</a></td><td>Correctness</td></tr> | 196 <tr bgcolor="#eeeeee"><td><a href="#EQ_COMPARING_CLASS_NAMES">Eq: equals method
compares class names rather than class objects</a></td><td>Correctness</td></tr> |
| 192 <tr bgcolor="#ffffff"><td><a href="#EQ_OTHER_NO_OBJECT">Eq: equals() method defi
ned that doesn't override equals(Object)</a></td><td>Correctness</td></tr> | 197 <tr bgcolor="#ffffff"><td><a href="#EQ_DONT_DEFINE_EQUALS_FOR_ENUM">Eq: Covarian
t equals() method defined for enum</a></td><td>Correctness</td></tr> |
| 193 <tr bgcolor="#eeeeee"><td><a href="#EQ_OTHER_USE_OBJECT">Eq: equals() method def
ined that doesn't override Object.equals(Object)</a></td><td>Correctness</td></t
r> | 198 <tr bgcolor="#eeeeee"><td><a href="#EQ_OTHER_NO_OBJECT">Eq: equals() method defi
ned that doesn't override equals(Object)</a></td><td>Correctness</td></tr> |
| 194 <tr bgcolor="#ffffff"><td><a href="#EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC">Eq: equa
ls method overrides equals in superclass and may not be symmetric</a></td><td>Co
rrectness</td></tr> | 199 <tr bgcolor="#ffffff"><td><a href="#EQ_OTHER_USE_OBJECT">Eq: equals() method def
ined that doesn't override Object.equals(Object)</a></td><td>Correctness</td></t
r> |
| 195 <tr bgcolor="#eeeeee"><td><a href="#EQ_SELF_USE_OBJECT">Eq: Covariant equals() m
ethod defined, Object.equals(Object) inherited</a></td><td>Correctness</td></tr> | 200 <tr bgcolor="#eeeeee"><td><a href="#EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC">Eq: equa
ls method overrides equals in superclass and may not be symmetric</a></td><td>Co
rrectness</td></tr> |
| 196 <tr bgcolor="#ffffff"><td><a href="#FB_MISSING_EXPECTED_WARNING">FB: Missing exp
ected or desired warning from FindBugs</a></td><td>Correctness</td></tr> | 201 <tr bgcolor="#ffffff"><td><a href="#EQ_SELF_USE_OBJECT">Eq: Covariant equals() m
ethod defined, Object.equals(Object) inherited</a></td><td>Correctness</td></tr> |
| 197 <tr bgcolor="#eeeeee"><td><a href="#FB_UNEXPECTED_WARNING">FB: Unexpected/undesi
red warning from FindBugs</a></td><td>Correctness</td></tr> | 202 <tr bgcolor="#eeeeee"><td><a href="#FB_MISSING_EXPECTED_WARNING">FB: Missing exp
ected or desired warning from FindBugs</a></td><td>Correctness</td></tr> |
| 198 <tr bgcolor="#ffffff"><td><a href="#FE_TEST_IF_EQUAL_TO_NOT_A_NUMBER">FE: Doomed
test for equality to NaN</a></td><td>Correctness</td></tr> | 203 <tr bgcolor="#ffffff"><td><a href="#FB_UNEXPECTED_WARNING">FB: Unexpected/undesi
red warning from FindBugs</a></td><td>Correctness</td></tr> |
| 199 <tr bgcolor="#eeeeee"><td><a href="#FL_MATH_USING_FLOAT_PRECISION">FL: Method pe
rforms math using floating point precision</a></td><td>Correctness</td></tr> | 204 <tr bgcolor="#eeeeee"><td><a href="#FE_TEST_IF_EQUAL_TO_NOT_A_NUMBER">FE: Doomed
test for equality to NaN</a></td><td>Correctness</td></tr> |
| 200 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_BAD_ARGUMENT">FS: Format st
ring placeholder incompatible with passed argument</a></td><td>Correctness</td><
/tr> | 205 <tr bgcolor="#ffffff"><td><a href="#FL_MATH_USING_FLOAT_PRECISION">FL: Method pe
rforms math using floating point precision</a></td><td>Correctness</td></tr> |
| 201 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_BAD_CONVERSION">FS: The typ
e of a supplied argument doesn't match format specifier</a></td><td>Correctness<
/td></tr> | 206 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_BAD_ARGUMENT">FS: Format st
ring placeholder incompatible with passed argument</a></td><td>Correctness</td><
/tr> |
| 202 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUP
PLIED">FS: MessageFormat supplied where printf style format expected</a></td><td
>Correctness</td></tr> | 207 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_BAD_CONVERSION">FS: The typ
e of a supplied argument doesn't match format specifier</a></td><td>Correctness<
/td></tr> |
| 203 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED">FS:
More arguments are passed than are actually used in the format string</a></td><
td>Correctness</td></tr> | 208 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_EXPECTED_MESSAGE_FORMAT_SUP
PLIED">FS: MessageFormat supplied where printf style format expected</a></td><td
>Correctness</td></tr> |
| 204 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_ILLEGAL">FS: Illegal format
string</a></td><td>Correctness</td></tr> | 209 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_EXTRA_ARGUMENTS_PASSED">FS:
More arguments are passed than are actually used in the format string</a></td><
td>Correctness</td></tr> |
| 205 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_MISSING_ARGUMENT">FS: Forma
t string references missing argument</a></td><td>Correctness</td></tr> | 210 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_ILLEGAL">FS: Illegal format
string</a></td><td>Correctness</td></tr> |
| 206 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT">FS: N
o previous argument for format string</a></td><td>Correctness</td></tr> | 211 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_MISSING_ARGUMENT">FS: Forma
t string references missing argument</a></td><td>Correctness</td></tr> |
| 207 <tr bgcolor="#eeeeee"><td><a href="#GC_UNRELATED_TYPES">GC: No relationship betw
een generic parameter and method argument</a></td><td>Correctness</td></tr> | 212 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_NO_PREVIOUS_ARGUMENT">FS: N
o previous argument for format string</a></td><td>Correctness</td></tr> |
| 208 <tr bgcolor="#ffffff"><td><a href="#HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_
CLASS">HE: Signature declares use of unhashable class in hashed construct</a></t
d><td>Correctness</td></tr> | 213 <tr bgcolor="#ffffff"><td><a href="#GC_UNRELATED_TYPES">GC: No relationship betw
een generic parameter and method argument</a></td><td>Correctness</td></tr> |
| 209 <tr bgcolor="#eeeeee"><td><a href="#HE_USE_OF_UNHASHABLE_CLASS">HE: Use of class
without a hashCode() method in a hashed data structure</a></td><td>Correctness<
/td></tr> | 214 <tr bgcolor="#eeeeee"><td><a href="#HE_SIGNATURE_DECLARES_HASHING_OF_UNHASHABLE_
CLASS">HE: Signature declares use of unhashable class in hashed construct</a></t
d><td>Correctness</td></tr> |
| 210 <tr bgcolor="#ffffff"><td><a href="#ICAST_INT_2_LONG_AS_INSTANT">ICAST: int valu
e converted to long and used as absolute time</a></td><td>Correctness</td></tr> | 215 <tr bgcolor="#ffffff"><td><a href="#HE_USE_OF_UNHASHABLE_CLASS">HE: Use of class
without a hashCode() method in a hashed data structure</a></td><td>Correctness<
/td></tr> |
| 211 <tr bgcolor="#eeeeee"><td><a href="#ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL">ICA
ST: Integral value cast to double and then passed to Math.ceil</a></td><td>Corre
ctness</td></tr> | 216 <tr bgcolor="#eeeeee"><td><a href="#ICAST_INT_2_LONG_AS_INSTANT">ICAST: int valu
e converted to long and used as absolute time</a></td><td>Correctness</td></tr> |
| 212 <tr bgcolor="#ffffff"><td><a href="#ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND">ICA
ST: int value cast to float and then passed to Math.round</a></td><td>Correctnes
s</td></tr> | 217 <tr bgcolor="#ffffff"><td><a href="#ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL">ICA
ST: Integral value cast to double and then passed to Math.ceil</a></td><td>Corre
ctness</td></tr> |
| 213 <tr bgcolor="#eeeeee"><td><a href="#IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHOD">I
JU: JUnit assertion in run method will not be noticed by JUnit</a></td><td>Corre
ctness</td></tr> | 218 <tr bgcolor="#eeeeee"><td><a href="#ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND">ICA
ST: int value cast to float and then passed to Math.round</a></td><td>Correctnes
s</td></tr> |
| 214 <tr bgcolor="#ffffff"><td><a href="#IJU_BAD_SUITE_METHOD">IJU: TestCase declares
a bad suite method </a></td><td>Correctness</td></tr> | 219 <tr bgcolor="#ffffff"><td><a href="#IJU_ASSERT_METHOD_INVOKED_FROM_RUN_METHOD">I
JU: JUnit assertion in run method will not be noticed by JUnit</a></td><td>Corre
ctness</td></tr> |
| 215 <tr bgcolor="#eeeeee"><td><a href="#IJU_NO_TESTS">IJU: TestCase has no tests</a>
</td><td>Correctness</td></tr> | 220 <tr bgcolor="#eeeeee"><td><a href="#IJU_BAD_SUITE_METHOD">IJU: TestCase declares
a bad suite method </a></td><td>Correctness</td></tr> |
| 216 <tr bgcolor="#ffffff"><td><a href="#IJU_SETUP_NO_SUPER">IJU: TestCase defines se
tUp that doesn't call super.setUp()</a></td><td>Correctness</td></tr> | 221 <tr bgcolor="#ffffff"><td><a href="#IJU_NO_TESTS">IJU: TestCase has no tests</a>
</td><td>Correctness</td></tr> |
| 217 <tr bgcolor="#eeeeee"><td><a href="#IJU_SUITE_NOT_STATIC">IJU: TestCase implemen
ts a non-static suite method </a></td><td>Correctness</td></tr> | 222 <tr bgcolor="#eeeeee"><td><a href="#IJU_SETUP_NO_SUPER">IJU: TestCase defines se
tUp that doesn't call super.setUp()</a></td><td>Correctness</td></tr> |
| 218 <tr bgcolor="#ffffff"><td><a href="#IJU_TEARDOWN_NO_SUPER">IJU: TestCase defines
tearDown that doesn't call super.tearDown()</a></td><td>Correctness</td></tr> | 223 <tr bgcolor="#ffffff"><td><a href="#IJU_SUITE_NOT_STATIC">IJU: TestCase implemen
ts a non-static suite method </a></td><td>Correctness</td></tr> |
| 219 <tr bgcolor="#eeeeee"><td><a href="#IL_CONTAINER_ADDED_TO_ITSELF">IL: A collecti
on is added to itself</a></td><td>Correctness</td></tr> | 224 <tr bgcolor="#eeeeee"><td><a href="#IJU_TEARDOWN_NO_SUPER">IJU: TestCase defines
tearDown that doesn't call super.tearDown()</a></td><td>Correctness</td></tr> |
| 220 <tr bgcolor="#ffffff"><td><a href="#IL_INFINITE_LOOP">IL: An apparent infinite l
oop</a></td><td>Correctness</td></tr> | 225 <tr bgcolor="#ffffff"><td><a href="#IL_CONTAINER_ADDED_TO_ITSELF">IL: A collecti
on is added to itself</a></td><td>Correctness</td></tr> |
| 221 <tr bgcolor="#eeeeee"><td><a href="#IL_INFINITE_RECURSIVE_LOOP">IL: An apparent
infinite recursive loop</a></td><td>Correctness</td></tr> | 226 <tr bgcolor="#eeeeee"><td><a href="#IL_INFINITE_LOOP">IL: An apparent infinite l
oop</a></td><td>Correctness</td></tr> |
| 222 <tr bgcolor="#ffffff"><td><a href="#IM_MULTIPLYING_RESULT_OF_IREM">IM: Integer m
ultiply of result of integer remainder</a></td><td>Correctness</td></tr> | 227 <tr bgcolor="#ffffff"><td><a href="#IL_INFINITE_RECURSIVE_LOOP">IL: An apparent
infinite recursive loop</a></td><td>Correctness</td></tr> |
| 223 <tr bgcolor="#eeeeee"><td><a href="#INT_BAD_COMPARISON_WITH_INT_VALUE">INT: Bad
comparison of int value with long constant</a></td><td>Correctness</td></tr> | 228 <tr bgcolor="#eeeeee"><td><a href="#IM_MULTIPLYING_RESULT_OF_IREM">IM: Integer m
ultiply of result of integer remainder</a></td><td>Correctness</td></tr> |
| 224 <tr bgcolor="#ffffff"><td><a href="#INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE">I
NT: Bad comparison of nonnegative value with negative constant</a></td><td>Corre
ctness</td></tr> | 229 <tr bgcolor="#ffffff"><td><a href="#INT_BAD_COMPARISON_WITH_INT_VALUE">INT: Bad
comparison of int value with long constant</a></td><td>Correctness</td></tr> |
| 225 <tr bgcolor="#eeeeee"><td><a href="#INT_BAD_COMPARISON_WITH_SIGNED_BYTE">INT: Ba
d comparison of signed byte</a></td><td>Correctness</td></tr> | 230 <tr bgcolor="#eeeeee"><td><a href="#INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE">I
NT: Bad comparison of nonnegative value with negative constant or zero</a></td><
td>Correctness</td></tr> |
| 226 <tr bgcolor="#ffffff"><td><a href="#IO_APPENDING_TO_OBJECT_OUTPUT_STREAM">IO: Do
omed attempt to append to an object output stream</a></td><td>Correctness</td></
tr> | 231 <tr bgcolor="#ffffff"><td><a href="#INT_BAD_COMPARISON_WITH_SIGNED_BYTE">INT: Ba
d comparison of signed byte</a></td><td>Correctness</td></tr> |
| 227 <tr bgcolor="#eeeeee"><td><a href="#IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN">IP: A
parameter is dead upon entry to a method but overwritten</a></td><td>Correctness
</td></tr> | 232 <tr bgcolor="#eeeeee"><td><a href="#IO_APPENDING_TO_OBJECT_OUTPUT_STREAM">IO: Do
omed attempt to append to an object output stream</a></td><td>Correctness</td></
tr> |
| 228 <tr bgcolor="#ffffff"><td><a href="#MF_CLASS_MASKS_FIELD">MF: Class defines fiel
d that masks a superclass field</a></td><td>Correctness</td></tr> | 233 <tr bgcolor="#ffffff"><td><a href="#IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN">IP: A
parameter is dead upon entry to a method but overwritten</a></td><td>Correctness
</td></tr> |
| 229 <tr bgcolor="#eeeeee"><td><a href="#MF_METHOD_MASKS_FIELD">MF: Method defines a
variable that obscures a field</a></td><td>Correctness</td></tr> | 234 <tr bgcolor="#eeeeee"><td><a href="#MF_CLASS_MASKS_FIELD">MF: Class defines fiel
d that masks a superclass field</a></td><td>Correctness</td></tr> |
| 230 <tr bgcolor="#ffffff"><td><a href="#NP_ALWAYS_NULL">NP: Null pointer dereference
</a></td><td>Correctness</td></tr> | 235 <tr bgcolor="#ffffff"><td><a href="#MF_METHOD_MASKS_FIELD">MF: Method defines a
variable that obscures a field</a></td><td>Correctness</td></tr> |
| 231 <tr bgcolor="#eeeeee"><td><a href="#NP_ALWAYS_NULL_EXCEPTION">NP: Null pointer d
ereference in method on exception path</a></td><td>Correctness</td></tr> | 236 <tr bgcolor="#eeeeee"><td><a href="#NP_ALWAYS_NULL">NP: Null pointer dereference
</a></td><td>Correctness</td></tr> |
| 232 <tr bgcolor="#ffffff"><td><a href="#NP_ARGUMENT_MIGHT_BE_NULL">NP: Method does n
ot check for null argument</a></td><td>Correctness</td></tr> | 237 <tr bgcolor="#ffffff"><td><a href="#NP_ALWAYS_NULL_EXCEPTION">NP: Null pointer d
ereference in method on exception path</a></td><td>Correctness</td></tr> |
| 233 <tr bgcolor="#eeeeee"><td><a href="#NP_CLOSING_NULL">NP: close() invoked on a va
lue that is always null</a></td><td>Correctness</td></tr> | 238 <tr bgcolor="#eeeeee"><td><a href="#NP_ARGUMENT_MIGHT_BE_NULL">NP: Method does n
ot check for null argument</a></td><td>Correctness</td></tr> |
| 234 <tr bgcolor="#ffffff"><td><a href="#NP_GUARANTEED_DEREF">NP: Null value is guara
nteed to be dereferenced</a></td><td>Correctness</td></tr> | 239 <tr bgcolor="#ffffff"><td><a href="#NP_CLOSING_NULL">NP: close() invoked on a va
lue that is always null</a></td><td>Correctness</td></tr> |
| 235 <tr bgcolor="#eeeeee"><td><a href="#NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH">NP: V
alue is null and guaranteed to be dereferenced on exception path</a></td><td>Cor
rectness</td></tr> | 240 <tr bgcolor="#eeeeee"><td><a href="#NP_GUARANTEED_DEREF">NP: Null value is guara
nteed to be dereferenced</a></td><td>Correctness</td></tr> |
| 236 <tr bgcolor="#ffffff"><td><a href="#NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUC
TOR">NP: Nonnull field is not initialized</a></td><td>Correctness</td></tr> | 241 <tr bgcolor="#ffffff"><td><a href="#NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH">NP: V
alue is null and guaranteed to be dereferenced on exception path</a></td><td>Cor
rectness</td></tr> |
| 237 <tr bgcolor="#eeeeee"><td><a href="#NP_NONNULL_PARAM_VIOLATION">NP: Method call
passes null to a nonnull parameter </a></td><td>Correctness</td></tr> | 242 <tr bgcolor="#eeeeee"><td><a href="#NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUC
TOR">NP: Non-null field is not initialized</a></td><td>Correctness</td></tr> |
| 238 <tr bgcolor="#ffffff"><td><a href="#NP_NONNULL_RETURN_VIOLATION">NP: Method may
return null, but is declared @NonNull</a></td><td>Correctness</td></tr> | 243 <tr bgcolor="#ffffff"><td><a href="#NP_NONNULL_PARAM_VIOLATION">NP: Method call
passes null to a non-null parameter </a></td><td>Correctness</td></tr> |
| 239 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_INSTANCEOF">NP: A known null value i
s checked to see if it is an instance of a type</a></td><td>Correctness</td></tr
> | 244 <tr bgcolor="#eeeeee"><td><a href="#NP_NONNULL_RETURN_VIOLATION">NP: Method may
return null, but is declared @Nonnull</a></td><td>Correctness</td></tr> |
| 240 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_ON_SOME_PATH">NP: Possible null poin
ter dereference</a></td><td>Correctness</td></tr> | 245 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_INSTANCEOF">NP: A known null value i
s checked to see if it is an instance of a type</a></td><td>Correctness</td></tr
> |
| 241 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_ON_SOME_PATH_EXCEPTION">NP: Possible
null pointer dereference in method on exception path</a></td><td>Correctness</t
d></tr> | 246 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_ON_SOME_PATH">NP: Possible null poin
ter dereference</a></td><td>Correctness</td></tr> |
| 242 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_PARAM_DEREF">NP: Method call passes
null for nonnull parameter</a></td><td>Correctness</td></tr> | 247 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_ON_SOME_PATH_EXCEPTION">NP: Possible
null pointer dereference in method on exception path</a></td><td>Correctness</t
d></tr> |
| 243 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS">N
P: Method call passes null for nonnull parameter</a></td><td>Correctness</td></t
r> | 248 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_PARAM_DEREF">NP: Method call passes
null for non-null parameter</a></td><td>Correctness</td></tr> |
| 244 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_PARAM_DEREF_NONVIRTUAL">NP: Non-virt
ual method call passes null for nonnull parameter</a></td><td>Correctness</td></
tr> | 249 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS">N
P: Method call passes null for non-null parameter</a></td><td>Correctness</td></
tr> |
| 245 <tr bgcolor="#eeeeee"><td><a href="#NP_OPTIONAL_RETURN_NULL">NP: Method with Opt
ional return type returns explicit null</a></td><td>Correctness</td></tr> | 250 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_PARAM_DEREF_NONVIRTUAL">NP: Non-virt
ual method call passes null for non-null parameter</a></td><td>Correctness</td><
/tr> |
| 246 <tr bgcolor="#ffffff"><td><a href="#NP_STORE_INTO_NONNULL_FIELD">NP: Store of nu
ll value into field annotated NonNull</a></td><td>Correctness</td></tr> | 251 <tr bgcolor="#ffffff"><td><a href="#NP_OPTIONAL_RETURN_NULL">NP: Method with Opt
ional return type returns explicit null</a></td><td>Correctness</td></tr> |
| 247 <tr bgcolor="#eeeeee"><td><a href="#NP_UNWRITTEN_FIELD">NP: Read of unwritten fi
eld</a></td><td>Correctness</td></tr> | 252 <tr bgcolor="#eeeeee"><td><a href="#NP_STORE_INTO_NONNULL_FIELD">NP: Store of nu
ll value into field annotated @Nonnull</a></td><td>Correctness</td></tr> |
| 248 <tr bgcolor="#ffffff"><td><a href="#NM_BAD_EQUAL">Nm: Class defines equal(Object
); should it be equals(Object)?</a></td><td>Correctness</td></tr> | 253 <tr bgcolor="#ffffff"><td><a href="#NP_UNWRITTEN_FIELD">NP: Read of unwritten fi
eld</a></td><td>Correctness</td></tr> |
| 249 <tr bgcolor="#eeeeee"><td><a href="#NM_LCASE_HASHCODE">Nm: Class defines hashcod
e(); should it be hashCode()?</a></td><td>Correctness</td></tr> | 254 <tr bgcolor="#eeeeee"><td><a href="#NM_BAD_EQUAL">Nm: Class defines equal(Object
); should it be equals(Object)?</a></td><td>Correctness</td></tr> |
| 250 <tr bgcolor="#ffffff"><td><a href="#NM_LCASE_TOSTRING">Nm: Class defines tostrin
g(); should it be toString()?</a></td><td>Correctness</td></tr> | 255 <tr bgcolor="#ffffff"><td><a href="#NM_LCASE_HASHCODE">Nm: Class defines hashcod
e(); should it be hashCode()?</a></td><td>Correctness</td></tr> |
| 251 <tr bgcolor="#eeeeee"><td><a href="#NM_METHOD_CONSTRUCTOR_CONFUSION">Nm: Apparen
t method/constructor confusion</a></td><td>Correctness</td></tr> | 256 <tr bgcolor="#eeeeee"><td><a href="#NM_LCASE_TOSTRING">Nm: Class defines tostrin
g(); should it be toString()?</a></td><td>Correctness</td></tr> |
| 252 <tr bgcolor="#ffffff"><td><a href="#NM_VERY_CONFUSING">Nm: Very confusing method
names</a></td><td>Correctness</td></tr> | 257 <tr bgcolor="#ffffff"><td><a href="#NM_METHOD_CONSTRUCTOR_CONFUSION">Nm: Apparen
t method/constructor confusion</a></td><td>Correctness</td></tr> |
| 253 <tr bgcolor="#eeeeee"><td><a href="#NM_WRONG_PACKAGE">Nm: Method doesn't overrid
e method in superclass due to wrong package for parameter</a></td><td>Correctnes
s</td></tr> | 258 <tr bgcolor="#eeeeee"><td><a href="#NM_VERY_CONFUSING">Nm: Very confusing method
names</a></td><td>Correctness</td></tr> |
| 254 <tr bgcolor="#ffffff"><td><a href="#QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT">QBA: Me
thod assigns boolean literal in boolean expression</a></td><td>Correctness</td><
/tr> | 259 <tr bgcolor="#ffffff"><td><a href="#NM_WRONG_PACKAGE">Nm: Method doesn't overrid
e method in superclass due to wrong package for parameter</a></td><td>Correctnes
s</td></tr> |
| 255 <tr bgcolor="#eeeeee"><td><a href="#RC_REF_COMPARISON">RC: Suspicious reference
comparison</a></td><td>Correctness</td></tr> | 260 <tr bgcolor="#eeeeee"><td><a href="#QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT">QBA: Me
thod assigns boolean literal in boolean expression</a></td><td>Correctness</td><
/tr> |
| 256 <tr bgcolor="#ffffff"><td><a href="#RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NP
E">RCN: Nullcheck of value previously dereferenced</a></td><td>Correctness</td><
/tr> | 261 <tr bgcolor="#ffffff"><td><a href="#RANGE_ARRAY_INDEX">RANGE: Array index is out
of bounds</a></td><td>Correctness</td></tr> |
| 257 <tr bgcolor="#eeeeee"><td><a href="#RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION">RE: In
valid syntax for regular expression</a></td><td>Correctness</td></tr> | 262 <tr bgcolor="#eeeeee"><td><a href="#RANGE_ARRAY_LENGTH">RANGE: Array length is o
ut of bounds</a></td><td>Correctness</td></tr> |
| 258 <tr bgcolor="#ffffff"><td><a href="#RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRES
SION">RE: File.separator used for regular expression</a></td><td>Correctness</td
></tr> | 263 <tr bgcolor="#ffffff"><td><a href="#RANGE_ARRAY_OFFSET">RANGE: Array offset is o
ut of bounds</a></td><td>Correctness</td></tr> |
| 259 <tr bgcolor="#eeeeee"><td><a href="#RE_POSSIBLE_UNINTENDED_PATTERN">RE: "." or "
|" used for regular expression</a></td><td>Correctness</td></tr> | 264 <tr bgcolor="#eeeeee"><td><a href="#RANGE_STRING_INDEX">RANGE: String index is o
ut of bounds</a></td><td>Correctness</td></tr> |
| 260 <tr bgcolor="#ffffff"><td><a href="#RV_01_TO_INT">RV: Random value from 0 to 1 i
s coerced to the integer 0</a></td><td>Correctness</td></tr> | 265 <tr bgcolor="#ffffff"><td><a href="#RC_REF_COMPARISON">RC: Suspicious reference
comparison</a></td><td>Correctness</td></tr> |
| 261 <tr bgcolor="#eeeeee"><td><a href="#RV_ABSOLUTE_VALUE_OF_HASHCODE">RV: Bad attem
pt to compute absolute value of signed 32-bit hashcode </a></td><td>Correctness<
/td></tr> | 266 <tr bgcolor="#eeeeee"><td><a href="#RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NP
E">RCN: Nullcheck of value previously dereferenced</a></td><td>Correctness</td><
/tr> |
| 262 <tr bgcolor="#ffffff"><td><a href="#RV_ABSOLUTE_VALUE_OF_RANDOM_INT">RV: Bad att
empt to compute absolute value of signed random integer</a></td><td>Correctness<
/td></tr> | 267 <tr bgcolor="#ffffff"><td><a href="#RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION">RE: In
valid syntax for regular expression</a></td><td>Correctness</td></tr> |
| 263 <tr bgcolor="#eeeeee"><td><a href="#RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE
">RV: Code checks for specific values returned by compareTo</a></td><td>Correctn
ess</td></tr> | 268 <tr bgcolor="#eeeeee"><td><a href="#RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRES
SION">RE: File.separator used for regular expression</a></td><td>Correctness</td
></tr> |
| 264 <tr bgcolor="#ffffff"><td><a href="#RV_EXCEPTION_NOT_THROWN">RV: Exception creat
ed and dropped rather than thrown</a></td><td>Correctness</td></tr> | 269 <tr bgcolor="#ffffff"><td><a href="#RE_POSSIBLE_UNINTENDED_PATTERN">RE: "." or "
|" used for regular expression</a></td><td>Correctness</td></tr> |
| 265 <tr bgcolor="#eeeeee"><td><a href="#RV_RETURN_VALUE_IGNORED">RV: Method ignores
return value</a></td><td>Correctness</td></tr> | 270 <tr bgcolor="#eeeeee"><td><a href="#RV_01_TO_INT">RV: Random value from 0 to 1 i
s coerced to the integer 0</a></td><td>Correctness</td></tr> |
| 266 <tr bgcolor="#ffffff"><td><a href="#RpC_REPEATED_CONDITIONAL_TEST">RpC: Repeated
conditional tests</a></td><td>Correctness</td></tr> | 271 <tr bgcolor="#ffffff"><td><a href="#RV_ABSOLUTE_VALUE_OF_HASHCODE">RV: Bad attem
pt to compute absolute value of signed 32-bit hashcode </a></td><td>Correctness<
/td></tr> |
| 267 <tr bgcolor="#eeeeee"><td><a href="#SA_FIELD_SELF_ASSIGNMENT">SA: Self assignmen
t of field</a></td><td>Correctness</td></tr> | 272 <tr bgcolor="#eeeeee"><td><a href="#RV_ABSOLUTE_VALUE_OF_RANDOM_INT">RV: Bad att
empt to compute absolute value of signed random integer</a></td><td>Correctness<
/td></tr> |
| 268 <tr bgcolor="#ffffff"><td><a href="#SA_FIELD_SELF_COMPARISON">SA: Self compariso
n of field with itself</a></td><td>Correctness</td></tr> | 273 <tr bgcolor="#ffffff"><td><a href="#RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE
">RV: Code checks for specific values returned by compareTo</a></td><td>Correctn
ess</td></tr> |
| 269 <tr bgcolor="#eeeeee"><td><a href="#SA_FIELD_SELF_COMPUTATION">SA: Nonsensical s
elf computation involving a field (e.g., x & x)</a></td><td>Correctness</td></tr
> | 274 <tr bgcolor="#eeeeee"><td><a href="#RV_EXCEPTION_NOT_THROWN">RV: Exception creat
ed and dropped rather than thrown</a></td><td>Correctness</td></tr> |
| 270 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD">S
A: Self assignment of local rather than assignment to field</a></td><td>Correctn
ess</td></tr> | 275 <tr bgcolor="#ffffff"><td><a href="#RV_RETURN_VALUE_IGNORED">RV: Method ignores
return value</a></td><td>Correctness</td></tr> |
| 271 <tr bgcolor="#eeeeee"><td><a href="#SA_LOCAL_SELF_COMPARISON">SA: Self compariso
n of value with itself</a></td><td>Correctness</td></tr> | 276 <tr bgcolor="#eeeeee"><td><a href="#RpC_REPEATED_CONDITIONAL_TEST">RpC: Repeated
conditional tests</a></td><td>Correctness</td></tr> |
| 272 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_COMPUTATION">SA: Nonsensical s
elf computation involving a variable (e.g., x & x)</a></td><td>Correctness</td><
/tr> | 277 <tr bgcolor="#ffffff"><td><a href="#SA_FIELD_SELF_ASSIGNMENT">SA: Self assignmen
t of field</a></td><td>Correctness</td></tr> |
| 273 <tr bgcolor="#eeeeee"><td><a href="#SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH">SF:
Dead store due to switch statement fall through</a></td><td>Correctness</td></t
r> | 278 <tr bgcolor="#eeeeee"><td><a href="#SA_FIELD_SELF_COMPARISON">SA: Self compariso
n of field with itself</a></td><td>Correctness</td></tr> |
| 274 <tr bgcolor="#ffffff"><td><a href="#SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_T
HROW">SF: Dead store due to switch statement fall through to throw</a></td><td>C
orrectness</td></tr> | 279 <tr bgcolor="#ffffff"><td><a href="#SA_FIELD_SELF_COMPUTATION">SA: Nonsensical s
elf computation involving a field (e.g., x & x)</a></td><td>Correctness</td></tr
> |
| 275 <tr bgcolor="#eeeeee"><td><a href="#SIC_THREADLOCAL_DEADLY_EMBRACE">SIC: Deadly
embrace of non-static inner class and thread local</a></td><td>Correctness</td><
/tr> | 280 <tr bgcolor="#eeeeee"><td><a href="#SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD">S
A: Self assignment of local rather than assignment to field</a></td><td>Correctn
ess</td></tr> |
| 276 <tr bgcolor="#ffffff"><td><a href="#SIO_SUPERFLUOUS_INSTANCEOF">SIO: Unnecessary
type check done using instanceof operator</a></td><td>Correctness</td></tr> | 281 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_COMPARISON">SA: Self compariso
n of value with itself</a></td><td>Correctness</td></tr> |
| 277 <tr bgcolor="#eeeeee"><td><a href="#SQL_BAD_PREPARED_STATEMENT_ACCESS">SQL: Meth
od attempts to access a prepared statement parameter with index 0</a></td><td>Co
rrectness</td></tr> | 282 <tr bgcolor="#eeeeee"><td><a href="#SA_LOCAL_SELF_COMPUTATION">SA: Nonsensical s
elf computation involving a variable (e.g., x & x)</a></td><td>Correctness</td><
/tr> |
| 278 <tr bgcolor="#ffffff"><td><a href="#SQL_BAD_RESULTSET_ACCESS">SQL: Method attemp
ts to access a result set field with index 0</a></td><td>Correctness</td></tr> | 283 <tr bgcolor="#ffffff"><td><a href="#SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH">SF:
Dead store due to switch statement fall through</a></td><td>Correctness</td></t
r> |
| 279 <tr bgcolor="#eeeeee"><td><a href="#STI_INTERRUPTED_ON_CURRENTTHREAD">STI: Unnee
ded use of currentThread() call, to call interrupted() </a></td><td>Correctness<
/td></tr> | 284 <tr bgcolor="#eeeeee"><td><a href="#SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_T
HROW">SF: Dead store due to switch statement fall through to throw</a></td><td>C
orrectness</td></tr> |
| 280 <tr bgcolor="#ffffff"><td><a href="#STI_INTERRUPTED_ON_UNKNOWNTHREAD">STI: Stati
c Thread.interrupted() method invoked on thread instance</a></td><td>Correctness
</td></tr> | 285 <tr bgcolor="#ffffff"><td><a href="#SIC_THREADLOCAL_DEADLY_EMBRACE">SIC: Deadly
embrace of non-static inner class and thread local</a></td><td>Correctness</td><
/tr> |
| 281 <tr bgcolor="#eeeeee"><td><a href="#SE_METHOD_MUST_BE_PRIVATE">Se: Method must b
e private in order for serialization to work</a></td><td>Correctness</td></tr> | 286 <tr bgcolor="#eeeeee"><td><a href="#SIO_SUPERFLUOUS_INSTANCEOF">SIO: Unnecessary
type check done using instanceof operator</a></td><td>Correctness</td></tr> |
| 282 <tr bgcolor="#ffffff"><td><a href="#SE_READ_RESOLVE_IS_STATIC">Se: The readResol
ve method must not be declared as a static method. </a></td><td>Correctness</td
></tr> | 287 <tr bgcolor="#ffffff"><td><a href="#SQL_BAD_PREPARED_STATEMENT_ACCESS">SQL: Meth
od attempts to access a prepared statement parameter with index 0</a></td><td>Co
rrectness</td></tr> |
| 283 <tr bgcolor="#eeeeee"><td><a href="#TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED">T
Q: Value annotated as carrying a type qualifier used where a value that must not
carry that qualifier is required</a></td><td>Correctness</td></tr> | 288 <tr bgcolor="#eeeeee"><td><a href="#SQL_BAD_RESULTSET_ACCESS">SQL: Method attemp
ts to access a result set field with index 0</a></td><td>Correctness</td></tr> |
| 284 <tr bgcolor="#ffffff"><td><a href="#TQ_COMPARING_VALUES_WITH_INCOMPATIBLE_TYPE_Q
UALIFIERS">TQ: Comparing values with incompatible type qualifiers</a></td><td>Co
rrectness</td></tr> | 289 <tr bgcolor="#ffffff"><td><a href="#STI_INTERRUPTED_ON_CURRENTTHREAD">STI: Unnee
ded use of currentThread() call, to call interrupted() </a></td><td>Correctness<
/td></tr> |
| 285 <tr bgcolor="#eeeeee"><td><a href="#TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK">T
Q: Value that might not carry a type qualifier is always used in a way requires
that type qualifier</a></td><td>Correctness</td></tr> | 290 <tr bgcolor="#eeeeee"><td><a href="#STI_INTERRUPTED_ON_UNKNOWNTHREAD">STI: Stati
c Thread.interrupted() method invoked on thread instance</a></td><td>Correctness
</td></tr> |
| 286 <tr bgcolor="#ffffff"><td><a href="#TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK">TQ
: Value that might carry a type qualifier is always used in a way prohibits it f
rom having that type qualifier</a></td><td>Correctness</td></tr> | 291 <tr bgcolor="#ffffff"><td><a href="#SE_METHOD_MUST_BE_PRIVATE">Se: Method must b
e private in order for serialization to work</a></td><td>Correctness</td></tr> |
| 287 <tr bgcolor="#eeeeee"><td><a href="#TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED">T
Q: Value annotated as never carrying a type qualifier used where value carrying
that qualifier is required</a></td><td>Correctness</td></tr> | 292 <tr bgcolor="#eeeeee"><td><a href="#SE_READ_RESOLVE_IS_STATIC">Se: The readResol
ve method must not be declared as a static method. </a></td><td>Correctness</td
></tr> |
| 288 <tr bgcolor="#ffffff"><td><a href="#TQ_UNKNOWN_VALUE_USED_WHERE_ALWAYS_STRICTLY_
REQUIRED">TQ: Value without a type qualifier used where a value is required to h
ave that qualifier</a></td><td>Correctness</td></tr> | 293 <tr bgcolor="#ffffff"><td><a href="#TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED">T
Q: Value annotated as carrying a type qualifier used where a value that must not
carry that qualifier is required</a></td><td>Correctness</td></tr> |
| 289 <tr bgcolor="#eeeeee"><td><a href="#UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS">U
MAC: Uncallable method defined in anonymous class</a></td><td>Correctness</td></
tr> | 294 <tr bgcolor="#eeeeee"><td><a href="#TQ_COMPARING_VALUES_WITH_INCOMPATIBLE_TYPE_Q
UALIFIERS">TQ: Comparing values with incompatible type qualifiers</a></td><td>Co
rrectness</td></tr> |
| 290 <tr bgcolor="#ffffff"><td><a href="#UR_UNINIT_READ">UR: Uninitialized read of fi
eld in constructor</a></td><td>Correctness</td></tr> | 295 <tr bgcolor="#ffffff"><td><a href="#TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK">T
Q: Value that might not carry a type qualifier is always used in a way requires
that type qualifier</a></td><td>Correctness</td></tr> |
| 291 <tr bgcolor="#eeeeee"><td><a href="#UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR
">UR: Uninitialized read of field method called from constructor of superclass</
a></td><td>Correctness</td></tr> | 296 <tr bgcolor="#eeeeee"><td><a href="#TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK">TQ
: Value that might carry a type qualifier is always used in a way prohibits it f
rom having that type qualifier</a></td><td>Correctness</td></tr> |
| 292 <tr bgcolor="#ffffff"><td><a href="#DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY">US
ELESS_STRING: Invocation of toString on an unnamed array</a></td><td>Correctness
</td></tr> | 297 <tr bgcolor="#ffffff"><td><a href="#TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED">T
Q: Value annotated as never carrying a type qualifier used where value carrying
that qualifier is required</a></td><td>Correctness</td></tr> |
| 293 <tr bgcolor="#eeeeee"><td><a href="#DMI_INVOKING_TOSTRING_ON_ARRAY">USELESS_STRI
NG: Invocation of toString on an array</a></td><td>Correctness</td></tr> | 298 <tr bgcolor="#eeeeee"><td><a href="#TQ_UNKNOWN_VALUE_USED_WHERE_ALWAYS_STRICTLY_
REQUIRED">TQ: Value without a type qualifier used where a value is required to h
ave that qualifier</a></td><td>Correctness</td></tr> |
| 294 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY">
USELESS_STRING: Array formatted in useless way using format string</a></td><td>C
orrectness</td></tr> | 299 <tr bgcolor="#ffffff"><td><a href="#UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS">U
MAC: Uncallable method defined in anonymous class</a></td><td>Correctness</td></
tr> |
| 295 <tr bgcolor="#eeeeee"><td><a href="#UWF_NULL_FIELD">UwF: Field only ever set to
null</a></td><td>Correctness</td></tr> | 300 <tr bgcolor="#eeeeee"><td><a href="#UR_UNINIT_READ">UR: Uninitialized read of fi
eld in constructor</a></td><td>Correctness</td></tr> |
| 296 <tr bgcolor="#ffffff"><td><a href="#UWF_UNWRITTEN_FIELD">UwF: Unwritten field</a
></td><td>Correctness</td></tr> | 301 <tr bgcolor="#ffffff"><td><a href="#UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR
">UR: Uninitialized read of field method called from constructor of superclass</
a></td><td>Correctness</td></tr> |
| 297 <tr bgcolor="#eeeeee"><td><a href="#VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG">
VA: Primitive array passed to function expecting a variable number of object arg
uments</a></td><td>Correctness</td></tr> | 302 <tr bgcolor="#eeeeee"><td><a href="#DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY">US
ELESS_STRING: Invocation of toString on an unnamed array</a></td><td>Correctness
</td></tr> |
| 298 <tr bgcolor="#ffffff"><td><a href="#VR_UNRESOLVABLE_REFERENCE">VR: Class makes r
eference to unresolvable class or method</a></td><td>Correctness</td></tr> | 303 <tr bgcolor="#ffffff"><td><a href="#DMI_INVOKING_TOSTRING_ON_ARRAY">USELESS_STRI
NG: Invocation of toString on an array</a></td><td>Correctness</td></tr> |
| 299 <tr bgcolor="#eeeeee"><td><a href="#LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE">LG: Po
tential lost logger changes due to weak reference in OpenJDK</a></td><td>Experim
ental</td></tr> | 304 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY">
USELESS_STRING: Array formatted in useless way using format string</a></td><td>C
orrectness</td></tr> |
| 300 <tr bgcolor="#ffffff"><td><a href="#OBL_UNSATISFIED_OBLIGATION">OBL: Method may
fail to clean up stream or resource</a></td><td>Experimental</td></tr> | 305 <tr bgcolor="#ffffff"><td><a href="#UWF_NULL_FIELD">UwF: Field only ever set to
null</a></td><td>Correctness</td></tr> |
| 301 <tr bgcolor="#eeeeee"><td><a href="#OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE">O
BL: Method may fail to clean up stream or resource on checked exception</a></td>
<td>Experimental</td></tr> | 306 <tr bgcolor="#eeeeee"><td><a href="#UWF_UNWRITTEN_FIELD">UwF: Unwritten field</a
></td><td>Correctness</td></tr> |
| 302 <tr bgcolor="#ffffff"><td><a href="#TESTING">TEST: Testing</a></td><td>Experimen
tal</td></tr> | 307 <tr bgcolor="#ffffff"><td><a href="#VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG">
VA: Primitive array passed to function expecting a variable number of object arg
uments</a></td><td>Correctness</td></tr> |
| 303 <tr bgcolor="#eeeeee"><td><a href="#DM_CONVERT_CASE">Dm: Consider using Locale p
arameterized version of invoked method</a></td><td>Internationalization</td></tr
> | 308 <tr bgcolor="#eeeeee"><td><a href="#VR_UNRESOLVABLE_REFERENCE">VR: Class makes r
eference to unresolvable class or method</a></td><td>Correctness</td></tr> |
| 304 <tr bgcolor="#ffffff"><td><a href="#DM_DEFAULT_ENCODING">Dm: Reliance on default
encoding</a></td><td>Internationalization</td></tr> | 309 <tr bgcolor="#ffffff"><td><a href="#LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE">LG: Po
tential lost logger changes due to weak reference in OpenJDK</a></td><td>Experim
ental</td></tr> |
| 305 <tr bgcolor="#eeeeee"><td><a href="#DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED">
DP: Classloaders should only be created inside doPrivileged block</a></td><td>Ma
licious code vulnerability</td></tr> | 310 <tr bgcolor="#eeeeee"><td><a href="#OBL_UNSATISFIED_OBLIGATION">OBL: Method may
fail to clean up stream or resource</a></td><td>Experimental</td></tr> |
| 306 <tr bgcolor="#ffffff"><td><a href="#DP_DO_INSIDE_DO_PRIVILEGED">DP: Method invok
ed that should be only be invoked inside a doPrivileged block</a></td><td>Malici
ous code vulnerability</td></tr> | 311 <tr bgcolor="#ffffff"><td><a href="#OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE">O
BL: Method may fail to clean up stream or resource on checked exception</a></td>
<td>Experimental</td></tr> |
| 307 <tr bgcolor="#eeeeee"><td><a href="#EI_EXPOSE_REP">EI: May expose internal repre
sentation by returning reference to mutable object</a></td><td>Malicious code vu
lnerability</td></tr> | 312 <tr bgcolor="#eeeeee"><td><a href="#TESTING">TEST: Testing</a></td><td>Experimen
tal</td></tr> |
| 308 <tr bgcolor="#ffffff"><td><a href="#EI_EXPOSE_REP2">EI2: May expose internal rep
resentation by incorporating reference to mutable object</a></td><td>Malicious c
ode vulnerability</td></tr> | 313 <tr bgcolor="#ffffff"><td><a href="#DM_CONVERT_CASE">Dm: Consider using Locale p
arameterized version of invoked method</a></td><td>Internationalization</td></tr
> |
| 309 <tr bgcolor="#eeeeee"><td><a href="#FI_PUBLIC_SHOULD_BE_PROTECTED">FI: Finalizer
should be protected, not public</a></td><td>Malicious code vulnerability</td></
tr> | 314 <tr bgcolor="#eeeeee"><td><a href="#DM_DEFAULT_ENCODING">Dm: Reliance on default
encoding</a></td><td>Internationalization</td></tr> |
| 310 <tr bgcolor="#ffffff"><td><a href="#EI_EXPOSE_STATIC_REP2">MS: May expose intern
al static state by storing a mutable object into a static field</a></td><td>Mali
cious code vulnerability</td></tr> | 315 <tr bgcolor="#ffffff"><td><a href="#DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED">
DP: Classloaders should only be created inside doPrivileged block</a></td><td>Ma
licious code vulnerability</td></tr> |
| 311 <tr bgcolor="#eeeeee"><td><a href="#MS_CANNOT_BE_FINAL">MS: Field isn't final an
d can't be protected from malicious code</a></td><td>Malicious code vulnerabilit
y</td></tr> | 316 <tr bgcolor="#eeeeee"><td><a href="#DP_DO_INSIDE_DO_PRIVILEGED">DP: Method invok
ed that should be only be invoked inside a doPrivileged block</a></td><td>Malici
ous code vulnerability</td></tr> |
| 312 <tr bgcolor="#ffffff"><td><a href="#MS_EXPOSE_REP">MS: Public static method may
expose internal representation by returning array</a></td><td>Malicious code vul
nerability</td></tr> | 317 <tr bgcolor="#ffffff"><td><a href="#EI_EXPOSE_REP">EI: May expose internal repre
sentation by returning reference to mutable object</a></td><td>Malicious code vu
lnerability</td></tr> |
| 313 <tr bgcolor="#eeeeee"><td><a href="#MS_FINAL_PKGPROTECT">MS: Field should be bot
h final and package protected</a></td><td>Malicious code vulnerability</td></tr> | 318 <tr bgcolor="#eeeeee"><td><a href="#EI_EXPOSE_REP2">EI2: May expose internal rep
resentation by incorporating reference to mutable object</a></td><td>Malicious c
ode vulnerability</td></tr> |
| 314 <tr bgcolor="#ffffff"><td><a href="#MS_MUTABLE_ARRAY">MS: Field is a mutable arr
ay</a></td><td>Malicious code vulnerability</td></tr> | 319 <tr bgcolor="#ffffff"><td><a href="#FI_PUBLIC_SHOULD_BE_PROTECTED">FI: Finalizer
should be protected, not public</a></td><td>Malicious code vulnerability</td></
tr> |
| 315 <tr bgcolor="#eeeeee"><td><a href="#MS_MUTABLE_HASHTABLE">MS: Field is a mutable
Hashtable</a></td><td>Malicious code vulnerability</td></tr> | 320 <tr bgcolor="#eeeeee"><td><a href="#EI_EXPOSE_STATIC_REP2">MS: May expose intern
al static state by storing a mutable object into a static field</a></td><td>Mali
cious code vulnerability</td></tr> |
| 316 <tr bgcolor="#ffffff"><td><a href="#MS_OOI_PKGPROTECT">MS: Field should be moved
out of an interface and made package protected</a></td><td>Malicious code vulne
rability</td></tr> | 321 <tr bgcolor="#ffffff"><td><a href="#MS_CANNOT_BE_FINAL">MS: Field isn't final an
d can't be protected from malicious code</a></td><td>Malicious code vulnerabilit
y</td></tr> |
| 317 <tr bgcolor="#eeeeee"><td><a href="#MS_PKGPROTECT">MS: Field should be package p
rotected</a></td><td>Malicious code vulnerability</td></tr> | 322 <tr bgcolor="#eeeeee"><td><a href="#MS_EXPOSE_REP">MS: Public static method may
expose internal representation by returning array</a></td><td>Malicious code vul
nerability</td></tr> |
| 318 <tr bgcolor="#ffffff"><td><a href="#MS_SHOULD_BE_FINAL">MS: Field isn't final bu
t should be</a></td><td>Malicious code vulnerability</td></tr> | 323 <tr bgcolor="#ffffff"><td><a href="#MS_FINAL_PKGPROTECT">MS: Field should be bot
h final and package protected</a></td><td>Malicious code vulnerability</td></tr> |
| 319 <tr bgcolor="#eeeeee"><td><a href="#MS_SHOULD_BE_REFACTORED_TO_BE_FINAL">MS: Fie
ld isn't final but should be refactored to be so</a></td><td>Malicious code vuln
erability</td></tr> | 324 <tr bgcolor="#eeeeee"><td><a href="#MS_MUTABLE_ARRAY">MS: Field is a mutable arr
ay</a></td><td>Malicious code vulnerability</td></tr> |
| 320 <tr bgcolor="#ffffff"><td><a href="#AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACT
ION">AT: Sequence of calls to concurrent abstraction may not be atomic</a></td><
td>Multithreaded correctness</td></tr> | 325 <tr bgcolor="#ffffff"><td><a href="#MS_MUTABLE_COLLECTION">MS: Field is a mutabl
e collection</a></td><td>Malicious code vulnerability</td></tr> |
| 321 <tr bgcolor="#eeeeee"><td><a href="#DC_DOUBLECHECK">DC: Possible double check of
field</a></td><td>Multithreaded correctness</td></tr> | 326 <tr bgcolor="#eeeeee"><td><a href="#MS_MUTABLE_COLLECTION_PKGPROTECT">MS: Field
is a mutable collection which should be package protected</a></td><td>Malicious
code vulnerability</td></tr> |
| 327 <tr bgcolor="#ffffff"><td><a href="#MS_MUTABLE_HASHTABLE">MS: Field is a mutable
Hashtable</a></td><td>Malicious code vulnerability</td></tr> |
| 328 <tr bgcolor="#eeeeee"><td><a href="#MS_OOI_PKGPROTECT">MS: Field should be moved
out of an interface and made package protected</a></td><td>Malicious code vulne
rability</td></tr> |
| 329 <tr bgcolor="#ffffff"><td><a href="#MS_PKGPROTECT">MS: Field should be package p
rotected</a></td><td>Malicious code vulnerability</td></tr> |
| 330 <tr bgcolor="#eeeeee"><td><a href="#MS_SHOULD_BE_FINAL">MS: Field isn't final bu
t should be</a></td><td>Malicious code vulnerability</td></tr> |
| 331 <tr bgcolor="#ffffff"><td><a href="#MS_SHOULD_BE_REFACTORED_TO_BE_FINAL">MS: Fie
ld isn't final but should be refactored to be so</a></td><td>Malicious code vuln
erability</td></tr> |
| 332 <tr bgcolor="#eeeeee"><td><a href="#AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACT
ION">AT: Sequence of calls to concurrent abstraction may not be atomic</a></td><
td>Multithreaded correctness</td></tr> |
| 333 <tr bgcolor="#ffffff"><td><a href="#DC_DOUBLECHECK">DC: Possible double check of
field</a></td><td>Multithreaded correctness</td></tr> |
| 334 <tr bgcolor="#eeeeee"><td><a href="#DC_PARTIALLY_CONSTRUCTED">DC: Possible expos
ure of partially initialized object</a></td><td>Multithreaded correctness</td></
tr> |
| 322 <tr bgcolor="#ffffff"><td><a href="#DL_SYNCHRONIZATION_ON_BOOLEAN">DL: Synchroni
zation on Boolean</a></td><td>Multithreaded correctness</td></tr> | 335 <tr bgcolor="#ffffff"><td><a href="#DL_SYNCHRONIZATION_ON_BOOLEAN">DL: Synchroni
zation on Boolean</a></td><td>Multithreaded correctness</td></tr> |
| 323 <tr bgcolor="#eeeeee"><td><a href="#DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE">DL: S
ynchronization on boxed primitive</a></td><td>Multithreaded correctness</td></tr
> | 336 <tr bgcolor="#eeeeee"><td><a href="#DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE">DL: S
ynchronization on boxed primitive</a></td><td>Multithreaded correctness</td></tr
> |
| 324 <tr bgcolor="#ffffff"><td><a href="#DL_SYNCHRONIZATION_ON_SHARED_CONSTANT">DL: S
ynchronization on interned String </a></td><td>Multithreaded correctness</td></t
r> | 337 <tr bgcolor="#ffffff"><td><a href="#DL_SYNCHRONIZATION_ON_SHARED_CONSTANT">DL: S
ynchronization on interned String </a></td><td>Multithreaded correctness</td></t
r> |
| 325 <tr bgcolor="#eeeeee"><td><a href="#DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITI
VE">DL: Synchronization on boxed primitive values</a></td><td>Multithreaded corr
ectness</td></tr> | 338 <tr bgcolor="#eeeeee"><td><a href="#DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITI
VE">DL: Synchronization on boxed primitive values</a></td><td>Multithreaded corr
ectness</td></tr> |
| 326 <tr bgcolor="#ffffff"><td><a href="#DM_MONITOR_WAIT_ON_CONDITION">Dm: Monitor wa
it() called on Condition</a></td><td>Multithreaded correctness</td></tr> | 339 <tr bgcolor="#ffffff"><td><a href="#DM_MONITOR_WAIT_ON_CONDITION">Dm: Monitor wa
it() called on Condition</a></td><td>Multithreaded correctness</td></tr> |
| 327 <tr bgcolor="#eeeeee"><td><a href="#DM_USELESS_THREAD">Dm: A thread was created
using the default empty run method</a></td><td>Multithreaded correctness</td></t
r> | 340 <tr bgcolor="#eeeeee"><td><a href="#DM_USELESS_THREAD">Dm: A thread was created
using the default empty run method</a></td><td>Multithreaded correctness</td></t
r> |
| 328 <tr bgcolor="#ffffff"><td><a href="#ESync_EMPTY_SYNC">ESync: Empty synchronized
block</a></td><td>Multithreaded correctness</td></tr> | 341 <tr bgcolor="#ffffff"><td><a href="#ESync_EMPTY_SYNC">ESync: Empty synchronized
block</a></td><td>Multithreaded correctness</td></tr> |
| 329 <tr bgcolor="#eeeeee"><td><a href="#IS2_INCONSISTENT_SYNC">IS: Inconsistent sync
hronization</a></td><td>Multithreaded correctness</td></tr> | 342 <tr bgcolor="#eeeeee"><td><a href="#IS2_INCONSISTENT_SYNC">IS: Inconsistent sync
hronization</a></td><td>Multithreaded correctness</td></tr> |
| 330 <tr bgcolor="#ffffff"><td><a href="#IS_FIELD_NOT_GUARDED">IS: Field not guarded
against concurrent access</a></td><td>Multithreaded correctness</td></tr> | 343 <tr bgcolor="#ffffff"><td><a href="#IS_FIELD_NOT_GUARDED">IS: Field not guarded
against concurrent access</a></td><td>Multithreaded correctness</td></tr> |
| 331 <tr bgcolor="#eeeeee"><td><a href="#JLM_JSR166_LOCK_MONITORENTER">JLM: Synchroni
zation performed on Lock</a></td><td>Multithreaded correctness</td></tr> | 344 <tr bgcolor="#eeeeee"><td><a href="#JLM_JSR166_LOCK_MONITORENTER">JLM: Synchroni
zation performed on Lock</a></td><td>Multithreaded correctness</td></tr> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 361 <tr bgcolor="#eeeeee"><td><a href="#WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL"
>WL: Synchronization on getClass rather than class literal</a></td><td>Multithre
aded correctness</td></tr> | 374 <tr bgcolor="#eeeeee"><td><a href="#WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL"
>WL: Synchronization on getClass rather than class literal</a></td><td>Multithre
aded correctness</td></tr> |
| 362 <tr bgcolor="#ffffff"><td><a href="#WS_WRITEOBJECT_SYNC">WS: Class's writeObject
() method is synchronized but nothing else is</a></td><td>Multithreaded correctn
ess</td></tr> | 375 <tr bgcolor="#ffffff"><td><a href="#WS_WRITEOBJECT_SYNC">WS: Class's writeObject
() method is synchronized but nothing else is</a></td><td>Multithreaded correctn
ess</td></tr> |
| 363 <tr bgcolor="#eeeeee"><td><a href="#WA_AWAIT_NOT_IN_LOOP">Wa: Condition.await()
not in loop </a></td><td>Multithreaded correctness</td></tr> | 376 <tr bgcolor="#eeeeee"><td><a href="#WA_AWAIT_NOT_IN_LOOP">Wa: Condition.await()
not in loop </a></td><td>Multithreaded correctness</td></tr> |
| 364 <tr bgcolor="#ffffff"><td><a href="#WA_NOT_IN_LOOP">Wa: Wait not in loop </a></t
d><td>Multithreaded correctness</td></tr> | 377 <tr bgcolor="#ffffff"><td><a href="#WA_NOT_IN_LOOP">Wa: Wait not in loop </a></t
d><td>Multithreaded correctness</td></tr> |
| 365 <tr bgcolor="#eeeeee"><td><a href="#NOISE_FIELD_REFERENCE">NOISE: Bogus warning
about a field reference</a></td><td>Bogus random noise</td></tr> | 378 <tr bgcolor="#eeeeee"><td><a href="#NOISE_FIELD_REFERENCE">NOISE: Bogus warning
about a field reference</a></td><td>Bogus random noise</td></tr> |
| 366 <tr bgcolor="#ffffff"><td><a href="#NOISE_METHOD_CALL">NOISE: Bogus warning abou
t a method call</a></td><td>Bogus random noise</td></tr> | 379 <tr bgcolor="#ffffff"><td><a href="#NOISE_METHOD_CALL">NOISE: Bogus warning abou
t a method call</a></td><td>Bogus random noise</td></tr> |
| 367 <tr bgcolor="#eeeeee"><td><a href="#NOISE_NULL_DEREFERENCE">NOISE: Bogus warning
about a null pointer dereference</a></td><td>Bogus random noise</td></tr> | 380 <tr bgcolor="#eeeeee"><td><a href="#NOISE_NULL_DEREFERENCE">NOISE: Bogus warning
about a null pointer dereference</a></td><td>Bogus random noise</td></tr> |
| 368 <tr bgcolor="#ffffff"><td><a href="#NOISE_OPERATION">NOISE: Bogus warning about
an operation</a></td><td>Bogus random noise</td></tr> | 381 <tr bgcolor="#ffffff"><td><a href="#NOISE_OPERATION">NOISE: Bogus warning about
an operation</a></td><td>Bogus random noise</td></tr> |
| 369 <tr bgcolor="#eeeeee"><td><a href="#BX_BOXING_IMMEDIATELY_UNBOXED">Bx: Primitive
value is boxed and then immediately unboxed</a></td><td>Performance</td></tr> | 382 <tr bgcolor="#eeeeee"><td><a href="#BX_BOXING_IMMEDIATELY_UNBOXED">Bx: Primitive
value is boxed and then immediately unboxed</a></td><td>Performance</td></tr> |
| 370 <tr bgcolor="#ffffff"><td><a href="#BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COE
RCION">Bx: Primitive value is boxed then unboxed to perform primitive coercion</
a></td><td>Performance</td></tr> | 383 <tr bgcolor="#ffffff"><td><a href="#BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COE
RCION">Bx: Primitive value is boxed then unboxed to perform primitive coercion</
a></td><td>Performance</td></tr> |
| 371 <tr bgcolor="#eeeeee"><td><a href="#BX_UNBOXING_IMMEDIATELY_REBOXED">Bx: Boxed v
alue is unboxed and then immediately reboxed</a></td><td>Performance</td></tr> | 384 <tr bgcolor="#eeeeee"><td><a href="#BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR"
>Bx: Primitive value is unboxed and coerced for ternary operator</a></td><td>Per
formance</td></tr> |
| 385 <tr bgcolor="#ffffff"><td><a href="#BX_UNBOXING_IMMEDIATELY_REBOXED">Bx: Boxed v
alue is unboxed and then immediately reboxed</a></td><td>Performance</td></tr> |
| 386 <tr bgcolor="#eeeeee"><td><a href="#DM_BOXED_PRIMITIVE_FOR_COMPARE">Bx: Boxing a
primitive to compare</a></td><td>Performance</td></tr> |
| 372 <tr bgcolor="#ffffff"><td><a href="#DM_BOXED_PRIMITIVE_FOR_PARSING">Bx: Boxing/u
nboxing to parse a primitive</a></td><td>Performance</td></tr> | 387 <tr bgcolor="#ffffff"><td><a href="#DM_BOXED_PRIMITIVE_FOR_PARSING">Bx: Boxing/u
nboxing to parse a primitive</a></td><td>Performance</td></tr> |
| 373 <tr bgcolor="#eeeeee"><td><a href="#DM_BOXED_PRIMITIVE_TOSTRING">Bx: Method allo
cates a boxed primitive just to call toString</a></td><td>Performance</td></tr> | 388 <tr bgcolor="#eeeeee"><td><a href="#DM_BOXED_PRIMITIVE_TOSTRING">Bx: Method allo
cates a boxed primitive just to call toString</a></td><td>Performance</td></tr> |
| 374 <tr bgcolor="#ffffff"><td><a href="#DM_FP_NUMBER_CTOR">Bx: Method invokes ineffi
cient floating-point Number constructor; use static valueOf instead</a></td><td>
Performance</td></tr> | 389 <tr bgcolor="#ffffff"><td><a href="#DM_FP_NUMBER_CTOR">Bx: Method invokes ineffi
cient floating-point Number constructor; use static valueOf instead</a></td><td>
Performance</td></tr> |
| 375 <tr bgcolor="#eeeeee"><td><a href="#DM_NUMBER_CTOR">Bx: Method invokes inefficie
nt Number constructor; use static valueOf instead</a></td><td>Performance</td></
tr> | 390 <tr bgcolor="#eeeeee"><td><a href="#DM_NUMBER_CTOR">Bx: Method invokes inefficie
nt Number constructor; use static valueOf instead</a></td><td>Performance</td></
tr> |
| 376 <tr bgcolor="#ffffff"><td><a href="#DMI_BLOCKING_METHODS_ON_URL">Dm: The equals
and hashCode methods of URL are blocking</a></td><td>Performance</td></tr> | 391 <tr bgcolor="#ffffff"><td><a href="#DMI_BLOCKING_METHODS_ON_URL">Dm: The equals
and hashCode methods of URL are blocking</a></td><td>Performance</td></tr> |
| 377 <tr bgcolor="#eeeeee"><td><a href="#DMI_COLLECTION_OF_URLS">Dm: Maps and sets of
URLs can be performance hogs</a></td><td>Performance</td></tr> | 392 <tr bgcolor="#eeeeee"><td><a href="#DMI_COLLECTION_OF_URLS">Dm: Maps and sets of
URLs can be performance hogs</a></td><td>Performance</td></tr> |
| 378 <tr bgcolor="#ffffff"><td><a href="#DM_BOOLEAN_CTOR">Dm: Method invokes ineffici
ent Boolean constructor; use Boolean.valueOf(...) instead</a></td><td>Performanc
e</td></tr> | 393 <tr bgcolor="#ffffff"><td><a href="#DM_BOOLEAN_CTOR">Dm: Method invokes ineffici
ent Boolean constructor; use Boolean.valueOf(...) instead</a></td><td>Performanc
e</td></tr> |
| 379 <tr bgcolor="#eeeeee"><td><a href="#DM_GC">Dm: Explicit garbage collection; extr
emely dubious except in benchmarking code</a></td><td>Performance</td></tr> | 394 <tr bgcolor="#eeeeee"><td><a href="#DM_GC">Dm: Explicit garbage collection; extr
emely dubious except in benchmarking code</a></td><td>Performance</td></tr> |
| 380 <tr bgcolor="#ffffff"><td><a href="#DM_NEW_FOR_GETCLASS">Dm: Method allocates an
object, only to get the class object</a></td><td>Performance</td></tr> | 395 <tr bgcolor="#ffffff"><td><a href="#DM_NEW_FOR_GETCLASS">Dm: Method allocates an
object, only to get the class object</a></td><td>Performance</td></tr> |
| 381 <tr bgcolor="#eeeeee"><td><a href="#DM_NEXTINT_VIA_NEXTDOUBLE">Dm: Use the nextI
nt method of Random rather than nextDouble to generate a random integer</a></td>
<td>Performance</td></tr> | 396 <tr bgcolor="#eeeeee"><td><a href="#DM_NEXTINT_VIA_NEXTDOUBLE">Dm: Use the nextI
nt method of Random rather than nextDouble to generate a random integer</a></td>
<td>Performance</td></tr> |
| 382 <tr bgcolor="#ffffff"><td><a href="#DM_STRING_CTOR">Dm: Method invokes inefficie
nt new String(String) constructor</a></td><td>Performance</td></tr> | 397 <tr bgcolor="#ffffff"><td><a href="#DM_STRING_CTOR">Dm: Method invokes inefficie
nt new String(String) constructor</a></td><td>Performance</td></tr> |
| 383 <tr bgcolor="#eeeeee"><td><a href="#DM_STRING_TOSTRING">Dm: Method invokes toStr
ing() method on a String</a></td><td>Performance</td></tr> | 398 <tr bgcolor="#eeeeee"><td><a href="#DM_STRING_TOSTRING">Dm: Method invokes toStr
ing() method on a String</a></td><td>Performance</td></tr> |
| 384 <tr bgcolor="#ffffff"><td><a href="#DM_STRING_VOID_CTOR">Dm: Method invokes inef
ficient new String() constructor</a></td><td>Performance</td></tr> | 399 <tr bgcolor="#ffffff"><td><a href="#DM_STRING_VOID_CTOR">Dm: Method invokes inef
ficient new String() constructor</a></td><td>Performance</td></tr> |
| 385 <tr bgcolor="#eeeeee"><td><a href="#HSC_HUGE_SHARED_STRING_CONSTANT">HSC: Huge s
tring constants is duplicated across multiple class files</a></td><td>Performanc
e</td></tr> | 400 <tr bgcolor="#eeeeee"><td><a href="#HSC_HUGE_SHARED_STRING_CONSTANT">HSC: Huge s
tring constants is duplicated across multiple class files</a></td><td>Performanc
e</td></tr> |
| 401 <tr bgcolor="#ffffff"><td><a href="#IIL_ELEMENTS_GET_LENGTH_IN_LOOP">IIL: NodeLi
st.getLength() called in a loop</a></td><td>Performance</td></tr> |
| 402 <tr bgcolor="#eeeeee"><td><a href="#IIL_PATTERN_COMPILE_IN_LOOP">IIL: Method cal
ls Pattern.compile in a loop</a></td><td>Performance</td></tr> |
| 403 <tr bgcolor="#ffffff"><td><a href="#IIL_PATTERN_COMPILE_IN_LOOP_INDIRECT">IIL: M
ethod compiles the regular expression in a loop</a></td><td>Performance</td></tr
> |
| 404 <tr bgcolor="#eeeeee"><td><a href="#IIL_PREPARE_STATEMENT_IN_LOOP">IIL: Method c
alls prepareStatement in a loop</a></td><td>Performance</td></tr> |
| 386 <tr bgcolor="#ffffff"><td><a href="#IIO_INEFFICIENT_INDEX_OF">IIO: Inefficient u
se of String.indexOf(String)</a></td><td>Performance</td></tr> | 405 <tr bgcolor="#ffffff"><td><a href="#IIO_INEFFICIENT_INDEX_OF">IIO: Inefficient u
se of String.indexOf(String)</a></td><td>Performance</td></tr> |
| 387 <tr bgcolor="#eeeeee"><td><a href="#IIO_INEFFICIENT_LAST_INDEX_OF">IIO: Ineffici
ent use of String.lastIndexOf(String)</a></td><td>Performance</td></tr> | 406 <tr bgcolor="#eeeeee"><td><a href="#IIO_INEFFICIENT_LAST_INDEX_OF">IIO: Ineffici
ent use of String.lastIndexOf(String)</a></td><td>Performance</td></tr> |
| 388 <tr bgcolor="#ffffff"><td><a href="#IMA_INEFFICIENT_MEMBER_ACCESS">IMA: Method a
ccesses a private member variable of owning class</a></td><td>Performance</td></
tr> | 407 <tr bgcolor="#ffffff"><td><a href="#IMA_INEFFICIENT_MEMBER_ACCESS">IMA: Method a
ccesses a private member variable of owning class</a></td><td>Performance</td></
tr> |
| 389 <tr bgcolor="#eeeeee"><td><a href="#ITA_INEFFICIENT_TO_ARRAY">ITA: Method uses t
oArray() with zero-length array argument</a></td><td>Performance</td></tr> | 408 <tr bgcolor="#eeeeee"><td><a href="#ITA_INEFFICIENT_TO_ARRAY">ITA: Method uses t
oArray() with zero-length array argument</a></td><td>Performance</td></tr> |
| 390 <tr bgcolor="#ffffff"><td><a href="#SBSC_USE_STRINGBUFFER_CONCATENATION">SBSC: M
ethod concatenates strings using + in a loop</a></td><td>Performance</td></tr> | 409 <tr bgcolor="#ffffff"><td><a href="#SBSC_USE_STRINGBUFFER_CONCATENATION">SBSC: M
ethod concatenates strings using + in a loop</a></td><td>Performance</td></tr> |
| 391 <tr bgcolor="#eeeeee"><td><a href="#SIC_INNER_SHOULD_BE_STATIC">SIC: Should be a
static inner class</a></td><td>Performance</td></tr> | 410 <tr bgcolor="#eeeeee"><td><a href="#SIC_INNER_SHOULD_BE_STATIC">SIC: Should be a
static inner class</a></td><td>Performance</td></tr> |
| 392 <tr bgcolor="#ffffff"><td><a href="#SIC_INNER_SHOULD_BE_STATIC_ANON">SIC: Could
be refactored into a named static inner class</a></td><td>Performance</td></tr> | 411 <tr bgcolor="#ffffff"><td><a href="#SIC_INNER_SHOULD_BE_STATIC_ANON">SIC: Could
be refactored into a named static inner class</a></td><td>Performance</td></tr> |
| 393 <tr bgcolor="#eeeeee"><td><a href="#SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS">SIC:
Could be refactored into a static inner class</a></td><td>Performance</td></tr> | 412 <tr bgcolor="#eeeeee"><td><a href="#SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS">SIC:
Could be refactored into a static inner class</a></td><td>Performance</td></tr> |
| 394 <tr bgcolor="#ffffff"><td><a href="#SS_SHOULD_BE_STATIC">SS: Unread field: shoul
d this field be static?</a></td><td>Performance</td></tr> | 413 <tr bgcolor="#ffffff"><td><a href="#SS_SHOULD_BE_STATIC">SS: Unread field: shoul
d this field be static?</a></td><td>Performance</td></tr> |
| 395 <tr bgcolor="#eeeeee"><td><a href="#UM_UNNECESSARY_MATH">UM: Method calls static
Math class method on a constant value</a></td><td>Performance</td></tr> | 414 <tr bgcolor="#eeeeee"><td><a href="#UM_UNNECESSARY_MATH">UM: Method calls static
Math class method on a constant value</a></td><td>Performance</td></tr> |
| 396 <tr bgcolor="#ffffff"><td><a href="#UPM_UNCALLED_PRIVATE_METHOD">UPM: Private me
thod is never called</a></td><td>Performance</td></tr> | 415 <tr bgcolor="#ffffff"><td><a href="#UPM_UNCALLED_PRIVATE_METHOD">UPM: Private me
thod is never called</a></td><td>Performance</td></tr> |
| 397 <tr bgcolor="#eeeeee"><td><a href="#URF_UNREAD_FIELD">UrF: Unread field</a></td>
<td>Performance</td></tr> | 416 <tr bgcolor="#eeeeee"><td><a href="#URF_UNREAD_FIELD">UrF: Unread field</a></td>
<td>Performance</td></tr> |
| 398 <tr bgcolor="#ffffff"><td><a href="#UUF_UNUSED_FIELD">UuF: Unused field</a></td>
<td>Performance</td></tr> | 417 <tr bgcolor="#ffffff"><td><a href="#UUF_UNUSED_FIELD">UuF: Unused field</a></td>
<td>Performance</td></tr> |
| 399 <tr bgcolor="#eeeeee"><td><a href="#WMI_WRONG_MAP_ITERATOR">WMI: Inefficient use
of keySet iterator instead of entrySet iterator</a></td><td>Performance</td></t
r> | 418 <tr bgcolor="#eeeeee"><td><a href="#WMI_WRONG_MAP_ITERATOR">WMI: Inefficient use
of keySet iterator instead of entrySet iterator</a></td><td>Performance</td></t
r> |
| 400 <tr bgcolor="#ffffff"><td><a href="#DMI_CONSTANT_DB_PASSWORD">Dm: Hardcoded cons
tant database password</a></td><td>Security</td></tr> | 419 <tr bgcolor="#ffffff"><td><a href="#DMI_CONSTANT_DB_PASSWORD">Dm: Hardcoded cons
tant database password</a></td><td>Security</td></tr> |
| 401 <tr bgcolor="#eeeeee"><td><a href="#DMI_EMPTY_DB_PASSWORD">Dm: Empty database pa
ssword</a></td><td>Security</td></tr> | 420 <tr bgcolor="#eeeeee"><td><a href="#DMI_EMPTY_DB_PASSWORD">Dm: Empty database pa
ssword</a></td><td>Security</td></tr> |
| 402 <tr bgcolor="#ffffff"><td><a href="#HRS_REQUEST_PARAMETER_TO_COOKIE">HRS: HTTP c
ookie formed from untrusted input</a></td><td>Security</td></tr> | 421 <tr bgcolor="#ffffff"><td><a href="#HRS_REQUEST_PARAMETER_TO_COOKIE">HRS: HTTP c
ookie formed from untrusted input</a></td><td>Security</td></tr> |
| 403 <tr bgcolor="#eeeeee"><td><a href="#HRS_REQUEST_PARAMETER_TO_HTTP_HEADER">HRS: H
TTP Response splitting vulnerability</a></td><td>Security</td></tr> | 422 <tr bgcolor="#eeeeee"><td><a href="#HRS_REQUEST_PARAMETER_TO_HTTP_HEADER">HRS: H
TTP Response splitting vulnerability</a></td><td>Security</td></tr> |
| 404 <tr bgcolor="#ffffff"><td><a href="#PT_ABSOLUTE_PATH_TRAVERSAL">PT: Absolute pat
h traversal in servlet</a></td><td>Security</td></tr> | 423 <tr bgcolor="#ffffff"><td><a href="#PT_ABSOLUTE_PATH_TRAVERSAL">PT: Absolute pat
h traversal in servlet</a></td><td>Security</td></tr> |
| 405 <tr bgcolor="#eeeeee"><td><a href="#PT_RELATIVE_PATH_TRAVERSAL">PT: Relative pat
h traversal in servlet</a></td><td>Security</td></tr> | 424 <tr bgcolor="#eeeeee"><td><a href="#PT_RELATIVE_PATH_TRAVERSAL">PT: Relative pat
h traversal in servlet</a></td><td>Security</td></tr> |
| 406 <tr bgcolor="#ffffff"><td><a href="#SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE">SQ
L: Nonconstant string passed to execute method on an SQL statement</a></td><td>S
ecurity</td></tr> | 425 <tr bgcolor="#ffffff"><td><a href="#SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE">SQ
L: Nonconstant string passed to execute or addBatch method on an SQL statement</
a></td><td>Security</td></tr> |
| 407 <tr bgcolor="#eeeeee"><td><a href="#SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCON
STANT_STRING">SQL: A prepared statement is generated from a nonconstant String</
a></td><td>Security</td></tr> | 426 <tr bgcolor="#eeeeee"><td><a href="#SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCON
STANT_STRING">SQL: A prepared statement is generated from a nonconstant String</
a></td><td>Security</td></tr> |
| 408 <tr bgcolor="#ffffff"><td><a href="#XSS_REQUEST_PARAMETER_TO_JSP_WRITER">XSS: JS
P reflected cross site scripting vulnerability</a></td><td>Security</td></tr> | 427 <tr bgcolor="#ffffff"><td><a href="#XSS_REQUEST_PARAMETER_TO_JSP_WRITER">XSS: JS
P reflected cross site scripting vulnerability</a></td><td>Security</td></tr> |
| 409 <tr bgcolor="#eeeeee"><td><a href="#XSS_REQUEST_PARAMETER_TO_SEND_ERROR">XSS: Se
rvlet reflected cross site scripting vulnerability in error page</a></td><td>Sec
urity</td></tr> | 428 <tr bgcolor="#eeeeee"><td><a href="#XSS_REQUEST_PARAMETER_TO_SEND_ERROR">XSS: Se
rvlet reflected cross site scripting vulnerability in error page</a></td><td>Sec
urity</td></tr> |
| 410 <tr bgcolor="#ffffff"><td><a href="#XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER">XSS
: Servlet reflected cross site scripting vulnerability</a></td><td>Security</td>
</tr> | 429 <tr bgcolor="#ffffff"><td><a href="#XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER">XSS
: Servlet reflected cross site scripting vulnerability</a></td><td>Security</td>
</tr> |
| 411 <tr bgcolor="#eeeeee"><td><a href="#BC_BAD_CAST_TO_ABSTRACT_COLLECTION">BC: Ques
tionable cast to abstract collection </a></td><td>Dodgy code</td></tr> | 430 <tr bgcolor="#eeeeee"><td><a href="#BC_BAD_CAST_TO_ABSTRACT_COLLECTION">BC: Ques
tionable cast to abstract collection </a></td><td>Dodgy code</td></tr> |
| 412 <tr bgcolor="#ffffff"><td><a href="#BC_BAD_CAST_TO_CONCRETE_COLLECTION">BC: Ques
tionable cast to concrete collection</a></td><td>Dodgy code</td></tr> | 431 <tr bgcolor="#ffffff"><td><a href="#BC_BAD_CAST_TO_CONCRETE_COLLECTION">BC: Ques
tionable cast to concrete collection</a></td><td>Dodgy code</td></tr> |
| 413 <tr bgcolor="#eeeeee"><td><a href="#BC_UNCONFIRMED_CAST">BC: Unchecked/unconfirm
ed cast</a></td><td>Dodgy code</td></tr> | 432 <tr bgcolor="#eeeeee"><td><a href="#BC_UNCONFIRMED_CAST">BC: Unchecked/unconfirm
ed cast</a></td><td>Dodgy code</td></tr> |
| 414 <tr bgcolor="#ffffff"><td><a href="#BC_UNCONFIRMED_CAST_OF_RETURN_VALUE">BC: Unc
hecked/unconfirmed cast of return value from method</a></td><td>Dodgy code</td><
/tr> | 433 <tr bgcolor="#ffffff"><td><a href="#BC_UNCONFIRMED_CAST_OF_RETURN_VALUE">BC: Unc
hecked/unconfirmed cast of return value from method</a></td><td>Dodgy code</td><
/tr> |
| 415 <tr bgcolor="#eeeeee"><td><a href="#BC_VACUOUS_INSTANCEOF">BC: instanceof will a
lways return true</a></td><td>Dodgy code</td></tr> | 434 <tr bgcolor="#eeeeee"><td><a href="#BC_VACUOUS_INSTANCEOF">BC: instanceof will a
lways return true</a></td><td>Dodgy code</td></tr> |
| 416 <tr bgcolor="#ffffff"><td><a href="#ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT">BSH
IFT: Unsigned right shift cast to short/byte</a></td><td>Dodgy code</td></tr> | 435 <tr bgcolor="#ffffff"><td><a href="#ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT">BSH
IFT: Unsigned right shift cast to short/byte</a></td><td>Dodgy code</td></tr> |
| 417 <tr bgcolor="#eeeeee"><td><a href="#CD_CIRCULAR_DEPENDENCY">CD: Test for circula
r dependencies among classes</a></td><td>Dodgy code</td></tr> | 436 <tr bgcolor="#eeeeee"><td><a href="#CAA_COVARIANT_ARRAY_FIELD">CAA: Covariant ar
ray assignment to a field</a></td><td>Dodgy code</td></tr> |
| 418 <tr bgcolor="#ffffff"><td><a href="#CI_CONFUSED_INHERITANCE">CI: Class is final
but declares protected field</a></td><td>Dodgy code</td></tr> | 437 <tr bgcolor="#ffffff"><td><a href="#CAA_COVARIANT_ARRAY_LOCAL">CAA: Covariant ar
ray assignment to a local variable</a></td><td>Dodgy code</td></tr> |
| 419 <tr bgcolor="#eeeeee"><td><a href="#DB_DUPLICATE_BRANCHES">DB: Method uses the s
ame code for two branches</a></td><td>Dodgy code</td></tr> | 438 <tr bgcolor="#eeeeee"><td><a href="#CAA_COVARIANT_ARRAY_RETURN">CAA: Covariant a
rray is returned from the method</a></td><td>Dodgy code</td></tr> |
| 420 <tr bgcolor="#ffffff"><td><a href="#DB_DUPLICATE_SWITCH_CLAUSES">DB: Method uses
the same code for two switch clauses</a></td><td>Dodgy code</td></tr> | 439 <tr bgcolor="#ffffff"><td><a href="#CD_CIRCULAR_DEPENDENCY">CD: Test for circula
r dependencies among classes</a></td><td>Dodgy code</td></tr> |
| 421 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_LOCAL_STORE">DLS: Dead store to loc
al variable</a></td><td>Dodgy code</td></tr> | 440 <tr bgcolor="#eeeeee"><td><a href="#CI_CONFUSED_INHERITANCE">CI: Class is final
but declares protected field</a></td><td>Dodgy code</td></tr> |
| 422 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_LOCAL_STORE_IN_RETURN">DLS: Useless
assignment in return statement</a></td><td>Dodgy code</td></tr> | 441 <tr bgcolor="#ffffff"><td><a href="#DB_DUPLICATE_BRANCHES">DB: Method uses the s
ame code for two branches</a></td><td>Dodgy code</td></tr> |
| 423 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_LOCAL_STORE_OF_NULL">DLS: Dead stor
e of null to local variable</a></td><td>Dodgy code</td></tr> | 442 <tr bgcolor="#eeeeee"><td><a href="#DB_DUPLICATE_SWITCH_CLAUSES">DB: Method uses
the same code for two switch clauses</a></td><td>Dodgy code</td></tr> |
| 424 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_LOCAL_STORE_SHADOWS_FIELD">DLS: Dea
d store to local variable that shadows field</a></td><td>Dodgy code</td></tr> | 443 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_LOCAL_STORE">DLS: Dead store to loc
al variable</a></td><td>Dodgy code</td></tr> |
| 425 <tr bgcolor="#eeeeee"><td><a href="#DMI_HARDCODED_ABSOLUTE_FILENAME">DMI: Code c
ontains a hard coded reference to an absolute pathname</a></td><td>Dodgy code</t
d></tr> | 444 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_LOCAL_STORE_IN_RETURN">DLS: Useless
assignment in return statement</a></td><td>Dodgy code</td></tr> |
| 426 <tr bgcolor="#ffffff"><td><a href="#DMI_NONSERIALIZABLE_OBJECT_WRITTEN">DMI: Non
serializable object written to ObjectOutput</a></td><td>Dodgy code</td></tr> | 445 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_LOCAL_STORE_OF_NULL">DLS: Dead stor
e of null to local variable</a></td><td>Dodgy code</td></tr> |
| 427 <tr bgcolor="#eeeeee"><td><a href="#DMI_USELESS_SUBSTRING">DMI: Invocation of su
bstring(0), which returns the original value</a></td><td>Dodgy code</td></tr> | 446 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_LOCAL_STORE_SHADOWS_FIELD">DLS: Dea
d store to local variable that shadows field</a></td><td>Dodgy code</td></tr> |
| 428 <tr bgcolor="#ffffff"><td><a href="#DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED">D
m: Thread passed where Runnable expected</a></td><td>Dodgy code</td></tr> | 447 <tr bgcolor="#ffffff"><td><a href="#DMI_HARDCODED_ABSOLUTE_FILENAME">DMI: Code c
ontains a hard coded reference to an absolute pathname</a></td><td>Dodgy code</t
d></tr> |
| 429 <tr bgcolor="#eeeeee"><td><a href="#DMI_UNSUPPORTED_METHOD">Dm: Call to unsuppor
ted method</a></td><td>Dodgy code</td></tr> | 448 <tr bgcolor="#eeeeee"><td><a href="#DMI_NONSERIALIZABLE_OBJECT_WRITTEN">DMI: Non
serializable object written to ObjectOutput</a></td><td>Dodgy code</td></tr> |
| 430 <tr bgcolor="#ffffff"><td><a href="#EQ_DOESNT_OVERRIDE_EQUALS">Eq: Class doesn't
override equals in superclass</a></td><td>Dodgy code</td></tr> | 449 <tr bgcolor="#ffffff"><td><a href="#DMI_USELESS_SUBSTRING">DMI: Invocation of su
bstring(0), which returns the original value</a></td><td>Dodgy code</td></tr> |
| 431 <tr bgcolor="#eeeeee"><td><a href="#EQ_UNUSUAL">Eq: Unusual equals method </a></
td><td>Dodgy code</td></tr> | 450 <tr bgcolor="#eeeeee"><td><a href="#DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED">D
m: Thread passed where Runnable expected</a></td><td>Dodgy code</td></tr> |
| 432 <tr bgcolor="#ffffff"><td><a href="#FE_FLOATING_POINT_EQUALITY">FE: Test for flo
ating point equality</a></td><td>Dodgy code</td></tr> | 451 <tr bgcolor="#ffffff"><td><a href="#DMI_UNSUPPORTED_METHOD">Dm: Call to unsuppor
ted method</a></td><td>Dodgy code</td></tr> |
| 433 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN">
FS: Non-Boolean argument formatted using %b format specifier</a></td><td>Dodgy c
ode</td></tr> | 452 <tr bgcolor="#eeeeee"><td><a href="#EQ_DOESNT_OVERRIDE_EQUALS">Eq: Class doesn't
override equals in superclass</a></td><td>Dodgy code</td></tr> |
| 434 <tr bgcolor="#ffffff"><td><a href="#IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTE
R_METHOD">IA: Potentially ambiguous invocation of either an inherited or outer m
ethod</a></td><td>Dodgy code</td></tr> | 453 <tr bgcolor="#ffffff"><td><a href="#EQ_UNUSUAL">Eq: Unusual equals method </a></
td><td>Dodgy code</td></tr> |
| 435 <tr bgcolor="#eeeeee"><td><a href="#IC_INIT_CIRCULARITY">IC: Initialization circ
ularity</a></td><td>Dodgy code</td></tr> | 454 <tr bgcolor="#eeeeee"><td><a href="#FE_FLOATING_POINT_EQUALITY">FE: Test for flo
ating point equality</a></td><td>Dodgy code</td></tr> |
| 436 <tr bgcolor="#ffffff"><td><a href="#ICAST_IDIV_CAST_TO_DOUBLE">ICAST: Integral d
ivision result cast to double or float</a></td><td>Dodgy code</td></tr> | 455 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN">
FS: Non-Boolean argument formatted using %b format specifier</a></td><td>Dodgy c
ode</td></tr> |
| 437 <tr bgcolor="#eeeeee"><td><a href="#ICAST_INTEGER_MULTIPLY_CAST_TO_LONG">ICAST:
Result of integer multiplication cast to long</a></td><td>Dodgy code</td></tr> | 456 <tr bgcolor="#eeeeee"><td><a href="#IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTE
R_METHOD">IA: Potentially ambiguous invocation of either an inherited or outer m
ethod</a></td><td>Dodgy code</td></tr> |
| 438 <tr bgcolor="#ffffff"><td><a href="#IM_AVERAGE_COMPUTATION_COULD_OVERFLOW">IM: C
omputation of average could overflow</a></td><td>Dodgy code</td></tr> | 457 <tr bgcolor="#ffffff"><td><a href="#IC_INIT_CIRCULARITY">IC: Initialization circ
ularity</a></td><td>Dodgy code</td></tr> |
| 439 <tr bgcolor="#eeeeee"><td><a href="#IM_BAD_CHECK_FOR_ODD">IM: Check for oddness
that won't work for negative numbers </a></td><td>Dodgy code</td></tr> | 458 <tr bgcolor="#eeeeee"><td><a href="#ICAST_IDIV_CAST_TO_DOUBLE">ICAST: Integral d
ivision result cast to double or float</a></td><td>Dodgy code</td></tr> |
| 440 <tr bgcolor="#ffffff"><td><a href="#INT_BAD_REM_BY_1">INT: Integer remainder mod
ulo 1</a></td><td>Dodgy code</td></tr> | 459 <tr bgcolor="#ffffff"><td><a href="#ICAST_INTEGER_MULTIPLY_CAST_TO_LONG">ICAST:
Result of integer multiplication cast to long</a></td><td>Dodgy code</td></tr> |
| 441 <tr bgcolor="#eeeeee"><td><a href="#INT_VACUOUS_BIT_OPERATION">INT: Vacuous bit
mask operation on integer value</a></td><td>Dodgy code</td></tr> | 460 <tr bgcolor="#eeeeee"><td><a href="#IM_AVERAGE_COMPUTATION_COULD_OVERFLOW">IM: C
omputation of average could overflow</a></td><td>Dodgy code</td></tr> |
| 442 <tr bgcolor="#ffffff"><td><a href="#INT_VACUOUS_COMPARISON">INT: Vacuous compari
son of integer value</a></td><td>Dodgy code</td></tr> | 461 <tr bgcolor="#ffffff"><td><a href="#IM_BAD_CHECK_FOR_ODD">IM: Check for oddness
that won't work for negative numbers </a></td><td>Dodgy code</td></tr> |
| 443 <tr bgcolor="#eeeeee"><td><a href="#MTIA_SUSPECT_SERVLET_INSTANCE_FIELD">MTIA: C
lass extends Servlet class and uses instance variables</a></td><td>Dodgy code</t
d></tr> | 462 <tr bgcolor="#eeeeee"><td><a href="#INT_BAD_REM_BY_1">INT: Integer remainder mod
ulo 1</a></td><td>Dodgy code</td></tr> |
| 444 <tr bgcolor="#ffffff"><td><a href="#MTIA_SUSPECT_STRUTS_INSTANCE_FIELD">MTIA: Cl
ass extends Struts Action class and uses instance variables</a></td><td>Dodgy co
de</td></tr> | 463 <tr bgcolor="#ffffff"><td><a href="#INT_VACUOUS_BIT_OPERATION">INT: Vacuous bit
mask operation on integer value</a></td><td>Dodgy code</td></tr> |
| 445 <tr bgcolor="#eeeeee"><td><a href="#NP_DEREFERENCE_OF_READLINE_VALUE">NP: Derefe
rence of the result of readLine() without nullcheck</a></td><td>Dodgy code</td><
/tr> | 464 <tr bgcolor="#eeeeee"><td><a href="#INT_VACUOUS_COMPARISON">INT: Vacuous compari
son of integer value</a></td><td>Dodgy code</td></tr> |
| 446 <tr bgcolor="#ffffff"><td><a href="#NP_IMMEDIATE_DEREFERENCE_OF_READLINE">NP: Im
mediate dereference of the result of readLine()</a></td><td>Dodgy code</td></tr> | 465 <tr bgcolor="#ffffff"><td><a href="#MTIA_SUSPECT_SERVLET_INSTANCE_FIELD">MTIA: C
lass extends Servlet class and uses instance variables</a></td><td>Dodgy code</t
d></tr> |
| 447 <tr bgcolor="#eeeeee"><td><a href="#NP_LOAD_OF_KNOWN_NULL_VALUE">NP: Load of kno
wn null value</a></td><td>Dodgy code</td></tr> | 466 <tr bgcolor="#eeeeee"><td><a href="#MTIA_SUSPECT_STRUTS_INSTANCE_FIELD">MTIA: Cl
ass extends Struts Action class and uses instance variables</a></td><td>Dodgy co
de</td></tr> |
| 448 <tr bgcolor="#ffffff"><td><a href="#NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION">NP:
Method tightens nullness annotation on parameter</a></td><td>Dodgy code</td></t
r> | 467 <tr bgcolor="#ffffff"><td><a href="#NP_DEREFERENCE_OF_READLINE_VALUE">NP: Derefe
rence of the result of readLine() without nullcheck</a></td><td>Dodgy code</td><
/tr> |
| 449 <tr bgcolor="#eeeeee"><td><a href="#NP_METHOD_RETURN_RELAXING_ANNOTATION">NP: Me
thod relaxes nullness annotation on return value</a></td><td>Dodgy code</td></tr
> | 468 <tr bgcolor="#eeeeee"><td><a href="#NP_IMMEDIATE_DEREFERENCE_OF_READLINE">NP: Im
mediate dereference of the result of readLine()</a></td><td>Dodgy code</td></tr> |
| 450 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE">NP:
Possible null pointer dereference due to return value of called method</a></td><
td>Dodgy code</td></tr> | 469 <tr bgcolor="#ffffff"><td><a href="#NP_LOAD_OF_KNOWN_NULL_VALUE">NP: Load of kno
wn null value</a></td><td>Dodgy code</td></tr> |
| 451 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE">NP
: Possible null pointer dereference on branch that might be infeasible</a></td><
td>Dodgy code</td></tr> | 470 <tr bgcolor="#eeeeee"><td><a href="#NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION">NP:
Method tightens nullness annotation on parameter</a></td><td>Dodgy code</td></t
r> |
| 452 <tr bgcolor="#ffffff"><td><a href="#NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_N
ULLABLE">NP: Parameter must be nonnull but is marked as nullable</a></td><td>Dod
gy code</td></tr> | 471 <tr bgcolor="#ffffff"><td><a href="#NP_METHOD_RETURN_RELAXING_ANNOTATION">NP: Me
thod relaxes nullness annotation on return value</a></td><td>Dodgy code</td></tr
> |
| 453 <tr bgcolor="#eeeeee"><td><a href="#NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">NP:
Read of unwritten public or protected field</a></td><td>Dodgy code</td></tr> | 472 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE">NP:
Possible null pointer dereference due to return value of called method</a></td><
td>Dodgy code</td></tr> |
| 454 <tr bgcolor="#ffffff"><td><a href="#NS_DANGEROUS_NON_SHORT_CIRCUIT">NS: Potentia
lly dangerous use of non-short-circuit logic</a></td><td>Dodgy code</td></tr> | 473 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE">NP
: Possible null pointer dereference on branch that might be infeasible</a></td><
td>Dodgy code</td></tr> |
| 455 <tr bgcolor="#eeeeee"><td><a href="#NS_NON_SHORT_CIRCUIT">NS: Questionable use o
f non-short-circuit logic</a></td><td>Dodgy code</td></tr> | 474 <tr bgcolor="#eeeeee"><td><a href="#NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_N
ULLABLE">NP: Parameter must be non-null but is marked as nullable</a></td><td>Do
dgy code</td></tr> |
| 456 <tr bgcolor="#ffffff"><td><a href="#PS_PUBLIC_SEMAPHORES">PS: Class exposes sync
hronization and semaphores in its public interface</a></td><td>Dodgy code</td></
tr> | 475 <tr bgcolor="#ffffff"><td><a href="#NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">NP:
Read of unwritten public or protected field</a></td><td>Dodgy code</td></tr> |
| 457 <tr bgcolor="#eeeeee"><td><a href="#PZLA_PREFER_ZERO_LENGTH_ARRAYS">PZLA: Consid
er returning a zero length array rather than null</a></td><td>Dodgy code</td></t
r> | 476 <tr bgcolor="#eeeeee"><td><a href="#NS_DANGEROUS_NON_SHORT_CIRCUIT">NS: Potentia
lly dangerous use of non-short-circuit logic</a></td><td>Dodgy code</td></tr> |
| 458 <tr bgcolor="#ffffff"><td><a href="#QF_QUESTIONABLE_FOR_LOOP">QF: Complicated, s
ubtle or wrong increment in for-loop </a></td><td>Dodgy code</td></tr> | 477 <tr bgcolor="#ffffff"><td><a href="#NS_NON_SHORT_CIRCUIT">NS: Questionable use o
f non-short-circuit logic</a></td><td>Dodgy code</td></tr> |
| 459 <tr bgcolor="#eeeeee"><td><a href="#RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL
_VALUE">RCN: Redundant comparison of non-null value to null</a></td><td>Dodgy co
de</td></tr> | 478 <tr bgcolor="#eeeeee"><td><a href="#PS_PUBLIC_SEMAPHORES">PS: Class exposes sync
hronization and semaphores in its public interface</a></td><td>Dodgy code</td></
tr> |
| 460 <tr bgcolor="#ffffff"><td><a href="#RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES">RC
N: Redundant comparison of two null values</a></td><td>Dodgy code</td></tr> | 479 <tr bgcolor="#ffffff"><td><a href="#PZLA_PREFER_ZERO_LENGTH_ARRAYS">PZLA: Consid
er returning a zero length array rather than null</a></td><td>Dodgy code</td></t
r> |
| 461 <tr bgcolor="#eeeeee"><td><a href="#RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE">RC
N: Redundant nullcheck of value known to be non-null</a></td><td>Dodgy code</td>
</tr> | 480 <tr bgcolor="#eeeeee"><td><a href="#QF_QUESTIONABLE_FOR_LOOP">QF: Complicated, s
ubtle or wrong increment in for-loop </a></td><td>Dodgy code</td></tr> |
| 462 <tr bgcolor="#ffffff"><td><a href="#RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE">RCN:
Redundant nullcheck of value known to be null</a></td><td>Dodgy code</td></tr> | 481 <tr bgcolor="#ffffff"><td><a href="#RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL
_VALUE">RCN: Redundant comparison of non-null value to null</a></td><td>Dodgy co
de</td></tr> |
| 463 <tr bgcolor="#eeeeee"><td><a href="#REC_CATCH_EXCEPTION">REC: Exception is caugh
t when Exception is not thrown</a></td><td>Dodgy code</td></tr> | 482 <tr bgcolor="#eeeeee"><td><a href="#RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES">RC
N: Redundant comparison of two null values</a></td><td>Dodgy code</td></tr> |
| 464 <tr bgcolor="#ffffff"><td><a href="#RI_REDUNDANT_INTERFACES">RI: Class implement
s same interface as superclass</a></td><td>Dodgy code</td></tr> | 483 <tr bgcolor="#ffffff"><td><a href="#RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE">RC
N: Redundant nullcheck of value known to be non-null</a></td><td>Dodgy code</td>
</tr> |
| 465 <tr bgcolor="#eeeeee"><td><a href="#RV_CHECK_FOR_POSITIVE_INDEXOF">RV: Method ch
ecks to see if result of String.indexOf is positive</a></td><td>Dodgy code</td><
/tr> | 484 <tr bgcolor="#eeeeee"><td><a href="#RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE">RCN:
Redundant nullcheck of value known to be null</a></td><td>Dodgy code</td></tr> |
| 466 <tr bgcolor="#ffffff"><td><a href="#RV_DONT_JUST_NULL_CHECK_READLINE">RV: Method
discards result of readLine after checking if it is nonnull</a></td><td>Dodgy c
ode</td></tr> | 485 <tr bgcolor="#ffffff"><td><a href="#REC_CATCH_EXCEPTION">REC: Exception is caugh
t when Exception is not thrown</a></td><td>Dodgy code</td></tr> |
| 467 <tr bgcolor="#eeeeee"><td><a href="#RV_REM_OF_HASHCODE">RV: Remainder of hashCod
e could be negative</a></td><td>Dodgy code</td></tr> | 486 <tr bgcolor="#eeeeee"><td><a href="#RI_REDUNDANT_INTERFACES">RI: Class implement
s same interface as superclass</a></td><td>Dodgy code</td></tr> |
| 468 <tr bgcolor="#ffffff"><td><a href="#RV_REM_OF_RANDOM_INT">RV: Remainder of 32-bi
t signed random integer</a></td><td>Dodgy code</td></tr> | 487 <tr bgcolor="#ffffff"><td><a href="#RV_CHECK_FOR_POSITIVE_INDEXOF">RV: Method ch
ecks to see if result of String.indexOf is positive</a></td><td>Dodgy code</td><
/tr> |
| 469 <tr bgcolor="#eeeeee"><td><a href="#RV_RETURN_VALUE_IGNORED_INFERRED">RV: Method
ignores return value, is this OK?</a></td><td>Dodgy code</td></tr> | 488 <tr bgcolor="#eeeeee"><td><a href="#RV_DONT_JUST_NULL_CHECK_READLINE">RV: Method
discards result of readLine after checking if it is non-null</a></td><td>Dodgy
code</td></tr> |
| 489 <tr bgcolor="#ffffff"><td><a href="#RV_REM_OF_HASHCODE">RV: Remainder of hashCod
e could be negative</a></td><td>Dodgy code</td></tr> |
| 490 <tr bgcolor="#eeeeee"><td><a href="#RV_REM_OF_RANDOM_INT">RV: Remainder of 32-bi
t signed random integer</a></td><td>Dodgy code</td></tr> |
| 491 <tr bgcolor="#ffffff"><td><a href="#RV_RETURN_VALUE_IGNORED_INFERRED">RV: Method
ignores return value, is this OK?</a></td><td>Dodgy code</td></tr> |
| 492 <tr bgcolor="#eeeeee"><td><a href="#RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT">RV:
Return value of method without side effect is ignored</a></td><td>Dodgy code</td
></tr> |
| 470 <tr bgcolor="#ffffff"><td><a href="#SA_FIELD_DOUBLE_ASSIGNMENT">SA: Double assig
nment of field</a></td><td>Dodgy code</td></tr> | 493 <tr bgcolor="#ffffff"><td><a href="#SA_FIELD_DOUBLE_ASSIGNMENT">SA: Double assig
nment of field</a></td><td>Dodgy code</td></tr> |
| 471 <tr bgcolor="#eeeeee"><td><a href="#SA_LOCAL_DOUBLE_ASSIGNMENT">SA: Double assig
nment of local variable </a></td><td>Dodgy code</td></tr> | 494 <tr bgcolor="#eeeeee"><td><a href="#SA_LOCAL_DOUBLE_ASSIGNMENT">SA: Double assig
nment of local variable </a></td><td>Dodgy code</td></tr> |
| 472 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_ASSIGNMENT">SA: Self assignmen
t of local variable</a></td><td>Dodgy code</td></tr> | 495 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_ASSIGNMENT">SA: Self assignmen
t of local variable</a></td><td>Dodgy code</td></tr> |
| 473 <tr bgcolor="#eeeeee"><td><a href="#SF_SWITCH_FALLTHROUGH">SF: Switch statement
found where one case falls through to the next case</a></td><td>Dodgy code</td><
/tr> | 496 <tr bgcolor="#eeeeee"><td><a href="#SF_SWITCH_FALLTHROUGH">SF: Switch statement
found where one case falls through to the next case</a></td><td>Dodgy code</td><
/tr> |
| 474 <tr bgcolor="#ffffff"><td><a href="#SF_SWITCH_NO_DEFAULT">SF: Switch statement f
ound where default case is missing</a></td><td>Dodgy code</td></tr> | 497 <tr bgcolor="#ffffff"><td><a href="#SF_SWITCH_NO_DEFAULT">SF: Switch statement f
ound where default case is missing</a></td><td>Dodgy code</td></tr> |
| 475 <tr bgcolor="#eeeeee"><td><a href="#ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD">ST:
Write to static field from instance method</a></td><td>Dodgy code</td></tr> | 498 <tr bgcolor="#eeeeee"><td><a href="#ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD">ST:
Write to static field from instance method</a></td><td>Dodgy code</td></tr> |
| 476 <tr bgcolor="#ffffff"><td><a href="#SE_PRIVATE_READ_RESOLVE_NOT_INHERITED">Se: P
rivate readResolve method not inherited by subclasses</a></td><td>Dodgy code</td
></tr> | 499 <tr bgcolor="#ffffff"><td><a href="#SE_PRIVATE_READ_RESOLVE_NOT_INHERITED">Se: P
rivate readResolve method not inherited by subclasses</a></td><td>Dodgy code</td
></tr> |
| 477 <tr bgcolor="#eeeeee"><td><a href="#SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS"
>Se: Transient field of class that isn't Serializable. </a></td><td>Dodgy code</
td></tr> | 500 <tr bgcolor="#eeeeee"><td><a href="#SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS"
>Se: Transient field of class that isn't Serializable. </a></td><td>Dodgy code</
td></tr> |
| 478 <tr bgcolor="#ffffff"><td><a href="#TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALW
AYS_SINK">TQ: Value required to have type qualifier, but marked as unknown</a></
td><td>Dodgy code</td></tr> | 501 <tr bgcolor="#ffffff"><td><a href="#TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALW
AYS_SINK">TQ: Value required to have type qualifier, but marked as unknown</a></
td><td>Dodgy code</td></tr> |
| 479 <tr bgcolor="#eeeeee"><td><a href="#TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEV
ER_SINK">TQ: Value required to not have type qualifier, but marked as unknown</a
></td><td>Dodgy code</td></tr> | 502 <tr bgcolor="#eeeeee"><td><a href="#TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEV
ER_SINK">TQ: Value required to not have type qualifier, but marked as unknown</a
></td><td>Dodgy code</td></tr> |
| 480 <tr bgcolor="#ffffff"><td><a href="#UCF_USELESS_CONTROL_FLOW">UCF: Useless contr
ol flow</a></td><td>Dodgy code</td></tr> | 503 <tr bgcolor="#ffffff"><td><a href="#UC_USELESS_CONDITION">UC: Condition has no e
ffect</a></td><td>Dodgy code</td></tr> |
| 481 <tr bgcolor="#eeeeee"><td><a href="#UCF_USELESS_CONTROL_FLOW_NEXT_LINE">UCF: Use
less control flow to next line</a></td><td>Dodgy code</td></tr> | 504 <tr bgcolor="#eeeeee"><td><a href="#UC_USELESS_CONDITION_TYPE">UC: Condition has
no effect due to the variable type</a></td><td>Dodgy code</td></tr> |
| 482 <tr bgcolor="#ffffff"><td><a href="#USM_USELESS_ABSTRACT_METHOD">USM: Abstract M
ethod is already defined in implemented interface</a></td><td>Dodgy code</td></t
r> | 505 <tr bgcolor="#ffffff"><td><a href="#UC_USELESS_OBJECT">UC: Useless object create
d</a></td><td>Dodgy code</td></tr> |
| 483 <tr bgcolor="#eeeeee"><td><a href="#USM_USELESS_SUBCLASS_METHOD">USM: Method sup
erfluously delegates to parent class method</a></td><td>Dodgy code</td></tr> | 506 <tr bgcolor="#eeeeee"><td><a href="#UC_USELESS_OBJECT_STACK">UC: Useless object
created on stack</a></td><td>Dodgy code</td></tr> |
| 484 <tr bgcolor="#ffffff"><td><a href="#URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD">UrF: U
nread public/protected field</a></td><td>Dodgy code</td></tr> | 507 <tr bgcolor="#ffffff"><td><a href="#UC_USELESS_VOID_METHOD">UC: Useless non-empt
y void method</a></td><td>Dodgy code</td></tr> |
| 485 <tr bgcolor="#eeeeee"><td><a href="#UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD">UuF: U
nused public or protected field</a></td><td>Dodgy code</td></tr> | 508 <tr bgcolor="#eeeeee"><td><a href="#UCF_USELESS_CONTROL_FLOW">UCF: Useless contr
ol flow</a></td><td>Dodgy code</td></tr> |
| 486 <tr bgcolor="#ffffff"><td><a href="#UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">Uw
F: Field not initialized in constructor but dereferenced without null check</a><
/td><td>Dodgy code</td></tr> | 509 <tr bgcolor="#ffffff"><td><a href="#UCF_USELESS_CONTROL_FLOW_NEXT_LINE">UCF: Use
less control flow to next line</a></td><td>Dodgy code</td></tr> |
| 487 <tr bgcolor="#eeeeee"><td><a href="#UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">UwF
: Unwritten public or protected field</a></td><td>Dodgy code</td></tr> | 510 <tr bgcolor="#eeeeee"><td><a href="#USM_USELESS_ABSTRACT_METHOD">USM: Abstract M
ethod is already defined in implemented interface</a></td><td>Dodgy code</td></t
r> |
| 488 <tr bgcolor="#ffffff"><td><a href="#XFB_XML_FACTORY_BYPASS">XFB: Method directly
allocates a specific implementation of xml interfaces</a></td><td>Dodgy code</t
d></tr> | 511 <tr bgcolor="#ffffff"><td><a href="#USM_USELESS_SUBCLASS_METHOD">USM: Method sup
erfluously delegates to parent class method</a></td><td>Dodgy code</td></tr> |
| 512 <tr bgcolor="#eeeeee"><td><a href="#URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD">UrF: U
nread public/protected field</a></td><td>Dodgy code</td></tr> |
| 513 <tr bgcolor="#ffffff"><td><a href="#UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD">UuF: U
nused public or protected field</a></td><td>Dodgy code</td></tr> |
| 514 <tr bgcolor="#eeeeee"><td><a href="#UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">Uw
F: Field not initialized in constructor but dereferenced without null check</a><
/td><td>Dodgy code</td></tr> |
| 515 <tr bgcolor="#ffffff"><td><a href="#UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">UwF
: Unwritten public or protected field</a></td><td>Dodgy code</td></tr> |
| 516 <tr bgcolor="#eeeeee"><td><a href="#XFB_XML_FACTORY_BYPASS">XFB: Method directly
allocates a specific implementation of xml interfaces</a></td><td>Dodgy code</t
d></tr> |
| 489 </table> | 517 </table> |
| 490 <h2>Descriptions</h2> | 518 <h2>Descriptions</h2> |
| 491 <h3><a name="AM_CREATES_EMPTY_JAR_FILE_ENTRY">AM: Creates an empty jar file entr
y (AM_CREATES_EMPTY_JAR_FILE_ENTRY)</a></h3> | 519 <h3><a name="AM_CREATES_EMPTY_JAR_FILE_ENTRY">AM: Creates an empty jar file entr
y (AM_CREATES_EMPTY_JAR_FILE_ENTRY)</a></h3> |
| 492 | 520 |
| 493 | 521 |
| 494 <p>The code calls <code>putNextEntry()</code>, immediately | 522 <p>The code calls <code>putNextEntry()</code>, immediately |
| 495 followed by a call to <code>closeEntry()</code>. This results | 523 followed by a call to <code>closeEntry()</code>. This results |
| 496 in an empty JarFile entry. The contents of the entry | 524 in an empty JarFile entry. The contents of the entry |
| 497 should be written to the JarFile between the calls to | 525 should be written to the JarFile between the calls to |
| 498 <code>putNextEntry()</code> and | 526 <code>putNextEntry()</code> and |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 | 602 |
| 575 <h3><a name="CO_ABSTRACT_SELF">Co: Abstract class defines covariant compareTo()
method (CO_ABSTRACT_SELF)</a></h3> | 603 <h3><a name="CO_ABSTRACT_SELF">Co: Abstract class defines covariant compareTo()
method (CO_ABSTRACT_SELF)</a></h3> |
| 576 | 604 |
| 577 | 605 |
| 578 <p> This class defines a covariant version of <code>compareTo()</code>. | 606 <p> This class defines a covariant version of <code>compareTo()</code>. |
| 579 To correctly override the <code>compareTo()</code> method in the | 607 To correctly override the <code>compareTo()</code> method in the |
| 580 <code>Comparable</code> interface, the parameter of <code>compareTo()</code> | 608 <code>Comparable</code> interface, the parameter of <code>compareTo()</code> |
| 581 must have type <code>java.lang.Object</code>.</p> | 609 must have type <code>java.lang.Object</code>.</p> |
| 582 | 610 |
| 583 | 611 |
| 612 <h3><a name="CO_COMPARETO_INCORRECT_FLOATING">Co: compareTo()/compare() incorrec
tly handles float or double value (CO_COMPARETO_INCORRECT_FLOATING)</a></h3> |
| 613 |
| 614 |
| 615 <p>This method compares double or float values using pattern like this: val1 &
gt; val2 ? 1 : val1 < val2 ? -1 : 0. |
| 616 This pattern works incorrectly for -0.0 and NaN values which may result in incor
rect sorting result or broken collection |
| 617 (if compared values are used as keys). Consider using Double.compare or Float.co
mpare static methods which handle all |
| 618 the special cases correctly.</p> |
| 619 |
| 620 |
| 621 <h3><a name="CO_COMPARETO_RESULTS_MIN_VALUE">Co: compareTo()/compare() returns I
nteger.MIN_VALUE (CO_COMPARETO_RESULTS_MIN_VALUE)</a></h3> |
| 622 |
| 623 |
| 624 <p> In some situation, this compareTo or compare method returns |
| 625 the constant Integer.MIN_VALUE, which is an exceptionally bad practice. |
| 626 The only thing that matters about the return value of compareTo is the sign of
the result. |
| 627 But people will sometimes negate the return value of compareTo, expecting th
at this will negate |
| 628 the sign of the result. And it will, except in the case where the value retu
rned is Integer.MIN_VALUE. |
| 629 So just return -1 rather than Integer.MIN_VALUE. |
| 630 |
| 631 |
| 584 <h3><a name="CO_SELF_NO_OBJECT">Co: Covariant compareTo() method defined (CO_SEL
F_NO_OBJECT)</a></h3> | 632 <h3><a name="CO_SELF_NO_OBJECT">Co: Covariant compareTo() method defined (CO_SEL
F_NO_OBJECT)</a></h3> |
| 585 | 633 |
| 586 | 634 |
| 587 <p> This class defines a covariant version of <code>compareTo()</code>. | 635 <p> This class defines a covariant version of <code>compareTo()</code>. |
| 588 To correctly override the <code>compareTo()</code> method in the | 636 To correctly override the <code>compareTo()</code> method in the |
| 589 <code>Comparable</code> interface, the parameter of <code>compareTo()</code> | 637 <code>Comparable</code> interface, the parameter of <code>compareTo()</code> |
| 590 must have type <code>java.lang.Object</code>.</p> | 638 must have type <code>java.lang.Object</code>.</p> |
| 591 | 639 |
| 592 | 640 |
| 593 <h3><a name="DE_MIGHT_DROP">DE: Method might drop exception (DE_MIGHT_DROP)</a><
/h3> | 641 <h3><a name="DE_MIGHT_DROP">DE: Method might drop exception (DE_MIGHT_DROP)</a><
/h3> |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 | 763 |
| 716 <h3><a name="EQ_COMPARETO_USE_OBJECT_EQUALS">Eq: Class defines compareTo(...) an
d uses Object.equals() (EQ_COMPARETO_USE_OBJECT_EQUALS)</a></h3> | 764 <h3><a name="EQ_COMPARETO_USE_OBJECT_EQUALS">Eq: Class defines compareTo(...) an
d uses Object.equals() (EQ_COMPARETO_USE_OBJECT_EQUALS)</a></h3> |
| 717 | 765 |
| 718 | 766 |
| 719 <p> This class defines a <code>compareTo(...)</code> method but inherits its | 767 <p> This class defines a <code>compareTo(...)</code> method but inherits its |
| 720 <code>equals()</code> method from <code>java.lang.Object</code>. | 768 <code>equals()</code> method from <code>java.lang.Object</code>. |
| 721 Generally, the value of compareTo should return zero if and only if | 769 Generally, the value of compareTo should return zero if and only if |
| 722 equals returns true. If this is violated, weird and unpredictable | 770 equals returns true. If this is violated, weird and unpredictable |
| 723 failures will occur in classes such as PriorityQueue. | 771 failures will occur in classes such as PriorityQueue. |
| 724 In Java 5 the PriorityQueue.remove method uses the compareTo method, | 772 In Java 5 the PriorityQueue.remove method uses the compareTo method, |
| 725 while in Java 6 it uses the equals method. | 773 while in Java 6 it uses the equals method.</p> |
| 726 | 774 |
| 727 <p>From the JavaDoc for the compareTo method in the Comparable interface: | 775 <p>From the JavaDoc for the compareTo method in the Comparable interface: |
| 728 <blockquote> | 776 <blockquote> |
| 729 It is strongly recommended, but not strictly required that <code>(x.compareTo(y)
==0) == (x.equals(y))</code>. | 777 It is strongly recommended, but not strictly required that <code>(x.compareTo(y)
==0) == (x.equals(y))</code>. |
| 730 Generally speaking, any class that implements the Comparable interface and viola
tes this condition | 778 Generally speaking, any class that implements the Comparable interface and viola
tes this condition |
| 731 should clearly indicate this fact. The recommended language | 779 should clearly indicate this fact. The recommended language |
| 732 is "Note: this class has a natural ordering that is inconsistent with equals." | 780 is "Note: this class has a natural ordering that is inconsistent with equals." |
| 733 </blockquote> | 781 </blockquote></p> |
| 734 | 782 |
| 735 | 783 |
| 736 <h3><a name="EQ_GETCLASS_AND_CLASS_CONSTANT">Eq: equals method fails for subtype
s (EQ_GETCLASS_AND_CLASS_CONSTANT)</a></h3> | 784 <h3><a name="EQ_GETCLASS_AND_CLASS_CONSTANT">Eq: equals method fails for subtype
s (EQ_GETCLASS_AND_CLASS_CONSTANT)</a></h3> |
| 737 | 785 |
| 738 | 786 |
| 739 <p> This class has an equals method that will be broken if it is inherited by
subclasses. | 787 <p> This class has an equals method that will be broken if it is inherited by
subclasses. |
| 740 It compares a class literal with the class of the argument (e.g., in class <code
>Foo</code> | 788 It compares a class literal with the class of the argument (e.g., in class <code
>Foo</code> |
| 741 it might check if <code>Foo.class == o.getClass()</code>). | 789 it might check if <code>Foo.class == o.getClass()</code>). |
| 742 It is better to check if <code>this.getClass() == o.getClass()</code>. | 790 It is better to check if <code>this.getClass() == o.getClass()</code>. |
| 743 </p> | 791 </p> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 761 | 809 |
| 762 <h3><a name="FI_EXPLICIT_INVOCATION">FI: Explicit invocation of finalizer (FI_EX
PLICIT_INVOCATION)</a></h3> | 810 <h3><a name="FI_EXPLICIT_INVOCATION">FI: Explicit invocation of finalizer (FI_EX
PLICIT_INVOCATION)</a></h3> |
| 763 | 811 |
| 764 | 812 |
| 765 <p> This method contains an explicit invocation of the <code>finalize()</code> | 813 <p> This method contains an explicit invocation of the <code>finalize()</code> |
| 766 method on an object. Because finalizer methods are supposed to be | 814 method on an object. Because finalizer methods are supposed to be |
| 767 executed once, and only by the VM, this is a bad idea.</p> | 815 executed once, and only by the VM, this is a bad idea.</p> |
| 768 <p>If a connected set of objects beings finalizable, then the VM will invoke the | 816 <p>If a connected set of objects beings finalizable, then the VM will invoke the |
| 769 finalize method on all the finalizable object, possibly at the same time in diff
erent threads. | 817 finalize method on all the finalizable object, possibly at the same time in diff
erent threads. |
| 770 Thus, it is a particularly bad idea, in the finalize method for a class X, invok
e finalize | 818 Thus, it is a particularly bad idea, in the finalize method for a class X, invok
e finalize |
| 771 on objects referenced by X, because they may already be getting finalized in a s
eparate thread. | 819 on objects referenced by X, because they may already be getting finalized in a s
eparate thread.</p> |
| 772 | 820 |
| 773 | 821 |
| 774 <h3><a name="FI_FINALIZER_NULLS_FIELDS">FI: Finalizer nulls fields (FI_FINALIZER
_NULLS_FIELDS)</a></h3> | 822 <h3><a name="FI_FINALIZER_NULLS_FIELDS">FI: Finalizer nulls fields (FI_FINALIZER
_NULLS_FIELDS)</a></h3> |
| 775 | 823 |
| 776 | 824 |
| 777 <p> This finalizer nulls out fields. This is usually an error, as it does not
aid garbage collection, | 825 <p> This finalizer nulls out fields. This is usually an error, as it does not
aid garbage collection, |
| 778 and the object is going to be garbage collected anyway. | 826 and the object is going to be garbage collected anyway.</p> |
| 779 | 827 |
| 780 | 828 |
| 781 <h3><a name="FI_FINALIZER_ONLY_NULLS_FIELDS">FI: Finalizer only nulls fields (FI
_FINALIZER_ONLY_NULLS_FIELDS)</a></h3> | 829 <h3><a name="FI_FINALIZER_ONLY_NULLS_FIELDS">FI: Finalizer only nulls fields (FI
_FINALIZER_ONLY_NULLS_FIELDS)</a></h3> |
| 782 | 830 |
| 783 | 831 |
| 784 <p> This finalizer does nothing except null out fields. This is completely poi
ntless, and requires that | 832 <p> This finalizer does nothing except null out fields. This is completely poi
ntless, and requires that |
| 785 the object be garbage collected, finalized, and then garbage collected again. Yo
u should just remove the finalize | 833 the object be garbage collected, finalized, and then garbage collected again. Yo
u should just remove the finalize |
| 786 method. | 834 method.</p> |
| 787 | 835 |
| 788 | 836 |
| 789 <h3><a name="FI_MISSING_SUPER_CALL">FI: Finalizer does not call superclass final
izer (FI_MISSING_SUPER_CALL)</a></h3> | 837 <h3><a name="FI_MISSING_SUPER_CALL">FI: Finalizer does not call superclass final
izer (FI_MISSING_SUPER_CALL)</a></h3> |
| 790 | 838 |
| 791 | 839 |
| 792 <p> This <code>finalize()</code> method does not make a call to its | 840 <p> This <code>finalize()</code> method does not make a call to its |
| 793 superclass's <code>finalize()</code> method. So, any finalizer | 841 superclass's <code>finalize()</code> method. So, any finalizer |
| 794 actions defined for the superclass will not be performed. | 842 actions defined for the superclass will not be performed. |
| 795 Add a call to <code>super.finalize()</code>.</p> | 843 Add a call to <code>super.finalize()</code>.</p> |
| 796 | 844 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 | 1004 |
| 957 | 1005 |
| 958 <h3><a name="JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS">JCIP: Fields of immutable
classes should be final (JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS)</a></h3> | 1006 <h3><a name="JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS">JCIP: Fields of immutable
classes should be final (JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS)</a></h3> |
| 959 | 1007 |
| 960 | 1008 |
| 961 <p> The class is annotated with net.jcip.annotations.Immutable or javax.annota
tion.concurrent.Immutable, | 1009 <p> The class is annotated with net.jcip.annotations.Immutable or javax.annota
tion.concurrent.Immutable, |
| 962 and the rules for those annotations require that all fields are final. | 1010 and the rules for those annotations require that all fields are final. |
| 963 .</p> | 1011 .</p> |
| 964 | 1012 |
| 965 | 1013 |
| 1014 <h3><a name="ME_ENUM_FIELD_SETTER">ME: Public enum method unconditionally sets i
ts field (ME_ENUM_FIELD_SETTER)</a></h3> |
| 1015 |
| 1016 |
| 1017 <p>This public method declared in public enum unconditionally sets enum field,
thus this field can be changed by malicious code |
| 1018 or by accident from another package. Though mutable enum fields may be used fo
r lazy initialization, it's a bad practice to expose them to the outer world. |
| 1019 Consider removing this method or declaring it package-private.</p> |
| 1020 |
| 1021 |
| 1022 <h3><a name="ME_MUTABLE_ENUM_FIELD">ME: Enum field is public and mutable (ME_MUT
ABLE_ENUM_FIELD)</a></h3> |
| 1023 |
| 1024 |
| 1025 <p>A mutable public field is defined inside a public enum, thus can be changed
by malicious code or by accident from another package. |
| 1026 Though mutable enum fields may be used for lazy initialization, it's a bad pra
ctice to expose them to the outer world. |
| 1027 Consider declaring this field final and/or package-private.</p> |
| 1028 |
| 1029 |
| 966 <h3><a name="NP_BOOLEAN_RETURN_NULL">NP: Method with Boolean return type returns
explicit null (NP_BOOLEAN_RETURN_NULL)</a></h3> | 1030 <h3><a name="NP_BOOLEAN_RETURN_NULL">NP: Method with Boolean return type returns
explicit null (NP_BOOLEAN_RETURN_NULL)</a></h3> |
| 967 | 1031 |
| 968 | 1032 |
| 969 <p> | 1033 <p> |
| 970 A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accid
ent waiting to happen. | 1034 A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accid
ent waiting to happen. |
| 971 This method can be invoked as though it returned a value of type boolean, an
d | 1035 This method can be invoked as though it returned a value of type boolean, an
d |
| 972 the compiler will insert automatic unboxing of the Boolean value. If a null
value is returned, | 1036 the compiler will insert automatic unboxing of the Boolean value. If a null
value is returned, |
| 973 this will result in a NullPointerException. | 1037 this will result in a NullPointerException. |
| 974 </p> | 1038 </p> |
| 975 | 1039 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1058 </p> | 1122 </p> |
| 1059 | 1123 |
| 1060 | 1124 |
| 1061 <h3><a name="NM_SAME_SIMPLE_NAME_AS_INTERFACE">Nm: Class names shouldn't shadow
simple name of implemented interface (NM_SAME_SIMPLE_NAME_AS_INTERFACE)</a></h3> | 1125 <h3><a name="NM_SAME_SIMPLE_NAME_AS_INTERFACE">Nm: Class names shouldn't shadow
simple name of implemented interface (NM_SAME_SIMPLE_NAME_AS_INTERFACE)</a></h3> |
| 1062 | 1126 |
| 1063 | 1127 |
| 1064 <p> This class/interface has a simple name that is identical to that of an imp
lemented/extended interface, except | 1128 <p> This class/interface has a simple name that is identical to that of an imp
lemented/extended interface, except |
| 1065 that the interface is in a different package (e.g., <code>alpha.Foo</code> exten
ds <code>beta.Foo</code>). | 1129 that the interface is in a different package (e.g., <code>alpha.Foo</code> exten
ds <code>beta.Foo</code>). |
| 1066 This can be exceptionally confusing, create lots of situations in which you have
to look at import statements | 1130 This can be exceptionally confusing, create lots of situations in which you have
to look at import statements |
| 1067 to resolve references and creates many | 1131 to resolve references and creates many |
| 1068 opportunities to accidently define methods that do not override methods in their
superclasses. | 1132 opportunities to accidentally define methods that do not override methods in the
ir superclasses. |
| 1069 </p> | 1133 </p> |
| 1070 | 1134 |
| 1071 | 1135 |
| 1072 <h3><a name="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS">Nm: Class names shouldn't shadow
simple name of superclass (NM_SAME_SIMPLE_NAME_AS_SUPERCLASS)</a></h3> | 1136 <h3><a name="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS">Nm: Class names shouldn't shadow
simple name of superclass (NM_SAME_SIMPLE_NAME_AS_SUPERCLASS)</a></h3> |
| 1073 | 1137 |
| 1074 | 1138 |
| 1075 <p> This class has a simple name that is identical to that of its superclass,
except | 1139 <p> This class has a simple name that is identical to that of its superclass,
except |
| 1076 that its superclass is in a different package (e.g., <code>alpha.Foo</code> exte
nds <code>beta.Foo</code>). | 1140 that its superclass is in a different package (e.g., <code>alpha.Foo</code> exte
nds <code>beta.Foo</code>). |
| 1077 This can be exceptionally confusing, create lots of situations in which you have
to look at import statements | 1141 This can be exceptionally confusing, create lots of situations in which you have
to look at import statements |
| 1078 to resolve references and creates many | 1142 to resolve references and creates many |
| 1079 opportunities to accidently define methods that do not override methods in their
superclasses. | 1143 opportunities to accidentally define methods that do not override methods in the
ir superclasses. |
| 1080 </p> | 1144 </p> |
| 1081 | 1145 |
| 1082 | 1146 |
| 1083 <h3><a name="NM_VERY_CONFUSING_INTENTIONAL">Nm: Very confusing method names (but
perhaps intentional) (NM_VERY_CONFUSING_INTENTIONAL)</a></h3> | 1147 <h3><a name="NM_VERY_CONFUSING_INTENTIONAL">Nm: Very confusing method names (but
perhaps intentional) (NM_VERY_CONFUSING_INTENTIONAL)</a></h3> |
| 1084 | 1148 |
| 1085 | 1149 |
| 1086 <p> The referenced methods have names that differ only by capitalization. | 1150 <p> The referenced methods have names that differ only by capitalization. |
| 1087 This is very confusing because if the capitalization were | 1151 This is very confusing because if the capitalization were |
| 1088 identical then one of the methods would override the other. From the existence o
f other methods, it | 1152 identical then one of the methods would override the other. From the existence o
f other methods, it |
| 1089 seems that the existence of both of these methods is intentional, but is sure is
confusing. | 1153 seems that the existence of both of these methods is intentional, but is sure is
confusing. |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1601 | 1665 |
| 1602 | 1666 |
| 1603 <h3><a name="BOA_BADLY_OVERRIDDEN_ADAPTER">BOA: Class overrides a method impleme
nted in super class Adapter wrongly (BOA_BADLY_OVERRIDDEN_ADAPTER)</a></h3> | 1667 <h3><a name="BOA_BADLY_OVERRIDDEN_ADAPTER">BOA: Class overrides a method impleme
nted in super class Adapter wrongly (BOA_BADLY_OVERRIDDEN_ADAPTER)</a></h3> |
| 1604 | 1668 |
| 1605 | 1669 |
| 1606 <p> This method overrides a method found in a parent class, where that class is
an Adapter that implements | 1670 <p> This method overrides a method found in a parent class, where that class is
an Adapter that implements |
| 1607 a listener defined in the java.awt.event or javax.swing.event package. As a resu
lt, this method will not | 1671 a listener defined in the java.awt.event or javax.swing.event package. As a resu
lt, this method will not |
| 1608 get called when the event occurs.</p> | 1672 get called when the event occurs.</p> |
| 1609 | 1673 |
| 1610 | 1674 |
| 1675 <h3><a name="BSHIFT_WRONG_ADD_PRIORITY">BSHIFT: Possible bad parsing of shift op
eration (BSHIFT_WRONG_ADD_PRIORITY)</a></h3> |
| 1676 |
| 1677 |
| 1678 <p> |
| 1679 The code performs an operation like (x << 8 + y). Although this might be c
orrect, probably it was meant |
| 1680 to perform (x << 8) + y, but shift operation has |
| 1681 a lower precedence, so it's actually parsed as x << (8 + y). |
| 1682 </p> |
| 1683 |
| 1684 |
| 1611 <h3><a name="ICAST_BAD_SHIFT_AMOUNT">BSHIFT: 32 bit int shifted by an amount not
in the range -31..31 (ICAST_BAD_SHIFT_AMOUNT)</a></h3> | 1685 <h3><a name="ICAST_BAD_SHIFT_AMOUNT">BSHIFT: 32 bit int shifted by an amount not
in the range -31..31 (ICAST_BAD_SHIFT_AMOUNT)</a></h3> |
| 1612 | 1686 |
| 1613 | 1687 |
| 1614 <p> | 1688 <p> |
| 1615 The code performs shift of a 32 bit int by a constant amount outside | 1689 The code performs shift of a 32 bit int by a constant amount outside |
| 1616 the range -31..31. | 1690 the range -31..31. |
| 1617 The effect of this is to use the lower 5 bits of the integer | 1691 The effect of this is to use the lower 5 bits of the integer |
| 1618 value to decide how much to shift by (e.g., shifting by 40 bits is the same as s
hifting by 8 bits, | 1692 value to decide how much to shift by (e.g., shifting by 40 bits is the same as s
hifting by 8 bits, |
| 1619 and shifting by 32 bits is the same as shifting by zero bits). This probably isn
't what was expected, | 1693 and shifting by 32 bits is the same as shifting by zero bits). This probably isn
't what was expected, |
| 1620 and it is at least confusing. | 1694 and it is at least confusing. |
| 1621 </p> | 1695 </p> |
| 1622 | 1696 |
| 1623 | 1697 |
| 1624 <h3><a name="BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR">Bx: Primitive value is
unboxed and coerced for ternary operator (BX_UNBOXED_AND_COERCED_FOR_TERNARY_OP
ERATOR)</a></h3> | 1698 <h3><a name="CAA_COVARIANT_ARRAY_ELEMENT_STORE">CAA: Possibly incompatible eleme
nt is stored in covariant array (CAA_COVARIANT_ARRAY_ELEMENT_STORE)</a></h3> |
| 1625 | 1699 |
| 1626 | 1700 |
| 1627 <p>A wrapped primitive value is unboxed and converted to another primitive typ
e as part of the | 1701 <p>Value is stored into the array and the value type doesn't match the array typ
e. |
| 1628 evaluation of a conditional ternary operator (the <code> b ? e1 : e2</code> oper
ator). The | 1702 It's known from the analysis that actual array type is narrower than the declare
d type of its variable or field |
| 1629 semantics of Java mandate that if <code>e1</code> and <code>e2</code> are wrappe
d | 1703 and this assignment doesn't satisfy the original array type. This assignment may
cause ArrayStoreException |
| 1630 numeric values, the values are unboxed and converted/coerced to their common typ
e (e.g, | 1704 at runtime. |
| 1631 if <code>e1</code> is of type <code>Integer</code> | |
| 1632 and <code>e2</code> is of type <code>Float</code>, then <code>e1</code> is unbox
ed, | |
| 1633 converted to a floating point value, and boxed. See JLS Section 15.25. | |
| 1634 </p> | 1705 </p> |
| 1635 | 1706 |
| 1636 | 1707 |
| 1637 <h3><a name="CO_COMPARETO_RESULTS_MIN_VALUE">Co: compareTo()/compare() returns I
nteger.MIN_VALUE (CO_COMPARETO_RESULTS_MIN_VALUE)</a></h3> | |
| 1638 | |
| 1639 | |
| 1640 <p> In some situation, this compareTo or compare method returns | |
| 1641 the constant Integer.MIN_VALUE, which is an exceptionally bad practice. | |
| 1642 The only thing that matters about the return value of compareTo is the sign of
the result. | |
| 1643 But people will sometimes negate the return value of compareTo, expecting th
at this will negate | |
| 1644 the sign of the result. And it will, except in the case where the value retu
rned is Integer.MIN_VALUE. | |
| 1645 So just return -1 rather than Integer.MIN_VALUE. | |
| 1646 | |
| 1647 | |
| 1648 <h3><a name="DLS_DEAD_LOCAL_INCREMENT_IN_RETURN">DLS: Useless increment in retur
n statement (DLS_DEAD_LOCAL_INCREMENT_IN_RETURN)</a></h3> | 1708 <h3><a name="DLS_DEAD_LOCAL_INCREMENT_IN_RETURN">DLS: Useless increment in retur
n statement (DLS_DEAD_LOCAL_INCREMENT_IN_RETURN)</a></h3> |
| 1649 | 1709 |
| 1650 | 1710 |
| 1651 <p>This statement has a return such as <code>return x++;</code>. | 1711 <p>This statement has a return such as <code>return x++;</code>. |
| 1652 A postfix increment/decrement does not impact the value of the expression, | 1712 A postfix increment/decrement does not impact the value of the expression, |
| 1653 so this increment/decrement has no effect. | 1713 so this increment/decrement has no effect. |
| 1654 Please verify that this statement does the right thing. | 1714 Please verify that this statement does the right thing. |
| 1655 </p> | 1715 </p> |
| 1656 | 1716 |
| 1657 | 1717 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1797 | 1857 |
| 1798 | 1858 |
| 1799 <h3><a name="DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD">Dm: Useless/vacuous call to Ea
syMock method (DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD)</a></h3> | 1859 <h3><a name="DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD">Dm: Useless/vacuous call to Ea
syMock method (DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD)</a></h3> |
| 1800 | 1860 |
| 1801 | 1861 |
| 1802 <p>This call doesn't pass any objects to the EasyMock method, so the call do
esn't do anything. | 1862 <p>This call doesn't pass any objects to the EasyMock method, so the call do
esn't do anything. |
| 1803 </p> | 1863 </p> |
| 1804 | 1864 |
| 1805 | 1865 |
| 1806 | 1866 |
| 1867 <h3><a name="DM_INVALID_MIN_MAX">Dm: Incorrect combination of Math.max and Math.
min (DM_INVALID_MIN_MAX)</a></h3> |
| 1868 |
| 1869 |
| 1870 <p>This code tries to limit the value bounds using the construct like Math.min
(0, Math.max(100, value)). However the order of |
| 1871 the constants is incorrect: it should be Math.min(100, Math.max(0, value)). As
the result this code always produces the same result |
| 1872 (or NaN if the value is NaN).</p> |
| 1873 |
| 1874 |
| 1807 <h3><a name="EC_ARRAY_AND_NONARRAY">EC: equals() used to compare array and nonar
ray (EC_ARRAY_AND_NONARRAY)</a></h3> | 1875 <h3><a name="EC_ARRAY_AND_NONARRAY">EC: equals() used to compare array and nonar
ray (EC_ARRAY_AND_NONARRAY)</a></h3> |
| 1808 | 1876 |
| 1809 | 1877 |
| 1810 <p> | 1878 <p> |
| 1811 This method invokes the .equals(Object o) to compare an array and a reference th
at doesn't seem | 1879 This method invokes the .equals(Object o) to compare an array and a reference th
at doesn't seem |
| 1812 to be an array. If things being compared are of different types, they are guaran
teed to be unequal | 1880 to be an array. If things being compared are of different types, they are guaran
teed to be unequal |
| 1813 and the comparison is almost certainly an error. Even if they are both arrays, t
he equals method | 1881 and the comparison is almost certainly an error. Even if they are both arrays, t
he equals method |
| 1814 on arrays only determines of the two arrays are the same object. | 1882 on arrays only determines of the two arrays are the same object. |
| 1815 To compare the | 1883 To compare the |
| 1816 contents of the arrays, use java.util.Arrays.equals(Object[], Object[]). | 1884 contents of the arrays, use java.util.Arrays.equals(Object[], Object[]). |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1882 classes should always compare as unequal; therefore, according to the | 1950 classes should always compare as unequal; therefore, according to the |
| 1883 contract defined by java.lang.Object.equals(Object), | 1951 contract defined by java.lang.Object.equals(Object), |
| 1884 the result of this comparison will always be false at runtime. | 1952 the result of this comparison will always be false at runtime. |
| 1885 </p> | 1953 </p> |
| 1886 | 1954 |
| 1887 | 1955 |
| 1888 <h3><a name="EC_UNRELATED_TYPES">EC: Call to equals() comparing different types
(EC_UNRELATED_TYPES)</a></h3> | 1956 <h3><a name="EC_UNRELATED_TYPES">EC: Call to equals() comparing different types
(EC_UNRELATED_TYPES)</a></h3> |
| 1889 | 1957 |
| 1890 | 1958 |
| 1891 <p> This method calls equals(Object) on two references of different | 1959 <p> This method calls equals(Object) on two references of different |
| 1892 class types with no common subclasses. | 1960 class types and analysis suggests they will be to objects of different classes |
| 1893 Therefore, the objects being compared | 1961 at runtime. Further, examination of the equals methods that would be invoked sug
gest that either |
| 1894 are unlikely to be members of the same class at runtime | 1962 this call will always return false, or else the equals method is not be symmetri
c (which is |
| 1895 (unless some application classes were not analyzed, or dynamic class | 1963 a property required by the contract |
| 1896 loading can occur at runtime). | 1964 for equals in class Object). |
| 1897 According to the contract of equals(), | |
| 1898 objects of different | |
| 1899 classes should always compare as unequal; therefore, according to the | |
| 1900 contract defined by java.lang.Object.equals(Object), | |
| 1901 the result of this comparison will always be false at runtime. | |
| 1902 </p> | 1965 </p> |
| 1903 | 1966 |
| 1904 | 1967 |
| 1905 <h3><a name="EC_UNRELATED_TYPES_USING_POINTER_EQUALITY">EC: Using pointer equali
ty to compare different types (EC_UNRELATED_TYPES_USING_POINTER_EQUALITY)</a></h
3> | 1968 <h3><a name="EC_UNRELATED_TYPES_USING_POINTER_EQUALITY">EC: Using pointer equali
ty to compare different types (EC_UNRELATED_TYPES_USING_POINTER_EQUALITY)</a></h
3> |
| 1906 | 1969 |
| 1907 | 1970 |
| 1908 <p> This method uses using pointer equality to compare two references that seem
to be of | 1971 <p> This method uses using pointer equality to compare two references that seem
to be of |
| 1909 different types. The result of this comparison will always be false at runtime. | 1972 different types. The result of this comparison will always be false at runtime. |
| 1910 </p> | 1973 </p> |
| 1911 | 1974 |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2168 | 2231 |
| 2169 | 2232 |
| 2170 <h3><a name="ICAST_INT_2_LONG_AS_INSTANT">ICAST: int value converted to long and
used as absolute time (ICAST_INT_2_LONG_AS_INSTANT)</a></h3> | 2233 <h3><a name="ICAST_INT_2_LONG_AS_INSTANT">ICAST: int value converted to long and
used as absolute time (ICAST_INT_2_LONG_AS_INSTANT)</a></h3> |
| 2171 | 2234 |
| 2172 | 2235 |
| 2173 <p> | 2236 <p> |
| 2174 This code converts a 32-bit int value to a 64-bit long value, and then | 2237 This code converts a 32-bit int value to a 64-bit long value, and then |
| 2175 passes that value for a method parameter that requires an absolute time value. | 2238 passes that value for a method parameter that requires an absolute time value. |
| 2176 An absolute time value is the number | 2239 An absolute time value is the number |
| 2177 of milliseconds since the standard base time known as "the epoch", namely Januar
y 1, 1970, 00:00:00 GMT. | 2240 of milliseconds since the standard base time known as "the epoch", namely Januar
y 1, 1970, 00:00:00 GMT. |
| 2178 For example, the following method, intended to convert seconds since the epoc in
to a Date, is badly | 2241 For example, the following method, intended to convert seconds since the epoch i
nto a Date, is badly |
| 2179 broken:</p> | 2242 broken:</p> |
| 2180 <pre> | 2243 <pre> |
| 2181 Date getDate(int seconds) { return new Date(seconds * 1000); } | 2244 Date getDate(int seconds) { return new Date(seconds * 1000); } |
| 2182 </pre> | 2245 </pre> |
| 2183 <p>The multiplication is done using 32-bit arithmetic, and then converted to a 6
4-bit value. | 2246 <p>The multiplication is done using 32-bit arithmetic, and then converted to a 6
4-bit value. |
| 2184 When a 32-bit value is converted to 64-bits and used to express an absolute time | 2247 When a 32-bit value is converted to 64-bits and used to express an absolute time |
| 2185 value, only dates in December 1969 and January 1970 can be represented.</p> | 2248 value, only dates in December 1969 and January 1970 can be represented.</p> |
| 2186 | 2249 |
| 2187 <p>Correct implementations for the above method are:</p> | 2250 <p>Correct implementations for the above method are:</p> |
| 2188 | 2251 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2310 | 2373 |
| 2311 <h3><a name="INT_BAD_COMPARISON_WITH_INT_VALUE">INT: Bad comparison of int value
with long constant (INT_BAD_COMPARISON_WITH_INT_VALUE)</a></h3> | 2374 <h3><a name="INT_BAD_COMPARISON_WITH_INT_VALUE">INT: Bad comparison of int value
with long constant (INT_BAD_COMPARISON_WITH_INT_VALUE)</a></h3> |
| 2312 | 2375 |
| 2313 | 2376 |
| 2314 <p> This code compares an int value with a long constant that is outside | 2377 <p> This code compares an int value with a long constant that is outside |
| 2315 the range of values that can be represented as an int value. | 2378 the range of values that can be represented as an int value. |
| 2316 This comparison is vacuous and possibily to be incorrect. | 2379 This comparison is vacuous and possibily to be incorrect. |
| 2317 </p> | 2380 </p> |
| 2318 | 2381 |
| 2319 | 2382 |
| 2320 <h3><a name="INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE">INT: Bad comparison of n
onnegative value with negative constant (INT_BAD_COMPARISON_WITH_NONNEGATIVE_VAL
UE)</a></h3> | 2383 <h3><a name="INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE">INT: Bad comparison of n
onnegative value with negative constant or zero (INT_BAD_COMPARISON_WITH_NONNEGA
TIVE_VALUE)</a></h3> |
| 2321 | 2384 |
| 2322 | 2385 |
| 2323 <p> This code compares a value that is guaranteed to be non-negative with a nega
tive constant. | 2386 <p> This code compares a value that is guaranteed to be non-negative with a nega
tive constant or zero. |
| 2324 </p> | 2387 </p> |
| 2325 | 2388 |
| 2326 | 2389 |
| 2327 <h3><a name="INT_BAD_COMPARISON_WITH_SIGNED_BYTE">INT: Bad comparison of signed
byte (INT_BAD_COMPARISON_WITH_SIGNED_BYTE)</a></h3> | 2390 <h3><a name="INT_BAD_COMPARISON_WITH_SIGNED_BYTE">INT: Bad comparison of signed
byte (INT_BAD_COMPARISON_WITH_SIGNED_BYTE)</a></h3> |
| 2328 | 2391 |
| 2329 | 2392 |
| 2330 <p> Signed bytes can only have a value in the range -128 to 127. Comparing | 2393 <p> Signed bytes can only have a value in the range -128 to 127. Comparing |
| 2331 a signed byte with a value outside that range is vacuous and likely to be incorr
ect. | 2394 a signed byte with a value outside that range is vacuous and likely to be incorr
ect. |
| 2332 To convert a signed byte <code>b</code> to an unsigned value in the range 0..255
, | 2395 To convert a signed byte <code>b</code> to an unsigned value in the range 0..255
, |
| 2333 use <code>0xff & b</code> | 2396 use <code>0xff & b</code> |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2422 | 2485 |
| 2423 | 2486 |
| 2424 <p> | 2487 <p> |
| 2425 There is a statement or branch that if executed guarantees that | 2488 There is a statement or branch that if executed guarantees that |
| 2426 a value is null at this point, and that | 2489 a value is null at this point, and that |
| 2427 value that is guaranteed to be dereferenced | 2490 value that is guaranteed to be dereferenced |
| 2428 (except on forward paths involving runtime exceptions). | 2491 (except on forward paths involving runtime exceptions). |
| 2429 </p> | 2492 </p> |
| 2430 <p>Note that a check such as | 2493 <p>Note that a check such as |
| 2431 <code>if (x == null) throw new NullPointerException();</code> | 2494 <code>if (x == null) throw new NullPointerException();</code> |
| 2432 is treated as a dereference of <code>x</code>. | 2495 is treated as a dereference of <code>x</code>.</p> |
| 2433 | 2496 |
| 2434 | 2497 |
| 2435 <h3><a name="NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH">NP: Value is null and guaran
teed to be dereferenced on exception path (NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH
)</a></h3> | 2498 <h3><a name="NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH">NP: Value is null and guaran
teed to be dereferenced on exception path (NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH
)</a></h3> |
| 2436 | 2499 |
| 2437 | 2500 |
| 2438 <p> | 2501 <p> |
| 2439 There is a statement or branch on an exception path | 2502 There is a statement or branch on an exception path |
| 2440 that if executed guarantees that | 2503 that if executed guarantees that |
| 2441 a value is null at this point, and that | 2504 a value is null at this point, and that |
| 2442 value that is guaranteed to be dereferenced | 2505 value that is guaranteed to be dereferenced |
| 2443 (except on forward paths involving runtime exceptions). | 2506 (except on forward paths involving runtime exceptions). |
| 2444 </p> | 2507 </p> |
| 2445 | 2508 |
| 2446 | 2509 |
| 2447 <h3><a name="NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">NP: Nonnull field
is not initialized (NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR)</a></h3> | 2510 <h3><a name="NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">NP: Non-null field
is not initialized (NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR)</a></h3> |
| 2448 | 2511 |
| 2449 | 2512 |
| 2450 <p> The field is marked as nonnull, but isn't written to by the construct
or. | 2513 <p> The field is marked as non-null, but isn't written to by the construc
tor. |
| 2451 The field might be initialized elsewhere during constructor, or might always | 2514 The field might be initialized elsewhere during constructor, or might always |
| 2452 be initialized before use. | 2515 be initialized before use. |
| 2453 </p> | 2516 </p> |
| 2454 | 2517 |
| 2455 | 2518 |
| 2456 <h3><a name="NP_NONNULL_PARAM_VIOLATION">NP: Method call passes null to a nonnul
l parameter (NP_NONNULL_PARAM_VIOLATION)</a></h3> | 2519 <h3><a name="NP_NONNULL_PARAM_VIOLATION">NP: Method call passes null to a non-nu
ll parameter (NP_NONNULL_PARAM_VIOLATION)</a></h3> |
| 2457 | 2520 |
| 2458 | 2521 |
| 2459 <p> | 2522 <p> |
| 2460 This method passes a null value as the parameter of a method which | 2523 This method passes a null value as the parameter of a method which |
| 2461 must be nonnull. Either this parameter has been explicitly marked | 2524 must be non-null. Either this parameter has been explicitly marked |
| 2462 as @Nonnull, or analysis has determined that this parameter is | 2525 as @Nonnull, or analysis has determined that this parameter is |
| 2463 always dereferenced. | 2526 always dereferenced. |
| 2464 </p> | 2527 </p> |
| 2465 | 2528 |
| 2466 | 2529 |
| 2467 <h3><a name="NP_NONNULL_RETURN_VIOLATION">NP: Method may return null, but is dec
lared @NonNull (NP_NONNULL_RETURN_VIOLATION)</a></h3> | 2530 <h3><a name="NP_NONNULL_RETURN_VIOLATION">NP: Method may return null, but is dec
lared @Nonnull (NP_NONNULL_RETURN_VIOLATION)</a></h3> |
| 2468 | 2531 |
| 2469 | 2532 |
| 2470 <p> | 2533 <p> |
| 2471 This method may return a null value, but the method (or a superclass metho
d | 2534 This method may return a null value, but the method (or a superclass metho
d |
| 2472 which it overrides) is declared to return @NonNull. | 2535 which it overrides) is declared to return @Nonnull. |
| 2473 </p> | 2536 </p> |
| 2474 | 2537 |
| 2475 | 2538 |
| 2476 <h3><a name="NP_NULL_INSTANCEOF">NP: A known null value is checked to see if it
is an instance of a type (NP_NULL_INSTANCEOF)</a></h3> | 2539 <h3><a name="NP_NULL_INSTANCEOF">NP: A known null value is checked to see if it
is an instance of a type (NP_NULL_INSTANCEOF)</a></h3> |
| 2477 | 2540 |
| 2478 | 2541 |
| 2479 <p> | 2542 <p> |
| 2480 This instanceof test will always return false, since the value being checked is
guaranteed to be null. | 2543 This instanceof test will always return false, since the value being checked is
guaranteed to be null. |
| 2481 Although this is safe, make sure it isn't | 2544 Although this is safe, make sure it isn't |
| 2482 an indication of some misunderstanding or some other logic error. | 2545 an indication of some misunderstanding or some other logic error. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 2500 <p> A reference value which is null on some exception control path is | 2563 <p> A reference value which is null on some exception control path is |
| 2501 dereferenced here. This may lead to a <code>NullPointerException</code> | 2564 dereferenced here. This may lead to a <code>NullPointerException</code> |
| 2502 when the code is executed. | 2565 when the code is executed. |
| 2503 Note that because FindBugs currently does not prune infeasible exception paths, | 2566 Note that because FindBugs currently does not prune infeasible exception paths, |
| 2504 this may be a false warning.</p> | 2567 this may be a false warning.</p> |
| 2505 | 2568 |
| 2506 <p> Also note that FindBugs considers the default case of a switch statement to | 2569 <p> Also note that FindBugs considers the default case of a switch statement to |
| 2507 be an exception path, since the default case is often infeasible.</p> | 2570 be an exception path, since the default case is often infeasible.</p> |
| 2508 | 2571 |
| 2509 | 2572 |
| 2510 <h3><a name="NP_NULL_PARAM_DEREF">NP: Method call passes null for nonnull parame
ter (NP_NULL_PARAM_DEREF)</a></h3> | 2573 <h3><a name="NP_NULL_PARAM_DEREF">NP: Method call passes null for non-null param
eter (NP_NULL_PARAM_DEREF)</a></h3> |
| 2511 | 2574 |
| 2512 | 2575 |
| 2513 <p> | 2576 <p> |
| 2514 This method call passes a null value for a nonnull method parameter. | 2577 This method call passes a null value for a non-null method parameter. |
| 2515 Either the parameter is annotated as a parameter that should | 2578 Either the parameter is annotated as a parameter that should |
| 2516 always be nonnull, or analysis has shown that it will always be | 2579 always be non-null, or analysis has shown that it will always be |
| 2517 dereferenced. | 2580 dereferenced. |
| 2518 </p> | 2581 </p> |
| 2519 | 2582 |
| 2520 | 2583 |
| 2521 <h3><a name="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS">NP: Method call passes n
ull for nonnull parameter (NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS)</a></h3> | 2584 <h3><a name="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS">NP: Method call passes n
ull for non-null parameter (NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS)</a></h3> |
| 2522 | 2585 |
| 2523 | 2586 |
| 2524 <p> | 2587 <p> |
| 2525 A possibly-null value is passed at a call site where all known | 2588 A possibly-null value is passed at a call site where all known |
| 2526 target methods require the parameter to be nonnull. | 2589 target methods require the parameter to be non-null. |
| 2527 Either the parameter is annotated as a parameter that should | 2590 Either the parameter is annotated as a parameter that should |
| 2528 always be nonnull, or analysis has shown that it will always be | 2591 always be non-null, or analysis has shown that it will always be |
| 2529 dereferenced. | 2592 dereferenced. |
| 2530 </p> | 2593 </p> |
| 2531 | 2594 |
| 2532 | 2595 |
| 2533 <h3><a name="NP_NULL_PARAM_DEREF_NONVIRTUAL">NP: Non-virtual method call passes
null for nonnull parameter (NP_NULL_PARAM_DEREF_NONVIRTUAL)</a></h3> | 2596 <h3><a name="NP_NULL_PARAM_DEREF_NONVIRTUAL">NP: Non-virtual method call passes
null for non-null parameter (NP_NULL_PARAM_DEREF_NONVIRTUAL)</a></h3> |
| 2534 | 2597 |
| 2535 | 2598 |
| 2536 <p> | 2599 <p> |
| 2537 A possibly-null value is passed to a nonnull method parameter. | 2600 A possibly-null value is passed to a non-null method parameter. |
| 2538 Either the parameter is annotated as a parameter that should | 2601 Either the parameter is annotated as a parameter that should |
| 2539 always be nonnull, or analysis has shown that it will always be | 2602 always be non-null, or analysis has shown that it will always be |
| 2540 dereferenced. | 2603 dereferenced. |
| 2541 </p> | 2604 </p> |
| 2542 | 2605 |
| 2543 | 2606 |
| 2544 <h3><a name="NP_OPTIONAL_RETURN_NULL">NP: Method with Optional return type retur
ns explicit null (NP_OPTIONAL_RETURN_NULL)</a></h3> | 2607 <h3><a name="NP_OPTIONAL_RETURN_NULL">NP: Method with Optional return type retur
ns explicit null (NP_OPTIONAL_RETURN_NULL)</a></h3> |
| 2545 | 2608 |
| 2546 | 2609 |
| 2547 <p> | 2610 <p> |
| 2548 The usage of Optional return type always mean that explicit null returns wer
e not desired by design. | 2611 The usage of Optional return type (java.util.Optional or com.google.common.b
ase.Optiona) |
| 2612 always mean that explicit null returns were not desired by design. |
| 2549 Returning a null value in such case is a contract violation and will most li
kely break clients code. | 2613 Returning a null value in such case is a contract violation and will most li
kely break clients code. |
| 2550 </p> | 2614 </p> |
| 2551 | 2615 |
| 2552 | 2616 |
| 2553 <h3><a name="NP_STORE_INTO_NONNULL_FIELD">NP: Store of null value into field ann
otated NonNull (NP_STORE_INTO_NONNULL_FIELD)</a></h3> | 2617 <h3><a name="NP_STORE_INTO_NONNULL_FIELD">NP: Store of null value into field ann
otated @Nonnull (NP_STORE_INTO_NONNULL_FIELD)</a></h3> |
| 2554 | 2618 |
| 2555 | 2619 |
| 2556 <p> A value that could be null is stored into a field that has been annotated as
NonNull. </p> | 2620 <p> A value that could be null is stored into a field that has been annotated as
@Nonnull. </p> |
| 2557 | 2621 |
| 2558 | 2622 |
| 2559 <h3><a name="NP_UNWRITTEN_FIELD">NP: Read of unwritten field (NP_UNWRITTEN_FIELD
)</a></h3> | 2623 <h3><a name="NP_UNWRITTEN_FIELD">NP: Read of unwritten field (NP_UNWRITTEN_FIELD
)</a></h3> |
| 2560 | 2624 |
| 2561 | 2625 |
| 2562 <p> The program is dereferencing a field that does not seem to ever have a non
-null value written to it. | 2626 <p> The program is dereferencing a field that does not seem to ever have a non
-null value written to it. |
| 2563 Unless the field is initialized via some mechanism not seen by the analysis, | 2627 Unless the field is initialized via some mechanism not seen by the analysis, |
| 2564 dereferencing this value will generate a null pointer exception. | 2628 dereferencing this value will generate a null pointer exception. |
| 2565 </p> | 2629 </p> |
| 2566 | 2630 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 2587 <p> This class defines a method called <code>tostring()</code>. This met
hod | 2651 <p> This class defines a method called <code>tostring()</code>. This met
hod |
| 2588 does not override the <code>toString()</code> method in <code>java.lang.Object
</code>, | 2652 does not override the <code>toString()</code> method in <code>java.lang.Object
</code>, |
| 2589 which is probably what was intended.</p> | 2653 which is probably what was intended.</p> |
| 2590 | 2654 |
| 2591 | 2655 |
| 2592 <h3><a name="NM_METHOD_CONSTRUCTOR_CONFUSION">Nm: Apparent method/constructor co
nfusion (NM_METHOD_CONSTRUCTOR_CONFUSION)</a></h3> | 2656 <h3><a name="NM_METHOD_CONSTRUCTOR_CONFUSION">Nm: Apparent method/constructor co
nfusion (NM_METHOD_CONSTRUCTOR_CONFUSION)</a></h3> |
| 2593 | 2657 |
| 2594 | 2658 |
| 2595 <p> This regular method has the same name as the class it is defined in. It is
likely that this was intended to be a constructor. | 2659 <p> This regular method has the same name as the class it is defined in. It is
likely that this was intended to be a constructor. |
| 2596 If it was intended to be a constructor, remove the declaration of a void r
eturn value. | 2660 If it was intended to be a constructor, remove the declaration of a void r
eturn value. |
| 2597 If you had accidently defined this method, realized the mistake, defined a p
roper constructor | 2661 If you had accidentally defined this method, realized the mistake, defined a
proper constructor |
| 2598 but can't get rid of this method due to backwards compatibility, deprecate t
he method. | 2662 but can't get rid of this method due to backwards compatibility, deprecate t
he method. |
| 2599 </p> | 2663 </p> |
| 2600 | 2664 |
| 2601 | 2665 |
| 2602 <h3><a name="NM_VERY_CONFUSING">Nm: Very confusing method names (NM_VERY_CONFUSI
NG)</a></h3> | 2666 <h3><a name="NM_VERY_CONFUSING">Nm: Very confusing method names (NM_VERY_CONFUSI
NG)</a></h3> |
| 2603 | 2667 |
| 2604 | 2668 |
| 2605 <p> The referenced methods have names that differ only by capitalization. | 2669 <p> The referenced methods have names that differ only by capitalization. |
| 2606 This is very confusing because if the capitalization were | 2670 This is very confusing because if the capitalization were |
| 2607 identical then one of the methods would override the other. | 2671 identical then one of the methods would override the other. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 2638 <h3><a name="QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT">QBA: Method assigns boolean li
teral in boolean expression (QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT)</a></h3> | 2702 <h3><a name="QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT">QBA: Method assigns boolean li
teral in boolean expression (QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT)</a></h3> |
| 2639 | 2703 |
| 2640 | 2704 |
| 2641 <p> | 2705 <p> |
| 2642 This method assigns a literal boolean value (true or false) to a boolean v
ariable inside | 2706 This method assigns a literal boolean value (true or false) to a boolean v
ariable inside |
| 2643 an if or while expression. Most probably this was supposed to be a boolean
comparison using | 2707 an if or while expression. Most probably this was supposed to be a boolean
comparison using |
| 2644 ==, not an assignment using =. | 2708 ==, not an assignment using =. |
| 2645 </p> | 2709 </p> |
| 2646 | 2710 |
| 2647 | 2711 |
| 2712 <h3><a name="RANGE_ARRAY_INDEX">RANGE: Array index is out of bounds (RANGE_ARRAY
_INDEX)</a></h3> |
| 2713 |
| 2714 |
| 2715 <p> Array operation is performed, but array index is out of bounds, which wil
l result in ArrayIndexOutOfBoundsException at runtime.</p> |
| 2716 |
| 2717 |
| 2718 <h3><a name="RANGE_ARRAY_LENGTH">RANGE: Array length is out of bounds (RANGE_ARR
AY_LENGTH)</a></h3> |
| 2719 |
| 2720 |
| 2721 <p> Method is called with array parameter and length parameter, but the lengt
h is out of bounds. This will result in IndexOutOfBoundsException at runtime. </
p> |
| 2722 |
| 2723 |
| 2724 <h3><a name="RANGE_ARRAY_OFFSET">RANGE: Array offset is out of bounds (RANGE_ARR
AY_OFFSET)</a></h3> |
| 2725 |
| 2726 |
| 2727 <p> Method is called with array parameter and offset parameter, but the offse
t is out of bounds. This will result in IndexOutOfBoundsException at runtime. </
p> |
| 2728 |
| 2729 |
| 2730 <h3><a name="RANGE_STRING_INDEX">RANGE: String index is out of bounds (RANGE_STR
ING_INDEX)</a></h3> |
| 2731 |
| 2732 |
| 2733 <p> String method is called and specified string index is out of bounds. This
will result in StringIndexOutOfBoundsException at runtime. </p> |
| 2734 |
| 2735 |
| 2648 <h3><a name="RC_REF_COMPARISON">RC: Suspicious reference comparison (RC_REF_COMP
ARISON)</a></h3> | 2736 <h3><a name="RC_REF_COMPARISON">RC: Suspicious reference comparison (RC_REF_COMP
ARISON)</a></h3> |
| 2649 | 2737 |
| 2650 | 2738 |
| 2651 <p> This method compares two reference values using the == or != operator, | 2739 <p> This method compares two reference values using the == or != operator, |
| 2652 where the correct way to compare instances of this type is generally | 2740 where the correct way to compare instances of this type is generally |
| 2653 with the equals() method. | 2741 with the equals() method. |
| 2654 It is possible to create distinct instances that are equal but do not compare as
== since | 2742 It is possible to create distinct instances that are equal but do not compare as
== since |
| 2655 they are different objects. | 2743 they are different objects. |
| 2656 Examples of classes which should generally | 2744 Examples of classes which should generally |
| 2657 not be compared by reference are java.lang.Integer, java.lang.Float, etc.</p> | 2745 not be compared by reference are java.lang.Integer, java.lang.Float, etc.</p> |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3416 | 3504 |
| 3417 <h3><a name="MS_MUTABLE_ARRAY">MS: Field is a mutable array (MS_MUTABLE_ARRAY)</
a></h3> | 3505 <h3><a name="MS_MUTABLE_ARRAY">MS: Field is a mutable array (MS_MUTABLE_ARRAY)</
a></h3> |
| 3418 | 3506 |
| 3419 | 3507 |
| 3420 <p> A final static field references an array | 3508 <p> A final static field references an array |
| 3421 and can be accessed by malicious code or | 3509 and can be accessed by malicious code or |
| 3422 by accident from another package. | 3510 by accident from another package. |
| 3423 This code can freely modify the contents of the array.</p> | 3511 This code can freely modify the contents of the array.</p> |
| 3424 | 3512 |
| 3425 | 3513 |
| 3514 <h3><a name="MS_MUTABLE_COLLECTION">MS: Field is a mutable collection (MS_MUTABL
E_COLLECTION)</a></h3> |
| 3515 |
| 3516 |
| 3517 <p>A mutable collection instance is assigned to a final static field, |
| 3518 thus can be changed by malicious code or by accident from another package. |
| 3519 Consider wrapping this field into Collections.unmodifiableSet/List/Map/etc. |
| 3520 to avoid this vulnerability.</p> |
| 3521 |
| 3522 |
| 3523 <h3><a name="MS_MUTABLE_COLLECTION_PKGPROTECT">MS: Field is a mutable collection
which should be package protected (MS_MUTABLE_COLLECTION_PKGPROTECT)</a></h3> |
| 3524 |
| 3525 |
| 3526 <p>A mutable collection instance is assigned to a final static field, |
| 3527 thus can be changed by malicious code or by accident from another package. |
| 3528 The field could be made package protected to avoid this vulnerability. |
| 3529 Alternatively you may wrap this field into Collections.unmodifiableSet/List/M
ap/etc. |
| 3530 to avoid this vulnerability.</p> |
| 3531 |
| 3532 |
| 3426 <h3><a name="MS_MUTABLE_HASHTABLE">MS: Field is a mutable Hashtable (MS_MUTABLE_
HASHTABLE)</a></h3> | 3533 <h3><a name="MS_MUTABLE_HASHTABLE">MS: Field is a mutable Hashtable (MS_MUTABLE_
HASHTABLE)</a></h3> |
| 3427 | 3534 |
| 3428 | 3535 |
| 3429 <p>A final static field references a Hashtable | 3536 <p>A final static field references a Hashtable |
| 3430 and can be accessed by malicious code or | 3537 and can be accessed by malicious code or |
| 3431 by accident from another package. | 3538 by accident from another package. |
| 3432 This code can freely modify the contents of the Hashtable.</p> | 3539 This code can freely modify the contents of the Hashtable.</p> |
| 3433 | 3540 |
| 3434 | 3541 |
| 3435 <h3><a name="MS_OOI_PKGPROTECT">MS: Field should be moved out of an interface an
d made package protected (MS_OOI_PKGPROTECT)</a></h3> | 3542 <h3><a name="MS_OOI_PKGPROTECT">MS: Field should be moved out of an interface an
d made package protected (MS_OOI_PKGPROTECT)</a></h3> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3492 <h3><a name="DC_DOUBLECHECK">DC: Possible double check of field (DC_DOUBLECHECK)
</a></h3> | 3599 <h3><a name="DC_DOUBLECHECK">DC: Possible double check of field (DC_DOUBLECHECK)
</a></h3> |
| 3493 | 3600 |
| 3494 | 3601 |
| 3495 <p> This method may contain an instance of double-checked locking. | 3602 <p> This method may contain an instance of double-checked locking. |
| 3496 This idiom is not correct according to the semantics of the Java memory | 3603 This idiom is not correct according to the semantics of the Java memory |
| 3497 model. For more information, see the web page | 3604 model. For more information, see the web page |
| 3498 <a href="http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.htm
l" | 3605 <a href="http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.htm
l" |
| 3499 >http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html</a>.</
p> | 3606 >http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html</a>.</
p> |
| 3500 | 3607 |
| 3501 | 3608 |
| 3609 <h3><a name="DC_PARTIALLY_CONSTRUCTED">DC: Possible exposure of partially initia
lized object (DC_PARTIALLY_CONSTRUCTED)</a></h3> |
| 3610 |
| 3611 |
| 3612 <p>Looks like this method uses lazy field initialization with double-checked l
ocking. |
| 3613 While the field is correctly declared as volatile, it's possible that the inte
rnal structure of |
| 3614 the object is changed after the field assignment, thus another thread may see
the partially initialized object.</p> |
| 3615 <p>To fix this problem consider storing the object into the local variable fir
st |
| 3616 and save it to the volatile field only after it's fully constructed. |
| 3617 </p> |
| 3618 |
| 3619 |
| 3502 <h3><a name="DL_SYNCHRONIZATION_ON_BOOLEAN">DL: Synchronization on Boolean (DL_S
YNCHRONIZATION_ON_BOOLEAN)</a></h3> | 3620 <h3><a name="DL_SYNCHRONIZATION_ON_BOOLEAN">DL: Synchronization on Boolean (DL_S
YNCHRONIZATION_ON_BOOLEAN)</a></h3> |
| 3503 | 3621 |
| 3504 | 3622 |
| 3505 <p> The code synchronizes on a boxed primitive constant, such as an Boolean.</
p> | 3623 <p> The code synchronizes on a boxed primitive constant, such as an Boolean.</
p> |
| 3506 <pre> | 3624 <pre> |
| 3507 private static Boolean inited = Boolean.FALSE; | 3625 private static Boolean inited = Boolean.FALSE; |
| 3508 ... | 3626 ... |
| 3509 synchronized(inited) { | 3627 synchronized(inited) { |
| 3510 if (!inited) { | 3628 if (!inited) { |
| 3511 init(); | 3629 init(); |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4094 </p> | 4212 </p> |
| 4095 | 4213 |
| 4096 | 4214 |
| 4097 <h3><a name="BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION">Bx: Primitive va
lue is boxed then unboxed to perform primitive coercion (BX_BOXING_IMMEDIATELY_U
NBOXED_TO_PERFORM_COERCION)</a></h3> | 4215 <h3><a name="BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION">Bx: Primitive va
lue is boxed then unboxed to perform primitive coercion (BX_BOXING_IMMEDIATELY_U
NBOXED_TO_PERFORM_COERCION)</a></h3> |
| 4098 | 4216 |
| 4099 | 4217 |
| 4100 <p>A primitive boxed value constructed and then immediately converted into a d
ifferent primitive type | 4218 <p>A primitive boxed value constructed and then immediately converted into a d
ifferent primitive type |
| 4101 (e.g., <code>new Double(d).intValue()</code>). Just perform direct primitive coe
rcion (e.g., <code>(int) d</code>).</p> | 4219 (e.g., <code>new Double(d).intValue()</code>). Just perform direct primitive coe
rcion (e.g., <code>(int) d</code>).</p> |
| 4102 | 4220 |
| 4103 | 4221 |
| 4222 <h3><a name="BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR">Bx: Primitive value is
unboxed and coerced for ternary operator (BX_UNBOXED_AND_COERCED_FOR_TERNARY_OP
ERATOR)</a></h3> |
| 4223 |
| 4224 |
| 4225 <p>A wrapped primitive value is unboxed and converted to another primitive typ
e as part of the |
| 4226 evaluation of a conditional ternary operator (the <code> b ? e1 : e2</code> oper
ator). The |
| 4227 semantics of Java mandate that if <code>e1</code> and <code>e2</code> are wrappe
d |
| 4228 numeric values, the values are unboxed and converted/coerced to their common typ
e (e.g, |
| 4229 if <code>e1</code> is of type <code>Integer</code> |
| 4230 and <code>e2</code> is of type <code>Float</code>, then <code>e1</code> is unbox
ed, |
| 4231 converted to a floating point value, and boxed. See JLS Section 15.25. |
| 4232 </p> |
| 4233 |
| 4234 |
| 4104 <h3><a name="BX_UNBOXING_IMMEDIATELY_REBOXED">Bx: Boxed value is unboxed and the
n immediately reboxed (BX_UNBOXING_IMMEDIATELY_REBOXED)</a></h3> | 4235 <h3><a name="BX_UNBOXING_IMMEDIATELY_REBOXED">Bx: Boxed value is unboxed and the
n immediately reboxed (BX_UNBOXING_IMMEDIATELY_REBOXED)</a></h3> |
| 4105 | 4236 |
| 4106 | 4237 |
| 4107 <p>A boxed value is unboxed and then immediately reboxed. | 4238 <p>A boxed value is unboxed and then immediately reboxed. |
| 4108 </p> | 4239 </p> |
| 4109 | 4240 |
| 4110 | 4241 |
| 4242 <h3><a name="DM_BOXED_PRIMITIVE_FOR_COMPARE">Bx: Boxing a primitive to compare (
DM_BOXED_PRIMITIVE_FOR_COMPARE)</a></h3> |
| 4243 |
| 4244 |
| 4245 <p>A boxed primitive is created just to call compareTo method. It's more effic
ient to use static compare method |
| 4246 (for double and float since Java 1.4, for other primitive types since Java 1.7
) which works on primitives directly. |
| 4247 </p> |
| 4248 |
| 4249 |
| 4111 <h3><a name="DM_BOXED_PRIMITIVE_FOR_PARSING">Bx: Boxing/unboxing to parse a prim
itive (DM_BOXED_PRIMITIVE_FOR_PARSING)</a></h3> | 4250 <h3><a name="DM_BOXED_PRIMITIVE_FOR_PARSING">Bx: Boxing/unboxing to parse a prim
itive (DM_BOXED_PRIMITIVE_FOR_PARSING)</a></h3> |
| 4112 | 4251 |
| 4113 | 4252 |
| 4114 <p>A boxed primitive is created from a String, just to extract the unboxed pri
mitive value. | 4253 <p>A boxed primitive is created from a String, just to extract the unboxed pri
mitive value. |
| 4115 It is more efficient to just call the static parseXXX method.</p> | 4254 It is more efficient to just call the static parseXXX method.</p> |
| 4116 | 4255 |
| 4117 | 4256 |
| 4118 <h3><a name="DM_BOXED_PRIMITIVE_TOSTRING">Bx: Method allocates a boxed primitive
just to call toString (DM_BOXED_PRIMITIVE_TOSTRING)</a></h3> | 4257 <h3><a name="DM_BOXED_PRIMITIVE_TOSTRING">Bx: Method allocates a boxed primitive
just to call toString (DM_BOXED_PRIMITIVE_TOSTRING)</a></h3> |
| 4119 | 4258 |
| 4120 | 4259 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4258 <p> | 4397 <p> |
| 4259 A large String constant is duplicated across multiple class files. | 4398 A large String constant is duplicated across multiple class files. |
| 4260 This is likely because a final field is initialized to a String constant, an
d the Java language | 4399 This is likely because a final field is initialized to a String constant, an
d the Java language |
| 4261 mandates that all references to a final field from other classes be inlined
into | 4400 mandates that all references to a final field from other classes be inlined
into |
| 4262 that classfile. See <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=
6447475">JDK bug 6447475</a> | 4401 that classfile. See <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=
6447475">JDK bug 6447475</a> |
| 4263 for a description of an occurrence of this bug in the JDK and how resolving
it reduced | 4402 for a description of an occurrence of this bug in the JDK and how resolving
it reduced |
| 4264 the size of the JDK by 1 megabyte. | 4403 the size of the JDK by 1 megabyte. |
| 4265 </p> | 4404 </p> |
| 4266 | 4405 |
| 4267 | 4406 |
| 4407 <h3><a name="IIL_ELEMENTS_GET_LENGTH_IN_LOOP">IIL: NodeList.getLength() called i
n a loop (IIL_ELEMENTS_GET_LENGTH_IN_LOOP)</a></h3> |
| 4408 |
| 4409 |
| 4410 <p> The method calls NodeList.getLength() inside the loop and NodeList was produ
ced by getElementsByTagName call. |
| 4411 This NodeList doesn't store its length, but computes it every time in not very o
ptimal way. |
| 4412 Consider storing the length to the variable before the loop. |
| 4413 </p> |
| 4414 |
| 4415 |
| 4416 <h3><a name="IIL_PATTERN_COMPILE_IN_LOOP">IIL: Method calls Pattern.compile in a
loop (IIL_PATTERN_COMPILE_IN_LOOP)</a></h3> |
| 4417 |
| 4418 |
| 4419 <p> The method calls Pattern.compile inside the loop passing the constant argume
nts. |
| 4420 If the Pattern should be used several times there's no reason to compile it for
each loop iteration. |
| 4421 Move this call outside of the loop or even into static final field.</p> |
| 4422 |
| 4423 |
| 4424 <h3><a name="IIL_PATTERN_COMPILE_IN_LOOP_INDIRECT">IIL: Method compiles the regu
lar expression in a loop (IIL_PATTERN_COMPILE_IN_LOOP_INDIRECT)</a></h3> |
| 4425 |
| 4426 |
| 4427 <p> The method creates the same regular expression inside the loop, so it will b
e compiled every iteration. |
| 4428 It would be more optimal to precompile this regular expression using Pattern.com
pile outside of the loop.</p> |
| 4429 |
| 4430 |
| 4431 <h3><a name="IIL_PREPARE_STATEMENT_IN_LOOP">IIL: Method calls prepareStatement i
n a loop (IIL_PREPARE_STATEMENT_IN_LOOP)</a></h3> |
| 4432 |
| 4433 |
| 4434 <p> The method calls Connection.prepareStatement inside the loop passing the con
stant arguments. |
| 4435 If the PreparedStatement should be executed several times there's no reason to r
ecreate it for each loop iteration. |
| 4436 Move this call outside of the loop.</p> |
| 4437 |
| 4438 |
| 4268 <h3><a name="IIO_INEFFICIENT_INDEX_OF">IIO: Inefficient use of String.indexOf(St
ring) (IIO_INEFFICIENT_INDEX_OF)</a></h3> | 4439 <h3><a name="IIO_INEFFICIENT_INDEX_OF">IIO: Inefficient use of String.indexOf(St
ring) (IIO_INEFFICIENT_INDEX_OF)</a></h3> |
| 4269 | 4440 |
| 4270 | 4441 |
| 4271 <p> This code passes a constant string of length 1 to String.indexOf(). | 4442 <p> This code passes a constant string of length 1 to String.indexOf(). |
| 4272 It is more efficient to use the integer implementations of String.indexOf(). | 4443 It is more efficient to use the integer implementations of String.indexOf(). |
| 4273 f. e. call <code>myString.indexOf('.')</code> instead of <code>myString.indexOf(
".")</code></p> | 4444 f. e. call <code>myString.indexOf('.')</code> instead of <code>myString.indexOf(
".")</code></p> |
| 4274 | 4445 |
| 4275 | 4446 |
| 4276 <h3><a name="IIO_INEFFICIENT_LAST_INDEX_OF">IIO: Inefficient use of String.lastI
ndexOf(String) (IIO_INEFFICIENT_LAST_INDEX_OF)</a></h3> | 4447 <h3><a name="IIO_INEFFICIENT_LAST_INDEX_OF">IIO: Inefficient use of String.lastI
ndexOf(String) (IIO_INEFFICIENT_LAST_INDEX_OF)</a></h3> |
| 4277 | 4448 |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4561 See <a href="http://cwe.mitre.org/data/definitions/23.html">http://cwe.mitre.org
/data/definitions/23.html</a> | 4732 See <a href="http://cwe.mitre.org/data/definitions/23.html">http://cwe.mitre.org
/data/definitions/23.html</a> |
| 4562 for more information.</p> | 4733 for more information.</p> |
| 4563 <p>FindBugs looks only for the most blatant, obvious cases of relative path trav
ersal. | 4734 <p>FindBugs looks only for the most blatant, obvious cases of relative path trav
ersal. |
| 4564 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more | 4735 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more |
| 4565 vulnerabilities that FindBugs doesn't report. If you are concerned about relativ
e path traversal, you should seriously | 4736 vulnerabilities that FindBugs doesn't report. If you are concerned about relativ
e path traversal, you should seriously |
| 4566 consider using a commercial static analysis or pen-testing tool. | 4737 consider using a commercial static analysis or pen-testing tool. |
| 4567 </p> | 4738 </p> |
| 4568 | 4739 |
| 4569 | 4740 |
| 4570 | 4741 |
| 4571 <h3><a name="SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE">SQL: Nonconstant string p
assed to execute method on an SQL statement (SQL_NONCONSTANT_STRING_PASSED_TO_EX
ECUTE)</a></h3> | 4742 <h3><a name="SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE">SQL: Nonconstant string p
assed to execute or addBatch method on an SQL statement (SQL_NONCONSTANT_STRING_
PASSED_TO_EXECUTE)</a></h3> |
| 4572 | 4743 |
| 4573 | 4744 |
| 4574 <p>The method invokes the execute method on an SQL statement with a String tha
t seems | 4745 <p>The method invokes the execute or addBatch method on an SQL statement with
a String that seems |
| 4575 to be dynamically generated. Consider using | 4746 to be dynamically generated. Consider using |
| 4576 a prepared statement instead. It is more efficient and less vulnerable to | 4747 a prepared statement instead. It is more efficient and less vulnerable to |
| 4577 SQL injection attacks. | 4748 SQL injection attacks. |
| 4578 </p> | 4749 </p> |
| 4579 | 4750 |
| 4580 | 4751 |
| 4581 <h3><a name="SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING">SQL: A pr
epared statement is generated from a nonconstant String (SQL_PREPARED_STATEMENT_
GENERATED_FROM_NONCONSTANT_STRING)</a></h3> | 4752 <h3><a name="SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING">SQL: A pr
epared statement is generated from a nonconstant String (SQL_PREPARED_STATEMENT_
GENERATED_FROM_NONCONSTANT_STRING)</a></h3> |
| 4582 | 4753 |
| 4583 | 4754 |
| 4584 <p>The code creates an SQL prepared statement from a nonconstant String. | 4755 <p>The code creates an SQL prepared statement from a nonconstant String. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4691 | 4862 |
| 4692 | 4863 |
| 4693 <p> | 4864 <p> |
| 4694 The code performs an unsigned right shift, whose result is then | 4865 The code performs an unsigned right shift, whose result is then |
| 4695 cast to a short or byte, which discards the upper bits of the result. | 4866 cast to a short or byte, which discards the upper bits of the result. |
| 4696 Since the upper bits are discarded, there may be no difference between | 4867 Since the upper bits are discarded, there may be no difference between |
| 4697 a signed and unsigned right shift (depending upon the size of the shift). | 4868 a signed and unsigned right shift (depending upon the size of the shift). |
| 4698 </p> | 4869 </p> |
| 4699 | 4870 |
| 4700 | 4871 |
| 4872 <h3><a name="CAA_COVARIANT_ARRAY_FIELD">CAA: Covariant array assignment to a fie
ld (CAA_COVARIANT_ARRAY_FIELD)</a></h3> |
| 4873 |
| 4874 |
| 4875 <p>Array of covariant type is assigned to a field. This is confusing and may lea
d to ArrayStoreException at runtime |
| 4876 if the reference of some other type will be stored in this array later like in t
he following code: |
| 4877 </p> |
| 4878 <p><code>Number[] arr = new Integer[10]; |
| 4879 arr[0] = 1.0; |
| 4880 </code></p> |
| 4881 <p>Consider changing the type of created array or the field type.</p> |
| 4882 |
| 4883 |
| 4884 <h3><a name="CAA_COVARIANT_ARRAY_LOCAL">CAA: Covariant array assignment to a loc
al variable (CAA_COVARIANT_ARRAY_LOCAL)</a></h3> |
| 4885 |
| 4886 |
| 4887 <p>Array of covariant type is assigned to a local variable. This is confusing an
d may lead to ArrayStoreException at runtime |
| 4888 if the reference of some other type will be stored in this array later like in t
he following code: |
| 4889 </p> |
| 4890 <p><code>Number[] arr = new Integer[10]; |
| 4891 arr[0] = 1.0; |
| 4892 </code></p> |
| 4893 <p>Consider changing the type of created array or the local variable type.</p>
|
| 4894 |
| 4895 |
| 4896 <h3><a name="CAA_COVARIANT_ARRAY_RETURN">CAA: Covariant array is returned from t
he method (CAA_COVARIANT_ARRAY_RETURN)</a></h3> |
| 4897 |
| 4898 |
| 4899 <p>Array of covariant type is returned from the method. This is confusing and ma
y lead to ArrayStoreException at runtime |
| 4900 if the calling code will try to store the reference of some other type in the re
turned array. |
| 4901 </p> |
| 4902 <p>Consider changing the type of created array or the method return type.</p>
|
| 4903 |
| 4904 |
| 4701 <h3><a name="CD_CIRCULAR_DEPENDENCY">CD: Test for circular dependencies among cl
asses (CD_CIRCULAR_DEPENDENCY)</a></h3> | 4905 <h3><a name="CD_CIRCULAR_DEPENDENCY">CD: Test for circular dependencies among cl
asses (CD_CIRCULAR_DEPENDENCY)</a></h3> |
| 4702 | 4906 |
| 4703 | 4907 |
| 4704 <p> | 4908 <p> |
| 4705 This class has a circular dependency with other classes. This makes building
these classes | 4909 This class has a circular dependency with other classes. This makes building
these classes |
| 4706 difficult, as each is dependent on the other to build correctly. Consider us
ing interfaces | 4910 difficult, as each is dependent on the other to build correctly. Consider us
ing interfaces |
| 4707 to break the hard dependency. | 4911 to break the hard dependency. |
| 4708 </p> | 4912 </p> |
| 4709 | 4913 |
| 4710 | 4914 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4862 <code>if ( Math.abs(x - y) < .0000001 )</code>. | 5066 <code>if ( Math.abs(x - y) < .0000001 )</code>. |
| 4863 See the Java Language Specification, section 4.2.4. | 5067 See the Java Language Specification, section 4.2.4. |
| 4864 </p> | 5068 </p> |
| 4865 | 5069 |
| 4866 | 5070 |
| 4867 <h3><a name="VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN">FS: Non-Boolean argumen
t formatted using %b format specifier (VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEA
N)</a></h3> | 5071 <h3><a name="VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN">FS: Non-Boolean argumen
t formatted using %b format specifier (VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEA
N)</a></h3> |
| 4868 | 5072 |
| 4869 | 5073 |
| 4870 <p> | 5074 <p> |
| 4871 An argument not of type Boolean is being formatted with a %b format specifier. T
his won't throw an | 5075 An argument not of type Boolean is being formatted with a %b format specifier. T
his won't throw an |
| 4872 exception; instead, it will print true for any nonnull value, and false for null
. | 5076 exception; instead, it will print true for any non-null value, and false for nul
l. |
| 4873 This feature of format strings is strange, and may not be what you intended. | 5077 This feature of format strings is strange, and may not be what you intended. |
| 4874 </p> | 5078 </p> |
| 4875 | 5079 |
| 4876 | 5080 |
| 4877 <h3><a name="IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD">IA: Potential
ly ambiguous invocation of either an inherited or outer method (IA_AMBIGUOUS_INV
OCATION_OF_INHERITED_OR_OUTER_METHOD)</a></h3> | 5081 <h3><a name="IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD">IA: Potential
ly ambiguous invocation of either an inherited or outer method (IA_AMBIGUOUS_INV
OCATION_OF_INHERITED_OR_OUTER_METHOD)</a></h3> |
| 4878 | 5082 |
| 4879 | 5083 |
| 4880 <p> | 5084 <p> |
| 4881 An inner class is invoking a method that could be resolved to either a inherited
method or a method defined in an outer class. | 5085 An inner class is invoking a method that could be resolved to either a inherited
method or a method defined in an outer class. |
| 4882 For example, you invoke <code>foo(17)</code>, which is defined in both a supercl
ass and in an outer method. | 5086 For example, you invoke <code>foo(17)</code>, which is defined in both a supercl
ass and in an outer method. |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5044 to read, readLine() will return null and dereferencing that will generate a null
pointer exception. | 5248 to read, readLine() will return null and dereferencing that will generate a null
pointer exception. |
| 5045 </p> | 5249 </p> |
| 5046 | 5250 |
| 5047 | 5251 |
| 5048 <h3><a name="NP_LOAD_OF_KNOWN_NULL_VALUE">NP: Load of known null value (NP_LOAD_
OF_KNOWN_NULL_VALUE)</a></h3> | 5252 <h3><a name="NP_LOAD_OF_KNOWN_NULL_VALUE">NP: Load of known null value (NP_LOAD_
OF_KNOWN_NULL_VALUE)</a></h3> |
| 5049 | 5253 |
| 5050 | 5254 |
| 5051 <p> The variable referenced at this point is known to be null due to an earlie
r | 5255 <p> The variable referenced at this point is known to be null due to an earlie
r |
| 5052 check against null. Although this is valid, it might be a mistake (perhaps yo
u | 5256 check against null. Although this is valid, it might be a mistake (perhaps yo
u |
| 5053 intended to refer to a different variable, or perhaps the earlier check to see i
f the | 5257 intended to refer to a different variable, or perhaps the earlier check to see i
f the |
| 5054 variable is null should have been a check to see if it was nonnull). | 5258 variable is null should have been a check to see if it was non-null). |
| 5055 </p> | 5259 </p> |
| 5056 | 5260 |
| 5057 | 5261 |
| 5058 <h3><a name="NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION">NP: Method tightens nullne
ss annotation on parameter (NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION)</a></h3> | 5262 <h3><a name="NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION">NP: Method tightens nullne
ss annotation on parameter (NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION)</a></h3> |
| 5059 | 5263 |
| 5060 <p> | 5264 <p> |
| 5061 A method should always implement the contract of a method it overrides.
Thus, if a method takes a parameter | 5265 A method should always implement the contract of a method it overrides.
Thus, if a method takes a parameter |
| 5062 that is marked as @Nullable, you shouldn't override that method in a subclas
s with a method where that parameter is @Nonnull. | 5266 that is marked as @Nullable, you shouldn't override that method in a subclas
s with a method where that parameter is @Nonnull. |
| 5063 Doing so violates the contract that the method should handle a null paramete
r. | 5267 Doing so violates the contract that the method should handle a null paramete
r. |
| 5064 </p> | 5268 </p> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 5087 <p> There is a branch of statement that, <em>if executed,</em> guarantees that | 5291 <p> There is a branch of statement that, <em>if executed,</em> guarantees that |
| 5088 a null value will be dereferenced, which | 5292 a null value will be dereferenced, which |
| 5089 would generate a <code>NullPointerException</code> when the code is executed. | 5293 would generate a <code>NullPointerException</code> when the code is executed. |
| 5090 Of course, the problem might be that the branch or statement is infeasible and t
hat | 5294 Of course, the problem might be that the branch or statement is infeasible and t
hat |
| 5091 the null pointer exception can't ever be executed; deciding that is beyond the a
bility of FindBugs. | 5295 the null pointer exception can't ever be executed; deciding that is beyond the a
bility of FindBugs. |
| 5092 Due to the fact that this value had been previously tested for nullness, | 5296 Due to the fact that this value had been previously tested for nullness, |
| 5093 this is a definite possibility. | 5297 this is a definite possibility. |
| 5094 </p> | 5298 </p> |
| 5095 | 5299 |
| 5096 | 5300 |
| 5097 <h3><a name="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE">NP: Parameter
must be nonnull but is marked as nullable (NP_PARAMETER_MUST_BE_NONNULL_BUT_MARK
ED_AS_NULLABLE)</a></h3> | 5301 <h3><a name="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE">NP: Parameter
must be non-null but is marked as nullable (NP_PARAMETER_MUST_BE_NONNULL_BUT_MAR
KED_AS_NULLABLE)</a></h3> |
| 5098 | 5302 |
| 5099 | 5303 |
| 5100 <p> This parameter is always used in a way that requires it to be nonnull, | 5304 <p> This parameter is always used in a way that requires it to be non-null, |
| 5101 but the parameter is explicitly annotated as being Nullable. Either the use | 5305 but the parameter is explicitly annotated as being Nullable. Either the use |
| 5102 of the parameter or the annotation is wrong. | 5306 of the parameter or the annotation is wrong. |
| 5103 </p> | 5307 </p> |
| 5104 | 5308 |
| 5105 | 5309 |
| 5106 <h3><a name="NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">NP: Read of unwritten publi
c or protected field (NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD)</a></h3> | 5310 <h3><a name="NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">NP: Read of unwritten publi
c or protected field (NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD)</a></h3> |
| 5107 | 5311 |
| 5108 | 5312 |
| 5109 <p> The program is dereferencing a public or protected | 5313 <p> The program is dereferencing a public or protected |
| 5110 field that does not seem to ever have a non-null value written to it. | 5314 field that does not seem to ever have a non-null value written to it. |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5254 | 5458 |
| 5255 <h3><a name="RV_CHECK_FOR_POSITIVE_INDEXOF">RV: Method checks to see if result o
f String.indexOf is positive (RV_CHECK_FOR_POSITIVE_INDEXOF)</a></h3> | 5459 <h3><a name="RV_CHECK_FOR_POSITIVE_INDEXOF">RV: Method checks to see if result o
f String.indexOf is positive (RV_CHECK_FOR_POSITIVE_INDEXOF)</a></h3> |
| 5256 | 5460 |
| 5257 | 5461 |
| 5258 <p> The method invokes String.indexOf and checks to see if the result is posi
tive or non-positive. | 5462 <p> The method invokes String.indexOf and checks to see if the result is posi
tive or non-positive. |
| 5259 It is much more typical to check to see if the result is negative or non-nega
tive. It is | 5463 It is much more typical to check to see if the result is negative or non-nega
tive. It is |
| 5260 positive only if the substring checked for occurs at some place other than at
the beginning of | 5464 positive only if the substring checked for occurs at some place other than at
the beginning of |
| 5261 the String.</p> | 5465 the String.</p> |
| 5262 | 5466 |
| 5263 | 5467 |
| 5264 <h3><a name="RV_DONT_JUST_NULL_CHECK_READLINE">RV: Method discards result of rea
dLine after checking if it is nonnull (RV_DONT_JUST_NULL_CHECK_READLINE)</a></h3
> | 5468 <h3><a name="RV_DONT_JUST_NULL_CHECK_READLINE">RV: Method discards result of rea
dLine after checking if it is non-null (RV_DONT_JUST_NULL_CHECK_READLINE)</a></h
3> |
| 5265 | 5469 |
| 5266 | 5470 |
| 5267 <p> The value returned by readLine is discarded after checking to see if the
return | 5471 <p> The value returned by readLine is discarded after checking to see if the
return |
| 5268 value is non-null. In almost all situations, if the result is non-null, you will
want | 5472 value is non-null. In almost all situations, if the result is non-null, you will
want |
| 5269 to use that non-null value. Calling readLine again will give you a different lin
e.</p> | 5473 to use that non-null value. Calling readLine again will give you a different lin
e.</p> |
| 5270 | 5474 |
| 5271 | 5475 |
| 5272 <h3><a name="RV_REM_OF_HASHCODE">RV: Remainder of hashCode could be negative (RV
_REM_OF_HASHCODE)</a></h3> | 5476 <h3><a name="RV_REM_OF_HASHCODE">RV: Remainder of hashCode could be negative (RV
_REM_OF_HASHCODE)</a></h3> |
| 5273 | 5477 |
| 5274 | 5478 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5309 </p> | 5513 </p> |
| 5310 <p>We are guessing that ignoring the return value might be a bad idea just from | 5514 <p>We are guessing that ignoring the return value might be a bad idea just from |
| 5311 a simple analysis of the body of the method. You can use a @CheckReturnValue ann
otation | 5515 a simple analysis of the body of the method. You can use a @CheckReturnValue ann
otation |
| 5312 to instruct FindBugs as to whether ignoring the return value of this method | 5516 to instruct FindBugs as to whether ignoring the return value of this method |
| 5313 is important or acceptable. | 5517 is important or acceptable. |
| 5314 </p> | 5518 </p> |
| 5315 <p>Please investigate this closely to decide whether it is OK to ignore the retu
rn value. | 5519 <p>Please investigate this closely to decide whether it is OK to ignore the retu
rn value. |
| 5316 </p> | 5520 </p> |
| 5317 | 5521 |
| 5318 | 5522 |
| 5523 <h3><a name="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT">RV: Return value of method
without side effect is ignored (RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT)</a></h3> |
| 5524 |
| 5525 |
| 5526 <p>This code calls a method and ignores the return value. However our analysis s
hows that |
| 5527 the method (including its implementations in subclasses if any) does not produce
any effect |
| 5528 other than return value. Thus this call can be removed. |
| 5529 </p> |
| 5530 <p>We are trying to reduce the false positives as much as possible, but in some
cases this warning might be wrong. |
| 5531 Common false-positive cases include:</p> |
| 5532 <p>- The method is designed to be overridden and produce a side effect in other
projects which are out of the scope of the analysis.</p> |
| 5533 <p>- The method is called to trigger the class loading which may have a side eff
ect.</p> |
| 5534 <p>- The method is called just to get some exception.</p> |
| 5535 <p>If you feel that our assumption is incorrect, you can use a @CheckReturnValue
annotation |
| 5536 to instruct FindBugs that ignoring the return value of this method is acceptable
. |
| 5537 </p> |
| 5538 |
| 5539 |
| 5319 <h3><a name="SA_FIELD_DOUBLE_ASSIGNMENT">SA: Double assignment of field (SA_FIEL
D_DOUBLE_ASSIGNMENT)</a></h3> | 5540 <h3><a name="SA_FIELD_DOUBLE_ASSIGNMENT">SA: Double assignment of field (SA_FIEL
D_DOUBLE_ASSIGNMENT)</a></h3> |
| 5320 | 5541 |
| 5321 | 5542 |
| 5322 <p> This method contains a double assignment of a field; e.g. | 5543 <p> This method contains a double assignment of a field; e.g. |
| 5323 </p> | 5544 </p> |
| 5324 <pre> | 5545 <pre> |
| 5325 int x,y; | 5546 int x,y; |
| 5326 public void foo() { | 5547 public void foo() { |
| 5327 x = x = 17; | 5548 x = x = 17; |
| 5328 } | 5549 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5365 <p> This method contains a switch statement where one case branch will fall th
rough to the next case. | 5586 <p> This method contains a switch statement where one case branch will fall th
rough to the next case. |
| 5366 Usually you need to end this case with a break or return.</p> | 5587 Usually you need to end this case with a break or return.</p> |
| 5367 | 5588 |
| 5368 | 5589 |
| 5369 <h3><a name="SF_SWITCH_NO_DEFAULT">SF: Switch statement found where default case
is missing (SF_SWITCH_NO_DEFAULT)</a></h3> | 5590 <h3><a name="SF_SWITCH_NO_DEFAULT">SF: Switch statement found where default case
is missing (SF_SWITCH_NO_DEFAULT)</a></h3> |
| 5370 | 5591 |
| 5371 | 5592 |
| 5372 <p> This method contains a switch statement where default case is missing. | 5593 <p> This method contains a switch statement where default case is missing. |
| 5373 Usually you need to provide a default case.</p> | 5594 Usually you need to provide a default case.</p> |
| 5374 <p>Because the analysis only looks at the generated bytecode, this warning can
be incorrect triggered if | 5595 <p>Because the analysis only looks at the generated bytecode, this warning can
be incorrect triggered if |
| 5375 the default case is at the end of the switch statement and doesn't end with a br
eak statement. | 5596 the default case is at the end of the switch statement and the switch statement
doesn't contain break statements for other |
| 5597 cases. |
| 5376 | 5598 |
| 5377 | 5599 |
| 5378 <h3><a name="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD">ST: Write to static field
from instance method (ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD)</a></h3> | 5600 <h3><a name="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD">ST: Write to static field
from instance method (ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD)</a></h3> |
| 5379 | 5601 |
| 5380 | 5602 |
| 5381 <p> This instance method writes to a static field. This is tricky to get | 5603 <p> This instance method writes to a static field. This is tricky to get |
| 5382 correct if multiple instances are being manipulated, | 5604 correct if multiple instances are being manipulated, |
| 5383 and generally bad practice. | 5605 and generally bad practice. |
| 5384 </p> | 5606 </p> |
| 5385 | 5607 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 5415 <h3><a name="TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK">TQ: Value requ
ired to not have type qualifier, but marked as unknown (TQ_EXPLICIT_UNKNOWN_SOUR
CE_VALUE_REACHES_NEVER_SINK)</a></h3> | 5637 <h3><a name="TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK">TQ: Value requ
ired to not have type qualifier, but marked as unknown (TQ_EXPLICIT_UNKNOWN_SOUR
CE_VALUE_REACHES_NEVER_SINK)</a></h3> |
| 5416 | 5638 |
| 5417 | 5639 |
| 5418 <p> | 5640 <p> |
| 5419 A value is used in a way that requires it to be never be a value denoted b
y a type qualifier, but | 5641 A value is used in a way that requires it to be never be a value denoted b
y a type qualifier, but |
| 5420 there is an explicit annotation stating that it is not known where the value
is prohibited from having that type qualifier. | 5642 there is an explicit annotation stating that it is not known where the value
is prohibited from having that type qualifier. |
| 5421 Either the usage or the annotation is incorrect. | 5643 Either the usage or the annotation is incorrect. |
| 5422 </p> | 5644 </p> |
| 5423 | 5645 |
| 5424 | 5646 |
| 5647 <h3><a name="UC_USELESS_CONDITION">UC: Condition has no effect (UC_USELESS_CONDI
TION)</a></h3> |
| 5648 |
| 5649 |
| 5650 <p>This condition always produces the same result as the value of the involved v
ariable was narrowed before. |
| 5651 Probably something else was meant or condition can be removed.</p> |
| 5652 |
| 5653 |
| 5654 <h3><a name="UC_USELESS_CONDITION_TYPE">UC: Condition has no effect due to the v
ariable type (UC_USELESS_CONDITION_TYPE)</a></h3> |
| 5655 |
| 5656 |
| 5657 <p>This condition always produces the same result due to the type range of the i
nvolved variable. |
| 5658 Probably something else was meant or condition can be removed.</p> |
| 5659 |
| 5660 |
| 5661 <h3><a name="UC_USELESS_OBJECT">UC: Useless object created (UC_USELESS_OBJECT)</
a></h3> |
| 5662 |
| 5663 |
| 5664 <p>Our analysis shows that this object is useless. |
| 5665 It's created and modified, but its value never go outside of the method or produ
ce any side-effect. |
| 5666 Either there is a mistake and object was intended to be used or it can be remove
d.</p> |
| 5667 <p>This analysis rarely produces false-positives. Common false-positive cases in
clude:</p> |
| 5668 <p>- This object used to implicitly throw some obscure exception.</p> |
| 5669 <p>- This object used as a stub to generalize the code.</p> |
| 5670 <p>- This object used to hold strong references to weak/soft-referenced objects.
</p> |
| 5671 |
| 5672 |
| 5673 <h3><a name="UC_USELESS_OBJECT_STACK">UC: Useless object created on stack (UC_US
ELESS_OBJECT_STACK)</a></h3> |
| 5674 |
| 5675 |
| 5676 <p>This object is created just to perform some modifications which don't have an
y side-effect. |
| 5677 Probably something else was meant or the object can be removed.</p> |
| 5678 |
| 5679 |
| 5680 <h3><a name="UC_USELESS_VOID_METHOD">UC: Useless non-empty void method (UC_USELE
SS_VOID_METHOD)</a></h3> |
| 5681 |
| 5682 |
| 5683 <p>Our analysis shows that this non-empty void method does not actually perform
any useful work. |
| 5684 Please check it: probably there's a mistake in its code or its body can be fully
removed. |
| 5685 </p> |
| 5686 <p>We are trying to reduce the false positives as much as possible, but in some
cases this warning might be wrong. |
| 5687 Common false-positive cases include:</p> |
| 5688 <p>- The method is intended to trigger loading of some class which may have a si
de effect.</p> |
| 5689 <p>- The method is intended to implicitly throw some obscure exception.</p> |
| 5690 |
| 5691 |
| 5425 <h3><a name="UCF_USELESS_CONTROL_FLOW">UCF: Useless control flow (UCF_USELESS_CO
NTROL_FLOW)</a></h3> | 5692 <h3><a name="UCF_USELESS_CONTROL_FLOW">UCF: Useless control flow (UCF_USELESS_CO
NTROL_FLOW)</a></h3> |
| 5426 | 5693 |
| 5427 | 5694 |
| 5428 <p> This method contains a useless control flow statement, where | 5695 <p> This method contains a useless control flow statement, where |
| 5429 control flow continues onto the same place regardless of whether or not | 5696 control flow continues onto the same place regardless of whether or not |
| 5430 the branch is taken. For example, | 5697 the branch is taken. For example, |
| 5431 this is caused by having an empty statement | 5698 this is caused by having an empty statement |
| 5432 block for an <code>if</code> statement:</p> | 5699 block for an <code>if</code> statement:</p> |
| 5433 <pre> | 5700 <pre> |
| 5434 if (argv.length == 0) { | 5701 if (argv.length == 0) { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5525 | 5792 |
| 5526 | 5793 |
| 5527 <hr> <p> | 5794 <hr> <p> |
| 5528 <script language="JavaScript" type="text/javascript"> | 5795 <script language="JavaScript" type="text/javascript"> |
| 5529 <!---//hide script from old browsers | 5796 <!---//hide script from old browsers |
| 5530 document.write( "Last updated "+ document.lastModified + "." ); | 5797 document.write( "Last updated "+ document.lastModified + "." ); |
| 5531 //end hiding contents ---> | 5798 //end hiding contents ---> |
| 5532 </script> | 5799 </script> |
| 5533 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbu
gs@cs.umd.edu</a> | 5800 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbu
gs@cs.umd.edu</a> |
| 5534 <p> | 5801 <p> |
| 5535 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?gro
up_id=96405&type=5" width="210" height="62" border="0" alt="SourceForge.net
Logo" /></A> | 5802 <a href="http://sourceforge.net/projects/findbugs/"><img src="http://sourceforge
.net/sflogo.php?group_id=96405&type=5" width="210" height="62" border="0" al
t="FindBugs on SourceForge.net" /></a> |
| 5536 </td></tr></table> | 5803 </td></tr></table> |
| 5537 </body></html> | 5804 </body></html> |
| OLD | NEW |