Name | Checked | Synopsis |
---|
Design1
|
 |
Classes with only static methods should have a private constructor |
Design2
|
 |
Avoid unnecessary if..then..else statements when returning a boolean |
Design3
|
 |
Avoid unnecessary comparisons in boolean expressions |
Design4
|
|
Switch statements should have a default label |
Design5
|
 |
Deeply nested if..then statements are hard to read |
Design6
|
 |
Avoid reassigning parameters |
Design7
|
 |
A high ratio of statements to labels in a switch statement. Consider refactoring |
Design8
|
 |
Don't call overridable methods during object construction |
Design9
|
 |
Avoid instantiation through private constructors from outside of the constructor's class |
Design10
|
 |
This final field could be made static |
Design11
|
 |
Ensure that resources are closed after use |
Design12
|
 |
Non-static initializers are confusing |
Design13
|
 |
The default label should be the last label in a switch statement |
Design14
|
 |
A non-case label was present in a switch statement |
Design15
|
 |
This call to Collection.toArray() may be optimizable |
Design16
|
 |
Avoid equality comparisons with Double.NaN |
Design17
|
 |
Avoid using equals() to compare against null |
Design18
|
 |
Avoid if (x != y) ..; else ..; |
Design19
|
 |
Avoid instantiating an object just to call getClass() on it; use the .class public member instead |
Design20
|
 |
Avoid idempotent operations (like assigning a variable to itself) |
Design21
|
 |
When instantiating a SimpleDateFormat object, specify a Locale |
Design22
|
 |
Declare private fields final, if possible |
Design23
|
 |
When doing a String.toLowerCase()/toUpperCase() call, use a Locale |
Design24
|
 |
Avoid protected fields in a final class. Change to private or package access |
Design25
|
 |
Possible unsafe assignment to a non-final static field in a constructor |
Design26
|
 |
Class cannot be instantiated and does not provide any static methods or fields |
Design27
|
 |
Use block level rather than method level synchronization |
Design28
|
 |
A switch statement does not contain a break |
Design29
|
 |
Call Thread.notifyAll() rather than Thread.notify() |
Design30
|
 |
An instanceof check is being performed on the caught exception. Create a separate catch clause for this exception type |
Design31
|
 |
This abstract class does not have any abstract methods |
Design32
|
 |
No need to check for null before an instanceof |
Design33
|
|
Use equals() to compare object references |
Design34
|
 |
Position literals first in String comparisons |
Design35
|
 |
Consider simply returning values instead of storing it in a local variable |
Design36
|
 |
Singleton is not thread safe |
Design37
|
 |
Document empty method |
Design38
|
 |
Document empty constructor |
Design39
|
 |
An Interface should be used only to model a behaviour; consider converting this to a class |
Design40
|
 |
Static java.text.Format objects should be accessed in a synchronized manner |
Design41
|
 |
Caught exception is rethrown, original stack trace may be lost |
Design42
|
 |
Substitute calls to size() == 0 (or size() != 0) with calls to isEmpty() |
Design43
|
 |
Declare members privately |
Design44
|
 |
Never initialize a final field to null |
Design45
|
 |
Avoid overloading the getInstance method |
Design100
|
 |
The scope of local variables should be kept to a minimum. |
Design101
|
 |
Classes with only private constructors should be declared as final |