Program: 75422
Project: 75422
Buggy source:
private boolean _inlineInsideMethodCalls(SootClass theClass,SootMethod method,JimpleBody body,PortInliner inliner,boolean debug){
  boolean doneSomething=false;
  CompleteUnitGraph unitGraph=new CompleteUnitGraph(body);
  SimpleLocalDefs localDefs=new SimpleLocalDefs(unitGraph);
  SimpleLocalUses localUses=new SimpleLocalUses(unitGraph,localDefs);
  for (Iterator units=body.getUnits().snapshotIterator(); units.hasNext(); ) {
    Stmt stmt=(Stmt)units.next();
    if (!stmt.containsInvokeExpr()) {
      continue;
    }
    ValueBox box=stmt.getInvokeExprBox();
    Value value=stmt.getInvokeExpr();
    if (value instanceof InstanceInvokeExpr) {
      InstanceInvokeExpr r=(InstanceInvokeExpr)value;
      if (r.getBase().getType() instanceof RefType) {
        RefType type=(RefType)r.getBase().getType();
        if (r.getMethod().equals(PtolemyUtilities.connectionsChangedMethod)) {
          if (type.getSootClass().isApplicationClass()) {
            SootMethod inlinee=null;
            if (r instanceof VirtualInvokeExpr) {
              List methodList=Scene.v().getActiveHierarchy().resolveAbstractDispatch(type.getSootClass(),PtolemyUtilities.connectionsChangedMethod);
              if (methodList.size() == 1) {
                inlinee=(SootMethod)methodList.get(0);
              }
 else {
                String string="String_Node_Str" + stmt + "String_Node_Str"+ method+ "String_Node_Str";
                for (int i=0; i < methodList.size(); i++) {
                  string+="String_Node_Str" + methodList.get(i) + "String_Node_Str";
                }
                System.out.println(string);
              }
            }
 else             if (r instanceof SpecialInvokeExpr) {
              inlinee=Scene.v().getActiveHierarchy().resolveSpecialDispatch((SpecialInvokeExpr)r,method);
            }
            if (!inlinee.getDeclaringClass().isApplicationClass()) {
              inlinee.getDeclaringClass().setLibraryClass();
            }
            inlinee.retrieveActiveBody();
            if (debug)             System.out.println("String_Node_Str" + r);
            SiteInliner.inlineSite(inlinee,stmt,method);
            doneSomething=true;
          }
 else {
            body.getUnits().remove(stmt);
            doneSomething=true;
          }
        }
        Value argValues[]=new Value[r.getArgCount()];
        int constantArgCount=0;
        for (Iterator args=r.getArgs().iterator(); args.hasNext(); ) {
          Value arg=(Value)args.next();
          if (Evaluator.isValueConstantValued(arg)) {
            argValues[constantArgCount++]=Evaluator.getConstantValueOf(arg);
          }
 else {
            break;
          }
        }
        boolean allArgsAreConstant=(r.getArgCount() == constantArgCount);
        if (SootUtilities.derivesFrom(type.getSootClass(),PtolemyUtilities.componentPortClass)) {
          TypedIOPort port=(TypedIOPort)getPortValue(method,(Local)r.getBase(),stmt,localDefs,localUses);
          if (port == null) {
            continue;
          }
          if (r.getMethod().getSubSignature().equals(PtolemyUtilities.getFullNameMethod.getSubSignature())) {
            box.setValue(StringConstant.v(port.getFullName()));
          }
          if (r.getMethod().getSubSignature().equals(PtolemyUtilities.getNameMethod.getSubSignature())) {
            box.setValue(StringConstant.v(port.getName()));
          }
          String methodName=r.getMethod().getName();
          if (r.getMethod().getName().equals("String_Node_Str")) {
            if (port.isInput()) {
              box.setValue(IntConstant.v(1));
            }
 else {
              box.setValue(IntConstant.v(0));
            }
          }
 else           if (r.getMethod().getName().equals("String_Node_Str")) {
            if (port.isOutput()) {
              box.setValue(IntConstant.v(1));
            }
 else {
              box.setValue(IntConstant.v(0));
            }
          }
 else           if (r.getMethod().getName().equals("String_Node_Str")) {
            if (port.isMultiport()) {
              box.setValue(IntConstant.v(1));
            }
 else {
              box.setValue(IntConstant.v(0));
            }
          }
 else           if (r.getMethod().getName().equals("String_Node_Str")) {
            Object object=SootUtilities.reflectAndInvokeMethod(port,r.getMethod(),argValues);
            Constant constant=SootUtilities.convertArgumentToConstantValue(object);
            box.setValue(constant);
          }
 else           if (r.getMethod().getName().equals("String_Node_Str")) {
            box.setValue(IntConstant.v(1));
          }
 else           if (r.getMethod().getName().equals("String_Node_Str")) {
            box.setValue(IntConstant.v(1));
          }
 else           if (r.getMethod().getName().equals("String_Node_Str")) {
            inliner.inlineGetInside(body,stmt,box,r,port);
          }
 else           if (r.getMethod().getName().equals("String_Node_Str")) {
            inliner.inlineSendInside(body,stmt,r,port);
          }
        }
      }
    }
  }
  return doneSomething;
}

