--- CodeFormatterVisitor.java.orig	2005-03-11 07:58:56.000000000 +0100
+++ CodeFormatterVisitor.java	2005-04-18 20:17:29.343750000 +0200
@@ -2739,14 +2739,8 @@
 				formatNecessaryEmptyStatement();
 			} else {
 				this.scribe.printNewLine();
-				this.scribe.indent();
-				action.traverse(this, scope);
-				if (action instanceof Expression) {
-					this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
-					this.scribe.printTrailingComment();
-					this.scribe.printNewLine();
-				}
-				this.scribe.unIndent();
+				/* Martijn Kruithof insert {} */
+				formatStatementAsBlock(scope,line,action);
 			}
 		} else {
 			/*
@@ -3004,14 +2998,9 @@
 				 */
 				formatNecessaryEmptyStatement();
 			} else {
-				this.scribe.indent();
 				this.scribe.printNewLine();
-				action.traverse(this, scope);
-				this.scribe.unIndent();
-			}
-			if (action instanceof Expression) {
-				this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
-				this.scribe.printTrailingComment();
+				/* Martijn Kruithof {} */
+				formatStatementAsBlock(scope, line, action);
 			}
 		} else {
 			/*
@@ -3095,16 +3084,11 @@
 			} else {
 				this.scribe.printTrailingComment();
 				this.scribe.printNewLine();
-				this.scribe.indent();
-				thenStatement.traverse(this, scope);
-				if (thenStatement instanceof Expression) {
-					this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
-					this.scribe.printTrailingComment();
-				}
+				/* Martijn Kruithof insert {} */
+				formatStatementAsBlock(scope, line, thenStatement);
 				if (elseStatement != null) {
 					this.scribe.printNewLine();
 				}
-				this.scribe.unIndent();
 			}
 		}
 		
@@ -3135,13 +3119,8 @@
 				}
 			} else {
 				this.scribe.printNewLine();
-				this.scribe.indent();
-				elseStatement.traverse(this, scope);
-				if (elseStatement instanceof Expression) {
-					this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
-					this.scribe.printTrailingComment();
-				}
-				this.scribe.unIndent();
+				/* Martijn Kruithof insert {} */
+				formatStatementAsBlock(scope, line, elseStatement);
 			}
 		}
 		return false;
@@ -4183,13 +4162,8 @@
 				formatNecessaryEmptyStatement();
 			} else {
 				this.scribe.printNewLine();
-				this.scribe.indent();
-				action.traverse(this, scope);
-				if (action instanceof Expression) {
-					this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
-					this.scribe.printTrailingComment();
-				}
-				this.scribe.unIndent();
+				/* Martijn Kruithof {} */
+				formatStatementAsBlock(scope, line, action);
 			}
 		} else {
 			/*
@@ -4199,4 +4173,22 @@
 		}
 		return false;
 	}
+
+    /* Martijn Kruithof {} */
+    private void formatStatementAsBlock(BlockScope scope, final int line, final Statement statement)
+    {
+        formatLeftCurlyBrace(line, this.preferences.brace_position_for_block);
+        this.scribe.insertLBrace(this.preferences.insert_space_before_opening_brace_in_block);
+        this.scribe.indent();
+        this.scribe.printNewLine();
+        statement.traverse(this, scope);
+        if (statement instanceof Expression) {
+        	this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
+        	this.scribe.printTrailingComment();
+        }
+        this.scribe.unIndent();
+        this.scribe.printNewLine();
+        this.scribe.insertRBrace(true);
+    }
+	
 }
