From: bdemsky Date: Mon, 14 Mar 2011 02:26:47 +0000 (+0000) Subject: bug fix X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=810f704b8aed6ce1cd0545ca5b96651900328a96;p=IRC.git bug fix --- diff --git a/Robust/src/IR/ClassDescriptor.java b/Robust/src/IR/ClassDescriptor.java index ae11b75d..d9d611d5 100644 --- a/Robust/src/IR/ClassDescriptor.java +++ b/Robust/src/IR/ClassDescriptor.java @@ -194,18 +194,18 @@ public class ClassDescriptor extends Descriptor { public MethodDescriptor getCalledMethod(MethodDescriptor md) { ClassDescriptor cn=this; while(true) { - Iterator methodit=cn.getMethods(); - //Iterator through methods - while(methodit.hasNext()) { - Set possiblematches=cn.getMethodTable().getSet(md.getSymbol()); - boolean foundmatch=false; - for(Iterator matchit=possiblematches.iterator(); matchit.hasNext();) { - MethodDescriptor matchmd=(MethodDescriptor)matchit.next(); - if (md.matches(matchmd)) { - return matchmd; - } + if (cn==null) { + return null; + } + Set possiblematches=cn.getMethodTable().getSet(md.getSymbol()); + boolean foundmatch=false; + for(Iterator matchit=possiblematches.iterator(); matchit.hasNext();) { + MethodDescriptor matchmd=(MethodDescriptor)matchit.next(); + if (md.matches(matchmd)) { + return matchmd; } } + //Not found...walk one level up cn=cn.getSuperDesc(); }