From b7de8668c6f3d6f70b06059c730b22819190f0be Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Sun, 23 Oct 2011 21:50:39 -0700 Subject: [PATCH] Cosmetics. --- .../core/dom/parser/c/CASTTypeId.java | 32 +++++++++---------- .../parser/cpp/semantics/CPPTemplates.java | 13 ++++---- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTTypeId.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTTypeId.java index 0bf0ded885d..b25f08429d1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTTypeId.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTTypeId.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * IBM Rational Software - Initial API and implementation - * Yuan Zhang / Beth Tibbitts (IBM Research) + * IBM Rational Software - Initial API and implementation + * Yuan Zhang / Beth Tibbitts (IBM Research) *******************************************************************************/ package org.eclipse.cdt.internal.core.dom.parser.c; @@ -21,7 +21,6 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode; * @author jcamelon */ public class CASTTypeId extends ASTNode implements IASTTypeId { - private IASTDeclSpecifier declSpecifier; private IASTDeclarator declarator; @@ -72,27 +71,26 @@ public class CASTTypeId extends ASTNode implements IASTTypeId { abstractDeclarator.setParent(this); abstractDeclarator.setPropertyInParent(ABSTRACT_DECLARATOR); } - } @Override - public boolean accept( ASTVisitor action ){ - if( action.shouldVisitTypeIds ){ - switch( action.visit( this ) ){ - case ASTVisitor.PROCESS_ABORT : return false; - case ASTVisitor.PROCESS_SKIP : return true; - default : break; + public boolean accept(ASTVisitor action) { + if (action.shouldVisitTypeIds) { + switch (action.visit(this)) { + case ASTVisitor.PROCESS_ABORT: return false; + case ASTVisitor.PROCESS_SKIP: return true; + default: break; } } - if( declSpecifier != null ) if( !declSpecifier.accept( action ) ) return false; - if( declarator != null ) if( !declarator.accept( action ) ) return false; + if (declSpecifier != null && !declSpecifier.accept(action)) return false; + if (declarator != null && !declarator.accept(action)) return false; - if( action.shouldVisitTypeIds ){ - switch( action.leave( this ) ){ - case ASTVisitor.PROCESS_ABORT : return false; - case ASTVisitor.PROCESS_SKIP : return true; - default : break; + if (action.shouldVisitTypeIds) { + switch (action.leave(this)) { + case ASTVisitor.PROCESS_ABORT: return false; + case ASTVisitor.PROCESS_SKIP: return true; + default: break; } } return true; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java index 4d4935bc154..11f3deb5ed0 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java @@ -6,10 +6,10 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * IBM - Initial API and implementation - * Bryan Wilkinson (QNX) - * Markus Schorn (Wind River Systems) - * Sergey Prigogin (Google) + * IBM - Initial API and implementation + * Bryan Wilkinson (QNX) + * Markus Schorn (Wind River Systems) + * Sergey Prigogin (Google) *******************************************************************************/ package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics; @@ -155,7 +155,7 @@ public class CPPTemplates { private static final int PACK_SIZE_FAIL = -2; private static final int PACK_SIZE_NOT_FOUND = Integer.MAX_VALUE; private static final ICPPFunction[] NO_FUNCTIONS = {}; - static enum TypeSelection {PARAMETERS, RETURN_TYPE, PARAMETERS_AND_RETURN_TYPE} + static enum TypeSelection { PARAMETERS, RETURN_TYPE, PARAMETERS_AND_RETURN_TYPE } /** * Instantiates a class template with the given arguments. May return null. @@ -183,8 +183,7 @@ public class CPPTemplates { if (template instanceof ICPPClassTemplatePartialSpecialization) { return instantiatePartialSpecialization((ICPPClassTemplatePartialSpecialization) template, arguments, isDefinition, null); } - - + final ICPPTemplateParameter[] parameters= template.getTemplateParameters(); final int numArgs = arguments.length; final int numParams= parameters.length;