bug fix
authorbdemsky <bdemsky>
Mon, 14 Mar 2011 02:26:47 +0000 (02:26 +0000)
committerbdemsky <bdemsky>
Mon, 14 Mar 2011 02:26:47 +0000 (02:26 +0000)
Robust/src/IR/ClassDescriptor.java

index ae11b75d2a153cd9a5fb7c3e7e8f52af4b588da4..d9d611d5d1f9e16b2867b759884d969650406998 100644 (file)
@@ -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();
     }