summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2013-07-08 22:52:11 (EDT)
committer Sergey Prigogin2013-07-09 13:06:44 (EDT)
commit982b93967bab4e247d0dc701633a97897561d327 (patch)
tree6d7c22f6edc0f8cf1c6b971621edb329855f8cda
parentc5b4670184ef9fb62f92cff55e2b6d4c6cf475dd (diff)
downloadorg.eclipse.cdt-982b93967bab4e247d0dc701633a97897561d327.zip
org.eclipse.cdt-982b93967bab4e247d0dc701633a97897561d327.tar.gz
org.eclipse.cdt-982b93967bab4e247d0dc701633a97897561d327.tar.bz2
Fixed an "unsafe method call" exception.refs/changes/98/14398/2
Change-Id: Iacc5a6a5c410766bd14ef2ec4ac626d1077e93b6 Signed-off-by: Nathan Ridge <zeratul976@hotmail.com> Reviewed-on: https://git.eclipse.org/r/14398 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/Value.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java6
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LinkedNamesFinder.java2
3 files changed, 5 insertions, 5 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/Value.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/Value.java
index 914bbee..6675227 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/Value.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/Value.java
@@ -355,7 +355,7 @@ public class Value implements IValue {
type1 = SemanticUtil.getNestedType(type1, TDEF);
type2 = SemanticUtil.getNestedType(type2, TDEF);
if (type1 instanceof ICPPClassType && type2 instanceof ICPPClassType) {
- return ClassTypeHelper.isSubclass((ICPPClassType) type2, (ICPPClassType) type1) ? 1 : 0;
+ return ClassTypeHelper.isSubclass((ICPPClassType) type2, (ICPPClassType) type1, point) ? 1 : 0;
} else {
return 0;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java
index 3a11376..18c6a61 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java
@@ -309,8 +309,8 @@ public class ClassTypeHelper {
* Checks inheritance relationship between two classes.
* @return <code>true</code> if {@code subclass} is a subclass of {@code superclass}.
*/
- public static boolean isSubclass(ICPPClassType subclass, ICPPClassType superclass) {
- ICPPBase[] bases= subclass.getBases();
+ public static boolean isSubclass(ICPPClassType subclass, ICPPClassType superclass, IASTNode point) {
+ ICPPBase[] bases= getBases(subclass, point);
for (ICPPBase base : bases) {
IBinding b= base.getBaseClass();
if (b instanceof ICPPClassType) {
@@ -318,7 +318,7 @@ public class ClassTypeHelper {
if (baseClass.isSameType(superclass)) {
return true;
}
- if (isSubclass(baseClass, superclass)) {
+ if (isSubclass(baseClass, superclass, point)) {
return true;
}
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LinkedNamesFinder.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LinkedNamesFinder.java
index 3de9c43..ebbb4d4 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LinkedNamesFinder.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LinkedNamesFinder.java
@@ -314,7 +314,7 @@ public class LinkedNamesFinder {
if (binding instanceof ICPPClassType) {
if (seenClasses.add(binding)) {
ICPPClassType candidate = (ICPPClassType) binding;
- if (ClassTypeHelper.isSubclass(candidate, baseClass)) {
+ if (ClassTypeHelper.isSubclass(candidate, baseClass, name)) {
subclasses.add(candidate);
}
}