All Polypheny-DB projects follow an modified and extended version of the Google Java Style Guide. The most recent Google Style Guides can be found here.
The IntelliJ Code Style definition can be downloaded here: Polypheny-DB-Style.xml
The following sections introduce Polypheny-DB specific changes.
Indentations are made with 4 spaces.
IMPORTANT: Getter and toString() must not have any side effects.
- Methods: 2
lang=java
public Constructor() {
this(0);
}
public Constructor(final int foo) {
}
private void foo() {
}
private void bar() {
}
- Initializers: 2
lang=java
private static final int INT;
static {
INT = 2;
}
public final String var;
- Classes: 2
lang=java
public class Mess {
public static class Foo {
}
protected class Bar {
}
}
- Array initializer braces
lang=java
int[] X = new int[] { 1, 3, 5, 6, 7, 87, 1213, 2 };
- Method declaration parantheses
lang=java
public void foo( int x, int y ) {
- Method call parentheses
lang=java
foo( 5, i );
ifparentheses
lang=java
if ( 0 < x && x < 10 ) {
forparentheses
lang=java
for ( int i = 0; i < x; i++ ) {
whileparentheses
lang=java
while ( x != y ) {
switchparentheses
lang=java
switch ( e.getCode() ) {
tryparentheses
lang=java
try ( MyResource r1 = getResource() ) {
catchparentheses
lang=java
} catch ( MyException e ) {
synchronizedparentheses
lang=java
synchronized ( this ) {
Additional horizontal whitespace around
- The unary //not// operator
!(currently not possible in IntelliJ, since IntelliJ has only the option to insert spaces around //all// unary operators)
lang=java
while ( ! this.isStopped ) {
Do not use the JavaDoc @author tag or a similar tag in other language. This information can always be found accurate and up to date in the git log.