nus-yam/ex-repair huggingface dataset:
Program: 2756
Project: 2756
Buggy source:
public void configure() throws CoreException {
  IProjectDescription desc=project.getDescription();
  ICommand[] commands=desc.getBuildSpec();
  for (int i=0; i < commands.length; ++i) {
    if (commands[i].getBuilderName().equals(Builder.BUILDER_ID)) {
      return;
    }
  }
  ICommand[] newCommands=new ICommand[commands.length + 1];
  System.arraycopy(commands,0,newCommands,0,commands.length);
  ICommand command=desc.newCommand();
  command.setBuilderName(Builder.BUILDER_ID);
  newCommands[newCommands.length - 1]=command;
  desc.setBuildSpec(newCommands);
  project.setDescription(desc,null);
}

Fixed version (ground truth):
public void configure() throws CoreException {
  IProjectDescription desc=project.getDescription();
  ICommand[] commands=desc.getBuildSpec();
  for (int i=0; i < commands.length; ++i) {
    if (commands[i].getBuilderName().equals(Builder.BUILDER_ID)) {
      return;
    }
  }
  ICommand[] newCommands=new ICommand[commands.length + 1];
  System.arraycopy(commands,0,newCommands,0,commands.length);
  ICommand command=desc.newCommand();
  command.setBuilderName(Builder.BUILDER_ID);
  command.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD,true);
  command.setBuilding(IncrementalProjectBuilder.FULL_BUILD,true);
  command.setBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD,true);
  newCommands[newCommands.length - 1]=command;
  desc.setBuildSpec(newCommands);
  project.setDescription(desc,null);
}
Program: 2759
Project: 2759
Buggy source:
public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration,IProgressMonitor monitor) throws CoreException {
  String m_projectName=configuration.getAttribute(ConfigurationConstants.projectNameCfgAttribute,"String_Node_Str");
  ISourceContainer sourceContainer=null;
  if (m_projectName != null) {
    IResource resource=ResourcesPlugin.getWorkspace().getRoot().findMember("String_Node_Str" + m_projectName + "String_Node_Str");
    if (resource != null) {
      IContainer container=resource.getParent();
      if (container.getType() == IResource.PROJECT) {
        sourceContainer=new ProjectSourceContainer((IProject)container,false);
      }
 else       if (container.getType() == IResource.FOLDER) {
        sourceContainer=new FolderSourceContainer(container,false);
      }
    }
  }
  if (sourceContainer == null) {
    sourceContainer=new WorkspaceSourceContainer();
  }
  return new ISourceContainer[]{sourceContainer};
}

Fixed version (ground truth):
public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration,IProgressMonitor monitor) throws CoreException {
  String m_projectName=configuration.getAttribute(ConfigurationConstants.projectNameCfgAttribute,"String_Node_Str");
  ISourceContainer sourceContainer=null;
  if (m_projectName != null) {
    IResource resourceRhodes=ResourcesPlugin.getWorkspace().getRoot().findMember("String_Node_Str" + m_projectName + "String_Node_Str");
    IResource resourceRhoconnect=ResourcesPlugin.getWorkspace().getRoot().findMember("String_Node_Str" + m_projectName + "String_Node_Str");
    IContainer container=null;
    if (resourceRhodes != null) {
      container=resourceRhodes.getParent();
    }
 else     if (resourceRhoconnect != null) {
      container=resourceRhoconnect.getParent();
    }
    if (container != null) {
      if (container.getType() == IResource.PROJECT) {
        sourceContainer=new ProjectSourceContainer((IProject)container,false);
      }
 else       if (container.getType() == IResource.FOLDER) {
        sourceContainer=new FolderSourceContainer(container,false);
      }
    }
  }
  if (sourceContainer == null) {
    sourceContainer=new WorkspaceSourceContainer();
  }
  return new ISourceContainer[]{sourceContainer};
}
Program: 2760
Project: 2760
Buggy source:
public boolean isTerminated(){
  return getProcess().isTerminated();
}

Fixed version (ground truth):
public boolean isTerminated(){
  return m_processHandle.isTerminated();
}
Program: 2761
Project: 2761
Buggy source:
public void breakpointAdded(IBreakpoint breakpoint){
  if (supportsBreakpoint(breakpoint)) {
    try {
      if (breakpoint.isEnabled()) {
        ScriptLineBreakpoint lineBr=(ScriptLineBreakpoint)breakpoint;
        int lineNum=lineBr.getLineNumber();
        String srcFile=null;
        if (m_debugType == EDebugPlatfrom.eRhosync) {
          srcFile=prepareResNameForSyncDebugger(lineBr.getResourcePath().toOSString());
        }
 else {
          srcFile=prepareResNameForRhodesDebugger(lineBr.getResourcePath().toOSString());
        }
        m_debugServer.debugBreakpoint(srcFile,lineNum);
      }
    }
 catch (    CoreException e) {
    }
  }
}

Fixed version (ground truth):
public void breakpointAdded(IBreakpoint breakpoint){
  if (supportsBreakpoint(breakpoint)) {
    try {
      if (breakpoint.isEnabled()) {
        ScriptLineBreakpoint lineBr=(ScriptLineBreakpoint)breakpoint;
        int lineNum=lineBr.getLineNumber();
        String srcFile=null;
        if (m_debugType == EDebugPlatfrom.eRhosync) {
          srcFile=prepareResNameForRhoconnectDebugger(lineBr.getResourcePath().toOSString());
        }
 else {
          srcFile=prepareResNameForRhodesDebugger(lineBr.getResourcePath().toOSString());
        }
        m_debugServer.debugBreakpoint(srcFile,lineNum);
      }
    }
 catch (    CoreException e) {
    }
  }
}
Program: 2762
Project: 2762
Buggy source:
public void breakpointRemoved(IBreakpoint breakpoint,IMarkerDelta delta){
  if (supportsBreakpoint(breakpoint)) {
    try {
      ScriptLineBreakpoint lineBr=(ScriptLineBreakpoint)breakpoint;
      int lineNum=lineBr.getLineNumber();
      String srcFile=null;
      if (m_debugType == EDebugPlatfrom.eRhosync) {
        srcFile=prepareResNameForSyncDebugger(lineBr.getResourcePath().toOSString());
      }
 else {
        srcFile=prepareResNameForRhodesDebugger(lineBr.getResourcePath().toOSString());
      }
      m_debugServer.debugRemoveBreakpoint(srcFile,lineNum);
    }
 catch (    CoreException e) {
    }
  }
}

