nus-yam/ex-repair huggingface dataset:
Program: 44023
Project: 44023
Buggy source:
/** 
 * This needs to leave any values returned by yield in the corouting  on the calling vm stack
 * @param vm
 * @param prior
 */
public void resumeFrom(VM vm,LThread prior){
  if (status == STATUS_DEAD) {
    vm.settop(0);
    vm.pushboolean(false);
    vm.pushstring("String_Node_Str");
    return;
  }
  if (prior != null)   prior.status=STATUS_NORMAL;
  try {
    if (threadVm.cc < 0) {
      vm.xmove(threadVm,vm.gettop() - 2);
      threadVm.prepStackCall();
    }
 else {
      threadVm.settop(0);
      vm.xmove(threadVm,vm.gettop() - 2);
    }
    status=STATUS_ACTIVE;
    while (threadVm.cc >= 0 && status == STATUS_ACTIVE)     threadVm.exec();
    vm.settop(0);
    vm.pushboolean(true);
    if (threadVm.cc >= 0) {
      threadVm.xmove(vm,threadVm.gettop() - 1);
    }
 else {
      threadVm.base=0;
      threadVm.xmove(vm,threadVm.gettop());
    }
  }
 catch (  Throwable t) {
    status=STATUS_DEAD;
    vm.settop(0);
    vm.pushboolean(false);
    vm.pushstring("String_Node_Str" + t);
  }
 finally {
    if (threadVm.cc < 0)     status=STATUS_DEAD;
    if (prior != null)     prior.status=STATUS_ACTIVE;
  }
}

Fixed version (ground truth):
/** 
 * This needs to leave any values returned by yield in the coroutine  on the calling vm stack
 * @param vm
 * @param nargs 
 */
public void resumeFrom(VM vm,int nargs){
  if (status == STATUS_DEAD) {
    vm.error("String_Node_Str");
    return;
  }
  LThread prior=running;
  try {
    running=this;
    if (prior != null)     prior.status=STATUS_NORMAL;
    status=STATUS_RUNNING;
    if (threadVm.cc < 0) {
      vm.xmove(threadVm,nargs);
      threadVm.prepStackCall();
    }
 else {
      threadVm.settop(0);
      vm.xmove(threadVm,nargs);
    }
    while (threadVm.cc >= 0 && status == STATUS_RUNNING)     threadVm.exec();
    vm.settop(0);
    vm.pushboolean(true);
    if (threadVm.cc >= 0) {
      threadVm.xmove(vm,threadVm.gettop() - 1);
    }
 else {
      threadVm.base=0;
      threadVm.xmove(vm,threadVm.gettop());
    }
  }
 catch (  Throwable t) {
    status=STATUS_DEAD;
    vm.settop(0);
    vm.pushboolean(false);
    vm.pushstring("String_Node_Str" + t);
  }
 finally {
    running=prior;
    if (running != null)     running.status=STATUS_RUNNING;
    if (threadVm.cc < 0)     status=STATUS_DEAD;
  }
}
Program: 44024
Project: 44024
Buggy source:
public boolean yield(){
  if (status == STATUS_ACTIVE)   status=STATUS_SUSPENDED;
  return true;
}

Fixed version (ground truth):
public boolean yield(){
  if (status == STATUS_RUNNING)   status=STATUS_SUSPENDED;
  return true;
}
Program: 44025
Project: 44025
Buggy source:
public boolean luaStackCall(VM vm){
switch (id) {
case 0:
{
      install();
      vm.pushnil();
      break;
    }
case 1:
{
    Closure c=(Closure)vm.topointer(2);
    vm.pushlvalue(new LThread(c));
    break;
  }
case 2:
{
  LThread t=(LThread)vm.topointer(2);
  t.resumeFrom(vm,vm.gettop() - 2);
  return false;
}
case 3:
{
LThread r=LThread.getRunning();
if (r != null) {
  vm.pushlvalue(r);
}
 else {
  vm.pushnil();
}
break;
}
case 4:
{
vm.pushstring(((LThread)vm.topointer(2)).getStatus());
break;
}
case 5:
{
Closure c=(Closure)vm.topointer(2);
vm.pushlvalue(new CoroutinesLib(7,new LThread(c)));
break;
}
case 6:
{
LThread r=LThread.getRunning();
if (r == null) vm.error("String_Node_Str");
 else {
return r.yield();
}
}
case 7:
{
LThread t=this.thread;
t.resumeFrom(vm,vm.gettop() - 1);
vm.remove(1);
return false;
}
}
vm.insert(1);
vm.settop(1);
return false;
}

Fixed version (ground truth):
public boolean luaStackCall(VM vm){
switch (id) {
case 0:
{
      install();
      vm.pushnil();
      break;
    }
case 1:
{
    Closure c=(Closure)vm.topointer(2);
    vm.pushlvalue(new LThread(c));
    break;
  }
case 2:
{
  LThread t=(LThread)vm.topointer(2);
  t.resumeFrom(vm,vm.gettop() - 2);
  return false;
}
case 3:
{
LThread r=LThread.getRunning();
if (r != null) {
  vm.pushlvalue(r);
}
 else {
  vm.pushnil();
}
break;
}
case 4:
{
vm.pushstring(((LThread)vm.topointer(2)).getStatus());
break;
}
case 5:
{
Closure c=(Closure)vm.topointer(2);
vm.pushlvalue(new CoroutinesLib(7,new LThread(c)));
break;
}
case 6:
{
LThread r=LThread.getRunning();
if (r == null) vm.error("String_Node_Str");
 else {
return r.yield();
}
}
case 7:
{
LThread t=this.thread;
t.resumeFrom(vm,vm.gettop() - 1);
if (vm.toboolean(1)) vm.remove(1);
 else vm.error(vm.tostring(2),0);
return false;
}
}
vm.insert(1);
vm.settop(1);
return false;
}
Program: 44027
Project: 44027
Buggy source:
/** 
 * Invoke a builtin
 */
public int invoke(VM vm){
switch (id) {
case PRINT:
{
      int n=vm.gettop();
      for (int i=1; i <= n; i++) {
        if (i > 1)         stdout.print("String_Node_Str");
        stdout.print(vm.topointer(i).toJavaString());
      }
      stdout.println();
      return 0;
    }
case PAIRS:
case IPAIRS:
{
    LValue v=vm.topointer(1);
    LValue r=v.luaPairs(id == PAIRS);
    vm.pushlvalue(r);
    return 1;
  }
case GETMETATABLE:
return vm.getmetatable(1);
case SETMETATABLE:
vm.setmetatable(1);
return 1;
case TYPE:
{
LValue v=vm.topointer(1);
vm.pushlstring(v.luaGetTypeName());
return 1;
}
case PCALL:
{
int n=vm.gettop();
int s=vm.pcall(n - 1,Lua.LUA_MULTRET,0);
if (s == 0) {
vm.pushboolean(true);
vm.insert(1);
return vm.gettop();
}
 else {
vm.pushboolean(false);
vm.insert(-2);
return 2;
}
}
default :
luaUnsupportedOperation();
return 0;
}
}

