Fixed "getMethod(Selector)" for the case where in an abstract class a method references a method of its implemented interface(s).

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@583 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
egeay 2007-01-16 21:49:02 +00:00
parent 8942ca89cf
commit 2d0309022b
1 changed files with 5 additions and 4 deletions

View File

@ -503,16 +503,17 @@ public final class ShrikeClass implements IClass {
// didn't find it yet. special logic for interfaces
try {
if (isInterface()) {
if (isInterface() || isAbstract()) {
final Iterator<IClass> it = (isInterface()) ? getAllAncestorInterfaces().iterator() :
getAllImplementedInterfaces().iterator();
// try each superinterface
for (Iterator it = getAllAncestorInterfaces().iterator(); it.hasNext();) {
while (it.hasNext()) {
IClass k = (IClass) it.next();
result = k.getMethod(selector);
if (result != null) {
return result;
}
}
}
} catch (ClassHierarchyException e) {
e.printStackTrace();
@ -757,7 +758,7 @@ public final class ShrikeClass implements IClass {
public void clearSoftCaches() {
// toss optional information from each method.
if (methodMap != null) {
for (Iterator it = getDeclaredMethods().iterator(); it.hasNext();) {
for (Iterator<IMethod> it = getDeclaredMethods().iterator(); it.hasNext();) {
ShrikeCTMethod m = (ShrikeCTMethod) it.next();
m.clearCaches();
}