Re: PgJDBC: code reformat - Mailing list pgsql-jdbc

From Vladimir Sitnikov
Subject Re: PgJDBC: code reformat
Date
Msg-id CAB=Je-GAKNkUhgnhNU+nCq0VfcvJy65=iE1soyeRzuSCmC55vg@mail.gmail.com
Whole thread Raw
In response to Re: PgJDBC: code reformat  (Dave Cramer <pg@fastcrypt.com>)
List pgsql-jdbc
>I tend to break up multiple lines.

"Mandatory brackets" plus "open curly on the new line" would result in
too much whitespace.
We do want "mandatory brackets", don't we?

Regarding whitespace, what if using explicit blank lines to separate
logic when required?
Like this:
https://github.com/pgjdbc/pgjdbc/blob/format_code/pgjdbc/src/main/java/org/postgresql/jdbc/PgSQLXML.java#L90-L94

>There doesn't seem to be a significant difference between sun style and google style.

Technically speaking, there is.

Sun style:

if (data == null)
{
  return null;
}

Google style (this one is used by pgjdbc-ng):

if (data == null) {
  return null;
}

Vladimir


pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: PgJDBC: code reformat
Next
From: Gavin Flower
Date:
Subject: Re: PgJDBC: code reformat