Fixed version (ground truth):
public void breakpointRemoved(IBreakpoint breakpoint,IMarkerDelta delta){
  if (supportsBreakpoint(breakpoint)) {
    try {
      ScriptLineBreakpoint lineBr=(ScriptLineBreakpoint)breakpoint;
      int lineNum=lineBr.getLineNumber();
      String srcFile=null;
      if (m_debugType == EDebugPlatfrom.eRhosync) {
        srcFile=prepareResNameForRhoconnectDebugger(lineBr.getResourcePath().toOSString());
      }
 else {
        srcFile=prepareResNameForRhodesDebugger(lineBr.getResourcePath().toOSString());
      }
      m_debugServer.debugRemoveBreakpoint(srcFile,lineNum);
    }
 catch (    CoreException e) {
    }
  }
}
Program: 2763
Project: 2763
Buggy source:
public boolean canTerminate(){
  return getProcess().canTerminate();
}

Fixed version (ground truth):
public boolean canTerminate(){
  return m_processHandle.canTerminate();
}
Program: 2764
Project: 2764
Buggy source:
@Override public void stopped(DebugState state,String file,int line,String className,String method){
  waitDebugProcessing();
  cleanState();
  installDeferredWatchs();
  waitDebugProcessing();
  if (state == DebugState.BREAKPOINT) {
    IBreakpoint[] breakpoints=DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(DebugConstants.debugModelId);
    for (int i=0; i < breakpoints.length; i++) {
      waitDebugProcessing();
      IBreakpoint breakpoint=breakpoints[i];
      if (breakpoint instanceof ScriptLineBreakpoint) {
        ScriptLineBreakpoint lineBreakpoint=(ScriptLineBreakpoint)breakpoint;
        String resPath=null;
        if (m_debugType == EDebugPlatfrom.eRhosync) {
          resPath=prepareResNameForSyncDebugger(lineBreakpoint.getResourcePath().toOSString());
        }
 else {
          resPath=prepareResNameForRhodesDebugger(lineBreakpoint.getResourcePath().toOSString());
        }
        try {
          if (lineBreakpoint.getLineNumber() == line && resPath.equals(file)) {
            m_threadHandle.setBreakpoints(new IBreakpoint[]{breakpoint});
            break;
          }
        }
 catch (        CoreException e) {
        }
      }
    }
    suspended(DebugEvent.BREAKPOINT);
  }
 else   if (DebugState.paused(state)) {
    m_threadHandle.setStepping(true);
    suspended(DebugEvent.STEP_END);
  }
}

Fixed version (ground truth):
@Override public void stopped(DebugState state,String file,int line,String className,String method){
  waitDebugProcessing();
  cleanState();
  installDeferredWatchs();
  waitDebugProcessing();
  if (state == DebugState.BREAKPOINT) {
    IBreakpoint[] breakpoints=DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(DebugConstants.debugModelId);
    for (int i=0; i < breakpoints.length; i++) {
      waitDebugProcessing();
      IBreakpoint breakpoint=breakpoints[i];
      if (breakpoint instanceof ScriptLineBreakpoint) {
        ScriptLineBreakpoint lineBreakpoint=(ScriptLineBreakpoint)breakpoint;
        String resPath=null;
        if (m_debugType == EDebugPlatfrom.eRhosync) {
          resPath=prepareResNameForRhoconnectDebugger(lineBreakpoint.getResourcePath().toOSString());
        }
 else {
          resPath=prepareResNameForRhodesDebugger(lineBreakpoint.getResourcePath().toOSString());
        }
        try {
          if (lineBreakpoint.getLineNumber() == line && resPath.equals(file)) {
            m_threadHandle.setBreakpoints(new IBreakpoint[]{breakpoint});
            break;
          }
        }
 catch (        CoreException e) {
        }
      }
    }
    suspended(DebugEvent.BREAKPOINT);
  }
 else   if (DebugState.paused(state)) {
    m_threadHandle.setStepping(true);
    suspended(DebugEvent.STEP_END);
  }
}
Program: 2765
Project: 2765
Buggy source:
private int runSelectedBuildConfiguration(IProject currProject) throws Exception {
  Map<String,Object> params=new HashMap<String,Object>();
  params.put(RunDebugRhodesAppTask.workDir,currProject.getLocation().toOSString());
  Map results=RhoTaskHolder.getInstance().runTask(RunDebugRhodesAppTask.taskTag,params);
  return TaskResultConverter.getResultIntCode(results);
}

Fixed version (ground truth):
private int runSelectedBuildConfiguration(IProject currProject) throws Exception {
  Map<String,Object> params=new HashMap<String,Object>();
  params.put(RunReleaseRhoconnectAppTask.workDir,currProject.getLocation().toOSString());
  Map results=RhoTaskHolder.getInstance().runTask(RunReleaseRhoconnectAppTask.taskTag,params);
  return TaskResultConverter.getResultIntCode(results);
}
Program: 2766
Project: 2766
Buggy source:
private IProcess debugSelectedBuildConfiguration(IProject currProject,ILaunch launch) throws Exception {
  return null;
}

