diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java index ce8b29f5163..ea5b3f87a99 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java @@ -650,13 +650,13 @@ public class ASTTypeUtil { return false; } } - + private static String[] getQualifiedNameForAnonymous(ICPPBinding binding, boolean normalize) throws DOMException { LinkedList result= new LinkedList(); result.addFirst(getNameForAnonymous(binding)); IBinding owner= binding.getOwner(); - while(owner instanceof ICPPNamespace || owner instanceof IType) { + while (owner instanceof ICPPNamespace || owner instanceof IType) { char[] name= owner.getNameCharArray(); if (name == null || name.length == 0) { if (!(binding instanceof ICPPNamespace)) { @@ -721,7 +721,6 @@ public class ASTTypeUtil { return null; } - private static int findFileNameStart(char[] fname) { for (int i= fname.length - 2; i >= 0; i--) { switch (fname[i]) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ProblemBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ProblemBinding.java index e1b8be95af4..926256b6c84 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ProblemBinding.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ProblemBinding.java @@ -9,6 +9,7 @@ * Andrew Niefer (IBM Corporation) - initial API and implementation * Markus Schorn (Wind River Systems) * Bryan Wilkinson (QNX) + * Sergey Prigogin (Google) *******************************************************************************/ package org.eclipse.cdt.internal.core.dom.parser; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java index 2854a68739b..ffd03b364d6 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java @@ -1643,7 +1643,7 @@ public class CVisitor extends ASTQueries { * Searches for the function enclosing the given node. May return null. */ public static IBinding findEnclosingFunction(IASTNode node) { - while(node != null && node instanceof IASTFunctionDefinition == false) { + while (node != null && !(node instanceof IASTFunctionDefinition)) { node= node.getParent(); } if (node == null) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/BaseClassLookup.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/BaseClassLookup.java index 4c4cd2dc1bc..098f75be32c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/BaseClassLookup.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/BaseClassLookup.java @@ -34,9 +34,10 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalUnknownScope; import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPUnknownBinding; /** - * Helper class for performing the base class lookup. First a directed graph without loops is computed to represent the base - * class hierarchy up to those bases for which the lookup finds matches. Next, from these leaves we search for virtual bases - * that are hidden. With this information the matches are extracted from the graph. + * Helper class for performing the base class lookup. First a directed graph without loops is computed + * to represent the base class hierarchy up to those bases for which the lookup finds matches. Next, from + * these leaves we search for virtual bases that are hidden. With this information the matches are extracted + * from the graph. */ class BaseClassLookup { public static void lookupInBaseClasses(LookupData data, ICPPClassScope classScope, IIndexFileSet fileSet) { @@ -108,7 +109,7 @@ class BaseClassLookup { if (fPropagationDone) return; fPropagationDone= true; - for (int i=0; i infoMap, int depth) { + static BaseClassLookup lookupInBaseClass(LookupData data, ICPPClassScope baseClassScope, boolean isVirtual, + ICPPClassType root, IIndexFileSet fileSet, HashMap infoMap, int depth) { if (depth++ > CPPSemantics.MAX_INHERITANCE_DEPTH) return null; @@ -142,7 +144,8 @@ class BaseClassLookup { if (info != null) { // avoid loops if (info.getResult() == null) { - data.problem = new ProblemBinding(null, IProblemBinding.SEMANTIC_CIRCULAR_INHERITANCE, root.getNameCharArray()); + data.problem = new ProblemBinding(null, IProblemBinding.SEMANTIC_CIRCULAR_INHERITANCE, + root.getNameCharArray()); return null; } return info; @@ -180,7 +183,8 @@ class BaseClassLookup { } } - // there is no result in the baseClass itself or we do content assist, we have to examine its base-classes + // There is no result in the baseClass itself or we do content assist, we have to examine its + // base-classes ICPPClassType baseClass= result.getClassType(); if (baseClass != null) { ICPPBase[] grandBases= null; @@ -220,7 +224,8 @@ class BaseClassLookup { if (!(grandBaseScope instanceof ICPPClassScope)) continue; - BaseClassLookup baseInfo= lookupInBaseClass(data, (ICPPClassScope) grandBaseScope, grandBase.isVirtual(), root, fileSet, infoMap, depth); + BaseClassLookup baseInfo= lookupInBaseClass(data, (ICPPClassScope) grandBaseScope, + grandBase.isVirtual(), root, fileSet, infoMap, depth); if (baseInfo != null) result.addBase(grandBase.isVirtual(), baseInfo); } catch (DOMException e) { @@ -232,6 +237,7 @@ class BaseClassLookup { result.setResult(matches); return result; } + static void hideVirtualBases(BaseClassLookup rootInfo, HashMap infoMap) { boolean containsVirtualBase= false; final BaseClassLookup[] allInfos = infoMap.values().toArray(new BaseClassLookup[infoMap.size()]); @@ -302,7 +308,7 @@ class BaseClassLookup { fCollected= true; data.foundItems = CPPSemantics.mergePrefixResults((CharArrayObjectMap) data.foundItems, fBindings, true); - for (int i=0; i> usingDirectives= Collections.emptyMap(); - /* - * Used to ensure we don't visit things more than once - */ + /** Used to ensure we don't visit things more than once. */ public ObjectSet visited= new ObjectSet(1); - - + @SuppressWarnings("unchecked") public ObjectSet associated = ObjectSet.EMPTY_SET; @@ -101,9 +98,12 @@ public class LookupData { public boolean prefixLookup = false; public boolean typesOnly = false; public boolean considerConstructors = false; - public boolean checkPointOfDecl= true; // for lookup of unknown bindings the point of declaration can be reversed. - public boolean usesEnclosingScope= true; // for field references or qualified names, enclosing template declarations are ignored. - public boolean firstArgIsImpliedMethodArg = false; // when computing the cost of a method call treat the first argument as the implied method argument + /** For lookup of unknown bindings the point of declaration can be reversed. */ + public boolean checkPointOfDecl= true; + /** For field references or qualified names, enclosing template declarations are ignored. */ + public boolean usesEnclosingScope= true; + /** When computing the cost of a method call, treat the first argument as the implied method argument. */ + public boolean firstArgIsImpliedMethodArg = false; public boolean ignoreMembers = false; public ICPPClassType skippedScope;