From 810f704b8aed6ce1cd0545ca5b96651900328a96 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Mon, 14 Mar 2011 02:26:47 +0000 Subject: [PATCH] bug fix --- Robust/src/IR/ClassDescriptor.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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(); } -- 2.34.1