Code formatting

Larry O'Leary loleary at redhat.com
Wed Apr 4 13:58:47 UTC 2012


On Wed, 2012-04-04 at 15:52 +0200, Heiko W.Rupp wrote:

> 
> I mostly mind for start of method braces here:
> 
>     public OperationResult invokeOperation(String name, Configuration parameters) throws InterruptedException,
>         Exception {
>         if ("revert".equals(name)) {
>             try {
>                 revertFromBackupFile();
> 
> 
> In this wrapped case, you have no direct visual indicator where the real code starts.
> With
> 
>     public OperationResult invokeOperation(String name, Configuration parameters) throws InterruptedException,
>         Exception {
> 
>         if ("revert".equals(name)) {
>             try {
>                 revertFromBackupFile();
> 
> you do
> 
> and with 
> 
>     public OperationResult invokeOperation(String name, Configuration parameters) throws InterruptedException,
>         Exception 
>     {
>         if ("revert".equals(name)) {
>             try {
>                 revertFromBackupFile();
> 
> also
> 
I feel the open brace goes at the end of the line and not on its own
line. Additionally, for the examples described, I am used to seeing
this: 

    public OperationResult invokeOperation(String name, Configuration parameters) throws InterruptedException,
            Exception {
        if ("revert".equals(name)) {
            try {
                revertFromBackupFile();

Wrapped lines contain double-indent.
-- 
Larry O'Leary
https://plus.google.com/u/0/112645929986009801513



More information about the rhq-devel mailing list