From: jjenista <jjenista>
Date: Tue, 24 Mar 2009 02:30:07 +0000 (+0000)
Subject: fix bug when mapping callee edges into caller, gotta look at super classes for possib... 
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1de9740574919566346a2cf9e40c584d580293b3;p=IRC.git

fix bug when mapping callee edges into caller, gotta look at super classes for possible match
---

diff --git a/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java b/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java
index a7a90102..3605309b 100644
--- a/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java
+++ b/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java
@@ -1229,7 +1229,7 @@ public class OwnershipAnalysis {
   // insert a call to debugSnapshot() somewhere in the analysis 
   // to get successive captures of the analysis state
   boolean takeDebugSnapshots = false;
-  String mcDescSymbolDebug = "setFlightPlan";
+  String mcDescSymbolDebug = "StandardEngine";
   boolean stopAfterCapture = true;
 
   // increments every visit to debugSnapshot, don't fiddle with it
@@ -1246,7 +1246,7 @@ public class OwnershipAnalysis {
   int iterStartCapture = 0;
 
   // the number of snapshots to take
-  int numIterToCapture = 10;
+  int numIterToCapture = 100;
 
   void debugSnapshot(OwnershipGraph og, FlatNode fn) {
     if( debugCounter > iterStartCapture + numIterToCapture ) {
diff --git a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java
index 04a54d04..dca6db51 100644
--- a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java
+++ b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java
@@ -1841,7 +1841,6 @@ public class OwnershipGraph {
     String debugCaller = "foo";
     String debugCallee = "bar";
 
-
     if( mc.getDescriptor().getSymbol().equals( debugCaller ) &&
 	fm.getMethod().getSymbol().equals( debugCallee ) ) {
 
@@ -2952,15 +2951,22 @@ public class OwnershipGraph {
       return false;
     }
 
-    Iterator fieldsSrcItr = tdSrc.getClassDesc().getFields();
-    while( fieldsSrcItr.hasNext() ) {
-      FieldDescriptor fd = (FieldDescriptor) fieldsSrcItr.next();
-      if( fd.getType().equals( edge.getType() ) &&
-	  fd.getSymbol().equals( edge.getField() ) ) {
-	return true;
+    ClassDescriptor cd = tdSrc.getClassDesc();
+    while( cd != null ) {      
+      Iterator fieldItr = cd.getFields();
+
+      while( fieldItr.hasNext() ) {	
+	FieldDescriptor fd = (FieldDescriptor) fieldItr.next();
+
+	if( fd.getType().equals( edge.getType() ) &&
+	    fd.getSymbol().equals( edge.getField() ) ) {
+	  return true;
+	}
       }
+      
+      cd = cd.getSuperDesc();
     }
-
+    
     // otherwise it is a class with fields
     // but we didn't find a match
     return false;