Fixed version (ground truth):
private IProcess debugSelectedBuildConfiguration(IProject currProject,ILaunch launch) throws Exception {
  Map<String,Object> params=new HashMap<String,Object>();
  params.put(RunDebugRhoconnectAppTask.workDir,currProject.getLocation().toOSString());
  params.put(RunDebugRhoconnectAppTask.appName,currProject.getName());
  params.put(RunDebugRhoconnectAppTask.launchObj,launch);
  Map results=RhoTaskHolder.getInstance().runTask(RunDebugRhoconnectAppTask.taskTag,params);
  return TaskResultConverter.getResultLaunchObj(results);
}
Program: 2768
Project: 2768
Buggy source:
public void terminate() throws DebugException {
  try {
    m_debugServer.debugTerminate();
    OSHelper.killProcess("String_Node_Str");
    if (m_debugType != EDebugPlatfrom.eRhosync) {
      m_processHandle.terminate();
    }
  }
 catch (  DebugServerException e) {
    e.printStackTrace();
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void terminate() throws DebugException {
  try {
    m_debugServer.debugTerminate();
    if (m_debugType == EDebugPlatfrom.eRhosync) {
      RhodesAdapter adapter=new RhodesAdapter();
      adapter.stopSyncApp();
    }
    m_processHandle.terminate();
  }
 catch (  DebugServerException e) {
    e.printStackTrace();
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 2769
Project: 2769
Buggy source:
public void run(){
  try {
    Socket clientSocket=serverSocket.accept();
    inFromClient=new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
    outToClient=new OutputStreamWriter(new BufferedOutputStream(clientSocket.getOutputStream()),"String_Node_Str");
    debugProtocol=new DebugProtocol(this,this.debugCallback);
    try {
      String data;
      while ((data=inFromClient.readLine()) != null) {
        if (debugOutput != null)         debugOutput.println("String_Node_Str" + data);
        debugProtocol.processCommand(data);
      }
    }
 catch (    EOFException e) {
    }
catch (    IOException e) {
    }
 finally {
      try {
        clientSocket.close();
      }
 catch (      IOException e) {
      }
    }
  }
 catch (  IOException ioe) {
  }
}

Fixed version (ground truth):
public void run(){
  try {
    Socket clientSocket=serverSocket.accept();
    inFromClient=new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
    outToClient=new OutputStreamWriter(new BufferedOutputStream(clientSocket.getOutputStream()),"String_Node_Str");
    debugProtocol=new DebugProtocol(this,this.debugCallback);
    try {
      String data;
      while ((data=inFromClient.readLine()) != null) {
        if (debugOutput != null)         debugOutput.println("String_Node_Str" + data);
        debugProtocol.processCommand(data);
      }
    }
 catch (    EOFException e) {
    }
catch (    IOException e) {
    }
 finally {
      try {
        clientSocket.close();
      }
 catch (      IOException e) {
      }
    }
  }
 catch (  IOException ioe) {
  }
catch (  NullPointerException e) {
  }
}
Program: 2770
Project: 2770
Buggy source:
public RunExeHelper(String exeName){
  m_executor=new SysCommandExecutor();
  if (OSHelper.isWindows()) {
    m_exeName=exeName + "String_Node_Str";
  }
 else {
    m_exeName=exeName;
  }
}

Fixed version (ground truth):
public RunExeHelper(String exeName,boolean isExe){
  m_executor=new SysCommandExecutor();
  if (OSHelper.isWindows()) {
    if (isExe) {
      m_exeName=exeName + "String_Node_Str";
    }
 else {
      m_exeName=exeName + "String_Node_Str";
    }
  }
 else {
    m_exeName=exeName;
  }
}
Program: 2772
Project: 2772
Buggy source:
/** 
 * The worker method. It will find the container, create the file if missing or just replace its contents, and open the editor on the newly created file.
 */
private void doFinish(BuildInfoHolder infoHolder,IProgressMonitor monitor) throws CoreException {
  IProject newProject=null;
  try {
    monitor.beginTask("String_Node_Str" + infoHolder.appName,2);
    monitor.worked(1);
    monitor.setTaskName("String_Node_Str");
    newProject=RhodesProjectSupport.createProject(infoHolder);
    if (!checkRhodesVersion(CommonConstants.rhodesVersion)) {
      newProject.delete(true,monitor);
      ShowMessageJob msgJob=new ShowMessageJob("String_Node_Str","String_Node_Str","String_Node_Str");
      msgJob.run(monitor);
      return;
    }
    if (!infoHolder.existCreate) {
      if (m_rhogenAdapter.generateApp(infoHolder) != 0) {
        throw new IOException("String_Node_Str");
      }
    }
    newProject.refreshLocal(IResource.DEPTH_INFINITE,monitor);
    ShowPerspectiveJob job=new ShowPerspectiveJob("String_Node_Str",UiConstants.rhodesPerspectiveId);
    job.run(monitor);
    monitor.worked(1);
  }
 catch (  IOException e) {
    newProject.delete(false,monitor);
    ShowMessageJob msgJob=new ShowMessageJob("String_Node_Str","String_Node_Str","String_Node_Str");
    msgJob.run(monitor);
  }
catch (  CheckProjectException e) {
    ShowMessageJob msgJob=new ShowMessageJob("String_Node_Str","String_Node_Str",e.getMessage());
    msgJob.run(monitor);
  }
catch (  AlredyCreatedException e) {
    ShowMessageJob msgJob=new ShowMessageJob("String_Node_Str","String_Node_Str",e.toString());
    msgJob.run(monitor);
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * The worker method. It will find the container, create the file if missing or just replace its contents, and open the editor on the newly created file.
 */
private void doFinish(BuildInfoHolder infoHolder,IProgressMonitor monitor) throws CoreException {
  IProject newProject=null;
  try {
    monitor.beginTask("String_Node_Str" + infoHolder.appName,2);
    monitor.worked(1);
    monitor.setTaskName("String_Node_Str");
    newProject=RhodesProjectSupport.createProject(infoHolder);
    if (!infoHolder.existCreate) {
      if (m_rhogenAdapter.generateApp(infoHolder) != 0) {
        throw new IOException("String_Node_Str");
      }
    }
    newProject.refreshLocal(IResource.DEPTH_INFINITE,monitor);
    ShowPerspectiveJob job=new ShowPerspectiveJob("String_Node_Str",UiConstants.rhodesPerspectiveId);
    job.run(monitor);
    monitor.worked(1);
  }
 catch (  IOException e) {
    newProject.delete(false,monitor);
    ShowMessageJob msgJob=new ShowMessageJob("String_Node_Str","String_Node_Str","String_Node_Str");
    msgJob.run(monitor);
  }
catch (  CheckProjectException e) {
    ShowMessageJob msgJob=new ShowMessageJob("String_Node_Str","String_Node_Str",e.getMessage());
    msgJob.run(monitor);
  }
catch (  AlredyCreatedException e) {
    ShowMessageJob msgJob=new ShowMessageJob("String_Node_Str","String_Node_Str",e.toString());
    msgJob.run(monitor);
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 2773
Project: 2773
Buggy source:
boolean checkRhodesVersion(String rhodesVer) throws Exception {
  RunExeHelper runHelper=new RunExeHelper("String_Node_Str");
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(rhodesVer);
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(sb.toString());
  String cmdOutput=runHelper.run(cmdLine);
  cmdOutput=cmdOutput.replaceAll("String_Node_Str","String_Node_Str");
  if (cmdOutput.equals(okRhodesVersionFlag)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
boolean checkRhodesVersion(String rhodesVer) throws Exception {
  RunExeHelper runHelper=new RunExeHelper("String_Node_Str",false);
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(rhodesVer);
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(sb.toString());
  String cmdOutput=runHelper.run(cmdLine);
  cmdOutput=cmdOutput.replaceAll("String_Node_Str","String_Node_Str");
  if (cmdOutput.equals(okRhodesVersionFlag)) {
    return true;
  }
  return false;
}
Program: 2774
Project: 2774
Buggy source:
boolean checkRhodesVersion(String rhodesVer) throws Exception {
  RunExeHelper runHelper=new RunExeHelper("String_Node_Str");
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(rhodesVer);
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(sb.toString());
  String cmdOutput=runHelper.run(cmdLine);
  cmdOutput=cmdOutput.replaceAll("String_Node_Str","String_Node_Str");
  if (cmdOutput.equals(okRhodesVersionFlag)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
boolean checkRhodesVersion(String rhodesVer) throws Exception {
  RunExeHelper runHelper=new RunExeHelper("String_Node_Str",false);
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(rhodesVer);
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(sb.toString());
  String cmdOutput=runHelper.run(cmdLine);
  cmdOutput=cmdOutput.replaceAll("String_Node_Str","String_Node_Str");
  if (cmdOutput.equals(okRhodesVersionFlag)) {
    return true;
  }
  return false;
}
Program: 2776
Project: 2776
Buggy source:
private IProcess debugSelectedBuildConfiguration(IProject currProject,ILaunch launch) throws Exception {
  return null;
}

Fixed version (ground truth):
private IProcess debugSelectedBuildConfiguration(IProject currProject,ILaunch launch) throws Exception {
  IProcess debugProcess=rhodesAdapter.debugSyncApp(currProject.getName(),currProject.getLocation().toOSString(),launch);
  return debugProcess;
}
Program: 2777
Project: 2777
Buggy source:
@SuppressWarnings("String_Node_Str") public synchronized void launch(ILaunchConfiguration configuration,String mode,ILaunch launch,final IProgressMonitor monitor) throws CoreException {
  setProcessFinished(false);
  rhodesLogHelper.stopLog();
  ConsoleHelper.cleanBuildConsole();
  setupConfigAttributes(configuration);
  if (m_projectName == null || m_projectName.length() == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final IProject project=ResourcesPlugin.getWorkspace().getRoot().getProject(m_projectName);
  if (!project.isOpen()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    startBuildThread(project,mode,launch);
    while (true) {
      try {
        if (monitor.isCanceled()) {
          OSHelper.killProcess("String_Node_Str");
          return;
        }
        if (getProcessFinished()) {
          break;
        }
        Thread.sleep(100);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
 catch (  IllegalArgumentException e) {
    ConsoleHelper.consolePrint(e.getMessage());
  }
catch (  Exception e) {
    e.printStackTrace();
  }
  monitor.done();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public synchronized void launch(ILaunchConfiguration configuration,String mode,ILaunch launch,final IProgressMonitor monitor) throws CoreException {
  RhogenDebugTarget target=null;
  setProcessFinished(false);
  rhodesLogHelper.stopLog();
  ConsoleHelper.cleanBuildConsole();
  setupConfigAttributes(configuration);
  if (m_projectName == null || m_projectName.length() == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final IProject project=ResourcesPlugin.getWorkspace().getRoot().getProject(m_projectName);
  if (!project.isOpen()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    if (mode.equals(ILaunchManager.DEBUG_MODE)) {
      ShowPerspectiveJob job=new ShowPerspectiveJob("String_Node_Str",DebugConstants.debugPerspectiveId);
      job.run(monitor);
      OSHelper.killProcess("String_Node_Str");
      target=new RhogenDebugTarget(launch,null);
    }
    startBuildThread(project,mode,launch);
    while (true) {
      try {
        if (monitor.isCanceled()) {
          OSHelper.killProcess("String_Node_Str");
          return;
        }
        if (getProcessFinished()) {
          break;
        }
        Thread.sleep(100);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
 catch (  IllegalArgumentException e) {
    ConsoleHelper.consolePrint(e.getMessage());
  }
catch (  Exception e) {
    e.printStackTrace();
  }
  monitor.done();
  if (mode.equals(ILaunchManager.DEBUG_MODE)) {
    target.setProcess(m_debugProcess);
    launch.addDebugTarget(target);
  }
}
Program: 2778
Project: 2778
Buggy source:
public int buildRhosyncApp(String workDir) throws Exception {
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  m_executor.setWorkingDirectory(workDir);
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  return m_executor.runCommand(cmdLine);
}

Fixed version (ground truth):
public int buildRhosyncApp(String workDir) throws Exception {
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  m_executor.setWorkingDirectory(workDir);
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  m_executor.runCommand(cmdLine);
  sb=new StringBuilder();
  sb.append("String_Node_Str");
  cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  return m_executor.runCommand(cmdLine);
}
Program: 2779
Project: 2779
Buggy source:
public IProcess debugSyncApp(String projectName,String workDir,ILaunch launch) throws Exception {
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  String[] commandLine=new String[cmdLine.size()];
  commandLine=cmdLine.toArray(commandLine);
  Process process=DebugPlugin.exec(commandLine,new File(workDir));
  return DebugPlugin.newProcess(launch,process,projectName);
}

Fixed version (ground truth):
public IProcess debugSyncApp(String projectName,String workDir,ILaunch launch) throws Exception {
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  m_executor.setWorkingDirectory(workDir);
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  m_executor.runCommand(cmdLine);
  sb=new StringBuilder();
  sb.append("String_Node_Str");
  cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  String[] commandLine=new String[cmdLine.size()];
  commandLine=cmdLine.toArray(commandLine);
  Process process=DebugPlugin.exec(commandLine,new File(workDir));
  return DebugPlugin.newProcess(launch,process,projectName);
}
Program: 2780
Project: 2780
Buggy source:
public IProcess debugApp(String projectName,String workDir,EPlatformType platformType,ILaunch launch) throws Exception {
  String platformName=convertDescFromPlatform(platformType);
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(platformName);
  sb.append("String_Node_Str");
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  String[] commandLine=new String[cmdLine.size()];
  commandLine=cmdLine.toArray(commandLine);
  Process process=DebugPlugin.exec(commandLine,new File(workDir));
  return DebugPlugin.newProcess(launch,process,projectName);
}

Fixed version (ground truth):
public IProcess debugApp(String projectName,String workDir,EPlatformType platformType,ILaunch launch) throws Exception {
  String platformName=convertDescFromPlatform(platformType);
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(platformName);
  sb.append("String_Node_Str");
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  cmdLine.add("String_Node_Str");
  cmdLine.add("String_Node_Str");
  String[] commandLine=new String[cmdLine.size()];
  commandLine=cmdLine.toArray(commandLine);
  Process process=DebugPlugin.exec(commandLine,new File(workDir));
  return DebugPlugin.newProcess(launch,process,projectName);
}
Program: 2781
Project: 2781
Buggy source:
public int buildAppOnRhoSim(String workDir,EPlatformType platformType) throws Exception {
  String platformName=convertDescFromPlatform(platformType);
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(platformName);
  sb.append("String_Node_Str");
  m_executor.setWorkingDirectory(workDir);
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  return m_executor.runCommand(cmdLine);
}

Fixed version (ground truth):
public int buildAppOnRhoSim(String workDir,EPlatformType platformType) throws Exception {
  String platformName=convertDescFromPlatform(platformType);
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(platformName);
  sb.append("String_Node_Str");
  m_executor.setWorkingDirectory(workDir);
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  cmdLine.add("String_Node_Str");
  cmdLine.add("String_Node_Str");
  return m_executor.runCommand(cmdLine);
}
Program: 2782
Project: 2782
Buggy source:
@Override public void exited(){
  m_isTerminated=true;
  m_isSuspended=false;
  DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
  DebugPlugin.getDefault().getExpressionManager().removeExpressionListener(this);
  fireTerminateEvent();
  m_debugServer.shutdown();
}

Fixed version (ground truth):
@Override public void exited(){
  m_isTerminated=true;
  m_isSuspended=false;
  DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
  DebugPlugin.getDefault().getExpressionManager().removeExpressionListener(this);
  fireTerminateEvent();
  try {
    m_debugServer.shutdown();
  }
 catch (  DebugServerException e) {
  }
}
Program: 2783
Project: 2783
Buggy source:
/** 
 * Returns the current stack frames in the target.
 * @return the current stack frames in the target
 * @throws DebugException if unable to perform the request
 */
protected IStackFrame[] getStackFrames() throws DebugException {
  StackData stackData=new StackData(m_debugServer.debugGetFile(),m_debugServer.debugGetLine());
  IStackFrame[] theFrames=new IStackFrame[1];
  for (int i=0; i < 3; ++i) {
    try {
      theFrames[0]=new RhogenStackFrame(m_threadHandle,stackData,0);
      break;
    }
 catch (    DebugServerException e) {
    }
  }
  return theFrames;
}

Fixed version (ground truth):
/** 
 * Returns the current stack frames in the target.
 * @return the current stack frames in the target
 * @throws DebugException if unable to perform the request
 */
protected IStackFrame[] getStackFrames() throws DebugException {
  StackData stackData=new StackData(m_debugServer.debugGetFile(),m_debugServer.debugGetLine());
  IStackFrame[] theFrames=new IStackFrame[1];
  for (int i=0; i < 3; ++i) {
    try {
      stackData.m_currVariables=m_debugServer.debugWatchList();
      theFrames[0]=new RhogenStackFrame(m_threadHandle,stackData,0);
      break;
    }
 catch (    DebugServerException e) {
    }
  }
  return theFrames;
}
Program: 2784
Project: 2784
Buggy source:
public void terminate() throws DebugException {
  m_debugServer.debugTerminate();
}

Fixed version (ground truth):
public void terminate() throws DebugException {
  try {
    m_debugServer.debugTerminate();
    m_processHandle.terminate();
  }
 catch (  DebugServerException e) {
  }
}
Program: 2785
Project: 2785
Buggy source:
public void startBuildThread(final IProject project,final String mode,final ILaunch launch){
  Thread cancelingThread=new Thread(new Runnable(){
    @Override public void run(){
      try {
        ConsoleHelper.consolePrint("String_Node_Str");
        if (mode.equals(ILaunchManager.DEBUG_MODE)) {
          m_debugProcess=debugSelectedBuildConfiguration(project,launch);
          if (m_debugProcess == null) {
            ConsoleHelper.consolePrint("String_Node_Str");
            setProcessFinished(true);
            return;
          }
        }
 else {
          if (runSelectedBuildConfiguration(project) != 0) {
            ConsoleHelper.consolePrint("String_Node_Str");
            setProcessFinished(true);
            return;
          }
        }
        startLogOutput(project,EPlatformType.eRsync);
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
      setProcessFinished(true);
    }
  }
);
  cancelingThread.start();
}

Fixed version (ground truth):
public void startBuildThread(final IProject project,final String mode,final ILaunch launch){
  Thread cancelingThread=new Thread(new Runnable(){
    @Override public void run(){
      try {
        OSHelper.setEnvVariable("String_Node_Str","String_Node_Str");
        OSHelper.setEnvVariable("String_Node_Str","String_Node_Str");
        ConsoleHelper.consolePrint("String_Node_Str");
        if (mode.equals(ILaunchManager.DEBUG_MODE)) {
          m_debugProcess=debugSelectedBuildConfiguration(project,launch);
          if (m_debugProcess == null) {
            ConsoleHelper.consolePrint("String_Node_Str");
            setProcessFinished(true);
            return;
          }
        }
 else {
          if (runSelectedBuildConfiguration(project) != 0) {
            ConsoleHelper.consolePrint("String_Node_Str");
            setProcessFinished(true);
            return;
          }
        }
        startLogOutput(project,EPlatformType.eRsync);
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
      setProcessFinished(true);
    }
  }
);
  cancelingThread.start();
}
Program: 2786
Project: 2786
Buggy source:
@Override public void run(){
  try {
    ConsoleHelper.consolePrint("String_Node_Str");
    if (mode.equals(ILaunchManager.DEBUG_MODE)) {
      m_debugProcess=debugSelectedBuildConfiguration(project,launch);
      if (m_debugProcess == null) {
        ConsoleHelper.consolePrint("String_Node_Str");
        setProcessFinished(true);
        return;
      }
    }
 else {
      if (runSelectedBuildConfiguration(project) != 0) {
        ConsoleHelper.consolePrint("String_Node_Str");
        setProcessFinished(true);
        return;
      }
    }
    startLogOutput(project,EPlatformType.eRsync);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  setProcessFinished(true);
}

Fixed version (ground truth):
@Override public void run(){
  try {
    OSHelper.setEnvVariable("String_Node_Str","String_Node_Str");
    OSHelper.setEnvVariable("String_Node_Str","String_Node_Str");
    ConsoleHelper.consolePrint("String_Node_Str");
    if (mode.equals(ILaunchManager.DEBUG_MODE)) {
      m_debugProcess=debugSelectedBuildConfiguration(project,launch);
      if (m_debugProcess == null) {
        ConsoleHelper.consolePrint("String_Node_Str");
        setProcessFinished(true);
        return;
      }
    }
 else {
      if (runSelectedBuildConfiguration(project) != 0) {
        ConsoleHelper.consolePrint("String_Node_Str");
        setProcessFinished(true);
        return;
      }
    }
    startLogOutput(project,EPlatformType.eRsync);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  setProcessFinished(true);
}
Program: 2787
Project: 2787
Buggy source:
/** 
 * The worker method. It will find the container, create the file if missing or just replace its contents, and open the editor on the newly created file.
 */
private void doFinish(BuildInfoHolder infoHolder,IProgressMonitor monitor) throws CoreException {
  try {
    monitor.beginTask("String_Node_Str" + infoHolder.appName,2);
    monitor.worked(1);
    monitor.setTaskName("String_Node_Str");
    IProject newProject=RhodesProjectSupport.createProject(infoHolder);
    if (!infoHolder.existCreate) {
      if (m_rhogenAdapter.generateApp(infoHolder) != 0) {
        throw new IOException("String_Node_Str");
      }
    }
    newProject.refreshLocal(IResource.DEPTH_INFINITE,monitor);
    ShowPerspectiveJob job=new ShowPerspectiveJob("String_Node_Str",RhogenConstants.rhodesPerspectiveId);
    job.run(monitor);
    monitor.worked(1);
  }
 catch (  IOException e) {
    ShowMessageJob msgJob=new ShowMessageJob("String_Node_Str","String_Node_Str",e.getMessage());
    msgJob.run(monitor);
  }
catch (  CheckProjectException e) {
    ShowMessageJob msgJob=new ShowMessageJob("String_Node_Str","String_Node_Str",e.getMessage());
    msgJob.run(monitor);
  }
catch (  AlredyCreatedException e) {
    ShowMessageJob msgJob=new ShowMessageJob("String_Node_Str","String_Node_Str",e.toString());
    msgJob.run(monitor);
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * The worker method. It will find the container, create the file if missing or just replace its contents, and open the editor on the newly created file.
 */
private void doFinish(BuildInfoHolder infoHolder,IProgressMonitor monitor) throws CoreException {
  IProject newProject=null;
  try {
    monitor.beginTask("String_Node_Str" + infoHolder.appName,2);
    monitor.worked(1);
    monitor.setTaskName("String_Node_Str");
    newProject=RhodesProjectSupport.createProject(infoHolder);
    if (!infoHolder.existCreate) {
      if (m_rhogenAdapter.generateApp(infoHolder) != 0) {
        throw new IOException("String_Node_Str");
      }
    }
    newProject.refreshLocal(IResource.DEPTH_INFINITE,monitor);
    ShowPerspectiveJob job=new ShowPerspectiveJob("String_Node_Str",RhogenConstants.rhodesPerspectiveId);
    job.run(monitor);
    monitor.worked(1);
  }
 catch (  IOException e) {
    newProject.delete(true,monitor);
    ShowMessageJob msgJob=new ShowMessageJob("String_Node_Str","String_Node_Str","String_Node_Str");
    msgJob.run(monitor);
  }
catch (  CheckProjectException e) {
    ShowMessageJob msgJob=new ShowMessageJob("String_Node_Str","String_Node_Str",e.getMessage());
    msgJob.run(monitor);
  }
catch (  AlredyCreatedException e) {
    ShowMessageJob msgJob=new ShowMessageJob("String_Node_Str","String_Node_Str",e.toString());
    msgJob.run(monitor);
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 2788
Project: 2788
Buggy source:
public IProcess debugApp(String workDir,EPlatformType platformType,ILaunch launch,boolean onDevice) throws Exception {
  String platformName=convertDescFromPlatform(platformType);
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(platformName);
  if (onDevice) {
    sb.append("String_Node_Str");
  }
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  String[] commandLine=new String[cmdLine.size()];
  commandLine=cmdLine.toArray(commandLine);
  Process process=DebugPlugin.exec(commandLine,new File(workDir));
  return DebugPlugin.newProcess(launch,process,"String_Node_Str");
}

Fixed version (ground truth):
public IProcess debugApp(String projectName,String workDir,EPlatformType platformType,ILaunch launch,boolean onDevice) throws Exception {
  String platformName=convertDescFromPlatform(platformType);
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(platformName);
  if (onDevice) {
    sb.append("String_Node_Str");
  }
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  String[] commandLine=new String[cmdLine.size()];
  commandLine=cmdLine.toArray(commandLine);
  Process process=DebugPlugin.exec(commandLine,new File(workDir));
  return DebugPlugin.newProcess(launch,process,projectName);
}
Program: 2789
Project: 2789
Buggy source:
public void startBuildThread(final IProject project,final String mode,final ILaunch launch){
  final EPlatformType type=RhodesAdapter.convertPlatformFromDesc(m_platformName);
  Thread cancelingThread=new Thread(new Runnable(){
    @Override public void run(){
      try {
        ConsoleHelper.consolePrint("String_Node_Str");
        if (mode.equals(ILaunchManager.DEBUG_MODE)) {
          if (type != RhodesAdapter.EPlatformType.eEmu) {
            if (rhodesAdapter.buildApp(project.getLocation().toOSString(),type,m_onDevice) != 0) {
              ConsoleHelper.consolePrint("String_Node_Str");
              setProcessFinished(true);
              return;
            }
          }
 else {
            m_debugProcess=rhodesAdapter.debugApp(project.getLocation().toOSString(),type,launch,m_onDevice);
            if (m_debugProcess == null) {
              ConsoleHelper.consolePrint("String_Node_Str");
              setProcessFinished(true);
              return;
            }
          }
        }
 else {
          if (rhodesAdapter.buildApp(project.getLocation().toOSString(),type,m_onDevice) != 0) {
            ConsoleHelper.consolePrint("String_Node_Str");
            setProcessFinished(true);
            return;
          }
        }
        ConsoleHelper.showAppConsole();
        startLogOutput(project,type);
        setProcessFinished(true);
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
);
  cancelingThread.start();
}

Fixed version (ground truth):
public void startBuildThread(final IProject project,final String mode,final ILaunch launch){
  final EPlatformType type=RhodesAdapter.convertPlatformFromDesc(m_platformName);
  Thread cancelingThread=new Thread(new Runnable(){
    @Override public void run(){
      try {
        ConsoleHelper.consolePrint("String_Node_Str");
        if (mode.equals(ILaunchManager.DEBUG_MODE)) {
          if (type != RhodesAdapter.EPlatformType.eEmu) {
            if (rhodesAdapter.buildApp(project.getLocation().toOSString(),type,m_onDevice) != 0) {
              ConsoleHelper.consolePrint("String_Node_Str");
              setProcessFinished(true);
              return;
            }
          }
 else {
            m_debugProcess=rhodesAdapter.debugApp(m_projectName,project.getLocation().toOSString(),type,launch,m_onDevice);
            if (m_debugProcess == null) {
              ConsoleHelper.consolePrint("String_Node_Str");
              setProcessFinished(true);
              return;
            }
          }
        }
 else {
          if (rhodesAdapter.buildApp(project.getLocation().toOSString(),type,m_onDevice) != 0) {
            ConsoleHelper.consolePrint("String_Node_Str");
            setProcessFinished(true);
            return;
          }
        }
        ConsoleHelper.showAppConsole();
        startLogOutput(project,type);
        setProcessFinished(true);
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
);
  cancelingThread.start();
}
Program: 2790
Project: 2790
Buggy source:
@Override public void run(){
  try {
    ConsoleHelper.consolePrint("String_Node_Str");
    if (mode.equals(ILaunchManager.DEBUG_MODE)) {
      if (type != RhodesAdapter.EPlatformType.eEmu) {
        if (rhodesAdapter.buildApp(project.getLocation().toOSString(),type,m_onDevice) != 0) {
          ConsoleHelper.consolePrint("String_Node_Str");
          setProcessFinished(true);
          return;
        }
      }
 else {
        m_debugProcess=rhodesAdapter.debugApp(project.getLocation().toOSString(),type,launch,m_onDevice);
        if (m_debugProcess == null) {
          ConsoleHelper.consolePrint("String_Node_Str");
          setProcessFinished(true);
          return;
        }
      }
    }
 else {
      if (rhodesAdapter.buildApp(project.getLocation().toOSString(),type,m_onDevice) != 0) {
        ConsoleHelper.consolePrint("String_Node_Str");
        setProcessFinished(true);
        return;
      }
    }
    ConsoleHelper.showAppConsole();
    startLogOutput(project,type);
    setProcessFinished(true);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    ConsoleHelper.consolePrint("String_Node_Str");
    if (mode.equals(ILaunchManager.DEBUG_MODE)) {
      if (type != RhodesAdapter.EPlatformType.eEmu) {
        if (rhodesAdapter.buildApp(project.getLocation().toOSString(),type,m_onDevice) != 0) {
          ConsoleHelper.consolePrint("String_Node_Str");
          setProcessFinished(true);
          return;
        }
      }
 else {
        m_debugProcess=rhodesAdapter.debugApp(m_projectName,project.getLocation().toOSString(),type,launch,m_onDevice);
        if (m_debugProcess == null) {
          ConsoleHelper.consolePrint("String_Node_Str");
          setProcessFinished(true);
          return;
        }
      }
    }
 else {
      if (rhodesAdapter.buildApp(project.getLocation().toOSString(),type,m_onDevice) != 0) {
        ConsoleHelper.consolePrint("String_Node_Str");
        setProcessFinished(true);
        return;
      }
    }
    ConsoleHelper.showAppConsole();
    startLogOutput(project,type);
    setProcessFinished(true);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 2791
Project: 2791
Buggy source:
public Vector<DebugVariable> getWatchList(DebugVariableType[] types){
  Vector<DebugVariable> result=null;
  if (DebugState.paused(this.state)) {
    this.waitForEOL=this.classPosition.length() > 0 ? DebugVariableType.INSTANCE : DebugVariableType.LOCAL;
    this.watchProcessing=true;
    this.watchList=new Vector<DebugVariable>();
    this.waitingThread=Thread.currentThread();
    this.wasWatchEOL=false;
    for (    DebugVariableType t : types)     if ((t == DebugVariableType.GLOBAL) || (t == DebugVariableType.LOCAL) || (this.classPosition.length() > 0))     getVariablesPrivate(t);
    do {
      try {
        Thread.sleep(1000);
      }
 catch (      InterruptedException e) {
      }
    }
 while (!(this.wasWatchEOL && (this.lastWatchEOL == this.waitForEOL)));
    this.watchProcessing=false;
    result=this.watchList;
    this.watchList=null;
  }
  return result;
}

Fixed version (ground truth):
public Vector<DebugVariable> getWatchList(DebugVariableType[] types){
  Vector<DebugVariable> result=null;
  if (DebugState.paused(this.state) && (types.length > 0)) {
    boolean hasSomethingToWatch=false;
    for (    DebugVariableType t : types)     if ((t == DebugVariableType.GLOBAL) || (t == DebugVariableType.LOCAL) || (this.classPosition.length() > 0)) {
      hasSomethingToWatch=true;
      this.waitForEOL=t;
    }
    if (hasSomethingToWatch) {
      this.watchProcessing=true;
      this.watchList=new Vector<DebugVariable>();
      this.waitingThread=Thread.currentThread();
      this.wasWatchEOL=false;
      for (      DebugVariableType t : types)       if ((t == DebugVariableType.GLOBAL) || (t == DebugVariableType.LOCAL) || (this.classPosition.length() > 0))       getVariablesPrivate(t);
      do {
        try {
          Thread.sleep(1000);
        }
 catch (        InterruptedException e) {
        }
      }
 while (!(this.wasWatchEOL && (this.lastWatchEOL == this.waitForEOL)));
      this.watchProcessing=false;
      result=this.watchList;
      this.watchList=null;
    }
  }
  return result;
}
Program: 2792
Project: 2792
Buggy source:
/** 
 * Called after the   {@link DebugServer#debugEvaluate(String)} method call.
 * @param valid - <code>true</code> if evaluated successfully,<code>false</code> otherwise. 
 * @param code - original Ruby code.
 * @param value - the resulted value of the evaluated/executed Ruby codeor the error message if evaliation failed (when <code>valid</code> is <code>false</code>). 
 */
public void evaluation(boolean valid,String code,String value);

Fixed version (ground truth):
/** 
 * Called after the   {@link DebugServer#debugEvaluate(String)} method call.
 * @param valid - <code>true</code> if evaluated successfully,<code>false</code> otherwise. 
 * @param code - original Ruby code.
 * @param value - the resulted value of the evaluated/executed Ruby codeor the error message if evaluation failed (when <code>valid</code> is <code>false</code>). 
 */
public void evaluation(boolean valid,String code,String value);
Program: 2793
Project: 2793
Buggy source:
public DebugEvaluation instantEvaluate(String expression){
  if (DebugState.paused(this.state)) {
    this.watchProcessing=true;
    this.evaluationResult=null;
    this.waitingThread=Thread.currentThread();
    evaluatePrivate(expression);
    do {
      try {
        Thread.sleep(1000);
      }
 catch (      InterruptedException e) {
      }
    }
 while (this.evaluationResult == null);
    this.watchProcessing=false;
    return this.evaluationResult;
  }
  return null;
}

Fixed version (ground truth):
public DebugEvaluation instantEvaluate(String expression){
  DebugEvaluation result=null;
  if (DebugState.paused(this.state)) {
    this.watchProcessing=true;
    this.evaluationResult=null;
    this.waitingThread=Thread.currentThread();
    evaluatePrivate(expression);
    do {
      try {
        Thread.sleep(1000);
      }
 catch (      InterruptedException e) {
      }
    }
 while (this.evaluationResult == null);
    this.watchProcessing=false;
    result=this.evaluationResult;
    this.evaluationResult=null;
  }
  return result;
}