diff options
author | Andrew Ferguson | 2007-05-23 08:36:16 +0000 |
---|---|---|
committer | Andrew Ferguson | 2007-05-23 08:36:16 +0000 |
commit | 59db7018c72972ead294e4d8166c56aa370da8d9 (patch) | |
tree | 8807e53821b9fb6b6bd9e27a4aad4de9c72322da | |
parent | 2a67c5a3211e935d28d1789fdd0580430e69dd07 (diff) | |
download | org.eclipse.cdt-59db7018c72972ead294e4d8166c56aa370da8d9.tar.gz org.eclipse.cdt-59db7018c72972ead294e4d8166c56aa370da8d9.tar.xz org.eclipse.cdt-59db7018c72972ead294e4d8166c56aa370da8d9.zip |
188324: apply fix
3 files changed, 19 insertions, 8 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBindingResolutionTestBase.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBindingResolutionTestBase.java index 0cfb991d6f2..a6b3e2d91cc 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBindingResolutionTestBase.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBindingResolutionTestBase.java @@ -69,9 +69,7 @@ public abstract class IndexBindingResolutionTestBase extends BaseTestCase { protected ITestStrategy strategy; public void setStrategy(ITestStrategy strategy) { - if(this.strategy==null) { - this.strategy = strategy; - } + this.strategy = strategy; } protected void setUp() throws Exception { diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionBugs.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionBugs.java index 65726c27035..1ed3c830606 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionBugs.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionBugs.java @@ -54,6 +54,18 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas setStrategy(new SinglePDOMTestStrategy(true)); } + // namespace ns {class A{};} + + // ns::A a; + // class B {}; + public void test188324() throws Exception { + IASTName name= findNames("B", 1)[0]; + IBinding b0= getBindingFromASTName("ns::A", 2); + assertInstance(b0, ICPPNamespace.class); + ICPPNamespace ns= (ICPPNamespace) b0; + assertEquals(0, ns.getNamespaceScope().getBindings(name, false, false).length); + } + // template<typename T> // class C : public C<T> {}; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeScope.java index f36af5ecea7..56caa82affa 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeScope.java @@ -90,13 +90,14 @@ public abstract class CompositeScope implements IIndexScope { /** * A convenience method for processing an array of bindings with {@link CompositeScope#processUncertainBinding(IBinding)} - * @param fragmentBindings - * @return + * Returns an empty array if the input parameter is null + * @param frgBindings + * @return a non-null IBinding[] */ - protected final IBinding[] processUncertainBindings(IBinding[] fragmentBindings) { - IBinding[] result= new IBinding[fragmentBindings.length]; + protected final IBinding[] processUncertainBindings(IBinding[] frgBindings) { + IBinding[] result= new IBinding[frgBindings==null ? 0 : frgBindings.length]; for(int i=0; i<result.length; i++) { - result[i]= processUncertainBinding(fragmentBindings[i]); + result[i]= processUncertainBinding(frgBindings[i]); } return result; } |