OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
g/TR/html4/loose.dtd"> | 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
g/TR/html4/loose.dtd"> |
2 <html><head><title>FindBugs Bug Descriptions (Unabridged)</title> | 2 <html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 3 <title>FindBugs Bug Descriptions (Unabridged)</title> |
3 <link rel="stylesheet" type="text/css" href="findbugs.css"/> | 4 <link rel="stylesheet" type="text/css" href="findbugs.css"/> |
4 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/> | 5 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/> |
5 </head><body> | 6 </head><body> |
6 | 7 |
7 <table width="100%"><tr> | 8 <table width="100%"><tr> |
8 | 9 |
9 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%"> | 10 <td bgcolor="#b9b9fe" valign="top" align="left" width="20%"> |
10 <table width="100%" cellspacing="0" border="0"> | 11 <table width="100%" cellspacing="0" border="0"> |
11 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="Fin
dBugs"></a></td></tr> | 12 <tr><td><a class="sidebar" href="index.html"><img src="umdFindbugs.png" alt="Fin
dBugs"></a></td></tr> |
12 | 13 |
13 <tr><td> </td></tr> | 14 <tr><td> </td></tr> |
14 | 15 |
15 <tr><td><b>Docs and Info</b></td></tr> | 16 <tr><td><b>Docs and Info</b></td></tr> |
16 <tr><td><font size="-1"><a class="sidebar" href="findbugs2.html">FindBugs 2.0</a
></font></td></tr> | 17 <tr><td><font size="-1"> <a class="sidebar" href="findbugs2.html">FindBugs
2.0</a></font></td></tr> |
17 <tr><td><font size="-1"><a class="sidebar" href="demo.html">Demo and data</a></f
ont></td></tr> | 18 <tr><td><font size="-1"> <a class="sidebar" href="demo.html">Demo and data<
/a></font></td></tr> |
18 <tr><td><font size="-1"><a class="sidebar" href="users.html">Users and supporter
s</a></font></td></tr> | 19 <tr><td><font size="-1"> <a class="sidebar" href="users.html">Users and sup
porters</a></font></td></tr> |
19 <tr><td><font size="-1"><a class="sidebar" href="http://findbugs.blogspot.com/">
FindBugs blog</a></font></td></tr> | 20 <tr><td><font size="-1"> <a class="sidebar" href="http://findbugs.blogspot.
com/">FindBugs blog</a></font></td></tr> |
20 <tr><td><font size="-1"><a class="sidebar" href="factSheet.html">Fact sheet</a><
/font></td></tr> | 21 <tr><td><font size="-1"> <a class="sidebar" href="factSheet.html">Fact shee
t</a></font></td></tr> |
21 <tr><td><font size="-1"><a class="sidebar" href="manual/index.html">Manual</a></
font></td></tr> | 22 <tr><td><font size="-1"> <a class="sidebar" href="manual/index.html">Manual
</a></font></td></tr> |
22 <tr><td><font size="-1"><a class="sidebar" href="ja/manual/index.html">Manual(ja
/日本語)</a></font></td></tr> | 23 <tr><td><font size="-1"> <a class="sidebar" href="ja/manual/index.html">Man
ual(ja/日本語)</a></font></td></tr> |
23 <tr><td><font size="-1"><a class="sidebar" href="FAQ.html">FAQ</a></font></td></
tr> | 24 <tr><td><font size="-1"> <a class="sidebar" href="FAQ.html">FAQ</a></font><
/td></tr> |
24 <tr><td><font size="-1"><a class="sidebar" href="bugDescriptions.html">Bug descr
iptions</a></font></td></tr> | 25 <tr><td><font size="-1"> <a class="sidebar" href="bugDescriptions.html">Bug
descriptions</a></font></td></tr> |
25 <tr><td><font size="-1"><a class="sidebar" href="mailingLists.html">Mailing list
s</a></font></td></tr> | 26 <tr><td><font size="-1"> <a class="sidebar" href="bugDescriptions_ja.html">
Bug descriptions(ja/日本語)</a></font></td></tr> |
26 <tr><td><font size="-1"><a class="sidebar" href="publications.html">Documents an
d Publications</a></font></td></tr> | 27 <tr><td><font size="-1"> <a class="sidebar" href="bugDescriptions_fr.html">
Bug descriptions(fr)</a></font></td></tr> |
27 <tr><td><font size="-1"><a class="sidebar" href="links.html">Links</a></font></t
d></tr> | 28 <tr><td><font size="-1"> <a class="sidebar" href="mailingLists.html">Mailin
g lists</a></font></td></tr> |
| 29 <tr><td><font size="-1"> <a class="sidebar" href="publications.html">Docume
nts and Publications</a></font></td></tr> |
| 30 <tr><td><font size="-1"> <a class="sidebar" href="links.html">Links</a></fo
nt></td></tr> |
28 | 31 |
29 <tr><td> </td></tr> | 32 <tr><td> </td></tr> |
30 | 33 |
31 <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> |
32 | 35 |
33 <tr><td> </td></tr> | 36 <tr><td> </td></tr> |
34 | 37 |
35 <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> |
36 | 39 |
37 <tr><td> </td></tr> | 40 <tr><td> </td></tr> |
38 | 41 |
39 <tr><td><b>Development</b></td></tr> | 42 <tr><td><b>Development</b></td></tr> |
40 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/tracker/
?group_id=96405">Open bugs</a></font></td></tr> | 43 <tr><td><font size="-1"> <a class="sidebar" href="http://sourceforge.net/p/
findbugs/bugs/">Open bugs</a></font></td></tr> |
41 <tr><td><font size="-1"><a class="sidebar" href="reportingBugs.html">Reporting b
ugs</a></font></td></tr> | 44 <tr><td><font size="-1"> <a class="sidebar" href="reportingBugs.html">Repor
ting bugs</a></font></td></tr> |
42 <tr><td><font size="-1"><a class="sidebar" href="contributing.html">Contributing
</a></font></td></tr> | 45 <tr><td><font size="-1"> <a class="sidebar" href="contributing.html">Contri
buting</a></font></td></tr> |
43 <tr><td><font size="-1"><a class="sidebar" href="team.html">Dev team</a></font><
/td></tr> | 46 <tr><td><font size="-1"> <a class="sidebar" href="team.html">Dev team</a></
font></td></tr> |
44 <tr><td><font size="-1"><a class="sidebar" href="api/index.html">API</a> <a clas
s="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></tr> | 47 <tr><td><font size="-1"> <a class="sidebar" href="api/index.html">API</a> <
a class="sidebar" href="api/overview-summary.html">[no frames]</a></font></td></
tr> |
45 <tr><td><font size="-1"><a class="sidebar" href="Changes.html">Change log</a></f
ont></td></tr> | 48 <tr><td><font size="-1"> <a class="sidebar" href="Changes.html">Change log<
/a></font></td></tr> |
46 <tr><td><font size="-1"><a class="sidebar" href="http://sourceforge.net/projects
/findbugs">SF project page</a></font></td></tr> | 49 <tr><td><font size="-1"> <a class="sidebar" href="http://sourceforge.net/pr
ojects/findbugs">SF project page</a></font></td></tr> |
47 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbu
gs/source/browse/">Browse source</a></font></td></tr> | 50 <tr><td><font size="-1"> <a class="sidebar" href="http://code.google.com/p/
findbugs/source/browse/">Browse source</a></font></td></tr> |
48 <tr><td><font size="-1"><a class="sidebar" href="http://code.google.com/p/findbu
gs/source/list">Latest code changes</a></font></td></tr> | 51 <tr><td><font size="-1"> <a class="sidebar" href="http://code.google.com/p/
findbugs/source/list">Latest code changes</a></font></td></tr> |
49 </table> | 52 </table> |
50 </td> | 53 </td> |
51 <td align="left" valign="top"> | 54 <td align="left" valign="top"> |
52 <h1>FindBugs Bug Descriptions (Unabridged)</h1> | 55 <h1>FindBugs Bug Descriptions (Unabridged)</h1> |
53 <p>This document lists all of the bug patterns reported by the | 56 <p>This document lists all of the bug patterns reported by the |
54 latest development version of | 57 latest development version of |
55 <a href="http://findbugs.sourceforge.net">FindBugs</a>. Note that this may
include | 58 <a href="http://findbugs.sourceforge.net">FindBugs</a>. Note that this may
include |
56 bug patterns not available in any released version of FindBugs, | 59 bug patterns not available in any released version of FindBugs, |
57 as well as bug patterns that are not enabled by default. | 60 as well as bug patterns that are not enabled by default. |
58 <h2>Summary</h2> | 61 <h2>Summary</h2> |
59 <table width="100%"> | 62 <table width="100%"> |
60 <tr bgcolor="#b9b9fe"><th>Description</th><th>Category</th></tr> | 63 <tr bgcolor="#b9b9fe"><th>Description</th><th>Category</th></tr> |
61 <tr bgcolor="#eeeeee"><td><a href="#AM_CREATES_EMPTY_JAR_FILE_ENTRY">AM: Creates
an empty jar file entry</a></td><td>Bad practice</td></tr> | 64 <tr bgcolor="#eeeeee"><td><a href="#AM_CREATES_EMPTY_JAR_FILE_ENTRY">AM: Creates
an empty jar file entry</a></td><td>Bad practice</td></tr> |
62 <tr bgcolor="#ffffff"><td><a href="#AM_CREATES_EMPTY_ZIP_FILE_ENTRY">AM: Creates
an empty zip file entry</a></td><td>Bad practice</td></tr> | 65 <tr bgcolor="#ffffff"><td><a href="#AM_CREATES_EMPTY_ZIP_FILE_ENTRY">AM: Creates
an empty zip file entry</a></td><td>Bad practice</td></tr> |
63 <tr bgcolor="#eeeeee"><td><a href="#BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS
">BC: Equals method should not assume anything about the type of its argument</a
></td><td>Bad practice</td></tr> | 66 <tr bgcolor="#eeeeee"><td><a href="#BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS
">BC: Equals method should not assume anything about the type of its argument</a
></td><td>Bad practice</td></tr> |
64 <tr bgcolor="#ffffff"><td><a href="#BIT_SIGNED_CHECK">BIT: Check for sign of bit
wise operation</a></td><td>Bad practice</td></tr> | 67 <tr bgcolor="#ffffff"><td><a href="#BIT_SIGNED_CHECK">BIT: Check for sign of bit
wise operation</a></td><td>Bad practice</td></tr> |
65 <tr bgcolor="#eeeeee"><td><a href="#CN_IDIOM">CN: Class implements Cloneable but
does not define or use clone method</a></td><td>Bad practice</td></tr> | 68 <tr bgcolor="#eeeeee"><td><a href="#CN_IDIOM">CN: Class implements Cloneable but
does not define or use clone method</a></td><td>Bad practice</td></tr> |
66 <tr bgcolor="#ffffff"><td><a href="#CN_IDIOM_NO_SUPER_CALL">CN: clone method doe
s not call super.clone()</a></td><td>Bad practice</td></tr> | 69 <tr bgcolor="#ffffff"><td><a href="#CN_IDIOM_NO_SUPER_CALL">CN: clone method doe
s not call super.clone()</a></td><td>Bad practice</td></tr> |
67 <tr bgcolor="#eeeeee"><td><a href="#CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE">CN: C
lass defines clone() but doesn't implement Cloneable</a></td><td>Bad practice</t
d></tr> | 70 <tr bgcolor="#eeeeee"><td><a href="#CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE">CN: C
lass defines clone() but doesn't implement Cloneable</a></td><td>Bad practice</t
d></tr> |
68 <tr bgcolor="#ffffff"><td><a href="#CO_ABSTRACT_SELF">Co: Abstract class defines
covariant compareTo() method</a></td><td>Bad practice</td></tr> | 71 <tr bgcolor="#ffffff"><td><a href="#CNT_ROUGH_CONSTANT_VALUE">CNT: Rough value o
f known constant found</a></td><td>Bad practice</td></tr> |
69 <tr bgcolor="#eeeeee"><td><a href="#CO_SELF_NO_OBJECT">Co: Covariant compareTo()
method defined</a></td><td>Bad practice</td></tr> | 72 <tr bgcolor="#eeeeee"><td><a href="#CO_ABSTRACT_SELF">Co: Abstract class defines
covariant compareTo() method</a></td><td>Bad practice</td></tr> |
70 <tr bgcolor="#ffffff"><td><a href="#DE_MIGHT_DROP">DE: Method might drop excepti
on</a></td><td>Bad practice</td></tr> | 73 <tr bgcolor="#ffffff"><td><a href="#CO_COMPARETO_INCORRECT_FLOATING">Co: compare
To()/compare() incorrectly handles float or double value</a></td><td>Bad practic
e</td></tr> |
71 <tr bgcolor="#eeeeee"><td><a href="#DE_MIGHT_IGNORE">DE: Method might ignore exc
eption</a></td><td>Bad practice</td></tr> | 74 <tr bgcolor="#eeeeee"><td><a href="#CO_COMPARETO_RESULTS_MIN_VALUE">Co: compareT
o()/compare() returns Integer.MIN_VALUE</a></td><td>Bad practice</td></tr> |
72 <tr bgcolor="#ffffff"><td><a href="#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> | 75 <tr bgcolor="#ffffff"><td><a href="#CO_SELF_NO_OBJECT">Co: Covariant compareTo()
method defined</a></td><td>Bad practice</td></tr> |
73 <tr bgcolor="#eeeeee"><td><a href="#DMI_RANDOM_USED_ONLY_ONCE">DMI: Random objec
t created and used only once</a></td><td>Bad practice</td></tr> | 76 <tr bgcolor="#eeeeee"><td><a href="#DE_MIGHT_DROP">DE: Method might drop excepti
on</a></td><td>Bad practice</td></tr> |
74 <tr bgcolor="#ffffff"><td><a href="#DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION">DMI
: Don't use removeAll to clear a collection</a></td><td>Bad practice</td></tr> | 77 <tr bgcolor="#ffffff"><td><a href="#DE_MIGHT_IGNORE">DE: Method might ignore exc
eption</a></td><td>Bad practice</td></tr> |
75 <tr bgcolor="#eeeeee"><td><a href="#DM_EXIT">Dm: Method invokes System.exit(...)
</a></td><td>Bad practice</td></tr> | 78 <tr bgcolor="#eeeeee"><td><a href="#DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS">DMI:
Adding elements of an entry set may fail due to reuse of Entry objects</a></td>
<td>Bad practice</td></tr> |
76 <tr bgcolor="#ffffff"><td><a href="#DM_RUN_FINALIZERS_ON_EXIT">Dm: Method invoke
s dangerous method runFinalizersOnExit</a></td><td>Bad practice</td></tr> | 79 <tr bgcolor="#ffffff"><td><a href="#DMI_RANDOM_USED_ONLY_ONCE">DMI: Random objec
t created and used only once</a></td><td>Bad practice</td></tr> |
77 <tr bgcolor="#eeeeee"><td><a href="#ES_COMPARING_PARAMETER_STRING_WITH_EQ">ES: C
omparison of String parameter using == or !=</a></td><td>Bad practice</td></tr> | 80 <tr bgcolor="#eeeeee"><td><a href="#DMI_USING_REMOVEALL_TO_CLEAR_COLLECTION">DMI
: Don't use removeAll to clear a collection</a></td><td>Bad practice</td></tr> |
78 <tr bgcolor="#ffffff"><td><a href="#ES_COMPARING_STRINGS_WITH_EQ">ES: Comparison
of String objects using == or !=</a></td><td>Bad practice</td></tr> | 81 <tr bgcolor="#ffffff"><td><a href="#DM_EXIT">Dm: Method invokes System.exit(...)
</a></td><td>Bad practice</td></tr> |
79 <tr bgcolor="#eeeeee"><td><a href="#EQ_ABSTRACT_SELF">Eq: Abstract class defines
covariant equals() method</a></td><td>Bad practice</td></tr> | 82 <tr bgcolor="#eeeeee"><td><a href="#DM_RUN_FINALIZERS_ON_EXIT">Dm: Method invoke
s dangerous method runFinalizersOnExit</a></td><td>Bad practice</td></tr> |
80 <tr bgcolor="#ffffff"><td><a href="#EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THI
S">Eq: Equals checks for incompatible operand</a></td><td>Bad practice</td></tr> | 83 <tr bgcolor="#ffffff"><td><a href="#ES_COMPARING_PARAMETER_STRING_WITH_EQ">ES: C
omparison of String parameter using == or !=</a></td><td>Bad practice</td></tr> |
81 <tr bgcolor="#eeeeee"><td><a href="#EQ_COMPARETO_USE_OBJECT_EQUALS">Eq: Class de
fines compareTo(...) and uses Object.equals()</a></td><td>Bad practice</td></tr> | 84 <tr bgcolor="#eeeeee"><td><a href="#ES_COMPARING_STRINGS_WITH_EQ">ES: Comparison
of String objects using == or !=</a></td><td>Bad practice</td></tr> |
82 <tr bgcolor="#ffffff"><td><a href="#EQ_GETCLASS_AND_CLASS_CONSTANT">Eq: equals m
ethod fails for subtypes</a></td><td>Bad practice</td></tr> | 85 <tr bgcolor="#ffffff"><td><a href="#EQ_ABSTRACT_SELF">Eq: Abstract class defines
covariant equals() method</a></td><td>Bad practice</td></tr> |
83 <tr bgcolor="#eeeeee"><td><a href="#EQ_SELF_NO_OBJECT">Eq: Covariant equals() me
thod defined</a></td><td>Bad practice</td></tr> | 86 <tr bgcolor="#eeeeee"><td><a href="#EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THI
S">Eq: Equals checks for incompatible operand</a></td><td>Bad practice</td></tr> |
84 <tr bgcolor="#ffffff"><td><a href="#FI_EMPTY">FI: Empty finalizer should be dele
ted</a></td><td>Bad practice</td></tr> | 87 <tr bgcolor="#ffffff"><td><a href="#EQ_COMPARETO_USE_OBJECT_EQUALS">Eq: Class de
fines compareTo(...) and uses Object.equals()</a></td><td>Bad practice</td></tr> |
85 <tr bgcolor="#eeeeee"><td><a href="#FI_EXPLICIT_INVOCATION">FI: Explicit invocat
ion of finalizer</a></td><td>Bad practice</td></tr> | 88 <tr bgcolor="#eeeeee"><td><a href="#EQ_GETCLASS_AND_CLASS_CONSTANT">Eq: equals m
ethod fails for subtypes</a></td><td>Bad practice</td></tr> |
86 <tr bgcolor="#ffffff"><td><a href="#FI_FINALIZER_NULLS_FIELDS">FI: Finalizer nul
ls fields</a></td><td>Bad practice</td></tr> | 89 <tr bgcolor="#ffffff"><td><a href="#EQ_SELF_NO_OBJECT">Eq: Covariant equals() me
thod defined</a></td><td>Bad practice</td></tr> |
87 <tr bgcolor="#eeeeee"><td><a href="#FI_FINALIZER_ONLY_NULLS_FIELDS">FI: Finalize
r only nulls fields</a></td><td>Bad practice</td></tr> | 90 <tr bgcolor="#eeeeee"><td><a href="#FI_EMPTY">FI: Empty finalizer should be dele
ted</a></td><td>Bad practice</td></tr> |
88 <tr bgcolor="#ffffff"><td><a href="#FI_MISSING_SUPER_CALL">FI: Finalizer does no
t call superclass finalizer</a></td><td>Bad practice</td></tr> | 91 <tr bgcolor="#ffffff"><td><a href="#FI_EXPLICIT_INVOCATION">FI: Explicit invocat
ion of finalizer</a></td><td>Bad practice</td></tr> |
89 <tr bgcolor="#eeeeee"><td><a href="#FI_NULLIFY_SUPER">FI: Finalizer nullifies su
perclass finalizer</a></td><td>Bad practice</td></tr> | 92 <tr bgcolor="#eeeeee"><td><a href="#FI_FINALIZER_NULLS_FIELDS">FI: Finalizer nul
ls fields</a></td><td>Bad practice</td></tr> |
90 <tr bgcolor="#ffffff"><td><a href="#FI_USELESS">FI: Finalizer does nothing but c
all superclass finalizer</a></td><td>Bad practice</td></tr> | 93 <tr bgcolor="#ffffff"><td><a href="#FI_FINALIZER_ONLY_NULLS_FIELDS">FI: Finalize
r only nulls fields</a></td><td>Bad practice</td></tr> |
91 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_USES_NEWLINE">FS: Format st
ring should use %n rather than \n</a></td><td>Bad practice</td></tr> | 94 <tr bgcolor="#eeeeee"><td><a href="#FI_MISSING_SUPER_CALL">FI: Finalizer does no
t call superclass finalizer</a></td><td>Bad practice</td></tr> |
92 <tr bgcolor="#ffffff"><td><a href="#GC_UNCHECKED_TYPE_IN_GENERIC_CALL">GC: Unche
cked type in generic call</a></td><td>Bad practice</td></tr> | 95 <tr bgcolor="#ffffff"><td><a href="#FI_NULLIFY_SUPER">FI: Finalizer nullifies su
perclass finalizer</a></td><td>Bad practice</td></tr> |
93 <tr bgcolor="#eeeeee"><td><a href="#HE_EQUALS_NO_HASHCODE">HE: Class defines equ
als() but not hashCode()</a></td><td>Bad practice</td></tr> | 96 <tr bgcolor="#eeeeee"><td><a href="#FI_USELESS">FI: Finalizer does nothing but c
all superclass finalizer</a></td><td>Bad practice</td></tr> |
94 <tr bgcolor="#ffffff"><td><a href="#HE_EQUALS_USE_HASHCODE">HE: Class defines eq
uals() and uses Object.hashCode()</a></td><td>Bad practice</td></tr> | 97 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_USES_NEWLINE">FS: Format st
ring should use %n rather than \n</a></td><td>Bad practice</td></tr> |
95 <tr bgcolor="#eeeeee"><td><a href="#HE_HASHCODE_NO_EQUALS">HE: Class defines has
hCode() but not equals()</a></td><td>Bad practice</td></tr> | 98 <tr bgcolor="#eeeeee"><td><a href="#GC_UNCHECKED_TYPE_IN_GENERIC_CALL">GC: Unche
cked type in generic call</a></td><td>Bad practice</td></tr> |
96 <tr bgcolor="#ffffff"><td><a href="#HE_HASHCODE_USE_OBJECT_EQUALS">HE: Class def
ines hashCode() and uses Object.equals()</a></td><td>Bad practice</td></tr> | 99 <tr bgcolor="#ffffff"><td><a href="#HE_EQUALS_NO_HASHCODE">HE: Class defines equ
als() but not hashCode()</a></td><td>Bad practice</td></tr> |
97 <tr bgcolor="#eeeeee"><td><a href="#HE_INHERITS_EQUALS_USE_HASHCODE">HE: Class i
nherits equals() and uses Object.hashCode()</a></td><td>Bad practice</td></tr> | 100 <tr bgcolor="#eeeeee"><td><a href="#HE_EQUALS_USE_HASHCODE">HE: Class defines eq
uals() and uses Object.hashCode()</a></td><td>Bad practice</td></tr> |
98 <tr bgcolor="#ffffff"><td><a href="#IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZ
ATION">IC: Superclass uses subclass during initialization</a></td><td>Bad practi
ce</td></tr> | 101 <tr bgcolor="#ffffff"><td><a href="#HE_HASHCODE_NO_EQUALS">HE: Class defines has
hCode() but not equals()</a></td><td>Bad practice</td></tr> |
99 <tr bgcolor="#eeeeee"><td><a href="#IMSE_DONT_CATCH_IMSE">IMSE: Dubious catching
of IllegalMonitorStateException</a></td><td>Bad practice</td></tr> | 102 <tr bgcolor="#eeeeee"><td><a href="#HE_HASHCODE_USE_OBJECT_EQUALS">HE: Class def
ines hashCode() and uses Object.equals()</a></td><td>Bad practice</td></tr> |
100 <tr bgcolor="#ffffff"><td><a href="#ISC_INSTANTIATE_STATIC_CLASS">ISC: Needless
instantiation of class that only supplies static methods</a></td><td>Bad practic
e</td></tr> | 103 <tr bgcolor="#ffffff"><td><a href="#HE_INHERITS_EQUALS_USE_HASHCODE">HE: Class i
nherits equals() and uses Object.hashCode()</a></td><td>Bad practice</td></tr> |
101 <tr bgcolor="#eeeeee"><td><a href="#IT_NO_SUCH_ELEMENT">It: Iterator next() meth
od can't throw NoSuchElementException</a></td><td>Bad practice</td></tr> | 104 <tr bgcolor="#eeeeee"><td><a href="#IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZ
ATION">IC: Superclass uses subclass during initialization</a></td><td>Bad practi
ce</td></tr> |
102 <tr bgcolor="#ffffff"><td><a href="#J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_S
ESSION">J2EE: Store of non serializable object into HttpSession</a></td><td>Bad
practice</td></tr> | 105 <tr bgcolor="#ffffff"><td><a href="#IMSE_DONT_CATCH_IMSE">IMSE: Dubious catching
of IllegalMonitorStateException</a></td><td>Bad practice</td></tr> |
103 <tr bgcolor="#eeeeee"><td><a href="#JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS">JC
IP: Fields of immutable classes should be final</a></td><td>Bad practice</td></t
r> | 106 <tr bgcolor="#eeeeee"><td><a href="#ISC_INSTANTIATE_STATIC_CLASS">ISC: Needless
instantiation of class that only supplies static methods</a></td><td>Bad practic
e</td></tr> |
104 <tr bgcolor="#ffffff"><td><a href="#NP_BOOLEAN_RETURN_NULL">NP: Method with Bool
ean return type returns explicit null</a></td><td>Bad practice</td></tr> | 107 <tr bgcolor="#ffffff"><td><a href="#IT_NO_SUCH_ELEMENT">It: Iterator next() meth
od can't throw NoSuchElementException</a></td><td>Bad practice</td></tr> |
105 <tr bgcolor="#eeeeee"><td><a href="#NP_CLONE_COULD_RETURN_NULL">NP: Clone method
may return null</a></td><td>Bad practice</td></tr> | 108 <tr bgcolor="#eeeeee"><td><a href="#J2EE_STORE_OF_NON_SERIALIZABLE_OBJECT_INTO_S
ESSION">J2EE: Store of non serializable object into HttpSession</a></td><td>Bad
practice</td></tr> |
106 <tr bgcolor="#ffffff"><td><a href="#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="#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> |
107 <tr bgcolor="#eeeeee"><td><a href="#NP_TOSTRING_COULD_RETURN_NULL">NP: toString
method may return null</a></td><td>Bad practice</td></tr> | 110 <tr bgcolor="#eeeeee"><td><a href="#ME_ENUM_FIELD_SETTER">ME: Public enum method
unconditionally sets its field</a></td><td>Bad practice</td></tr> |
108 <tr bgcolor="#ffffff"><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="#ffffff"><td><a href="#ME_MUTABLE_ENUM_FIELD">ME: Enum field is pub
lic and mutable</a></td><td>Bad practice</td></tr> |
109 <tr bgcolor="#eeeeee"><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="#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> |
110 <tr bgcolor="#ffffff"><td><a href="#NM_CONFUSING">Nm: Confusing method names</a>
</td><td>Bad practice</td></tr> | 113 <tr bgcolor="#ffffff"><td><a href="#NP_CLONE_COULD_RETURN_NULL">NP: Clone method
may return null</a></td><td>Bad practice</td></tr> |
111 <tr bgcolor="#eeeeee"><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="#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> |
112 <tr bgcolor="#ffffff"><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="#ffffff"><td><a href="#NP_TOSTRING_COULD_RETURN_NULL">NP: toString
method may return null</a></td><td>Bad practice</td></tr> |
113 <tr bgcolor="#eeeeee"><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="#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> |
114 <tr bgcolor="#ffffff"><td><a href="#NM_METHOD_NAMING_CONVENTION">Nm: Method name
s should start with a lower case letter</a></td><td>Bad practice</td></tr> | 117 <tr bgcolor="#ffffff"><td><a href="#NM_CLASS_NOT_EXCEPTION">Nm: Class is not der
ived from an Exception, even though it is named as such</a></td><td>Bad practice
</td></tr> |
115 <tr bgcolor="#eeeeee"><td><a href="#NM_SAME_SIMPLE_NAME_AS_INTERFACE">Nm: Class
names shouldn't shadow simple name of implemented interface</a></td><td>Bad prac
tice</td></tr> | 118 <tr bgcolor="#eeeeee"><td><a href="#NM_CONFUSING">Nm: Confusing method names</a>
</td><td>Bad practice</td></tr> |
116 <tr bgcolor="#ffffff"><td><a href="#NM_SAME_SIMPLE_NAME_AS_SUPERCLASS">Nm: Class
names shouldn't shadow simple name of superclass</a></td><td>Bad practice</td><
/tr> | 119 <tr bgcolor="#ffffff"><td><a href="#NM_FIELD_NAMING_CONVENTION">Nm: Field names
should start with a lower case letter</a></td><td>Bad practice</td></tr> |
117 <tr bgcolor="#eeeeee"><td><a href="#NM_VERY_CONFUSING_INTENTIONAL">Nm: Very conf
using method names (but perhaps intentional)</a></td><td>Bad practice</td></tr> | 120 <tr bgcolor="#eeeeee"><td><a href="#NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER">Nm: Us
e of identifier that is a keyword in later versions of Java</a></td><td>Bad prac
tice</td></tr> |
118 <tr bgcolor="#ffffff"><td><a href="#NM_WRONG_PACKAGE_INTENTIONAL">Nm: Method doe
sn't override method in superclass due to wrong package for parameter</a></td><t
d>Bad practice</td></tr> | 121 <tr bgcolor="#ffffff"><td><a href="#NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER"
>Nm: Use of identifier that is a keyword in later versions of Java</a></td><td>B
ad practice</td></tr> |
119 <tr bgcolor="#eeeeee"><td><a href="#ODR_OPEN_DATABASE_RESOURCE">ODR: Method may
fail to close database resource</a></td><td>Bad practice</td></tr> | 122 <tr bgcolor="#eeeeee"><td><a href="#NM_METHOD_NAMING_CONVENTION">Nm: Method name
s should start with a lower case letter</a></td><td>Bad practice</td></tr> |
120 <tr bgcolor="#ffffff"><td><a href="#ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH">O
DR: Method may fail to close database resource on exception</a></td><td>Bad prac
tice</td></tr> | 123 <tr bgcolor="#ffffff"><td><a href="#NM_SAME_SIMPLE_NAME_AS_INTERFACE">Nm: Class
names shouldn't shadow simple name of implemented interface</a></td><td>Bad prac
tice</td></tr> |
121 <tr bgcolor="#eeeeee"><td><a href="#OS_OPEN_STREAM">OS: Method may fail to close
stream</a></td><td>Bad practice</td></tr> | 124 <tr bgcolor="#eeeeee"><td><a href="#NM_SAME_SIMPLE_NAME_AS_SUPERCLASS">Nm: Class
names shouldn't shadow simple name of superclass</a></td><td>Bad practice</td><
/tr> |
122 <tr bgcolor="#ffffff"><td><a href="#OS_OPEN_STREAM_EXCEPTION_PATH">OS: Method ma
y fail to close stream on exception</a></td><td>Bad practice</td></tr> | 125 <tr bgcolor="#ffffff"><td><a href="#NM_VERY_CONFUSING_INTENTIONAL">Nm: Very conf
using method names (but perhaps intentional)</a></td><td>Bad practice</td></tr> |
123 <tr bgcolor="#eeeeee"><td><a href="#PZ_DONT_REUSE_ENTRY_OBJECTS_IN_ITERATORS">PZ
: Don't reuse entry objects in iterators</a></td><td>Bad practice</td></tr> | 126 <tr bgcolor="#eeeeee"><td><a href="#NM_WRONG_PACKAGE_INTENTIONAL">Nm: Method doe
sn't override method in superclass due to wrong package for parameter</a></td><t
d>Bad practice</td></tr> |
124 <tr bgcolor="#ffffff"><td><a href="#RC_REF_COMPARISON_BAD_PRACTICE">RC: Suspicio
us reference comparison to constant</a></td><td>Bad practice</td></tr> | 127 <tr bgcolor="#ffffff"><td><a href="#ODR_OPEN_DATABASE_RESOURCE">ODR: Method may
fail to close database resource</a></td><td>Bad practice</td></tr> |
125 <tr bgcolor="#eeeeee"><td><a href="#RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN">RC:
Suspicious reference comparison of Boolean values</a></td><td>Bad practice</td><
/tr> | 128 <tr bgcolor="#eeeeee"><td><a href="#ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH">O
DR: Method may fail to close database resource on exception</a></td><td>Bad prac
tice</td></tr> |
126 <tr bgcolor="#ffffff"><td><a href="#RR_NOT_CHECKED">RR: Method ignores results o
f InputStream.read()</a></td><td>Bad practice</td></tr> | 129 <tr bgcolor="#ffffff"><td><a href="#OS_OPEN_STREAM">OS: Method may fail to close
stream</a></td><td>Bad practice</td></tr> |
127 <tr bgcolor="#eeeeee"><td><a href="#SR_NOT_CHECKED">RR: Method ignores results o
f InputStream.skip()</a></td><td>Bad practice</td></tr> | 130 <tr bgcolor="#eeeeee"><td><a href="#OS_OPEN_STREAM_EXCEPTION_PATH">OS: Method ma
y fail to close stream on exception</a></td><td>Bad practice</td></tr> |
128 <tr bgcolor="#ffffff"><td><a href="#RV_NEGATING_RESULT_OF_COMPARETO">RV: Negatin
g the result of compareTo()/compare()</a></td><td>Bad practice</td></tr> | 131 <tr bgcolor="#ffffff"><td><a href="#PZ_DONT_REUSE_ENTRY_OBJECTS_IN_ITERATORS">PZ
: Don't reuse entry objects in iterators</a></td><td>Bad practice</td></tr> |
129 <tr bgcolor="#eeeeee"><td><a href="#RV_RETURN_VALUE_IGNORED_BAD_PRACTICE">RV: Me
thod ignores exceptional return value</a></td><td>Bad practice</td></tr> | 132 <tr bgcolor="#eeeeee"><td><a href="#RC_REF_COMPARISON_BAD_PRACTICE">RC: Suspicio
us reference comparison to constant</a></td><td>Bad practice</td></tr> |
130 <tr bgcolor="#ffffff"><td><a href="#SI_INSTANCE_BEFORE_FINALS_ASSIGNED">SI: Stat
ic initializer creates instance before all static final fields assigned</a></td>
<td>Bad practice</td></tr> | 133 <tr bgcolor="#ffffff"><td><a href="#RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN">RC:
Suspicious reference comparison of Boolean values</a></td><td>Bad practice</td><
/tr> |
131 <tr bgcolor="#eeeeee"><td><a href="#SW_SWING_METHODS_INVOKED_IN_SWING_THREAD">SW
: Certain swing methods needs to be invoked in Swing thread</a></td><td>Bad prac
tice</td></tr> | 134 <tr bgcolor="#eeeeee"><td><a href="#RR_NOT_CHECKED">RR: Method ignores results o
f InputStream.read()</a></td><td>Bad practice</td></tr> |
132 <tr bgcolor="#ffffff"><td><a href="#SE_BAD_FIELD">Se: Non-transient non-serializ
able instance field in serializable class</a></td><td>Bad practice</td></tr> | 135 <tr bgcolor="#ffffff"><td><a href="#SR_NOT_CHECKED">RR: Method ignores results o
f InputStream.skip()</a></td><td>Bad practice</td></tr> |
133 <tr bgcolor="#eeeeee"><td><a href="#SE_BAD_FIELD_INNER_CLASS">Se: Non-serializab
le class has a serializable inner class</a></td><td>Bad practice</td></tr> | 136 <tr bgcolor="#eeeeee"><td><a href="#RV_NEGATING_RESULT_OF_COMPARETO">RV: Negatin
g the result of compareTo()/compare()</a></td><td>Bad practice</td></tr> |
134 <tr bgcolor="#ffffff"><td><a href="#SE_BAD_FIELD_STORE">Se: Non-serializable val
ue stored into instance field of a serializable class</a></td><td>Bad practice</
td></tr> | 137 <tr bgcolor="#ffffff"><td><a href="#RV_RETURN_VALUE_IGNORED_BAD_PRACTICE">RV: Me
thod ignores exceptional return value</a></td><td>Bad practice</td></tr> |
135 <tr bgcolor="#eeeeee"><td><a href="#SE_COMPARATOR_SHOULD_BE_SERIALIZABLE">Se: Co
mparator doesn't implement Serializable</a></td><td>Bad practice</td></tr> | 138 <tr bgcolor="#eeeeee"><td><a href="#SI_INSTANCE_BEFORE_FINALS_ASSIGNED">SI: Stat
ic initializer creates instance before all static final fields assigned</a></td>
<td>Bad practice</td></tr> |
136 <tr bgcolor="#ffffff"><td><a href="#SE_INNER_CLASS">Se: Serializable inner class
</a></td><td>Bad practice</td></tr> | 139 <tr bgcolor="#ffffff"><td><a href="#SW_SWING_METHODS_INVOKED_IN_SWING_THREAD">SW
: Certain swing methods needs to be invoked in Swing thread</a></td><td>Bad prac
tice</td></tr> |
137 <tr bgcolor="#eeeeee"><td><a href="#SE_NONFINAL_SERIALVERSIONID">Se: serialVersi
onUID isn't final</a></td><td>Bad practice</td></tr> | 140 <tr bgcolor="#eeeeee"><td><a href="#SE_BAD_FIELD">Se: Non-transient non-serializ
able instance field in serializable class</a></td><td>Bad practice</td></tr> |
138 <tr bgcolor="#ffffff"><td><a href="#SE_NONLONG_SERIALVERSIONID">Se: serialVersio
nUID isn't long</a></td><td>Bad practice</td></tr> | 141 <tr bgcolor="#ffffff"><td><a href="#SE_BAD_FIELD_INNER_CLASS">Se: Non-serializab
le class has a serializable inner class</a></td><td>Bad practice</td></tr> |
139 <tr bgcolor="#eeeeee"><td><a href="#SE_NONSTATIC_SERIALVERSIONID">Se: serialVers
ionUID isn't static</a></td><td>Bad practice</td></tr> | 142 <tr bgcolor="#eeeeee"><td><a href="#SE_BAD_FIELD_STORE">Se: Non-serializable val
ue stored into instance field of a serializable class</a></td><td>Bad practice</
td></tr> |
140 <tr bgcolor="#ffffff"><td><a href="#SE_NO_SUITABLE_CONSTRUCTOR">Se: Class is Ser
ializable but its superclass doesn't define a void constructor</a></td><td>Bad p
ractice</td></tr> | 143 <tr bgcolor="#ffffff"><td><a href="#SE_COMPARATOR_SHOULD_BE_SERIALIZABLE">Se: Co
mparator doesn't implement Serializable</a></td><td>Bad practice</td></tr> |
141 <tr bgcolor="#eeeeee"><td><a href="#SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATI
ON">Se: Class is Externalizable but doesn't define a void constructor</a></td><t
d>Bad practice</td></tr> | 144 <tr bgcolor="#eeeeee"><td><a href="#SE_INNER_CLASS">Se: Serializable inner class
</a></td><td>Bad practice</td></tr> |
142 <tr bgcolor="#ffffff"><td><a href="#SE_READ_RESOLVE_MUST_RETURN_OBJECT">Se: The
readResolve method must be declared with a return type of Object. </a></td><td>B
ad practice</td></tr> | 145 <tr bgcolor="#ffffff"><td><a href="#SE_NONFINAL_SERIALVERSIONID">Se: serialVersi
onUID isn't final</a></td><td>Bad practice</td></tr> |
143 <tr bgcolor="#eeeeee"><td><a href="#SE_TRANSIENT_FIELD_NOT_RESTORED">Se: Transie
nt field that isn't set by deserialization. </a></td><td>Bad practice</td></tr> | 146 <tr bgcolor="#eeeeee"><td><a href="#SE_NONLONG_SERIALVERSIONID">Se: serialVersio
nUID isn't long</a></td><td>Bad practice</td></tr> |
144 <tr bgcolor="#ffffff"><td><a href="#SE_NO_SERIALVERSIONID">SnVI: Class is Serial
izable, but doesn't define serialVersionUID</a></td><td>Bad practice</td></tr> | 147 <tr bgcolor="#ffffff"><td><a href="#SE_NONSTATIC_SERIALVERSIONID">Se: serialVers
ionUID isn't static</a></td><td>Bad practice</td></tr> |
145 <tr bgcolor="#eeeeee"><td><a href="#UI_INHERITANCE_UNSAFE_GETRESOURCE">UI: Usage
of GetResource may be unsafe if class is extended</a></td><td>Bad practice</td>
</tr> | 148 <tr bgcolor="#eeeeee"><td><a href="#SE_NO_SUITABLE_CONSTRUCTOR">Se: Class is Ser
ializable but its superclass doesn't define a void constructor</a></td><td>Bad p
ractice</td></tr> |
146 <tr bgcolor="#ffffff"><td><a href="#BAC_BAD_APPLET_CONSTRUCTOR">BAC: Bad Applet
Constructor relies on uninitialized AppletStub</a></td><td>Correctness</td></tr> | 149 <tr bgcolor="#ffffff"><td><a href="#SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATI
ON">Se: Class is Externalizable but doesn't define a void constructor</a></td><t
d>Bad practice</td></tr> |
147 <tr bgcolor="#eeeeee"><td><a href="#BC_IMPOSSIBLE_CAST">BC: Impossible cast</a><
/td><td>Correctness</td></tr> | 150 <tr bgcolor="#eeeeee"><td><a href="#SE_READ_RESOLVE_MUST_RETURN_OBJECT">Se: The
readResolve method must be declared with a return type of Object. </a></td><td>B
ad practice</td></tr> |
148 <tr bgcolor="#ffffff"><td><a href="#BC_IMPOSSIBLE_DOWNCAST">BC: Impossible downc
ast</a></td><td>Correctness</td></tr> | 151 <tr bgcolor="#ffffff"><td><a href="#SE_TRANSIENT_FIELD_NOT_RESTORED">Se: Transie
nt field that isn't set by deserialization. </a></td><td>Bad practice</td></tr> |
149 <tr bgcolor="#eeeeee"><td><a href="#BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY">BC: Impos
sible downcast of toArray() result</a></td><td>Correctness</td></tr> | 152 <tr bgcolor="#eeeeee"><td><a href="#SE_NO_SERIALVERSIONID">SnVI: Class is Serial
izable, but doesn't define serialVersionUID</a></td><td>Bad practice</td></tr> |
150 <tr bgcolor="#ffffff"><td><a href="#BC_IMPOSSIBLE_INSTANCEOF">BC: instanceof wil
l always return false</a></td><td>Correctness</td></tr> | 153 <tr bgcolor="#ffffff"><td><a href="#UI_INHERITANCE_UNSAFE_GETRESOURCE">UI: Usage
of GetResource may be unsafe if class is extended</a></td><td>Bad practice</td>
</tr> |
151 <tr bgcolor="#eeeeee"><td><a href="#BIT_ADD_OF_SIGNED_BYTE">BIT: Bitwise add of
signed byte value</a></td><td>Correctness</td></tr> | 154 <tr bgcolor="#eeeeee"><td><a href="#BAC_BAD_APPLET_CONSTRUCTOR">BAC: Bad Applet
Constructor relies on uninitialized AppletStub</a></td><td>Correctness</td></tr> |
152 <tr bgcolor="#ffffff"><td><a href="#BIT_AND">BIT: Incompatible bit masks</a></td
><td>Correctness</td></tr> | 155 <tr bgcolor="#ffffff"><td><a href="#BC_IMPOSSIBLE_CAST">BC: Impossible cast</a><
/td><td>Correctness</td></tr> |
153 <tr bgcolor="#eeeeee"><td><a href="#BIT_AND_ZZ">BIT: Check to see if ((...) & 0)
== 0</a></td><td>Correctness</td></tr> | 156 <tr bgcolor="#eeeeee"><td><a href="#BC_IMPOSSIBLE_DOWNCAST">BC: Impossible downc
ast</a></td><td>Correctness</td></tr> |
154 <tr bgcolor="#ffffff"><td><a href="#BIT_IOR">BIT: Incompatible bit masks</a></td
><td>Correctness</td></tr> | 157 <tr bgcolor="#ffffff"><td><a href="#BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY">BC: Impos
sible downcast of toArray() result</a></td><td>Correctness</td></tr> |
155 <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> | 158 <tr bgcolor="#eeeeee"><td><a href="#BC_IMPOSSIBLE_INSTANCEOF">BC: instanceof wil
l always return false</a></td><td>Correctness</td></tr> |
156 <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> | 159 <tr bgcolor="#ffffff"><td><a href="#BIT_ADD_OF_SIGNED_BYTE">BIT: Bitwise add of
signed byte value</a></td><td>Correctness</td></tr> |
157 <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> | 160 <tr bgcolor="#eeeeee"><td><a href="#BIT_AND">BIT: Incompatible bit masks</a></td
><td>Correctness</td></tr> |
| 161 <tr bgcolor="#ffffff"><td><a href="#BIT_AND_ZZ">BIT: Check to see if ((...) & 0)
== 0</a></td><td>Correctness</td></tr> |
| 162 <tr bgcolor="#eeeeee"><td><a href="#BIT_IOR">BIT: Incompatible bit masks</a></td
><td>Correctness</td></tr> |
| 163 <tr bgcolor="#ffffff"><td><a href="#BIT_IOR_OF_SIGNED_BYTE">BIT: Bitwise OR of s
igned byte value</a></td><td>Correctness</td></tr> |
| 164 <tr bgcolor="#eeeeee"><td><a href="#BIT_SIGNED_CHECK_HIGH_BIT">BIT: Check for si
gn of bitwise operation</a></td><td>Correctness</td></tr> |
| 165 <tr bgcolor="#ffffff"><td><a href="#BOA_BADLY_OVERRIDDEN_ADAPTER">BOA: Class ove
rrides a method implemented in super class Adapter wrongly</a></td><td>Correctne
ss</td></tr> |
| 166 <tr bgcolor="#eeeeee"><td><a href="#BSHIFT_WRONG_ADD_PRIORITY">BSHIFT: Possible
bad parsing of shift operation</a></td><td>Correctness</td></tr> |
158 <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> | 167 <tr bgcolor="#ffffff"><td><a href="#ICAST_BAD_SHIFT_AMOUNT">BSHIFT: 32 bit int s
hifted by an amount not in the range -31..31</a></td><td>Correctness</td></tr> |
159 <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> | 168 <tr bgcolor="#eeeeee"><td><a href="#CAA_COVARIANT_ARRAY_ELEMENT_STORE">CAA: Poss
ibly incompatible element is stored in covariant array</a></td><td>Correctness</
td></tr> |
160 <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> | 169 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_LOCAL_INCREMENT_IN_RETURN">DLS: Use
less increment in return statement</a></td><td>Correctness</td></tr> |
161 <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> | 170 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_STORE_OF_CLASS_LITERAL">DLS: Dead s
tore of class literal</a></td><td>Correctness</td></tr> |
162 <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> | 171 <tr bgcolor="#ffffff"><td><a href="#DLS_OVERWRITTEN_INCREMENT">DLS: Overwritten
increment</a></td><td>Correctness</td></tr> |
163 <tr bgcolor="#eeeeee"><td><a href="#DLS_OVERWRITTEN_INCREMENT">DLS: Overwritten
increment</a></td><td>Correctness</td></tr> | 172 <tr bgcolor="#eeeeee"><td><a href="#DMI_ARGUMENTS_WRONG_ORDER">DMI: Reversed met
hod arguments</a></td><td>Correctness</td></tr> |
164 <tr bgcolor="#ffffff"><td><a href="#DMI_ARGUMENTS_WRONG_ORDER">DMI: Reversed met
hod arguments</a></td><td>Correctness</td></tr> | 173 <tr bgcolor="#ffffff"><td><a href="#DMI_BAD_MONTH">DMI: Bad constant value for m
onth</a></td><td>Correctness</td></tr> |
165 <tr bgcolor="#eeeeee"><td><a href="#DMI_BAD_MONTH">DMI: Bad constant value for m
onth</a></td><td>Correctness</td></tr> | 174 <tr bgcolor="#eeeeee"><td><a href="#DMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE">DMI:
BigDecimal constructed from double that isn't represented precisely</a></td><td
>Correctness</td></tr> |
166 <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> | 175 <tr bgcolor="#ffffff"><td><a href="#DMI_CALLING_NEXT_FROM_HASNEXT">DMI: hasNext
method invokes next</a></td><td>Correctness</td></tr> |
167 <tr bgcolor="#eeeeee"><td><a href="#DMI_CALLING_NEXT_FROM_HASNEXT">DMI: hasNext
method invokes next</a></td><td>Correctness</td></tr> | 176 <tr bgcolor="#eeeeee"><td><a href="#DMI_COLLECTIONS_SHOULD_NOT_CONTAIN_THEMSELVE
S">DMI: Collections should not contain themselves</a></td><td>Correctness</td></
tr> |
168 <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> | 177 <tr bgcolor="#ffffff"><td><a href="#DMI_DOH">DMI: D'oh! A nonsensical method inv
ocation</a></td><td>Correctness</td></tr> |
169 <tr bgcolor="#eeeeee"><td><a href="#DMI_DOH">DMI: D'oh! A nonsensical method inv
ocation</a></td><td>Correctness</td></tr> | 178 <tr bgcolor="#eeeeee"><td><a href="#DMI_INVOKING_HASHCODE_ON_ARRAY">DMI: Invocat
ion of hashCode on an array</a></td><td>Correctness</td></tr> |
170 <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> | 179 <tr bgcolor="#ffffff"><td><a href="#DMI_LONG_BITS_TO_DOUBLE_INVOKED_ON_INT">DMI:
Double.longBitsToDouble invoked on an int</a></td><td>Correctness</td></tr> |
171 <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> | 180 <tr bgcolor="#eeeeee"><td><a href="#DMI_VACUOUS_SELF_COLLECTION_CALL">DMI: Vacuo
us call to collections</a></td><td>Correctness</td></tr> |
172 <tr bgcolor="#ffffff"><td><a href="#DMI_VACUOUS_SELF_COLLECTION_CALL">DMI: Vacuo
us call to collections</a></td><td>Correctness</td></tr> | 181 <tr bgcolor="#ffffff"><td><a href="#DMI_ANNOTATION_IS_NOT_VISIBLE_TO_REFLECTION"
>Dm: Can't use reflection to check for presence of annotation without runtime re
tention</a></td><td>Correctness</td></tr> |
173 <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> | 182 <tr bgcolor="#eeeeee"><td><a href="#DMI_FUTILE_ATTEMPT_TO_CHANGE_MAXPOOL_SIZE_OF
_SCHEDULED_THREAD_POOL_EXECUTOR">Dm: Futile attempt to change max pool size of S
cheduledThreadPoolExecutor</a></td><td>Correctness</td></tr> |
174 <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> | 183 <tr bgcolor="#ffffff"><td><a href="#DMI_SCHEDULED_THREAD_POOL_EXECUTOR_WITH_ZERO
_CORE_THREADS">Dm: Creation of ScheduledThreadPoolExecutor with zero core thread
s</a></td><td>Correctness</td></tr> |
175 <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> | 184 <tr bgcolor="#eeeeee"><td><a href="#DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD">Dm: Use
less/vacuous call to EasyMock method</a></td><td>Correctness</td></tr> |
176 <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> | 185 <tr bgcolor="#ffffff"><td><a href="#DM_INVALID_MIN_MAX">Dm: Incorrect combinatio
n of Math.max and Math.min</a></td><td>Correctness</td></tr> |
177 <tr bgcolor="#eeeeee"><td><a href="#EC_ARRAY_AND_NONARRAY">EC: equals() used to
compare array and nonarray</a></td><td>Correctness</td></tr> | 186 <tr bgcolor="#eeeeee"><td><a href="#EC_ARRAY_AND_NONARRAY">EC: equals() used to
compare array and nonarray</a></td><td>Correctness</td></tr> |
178 <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> | 187 <tr bgcolor="#ffffff"><td><a href="#EC_BAD_ARRAY_COMPARE">EC: Invocation of equa
ls() on an array, which is equivalent to ==</a></td><td>Correctness</td></tr> |
179 <tr bgcolor="#eeeeee"><td><a href="#EC_INCOMPATIBLE_ARRAY_COMPARE">EC: equals(..
.) used to compare incompatible arrays</a></td><td>Correctness</td></tr> | 188 <tr bgcolor="#eeeeee"><td><a href="#EC_INCOMPATIBLE_ARRAY_COMPARE">EC: equals(..
.) used to compare incompatible arrays</a></td><td>Correctness</td></tr> |
180 <tr bgcolor="#ffffff"><td><a href="#EC_NULL_ARG">EC: Call to equals(null)</a></t
d><td>Correctness</td></tr> | 189 <tr bgcolor="#ffffff"><td><a href="#EC_NULL_ARG">EC: Call to equals(null)</a></t
d><td>Correctness</td></tr> |
181 <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> | 190 <tr bgcolor="#eeeeee"><td><a href="#EC_UNRELATED_CLASS_AND_INTERFACE">EC: Call t
o equals() comparing unrelated class and interface</a></td><td>Correctness</td><
/tr> |
182 <tr bgcolor="#ffffff"><td><a href="#EC_UNRELATED_INTERFACES">EC: Call to equals(
) comparing different interface types</a></td><td>Correctness</td></tr> | 191 <tr bgcolor="#ffffff"><td><a href="#EC_UNRELATED_INTERFACES">EC: Call to equals(
) comparing different interface types</a></td><td>Correctness</td></tr> |
183 <tr bgcolor="#eeeeee"><td><a href="#EC_UNRELATED_TYPES">EC: Call to equals() com
paring different types</a></td><td>Correctness</td></tr> | 192 <tr bgcolor="#eeeeee"><td><a href="#EC_UNRELATED_TYPES">EC: Call to equals() com
paring different types</a></td><td>Correctness</td></tr> |
184 <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> | 193 <tr bgcolor="#ffffff"><td><a href="#EC_UNRELATED_TYPES_USING_POINTER_EQUALITY">E
C: Using pointer equality to compare different types</a></td><td>Correctness</td
></tr> |
185 <tr bgcolor="#eeeeee"><td><a href="#EQ_ALWAYS_FALSE">Eq: equals method always re
turns false</a></td><td>Correctness</td></tr> | 194 <tr bgcolor="#eeeeee"><td><a href="#EQ_ALWAYS_FALSE">Eq: equals method always re
turns false</a></td><td>Correctness</td></tr> |
186 <tr bgcolor="#ffffff"><td><a href="#EQ_ALWAYS_TRUE">Eq: equals method always ret
urns true</a></td><td>Correctness</td></tr> | 195 <tr bgcolor="#ffffff"><td><a href="#EQ_ALWAYS_TRUE">Eq: equals method always ret
urns true</a></td><td>Correctness</td></tr> |
(...skipping 24 matching lines...) Expand all Loading... |
211 <tr bgcolor="#eeeeee"><td><a href="#IJU_BAD_SUITE_METHOD">IJU: TestCase declares
a bad suite method </a></td><td>Correctness</td></tr> | 220 <tr bgcolor="#eeeeee"><td><a href="#IJU_BAD_SUITE_METHOD">IJU: TestCase declares
a bad suite method </a></td><td>Correctness</td></tr> |
212 <tr bgcolor="#ffffff"><td><a href="#IJU_NO_TESTS">IJU: TestCase has no tests</a>
</td><td>Correctness</td></tr> | 221 <tr bgcolor="#ffffff"><td><a href="#IJU_NO_TESTS">IJU: TestCase has no tests</a>
</td><td>Correctness</td></tr> |
213 <tr bgcolor="#eeeeee"><td><a href="#IJU_SETUP_NO_SUPER">IJU: TestCase defines se
tUp that doesn't call super.setUp()</a></td><td>Correctness</td></tr> | 222 <tr bgcolor="#eeeeee"><td><a href="#IJU_SETUP_NO_SUPER">IJU: TestCase defines se
tUp that doesn't call super.setUp()</a></td><td>Correctness</td></tr> |
214 <tr bgcolor="#ffffff"><td><a href="#IJU_SUITE_NOT_STATIC">IJU: TestCase implemen
ts a non-static suite method </a></td><td>Correctness</td></tr> | 223 <tr bgcolor="#ffffff"><td><a href="#IJU_SUITE_NOT_STATIC">IJU: TestCase implemen
ts a non-static suite method </a></td><td>Correctness</td></tr> |
215 <tr bgcolor="#eeeeee"><td><a href="#IJU_TEARDOWN_NO_SUPER">IJU: TestCase defines
tearDown that doesn't call super.tearDown()</a></td><td>Correctness</td></tr> | 224 <tr bgcolor="#eeeeee"><td><a href="#IJU_TEARDOWN_NO_SUPER">IJU: TestCase defines
tearDown that doesn't call super.tearDown()</a></td><td>Correctness</td></tr> |
216 <tr bgcolor="#ffffff"><td><a href="#IL_CONTAINER_ADDED_TO_ITSELF">IL: A collecti
on is added to itself</a></td><td>Correctness</td></tr> | 225 <tr bgcolor="#ffffff"><td><a href="#IL_CONTAINER_ADDED_TO_ITSELF">IL: A collecti
on is added to itself</a></td><td>Correctness</td></tr> |
217 <tr bgcolor="#eeeeee"><td><a href="#IL_INFINITE_LOOP">IL: An apparent infinite l
oop</a></td><td>Correctness</td></tr> | 226 <tr bgcolor="#eeeeee"><td><a href="#IL_INFINITE_LOOP">IL: An apparent infinite l
oop</a></td><td>Correctness</td></tr> |
218 <tr bgcolor="#ffffff"><td><a href="#IL_INFINITE_RECURSIVE_LOOP">IL: An apparent
infinite recursive loop</a></td><td>Correctness</td></tr> | 227 <tr bgcolor="#ffffff"><td><a href="#IL_INFINITE_RECURSIVE_LOOP">IL: An apparent
infinite recursive loop</a></td><td>Correctness</td></tr> |
219 <tr bgcolor="#eeeeee"><td><a href="#IM_MULTIPLYING_RESULT_OF_IREM">IM: Integer m
ultiply of result of integer remainder</a></td><td>Correctness</td></tr> | 228 <tr bgcolor="#eeeeee"><td><a href="#IM_MULTIPLYING_RESULT_OF_IREM">IM: Integer m
ultiply of result of integer remainder</a></td><td>Correctness</td></tr> |
220 <tr bgcolor="#ffffff"><td><a href="#INT_BAD_COMPARISON_WITH_INT_VALUE">INT: Bad
comparison of int value with long constant</a></td><td>Correctness</td></tr> | 229 <tr bgcolor="#ffffff"><td><a href="#INT_BAD_COMPARISON_WITH_INT_VALUE">INT: Bad
comparison of int value with long constant</a></td><td>Correctness</td></tr> |
221 <tr bgcolor="#eeeeee"><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> | 230 <tr bgcolor="#eeeeee"><td><a href="#INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE">I
NT: Bad comparison of nonnegative value with negative constant or zero</a></td><
td>Correctness</td></tr> |
222 <tr bgcolor="#ffffff"><td><a href="#INT_BAD_COMPARISON_WITH_SIGNED_BYTE">INT: Ba
d comparison of signed byte</a></td><td>Correctness</td></tr> | 231 <tr bgcolor="#ffffff"><td><a href="#INT_BAD_COMPARISON_WITH_SIGNED_BYTE">INT: Ba
d comparison of signed byte</a></td><td>Correctness</td></tr> |
223 <tr bgcolor="#eeeeee"><td><a href="#IO_APPENDING_TO_OBJECT_OUTPUT_STREAM">IO: Do
omed attempt to append to an object output stream</a></td><td>Correctness</td></
tr> | 232 <tr bgcolor="#eeeeee"><td><a href="#IO_APPENDING_TO_OBJECT_OUTPUT_STREAM">IO: Do
omed attempt to append to an object output stream</a></td><td>Correctness</td></
tr> |
224 <tr bgcolor="#ffffff"><td><a href="#IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN">IP: A
parameter is dead upon entry to a method but overwritten</a></td><td>Correctness
</td></tr> | 233 <tr bgcolor="#ffffff"><td><a href="#IP_PARAMETER_IS_DEAD_BUT_OVERWRITTEN">IP: A
parameter is dead upon entry to a method but overwritten</a></td><td>Correctness
</td></tr> |
225 <tr bgcolor="#eeeeee"><td><a href="#MF_CLASS_MASKS_FIELD">MF: Class defines fiel
d that masks a superclass field</a></td><td>Correctness</td></tr> | 234 <tr bgcolor="#eeeeee"><td><a href="#MF_CLASS_MASKS_FIELD">MF: Class defines fiel
d that masks a superclass field</a></td><td>Correctness</td></tr> |
226 <tr bgcolor="#ffffff"><td><a href="#MF_METHOD_MASKS_FIELD">MF: Method defines a
variable that obscures a field</a></td><td>Correctness</td></tr> | 235 <tr bgcolor="#ffffff"><td><a href="#MF_METHOD_MASKS_FIELD">MF: Method defines a
variable that obscures a field</a></td><td>Correctness</td></tr> |
227 <tr bgcolor="#eeeeee"><td><a href="#NP_ALWAYS_NULL">NP: Null pointer dereference
</a></td><td>Correctness</td></tr> | 236 <tr bgcolor="#eeeeee"><td><a href="#NP_ALWAYS_NULL">NP: Null pointer dereference
</a></td><td>Correctness</td></tr> |
228 <tr bgcolor="#ffffff"><td><a href="#NP_ALWAYS_NULL_EXCEPTION">NP: Null pointer d
ereference in method on exception path</a></td><td>Correctness</td></tr> | 237 <tr bgcolor="#ffffff"><td><a href="#NP_ALWAYS_NULL_EXCEPTION">NP: Null pointer d
ereference in method on exception path</a></td><td>Correctness</td></tr> |
229 <tr bgcolor="#eeeeee"><td><a href="#NP_ARGUMENT_MIGHT_BE_NULL">NP: Method does n
ot check for null argument</a></td><td>Correctness</td></tr> | 238 <tr bgcolor="#eeeeee"><td><a href="#NP_ARGUMENT_MIGHT_BE_NULL">NP: Method does n
ot check for null argument</a></td><td>Correctness</td></tr> |
230 <tr bgcolor="#ffffff"><td><a href="#NP_CLOSING_NULL">NP: close() invoked on a va
lue that is always null</a></td><td>Correctness</td></tr> | 239 <tr bgcolor="#ffffff"><td><a href="#NP_CLOSING_NULL">NP: close() invoked on a va
lue that is always null</a></td><td>Correctness</td></tr> |
231 <tr bgcolor="#eeeeee"><td><a href="#NP_GUARANTEED_DEREF">NP: Null value is guara
nteed to be dereferenced</a></td><td>Correctness</td></tr> | 240 <tr bgcolor="#eeeeee"><td><a href="#NP_GUARANTEED_DEREF">NP: Null value is guara
nteed to be dereferenced</a></td><td>Correctness</td></tr> |
232 <tr bgcolor="#ffffff"><td><a href="#NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH">NP: V
alue is null and guaranteed to be dereferenced on exception path</a></td><td>Cor
rectness</td></tr> | 241 <tr bgcolor="#ffffff"><td><a href="#NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH">NP: V
alue is null and guaranteed to be dereferenced on exception path</a></td><td>Cor
rectness</td></tr> |
233 <tr bgcolor="#eeeeee"><td><a href="#NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUC
TOR">NP: Nonnull field is not initialized</a></td><td>Correctness</td></tr> | 242 <tr bgcolor="#eeeeee"><td><a href="#NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUC
TOR">NP: Non-null field is not initialized</a></td><td>Correctness</td></tr> |
234 <tr bgcolor="#ffffff"><td><a href="#NP_NONNULL_PARAM_VIOLATION">NP: Method call
passes null to a nonnull parameter </a></td><td>Correctness</td></tr> | 243 <tr bgcolor="#ffffff"><td><a href="#NP_NONNULL_PARAM_VIOLATION">NP: Method call
passes null to a non-null parameter </a></td><td>Correctness</td></tr> |
235 <tr bgcolor="#eeeeee"><td><a href="#NP_NONNULL_RETURN_VIOLATION">NP: Method may
return null, but is declared @NonNull</a></td><td>Correctness</td></tr> | 244 <tr bgcolor="#eeeeee"><td><a href="#NP_NONNULL_RETURN_VIOLATION">NP: Method may
return null, but is declared @Nonnull</a></td><td>Correctness</td></tr> |
236 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_INSTANCEOF">NP: A known null value i
s checked to see if it is an instance of a type</a></td><td>Correctness</td></tr
> | 245 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_INSTANCEOF">NP: A known null value i
s checked to see if it is an instance of a type</a></td><td>Correctness</td></tr
> |
237 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_ON_SOME_PATH">NP: Possible null poin
ter dereference</a></td><td>Correctness</td></tr> | 246 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_ON_SOME_PATH">NP: Possible null poin
ter dereference</a></td><td>Correctness</td></tr> |
238 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_ON_SOME_PATH_EXCEPTION">NP: Possible
null pointer dereference in method on exception path</a></td><td>Correctness</t
d></tr> | 247 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_ON_SOME_PATH_EXCEPTION">NP: Possible
null pointer dereference in method on exception path</a></td><td>Correctness</t
d></tr> |
239 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_PARAM_DEREF">NP: Method call passes
null for nonnull parameter</a></td><td>Correctness</td></tr> | 248 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_PARAM_DEREF">NP: Method call passes
null for non-null parameter</a></td><td>Correctness</td></tr> |
240 <tr bgcolor="#ffffff"><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> | 249 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS">N
P: Method call passes null for non-null parameter</a></td><td>Correctness</td></
tr> |
241 <tr bgcolor="#eeeeee"><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> | 250 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_PARAM_DEREF_NONVIRTUAL">NP: Non-virt
ual method call passes null for non-null parameter</a></td><td>Correctness</td><
/tr> |
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> | 251 <tr bgcolor="#ffffff"><td><a href="#NP_OPTIONAL_RETURN_NULL">NP: Method with Opt
ional return type returns explicit null</a></td><td>Correctness</td></tr> |
243 <tr bgcolor="#eeeeee"><td><a href="#NP_UNWRITTEN_FIELD">NP: Read of unwritten fi
eld</a></td><td>Correctness</td></tr> | 252 <tr bgcolor="#eeeeee"><td><a href="#NP_STORE_INTO_NONNULL_FIELD">NP: Store of nu
ll value into field annotated @Nonnull</a></td><td>Correctness</td></tr> |
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> | 253 <tr bgcolor="#ffffff"><td><a href="#NP_UNWRITTEN_FIELD">NP: Read of unwritten fi
eld</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> | 254 <tr bgcolor="#eeeeee"><td><a href="#NM_BAD_EQUAL">Nm: Class defines equal(Object
); should it be equals(Object)?</a></td><td>Correctness</td></tr> |
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> | 255 <tr bgcolor="#ffffff"><td><a href="#NM_LCASE_HASHCODE">Nm: Class defines hashcod
e(); should it be hashCode()?</a></td><td>Correctness</td></tr> |
247 <tr bgcolor="#eeeeee"><td><a href="#NM_METHOD_CONSTRUCTOR_CONFUSION">Nm: Apparen
t method/constructor confusion</a></td><td>Correctness</td></tr> | 256 <tr bgcolor="#eeeeee"><td><a href="#NM_LCASE_TOSTRING">Nm: Class defines tostrin
g(); should it be toString()?</a></td><td>Correctness</td></tr> |
248 <tr bgcolor="#ffffff"><td><a href="#NM_VERY_CONFUSING">Nm: Very confusing method
names</a></td><td>Correctness</td></tr> | 257 <tr bgcolor="#ffffff"><td><a href="#NM_METHOD_CONSTRUCTOR_CONFUSION">Nm: Apparen
t method/constructor confusion</a></td><td>Correctness</td></tr> |
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> | 258 <tr bgcolor="#eeeeee"><td><a href="#NM_VERY_CONFUSING">Nm: Very confusing method
names</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> | 259 <tr bgcolor="#ffffff"><td><a href="#NM_WRONG_PACKAGE">Nm: Method doesn't overrid
e method in superclass due to wrong package for parameter</a></td><td>Correctnes
s</td></tr> |
251 <tr bgcolor="#eeeeee"><td><a href="#RC_REF_COMPARISON">RC: Suspicious reference
comparison</a></td><td>Correctness</td></tr> | 260 <tr bgcolor="#eeeeee"><td><a href="#QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT">QBA: Me
thod assigns boolean literal in boolean expression</a></td><td>Correctness</td><
/tr> |
252 <tr bgcolor="#ffffff"><td><a href="#RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NP
E">RCN: Nullcheck of value previously dereferenced</a></td><td>Correctness</td><
/tr> | 261 <tr bgcolor="#ffffff"><td><a href="#RANGE_ARRAY_INDEX">RANGE: Array index is out
of bounds</a></td><td>Correctness</td></tr> |
253 <tr bgcolor="#eeeeee"><td><a href="#RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION">RE: In
valid syntax for regular expression</a></td><td>Correctness</td></tr> | 262 <tr bgcolor="#eeeeee"><td><a href="#RANGE_ARRAY_LENGTH">RANGE: Array length is o
ut of bounds</a></td><td>Correctness</td></tr> |
254 <tr bgcolor="#ffffff"><td><a href="#RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRES
SION">RE: File.separator used for regular expression</a></td><td>Correctness</td
></tr> | 263 <tr bgcolor="#ffffff"><td><a href="#RANGE_ARRAY_OFFSET">RANGE: Array offset is o
ut of bounds</a></td><td>Correctness</td></tr> |
255 <tr bgcolor="#eeeeee"><td><a href="#RE_POSSIBLE_UNINTENDED_PATTERN">RE: "." or "
|" used for regular expression</a></td><td>Correctness</td></tr> | 264 <tr bgcolor="#eeeeee"><td><a href="#RANGE_STRING_INDEX">RANGE: String index is o
ut of bounds</a></td><td>Correctness</td></tr> |
256 <tr bgcolor="#ffffff"><td><a href="#RV_01_TO_INT">RV: Random value from 0 to 1 i
s coerced to the integer 0</a></td><td>Correctness</td></tr> | 265 <tr bgcolor="#ffffff"><td><a href="#RC_REF_COMPARISON">RC: Suspicious reference
comparison</a></td><td>Correctness</td></tr> |
257 <tr bgcolor="#eeeeee"><td><a href="#RV_ABSOLUTE_VALUE_OF_HASHCODE">RV: Bad attem
pt to compute absolute value of signed 32-bit hashcode </a></td><td>Correctness<
/td></tr> | 266 <tr bgcolor="#eeeeee"><td><a href="#RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NP
E">RCN: Nullcheck of value previously dereferenced</a></td><td>Correctness</td><
/tr> |
258 <tr bgcolor="#ffffff"><td><a href="#RV_ABSOLUTE_VALUE_OF_RANDOM_INT">RV: Bad att
empt to compute absolute value of signed random integer</a></td><td>Correctness<
/td></tr> | 267 <tr bgcolor="#ffffff"><td><a href="#RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION">RE: In
valid syntax for regular expression</a></td><td>Correctness</td></tr> |
259 <tr bgcolor="#eeeeee"><td><a href="#RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE
">RV: Code checks for specific values returned by compareTo</a></td><td>Correctn
ess</td></tr> | 268 <tr bgcolor="#eeeeee"><td><a href="#RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRES
SION">RE: File.separator used for regular expression</a></td><td>Correctness</td
></tr> |
260 <tr bgcolor="#ffffff"><td><a href="#RV_EXCEPTION_NOT_THROWN">RV: Exception creat
ed and dropped rather than thrown</a></td><td>Correctness</td></tr> | 269 <tr bgcolor="#ffffff"><td><a href="#RE_POSSIBLE_UNINTENDED_PATTERN">RE: "." or "
|" used for regular expression</a></td><td>Correctness</td></tr> |
261 <tr bgcolor="#eeeeee"><td><a href="#RV_RETURN_VALUE_IGNORED">RV: Method ignores
return value</a></td><td>Correctness</td></tr> | 270 <tr bgcolor="#eeeeee"><td><a href="#RV_01_TO_INT">RV: Random value from 0 to 1 i
s coerced to the integer 0</a></td><td>Correctness</td></tr> |
262 <tr bgcolor="#ffffff"><td><a href="#RpC_REPEATED_CONDITIONAL_TEST">RpC: Repeated
conditional tests</a></td><td>Correctness</td></tr> | 271 <tr bgcolor="#ffffff"><td><a href="#RV_ABSOLUTE_VALUE_OF_HASHCODE">RV: Bad attem
pt to compute absolute value of signed 32-bit hashcode </a></td><td>Correctness<
/td></tr> |
263 <tr bgcolor="#eeeeee"><td><a href="#SA_FIELD_SELF_ASSIGNMENT">SA: Self assignmen
t of field</a></td><td>Correctness</td></tr> | 272 <tr bgcolor="#eeeeee"><td><a href="#RV_ABSOLUTE_VALUE_OF_RANDOM_INT">RV: Bad att
empt to compute absolute value of signed random integer</a></td><td>Correctness<
/td></tr> |
264 <tr bgcolor="#ffffff"><td><a href="#SA_FIELD_SELF_COMPARISON">SA: Self compariso
n of field with itself</a></td><td>Correctness</td></tr> | 273 <tr bgcolor="#ffffff"><td><a href="#RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE
">RV: Code checks for specific values returned by compareTo</a></td><td>Correctn
ess</td></tr> |
265 <tr bgcolor="#eeeeee"><td><a href="#SA_FIELD_SELF_COMPUTATION">SA: Nonsensical s
elf computation involving a field (e.g., x & x)</a></td><td>Correctness</td></tr
> | 274 <tr bgcolor="#eeeeee"><td><a href="#RV_EXCEPTION_NOT_THROWN">RV: Exception creat
ed and dropped rather than thrown</a></td><td>Correctness</td></tr> |
266 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD">S
A: Self assignment of local rather than assignment to field</a></td><td>Correctn
ess</td></tr> | 275 <tr bgcolor="#ffffff"><td><a href="#RV_RETURN_VALUE_IGNORED">RV: Method ignores
return value</a></td><td>Correctness</td></tr> |
267 <tr bgcolor="#eeeeee"><td><a href="#SA_LOCAL_SELF_COMPARISON">SA: Self compariso
n of value with itself</a></td><td>Correctness</td></tr> | 276 <tr bgcolor="#eeeeee"><td><a href="#RpC_REPEATED_CONDITIONAL_TEST">RpC: Repeated
conditional tests</a></td><td>Correctness</td></tr> |
268 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_COMPUTATION">SA: Nonsensical s
elf computation involving a variable (e.g., x & x)</a></td><td>Correctness</td><
/tr> | 277 <tr bgcolor="#ffffff"><td><a href="#SA_FIELD_SELF_ASSIGNMENT">SA: Self assignmen
t of field</a></td><td>Correctness</td></tr> |
269 <tr bgcolor="#eeeeee"><td><a href="#SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH">SF:
Dead store due to switch statement fall through</a></td><td>Correctness</td></t
r> | 278 <tr bgcolor="#eeeeee"><td><a href="#SA_FIELD_SELF_COMPARISON">SA: Self compariso
n of field with itself</a></td><td>Correctness</td></tr> |
270 <tr bgcolor="#ffffff"><td><a href="#SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_T
HROW">SF: Dead store due to switch statement fall through to throw</a></td><td>C
orrectness</td></tr> | 279 <tr bgcolor="#ffffff"><td><a href="#SA_FIELD_SELF_COMPUTATION">SA: Nonsensical s
elf computation involving a field (e.g., x & x)</a></td><td>Correctness</td></tr
> |
271 <tr bgcolor="#eeeeee"><td><a href="#SIC_THREADLOCAL_DEADLY_EMBRACE">SIC: Deadly
embrace of non-static inner class and thread local</a></td><td>Correctness</td><
/tr> | 280 <tr bgcolor="#eeeeee"><td><a href="#SA_LOCAL_SELF_ASSIGNMENT_INSTEAD_OF_FIELD">S
A: Self assignment of local rather than assignment to field</a></td><td>Correctn
ess</td></tr> |
272 <tr bgcolor="#ffffff"><td><a href="#SIO_SUPERFLUOUS_INSTANCEOF">SIO: Unnecessary
type check done using instanceof operator</a></td><td>Correctness</td></tr> | 281 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_COMPARISON">SA: Self compariso
n of value with itself</a></td><td>Correctness</td></tr> |
273 <tr bgcolor="#eeeeee"><td><a href="#SQL_BAD_PREPARED_STATEMENT_ACCESS">SQL: Meth
od attempts to access a prepared statement parameter with index 0</a></td><td>Co
rrectness</td></tr> | 282 <tr bgcolor="#eeeeee"><td><a href="#SA_LOCAL_SELF_COMPUTATION">SA: Nonsensical s
elf computation involving a variable (e.g., x & x)</a></td><td>Correctness</td><
/tr> |
274 <tr bgcolor="#ffffff"><td><a href="#SQL_BAD_RESULTSET_ACCESS">SQL: Method attemp
ts to access a result set field with index 0</a></td><td>Correctness</td></tr> | 283 <tr bgcolor="#ffffff"><td><a href="#SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH">SF:
Dead store due to switch statement fall through</a></td><td>Correctness</td></t
r> |
275 <tr bgcolor="#eeeeee"><td><a href="#STI_INTERRUPTED_ON_CURRENTTHREAD">STI: Unnee
ded use of currentThread() call, to call interrupted() </a></td><td>Correctness<
/td></tr> | 284 <tr bgcolor="#eeeeee"><td><a href="#SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_T
HROW">SF: Dead store due to switch statement fall through to throw</a></td><td>C
orrectness</td></tr> |
276 <tr bgcolor="#ffffff"><td><a href="#STI_INTERRUPTED_ON_UNKNOWNTHREAD">STI: Stati
c Thread.interrupted() method invoked on thread instance</a></td><td>Correctness
</td></tr> | 285 <tr bgcolor="#ffffff"><td><a href="#SIC_THREADLOCAL_DEADLY_EMBRACE">SIC: Deadly
embrace of non-static inner class and thread local</a></td><td>Correctness</td><
/tr> |
277 <tr bgcolor="#eeeeee"><td><a href="#SE_METHOD_MUST_BE_PRIVATE">Se: Method must b
e private in order for serialization to work</a></td><td>Correctness</td></tr> | 286 <tr bgcolor="#eeeeee"><td><a href="#SIO_SUPERFLUOUS_INSTANCEOF">SIO: Unnecessary
type check done using instanceof operator</a></td><td>Correctness</td></tr> |
278 <tr bgcolor="#ffffff"><td><a href="#SE_READ_RESOLVE_IS_STATIC">Se: The readResol
ve method must not be declared as a static method. </a></td><td>Correctness</td
></tr> | 287 <tr bgcolor="#ffffff"><td><a href="#SQL_BAD_PREPARED_STATEMENT_ACCESS">SQL: Meth
od attempts to access a prepared statement parameter with index 0</a></td><td>Co
rrectness</td></tr> |
279 <tr bgcolor="#eeeeee"><td><a href="#TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED">T
Q: Value annotated as carrying a type qualifier used where a value that must not
carry that qualifier is required</a></td><td>Correctness</td></tr> | 288 <tr bgcolor="#eeeeee"><td><a href="#SQL_BAD_RESULTSET_ACCESS">SQL: Method attemp
ts to access a result set field with index 0</a></td><td>Correctness</td></tr> |
280 <tr bgcolor="#ffffff"><td><a href="#TQ_COMPARING_VALUES_WITH_INCOMPATIBLE_TYPE_Q
UALIFIERS">TQ: Comparing values with incompatible type qualifiers</a></td><td>Co
rrectness</td></tr> | 289 <tr bgcolor="#ffffff"><td><a href="#STI_INTERRUPTED_ON_CURRENTTHREAD">STI: Unnee
ded use of currentThread() call, to call interrupted() </a></td><td>Correctness<
/td></tr> |
281 <tr bgcolor="#eeeeee"><td><a href="#TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK">T
Q: Value that might not carry a type qualifier is always used in a way requires
that type qualifier</a></td><td>Correctness</td></tr> | 290 <tr bgcolor="#eeeeee"><td><a href="#STI_INTERRUPTED_ON_UNKNOWNTHREAD">STI: Stati
c Thread.interrupted() method invoked on thread instance</a></td><td>Correctness
</td></tr> |
282 <tr bgcolor="#ffffff"><td><a href="#TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK">TQ
: Value that might carry a type qualifier is always used in a way prohibits it f
rom having that type qualifier</a></td><td>Correctness</td></tr> | 291 <tr bgcolor="#ffffff"><td><a href="#SE_METHOD_MUST_BE_PRIVATE">Se: Method must b
e private in order for serialization to work</a></td><td>Correctness</td></tr> |
283 <tr bgcolor="#eeeeee"><td><a href="#TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED">T
Q: Value annotated as never carrying a type qualifier used where value carrying
that qualifier is required</a></td><td>Correctness</td></tr> | 292 <tr bgcolor="#eeeeee"><td><a href="#SE_READ_RESOLVE_IS_STATIC">Se: The readResol
ve method must not be declared as a static method. </a></td><td>Correctness</td
></tr> |
284 <tr bgcolor="#ffffff"><td><a href="#TQ_UNKNOWN_VALUE_USED_WHERE_ALWAYS_STRICTLY_
REQUIRED">TQ: Value without a type qualifier used where a value is required to h
ave that qualifier</a></td><td>Correctness</td></tr> | 293 <tr bgcolor="#ffffff"><td><a href="#TQ_ALWAYS_VALUE_USED_WHERE_NEVER_REQUIRED">T
Q: Value annotated as carrying a type qualifier used where a value that must not
carry that qualifier is required</a></td><td>Correctness</td></tr> |
285 <tr bgcolor="#eeeeee"><td><a href="#UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS">U
MAC: Uncallable method defined in anonymous class</a></td><td>Correctness</td></
tr> | 294 <tr bgcolor="#eeeeee"><td><a href="#TQ_COMPARING_VALUES_WITH_INCOMPATIBLE_TYPE_Q
UALIFIERS">TQ: Comparing values with incompatible type qualifiers</a></td><td>Co
rrectness</td></tr> |
286 <tr bgcolor="#ffffff"><td><a href="#UR_UNINIT_READ">UR: Uninitialized read of fi
eld in constructor</a></td><td>Correctness</td></tr> | 295 <tr bgcolor="#ffffff"><td><a href="#TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK">T
Q: Value that might not carry a type qualifier is always used in a way requires
that type qualifier</a></td><td>Correctness</td></tr> |
287 <tr bgcolor="#eeeeee"><td><a href="#UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR
">UR: Uninitialized read of field method called from constructor of superclass</
a></td><td>Correctness</td></tr> | 296 <tr bgcolor="#eeeeee"><td><a href="#TQ_MAYBE_SOURCE_VALUE_REACHES_NEVER_SINK">TQ
: Value that might carry a type qualifier is always used in a way prohibits it f
rom having that type qualifier</a></td><td>Correctness</td></tr> |
288 <tr bgcolor="#ffffff"><td><a href="#DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY">US
ELESS_STRING: Invocation of toString on an unnamed array</a></td><td>Correctness
</td></tr> | 297 <tr bgcolor="#ffffff"><td><a href="#TQ_NEVER_VALUE_USED_WHERE_ALWAYS_REQUIRED">T
Q: Value annotated as never carrying a type qualifier used where value carrying
that qualifier is required</a></td><td>Correctness</td></tr> |
289 <tr bgcolor="#eeeeee"><td><a href="#DMI_INVOKING_TOSTRING_ON_ARRAY">USELESS_STRI
NG: Invocation of toString on an array</a></td><td>Correctness</td></tr> | 298 <tr bgcolor="#eeeeee"><td><a href="#TQ_UNKNOWN_VALUE_USED_WHERE_ALWAYS_STRICTLY_
REQUIRED">TQ: Value without a type qualifier used where a value is required to h
ave that qualifier</a></td><td>Correctness</td></tr> |
290 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY">
USELESS_STRING: Array formatted in useless way using format string</a></td><td>C
orrectness</td></tr> | 299 <tr bgcolor="#ffffff"><td><a href="#UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS">U
MAC: Uncallable method defined in anonymous class</a></td><td>Correctness</td></
tr> |
291 <tr bgcolor="#eeeeee"><td><a href="#UWF_NULL_FIELD">UwF: Field only ever set to
null</a></td><td>Correctness</td></tr> | 300 <tr bgcolor="#eeeeee"><td><a href="#UR_UNINIT_READ">UR: Uninitialized read of fi
eld in constructor</a></td><td>Correctness</td></tr> |
292 <tr bgcolor="#ffffff"><td><a href="#UWF_UNWRITTEN_FIELD">UwF: Unwritten field</a
></td><td>Correctness</td></tr> | 301 <tr bgcolor="#ffffff"><td><a href="#UR_UNINIT_READ_CALLED_FROM_SUPER_CONSTRUCTOR
">UR: Uninitialized read of field method called from constructor of superclass</
a></td><td>Correctness</td></tr> |
293 <tr bgcolor="#eeeeee"><td><a href="#VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG">
VA: Primitive array passed to function expecting a variable number of object arg
uments</a></td><td>Correctness</td></tr> | 302 <tr bgcolor="#eeeeee"><td><a href="#DMI_INVOKING_TOSTRING_ON_ANONYMOUS_ARRAY">US
ELESS_STRING: Invocation of toString on an unnamed array</a></td><td>Correctness
</td></tr> |
294 <tr bgcolor="#ffffff"><td><a href="#VR_UNRESOLVABLE_REFERENCE">VR: Class makes r
eference to unresolvable class or method</a></td><td>Correctness</td></tr> | 303 <tr bgcolor="#ffffff"><td><a href="#DMI_INVOKING_TOSTRING_ON_ARRAY">USELESS_STRI
NG: Invocation of toString on an array</a></td><td>Correctness</td></tr> |
295 <tr bgcolor="#eeeeee"><td><a href="#LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE">LG: Po
tential lost logger changes due to weak reference in OpenJDK</a></td><td>Experim
ental</td></tr> | 304 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_BAD_CONVERSION_FROM_ARRAY">
USELESS_STRING: Array formatted in useless way using format string</a></td><td>C
orrectness</td></tr> |
296 <tr bgcolor="#ffffff"><td><a href="#OBL_UNSATISFIED_OBLIGATION">OBL: Method may
fail to clean up stream or resource</a></td><td>Experimental</td></tr> | 305 <tr bgcolor="#ffffff"><td><a href="#UWF_NULL_FIELD">UwF: Field only ever set to
null</a></td><td>Correctness</td></tr> |
297 <tr bgcolor="#eeeeee"><td><a href="#OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE">O
BL: Method may fail to clean up stream or resource on checked exception</a></td>
<td>Experimental</td></tr> | 306 <tr bgcolor="#eeeeee"><td><a href="#UWF_UNWRITTEN_FIELD">UwF: Unwritten field</a
></td><td>Correctness</td></tr> |
298 <tr bgcolor="#ffffff"><td><a href="#TESTING">TEST: Testing</a></td><td>Experimen
tal</td></tr> | 307 <tr bgcolor="#ffffff"><td><a href="#VA_PRIMITIVE_ARRAY_PASSED_TO_OBJECT_VARARG">
VA: Primitive array passed to function expecting a variable number of object arg
uments</a></td><td>Correctness</td></tr> |
299 <tr bgcolor="#eeeeee"><td><a href="#DM_CONVERT_CASE">Dm: Consider using Locale p
arameterized version of invoked method</a></td><td>Internationalization</td></tr
> | 308 <tr bgcolor="#eeeeee"><td><a href="#VR_UNRESOLVABLE_REFERENCE">VR: Class makes r
eference to unresolvable class or method</a></td><td>Correctness</td></tr> |
300 <tr bgcolor="#ffffff"><td><a href="#DM_DEFAULT_ENCODING">Dm: Reliance on default
encoding</a></td><td>Internationalization</td></tr> | 309 <tr bgcolor="#ffffff"><td><a href="#LG_LOST_LOGGER_DUE_TO_WEAK_REFERENCE">LG: Po
tential lost logger changes due to weak reference in OpenJDK</a></td><td>Experim
ental</td></tr> |
301 <tr bgcolor="#eeeeee"><td><a href="#DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED">
DP: Classloaders should only be created inside doPrivileged block</a></td><td>Ma
licious code vulnerability</td></tr> | 310 <tr bgcolor="#eeeeee"><td><a href="#OBL_UNSATISFIED_OBLIGATION">OBL: Method may
fail to clean up stream or resource</a></td><td>Experimental</td></tr> |
302 <tr bgcolor="#ffffff"><td><a href="#DP_DO_INSIDE_DO_PRIVILEGED">DP: Method invok
ed that should be only be invoked inside a doPrivileged block</a></td><td>Malici
ous code vulnerability</td></tr> | 311 <tr bgcolor="#ffffff"><td><a href="#OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE">O
BL: Method may fail to clean up stream or resource on checked exception</a></td>
<td>Experimental</td></tr> |
303 <tr bgcolor="#eeeeee"><td><a href="#EI_EXPOSE_REP">EI: May expose internal repre
sentation by returning reference to mutable object</a></td><td>Malicious code vu
lnerability</td></tr> | 312 <tr bgcolor="#eeeeee"><td><a href="#TESTING">TEST: Testing</a></td><td>Experimen
tal</td></tr> |
304 <tr bgcolor="#ffffff"><td><a href="#EI_EXPOSE_REP2">EI2: May expose internal rep
resentation by incorporating reference to mutable object</a></td><td>Malicious c
ode vulnerability</td></tr> | 313 <tr bgcolor="#ffffff"><td><a href="#DM_CONVERT_CASE">Dm: Consider using Locale p
arameterized version of invoked method</a></td><td>Internationalization</td></tr
> |
305 <tr bgcolor="#eeeeee"><td><a href="#FI_PUBLIC_SHOULD_BE_PROTECTED">FI: Finalizer
should be protected, not public</a></td><td>Malicious code vulnerability</td></
tr> | 314 <tr bgcolor="#eeeeee"><td><a href="#DM_DEFAULT_ENCODING">Dm: Reliance on default
encoding</a></td><td>Internationalization</td></tr> |
306 <tr bgcolor="#ffffff"><td><a href="#EI_EXPOSE_STATIC_REP2">MS: May expose intern
al static state by storing a mutable object into a static field</a></td><td>Mali
cious code vulnerability</td></tr> | 315 <tr bgcolor="#ffffff"><td><a href="#DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED">
DP: Classloaders should only be created inside doPrivileged block</a></td><td>Ma
licious code vulnerability</td></tr> |
307 <tr bgcolor="#eeeeee"><td><a href="#MS_CANNOT_BE_FINAL">MS: Field isn't final an
d can't be protected from malicious code</a></td><td>Malicious code vulnerabilit
y</td></tr> | 316 <tr bgcolor="#eeeeee"><td><a href="#DP_DO_INSIDE_DO_PRIVILEGED">DP: Method invok
ed that should be only be invoked inside a doPrivileged block</a></td><td>Malici
ous code vulnerability</td></tr> |
308 <tr bgcolor="#ffffff"><td><a href="#MS_EXPOSE_REP">MS: Public static method may
expose internal representation by returning array</a></td><td>Malicious code vul
nerability</td></tr> | 317 <tr bgcolor="#ffffff"><td><a href="#EI_EXPOSE_REP">EI: May expose internal repre
sentation by returning reference to mutable object</a></td><td>Malicious code vu
lnerability</td></tr> |
309 <tr bgcolor="#eeeeee"><td><a href="#MS_FINAL_PKGPROTECT">MS: Field should be bot
h final and package protected</a></td><td>Malicious code vulnerability</td></tr> | 318 <tr bgcolor="#eeeeee"><td><a href="#EI_EXPOSE_REP2">EI2: May expose internal rep
resentation by incorporating reference to mutable object</a></td><td>Malicious c
ode vulnerability</td></tr> |
310 <tr bgcolor="#ffffff"><td><a href="#MS_MUTABLE_ARRAY">MS: Field is a mutable arr
ay</a></td><td>Malicious code vulnerability</td></tr> | 319 <tr bgcolor="#ffffff"><td><a href="#FI_PUBLIC_SHOULD_BE_PROTECTED">FI: Finalizer
should be protected, not public</a></td><td>Malicious code vulnerability</td></
tr> |
311 <tr bgcolor="#eeeeee"><td><a href="#MS_MUTABLE_HASHTABLE">MS: Field is a mutable
Hashtable</a></td><td>Malicious code vulnerability</td></tr> | 320 <tr bgcolor="#eeeeee"><td><a href="#EI_EXPOSE_STATIC_REP2">MS: May expose intern
al static state by storing a mutable object into a static field</a></td><td>Mali
cious code vulnerability</td></tr> |
312 <tr bgcolor="#ffffff"><td><a href="#MS_OOI_PKGPROTECT">MS: Field should be moved
out of an interface and made package protected</a></td><td>Malicious code vulne
rability</td></tr> | 321 <tr bgcolor="#ffffff"><td><a href="#MS_CANNOT_BE_FINAL">MS: Field isn't final an
d can't be protected from malicious code</a></td><td>Malicious code vulnerabilit
y</td></tr> |
313 <tr bgcolor="#eeeeee"><td><a href="#MS_PKGPROTECT">MS: Field should be package p
rotected</a></td><td>Malicious code vulnerability</td></tr> | 322 <tr bgcolor="#eeeeee"><td><a href="#MS_EXPOSE_REP">MS: Public static method may
expose internal representation by returning array</a></td><td>Malicious code vul
nerability</td></tr> |
314 <tr bgcolor="#ffffff"><td><a href="#MS_SHOULD_BE_FINAL">MS: Field isn't final bu
t should be</a></td><td>Malicious code vulnerability</td></tr> | 323 <tr bgcolor="#ffffff"><td><a href="#MS_FINAL_PKGPROTECT">MS: Field should be bot
h final and package protected</a></td><td>Malicious code vulnerability</td></tr> |
315 <tr bgcolor="#eeeeee"><td><a href="#MS_SHOULD_BE_REFACTORED_TO_BE_FINAL">MS: Fie
ld isn't final but should be refactored to be so</a></td><td>Malicious code vuln
erability</td></tr> | 324 <tr bgcolor="#eeeeee"><td><a href="#MS_MUTABLE_ARRAY">MS: Field is a mutable arr
ay</a></td><td>Malicious code vulnerability</td></tr> |
316 <tr bgcolor="#ffffff"><td><a href="#AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACT
ION">AT: Sequence of calls to concurrent abstraction may not be atomic</a></td><
td>Multithreaded correctness</td></tr> | 325 <tr bgcolor="#ffffff"><td><a href="#MS_MUTABLE_COLLECTION">MS: Field is a mutabl
e collection</a></td><td>Malicious code vulnerability</td></tr> |
317 <tr bgcolor="#eeeeee"><td><a href="#DC_DOUBLECHECK">DC: Possible double check of
field</a></td><td>Multithreaded correctness</td></tr> | 326 <tr bgcolor="#eeeeee"><td><a href="#MS_MUTABLE_COLLECTION_PKGPROTECT">MS: Field
is a mutable collection which should be package protected</a></td><td>Malicious
code vulnerability</td></tr> |
| 327 <tr bgcolor="#ffffff"><td><a href="#MS_MUTABLE_HASHTABLE">MS: Field is a mutable
Hashtable</a></td><td>Malicious code vulnerability</td></tr> |
| 328 <tr bgcolor="#eeeeee"><td><a href="#MS_OOI_PKGPROTECT">MS: Field should be moved
out of an interface and made package protected</a></td><td>Malicious code vulne
rability</td></tr> |
| 329 <tr bgcolor="#ffffff"><td><a href="#MS_PKGPROTECT">MS: Field should be package p
rotected</a></td><td>Malicious code vulnerability</td></tr> |
| 330 <tr bgcolor="#eeeeee"><td><a href="#MS_SHOULD_BE_FINAL">MS: Field isn't final bu
t should be</a></td><td>Malicious code vulnerability</td></tr> |
| 331 <tr bgcolor="#ffffff"><td><a href="#MS_SHOULD_BE_REFACTORED_TO_BE_FINAL">MS: Fie
ld isn't final but should be refactored to be so</a></td><td>Malicious code vuln
erability</td></tr> |
| 332 <tr bgcolor="#eeeeee"><td><a href="#AT_OPERATION_SEQUENCE_ON_CONCURRENT_ABSTRACT
ION">AT: Sequence of calls to concurrent abstraction may not be atomic</a></td><
td>Multithreaded correctness</td></tr> |
| 333 <tr bgcolor="#ffffff"><td><a href="#DC_DOUBLECHECK">DC: Possible double check of
field</a></td><td>Multithreaded correctness</td></tr> |
| 334 <tr bgcolor="#eeeeee"><td><a href="#DC_PARTIALLY_CONSTRUCTED">DC: Possible expos
ure of partially initialized object</a></td><td>Multithreaded correctness</td></
tr> |
318 <tr bgcolor="#ffffff"><td><a href="#DL_SYNCHRONIZATION_ON_BOOLEAN">DL: Synchroni
zation on Boolean</a></td><td>Multithreaded correctness</td></tr> | 335 <tr bgcolor="#ffffff"><td><a href="#DL_SYNCHRONIZATION_ON_BOOLEAN">DL: Synchroni
zation on Boolean</a></td><td>Multithreaded correctness</td></tr> |
319 <tr bgcolor="#eeeeee"><td><a href="#DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE">DL: S
ynchronization on boxed primitive</a></td><td>Multithreaded correctness</td></tr
> | 336 <tr bgcolor="#eeeeee"><td><a href="#DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE">DL: S
ynchronization on boxed primitive</a></td><td>Multithreaded correctness</td></tr
> |
320 <tr bgcolor="#ffffff"><td><a href="#DL_SYNCHRONIZATION_ON_SHARED_CONSTANT">DL: S
ynchronization on interned String </a></td><td>Multithreaded correctness</td></t
r> | 337 <tr bgcolor="#ffffff"><td><a href="#DL_SYNCHRONIZATION_ON_SHARED_CONSTANT">DL: S
ynchronization on interned String </a></td><td>Multithreaded correctness</td></t
r> |
321 <tr bgcolor="#eeeeee"><td><a href="#DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITI
VE">DL: Synchronization on boxed primitive values</a></td><td>Multithreaded corr
ectness</td></tr> | 338 <tr bgcolor="#eeeeee"><td><a href="#DL_SYNCHRONIZATION_ON_UNSHARED_BOXED_PRIMITI
VE">DL: Synchronization on boxed primitive values</a></td><td>Multithreaded corr
ectness</td></tr> |
322 <tr bgcolor="#ffffff"><td><a href="#DM_MONITOR_WAIT_ON_CONDITION">Dm: Monitor wa
it() called on Condition</a></td><td>Multithreaded correctness</td></tr> | 339 <tr bgcolor="#ffffff"><td><a href="#DM_MONITOR_WAIT_ON_CONDITION">Dm: Monitor wa
it() called on Condition</a></td><td>Multithreaded correctness</td></tr> |
323 <tr bgcolor="#eeeeee"><td><a href="#DM_USELESS_THREAD">Dm: A thread was created
using the default empty run method</a></td><td>Multithreaded correctness</td></t
r> | 340 <tr bgcolor="#eeeeee"><td><a href="#DM_USELESS_THREAD">Dm: A thread was created
using the default empty run method</a></td><td>Multithreaded correctness</td></t
r> |
324 <tr bgcolor="#ffffff"><td><a href="#ESync_EMPTY_SYNC">ESync: Empty synchronized
block</a></td><td>Multithreaded correctness</td></tr> | 341 <tr bgcolor="#ffffff"><td><a href="#ESync_EMPTY_SYNC">ESync: Empty synchronized
block</a></td><td>Multithreaded correctness</td></tr> |
325 <tr bgcolor="#eeeeee"><td><a href="#IS2_INCONSISTENT_SYNC">IS: Inconsistent sync
hronization</a></td><td>Multithreaded correctness</td></tr> | 342 <tr bgcolor="#eeeeee"><td><a href="#IS2_INCONSISTENT_SYNC">IS: Inconsistent sync
hronization</a></td><td>Multithreaded correctness</td></tr> |
326 <tr bgcolor="#ffffff"><td><a href="#IS_FIELD_NOT_GUARDED">IS: Field not guarded
against concurrent access</a></td><td>Multithreaded correctness</td></tr> | 343 <tr bgcolor="#ffffff"><td><a href="#IS_FIELD_NOT_GUARDED">IS: Field not guarded
against concurrent access</a></td><td>Multithreaded correctness</td></tr> |
327 <tr bgcolor="#eeeeee"><td><a href="#JLM_JSR166_LOCK_MONITORENTER">JLM: Synchroni
zation performed on Lock</a></td><td>Multithreaded correctness</td></tr> | 344 <tr bgcolor="#eeeeee"><td><a href="#JLM_JSR166_LOCK_MONITORENTER">JLM: Synchroni
zation performed on Lock</a></td><td>Multithreaded correctness</td></tr> |
(...skipping 29 matching lines...) Expand all Loading... |
357 <tr bgcolor="#eeeeee"><td><a href="#WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL"
>WL: Synchronization on getClass rather than class literal</a></td><td>Multithre
aded correctness</td></tr> | 374 <tr bgcolor="#eeeeee"><td><a href="#WL_USING_GETCLASS_RATHER_THAN_CLASS_LITERAL"
>WL: Synchronization on getClass rather than class literal</a></td><td>Multithre
aded correctness</td></tr> |
358 <tr bgcolor="#ffffff"><td><a href="#WS_WRITEOBJECT_SYNC">WS: Class's writeObject
() method is synchronized but nothing else is</a></td><td>Multithreaded correctn
ess</td></tr> | 375 <tr bgcolor="#ffffff"><td><a href="#WS_WRITEOBJECT_SYNC">WS: Class's writeObject
() method is synchronized but nothing else is</a></td><td>Multithreaded correctn
ess</td></tr> |
359 <tr bgcolor="#eeeeee"><td><a href="#WA_AWAIT_NOT_IN_LOOP">Wa: Condition.await()
not in loop </a></td><td>Multithreaded correctness</td></tr> | 376 <tr bgcolor="#eeeeee"><td><a href="#WA_AWAIT_NOT_IN_LOOP">Wa: Condition.await()
not in loop </a></td><td>Multithreaded correctness</td></tr> |
360 <tr bgcolor="#ffffff"><td><a href="#WA_NOT_IN_LOOP">Wa: Wait not in loop </a></t
d><td>Multithreaded correctness</td></tr> | 377 <tr bgcolor="#ffffff"><td><a href="#WA_NOT_IN_LOOP">Wa: Wait not in loop </a></t
d><td>Multithreaded correctness</td></tr> |
361 <tr bgcolor="#eeeeee"><td><a href="#NOISE_FIELD_REFERENCE">NOISE: Bogus warning
about a field reference</a></td><td>Bogus random noise</td></tr> | 378 <tr bgcolor="#eeeeee"><td><a href="#NOISE_FIELD_REFERENCE">NOISE: Bogus warning
about a field reference</a></td><td>Bogus random noise</td></tr> |
362 <tr bgcolor="#ffffff"><td><a href="#NOISE_METHOD_CALL">NOISE: Bogus warning abou
t a method call</a></td><td>Bogus random noise</td></tr> | 379 <tr bgcolor="#ffffff"><td><a href="#NOISE_METHOD_CALL">NOISE: Bogus warning abou
t a method call</a></td><td>Bogus random noise</td></tr> |
363 <tr bgcolor="#eeeeee"><td><a href="#NOISE_NULL_DEREFERENCE">NOISE: Bogus warning
about a null pointer dereference</a></td><td>Bogus random noise</td></tr> | 380 <tr bgcolor="#eeeeee"><td><a href="#NOISE_NULL_DEREFERENCE">NOISE: Bogus warning
about a null pointer dereference</a></td><td>Bogus random noise</td></tr> |
364 <tr bgcolor="#ffffff"><td><a href="#NOISE_OPERATION">NOISE: Bogus warning about
an operation</a></td><td>Bogus random noise</td></tr> | 381 <tr bgcolor="#ffffff"><td><a href="#NOISE_OPERATION">NOISE: Bogus warning about
an operation</a></td><td>Bogus random noise</td></tr> |
365 <tr bgcolor="#eeeeee"><td><a href="#BX_BOXING_IMMEDIATELY_UNBOXED">Bx: Primitive
value is boxed and then immediately unboxed</a></td><td>Performance</td></tr> | 382 <tr bgcolor="#eeeeee"><td><a href="#BX_BOXING_IMMEDIATELY_UNBOXED">Bx: Primitive
value is boxed and then immediately unboxed</a></td><td>Performance</td></tr> |
366 <tr bgcolor="#ffffff"><td><a href="#BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COE
RCION">Bx: Primitive value is boxed then unboxed to perform primitive coercion</
a></td><td>Performance</td></tr> | 383 <tr bgcolor="#ffffff"><td><a href="#BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COE
RCION">Bx: Primitive value is boxed then unboxed to perform primitive coercion</
a></td><td>Performance</td></tr> |
367 <tr bgcolor="#eeeeee"><td><a href="#BX_UNBOXING_IMMEDIATELY_REBOXED">Bx: Boxed v
alue is unboxed and then immediately reboxed</a></td><td>Performance</td></tr> | 384 <tr bgcolor="#eeeeee"><td><a href="#BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR"
>Bx: Primitive value is unboxed and coerced for ternary operator</a></td><td>Per
formance</td></tr> |
| 385 <tr bgcolor="#ffffff"><td><a href="#BX_UNBOXING_IMMEDIATELY_REBOXED">Bx: Boxed v
alue is unboxed and then immediately reboxed</a></td><td>Performance</td></tr> |
| 386 <tr bgcolor="#eeeeee"><td><a href="#DM_BOXED_PRIMITIVE_FOR_COMPARE">Bx: Boxing a
primitive to compare</a></td><td>Performance</td></tr> |
368 <tr bgcolor="#ffffff"><td><a href="#DM_BOXED_PRIMITIVE_FOR_PARSING">Bx: Boxing/u
nboxing to parse a primitive</a></td><td>Performance</td></tr> | 387 <tr bgcolor="#ffffff"><td><a href="#DM_BOXED_PRIMITIVE_FOR_PARSING">Bx: Boxing/u
nboxing to parse a primitive</a></td><td>Performance</td></tr> |
369 <tr bgcolor="#eeeeee"><td><a href="#DM_BOXED_PRIMITIVE_TOSTRING">Bx: Method allo
cates a boxed primitive just to call toString</a></td><td>Performance</td></tr> | 388 <tr bgcolor="#eeeeee"><td><a href="#DM_BOXED_PRIMITIVE_TOSTRING">Bx: Method allo
cates a boxed primitive just to call toString</a></td><td>Performance</td></tr> |
370 <tr bgcolor="#ffffff"><td><a href="#DM_FP_NUMBER_CTOR">Bx: Method invokes ineffi
cient floating-point Number constructor; use static valueOf instead</a></td><td>
Performance</td></tr> | 389 <tr bgcolor="#ffffff"><td><a href="#DM_FP_NUMBER_CTOR">Bx: Method invokes ineffi
cient floating-point Number constructor; use static valueOf instead</a></td><td>
Performance</td></tr> |
371 <tr bgcolor="#eeeeee"><td><a href="#DM_NUMBER_CTOR">Bx: Method invokes inefficie
nt Number constructor; use static valueOf instead</a></td><td>Performance</td></
tr> | 390 <tr bgcolor="#eeeeee"><td><a href="#DM_NUMBER_CTOR">Bx: Method invokes inefficie
nt Number constructor; use static valueOf instead</a></td><td>Performance</td></
tr> |
372 <tr bgcolor="#ffffff"><td><a href="#DMI_BLOCKING_METHODS_ON_URL">Dm: The equals
and hashCode methods of URL are blocking</a></td><td>Performance</td></tr> | 391 <tr bgcolor="#ffffff"><td><a href="#DMI_BLOCKING_METHODS_ON_URL">Dm: The equals
and hashCode methods of URL are blocking</a></td><td>Performance</td></tr> |
373 <tr bgcolor="#eeeeee"><td><a href="#DMI_COLLECTION_OF_URLS">Dm: Maps and sets of
URLs can be performance hogs</a></td><td>Performance</td></tr> | 392 <tr bgcolor="#eeeeee"><td><a href="#DMI_COLLECTION_OF_URLS">Dm: Maps and sets of
URLs can be performance hogs</a></td><td>Performance</td></tr> |
374 <tr bgcolor="#ffffff"><td><a href="#DM_BOOLEAN_CTOR">Dm: Method invokes ineffici
ent Boolean constructor; use Boolean.valueOf(...) instead</a></td><td>Performanc
e</td></tr> | 393 <tr bgcolor="#ffffff"><td><a href="#DM_BOOLEAN_CTOR">Dm: Method invokes ineffici
ent Boolean constructor; use Boolean.valueOf(...) instead</a></td><td>Performanc
e</td></tr> |
375 <tr bgcolor="#eeeeee"><td><a href="#DM_GC">Dm: Explicit garbage collection; extr
emely dubious except in benchmarking code</a></td><td>Performance</td></tr> | 394 <tr bgcolor="#eeeeee"><td><a href="#DM_GC">Dm: Explicit garbage collection; extr
emely dubious except in benchmarking code</a></td><td>Performance</td></tr> |
376 <tr bgcolor="#ffffff"><td><a href="#DM_NEW_FOR_GETCLASS">Dm: Method allocates an
object, only to get the class object</a></td><td>Performance</td></tr> | 395 <tr bgcolor="#ffffff"><td><a href="#DM_NEW_FOR_GETCLASS">Dm: Method allocates an
object, only to get the class object</a></td><td>Performance</td></tr> |
377 <tr bgcolor="#eeeeee"><td><a href="#DM_NEXTINT_VIA_NEXTDOUBLE">Dm: Use the nextI
nt method of Random rather than nextDouble to generate a random integer</a></td>
<td>Performance</td></tr> | 396 <tr bgcolor="#eeeeee"><td><a href="#DM_NEXTINT_VIA_NEXTDOUBLE">Dm: Use the nextI
nt method of Random rather than nextDouble to generate a random integer</a></td>
<td>Performance</td></tr> |
378 <tr bgcolor="#ffffff"><td><a href="#DM_STRING_CTOR">Dm: Method invokes inefficie
nt new String(String) constructor</a></td><td>Performance</td></tr> | 397 <tr bgcolor="#ffffff"><td><a href="#DM_STRING_CTOR">Dm: Method invokes inefficie
nt new String(String) constructor</a></td><td>Performance</td></tr> |
379 <tr bgcolor="#eeeeee"><td><a href="#DM_STRING_TOSTRING">Dm: Method invokes toStr
ing() method on a String</a></td><td>Performance</td></tr> | 398 <tr bgcolor="#eeeeee"><td><a href="#DM_STRING_TOSTRING">Dm: Method invokes toStr
ing() method on a String</a></td><td>Performance</td></tr> |
380 <tr bgcolor="#ffffff"><td><a href="#DM_STRING_VOID_CTOR">Dm: Method invokes inef
ficient new String() constructor</a></td><td>Performance</td></tr> | 399 <tr bgcolor="#ffffff"><td><a href="#DM_STRING_VOID_CTOR">Dm: Method invokes inef
ficient new String() constructor</a></td><td>Performance</td></tr> |
381 <tr bgcolor="#eeeeee"><td><a href="#HSC_HUGE_SHARED_STRING_CONSTANT">HSC: Huge s
tring constants is duplicated across multiple class files</a></td><td>Performanc
e</td></tr> | 400 <tr bgcolor="#eeeeee"><td><a href="#HSC_HUGE_SHARED_STRING_CONSTANT">HSC: Huge s
tring constants is duplicated across multiple class files</a></td><td>Performanc
e</td></tr> |
| 401 <tr bgcolor="#ffffff"><td><a href="#IIL_ELEMENTS_GET_LENGTH_IN_LOOP">IIL: NodeLi
st.getLength() called in a loop</a></td><td>Performance</td></tr> |
| 402 <tr bgcolor="#eeeeee"><td><a href="#IIL_PATTERN_COMPILE_IN_LOOP">IIL: Method cal
ls Pattern.compile in a loop</a></td><td>Performance</td></tr> |
| 403 <tr bgcolor="#ffffff"><td><a href="#IIL_PATTERN_COMPILE_IN_LOOP_INDIRECT">IIL: M
ethod compiles the regular expression in a loop</a></td><td>Performance</td></tr
> |
| 404 <tr bgcolor="#eeeeee"><td><a href="#IIL_PREPARE_STATEMENT_IN_LOOP">IIL: Method c
alls prepareStatement in a loop</a></td><td>Performance</td></tr> |
| 405 <tr bgcolor="#ffffff"><td><a href="#IIO_INEFFICIENT_INDEX_OF">IIO: Inefficient u
se of String.indexOf(String)</a></td><td>Performance</td></tr> |
| 406 <tr bgcolor="#eeeeee"><td><a href="#IIO_INEFFICIENT_LAST_INDEX_OF">IIO: Ineffici
ent use of String.lastIndexOf(String)</a></td><td>Performance</td></tr> |
382 <tr bgcolor="#ffffff"><td><a href="#IMA_INEFFICIENT_MEMBER_ACCESS">IMA: Method a
ccesses a private member variable of owning class</a></td><td>Performance</td></
tr> | 407 <tr bgcolor="#ffffff"><td><a href="#IMA_INEFFICIENT_MEMBER_ACCESS">IMA: Method a
ccesses a private member variable of owning class</a></td><td>Performance</td></
tr> |
383 <tr bgcolor="#eeeeee"><td><a href="#ITA_INEFFICIENT_TO_ARRAY">ITA: Method uses t
oArray() with zero-length array argument</a></td><td>Performance</td></tr> | 408 <tr bgcolor="#eeeeee"><td><a href="#ITA_INEFFICIENT_TO_ARRAY">ITA: Method uses t
oArray() with zero-length array argument</a></td><td>Performance</td></tr> |
384 <tr bgcolor="#ffffff"><td><a href="#SBSC_USE_STRINGBUFFER_CONCATENATION">SBSC: M
ethod concatenates strings using + in a loop</a></td><td>Performance</td></tr> | 409 <tr bgcolor="#ffffff"><td><a href="#SBSC_USE_STRINGBUFFER_CONCATENATION">SBSC: M
ethod concatenates strings using + in a loop</a></td><td>Performance</td></tr> |
385 <tr bgcolor="#eeeeee"><td><a href="#SIC_INNER_SHOULD_BE_STATIC">SIC: Should be a
static inner class</a></td><td>Performance</td></tr> | 410 <tr bgcolor="#eeeeee"><td><a href="#SIC_INNER_SHOULD_BE_STATIC">SIC: Should be a
static inner class</a></td><td>Performance</td></tr> |
386 <tr bgcolor="#ffffff"><td><a href="#SIC_INNER_SHOULD_BE_STATIC_ANON">SIC: Could
be refactored into a named static inner class</a></td><td>Performance</td></tr> | 411 <tr bgcolor="#ffffff"><td><a href="#SIC_INNER_SHOULD_BE_STATIC_ANON">SIC: Could
be refactored into a named static inner class</a></td><td>Performance</td></tr> |
387 <tr bgcolor="#eeeeee"><td><a href="#SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS">SIC:
Could be refactored into a static inner class</a></td><td>Performance</td></tr> | 412 <tr bgcolor="#eeeeee"><td><a href="#SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS">SIC:
Could be refactored into a static inner class</a></td><td>Performance</td></tr> |
388 <tr bgcolor="#ffffff"><td><a href="#SS_SHOULD_BE_STATIC">SS: Unread field: shoul
d this field be static?</a></td><td>Performance</td></tr> | 413 <tr bgcolor="#ffffff"><td><a href="#SS_SHOULD_BE_STATIC">SS: Unread field: shoul
d this field be static?</a></td><td>Performance</td></tr> |
389 <tr bgcolor="#eeeeee"><td><a href="#UM_UNNECESSARY_MATH">UM: Method calls static
Math class method on a constant value</a></td><td>Performance</td></tr> | 414 <tr bgcolor="#eeeeee"><td><a href="#UM_UNNECESSARY_MATH">UM: Method calls static
Math class method on a constant value</a></td><td>Performance</td></tr> |
390 <tr bgcolor="#ffffff"><td><a href="#UPM_UNCALLED_PRIVATE_METHOD">UPM: Private me
thod is never called</a></td><td>Performance</td></tr> | 415 <tr bgcolor="#ffffff"><td><a href="#UPM_UNCALLED_PRIVATE_METHOD">UPM: Private me
thod is never called</a></td><td>Performance</td></tr> |
391 <tr bgcolor="#eeeeee"><td><a href="#URF_UNREAD_FIELD">UrF: Unread field</a></td>
<td>Performance</td></tr> | 416 <tr bgcolor="#eeeeee"><td><a href="#URF_UNREAD_FIELD">UrF: Unread field</a></td>
<td>Performance</td></tr> |
392 <tr bgcolor="#ffffff"><td><a href="#UUF_UNUSED_FIELD">UuF: Unused field</a></td>
<td>Performance</td></tr> | 417 <tr bgcolor="#ffffff"><td><a href="#UUF_UNUSED_FIELD">UuF: Unused field</a></td>
<td>Performance</td></tr> |
393 <tr bgcolor="#eeeeee"><td><a href="#WMI_WRONG_MAP_ITERATOR">WMI: Inefficient use
of keySet iterator instead of entrySet iterator</a></td><td>Performance</td></t
r> | 418 <tr bgcolor="#eeeeee"><td><a href="#WMI_WRONG_MAP_ITERATOR">WMI: Inefficient use
of keySet iterator instead of entrySet iterator</a></td><td>Performance</td></t
r> |
394 <tr bgcolor="#ffffff"><td><a href="#DMI_CONSTANT_DB_PASSWORD">Dm: Hardcoded cons
tant database password</a></td><td>Security</td></tr> | 419 <tr bgcolor="#ffffff"><td><a href="#DMI_CONSTANT_DB_PASSWORD">Dm: Hardcoded cons
tant database password</a></td><td>Security</td></tr> |
395 <tr bgcolor="#eeeeee"><td><a href="#DMI_EMPTY_DB_PASSWORD">Dm: Empty database pa
ssword</a></td><td>Security</td></tr> | 420 <tr bgcolor="#eeeeee"><td><a href="#DMI_EMPTY_DB_PASSWORD">Dm: Empty database pa
ssword</a></td><td>Security</td></tr> |
396 <tr bgcolor="#ffffff"><td><a href="#HRS_REQUEST_PARAMETER_TO_COOKIE">HRS: HTTP c
ookie formed from untrusted input</a></td><td>Security</td></tr> | 421 <tr bgcolor="#ffffff"><td><a href="#HRS_REQUEST_PARAMETER_TO_COOKIE">HRS: HTTP c
ookie formed from untrusted input</a></td><td>Security</td></tr> |
397 <tr bgcolor="#eeeeee"><td><a href="#HRS_REQUEST_PARAMETER_TO_HTTP_HEADER">HRS: H
TTP Response splitting vulnerability</a></td><td>Security</td></tr> | 422 <tr bgcolor="#eeeeee"><td><a href="#HRS_REQUEST_PARAMETER_TO_HTTP_HEADER">HRS: H
TTP Response splitting vulnerability</a></td><td>Security</td></tr> |
398 <tr bgcolor="#ffffff"><td><a href="#PT_ABSOLUTE_PATH_TRAVERSAL">PT: Absolute pat
h traversal in servlet</a></td><td>Security</td></tr> | 423 <tr bgcolor="#ffffff"><td><a href="#PT_ABSOLUTE_PATH_TRAVERSAL">PT: Absolute pat
h traversal in servlet</a></td><td>Security</td></tr> |
399 <tr bgcolor="#eeeeee"><td><a href="#PT_RELATIVE_PATH_TRAVERSAL">PT: Relative pat
h traversal in servlet</a></td><td>Security</td></tr> | 424 <tr bgcolor="#eeeeee"><td><a href="#PT_RELATIVE_PATH_TRAVERSAL">PT: Relative pat
h traversal in servlet</a></td><td>Security</td></tr> |
400 <tr bgcolor="#ffffff"><td><a href="#SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE">SQ
L: Nonconstant string passed to execute method on an SQL statement</a></td><td>S
ecurity</td></tr> | 425 <tr bgcolor="#ffffff"><td><a href="#SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE">SQ
L: Nonconstant string passed to execute or addBatch method on an SQL statement</
a></td><td>Security</td></tr> |
401 <tr bgcolor="#eeeeee"><td><a href="#SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCON
STANT_STRING">SQL: A prepared statement is generated from a nonconstant String</
a></td><td>Security</td></tr> | 426 <tr bgcolor="#eeeeee"><td><a href="#SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCON
STANT_STRING">SQL: A prepared statement is generated from a nonconstant String</
a></td><td>Security</td></tr> |
402 <tr bgcolor="#ffffff"><td><a href="#XSS_REQUEST_PARAMETER_TO_JSP_WRITER">XSS: JS
P reflected cross site scripting vulnerability</a></td><td>Security</td></tr> | 427 <tr bgcolor="#ffffff"><td><a href="#XSS_REQUEST_PARAMETER_TO_JSP_WRITER">XSS: JS
P reflected cross site scripting vulnerability</a></td><td>Security</td></tr> |
403 <tr bgcolor="#eeeeee"><td><a href="#XSS_REQUEST_PARAMETER_TO_SEND_ERROR">XSS: Se
rvlet reflected cross site scripting vulnerability in error page</a></td><td>Sec
urity</td></tr> | 428 <tr bgcolor="#eeeeee"><td><a href="#XSS_REQUEST_PARAMETER_TO_SEND_ERROR">XSS: Se
rvlet reflected cross site scripting vulnerability in error page</a></td><td>Sec
urity</td></tr> |
404 <tr bgcolor="#ffffff"><td><a href="#XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER">XSS
: Servlet reflected cross site scripting vulnerability</a></td><td>Security</td>
</tr> | 429 <tr bgcolor="#ffffff"><td><a href="#XSS_REQUEST_PARAMETER_TO_SERVLET_WRITER">XSS
: Servlet reflected cross site scripting vulnerability</a></td><td>Security</td>
</tr> |
405 <tr bgcolor="#eeeeee"><td><a href="#BC_BAD_CAST_TO_ABSTRACT_COLLECTION">BC: Ques
tionable cast to abstract collection </a></td><td>Dodgy code</td></tr> | 430 <tr bgcolor="#eeeeee"><td><a href="#BC_BAD_CAST_TO_ABSTRACT_COLLECTION">BC: Ques
tionable cast to abstract collection </a></td><td>Dodgy code</td></tr> |
406 <tr bgcolor="#ffffff"><td><a href="#BC_BAD_CAST_TO_CONCRETE_COLLECTION">BC: Ques
tionable cast to concrete collection</a></td><td>Dodgy code</td></tr> | 431 <tr bgcolor="#ffffff"><td><a href="#BC_BAD_CAST_TO_CONCRETE_COLLECTION">BC: Ques
tionable cast to concrete collection</a></td><td>Dodgy code</td></tr> |
407 <tr bgcolor="#eeeeee"><td><a href="#BC_UNCONFIRMED_CAST">BC: Unchecked/unconfirm
ed cast</a></td><td>Dodgy code</td></tr> | 432 <tr bgcolor="#eeeeee"><td><a href="#BC_UNCONFIRMED_CAST">BC: Unchecked/unconfirm
ed cast</a></td><td>Dodgy code</td></tr> |
408 <tr bgcolor="#ffffff"><td><a href="#BC_UNCONFIRMED_CAST_OF_RETURN_VALUE">BC: Unc
hecked/unconfirmed cast of return value from method</a></td><td>Dodgy code</td><
/tr> | 433 <tr bgcolor="#ffffff"><td><a href="#BC_UNCONFIRMED_CAST_OF_RETURN_VALUE">BC: Unc
hecked/unconfirmed cast of return value from method</a></td><td>Dodgy code</td><
/tr> |
409 <tr bgcolor="#eeeeee"><td><a href="#BC_VACUOUS_INSTANCEOF">BC: instanceof will a
lways return true</a></td><td>Dodgy code</td></tr> | 434 <tr bgcolor="#eeeeee"><td><a href="#BC_VACUOUS_INSTANCEOF">BC: instanceof will a
lways return true</a></td><td>Dodgy code</td></tr> |
410 <tr bgcolor="#ffffff"><td><a href="#ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT">BSH
IFT: Unsigned right shift cast to short/byte</a></td><td>Dodgy code</td></tr> | 435 <tr bgcolor="#ffffff"><td><a href="#ICAST_QUESTIONABLE_UNSIGNED_RIGHT_SHIFT">BSH
IFT: Unsigned right shift cast to short/byte</a></td><td>Dodgy code</td></tr> |
411 <tr bgcolor="#eeeeee"><td><a href="#CD_CIRCULAR_DEPENDENCY">CD: Test for circula
r dependencies among classes</a></td><td>Dodgy code</td></tr> | 436 <tr bgcolor="#eeeeee"><td><a href="#CAA_COVARIANT_ARRAY_FIELD">CAA: Covariant ar
ray assignment to a field</a></td><td>Dodgy code</td></tr> |
412 <tr bgcolor="#ffffff"><td><a href="#CI_CONFUSED_INHERITANCE">CI: Class is final
but declares protected field</a></td><td>Dodgy code</td></tr> | 437 <tr bgcolor="#ffffff"><td><a href="#CAA_COVARIANT_ARRAY_LOCAL">CAA: Covariant ar
ray assignment to a local variable</a></td><td>Dodgy code</td></tr> |
413 <tr bgcolor="#eeeeee"><td><a href="#DB_DUPLICATE_BRANCHES">DB: Method uses the s
ame code for two branches</a></td><td>Dodgy code</td></tr> | 438 <tr bgcolor="#eeeeee"><td><a href="#CAA_COVARIANT_ARRAY_RETURN">CAA: Covariant a
rray is returned from the method</a></td><td>Dodgy code</td></tr> |
414 <tr bgcolor="#ffffff"><td><a href="#DB_DUPLICATE_SWITCH_CLAUSES">DB: Method uses
the same code for two switch clauses</a></td><td>Dodgy code</td></tr> | 439 <tr bgcolor="#ffffff"><td><a href="#CD_CIRCULAR_DEPENDENCY">CD: Test for circula
r dependencies among classes</a></td><td>Dodgy code</td></tr> |
415 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_LOCAL_STORE">DLS: Dead store to loc
al variable</a></td><td>Dodgy code</td></tr> | 440 <tr bgcolor="#eeeeee"><td><a href="#CI_CONFUSED_INHERITANCE">CI: Class is final
but declares protected field</a></td><td>Dodgy code</td></tr> |
416 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_LOCAL_STORE_IN_RETURN">DLS: Useless
assignment in return statement</a></td><td>Dodgy code</td></tr> | 441 <tr bgcolor="#ffffff"><td><a href="#DB_DUPLICATE_BRANCHES">DB: Method uses the s
ame code for two branches</a></td><td>Dodgy code</td></tr> |
417 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_LOCAL_STORE_OF_NULL">DLS: Dead stor
e of null to local variable</a></td><td>Dodgy code</td></tr> | 442 <tr bgcolor="#eeeeee"><td><a href="#DB_DUPLICATE_SWITCH_CLAUSES">DB: Method uses
the same code for two switch clauses</a></td><td>Dodgy code</td></tr> |
418 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_LOCAL_STORE_SHADOWS_FIELD">DLS: Dea
d store to local variable that shadows field</a></td><td>Dodgy code</td></tr> | 443 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_LOCAL_STORE">DLS: Dead store to loc
al variable</a></td><td>Dodgy code</td></tr> |
419 <tr bgcolor="#eeeeee"><td><a href="#DMI_HARDCODED_ABSOLUTE_FILENAME">DMI: Code c
ontains a hard coded reference to an absolute pathname</a></td><td>Dodgy code</t
d></tr> | 444 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_LOCAL_STORE_IN_RETURN">DLS: Useless
assignment in return statement</a></td><td>Dodgy code</td></tr> |
420 <tr bgcolor="#ffffff"><td><a href="#DMI_NONSERIALIZABLE_OBJECT_WRITTEN">DMI: Non
serializable object written to ObjectOutput</a></td><td>Dodgy code</td></tr> | 445 <tr bgcolor="#ffffff"><td><a href="#DLS_DEAD_LOCAL_STORE_OF_NULL">DLS: Dead stor
e of null to local variable</a></td><td>Dodgy code</td></tr> |
421 <tr bgcolor="#eeeeee"><td><a href="#DMI_USELESS_SUBSTRING">DMI: Invocation of su
bstring(0), which returns the original value</a></td><td>Dodgy code</td></tr> | 446 <tr bgcolor="#eeeeee"><td><a href="#DLS_DEAD_LOCAL_STORE_SHADOWS_FIELD">DLS: Dea
d store to local variable that shadows field</a></td><td>Dodgy code</td></tr> |
422 <tr bgcolor="#ffffff"><td><a href="#DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED">D
m: Thread passed where Runnable expected</a></td><td>Dodgy code</td></tr> | 447 <tr bgcolor="#ffffff"><td><a href="#DMI_HARDCODED_ABSOLUTE_FILENAME">DMI: Code c
ontains a hard coded reference to an absolute pathname</a></td><td>Dodgy code</t
d></tr> |
423 <tr bgcolor="#eeeeee"><td><a href="#DMI_UNSUPPORTED_METHOD">Dm: Call to unsuppor
ted method</a></td><td>Dodgy code</td></tr> | 448 <tr bgcolor="#eeeeee"><td><a href="#DMI_NONSERIALIZABLE_OBJECT_WRITTEN">DMI: Non
serializable object written to ObjectOutput</a></td><td>Dodgy code</td></tr> |
424 <tr bgcolor="#ffffff"><td><a href="#EQ_DOESNT_OVERRIDE_EQUALS">Eq: Class doesn't
override equals in superclass</a></td><td>Dodgy code</td></tr> | 449 <tr bgcolor="#ffffff"><td><a href="#DMI_USELESS_SUBSTRING">DMI: Invocation of su
bstring(0), which returns the original value</a></td><td>Dodgy code</td></tr> |
425 <tr bgcolor="#eeeeee"><td><a href="#EQ_UNUSUAL">Eq: Unusual equals method </a></
td><td>Dodgy code</td></tr> | 450 <tr bgcolor="#eeeeee"><td><a href="#DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED">D
m: Thread passed where Runnable expected</a></td><td>Dodgy code</td></tr> |
426 <tr bgcolor="#ffffff"><td><a href="#FE_FLOATING_POINT_EQUALITY">FE: Test for flo
ating point equality</a></td><td>Dodgy code</td></tr> | 451 <tr bgcolor="#ffffff"><td><a href="#DMI_UNSUPPORTED_METHOD">Dm: Call to unsuppor
ted method</a></td><td>Dodgy code</td></tr> |
427 <tr bgcolor="#eeeeee"><td><a href="#VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN">
FS: Non-Boolean argument formatted using %b format specifier</a></td><td>Dodgy c
ode</td></tr> | 452 <tr bgcolor="#eeeeee"><td><a href="#EQ_DOESNT_OVERRIDE_EQUALS">Eq: Class doesn't
override equals in superclass</a></td><td>Dodgy code</td></tr> |
428 <tr bgcolor="#ffffff"><td><a href="#IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTE
R_METHOD">IA: Potentially ambiguous invocation of either an inherited or outer m
ethod</a></td><td>Dodgy code</td></tr> | 453 <tr bgcolor="#ffffff"><td><a href="#EQ_UNUSUAL">Eq: Unusual equals method </a></
td><td>Dodgy code</td></tr> |
429 <tr bgcolor="#eeeeee"><td><a href="#IC_INIT_CIRCULARITY">IC: Initialization circ
ularity</a></td><td>Dodgy code</td></tr> | 454 <tr bgcolor="#eeeeee"><td><a href="#FE_FLOATING_POINT_EQUALITY">FE: Test for flo
ating point equality</a></td><td>Dodgy code</td></tr> |
430 <tr bgcolor="#ffffff"><td><a href="#ICAST_IDIV_CAST_TO_DOUBLE">ICAST: Integral d
ivision result cast to double or float</a></td><td>Dodgy code</td></tr> | 455 <tr bgcolor="#ffffff"><td><a href="#VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN">
FS: Non-Boolean argument formatted using %b format specifier</a></td><td>Dodgy c
ode</td></tr> |
431 <tr bgcolor="#eeeeee"><td><a href="#ICAST_INTEGER_MULTIPLY_CAST_TO_LONG">ICAST:
Result of integer multiplication cast to long</a></td><td>Dodgy code</td></tr> | 456 <tr bgcolor="#eeeeee"><td><a href="#IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTE
R_METHOD">IA: Potentially ambiguous invocation of either an inherited or outer m
ethod</a></td><td>Dodgy code</td></tr> |
432 <tr bgcolor="#ffffff"><td><a href="#IM_AVERAGE_COMPUTATION_COULD_OVERFLOW">IM: C
omputation of average could overflow</a></td><td>Dodgy code</td></tr> | 457 <tr bgcolor="#ffffff"><td><a href="#IC_INIT_CIRCULARITY">IC: Initialization circ
ularity</a></td><td>Dodgy code</td></tr> |
433 <tr bgcolor="#eeeeee"><td><a href="#IM_BAD_CHECK_FOR_ODD">IM: Check for oddness
that won't work for negative numbers </a></td><td>Dodgy code</td></tr> | 458 <tr bgcolor="#eeeeee"><td><a href="#ICAST_IDIV_CAST_TO_DOUBLE">ICAST: Integral d
ivision result cast to double or float</a></td><td>Dodgy code</td></tr> |
434 <tr bgcolor="#ffffff"><td><a href="#INT_BAD_REM_BY_1">INT: Integer remainder mod
ulo 1</a></td><td>Dodgy code</td></tr> | 459 <tr bgcolor="#ffffff"><td><a href="#ICAST_INTEGER_MULTIPLY_CAST_TO_LONG">ICAST:
Result of integer multiplication cast to long</a></td><td>Dodgy code</td></tr> |
435 <tr bgcolor="#eeeeee"><td><a href="#INT_VACUOUS_BIT_OPERATION">INT: Vacuous bit
mask operation on integer value</a></td><td>Dodgy code</td></tr> | 460 <tr bgcolor="#eeeeee"><td><a href="#IM_AVERAGE_COMPUTATION_COULD_OVERFLOW">IM: C
omputation of average could overflow</a></td><td>Dodgy code</td></tr> |
436 <tr bgcolor="#ffffff"><td><a href="#INT_VACUOUS_COMPARISON">INT: Vacuous compari
son of integer value</a></td><td>Dodgy code</td></tr> | 461 <tr bgcolor="#ffffff"><td><a href="#IM_BAD_CHECK_FOR_ODD">IM: Check for oddness
that won't work for negative numbers </a></td><td>Dodgy code</td></tr> |
437 <tr bgcolor="#eeeeee"><td><a href="#MTIA_SUSPECT_SERVLET_INSTANCE_FIELD">MTIA: C
lass extends Servlet class and uses instance variables</a></td><td>Dodgy code</t
d></tr> | 462 <tr bgcolor="#eeeeee"><td><a href="#INT_BAD_REM_BY_1">INT: Integer remainder mod
ulo 1</a></td><td>Dodgy code</td></tr> |
438 <tr bgcolor="#ffffff"><td><a href="#MTIA_SUSPECT_STRUTS_INSTANCE_FIELD">MTIA: Cl
ass extends Struts Action class and uses instance variables</a></td><td>Dodgy co
de</td></tr> | 463 <tr bgcolor="#ffffff"><td><a href="#INT_VACUOUS_BIT_OPERATION">INT: Vacuous bit
mask operation on integer value</a></td><td>Dodgy code</td></tr> |
439 <tr bgcolor="#eeeeee"><td><a href="#NP_DEREFERENCE_OF_READLINE_VALUE">NP: Derefe
rence of the result of readLine() without nullcheck</a></td><td>Dodgy code</td><
/tr> | 464 <tr bgcolor="#eeeeee"><td><a href="#INT_VACUOUS_COMPARISON">INT: Vacuous compari
son of integer value</a></td><td>Dodgy code</td></tr> |
440 <tr bgcolor="#ffffff"><td><a href="#NP_IMMEDIATE_DEREFERENCE_OF_READLINE">NP: Im
mediate dereference of the result of readLine()</a></td><td>Dodgy code</td></tr> | 465 <tr bgcolor="#ffffff"><td><a href="#MTIA_SUSPECT_SERVLET_INSTANCE_FIELD">MTIA: C
lass extends Servlet class and uses instance variables</a></td><td>Dodgy code</t
d></tr> |
441 <tr bgcolor="#eeeeee"><td><a href="#NP_LOAD_OF_KNOWN_NULL_VALUE">NP: Load of kno
wn null value</a></td><td>Dodgy code</td></tr> | 466 <tr bgcolor="#eeeeee"><td><a href="#MTIA_SUSPECT_STRUTS_INSTANCE_FIELD">MTIA: Cl
ass extends Struts Action class and uses instance variables</a></td><td>Dodgy co
de</td></tr> |
442 <tr bgcolor="#ffffff"><td><a href="#NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION">NP:
Method tightens nullness annotation on parameter</a></td><td>Dodgy code</td></t
r> | 467 <tr bgcolor="#ffffff"><td><a href="#NP_DEREFERENCE_OF_READLINE_VALUE">NP: Derefe
rence of the result of readLine() without nullcheck</a></td><td>Dodgy code</td><
/tr> |
443 <tr bgcolor="#eeeeee"><td><a href="#NP_METHOD_RETURN_RELAXING_ANNOTATION">NP: Me
thod relaxes nullness annotation on return value</a></td><td>Dodgy code</td></tr
> | 468 <tr bgcolor="#eeeeee"><td><a href="#NP_IMMEDIATE_DEREFERENCE_OF_READLINE">NP: Im
mediate dereference of the result of readLine()</a></td><td>Dodgy code</td></tr> |
444 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE">NP:
Possible null pointer dereference due to return value of called method</a></td><
td>Dodgy code</td></tr> | 469 <tr bgcolor="#ffffff"><td><a href="#NP_LOAD_OF_KNOWN_NULL_VALUE">NP: Load of kno
wn null value</a></td><td>Dodgy code</td></tr> |
445 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE">NP
: Possible null pointer dereference on branch that might be infeasible</a></td><
td>Dodgy code</td></tr> | 470 <tr bgcolor="#eeeeee"><td><a href="#NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION">NP:
Method tightens nullness annotation on parameter</a></td><td>Dodgy code</td></t
r> |
446 <tr bgcolor="#ffffff"><td><a href="#NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_N
ULLABLE">NP: Parameter must be nonnull but is marked as nullable</a></td><td>Dod
gy code</td></tr> | 471 <tr bgcolor="#ffffff"><td><a href="#NP_METHOD_RETURN_RELAXING_ANNOTATION">NP: Me
thod relaxes nullness annotation on return value</a></td><td>Dodgy code</td></tr
> |
447 <tr bgcolor="#eeeeee"><td><a href="#NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">NP:
Read of unwritten public or protected field</a></td><td>Dodgy code</td></tr> | 472 <tr bgcolor="#eeeeee"><td><a href="#NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE">NP:
Possible null pointer dereference due to return value of called method</a></td><
td>Dodgy code</td></tr> |
448 <tr bgcolor="#ffffff"><td><a href="#NS_DANGEROUS_NON_SHORT_CIRCUIT">NS: Potentia
lly dangerous use of non-short-circuit logic</a></td><td>Dodgy code</td></tr> | 473 <tr bgcolor="#ffffff"><td><a href="#NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE">NP
: Possible null pointer dereference on branch that might be infeasible</a></td><
td>Dodgy code</td></tr> |
449 <tr bgcolor="#eeeeee"><td><a href="#NS_NON_SHORT_CIRCUIT">NS: Questionable use o
f non-short-circuit logic</a></td><td>Dodgy code</td></tr> | 474 <tr bgcolor="#eeeeee"><td><a href="#NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_N
ULLABLE">NP: Parameter must be non-null but is marked as nullable</a></td><td>Do
dgy code</td></tr> |
450 <tr bgcolor="#ffffff"><td><a href="#PS_PUBLIC_SEMAPHORES">PS: Class exposes sync
hronization and semaphores in its public interface</a></td><td>Dodgy code</td></
tr> | 475 <tr bgcolor="#ffffff"><td><a href="#NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">NP:
Read of unwritten public or protected field</a></td><td>Dodgy code</td></tr> |
451 <tr bgcolor="#eeeeee"><td><a href="#PZLA_PREFER_ZERO_LENGTH_ARRAYS">PZLA: Consid
er returning a zero length array rather than null</a></td><td>Dodgy code</td></t
r> | 476 <tr bgcolor="#eeeeee"><td><a href="#NS_DANGEROUS_NON_SHORT_CIRCUIT">NS: Potentia
lly dangerous use of non-short-circuit logic</a></td><td>Dodgy code</td></tr> |
452 <tr bgcolor="#ffffff"><td><a href="#QF_QUESTIONABLE_FOR_LOOP">QF: Complicated, s
ubtle or wrong increment in for-loop </a></td><td>Dodgy code</td></tr> | 477 <tr bgcolor="#ffffff"><td><a href="#NS_NON_SHORT_CIRCUIT">NS: Questionable use o
f non-short-circuit logic</a></td><td>Dodgy code</td></tr> |
453 <tr bgcolor="#eeeeee"><td><a href="#RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL
_VALUE">RCN: Redundant comparison of non-null value to null</a></td><td>Dodgy co
de</td></tr> | 478 <tr bgcolor="#eeeeee"><td><a href="#PS_PUBLIC_SEMAPHORES">PS: Class exposes sync
hronization and semaphores in its public interface</a></td><td>Dodgy code</td></
tr> |
454 <tr bgcolor="#ffffff"><td><a href="#RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES">RC
N: Redundant comparison of two null values</a></td><td>Dodgy code</td></tr> | 479 <tr bgcolor="#ffffff"><td><a href="#PZLA_PREFER_ZERO_LENGTH_ARRAYS">PZLA: Consid
er returning a zero length array rather than null</a></td><td>Dodgy code</td></t
r> |
455 <tr bgcolor="#eeeeee"><td><a href="#RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE">RC
N: Redundant nullcheck of value known to be non-null</a></td><td>Dodgy code</td>
</tr> | 480 <tr bgcolor="#eeeeee"><td><a href="#QF_QUESTIONABLE_FOR_LOOP">QF: Complicated, s
ubtle or wrong increment in for-loop </a></td><td>Dodgy code</td></tr> |
456 <tr bgcolor="#ffffff"><td><a href="#RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE">RCN:
Redundant nullcheck of value known to be null</a></td><td>Dodgy code</td></tr> | 481 <tr bgcolor="#ffffff"><td><a href="#RCN_REDUNDANT_COMPARISON_OF_NULL_AND_NONNULL
_VALUE">RCN: Redundant comparison of non-null value to null</a></td><td>Dodgy co
de</td></tr> |
457 <tr bgcolor="#eeeeee"><td><a href="#REC_CATCH_EXCEPTION">REC: Exception is caugh
t when Exception is not thrown</a></td><td>Dodgy code</td></tr> | 482 <tr bgcolor="#eeeeee"><td><a href="#RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES">RC
N: Redundant comparison of two null values</a></td><td>Dodgy code</td></tr> |
458 <tr bgcolor="#ffffff"><td><a href="#RI_REDUNDANT_INTERFACES">RI: Class implement
s same interface as superclass</a></td><td>Dodgy code</td></tr> | 483 <tr bgcolor="#ffffff"><td><a href="#RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE">RC
N: Redundant nullcheck of value known to be non-null</a></td><td>Dodgy code</td>
</tr> |
459 <tr bgcolor="#eeeeee"><td><a href="#RV_CHECK_FOR_POSITIVE_INDEXOF">RV: Method ch
ecks to see if result of String.indexOf is positive</a></td><td>Dodgy code</td><
/tr> | 484 <tr bgcolor="#eeeeee"><td><a href="#RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE">RCN:
Redundant nullcheck of value known to be null</a></td><td>Dodgy code</td></tr> |
460 <tr bgcolor="#ffffff"><td><a href="#RV_DONT_JUST_NULL_CHECK_READLINE">RV: Method
discards result of readLine after checking if it is nonnull</a></td><td>Dodgy c
ode</td></tr> | 485 <tr bgcolor="#ffffff"><td><a href="#REC_CATCH_EXCEPTION">REC: Exception is caugh
t when Exception is not thrown</a></td><td>Dodgy code</td></tr> |
461 <tr bgcolor="#eeeeee"><td><a href="#RV_REM_OF_HASHCODE">RV: Remainder of hashCod
e could be negative</a></td><td>Dodgy code</td></tr> | 486 <tr bgcolor="#eeeeee"><td><a href="#RI_REDUNDANT_INTERFACES">RI: Class implement
s same interface as superclass</a></td><td>Dodgy code</td></tr> |
462 <tr bgcolor="#ffffff"><td><a href="#RV_REM_OF_RANDOM_INT">RV: Remainder of 32-bi
t signed random integer</a></td><td>Dodgy code</td></tr> | 487 <tr bgcolor="#ffffff"><td><a href="#RV_CHECK_FOR_POSITIVE_INDEXOF">RV: Method ch
ecks to see if result of String.indexOf is positive</a></td><td>Dodgy code</td><
/tr> |
463 <tr bgcolor="#eeeeee"><td><a href="#RV_RETURN_VALUE_IGNORED_INFERRED">RV: Method
ignores return value, is this OK?</a></td><td>Dodgy code</td></tr> | 488 <tr bgcolor="#eeeeee"><td><a href="#RV_DONT_JUST_NULL_CHECK_READLINE">RV: Method
discards result of readLine after checking if it is non-null</a></td><td>Dodgy
code</td></tr> |
| 489 <tr bgcolor="#ffffff"><td><a href="#RV_REM_OF_HASHCODE">RV: Remainder of hashCod
e could be negative</a></td><td>Dodgy code</td></tr> |
| 490 <tr bgcolor="#eeeeee"><td><a href="#RV_REM_OF_RANDOM_INT">RV: Remainder of 32-bi
t signed random integer</a></td><td>Dodgy code</td></tr> |
| 491 <tr bgcolor="#ffffff"><td><a href="#RV_RETURN_VALUE_IGNORED_INFERRED">RV: Method
ignores return value, is this OK?</a></td><td>Dodgy code</td></tr> |
| 492 <tr bgcolor="#eeeeee"><td><a href="#RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT">RV:
Return value of method without side effect is ignored</a></td><td>Dodgy code</td
></tr> |
464 <tr bgcolor="#ffffff"><td><a href="#SA_FIELD_DOUBLE_ASSIGNMENT">SA: Double assig
nment of field</a></td><td>Dodgy code</td></tr> | 493 <tr bgcolor="#ffffff"><td><a href="#SA_FIELD_DOUBLE_ASSIGNMENT">SA: Double assig
nment of field</a></td><td>Dodgy code</td></tr> |
465 <tr bgcolor="#eeeeee"><td><a href="#SA_LOCAL_DOUBLE_ASSIGNMENT">SA: Double assig
nment of local variable </a></td><td>Dodgy code</td></tr> | 494 <tr bgcolor="#eeeeee"><td><a href="#SA_LOCAL_DOUBLE_ASSIGNMENT">SA: Double assig
nment of local variable </a></td><td>Dodgy code</td></tr> |
466 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_ASSIGNMENT">SA: Self assignmen
t of local variable</a></td><td>Dodgy code</td></tr> | 495 <tr bgcolor="#ffffff"><td><a href="#SA_LOCAL_SELF_ASSIGNMENT">SA: Self assignmen
t of local variable</a></td><td>Dodgy code</td></tr> |
467 <tr bgcolor="#eeeeee"><td><a href="#SF_SWITCH_FALLTHROUGH">SF: Switch statement
found where one case falls through to the next case</a></td><td>Dodgy code</td><
/tr> | 496 <tr bgcolor="#eeeeee"><td><a href="#SF_SWITCH_FALLTHROUGH">SF: Switch statement
found where one case falls through to the next case</a></td><td>Dodgy code</td><
/tr> |
468 <tr bgcolor="#ffffff"><td><a href="#SF_SWITCH_NO_DEFAULT">SF: Switch statement f
ound where default case is missing</a></td><td>Dodgy code</td></tr> | 497 <tr bgcolor="#ffffff"><td><a href="#SF_SWITCH_NO_DEFAULT">SF: Switch statement f
ound where default case is missing</a></td><td>Dodgy code</td></tr> |
469 <tr bgcolor="#eeeeee"><td><a href="#ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD">ST:
Write to static field from instance method</a></td><td>Dodgy code</td></tr> | 498 <tr bgcolor="#eeeeee"><td><a href="#ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD">ST:
Write to static field from instance method</a></td><td>Dodgy code</td></tr> |
470 <tr bgcolor="#ffffff"><td><a href="#SE_PRIVATE_READ_RESOLVE_NOT_INHERITED">Se: P
rivate readResolve method not inherited by subclasses</a></td><td>Dodgy code</td
></tr> | 499 <tr bgcolor="#ffffff"><td><a href="#SE_PRIVATE_READ_RESOLVE_NOT_INHERITED">Se: P
rivate readResolve method not inherited by subclasses</a></td><td>Dodgy code</td
></tr> |
471 <tr bgcolor="#eeeeee"><td><a href="#SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS"
>Se: Transient field of class that isn't Serializable. </a></td><td>Dodgy code</
td></tr> | 500 <tr bgcolor="#eeeeee"><td><a href="#SE_TRANSIENT_FIELD_OF_NONSERIALIZABLE_CLASS"
>Se: Transient field of class that isn't Serializable. </a></td><td>Dodgy code</
td></tr> |
472 <tr bgcolor="#ffffff"><td><a href="#TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALW
AYS_SINK">TQ: Value required to have type qualifier, but marked as unknown</a></
td><td>Dodgy code</td></tr> | 501 <tr bgcolor="#ffffff"><td><a href="#TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_ALW
AYS_SINK">TQ: Value required to have type qualifier, but marked as unknown</a></
td><td>Dodgy code</td></tr> |
473 <tr bgcolor="#eeeeee"><td><a href="#TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEV
ER_SINK">TQ: Value required to not have type qualifier, but marked as unknown</a
></td><td>Dodgy code</td></tr> | 502 <tr bgcolor="#eeeeee"><td><a href="#TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEV
ER_SINK">TQ: Value required to not have type qualifier, but marked as unknown</a
></td><td>Dodgy code</td></tr> |
474 <tr bgcolor="#ffffff"><td><a href="#UCF_USELESS_CONTROL_FLOW">UCF: Useless contr
ol flow</a></td><td>Dodgy code</td></tr> | 503 <tr bgcolor="#ffffff"><td><a href="#UC_USELESS_CONDITION">UC: Condition has no e
ffect</a></td><td>Dodgy code</td></tr> |
475 <tr bgcolor="#eeeeee"><td><a href="#UCF_USELESS_CONTROL_FLOW_NEXT_LINE">UCF: Use
less control flow to next line</a></td><td>Dodgy code</td></tr> | 504 <tr bgcolor="#eeeeee"><td><a href="#UC_USELESS_CONDITION_TYPE">UC: Condition has
no effect due to the variable type</a></td><td>Dodgy code</td></tr> |
476 <tr bgcolor="#ffffff"><td><a href="#USM_USELESS_ABSTRACT_METHOD">USM: Abstract M
ethod is already defined in implemented interface</a></td><td>Dodgy code</td></t
r> | 505 <tr bgcolor="#ffffff"><td><a href="#UC_USELESS_OBJECT">UC: Useless object create
d</a></td><td>Dodgy code</td></tr> |
477 <tr bgcolor="#eeeeee"><td><a href="#USM_USELESS_SUBCLASS_METHOD">USM: Method sup
erfluously delegates to parent class method</a></td><td>Dodgy code</td></tr> | 506 <tr bgcolor="#eeeeee"><td><a href="#UC_USELESS_OBJECT_STACK">UC: Useless object
created on stack</a></td><td>Dodgy code</td></tr> |
478 <tr bgcolor="#ffffff"><td><a href="#URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD">UrF: U
nread public/protected field</a></td><td>Dodgy code</td></tr> | 507 <tr bgcolor="#ffffff"><td><a href="#UC_USELESS_VOID_METHOD">UC: Useless non-empt
y void method</a></td><td>Dodgy code</td></tr> |
479 <tr bgcolor="#eeeeee"><td><a href="#UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD">UuF: U
nused public or protected field</a></td><td>Dodgy code</td></tr> | 508 <tr bgcolor="#eeeeee"><td><a href="#UCF_USELESS_CONTROL_FLOW">UCF: Useless contr
ol flow</a></td><td>Dodgy code</td></tr> |
480 <tr bgcolor="#ffffff"><td><a href="#UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">Uw
F: Field not initialized in constructor but dereferenced without null check</a><
/td><td>Dodgy code</td></tr> | 509 <tr bgcolor="#ffffff"><td><a href="#UCF_USELESS_CONTROL_FLOW_NEXT_LINE">UCF: Use
less control flow to next line</a></td><td>Dodgy code</td></tr> |
481 <tr bgcolor="#eeeeee"><td><a href="#UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">UwF
: Unwritten public or protected field</a></td><td>Dodgy code</td></tr> | 510 <tr bgcolor="#eeeeee"><td><a href="#USM_USELESS_ABSTRACT_METHOD">USM: Abstract M
ethod is already defined in implemented interface</a></td><td>Dodgy code</td></t
r> |
482 <tr bgcolor="#ffffff"><td><a href="#XFB_XML_FACTORY_BYPASS">XFB: Method directly
allocates a specific implementation of xml interfaces</a></td><td>Dodgy code</t
d></tr> | 511 <tr bgcolor="#ffffff"><td><a href="#USM_USELESS_SUBCLASS_METHOD">USM: Method sup
erfluously delegates to parent class method</a></td><td>Dodgy code</td></tr> |
| 512 <tr bgcolor="#eeeeee"><td><a href="#URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD">UrF: U
nread public/protected field</a></td><td>Dodgy code</td></tr> |
| 513 <tr bgcolor="#ffffff"><td><a href="#UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD">UuF: U
nused public or protected field</a></td><td>Dodgy code</td></tr> |
| 514 <tr bgcolor="#eeeeee"><td><a href="#UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">Uw
F: Field not initialized in constructor but dereferenced without null check</a><
/td><td>Dodgy code</td></tr> |
| 515 <tr bgcolor="#ffffff"><td><a href="#UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">UwF
: Unwritten public or protected field</a></td><td>Dodgy code</td></tr> |
| 516 <tr bgcolor="#eeeeee"><td><a href="#XFB_XML_FACTORY_BYPASS">XFB: Method directly
allocates a specific implementation of xml interfaces</a></td><td>Dodgy code</t
d></tr> |
483 </table> | 517 </table> |
484 <h2>Descriptions</h2> | 518 <h2>Descriptions</h2> |
485 <h3><a name="AM_CREATES_EMPTY_JAR_FILE_ENTRY">AM: Creates an empty jar file entr
y (AM_CREATES_EMPTY_JAR_FILE_ENTRY)</a></h3> | 519 <h3><a name="AM_CREATES_EMPTY_JAR_FILE_ENTRY">AM: Creates an empty jar file entr
y (AM_CREATES_EMPTY_JAR_FILE_ENTRY)</a></h3> |
486 | 520 |
487 | 521 |
488 <p>The code calls <code>putNextEntry()</code>, immediately | 522 <p>The code calls <code>putNextEntry()</code>, immediately |
489 followed by a call to <code>closeEntry()</code>. This results | 523 followed by a call to <code>closeEntry()</code>. This results |
490 in an empty JarFile entry. The contents of the entry | 524 in an empty JarFile entry. The contents of the entry |
491 should be written to the JarFile between the calls to | 525 should be written to the JarFile between the calls to |
492 <code>putNextEntry()</code> and | 526 <code>putNextEntry()</code> and |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 | 587 |
554 <h3><a name="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE">CN: Class defines clone() bu
t doesn't implement Cloneable (CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE)</a></h3> | 588 <h3><a name="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE">CN: Class defines clone() bu
t doesn't implement Cloneable (CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE)</a></h3> |
555 | 589 |
556 | 590 |
557 <p> This class defines a clone() method but the class doesn't implement Cloneabl
e. | 591 <p> This class defines a clone() method but the class doesn't implement Cloneabl
e. |
558 There are some situations in which this is OK (e.g., you want to control how sub
classes | 592 There are some situations in which this is OK (e.g., you want to control how sub
classes |
559 can clone themselves), but just make sure that this is what you intended. | 593 can clone themselves), but just make sure that this is what you intended. |
560 </p> | 594 </p> |
561 | 595 |
562 | 596 |
| 597 <h3><a name="CNT_ROUGH_CONSTANT_VALUE">CNT: Rough value of known constant found
(CNT_ROUGH_CONSTANT_VALUE)</a></h3> |
| 598 |
| 599 |
| 600 <p>It's recommended to use the predefined library constant for code clarity
and better precision.</p> |
| 601 |
| 602 |
563 <h3><a name="CO_ABSTRACT_SELF">Co: Abstract class defines covariant compareTo()
method (CO_ABSTRACT_SELF)</a></h3> | 603 <h3><a name="CO_ABSTRACT_SELF">Co: Abstract class defines covariant compareTo()
method (CO_ABSTRACT_SELF)</a></h3> |
564 | 604 |
565 | 605 |
566 <p> This class defines a covariant version of <code>compareTo()</code>. | 606 <p> This class defines a covariant version of <code>compareTo()</code>. |
567 To correctly override the <code>compareTo()</code> method in the | 607 To correctly override the <code>compareTo()</code> method in the |
568 <code>Comparable</code> interface, the parameter of <code>compareTo()</code> | 608 <code>Comparable</code> interface, the parameter of <code>compareTo()</code> |
569 must have type <code>java.lang.Object</code>.</p> | 609 must have type <code>java.lang.Object</code>.</p> |
570 | 610 |
571 | 611 |
| 612 <h3><a name="CO_COMPARETO_INCORRECT_FLOATING">Co: compareTo()/compare() incorrec
tly handles float or double value (CO_COMPARETO_INCORRECT_FLOATING)</a></h3> |
| 613 |
| 614 |
| 615 <p>This method compares double or float values using pattern like this: val1 &
gt; val2 ? 1 : val1 < val2 ? -1 : 0. |
| 616 This pattern works incorrectly for -0.0 and NaN values which may result in incor
rect sorting result or broken collection |
| 617 (if compared values are used as keys). Consider using Double.compare or Float.co
mpare static methods which handle all |
| 618 the special cases correctly.</p> |
| 619 |
| 620 |
| 621 <h3><a name="CO_COMPARETO_RESULTS_MIN_VALUE">Co: compareTo()/compare() returns I
nteger.MIN_VALUE (CO_COMPARETO_RESULTS_MIN_VALUE)</a></h3> |
| 622 |
| 623 |
| 624 <p> In some situation, this compareTo or compare method returns |
| 625 the constant Integer.MIN_VALUE, which is an exceptionally bad practice. |
| 626 The only thing that matters about the return value of compareTo is the sign of
the result. |
| 627 But people will sometimes negate the return value of compareTo, expecting th
at this will negate |
| 628 the sign of the result. And it will, except in the case where the value retu
rned is Integer.MIN_VALUE. |
| 629 So just return -1 rather than Integer.MIN_VALUE. |
| 630 |
| 631 |
572 <h3><a name="CO_SELF_NO_OBJECT">Co: Covariant compareTo() method defined (CO_SEL
F_NO_OBJECT)</a></h3> | 632 <h3><a name="CO_SELF_NO_OBJECT">Co: Covariant compareTo() method defined (CO_SEL
F_NO_OBJECT)</a></h3> |
573 | 633 |
574 | 634 |
575 <p> This class defines a covariant version of <code>compareTo()</code>. | 635 <p> This class defines a covariant version of <code>compareTo()</code>. |
576 To correctly override the <code>compareTo()</code> method in the | 636 To correctly override the <code>compareTo()</code> method in the |
577 <code>Comparable</code> interface, the parameter of <code>compareTo()</code> | 637 <code>Comparable</code> interface, the parameter of <code>compareTo()</code> |
578 must have type <code>java.lang.Object</code>.</p> | 638 must have type <code>java.lang.Object</code>.</p> |
579 | 639 |
580 | 640 |
581 <h3><a name="DE_MIGHT_DROP">DE: Method might drop exception (DE_MIGHT_DROP)</a><
/h3> | 641 <h3><a name="DE_MIGHT_DROP">DE: Method might drop exception (DE_MIGHT_DROP)</a><
/h3> |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 | 763 |
704 <h3><a name="EQ_COMPARETO_USE_OBJECT_EQUALS">Eq: Class defines compareTo(...) an
d uses Object.equals() (EQ_COMPARETO_USE_OBJECT_EQUALS)</a></h3> | 764 <h3><a name="EQ_COMPARETO_USE_OBJECT_EQUALS">Eq: Class defines compareTo(...) an
d uses Object.equals() (EQ_COMPARETO_USE_OBJECT_EQUALS)</a></h3> |
705 | 765 |
706 | 766 |
707 <p> This class defines a <code>compareTo(...)</code> method but inherits its | 767 <p> This class defines a <code>compareTo(...)</code> method but inherits its |
708 <code>equals()</code> method from <code>java.lang.Object</code>. | 768 <code>equals()</code> method from <code>java.lang.Object</code>. |
709 Generally, the value of compareTo should return zero if and only if | 769 Generally, the value of compareTo should return zero if and only if |
710 equals returns true. If this is violated, weird and unpredictable | 770 equals returns true. If this is violated, weird and unpredictable |
711 failures will occur in classes such as PriorityQueue. | 771 failures will occur in classes such as PriorityQueue. |
712 In Java 5 the PriorityQueue.remove method uses the compareTo method, | 772 In Java 5 the PriorityQueue.remove method uses the compareTo method, |
713 while in Java 6 it uses the equals method. | 773 while in Java 6 it uses the equals method.</p> |
714 | 774 |
715 <p>From the JavaDoc for the compareTo method in the Comparable interface: | 775 <p>From the JavaDoc for the compareTo method in the Comparable interface: |
716 <blockquote> | 776 <blockquote> |
717 It is strongly recommended, but not strictly required that <code>(x.compareTo(y)
==0) == (x.equals(y))</code>. | 777 It is strongly recommended, but not strictly required that <code>(x.compareTo(y)
==0) == (x.equals(y))</code>. |
718 Generally speaking, any class that implements the Comparable interface and viola
tes this condition | 778 Generally speaking, any class that implements the Comparable interface and viola
tes this condition |
719 should clearly indicate this fact. The recommended language | 779 should clearly indicate this fact. The recommended language |
720 is "Note: this class has a natural ordering that is inconsistent with equals." | 780 is "Note: this class has a natural ordering that is inconsistent with equals." |
721 </blockquote> | 781 </blockquote></p> |
722 | 782 |
723 | 783 |
724 <h3><a name="EQ_GETCLASS_AND_CLASS_CONSTANT">Eq: equals method fails for subtype
s (EQ_GETCLASS_AND_CLASS_CONSTANT)</a></h3> | 784 <h3><a name="EQ_GETCLASS_AND_CLASS_CONSTANT">Eq: equals method fails for subtype
s (EQ_GETCLASS_AND_CLASS_CONSTANT)</a></h3> |
725 | 785 |
726 | 786 |
727 <p> This class has an equals method that will be broken if it is inherited by
subclasses. | 787 <p> This class has an equals method that will be broken if it is inherited by
subclasses. |
728 It compares a class literal with the class of the argument (e.g., in class <code
>Foo</code> | 788 It compares a class literal with the class of the argument (e.g., in class <code
>Foo</code> |
729 it might check if <code>Foo.class == o.getClass()</code>). | 789 it might check if <code>Foo.class == o.getClass()</code>). |
730 It is better to check if <code>this.getClass() == o.getClass()</code>. | 790 It is better to check if <code>this.getClass() == o.getClass()</code>. |
731 </p> | 791 </p> |
(...skipping 17 matching lines...) Expand all Loading... |
749 | 809 |
750 <h3><a name="FI_EXPLICIT_INVOCATION">FI: Explicit invocation of finalizer (FI_EX
PLICIT_INVOCATION)</a></h3> | 810 <h3><a name="FI_EXPLICIT_INVOCATION">FI: Explicit invocation of finalizer (FI_EX
PLICIT_INVOCATION)</a></h3> |
751 | 811 |
752 | 812 |
753 <p> This method contains an explicit invocation of the <code>finalize()</code> | 813 <p> This method contains an explicit invocation of the <code>finalize()</code> |
754 method on an object. Because finalizer methods are supposed to be | 814 method on an object. Because finalizer methods are supposed to be |
755 executed once, and only by the VM, this is a bad idea.</p> | 815 executed once, and only by the VM, this is a bad idea.</p> |
756 <p>If a connected set of objects beings finalizable, then the VM will invoke the | 816 <p>If a connected set of objects beings finalizable, then the VM will invoke the |
757 finalize method on all the finalizable object, possibly at the same time in diff
erent threads. | 817 finalize method on all the finalizable object, possibly at the same time in diff
erent threads. |
758 Thus, it is a particularly bad idea, in the finalize method for a class X, invok
e finalize | 818 Thus, it is a particularly bad idea, in the finalize method for a class X, invok
e finalize |
759 on objects referenced by X, because they may already be getting finalized in a s
eparate thread. | 819 on objects referenced by X, because they may already be getting finalized in a s
eparate thread.</p> |
760 | 820 |
761 | 821 |
762 <h3><a name="FI_FINALIZER_NULLS_FIELDS">FI: Finalizer nulls fields (FI_FINALIZER
_NULLS_FIELDS)</a></h3> | 822 <h3><a name="FI_FINALIZER_NULLS_FIELDS">FI: Finalizer nulls fields (FI_FINALIZER
_NULLS_FIELDS)</a></h3> |
763 | 823 |
764 | 824 |
765 <p> This finalizer nulls out fields. This is usually an error, as it does not
aid garbage collection, | 825 <p> This finalizer nulls out fields. This is usually an error, as it does not
aid garbage collection, |
766 and the object is going to be garbage collected anyway. | 826 and the object is going to be garbage collected anyway.</p> |
767 | 827 |
768 | 828 |
769 <h3><a name="FI_FINALIZER_ONLY_NULLS_FIELDS">FI: Finalizer only nulls fields (FI
_FINALIZER_ONLY_NULLS_FIELDS)</a></h3> | 829 <h3><a name="FI_FINALIZER_ONLY_NULLS_FIELDS">FI: Finalizer only nulls fields (FI
_FINALIZER_ONLY_NULLS_FIELDS)</a></h3> |
770 | 830 |
771 | 831 |
772 <p> This finalizer does nothing except null out fields. This is completely poi
ntless, and requires that | 832 <p> This finalizer does nothing except null out fields. This is completely poi
ntless, and requires that |
773 the object be garbage collected, finalized, and then garbage collected again. Yo
u should just remove the finalize | 833 the object be garbage collected, finalized, and then garbage collected again. Yo
u should just remove the finalize |
774 method. | 834 method.</p> |
775 | 835 |
776 | 836 |
777 <h3><a name="FI_MISSING_SUPER_CALL">FI: Finalizer does not call superclass final
izer (FI_MISSING_SUPER_CALL)</a></h3> | 837 <h3><a name="FI_MISSING_SUPER_CALL">FI: Finalizer does not call superclass final
izer (FI_MISSING_SUPER_CALL)</a></h3> |
778 | 838 |
779 | 839 |
780 <p> This <code>finalize()</code> method does not make a call to its | 840 <p> This <code>finalize()</code> method does not make a call to its |
781 superclass's <code>finalize()</code> method. So, any finalizer | 841 superclass's <code>finalize()</code> method. So, any finalizer |
782 actions defined for the superclass will not be performed. | 842 actions defined for the superclass will not be performed. |
783 Add a call to <code>super.finalize()</code>.</p> | 843 Add a call to <code>super.finalize()</code>.</p> |
784 | 844 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 | 1004 |
945 | 1005 |
946 <h3><a name="JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS">JCIP: Fields of immutable
classes should be final (JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS)</a></h3> | 1006 <h3><a name="JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS">JCIP: Fields of immutable
classes should be final (JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS)</a></h3> |
947 | 1007 |
948 | 1008 |
949 <p> The class is annotated with net.jcip.annotations.Immutable or javax.annota
tion.concurrent.Immutable, | 1009 <p> The class is annotated with net.jcip.annotations.Immutable or javax.annota
tion.concurrent.Immutable, |
950 and the rules for those annotations require that all fields are final. | 1010 and the rules for those annotations require that all fields are final. |
951 .</p> | 1011 .</p> |
952 | 1012 |
953 | 1013 |
| 1014 <h3><a name="ME_ENUM_FIELD_SETTER">ME: Public enum method unconditionally sets i
ts field (ME_ENUM_FIELD_SETTER)</a></h3> |
| 1015 |
| 1016 |
| 1017 <p>This public method declared in public enum unconditionally sets enum field,
thus this field can be changed by malicious code |
| 1018 or by accident from another package. Though mutable enum fields may be used fo
r lazy initialization, it's a bad practice to expose them to the outer world. |
| 1019 Consider removing this method or declaring it package-private.</p> |
| 1020 |
| 1021 |
| 1022 <h3><a name="ME_MUTABLE_ENUM_FIELD">ME: Enum field is public and mutable (ME_MUT
ABLE_ENUM_FIELD)</a></h3> |
| 1023 |
| 1024 |
| 1025 <p>A mutable public field is defined inside a public enum, thus can be changed
by malicious code or by accident from another package. |
| 1026 Though mutable enum fields may be used for lazy initialization, it's a bad pra
ctice to expose them to the outer world. |
| 1027 Consider declaring this field final and/or package-private.</p> |
| 1028 |
| 1029 |
954 <h3><a name="NP_BOOLEAN_RETURN_NULL">NP: Method with Boolean return type returns
explicit null (NP_BOOLEAN_RETURN_NULL)</a></h3> | 1030 <h3><a name="NP_BOOLEAN_RETURN_NULL">NP: Method with Boolean return type returns
explicit null (NP_BOOLEAN_RETURN_NULL)</a></h3> |
955 | 1031 |
956 | 1032 |
957 <p> | 1033 <p> |
958 A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accid
ent waiting to happen. | 1034 A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accid
ent waiting to happen. |
959 This method can be invoked as though it returned a value of type boolean, an
d | 1035 This method can be invoked as though it returned a value of type boolean, an
d |
960 the compiler will insert automatic unboxing of the Boolean value. If a null
value is returned, | 1036 the compiler will insert automatic unboxing of the Boolean value. If a null
value is returned, |
961 this will result in a NullPointerException. | 1037 this will result in a NullPointerException. |
962 </p> | 1038 </p> |
963 | 1039 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 </p> | 1122 </p> |
1047 | 1123 |
1048 | 1124 |
1049 <h3><a name="NM_SAME_SIMPLE_NAME_AS_INTERFACE">Nm: Class names shouldn't shadow
simple name of implemented interface (NM_SAME_SIMPLE_NAME_AS_INTERFACE)</a></h3> | 1125 <h3><a name="NM_SAME_SIMPLE_NAME_AS_INTERFACE">Nm: Class names shouldn't shadow
simple name of implemented interface (NM_SAME_SIMPLE_NAME_AS_INTERFACE)</a></h3> |
1050 | 1126 |
1051 | 1127 |
1052 <p> This class/interface has a simple name that is identical to that of an imp
lemented/extended interface, except | 1128 <p> This class/interface has a simple name that is identical to that of an imp
lemented/extended interface, except |
1053 that the interface is in a different package (e.g., <code>alpha.Foo</code> exten
ds <code>beta.Foo</code>). | 1129 that the interface is in a different package (e.g., <code>alpha.Foo</code> exten
ds <code>beta.Foo</code>). |
1054 This can be exceptionally confusing, create lots of situations in which you have
to look at import statements | 1130 This can be exceptionally confusing, create lots of situations in which you have
to look at import statements |
1055 to resolve references and creates many | 1131 to resolve references and creates many |
1056 opportunities to accidently define methods that do not override methods in their
superclasses. | 1132 opportunities to accidentally define methods that do not override methods in the
ir superclasses. |
1057 </p> | 1133 </p> |
1058 | 1134 |
1059 | 1135 |
1060 <h3><a name="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS">Nm: Class names shouldn't shadow
simple name of superclass (NM_SAME_SIMPLE_NAME_AS_SUPERCLASS)</a></h3> | 1136 <h3><a name="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS">Nm: Class names shouldn't shadow
simple name of superclass (NM_SAME_SIMPLE_NAME_AS_SUPERCLASS)</a></h3> |
1061 | 1137 |
1062 | 1138 |
1063 <p> This class has a simple name that is identical to that of its superclass,
except | 1139 <p> This class has a simple name that is identical to that of its superclass,
except |
1064 that its superclass is in a different package (e.g., <code>alpha.Foo</code> exte
nds <code>beta.Foo</code>). | 1140 that its superclass is in a different package (e.g., <code>alpha.Foo</code> exte
nds <code>beta.Foo</code>). |
1065 This can be exceptionally confusing, create lots of situations in which you have
to look at import statements | 1141 This can be exceptionally confusing, create lots of situations in which you have
to look at import statements |
1066 to resolve references and creates many | 1142 to resolve references and creates many |
1067 opportunities to accidently define methods that do not override methods in their
superclasses. | 1143 opportunities to accidentally define methods that do not override methods in the
ir superclasses. |
1068 </p> | 1144 </p> |
1069 | 1145 |
1070 | 1146 |
1071 <h3><a name="NM_VERY_CONFUSING_INTENTIONAL">Nm: Very confusing method names (but
perhaps intentional) (NM_VERY_CONFUSING_INTENTIONAL)</a></h3> | 1147 <h3><a name="NM_VERY_CONFUSING_INTENTIONAL">Nm: Very confusing method names (but
perhaps intentional) (NM_VERY_CONFUSING_INTENTIONAL)</a></h3> |
1072 | 1148 |
1073 | 1149 |
1074 <p> The referenced methods have names that differ only by capitalization. | 1150 <p> The referenced methods have names that differ only by capitalization. |
1075 This is very confusing because if the capitalization were | 1151 This is very confusing because if the capitalization were |
1076 identical then one of the methods would override the other. From the existence o
f other methods, it | 1152 identical then one of the methods would override the other. From the existence o
f other methods, it |
1077 seems that the existence of both of these methods is intentional, but is sure is
confusing. | 1153 seems that the existence of both of these methods is intentional, but is sure is
confusing. |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1589 | 1665 |
1590 | 1666 |
1591 <h3><a name="BOA_BADLY_OVERRIDDEN_ADAPTER">BOA: Class overrides a method impleme
nted in super class Adapter wrongly (BOA_BADLY_OVERRIDDEN_ADAPTER)</a></h3> | 1667 <h3><a name="BOA_BADLY_OVERRIDDEN_ADAPTER">BOA: Class overrides a method impleme
nted in super class Adapter wrongly (BOA_BADLY_OVERRIDDEN_ADAPTER)</a></h3> |
1592 | 1668 |
1593 | 1669 |
1594 <p> This method overrides a method found in a parent class, where that class is
an Adapter that implements | 1670 <p> This method overrides a method found in a parent class, where that class is
an Adapter that implements |
1595 a listener defined in the java.awt.event or javax.swing.event package. As a resu
lt, this method will not | 1671 a listener defined in the java.awt.event or javax.swing.event package. As a resu
lt, this method will not |
1596 get called when the event occurs.</p> | 1672 get called when the event occurs.</p> |
1597 | 1673 |
1598 | 1674 |
| 1675 <h3><a name="BSHIFT_WRONG_ADD_PRIORITY">BSHIFT: Possible bad parsing of shift op
eration (BSHIFT_WRONG_ADD_PRIORITY)</a></h3> |
| 1676 |
| 1677 |
| 1678 <p> |
| 1679 The code performs an operation like (x << 8 + y). Although this might be c
orrect, probably it was meant |
| 1680 to perform (x << 8) + y, but shift operation has |
| 1681 a lower precedence, so it's actually parsed as x << (8 + y). |
| 1682 </p> |
| 1683 |
| 1684 |
1599 <h3><a name="ICAST_BAD_SHIFT_AMOUNT">BSHIFT: 32 bit int shifted by an amount not
in the range -31..31 (ICAST_BAD_SHIFT_AMOUNT)</a></h3> | 1685 <h3><a name="ICAST_BAD_SHIFT_AMOUNT">BSHIFT: 32 bit int shifted by an amount not
in the range -31..31 (ICAST_BAD_SHIFT_AMOUNT)</a></h3> |
1600 | 1686 |
1601 | 1687 |
1602 <p> | 1688 <p> |
1603 The code performs shift of a 32 bit int by a constant amount outside | 1689 The code performs shift of a 32 bit int by a constant amount outside |
1604 the range -31..31. | 1690 the range -31..31. |
1605 The effect of this is to use the lower 5 bits of the integer | 1691 The effect of this is to use the lower 5 bits of the integer |
1606 value to decide how much to shift by (e.g., shifting by 40 bits is the same as s
hifting by 8 bits, | 1692 value to decide how much to shift by (e.g., shifting by 40 bits is the same as s
hifting by 8 bits, |
1607 and shifting by 32 bits is the same as shifting by zero bits). This probably isn
't what was expected, | 1693 and shifting by 32 bits is the same as shifting by zero bits). This probably isn
't what was expected, |
1608 and it is at least confusing. | 1694 and it is at least confusing. |
1609 </p> | 1695 </p> |
1610 | 1696 |
1611 | 1697 |
1612 <h3><a name="BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR">Bx: Primitive value is
unboxed and coerced for ternary operator (BX_UNBOXED_AND_COERCED_FOR_TERNARY_OP
ERATOR)</a></h3> | 1698 <h3><a name="CAA_COVARIANT_ARRAY_ELEMENT_STORE">CAA: Possibly incompatible eleme
nt is stored in covariant array (CAA_COVARIANT_ARRAY_ELEMENT_STORE)</a></h3> |
1613 | 1699 |
1614 | 1700 |
1615 <p>A wrapped primitive value is unboxed and converted to another primitive typ
e as part of the | 1701 <p>Value is stored into the array and the value type doesn't match the array typ
e. |
1616 evaluation of a conditional ternary operator (the <code> b ? e1 : e2</code> oper
ator). The | 1702 It's known from the analysis that actual array type is narrower than the declare
d type of its variable or field |
1617 semantics of Java mandate that if <code>e1</code> and <code>e2</code> are wrappe
d | 1703 and this assignment doesn't satisfy the original array type. This assignment may
cause ArrayStoreException |
1618 numeric values, the values are unboxed and converted/coerced to their common typ
e (e.g, | 1704 at runtime. |
1619 if <code>e1</code> is of type <code>Integer</code> | |
1620 and <code>e2</code> is of type <code>Float</code>, then <code>e1</code> is unbox
ed, | |
1621 converted to a floating point value, and boxed. See JLS Section 15.25. | |
1622 </p> | 1705 </p> |
1623 | 1706 |
1624 | 1707 |
1625 <h3><a name="CO_COMPARETO_RESULTS_MIN_VALUE">Co: compareTo()/compare() returns I
nteger.MIN_VALUE (CO_COMPARETO_RESULTS_MIN_VALUE)</a></h3> | |
1626 | |
1627 | |
1628 <p> In some situation, this compareTo or compare method returns | |
1629 the constant Integer.MIN_VALUE, which is an exceptionally bad practice. | |
1630 The only thing that matters about the return value of compareTo is the sign of
the result. | |
1631 But people will sometimes negate the return value of compareTo, expecting th
at this will negate | |
1632 the sign of the result. And it will, except in the case where the value retu
rned is Integer.MIN_VALUE. | |
1633 So just return -1 rather than Integer.MIN_VALUE. | |
1634 | |
1635 | |
1636 <h3><a name="DLS_DEAD_LOCAL_INCREMENT_IN_RETURN">DLS: Useless increment in retur
n statement (DLS_DEAD_LOCAL_INCREMENT_IN_RETURN)</a></h3> | 1708 <h3><a name="DLS_DEAD_LOCAL_INCREMENT_IN_RETURN">DLS: Useless increment in retur
n statement (DLS_DEAD_LOCAL_INCREMENT_IN_RETURN)</a></h3> |
1637 | 1709 |
1638 | 1710 |
1639 <p>This statement has a return such as <code>return x++;</code>. | 1711 <p>This statement has a return such as <code>return x++;</code>. |
1640 A postfix increment/decrement does not impact the value of the expression, | 1712 A postfix increment/decrement does not impact the value of the expression, |
1641 so this increment/decrement has no effect. | 1713 so this increment/decrement has no effect. |
1642 Please verify that this statement does the right thing. | 1714 Please verify that this statement does the right thing. |
1643 </p> | 1715 </p> |
1644 | 1716 |
1645 | 1717 |
1646 <h3><a name="DLS_DEAD_STORE_OF_CLASS_LITERAL">DLS: Dead store of class literal (
DLS_DEAD_STORE_OF_CLASS_LITERAL)</a></h3> | 1718 <h3><a name="DLS_DEAD_STORE_OF_CLASS_LITERAL">DLS: Dead store of class literal (
DLS_DEAD_STORE_OF_CLASS_LITERAL)</a></h3> |
1647 | 1719 |
1648 | 1720 |
1649 <p> | 1721 <p> |
1650 This instruction assigns a class literal to a variable and then never uses it. | 1722 This instruction assigns a class literal to a variable and then never uses it. |
1651 <a href="//java.sun.com/j2se/1.5.0/compatibility.html#literal">The behavior of t
his differs in Java 1.4 and in Java 5.</a> | 1723 <a href="//java.sun.com/j2se/1.5.0/compatibility.html#literal">The behavior of t
his differs in Java 1.4 and in Java 5.</a> |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1785 | 1857 |
1786 | 1858 |
1787 <h3><a name="DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD">Dm: Useless/vacuous call to Ea
syMock method (DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD)</a></h3> | 1859 <h3><a name="DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD">Dm: Useless/vacuous call to Ea
syMock method (DMI_VACUOUS_CALL_TO_EASYMOCK_METHOD)</a></h3> |
1788 | 1860 |
1789 | 1861 |
1790 <p>This call doesn't pass any objects to the EasyMock method, so the call do
esn't do anything. | 1862 <p>This call doesn't pass any objects to the EasyMock method, so the call do
esn't do anything. |
1791 </p> | 1863 </p> |
1792 | 1864 |
1793 | 1865 |
1794 | 1866 |
| 1867 <h3><a name="DM_INVALID_MIN_MAX">Dm: Incorrect combination of Math.max and Math.
min (DM_INVALID_MIN_MAX)</a></h3> |
| 1868 |
| 1869 |
| 1870 <p>This code tries to limit the value bounds using the construct like Math.min
(0, Math.max(100, value)). However the order of |
| 1871 the constants is incorrect: it should be Math.min(100, Math.max(0, value)). As
the result this code always produces the same result |
| 1872 (or NaN if the value is NaN).</p> |
| 1873 |
| 1874 |
1795 <h3><a name="EC_ARRAY_AND_NONARRAY">EC: equals() used to compare array and nonar
ray (EC_ARRAY_AND_NONARRAY)</a></h3> | 1875 <h3><a name="EC_ARRAY_AND_NONARRAY">EC: equals() used to compare array and nonar
ray (EC_ARRAY_AND_NONARRAY)</a></h3> |
1796 | 1876 |
1797 | 1877 |
1798 <p> | 1878 <p> |
1799 This method invokes the .equals(Object o) to compare an array and a reference th
at doesn't seem | 1879 This method invokes the .equals(Object o) to compare an array and a reference th
at doesn't seem |
1800 to be an array. If things being compared are of different types, they are guaran
teed to be unequal | 1880 to be an array. If things being compared are of different types, they are guaran
teed to be unequal |
1801 and the comparison is almost certainly an error. Even if they are both arrays, t
he equals method | 1881 and the comparison is almost certainly an error. Even if they are both arrays, t
he equals method |
1802 on arrays only determines of the two arrays are the same object. | 1882 on arrays only determines of the two arrays are the same object. |
1803 To compare the | 1883 To compare the |
1804 contents of the arrays, use java.util.Arrays.equals(Object[], Object[]). | 1884 contents of the arrays, use java.util.Arrays.equals(Object[], Object[]). |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1870 classes should always compare as unequal; therefore, according to the | 1950 classes should always compare as unequal; therefore, according to the |
1871 contract defined by java.lang.Object.equals(Object), | 1951 contract defined by java.lang.Object.equals(Object), |
1872 the result of this comparison will always be false at runtime. | 1952 the result of this comparison will always be false at runtime. |
1873 </p> | 1953 </p> |
1874 | 1954 |
1875 | 1955 |
1876 <h3><a name="EC_UNRELATED_TYPES">EC: Call to equals() comparing different types
(EC_UNRELATED_TYPES)</a></h3> | 1956 <h3><a name="EC_UNRELATED_TYPES">EC: Call to equals() comparing different types
(EC_UNRELATED_TYPES)</a></h3> |
1877 | 1957 |
1878 | 1958 |
1879 <p> This method calls equals(Object) on two references of different | 1959 <p> This method calls equals(Object) on two references of different |
1880 class types with no common subclasses. | 1960 class types and analysis suggests they will be to objects of different classes |
1881 Therefore, the objects being compared | 1961 at runtime. Further, examination of the equals methods that would be invoked sug
gest that either |
1882 are unlikely to be members of the same class at runtime | 1962 this call will always return false, or else the equals method is not be symmetri
c (which is |
1883 (unless some application classes were not analyzed, or dynamic class | 1963 a property required by the contract |
1884 loading can occur at runtime). | 1964 for equals in class Object). |
1885 According to the contract of equals(), | |
1886 objects of different | |
1887 classes should always compare as unequal; therefore, according to the | |
1888 contract defined by java.lang.Object.equals(Object), | |
1889 the result of this comparison will always be false at runtime. | |
1890 </p> | 1965 </p> |
1891 | 1966 |
1892 | 1967 |
1893 <h3><a name="EC_UNRELATED_TYPES_USING_POINTER_EQUALITY">EC: Using pointer equali
ty to compare different types (EC_UNRELATED_TYPES_USING_POINTER_EQUALITY)</a></h
3> | 1968 <h3><a name="EC_UNRELATED_TYPES_USING_POINTER_EQUALITY">EC: Using pointer equali
ty to compare different types (EC_UNRELATED_TYPES_USING_POINTER_EQUALITY)</a></h
3> |
1894 | 1969 |
1895 | 1970 |
1896 <p> This method uses using pointer equality to compare two references that seem
to be of | 1971 <p> This method uses using pointer equality to compare two references that seem
to be of |
1897 different types. The result of this comparison will always be false at runtime. | 1972 different types. The result of this comparison will always be false at runtime. |
1898 </p> | 1973 </p> |
1899 | 1974 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2156 | 2231 |
2157 | 2232 |
2158 <h3><a name="ICAST_INT_2_LONG_AS_INSTANT">ICAST: int value converted to long and
used as absolute time (ICAST_INT_2_LONG_AS_INSTANT)</a></h3> | 2233 <h3><a name="ICAST_INT_2_LONG_AS_INSTANT">ICAST: int value converted to long and
used as absolute time (ICAST_INT_2_LONG_AS_INSTANT)</a></h3> |
2159 | 2234 |
2160 | 2235 |
2161 <p> | 2236 <p> |
2162 This code converts a 32-bit int value to a 64-bit long value, and then | 2237 This code converts a 32-bit int value to a 64-bit long value, and then |
2163 passes that value for a method parameter that requires an absolute time value. | 2238 passes that value for a method parameter that requires an absolute time value. |
2164 An absolute time value is the number | 2239 An absolute time value is the number |
2165 of milliseconds since the standard base time known as "the epoch", namely Januar
y 1, 1970, 00:00:00 GMT. | 2240 of milliseconds since the standard base time known as "the epoch", namely Januar
y 1, 1970, 00:00:00 GMT. |
2166 For example, the following method, intended to convert seconds since the epoc in
to a Date, is badly | 2241 For example, the following method, intended to convert seconds since the epoch i
nto a Date, is badly |
2167 broken:</p> | 2242 broken:</p> |
2168 <pre> | 2243 <pre> |
2169 Date getDate(int seconds) { return new Date(seconds * 1000); } | 2244 Date getDate(int seconds) { return new Date(seconds * 1000); } |
2170 </pre> | 2245 </pre> |
2171 <p>The multiplication is done using 32-bit arithmetic, and then converted to a 6
4-bit value. | 2246 <p>The multiplication is done using 32-bit arithmetic, and then converted to a 6
4-bit value. |
2172 When a 32-bit value is converted to 64-bits and used to express an absolute time | 2247 When a 32-bit value is converted to 64-bits and used to express an absolute time |
2173 value, only dates in December 1969 and January 1970 can be represented.</p> | 2248 value, only dates in December 1969 and January 1970 can be represented.</p> |
2174 | 2249 |
2175 <p>Correct implementations for the above method are:</p> | 2250 <p>Correct implementations for the above method are:</p> |
2176 | 2251 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2298 | 2373 |
2299 <h3><a name="INT_BAD_COMPARISON_WITH_INT_VALUE">INT: Bad comparison of int value
with long constant (INT_BAD_COMPARISON_WITH_INT_VALUE)</a></h3> | 2374 <h3><a name="INT_BAD_COMPARISON_WITH_INT_VALUE">INT: Bad comparison of int value
with long constant (INT_BAD_COMPARISON_WITH_INT_VALUE)</a></h3> |
2300 | 2375 |
2301 | 2376 |
2302 <p> This code compares an int value with a long constant that is outside | 2377 <p> This code compares an int value with a long constant that is outside |
2303 the range of values that can be represented as an int value. | 2378 the range of values that can be represented as an int value. |
2304 This comparison is vacuous and possibily to be incorrect. | 2379 This comparison is vacuous and possibily to be incorrect. |
2305 </p> | 2380 </p> |
2306 | 2381 |
2307 | 2382 |
2308 <h3><a name="INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE">INT: Bad comparison of n
onnegative value with negative constant (INT_BAD_COMPARISON_WITH_NONNEGATIVE_VAL
UE)</a></h3> | 2383 <h3><a name="INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE">INT: Bad comparison of n
onnegative value with negative constant or zero (INT_BAD_COMPARISON_WITH_NONNEGA
TIVE_VALUE)</a></h3> |
2309 | 2384 |
2310 | 2385 |
2311 <p> This code compares a value that is guaranteed to be non-negative with a nega
tive constant. | 2386 <p> This code compares a value that is guaranteed to be non-negative with a nega
tive constant or zero. |
2312 </p> | 2387 </p> |
2313 | 2388 |
2314 | 2389 |
2315 <h3><a name="INT_BAD_COMPARISON_WITH_SIGNED_BYTE">INT: Bad comparison of signed
byte (INT_BAD_COMPARISON_WITH_SIGNED_BYTE)</a></h3> | 2390 <h3><a name="INT_BAD_COMPARISON_WITH_SIGNED_BYTE">INT: Bad comparison of signed
byte (INT_BAD_COMPARISON_WITH_SIGNED_BYTE)</a></h3> |
2316 | 2391 |
2317 | 2392 |
2318 <p> Signed bytes can only have a value in the range -128 to 127. Comparing | 2393 <p> Signed bytes can only have a value in the range -128 to 127. Comparing |
2319 a signed byte with a value outside that range is vacuous and likely to be incorr
ect. | 2394 a signed byte with a value outside that range is vacuous and likely to be incorr
ect. |
2320 To convert a signed byte <code>b</code> to an unsigned value in the range 0..255
, | 2395 To convert a signed byte <code>b</code> to an unsigned value in the range 0..255
, |
2321 use <code>0xff & b</code> | 2396 use <code>0xff & b</code> |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2410 | 2485 |
2411 | 2486 |
2412 <p> | 2487 <p> |
2413 There is a statement or branch that if executed guarantees that | 2488 There is a statement or branch that if executed guarantees that |
2414 a value is null at this point, and that | 2489 a value is null at this point, and that |
2415 value that is guaranteed to be dereferenced | 2490 value that is guaranteed to be dereferenced |
2416 (except on forward paths involving runtime exceptions). | 2491 (except on forward paths involving runtime exceptions). |
2417 </p> | 2492 </p> |
2418 <p>Note that a check such as | 2493 <p>Note that a check such as |
2419 <code>if (x == null) throw new NullPointerException();</code> | 2494 <code>if (x == null) throw new NullPointerException();</code> |
2420 is treated as a dereference of <code>x</code>. | 2495 is treated as a dereference of <code>x</code>.</p> |
2421 | 2496 |
2422 | 2497 |
2423 <h3><a name="NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH">NP: Value is null and guaran
teed to be dereferenced on exception path (NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH
)</a></h3> | 2498 <h3><a name="NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH">NP: Value is null and guaran
teed to be dereferenced on exception path (NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH
)</a></h3> |
2424 | 2499 |
2425 | 2500 |
2426 <p> | 2501 <p> |
2427 There is a statement or branch on an exception path | 2502 There is a statement or branch on an exception path |
2428 that if executed guarantees that | 2503 that if executed guarantees that |
2429 a value is null at this point, and that | 2504 a value is null at this point, and that |
2430 value that is guaranteed to be dereferenced | 2505 value that is guaranteed to be dereferenced |
2431 (except on forward paths involving runtime exceptions). | 2506 (except on forward paths involving runtime exceptions). |
2432 </p> | 2507 </p> |
2433 | 2508 |
2434 | 2509 |
2435 <h3><a name="NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">NP: Nonnull field
is not initialized (NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR)</a></h3> | 2510 <h3><a name="NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR">NP: Non-null field
is not initialized (NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR)</a></h3> |
2436 | 2511 |
2437 | 2512 |
2438 <p> The field is marked as nonnull, but isn't written to by the construct
or. | 2513 <p> The field is marked as non-null, but isn't written to by the construc
tor. |
2439 The field might be initialized elsewhere during constructor, or might always | 2514 The field might be initialized elsewhere during constructor, or might always |
2440 be initialized before use. | 2515 be initialized before use. |
2441 </p> | 2516 </p> |
2442 | 2517 |
2443 | 2518 |
2444 <h3><a name="NP_NONNULL_PARAM_VIOLATION">NP: Method call passes null to a nonnul
l parameter (NP_NONNULL_PARAM_VIOLATION)</a></h3> | 2519 <h3><a name="NP_NONNULL_PARAM_VIOLATION">NP: Method call passes null to a non-nu
ll parameter (NP_NONNULL_PARAM_VIOLATION)</a></h3> |
2445 | 2520 |
2446 | 2521 |
2447 <p> | 2522 <p> |
2448 This method passes a null value as the parameter of a method which | 2523 This method passes a null value as the parameter of a method which |
2449 must be nonnull. Either this parameter has been explicitly marked | 2524 must be non-null. Either this parameter has been explicitly marked |
2450 as @Nonnull, or analysis has determined that this parameter is | 2525 as @Nonnull, or analysis has determined that this parameter is |
2451 always dereferenced. | 2526 always dereferenced. |
2452 </p> | 2527 </p> |
2453 | 2528 |
2454 | 2529 |
2455 <h3><a name="NP_NONNULL_RETURN_VIOLATION">NP: Method may return null, but is dec
lared @NonNull (NP_NONNULL_RETURN_VIOLATION)</a></h3> | 2530 <h3><a name="NP_NONNULL_RETURN_VIOLATION">NP: Method may return null, but is dec
lared @Nonnull (NP_NONNULL_RETURN_VIOLATION)</a></h3> |
2456 | 2531 |
2457 | 2532 |
2458 <p> | 2533 <p> |
2459 This method may return a null value, but the method (or a superclass metho
d | 2534 This method may return a null value, but the method (or a superclass metho
d |
2460 which it overrides) is declared to return @NonNull. | 2535 which it overrides) is declared to return @Nonnull. |
2461 </p> | 2536 </p> |
2462 | 2537 |
2463 | 2538 |
2464 <h3><a name="NP_NULL_INSTANCEOF">NP: A known null value is checked to see if it
is an instance of a type (NP_NULL_INSTANCEOF)</a></h3> | 2539 <h3><a name="NP_NULL_INSTANCEOF">NP: A known null value is checked to see if it
is an instance of a type (NP_NULL_INSTANCEOF)</a></h3> |
2465 | 2540 |
2466 | 2541 |
2467 <p> | 2542 <p> |
2468 This instanceof test will always return false, since the value being checked is
guaranteed to be null. | 2543 This instanceof test will always return false, since the value being checked is
guaranteed to be null. |
2469 Although this is safe, make sure it isn't | 2544 Although this is safe, make sure it isn't |
2470 an indication of some misunderstanding or some other logic error. | 2545 an indication of some misunderstanding or some other logic error. |
(...skipping 17 matching lines...) Expand all Loading... |
2488 <p> A reference value which is null on some exception control path is | 2563 <p> A reference value which is null on some exception control path is |
2489 dereferenced here. This may lead to a <code>NullPointerException</code> | 2564 dereferenced here. This may lead to a <code>NullPointerException</code> |
2490 when the code is executed. | 2565 when the code is executed. |
2491 Note that because FindBugs currently does not prune infeasible exception paths, | 2566 Note that because FindBugs currently does not prune infeasible exception paths, |
2492 this may be a false warning.</p> | 2567 this may be a false warning.</p> |
2493 | 2568 |
2494 <p> Also note that FindBugs considers the default case of a switch statement to | 2569 <p> Also note that FindBugs considers the default case of a switch statement to |
2495 be an exception path, since the default case is often infeasible.</p> | 2570 be an exception path, since the default case is often infeasible.</p> |
2496 | 2571 |
2497 | 2572 |
2498 <h3><a name="NP_NULL_PARAM_DEREF">NP: Method call passes null for nonnull parame
ter (NP_NULL_PARAM_DEREF)</a></h3> | 2573 <h3><a name="NP_NULL_PARAM_DEREF">NP: Method call passes null for non-null param
eter (NP_NULL_PARAM_DEREF)</a></h3> |
2499 | 2574 |
2500 | 2575 |
2501 <p> | 2576 <p> |
2502 This method call passes a null value for a nonnull method parameter. | 2577 This method call passes a null value for a non-null method parameter. |
2503 Either the parameter is annotated as a parameter that should | 2578 Either the parameter is annotated as a parameter that should |
2504 always be nonnull, or analysis has shown that it will always be | 2579 always be non-null, or analysis has shown that it will always be |
2505 dereferenced. | 2580 dereferenced. |
2506 </p> | 2581 </p> |
2507 | 2582 |
2508 | 2583 |
2509 <h3><a name="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS">NP: Method call passes n
ull for nonnull parameter (NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS)</a></h3> | 2584 <h3><a name="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS">NP: Method call passes n
ull for non-null parameter (NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS)</a></h3> |
2510 | 2585 |
2511 | 2586 |
2512 <p> | 2587 <p> |
2513 A possibly-null value is passed at a call site where all known | 2588 A possibly-null value is passed at a call site where all known |
2514 target methods require the parameter to be nonnull. | 2589 target methods require the parameter to be non-null. |
2515 Either the parameter is annotated as a parameter that should | 2590 Either the parameter is annotated as a parameter that should |
2516 always be nonnull, or analysis has shown that it will always be | 2591 always be non-null, or analysis has shown that it will always be |
2517 dereferenced. | 2592 dereferenced. |
2518 </p> | 2593 </p> |
2519 | 2594 |
2520 | 2595 |
2521 <h3><a name="NP_NULL_PARAM_DEREF_NONVIRTUAL">NP: Non-virtual method call passes
null for nonnull parameter (NP_NULL_PARAM_DEREF_NONVIRTUAL)</a></h3> | 2596 <h3><a name="NP_NULL_PARAM_DEREF_NONVIRTUAL">NP: Non-virtual method call passes
null for non-null parameter (NP_NULL_PARAM_DEREF_NONVIRTUAL)</a></h3> |
2522 | 2597 |
2523 | 2598 |
2524 <p> | 2599 <p> |
2525 A possibly-null value is passed to a nonnull method parameter. | 2600 A possibly-null value is passed to a non-null method parameter. |
2526 Either the parameter is annotated as a parameter that should | 2601 Either the parameter is annotated as a parameter that should |
2527 always be nonnull, or analysis has shown that it will always be | 2602 always be non-null, or analysis has shown that it will always be |
2528 dereferenced. | 2603 dereferenced. |
2529 </p> | 2604 </p> |
2530 | 2605 |
2531 | 2606 |
2532 <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> | 2607 <h3><a name="NP_OPTIONAL_RETURN_NULL">NP: Method with Optional return type retur
ns explicit null (NP_OPTIONAL_RETURN_NULL)</a></h3> |
| 2608 |
| 2609 |
| 2610 <p> |
| 2611 The usage of Optional return type (java.util.Optional or com.google.common.b
ase.Optiona) |
| 2612 always mean that explicit null returns were not desired by design. |
| 2613 Returning a null value in such case is a contract violation and will most li
kely break clients code. |
| 2614 </p> |
| 2615 |
| 2616 |
| 2617 <h3><a name="NP_STORE_INTO_NONNULL_FIELD">NP: Store of null value into field ann
otated @Nonnull (NP_STORE_INTO_NONNULL_FIELD)</a></h3> |
2533 | 2618 |
2534 | 2619 |
2535 <p> A value that could be null is stored into a field that has been annotated as
NonNull. </p> | 2620 <p> A value that could be null is stored into a field that has been annotated as
@Nonnull. </p> |
2536 | 2621 |
2537 | 2622 |
2538 <h3><a name="NP_UNWRITTEN_FIELD">NP: Read of unwritten field (NP_UNWRITTEN_FIELD
)</a></h3> | 2623 <h3><a name="NP_UNWRITTEN_FIELD">NP: Read of unwritten field (NP_UNWRITTEN_FIELD
)</a></h3> |
2539 | 2624 |
2540 | 2625 |
2541 <p> The program is dereferencing a field that does not seem to ever have a non
-null value written to it. | 2626 <p> The program is dereferencing a field that does not seem to ever have a non
-null value written to it. |
2542 Unless the field is initialized via some mechanism not seen by the analysis, | 2627 Unless the field is initialized via some mechanism not seen by the analysis, |
2543 dereferencing this value will generate a null pointer exception. | 2628 dereferencing this value will generate a null pointer exception. |
2544 </p> | 2629 </p> |
2545 | 2630 |
(...skipping 20 matching lines...) Expand all Loading... |
2566 <p> This class defines a method called <code>tostring()</code>. This met
hod | 2651 <p> This class defines a method called <code>tostring()</code>. This met
hod |
2567 does not override the <code>toString()</code> method in <code>java.lang.Object
</code>, | 2652 does not override the <code>toString()</code> method in <code>java.lang.Object
</code>, |
2568 which is probably what was intended.</p> | 2653 which is probably what was intended.</p> |
2569 | 2654 |
2570 | 2655 |
2571 <h3><a name="NM_METHOD_CONSTRUCTOR_CONFUSION">Nm: Apparent method/constructor co
nfusion (NM_METHOD_CONSTRUCTOR_CONFUSION)</a></h3> | 2656 <h3><a name="NM_METHOD_CONSTRUCTOR_CONFUSION">Nm: Apparent method/constructor co
nfusion (NM_METHOD_CONSTRUCTOR_CONFUSION)</a></h3> |
2572 | 2657 |
2573 | 2658 |
2574 <p> This regular method has the same name as the class it is defined in. It is
likely that this was intended to be a constructor. | 2659 <p> This regular method has the same name as the class it is defined in. It is
likely that this was intended to be a constructor. |
2575 If it was intended to be a constructor, remove the declaration of a void r
eturn value. | 2660 If it was intended to be a constructor, remove the declaration of a void r
eturn value. |
2576 If you had accidently defined this method, realized the mistake, defined a p
roper constructor | 2661 If you had accidentally defined this method, realized the mistake, defined a
proper constructor |
2577 but can't get rid of this method due to backwards compatibility, deprecate t
he method. | 2662 but can't get rid of this method due to backwards compatibility, deprecate t
he method. |
2578 </p> | 2663 </p> |
2579 | 2664 |
2580 | 2665 |
2581 <h3><a name="NM_VERY_CONFUSING">Nm: Very confusing method names (NM_VERY_CONFUSI
NG)</a></h3> | 2666 <h3><a name="NM_VERY_CONFUSING">Nm: Very confusing method names (NM_VERY_CONFUSI
NG)</a></h3> |
2582 | 2667 |
2583 | 2668 |
2584 <p> The referenced methods have names that differ only by capitalization. | 2669 <p> The referenced methods have names that differ only by capitalization. |
2585 This is very confusing because if the capitalization were | 2670 This is very confusing because if the capitalization were |
2586 identical then one of the methods would override the other. | 2671 identical then one of the methods would override the other. |
(...skipping 30 matching lines...) Expand all Loading... |
2617 <h3><a name="QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT">QBA: Method assigns boolean li
teral in boolean expression (QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT)</a></h3> | 2702 <h3><a name="QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT">QBA: Method assigns boolean li
teral in boolean expression (QBA_QUESTIONABLE_BOOLEAN_ASSIGNMENT)</a></h3> |
2618 | 2703 |
2619 | 2704 |
2620 <p> | 2705 <p> |
2621 This method assigns a literal boolean value (true or false) to a boolean v
ariable inside | 2706 This method assigns a literal boolean value (true or false) to a boolean v
ariable inside |
2622 an if or while expression. Most probably this was supposed to be a boolean
comparison using | 2707 an if or while expression. Most probably this was supposed to be a boolean
comparison using |
2623 ==, not an assignment using =. | 2708 ==, not an assignment using =. |
2624 </p> | 2709 </p> |
2625 | 2710 |
2626 | 2711 |
| 2712 <h3><a name="RANGE_ARRAY_INDEX">RANGE: Array index is out of bounds (RANGE_ARRAY
_INDEX)</a></h3> |
| 2713 |
| 2714 |
| 2715 <p> Array operation is performed, but array index is out of bounds, which wil
l result in ArrayIndexOutOfBoundsException at runtime.</p> |
| 2716 |
| 2717 |
| 2718 <h3><a name="RANGE_ARRAY_LENGTH">RANGE: Array length is out of bounds (RANGE_ARR
AY_LENGTH)</a></h3> |
| 2719 |
| 2720 |
| 2721 <p> Method is called with array parameter and length parameter, but the lengt
h is out of bounds. This will result in IndexOutOfBoundsException at runtime. </
p> |
| 2722 |
| 2723 |
| 2724 <h3><a name="RANGE_ARRAY_OFFSET">RANGE: Array offset is out of bounds (RANGE_ARR
AY_OFFSET)</a></h3> |
| 2725 |
| 2726 |
| 2727 <p> Method is called with array parameter and offset parameter, but the offse
t is out of bounds. This will result in IndexOutOfBoundsException at runtime. </
p> |
| 2728 |
| 2729 |
| 2730 <h3><a name="RANGE_STRING_INDEX">RANGE: String index is out of bounds (RANGE_STR
ING_INDEX)</a></h3> |
| 2731 |
| 2732 |
| 2733 <p> String method is called and specified string index is out of bounds. This
will result in StringIndexOutOfBoundsException at runtime. </p> |
| 2734 |
| 2735 |
2627 <h3><a name="RC_REF_COMPARISON">RC: Suspicious reference comparison (RC_REF_COMP
ARISON)</a></h3> | 2736 <h3><a name="RC_REF_COMPARISON">RC: Suspicious reference comparison (RC_REF_COMP
ARISON)</a></h3> |
2628 | 2737 |
2629 | 2738 |
2630 <p> This method compares two reference values using the == or != operator, | 2739 <p> This method compares two reference values using the == or != operator, |
2631 where the correct way to compare instances of this type is generally | 2740 where the correct way to compare instances of this type is generally |
2632 with the equals() method. | 2741 with the equals() method. |
2633 It is possible to create distinct instances that are equal but do not compare as
== since | 2742 It is possible to create distinct instances that are equal but do not compare as
== since |
2634 they are different objects. | 2743 they are different objects. |
2635 Examples of classes which should generally | 2744 Examples of classes which should generally |
2636 not be compared by reference are java.lang.Integer, java.lang.Float, etc.</p> | 2745 not be compared by reference are java.lang.Integer, java.lang.Float, etc.</p> |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3395 | 3504 |
3396 <h3><a name="MS_MUTABLE_ARRAY">MS: Field is a mutable array (MS_MUTABLE_ARRAY)</
a></h3> | 3505 <h3><a name="MS_MUTABLE_ARRAY">MS: Field is a mutable array (MS_MUTABLE_ARRAY)</
a></h3> |
3397 | 3506 |
3398 | 3507 |
3399 <p> A final static field references an array | 3508 <p> A final static field references an array |
3400 and can be accessed by malicious code or | 3509 and can be accessed by malicious code or |
3401 by accident from another package. | 3510 by accident from another package. |
3402 This code can freely modify the contents of the array.</p> | 3511 This code can freely modify the contents of the array.</p> |
3403 | 3512 |
3404 | 3513 |
| 3514 <h3><a name="MS_MUTABLE_COLLECTION">MS: Field is a mutable collection (MS_MUTABL
E_COLLECTION)</a></h3> |
| 3515 |
| 3516 |
| 3517 <p>A mutable collection instance is assigned to a final static field, |
| 3518 thus can be changed by malicious code or by accident from another package. |
| 3519 Consider wrapping this field into Collections.unmodifiableSet/List/Map/etc. |
| 3520 to avoid this vulnerability.</p> |
| 3521 |
| 3522 |
| 3523 <h3><a name="MS_MUTABLE_COLLECTION_PKGPROTECT">MS: Field is a mutable collection
which should be package protected (MS_MUTABLE_COLLECTION_PKGPROTECT)</a></h3> |
| 3524 |
| 3525 |
| 3526 <p>A mutable collection instance is assigned to a final static field, |
| 3527 thus can be changed by malicious code or by accident from another package. |
| 3528 The field could be made package protected to avoid this vulnerability. |
| 3529 Alternatively you may wrap this field into Collections.unmodifiableSet/List/M
ap/etc. |
| 3530 to avoid this vulnerability.</p> |
| 3531 |
| 3532 |
3405 <h3><a name="MS_MUTABLE_HASHTABLE">MS: Field is a mutable Hashtable (MS_MUTABLE_
HASHTABLE)</a></h3> | 3533 <h3><a name="MS_MUTABLE_HASHTABLE">MS: Field is a mutable Hashtable (MS_MUTABLE_
HASHTABLE)</a></h3> |
3406 | 3534 |
3407 | 3535 |
3408 <p>A final static field references a Hashtable | 3536 <p>A final static field references a Hashtable |
3409 and can be accessed by malicious code or | 3537 and can be accessed by malicious code or |
3410 by accident from another package. | 3538 by accident from another package. |
3411 This code can freely modify the contents of the Hashtable.</p> | 3539 This code can freely modify the contents of the Hashtable.</p> |
3412 | 3540 |
3413 | 3541 |
3414 <h3><a name="MS_OOI_PKGPROTECT">MS: Field should be moved out of an interface an
d made package protected (MS_OOI_PKGPROTECT)</a></h3> | 3542 <h3><a name="MS_OOI_PKGPROTECT">MS: Field should be moved out of an interface an
d made package protected (MS_OOI_PKGPROTECT)</a></h3> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3471 <h3><a name="DC_DOUBLECHECK">DC: Possible double check of field (DC_DOUBLECHECK)
</a></h3> | 3599 <h3><a name="DC_DOUBLECHECK">DC: Possible double check of field (DC_DOUBLECHECK)
</a></h3> |
3472 | 3600 |
3473 | 3601 |
3474 <p> This method may contain an instance of double-checked locking. | 3602 <p> This method may contain an instance of double-checked locking. |
3475 This idiom is not correct according to the semantics of the Java memory | 3603 This idiom is not correct according to the semantics of the Java memory |
3476 model. For more information, see the web page | 3604 model. For more information, see the web page |
3477 <a href="http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.htm
l" | 3605 <a href="http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.htm
l" |
3478 >http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html</a>.</
p> | 3606 >http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html</a>.</
p> |
3479 | 3607 |
3480 | 3608 |
| 3609 <h3><a name="DC_PARTIALLY_CONSTRUCTED">DC: Possible exposure of partially initia
lized object (DC_PARTIALLY_CONSTRUCTED)</a></h3> |
| 3610 |
| 3611 |
| 3612 <p>Looks like this method uses lazy field initialization with double-checked l
ocking. |
| 3613 While the field is correctly declared as volatile, it's possible that the inte
rnal structure of |
| 3614 the object is changed after the field assignment, thus another thread may see
the partially initialized object.</p> |
| 3615 <p>To fix this problem consider storing the object into the local variable fir
st |
| 3616 and save it to the volatile field only after it's fully constructed. |
| 3617 </p> |
| 3618 |
| 3619 |
3481 <h3><a name="DL_SYNCHRONIZATION_ON_BOOLEAN">DL: Synchronization on Boolean (DL_S
YNCHRONIZATION_ON_BOOLEAN)</a></h3> | 3620 <h3><a name="DL_SYNCHRONIZATION_ON_BOOLEAN">DL: Synchronization on Boolean (DL_S
YNCHRONIZATION_ON_BOOLEAN)</a></h3> |
3482 | 3621 |
3483 | 3622 |
3484 <p> The code synchronizes on a boxed primitive constant, such as an Boolean.</
p> | 3623 <p> The code synchronizes on a boxed primitive constant, such as an Boolean.</
p> |
3485 <pre> | 3624 <pre> |
3486 private static Boolean inited = Boolean.FALSE; | 3625 private static Boolean inited = Boolean.FALSE; |
3487 ... | 3626 ... |
3488 synchronized(inited) { | 3627 synchronized(inited) { |
3489 if (!inited) { | 3628 if (!inited) { |
3490 init(); | 3629 init(); |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4073 </p> | 4212 </p> |
4074 | 4213 |
4075 | 4214 |
4076 <h3><a name="BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION">Bx: Primitive va
lue is boxed then unboxed to perform primitive coercion (BX_BOXING_IMMEDIATELY_U
NBOXED_TO_PERFORM_COERCION)</a></h3> | 4215 <h3><a name="BX_BOXING_IMMEDIATELY_UNBOXED_TO_PERFORM_COERCION">Bx: Primitive va
lue is boxed then unboxed to perform primitive coercion (BX_BOXING_IMMEDIATELY_U
NBOXED_TO_PERFORM_COERCION)</a></h3> |
4077 | 4216 |
4078 | 4217 |
4079 <p>A primitive boxed value constructed and then immediately converted into a d
ifferent primitive type | 4218 <p>A primitive boxed value constructed and then immediately converted into a d
ifferent primitive type |
4080 (e.g., <code>new Double(d).intValue()</code>). Just perform direct primitive coe
rcion (e.g., <code>(int) d</code>).</p> | 4219 (e.g., <code>new Double(d).intValue()</code>). Just perform direct primitive coe
rcion (e.g., <code>(int) d</code>).</p> |
4081 | 4220 |
4082 | 4221 |
| 4222 <h3><a name="BX_UNBOXED_AND_COERCED_FOR_TERNARY_OPERATOR">Bx: Primitive value is
unboxed and coerced for ternary operator (BX_UNBOXED_AND_COERCED_FOR_TERNARY_OP
ERATOR)</a></h3> |
| 4223 |
| 4224 |
| 4225 <p>A wrapped primitive value is unboxed and converted to another primitive typ
e as part of the |
| 4226 evaluation of a conditional ternary operator (the <code> b ? e1 : e2</code> oper
ator). The |
| 4227 semantics of Java mandate that if <code>e1</code> and <code>e2</code> are wrappe
d |
| 4228 numeric values, the values are unboxed and converted/coerced to their common typ
e (e.g, |
| 4229 if <code>e1</code> is of type <code>Integer</code> |
| 4230 and <code>e2</code> is of type <code>Float</code>, then <code>e1</code> is unbox
ed, |
| 4231 converted to a floating point value, and boxed. See JLS Section 15.25. |
| 4232 </p> |
| 4233 |
| 4234 |
4083 <h3><a name="BX_UNBOXING_IMMEDIATELY_REBOXED">Bx: Boxed value is unboxed and the
n immediately reboxed (BX_UNBOXING_IMMEDIATELY_REBOXED)</a></h3> | 4235 <h3><a name="BX_UNBOXING_IMMEDIATELY_REBOXED">Bx: Boxed value is unboxed and the
n immediately reboxed (BX_UNBOXING_IMMEDIATELY_REBOXED)</a></h3> |
4084 | 4236 |
4085 | 4237 |
4086 <p>A boxed value is unboxed and then immediately reboxed. | 4238 <p>A boxed value is unboxed and then immediately reboxed. |
4087 </p> | 4239 </p> |
4088 | 4240 |
4089 | 4241 |
| 4242 <h3><a name="DM_BOXED_PRIMITIVE_FOR_COMPARE">Bx: Boxing a primitive to compare (
DM_BOXED_PRIMITIVE_FOR_COMPARE)</a></h3> |
| 4243 |
| 4244 |
| 4245 <p>A boxed primitive is created just to call compareTo method. It's more effic
ient to use static compare method |
| 4246 (for double and float since Java 1.4, for other primitive types since Java 1.7
) which works on primitives directly. |
| 4247 </p> |
| 4248 |
| 4249 |
4090 <h3><a name="DM_BOXED_PRIMITIVE_FOR_PARSING">Bx: Boxing/unboxing to parse a prim
itive (DM_BOXED_PRIMITIVE_FOR_PARSING)</a></h3> | 4250 <h3><a name="DM_BOXED_PRIMITIVE_FOR_PARSING">Bx: Boxing/unboxing to parse a prim
itive (DM_BOXED_PRIMITIVE_FOR_PARSING)</a></h3> |
4091 | 4251 |
4092 | 4252 |
4093 <p>A boxed primitive is created from a String, just to extract the unboxed pri
mitive value. | 4253 <p>A boxed primitive is created from a String, just to extract the unboxed pri
mitive value. |
4094 It is more efficient to just call the static parseXXX method.</p> | 4254 It is more efficient to just call the static parseXXX method.</p> |
4095 | 4255 |
4096 | 4256 |
4097 <h3><a name="DM_BOXED_PRIMITIVE_TOSTRING">Bx: Method allocates a boxed primitive
just to call toString (DM_BOXED_PRIMITIVE_TOSTRING)</a></h3> | 4257 <h3><a name="DM_BOXED_PRIMITIVE_TOSTRING">Bx: Method allocates a boxed primitive
just to call toString (DM_BOXED_PRIMITIVE_TOSTRING)</a></h3> |
4098 | 4258 |
4099 | 4259 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4237 <p> | 4397 <p> |
4238 A large String constant is duplicated across multiple class files. | 4398 A large String constant is duplicated across multiple class files. |
4239 This is likely because a final field is initialized to a String constant, an
d the Java language | 4399 This is likely because a final field is initialized to a String constant, an
d the Java language |
4240 mandates that all references to a final field from other classes be inlined
into | 4400 mandates that all references to a final field from other classes be inlined
into |
4241 that classfile. See <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=
6447475">JDK bug 6447475</a> | 4401 that classfile. See <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=
6447475">JDK bug 6447475</a> |
4242 for a description of an occurrence of this bug in the JDK and how resolving
it reduced | 4402 for a description of an occurrence of this bug in the JDK and how resolving
it reduced |
4243 the size of the JDK by 1 megabyte. | 4403 the size of the JDK by 1 megabyte. |
4244 </p> | 4404 </p> |
4245 | 4405 |
4246 | 4406 |
| 4407 <h3><a name="IIL_ELEMENTS_GET_LENGTH_IN_LOOP">IIL: NodeList.getLength() called i
n a loop (IIL_ELEMENTS_GET_LENGTH_IN_LOOP)</a></h3> |
| 4408 |
| 4409 |
| 4410 <p> The method calls NodeList.getLength() inside the loop and NodeList was produ
ced by getElementsByTagName call. |
| 4411 This NodeList doesn't store its length, but computes it every time in not very o
ptimal way. |
| 4412 Consider storing the length to the variable before the loop. |
| 4413 </p> |
| 4414 |
| 4415 |
| 4416 <h3><a name="IIL_PATTERN_COMPILE_IN_LOOP">IIL: Method calls Pattern.compile in a
loop (IIL_PATTERN_COMPILE_IN_LOOP)</a></h3> |
| 4417 |
| 4418 |
| 4419 <p> The method calls Pattern.compile inside the loop passing the constant argume
nts. |
| 4420 If the Pattern should be used several times there's no reason to compile it for
each loop iteration. |
| 4421 Move this call outside of the loop or even into static final field.</p> |
| 4422 |
| 4423 |
| 4424 <h3><a name="IIL_PATTERN_COMPILE_IN_LOOP_INDIRECT">IIL: Method compiles the regu
lar expression in a loop (IIL_PATTERN_COMPILE_IN_LOOP_INDIRECT)</a></h3> |
| 4425 |
| 4426 |
| 4427 <p> The method creates the same regular expression inside the loop, so it will b
e compiled every iteration. |
| 4428 It would be more optimal to precompile this regular expression using Pattern.com
pile outside of the loop.</p> |
| 4429 |
| 4430 |
| 4431 <h3><a name="IIL_PREPARE_STATEMENT_IN_LOOP">IIL: Method calls prepareStatement i
n a loop (IIL_PREPARE_STATEMENT_IN_LOOP)</a></h3> |
| 4432 |
| 4433 |
| 4434 <p> The method calls Connection.prepareStatement inside the loop passing the con
stant arguments. |
| 4435 If the PreparedStatement should be executed several times there's no reason to r
ecreate it for each loop iteration. |
| 4436 Move this call outside of the loop.</p> |
| 4437 |
| 4438 |
| 4439 <h3><a name="IIO_INEFFICIENT_INDEX_OF">IIO: Inefficient use of String.indexOf(St
ring) (IIO_INEFFICIENT_INDEX_OF)</a></h3> |
| 4440 |
| 4441 |
| 4442 <p> This code passes a constant string of length 1 to String.indexOf(). |
| 4443 It is more efficient to use the integer implementations of String.indexOf(). |
| 4444 f. e. call <code>myString.indexOf('.')</code> instead of <code>myString.indexOf(
".")</code></p> |
| 4445 |
| 4446 |
| 4447 <h3><a name="IIO_INEFFICIENT_LAST_INDEX_OF">IIO: Inefficient use of String.lastI
ndexOf(String) (IIO_INEFFICIENT_LAST_INDEX_OF)</a></h3> |
| 4448 |
| 4449 |
| 4450 <p> This code passes a constant string of length 1 to String.lastIndexOf(). |
| 4451 It is more efficient to use the integer implementations of String.lastIndexOf(). |
| 4452 f. e. call <code>myString.lastIndexOf('.')</code> instead of <code>myString.last
IndexOf(".")</code></p> |
| 4453 |
| 4454 |
4247 <h3><a name="IMA_INEFFICIENT_MEMBER_ACCESS">IMA: Method accesses a private membe
r variable of owning class (IMA_INEFFICIENT_MEMBER_ACCESS)</a></h3> | 4455 <h3><a name="IMA_INEFFICIENT_MEMBER_ACCESS">IMA: Method accesses a private membe
r variable of owning class (IMA_INEFFICIENT_MEMBER_ACCESS)</a></h3> |
4248 | 4456 |
4249 | 4457 |
4250 <p> | 4458 <p> |
4251 This method of an inner class reads from or writes to a private member var
iable of the owning class, | 4459 This method of an inner class reads from or writes to a private member var
iable of the owning class, |
4252 or calls a private method of the owning class. The compiler must generate
a special method to access this | 4460 or calls a private method of the owning class. The compiler must generate
a special method to access this |
4253 private member, causing this to be less efficient. Relaxing the protection
of the member variable or method | 4461 private member, causing this to be less efficient. Relaxing the protection
of the member variable or method |
4254 will allow the compiler to treat this as a normal access. | 4462 will allow the compiler to treat this as a normal access. |
4255 </p> | 4463 </p> |
4256 | 4464 |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4524 See <a href="http://cwe.mitre.org/data/definitions/23.html">http://cwe.mitre.org
/data/definitions/23.html</a> | 4732 See <a href="http://cwe.mitre.org/data/definitions/23.html">http://cwe.mitre.org
/data/definitions/23.html</a> |
4525 for more information.</p> | 4733 for more information.</p> |
4526 <p>FindBugs looks only for the most blatant, obvious cases of relative path trav
ersal. | 4734 <p>FindBugs looks only for the most blatant, obvious cases of relative path trav
ersal. |
4527 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more | 4735 If FindBugs found <em>any</em>, you <em>almost certainly</em> have more |
4528 vulnerabilities that FindBugs doesn't report. If you are concerned about relativ
e path traversal, you should seriously | 4736 vulnerabilities that FindBugs doesn't report. If you are concerned about relativ
e path traversal, you should seriously |
4529 consider using a commercial static analysis or pen-testing tool. | 4737 consider using a commercial static analysis or pen-testing tool. |
4530 </p> | 4738 </p> |
4531 | 4739 |
4532 | 4740 |
4533 | 4741 |
4534 <h3><a name="SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE">SQL: Nonconstant string p
assed to execute method on an SQL statement (SQL_NONCONSTANT_STRING_PASSED_TO_EX
ECUTE)</a></h3> | 4742 <h3><a name="SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE">SQL: Nonconstant string p
assed to execute or addBatch method on an SQL statement (SQL_NONCONSTANT_STRING_
PASSED_TO_EXECUTE)</a></h3> |
4535 | 4743 |
4536 | 4744 |
4537 <p>The method invokes the execute method on an SQL statement with a String tha
t seems | 4745 <p>The method invokes the execute or addBatch method on an SQL statement with
a String that seems |
4538 to be dynamically generated. Consider using | 4746 to be dynamically generated. Consider using |
4539 a prepared statement instead. It is more efficient and less vulnerable to | 4747 a prepared statement instead. It is more efficient and less vulnerable to |
4540 SQL injection attacks. | 4748 SQL injection attacks. |
4541 </p> | 4749 </p> |
4542 | 4750 |
4543 | 4751 |
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> | 4752 <h3><a name="SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING">SQL: A pr
epared statement is generated from a nonconstant String (SQL_PREPARED_STATEMENT_
GENERATED_FROM_NONCONSTANT_STRING)</a></h3> |
4545 | 4753 |
4546 | 4754 |
4547 <p>The code creates an SQL prepared statement from a nonconstant String. | 4755 <p>The code creates an SQL prepared statement from a nonconstant String. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4654 | 4862 |
4655 | 4863 |
4656 <p> | 4864 <p> |
4657 The code performs an unsigned right shift, whose result is then | 4865 The code performs an unsigned right shift, whose result is then |
4658 cast to a short or byte, which discards the upper bits of the result. | 4866 cast to a short or byte, which discards the upper bits of the result. |
4659 Since the upper bits are discarded, there may be no difference between | 4867 Since the upper bits are discarded, there may be no difference between |
4660 a signed and unsigned right shift (depending upon the size of the shift). | 4868 a signed and unsigned right shift (depending upon the size of the shift). |
4661 </p> | 4869 </p> |
4662 | 4870 |
4663 | 4871 |
| 4872 <h3><a name="CAA_COVARIANT_ARRAY_FIELD">CAA: Covariant array assignment to a fie
ld (CAA_COVARIANT_ARRAY_FIELD)</a></h3> |
| 4873 |
| 4874 |
| 4875 <p>Array of covariant type is assigned to a field. This is confusing and may lea
d to ArrayStoreException at runtime |
| 4876 if the reference of some other type will be stored in this array later like in t
he following code: |
| 4877 </p> |
| 4878 <p><code>Number[] arr = new Integer[10]; |
| 4879 arr[0] = 1.0; |
| 4880 </code></p> |
| 4881 <p>Consider changing the type of created array or the field type.</p> |
| 4882 |
| 4883 |
| 4884 <h3><a name="CAA_COVARIANT_ARRAY_LOCAL">CAA: Covariant array assignment to a loc
al variable (CAA_COVARIANT_ARRAY_LOCAL)</a></h3> |
| 4885 |
| 4886 |
| 4887 <p>Array of covariant type is assigned to a local variable. This is confusing an
d may lead to ArrayStoreException at runtime |
| 4888 if the reference of some other type will be stored in this array later like in t
he following code: |
| 4889 </p> |
| 4890 <p><code>Number[] arr = new Integer[10]; |
| 4891 arr[0] = 1.0; |
| 4892 </code></p> |
| 4893 <p>Consider changing the type of created array or the local variable type.</p>
|
| 4894 |
| 4895 |
| 4896 <h3><a name="CAA_COVARIANT_ARRAY_RETURN">CAA: Covariant array is returned from t
he method (CAA_COVARIANT_ARRAY_RETURN)</a></h3> |
| 4897 |
| 4898 |
| 4899 <p>Array of covariant type is returned from the method. This is confusing and ma
y lead to ArrayStoreException at runtime |
| 4900 if the calling code will try to store the reference of some other type in the re
turned array. |
| 4901 </p> |
| 4902 <p>Consider changing the type of created array or the method return type.</p>
|
| 4903 |
| 4904 |
4664 <h3><a name="CD_CIRCULAR_DEPENDENCY">CD: Test for circular dependencies among cl
asses (CD_CIRCULAR_DEPENDENCY)</a></h3> | 4905 <h3><a name="CD_CIRCULAR_DEPENDENCY">CD: Test for circular dependencies among cl
asses (CD_CIRCULAR_DEPENDENCY)</a></h3> |
4665 | 4906 |
4666 | 4907 |
4667 <p> | 4908 <p> |
4668 This class has a circular dependency with other classes. This makes building
these classes | 4909 This class has a circular dependency with other classes. This makes building
these classes |
4669 difficult, as each is dependent on the other to build correctly. Consider us
ing interfaces | 4910 difficult, as each is dependent on the other to build correctly. Consider us
ing interfaces |
4670 to break the hard dependency. | 4911 to break the hard dependency. |
4671 </p> | 4912 </p> |
4672 | 4913 |
4673 | 4914 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4825 <code>if ( Math.abs(x - y) < .0000001 )</code>. | 5066 <code>if ( Math.abs(x - y) < .0000001 )</code>. |
4826 See the Java Language Specification, section 4.2.4. | 5067 See the Java Language Specification, section 4.2.4. |
4827 </p> | 5068 </p> |
4828 | 5069 |
4829 | 5070 |
4830 <h3><a name="VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN">FS: Non-Boolean argumen
t formatted using %b format specifier (VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEA
N)</a></h3> | 5071 <h3><a name="VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEAN">FS: Non-Boolean argumen
t formatted using %b format specifier (VA_FORMAT_STRING_BAD_CONVERSION_TO_BOOLEA
N)</a></h3> |
4831 | 5072 |
4832 | 5073 |
4833 <p> | 5074 <p> |
4834 An argument not of type Boolean is being formatted with a %b format specifier. T
his won't throw an | 5075 An argument not of type Boolean is being formatted with a %b format specifier. T
his won't throw an |
4835 exception; instead, it will print true for any nonnull value, and false for null
. | 5076 exception; instead, it will print true for any non-null value, and false for nul
l. |
4836 This feature of format strings is strange, and may not be what you intended. | 5077 This feature of format strings is strange, and may not be what you intended. |
4837 </p> | 5078 </p> |
4838 | 5079 |
4839 | 5080 |
4840 <h3><a name="IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD">IA: Potential
ly ambiguous invocation of either an inherited or outer method (IA_AMBIGUOUS_INV
OCATION_OF_INHERITED_OR_OUTER_METHOD)</a></h3> | 5081 <h3><a name="IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD">IA: Potential
ly ambiguous invocation of either an inherited or outer method (IA_AMBIGUOUS_INV
OCATION_OF_INHERITED_OR_OUTER_METHOD)</a></h3> |
4841 | 5082 |
4842 | 5083 |
4843 <p> | 5084 <p> |
4844 An inner class is invoking a method that could be resolved to either a inherited
method or a method defined in an outer class. | 5085 An inner class is invoking a method that could be resolved to either a inherited
method or a method defined in an outer class. |
4845 For example, you invoke <code>foo(17)</code>, which is defined in both a supercl
ass and in an outer method. | 5086 For example, you invoke <code>foo(17)</code>, which is defined in both a supercl
ass and in an outer method. |
4846 By the Java semantics, | 5087 By the Java semantics, |
4847 it will be resolved to invoke the inherited method, but this may not be want | 5088 it will be resolved to invoke the inherited method, but this may not be want |
4848 you intend. | 5089 you intend. |
4849 </p> | 5090 </p> |
4850 <p>If you really intend to invoke the inherited method, | 5091 <p>If you really intend to invoke the inherited method, |
4851 invoke it by invoking the method on super (e.g., invoke super.foo(17)), and | 5092 invoke it by invoking the method on super (e.g., invoke super.foo(17)), and |
4852 thus it will be clear to other readers of your code and to FindBugs | 5093 thus it will be clear to other readers of your code and to FindBugs |
4853 that you want to invoke the inherited method, not the method in the outer class. | 5094 that you want to invoke the inherited method, not the method in the outer class. |
4854 </p> | 5095 </p> |
4855 <p>If you call <code>this.foo(17)</code>, then the inherited method will be invo
ked. However, since FindBugs only looks at | 5096 <p>If you call <code>this.foo(17)</code>, then the inherited method will be invo
ked. However, since FindBugs only looks at |
4856 classfiles, it | 5097 classfiles, it |
4857 can't tell the difference between an invocation of <code>this.foo(17)</code> and
<code>foo(17)</code>, it will still | 5098 can't tell the difference between an invocation of <code>this.foo(17)</code> and
<code>foo(17)</code>, it will still |
4858 complain about a potential ambiguous invocation. | 5099 complain about a potential ambiguous invocation. |
4859 </p> | 5100 </p> |
4860 | 5101 |
4861 | 5102 |
4862 <h3><a name="IC_INIT_CIRCULARITY">IC: Initialization circularity (IC_INIT_CIRCUL
ARITY)</a></h3> | 5103 <h3><a name="IC_INIT_CIRCULARITY">IC: Initialization circularity (IC_INIT_CIRCUL
ARITY)</a></h3> |
4863 | 5104 |
4864 | 5105 |
4865 <p> A circularity was detected in the static initializers of the two | 5106 <p> A circularity was detected in the static initializers of the two |
4866 classes referenced by the bug instance. Many kinds of unexpected | 5107 classes referenced by the bug instance. Many kinds of unexpected |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5007 to read, readLine() will return null and dereferencing that will generate a null
pointer exception. | 5248 to read, readLine() will return null and dereferencing that will generate a null
pointer exception. |
5008 </p> | 5249 </p> |
5009 | 5250 |
5010 | 5251 |
5011 <h3><a name="NP_LOAD_OF_KNOWN_NULL_VALUE">NP: Load of known null value (NP_LOAD_
OF_KNOWN_NULL_VALUE)</a></h3> | 5252 <h3><a name="NP_LOAD_OF_KNOWN_NULL_VALUE">NP: Load of known null value (NP_LOAD_
OF_KNOWN_NULL_VALUE)</a></h3> |
5012 | 5253 |
5013 | 5254 |
5014 <p> The variable referenced at this point is known to be null due to an earlie
r | 5255 <p> The variable referenced at this point is known to be null due to an earlie
r |
5015 check against null. Although this is valid, it might be a mistake (perhaps yo
u | 5256 check against null. Although this is valid, it might be a mistake (perhaps yo
u |
5016 intended to refer to a different variable, or perhaps the earlier check to see i
f the | 5257 intended to refer to a different variable, or perhaps the earlier check to see i
f the |
5017 variable is null should have been a check to see if it was nonnull). | 5258 variable is null should have been a check to see if it was non-null). |
5018 </p> | 5259 </p> |
5019 | 5260 |
5020 | 5261 |
5021 <h3><a name="NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION">NP: Method tightens nullne
ss annotation on parameter (NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION)</a></h3> | 5262 <h3><a name="NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION">NP: Method tightens nullne
ss annotation on parameter (NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION)</a></h3> |
5022 | 5263 |
5023 <p> | 5264 <p> |
5024 A method should always implement the contract of a method it overrides.
Thus, if a method takes a parameter | 5265 A method should always implement the contract of a method it overrides.
Thus, if a method takes a parameter |
5025 » that is marked as @Nullable, you shouldn't override that method in a sub
class with a method where that parameter is @Nonnull. | 5266 that is marked as @Nullable, you shouldn't override that method in a subclas
s with a method where that parameter is @Nonnull. |
5026 » Doing so violates the contract that the method should handle a null para
meter. | 5267 Doing so violates the contract that the method should handle a null paramete
r. |
5027 </p> | 5268 </p> |
5028 | 5269 |
5029 <h3><a name="NP_METHOD_RETURN_RELAXING_ANNOTATION">NP: Method relaxes nullness a
nnotation on return value (NP_METHOD_RETURN_RELAXING_ANNOTATION)</a></h3> | 5270 <h3><a name="NP_METHOD_RETURN_RELAXING_ANNOTATION">NP: Method relaxes nullness a
nnotation on return value (NP_METHOD_RETURN_RELAXING_ANNOTATION)</a></h3> |
5030 | 5271 |
5031 <p> | 5272 <p> |
5032 A method should always implement the contract of a method it overrides.
Thus, if a method takes is annotated | 5273 A method should always implement the contract of a method it overrides.
Thus, if a method takes is annotated |
5033 » as returning a @Nonnull value, | 5274 as returning a @Nonnull value, |
5034 » you shouldn't override that method in a subclass with a method annotated
as returning a @Nullable or @CheckForNull value. | 5275 you shouldn't override that method in a subclass with a method annotated as
returning a @Nullable or @CheckForNull value. |
5035 » Doing so violates the contract that the method shouldn't return null. | 5276 Doing so violates the contract that the method shouldn't return null. |
5036 </p> | 5277 </p> |
5037 | 5278 |
5038 <h3><a name="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE">NP: Possible null pointer d
ereference due to return value of called method (NP_NULL_ON_SOME_PATH_FROM_RETUR
N_VALUE)</a></h3> | 5279 <h3><a name="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE">NP: Possible null pointer d
ereference due to return value of called method (NP_NULL_ON_SOME_PATH_FROM_RETUR
N_VALUE)</a></h3> |
5039 | 5280 |
5040 | 5281 |
5041 <p> The return value from a method is dereferenced without a null check, | 5282 <p> The return value from a method is dereferenced without a null check, |
5042 and the return value of that method is one that should generally be checked | 5283 and the return value of that method is one that should generally be checked |
5043 for null. This may lead to a <code>NullPointerException</code> when the code is
executed. | 5284 for null. This may lead to a <code>NullPointerException</code> when the code is
executed. |
5044 </p> | 5285 </p> |
5045 | 5286 |
5046 | 5287 |
5047 <h3><a name="NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE">NP: Possible null pointer
dereference on branch that might be infeasible (NP_NULL_ON_SOME_PATH_MIGHT_BE_I
NFEASIBLE)</a></h3> | 5288 <h3><a name="NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE">NP: Possible null pointer
dereference on branch that might be infeasible (NP_NULL_ON_SOME_PATH_MIGHT_BE_I
NFEASIBLE)</a></h3> |
5048 | 5289 |
5049 | 5290 |
5050 <p> There is a branch of statement that, <em>if executed,</em> guarantees that | 5291 <p> There is a branch of statement that, <em>if executed,</em> guarantees that |
5051 a null value will be dereferenced, which | 5292 a null value will be dereferenced, which |
5052 would generate a <code>NullPointerException</code> when the code is executed. | 5293 would generate a <code>NullPointerException</code> when the code is executed. |
5053 Of course, the problem might be that the branch or statement is infeasible and t
hat | 5294 Of course, the problem might be that the branch or statement is infeasible and t
hat |
5054 the null pointer exception can't ever be executed; deciding that is beyond the a
bility of FindBugs. | 5295 the null pointer exception can't ever be executed; deciding that is beyond the a
bility of FindBugs. |
5055 Due to the fact that this value had been previously tested for nullness, | 5296 Due to the fact that this value had been previously tested for nullness, |
5056 this is a definite possibility. | 5297 this is a definite possibility. |
5057 </p> | 5298 </p> |
5058 | 5299 |
5059 | 5300 |
5060 <h3><a name="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE">NP: Parameter
must be nonnull but is marked as nullable (NP_PARAMETER_MUST_BE_NONNULL_BUT_MARK
ED_AS_NULLABLE)</a></h3> | 5301 <h3><a name="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE">NP: Parameter
must be non-null but is marked as nullable (NP_PARAMETER_MUST_BE_NONNULL_BUT_MAR
KED_AS_NULLABLE)</a></h3> |
5061 | 5302 |
5062 | 5303 |
5063 <p> This parameter is always used in a way that requires it to be nonnull, | 5304 <p> This parameter is always used in a way that requires it to be non-null, |
5064 but the parameter is explicitly annotated as being Nullable. Either the use | 5305 but the parameter is explicitly annotated as being Nullable. Either the use |
5065 of the parameter or the annotation is wrong. | 5306 of the parameter or the annotation is wrong. |
5066 </p> | 5307 </p> |
5067 | 5308 |
5068 | 5309 |
5069 <h3><a name="NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">NP: Read of unwritten publi
c or protected field (NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD)</a></h3> | 5310 <h3><a name="NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD">NP: Read of unwritten publi
c or protected field (NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD)</a></h3> |
5070 | 5311 |
5071 | 5312 |
5072 <p> The program is dereferencing a public or protected | 5313 <p> The program is dereferencing a public or protected |
5073 field that does not seem to ever have a non-null value written to it. | 5314 field that does not seem to ever have a non-null value written to it. |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5217 | 5458 |
5218 <h3><a name="RV_CHECK_FOR_POSITIVE_INDEXOF">RV: Method checks to see if result o
f String.indexOf is positive (RV_CHECK_FOR_POSITIVE_INDEXOF)</a></h3> | 5459 <h3><a name="RV_CHECK_FOR_POSITIVE_INDEXOF">RV: Method checks to see if result o
f String.indexOf is positive (RV_CHECK_FOR_POSITIVE_INDEXOF)</a></h3> |
5219 | 5460 |
5220 | 5461 |
5221 <p> The method invokes String.indexOf and checks to see if the result is posi
tive or non-positive. | 5462 <p> The method invokes String.indexOf and checks to see if the result is posi
tive or non-positive. |
5222 It is much more typical to check to see if the result is negative or non-nega
tive. It is | 5463 It is much more typical to check to see if the result is negative or non-nega
tive. It is |
5223 positive only if the substring checked for occurs at some place other than at
the beginning of | 5464 positive only if the substring checked for occurs at some place other than at
the beginning of |
5224 the String.</p> | 5465 the String.</p> |
5225 | 5466 |
5226 | 5467 |
5227 <h3><a name="RV_DONT_JUST_NULL_CHECK_READLINE">RV: Method discards result of rea
dLine after checking if it is nonnull (RV_DONT_JUST_NULL_CHECK_READLINE)</a></h3
> | 5468 <h3><a name="RV_DONT_JUST_NULL_CHECK_READLINE">RV: Method discards result of rea
dLine after checking if it is non-null (RV_DONT_JUST_NULL_CHECK_READLINE)</a></h
3> |
5228 | 5469 |
5229 | 5470 |
5230 <p> The value returned by readLine is discarded after checking to see if the
return | 5471 <p> The value returned by readLine is discarded after checking to see if the
return |
5231 value is non-null. In almost all situations, if the result is non-null, you will
want | 5472 value is non-null. In almost all situations, if the result is non-null, you will
want |
5232 to use that non-null value. Calling readLine again will give you a different lin
e.</p> | 5473 to use that non-null value. Calling readLine again will give you a different lin
e.</p> |
5233 | 5474 |
5234 | 5475 |
5235 <h3><a name="RV_REM_OF_HASHCODE">RV: Remainder of hashCode could be negative (RV
_REM_OF_HASHCODE)</a></h3> | 5476 <h3><a name="RV_REM_OF_HASHCODE">RV: Remainder of hashCode could be negative (RV
_REM_OF_HASHCODE)</a></h3> |
5236 | 5477 |
5237 | 5478 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5272 </p> | 5513 </p> |
5273 <p>We are guessing that ignoring the return value might be a bad idea just from | 5514 <p>We are guessing that ignoring the return value might be a bad idea just from |
5274 a simple analysis of the body of the method. You can use a @CheckReturnValue ann
otation | 5515 a simple analysis of the body of the method. You can use a @CheckReturnValue ann
otation |
5275 to instruct FindBugs as to whether ignoring the return value of this method | 5516 to instruct FindBugs as to whether ignoring the return value of this method |
5276 is important or acceptable. | 5517 is important or acceptable. |
5277 </p> | 5518 </p> |
5278 <p>Please investigate this closely to decide whether it is OK to ignore the retu
rn value. | 5519 <p>Please investigate this closely to decide whether it is OK to ignore the retu
rn value. |
5279 </p> | 5520 </p> |
5280 | 5521 |
5281 | 5522 |
| 5523 <h3><a name="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT">RV: Return value of method
without side effect is ignored (RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT)</a></h3> |
| 5524 |
| 5525 |
| 5526 <p>This code calls a method and ignores the return value. However our analysis s
hows that |
| 5527 the method (including its implementations in subclasses if any) does not produce
any effect |
| 5528 other than return value. Thus this call can be removed. |
| 5529 </p> |
| 5530 <p>We are trying to reduce the false positives as much as possible, but in some
cases this warning might be wrong. |
| 5531 Common false-positive cases include:</p> |
| 5532 <p>- The method is designed to be overridden and produce a side effect in other
projects which are out of the scope of the analysis.</p> |
| 5533 <p>- The method is called to trigger the class loading which may have a side eff
ect.</p> |
| 5534 <p>- The method is called just to get some exception.</p> |
| 5535 <p>If you feel that our assumption is incorrect, you can use a @CheckReturnValue
annotation |
| 5536 to instruct FindBugs that ignoring the return value of this method is acceptable
. |
| 5537 </p> |
| 5538 |
| 5539 |
5282 <h3><a name="SA_FIELD_DOUBLE_ASSIGNMENT">SA: Double assignment of field (SA_FIEL
D_DOUBLE_ASSIGNMENT)</a></h3> | 5540 <h3><a name="SA_FIELD_DOUBLE_ASSIGNMENT">SA: Double assignment of field (SA_FIEL
D_DOUBLE_ASSIGNMENT)</a></h3> |
5283 | 5541 |
5284 | 5542 |
5285 <p> This method contains a double assignment of a field; e.g. | 5543 <p> This method contains a double assignment of a field; e.g. |
5286 </p> | 5544 </p> |
5287 <pre> | 5545 <pre> |
5288 int x,y; | 5546 int x,y; |
5289 public void foo() { | 5547 public void foo() { |
5290 x = x = 17; | 5548 x = x = 17; |
5291 } | 5549 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5328 <p> This method contains a switch statement where one case branch will fall th
rough to the next case. | 5586 <p> This method contains a switch statement where one case branch will fall th
rough to the next case. |
5329 Usually you need to end this case with a break or return.</p> | 5587 Usually you need to end this case with a break or return.</p> |
5330 | 5588 |
5331 | 5589 |
5332 <h3><a name="SF_SWITCH_NO_DEFAULT">SF: Switch statement found where default case
is missing (SF_SWITCH_NO_DEFAULT)</a></h3> | 5590 <h3><a name="SF_SWITCH_NO_DEFAULT">SF: Switch statement found where default case
is missing (SF_SWITCH_NO_DEFAULT)</a></h3> |
5333 | 5591 |
5334 | 5592 |
5335 <p> This method contains a switch statement where default case is missing. | 5593 <p> This method contains a switch statement where default case is missing. |
5336 Usually you need to provide a default case.</p> | 5594 Usually you need to provide a default case.</p> |
5337 <p>Because the analysis only looks at the generated bytecode, this warning can
be incorrect triggered if | 5595 <p>Because the analysis only looks at the generated bytecode, this warning can
be incorrect triggered if |
5338 the default case is at the end of the switch statement and doesn't end with a br
eak statement. | 5596 the default case is at the end of the switch statement and the switch statement
doesn't contain break statements for other |
| 5597 cases. |
5339 | 5598 |
5340 | 5599 |
5341 <h3><a name="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD">ST: Write to static field
from instance method (ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD)</a></h3> | 5600 <h3><a name="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD">ST: Write to static field
from instance method (ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD)</a></h3> |
5342 | 5601 |
5343 | 5602 |
5344 <p> This instance method writes to a static field. This is tricky to get | 5603 <p> This instance method writes to a static field. This is tricky to get |
5345 correct if multiple instances are being manipulated, | 5604 correct if multiple instances are being manipulated, |
5346 and generally bad practice. | 5605 and generally bad practice. |
5347 </p> | 5606 </p> |
5348 | 5607 |
(...skipping 29 matching lines...) Expand all Loading... |
5378 <h3><a name="TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK">TQ: Value requ
ired to not have type qualifier, but marked as unknown (TQ_EXPLICIT_UNKNOWN_SOUR
CE_VALUE_REACHES_NEVER_SINK)</a></h3> | 5637 <h3><a name="TQ_EXPLICIT_UNKNOWN_SOURCE_VALUE_REACHES_NEVER_SINK">TQ: Value requ
ired to not have type qualifier, but marked as unknown (TQ_EXPLICIT_UNKNOWN_SOUR
CE_VALUE_REACHES_NEVER_SINK)</a></h3> |
5379 | 5638 |
5380 | 5639 |
5381 <p> | 5640 <p> |
5382 A value is used in a way that requires it to be never be a value denoted b
y a type qualifier, but | 5641 A value is used in a way that requires it to be never be a value denoted b
y a type qualifier, but |
5383 there is an explicit annotation stating that it is not known where the value
is prohibited from having that type qualifier. | 5642 there is an explicit annotation stating that it is not known where the value
is prohibited from having that type qualifier. |
5384 Either the usage or the annotation is incorrect. | 5643 Either the usage or the annotation is incorrect. |
5385 </p> | 5644 </p> |
5386 | 5645 |
5387 | 5646 |
| 5647 <h3><a name="UC_USELESS_CONDITION">UC: Condition has no effect (UC_USELESS_CONDI
TION)</a></h3> |
| 5648 |
| 5649 |
| 5650 <p>This condition always produces the same result as the value of the involved v
ariable was narrowed before. |
| 5651 Probably something else was meant or condition can be removed.</p> |
| 5652 |
| 5653 |
| 5654 <h3><a name="UC_USELESS_CONDITION_TYPE">UC: Condition has no effect due to the v
ariable type (UC_USELESS_CONDITION_TYPE)</a></h3> |
| 5655 |
| 5656 |
| 5657 <p>This condition always produces the same result due to the type range of the i
nvolved variable. |
| 5658 Probably something else was meant or condition can be removed.</p> |
| 5659 |
| 5660 |
| 5661 <h3><a name="UC_USELESS_OBJECT">UC: Useless object created (UC_USELESS_OBJECT)</
a></h3> |
| 5662 |
| 5663 |
| 5664 <p>Our analysis shows that this object is useless. |
| 5665 It's created and modified, but its value never go outside of the method or produ
ce any side-effect. |
| 5666 Either there is a mistake and object was intended to be used or it can be remove
d.</p> |
| 5667 <p>This analysis rarely produces false-positives. Common false-positive cases in
clude:</p> |
| 5668 <p>- This object used to implicitly throw some obscure exception.</p> |
| 5669 <p>- This object used as a stub to generalize the code.</p> |
| 5670 <p>- This object used to hold strong references to weak/soft-referenced objects.
</p> |
| 5671 |
| 5672 |
| 5673 <h3><a name="UC_USELESS_OBJECT_STACK">UC: Useless object created on stack (UC_US
ELESS_OBJECT_STACK)</a></h3> |
| 5674 |
| 5675 |
| 5676 <p>This object is created just to perform some modifications which don't have an
y side-effect. |
| 5677 Probably something else was meant or the object can be removed.</p> |
| 5678 |
| 5679 |
| 5680 <h3><a name="UC_USELESS_VOID_METHOD">UC: Useless non-empty void method (UC_USELE
SS_VOID_METHOD)</a></h3> |
| 5681 |
| 5682 |
| 5683 <p>Our analysis shows that this non-empty void method does not actually perform
any useful work. |
| 5684 Please check it: probably there's a mistake in its code or its body can be fully
removed. |
| 5685 </p> |
| 5686 <p>We are trying to reduce the false positives as much as possible, but in some
cases this warning might be wrong. |
| 5687 Common false-positive cases include:</p> |
| 5688 <p>- The method is intended to trigger loading of some class which may have a si
de effect.</p> |
| 5689 <p>- The method is intended to implicitly throw some obscure exception.</p> |
| 5690 |
| 5691 |
5388 <h3><a name="UCF_USELESS_CONTROL_FLOW">UCF: Useless control flow (UCF_USELESS_CO
NTROL_FLOW)</a></h3> | 5692 <h3><a name="UCF_USELESS_CONTROL_FLOW">UCF: Useless control flow (UCF_USELESS_CO
NTROL_FLOW)</a></h3> |
5389 | 5693 |
5390 | 5694 |
5391 <p> This method contains a useless control flow statement, where | 5695 <p> This method contains a useless control flow statement, where |
5392 control flow continues onto the same place regardless of whether or not | 5696 control flow continues onto the same place regardless of whether or not |
5393 the branch is taken. For example, | 5697 the branch is taken. For example, |
5394 this is caused by having an empty statement | 5698 this is caused by having an empty statement |
5395 block for an <code>if</code> statement:</p> | 5699 block for an <code>if</code> statement:</p> |
5396 <pre> | 5700 <pre> |
5397 if (argv.length == 0) { | 5701 if (argv.length == 0) { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5488 | 5792 |
5489 | 5793 |
5490 <hr> <p> | 5794 <hr> <p> |
5491 <script language="JavaScript" type="text/javascript"> | 5795 <script language="JavaScript" type="text/javascript"> |
5492 <!---//hide script from old browsers | 5796 <!---//hide script from old browsers |
5493 document.write( "Last updated "+ document.lastModified + "." ); | 5797 document.write( "Last updated "+ document.lastModified + "." ); |
5494 //end hiding contents ---> | 5798 //end hiding contents ---> |
5495 </script> | 5799 </script> |
5496 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbu
gs@cs.umd.edu</a> | 5800 <p> Send comments to <a class="sidebar" href="mailto:findbugs@cs.umd.edu">findbu
gs@cs.umd.edu</a> |
5497 <p> | 5801 <p> |
5498 <A href="http://sourceforge.net"><IMG src="http://sourceforge.net/sflogo.php?gro
up_id=96405&type=5" width="210" height="62" border="0" alt="SourceForge.net
Logo" /></A> | 5802 <a href="http://sourceforge.net/projects/findbugs/"><img src="http://sourceforge
.net/sflogo.php?group_id=96405&type=5" width="210" height="62" border="0" al
t="FindBugs on SourceForge.net" /></a> |
5499 </td></tr></table> | 5803 </td></tr></table> |
5500 </body></html> | 5804 </body></html> |
OLD | NEW |