diff options
author | Sergey Prigogin | 2011-04-18 18:53:08 +0000 |
---|---|---|
committer | Sergey Prigogin | 2011-04-18 18:53:08 +0000 |
commit | 3128381403b4cf286c0aeb9fd95d48e34eb58c67 (patch) | |
tree | 423c07e2e73b83436b6b4aac7b54d47694c503be /core | |
parent | 51c07a5131cb3e8524030f115362e4cdd384b8e7 (diff) | |
download | org.eclipse.cdt-3128381403b4cf286c0aeb9fd95d48e34eb58c67.tar.gz org.eclipse.cdt-3128381403b4cf286c0aeb9fd95d48e34eb58c67.tar.xz org.eclipse.cdt-3128381403b4cf286c0aeb9fd95d48e34eb58c67.zip |
Cosmetics.
Diffstat (limited to 'core')
-rw-r--r-- | core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/NodeHelper.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/NodeHelper.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/NodeHelper.java index 5783e442e35..820d9c2d040 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/NodeHelper.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/NodeHelper.java @@ -89,7 +89,7 @@ public class NodeHelper { } public static IASTSimpleDeclaration findSimpleDeclarationInParents(IASTNode node) { - while (node != null){ + while (node != null) { if (node instanceof IASTSimpleDeclaration) { return (IASTSimpleDeclaration) node; } @@ -104,13 +104,13 @@ public class NodeHelper { MethodContext context = new MethodContext(); context.setType(MethodContext.ContextType.NONE); IASTName name = null; - while (node != null && !found){ + while (node != null && !found) { node = node.getParent(); - if (node instanceof IASTFunctionDeclarator){ + if (node instanceof IASTFunctionDeclarator) { name=((IASTFunctionDeclarator)node).getName(); found = true; context.setType(MethodContext.ContextType.FUNCTION); - } else if (node instanceof IASTFunctionDefinition){ + } else if (node instanceof IASTFunctionDefinition) { name=CPPVisitor.findInnermostDeclarator(((IASTFunctionDefinition)node).getDeclarator()).getName(); found = true; context.setType(MethodContext.ContextType.FUNCTION); @@ -126,8 +126,8 @@ public class NodeHelper { private static void getMethodContex(IASTTranslationUnit translationUnit, MethodContext context, IASTName name) { - if (name instanceof ICPPASTQualifiedName){ - ICPPASTQualifiedName qname =( ICPPASTQualifiedName )name; + if (name instanceof ICPPASTQualifiedName) { + ICPPASTQualifiedName qname = (ICPPASTQualifiedName) name; context.setMethodQName(qname); IBinding bind = qname.resolveBinding(); IASTName[] decl = translationUnit.getDeclarationsInAST(bind); @@ -166,14 +166,14 @@ public class NodeHelper { } } } - if (name instanceof ICPPASTQualifiedName){ - ICPPASTQualifiedName qname =( ICPPASTQualifiedName )name; + if (name instanceof ICPPASTQualifiedName) { + ICPPASTQualifiedName qname = (ICPPASTQualifiedName) name; context.setMethodQName(qname); } } public static IASTCompoundStatement findCompoundStatementInAncestors(IASTNode node) { - while (node != null){ + while (node != null) { if (node instanceof IASTCompoundStatement) { return (IASTCompoundStatement) node; } @@ -183,7 +183,7 @@ public class NodeHelper { } public static IASTCompositeTypeSpecifier findClassInAncestors(IASTNode node) { - while (!(node instanceof IASTCompositeTypeSpecifier)){ + while (!(node instanceof IASTCompositeTypeSpecifier)) { if (node instanceof IASTTranslationUnit) { return null; } @@ -193,7 +193,7 @@ public class NodeHelper { } public static IASTFunctionDefinition findFunctionDefinitionInAncestors(IASTNode node) { - while (node != null){ + while (node != null) { if (node instanceof IASTFunctionDefinition) { return (IASTFunctionDefinition) node; } |