It looks like Oracle never really had one, or at least if there was one did not enforce it. Specially the Mojarra code base and the parts of the code in GlassFish that implement JACC and JASPIC have a rather inconsistent formatting and overal style.
As for the Javadoc, the Sun code conventions don't specify these directly. There's a separate article from Oracle though that uses examples for an highly indented style though, that would be an alternative candidate.
@param a The first parameter. For an optimum result, this should be an odd
number between 0 and 100.
Based on the advice from Uncle Bob's Clean Code, specifically:
-No cryptic abbreviations like c, ta, rx, ct, with the exception of the well established i and J in loops
-No variable names like ret, rvalue, result etc for variables that are returned from methods. Instead, the should be named after what they actually return. For example:
public Permissions getCallerPermission(....) {
public Permissions getCallerPermissions(....) {
Permissions callerPermissions;
return callerPermissions;
-No Hungarian variations for collections like usrLst, usArray, arrUsers, UserCol, etc, and no such variation for elements of the collection like el, elm, usrEl, userElem, currentUsr, curUser, userCr, etc. Omit the Hungarian and use the element type name directly and the plural of that for the collection. For example:
for (User curUsr : colUser) {
for (User user : users) {
- Handle the short and fast error case for method parameters early instead of the happy path. For example:
public void foo(Bar bar) {
throw new IllegalStateException("Bar should not be null");
public void foo(Bar bar) {
throw new IllegalStateException("Bar should not be null");
- if/else blocks that return don't need to be if/else blocks. For example:
} else if (foo == somethingElse) {
if (foo == somethingElse) {
- Omit initialisation of instance variables to their default values. For example:
private int someNumber = 0;
private Foo someFoo = null;
private boolean isFoo = false;
- Omit using the pubic modifier for interface methods .For example:
public interface MyInterface {
public interface MyInterface {
- Omit unnecessary braces. For example:
A large number of additional code convention rules are contained in the well known SonarQube. The default rule set ("the sonar way") is probably a good starting point and with sonarcloud.io it would be relatively easy to check each EE4J project. Rules that would be specifically good IMHO to pay attention to are the ones that warn for high levels of cyclomatic complexity and large classes.