From 5cf3cf47c2df31749ca1b34744716c037771aa6b Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Tue, 9 Feb 2010 11:06:58 +0000 Subject: [PATCH] Bug 301366 - [formatter] throw; invalidates indenting rules --- .../cdt/internal/formatter/CodeFormatterVisitor.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java index 824fd2cd283..bfb37a8764e 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java @@ -2057,10 +2057,12 @@ public class CodeFormatterVisitor extends CPPASTVisitor { break; case IASTUnaryExpression.op_throw: scribe.printNextToken(Token.t_throw, scribe.printComment()); - if (peekNextToken() != Token.tLPAREN) { - scribe.space(); + if (operand != null) { + if (peekNextToken() != Token.tLPAREN) { + scribe.space(); + } + operand.accept(this); } - operand.accept(this); break; case IASTUnaryExpression.op_typeid: scribe.printNextToken(Token.t_typeid, scribe.printComment());