Java Coding Standards Checklist
Java Coding Standards Checklist
Revision: 0.1
1 OMII
Table of Contents
1 Introduction _________________________________________________________________ 3
2 General checklist _____________________________________________________________ 3
2 OMII
1 Introduction
This is a supplementary document for Sun Java coding conventions. It is for all the developers who submit
their codes to OMII.
2 General Checklist
The following checklist is intended to develop the quality of codes. Some items may not be relevant to all
development. Any additional items identified in the course of reviews should be added.
3 OMII
Do code comments explain why something is done or do they
state the obvious?
Do the comments lie? Are they out of date?
Are change flags properly used?
Is there dead code or old commented out code littered about?
Should it be deleted, or remain commented out?
4 OMII
Table 3.2 Java specific
Guidelines
Does each class have appropriate constructors and destructors?
Do any subclasses have common members that should be in the
super-class?
Can the class inheritance hierarchy be simplified?
Are the right abstractions used?
Are encapsulation principles violated?
Do exceptions include enough information to communicate what
failed and why?
Are error-conditions propagated, logged or ignored?
Is a meaningful message emitted?
Messages should include what went wrong, with relevant clues
why it went wrong, and a possible user action, or a useful
exception. Where exceptions are used by logging, sufficient
information is required to locate and understand the situation.
Do entry logs include input parameters?
Do exit logs include return values?
Are entry and exit logs properly paired?
Do major branches or decision points in the code include trace
messages to indicate flow of control?
Do exceptions include enough information to communicate what
failed and why?
Do empty catch blocks have at least a comment to say why it's OK
to ignore them.
Is there any information loss about failure reason when exceptions
are mapped and re-thrown?
Are exceptions handled in the right part of the code?
5 OMII