Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2015-02-04 23:11:39 +0000
committerSergey Prigogin2015-02-05 02:19:32 +0000
commit91981f94534e7fe0f28b1f43e3b171039194bd16 (patch)
tree65dab432c8a38ad29277e966f4b3476d13b261e9
parent8eb15f3fcab1209acd989c968ae29e0be1e38f48 (diff)
downloadorg.eclipse.cdt-91981f94534e7fe0f28b1f43e3b171039194bd16.tar.gz
org.eclipse.cdt-91981f94534e7fe0f28b1f43e3b171039194bd16.tar.xz
org.eclipse.cdt-91981f94534e7fe0f28b1f43e3b171039194bd16.zip
Bug 459179 - ClassCastException in CPPSemantics.getParentScope
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPBinding.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java6
5 files changed, 18 insertions, 5 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java
index 110cc584d7a..91997095435 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java
@@ -35,7 +35,6 @@ import org.eclipse.cdt.internal.core.pdom.PDOM;
import org.eclipse.cdt.internal.core.pdom.db.Database;
import org.eclipse.cdt.internal.core.pdom.db.IString;
import org.eclipse.cdt.internal.core.pdom.db.PDOMExternalReferencesList;
-import org.eclipse.cdt.internal.core.pdom.dom.c.PDOMCGlobalScope;
import org.eclipse.cdt.internal.core.pdom.tag.PDOMTaggable;
import org.eclipse.core.runtime.CoreException;
@@ -257,7 +256,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding
} catch (CoreException e) {
CCorePlugin.log(e);
}
- return PDOMCGlobalScope.INSTANCE;
+ return getLinkage().getGlobalScope();
}
@Override
@@ -271,7 +270,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding
} catch (CoreException e) {
CCorePlugin.log(e);
}
- return PDOMCGlobalScope.INSTANCE;
+ return getLinkage().getGlobalScope();
}
@Override
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java
index 14316d562b0..835fc405e8e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java
@@ -180,10 +180,12 @@ public abstract class PDOMLinkage extends PDOMNamedNode implements IIndexLinkage
return null;
}
- abstract public PDOMNode getNode(long record, int nodeType) throws CoreException;
+ public abstract PDOMNode getNode(long record, int nodeType) throws CoreException;
public abstract IBTreeComparator getIndexComparator();
+ public abstract PDOMGlobalScope getGlobalScope();
+
public IBTreeComparator getNestedBindingsComparator() {
return new FindBinding.NestedBindingsBTreeComparator(this);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java
index 5d9da173860..801ea5f0b8b 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java
@@ -43,6 +43,7 @@ import org.eclipse.cdt.internal.core.pdom.dom.FindBinding;
import org.eclipse.cdt.internal.core.pdom.dom.IPDOMMemberOwner;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMASTAdapter;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
+import org.eclipse.cdt.internal.core.pdom.dom.PDOMGlobalScope;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMLinkage;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
import org.eclipse.core.runtime.CoreException;
@@ -342,6 +343,11 @@ class PDOMCLinkage extends PDOMLinkage implements IIndexCBindingConstants {
return new FindBinding.DefaultBindingBTreeComparator(this);
}
+ @Override
+ public PDOMGlobalScope getGlobalScope() {
+ return PDOMCGlobalScope.INSTANCE;
+ }
+
@Override
public PDOMBinding addTypeBinding(IBinding type) throws CoreException {
return addBinding(type, null);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPBinding.java
index d5bfbf8f3b2..a4ea9e1afc4 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPBinding.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPBinding.java
@@ -84,6 +84,6 @@ public abstract class PDOMCPPBinding extends PDOMBinding implements ICPPBinding
} catch (CoreException e) {
CCorePlugin.log(e);
}
- return PDOMCPPGlobalScope.INSTANCE;
+ return getLinkage().getGlobalScope();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
index 61bf7d4bd59..c8ab70c9c10 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
@@ -136,6 +136,7 @@ import org.eclipse.cdt.internal.core.pdom.dom.IPDOMMemberOwner;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMASTAdapter;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMFile;
+import org.eclipse.cdt.internal.core.pdom.dom.PDOMGlobalScope;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMLinkage;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMName;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
@@ -1055,6 +1056,11 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
}
@Override
+ public PDOMGlobalScope getGlobalScope() {
+ return PDOMCPPGlobalScope.INSTANCE;
+ }
+
+ @Override
public void onCreateName(PDOMFile file, IASTName name, PDOMName pdomName) throws CoreException {
super.onCreateName(file, name, pdomName);

Back to the top