bug fix in getField()

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1164 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
sjfink 2007-05-23 13:42:04 +00:00
parent 42e43625cd
commit 59822957c9
1 changed files with 13 additions and 0 deletions

View File

@ -550,6 +550,19 @@ public final class ShrikeClass implements IClass {
return f;
}
}
// try superinterfaces
try {
Collection<IClass> ifaces = isInterface() ? getAllAncestorInterfaces() : getAllImplementedInterfaces();
for (IClass i : ifaces) {
f = i.getField(name);
if (f != null) {
fieldMap.put(name, f);
return f;
}
}
} catch (ClassHierarchyException e) {
// skip
}
}
return null;