Fixed version (ground truth):
private boolean _inlineInsideMethodCalls(SootClass theClass,SootMethod method,JimpleBody body,PortInliner inliner,boolean debug){
  if (debug)   System.out.println("String_Node_Str" + method);
  boolean doneSomething=false;
  CompleteUnitGraph unitGraph=new CompleteUnitGraph(body);
  SimpleLocalDefs localDefs=new SimpleLocalDefs(unitGraph);
  SimpleLocalUses localUses=new SimpleLocalUses(unitGraph,localDefs);
  for (Iterator units=body.getUnits().snapshotIterator(); units.hasNext(); ) {
    Stmt stmt=(Stmt)units.next();
    if (!stmt.containsInvokeExpr()) {
      continue;
    }
    ValueBox box=stmt.getInvokeExprBox();
    Value value=stmt.getInvokeExpr();
    if (value instanceof InstanceInvokeExpr) {
      InstanceInvokeExpr r=(InstanceInvokeExpr)value;
      if (r.getBase().getType() instanceof RefType) {
        RefType type=(RefType)r.getBase().getType();
        if (r.getMethod().equals(PtolemyUtilities.connectionsChangedMethod)) {
          if (type.getSootClass().isApplicationClass()) {
            SootMethod inlinee=null;
            if (r instanceof VirtualInvokeExpr) {
              List methodList=Scene.v().getActiveHierarchy().resolveAbstractDispatch(type.getSootClass(),PtolemyUtilities.connectionsChangedMethod);
              if (methodList.size() == 1) {
                inlinee=(SootMethod)methodList.get(0);
              }
 else {
                String string="String_Node_Str" + stmt + "String_Node_Str"+ method+ "String_Node_Str";
                for (int i=0; i < methodList.size(); i++) {
                  string+="String_Node_Str" + methodList.get(i) + "String_Node_Str";
                }
                System.out.println(string);
              }
            }
 else             if (r instanceof SpecialInvokeExpr) {
              inlinee=Scene.v().getActiveHierarchy().resolveSpecialDispatch((SpecialInvokeExpr)r,method);
            }
            if (!inlinee.getDeclaringClass().isApplicationClass()) {
              inlinee.getDeclaringClass().setLibraryClass();
            }
            inlinee.retrieveActiveBody();
            if (debug)             System.out.println("String_Node_Str" + r);
            SiteInliner.inlineSite(inlinee,stmt,method);
            doneSomething=true;
          }
 else {
            body.getUnits().remove(stmt);
            doneSomething=true;
          }
        }
        Value argValues[]=new Value[r.getArgCount()];
        int constantArgCount=0;
        for (Iterator args=r.getArgs().iterator(); args.hasNext(); ) {
          Value arg=(Value)args.next();
          if (Evaluator.isValueConstantValued(arg)) {
            argValues[constantArgCount++]=Evaluator.getConstantValueOf(arg);
          }
 else {
            break;
          }
        }
        boolean allArgsAreConstant=(r.getArgCount() == constantArgCount);
        if (SootUtilities.derivesFrom(type.getSootClass(),PtolemyUtilities.componentPortClass)) {
          TypedIOPort port=(TypedIOPort)getPortValue(method,(Local)r.getBase(),stmt,localDefs,localUses);
          if (port == null) {
            continue;
          }
          if (r.getMethod().getSubSignature().equals(PtolemyUtilities.getFullNameMethod.getSubSignature())) {
            box.setValue(StringConstant.v(port.getFullName()));
          }
          if (r.getMethod().getSubSignature().equals(PtolemyUtilities.getNameMethod.getSubSignature())) {
            box.setValue(StringConstant.v(port.getName()));
          }
          String methodName=r.getMethod().getName();
          if (r.getMethod().getName().equals("String_Node_Str")) {
            if (port.isInput()) {
              box.setValue(IntConstant.v(1));
            }
 else {
              box.setValue(IntConstant.v(0));
            }
          }
 else           if (r.getMethod().getName().equals("String_Node_Str")) {
            if (port.isOutput()) {
              box.setValue(IntConstant.v(1));
            }
 else {
              box.setValue(IntConstant.v(0));
            }
          }
 else           if (r.getMethod().getName().equals("String_Node_Str")) {
            if (port.isMultiport()) {
              box.setValue(IntConstant.v(1));
            }
 else {
              box.setValue(IntConstant.v(0));
            }
          }
 else           if (r.getMethod().getName().equals("String_Node_Str")) {
            Object object=SootUtilities.reflectAndInvokeMethod(port,r.getMethod(),argValues);
            Constant constant=SootUtilities.convertArgumentToConstantValue(object);
            box.setValue(constant);
          }
 else           if (r.getMethod().getName().equals("String_Node_Str")) {
            box.setValue(IntConstant.v(1));
          }
 else           if (r.getMethod().getName().equals("String_Node_Str")) {
            box.setValue(IntConstant.v(1));
          }
 else           if (r.getMethod().getName().equals("String_Node_Str")) {
            inliner.inlineGetInside(body,stmt,box,r,port);
          }
 else           if (r.getMethod().getName().equals("String_Node_Str")) {
            inliner.inlineSendInside(body,stmt,r,port);
          }
        }
      }
    }
  }
  return doneSomething;
}