The Allman style does concern alignment, not all (parentheses). I believe that you are free to do both if you want, but it seems like a source of problems (like this one) for me, without an obvious payback in readability. In other words, a logical fetish :-)
You can follow the guide http://mbreen.com/javastyle.html : "An instruction containing a declaration with a block of code is first indented as an expression." I think this will change your examples to
foo (new Clazz( ) { // Do stuff. }); Clazz bar = ( new Clazz( ) { // Do stuff. });
happenstance
source share