Fixed version (ground truth):
/** 
 * Invoke a builtin
 */
public int invoke(VM vm){
switch (id) {
case PRINT:
{
      int n=vm.gettop();
      for (int i=1; i <= n; i++) {
        if (i > 1)         stdout.print("String_Node_Str");
        stdout.print(vm.topointer(i).toJavaString());
      }
      stdout.println();
      return 0;
    }
case PAIRS:
case IPAIRS:
{
    LValue v=vm.topointer(1);
    LValue r=v.luaPairs(id == PAIRS);
    vm.pushlvalue(r);
    return 1;
  }
case GETMETATABLE:
return vm.getmetatable(1);
case SETMETATABLE:
vm.setmetatable(1);
return 1;
case TYPE:
{
LValue v=vm.topointer(1);
vm.pushlstring(v.luaGetTypeName());
return 1;
}
case PCALL:
{
int n=vm.gettop();
int s=vm.pcall(n - 1,Lua.LUA_MULTRET,0);
if (s == 0) {
vm.pushboolean(true);
vm.insert(1);
return vm.gettop();
}
 else {
vm.pushboolean(false);
vm.insert(-2);
return 2;
}
}
case ERROR:
{
vm.error(vm.tostring(1),vm.gettop() > 1 ? vm.tointeger(2) : 1);
}
case ASSERT:
{
if (!vm.toboolean(1)) {
vm.error(vm.gettop() > 1 ? vm.tostring(2) : "String_Node_Str",0);
}
 else {
return vm.gettop();
}
}
default :
luaUnsupportedOperation();
return 0;
}
}
Program: 44028
Project: 44028
Buggy source:
/** 
 * Raises an error.   The message is pushed onto the stack and used as the error message.   It also adds at the beginning of the message the file name and the line number where  the error occurred, if this information is available. In the java implementation this throws a RuntimeException, possibly filling  line number information first.
 */
public void error(String message);

Fixed version (ground truth):
/** 
 * Raises an error.   The message is pushed onto the stack and used as the error message.   It also adds at the beginning of the message the file name and the line number where  the error occurred, if this information is available. In the java implementation this throws a RuntimeException, possibly filling  line number information first.
 */
public void error(String message,int level);
Program: 44029
Project: 44029
Buggy source:
public void error(String message){
  super.error(getFileLine(cc) + "String_Node_Str" + message);
}

Fixed version (ground truth):
public void error(String message){
  error(message,1);
}
Program: 44030
Project: 44030
Buggy source:
public void exec(){
  try {
    super.exec();
  }
 catch (  AbortException e) {
  }
catch (  Exception t) {
    t.printStackTrace();
    printLuaTrace();
    System.out.flush();
  }
}

Fixed version (ground truth):
public void exec(){
  try {
    super.exec();
  }
 catch (  AbortException e) {
  }
}
Program: 44031
Project: 44031
Buggy source:
/** 
 * This needs to leave any values returned by yield in the coroutine  on the calling vm stack
 * @param vm
 * @param nargs 
 */
public void resumeFrom(VM vm,int nargs){
  if (status == STATUS_DEAD) {
    vm.error("String_Node_Str");
    return;
  }
  LThread prior=running;
  try {
    running=this;
    if (prior != null)     prior.status=STATUS_NORMAL;
    status=STATUS_RUNNING;
    if (threadVm.cc < 0) {
      vm.xmove(threadVm,nargs);
      threadVm.prepStackCall();
    }
 else {
      threadVm.settop(0);
      vm.xmove(threadVm,nargs);
    }
    while (threadVm.cc >= 0 && status == STATUS_RUNNING)     threadVm.exec();
    vm.settop(0);
    vm.pushboolean(true);
    if (threadVm.cc >= 0) {
      threadVm.xmove(vm,threadVm.gettop() - 1);
    }
 else {
      threadVm.base=0;
      threadVm.xmove(vm,threadVm.gettop());
    }
  }
 catch (  Throwable t) {
    status=STATUS_DEAD;
    vm.settop(0);
    vm.pushboolean(false);
    vm.pushstring("String_Node_Str" + t);
  }
 finally {
    running=prior;
    if (running != null)     running.status=STATUS_RUNNING;
    if (threadVm.cc < 0)     status=STATUS_DEAD;
  }
}

Fixed version (ground truth):
/** 
 * This needs to leave any values returned by yield in the coroutine  on the calling vm stack
 * @param vm
 * @param nargs 
 */
public void resumeFrom(VM vm,int nargs){
  if (status == STATUS_DEAD) {
    vm.settop(0);
    vm.pushboolean(false);
    vm.pushstring("String_Node_Str");
    return;
  }
  LThread prior=running;
  try {
    running=this;
    if (prior != null)     prior.status=STATUS_NORMAL;
    status=STATUS_RUNNING;
    if (threadVm.cc < 0) {
      vm.xmove(threadVm,nargs);
      threadVm.prepStackCall();
    }
 else {
      threadVm.settop(0);
      vm.xmove(threadVm,nargs);
    }
    while (threadVm.cc >= 0 && status == STATUS_RUNNING)     threadVm.exec();
    vm.settop(0);
    vm.pushboolean(true);
    if (threadVm.cc >= 0) {
      threadVm.xmove(vm,threadVm.gettop() - 1);
    }
 else {
      threadVm.base=0;
      threadVm.xmove(vm,threadVm.gettop());
    }
  }
 catch (  Throwable t) {
    status=STATUS_DEAD;
    vm.settop(0);
    vm.pushboolean(false);
    vm.pushstring("String_Node_Str" + t);
  }
 finally {
    running=prior;
    if (running != null)     running.status=STATUS_RUNNING;
    if (threadVm.cc < 0)     status=STATUS_DEAD;
  }
}
Program: 44032
Project: 44032
Buggy source:
/** 
 * Get the current line number
 * @param pc program counter
 * @return the line number corresponding to the pc
 */
private int getLineNumber(CallInfo ci){
  int[] lineNumbers=ci.closure.p.lineinfo;
  int pc=ci.pc;
  int line=(lineNumbers != null && lineNumbers.length > pc ? lineNumbers[pc] : -1);
  return line;
}

Fixed version (ground truth):
/** 
 * Get the current line number
 * @param pc program counter
 * @return the line number corresponding to the pc
 */
