-
Notifications
You must be signed in to change notification settings - Fork 45
/
messages.xml
executable file
·6065 lines (5559 loc) · 268 KB
/
messages.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<MessageCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="messagecollection.xsd">
<Plugin>
<ShortDescription>fb-contrib plugin</ShortDescription>
<Details>
<![CDATA[
<p>This plugin contains FindBugs detectors from the fb-contrib project</p>
]]>
</Details>
<BugsUrl>http://fb-contrib.sourceforge.net/bugdescriptions.html</BugsUrl>
<AllBugsUrl>http://fb-contrib.sourceforge.net/bugdescriptions.html</AllBugsUrl>
</Plugin>
<!-- Detectors -->
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics">
<Details>
<![CDATA[
<p>Collects statistics for other detectors</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.collect.CollectMethodsReturningImmutableCollections">
<Details>
<![CDATA[
<p>Collects method calls that may return immutable collections</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.InefficientStringBuffering">
<Details>
<![CDATA[
<p>Looks for appending strings inside of calls to StringBuffer or StringBuilder append.</p>
<pre>
StringBuilder sb = new StringBuilder();
sb.append(a + b);
return sb.toString();
</pre>
You should use the .append method to append values
<pre>
sb.append(a).append(b);
</pre>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.SyncCollectionIterators">
<Details>
<![CDATA[
<p>Looks for use of iterators on synchronized collections built from the java.util.Collections class.</p>
<p>As the collection in question was built through Collections.synchronizedXXX, an assumption
is made that this collection must be multithreaded safe. However, iterator access is used,
which is explicitly unsafe. When iterators are to be used, synchronization should be done manually.</p>
<p>It is a slow detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.CyclomaticComplexity">
<Details>
<![CDATA[
<p>Calculates the McCabe Cyclomatic Complexity measure and reports methods that have an
excessive value. This report value can be set with system property 'fb-contrib.cc.limit'.</p>
<p>It is a slow detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.OverlyConcreteParameter">
<Details>
<![CDATA[
<p>Looks for parameters that are defined by classes, but where the method only use methods defined by an
implemented interface or superclass of that class. Relying on concrete classes in public signatures causes cohesion,
and makes low impact changes more difficult.</p>
<p>It is a slow detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.ListIndexedIterating">
<Details>
<![CDATA[
<p>Looks for for loops that iterate over a java.util.List using an integer index, and get,
rather than using an Iterator. An iterator may perform better depending on List implementation,
but more importantly will allow the code to be converted to other collection types.</p>
<p>It is a moderately fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.UnrelatedCollectionContents">
<Details>
<![CDATA[
<p>Looks for collections or arrays that hold objects that are unrelated through class or
interface inheritance other than java.lang.Object. Doing so makes for brittle code,
relying either on positional correspondence for type, or a reliance on instanceof to
determine type. A better design usually can be had by creating a separate class,
which defines the different types required, and add an instance of that class to the
collection, or array.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.RuntimeExceptionDeclared">
<Details>
<![CDATA[
<p>Looks for methods that declare RuntimeExceptions in their throws clause. While doing
so is not illegal, it may represent a misunderstanding as to the exception in question.
If a RuntimeException is declared, it implies that this exception type is expected to happen,
which if true should be handled in code, and not propagated. </p>
<p>It is a fast detector.</p>
<p>As an example, every method could be declared like this:
<code>
public void foo() throws NullPointerException {
}
</code>
But what does that tell you? Is this method very very likely to throw NullPointerExceptions?
If it is, why isn't this method handling them so that exceptions aren't thrown. So don't do this.
If an NPE is very likely, then check for it, and handle the situation.
</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.ClassEnvy">
<Details>
<![CDATA[
<p><em>THIS DETECTOR IS HIGHLY EXPERIMENTAL AND IS LIKELY TO CREATE A LOT OF FUD</em></p>
<p>Looks for methods that use a high percentage of methods from another class over its own
methods. When this is the case, it is often better to implement this method in that other class,
by refactoring the class to accept parameters it needs from the source class.
The reporting percentage can be set with system property 'fb-contrib.ce.percent'.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.LiteralStringComparison">
<Details>
<![CDATA[
<p>Looks for methods that compare strings against literal strings, where the literal string
is passed as the parameter. If the .equals or .compareTo is called on the literal itself, passing
the variable as the parameter, you avoid the possibility of a NullPointerException.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.PartiallyConstructedObjectAccess">
<Details>
<![CDATA[
<p>Looks for constructors of non-final classes that make method calls to non-final methods.
As these methods could be overridden, the overridden method will be accessing an object that
is only partially constructed, perhaps causing problems. Making these called methods final is
an easy fix, where possible.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.DubiousListCollection">
<Details>
<![CDATA[
<p>Looks for fields that are implementations of java.util.List, but that are used in a set-like fashion.
Since lookup type operations are performed using a linear search for Lists, the performance for large
Lists will be poor. Consideration should be made as to whether these fields should be sets. In the
case that order is important, consider using LinkedHashSet.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.ParallelLists">
<Details>
<![CDATA[
<p>Looks for classes that maintain two or more lists or arrays associated one-for-one through the same index
to hold two or more pieces of related information. It would be better to create a new class that holds
all of these pieces of information, and place instances of this class in one list. Or if the two list are
related in key/value fashion, then use a map instead.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.FinalParameters">
<Details>
<![CDATA[
<p>Looks for methods that correctly do not write to a parameter. To help document this you should consider
defining these parameters as final.</p>
<p>It is a slow detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.AbstractClassEmptyMethods">
<Details>
<![CDATA[
<p>Looks for abstract classes that define empty methods or methods that simply throw an
exception. Since this is an abstract class, it may be cleaner to simple define this method
as abstract, so that correct subclass behavior is enforced.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.ManualArrayCopy">
<Details>
<![CDATA[
<p>Looks for methods that copy data from one array to another using a loop. It is
better performing to use System.arraycopy to do such copying as this is a native method.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.FloatingPointLoops">
<Details>
<![CDATA[
<p>Looks for methods that use floating point indexes for loops. Since floating point
math is imprecise, rounding errors will occur each time through the loop causing
hard to find problems. It is usually better to use integer indexing, and calculating
the correct floating point value from the index.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.NonCollectionMethodUse">
<Details>
<![CDATA[
<p>Looks for method calls to collection classes where the method is not defined by the Collections
interface, and an equivalent method exists in the interface. Examples include:<br/>
<table border="1">
<tr><th>Old Method</th><th>New Method</th></tr>
<tr><td>Hashtable.contains</td><td>Map.containsValue</td></tr>
<tr><td>Hashtable.elements</td><td>Map.elements</td></tr>
<tr><td>Hashtable.keys</td><td>Map.keySet</td></tr>
<tr><td>Vector.addElement</td><td>List.add</td></tr>
<tr><td>Vector.elementAt</td><td>List.get</td></tr>
<tr><td>Vector.insertElementAt</td><td>List.add</td></tr>
<tr><td>Vector.removeAllElements</td><td>List.clear</td></tr>
<tr><td>Vector.removeElement</td><td>List.remove</td></tr>
<tr><td>Vector.removeElementAt</td><td>List.remove</td></tr>
<tr><td>Vector.setElementAt</td><td>List.set</td></tr>
</table>
</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingAutoboxedOverloading">
<Details>
<![CDATA[
<p>Looks for methods that have the same signature, except where one uses a
Character parameter, and the other uses an int, long, float, double parameter.
Since autoboxing is available in 1.5 one might assume that
<pre><code>
test('a')
</code></pre>
would map to
<pre><code>
public void test(Character c)
</code></pre>
but instead maps to one that takes an int, long, float or double, such as
<pre><code>
public void test(int i)
</code></pre>
</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.AbnormalFinallyBlockReturn">
<Details>
<![CDATA[
<p>Looks for methods that have finally blocks that return values
or throw exceptions. This code will swallow normal program flow and
hide real program logic.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.StaticMethodInstanceInvocation">
<Details>
<![CDATA[
<p>Looks for methods that make static method calls using an instance reference.
For documentation purposes, it is better to call the method using the class name.
This may represent a change in definition that should be noticed.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.SpuriousThreadStates">
<Details>
<![CDATA[
<p>Looks for methods that call wait, notify or notifyAll on an instance of a
java.lang.Thread. Since the internal workings of the threads is to synchronize on the
thread itself, introducing client calls will confuse the thread state of the object
in question, and will cause spurious thread state changes, either waking threads up
when not intended, or removing the thread from the runnable state.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessAutoboxing">
<Details>
<![CDATA[
<p>Looks for methods that pass a primitive wrapper class object to the
same class' Constructor. Patterns found are:
<ul>
<li>new Boolean(Boolean)</li>
<li>new Byte(Byte)</li>
<li>new Character(Character)</li>
<li>new Short(Short)</li>
<li>new Integer(Integer)</li>
<li>new Long(Long)</li>
<li>new Float(Float)</li>
<li>new Double(Double)</li>
</ul>
Since primitive wrapper classes are immutable this is needless garbage being created. Just
use the original reference.
</p>
<p>It also looks for calls to BoxedClass.valueOf(x) where X is already a BoxedClass</p>
<p>It also looks for calls to BoxedClass.valueOf(myString).boxedValue(), when instead it is
simpler to use BoxedClass.parseBoxed(myString)</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.UnnecessaryStoreBeforeReturn">
<Details>
<![CDATA[
<p>Looks for methods that store the return result in a local variable and
then immediately return that local variable. It is simpler to just return
the method (or assignment) result directly.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.CopiedOverriddenMethod">
<Details>
<![CDATA[
<p>Looks for methods that are direct copies of the implementation in the superclass.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.ArrayBasedCollections">
<Details>
<![CDATA[
<p>Looks for methods that use arrays for items in the keySet of a map, or as
an element of a set, or in a list when using the contains method. Since arrays
do not, and cannot define an equals method, reference equality is used for these
collections, which is probably not desired. If it is, consider using the IdentityHashMap
class when using Maps in this case, to better document your intentions.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.OrphanedDOMNode">
<Details>
<![CDATA[
<p>Looks for methods that create DOM nodes but do not add them to any DOM Document.
Either the node was needed to be added to the tree, or the node likely was created in error.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.AbstractOverriddenMethod">
<Details>
<![CDATA[
<p>Looks for methods that are declared as abstract that override concrete methods in a
superclass. Doing this casts away the implementation of the superclass, and breaks
the contract as set forth by the parent class.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.CustomBuiltXML">
<Details>
<![CDATA[
<p>Looks for methods that build XML based strings by concatenation strings
and custom values together. Doing so makes brittle code, that is difficult to
modify, validate and understand. It is cleaner to create external XML files that are
transformed at runtime, using parameters set through Transformer.setParameter.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedSynchronizedBlock">
<Details>
<![CDATA[
<p>Looks for methods that are implemented using synchronized blocks, but are overly
synchronized because the beginning of the block only accesses local variables,
and not member variables, or this.</p>
<p>It is a slow detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.ConstantListIndex">
<Details>
<![CDATA[
<p>Looks for methods that access arrays or classes that implement java.util.List
using a constant integer for the index. This is often a typo intended to be a loop
variable, but if specific indices mean certain things, perhaps a first class object
would be a better choice for a container, on even a map with informative key names
would be better.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.SloppyClassReflection">
<Details>
<![CDATA[
<p>Looks for methods that use Class.forName("XXX") to load a class object
for a class that is already referenced by this class. It is simpler to just use
XXX.class, and doing so protects the integrity of this code from such transformations
as obfuscation. Use of Class.forName should only be used when the class in question
isn't already statically bound to this context.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.ArrayWrappedCallByReference">
<Details>
<![CDATA[
<p>Looks for methods that use an array of length one to pass a variable to achieve call
by pointer ala C++. It is better to define a proper return class type that holds all
the relevant information retrieved from the called method.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.SluggishGui">
<Details>
<![CDATA[
<p>Looks for methods that implement AWT or Swing listeners and perform time
consuming operations. Doing these operations in the GUI thread will cause the
interface to appear sluggish and non-responsive to the user. It is better to
use a separate thread to do the time consuming work so that the user
has a better experience.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessInstanceRetrieval">
<Details>
<![CDATA[
<p>Looks for methods that call a method to retrieve a reference to an object,
to use to load a constant. It is simpler and more performant to access the
static variable directly from the class itself.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.DateComparison">
<Details>
<![CDATA[
<p>Looks for inefficient comparison of Date objects using two comparisons when one would do.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousWaitOnConcurrentObject">
<Details>
<![CDATA[
<p>Looks for calls to the wait method on mutexes defined in the java.util.concurrent
package where it is likely that await was intended.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.JDBCVendorReliance">
<Details>
<![CDATA[
<p>Looks for uses of JDBC vendor specific classes and methods making the database
access code non-portable.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.PossibleMemoryBloat">
<Details>
<![CDATA[
<p>Looks for classes that maintain collections or StringBuffer/StringBuilders in
static member variables, and that do not appear to provide a way to clear or remove
items from these members. Such class fields are likely causes of memory bloat.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.LocalSynchronizedCollection">
<Details>
<![CDATA[
<p>Looks for allocations of synchronized collections that are stored in local
variables, and never stored in fields or returned from methods. As local variables
are by definition thread safe, using synchronized collections in this context
makes no sense.</p>
<p>It is a moderately fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.FieldCouldBeLocal">
<Details>
<![CDATA[
<p>Looks for classes that define fields that are used in a locals only fashion,
specifically private fields that are accessed first in each method with a
store vs. a load.</p>
<p>It is a slow detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.NonOwnedSynchronization">
<Details>
<![CDATA[
<p>Looks for methods that synchronize on variables that are not owned by the
current class. Doing this causes confusion when two classes use the same variable
for their own synchronization purposes. For cleanest separation of interests, only
synchronize on private fields of the class. Note that 'this' is not owned by
the current class and synchronization on 'this' should be avoided as well.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.NonRecycleableTaglibs">
<Details>
<![CDATA[
<p>Looks for tag libraries that are not recycleable because backing members
of taglib attributes are set in areas besides the setter method for the attribute.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.Section508Compliance">
<Details>
<![CDATA[
<p>Looks for violation of Section 508, Accessibility for People with disabilities Act.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.UseEnumCollections">
<Details>
<![CDATA[
<p>Looks for use of sets and maps using enums. It is more efficient to use EnumSet or EnumMap.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.SQLInLoop">
<Details>
<![CDATA[
<p>Looks for the execution of SQL queries inside a loop. This pattern tends to be inefficient,
and often can be improved upon, by collecting all the keys needed for the query and issuing just
one query using an in clause with all the keys for all the queries previously needed in the loop.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessMemberCollectionSynchronization">
<Details>
<![CDATA[
<p>Looks for classes that define private synchronized collections as static or instance
members, that are only altered in a static initializer or constructor. Since the multithreaded
use of this collection is read-only, the use of synchronization is unnecessary.</p>
<p>It is a moderately fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.InheritanceTypeChecking">
<Details>
<![CDATA[
<p>Looks for if/else blocks where a series of them use instanceof on the same
variable to determine what to do. If these classes are related by inheritance,
this often is better handled through calling a single overridden method.</p>
<p>It is a moderately fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.StaticArrayCreatedInMethod">
<Details>
<![CDATA[
<p>Looks for creation of arrays in methods using constant values. These arrays
will need to be recreated each time the method is called. These arrays should probably
be defined as static fields, instead.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.PossiblyRedundantMethodCalls">
<Details>
<![CDATA[
<p>Looks for calls of the same method on the same object when that object hasn't changed.
This often is redundant, and the second call can be removed, or combined.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.UseToArray">
<Details>
<![CDATA[
<p>Looks for code that builds an array of values from a collection, by manually looping
over the elements of the collection, and adding them to the array. It is simpler and
cleaner to use mycollection.toArray(new type[mycollection.size()]).</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.LostExceptionStackTrace">
<Details>
<![CDATA[
<p>Looks for methods that catch exceptions, and then throw a different exception
without embedding the original exception in the thrown one. Doing so, hides the real
source of the exception, making debugging and fixing these problems difficult.</p>
<p>It is a moderately fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.UseCharacterParameterizedMethod">
<Details>
<![CDATA[
<p>Looks for methods that pass single character string constants as parameters to
methods that alternatively have an overridden method that accepts a character instead.
It is easier for the method to handle a single character than a String.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.TailRecursion">
<Details>
<![CDATA[
<p>Looks for methods that make a recursive call to itself as the last statement in the
method. This tail recursion could be converted into a simple loop which would improve
the performance and stack requirements.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.UnrelatedReturnValues">
<Details>
<![CDATA[
<p>Looks for methods that are defined to return Object, and return different types of
objects based on different code paths. If this method is not based on an interface or
superclass, it is suggested to change the return type to a type that would accommodate
all kinds of return types.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.PossibleIncompleteSerialization">
<Details>
<![CDATA[
<p>Looks for classes that don't handle serialization of parent class member fields
when the class in question is serializable but is derived from a non serializable
classes.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousComparatorReturnValues">
<Details>
<![CDATA[
<p>Looks for classes that implement Comparator or Comparable, and whose compare or compareTo
methods return constant values only, but that don't represent the three possible choice
(a negative number, 0, and a positive number).</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.SillynessPotPourri">
<Details>
<![CDATA[
<p>Looks for a potpourri of small problems that do not fit into a common pattern.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope">
<Details>
<![CDATA[
<p><em>THIS DETECTOR IS HIGHLY EXPERIMENTAL AND IS LIKELY TO CREATE A LOT OF FUD</em></p>
<p>Looks for assignments to variables in a scope larger than its use. As long as the evaluation of the assignment
does not have side effects, the assignment can be moved into the inner scope where it is used.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.SpoiledChildInterfaceImplementor">
<Details>
<![CDATA[
<p>Looks for classes that implement interfaces by relying on methods being
implemented in superclasses, even though the superclass knows nothing about
the interface being implemented by the child.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.DeletingWhileIterating">
<Details>
<![CDATA[
<p>Looks for deletion of items from a collection using the remove method
of the collection at the same time that the collection is being iterated on. If
this occurs the iterator will become invalid and throw a ConcurrentModificationException.
Instead, the remove should be called on the iterator itself.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.UseSplit">
<Details>
<![CDATA[
<p>Looks for code that builds an array by using a StringTokenizer to break up
a string and place individual elements into an array. It is simpler to use
String.split instead.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousJDKVersionUse">
<Details>
<![CDATA[
<p>Looks for calls to classes and methods that do not exist in the JDK for which this class is
compiled. This can happen if you specify the <code>-source</code> and <code>-target</code> options of the javac compiler, and
specify a target that is less than the JDK version of the javac compiler.</p>
<p>It relies on the system property <code>-Dfb-contrib.sjvu.jdkhome=/path/to/older/jdk/to/check"</code> to specify
what JDK to compare against. On linux, you may need to give file permissions to findbugs to read these directories.
If this property is not set, this detector does nothing.</p>
<p>It is a slow detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.UseAddAll">
<Details>
<![CDATA[
<p>Looks for loops that transfer the contents of one collection to another. These collection sources might
be local variables or member fields, including sets, maps key/values, lists, or arrays. It is simpler to
just use the addAll method of the collection class. In the case where the source is an array, you can use
Arrays.asList(array), and use that as the source to addAll.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.MethodReturnsConstant">
<Details>
<![CDATA[
<p>Looks for private or static methods that only return one constant value. Since there is no
chance for derived classes overriding this behavior, the return of a constant value
seems dubious.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessCustomSerialization">
<Details>
<![CDATA[
<p>Looks for classes that implement the Serializable interface and implement the
standard readObject and writeObject methods by simply deferring to the Stream
parameter's defaultReadObject or defaultWriteObject and nothing else. As this is the
built in behavior, these methods are not needed.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.MisleadingOverloadModel">
<Details>
<![CDATA[
<p>Looks for classes that define both static and instance methods with the same name.
As each type represents a different use model, it doesn't make sense that this name
would be overloaded, and will confuse users of the class.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.ExceptionSoftening">
<Details>
<![CDATA[
<p>Looks for methods that catch checked exceptions, and throw unchecked
exceptions in their place. There are several levels of concern. Least
concerning are methods constrained by interface or superclass contracts
not to throw checked exceptions but appear owned by the same author. Next
are methods constrained by interface or superclass contracts and throw other
types of checked exceptions. Most egregious are methods not constrained by any interface
or superclass contract.</p>
<p>It is a moderately fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingFunctionSemantics">
<Details>
<![CDATA[
<p>Looks for methods that return a parameter after modifying that parameter.
Doing this will confuse the user of this method, as it will be assumed that the
passed in argument is different than the output, or at least won't be changed.
If the purpose of this method is just to modify the parameter, this method should
probably be changed to have a void return type. If you must return a variable, perhaps
a clone of the parameter should be returned.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.UnitTestAssertionOddities">
<Details>
<![CDATA[
<p>Looks for JUnit or TestNG test case methods that use assertions with odd parameters.
Including in this is:
<ul>
<li>Passing a constant as the second (actual) parameter in a JUnit test</li>
<li>Not using the three parameter version of asserts for doubles</li>
<li>Passing true or false as the first parameter instead of using assertTrue, or assertFalse</li>
<li>Using the assert keyword</li>
</ul>
</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousCloneAlgorithm">
<Details>
<![CDATA[
<p>Looks for implementations of clone where an assignment is made to a field of the
source object. It is likely that that store should have occurred on the cloned object, as
the clone operation is almost always considered read only.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.WeakExceptionMessaging">
<Details>
<![CDATA[
<p>Looks for exceptions that are thrown with static strings as messages. Using static strings
doesn't differentiate one use of this method versus another, and so it may be difficult
to determine how this exception occurred without showing context.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousClusteredSessionSupport">
<Details>
<![CDATA[
<p>Looks for code that fetches a complex object from an HttpSession attribute, modifies the
object, but does not call setAttribute again on this object. This will not inform the application server
that this object has changed, and thus will not correctly replicate these changes across the cluster.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.LoggerOddities">
<Details>
<![CDATA[
<p>Looks for odd patterns of use of Logger classes from either log4j, SLF4J or Commons Logging.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.IncorrectInternalClassUse">
<Details>
<![CDATA[
<p>Looks for classes that rely on internal classes in the various APIs or libraries. As these
classes are not officially released from the API vendor, they are subject to change or removal, and thus,
should not be counted on.</p>
Packages that shouldn't be used are:
<ul>
<li>sun.xxx</li>
<li>org.apache.xerces.xxx</li>
<li>org.apache.xalan.xxx</li>
</ul>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.DubiousSetOfCollections">
<Details>
<![CDATA[
<p>Looks for sets or keySets of maps that contain other collections. As typically collections calculate
their hashCode, equals and compareTo methods by iterating the collection and evaluating the same function
on each item in the collection, this can be costly from a performance point of view.</p>
<p>In addition, using a set, or keySet of a map, infers that you will be looking for items based on
the value of a collection, which seems dubious at best.</p>
<p>Finally, as collections are often modified, this may cause problems if the collection is modified,
thus changing hashCodes, etc, while the collection is in the set.</p>
<p>If you wish to keep a collection of collections, the outer collection should probably be a list
to avoid these problems.</p>
<p>It is a moderately fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.BogusExceptionDeclaration">
<Details>
<![CDATA[
<p>Looks for constructors, static methods and private methods that declare that they throw
checked exceptions that the actual code never throws. Since these methods can't be overridden,
there is no reason to add these exceptions to the method declaration.</p>
<p>It is a moderately fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.UnnecessaryNewNullCheck">
<Details>
<![CDATA[
<p>Looks for allocations of objects, and then immediately checking to see if the
object is null, or non null. As the new operator is guaranteed to either succeed, or throw
an exception, this null check is useless, and denotes a misunderstanding as to how
the JVM works. You can remove this guard.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.DeprecatedTypesafeEnumPattern">
<Details>
<![CDATA[
<p>Looks for classes that appear to implement the old style type safe enum pattern
that was used before Java added Enum support to the language. Since this class is
compiled with Java 1.5 or later, it would be simpler to just use Java enums.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.TristateBooleanPattern">
<Details>
<![CDATA[
<p>Looks for methods that are declared to return a Boolean, but return a null
value. As this now allows the method to return three values, the use of Boolean is
dubious. It would be better to just define a new enumeration with three values,
and return that.</p>
<p>It is a fast detector.</p>
]]>
</Details>
</Detector>
<Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousUninitializedArray">
<Details>
<![CDATA[