diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/MethodContext.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/MethodContext.java index 3219ec3735d..69d238152a1 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/MethodContext.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/MethodContext.java @@ -7,7 +7,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Institute for Software - initial API and implementation + * Institute for Software - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.ui.refactoring; @@ -31,7 +31,6 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding; /** * Represents a function or method and adds some useful helper methods to * determine if methods are in the same class. - * */ public class MethodContext { public enum ContextType{ NONE, FUNCTION, METHOD } @@ -204,7 +203,8 @@ public class MethodContext { private static ICPPClassType getClassBinding(IASTName declName1) { if (declName1.getParent().getParent().getParent() instanceof ICPPASTCompositeTypeSpecifier) { - ICPPASTCompositeTypeSpecifier compTypeSpec = (ICPPASTCompositeTypeSpecifier) declName1.getParent().getParent().getParent(); + ICPPASTCompositeTypeSpecifier compTypeSpec = + (ICPPASTCompositeTypeSpecifier) declName1.getParent().getParent().getParent(); return (ICPPClassType) compTypeSpec.getName().resolveBinding(); } return null; 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 820d9c2d040..fac66b73716 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 @@ -107,11 +107,11 @@ public class NodeHelper { while (node != null && !found) { node = node.getParent(); if (node instanceof IASTFunctionDeclarator) { - name=((IASTFunctionDeclarator)node).getName(); + name = ((IASTFunctionDeclarator) node).getName(); found = true; context.setType(MethodContext.ContextType.FUNCTION); } else if (node instanceof IASTFunctionDefinition) { - name=CPPVisitor.findInnermostDeclarator(((IASTFunctionDefinition)node).getDeclarator()).getName(); + name = CPPVisitor.findInnermostDeclarator(((IASTFunctionDefinition) node).getDeclarator()).getName(); found = true; context.setType(MethodContext.ContextType.FUNCTION); } @@ -160,7 +160,8 @@ public class NodeHelper { IASTName declName = DeclarationFinder.findDeclarationInTranslationUnit(locTu, tmpname); if (declName != null) { IASTNode methoddefinition = declName.getParent().getParent(); - if (methoddefinition instanceof IASTSimpleDeclaration || methoddefinition instanceof IASTFunctionDefinition) { + if (methoddefinition instanceof IASTSimpleDeclaration || + methoddefinition instanceof IASTFunctionDefinition) { context.setMethodDeclarationName(declName); } } @@ -206,7 +207,8 @@ public class NodeHelper { if (simpleDeclaration == null) { return false; } - return simpleDeclaration.getDeclarators().length == 1 && simpleDeclaration.getDeclarators()[0] instanceof ICPPASTFunctionDeclarator; + return simpleDeclaration.getDeclarators().length == 1 && + simpleDeclaration.getDeclarators()[0] instanceof ICPPASTFunctionDeclarator; } public static boolean isContainedInTemplateDeclaration(IASTNode node) {