classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU Java Style


From: Brian Jones
Subject: Re: GNU Java Style
Date: 23 May 2003 18:49:38 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Etienne Gagnon <address@hidden> writes:

> Hi All,
> 
> Does anybody know where I can find the specification of the GNU Java
> Style?  If yes, could you please tell me where to find it?

Best characterized as subtly different from Gnu C-style,
http://www.gnu.org/prep/standards_23.html#SEC23

I will try here to start a list, it may be wrong.  I view Tom Tromey
as authoritative on the subject but not sure when he is back from
vacation.

Opening/closing brace for class and method is at the same level of
indent as the declaration.  All other braces are indented and content
between braces indented again.

Unnecessary braces can be removed, one line after an if, for, while as
examples.  

Space before method declaration parens, statement parens, braces,
method call parens.

Space after comma, semicolon, type cast.

Space around operators (assignment, logical, relational, bitwise,
mathematical, shift).

Implements and extends on separate lines, throws too.
Indent extends, implements, throws.
Apply deep indentation for method arguments.

If possible, generate specific imports (expand) over java.io.* type
imports.  Order by gnu, java, javax.

Blank line after package statement, last import statement, classes,
interfaces, methods.

Blank line before single-line comments, multi-line comments, javadoc
comments.

If more than 2 blank lines, trim to 2.

Wrap lines at 80 characters after assignments and before operators.
Wrap always before extends, implements, throws, and labels.

-- 
Brian Jones <address@hidden>

Attachment: test.java
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]