From 67f2b199d904e7f4986d987c1310031496e209e7 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Fri, 8 Jul 2016 15:38:19 -0700 Subject: [PATCH] Removed redundant qualifiers. Change-Id: I28dad37e31f471d2e194b0f83098fd8ca1414894 --- .../dom/parser/cpp/semantics/CPPSemantics.java | 18 ++++++++++-------- .../dom/parser/cpp/semantics/CPPTemplates.java | 9 ++++----- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java index 5cc2d2d60ba..443dacb9716 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java @@ -465,7 +465,7 @@ public class CPPSemantics { // Do not interpret template arguments to a template class as being // explicit template arguments to its templated constructor. data.setTemplateArguments(null); - binding= CPPSemantics.resolveFunction(data, ClassTypeHelper.getConstructors(cls, lookupPoint), true); + binding= resolveFunction(data, ClassTypeHelper.getConstructors(cls, lookupPoint), true); } } catch (DOMException e) { return e.getProblem(); @@ -2538,7 +2538,7 @@ public class CPPSemantics { return CPPDeferredFunction.createForCandidates(fns); } - IFunction[] ambiguousFunctions= null; // Ambiguity, 2 functions are equally good. + IFunction[] ambiguousFunctions= null; // Ambiguity, two or more functions are equally good. FunctionCost bestFnCost = null; // The cost of the best function. // Loop over all functions @@ -3005,7 +3005,7 @@ public class CPPSemantics { LookupData data= new LookupData(name); data.setFunctionArguments(false, init.getArguments()); try { - IBinding ctor = CPPSemantics.resolveFunction(data, + IBinding ctor = resolveFunction(data, ClassTypeHelper.getConstructors((ICPPClassType) targetType, name), true); if (ctor instanceof ICPPConstructor) { int i= 0; @@ -3964,13 +3964,13 @@ public class CPPSemantics { // Find all bindings that match the first part of the name. For each such binding, // lookup the second part of the name. - for (IBinding binding : CPPSemantics.findBindings(scope, part1, false)) { + for (IBinding binding : findBindings(scope, part1, false)) { findBindingsForQualifiedName(getLookupScope(binding), part2, bindings); } } - private static ICPPScope getNamespaceScope(CPPASTTranslationUnit tu, String[] namespaceParts, IASTNode point) - throws DOMException { + private static ICPPScope getNamespaceScope(CPPASTTranslationUnit tu, String[] namespaceParts, + IASTNode point) throws DOMException { ICPPScope nsScope= tu.getScope(); outer: for (String nsPart : namespaceParts) { nsPart= nsPart.trim(); @@ -4099,7 +4099,8 @@ public class CPPSemantics { } else { if (function instanceof ICPPTemplateDefinition) { final ICPPTemplateDefinition funcTemplate = (ICPPTemplateDefinition) function; - if (!isSameTemplateParameterList(funcTemplate.getTemplateParameters(), templateDecl.getTemplateParameters())) { + if (!isSameTemplateParameterList(funcTemplate.getTemplateParameters(), + templateDecl.getTemplateParameters())) { return false; } } else { @@ -4118,7 +4119,8 @@ public class CPPSemantics { return false; } - private static boolean isSameTemplateParameterList(ICPPTemplateParameter[] tplist, ICPPASTTemplateParameter[] tps) { + private static boolean isSameTemplateParameterList(ICPPTemplateParameter[] tplist, + ICPPASTTemplateParameter[] tps) { if (tplist.length != tps.length) return false; 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 54d2cc2ac03..b7c1950f75e 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 @@ -966,7 +966,7 @@ public class CPPTemplates { } // else reuse last parameter (which should be a pack) @SuppressWarnings("null") IValue defaultValue = par.getDefaultValue(); - IValue specializedValue = CPPTemplates.instantiateValue(defaultValue, context, maxdepth); + IValue specializedValue = instantiateValue(defaultValue, context, maxdepth); result[i] = new CPPParameterSpecialization(par, functionSpec, specializedParameterTypes[i], specializedValue, context.getParameterMap()); } @@ -998,7 +998,7 @@ public class CPPTemplates { } else if (decl instanceof ICPPClassTemplate) { ICPPClassTemplate template = (ICPPClassTemplate) decl; CPPClassTemplateSpecialization classTemplateSpec = new CPPClassTemplateSpecialization(template, owner, tpMap); - classTemplateSpec.setTemplateParameters(CPPTemplates.specializeTemplateParameters(classTemplateSpec, + classTemplateSpec.setTemplateParameters(specializeTemplateParameters(classTemplateSpec, (ICPPScope) classTemplateSpec.getScope(), template.getTemplateParameters(), owner, point)); spec = classTemplateSpec; } else if (decl instanceof ICPPClassType) { @@ -1016,7 +1016,7 @@ public class CPPTemplates { if (decl instanceof ICPPFieldTemplate) { CPPFieldTemplateSpecialization fieldTempSpec = new CPPFieldTemplateSpecialization(decl, owner, tpMap, type, value); - ICPPTemplateParameter[] params = CPPTemplates.specializeTemplateParameters(fieldTempSpec, + ICPPTemplateParameter[] params = specializeTemplateParameters(fieldTempSpec, (ICPPScope) fieldTempSpec.getScope(), ((ICPPFieldTemplate) decl).getTemplateParameters(), owner, point); fieldTempSpec.setTemplateParameters(params); @@ -1041,7 +1041,7 @@ public class CPPTemplates { methodSpec = new CPPMethodTemplateSpecialization((ICPPMethod) decl, owner, tpMap, type, exceptionSpecs); } - methodSpec.setTemplateParameters(CPPTemplates.specializeTemplateParameters(methodSpec, + methodSpec.setTemplateParameters(specializeTemplateParameters(methodSpec, (ICPPScope) methodSpec.getScope(), ((ICPPFunctionTemplate) decl).getTemplateParameters(), owner, point)); functionSpec = methodSpec; @@ -1443,7 +1443,6 @@ public class CPPTemplates { TypeInstantiationRequest instantiationRequest = new TypeInstantiationRequest(type, context); if (!instantiationsInProgress.get().add(instantiationRequest)) { - System.out.println("Recursion in instantiation of type \"" + type + "\""); //$NON-NLS-1$//$NON-NLS-2$ //XXX return type instanceof ICPPFunctionType ? ProblemFunctionType.RECURSION_IN_LOOKUP : ProblemType.RECURSION_IN_LOOKUP; }