From fdeda95079a0a99edc5aaeddecde89d7cb2d50f3 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Tue, 27 Nov 2012 19:04:17 -0800 Subject: [PATCH] Code streamlining. --- .../core/dom/parser/cpp/CPPASTAliasDeclaration.java | 8 ++------ .../dom/parser/cpp/CPPASTFunctionDefinition.java | 13 +++++-------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTAliasDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTAliasDeclaration.java index a1cbff32b7a..17796ae47a1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTAliasDeclaration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTAliasDeclaration.java @@ -72,12 +72,8 @@ public class CPPASTAliasDeclaration extends ASTNode implements ICPPASTAliasDecla public ICPPASTAliasDeclaration copy(CopyStyle style) { CPPASTAliasDeclaration copy = new CPPASTAliasDeclaration( aliasName == null ? null : aliasName.copy(style), - mappingTypeId == null ? null : mappingTypeId.copy(style)); - copy.setOffsetAndLength(this); - if (style == CopyStyle.withLocations) { - copy.setCopyLocation(this); - } - return copy; + mappingTypeId == null ? null : mappingTypeId.copy(style)); + return copy(copy, style); } @Override 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 65ec3d317b3..3db8591e159 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 @@ -27,8 +27,8 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTQueries; 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. + * 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 { @@ -68,16 +68,13 @@ public class CPPASTFunctionDefinition extends ASTNode copy.setBody(bodyStatement == null ? null : bodyStatement.copy(style)); - for (ICPPASTConstructorChainInitializer initializer : getMemberInitializers()) + for (ICPPASTConstructorChainInitializer initializer : getMemberInitializers()) { copy.addMemberInitializer(initializer == null ? null : initializer.copy(style)); + } copy.fDefaulted = fDefaulted; copy.fDeleted = fDeleted; - copy.setOffsetAndLength(this); - if (style == CopyStyle.withLocations) { - copy.setCopyLocation(this); - } - return copy; + return copy(copy, style); } @Override