Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: doc/bugDescriptions.html

Issue 1232833004: Update findbugs from 3.0.0 to 3.0.1. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/findbugs.git@master
Patch Set: rebase again Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « doc/allBugDescriptions.html ('k') | doc/bugDescriptions_fr.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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</title> 2 <html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8">
3 <title>FindBugs Bug Descriptions</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
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>&nbsp;</td></tr> 36 <tr><td>&nbsp;</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>&nbsp;</td></tr> 40 <tr><td>&nbsp;</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">&nbsp;<a class="sidebar" href="http://sourceforge.net/tr acker/?group_id=96405">Open bugs</a></font></td></tr> 43 <tr><td><font size="-1">&nbsp;<a class="sidebar" href="http://sourceforge.net/p/ findbugs/bugs/">Open bugs</a></font></td></tr>
43 <tr><td><font size="-1">&nbsp;<a class="sidebar" href="reportingBugs.html">Repor ting bugs</a></font></td></tr> 44 <tr><td><font size="-1">&nbsp;<a class="sidebar" href="reportingBugs.html">Repor ting bugs</a></font></td></tr>
44 <tr><td><font size="-1">&nbsp;<a class="sidebar" href="contributing.html">Contri buting</a></font></td></tr> 45 <tr><td><font size="-1">&nbsp;<a class="sidebar" href="contributing.html">Contri buting</a></font></td></tr>
45 <tr><td><font size="-1">&nbsp;<a class="sidebar" href="team.html">Dev team</a></ font></td></tr> 46 <tr><td><font size="-1">&nbsp;<a class="sidebar" href="team.html">Dev team</a></ font></td></tr>
46 <tr><td><font size="-1">&nbsp;<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">&nbsp;<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">&nbsp;<a class="sidebar" href="Changes.html">Change log< /a></font></td></tr> 48 <tr><td><font size="-1">&nbsp;<a class="sidebar" href="Changes.html">Change log< /a></font></td></tr>
48 <tr><td><font size="-1">&nbsp;<a class="sidebar" href="http://sourceforge.net/pr ojects/findbugs">SF project page</a></font></td></tr> 49 <tr><td><font size="-1">&nbsp;<a class="sidebar" href="http://sourceforge.net/pr ojects/findbugs">SF project page</a></font></td></tr>
49 <tr><td><font size="-1">&nbsp;<a class="sidebar" href="http://code.google.com/p/ findbugs/source/browse/">Browse source</a></font></td></tr> 50 <tr><td><font size="-1">&nbsp;<a class="sidebar" href="http://code.google.com/p/ findbugs/source/browse/">Browse source</a></font></td></tr>
50 <tr><td><font size="-1">&nbsp;<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">&nbsp;<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</h1> 55 <h1>FindBugs Bug Descriptions</h1>
55 <p>This document lists the standard bug patterns reported by 56 <p>This document lists the standard bug patterns reported by
56 <a href="http://findbugs.sourceforge.net">FindBugs</a> version 3.0.0.</p> 57 <a href="http://findbugs.sourceforge.net">FindBugs</a> version 3.0.1.</p>
57 <h2>Summary</h2> 58 <h2>Summary</h2>
58 <table width="100%"> 59 <table width="100%">
59 <tr bgcolor="#b9b9fe"><th>Description</th><th>Category</th></tr> 60 <tr bgcolor="#b9b9fe"><th>Description</th><th>Category</th></tr>
60 <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> 61 <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>
61 <tr bgcolor="#ffffff"><td><a href="#BIT_SIGNED_CHECK">BIT: Check for sign of bit wise operation</a></td><td>Bad practice</td></tr> 62 <tr bgcolor="#ffffff"><td><a href="#BIT_SIGNED_CHECK">BIT: Check for sign of bit wise operation</a></td><td>Bad practice</td></tr>
62 <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> 63 <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>
63 <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> 64 <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>
64 <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> 65 <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>
65 <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> 66 <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>
66 <tr bgcolor="#eeeeee"><td><a href="#CO_ABSTRACT_SELF">Co: Abstract class defines covariant compareTo() method</a></td><td>Bad practice</td></tr> 67 <tr bgcolor="#eeeeee"><td><a href="#CO_ABSTRACT_SELF">Co: Abstract class defines covariant compareTo() method</a></td><td>Bad practice</td></tr>
68 <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>
69 <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>
67 <tr bgcolor="#ffffff"><td><a href="#CO_SELF_NO_OBJECT">Co: Covariant compareTo() method defined</a></td><td>Bad practice</td></tr> 70 <tr bgcolor="#ffffff"><td><a href="#CO_SELF_NO_OBJECT">Co: Covariant compareTo() method defined</a></td><td>Bad practice</td></tr>
68 <tr bgcolor="#eeeeee"><td><a href="#DE_MIGHT_DROP">DE: Method might drop excepti on</a></td><td>Bad practice</td></tr> 71 <tr bgcolor="#eeeeee"><td><a href="#DE_MIGHT_DROP">DE: Method might drop excepti on</a></td><td>Bad practice</td></tr>
69 <tr bgcolor="#ffffff"><td><a href="#DE_MIGHT_IGNORE">DE: Method might ignore exc eption</a></td><td>Bad practice</td></tr> 72 <tr bgcolor="#ffffff"><td><a href="#DE_MIGHT_IGNORE">DE: Method might ignore exc eption</a></td><td>Bad practice</td></tr>
70 <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> 73 <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>
71 <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> 74 <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>
72 <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> 75 <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>
73 <tr bgcolor="#ffffff"><td><a href="#DM_EXIT">Dm: Method invokes System.exit(...) </a></td><td>Bad practice</td></tr> 76 <tr bgcolor="#ffffff"><td><a href="#DM_EXIT">Dm: Method invokes System.exit(...) </a></td><td>Bad practice</td></tr>
74 <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> 77 <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>
75 <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> 78 <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>
76 <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> 79 <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
92 <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> 95 <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>
93 <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> 96 <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>
94 <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> 97 <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>
95 <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> 98 <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>
96 <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> 99 <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>
97 <tr bgcolor="#ffffff"><td><a href="#IMSE_DONT_CATCH_IMSE">IMSE: Dubious catching of IllegalMonitorStateException</a></td><td>Bad practice</td></tr> 100 <tr bgcolor="#ffffff"><td><a href="#IMSE_DONT_CATCH_IMSE">IMSE: Dubious catching of IllegalMonitorStateException</a></td><td>Bad practice</td></tr>
98 <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> 101 <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>
99 <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> 102 <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>
100 <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> 103 <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>
101 <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> 104 <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>
105 <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>
106 <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>
102 <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> 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>
103 <tr bgcolor="#ffffff"><td><a href="#NP_CLONE_COULD_RETURN_NULL">NP: Clone method may return 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>
104 <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> 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>
105 <tr bgcolor="#ffffff"><td><a href="#NP_TOSTRING_COULD_RETURN_NULL">NP: toString method may return null</a></td><td>Bad practice</td></tr> 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>
106 <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> 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>
107 <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> 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>
108 <tr bgcolor="#eeeeee"><td><a href="#NM_CONFUSING">Nm: Confusing method names</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>
109 <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> 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>
110 <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> 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>
111 <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> 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>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 <tr bgcolor="#ffffff"><td><a href="#BC_IMPOSSIBLE_DOWNCAST">BC: Impossible downc ast</a></td><td>Correctness</td></tr> 150 <tr bgcolor="#ffffff"><td><a href="#BC_IMPOSSIBLE_DOWNCAST">BC: Impossible downc ast</a></td><td>Correctness</td></tr>
146 <tr bgcolor="#eeeeee"><td><a href="#BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY">BC: Impos sible downcast of toArray() result</a></td><td>Correctness</td></tr> 151 <tr bgcolor="#eeeeee"><td><a href="#BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY">BC: Impos sible downcast of toArray() result</a></td><td>Correctness</td></tr>
147 <tr bgcolor="#ffffff"><td><a href="#BC_IMPOSSIBLE_INSTANCEOF">BC: instanceof wil l always return false</a></td><td>Correctness</td></tr> 152 <tr bgcolor="#ffffff"><td><a href="#BC_IMPOSSIBLE_INSTANCEOF">BC: instanceof wil l always return false</a></td><td>Correctness</td></tr>
148 <tr bgcolor="#eeeeee"><td><a href="#BIT_ADD_OF_SIGNED_BYTE">BIT: Bitwise add of signed byte value</a></td><td>Correctness</td></tr> 153 <tr bgcolor="#eeeeee"><td><a href="#BIT_ADD_OF_SIGNED_BYTE">BIT: Bitwise add of signed byte value</a></td><td>Correctness</td></tr>
149 <tr bgcolor="#ffffff"><td><a href="#BIT_AND">BIT: Incompatible bit masks</a></td ><td>Correctness</td></tr> 154 <tr bgcolor="#ffffff"><td><a href="#BIT_AND">BIT: Incompatible bit masks</a></td ><td>Correctness</td></tr>
150 <tr bgcolor="#eeeeee"><td><a href="#BIT_AND_ZZ">BIT: Check to see if ((...) & 0) == 0</a></td><td>Correctness</td></tr> 155 <tr bgcolor="#eeeeee"><td><a href="#BIT_AND_ZZ">BIT: Check to see if ((...) & 0) == 0</a></td><td>Correctness</td></tr>
151 <tr bgcolor="#ffffff"><td><a href="#BIT_IOR">BIT: Incompatible bit masks</a></td ><td>Correctness</td></tr> 156 <tr bgcolor="#ffffff"><td><a href="#BIT_IOR">BIT: Incompatible bit masks</a></td ><td>Correctness</td></tr>
152 <tr bgcolor="#eeeeee"><td><a href="#BIT_IOR_OF_SIGNED_BYTE">BIT: Bitwise OR of s igned byte value</a></td><td>Correctness</td></tr> 157 <tr bgcolor="#eeeeee"><td><a href="#BIT_IOR_OF_SIGNED_BYTE">BIT: Bitwise OR of s igned byte value</a></td><td>Correctness</td></tr>
153 <tr bgcolor="#ffffff"><td><a href="#BIT_SIGNED_CHECK_HIGH_BIT">BIT: Check for si gn of bitwise operation</a></td><td>Correctness</td></tr> 158 <tr bgcolor="#ffffff"><td><a href="#BIT_SIGNED_CHECK_HIGH_BIT">BIT: Check for si gn of bitwise operation</a></td><td>Correctness</td></tr>
154 <tr bgcolor="#eeeeee"><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> 159 <tr bgcolor="#eeeeee"><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>
155 <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> 160 <tr bgcolor="#ffffff"><td><a href="#BSHIFT_WRONG_ADD_PRIORITY">BSHIFT: Possible bad parsing of shift operation</a></td><td>Correctness</td></tr>
156 <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>Cor rectness</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>
157 <tr bgcolor="#ffffff"><td><a href="#CO_COMPARETO_RESULTS_MIN_VALUE">Co: compareT o()/compare() returns Integer.MIN_VALUE</a></td><td>Correctness</td></tr> 162 <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>
158 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_LOCAL_INCREMENT_IN_RETURN">DLS: Use less increment in return statement</a></td><td>Correctness</td></tr> 163 <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>
159 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_STORE_OF_CLASS_LITERAL">DLS: Dead s tore of class literal</a></td><td>Correctness</td></tr> 164 <tr bgcolor="#ffffff"><td><a href="#DLS_OVERWRITTEN_INCREMENT">DLS: Overwritten increment</a></td><td>Correctness</td></tr>
160 <tr bgcolor="#eeeeee"><td><a href="#DLS_OVERWRITTEN_INCREMENT">DLS: Overwritten increment</a></td><td>Correctness</td></tr> 165 <tr bgcolor="#eeeeee"><td><a href="#DMI_ARGUMENTS_WRONG_ORDER">DMI: Reversed met hod arguments</a></td><td>Correctness</td></tr>
161 <tr bgcolor="#ffffff"><td><a href="#DMI_ARGUMENTS_WRONG_ORDER">DMI: Reversed met hod arguments</a></td><td>Correctness</td></tr> 166 <tr bgcolor="#ffffff"><td><a href="#DMI_BAD_MONTH">DMI: Bad constant value for m onth</a></td><td>Correctness</td></tr>
162 <tr bgcolor="#eeeeee"><td><a href="#DMI_BAD_MONTH">DMI: Bad constant value for m onth</a></td><td>Correctness</td></tr> 167 <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>
163 <tr bgcolor="#ffffff"><td><a href="#DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE">DMI: BigDecimal constructed from double that isn't represented precisely</a></td><td >Correctness</td></tr> 168 <tr bgcolor="#ffffff"><td><a href="#DMI_CALLING_NEXT_FROM_HASNEXT">DMI: hasNext method invokes next</a></td><td>Correctness</td></tr>
164 <tr bgcolor="#eeeeee"><td><a href="#DMI_CALLING_NEXT_FROM_HASNEXT">DMI: hasNext method invokes next</a></td><td>Correctness</td></tr> 169 <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>
165 <tr bgcolor="#ffffff"><td><a href="#DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVE S">DMI: Collections should not contain themselves</a></td><td>Correctness</td></ tr> 170 <tr bgcolor="#ffffff"><td><a href="#DMI_DOH">DMI: D'oh! A nonsensical method inv ocation</a></td><td>Correctness</td></tr>
166 <tr bgcolor="#eeeeee"><td><a href="#DMI_DOH">DMI: D'oh! A nonsensical method inv ocation</a></td><td>Correctness</td></tr> 171 <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>
167 <tr bgcolor="#ffffff"><td><a href="#DMI_INVOKING_HASHCODE_ON_ARRAY">DMI: Invocat ion of hashCode on an array</a></td><td>Correctness</td></tr> 172 <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>
168 <tr bgcolor="#eeeeee"><td><a href="#DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INT">DMI: Double.longBitsToDouble invoked on an int</a></td><td>Correctness</td></tr> 173 <tr bgcolor="#eeeeee"><td><a href="#DMI_VACUOUS_SELF_COLLECTION_CALL">DMI: Vacuo us call to collections</a></td><td>Correctness</td></tr>
169 <tr bgcolor="#ffffff"><td><a href="#DMI_VACUOUS_SELF_COLLECTION_CALL">DMI: Vacuo us call to collections</a></td><td>Correctness</td></tr> 174 <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>
170 <tr bgcolor="#eeeeee"><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> 175 <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>
171 <tr bgcolor="#ffffff"><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> 176 <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>
172 <tr bgcolor="#eeeeee"><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> 177 <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>
173 <tr bgcolor="#ffffff"><td><a href="#DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD">Dm: Use less/vacuous call to EasyMock method</a></td><td>Correctness</td></tr> 178 <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>
174 <tr bgcolor="#eeeeee"><td><a href="#EC_ARRAY_AND_NONARRAY">EC: equals() used to compare array and nonarray</a></td><td>Correctness</td></tr> 179 <tr bgcolor="#eeeeee"><td><a href="#EC_ARRAY_AND_NONARRAY">EC: equals() used to compare array and nonarray</a></td><td>Correctness</td></tr>
175 <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> 180 <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>
176 <tr bgcolor="#eeeeee"><td><a href="#EC_INCOMPATIBLE_ARRAY_COMPARE">EC: equals(.. .) used to compare incompatible arrays</a></td><td>Correctness</td></tr> 181 <tr bgcolor="#eeeeee"><td><a href="#EC_INCOMPATIBLE_ARRAY_COMPARE">EC: equals(.. .) used to compare incompatible arrays</a></td><td>Correctness</td></tr>
177 <tr bgcolor="#ffffff"><td><a href="#EC_NULL_ARG">EC: Call to equals(null)</a></t d><td>Correctness</td></tr> 182 <tr bgcolor="#ffffff"><td><a href="#EC_NULL_ARG">EC: Call to equals(null)</a></t d><td>Correctness</td></tr>
178 <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> 183 <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>
179 <tr bgcolor="#ffffff"><td><a href="#EC_UNRELATED_INTERFACES">EC: Call to equals( ) comparing different interface types</a></td><td>Correctness</td></tr> 184 <tr bgcolor="#ffffff"><td><a href="#EC_UNRELATED_INTERFACES">EC: Call to equals( ) comparing different interface types</a></td><td>Correctness</td></tr>
180 <tr bgcolor="#eeeeee"><td><a href="#EC_UNRELATED_TYPES">EC: Call to equals() com paring different types</a></td><td>Correctness</td></tr> 185 <tr bgcolor="#eeeeee"><td><a href="#EC_UNRELATED_TYPES">EC: Call to equals() com paring different types</a></td><td>Correctness</td></tr>
181 <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> 186 <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>
182 <tr bgcolor="#eeeeee"><td><a href="#EQ_ALWAYS_FALSE">Eq: equals method always re turns false</a></td><td>Correctness</td></tr> 187 <tr bgcolor="#eeeeee"><td><a href="#EQ_ALWAYS_FALSE">Eq: equals method always re turns false</a></td><td>Correctness</td></tr>
183 <tr bgcolor="#ffffff"><td><a href="#EQ_ALWAYS_TRUE">Eq: equals method always ret urns true</a></td><td>Correctness</td></tr> 188 <tr bgcolor="#ffffff"><td><a href="#EQ_ALWAYS_TRUE">Eq: equals method always ret urns true</a></td><td>Correctness</td></tr>
(...skipping 21 matching lines...) Expand all
205 <tr bgcolor="#ffffff"><td><a href="#IJU_BAD_SUITE_METHOD">IJU: TestCase declares a bad suite method </a></td><td>Correctness</td></tr> 210 <tr bgcolor="#ffffff"><td><a href="#IJU_BAD_SUITE_METHOD">IJU: TestCase declares a bad suite method </a></td><td>Correctness</td></tr>
206 <tr bgcolor="#eeeeee"><td><a href="#IJU_NO_TESTS">IJU: TestCase has no tests</a> </td><td>Correctness</td></tr> 211 <tr bgcolor="#eeeeee"><td><a href="#IJU_NO_TESTS">IJU: TestCase has no tests</a> </td><td>Correctness</td></tr>
207 <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> 212 <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>
208 <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> 213 <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>
209 <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> 214 <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>
210 <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> 215 <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>
211 <tr bgcolor="#ffffff"><td><a href="#IL_INFINITE_LOOP">IL: An apparent infinite l oop</a></td><td>Correctness</td></tr> 216 <tr bgcolor="#ffffff"><td><a href="#IL_INFINITE_LOOP">IL: An apparent infinite l oop</a></td><td>Correctness</td></tr>
212 <tr bgcolor="#eeeeee"><td><a href="#IL_INFINITE_RECURSIVE_LOOP">IL: An apparent infinite recursive loop</a></td><td>Correctness</td></tr> 217 <tr bgcolor="#eeeeee"><td><a href="#IL_INFINITE_RECURSIVE_LOOP">IL: An apparent infinite recursive loop</a></td><td>Correctness</td></tr>
213 <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> 218 <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>
214 <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> 219 <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>
215 <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> 220 <tr bgcolor="#ffffff"><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>
216 <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> 221 <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>
217 <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> 222 <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>
218 <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> 223 <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>
219 <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> 224 <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>
220 <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> 225 <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>
221 <tr bgcolor="#ffffff"><td><a href="#NP_ALWAYS_NULL">NP: Null pointer dereference </a></td><td>Correctness</td></tr> 226 <tr bgcolor="#ffffff"><td><a href="#NP_ALWAYS_NULL">NP: Null pointer dereference </a></td><td>Correctness</td></tr>
222 <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> 227 <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>
223 <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> 228 <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>
224 <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> 229 <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>
225 <tr bgcolor="#ffffff"><td><a href="#NP_GUARANTEED_DEREF">NP: Null value is guara nteed to be dereferenced</a></td><td>Correctness</td></tr> 230 <tr bgcolor="#ffffff"><td><a href="#NP_GUARANTEED_DEREF">NP: Null value is guara nteed to be dereferenced</a></td><td>Correctness</td></tr>
226 <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> 231 <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>
227 <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> 232 <tr bgcolor="#ffffff"><td><a href="#NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUC TOR">NP: Non-null field is not initialized</a></td><td>Correctness</td></tr>
228 <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> 233 <tr bgcolor="#eeeeee"><td><a href="#NP_NONNULL_PARAM_VIOLATION">NP: Method call passes null to a non-null parameter </a></td><td>Correctness</td></tr>
229 <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> 234 <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>
230 <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 > 235 <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 >
231 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_ON_SOME_PATH">NP: Possible null poin ter dereference</a></td><td>Correctness</td></tr> 236 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_ON_SOME_PATH">NP: Possible null poin ter dereference</a></td><td>Correctness</td></tr>
232 <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> 237 <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>
233 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_PARAM_DEREF">NP: Method call passes null for nonnull parameter</a></td><td>Correctness</td></tr> 238 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_PARAM_DEREF">NP: Method call passes null for non-null parameter</a></td><td>Correctness</td></tr>
234 <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> 239 <tr bgcolor="#eeeeee"><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>
235 <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> 240 <tr bgcolor="#ffffff"><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>
236 <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> 241 <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>
237 <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> 242 <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>
238 <tr bgcolor="#eeeeee"><td><a href="#NP_UNWRITTEN_FIELD">NP: Read of unwritten fi eld</a></td><td>Correctness</td></tr> 243 <tr bgcolor="#eeeeee"><td><a href="#NP_UNWRITTEN_FIELD">NP: Read of unwritten fi eld</a></td><td>Correctness</td></tr>
239 <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> 244 <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>
240 <tr bgcolor="#eeeeee"><td><a href="#NM_LCASE_HASHCODE">Nm: Class defines hashcod e(); should it be hashCode()?</a></td><td>Correctness</td></tr> 245 <tr bgcolor="#eeeeee"><td><a href="#NM_LCASE_HASHCODE">Nm: Class defines hashcod e(); should it be hashCode()?</a></td><td>Correctness</td></tr>
241 <tr bgcolor="#ffffff"><td><a href="#NM_LCASE_TOSTRING">Nm: Class defines tostrin g(); should it be toString()?</a></td><td>Correctness</td></tr> 246 <tr bgcolor="#ffffff"><td><a href="#NM_LCASE_TOSTRING">Nm: Class defines tostrin g(); should it be toString()?</a></td><td>Correctness</td></tr>
242 <tr bgcolor="#eeeeee"><td><a href="#NM_METHOD_CONSTRUCTOR_CONFUSION">Nm: Apparen t method/constructor confusion</a></td><td>Correctness</td></tr> 247 <tr bgcolor="#eeeeee"><td><a href="#NM_METHOD_CONSTRUCTOR_CONFUSION">Nm: Apparen t method/constructor confusion</a></td><td>Correctness</td></tr>
243 <tr bgcolor="#ffffff"><td><a href="#NM_VERY_CONFUSING">Nm: Very confusing method names</a></td><td>Correctness</td></tr> 248 <tr bgcolor="#ffffff"><td><a href="#NM_VERY_CONFUSING">Nm: Very confusing method names</a></td><td>Correctness</td></tr>
244 <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> 249 <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>
245 <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> 250 <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>
251 <tr bgcolor="#eeeeee"><td><a href="#RANGE_ARRAY_INDEX">RANGE: Array index is out of bounds</a></td><td>Correctness</td></tr>
252 <tr bgcolor="#ffffff"><td><a href="#RANGE_ARRAY_LENGTH">RANGE: Array length is o ut of bounds</a></td><td>Correctness</td></tr>
253 <tr bgcolor="#eeeeee"><td><a href="#RANGE_ARRAY_OFFSET">RANGE: Array offset is o ut of bounds</a></td><td>Correctness</td></tr>
254 <tr bgcolor="#ffffff"><td><a href="#RANGE_STRING_INDEX">RANGE: String index is o ut of bounds</a></td><td>Correctness</td></tr>
246 <tr bgcolor="#eeeeee"><td><a href="#RC_REF_COMPARISON">RC: Suspicious reference comparison</a></td><td>Correctness</td></tr> 255 <tr bgcolor="#eeeeee"><td><a href="#RC_REF_COMPARISON">RC: Suspicious reference comparison</a></td><td>Correctness</td></tr>
247 <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> 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>
248 <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> 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>
249 <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> 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>
250 <tr bgcolor="#eeeeee"><td><a href="#RE_POSSIBLE_UNINTENDED_PATTERN">RE: "." or " |" used for regular expression</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>
251 <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> 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>
252 <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> 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>
253 <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> 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>
254 <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> 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>
255 <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> 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>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 <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> 303 <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>
295 <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> 304 <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>
296 <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> 305 <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>
297 <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> 306 <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>
298 <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> 307 <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>
299 <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> 308 <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>
300 <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> 309 <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>
301 <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> 310 <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>
302 <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> 311 <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>
303 <tr bgcolor="#ffffff"><td><a href="#MS_MUTABLE_ARRAY">MS: Field is a mutable arr ay</a></td><td>Malicious code vulnerability</td></tr> 312 <tr bgcolor="#ffffff"><td><a href="#MS_MUTABLE_ARRAY">MS: Field is a mutable arr ay</a></td><td>Malicious code vulnerability</td></tr>
313 <tr bgcolor="#eeeeee"><td><a href="#MS_MUTABLE_COLLECTION">MS: Field is a mutabl e collection</a></td><td>Malicious code vulnerability</td></tr>
314 <tr bgcolor="#ffffff"><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>
304 <tr bgcolor="#eeeeee"><td><a href="#MS_MUTABLE_HASHTABLE">MS: Field is a mutable Hashtable</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>
305 <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> 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>
306 <tr bgcolor="#eeeeee"><td><a href="#MS_PKGPROTECT">MS: Field should be package p rotected</a></td><td>Malicious code vulnerability</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>
307 <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> 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>
308 <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> 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>
309 <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> 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>
310 <tr bgcolor="#eeeeee"><td><a href="#DC_DOUBLECHECK">DC: Possible double check of field</a></td><td>Multithreaded correctness</td></tr> 321 <tr bgcolor="#eeeeee"><td><a href="#DC_DOUBLECHECK">DC: Possible double check of field</a></td><td>Multithreaded correctness</td></tr>
311 <tr bgcolor="#ffffff"><td><a href="#DL_SYNCHRONIZATION_ON_BOOLEAN">DL: Synchroni zation on Boolean</a></td><td>Multithreaded correctness</td></tr> 322 <tr bgcolor="#ffffff"><td><a href="#DC_PARTIALLY_CONSTRUCTED">DC: Possible expos ure of partially initialized object</a></td><td>Multithreaded correctness</td></ tr>
312 <tr bgcolor="#eeeeee"><td><a href="#DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE">DL: S ynchronization on boxed primitive</a></td><td>Multithreaded correctness</td></tr > 323 <tr bgcolor="#eeeeee"><td><a href="#DL_SYNCHRONIZATION_ON_BOOLEAN">DL: Synchroni zation on Boolean</a></td><td>Multithreaded correctness</td></tr>
313 <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> 324 <tr bgcolor="#ffffff"><td><a href="#DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE">DL: S ynchronization on boxed primitive</a></td><td>Multithreaded correctness</td></tr >
314 <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> 325 <tr bgcolor="#eeeeee"><td><a href="#DL_SYNCHRONIZATION_ON_SHARED_CONSTANT">DL: S ynchronization on interned String </a></td><td>Multithreaded correctness</td></t r>
315 <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> 326 <tr bgcolor="#ffffff"><td><a href="#DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITI VE">DL: Synchronization on boxed primitive values</a></td><td>Multithreaded corr ectness</td></tr>
316 <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> 327 <tr bgcolor="#eeeeee"><td><a href="#DM_MONITOR_WAIT_ON_CONDITION">Dm: Monitor wa it() called on Condition</a></td><td>Multithreaded correctness</td></tr>
317 <tr bgcolor="#ffffff"><td><a href="#ESync_EMPTY_SYNC">ESync: Empty synchronized block</a></td><td>Multithreaded correctness</td></tr> 328 <tr bgcolor="#ffffff"><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>
318 <tr bgcolor="#eeeeee"><td><a href="#IS2_INCONSISTENT_SYNC">IS: Inconsistent sync hronization</a></td><td>Multithreaded correctness</td></tr> 329 <tr bgcolor="#eeeeee"><td><a href="#ESync_EMPTY_SYNC">ESync: Empty synchronized block</a></td><td>Multithreaded correctness</td></tr>
319 <tr bgcolor="#ffffff"><td><a href="#IS_FIELD_NOT_GUARDED">IS: Field not guarded against concurrent access</a></td><td>Multithreaded correctness</td></tr> 330 <tr bgcolor="#ffffff"><td><a href="#IS2_INCONSISTENT_SYNC">IS: Inconsistent sync hronization</a></td><td>Multithreaded correctness</td></tr>
320 <tr bgcolor="#eeeeee"><td><a href="#JLM_JSR166_LOCK_MONITORENTER">JLM: Synchroni zation performed on Lock</a></td><td>Multithreaded correctness</td></tr> 331 <tr bgcolor="#eeeeee"><td><a href="#IS_FIELD_NOT_GUARDED">IS: Field not guarded against concurrent access</a></td><td>Multithreaded correctness</td></tr>
321 <tr bgcolor="#ffffff"><td><a href="#JLM_JSR166_UTILCONCURRENT_MONITORENTER">JLM: Synchronization performed on util.concurrent instance</a></td><td>Multithreaded correctness</td></tr> 332 <tr bgcolor="#ffffff"><td><a href="#JLM_JSR166_LOCK_MONITORENTER">JLM: Synchroni zation performed on Lock</a></td><td>Multithreaded correctness</td></tr>
322 <tr bgcolor="#eeeeee"><td><a href="#JML_JSR166_CALLING_WAIT_RATHER_THAN_AWAIT">J LM: Using monitor style wait methods on util.concurrent abstraction</a></td><td> Multithreaded correctness</td></tr> 333 <tr bgcolor="#eeeeee"><td><a href="#JLM_JSR166_UTILCONCURRENT_MONITORENTER">JLM: Synchronization performed on util.concurrent instance</a></td><td>Multithreaded correctness</td></tr>
323 <tr bgcolor="#ffffff"><td><a href="#LI_LAZY_INIT_STATIC">LI: Incorrect lazy init ialization of static field</a></td><td>Multithreaded correctness</td></tr> 334 <tr bgcolor="#ffffff"><td><a href="#JML_JSR166_CALLING_WAIT_RATHER_THAN_AWAIT">J LM: Using monitor style wait methods on util.concurrent abstraction</a></td><td> Multithreaded correctness</td></tr>
324 <tr bgcolor="#eeeeee"><td><a href="#LI_LAZY_INIT_UPDATE_STATIC">LI: Incorrect la zy initialization and update of static field</a></td><td>Multithreaded correctne ss</td></tr> 335 <tr bgcolor="#eeeeee"><td><a href="#LI_LAZY_INIT_STATIC">LI: Incorrect lazy init ialization of static field</a></td><td>Multithreaded correctness</td></tr>
325 <tr bgcolor="#ffffff"><td><a href="#ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIEL D">ML: Synchronization on field in futile attempt to guard that field</a></td><t d>Multithreaded correctness</td></tr> 336 <tr bgcolor="#ffffff"><td><a href="#LI_LAZY_INIT_UPDATE_STATIC">LI: Incorrect la zy initialization and update of static field</a></td><td>Multithreaded correctne ss</td></tr>
326 <tr bgcolor="#eeeeee"><td><a href="#ML_SYNC_ON_UPDATED_FIELD">ML: Method synchro nizes on an updated field</a></td><td>Multithreaded correctness</td></tr> 337 <tr bgcolor="#eeeeee"><td><a href="#ML_SYNC_ON_FIELD_TO_GUARD_CHANGING_THAT_FIEL D">ML: Synchronization on field in futile attempt to guard that field</a></td><t d>Multithreaded correctness</td></tr>
327 <tr bgcolor="#ffffff"><td><a href="#MSF_MUTABLE_SERVLET_FIELD">MSF: Mutable serv let field</a></td><td>Multithreaded correctness</td></tr> 338 <tr bgcolor="#ffffff"><td><a href="#ML_SYNC_ON_UPDATED_FIELD">ML: Method synchro nizes on an updated field</a></td><td>Multithreaded correctness</td></tr>
328 <tr bgcolor="#eeeeee"><td><a href="#MWN_MISMATCHED_NOTIFY">MWN: Mismatched notif y()</a></td><td>Multithreaded correctness</td></tr> 339 <tr bgcolor="#eeeeee"><td><a href="#MSF_MUTABLE_SERVLET_FIELD">MSF: Mutable serv let field</a></td><td>Multithreaded correctness</td></tr>
329 <tr bgcolor="#ffffff"><td><a href="#MWN_MISMATCHED_WAIT">MWN: Mismatched wait()< /a></td><td>Multithreaded correctness</td></tr> 340 <tr bgcolor="#ffffff"><td><a href="#MWN_MISMATCHED_NOTIFY">MWN: Mismatched notif y()</a></td><td>Multithreaded correctness</td></tr>
330 <tr bgcolor="#eeeeee"><td><a href="#NN_NAKED_NOTIFY">NN: Naked notify</a></td><t d>Multithreaded correctness</td></tr> 341 <tr bgcolor="#eeeeee"><td><a href="#MWN_MISMATCHED_WAIT">MWN: Mismatched wait()< /a></td><td>Multithreaded correctness</td></tr>
331 <tr bgcolor="#ffffff"><td><a href="#NP_SYNC_AND_NULL_CHECK_FIELD">NP: Synchroniz e and null check on the same field.</a></td><td>Multithreaded correctness</td></ tr> 342 <tr bgcolor="#ffffff"><td><a href="#NN_NAKED_NOTIFY">NN: Naked notify</a></td><t d>Multithreaded correctness</td></tr>
332 <tr bgcolor="#eeeeee"><td><a href="#NO_NOTIFY_NOT_NOTIFYALL">No: Using notify() rather than notifyAll()</a></td><td>Multithreaded correctness</td></tr> 343 <tr bgcolor="#eeeeee"><td><a href="#NP_SYNC_AND_NULL_CHECK_FIELD">NP: Synchroniz e and null check on the same field.</a></td><td>Multithreaded correctness</td></ tr>
333 <tr bgcolor="#ffffff"><td><a href="#RS_READOBJECT_SYNC">RS: Class's readObject() method is synchronized</a></td><td>Multithreaded correctness</td></tr> 344 <tr bgcolor="#ffffff"><td><a href="#NO_NOTIFY_NOT_NOTIFYALL">No: Using notify() rather than notifyAll()</a></td><td>Multithreaded correctness</td></tr>
334 <tr bgcolor="#eeeeee"><td><a href="#RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED">RV: Return value of putIfAbsent ignored, value passed to putIfAbsent reused</a></td> <td>Multithreaded correctness</td></tr> 345 <tr bgcolor="#eeeeee"><td><a href="#RS_READOBJECT_SYNC">RS: Class's readObject() method is synchronized</a></td><td>Multithreaded correctness</td></tr>
335 <tr bgcolor="#ffffff"><td><a href="#RU_INVOKE_RUN">Ru: Invokes run on a thread ( did you mean to start it instead?)</a></td><td>Multithreaded correctness</td></t r> 346 <tr bgcolor="#ffffff"><td><a href="#RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED">RV: Return value of putIfAbsent ignored, value passed to putIfAbsent reused</a></td> <td>Multithreaded correctness</td></tr>
336 <tr bgcolor="#eeeeee"><td><a href="#SC_START_IN_CTOR">SC: Constructor invokes Th read.start()</a></td><td>Multithreaded correctness</td></tr> 347 <tr bgcolor="#eeeeee"><td><a href="#RU_INVOKE_RUN">Ru: Invokes run on a thread ( did you mean to start it instead?)</a></td><td>Multithreaded correctness</td></t r>
337 <tr bgcolor="#ffffff"><td><a href="#SP_SPIN_ON_FIELD">SP: Method spins on field< /a></td><td>Multithreaded correctness</td></tr> 348 <tr bgcolor="#ffffff"><td><a href="#SC_START_IN_CTOR">SC: Constructor invokes Th read.start()</a></td><td>Multithreaded correctness</td></tr>
338 <tr bgcolor="#eeeeee"><td><a href="#STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE">ST CAL: Call to static Calendar</a></td><td>Multithreaded correctness</td></tr> 349 <tr bgcolor="#eeeeee"><td><a href="#SP_SPIN_ON_FIELD">SP: Method spins on field< /a></td><td>Multithreaded correctness</td></tr>
339 <tr bgcolor="#ffffff"><td><a href="#STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE" >STCAL: Call to static DateFormat</a></td><td>Multithreaded correctness</td></tr > 350 <tr bgcolor="#ffffff"><td><a href="#STCAL_INVOKE_ON_STATIC_CALENDAR_INSTANCE">ST CAL: Call to static Calendar</a></td><td>Multithreaded correctness</td></tr>
340 <tr bgcolor="#eeeeee"><td><a href="#STCAL_STATIC_CALENDAR_INSTANCE">STCAL: Stati c Calendar field</a></td><td>Multithreaded correctness</td></tr> 351 <tr bgcolor="#eeeeee"><td><a href="#STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE" >STCAL: Call to static DateFormat</a></td><td>Multithreaded correctness</td></tr >
341 <tr bgcolor="#ffffff"><td><a href="#STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE">ST CAL: Static DateFormat</a></td><td>Multithreaded correctness</td></tr> 352 <tr bgcolor="#ffffff"><td><a href="#STCAL_STATIC_CALENDAR_INSTANCE">STCAL: Stati c Calendar field</a></td><td>Multithreaded correctness</td></tr>
342 <tr bgcolor="#eeeeee"><td><a href="#SWL_SLEEP_WITH_LOCK_HELD">SWL: Method calls Thread.sleep() with a lock held</a></td><td>Multithreaded correctness</td></tr> 353 <tr bgcolor="#eeeeee"><td><a href="#STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE">ST CAL: Static DateFormat</a></td><td>Multithreaded correctness</td></tr>
343 <tr bgcolor="#ffffff"><td><a href="#TLW_TWO_LOCK_WAIT">TLW: Wait with two locks held</a></td><td>Multithreaded correctness</td></tr> 354 <tr bgcolor="#ffffff"><td><a href="#SWL_SLEEP_WITH_LOCK_HELD">SWL: Method calls Thread.sleep() with a lock held</a></td><td>Multithreaded correctness</td></tr>
344 <tr bgcolor="#eeeeee"><td><a href="#UG_SYNC_SET_UNSYNC_GET">UG: Unsynchronized g et method, synchronized set method</a></td><td>Multithreaded correctness</td></t r> 355 <tr bgcolor="#eeeeee"><td><a href="#TLW_TWO_LOCK_WAIT">TLW: Wait with two locks held</a></td><td>Multithreaded correctness</td></tr>
345 <tr bgcolor="#ffffff"><td><a href="#UL_UNRELEASED_LOCK">UL: Method does not rele ase lock on all paths</a></td><td>Multithreaded correctness</td></tr> 356 <tr bgcolor="#ffffff"><td><a href="#UG_SYNC_SET_UNSYNC_GET">UG: Unsynchronized g et method, synchronized set method</a></td><td>Multithreaded correctness</td></t r>
346 <tr bgcolor="#eeeeee"><td><a href="#UL_UNRELEASED_LOCK_EXCEPTION_PATH">UL: Metho d does not release lock on all exception paths</a></td><td>Multithreaded correct ness</td></tr> 357 <tr bgcolor="#eeeeee"><td><a href="#UL_UNRELEASED_LOCK">UL: Method does not rele ase lock on all paths</a></td><td>Multithreaded correctness</td></tr>
347 <tr bgcolor="#ffffff"><td><a href="#UW_UNCOND_WAIT">UW: Unconditional wait</a></ td><td>Multithreaded correctness</td></tr> 358 <tr bgcolor="#ffffff"><td><a href="#UL_UNRELEASED_LOCK_EXCEPTION_PATH">UL: Metho d does not release lock on all exception paths</a></td><td>Multithreaded correct ness</td></tr>
348 <tr bgcolor="#eeeeee"><td><a href="#VO_VOLATILE_INCREMENT">VO: An increment to a volatile field isn't atomic</a></td><td>Multithreaded correctness</td></tr> 359 <tr bgcolor="#eeeeee"><td><a href="#UW_UNCOND_WAIT">UW: Unconditional wait</a></ td><td>Multithreaded correctness</td></tr>
349 <tr bgcolor="#ffffff"><td><a href="#VO_VOLATILE_REFERENCE_TO_ARRAY">VO: A volati le reference to an array doesn't treat the array elements as volatile</a></td><t d>Multithreaded correctness</td></tr> 360 <tr bgcolor="#ffffff"><td><a href="#VO_VOLATILE_INCREMENT">VO: An increment to a volatile field isn't atomic</a></td><td>Multithreaded correctness</td></tr>
350 <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> 361 <tr bgcolor="#eeeeee"><td><a href="#VO_VOLATILE_REFERENCE_TO_ARRAY">VO: A volati le reference to an array doesn't treat the array elements as volatile</a></td><t d>Multithreaded correctness</td></tr>
351 <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> 362 <tr bgcolor="#ffffff"><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>
352 <tr bgcolor="#eeeeee"><td><a href="#WA_AWAIT_NOT_IN_LOOP">Wa: Condition.await() not in loop </a></td><td>Multithreaded correctness</td></tr> 363 <tr bgcolor="#eeeeee"><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>
353 <tr bgcolor="#ffffff"><td><a href="#WA_NOT_IN_LOOP">Wa: Wait not in loop </a></t d><td>Multithreaded correctness</td></tr> 364 <tr bgcolor="#ffffff"><td><a href="#WA_AWAIT_NOT_IN_LOOP">Wa: Condition.await() not in loop </a></td><td>Multithreaded correctness</td></tr>
354 <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> 365 <tr bgcolor="#eeeeee"><td><a href="#WA_NOT_IN_LOOP">Wa: Wait not in loop </a></t d><td>Multithreaded correctness</td></tr>
355 <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> 366 <tr bgcolor="#ffffff"><td><a href="#BX_BOXING_IMMEDIATELY_UNBOXED">Bx: Primitive value is boxed and then immediately unboxed</a></td><td>Performance</td></tr>
367 <tr bgcolor="#eeeeee"><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>
368 <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>Per formance</td></tr>
356 <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> 369 <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>
357 <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> 370 <tr bgcolor="#ffffff"><td><a href="#DM_BOXED_PRIMITIVE_FOR_COMPARE">Bx: Boxing a primitive to compare</a></td><td>Performance</td></tr>
358 <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> 371 <tr bgcolor="#eeeeee"><td><a href="#DM_BOXED_PRIMITIVE_FOR_PARSING">Bx: Boxing/u nboxing to parse a primitive</a></td><td>Performance</td></tr>
359 <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> 372 <tr bgcolor="#ffffff"><td><a href="#DM_BOXED_PRIMITIVE_TOSTRING">Bx: Method allo cates a boxed primitive just to call toString</a></td><td>Performance</td></tr>
360 <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> 373 <tr bgcolor="#eeeeee"><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>
361 <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> 374 <tr bgcolor="#ffffff"><td><a href="#DM_NUMBER_CTOR">Bx: Method invokes inefficie nt Number constructor; use static valueOf instead</a></td><td>Performance</td></ tr>
362 <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> 375 <tr bgcolor="#eeeeee"><td><a href="#DMI_BLOCKING_METHODS_ON_URL">Dm: The equals and hashCode methods of URL are blocking</a></td><td>Performance</td></tr>
363 <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> 376 <tr bgcolor="#ffffff"><td><a href="#DMI_COLLECTION_OF_URLS">Dm: Maps and sets of URLs can be performance hogs</a></td><td>Performance</td></tr>
364 <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> 377 <tr bgcolor="#eeeeee"><td><a href="#DM_BOOLEAN_CTOR">Dm: Method invokes ineffici ent Boolean constructor; use Boolean.valueOf(...) instead</a></td><td>Performanc e</td></tr>
365 <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> 378 <tr bgcolor="#ffffff"><td><a href="#DM_GC">Dm: Explicit garbage collection; extr emely dubious except in benchmarking code</a></td><td>Performance</td></tr>
366 <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> 379 <tr bgcolor="#eeeeee"><td><a href="#DM_NEW_FOR_GETCLASS">Dm: Method allocates an object, only to get the class object</a></td><td>Performance</td></tr>
367 <tr bgcolor="#ffffff"><td><a href="#DM_STRING_CTOR">Dm: Method invokes inefficie nt new String(String) constructor</a></td><td>Performance</td></tr> 380 <tr bgcolor="#ffffff"><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>
368 <tr bgcolor="#eeeeee"><td><a href="#DM_STRING_TOSTRING">Dm: Method invokes toStr ing() method on a String</a></td><td>Performance</td></tr> 381 <tr bgcolor="#eeeeee"><td><a href="#DM_STRING_CTOR">Dm: Method invokes inefficie nt new String(String) constructor</a></td><td>Performance</td></tr>
369 <tr bgcolor="#ffffff"><td><a href="#DM_STRING_VOID_CTOR">Dm: Method invokes inef ficient new String() constructor</a></td><td>Performance</td></tr> 382 <tr bgcolor="#ffffff"><td><a href="#DM_STRING_TOSTRING">Dm: Method invokes toStr ing() method on a String</a></td><td>Performance</td></tr>
370 <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> 383 <tr bgcolor="#eeeeee"><td><a href="#DM_STRING_VOID_CTOR">Dm: Method invokes inef ficient new String() constructor</a></td><td>Performance</td></tr>
371 <tr bgcolor="#ffffff"><td><a href="#IIO_INEFFICIENT_INDEX_OF">IIO: Inefficient u se of String.indexOf(String)</a></td><td>Performance</td></tr> 384 <tr bgcolor="#ffffff"><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>
372 <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>
373 <tr bgcolor="#ffffff"><td><a href="#ITA_INEFFICIENT_TO_ARRAY">ITA: Method uses t oArray() with zero-length array argument</a></td><td>Performance</td></tr>
374 <tr bgcolor="#eeeeee"><td><a href="#SBSC_USE_STRINGBUFFER_CONCATENATION">SBSC: M ethod concatenates strings using + in a loop</a></td><td>Performance</td></tr> 385 <tr bgcolor="#eeeeee"><td><a href="#SBSC_USE_STRINGBUFFER_CONCATENATION">SBSC: M ethod concatenates strings using + in a loop</a></td><td>Performance</td></tr>
375 <tr bgcolor="#ffffff"><td><a href="#SIC_INNER_SHOULD_BE_STATIC">SIC: Should be a static inner class</a></td><td>Performance</td></tr> 386 <tr bgcolor="#ffffff"><td><a href="#SIC_INNER_SHOULD_BE_STATIC">SIC: Should be a static inner class</a></td><td>Performance</td></tr>
376 <tr bgcolor="#eeeeee"><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> 387 <tr bgcolor="#eeeeee"><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>
377 <tr bgcolor="#ffffff"><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> 388 <tr bgcolor="#ffffff"><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>
378 <tr bgcolor="#eeeeee"><td><a href="#SS_SHOULD_BE_STATIC">SS: Unread field: shoul d this field be static?</a></td><td>Performance</td></tr> 389 <tr bgcolor="#eeeeee"><td><a href="#SS_SHOULD_BE_STATIC">SS: Unread field: shoul d this field be static?</a></td><td>Performance</td></tr>
379 <tr bgcolor="#ffffff"><td><a href="#UM_UNNECESSARY_MATH">UM: Method calls static Math class method on a constant value</a></td><td>Performance</td></tr> 390 <tr bgcolor="#ffffff"><td><a href="#UM_UNNECESSARY_MATH">UM: Method calls static Math class method on a constant value</a></td><td>Performance</td></tr>
380 <tr bgcolor="#eeeeee"><td><a href="#UPM_UNCALLED_PRIVATE_METHOD">UPM: Private me thod is never called</a></td><td>Performance</td></tr> 391 <tr bgcolor="#eeeeee"><td><a href="#UPM_UNCALLED_PRIVATE_METHOD">UPM: Private me thod is never called</a></td><td>Performance</td></tr>
381 <tr bgcolor="#ffffff"><td><a href="#URF_UNREAD_FIELD">UrF: Unread field</a></td> <td>Performance</td></tr> 392 <tr bgcolor="#ffffff"><td><a href="#URF_UNREAD_FIELD">UrF: Unread field</a></td> <td>Performance</td></tr>
382 <tr bgcolor="#eeeeee"><td><a href="#UUF_UNUSED_FIELD">UuF: Unused field</a></td> <td>Performance</td></tr> 393 <tr bgcolor="#eeeeee"><td><a href="#UUF_UNUSED_FIELD">UuF: Unused field</a></td> <td>Performance</td></tr>
383 <tr bgcolor="#ffffff"><td><a href="#WMI_WRONG_MAP_ITERATOR">WMI: Inefficient use of keySet iterator instead of entrySet iterator</a></td><td>Performance</td></t r> 394 <tr bgcolor="#ffffff"><td><a href="#WMI_WRONG_MAP_ITERATOR">WMI: Inefficient use of keySet iterator instead of entrySet iterator</a></td><td>Performance</td></t r>
384 <tr bgcolor="#eeeeee"><td><a href="#DMI_CONSTANT_DB_PASSWORD">Dm: Hardcoded cons tant database password</a></td><td>Security</td></tr> 395 <tr bgcolor="#eeeeee"><td><a href="#DMI_CONSTANT_DB_PASSWORD">Dm: Hardcoded cons tant database password</a></td><td>Security</td></tr>
385 <tr bgcolor="#ffffff"><td><a href="#DMI_EMPTY_DB_PASSWORD">Dm: Empty database pa ssword</a></td><td>Security</td></tr> 396 <tr bgcolor="#ffffff"><td><a href="#DMI_EMPTY_DB_PASSWORD">Dm: Empty database pa ssword</a></td><td>Security</td></tr>
386 <tr bgcolor="#eeeeee"><td><a href="#HRS_REQUEST_PARAMETER_TO_COOKIE">HRS: HTTP c ookie formed from untrusted input</a></td><td>Security</td></tr> 397 <tr bgcolor="#eeeeee"><td><a href="#HRS_REQUEST_PARAMETER_TO_COOKIE">HRS: HTTP c ookie formed from untrusted input</a></td><td>Security</td></tr>
387 <tr bgcolor="#ffffff"><td><a href="#HRS_REQUEST_PARAMETER_TO_HTTP_HEADER">HRS: H TTP Response splitting vulnerability</a></td><td>Security</td></tr> 398 <tr bgcolor="#ffffff"><td><a href="#HRS_REQUEST_PARAMETER_TO_HTTP_HEADER">HRS: H TTP Response splitting vulnerability</a></td><td>Security</td></tr>
388 <tr bgcolor="#eeeeee"><td><a href="#PT_ABSOLUTE_PATH_TRAVERSAL">PT: Absolute pat h traversal in servlet</a></td><td>Security</td></tr> 399 <tr bgcolor="#eeeeee"><td><a href="#PT_ABSOLUTE_PATH_TRAVERSAL">PT: Absolute pat h traversal in servlet</a></td><td>Security</td></tr>
389 <tr bgcolor="#ffffff"><td><a href="#PT_RELATIVE_PATH_TRAVERSAL">PT: Relative pat h traversal in servlet</a></td><td>Security</td></tr> 400 <tr bgcolor="#ffffff"><td><a href="#PT_RELATIVE_PATH_TRAVERSAL">PT: Relative pat h traversal in servlet</a></td><td>Security</td></tr>
390 <tr bgcolor="#eeeeee"><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> 401 <tr bgcolor="#eeeeee"><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>
391 <tr bgcolor="#ffffff"><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> 402 <tr bgcolor="#ffffff"><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>
392 <tr bgcolor="#eeeeee"><td><a href="#XSS_REQUEST_PARAMETER_TO_JSP_WRITER">XSS: JS P reflected cross site scripting vulnerability</a></td><td>Security</td></tr> 403 <tr bgcolor="#eeeeee"><td><a href="#XSS_REQUEST_PARAMETER_TO_JSP_WRITER">XSS: JS P reflected cross site scripting vulnerability</a></td><td>Security</td></tr>
393 <tr bgcolor="#ffffff"><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> 404 <tr bgcolor="#ffffff"><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>
394 <tr bgcolor="#eeeeee"><td><a href="#XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER">XSS : Servlet reflected cross site scripting vulnerability</a></td><td>Security</td> </tr> 405 <tr bgcolor="#eeeeee"><td><a href="#XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER">XSS : Servlet reflected cross site scripting vulnerability</a></td><td>Security</td> </tr>
395 <tr bgcolor="#ffffff"><td><a href="#BC_BAD_CAST_TO_ABSTRACT_COLLECTION">BC: Ques tionable cast to abstract collection </a></td><td>Dodgy code</td></tr> 406 <tr bgcolor="#ffffff"><td><a href="#BC_BAD_CAST_TO_ABSTRACT_COLLECTION">BC: Ques tionable cast to abstract collection </a></td><td>Dodgy code</td></tr>
396 <tr bgcolor="#eeeeee"><td><a href="#BC_BAD_CAST_TO_CONCRETE_COLLECTION">BC: Ques tionable cast to concrete collection</a></td><td>Dodgy code</td></tr> 407 <tr bgcolor="#eeeeee"><td><a href="#BC_BAD_CAST_TO_CONCRETE_COLLECTION">BC: Ques tionable cast to concrete collection</a></td><td>Dodgy code</td></tr>
397 <tr bgcolor="#ffffff"><td><a href="#BC_UNCONFIRMED_CAST">BC: Unchecked/unconfirm ed cast</a></td><td>Dodgy code</td></tr> 408 <tr bgcolor="#ffffff"><td><a href="#BC_UNCONFIRMED_CAST">BC: Unchecked/unconfirm ed cast</a></td><td>Dodgy code</td></tr>
398 <tr bgcolor="#eeeeee"><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> 409 <tr bgcolor="#eeeeee"><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>
399 <tr bgcolor="#ffffff"><td><a href="#BC_VACUOUS_INSTANCEOF">BC: instanceof will a lways return true</a></td><td>Dodgy code</td></tr> 410 <tr bgcolor="#ffffff"><td><a href="#BC_VACUOUS_INSTANCEOF">BC: instanceof will a lways return true</a></td><td>Dodgy code</td></tr>
400 <tr bgcolor="#eeeeee"><td><a href="#ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT">BSH IFT: Unsigned right shift cast to short/byte</a></td><td>Dodgy code</td></tr> 411 <tr bgcolor="#eeeeee"><td><a href="#ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT">BSH IFT: Unsigned right shift cast to short/byte</a></td><td>Dodgy code</td></tr>
(...skipping 23 matching lines...) Expand all
424 <tr bgcolor="#eeeeee"><td><a href="#INT_VACUOUS_COMPARISON">INT: Vacuous compari son of integer value</a></td><td>Dodgy code</td></tr> 435 <tr bgcolor="#eeeeee"><td><a href="#INT_VACUOUS_COMPARISON">INT: Vacuous compari son of integer value</a></td><td>Dodgy code</td></tr>
425 <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> 436 <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>
426 <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> 437 <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>
427 <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> 438 <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>
428 <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> 439 <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>
429 <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> 440 <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>
430 <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> 441 <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>
431 <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 > 442 <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 >
432 <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> 443 <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>
433 <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> 444 <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>
434 <tr bgcolor="#eeeeee"><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> 445 <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>
435 <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> 446 <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>
436 <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> 447 <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>
437 <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> 448 <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>
438 <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> 449 <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>
439 <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> 450 <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>
440 <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> 451 <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>
441 <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> 452 <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>
442 <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> 453 <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>
443 <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> 454 <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>
444 <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> 455 <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>
445 <tr bgcolor="#ffffff"><td><a href="#RI_REDUNDANT_INTERFACES">RI: Class implement s same interface as superclass</a></td><td>Dodgy code</td></tr> 456 <tr bgcolor="#ffffff"><td><a href="#RI_REDUNDANT_INTERFACES">RI: Class implement s same interface as superclass</a></td><td>Dodgy code</td></tr>
446 <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> 457 <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>
447 <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> 458 <tr bgcolor="#ffffff"><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>
448 <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> 459 <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>
449 <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> 460 <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>
450 <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> 461 <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>
451 <tr bgcolor="#ffffff"><td><a href="#SA_FIELD_DOUBLE_ASSIGNMENT">SA: Double assig nment of field</a></td><td>Dodgy code</td></tr> 462 <tr bgcolor="#ffffff"><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>
452 <tr bgcolor="#eeeeee"><td><a href="#SA_LOCAL_DOUBLE_ASSIGNMENT">SA: Double assig nment of local variable </a></td><td>Dodgy code</td></tr> 463 <tr bgcolor="#eeeeee"><td><a href="#SA_FIELD_DOUBLE_ASSIGNMENT">SA: Double assig nment of field</a></td><td>Dodgy code</td></tr>
453 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_ASSIGNMENT">SA: Self assignmen t of local variable</a></td><td>Dodgy code</td></tr> 464 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_DOUBLE_ASSIGNMENT">SA: Double assig nment of local variable </a></td><td>Dodgy code</td></tr>
454 <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> 465 <tr bgcolor="#eeeeee"><td><a href="#SA_LOCAL_SELF_ASSIGNMENT">SA: Self assignmen t of local variable</a></td><td>Dodgy code</td></tr>
455 <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> 466 <tr bgcolor="#ffffff"><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>
456 <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> 467 <tr bgcolor="#eeeeee"><td><a href="#SF_SWITCH_NO_DEFAULT">SF: Switch statement f ound where default case is missing</a></td><td>Dodgy code</td></tr>
457 <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> 468 <tr bgcolor="#ffffff"><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>
458 <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> 469 <tr bgcolor="#eeeeee"><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>
459 <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> 470 <tr bgcolor="#ffffff"><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>
460 <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> 471 <tr bgcolor="#eeeeee"><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>
472 <tr bgcolor="#ffffff"><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>
473 <tr bgcolor="#eeeeee"><td><a href="#UC_USELESS_CONDITION">UC: Condition has no e ffect</a></td><td>Dodgy code</td></tr>
474 <tr bgcolor="#ffffff"><td><a href="#UC_USELESS_CONDITION_TYPE">UC: Condition has no effect due to the variable type</a></td><td>Dodgy code</td></tr>
475 <tr bgcolor="#eeeeee"><td><a href="#UC_USELESS_OBJECT">UC: Useless object create d</a></td><td>Dodgy code</td></tr>
476 <tr bgcolor="#ffffff"><td><a href="#UC_USELESS_OBJECT_STACK">UC: Useless object created on stack</a></td><td>Dodgy code</td></tr>
477 <tr bgcolor="#eeeeee"><td><a href="#UC_USELESS_VOID_METHOD">UC: Useless non-empt y void method</a></td><td>Dodgy code</td></tr>
461 <tr bgcolor="#ffffff"><td><a href="#UCF_USELESS_CONTROL_FLOW">UCF: Useless contr ol flow</a></td><td>Dodgy code</td></tr> 478 <tr bgcolor="#ffffff"><td><a href="#UCF_USELESS_CONTROL_FLOW">UCF: Useless contr ol flow</a></td><td>Dodgy code</td></tr>
462 <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> 479 <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>
463 <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> 480 <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>
464 <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> 481 <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>
465 <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> 482 <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>
466 <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> 483 <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>
467 <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> 484 <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>
468 </table> 485 </table>
469 <h2>Descriptions</h2> 486 <h2>Descriptions</h2>
470 <h3><a name="BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS">BC: Equals method sho uld not assume anything about the type of its argument (BC_EQUALS_METHOD_SHOULD_ WORK_FOR_ALL_OBJECTS)</a></h3> 487 <h3><a name="BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS">BC: Equals method sho uld not assume anything about the type of its argument (BC_EQUALS_METHOD_SHOULD_ WORK_FOR_ALL_OBJECTS)</a></h3>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 548
532 <h3><a name="CO_ABSTRACT_SELF">Co: Abstract class defines covariant compareTo() method (CO_ABSTRACT_SELF)</a></h3> 549 <h3><a name="CO_ABSTRACT_SELF">Co: Abstract class defines covariant compareTo() method (CO_ABSTRACT_SELF)</a></h3>
533 550
534 551
535 <p> This class defines a covariant version of <code>compareTo()</code>.&nbsp; 552 <p> This class defines a covariant version of <code>compareTo()</code>.&nbsp;
536 To correctly override the <code>compareTo()</code> method in the 553 To correctly override the <code>compareTo()</code> method in the
537 <code>Comparable</code> interface, the parameter of <code>compareTo()</code> 554 <code>Comparable</code> interface, the parameter of <code>compareTo()</code>
538 must have type <code>java.lang.Object</code>.</p> 555 must have type <code>java.lang.Object</code>.</p>
539 556
540 557
558 <h3><a name="CO_COMPARETO_INCORRECT_FLOATING">Co: compareTo()/compare() incorrec tly handles float or double value (CO_COMPARETO_INCORRECT_FLOATING)</a></h3>
559
560
561 <p>This method compares double or float values using pattern like this: val1 & gt; val2 ? 1 : val1 &lt; val2 ? -1 : 0.
562 This pattern works incorrectly for -0.0 and NaN values which may result in incor rect sorting result or broken collection
563 (if compared values are used as keys). Consider using Double.compare or Float.co mpare static methods which handle all
564 the special cases correctly.</p>
565
566
567 <h3><a name="CO_COMPARETO_RESULTS_MIN_VALUE">Co: compareTo()/compare() returns I nteger.MIN_VALUE (CO_COMPARETO_RESULTS_MIN_VALUE)</a></h3>
568
569
570 <p> In some situation, this compareTo or compare method returns
571 the constant Integer.MIN_VALUE, which is an exceptionally bad practice.
572 The only thing that matters about the return value of compareTo is the sign of the result.
573 But people will sometimes negate the return value of compareTo, expecting th at this will negate
574 the sign of the result. And it will, except in the case where the value retu rned is Integer.MIN_VALUE.
575 So just return -1 rather than Integer.MIN_VALUE.
576
577
541 <h3><a name="CO_SELF_NO_OBJECT">Co: Covariant compareTo() method defined (CO_SEL F_NO_OBJECT)</a></h3> 578 <h3><a name="CO_SELF_NO_OBJECT">Co: Covariant compareTo() method defined (CO_SEL F_NO_OBJECT)</a></h3>
542 579
543 580
544 <p> This class defines a covariant version of <code>compareTo()</code>.&nbsp; 581 <p> This class defines a covariant version of <code>compareTo()</code>.&nbsp;
545 To correctly override the <code>compareTo()</code> method in the 582 To correctly override the <code>compareTo()</code> method in the
546 <code>Comparable</code> interface, the parameter of <code>compareTo()</code> 583 <code>Comparable</code> interface, the parameter of <code>compareTo()</code>
547 must have type <code>java.lang.Object</code>.</p> 584 must have type <code>java.lang.Object</code>.</p>
548 585
549 586
550 <h3><a name="DE_MIGHT_DROP">DE: Method might drop exception (DE_MIGHT_DROP)</a>< /h3> 587 <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
672 709
673 <h3><a name="EQ_COMPARETO_USE_OBJECT_EQUALS">Eq: Class defines compareTo(...) an d uses Object.equals() (EQ_COMPARETO_USE_OBJECT_EQUALS)</a></h3> 710 <h3><a name="EQ_COMPARETO_USE_OBJECT_EQUALS">Eq: Class defines compareTo(...) an d uses Object.equals() (EQ_COMPARETO_USE_OBJECT_EQUALS)</a></h3>
674 711
675 712
676 <p> This class defines a <code>compareTo(...)</code> method but inherits its 713 <p> This class defines a <code>compareTo(...)</code> method but inherits its
677 <code>equals()</code> method from <code>java.lang.Object</code>. 714 <code>equals()</code> method from <code>java.lang.Object</code>.
678 Generally, the value of compareTo should return zero if and only if 715 Generally, the value of compareTo should return zero if and only if
679 equals returns true. If this is violated, weird and unpredictable 716 equals returns true. If this is violated, weird and unpredictable
680 failures will occur in classes such as PriorityQueue. 717 failures will occur in classes such as PriorityQueue.
681 In Java 5 the PriorityQueue.remove method uses the compareTo method, 718 In Java 5 the PriorityQueue.remove method uses the compareTo method,
682 while in Java 6 it uses the equals method. 719 while in Java 6 it uses the equals method.</p>
683 720
684 <p>From the JavaDoc for the compareTo method in the Comparable interface: 721 <p>From the JavaDoc for the compareTo method in the Comparable interface:
685 <blockquote> 722 <blockquote>
686 It is strongly recommended, but not strictly required that <code>(x.compareTo(y) ==0) == (x.equals(y))</code>. 723 It is strongly recommended, but not strictly required that <code>(x.compareTo(y) ==0) == (x.equals(y))</code>.
687 Generally speaking, any class that implements the Comparable interface and viola tes this condition 724 Generally speaking, any class that implements the Comparable interface and viola tes this condition
688 should clearly indicate this fact. The recommended language 725 should clearly indicate this fact. The recommended language
689 is "Note: this class has a natural ordering that is inconsistent with equals." 726 is "Note: this class has a natural ordering that is inconsistent with equals."
690 </blockquote> 727 </blockquote></p>
691 728
692 729
693 <h3><a name="EQ_GETCLASS_AND_CLASS_CONSTANT">Eq: equals method fails for subtype s (EQ_GETCLASS_AND_CLASS_CONSTANT)</a></h3> 730 <h3><a name="EQ_GETCLASS_AND_CLASS_CONSTANT">Eq: equals method fails for subtype s (EQ_GETCLASS_AND_CLASS_CONSTANT)</a></h3>
694 731
695 732
696 <p> This class has an equals method that will be broken if it is inherited by subclasses. 733 <p> This class has an equals method that will be broken if it is inherited by subclasses.
697 It compares a class literal with the class of the argument (e.g., in class <code >Foo</code> 734 It compares a class literal with the class of the argument (e.g., in class <code >Foo</code>
698 it might check if <code>Foo.class == o.getClass()</code>). 735 it might check if <code>Foo.class == o.getClass()</code>).
699 It is better to check if <code>this.getClass() == o.getClass()</code>. 736 It is better to check if <code>this.getClass() == o.getClass()</code>.
700 </p> 737 </p>
(...skipping 17 matching lines...) Expand all
718 755
719 <h3><a name="FI_EXPLICIT_INVOCATION">FI: Explicit invocation of finalizer (FI_EX PLICIT_INVOCATION)</a></h3> 756 <h3><a name="FI_EXPLICIT_INVOCATION">FI: Explicit invocation of finalizer (FI_EX PLICIT_INVOCATION)</a></h3>
720 757
721 758
722 <p> This method contains an explicit invocation of the <code>finalize()</code> 759 <p> This method contains an explicit invocation of the <code>finalize()</code>
723 method on an object.&nbsp; Because finalizer methods are supposed to be 760 method on an object.&nbsp; Because finalizer methods are supposed to be
724 executed once, and only by the VM, this is a bad idea.</p> 761 executed once, and only by the VM, this is a bad idea.</p>
725 <p>If a connected set of objects beings finalizable, then the VM will invoke the 762 <p>If a connected set of objects beings finalizable, then the VM will invoke the
726 finalize method on all the finalizable object, possibly at the same time in diff erent threads. 763 finalize method on all the finalizable object, possibly at the same time in diff erent threads.
727 Thus, it is a particularly bad idea, in the finalize method for a class X, invok e finalize 764 Thus, it is a particularly bad idea, in the finalize method for a class X, invok e finalize
728 on objects referenced by X, because they may already be getting finalized in a s eparate thread. 765 on objects referenced by X, because they may already be getting finalized in a s eparate thread.</p>
729 766
730 767
731 <h3><a name="FI_FINALIZER_NULLS_FIELDS">FI: Finalizer nulls fields (FI_FINALIZER _NULLS_FIELDS)</a></h3> 768 <h3><a name="FI_FINALIZER_NULLS_FIELDS">FI: Finalizer nulls fields (FI_FINALIZER _NULLS_FIELDS)</a></h3>
732 769
733 770
734 <p> This finalizer nulls out fields. This is usually an error, as it does not aid garbage collection, 771 <p> This finalizer nulls out fields. This is usually an error, as it does not aid garbage collection,
735 and the object is going to be garbage collected anyway. 772 and the object is going to be garbage collected anyway.</p>
736 773
737 774
738 <h3><a name="FI_FINALIZER_ONLY_NULLS_FIELDS">FI: Finalizer only nulls fields (FI _FINALIZER_ONLY_NULLS_FIELDS)</a></h3> 775 <h3><a name="FI_FINALIZER_ONLY_NULLS_FIELDS">FI: Finalizer only nulls fields (FI _FINALIZER_ONLY_NULLS_FIELDS)</a></h3>
739 776
740 777
741 <p> This finalizer does nothing except null out fields. This is completely poi ntless, and requires that 778 <p> This finalizer does nothing except null out fields. This is completely poi ntless, and requires that
742 the object be garbage collected, finalized, and then garbage collected again. Yo u should just remove the finalize 779 the object be garbage collected, finalized, and then garbage collected again. Yo u should just remove the finalize
743 method. 780 method.</p>
744 781
745 782
746 <h3><a name="FI_MISSING_SUPER_CALL">FI: Finalizer does not call superclass final izer (FI_MISSING_SUPER_CALL)</a></h3> 783 <h3><a name="FI_MISSING_SUPER_CALL">FI: Finalizer does not call superclass final izer (FI_MISSING_SUPER_CALL)</a></h3>
747 784
748 785
749 <p> This <code>finalize()</code> method does not make a call to its 786 <p> This <code>finalize()</code> method does not make a call to its
750 superclass's <code>finalize()</code> method.&nbsp; So, any finalizer 787 superclass's <code>finalize()</code> method.&nbsp; So, any finalizer
751 actions defined for the superclass will not be performed.&nbsp; 788 actions defined for the superclass will not be performed.&nbsp;
752 Add a call to <code>super.finalize()</code>.</p> 789 Add a call to <code>super.finalize()</code>.</p>
753 790
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 950
914 951
915 <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> 952 <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>
916 953
917 954
918 <p> The class is annotated with net.jcip.annotations.Immutable or javax.annota tion.concurrent.Immutable, 955 <p> The class is annotated with net.jcip.annotations.Immutable or javax.annota tion.concurrent.Immutable,
919 and the rules for those annotations require that all fields are final. 956 and the rules for those annotations require that all fields are final.
920 .</p> 957 .</p>
921 958
922 959
960 <h3><a name="ME_ENUM_FIELD_SETTER">ME: Public enum method unconditionally sets i ts field (ME_ENUM_FIELD_SETTER)</a></h3>
961
962
963 <p>This public method declared in public enum unconditionally sets enum field, thus this field can be changed by malicious code
964 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.
965 Consider removing this method or declaring it package-private.</p>
966
967
968 <h3><a name="ME_MUTABLE_ENUM_FIELD">ME: Enum field is public and mutable (ME_MUT ABLE_ENUM_FIELD)</a></h3>
969
970
971 <p>A mutable public field is defined inside a public enum, thus can be changed by malicious code or by accident from another package.
972 Though mutable enum fields may be used for lazy initialization, it's a bad pra ctice to expose them to the outer world.
973 Consider declaring this field final and/or package-private.</p>
974
975
923 <h3><a name="NP_BOOLEAN_RETURN_NULL">NP: Method with Boolean return type returns explicit null (NP_BOOLEAN_RETURN_NULL)</a></h3> 976 <h3><a name="NP_BOOLEAN_RETURN_NULL">NP: Method with Boolean return type returns explicit null (NP_BOOLEAN_RETURN_NULL)</a></h3>
924 977
925 978
926 <p> 979 <p>
927 A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accid ent waiting to happen. 980 A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accid ent waiting to happen.
928 This method can be invoked as though it returned a value of type boolean, an d 981 This method can be invoked as though it returned a value of type boolean, an d
929 the compiler will insert automatic unboxing of the Boolean value. If a null value is returned, 982 the compiler will insert automatic unboxing of the Boolean value. If a null value is returned,
930 this will result in a NullPointerException. 983 this will result in a NullPointerException.
931 </p> 984 </p>
932 985
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 </p> 1068 </p>
1016 1069
1017 1070
1018 <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> 1071 <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>
1019 1072
1020 1073
1021 <p> This class/interface has a simple name that is identical to that of an imp lemented/extended interface, except 1074 <p> This class/interface has a simple name that is identical to that of an imp lemented/extended interface, except
1022 that the interface is in a different package (e.g., <code>alpha.Foo</code> exten ds <code>beta.Foo</code>). 1075 that the interface is in a different package (e.g., <code>alpha.Foo</code> exten ds <code>beta.Foo</code>).
1023 This can be exceptionally confusing, create lots of situations in which you have to look at import statements 1076 This can be exceptionally confusing, create lots of situations in which you have to look at import statements
1024 to resolve references and creates many 1077 to resolve references and creates many
1025 opportunities to accidently define methods that do not override methods in their superclasses. 1078 opportunities to accidentally define methods that do not override methods in the ir superclasses.
1026 </p> 1079 </p>
1027 1080
1028 1081
1029 <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> 1082 <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>
1030 1083
1031 1084
1032 <p> This class has a simple name that is identical to that of its superclass, except 1085 <p> This class has a simple name that is identical to that of its superclass, except
1033 that its superclass is in a different package (e.g., <code>alpha.Foo</code> exte nds <code>beta.Foo</code>). 1086 that its superclass is in a different package (e.g., <code>alpha.Foo</code> exte nds <code>beta.Foo</code>).
1034 This can be exceptionally confusing, create lots of situations in which you have to look at import statements 1087 This can be exceptionally confusing, create lots of situations in which you have to look at import statements
1035 to resolve references and creates many 1088 to resolve references and creates many
1036 opportunities to accidently define methods that do not override methods in their superclasses. 1089 opportunities to accidentally define methods that do not override methods in the ir superclasses.
1037 </p> 1090 </p>
1038 1091
1039 1092
1040 <h3><a name="NM_VERY_CONFUSING_INTENTIONAL">Nm: Very confusing method names (but perhaps intentional) (NM_VERY_CONFUSING_INTENTIONAL)</a></h3> 1093 <h3><a name="NM_VERY_CONFUSING_INTENTIONAL">Nm: Very confusing method names (but perhaps intentional) (NM_VERY_CONFUSING_INTENTIONAL)</a></h3>
1041 1094
1042 1095
1043 <p> The referenced methods have names that differ only by capitalization. 1096 <p> The referenced methods have names that differ only by capitalization.
1044 This is very confusing because if the capitalization were 1097 This is very confusing because if the capitalization were
1045 identical then one of the methods would override the other. From the existence o f other methods, it 1098 identical then one of the methods would override the other. From the existence o f other methods, it
1046 seems that the existence of both of these methods is intentional, but is sure is confusing. 1099 seems that the existence of both of these methods is intentional, but is sure is confusing.
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1548 1601
1549 1602
1550 <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> 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>
1551 1604
1552 1605
1553 <p> This method overrides a method found in a parent class, where that class is an Adapter that implements 1606 <p> This method overrides a method found in a parent class, where that class is an Adapter that implements
1554 a listener defined in the java.awt.event or javax.swing.event package. As a resu lt, this method will not 1607 a listener defined in the java.awt.event or javax.swing.event package. As a resu lt, this method will not
1555 get called when the event occurs.</p> 1608 get called when the event occurs.</p>
1556 1609
1557 1610
1611 <h3><a name="BSHIFT_WRONG_ADD_PRIORITY">BSHIFT: Possible bad parsing of shift op eration (BSHIFT_WRONG_ADD_PRIORITY)</a></h3>
1612
1613
1614 <p>
1615 The code performs an operation like (x &lt;&lt; 8 + y). Although this might be c orrect, probably it was meant
1616 to perform (x &lt;&lt; 8) + y, but shift operation has
1617 a lower precedence, so it's actually parsed as x &lt;&lt; (8 + y).
1618 </p>
1619
1620
1558 <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> 1621 <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>
1559 1622
1560 1623
1561 <p> 1624 <p>
1562 The code performs shift of a 32 bit int by a constant amount outside 1625 The code performs shift of a 32 bit int by a constant amount outside
1563 the range -31..31. 1626 the range -31..31.
1564 The effect of this is to use the lower 5 bits of the integer 1627 The effect of this is to use the lower 5 bits of the integer
1565 value to decide how much to shift by (e.g., shifting by 40 bits is the same as s hifting by 8 bits, 1628 value to decide how much to shift by (e.g., shifting by 40 bits is the same as s hifting by 8 bits,
1566 and shifting by 32 bits is the same as shifting by zero bits). This probably isn 't what was expected, 1629 and shifting by 32 bits is the same as shifting by zero bits). This probably isn 't what was expected,
1567 and it is at least confusing. 1630 and it is at least confusing.
1568 </p> 1631 </p>
1569 1632
1570 1633
1571 <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>
1572
1573
1574 <p>A wrapped primitive value is unboxed and converted to another primitive typ e as part of the
1575 evaluation of a conditional ternary operator (the <code> b ? e1 : e2</code> oper ator). The
1576 semantics of Java mandate that if <code>e1</code> and <code>e2</code> are wrappe d
1577 numeric values, the values are unboxed and converted/coerced to their common typ e (e.g,
1578 if <code>e1</code> is of type <code>Integer</code>
1579 and <code>e2</code> is of type <code>Float</code>, then <code>e1</code> is unbox ed,
1580 converted to a floating point value, and boxed. See JLS Section 15.25.
1581 </p>
1582
1583
1584 <h3><a name="CO_COMPARETO_RESULTS_MIN_VALUE">Co: compareTo()/compare() returns I nteger.MIN_VALUE (CO_COMPARETO_RESULTS_MIN_VALUE)</a></h3>
1585
1586
1587 <p> In some situation, this compareTo or compare method returns
1588 the constant Integer.MIN_VALUE, which is an exceptionally bad practice.
1589 The only thing that matters about the return value of compareTo is the sign of the result.
1590 But people will sometimes negate the return value of compareTo, expecting th at this will negate
1591 the sign of the result. And it will, except in the case where the value retu rned is Integer.MIN_VALUE.
1592 So just return -1 rather than Integer.MIN_VALUE.
1593
1594
1595 <h3><a name="DLS_DEAD_LOCAL_INCREMENT_IN_RETURN">DLS: Useless increment in retur n statement (DLS_DEAD_LOCAL_INCREMENT_IN_RETURN)</a></h3> 1634 <h3><a name="DLS_DEAD_LOCAL_INCREMENT_IN_RETURN">DLS: Useless increment in retur n statement (DLS_DEAD_LOCAL_INCREMENT_IN_RETURN)</a></h3>
1596 1635
1597 1636
1598 <p>This statement has a return such as <code>return x++;</code>. 1637 <p>This statement has a return such as <code>return x++;</code>.
1599 A postfix increment/decrement does not impact the value of the expression, 1638 A postfix increment/decrement does not impact the value of the expression,
1600 so this increment/decrement has no effect. 1639 so this increment/decrement has no effect.
1601 Please verify that this statement does the right thing. 1640 Please verify that this statement does the right thing.
1602 </p> 1641 </p>
1603 1642
1604 1643
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1744 1783
1745 1784
1746 <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> 1785 <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>
1747 1786
1748 1787
1749 <p>This call doesn't pass any objects to the EasyMock method, so the call do esn't do anything. 1788 <p>This call doesn't pass any objects to the EasyMock method, so the call do esn't do anything.
1750 </p> 1789 </p>
1751 1790
1752 1791
1753 1792
1793 <h3><a name="DM_INVALID_MIN_MAX">Dm: Incorrect combination of Math.max and Math. min (DM_INVALID_MIN_MAX)</a></h3>
1794
1795
1796 <p>This code tries to limit the value bounds using the construct like Math.min (0, Math.max(100, value)). However the order of
1797 the constants is incorrect: it should be Math.min(100, Math.max(0, value)). As the result this code always produces the same result
1798 (or NaN if the value is NaN).</p>
1799
1800
1754 <h3><a name="EC_ARRAY_AND_NONARRAY">EC: equals() used to compare array and nonar ray (EC_ARRAY_AND_NONARRAY)</a></h3> 1801 <h3><a name="EC_ARRAY_AND_NONARRAY">EC: equals() used to compare array and nonar ray (EC_ARRAY_AND_NONARRAY)</a></h3>
1755 1802
1756 1803
1757 <p> 1804 <p>
1758 This method invokes the .equals(Object o) to compare an array and a reference th at doesn't seem 1805 This method invokes the .equals(Object o) to compare an array and a reference th at doesn't seem
1759 to be an array. If things being compared are of different types, they are guaran teed to be unequal 1806 to be an array. If things being compared are of different types, they are guaran teed to be unequal
1760 and the comparison is almost certainly an error. Even if they are both arrays, t he equals method 1807 and the comparison is almost certainly an error. Even if they are both arrays, t he equals method
1761 on arrays only determines of the two arrays are the same object. 1808 on arrays only determines of the two arrays are the same object.
1762 To compare the 1809 To compare the
1763 contents of the arrays, use java.util.Arrays.equals(Object[], Object[]). 1810 contents of the arrays, use java.util.Arrays.equals(Object[], Object[]).
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1829 classes should always compare as unequal; therefore, according to the 1876 classes should always compare as unequal; therefore, according to the
1830 contract defined by java.lang.Object.equals(Object), 1877 contract defined by java.lang.Object.equals(Object),
1831 the result of this comparison will always be false at runtime. 1878 the result of this comparison will always be false at runtime.
1832 </p> 1879 </p>
1833 1880
1834 1881
1835 <h3><a name="EC_UNRELATED_TYPES">EC: Call to equals() comparing different types (EC_UNRELATED_TYPES)</a></h3> 1882 <h3><a name="EC_UNRELATED_TYPES">EC: Call to equals() comparing different types (EC_UNRELATED_TYPES)</a></h3>
1836 1883
1837 1884
1838 <p> This method calls equals(Object) on two references of different 1885 <p> This method calls equals(Object) on two references of different
1839 class types with no common subclasses. 1886 class types and analysis suggests they will be to objects of different classes
1840 Therefore, the objects being compared 1887 at runtime. Further, examination of the equals methods that would be invoked sug gest that either
1841 are unlikely to be members of the same class at runtime 1888 this call will always return false, or else the equals method is not be symmetri c (which is
1842 (unless some application classes were not analyzed, or dynamic class 1889 a property required by the contract
1843 loading can occur at runtime). 1890 for equals in class Object).
1844 According to the contract of equals(),
1845 objects of different
1846 classes should always compare as unequal; therefore, according to the
1847 contract defined by java.lang.Object.equals(Object),
1848 the result of this comparison will always be false at runtime.
1849 </p> 1891 </p>
1850 1892
1851 1893
1852 <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> 1894 <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>
1853 1895
1854 1896
1855 <p> This method uses using pointer equality to compare two references that seem to be of 1897 <p> This method uses using pointer equality to compare two references that seem to be of
1856 different types. The result of this comparison will always be false at runtime. 1898 different types. The result of this comparison will always be false at runtime.
1857 </p> 1899 </p>
1858 1900
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
2092 2134
2093 2135
2094 <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> 2136 <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>
2095 2137
2096 2138
2097 <p> 2139 <p>
2098 This code converts a 32-bit int value to a 64-bit long value, and then 2140 This code converts a 32-bit int value to a 64-bit long value, and then
2099 passes that value for a method parameter that requires an absolute time value. 2141 passes that value for a method parameter that requires an absolute time value.
2100 An absolute time value is the number 2142 An absolute time value is the number
2101 of milliseconds since the standard base time known as "the epoch", namely Januar y 1, 1970, 00:00:00 GMT. 2143 of milliseconds since the standard base time known as "the epoch", namely Januar y 1, 1970, 00:00:00 GMT.
2102 For example, the following method, intended to convert seconds since the epoc in to a Date, is badly 2144 For example, the following method, intended to convert seconds since the epoch i nto a Date, is badly
2103 broken:</p> 2145 broken:</p>
2104 <pre> 2146 <pre>
2105 Date getDate(int seconds) { return new Date(seconds * 1000); } 2147 Date getDate(int seconds) { return new Date(seconds * 1000); }
2106 </pre> 2148 </pre>
2107 <p>The multiplication is done using 32-bit arithmetic, and then converted to a 6 4-bit value. 2149 <p>The multiplication is done using 32-bit arithmetic, and then converted to a 6 4-bit value.
2108 When a 32-bit value is converted to 64-bits and used to express an absolute time 2150 When a 32-bit value is converted to 64-bits and used to express an absolute time
2109 value, only dates in December 1969 and January 1970 can be represented.</p> 2151 value, only dates in December 1969 and January 1970 can be represented.</p>
2110 2152
2111 <p>Correct implementations for the above method are:</p> 2153 <p>Correct implementations for the above method are:</p>
2112 2154
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
2234 2276
2235 <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> 2277 <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>
2236 2278
2237 2279
2238 <p> This code compares an int value with a long constant that is outside 2280 <p> This code compares an int value with a long constant that is outside
2239 the range of values that can be represented as an int value. 2281 the range of values that can be represented as an int value.
2240 This comparison is vacuous and possibily to be incorrect. 2282 This comparison is vacuous and possibily to be incorrect.
2241 </p> 2283 </p>
2242 2284
2243 2285
2244 <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> 2286 <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>
2245 2287
2246 2288
2247 <p> This code compares a value that is guaranteed to be non-negative with a nega tive constant. 2289 <p> This code compares a value that is guaranteed to be non-negative with a nega tive constant or zero.
2248 </p> 2290 </p>
2249 2291
2250 2292
2251 <h3><a name="INT_BAD_COMPARISON_WITH_SIGNED_BYTE">INT: Bad comparison of signed byte (INT_BAD_COMPARISON_WITH_SIGNED_BYTE)</a></h3> 2293 <h3><a name="INT_BAD_COMPARISON_WITH_SIGNED_BYTE">INT: Bad comparison of signed byte (INT_BAD_COMPARISON_WITH_SIGNED_BYTE)</a></h3>
2252 2294
2253 2295
2254 <p> Signed bytes can only have a value in the range -128 to 127. Comparing 2296 <p> Signed bytes can only have a value in the range -128 to 127. Comparing
2255 a signed byte with a value outside that range is vacuous and likely to be incorr ect. 2297 a signed byte with a value outside that range is vacuous and likely to be incorr ect.
2256 To convert a signed byte <code>b</code> to an unsigned value in the range 0..255 , 2298 To convert a signed byte <code>b</code> to an unsigned value in the range 0..255 ,
2257 use <code>0xff &amp; b</code> 2299 use <code>0xff &amp; b</code>
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
2346 2388
2347 2389
2348 <p> 2390 <p>
2349 There is a statement or branch that if executed guarantees that 2391 There is a statement or branch that if executed guarantees that
2350 a value is null at this point, and that 2392 a value is null at this point, and that
2351 value that is guaranteed to be dereferenced 2393 value that is guaranteed to be dereferenced
2352 (except on forward paths involving runtime exceptions). 2394 (except on forward paths involving runtime exceptions).
2353 </p> 2395 </p>
2354 <p>Note that a check such as 2396 <p>Note that a check such as
2355 <code>if (x == null) throw new NullPointerException();</code> 2397 <code>if (x == null) throw new NullPointerException();</code>
2356 is treated as a dereference of <code>x</code>. 2398 is treated as a dereference of <code>x</code>.</p>
2357 2399
2358 2400
2359 <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> 2401 <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>
2360 2402
2361 2403
2362 <p> 2404 <p>
2363 There is a statement or branch on an exception path 2405 There is a statement or branch on an exception path
2364 that if executed guarantees that 2406 that if executed guarantees that
2365 a value is null at this point, and that 2407 a value is null at this point, and that
2366 value that is guaranteed to be dereferenced 2408 value that is guaranteed to be dereferenced
2367 (except on forward paths involving runtime exceptions). 2409 (except on forward paths involving runtime exceptions).
2368 </p> 2410 </p>
2369 2411
2370 2412
2371 <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> 2413 <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>
2372 2414
2373 2415
2374 <p> The field is marked as nonnull, but isn't written to by the construct or. 2416 <p> The field is marked as non-null, but isn't written to by the construc tor.
2375 The field might be initialized elsewhere during constructor, or might always 2417 The field might be initialized elsewhere during constructor, or might always
2376 be initialized before use. 2418 be initialized before use.
2377 </p> 2419 </p>
2378 2420
2379 2421
2380 <h3><a name="NP_NONNULL_PARAM_VIOLATION">NP: Method call passes null to a nonnul l parameter (NP_NONNULL_PARAM_VIOLATION)</a></h3> 2422 <h3><a name="NP_NONNULL_PARAM_VIOLATION">NP: Method call passes null to a non-nu ll parameter (NP_NONNULL_PARAM_VIOLATION)</a></h3>
2381 2423
2382 2424
2383 <p> 2425 <p>
2384 This method passes a null value as the parameter of a method which 2426 This method passes a null value as the parameter of a method which
2385 must be nonnull. Either this parameter has been explicitly marked 2427 must be non-null. Either this parameter has been explicitly marked
2386 as @Nonnull, or analysis has determined that this parameter is 2428 as @Nonnull, or analysis has determined that this parameter is
2387 always dereferenced. 2429 always dereferenced.
2388 </p> 2430 </p>
2389 2431
2390 2432
2391 <h3><a name="NP_NONNULL_RETURN_VIOLATION">NP: Method may return null, but is dec lared @NonNull (NP_NONNULL_RETURN_VIOLATION)</a></h3> 2433 <h3><a name="NP_NONNULL_RETURN_VIOLATION">NP: Method may return null, but is dec lared @Nonnull (NP_NONNULL_RETURN_VIOLATION)</a></h3>
2392 2434
2393 2435
2394 <p> 2436 <p>
2395 This method may return a null value, but the method (or a superclass metho d 2437 This method may return a null value, but the method (or a superclass metho d
2396 which it overrides) is declared to return @NonNull. 2438 which it overrides) is declared to return @Nonnull.
2397 </p> 2439 </p>
2398 2440
2399 2441
2400 <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> 2442 <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>
2401 2443
2402 2444
2403 <p> 2445 <p>
2404 This instanceof test will always return false, since the value being checked is guaranteed to be null. 2446 This instanceof test will always return false, since the value being checked is guaranteed to be null.
2405 Although this is safe, make sure it isn't 2447 Although this is safe, make sure it isn't
2406 an indication of some misunderstanding or some other logic error. 2448 an indication of some misunderstanding or some other logic error.
(...skipping 17 matching lines...) Expand all
2424 <p> A reference value which is null on some exception control path is 2466 <p> A reference value which is null on some exception control path is
2425 dereferenced here.&nbsp; This may lead to a <code>NullPointerException</code> 2467 dereferenced here.&nbsp; This may lead to a <code>NullPointerException</code>
2426 when the code is executed.&nbsp; 2468 when the code is executed.&nbsp;
2427 Note that because FindBugs currently does not prune infeasible exception paths, 2469 Note that because FindBugs currently does not prune infeasible exception paths,
2428 this may be a false warning.</p> 2470 this may be a false warning.</p>
2429 2471
2430 <p> Also note that FindBugs considers the default case of a switch statement to 2472 <p> Also note that FindBugs considers the default case of a switch statement to
2431 be an exception path, since the default case is often infeasible.</p> 2473 be an exception path, since the default case is often infeasible.</p>
2432 2474
2433 2475
2434 <h3><a name="NP_NULL_PARAM_DEREF">NP: Method call passes null for nonnull parame ter (NP_NULL_PARAM_DEREF)</a></h3> 2476 <h3><a name="NP_NULL_PARAM_DEREF">NP: Method call passes null for non-null param eter (NP_NULL_PARAM_DEREF)</a></h3>
2435 2477
2436 2478
2437 <p> 2479 <p>
2438 This method call passes a null value for a nonnull method parameter. 2480 This method call passes a null value for a non-null method parameter.
2439 Either the parameter is annotated as a parameter that should 2481 Either the parameter is annotated as a parameter that should
2440 always be nonnull, or analysis has shown that it will always be 2482 always be non-null, or analysis has shown that it will always be
2441 dereferenced. 2483 dereferenced.
2442 </p> 2484 </p>
2443 2485
2444 2486
2445 <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> 2487 <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>
2446 2488
2447 2489
2448 <p> 2490 <p>
2449 A possibly-null value is passed at a call site where all known 2491 A possibly-null value is passed at a call site where all known
2450 target methods require the parameter to be nonnull. 2492 target methods require the parameter to be non-null.
2451 Either the parameter is annotated as a parameter that should 2493 Either the parameter is annotated as a parameter that should
2452 always be nonnull, or analysis has shown that it will always be 2494 always be non-null, or analysis has shown that it will always be
2453 dereferenced. 2495 dereferenced.
2454 </p> 2496 </p>
2455 2497
2456 2498
2457 <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> 2499 <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>
2458 2500
2459 2501
2460 <p> 2502 <p>
2461 A possibly-null value is passed to a nonnull method parameter. 2503 A possibly-null value is passed to a non-null method parameter.
2462 Either the parameter is annotated as a parameter that should 2504 Either the parameter is annotated as a parameter that should
2463 always be nonnull, or analysis has shown that it will always be 2505 always be non-null, or analysis has shown that it will always be
2464 dereferenced. 2506 dereferenced.
2465 </p> 2507 </p>
2466 2508
2467 2509
2468 <h3><a name="NP_OPTIONAL_RETURN_NULL">NP: Method with Optional return type retur ns explicit null (NP_OPTIONAL_RETURN_NULL)</a></h3> 2510 <h3><a name="NP_OPTIONAL_RETURN_NULL">NP: Method with Optional return type retur ns explicit null (NP_OPTIONAL_RETURN_NULL)</a></h3>
2469 2511
2470 2512
2471 <p> 2513 <p>
2472 The usage of Optional return type always mean that explicit null returns wer e not desired by design. 2514 The usage of Optional return type (java.util.Optional or com.google.common.b ase.Optiona)
2515 always mean that explicit null returns were not desired by design.
2473 Returning a null value in such case is a contract violation and will most li kely break clients code. 2516 Returning a null value in such case is a contract violation and will most li kely break clients code.
2474 </p> 2517 </p>
2475 2518
2476 2519
2477 <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> 2520 <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>
2478 2521
2479 2522
2480 <p> A value that could be null is stored into a field that has been annotated as NonNull. </p> 2523 <p> A value that could be null is stored into a field that has been annotated as @Nonnull. </p>
2481 2524
2482 2525
2483 <h3><a name="NP_UNWRITTEN_FIELD">NP: Read of unwritten field (NP_UNWRITTEN_FIELD )</a></h3> 2526 <h3><a name="NP_UNWRITTEN_FIELD">NP: Read of unwritten field (NP_UNWRITTEN_FIELD )</a></h3>
2484 2527
2485 2528
2486 <p> The program is dereferencing a field that does not seem to ever have a non -null value written to it. 2529 <p> The program is dereferencing a field that does not seem to ever have a non -null value written to it.
2487 Unless the field is initialized via some mechanism not seen by the analysis, 2530 Unless the field is initialized via some mechanism not seen by the analysis,
2488 dereferencing this value will generate a null pointer exception. 2531 dereferencing this value will generate a null pointer exception.
2489 </p> 2532 </p>
2490 2533
(...skipping 20 matching lines...) Expand all
2511 <p> This class defines a method called <code>tostring()</code>.&nbsp; This met hod 2554 <p> This class defines a method called <code>tostring()</code>.&nbsp; This met hod
2512 does not override the <code>toString()</code> method in <code>java.lang.Object </code>, 2555 does not override the <code>toString()</code> method in <code>java.lang.Object </code>,
2513 which is probably what was intended.</p> 2556 which is probably what was intended.</p>
2514 2557
2515 2558
2516 <h3><a name="NM_METHOD_CONSTRUCTOR_CONFUSION">Nm: Apparent method/constructor co nfusion (NM_METHOD_CONSTRUCTOR_CONFUSION)</a></h3> 2559 <h3><a name="NM_METHOD_CONSTRUCTOR_CONFUSION">Nm: Apparent method/constructor co nfusion (NM_METHOD_CONSTRUCTOR_CONFUSION)</a></h3>
2517 2560
2518 2561
2519 <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. 2562 <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.
2520 If it was intended to be a constructor, remove the declaration of a void r eturn value. 2563 If it was intended to be a constructor, remove the declaration of a void r eturn value.
2521 If you had accidently defined this method, realized the mistake, defined a p roper constructor 2564 If you had accidentally defined this method, realized the mistake, defined a proper constructor
2522 but can't get rid of this method due to backwards compatibility, deprecate t he method. 2565 but can't get rid of this method due to backwards compatibility, deprecate t he method.
2523 </p> 2566 </p>
2524 2567
2525 2568
2526 <h3><a name="NM_VERY_CONFUSING">Nm: Very confusing method names (NM_VERY_CONFUSI NG)</a></h3> 2569 <h3><a name="NM_VERY_CONFUSING">Nm: Very confusing method names (NM_VERY_CONFUSI NG)</a></h3>
2527 2570
2528 2571
2529 <p> The referenced methods have names that differ only by capitalization. 2572 <p> The referenced methods have names that differ only by capitalization.
2530 This is very confusing because if the capitalization were 2573 This is very confusing because if the capitalization were
2531 identical then one of the methods would override the other. 2574 identical then one of the methods would override the other.
(...skipping 30 matching lines...) Expand all
2562 <h3><a name="QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT">QBA: Method assigns boolean li teral in boolean expression (QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT)</a></h3> 2605 <h3><a name="QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT">QBA: Method assigns boolean li teral in boolean expression (QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT)</a></h3>
2563 2606
2564 2607
2565 <p> 2608 <p>
2566 This method assigns a literal boolean value (true or false) to a boolean v ariable inside 2609 This method assigns a literal boolean value (true or false) to a boolean v ariable inside
2567 an if or while expression. Most probably this was supposed to be a boolean comparison using 2610 an if or while expression. Most probably this was supposed to be a boolean comparison using
2568 ==, not an assignment using =. 2611 ==, not an assignment using =.
2569 </p> 2612 </p>
2570 2613
2571 2614
2615 <h3><a name="RANGE_ARRAY_INDEX">RANGE: Array index is out of bounds (RANGE_ARRAY _INDEX)</a></h3>
2616
2617
2618 <p> Array operation is performed, but array index is out of bounds, which wil l result in ArrayIndexOutOfBoundsException at runtime.</p>
2619
2620
2621 <h3><a name="RANGE_ARRAY_LENGTH">RANGE: Array length is out of bounds (RANGE_ARR AY_LENGTH)</a></h3>
2622
2623
2624 <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>
2625
2626
2627 <h3><a name="RANGE_ARRAY_OFFSET">RANGE: Array offset is out of bounds (RANGE_ARR AY_OFFSET)</a></h3>
2628
2629
2630 <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>
2631
2632
2633 <h3><a name="RANGE_STRING_INDEX">RANGE: String index is out of bounds (RANGE_STR ING_INDEX)</a></h3>
2634
2635
2636 <p> String method is called and specified string index is out of bounds. This will result in StringIndexOutOfBoundsException at runtime. </p>
2637
2638
2572 <h3><a name="RC_REF_COMPARISON">RC: Suspicious reference comparison (RC_REF_COMP ARISON)</a></h3> 2639 <h3><a name="RC_REF_COMPARISON">RC: Suspicious reference comparison (RC_REF_COMP ARISON)</a></h3>
2573 2640
2574 2641
2575 <p> This method compares two reference values using the == or != operator, 2642 <p> This method compares two reference values using the == or != operator,
2576 where the correct way to compare instances of this type is generally 2643 where the correct way to compare instances of this type is generally
2577 with the equals() method. 2644 with the equals() method.
2578 It is possible to create distinct instances that are equal but do not compare as == since 2645 It is possible to create distinct instances that are equal but do not compare as == since
2579 they are different objects. 2646 they are different objects.
2580 Examples of classes which should generally 2647 Examples of classes which should generally
2581 not be compared by reference are java.lang.Integer, java.lang.Float, etc.</p> 2648 not be compared by reference are java.lang.Integer, java.lang.Float, etc.</p>
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
3324 3391
3325 <h3><a name="MS_MUTABLE_ARRAY">MS: Field is a mutable array (MS_MUTABLE_ARRAY)</ a></h3> 3392 <h3><a name="MS_MUTABLE_ARRAY">MS: Field is a mutable array (MS_MUTABLE_ARRAY)</ a></h3>
3326 3393
3327 3394
3328 <p> A final static field references an array 3395 <p> A final static field references an array
3329 and can be accessed by malicious code or 3396 and can be accessed by malicious code or
3330 by accident from another package. 3397 by accident from another package.
3331 This code can freely modify the contents of the array.</p> 3398 This code can freely modify the contents of the array.</p>
3332 3399
3333 3400
3401 <h3><a name="MS_MUTABLE_COLLECTION">MS: Field is a mutable collection (MS_MUTABL E_COLLECTION)</a></h3>
3402
3403
3404 <p>A mutable collection instance is assigned to a final static field,
3405 thus can be changed by malicious code or by accident from another package.
3406 Consider wrapping this field into Collections.unmodifiableSet/List/Map/etc.
3407 to avoid this vulnerability.</p>
3408
3409
3410 <h3><a name="MS_MUTABLE_COLLECTION_PKGPROTECT">MS: Field is a mutable collection which should be package protected (MS_MUTABLE_COLLECTION_PKGPROTECT)</a></h3>
3411
3412
3413 <p>A mutable collection instance is assigned to a final static field,
3414 thus can be changed by malicious code or by accident from another package.
3415 The field could be made package protected to avoid this vulnerability.
3416 Alternatively you may wrap this field into Collections.unmodifiableSet/List/M ap/etc.
3417 to avoid this vulnerability.</p>
3418
3419
3334 <h3><a name="MS_MUTABLE_HASHTABLE">MS: Field is a mutable Hashtable (MS_MUTABLE_ HASHTABLE)</a></h3> 3420 <h3><a name="MS_MUTABLE_HASHTABLE">MS: Field is a mutable Hashtable (MS_MUTABLE_ HASHTABLE)</a></h3>
3335 3421
3336 3422
3337 <p>A final static field references a Hashtable 3423 <p>A final static field references a Hashtable
3338 and can be accessed by malicious code or 3424 and can be accessed by malicious code or
3339 by accident from another package. 3425 by accident from another package.
3340 This code can freely modify the contents of the Hashtable.</p> 3426 This code can freely modify the contents of the Hashtable.</p>
3341 3427
3342 3428
3343 <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> 3429 <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
3400 <h3><a name="DC_DOUBLECHECK">DC: Possible double check of field (DC_DOUBLECHECK) </a></h3> 3486 <h3><a name="DC_DOUBLECHECK">DC: Possible double check of field (DC_DOUBLECHECK) </a></h3>
3401 3487
3402 3488
3403 <p> This method may contain an instance of double-checked locking.&nbsp; 3489 <p> This method may contain an instance of double-checked locking.&nbsp;
3404 This idiom is not correct according to the semantics of the Java memory 3490 This idiom is not correct according to the semantics of the Java memory
3405 model.&nbsp; For more information, see the web page 3491 model.&nbsp; For more information, see the web page
3406 <a href="http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.htm l" 3492 <a href="http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.htm l"
3407 >http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html</a>.</ p> 3493 >http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html</a>.</ p>
3408 3494
3409 3495
3496 <h3><a name="DC_PARTIALLY_CONSTRUCTED">DC: Possible exposure of partially initia lized object (DC_PARTIALLY_CONSTRUCTED)</a></h3>
3497
3498
3499 <p>Looks like this method uses lazy field initialization with double-checked l ocking.
3500 While the field is correctly declared as volatile, it's possible that the inte rnal structure of
3501 the object is changed after the field assignment, thus another thread may see the partially initialized object.</p>
3502 <p>To fix this problem consider storing the object into the local variable fir st
3503 and save it to the volatile field only after it's fully constructed.
3504 </p>
3505
3506
3410 <h3><a name="DL_SYNCHRONIZATION_ON_BOOLEAN">DL: Synchronization on Boolean (DL_S YNCHRONIZATION_ON_BOOLEAN)</a></h3> 3507 <h3><a name="DL_SYNCHRONIZATION_ON_BOOLEAN">DL: Synchronization on Boolean (DL_S YNCHRONIZATION_ON_BOOLEAN)</a></h3>
3411 3508
3412 3509
3413 <p> The code synchronizes on a boxed primitive constant, such as an Boolean.</ p> 3510 <p> The code synchronizes on a boxed primitive constant, such as an Boolean.</ p>
3414 <pre> 3511 <pre>
3415 private static Boolean inited = Boolean.FALSE; 3512 private static Boolean inited = Boolean.FALSE;
3416 ... 3513 ...
3417 synchronized(inited) { 3514 synchronized(inited) {
3418 if (!inited) { 3515 if (!inited) {
3419 init(); 3516 init();
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
3978 </p> 4075 </p>
3979 4076
3980 4077
3981 <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> 4078 <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>
3982 4079
3983 4080
3984 <p>A primitive boxed value constructed and then immediately converted into a d ifferent primitive type 4081 <p>A primitive boxed value constructed and then immediately converted into a d ifferent primitive type
3985 (e.g., <code>new Double(d).intValue()</code>). Just perform direct primitive coe rcion (e.g., <code>(int) d</code>).</p> 4082 (e.g., <code>new Double(d).intValue()</code>). Just perform direct primitive coe rcion (e.g., <code>(int) d</code>).</p>
3986 4083
3987 4084
4085 <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>
4086
4087
4088 <p>A wrapped primitive value is unboxed and converted to another primitive typ e as part of the
4089 evaluation of a conditional ternary operator (the <code> b ? e1 : e2</code> oper ator). The
4090 semantics of Java mandate that if <code>e1</code> and <code>e2</code> are wrappe d
4091 numeric values, the values are unboxed and converted/coerced to their common typ e (e.g,
4092 if <code>e1</code> is of type <code>Integer</code>
4093 and <code>e2</code> is of type <code>Float</code>, then <code>e1</code> is unbox ed,
4094 converted to a floating point value, and boxed. See JLS Section 15.25.
4095 </p>
4096
4097
3988 <h3><a name="BX_UNBOXING_IMMEDIATELY_REBOXED">Bx: Boxed value is unboxed and the n immediately reboxed (BX_UNBOXING_IMMEDIATELY_REBOXED)</a></h3> 4098 <h3><a name="BX_UNBOXING_IMMEDIATELY_REBOXED">Bx: Boxed value is unboxed and the n immediately reboxed (BX_UNBOXING_IMMEDIATELY_REBOXED)</a></h3>
3989 4099
3990 4100
3991 <p>A boxed value is unboxed and then immediately reboxed. 4101 <p>A boxed value is unboxed and then immediately reboxed.
3992 </p> 4102 </p>
3993 4103
3994 4104
4105 <h3><a name="DM_BOXED_PRIMITIVE_FOR_COMPARE">Bx: Boxing a primitive to compare ( DM_BOXED_PRIMITIVE_FOR_COMPARE)</a></h3>
4106
4107
4108 <p>A boxed primitive is created just to call compareTo method. It's more effic ient to use static compare method
4109 (for double and float since Java 1.4, for other primitive types since Java 1.7 ) which works on primitives directly.
4110 </p>
4111
4112
3995 <h3><a name="DM_BOXED_PRIMITIVE_FOR_PARSING">Bx: Boxing/unboxing to parse a prim itive (DM_BOXED_PRIMITIVE_FOR_PARSING)</a></h3> 4113 <h3><a name="DM_BOXED_PRIMITIVE_FOR_PARSING">Bx: Boxing/unboxing to parse a prim itive (DM_BOXED_PRIMITIVE_FOR_PARSING)</a></h3>
3996 4114
3997 4115
3998 <p>A boxed primitive is created from a String, just to extract the unboxed pri mitive value. 4116 <p>A boxed primitive is created from a String, just to extract the unboxed pri mitive value.
3999 It is more efficient to just call the static parseXXX method.</p> 4117 It is more efficient to just call the static parseXXX method.</p>
4000 4118
4001 4119
4002 <h3><a name="DM_BOXED_PRIMITIVE_TOSTRING">Bx: Method allocates a boxed primitive just to call toString (DM_BOXED_PRIMITIVE_TOSTRING)</a></h3> 4120 <h3><a name="DM_BOXED_PRIMITIVE_TOSTRING">Bx: Method allocates a boxed primitive just to call toString (DM_BOXED_PRIMITIVE_TOSTRING)</a></h3>
4003 4121
4004 4122
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
4142 <p> 4260 <p>
4143 A large String constant is duplicated across multiple class files. 4261 A large String constant is duplicated across multiple class files.
4144 This is likely because a final field is initialized to a String constant, an d the Java language 4262 This is likely because a final field is initialized to a String constant, an d the Java language
4145 mandates that all references to a final field from other classes be inlined into 4263 mandates that all references to a final field from other classes be inlined into
4146 that classfile. See <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id= 6447475">JDK bug 6447475</a> 4264 that classfile. See <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id= 6447475">JDK bug 6447475</a>
4147 for a description of an occurrence of this bug in the JDK and how resolving it reduced 4265 for a description of an occurrence of this bug in the JDK and how resolving it reduced
4148 the size of the JDK by 1 megabyte. 4266 the size of the JDK by 1 megabyte.
4149 </p> 4267 </p>
4150 4268
4151 4269
4152 <h3><a name="IIO_INEFFICIENT_INDEX_OF">IIO: Inefficient use of String.indexOf(St ring) (IIO_INEFFICIENT_INDEX_OF)</a></h3>
4153
4154
4155 <p> This code passes a constant string of length 1 to String.indexOf().
4156 It is more efficient to use the integer implementations of String.indexOf().
4157 f. e. call <code>myString.indexOf('.')</code> instead of <code>myString.indexOf( ".")</code></p>
4158
4159
4160 <h3><a name="IIO_INEFFICIENT_LAST_INDEX_OF">IIO: Inefficient use of String.lastI ndexOf(String) (IIO_INEFFICIENT_LAST_INDEX_OF)</a></h3>
4161
4162
4163 <p> This code passes a constant string of length 1 to String.lastIndexOf().
4164 It is more efficient to use the integer implementations of String.lastIndexOf().
4165 f. e. call <code>myString.lastIndexOf('.')</code> instead of <code>myString.last IndexOf(".")</code></p>
4166
4167
4168 <h3><a name="ITA_INEFFICIENT_TO_ARRAY">ITA: Method uses toArray() with zero-leng th array argument (ITA_INEFFICIENT_TO_ARRAY)</a></h3>
4169
4170
4171 <p> This method uses the toArray() method of a collection derived class, and pas ses
4172 in a zero-length prototype array argument. It is more efficient to use
4173 <code>myCollection.toArray(new Foo[myCollection.size()])</code>
4174 If the array passed in is big enough to store all of the
4175 elements of the collection, then it is populated and returned
4176 directly. This avoids the need to create a second array
4177 (by reflection) to return as the result.</p>
4178
4179
4180 <h3><a name="SBSC_USE_STRINGBUFFER_CONCATENATION">SBSC: Method concatenates stri ngs using + in a loop (SBSC_USE_STRINGBUFFER_CONCATENATION)</a></h3> 4270 <h3><a name="SBSC_USE_STRINGBUFFER_CONCATENATION">SBSC: Method concatenates stri ngs using + in a loop (SBSC_USE_STRINGBUFFER_CONCATENATION)</a></h3>
4181 4271
4182 4272
4183 <p> The method seems to be building a String using concatenation in a loop. 4273 <p> The method seems to be building a String using concatenation in a loop.
4184 In each iteration, the String is converted to a StringBuffer/StringBuilder, 4274 In each iteration, the String is converted to a StringBuffer/StringBuilder,
4185 appended to, and converted back to a String. 4275 appended to, and converted back to a String.
4186 This can lead to a cost quadratic in the number of iterations, 4276 This can lead to a cost quadratic in the number of iterations,
4187 as the growing string is recopied in each iteration. </p> 4277 as the growing string is recopied in each iteration. </p>
4188 4278
4189 <p>Better performance can be obtained by using 4279 <p>Better performance can be obtained by using
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
4434 See <a href="http://cwe.mitre.org/data/definitions/23.html">http://cwe.mitre.org /data/definitions/23.html</a> 4524 See <a href="http://cwe.mitre.org/data/definitions/23.html">http://cwe.mitre.org /data/definitions/23.html</a>
4435 for more information.</p> 4525 for more information.</p>
4436 <p>FindBugs looks only for the most blatant, obvious cases of relative path trav ersal. 4526 <p>FindBugs looks only for the most blatant, obvious cases of relative path trav ersal.
4437 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more 4527 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more
4438 vulnerabilities that FindBugs doesn't report. If you are concerned about relativ e path traversal, you should seriously 4528 vulnerabilities that FindBugs doesn't report. If you are concerned about relativ e path traversal, you should seriously
4439 consider using a commercial static analysis or pen-testing tool. 4529 consider using a commercial static analysis or pen-testing tool.
4440 </p> 4530 </p>
4441 4531
4442 4532
4443 4533
4444 <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> 4534 <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>
4445 4535
4446 4536
4447 <p>The method invokes the execute method on an SQL statement with a String tha t seems 4537 <p>The method invokes the execute or addBatch method on an SQL statement with a String that seems
4448 to be dynamically generated. Consider using 4538 to be dynamically generated. Consider using
4449 a prepared statement instead. It is more efficient and less vulnerable to 4539 a prepared statement instead. It is more efficient and less vulnerable to
4450 SQL injection attacks. 4540 SQL injection attacks.
4451 </p> 4541 </p>
4452 4542
4453 4543
4454 <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> 4544 <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>
4455 4545
4456 4546
4457 <p>The code creates an SQL prepared statement from a nonconstant String. 4547 <p>The code creates an SQL prepared statement from a nonconstant String.
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
4717 <code>if ( Math.abs(x - y) &lt; .0000001 )</code>. 4807 <code>if ( Math.abs(x - y) &lt; .0000001 )</code>.
4718 See the Java Language Specification, section 4.2.4. 4808 See the Java Language Specification, section 4.2.4.
4719 </p> 4809 </p>
4720 4810
4721 4811
4722 <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> 4812 <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>
4723 4813
4724 4814
4725 <p> 4815 <p>
4726 An argument not of type Boolean is being formatted with a %b format specifier. T his won't throw an 4816 An argument not of type Boolean is being formatted with a %b format specifier. T his won't throw an
4727 exception; instead, it will print true for any nonnull value, and false for null . 4817 exception; instead, it will print true for any non-null value, and false for nul l.
4728 This feature of format strings is strange, and may not be what you intended. 4818 This feature of format strings is strange, and may not be what you intended.
4729 </p> 4819 </p>
4730 4820
4731 4821
4732 <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> 4822 <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>
4733 4823
4734 4824
4735 <p> 4825 <p>
4736 An inner class is invoking a method that could be resolved to either a inherited method or a method defined in an outer class. 4826 An inner class is invoking a method that could be resolved to either a inherited method or a method defined in an outer class.
4737 For example, you invoke <code>foo(17)</code>, which is defined in both a supercl ass and in an outer method. 4827 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
4899 to read, readLine() will return null and dereferencing that will generate a null pointer exception. 4989 to read, readLine() will return null and dereferencing that will generate a null pointer exception.
4900 </p> 4990 </p>
4901 4991
4902 4992
4903 <h3><a name="NP_LOAD_OF_KNOWN_NULL_VALUE">NP: Load of known null value (NP_LOAD_ OF_KNOWN_NULL_VALUE)</a></h3> 4993 <h3><a name="NP_LOAD_OF_KNOWN_NULL_VALUE">NP: Load of known null value (NP_LOAD_ OF_KNOWN_NULL_VALUE)</a></h3>
4904 4994
4905 4995
4906 <p> The variable referenced at this point is known to be null due to an earlie r 4996 <p> The variable referenced at this point is known to be null due to an earlie r
4907 check against null. Although this is valid, it might be a mistake (perhaps yo u 4997 check against null. Although this is valid, it might be a mistake (perhaps yo u
4908 intended to refer to a different variable, or perhaps the earlier check to see i f the 4998 intended to refer to a different variable, or perhaps the earlier check to see i f the
4909 variable is null should have been a check to see if it was nonnull). 4999 variable is null should have been a check to see if it was non-null).
4910 </p> 5000 </p>
4911 5001
4912 5002
4913 <h3><a name="NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION">NP: Method tightens nullne ss annotation on parameter (NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION)</a></h3> 5003 <h3><a name="NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION">NP: Method tightens nullne ss annotation on parameter (NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION)</a></h3>
4914 5004
4915 <p> 5005 <p>
4916 A method should always implement the contract of a method it overrides. Thus, if a method takes a parameter 5006 A method should always implement the contract of a method it overrides. Thus, if a method takes a parameter
4917 that is marked as @Nullable, you shouldn't override that method in a subclas s with a method where that parameter is @Nonnull. 5007 that is marked as @Nullable, you shouldn't override that method in a subclas s with a method where that parameter is @Nonnull.
4918 Doing so violates the contract that the method should handle a null paramete r. 5008 Doing so violates the contract that the method should handle a null paramete r.
4919 </p> 5009 </p>
(...skipping 22 matching lines...) Expand all
4942 <p> There is a branch of statement that, <em>if executed,</em> guarantees that 5032 <p> There is a branch of statement that, <em>if executed,</em> guarantees that
4943 a null value will be dereferenced, which 5033 a null value will be dereferenced, which
4944 would generate a <code>NullPointerException</code> when the code is executed. 5034 would generate a <code>NullPointerException</code> when the code is executed.
4945 Of course, the problem might be that the branch or statement is infeasible and t hat 5035 Of course, the problem might be that the branch or statement is infeasible and t hat
4946 the null pointer exception can't ever be executed; deciding that is beyond the a bility of FindBugs. 5036 the null pointer exception can't ever be executed; deciding that is beyond the a bility of FindBugs.
4947 Due to the fact that this value had been previously tested for nullness, 5037 Due to the fact that this value had been previously tested for nullness,
4948 this is a definite possibility. 5038 this is a definite possibility.
4949 </p> 5039 </p>
4950 5040
4951 5041
4952 <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> 5042 <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>
4953 5043
4954 5044
4955 <p> This parameter is always used in a way that requires it to be nonnull, 5045 <p> This parameter is always used in a way that requires it to be non-null,
4956 but the parameter is explicitly annotated as being Nullable. Either the use 5046 but the parameter is explicitly annotated as being Nullable. Either the use
4957 of the parameter or the annotation is wrong. 5047 of the parameter or the annotation is wrong.
4958 </p> 5048 </p>
4959 5049
4960 5050
4961 <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> 5051 <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>
4962 5052
4963 5053
4964 <p> The program is dereferencing a public or protected 5054 <p> The program is dereferencing a public or protected
4965 field that does not seem to ever have a non-null value written to it. 5055 field that does not seem to ever have a non-null value written to it.
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
5097 5187
5098 <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> 5188 <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>
5099 5189
5100 5190
5101 <p> The method invokes String.indexOf and checks to see if the result is posi tive or non-positive. 5191 <p> The method invokes String.indexOf and checks to see if the result is posi tive or non-positive.
5102 It is much more typical to check to see if the result is negative or non-nega tive. It is 5192 It is much more typical to check to see if the result is negative or non-nega tive. It is
5103 positive only if the substring checked for occurs at some place other than at the beginning of 5193 positive only if the substring checked for occurs at some place other than at the beginning of
5104 the String.</p> 5194 the String.</p>
5105 5195
5106 5196
5107 <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 > 5197 <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>
5108 5198
5109 5199
5110 <p> The value returned by readLine is discarded after checking to see if the return 5200 <p> The value returned by readLine is discarded after checking to see if the return
5111 value is non-null. In almost all situations, if the result is non-null, you will want 5201 value is non-null. In almost all situations, if the result is non-null, you will want
5112 to use that non-null value. Calling readLine again will give you a different lin e.</p> 5202 to use that non-null value. Calling readLine again will give you a different lin e.</p>
5113 5203
5114 5204
5115 <h3><a name="RV_REM_OF_HASHCODE">RV: Remainder of hashCode could be negative (RV _REM_OF_HASHCODE)</a></h3> 5205 <h3><a name="RV_REM_OF_HASHCODE">RV: Remainder of hashCode could be negative (RV _REM_OF_HASHCODE)</a></h3>
5116 5206
5117 5207
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
5152 </p> 5242 </p>
5153 <p>We are guessing that ignoring the return value might be a bad idea just from 5243 <p>We are guessing that ignoring the return value might be a bad idea just from
5154 a simple analysis of the body of the method. You can use a @CheckReturnValue ann otation 5244 a simple analysis of the body of the method. You can use a @CheckReturnValue ann otation
5155 to instruct FindBugs as to whether ignoring the return value of this method 5245 to instruct FindBugs as to whether ignoring the return value of this method
5156 is important or acceptable. 5246 is important or acceptable.
5157 </p> 5247 </p>
5158 <p>Please investigate this closely to decide whether it is OK to ignore the retu rn value. 5248 <p>Please investigate this closely to decide whether it is OK to ignore the retu rn value.
5159 </p> 5249 </p>
5160 5250
5161 5251
5252 <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>
5253
5254
5255 <p>This code calls a method and ignores the return value. However our analysis s hows that
5256 the method (including its implementations in subclasses if any) does not produce any effect
5257 other than return value. Thus this call can be removed.
5258 </p>
5259 <p>We are trying to reduce the false positives as much as possible, but in some cases this warning might be wrong.
5260 Common false-positive cases include:</p>
5261 <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>
5262 <p>- The method is called to trigger the class loading which may have a side eff ect.</p>
5263 <p>- The method is called just to get some exception.</p>
5264 <p>If you feel that our assumption is incorrect, you can use a @CheckReturnValue annotation
5265 to instruct FindBugs that ignoring the return value of this method is acceptable .
5266 </p>
5267
5268
5162 <h3><a name="SA_FIELD_DOUBLE_ASSIGNMENT">SA: Double assignment of field (SA_FIEL D_DOUBLE_ASSIGNMENT)</a></h3> 5269 <h3><a name="SA_FIELD_DOUBLE_ASSIGNMENT">SA: Double assignment of field (SA_FIEL D_DOUBLE_ASSIGNMENT)</a></h3>
5163 5270
5164 5271
5165 <p> This method contains a double assignment of a field; e.g. 5272 <p> This method contains a double assignment of a field; e.g.
5166 </p> 5273 </p>
5167 <pre> 5274 <pre>
5168 int x,y; 5275 int x,y;
5169 public void foo() { 5276 public void foo() {
5170 x = x = 17; 5277 x = x = 17;
5171 } 5278 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
5208 <p> This method contains a switch statement where one case branch will fall th rough to the next case. 5315 <p> This method contains a switch statement where one case branch will fall th rough to the next case.
5209 Usually you need to end this case with a break or return.</p> 5316 Usually you need to end this case with a break or return.</p>
5210 5317
5211 5318
5212 <h3><a name="SF_SWITCH_NO_DEFAULT">SF: Switch statement found where default case is missing (SF_SWITCH_NO_DEFAULT)</a></h3> 5319 <h3><a name="SF_SWITCH_NO_DEFAULT">SF: Switch statement found where default case is missing (SF_SWITCH_NO_DEFAULT)</a></h3>
5213 5320
5214 5321
5215 <p> This method contains a switch statement where default case is missing. 5322 <p> This method contains a switch statement where default case is missing.
5216 Usually you need to provide a default case.</p> 5323 Usually you need to provide a default case.</p>
5217 <p>Because the analysis only looks at the generated bytecode, this warning can be incorrect triggered if 5324 <p>Because the analysis only looks at the generated bytecode, this warning can be incorrect triggered if
5218 the default case is at the end of the switch statement and doesn't end with a br eak statement. 5325 the default case is at the end of the switch statement and the switch statement doesn't contain break statements for other
5326 cases.
5219 5327
5220 5328
5221 <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> 5329 <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>
5222 5330
5223 5331
5224 <p> This instance method writes to a static field. This is tricky to get 5332 <p> This instance method writes to a static field. This is tricky to get
5225 correct if multiple instances are being manipulated, 5333 correct if multiple instances are being manipulated,
5226 and generally bad practice. 5334 and generally bad practice.
5227 </p> 5335 </p>
5228 5336
(...skipping 29 matching lines...) Expand all
5258 <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> 5366 <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>
5259 5367
5260 5368
5261 <p> 5369 <p>
5262 A value is used in a way that requires it to be never be a value denoted b y a type qualifier, but 5370 A value is used in a way that requires it to be never be a value denoted b y a type qualifier, but
5263 there is an explicit annotation stating that it is not known where the value is prohibited from having that type qualifier. 5371 there is an explicit annotation stating that it is not known where the value is prohibited from having that type qualifier.
5264 Either the usage or the annotation is incorrect. 5372 Either the usage or the annotation is incorrect.
5265 </p> 5373 </p>
5266 5374
5267 5375
5376 <h3><a name="UC_USELESS_CONDITION">UC: Condition has no effect (UC_USELESS_CONDI TION)</a></h3>
5377
5378
5379 <p>This condition always produces the same result as the value of the involved v ariable was narrowed before.
5380 Probably something else was meant or condition can be removed.</p>
5381
5382
5383 <h3><a name="UC_USELESS_CONDITION_TYPE">UC: Condition has no effect due to the v ariable type (UC_USELESS_CONDITION_TYPE)</a></h3>
5384
5385
5386 <p>This condition always produces the same result due to the type range of the i nvolved variable.
5387 Probably something else was meant or condition can be removed.</p>
5388
5389
5390 <h3><a name="UC_USELESS_OBJECT">UC: Useless object created (UC_USELESS_OBJECT)</ a></h3>
5391
5392
5393 <p>Our analysis shows that this object is useless.
5394 It's created and modified, but its value never go outside of the method or produ ce any side-effect.
5395 Either there is a mistake and object was intended to be used or it can be remove d.</p>
5396 <p>This analysis rarely produces false-positives. Common false-positive cases in clude:</p>
5397 <p>- This object used to implicitly throw some obscure exception.</p>
5398 <p>- This object used as a stub to generalize the code.</p>
5399 <p>- This object used to hold strong references to weak/soft-referenced objects. </p>
5400
5401
5402 <h3><a name="UC_USELESS_OBJECT_STACK">UC: Useless object created on stack (UC_US ELESS_OBJECT_STACK)</a></h3>
5403
5404
5405 <p>This object is created just to perform some modifications which don't have an y side-effect.
5406 Probably something else was meant or the object can be removed.</p>
5407
5408
5409 <h3><a name="UC_USELESS_VOID_METHOD">UC: Useless non-empty void method (UC_USELE SS_VOID_METHOD)</a></h3>
5410
5411
5412 <p>Our analysis shows that this non-empty void method does not actually perform any useful work.
5413 Please check it: probably there's a mistake in its code or its body can be fully removed.
5414 </p>
5415 <p>We are trying to reduce the false positives as much as possible, but in some cases this warning might be wrong.
5416 Common false-positive cases include:</p>
5417 <p>- The method is intended to trigger loading of some class which may have a si de effect.</p>
5418 <p>- The method is intended to implicitly throw some obscure exception.</p>
5419
5420
5268 <h3><a name="UCF_USELESS_CONTROL_FLOW">UCF: Useless control flow (UCF_USELESS_CO NTROL_FLOW)</a></h3> 5421 <h3><a name="UCF_USELESS_CONTROL_FLOW">UCF: Useless control flow (UCF_USELESS_CO NTROL_FLOW)</a></h3>
5269 5422
5270 5423
5271 <p> This method contains a useless control flow statement, where 5424 <p> This method contains a useless control flow statement, where
5272 control flow continues onto the same place regardless of whether or not 5425 control flow continues onto the same place regardless of whether or not
5273 the branch is taken. For example, 5426 the branch is taken. For example,
5274 this is caused by having an empty statement 5427 this is caused by having an empty statement
5275 block for an <code>if</code> statement:</p> 5428 block for an <code>if</code> statement:</p>
5276 <pre> 5429 <pre>
5277 if (argv.length == 0) { 5430 if (argv.length == 0) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
5350 5503
5351 5504
5352 <hr> <p> 5505 <hr> <p>
5353 <script language="JavaScript" type="text/javascript"> 5506 <script language="JavaScript" type="text/javascript">
5354 <!---//hide script from old browsers 5507 <!---//hide script from old browsers
5355 document.write( "Last updated "+ document.lastModified + "." ); 5508 document.write( "Last updated "+ document.lastModified + "." );
5356 //end hiding contents ---> 5509 //end hiding contents --->
5357 </script> 5510 </script>
5358 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbu gs@cs.umd.edu</a> 5511 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbu gs@cs.umd.edu</a>
5359 <p> 5512 <p>
5360 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?gro up_id=96405&amp;type=5" width="210" height="62" border="0" alt="SourceForge.net Logo" /></A> 5513 <a href="http://sourceforge.net/projects/findbugs/"><img src="http://sourceforge .net/sflogo.php?group_id=96405&amp;type=5" width="210" height="62" border="0" al t="FindBugs on SourceForge.net" /></a>
5361 </td></tr></table> 5514 </td></tr></table>
5362 </body></html> 5515 </body></html>
OLDNEW
« no previous file with comments | « doc/allBugDescriptions.html ('k') | doc/bugDescriptions_fr.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698