private int getLineNumber(CallInfo ci){
  int[] lineNumbers=ci.closure.p.lineinfo;
  int pc=(ci != calls[cc] ? ci.pc - 1 : ci.pc);
  int line=(lineNumbers != null && lineNumbers.length > pc ? lineNumbers[pc] : -1);
  return line;
}
Program: 44033
Project: 44033
Buggy source:
public Variable[] getStack(int index){
  if (index < 0 || index >= calls.length) {
    throw new RuntimeException("String_Node_Str");
  }
  Vector variables=new Vector();
  Hashtable variablesSeen=new Hashtable();
  for (int i=index; i >= 0; i--) {
    addVariables(variables,variablesSeen,i);
  }
  Variable[] result=new Variable[variables.size()];
  for (int i=0; i < variables.size(); i++) {
    result[i]=(Variable)variables.elementAt(i);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Returns the visible local variables on a stack frame.
 * @param index The stack frame index
 * @return the visible local variables on the given stack frame.
 */
public Variable[] getStack(int index){
  if (index < 0 || index >= calls.length) {
    throw new RuntimeException("String_Node_Str");
  }
  Vector variables=new Vector();
  Hashtable variablesSeen=new Hashtable();
  for (int i=index; i >= 0; i--) {
    addVariables(variables,variablesSeen,i);
  }
  Variable[] result=new Variable[variables.size()];
  for (int i=0; i < variables.size(); i++) {
    result[i]=(Variable)variables.elementAt(i);
  }
  return result;
}
Program: 44034
Project: 44034
Buggy source:
/** 
 * Returns the visible local variables on a stack frame.
 * @param index The stack frame index
 * @return the visible local variables on the given stack frame.
 */
public Variable[] getStack(int index){
  if (index < 0 || index >= calls.length) {
    throw new RuntimeException("String_Node_Str");
  }
  Vector variables=new Vector();
  Hashtable variablesSeen=new Hashtable();
  addVariables(variables,variablesSeen,index);
  Variable[] result=new Variable[variables.size()];
  for (int i=0; i < variables.size(); i++) {
    result[i]=(Variable)variables.elementAt(i);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Returns the visible local variables on a stack frame.
 * @param index The stack frame index
 * @return the visible local variables on the given stack frame.
 */
public Variable[] getStack(int index){
  if (index < 0 || index >= calls.length) {
    throw new RuntimeException("String_Node_Str");
  }
  Vector variables=new Vector();
  Hashtable variablesSeen=new Hashtable();
  Proto p=calls[index].closure.p;
  for (int i=index; i >= 0; i--) {
    if (i == index || isInScope(p,calls[i])) {
      addVariables(variables,variablesSeen,i);
    }
  }
  Variable[] result=new Variable[variables.size()];
  for (int i=0; i < variables.size(); i++) {
    result[i]=(Variable)variables.elementAt(i);
  }
  return result;
}
Program: 44035
Project: 44035
Buggy source:
public TableVariable(int index,String name,int type,LTable table){
  super(index,name,type,null);
  int size=table.size();
  DebugUtils.println("String_Node_Str" + size);
  this.keys=new String[size];
  this.values=new Object[size];
  LValue[] keyValues=table.getKeys();
  for (int i=0; i < size; i++) {
    this.keys[i]=keyValues[i].toString();
    LValue value=table.get(keyValues[i]);
    if (value instanceof LTable) {
      this.values[i]=new TableVariable(i,"String_Node_Str",Lua.LUA_TTABLE,(LTable)value);
    }
 else {
      this.values[i]=value.toString();
    }
    DebugUtils.println("String_Node_Str" + keys[i] + "String_Node_Str"+ values[i].toString()+ "String_Node_Str");
  }
}

Fixed version (ground truth):
public TableVariable(int index,String name,int type,LTable table){
  super(index,name,type,null);
  int size=table.size();
  DebugUtils.println("String_Node_Str" + size);
  List keyArray=new ArrayList();
  List valueArray=new ArrayList();
  LValue[] keyValues=table.getKeys();
  for (int i=0; i < size; i++) {
    LValue value=table.get(keyValues[i]);
    if (value == table) {
      continue;
    }
    keyArray.add(keyValues[i].toString());
    if (value instanceof LTable) {
      DebugUtils.println("String_Node_Str" + i + "String_Node_Str"+ value.toString());
      valueArray.add(new TableVariable(i,"String_Node_Str" + keyValues[i].toString() + "String_Node_Str",Lua.LUA_TTABLE,(LTable)value));
    }
 else {
      valueArray.add(value.toString());
    }
    DebugUtils.println("String_Node_Str" + keyValues[i].toString() + "String_Node_Str"+ value.toString()+ "String_Node_Str");
  }
  this.keys=(String[])keyArray.toArray(new String[0]);
  this.values=valueArray.toArray();
}
Program: 44036
Project: 44036
Buggy source:
public void luaGetTable(VM vm,LValue table,LValue key){
  vm.push(this);
  vm.push(table);
  vm.push(key);
  vm.setExpectedResultCount(1);
  if (this.luaStackCall(vm))   vm.execute();
 else   vm.adjustResults();
}

Fixed version (ground truth):
public void luaGetTable(VM vm,LValue table,LValue key){
  vm.newCall();
  vm.push(this);
  vm.push(table);
  vm.push(key);
  vm.setExpectedResultCount(1);
  if (this.luaStackCall(vm))   vm.execute();
 else   vm.adjustResults();
}
Program: 44037
Project: 44037
Buggy source:
public void luaSetTable(VM vm,LValue table,LValue key,LValue val){
  vm.push(this);
  vm.push(table);
  vm.push(key);
  vm.push(val);
  vm.setExpectedResultCount(0);
  if (this.luaStackCall(vm))   vm.execute();
 else   vm.adjustResults();
}

Fixed version (ground truth):
public void luaSetTable(VM vm,LValue table,LValue key,LValue val){
  vm.newCall();
  vm.push(this);
  vm.push(table);
  vm.push(key);
  vm.push(val);
  vm.setExpectedResultCount(0);
  if (this.luaStackCall(vm))   vm.execute();
 else   vm.adjustResults();
}
Program: 44038
Project: 44038
Buggy source:
public void luaGetTable(VM vm,LValue table,LValue key){
  final String s=key.luaAsString();
  try {
    Field f=clazz.getField(s);
    Object o=f.get(m_instance);
    LValue v=CoerceJavaToLua.coerce(o);
    vm.push(v);
  }
 catch (  NoSuchFieldException nsfe) {
    vm.setResult(new LMethod(m_instance,clazz,s));
  }
catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void luaGetTable(VM vm,LValue table,LValue key){
  final String s=key.luaAsString();
  try {
    Field f=clazz.getField(s);
    Object o=f.get(m_instance);
    LValue v=CoerceJavaToLua.coerce(o);
    vm.push(v);
  }
 catch (  NoSuchFieldException nsfe) {
    vm.push(new LMethod(m_instance,clazz,s));
  }
catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 44039
Project: 44039
Buggy source:
public static void main(String[] args) throws IOException {
  LuaJava.install();
  String script=(args.length > 0 ? args[0] : "String_Node_Str");
  System.out.println("String_Node_Str" + script + "String_Node_Str");
  StackState state=new StackState();
  InputStream is=LuaJavaAppRunner.class.getResourceAsStream(script);
  Proto p=LoadState.undump(state,is,script);
  Closure c=new Closure(state,p);
  state.doCall(c,new LValue[0]);
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  LuaCompat.install();
  LuaJava.install();
  String script=(args.length > 0 ? args[0] : "String_Node_Str");
  System.out.println("String_Node_Str" + script + "String_Node_Str");
  StackState state=new StackState();
  InputStream is=LuaJavaAppRunner.class.getResourceAsStream(script);
  Proto p=LoadState.undump(state,is,script);
  Closure c=new Closure(state,p);
  state.doCall(c,new LValue[0]);
}
Program: 44041
Project: 44041
Buggy source:
public void luaStackCall(CallFrame call,int base,int top,int nresults){
  try {
    Method[] meths=clazz.getMethods();
    Method meth=null;
    Class[] paramTypes=null;
    int score=Integer.MAX_VALUE;
    int paramsBase=base + 2;
    int nargs=top - paramsBase;
    for (int i=0; i < meths.length; i++) {
      Method m=meths[i];
      String name=m.getName();
      if (s.equals(name)) {
        Class[] p=m.getParameterTypes();
        int s=CoerceLuaToJava.scoreParamTypes(call.stack,paramsBase,nargs,p);
        if (s < score) {
          meth=m;
          paramTypes=p;
          score=s;
        }
      }
    }
    Object[] args=CoerceLuaToJava.coerceArgs(call,paramsBase,nargs,paramTypes);
    Object result=meth.invoke(instance,args);
    call.stack[base]=CoerceJavaToLua.coerce(result);
    call.top=base + 1;
    call.adjustTop(base + nresults);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void luaStackCall(CallFrame call,int base,int top,int nresults){
  try {
    Method[] meths=clazz.getMethods();
    Method meth=null;
    Class[] paramTypes=null;
    int score=Integer.MAX_VALUE;
    int paramsBase=base + 2;
    int nargs=top - paramsBase;
    for (int i=0; i < meths.length; i++) {
      Method m=meths[i];
      String name=m.getName();
      if (s.equals(name)) {
        Class[] p=m.getParameterTypes();
        int s=CoerceLuaToJava.scoreParamTypes(call.stack,paramsBase,nargs,p);
        if (s < score) {
          meth=m;
          paramTypes=p;
          score=s;
        }
      }
    }
    Object[] args=CoerceLuaToJava.coerceArgs(call,paramsBase,nargs,paramTypes);
    Object result=meth.invoke(instance,args);
    call.stack[base]=CoerceJavaToLua.coerce(result);
    call.top=base + 1;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 44043
Project: 44043
Buggy source:
public void move(DatabaseUtil database,double timeleft,double time){
  assert(vehicles.size() > 0);
  Map map=new Map();
  for (  Vehicle v : vehicles) {
    if (v.stopped)     continue;
    v.initMovement(database,timeleft,time,map);
    map.add(v.getActualPosition(),v.getVehicle_id());
  }
}

Fixed version (ground truth):
public void move(DatabaseUtil database,double timeleft,double time){
  assert(vehicles.size() > 0);
  for (  Vehicle v : vehicles) {
    if (v.stopped)     continue;
    v.initMovement(database,timeleft,time);
  }
}
Program: 44044
Project: 44044
Buggy source:
public void initMovement(DatabaseUtil database,double timeLeft,double time,Map map);

Fixed version (ground truth):
public void initMovement(DatabaseUtil database,double timeLeft,double time);
Program: 44045
Project: 44045
Buggy source:
public TrafficAlgorithm(UserInput userInput) throws SQLException {
  System.out.println("String_Node_Str");
  this.user=userInput;
  this.database=new DatabaseUtil();
  this.database.clearVehicles();
  long t0=System.currentTimeMillis();
  user=userInput;
  setVehicles(new AllVehicles());
  database=new DatabaseUtil();
  String out="String_Node_Str";
  OutputUtil kml=new OutputUtil("String_Node_Str");
  out=kml.KMLHeader();
  database.clearVehicles();
  AllVehicles vehicles=new AllVehicles();
  for (int i=0; i < this.user.getTotalVehicles(); i++) {
    Zone from=this.user.getFromZones().selectRandomZone();
    Zone to=this.user.getToZones().selectRandomZone();
    Vehicle v=this.vehicles.generateVehicle(from,to);
    this.vehicles.addVehicle(v);
    this.database.addVehicle(v,this.vehicles.size());
    System.out.println((i + 1) + "String_Node_Str" + this.user.getTotalVehicles());
    System.out.println("String_Node_Str" + (System.currentTimeMillis() - t0) + "String_Node_Str");
  }
  run();
}

Fixed version (ground truth):
public TrafficAlgorithm(UserInput userInput) throws SQLException {
  System.out.println("String_Node_Str");
  this.user=userInput;
  this.database=new DatabaseUtil();
  this.database.clearVehicles();
  long t0=System.currentTimeMillis();
  user=userInput;
  setVehicles(new AllVehicles());
  database=new DatabaseUtil();
  String out="String_Node_Str";
  OutputUtil kml=new OutputUtil("String_Node_Str");
  out=kml.KMLHeader();
  database.clearVehicles();
  this.vehicles=new AllVehicles();
  for (int i=0; i < this.user.getTotalVehicles(); i++) {
    Zone from=this.user.getFromZones().selectRandomZone();
    Zone to=this.user.getToZones().selectRandomZone();
    Vehicle v=this.vehicles.generateVehicle(from,to);
    this.vehicles.addVehicle(v);
    this.database.addVehicle(v,this.vehicles.size());
    System.out.println((i + 1) + "String_Node_Str" + this.user.getTotalVehicles());
    System.out.println("String_Node_Str" + (System.currentTimeMillis() - t0) + "String_Node_Str");
  }
  run();
}
Program: 44046
Project: 44046
Buggy source:
public static Configuration loadFromFile(){
  try {
    instance=loadFromFile("String_Node_Str");
    return instance;
  }
 catch (  NotSerializableException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
catch (  ClassNotFoundException e) {
    e.printStackTrace();
  }
  Configuration c=new Configuration();
  return c;
}

Fixed version (ground truth):
public static Configuration loadFromFile(){
  try {
    instance=loadFromFile("String_Node_Str");
    return instance;
  }
 catch (  NotSerializableException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
catch (  ClassNotFoundException e) {
    e.printStackTrace();
  }
  Configuration c=new Configuration();
  instance=c;
  return c;
}
Program: 44048
Project: 44048
Buggy source:
public void draw(Graphics g,ZMapWidget map){
  Point p=map.getMapPosition(lat1,lon1);
  Point p2=map.getMapPosition(lat2,lon2);
  if (p != null && p2 != null) {
    g.setColor(Color.orange);
    g.drawRect(p.x,p.y,p2.x - p.x,p2.y - p.y);
  }
}

Fixed version (ground truth):
public void draw(Graphics g,ZMapWidget map){
  Point p=map.getMapPosition(lat1,lon1,false);
  Point p2=map.getMapPosition(lat2,lon2,false);
  if (p != null && p2 != null) {
    g.setColor(Color.orange);
    g.drawRect(p.x,p.y,p2.x - p.x,p2.y - p.y);
  }
}
Program: 44049
Project: 44049
Buggy source:
public static Configuration loadFromFile(){
  try {
    instance=loadFromFile("String_Node_Str");
    return instance;
  }
 catch (  NotSerializableException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
catch (  ClassNotFoundException e) {
    e.printStackTrace();
  }
  Configuration c=new Configuration();
  instance=c;
  return c;
}

Fixed version (ground truth):
public static Configuration loadFromFile(){
  try {
    instance=loadFromFile("String_Node_Str");
    return instance;
  }
 catch (  FileNotFoundException e) {
  }
catch (  NotSerializableException e) {
    Logger.printStackTrace(e,"String_Node_Str");
  }
catch (  IOException e) {
    try {
      instance=loadFromFile("String_Node_Str");
      return instance;
    }
 catch (    Exception e1) {
      Logger.printStackTrace(e,"String_Node_Str");
    }
  }
catch (  ClassNotFoundException e) {
    Logger.printStackTrace(e,"String_Node_Str");
  }
  instance=new Configuration();
  return instance;
}
Program: 44050
Project: 44050
Buggy source:
public void saveToFile(){
  try {
    saveToFile("String_Node_Str");
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void saveToFile(){
  try {
    saveToFile("String_Node_Str");
  }
 catch (  IOException e) {
    Logger.printStackTrace(e,"String_Node_Str");
  }
}
Program: 44051
Project: 44051
Buggy source:
public void drawNode(Graphics g,ZMapWidget map,Node node){
  User user=map.dc.users.get(map.dc.changesets.get(map.dc.changesetsIndex.get(node.changesetId)).userId);
  Profile p=Configuration.instance.getSelectedProfile();
  User[] u=p.getUsers();
  if (p.getListType() == 0) {
    drawNodeP(g,map,node);
  }
 else   if (p.getListType() == 2) {
    for (int i=0; i < u.length; i++)     if (u[i].id == user.id) {
      drawNodeP(g,map,node);
    }
  }
 else {
    boolean t=false;
    for (int i=0; i < u.length; i++)     if (u[i].id == user.id) {
      t=true;
    }
    if (!t)     drawNodeP(g,map,node);
  }
}

Fixed version (ground truth):
public void drawNode(Graphics g,ZMapWidget map,Node node){
  if (isVisibleNode(map,node))   drawNodeP(g,map,node);
}
Program: 44052
Project: 44052
Buggy source:
public static void openURL(String url){
  if (!java.awt.Desktop.isDesktopSupported()) {
    System.err.println("String_Node_Str");
  }
  java.awt.Desktop desktop=java.awt.Desktop.getDesktop();
  if (!desktop.isSupported(java.awt.Desktop.Action.BROWSE)) {
    System.err.println("String_Node_Str");
  }
  try {
    java.net.URI uri=new java.net.URI(url);
    desktop.browse(uri);
  }
 catch (  Exception e) {
    System.err.println(e.getMessage());
  }
}

Fixed version (ground truth):
public static void openURL(String url){
  if (!java.awt.Desktop.isDesktopSupported()) {
    System.err.println("String_Node_Str");
  }
  java.awt.Desktop desktop=java.awt.Desktop.getDesktop();
  if (!desktop.isSupported(java.awt.Desktop.Action.BROWSE)) {
    System.err.println("String_Node_Str");
  }
  try {
    java.net.URI uri=new java.net.URI(url);
    desktop.browse(uri);
  }
 catch (  Exception e) {
  }
}
Program: 44053
Project: 44053
Buggy source:
private void initChangeStream(){
  try {
    BufferedReader br=new BufferedReader(new InputStreamReader(new BufferedInputStream(new URL("String_Node_Str").openStream())));
    br.readLine();
    String seqNumStr=br.readLine();
    seqNum=Integer.parseInt(seqNumStr.substring(seqNumStr.indexOf("String_Node_Str") + 1));
    br.readLine();
    br.close();
  }
 catch (  IOException ioe) {
    System.err.println("String_Node_Str");
  }
}

Fixed version (ground truth):
private void initChangeStream(){
  try {
    BufferedReader br;
    br=new BufferedReader(new InputStreamReader(new BufferedInputStream(new URL("String_Node_Str").openStream())));
    br.readLine();
    String seqNumStr=br.readLine();
    seqNum=Integer.parseInt(seqNumStr.substring(seqNumStr.indexOf("String_Node_Str") + 1));
    br.readLine();
    br.close();
  }
 catch (  MalformedURLException e) {
    System.err.println("String_Node_Str");
  }
catch (  Exception e) {
    System.err.println("String_Node_Str");
  }
}
Program: 44054
Project: 44054
Buggy source:
public void getData(String url){
  try {
    BufferedInputStream bis=new BufferedInputStream(new GZIPInputStream(new URL(url).openStream()));
    System.out.println("String_Node_Str" + url);
    dc.addData(bis);
  }
 catch (  IOException ioe) {
    System.err.println("String_Node_Str");
  }
}

Fixed version (ground truth):
public void getData(String url){
  try {
    BufferedInputStream bis;
    bis=new BufferedInputStream(new GZIPInputStream(new URL(url).openStream()));
    System.out.println("String_Node_Str" + url);
    dc.addData(bis);
  }
 catch (  MalformedURLException e) {
    System.err.println("String_Node_Str");
  }
catch (  IOException e) {
    System.err.println("String_Node_Str");
  }
}
Program: 44055
Project: 44055
Buggy source:
public void mouseClicked(MouseEvent arg0){
  Iterator<Long> iterator=dc.nodes.keySet().iterator();
  while (iterator.hasNext()) {
    Node node=dc.nodes.get(iterator.next());
    Point p=getMapPosition(node.lat,node.lon);
    if (p != null) {
      if (p.x < arg0.getX() + 3 && p.x > arg0.getX() - 3 && p.y < arg0.getY() + 3 && p.y > arg0.getY() - 3) {
        for (int i=0; i < zMapWidgetListeners.size(); i++) {
          zMapWidgetListeners.get(i).nodeClicked(node);
        }
        return;
      }
    }
  }
}

Fixed version (ground truth):
public void mouseClicked(MouseEvent arg0){
  Iterator<Long> iterator=dc.nodes.keySet().iterator();
  while (iterator.hasNext()) {
    Node node=dc.nodes.get(iterator.next());
    if (this.drawStyle.isVisibleNode(this,node)) {
      Point p=getMapPosition(node.lat,node.lon);
      if (p != null) {
        if (p.x < arg0.getX() + 3 && p.x > arg0.getX() - 3 && p.y < arg0.getY() + 3 && p.y > arg0.getY() - 3) {
          for (int i=0; i < zMapWidgetListeners.size(); i++) {
            zMapWidgetListeners.get(i).nodeClicked(node);
          }
          return;
        }
      }
    }
  }
}
Program: 44057
Project: 44057
Buggy source:
public void refrashOverlay(){
  overlayI=new BufferedImage(this.getWidth(),this.getHeight(),BufferedImage.TYPE_INT_ARGB);
  Graphics g=overlayI.getGraphics();
  g.setColor(Color.BLACK);
  if (drawStyle != null) {
    Iterator<Long> iterator=dc.nodes.keySet().iterator();
    while (iterator.hasNext()) {
      Node node=dc.nodes.get(iterator.next());
      drawStyle.drawNode(g,this,node);
    }
  }
  if (dc.mapfilter instanceof DrawerOverlay) {
    DrawerOverlay dov=(DrawerOverlay)dc.mapfilter;
    dov.draw(g,this);
  }
}

Fixed version (ground truth):
public void refrashOverlay(){
  overlayI=new BufferedImage(this.getWidth(),this.getHeight(),BufferedImage.TYPE_INT_ARGB);
  Graphics g=overlayI.getGraphics();
  g.setColor(Color.BLACK);
  if (drawStyle != null) {
    Iterator<Long> iterator=dc.nodes.keySet().iterator();
    while (iterator.hasNext()) {
      Node node=dc.nodes.get(iterator.next());
      drawStyle.drawNode(g,this,node);
    }
  }
  if (dc.mapfilter instanceof DrawerOverlay) {
    DrawerOverlay dov=(DrawerOverlay)dc.mapfilter;
    dov.draw(g,this);
  }
  repaint();
}
Program: 44058
Project: 44058
Buggy source:
public void getData(){
  try {
    DecimalFormat myFormat=new DecimalFormat("String_Node_Str");
    String url="String_Node_Str" + myFormat.format(seqNum / 1000000) + "String_Node_Str"+ myFormat.format((seqNum / 1000) % 1000)+ "String_Node_Str"+ myFormat.format(seqNum % 1000)+ "String_Node_Str";
    BufferedInputStream bis=new BufferedInputStream(new GZIPInputStream(new URL(url).openStream()));
    dc.addData(bis);
    makeOverlay();
    reloadChangesets();
  }
 catch (  IOException ioe) {
    if (ioe instanceof FileNotFoundException) {
    }
 else {
      ioe.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void getData(){
  try {
    DecimalFormat myFormat=new DecimalFormat("String_Node_Str");
    String url="String_Node_Str" + myFormat.format(seqNum / 1000000) + "String_Node_Str"+ myFormat.format((seqNum / 1000) % 1000)+ "String_Node_Str"+ myFormat.format(seqNum % 1000)+ "String_Node_Str";
    BufferedInputStream bis=new BufferedInputStream(new GZIPInputStream(new URL(url).openStream()));
    dc.addData(bis);
    System.out.println("String_Node_Str" + dc.nodes.size());
    makeOverlay();
    reloadChangesets();
    seqNum++;
  }
 catch (  IOException ioe) {
    if (ioe instanceof FileNotFoundException) {
    }
 else {
      ioe.printStackTrace();
    }
  }
}
Program: 44059
Project: 44059
Buggy source:
public boolean isValid(){
  return (Explore.exit() || parent.teleportFailSafe >= GameConstants.TELEPORT_FAILSAFE || parent.prestige || Dungeon.curFloor() >= GameConstants.MAX_FLOOR);
}

Fixed version (ground truth):
public boolean isValid(){
  return (Explore.exit() || parent.teleportFailSafe >= GameConstants.TELEPORT_FAILSAFE || parent.prestige || Dungeon.curFloor() > GameConstants.MAX_FLOOR);
}
Program: 44060
Project: 44060
Buggy source:
public int execute(){
  Pathfinding bfs=new Pathfinding(parent);
  Room end=null;
  Door searchDoor=getDoor();
  if (searchDoor != null) {
    end=searchDoor.getParent();
  }
  Room[] path=bfs.findPath(MyPlayer.currentRoom(),end);
  bfs.walkPath(path);
  return random(400,600);
}

Fixed version (ground truth):
public int execute(){
  Pathfinding bfs=new Pathfinding(parent);
  Room end=null;
  Door searchDoor=getDoor();
  if (searchDoor != null) {
    end=searchDoor.getParent();
  }
  Room[] path=bfs.findPath(MyPlayer.currentRoom(),end);
  if (path == null)   Explore.setExit(true);
  bfs.walkPath(path);
  return random(400,600);
}
Program: 44061
Project: 44061
Buggy source:
private void changeWeapons(){
  if (!destroyedArmour && !MyEquipment.contains("String_Node_Str",true)) {
    weapon=MyEquipment.getItem(MyEquipment.WEAPON).getName();
    util.clickItem(MyInventory.getItem("String_Node_Str"));
    Game.openTab(Game.TAB_EQUIPMENT);
    sleep(Random.nextInt(500,600));
    Game.openTab(Game.TAB_INVENTORY);
  }
 else   if (MyInventory.getItem(weapon) != null) {
    util.clickItem(MyInventory.getItem(weapon));
    Game.openTab(Game.TAB_EQUIPMENT);
    sleep(Random.nextInt(500,600));
    Game.openTab(Game.TAB_INVENTORY);
  }
 else   killBoss();
}

Fixed version (ground truth):
private void changeWeapons(){
  if (!destroyedArmour && !MyEquipment.contains("String_Node_Str",true)) {
    weapon=MyEquipment.getItem(MyEquipment.WEAPON).getName();
    MyInventory.getItem("String_Node_Str").interact("String_Node_Str");
    Game.openTab(Game.TAB_EQUIPMENT);
    sleep(Random.nextInt(500,600));
    Game.openTab(Game.TAB_INVENTORY);
  }
 else   if (MyInventory.getItem(weapon) != null) {
    MyInventory.getItem(weapon).interact("String_Node_Str");
    Game.openTab(Game.TAB_EQUIPMENT);
    sleep(Random.nextInt(500,600));
    Game.openTab(Game.TAB_INVENTORY);
  }
 else   killBoss();
}
Program: 44062
Project: 44062
Buggy source:
private void talk(){
  Npc skinweaver=MyPlayer.currentRoom().getNearestNpc("String_Node_Str");
  if (MyPlayer.isMoving() && Calculations.distanceTo(skinweaver) > 3)   return;
  MyMovement.turnTo(skinweaver);
  if (skinweaver.isOnScreen() && skinweaver.interact("String_Node_Str")) {
    int timeout=0;
    while (skinweaver.getMessage() == null && ++timeout <= 20)     sleep(100);
    if (skinweaver.getMessage() != null && skinweaver.getMessage().contains("String_Node_Str"))     talkedToSkinWeaver=true;
  }
}

Fixed version (ground truth):
private void talk(){
  Npc skinweaver=MyPlayer.currentRoom().getNearestNpc("String_Node_Str");
  if (MyPlayer.isMoving() && Calculations.distanceTo(skinweaver) > 3)   return;
  MyMovement.turnTo(skinweaver);
  if (skinweaver.isOnScreen() && skinweaver.interact("String_Node_Str")) {
    int timeout=0;
    while (skinweaver.getMessage() == null && ++timeout <= 20)     sleep(100);
    if (skinweaver.getMessage() != null && skinweaver.getMessage().contains("String_Node_Str"))     talkedToSkinWeaver=true;
 else     if (Widgets.getComponent(242,0) != null)     talkedToSkinWeaver=true;
  }
}
Program: 44063
Project: 44063
Buggy source:
public boolean accept(Npc npc){
  return npc != null && MyPlayer.currentRoom().contains(npc);
}

Fixed version (ground truth):
public boolean accept(Npc npc){
  return npc != null && MyPlayer.currentRoom().contains(npc) && !npc.getName().contains("String_Node_Str");
}
Program: 44064
Project: 44064
Buggy source:
@Override public void onPlayerInteract(PlayerInteractEvent e){
  if (e.getAction().toString().equals("String_Node_Str")) {
synchronized (_lock) {
      if (e.getPlayer().getItemInHand().getType() == Material.AIR) {
        if (plugin.checkPermissions(e.getPlayer(),"String_Node_Str",false) && plugin.breakMode(e.getPlayer())) {
          pixlBreak(e.getClickedBlock(),e.getPlayer());
        }
 else         if (plugin.checkPermissions(e.getPlayer(),"String_Node_Str",false) && plugin.isToggled(e.getPlayer()) && a.Block(e.getClickedBlock())) {
          pixlArt(e.getClickedBlock(),e.getPlayer());
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onPlayerInteract(PlayerInteractEvent e){
  if (e.getAction().toString().equals("String_Node_Str")) {
synchronized (_lock) {
      if (e.getPlayer().getItemInHand().getType() == Material.AIR) {
        if (plugin.checkPermissions(e.getPlayer(),"String_Node_Str",false) && plugin.breakMode(e.getPlayer())) {
          e.setCancelled(true);
          pixlBreak(e.getClickedBlock(),e.getPlayer());
        }
 else         if (plugin.checkPermissions(e.getPlayer(),"String_Node_Str",false) && plugin.isToggled(e.getPlayer()) && a.Block(e.getClickedBlock())) {
          pixlArt(e.getClickedBlock(),e.getPlayer());
        }
      }
    }
  }
}
Program: 44067
Project: 44067
Buggy source:
@Override public void onPlayerInteract(PlayerInteractEvent e){
  if (e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
synchronized (_lock) {
      if (e.getPlayer().getItemInHand().getType() == Material.AIR) {
        if (plugin.checkPermissions(e.getPlayer(),"String_Node_Str",false) && plugin.isToggled(e.getPlayer()) && a.Block(e.getClickedBlock())) {
          pixlArt(e.getClickedBlock(),e.getPlayer());
        }
      }
    }
  }
 else   if (e.getAction().equals(Action.LEFT_CLICK_BLOCK)) {
synchronized (_lock) {
      if (e.getPlayer().getItemInHand().getType() == Material.AIR) {
        if (plugin.checkPermissions(e.getPlayer(),"String_Node_Str",false) && plugin.breakMode(e.getPlayer())) {
          pixlBreak(e.getClickedBlock(),e.getPlayer());
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onPlayerInteract(PlayerInteractEvent e){
  if (e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
synchronized (_lock) {
      if (e.getPlayer().getItemInHand().getType() == Material.AIR) {
        if (plugin.checkPermissions(e.getPlayer(),"String_Node_Str",false) && plugin.isToggled(e.getPlayer()) && a.Block(e.getClickedBlock())) {
          pixlArt(e.getClickedBlock(),e.getPlayer());
        }
      }
    }
  }
 else   if (e.getAction().equals(Action.LEFT_CLICK_BLOCK)) {
synchronized (_lock) {
      if (this.isPickaxe(e.getPlayer().getItemInHand().getType())) {
        if (plugin.checkPermissions(e.getPlayer(),"String_Node_Str",false) && plugin.breakMode(e.getPlayer())) {
          pixlBreak(e.getClickedBlock(),e.getPlayer());
        }
 else         if (plugin.checkPermissions(e.getPlayer(),"String_Node_Str",false) && plugin.breakMode(e.getPlayer())) {
          pixlHelp(e.getClickedBlock(),e.getPlayer());
        }
      }
    }
  }
}
Program: 44068
Project: 44068
Buggy source:
public static long getDeepObjectSize(Object obj,LibraVisitor visitor) throws LibraException {
  try {
    return visitor.visit(LibraObjectVisitor.INSTANCE,obj);
  }
 catch (  VisitationException e) {
    throw new LibraException(e);
  }
}

Fixed version (ground truth):
public static long getDeepObjectSize(Object obj,LibraVisitor visitor) throws LibraException {
  try {
    return visitor.visit(LibraObjectVisitor.INSTANCE,obj,new LinkedList<Object>());
  }
 catch (  VisitationException e) {
    throw new LibraException(e);
  }
}
Program: 44069
Project: 44069
Buggy source:
R visit(C context,T target) throws VisitationException ;

Fixed version (ground truth):
R visit(C context,T target,LinkedList<Object> parentChine) throws VisitationException ;
Program: 44070
Project: 44070
Buggy source:
@Override public Long visit(Visitor<Long,Object> visitor,Object obj) throws VisitationException {
  final Class<?> cls=obj.getClass();
  long size=visitor.visit(obj);
  try {
    Field declaredFields[]=cls.getDeclaredFields();
    for (    Field field : declaredFields) {
      if (Modifier.isStatic(field.getModifiers()))       continue;
      field.setAccessible(true);
      Object fieldValue=field.get(obj);
      if (field.getType().isPrimitive())       size+=visitor.visit(fieldValue);
 else       if (fieldValue != null)       size+=visit(visitor,fieldValue);
    }
    return size;
  }
 catch (  IllegalAccessException e) {
    throw new VisitationException(e);
  }
}

Fixed version (ground truth):
@Override public Long visit(Visitor<Long,Object> visitor,Object obj,LinkedList<Object> parentChine) throws VisitationException {
  final Class<?> cls=obj.getClass();
  long size=visitor.visit(obj);
  try {
    Field declaredFields[]=cls.getDeclaredFields();
    for (    Field field : declaredFields) {
      if (Modifier.isStatic(field.getModifiers()))       continue;
      field.setAccessible(true);
      Object fieldValue=field.get(obj);
      if (field.getType().isPrimitive()) {
        size+=visitor.visit(fieldValue);
      }
 else       if (fieldValue instanceof String) {
        size+=((String)fieldValue).length();
      }
 else       if (fieldValue != null) {
        if (parentChine.contains(fieldValue)) {
          continue;
        }
 else {
          parentChine.add(fieldValue);
          size+=visit(visitor,fieldValue,parentChine);
        }
      }
    }
    return size;
  }
 catch (  IllegalAccessException e) {
    throw new VisitationException(e);
  }
catch (  StackOverflowError e) {
    throw new VisitationException(e);
  }
}
Program: 44073
Project: 44073
Buggy source:
private void setupSampleTask(){
  long now=System.currentTimeMillis();
  Project sampleProject=new Project("String_Node_Str",0L,false,null,null);
  Context sampleContext=ModelUtils.getSampleContext(getResources());
  mSampleTask=new Task("String_Node_Str","String_Node_Str",sampleContext,sampleProject,now,now,now,now + DateUtils.HOUR_IN_MILLIS * 3,null,false,false,null,1,false,null,null);
}

Fixed version (ground truth):
private void setupSampleTask(){
  long now=System.currentTimeMillis();
  Project sampleProject=new Project("String_Node_Str",0L,false,null,System.currentTimeMillis());
  Context sampleContext=ModelUtils.getSampleContext(getResources());
  mSampleTask=new Task("String_Node_Str","String_Node_Str",sampleContext,sampleProject,now,now,now,now + DateUtils.HOUR_IN_MILLIS * 3,null,false,false,null,1,false,null,null);
}
Program: 44074
Project: 44074
Buggy source:
private void writeContexts(Builder builder,int progressStart,int progressEnd){
  Log.d(cTag,"String_Node_Str");
  Cursor cursor=getContentResolver().query(Shuffle.Contexts.CONTENT_URI,Shuffle.Contexts.cFullProjection,null,null,null);
  int i=0;
  int total=cursor.getCount();
  String type=getString(R.string.context_name);
  while (cursor.moveToNext()) {
    Context context=BindingUtils.readContext(cursor,getResources());
    String text=getString(R.string.backup_progress,type,context.name);
    int percent=calculatePercent(progressStart,progressEnd,++i,total);
    publishProgress(Progress.createProgress(percent,text));
  }
  cursor.close();
}

Fixed version (ground truth):
private void writeContexts(Builder builder,int progressStart,int progressEnd){
  Log.d(cTag,"String_Node_Str");
  Cursor cursor=getContentResolver().query(Shuffle.Contexts.CONTENT_URI,Shuffle.Contexts.cFullProjection,null,null,null);
  int i=0;
  int total=cursor.getCount();
  String type=getString(R.string.context_name);
  while (cursor.moveToNext()) {
    Context context=BindingUtils.readContext(cursor,getResources());
    builder.addContext(context.toDto());
    String text=getString(R.string.backup_progress,type,context.name);
    int percent=calculatePercent(progressStart,progressEnd,++i,total);
    publishProgress(Progress.createProgress(percent,text));
  }
  cursor.close();
}
Program: 44075
Project: 44075
Buggy source:
private void writeProjects(Builder builder,int progressStart,int progressEnd){
  Log.d(cTag,"String_Node_Str");
  Cursor cursor=getContentResolver().query(Shuffle.Projects.CONTENT_URI,Shuffle.Projects.cFullProjection,null,null,null);
  int i=0;
  int total=cursor.getCount();
  String type=getString(R.string.project_name);
  while (cursor.moveToNext()) {
    Project project=BindingUtils.readProject(cursor);
    String text=getString(R.string.backup_progress,type,project.name);
    int percent=calculatePercent(progressStart,progressEnd,++i,total);
    publishProgress(Progress.createProgress(percent,text));
  }
  cursor.close();
}

Fixed version (ground truth):
private void writeProjects(Builder builder,int progressStart,int progressEnd){
  Log.d(cTag,"String_Node_Str");
  Cursor cursor=getContentResolver().query(Shuffle.Projects.CONTENT_URI,Shuffle.Projects.cFullProjection,null,null,null);
  int i=0;
  int total=cursor.getCount();
  String type=getString(R.string.project_name);
  while (cursor.moveToNext()) {
    Project project=BindingUtils.readProject(cursor);
    builder.addProject(project.toDto());
    String text=getString(R.string.backup_progress,type,project.name);
    int percent=calculatePercent(progressStart,progressEnd,++i,total);
    publishProgress(Progress.createProgress(percent,text));
  }
  cursor.close();
}
Program: 44076
Project: 44076
Buggy source:
@Override public void onProgressUpdate(Progress... progresses){
  Progress progress=progresses[0];
  mProgressBar.setProgress(progress.getProgressPercent());
  mProgressText.setText(progress.getDetails());
  if (progress.isError()) {
    Runnable action=progress.getErrorUIAction();
    if (action != null) {
      action.run();
    }
 else {
      setState(State.ERROR);
    }
  }
 else   if (progress.isComplete()) {
    setState(State.COMPLETE);
  }
}

Fixed version (ground truth):
@Override public void onProgressUpdate(Progress... progresses){
  Progress progress=progresses[0];
  mProgressBar.setProgress(progress.getProgressPercent());
  mProgressText.setText(progress.getDetails());
  if (progress.isError()) {
    AlertUtils.showWarning(PreferencesCreateBackupActivity.this,progress.getDetails());
    Runnable action=progress.getErrorUIAction();
    if (action != null) {
      action.run();
    }
 else {
      setState(State.ERROR);
    }
  }
 else   if (progress.isComplete()) {
    setState(State.COMPLETE);
  }
}
Program: 44077
Project: 44077
Buggy source:
private void writeTasks(Builder builder,int progressStart,int progressEnd){
  Log.d(cTag,"String_Node_Str");
  Cursor cursor=getContentResolver().query(Shuffle.Tasks.CONTENT_URI,Shuffle.Tasks.cExpandedProjection,null,null,null);
  int i=0;
  int total=cursor.getCount();
  String type=getString(R.string.task_name);
  while (cursor.moveToNext()) {
    Task task=BindingUtils.readTask(cursor,getResources());
    String text=getString(R.string.backup_progress,type,task.description);
    int percent=calculatePercent(progressStart,progressEnd,++i,total);
    publishProgress(Progress.createProgress(percent,text));
  }
  cursor.close();
}

Fixed version (ground truth):
private void writeTasks(Builder builder,int progressStart,int progressEnd){
  Log.d(cTag,"String_Node_Str");
  Cursor cursor=getContentResolver().query(Shuffle.Tasks.CONTENT_URI,Shuffle.Tasks.cExpandedProjection,null,null,null);
  int i=0;
  int total=cursor.getCount();
  String type=getString(R.string.task_name);
  while (cursor.moveToNext()) {
    Task task=BindingUtils.readTask(cursor,getResources());
    builder.addTask(task.toDto());
    String text=getString(R.string.backup_progress,type,task.description);
    int percent=calculatePercent(progressStart,progressEnd,++i,total);
    publishProgress(Progress.createProgress(percent,text));
  }
  cursor.close();
}