nus-yam/ex-repair huggingface dataset:
Program: 2794
Project: 2794
Buggy source:
public Vector<DebugVariable> getWatchList(){
  if (DebugState.paused(this.state)) {
    this.waitForEOL=DebugVariableType.LOCAL;
    this.watchProcessing=true;
    this.watchList=new Vector<DebugVariable>();
    this.waitingThread=Thread.currentThread();
    this.wasWatchEOL=false;
    getVariablesPrivate(DebugVariableType.GLOBAL);
    getVariablesPrivate(DebugVariableType.LOCAL);
    if (this.classPosition.length() > 0) {
      this.waitForEOL=DebugVariableType.INSTANCE;
      getVariablesPrivate(DebugVariableType.CLASS);
      getVariablesPrivate(DebugVariableType.INSTANCE);
    }
    do {
      try {
        Thread.sleep(1000);
      }
 catch (      InterruptedException e) {
      }
    }
 while (!(this.wasWatchEOL && (this.lastWatchEOL == this.waitForEOL)));
    this.watchProcessing=false;
    return this.watchList;
  }
  return null;
}

Fixed version (ground truth):
public Vector<DebugVariable> getWatchList(){
  Vector<DebugVariable> result=null;
  if (DebugState.paused(this.state)) {
    this.waitForEOL=DebugVariableType.LOCAL;
    this.watchProcessing=true;
    this.watchList=new Vector<DebugVariable>();
    this.waitingThread=Thread.currentThread();
    this.wasWatchEOL=false;
    getVariablesPrivate(DebugVariableType.GLOBAL);
    getVariablesPrivate(DebugVariableType.LOCAL);
    if (this.classPosition.length() > 0) {
      this.waitForEOL=DebugVariableType.INSTANCE;
      getVariablesPrivate(DebugVariableType.CLASS);
      getVariablesPrivate(DebugVariableType.INSTANCE);
    }
    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: 2795
Project: 2795
Buggy source:
/** 
 * Create a debug server.
 * @param callback - object to receive events from the debug target (Rhodes application).
 */
public DebugServer(IDebugCallback callback){
  this.debugCallback=callback;
  this.initialize();
}

Fixed version (ground truth):
/** 
 * Create a debug server.
 * @param callback - object to receive events from the debug target(Rhodes application).
 */
public DebugServer(IDebugCallback callback){
  this.debugCallback=callback;
  this.initialize();
}
Program: 2796
Project: 2796
Buggy source:
/** 
 * Suspend the execution of Ruby code. The   {@link IDebugCallback#step(String,int,String,String)}method is called when the actual stop occurs.
 */
public void debugSuspend(){
  if (this.debugProtocol != null)   this.debugProtocol.suspend();
}

Fixed version (ground truth):
/** 
 * Suspend the execution of Ruby code. The  {@link IDebugCallback#step(String,int,String,String)}method is called when the actual stop occurs.
 */
public void debugSuspend(){
  if (this.debugProtocol != null)   this.debugProtocol.suspend();
}
Program: 2797
Project: 2797
Buggy source:
/** 
 * Set an output stream for a detailed debug information.
 * @param stream - output stream (if null, no debug information will be passed anywhere). 
 */
public static void setDebugOutputStream(PrintStream stream){
  debugOutput=stream;
}

Fixed version (ground truth):
/** 
 * Set an output stream for a detailed debug information.
 * @param stream - output stream (if null, no debug informationwill be passed anywhere). 
 */
public static void setDebugOutputStream(PrintStream stream){
  debugOutput=stream;
}
Program: 2798
Project: 2798
Buggy source:
/** 
 * Toggle breakpoints skip mode.
 * @param skip - if <code>true</code>, skip all breakpoints; if <code>false</code>, stop at breakpoints.
 */
public void debugSkipBreakpoints(boolean skip){
  if (this.debugProtocol != null)   this.debugProtocol.skipBreakpoints(skip);
}

Fixed version (ground truth):
/** 
 * Toggle breakpoints skip mode.
 * @param skip - if <code>true</code>, skip all breakpoints;if <code>false</code>, stop at breakpoints.
 */
public void debugSkipBreakpoints(boolean skip){
  if (this.debugProtocol != null)   this.debugProtocol.skipBreakpoints(skip);
}
Program: 2799
Project: 2799
Buggy source:
/** 
 * Resume a normal execution of the Rhodes application (after the stop at breakpoint or after   {@link #debugStepInto()},   {@link #debugStepOver()} or {@link #debugStepReturn()} method call). 
 */
public void debugResume(){
  if (this.debugProtocol != null)   this.debugProtocol.resume();
}

Fixed version (ground truth):
/** 
 * Resume a normal execution of the Rhodes application (after the stop at breakpoint or after   {@link #debugStepInto()},   {@link #debugStepOver()}or   {@link #debugStepReturn()} method call). 
 */
public void debugResume(){
  if (this.debugProtocol != null)   this.debugProtocol.resume();
}
Program: 2800
Project: 2800
Buggy source:
/** 
 * Remove a breakpoint.
 * @param file - file path within <code>app</code> folder of the Rhodes application,e.g. <code>"application.rb"</code> (always use <code>'/'</code> as a folder/file name separator).
 * @param line - effective line number (starting with 1). Must point to non-empty line of code.
 */
public void debugRemoveBreakpoint(String file,int line){
  if (this.debugProtocol != null)   this.debugProtocol.removeBreakpoint(file,line);
}

Fixed version (ground truth):
/** 
 * Remove an existing breakpoint.
 * @param file - file path within <code>app</code> folder of the Rhodesapplication, e.g. <code>"application.rb"</code> (always use <code>'/'</code> as a folder/file name separator).
 * @param line - breakpoint effective line number (starting with 1).
 */
public void debugRemoveBreakpoint(String file,int line){
  if (this.debugProtocol != null)   this.debugProtocol.removeBreakpoint(file,line);
}
Program: 2801
Project: 2801
Buggy source:
/** 
 * Add a breakpoint.
 * @param file - file path within <code>app</code> folder of the Rhodes application,e.g. <code>"application.rb"</code> (always use <code>'/'</code> as a folder/file name separator).
 * @param line - effective line number (starting with 1). Must point to non-empty line of code.
 */
public void debugBreakpoint(String file,int line){
  if (this.debugProtocol != null)   this.debugProtocol.addBreakpoint(file,line);
}

Fixed version (ground truth):
/** 
 * Add a breakpoint.
 * @param file - file path within <code>app</code> folder of the Rhodesapplication, e.g. <code>"application.rb"</code> (always use <code>'/'</code> as a folder/file name separator).
 * @param line - effective line number (starting with 1). Must point tonon-empty line of code.
 */
public void debugBreakpoint(String file,int line){
  if (this.debugProtocol != null)   this.debugProtocol.addBreakpoint(file,line);
}
Program: 2802
Project: 2802
Buggy source:
/** 
 * Terminates execution of the Rhodes application.
 */
public void debugTerminate(){
  if (this.debugProtocol != null)   this.debugProtocol.terminate();
}

Fixed version (ground truth):
/** 
 * Terminates execution of the Rhodes application. The  {@link IDebugCallback#exited()} method is called when the actualexit occurs.
 */
public void debugTerminate(){
  if (this.debugProtocol != null)   this.debugProtocol.terminate();
}
Program: 2803
Project: 2803
Buggy source:
/** 
 * Get list and values of variables of the specified types. Result is returned by the number of   {@link IDebugCallback#watch(DebugVariableType,String,String)} method calls.
 * @param types - list of variable types ({@link DebugVariableType}) to watch. 
 */
public void debugGetVariables(DebugVariableType[] types){
  if (this.debugProtocol != null)   this.debugProtocol.getVariables(types);
}

Fixed version (ground truth):
/** 
 * Get list and values of variables of the specified types. Result is returned by the number of   {@link IDebugCallback#watch(DebugVariableType,String,String)}method calls preceded by   {@link IDebugCallback#watchBOL(DebugVariableType)}and concluded by   {@link IDebugCallback#watchEOL(DebugVariableType)} for eachtype of variables.
 * @param types - list of variable types ({@link DebugVariableType}) to watch. 
 */
public void debugGetVariables(DebugVariableType[] types){
  if (this.debugProtocol != null)   this.debugProtocol.getVariables(types);
}
Program: 2804
Project: 2804
Buggy source:
/** 
 * Shutdown the debug server (close all connections and a server socket).
 */
public void shutdown(){
  this.interrupt();
  try {
    if (this.inFromClient != null)     this.inFromClient.close();
    if (this.outToClient != null)     this.outToClient.close();
    if (this.serverSocket != null)     this.serverSocket.close();
  }
 catch (  IOException ioe) {
  }
  this.inFromClient=null;
  this.outToClient=null;
  this.serverSocket=null;
  if (debugOutput != null)   debugOutput.println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Shutdown the debug server (close the connection and the server socket).
 */
public void shutdown(){
  this.interrupt();
  try {
    if (this.inFromClient != null)     this.inFromClient.close();
    if (this.outToClient != null)     this.outToClient.close();
    if (this.serverSocket != null)     this.serverSocket.close();
  }
 catch (  IOException ioe) {
  }
  this.inFromClient=null;
  this.outToClient=null;
  this.serverSocket=null;
  if (debugOutput != null)   debugOutput.println("String_Node_Str");
}
Program: 2805
Project: 2805
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 evaliation failed (when <code>valid</code> is <code>false</code>). 
 */
public void evaluation(boolean valid,String code,String value);
Program: 2806
Project: 2806
Buggy source:
/** 
 * Variable watch. Called for each variable after the call of  {@link DebugServer#debugGetVariables()} or {@link DebugServer#debugGetVariables(DebugVariableType[])}. 
 * @param type - Ruby variable type {@link DebugVariableType}.
 * @param variable - name of the local variable.
 * @param value - current value of the local variable.
 */
public void watch(DebugVariableType type,String variable,String value);

Fixed version (ground truth):
/** 
 * Variable watch. Called for each variable after the call of  {@link DebugServer#debugGetVariables()} or{@link DebugServer#debugGetVariables(DebugVariableType[])}. 
 * @param type - Ruby variable type {@link DebugVariableType}.
 * @param variable - name of the local variable.
 * @param value - current value of the local variable.
 */
public void watch(DebugVariableType type,String variable,String value);
Program: 2807
Project: 2807
Buggy source:
/** 
 * Called after execution of next method of Ruby code after the  {@link DebugServer#debugStepOver()} or {@link DebugServer#debugStepInto()} method call.  
 * @param file - file path within <code>app</code> folder of the Rhodes application,e.g. <code>"application.rb"</code>.
 * @param line - effective line number (starting with 1).
 * @param className - class name of the current object ("" if none).
 * @param method - name of the current method ("" if none).
 */
public void step(String file,int line,String className,String method);

Fixed version (ground truth):
/** 
 * Called after execution of next method of Ruby code after the  {@link DebugServer#debugStepOver()},   {@link DebugServer#debugStepInto()}or   {@link DebugServer#debugStepReturn()} method call.  
 * @param file - file path within <code>app</code> folder of the Rhodesapplication, e.g. <code>"application.rb"</code>.
 * @param line - effective line number (starting with 1).
 * @param className - class name of the current object ("" if none).
 * @param method - name of the current method ("" if none).
 */
public void step(String file,int line,String className,String method);
Program: 2808
Project: 2808
Buggy source:
/** 
 * Watch Begin-Of-List. Called before the first   {@link #watch(DebugVariableType,String,String)}callback for the particular type of variables.  
 * @param type - type of variables ({@link DebugVariableType}). 
 */
public void watchBOL(DebugVariableType type);

Fixed version (ground truth):
/** 
 * Watch Begin-Of-List. Called before the first  {@link #watch(DebugVariableType,String,String)}callback for the particular type of variables.  
 * @param type - type of variables ({@link DebugVariableType}). 
 */
public void watchBOL(DebugVariableType type);
Program: 2809
Project: 2809
Buggy source:
/** 
 * Watch End-Of-List. Called after the last   {@link #watch(DebugVariableType,String,String)}callback for the particular type of variables.  
 * @param type - type of variables ({@link DebugVariableType}). 
 */
public void watchEOL(DebugVariableType type);

Fixed version (ground truth):
/** 
 * Watch End-Of-List. Called after the last  {@link #watch(DebugVariableType,String,String)}callback for the particular type of variables.  
 * @param type - type of variables ({@link DebugVariableType}). 
 */
public void watchEOL(DebugVariableType type);
Program: 2810
Project: 2810
Buggy source:
/** 
 * Called when the breakpoint is reached.
 * @param file - file path within <code>app</code> folder of the Rhodes application,e.g. <code>"application.rb"</code>.
 * @param line - effective line number (starting with 1).
 * @param className - class name of the current object ("" if none).
 * @param method - name of the current method ("" if none).
 */
public void breakpoint(String file,int line,String className,String method);

Fixed version (ground truth):
/** 
 * Called when the breakpoint is reached.
 * @param file - file path within <code>app</code> folder of the Rhodesapplication, e.g. <code>"application.rb"</code>.
 * @param line - effective line number (starting with 1).
 * @param className - class name of the current object ("" if none).
 * @param method - name of the current method ("" if none).
 */
public void breakpoint(String file,int line,String className,String method);
Program: 2811
Project: 2811
Buggy source:
public void evaluate(String expression){
  debugServer.send("String_Node_Str" + expression);
}

Fixed version (ground truth):
public void evaluate(String expression){
  try {
    expression=URLEncoder.encode(expression,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
  }
  debugServer.send("String_Node_Str" + expression);
}
Program: 2812
Project: 2812
Buggy source:
/** 
 * Resume a normal execution of the Rhodes application (after the stop at breakpoint or after   {@link #debugStep()} method call). 
 */
public void debugResume(){
  if (this.debugProtocol != null)   this.debugProtocol.resume();
}

Fixed version (ground truth):
/** 
 * Resume a normal execution of the Rhodes application (after the stop at breakpoint or after   {@link #debugStepInto()},   {@link #debugStepOver()} or {@link #debugStepReturn()} method call). 
 */
public void debugResume(){
  if (this.debugProtocol != null)   this.debugProtocol.resume();
}
Program: 2813
Project: 2813
Buggy source:
/** 
 * Evaluate Ruby expression or execute arbitrary Ruby code. 
 * @param expression - expression to evaluate or Ruby code to execute.
 * @param includeCode - if <code>true</code>, return the original Ruby expression/codetogether with the calculated value though {@link IDebugCallback#evaluation(String,String)} method call.If <code>includeCode</code> is false, the result of evaluation/execution is returned by the  {@link IDebugCallback#evaluation(String)} method call.
 */
public void debugEvaluate(String expression,boolean includeCode){
  if (this.debugProtocol != null)   this.debugProtocol.evaluate(expression,includeCode);
}

Fixed version (ground truth):
/** 
 * Evaluate Ruby expression or execute arbitrary Ruby code. 
 * @param expression - expression to evaluate or Ruby code to execute.
 * @param includeCode - if <code>true</code>, return the original Ruby expression/codetogether with the calculated value though {@link IDebugCallback#evaluation(String,String)} method call.If <code>includeCode</code> is <code>false</code>, the result of evaluation/execution is returned by the  {@link IDebugCallback#evaluation(String)} method call.
 */
public void debugEvaluate(String expression,boolean includeCode){
  if (this.debugProtocol != null)   this.debugProtocol.evaluate(expression,includeCode);
}
Program: 2814
Project: 2814
Buggy source:
/** 
 * Variable watch. Called for each variable after the call of  {@link DebugServer#gebugGetVariables()}. 
 * @param type - Ruby variable type {@link DebugVariableType}.
 * @param variable - name of the local variable.
 * @param value - current value of the local variable.
 */
public void watch(DebugVariableType type,String variable,String value);

Fixed version (ground truth):
/** 
 * Variable watch. Called for each variable after the call of  {@link DebugServer#debugGetVariables()} or {@link DebugServer#debugGetVariables(DebugVariableType[])}. 
 * @param type - Ruby variable type {@link DebugVariableType}.
 * @param variable - name of the local variable.
 * @param value - current value of the local variable.
 */
public void watch(DebugVariableType type,String variable,String value);
Program: 2816
Project: 2816
Buggy source:
protected void processCommand(String cmd){
  if (cmd.endsWith("String_Node_Str"))   cmd=cmd.substring(0,cmd.length() - 1);
  if (cmd.compareTo("String_Node_Str") == 0) {
    this.state=DebugState.CONNECTED;
    debugServer.send("String_Node_Str");
    debugCallback.connected();
  }
 else   if (cmd.startsWith("String_Node_Str")) {
    this.state=DebugState.STOPPED;
    String[] bp=cmd.split("String_Node_Str");
    debugCallback.breakpoint(bp[1].replace('|',':').replace('\\','/'),Integer.parseInt(bp[2]));
  }
 else   if (cmd.startsWith("String_Node_Str")) {
    String[] bp=cmd.split("String_Node_Str");
    debugCallback.evaluation(bp[1].replace("String_Node_Str","String_Node_Str"));
  }
 else {
    debugCallback.unknown(cmd);
  }
}

Fixed version (ground truth):
protected void processCommand(String cmd){
  if (cmd.endsWith("String_Node_Str"))   cmd=cmd.substring(0,cmd.length() - 1);
  if (cmd.compareTo("String_Node_Str") == 0) {
    this.state=DebugState.CONNECTED;
    debugServer.send("String_Node_Str");
    debugCallback.connected();
  }
 else   if (cmd.startsWith("String_Node_Str")) {
    this.state=DebugState.STOPPED;
    String[] bp=cmd.split("String_Node_Str");
    debugCallback.breakpoint(bp[1].replace('|',':').replace('\\','/'),Integer.parseInt(bp[2]));
  }
 else   if (cmd.startsWith("String_Node_Str")) {
    debugCallback.evaluation(cmd.substring(3).replace("String_Node_Str","String_Node_Str"));
  }
 else {
    debugCallback.unknown(cmd);
  }
}
Program: 2818
Project: 2818
Buggy source:
public void evaluate(String expression,boolean includeName){
  debugServer.send((includeName ? "String_Node_Str" : "String_Node_Str") + expression);
}

Fixed version (ground truth):
public void evaluate(String expression){
  debugServer.send("String_Node_Str" + expression);
}
Program: 2819
Project: 2819
Buggy source:
/** 
 * Evaluate Ruby expression or execute arbitrary Ruby code. 
 * @param expression - expression to evaluate or Ruby code to execute.
 * @param includeCode - if <code>true</code>, returns the original Ruby expression/codetogether with the calculated value though {@link IDebugCallback#evaluation(String,String)} method call.If <code>includeCode</code> is <code>false</code>, the result of evaluation/execution is returned by the  {@link IDebugCallback#evaluation(String)} method call (not recommended!).
 */
public void debugEvaluate(String expression,boolean includeCode){
  if (this.debugProtocol != null)   this.debugProtocol.evaluate(expression,includeCode);
}

Fixed version (ground truth):
/** 
 * Evaluate Ruby expression or execute arbitrary Ruby code. 
 * @param expression - expression to evaluate or Ruby code to execute.Result of evaluation/execution is returned by the {@link IDebugCallback#evaluation(boolean,String,String)} method call.
 */
public void debugEvaluate(String expression){
  if (this.debugProtocol != null)   this.debugProtocol.evaluate(expression);
}
Program: 2820
Project: 2820
Buggy source:
/** 
 * Called after the   {@link DebugServer#debugEvaluate(String,boolean)} method call when second parameter is <code>true</code>.
 * @param code - original Ruby code. 
 * @param value - the resulted value of the evaluated/executed Ruby code. 
 */
public void evaluation(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 evaliation failed (when <code>valid</code> is <code>false</code>). 
 */
public void evaluation(boolean valid,String code,String value);
Program: 2821
Project: 2821
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(String modelName,String modelParams,IProgressMonitor monitor) throws CoreException {
  try {
    monitor.beginTask("String_Node_Str" + modelName,2);
    monitor.worked(1);
    monitor.setTaskName("String_Node_Str");
    if (null != m_projectLocation) {
      m_rhogenAdapter.generateModel(m_projectLocation,modelName,modelParams);
    }
 else {
    }
    m_currentProject.refreshLocal(IResource.DEPTH_INFINITE,monitor);
    monitor.worked(1);
  }
 catch (  Exception e1) {
    e1.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(String modelName,String modelParams,IProgressMonitor monitor) throws CoreException {
  try {
    monitor.beginTask("String_Node_Str" + modelName,2);
    monitor.worked(1);
    monitor.setTaskName("String_Node_Str");
    if (null != m_projectLocation) {
      m_rhogenAdapter.generateModel(m_projectLocation,modelName,modelParams);
    }
 else {
    }
    m_currentProject.refreshLocal(IResource.DEPTH_INFINITE,monitor);
    monitor.worked(1);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 2822
Project: 2822
Buggy source:
/** 
 * Saves the multi-page editor's document.
 */
public void doSave(IProgressMonitor monitor){
}

Fixed version (ground truth):
/** 
 * Saves the multi-page editor's document.
 */
public void doSave(IProgressMonitor monitor){
  m_editor.doSave(monitor);
}
Program: 2823
Project: 2823
Buggy source:
/** 
 * Calculates the contents of page 2 when the it is activated.
 */
protected void pageChange(int newPageIndex){
  super.pageChange(newPageIndex);
  try {
    if (newPageIndex == 0) {
      String pathToFile=getFileLocation();
      m_ymlFile=new AppYmlFile(pathToFile);
      m_appLogText.setText(m_ymlFile.getAppLog());
      m_rhodesPathText.setText(m_ymlFile.getSdkPath());
      m_appNameText.setText(m_ymlFile.getAppName());
      showCapabilitiesText(m_ymlFile.getCapabilities());
      return;
    }
    if (newPageIndex == 1) {
      m_editor.setInput(new FileEditorInput(getFile()));
      getFile().getProject().refreshLocal(IResource.DEPTH_INFINITE,null);
    }
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  CoreException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Calculates the contents of page 2 when the it is activated.
 */
protected void pageChange(int newPageIndex){
  super.pageChange(newPageIndex);
  try {
    if (newPageIndex == 0) {
      m_editor.doSave(null);
      String pathToFile=getFileLocation();
      m_ymlFile=null;
      m_ymlFile=new AppYmlFile(pathToFile);
      String sdk=m_ymlFile.getSdkPath();
      String appName=m_ymlFile.getAppName();
      String logName=m_ymlFile.getAppLog();
      m_appLogText.setText(logName);
      m_rhodesPathText.setText(sdk);
      m_appNameText.setText(appName);
      showCapabilitiesText(m_ymlFile.getCapabilities());
      return;
    }
    if (newPageIndex == 1) {
      m_editor.setInput(new FileEditorInput(getFile()));
      getFile().getProject().refreshLocal(IResource.DEPTH_INFINITE,null);
    }
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  CoreException e) {
    e.printStackTrace();
  }
}
Program: 2824
Project: 2824
Buggy source:
public void start(BundleContext context) throws Exception {
  super.start(context);
  plugin=this;
  ConsoleHelper.consolePrint("String_Node_Str");
  ConsoleHelper.consoleAppPrint("String_Node_Str");
}

Fixed version (ground truth):
public void start(BundleContext context) throws Exception {
  super.start(context);
  plugin=this;
  ConsoleHelper.consoleAppPrint("String_Node_Str");
  ConsoleHelper.consolePrint("String_Node_Str");
}
Program: 2825
Project: 2825
Buggy source:
public void setAndroidEmuName(String newName){
}

Fixed version (ground truth):
public void setAndroidEmuName(String newName){
  super.set("String_Node_Str","String_Node_Str",newName);
}
Program: 2826
Project: 2826
Buggy source:
public String getAndroidEmuName(){
  return "String_Node_Str";
}

Fixed version (ground truth):
public String getAndroidEmuName(){
  return super.get("String_Node_Str","String_Node_Str");
}
Program: 2827
Project: 2827
Buggy source:
public void save() throws FileNotFoundException {
  if (m_filePath.length() != 0) {
    StringBuilder sb=new StringBuilder();
    Iterator it=m_dataStorage.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry pairs=(Map.Entry)it.next();
      Object key=(Object)pairs.getKey();
      Object val=pairs.getValue();
      saveSelector(sb,"String_Node_Str",key.toString(),val);
    }
    ConsoleHelper.consolePrint(sb.toString());
  }
}

Fixed version (ground truth):
public void save() throws FileNotFoundException {
  try {
    if (m_filePath.length() != 0) {
      String dataString=null;
      File outFile=new File(m_filePath);
      FileOutputStream os=new FileOutputStream(outFile);
      if (SNAKE_YAML_SAVE) {
        org.yaml.snakeyaml.Yaml dumpEncoder=new org.yaml.snakeyaml.Yaml();
        dataString=dumpEncoder.dump(m_dataStorage);
      }
 else {
        StringBuilder sb=new StringBuilder();
        Iterator it=m_dataStorage.entrySet().iterator();
        while (it.hasNext()) {
          Map.Entry pairs=(Map.Entry)it.next();
          Object key=(Object)pairs.getKey();
          Object val=pairs.getValue();
          saveSelector(sb,"String_Node_Str",key.toString(),val);
        }
        dataString=sb.toString();
      }
      os.write(dataString.getBytes());
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 2829
Project: 2829
Buggy source:
@Override public void initializeFrom(ILaunchConfiguration configuration){
  try {
    Control scrollParent=getLaunchConfigurationDialog().getActiveTab().getControl().getParent();
    if (scrollParent instanceof ScrolledComposite) {
      ScrolledComposite sc=(ScrolledComposite)scrollParent;
      sc.setMinSize(scrollParent.computeSize(minTabSize,SWT.DEFAULT));
    }
    String selProjectName=null, selProjectPlatform=null, selAndroidEmuName=null;
    selProjectName=configuration.getAttribute(RhogenLaunchDelegate.projectNameCfgAttribute,"String_Node_Str");
    selProjectPlatform=configuration.getAttribute(RhogenLaunchDelegate.platforrmCfgAttribute,"String_Node_Str");
    boolean onDevice=configuration.getAttribute(RhogenLaunchDelegate.platforrmDeviceCfgAttribute,false);
    boolean isClean=configuration.getAttribute(RhogenLaunchDelegate.isCleanAttribute,false);
    if (selProjectName != "String_Node_Str") {
      m_selProject=ResourcesPlugin.getWorkspace().getRoot().getProject(selProjectName);
      m_appNameText.setText(selProjectName);
    }
    setPlatformCombo(selProjectPlatform,onDevice);
    m_cleanButton.setSelection(isClean);
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void initializeFrom(ILaunchConfiguration configuration){
  try {
    Control scrollParent=getLaunchConfigurationDialog().getActiveTab().getControl().getParent();
    if (scrollParent instanceof ScrolledComposite) {
      ScrolledComposite sc=(ScrolledComposite)scrollParent;
      sc.setMinSize(scrollParent.computeSize(minTabSize,SWT.DEFAULT));
    }
    String selProjectName=null, selProjectPlatform=null, selAndroidEmuName=null;
    selProjectName=configuration.getAttribute(RhogenLaunchDelegate.projectNameCfgAttribute,"String_Node_Str");
    selProjectPlatform=configuration.getAttribute(RhogenLaunchDelegate.platforrmCfgAttribute,"String_Node_Str");
    boolean onDevice=configuration.getAttribute(RhogenLaunchDelegate.platforrmDeviceCfgAttribute,false);
    boolean isClean=configuration.getAttribute(RhogenLaunchDelegate.isCleanAttribute,false);
    selAndroidEmuName=configuration.getAttribute(RhogenLaunchDelegate.androidEmuNameAttribute,"String_Node_Str");
    if (selProjectName != "String_Node_Str") {
      m_selProject=ResourcesPlugin.getWorkspace().getRoot().getProject(selProjectName);
      m_appNameText.setText(selProjectName);
      m_adroidEmuNameText.setText(selAndroidEmuName);
      m_ymlFile=AppYmlFile.createFromProject(m_selProject);
    }
    setPlatformCombo(selProjectPlatform,onDevice);
    m_cleanButton.setSelection(isClean);
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
}
Program: 2830
Project: 2830
Buggy source:
private void setAndroidEmuName(){
  try {
    showAndroidEmuName(false);
    String selProjectPlatform=m_configuration.getAttribute(RhogenLaunchDelegate.platforrmCfgAttribute,"String_Node_Str");
    String emuName=m_configuration.getAttribute(RhogenLaunchDelegate.androidEmuNameAttribute,"String_Node_Str");
    if (selProjectPlatform.equals(RhodesAdapter.platformAdroid)) {
      showAndroidEmuName(true);
      if (!m_adroidEmuNameText.getText().equals(emuName)) {
        m_adroidEmuNameText.setText(emuName);
      }
    }
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void setAndroidEmuName(){
  try {
    showAndroidEmuName(false);
    String selProjectPlatform=m_configuration.getAttribute(RhogenLaunchDelegate.platforrmCfgAttribute,"String_Node_Str");
    String emuName=m_configuration.getAttribute(RhogenLaunchDelegate.androidEmuNameAttribute,"String_Node_Str");
    if (selProjectPlatform.equals(RhodesAdapter.platformAdroid)) {
      showAndroidEmuName(true);
      m_adroidEmuNameText.setText(emuName);
    }
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
}
Program: 2831
Project: 2831
Buggy source:
@Override public void performApply(ILaunchConfigurationWorkingCopy configuration){
  m_configuration=configuration;
  try {
    m_ymlFile=AppYmlFile.createFromProject(m_selProject);
    if (m_ymlFile != null) {
      m_configuration.setAttribute(RhogenLaunchDelegate.androidVersionAttribute,m_ymlFile.getAndroidVer());
      m_configuration.setAttribute(RhogenLaunchDelegate.blackberryVersionAttribute,m_ymlFile.getBlackberryVer());
      m_configuration.setAttribute(RhogenLaunchDelegate.androidEmuNameAttribute,m_ymlFile.getAndroidEmuName());
      setPlatformVersionCombo();
    }
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void performApply(ILaunchConfigurationWorkingCopy configuration){
  m_configuration=configuration;
}
Program: 2832
Project: 2832
Buggy source:
public void modifyText(ModifyEvent e){
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  if (m_configuration != null && m_ymlFile != null) {
    try {
      m_configuration.setAttribute(RhogenLaunchDelegate.androidEmuNameAttribute,m_adroidEmuNameText.getText());
      m_ymlFile.setAndroidEmuName(m_adroidEmuNameText.getText());
      m_ymlFile.save();
      showApplyButton();
    }
 catch (    FileNotFoundException e1) {
      e1.printStackTrace();
    }
  }
}
Program: 2834
Project: 2834
Buggy source:
public RhogenComboFieldEditor(String name,String labelText,String[][] entryNamesAndValues,Composite parent){
  init(name,labelText);
  Assert.isTrue(checkArray(entryNamesAndValues));
  fEntryNamesAndValues=entryNamesAndValues;
  createControl(parent);
}

Fixed version (ground truth):
public RhogenComboFieldEditor(String name,String labelText,String[][] entryNamesAndValues,Composite parent,IItemAddedNotifier notifier){
  init(name,labelText);
  Assert.isTrue(checkArray(entryNamesAndValues));
  fEntryNamesAndValues=entryNamesAndValues;
  fNewValueNotify=notifier;
  createControl(parent);
}
Program: 2835
Project: 2835
Buggy source:
protected void doFillIntoGrid(Composite parent,int numColumns){
  int comboC=1;
  if (numColumns > 1) {
    comboC=numColumns - 1;
  }
  Control control=getLabelControl(parent);
  GridData gd=new GridData();
  gd.horizontalSpan=1;
  control.setLayoutData(gd);
  control=getComboBoxControl(parent);
  gd=new GridData();
  gd.horizontalSpan=comboC;
  gd.horizontalAlignment=GridData.FILL;
  control.setLayoutData(gd);
  control.setFont(parent.getFont());
}

Fixed version (ground truth):
protected void doFillIntoGrid(final Composite parent,int numColumns){
  int comboC=1;
  if (numColumns > 1) {
    comboC=numColumns - 1;
  }
  Control control=getLabelControl(parent);
  GridData gd=new GridData();
  gd.horizontalSpan=1;
  control.setLayoutData(gd);
  control=getComboBoxControl(parent);
  gd=new GridData();
  gd.horizontalAlignment=GridData.FILL;
  control.setLayoutData(gd);
  control.setFont(parent.getFont());
  fNewVersin=new Button(parent,SWT.PUSH);
  fNewVersin.setText("String_Node_Str");
  fNewVersin.setLayoutData(gd);
  fNewVersin.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      final Shell parentShell=parent.getShell();
      InputDialog inputDlg=new InputDialog(parentShell,"String_Node_Str","String_Node_Str","String_Node_Str",null);
      inputDlg.open();
      if (fNewValueNotify != null) {
        fNewValueNotify.addNewValue(inputDlg.getValue());
      }
      fCombo.add(inputDlg.getValue());
      super.widgetSelected(e);
    }
  }
);
}
Program: 2836
Project: 2836
Buggy source:
protected void adjustForNumColumns(int numColumns){
  if (numColumns > 1) {
    Control control=getLabelControl();
    int left=numColumns;
    if (control != null) {
      ((GridData)control.getLayoutData()).horizontalSpan=1;
      left=left - 1;
    }
    ((GridData)fCombo.getLayoutData()).horizontalSpan=left;
  }
 else {
    Control control=getLabelControl();
    if (control != null) {
      ((GridData)control.getLayoutData()).horizontalSpan=1;
    }
    ((GridData)fCombo.getLayoutData()).horizontalSpan=1;
  }
}

Fixed version (ground truth):
protected void adjustForNumColumns(int numColumns){
  if (numColumns > 1) {
    Control control=getLabelControl();
    int left=numColumns;
    if (control != null) {
      ((GridData)control.getLayoutData()).horizontalSpan=1;
      left=left - 1;
    }
  }
 else {
    Control control=getLabelControl();
    if (control != null) {
      ((GridData)control.getLayoutData()).horizontalSpan=1;
    }
    ((GridData)fCombo.getLayoutData()).horizontalSpan=1;
  }
}
Program: 2837
Project: 2837
Buggy source:
public int getNumberOfControls(){
  return 2;
}

Fixed version (ground truth):
public int getNumberOfControls(){
  return 3;
}
Program: 2839
Project: 2839
Buggy source:
@Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration){
  m_configuration=configuration;
  if (m_selProject == null) {
    m_selProject=getSelectedProject();
  }
  if (m_selProject != null) {
    configuration.setAttribute(RhogenLaunchDelegate.projectNameCfgAttribute,m_selProject.getName());
  }
  configuration.setAttribute(RhogenLaunchDelegate.platforrmCfgAttribute,(String)"String_Node_Str");
  configuration.setAttribute(RhogenLaunchDelegate.platforrmDeviceCfgAttribute,(String)"String_Node_Str");
}

Fixed version (ground truth):
@Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration){
  m_configuration=configuration;
  if (m_selProject == null) {
    m_selProject=getSelectedProject();
    if (m_selProject == null) {
      IProject[] allProjects=ResourcesPlugin.getWorkspace().getRoot().getProjects();
      if (allProjects.length == 1) {
        m_selProject=allProjects[0];
      }
    }
  }
  if (m_selProject != null) {
    configuration.setAttribute(RhogenLaunchDelegate.projectNameCfgAttribute,m_selProject.getName());
  }
  configuration.setAttribute(RhogenLaunchDelegate.platforrmCfgAttribute,(String)RhodesAdapter.platformAdroid);
  configuration.setAttribute(RhogenLaunchDelegate.platforrmDeviceCfgAttribute,(String)"String_Node_Str");
}
Program: 2841
Project: 2841
Buggy source:
public void start(BundleContext context) throws Exception {
  super.start(context);
  plugin=this;
}

Fixed version (ground truth):
public void start(BundleContext context) throws Exception {
  super.start(context);
  plugin=this;
  ConsoleHelper.consolePrint("String_Node_Str");
}
Program: 2842
Project: 2842
Buggy source:
public static OutputStream getConsoleStream(){
  MessageConsole myConsole=findConsole("String_Node_Str");
  MessageConsoleStream out=myConsole.newMessageStream();
  return out;
}

Fixed version (ground truth):
public static OutputStream getConsoleStream(){
  if (msgConsole == null) {
    msgConsole=findConsole("String_Node_Str");
  }
  MessageConsoleStream out=msgConsole.newMessageStream();
  return out;
}
Program: 2843
Project: 2843
Buggy source:
public boolean generateModel(String workDir,String modelName,String modelParams) throws Exception {
  m_executor.setWorkingDirectory(workDir);
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rhogenExe);
  cmdLine.add("String_Node_Str");
  cmdLine.add(modelName);
  cmdLine.add(modelParams);
  m_executor.runCommand(cmdLine);
  return true;
}

Fixed version (ground truth):
public boolean generateModel(String workDir,String modelName,String modelParams) throws Exception {
  m_executor.setWorkingDirectory(workDir);
  modelParams=modelParams.replace(' ','_');
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rhogenExe);
  cmdLine.add("String_Node_Str");
  cmdLine.add(modelName);
  cmdLine.add(modelParams);
  m_executor.runCommand(cmdLine);
  return true;
}
Program: 2844
Project: 2844
Buggy source:
@Override public void log(String str){
  if (null != m_consoleStream) {
    m_consoleStream.println(str);
  }
}

Fixed version (ground truth):
@Override public void log(String str){
  if (null != m_consoleStream) {
    m_consoleStream.println(prepareString(str));
  }
}
Program: 2845
Project: 2845
Buggy source:
public boolean buildApp(String workDir,String platformName) throws Exception {
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(platformName);
  m_executor.setWorkingDirectory(workDir);
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  m_executor.runCommand(cmdLine);
  return true;
}

Fixed version (ground truth):
public boolean buildApp(String workDir,String platformName) throws Exception {
  ConsoleHelper.consolePrint("String_Node_Str");
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(platformName);
  m_executor.setWorkingDirectory(workDir);
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  m_executor.runCommand(cmdLine);
  return true;
}
Program: 2846
Project: 2846
Buggy source:
protected IProject[] build(int kind,Map args,IProgressMonitor monitor) throws CoreException {
  try {
    String platformName=(String)getProject().getSessionProperty(getPlatformQualifier());
    if (kind != CLEAN_BUILD && platformName != null) {
      ConsoleHelper.consolePrint("String_Node_Str" + getProject().getName() + "String_Node_Str"+ platformName);
      m_rhodeAdapter.buildApp(getProject().getLocation().toOSString(),platformName);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
protected IProject[] build(int kind,Map args,final IProgressMonitor monitor) throws CoreException {
  try {
    String platformName=(String)getProject().getSessionProperty(getPlatformQualifier());
    if (kind != CLEAN_BUILD && platformName != null) {
      ConsoleHelper.consolePrint("String_Node_Str" + getProject().getName() + "String_Node_Str"+ platformName);
      m_rhodeAdapter.buildApp(getProject().getLocation().toOSString(),platformName);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}
Program: 2847
Project: 2847
Buggy source:
public void start(BundleContext context) throws Exception {
  super.start(context);
  plugin=this;
  ConsoleHelper.consolePrint("String_Node_Str");
}

Fixed version (ground truth):
public void start(BundleContext context) throws Exception {
  super.start(context);
  plugin=this;
  ConsoleHelper.consolePrint("String_Node_Str");
  ConsoleHelper.consoleAppPrint("String_Node_Str");
}
Program: 2848
Project: 2848
Buggy source:
public static OutputStream getConsoleStream(){
  if (msgConsole == null) {
    msgConsole=findConsole("String_Node_Str");
  }
  MessageConsoleStream out=msgConsole.newMessageStream();
  return out;
}

Fixed version (ground truth):
public static OutputStream getConsoleStream(){
  if (msgConsole == null) {
    msgConsole=findConsole("String_Node_Str");
    appConsole=findConsole("String_Node_Str");
  }
  MessageConsoleStream out=msgConsole.newMessageStream();
  return out;
}
Program: 2849
Project: 2849
Buggy source:
public void buildApp(String workDir,String platformName) throws Exception {
  ConsoleHelper.consolePrint("String_Node_Str");
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(platformName);
  m_executor.setWorkingDirectory(workDir);
  List<String> cmdLine=new ArrayList<String>();
  cmdLine.add(m_rakeExe);
  cmdLine.add(sb.toString());
  m_executor.runCommand(cmdLine);
}

Fixed version (ground truth):
public void buildApp(String workDir,String platformName,boolean onDevice) throws Exception {
  ConsoleHelper.consolePrint("String_Node_Str");
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(platformName);
  if (onDevice) {
    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);
}
Program: 2851
Project: 2851
Buggy source:
@Override public void run(){
  try {
    rhodesAdapter.buildApp(project.getLocation().toOSString(),m_platformName);
    setProcessFinished(true);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    rhodesAdapter.buildApp(project.getLocation().toOSString(),m_platformName,m_onDevice);
    setProcessFinished(true);
    startLogOutput(project);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 2852
Project: 2852
Buggy source:
public boolean generateApp(BuildInfoHolder holder) throws Exception {
  m_executor.setWorkingDirectory(holder.m_appDir);
  StringBuilder sb=new StringBuilder();
  sb.append(m_rhogenExe + "String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(holder.m_appName);
  sb.append("String_Node_Str" + holder.generateAttributeString());
  m_executor.runCommand(sb.toString());
  return true;
}

Fixed version (ground truth):
public boolean generateApp(BuildInfoHolder holder) throws Exception {
  m_executor.setWorkingDirectory(holder.getProjectLocationPath().toOSString());
  StringBuilder sb=new StringBuilder();
  sb.append(m_rhogenExe + "String_Node_Str");
  sb.append("String_Node_Str");
  sb.append(holder.appName);
  sb.append("String_Node_Str" + holder.generateAttributeString());
  m_executor.runCommand(sb.toString());
  return true;
}
Program: 2853
Project: 2853
Buggy source:
/** 
 * Just do the basics: create a basic project.
 * @param location
 * @param projectName
 */
private static IProject createBaseProject(String projectName,URI location){
  IProject newProject=ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
  if (!newProject.exists()) {
    URI projectLocation=location;
    String path=URIUtil.toPath(projectLocation).toOSString();
    path=path + "String_Node_Str" + projectName;
    IProjectDescription desc=newProject.getWorkspace().newProjectDescription(newProject.getName());
    desc.setLocationURI(URIUtil.toURI(path));
    try {
      newProject.create(desc,null);
      if (!newProject.isOpen()) {
        newProject.open(null);
      }
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
  }
 else {
  }
  return newProject;
}

Fixed version (ground truth):
/** 
 * Just do the basics: create a basic project.
 * @param location
 * @param projectName
 */
private static IProject createBaseProject(BuildInfoHolder projectInfo){
  IProject newProject=ResourcesPlugin.getWorkspace().getRoot().getProject(projectInfo.appName);
  if (!newProject.exists()) {
    URI projectLocation=projectInfo.getProjectLocation();
    String path=URIUtil.toPath(projectLocation).toOSString();
    path=path + "String_Node_Str" + projectInfo.appName;
    IProjectDescription desc=newProject.getWorkspace().newProjectDescription(newProject.getName());
    if (!projectInfo.isInDefaultWs) {
      desc.setLocationURI(URIUtil.toURI(path));
    }
    try {
      newProject.create(desc,null);
      if (!newProject.isOpen()) {
        newProject.open(null);
      }
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
  }
 else {
  }
  return newProject;
}
Program: 2854
Project: 2854
Buggy source:
public static IProject createProject(String projectName,URI location){
  Assert.isNotNull(projectName);
  Assert.isTrue(projectName.trim().length() != 0);
  IProject project=createBaseProject(projectName,location);
  return project;
}

Fixed version (ground truth):
public static IProject createProject(BuildInfoHolder projectInfo){
  Assert.isNotNull(projectInfo.appName);
  Assert.isTrue(projectInfo.appName.trim().length() != 0);
  IProject project=createBaseProject(projectInfo);
  return project;
}
Program: 2855
Project: 2855
Buggy source:
/** 
 * @see IObjectActionDelegate#setActivePart(IAction,IWorkbenchPart)
 */
public void setActivePart(IAction action,IWorkbenchPart targetPart){
  m_shell=targetPart.getSite().getShell();
  m_projectLocation=getCurrectProjectLocation(targetPart);
}

Fixed version (ground truth):
/** 
 * @see IObjectActionDelegate#setActivePart(IAction,IWorkbenchPart)
 */
public void setActivePart(IAction action,IWorkbenchPart targetPart){
  m_shell=targetPart.getSite().getShell();
  m_projectLocation=getCurrentProjectLocation(targetPart);
}