Program: 132734
Project: 132734
Buggy source:
/** 
 * Analyse the variables that are present in the block and add VariableUsageInfo object to the BLOCK AST nodes
 * @param function
 * @param oList
 * @param iList
 * @param block
 * @throws UserException
 */
public void analyzeVariableUsage(Context context,LineMapping lineMapping,String function,List<Var> iList,List<Var> oList,SwiftAST block) throws UserException {
  LogHelper.debug(context,"String_Node_Str" + function);
  this.lineMapping=lineMapping;
  VariableUsageInfo globVui=new VariableUsageInfo();
  for (  Var global : context.getScopeVariables()) {
    globVui.declare(context,global.name(),global.type(),false);
    globVui.assign(context,global.name(),AssignOp.ASSIGN);
  }
  VariableUsageInfo argVui=globVui.createNested();
  Context fnContext=new LocalContext(context,function);
  for (  Var i : iList) {
    argVui.declare(context,i.name(),i.type(),false);
    argVui.assign(context,i.name(),AssignOp.ASSIGN);
    fnContext.declareVariable(i.type(),i.name(),i.storage(),i.defType(),VarProvenance.unknown(),i.mappedDecl());
  }
  for (  Var o : oList) {
    argVui.declare(context,o.name(),o.type(),false);
    argVui.read(context,o.name());
    fnContext.declareVariable(o.type(),o.name(),o.storage(),o.defType(),VarProvenance.unknown(),o.mappedDecl());
  }
  walkBlock(fnContext,block,argVui);
  boolean fatalError=false;
  for (  Violation v : argVui.getViolations()) {
    String msg=v.toException().getMessage();
    if (v.getType() == ViolationType.ERROR) {
      fatalError=true;
      LogHelper.log(0,Level.ERROR,msg);
    }
 else {
      LogHelper.log(0,Level.WARN,msg);
    }
  }
  if (fatalError) {
    throw new VariableUsageException("String_Node_Str" + function + "String_Node_Str");
  }
  LogHelper.debug(context,"String_Node_Str" + function);
}

Fixed version (ground truth):
/** 
 * Analyse the variables that are present in the block and add VariableUsageInfo object to the BLOCK AST nodes
 * @param function
 * @param oList
 * @param iList
 * @param block
 * @throws UserException
 */
public void analyzeVariableUsage(Context context,LineMapping lineMapping,String function,List<Var> iList,List<Var> oList,SwiftAST block) throws UserException {
  LogHelper.debug(context,"String_Node_Str" + function);
  this.lineMapping=lineMapping;
  VariableUsageInfo globVui=new VariableUsageInfo();
  for (  Var global : context.getScopeVariables()) {
    globVui.declare(context,global.name(),global.type(),false);
    globVui.assign(context,global.name(),AssignOp.ASSIGN);
  }
  VariableUsageInfo argVui=globVui.createNested();
  Context fnContext=new LocalContext(context,function);
  for (  Var i : iList) {
    argVui.declare(fnContext,i.name(),i.type(),false);
    argVui.assign(fnContext,i.name(),AssignOp.ASSIGN);
    fnContext.declareVariable(i.type(),i.name(),i.storage(),i.defType(),VarProvenance.unknown(),i.mappedDecl());
  }
  for (  Var o : oList) {
    argVui.declare(fnContext,o.name(),o.type(),false);
    argVui.read(fnContext,o.name());
    fnContext.declareVariable(o.type(),o.name(),o.storage(),o.defType(),VarProvenance.unknown(),o.mappedDecl());
  }
  walkBlock(fnContext,block,argVui);
  boolean fatalError=false;
  for (  Violation v : argVui.getViolations()) {
    String msg=v.toException().getMessage();
    if (v.getType() == ViolationType.ERROR) {
      fatalError=true;
      LogHelper.log(0,Level.ERROR,msg);
    }
 else {
      LogHelper.log(0,Level.WARN,msg);
    }
  }
  if (fatalError) {
    throw new VariableUsageException("String_Node_Str" + function + "String_Node_Str");
  }
  LogHelper.debug(context,"String_Node_Str" + function);
}