Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2011-05-16 19:11:22 +0000
committerSergey Prigogin2011-05-16 19:11:22 +0000
commit2085f2d1fcab0ad5f00319c31db084c0d9efe69c (patch)
tree62cdf4395b3285d0fe6bfb06c17a87112987f082
parent6a8b930ea61d97715627ac49c2abbadab91a9b63 (diff)
downloadorg.eclipse.cdt-2085f2d1fcab0ad5f00319c31db084c0d9efe69c.tar.gz
org.eclipse.cdt-2085f2d1fcab0ad5f00319c31db084c0d9efe69c.tar.xz
org.eclipse.cdt-2085f2d1fcab0ad5f00319c31db084c0d9efe69c.zip
Cosmetics.
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/MethodContext.java6
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/NodeHelper.java10
2 files changed, 9 insertions, 7 deletions
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 3219ec3735..69d238152a 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 820d9c2d04..fac66b7371 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) {

Back to the top