J2SE Best Practices code review

The J2SE Best Practices code review consists of one category only; it is also called J2SE Best Practices.

Purpose

The J2SE Best Practices code review applies rules to detect code that has potential problems or is noncompliant with J2SE standards. Within this code review, the J2SE Best Practices category has 17 subcategories of rules. This makes it easy to pick and choose which areas of J2SE conformance you want to investigate. Although rules in this category do not require in-depth code analysis, the large number of rules might make the code review take longer to finish.

Rule categories

The following table lists all of the categories and subcategories in the Quick code review, along with a description of the rules in each one. In the left column, categories are in bold text and subcategories are in plain text.

Category or subcategory Description
J2SE Best Practices Contains rules that validate code for compliance with J2SE best practices for Java™ development
AWT Contains rules that detect issues related to using the Abstract Window Toolkit library
Casting Contains rules that detect issues related to casting and coercion
Cloneable Contains rules that detect issues related to object cloning
Comparison Contains rules that detect issues related to comparing objects and testing object equality
Conditional Contains rules that detect issues related to the usage of conditionals
Constructors Contains rules that detect issues related to defining and implementing constructors
Declaration Contains rules that detect issues related to declaring constants, variables, and fields
Exceptions Contains rules that detect issues related to exception handling
Initialization Contains rules that detect issues related to the initialization of primitives and objects
Loop Contains rules that detect issues related to using loops
Null Contains rules that detect issues related to using null
Portability Contains rules that detect issues related to portability
Reflection Contains rules that detect issues related to using reflection
Serialization Contains rules that detect issues related to serialization
Statement Contains rules that detect general issues in statements
Switch Contains rules that detect issues related to using switch statements
Threads Contains rules that detect issues related to using threads

Sample rule

The following rule is a sample one that is applied in the J2SE Best Practices code review. It is in the J2SE Best Practices category, in the Conditional subcategory.
Avoid using negation in if/else conditions

Parent topic: Types of code review

Terms of use | Feedback
(C) Copyright IBM Corporation 2004, 2005. All Rights Reserved.