diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDefinition.java index 8283bcbad6d..d3a15b1dbed 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDefinition.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDefinition.java @@ -30,8 +30,8 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent; * Models a function definition without a try-block. If used for a constructor definition it may contain * member initializers. */ -public class CPPASTFunctionDefinition extends ASTNode implements - ICPPASTFunctionDefinition, IASTAmbiguityParent { +public class CPPASTFunctionDefinition extends ASTNode + implements ICPPASTFunctionDefinition, IASTAmbiguityParent { private IASTDeclSpecifier declSpecifier; private IASTFunctionDeclarator declarator; @@ -41,7 +41,6 @@ public class CPPASTFunctionDefinition extends ASTNode implements private boolean fDeleted= false; private boolean fDefaulted= false; - public CPPASTFunctionDefinition() { } @@ -56,7 +55,7 @@ public class CPPASTFunctionDefinition extends ASTNode implements CPPASTFunctionDefinition copy = new CPPASTFunctionDefinition(); copy.setDeclSpecifier(declSpecifier == null ? null : declSpecifier.copy()); - if(declarator != null) { + if (declarator != null) { IASTDeclarator outer = ASTQueries.findOutermostDeclarator(declarator); outer = outer.copy(); copy.setDeclarator((IASTFunctionDeclarator)ASTQueries.findTypeRelevantDeclarator(outer)); @@ -64,7 +63,7 @@ public class CPPASTFunctionDefinition extends ASTNode implements copy.setBody(bodyStatement == null ? null : bodyStatement.copy()); - for(ICPPASTConstructorChainInitializer initializer : getMemberInitializers()) + for (ICPPASTConstructorChainInitializer initializer : getMemberInitializers()) copy.addMemberInitializer(initializer == null ? null : initializer.copy()); copy.fDefaulted= fDefaulted; @@ -199,10 +198,9 @@ public class CPPASTFunctionDefinition extends ASTNode implements } public void replace(IASTNode child, IASTNode other) { - if( bodyStatement == child ) - { - other.setPropertyInParent( bodyStatement.getPropertyInParent() ); - other.setParent( bodyStatement.getParent() ); + if (bodyStatement == child) { + other.setPropertyInParent(bodyStatement.getPropertyInParent()); + other.setParent(bodyStatement.getParent()); bodyStatement = (IASTStatement) other; } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/SelectionHelper.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/SelectionHelper.java index 7c40eab7144..76451077267 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/SelectionHelper.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/SelectionHelper.java @@ -55,7 +55,8 @@ public class SelectionHelper { } @Override public int visit(IASTDeclaration declaration) { - if (declaration instanceof IASTSimpleDeclaration && isSelectionOnExpression(textSelection, declaration)) { + if (declaration instanceof IASTSimpleDeclaration && + isSelectionOnExpression(textSelection, declaration)) { container.setObject((IASTSimpleDeclaration) declaration); } return super.visit(declaration); @@ -78,7 +79,7 @@ public class SelectionHelper { int selStart = textSelection.getOffset(); int selEnd = textSelection.getLength() + selStart; - return exprPos.getOffset() >= selStart && exprPos.getOffset()+exprPos.getLength() <= selEnd; + return exprPos.getOffset() >= selStart && exprPos.getOffset() + exprPos.getLength() <= selEnd; } public static boolean isInSameFile(IASTNode node, IFile file) {