nus-yam/ex-repair huggingface dataset:
Program: 145220
Project: 145220
Buggy source:
private static void listQuestion(FormDef f,QuestionDef q,int indent,StringBuffer sb){
  TreeElement instanceNode=getInstanceNode(f.getDataModel(),q.getBind());
  String caption=q.getLongText();
  int type=instanceNode.dataType;
  if (q.getControlType() != Constants.CONTROL_TRIGGER) {
    println(sb,indent,"String_Node_Str" + caption + "String_Node_Str");
    println(sb,indent + 1,"String_Node_Str" + printType(type));
  }
 else {
    println(sb,indent,"String_Node_Str" + caption + "String_Node_Str");
  }
  if (q.getControlType() == Constants.CONTROL_SELECT_ONE || q.getControlType() == Constants.CONTROL_SELECT_MULTI) {
    printChoices(q,indent + 1,sb);
  }
  printProperty("String_Node_Str",f,instanceNode,indent + 1,sb);
  printProperty("String_Node_Str",f,instanceNode,indent + 1,sb);
  printProperty("String_Node_Str",f,instanceNode,indent + 1,sb);
  String defaultValue=printDefault(instanceNode);
  if (defaultValue != null) {
    println(sb,indent + 1,"String_Node_Str" + defaultValue);
  }
  if (instanceNode.constraint != null) {
    println(sb,indent + 1,"String_Node_Str" + printCondition(instanceNode.constraint.constraint));
  }
  println(sb);
}

Fixed version (ground truth):
private static void listQuestion(FormDef f,QuestionDef q,int indent,StringBuffer sb){
  TreeElement instanceNode=getInstanceNode(f.getDataModel(),q.getBind());
  String caption=q.getLongText();
  int type=instanceNode.dataType;
  if (q.getControlType() != Constants.CONTROL_TRIGGER) {
    println(sb,indent,"String_Node_Str" + caption + "String_Node_Str");
    println(sb,indent + 1,"String_Node_Str" + printType(type));
  }
 else {
    println(sb,indent,"String_Node_Str" + caption + "String_Node_Str");
  }
  if (q.getControlType() == Constants.CONTROL_SELECT_ONE || q.getControlType() == Constants.CONTROL_SELECT_MULTI) {
    printChoices(q,indent + 1,sb);
  }
  printProperty("String_Node_Str",f,instanceNode,indent + 1,sb);
  printProperty("String_Node_Str",f,instanceNode,indent + 1,sb);
  printProperty("String_Node_Str",f,instanceNode,indent + 1,sb);
  String defaultValue=printDefault(instanceNode);
  if (defaultValue != null) {
    println(sb,indent + 1,"String_Node_Str" + defaultValue);
  }
  if (instanceNode.getConstraint() != null) {
    println(sb,indent + 1,"String_Node_Str" + printCondition(instanceNode.getConstraint().constraint));
  }
  println(sb);
}
Program: 145222
Project: 145222
Buggy source:
private void init(){
  new J2MEModule().registerModule(context);
  new XFormsModule().registerModule(context);
  new CoreModelModule().registerModule(context);
  new HttpTransportModule().registerModule(context);
  new FormManagerModule().registerModule(context);
  FormDefRMSUtility formDef=(FormDefRMSUtility)JavaRosaServiceProvider.instance().getStorageManager().getRMSStorageProvider().getUtility(FormDefRMSUtility.getUtilityName());
  int formID=formDef.writeToRMS(XFormUtils.getFormFromResource("String_Node_Str"));
  launchFormEntryActivity(context,formID,-1);
}

Fixed version (ground truth):
private void init(){
  new J2MEModule().registerModule(context);
  new LanguagePackModule().registerModule(context);
  new XFormsModule().registerModule(context);
  new CoreModelModule().registerModule(context);
  new HttpTransportModule().registerModule(context);
  new FormManagerModule().registerModule(context);
  FormDefRMSUtility formDef=(FormDefRMSUtility)JavaRosaServiceProvider.instance().getStorageManager().getRMSStorageProvider().getUtility(FormDefRMSUtility.getUtilityName());
  int formID=formDef.writeToRMS(XFormUtils.getFormFromResource("String_Node_Str"));
  launchFormEntryActivity(context,formID,-1);
}
Program: 145223
Project: 145223
Buggy source:
public ChatterboxWidget getNewRepeatWidget(FormIndex index,FormDef f,Chatterbox cbox){
  GroupDef repeat=(GroupDef)f.explodeIndex(index).lastElement();
  FormIndex end=index;
  while (!end.isTerminal()) {
    end=end.getNextLevel();
  }
  int multiplicity=end.getInstanceIndex();
  QuestionDef q=new QuestionDef(-1,"String_Node_Str",Constants.CONTROL_SELECT_ONE);
  String label=repeat.getLongText();
  q.setLongText("String_Node_Str" + (multiplicity > 0 ? "String_Node_Str" : "String_Node_Str") + (label == null || label.length() == 0 ? "String_Node_Str" : label)+ "String_Node_Str");
  q.addSelectItem("String_Node_Str","String_Node_Str");
  q.addSelectItem("String_Node_Str","String_Node_Str");
  FormElementBinding binding=new FormElementBinding(null,q,new TreeElement(null,0));
  return new ChatterboxWidget(cbox,binding,ChatterboxWidget.VIEW_EXPANDED,new CollapsedWidget(),new SelectOneEntryWidget(ChoiceGroup.EXCLUSIVE));
}

Fixed version (ground truth):
public ChatterboxWidget getNewRepeatWidget(FormIndex index,FormDef f,Chatterbox cbox){
  GroupDef repeat=(GroupDef)f.explodeIndex(index).lastElement();
  FormIndex end=index;
  while (!end.isTerminal()) {
    end=end.getNextLevel();
  }
  int multiplicity=end.getInstanceIndex();
  QuestionDef q=new QuestionDef(-1,"String_Node_Str",Constants.CONTROL_SELECT_ONE);
  String label=repeat.getLongText();
  q.setLongText("String_Node_Str" + (multiplicity > 0 ? "String_Node_Str" : "String_Node_Str") + (label == null || label.length() == 0 ? "String_Node_Str" : label)+ "String_Node_Str");
  q.addSelectItem("String_Node_Str","String_Node_Str");
  q.addSelectItem("String_Node_Str","String_Node_Str");
  q.addSelectItemID("String_Node_Str",false,"String_Node_Str");
  q.addSelectItemID("String_Node_Str",false,"String_Node_Str");
  FormElementBinding binding=new FormElementBinding(null,q,new TreeElement(null,0));
  binding.form=f;
  return new ChatterboxWidget(cbox,binding,ChatterboxWidget.VIEW_EXPANDED,new CollapsedWidget(),new SelectOneEntryWidget(ChoiceGroup.EXCLUSIVE));
}
Program: 145224
Project: 145224
Buggy source:
/** 
 * Add a Condition to the form's Collection.
 * @param condition the condition to be set
 */
public Triggerable addTriggerable(Triggerable t){
  int useExistingIx=-1;
  if (t instanceof Condition) {
    int p=triggerables.indexOf(t);
    if (p >= 0) {
      useExistingIx=p;
    }
  }
  if (useExistingIx != -1) {
    return (Condition)triggerables.elementAt(useExistingIx);
  }
 else {
    triggerables.addElement(t);
    Vector triggers=t.getTriggers();
    for (int i=0; i < triggers.size(); i++) {
      TreeReference trigger=(TreeReference)triggers.elementAt(i);
      if (!triggerIndex.containsKey(trigger)) {
        triggerIndex.put(trigger,new Vector());
      }
      Vector triggered=(Vector)triggerIndex.get(trigger);
      if (!triggered.contains(t)) {
        triggered.addElement(t);
      }
    }
    if (t instanceof Condition) {
      Vector targets=t.getTargets();
      for (int i=0; i < targets.size(); i++) {
        TreeReference target=(TreeReference)targets.elementAt(i);
        if (model.getTemplate(target) != null) {
          conditionRepeatTargetIndex.put(target,(Condition)t);
        }
      }
    }
    return t;
  }
}

Fixed version (ground truth):
/** 
 * Add a Condition to the form's Collection.
 * @param condition the condition to be set
 */
public Triggerable addTriggerable(Triggerable t){
  int existingIx=triggerables.indexOf(t);
  if (existingIx >= 0) {
    return (Triggerable)triggerables.elementAt(existingIx);
  }
 else {
    triggerables.addElement(t);
    Vector triggers=t.getTriggers();
    for (int i=0; i < triggers.size(); i++) {
      TreeReference trigger=(TreeReference)triggers.elementAt(i);
      if (!triggerIndex.containsKey(trigger)) {
        triggerIndex.put(trigger,new Vector());
      }
      Vector triggered=(Vector)triggerIndex.get(trigger);
      if (!triggered.contains(t)) {
        triggered.addElement(t);
      }
    }
    if (t instanceof Condition) {
      Vector targets=t.getTargets();
      for (int i=0; i < targets.size(); i++) {
        TreeReference target=(TreeReference)targets.elementAt(i);
        if (model.getTemplate(target) != null) {
          conditionRepeatTargetIndex.put(target,(Condition)t);
        }
      }
    }
    return t;
  }
}
Program: 145225
Project: 145225
Buggy source:
public Command getAcquireCommand(){
  return new Command(Locale.get("String_Node_Str"),Command.SCREEN,3);
  return new Command("String_Node_Str",Command.SCREEN,3);
}

Fixed version (ground truth):
public Command getAcquireCommand(){
  Command acquire;
  acquire=new Command(Locale.get("String_Node_Str"),Command.SCREEN,3);
  acquire=new Command("String_Node_Str",Command.SCREEN,3);
  return acquire;
}
Program: 145226
Project: 145226
Buggy source:
public void registerModule(Context context){
  ReminderRMSUtility reminderRms=new ReminderRMSUtility(ReminderRMSUtility.getUtilityName());
  JavaRosaServiceProvider.instance().getStorageManager().getRMSStorageProvider().registerRMSUtility(reminderRms);
  IDaemon newDaemon=new ReminderNotifierDaemon();
  JavaRosaServiceProvider.instance().registerDaemon(newDaemon,ReminderNotifierDaemon.DEFAULT_NAME);
  PropertyManager propManager=JavaRosaServiceProvider.instance().getPropertyManager();
  propManager.addRules(new ReminderPropertyRules());
  PropertyUtils.initializeProperty(ReminderPropertyRules.REMINDERS_ENABLED_PROPERTY,ReminderPropertyRules.REMINDERS_ENABLED);
  String enabled=propManager.getSingularProperty(ReminderPropertyRules.REMINDERS_ENABLED_PROPERTY);
  if (ReminderPropertyRules.REMINDERS_ENABLED.equals(enabled)) {
    newDaemon.start();
  }
}

Fixed version (ground truth):
public void registerModule(Context context){
  ReminderRMSUtility reminderRms=new ReminderRMSUtility(ReminderRMSUtility.getUtilityName());
  JavaRosaServiceProvider.instance().getStorageManager().getRMSStorageProvider().registerRMSUtility(reminderRms);
  IDaemon newDaemon=new ReminderNotifierDaemon();
  JavaRosaServiceProvider.instance().registerDaemon(newDaemon,ReminderNotifierDaemon.DEFAULT_NAME);
  IPropertyManager propManager=JavaRosaServiceProvider.instance().getPropertyManager();
  propManager.addRules(new ReminderPropertyRules());
  PropertyUtils.initializeProperty(ReminderPropertyRules.REMINDERS_ENABLED_PROPERTY,ReminderPropertyRules.REMINDERS_ENABLED);
  String enabled=propManager.getSingularProperty(ReminderPropertyRules.REMINDERS_ENABLED_PROPERTY);
  if (ReminderPropertyRules.REMINDERS_ENABLED.equals(enabled)) {
    newDaemon.start();
  }
}
Program: 145227
Project: 145227
Buggy source:
private void showError(String title,String message){
  Alert alert=new Alert(title,message,null,AlertType.ERROR);
  alert.setTimeout(Alert.FOREVER);
  Alert.setCurrent((Display)JavaRosaServiceProvider.instance().getDisplay().getDisplayObject(),alert,null);
}

Fixed version (ground truth):
private void showError(String title,String message){
  Alert alert=new Alert(title,message,null,AlertType.ERROR);
  alert.setTimeout(Alert.FOREVER);
  Alert.setCurrent((Display)JavaRosaServiceProvider.instance().getDisplay().getDisplayObject(),alert,this);
}
Program: 145228
Project: 145228
Buggy source:
public ChatterboxWidget generateHeader(){
  int mult=-1;
  if (this.activeStyle instanceof LabelWidget) {
    LabelWidget label=(LabelWidget)this.activeStyle;
    mult=label.getMultiplicity();
  }
  LabelWidget labelStyle=new LabelWidget(mult);
  ChatterboxWidget widget=new ChatterboxWidget(cbox,this.getBinding(),ChatterboxWidget.VIEW_LABEL,labelStyle,null);
  return widget;
}

Fixed version (ground truth):
public ChatterboxWidget generateHeader(){
  int mult=-1;
  if (this.activeStyle instanceof LabelWidget) {
    LabelWidget label=(LabelWidget)this.activeStyle;
    mult=label.getMultiplicity();
  }
  LabelWidget labelStyle=new LabelWidget(mult);
  ChatterboxWidget widget=new ChatterboxWidget(cbox,(FormElementBinding)this.getBinding().clone(),ChatterboxWidget.VIEW_LABEL,labelStyle,null);
  return widget;
}
Program: 145229
Project: 145229
Buggy source:
public Object clone(){
  if (this.getViewState() == ChatterboxWidget.VIEW_LABEL) {
    LabelWidget label=(LabelWidget)this.activeStyle;
    ChatterboxWidget widget=new ChatterboxWidget(cbox,binding,this.getViewState(),(LabelWidget)label.clone(),null);
    return widget;
  }
  return null;
}

Fixed version (ground truth):
public Object clone(){
  if (this.getViewState() == ChatterboxWidget.VIEW_LABEL) {
    LabelWidget label=(LabelWidget)this.activeStyle;
    FormElementBinding newBinding=(FormElementBinding)binding.clone();
    ChatterboxWidget widget=new ChatterboxWidget(cbox,newBinding,this.getViewState(),(LabelWidget)label.clone(),null);
    return widget;
  }
  return null;
}
Program: 145230
Project: 145230
Buggy source:
private void computeHeaders(){
  int threshold=this.contentY;
  if (this.topFrame != null && this.topFrame.size() != 0) {
    threshold+=this.topFrame.getContentHeight();
  }
  Vector headers=new Vector();
  for (int i=0; i < size(); i++) {
    ChatterboxWidget cw=getWidgetAtIndex(i);
    if (cw.getAbsoluteY() + cw.getContentHeight() > threshold) {
    }
    if (cw.isPinned()) {
      if (cw.getAbsoluteY() + cw.getPinnableHeight() < threshold) {
        StringItem item2=new StringItem("String_Node_Str","String_Node_Str");
        headers.addElement(cw.generateHeader());
      }
    }
  }
  Item[] newHeaders=new Item[headers.size()];
  headers.copyInto(newHeaders);
  if ((this.topFrame == null && headers.size() > 0) || (this.topFrame != null && !itemArraysEqual(newHeaders,this.topFrame.getItems()))) {
    if (topFrame != null) {
      this.topFrame.clear();
    }
    for (int i=0; i < newHeaders.length; ++i) {
      append(Graphics.TOP,newHeaders[i]);
    }
    if (newHeaders.length == 0) {
      this.calculateContentArea(0,0,this.getWidth(),this.getHeight());
    }
  }
}

Fixed version (ground truth):
private void computeHeaders(){
  int threshold=0;
  if (this.topFrame != null && this.topFrame.size() != 0) {
    threshold+=this.topFrame.getContentHeight();
  }
  Vector headers=new Vector();
  for (int i=0; i < size(); i++) {
    ChatterboxWidget cw=getWidgetAtIndex(i);
    if (cw.getAbsoluteY() + cw.getContentHeight() > threshold) {
    }
    if (cw.isPinned()) {
      if (cw.getAbsoluteY() + cw.getPinnableHeight() < threshold) {
        System.out.println("String_Node_Str" + cw.getAbsoluteY() + cw.getPinnableHeight()+ "String_Node_Str"+ threshold);
        StringItem item2=new StringItem("String_Node_Str","String_Node_Str");
        headers.addElement(cw.generateHeader());
      }
    }
  }
  Item[] newHeaders=new Item[headers.size()];
  headers.copyInto(newHeaders);
  if ((this.topFrame == null && headers.size() > 0) || (this.topFrame != null && !itemArraysEqual(newHeaders,this.topFrame.getItems()))) {
    if (topFrame != null) {
      this.topFrame.clear();
    }
    for (int i=0; i < newHeaders.length; ++i) {
      append(Graphics.TOP,newHeaders[i]);
    }
    if (newHeaders.length == 0) {
      this.calculateContentArea(0,0,this.getWidth(),this.getHeight());
    }
  }
}
Program: 145231
Project: 145231
Buggy source:
public AcquiringQuestionScreen getWidget(FormElementBinding prompt,char str){
  BarcodeQuestionWidget barcodeWidget=new BarcodeQuestionWidget(prompt,str);
  ;
  try {
    IBarcodeProcessingService barcodeProcessor=(IBarcodeProcessingService)JavaRosaServiceProvider.instance().getService("String_Node_Str");
    barcodeWidget.setBarcodeProcessor(barcodeProcessor);
    return barcodeWidget;
  }
 catch (  UnavailableServiceException se) {
    return null;
  }
}

Fixed version (ground truth):
public AcquiringQuestionScreen getWidget(FormElementBinding prompt,char str){
  BarcodeQuestionWidget barcodeWidget=new BarcodeQuestionWidget(prompt,str);
  try {
    IBarcodeProcessingService barcodeProcessor=(IBarcodeProcessingService)JavaRosaServiceProvider.instance().getService("String_Node_Str");
    barcodeWidget.setBarcodeProcessor(barcodeProcessor);
    return barcodeWidget;
  }
 catch (  UnavailableServiceException se) {
    return null;
  }
}
Program: 145232
Project: 145232
Buggy source:
private void unjar(String filename,String destDir){
  final int BUFFER=2048;
  if (destDir.charAt(destDir.length() - 1) != '/')   destDir+="String_Node_Str";
  try {
    BufferedOutputStream dest=null;
    BufferedInputStream is=null;
    JarEntry entry;
    JarFile jarfile=new JarFile(filename);
    Enumeration e=jarfile.entries();
    while (e.hasMoreElements()) {
      entry=(JarEntry)e.nextElement();
      if (entry.isDirectory()) {
        File d=new File(destDir + entry.getName());
        d.mkdirs();
        continue;
      }
      File f=new File(destDir + entry.getName());
      if (!f.exists()) {
        File f2=new File(f.getParent());
        f2.mkdirs();
        f.createNewFile();
      }
 else {
      }
      is=new BufferedInputStream(jarfile.getInputStream(entry));
      int count;
      byte data[]=new byte[BUFFER];
      FileOutputStream fos=new FileOutputStream(f);
      dest=new BufferedOutputStream(fos,BUFFER);
      while ((count=is.read(data,0,BUFFER)) != -1) {
        dest.write(data,0,count);
      }
      dest.flush();
      dest.close();
      is.close();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private boolean unjar(String filename,String destDir){
  final int BUFFER=2048;
  if (destDir.charAt(destDir.length() - 1) != '/')   destDir+="String_Node_Str";
  try {
    BufferedOutputStream dest=null;
    BufferedInputStream is=null;
    JarEntry entry;
    JarFile jarfile;
    try {
      jarfile=new JarFile(filename);
    }
 catch (    Exception e) {
      addToTextArea("String_Node_Str" + filename);
      return false;
    }
    Enumeration e=jarfile.entries();
    while (e.hasMoreElements()) {
      entry=(JarEntry)e.nextElement();
      if (entry.isDirectory()) {
        File d=new File(destDir + entry.getName());
        d.mkdirs();
        continue;
      }
      File f=new File(destDir + entry.getName());
      if (!f.exists()) {
        File f2=new File(f.getParent());
        f2.mkdirs();
        f.createNewFile();
      }
 else {
      }
      is=new BufferedInputStream(jarfile.getInputStream(entry));
      int count;
      byte data[]=new byte[BUFFER];
      FileOutputStream fos=new FileOutputStream(f);
      dest=new BufferedOutputStream(fos,BUFFER);
      while ((count=is.read(data,0,BUFFER)) != -1) {
        dest.write(data,0,count);
      }
      dest.flush();
      dest.close();
      is.close();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return true;
}
Program: 145233
Project: 145233
Buggy source:
public XFormValidatorGUI(){
  super();
  addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      dispose();
      System.exit(0);
    }
  }
);
  File f=new File("String_Node_Str");
  try {
    this.origJarDir=f.getCanonicalPath();
  }
 catch (  IOException e1) {
    e1.printStackTrace();
  }
  readProperties();
  this.setTitle("String_Node_Str");
  createGUI();
  this.pack();
  setVisible(true);
  Font orig=this.formName.getFont();
  Font bold=orig.deriveFont(orig.getStyle() ^ Font.BOLD);
  this.formName.setFont(bold);
  this.status.setFont(bold);
  Timer t=new Timer();
  t.schedule(new CheckOutput(),100,100);
  if (!checkParams()) {
    addToTextArea("String_Node_Str");
  }
 else {
    addToTextArea("String_Node_Str");
  }
}

Fixed version (ground truth):
public XFormValidatorGUI(){
  super();
  addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      dispose();
      System.exit(0);
    }
  }
);
  File f=new File("String_Node_Str");
  try {
    this.origJarDir=f.getCanonicalPath() + "String_Node_Str";
  }
 catch (  IOException e1) {
    e1.printStackTrace();
  }
  readProperties();
  this.setTitle("String_Node_Str");
  createGUI();
  this.pack();
  setVisible(true);
  Font orig=this.formName.getFont();
  Font bold=orig.deriveFont(orig.getStyle() ^ Font.BOLD);
  this.formName.setFont(bold);
  this.status.setFont(bold);
  Timer t=new Timer();
  t.schedule(new CheckOutput(),100,100);
  if (!checkParams()) {
    addToTextArea("String_Node_Str");
  }
 else {
    addToTextArea("String_Node_Str");
  }
}
Program: 145235
Project: 145235
Buggy source:
private void initGUI(){
  setUpCommands();
  initProgressBar();
  if (model.isReadOnly()) {
    while (!model.getQuestionIndex().isEndOfFormIndex()) {
      controller.stepQuestion(true);
    }
  }
 else   if (model.getStartIndex() != null) {
    while (!model.getQuestionIndex().equals(model.getStartIndex())) {
      controller.stepQuestion(true);
    }
  }
 else {
    controller.stepQuestion(true);
  }
}

Fixed version (ground truth):
private void initGUI(){
  setUpCommands();
  initProgressBar();
  if (model.isReadOnly()) {
    while (!model.getQuestionIndex().isEndOfFormIndex()) {
      controller.stepQuestion(true);
    }
  }
 else   if (model.getStartIndex() != null) {
    while (!model.getQuestionIndex().equals(model.getStartIndex())) {
      controller.stepQuestion(true);
    }
  }
 else {
    controller.stepQuestion(true);
  }
  this.currentlyActiveContainer=this.container;
}
Program: 145236
Project: 145236
Buggy source:
public AddUserActivity(IShell p){
  this.parent=p;
}

Fixed version (ground truth):
public AddUserActivity(IShell p){
  this.parent=p;
  success=false;
}
Program: 145238
Project: 145238
Buggy source:
public EditUserActivity(IShell p){
  this.parent=p;
}

Fixed version (ground truth):
public EditUserActivity(IShell p){
  this.parent=p;
  success=false;
}
Program: 145241
Project: 145241
Buggy source:
private void readProperties(){
  File f=new File(this.PROPERTIES_FILE);
  if (!f.exists()) {
    System.out.println("String_Node_Str");
    writeProperties();
    return;
  }
  Properties props=new java.util.Properties();
  try {
    FileInputStream fis=new FileInputStream(f);
    props.load(fis);
    fis.close();
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  this.wtkPath=props.getProperty(this.WTK_PATH);
  this.newForm=props.getProperty(this.NEW_FORM);
  this.origJarDir=props.getProperty(this.ORIGINAL_JAR_DIR);
  openXMLWith=props.getProperty(this.OPEN_XML_WITH);
  openAtEnd=new Boolean(props.getProperty(this.OPEN_AT_END));
}

Fixed version (ground truth):
private void readProperties(){
  File f=new File(this.PROPERTIES_FILE);
  if (!f.exists() && !noRecurse) {
    System.out.println("String_Node_Str");
    writeProperties();
    noRecurse=true;
    readProperties();
    return;
  }
  Properties props=new java.util.Properties();
  try {
    FileInputStream fis=new FileInputStream(f);
    props.load(fis);
    fis.close();
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  this.wtkPath=props.getProperty(this.WTK_PATH);
  this.newForm=props.getProperty(this.NEW_FORM);
  this.origJarDir=props.getProperty(this.ORIGINAL_JAR_DIR);
  openXMLWith=props.getProperty(this.OPEN_XML_WITH);
  openAtEnd=new Boolean(props.getProperty(this.OPEN_AT_END));
}
Program: 145242
Project: 145242
Buggy source:
public XFormValidatorGUI(){
  super();
  addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      dispose();
      System.exit(0);
    }
  }
);
  File f=new File("String_Node_Str");
  try {
    this.origJarDir=f.getCanonicalPath() + "String_Node_Str" + JAR_NAME;
  }
 catch (  IOException e1) {
    e1.printStackTrace();
  }
  readProperties();
  this.setTitle("String_Node_Str");
  createGUI();
  this.pack();
  setVisible(true);
  Font orig=this.formName.getFont();
  Font bold=orig.deriveFont(orig.getStyle() ^ Font.BOLD);
  this.formName.setFont(bold);
  this.status.setFont(bold);
  Timer t=new Timer();
  t.schedule(new CheckOutput(),100,100);
  if (!checkParams()) {
    addToTextArea("String_Node_Str");
  }
 else {
    addToTextArea("String_Node_Str");
  }
}

Fixed version (ground truth):
public XFormValidatorGUI(){
  super();
  addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      dispose();
      System.exit(0);
    }
  }
);
  File f=new File("String_Node_Str");
  try {
    this.origJarDir=f.getCanonicalPath();
  }
 catch (  IOException e1) {
    e1.printStackTrace();
  }
  readProperties();
  this.setTitle("String_Node_Str");
  createGUI();
  this.pack();
  setVisible(true);
  Font orig=this.formName.getFont();
  Font bold=orig.deriveFont(orig.getStyle() ^ Font.BOLD);
  this.formName.setFont(bold);
  this.status.setFont(bold);
  Timer t=new Timer();
  t.schedule(new CheckOutput(),100,100);
  if (!checkParams()) {
    addToTextArea("String_Node_Str");
  }
 else {
    addToTextArea("String_Node_Str");
  }
}
Program: 145243
Project: 145243
Buggy source:
public GetURLForm(ITransportDestination preload){
  super("String_Node_Str");
  textField=new TextField("String_Node_Str",((HttpTransportDestination)preload).getURL(),140,TextField.ANY);
  append(textField);
  addCommand(CMD_OK);
  addCommand(CMD_BACK);
}

Fixed version (ground truth):
public GetURLForm(ITransportDestination preload){
  super("String_Node_Str");
  String prefill="String_Node_Str";
  HttpTransportDestination def=((HttpTransportDestination)preload);
  if (def != null) {
    prefill=def.getURL();
  }
  textField=new TextField("String_Node_Str",prefill,140,TextField.ANY);
  append(textField);
  addCommand(CMD_OK);
  addCommand(CMD_BACK);
}
Program: 145244
Project: 145244
Buggy source:
public int getRelativeScrollYOffset(){
  if (!this.enableScrolling && this.parent instanceof Container) {
    return ((Container)this.parent).getScrollYOffset() + this.relativeY + this.parent.relativeY;
  }
  int offset=this.targetYOffset;
  if (!this.scrollSmooth) {
    offset=this.yOffset;
  }
  return offset;
}

Fixed version (ground truth):
public int getRelativeScrollYOffset(){
  if (!this.enableScrolling && this.parent instanceof Container) {
    Item walker=this.parent;
    int offset=0;
    while (walker instanceof Container) {
      offset+=walker.relativeY;
      walker=walker.getParent();
    }
    return ((Container)this.parent).getScrollYOffset() + this.relativeY + offset;
  }
  int offset=this.targetYOffset;
  if (!this.scrollSmooth) {
    offset=this.yOffset;
  }
  return offset;
}
Program: 145245
Project: 145245
Buggy source:
protected Item getEntryWidget(QuestionDef question){
  this.question=question;
  ChoiceGroup cg=new ChoiceGroup("String_Node_Str",style){
    public int getRelativeScrollYOffset(){
      if (!this.enableScrolling && this.parent instanceof Container) {
        return ((Container)this.parent).getScrollYOffset() + this.relativeY + this.parent.relativeY;
      }
      int offset=this.targetYOffset;
      if (!this.scrollSmooth) {
        offset=this.yOffset;
      }
      return offset;
    }
  }
;
  for (int i=0; i < question.getSelectItems().size(); i++)   cg.append("String_Node_Str",null);
  this.choicegroup=cg;
  return cg;
}

Fixed version (ground truth):
protected Item getEntryWidget(QuestionDef question){
  this.question=question;
  ChoiceGroup cg=new ChoiceGroup("String_Node_Str",style){
    public int getRelativeScrollYOffset(){
      if (!this.enableScrolling && this.parent instanceof Container) {
        Item walker=this.parent;
        int offset=0;
        while (walker instanceof Container) {
          offset+=walker.relativeY;
          walker=walker.getParent();
        }
        return ((Container)this.parent).getScrollYOffset() + this.relativeY + offset;
      }
      int offset=this.targetYOffset;
      if (!this.scrollSmooth) {
        offset=this.yOffset;
      }
      return offset;
    }
  }
;
  for (int i=0; i < question.getSelectItems().size(); i++)   cg.append("String_Node_Str",null);
  this.choicegroup=cg;
  return cg;
}
Program: 145247
Project: 145247
Buggy source:
/** 
 * Get the default root directory
 * @return
 */
public String getDefaultRoot() throws FileException {
  Enumeration root=getRootNames();
  String rootName="String_Node_Str";
  while (root.hasMoreElements()) {
    rootName=(String)root.nextElement();
  }
  return rootName;
}

Fixed version (ground truth):
/** 
 * Get the default root directory
 * @return
 */
public String getDefaultRoot() throws FileException {
  Vector v=new Vector();
  addArrtoVec(v,getRootNames());
  Enumeration root=v.elements();
  String rootName="String_Node_Str";
  while (root.hasMoreElements()) {
    rootName=(String)root.nextElement();
  }
  return rootName;
}
Program: 145248
Project: 145248
Buggy source:
/** 
 * Create a file 
 * @param fullName
 * @param data
 * @return whether the file was created
 */
public boolean createFile(String fullName,byte[] data) throws FileException {
  OutputStream fos=null;
  FileConnection file=null;
  boolean isSaved=false;
  try {
    file=(FileConnection)Connector.open(fullName);
    if (!file.exists()) {
      file.create();
    }
    fos=file.openOutputStream();
    fos.write(data);
  }
 catch (  IOException ex) {
    throw new FileException("String_Node_Str");
    return false;
  }
 finally {
    close(fos);
    close(file);
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Create a file 
 * @param fullName
 * @param data
 * @return whether the file was created
 */
public boolean createFile(String fullName,byte[] data) throws FileException {
  OutputStream fos=null;
  FileConnection file=null;
  boolean isSaved=false;
  try {
    file=(FileConnection)Connector.open(fullName);
    if (!file.exists()) {
      file.create();
    }
    fos=file.openOutputStream();
    fos.write(data);
    isSaved=true;
  }
 catch (  IOException ex) {
    isSaved=false;
    throw new FileException("String_Node_Str");
  }
 finally {
    close(fos);
    close(file);
  }
  return isSaved;
}
Program: 145249
Project: 145249
Buggy source:
/** 
 * Gets the directory with the most recent changes below the one passed in. This call is recursive
 * @param directory
 * @return
 */
public String getMostRecentlyModifiedDirectoryBelow(String directory){
  if (!directory.endsWith("String_Node_Str")) {
    directory=directory + "String_Node_Str";
  }
  String toReturn=directory;
  try {
    Date latestFoundDate=getModifiedDate(directory);
    Enumeration filesBelow=listDirectory(directory);
    while (filesBelow.hasMoreElements()) {
      FileConnection subFile=null;
      String subFileName=(String)filesBelow.nextElement();
      try {
        String fullPathConstructed=directory + subFileName;
        subFile=(FileConnection)Connector.open(fullPathConstructed);
        if (subFile.isDirectory()) {
          Date subFileDate=getModifiedDateRecursive(fullPathConstructed);
          if (subFileDate.getTime() > latestFoundDate.getTime()) {
            latestFoundDate=subFileDate;
            toReturn=fullPathConstructed;
          }
        }
      }
  finally {
        close(subFile);
      }
    }
    if (toReturn != directory) {
      return getMostRecentlyModifiedDirectoryBelow(toReturn);
    }
  }
 catch (  IOException e) {
    handleException(e);
    toReturn=null;
  }
  return toReturn;
}

Fixed version (ground truth):
/** 
 * Gets the directory with the most recent changes below the one passed in. This call is recursive
 * @param directory
 * @return
 */
public String getMostRecentlyModifiedDirectoryBelow(String directory){
  if (!directory.endsWith("String_Node_Str")) {
    directory=directory + "String_Node_Str";
  }
  String toReturn=directory;
  try {
    Date latestFoundDate=getModifiedDate(directory);
    Vector v=new Vector();
    addArrtoVec(v,listDirectory(directory));
    Enumeration filesBelow=v.elements();
    while (filesBelow.hasMoreElements()) {
      FileConnection subFile=null;
      String subFileName=(String)filesBelow.nextElement();
      try {
        String fullPathConstructed=directory + subFileName;
        subFile=(FileConnection)Connector.open(fullPathConstructed);
        if (subFile.isDirectory()) {
          Date subFileDate=getModifiedDateRecursive(fullPathConstructed);
          if (subFileDate.getTime() > latestFoundDate.getTime()) {
            latestFoundDate=subFileDate;
            toReturn=fullPathConstructed;
          }
        }
      }
  finally {
        close(subFile);
      }
    }
    if (toReturn != directory) {
      return getMostRecentlyModifiedDirectoryBelow(toReturn);
    }
  }
 catch (  IOException e) {
    handleException(e);
    toReturn=null;
  }
catch (  FileException fe) {
  }
  return toReturn;
}
Program: 145250
Project: 145250
Buggy source:
private static String[] enumtoStringArr(Enumeration enumer){
}

Fixed version (ground truth):
private static String[] enumtoStringArr(Enumeration enumer){
  Vector enumerationList=new Vector();
  Enumeration e=enumer;
  while (e.hasMoreElements())   enumerationList.addElement((String)e.nextElement());
  return vectorToStringArr(enumerationList);
}
Program: 145251
Project: 145251
Buggy source:
public InputStream getFileDataStream(String fileName) throws FileException {
  InputStream fis=null;
  FileConnection file=null;
  try {
    file=(FileConnection)Connector.open(fileName);
    fis=file.openInputStream();
    return fis;
  }
 catch (  Exception ex) {
    handleException(ex);
    throw new FileException("String_Node_Str");
  }
 finally {
    close(file);
  }
  return null;
}

Fixed version (ground truth):
public InputStream getFileDataStream(String fileName) throws FileException {
  InputStream fis=null;
  FileConnection file=null;
  try {
    file=(FileConnection)Connector.open(fileName);
    fis=file.openInputStream();
  }
 catch (  Exception ex) {
    handleException(ex);
    throw new FileException("String_Node_Str");
  }
 finally {
    close(file);
  }
  return fis;
}
Program: 145252
Project: 145252
Buggy source:
public String[] listDirectory(String directoryPath) throws FileException {
  FileConnection dir=null;
  System.out.println("String_Node_Str" + directoryPath);
  try {
    dir=(FileConnection)Connector.open(directoryPath);
    return enumtoStringArr(dir.list());
  }
 catch (  IOException ioe) {
    throw new FileException("String_Node_Str" + directoryPath + "String_Node_Str");
  }
catch (  Exception ex) {
    handleException(ex);
  }
 finally {
    close(dir);
  }
}

Fixed version (ground truth):
public String[] listDirectory(String directoryPath) throws FileException {
  FileConnection dir=null;
  System.out.println("String_Node_Str" + directoryPath);
  try {
    dir=(FileConnection)Connector.open(directoryPath);
  }
 catch (  IOException ioe) {
    throw new FileException("String_Node_Str" + directoryPath + "String_Node_Str");
  }
catch (  Exception ex) {
    handleException(ex);
  }
 finally {
    close(dir);
  }
  if (dir != null) {
    try {
      return enumtoStringArr(dir.list());
    }
 catch (    IOException ioe) {
      throw new FileException("String_Node_Str");
    }
  }
  return null;
}
Program: 145253
Project: 145253
Buggy source:
/** 
 * Create a directory from the path
 * @param path
 * @return true if the operation succeeded or the directory already existed
 */
public boolean createDirectory(String path) throws FileException {
  FileConnection directory=null;
  try {
    directory=(FileConnection)Connector.open(path);
    if (!directory.exists())     directory.mkdir();
  }
 catch (  IOException ex) {
    throw new FileException("String_Node_Str");
    return false;
  }
 finally {
    close(directory);
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Create a directory from the path
 * @param path
 * @return true if the operation succeeded or the directory already existed
 */
public boolean createDirectory(String path) throws FileException {
  FileConnection directory=null;
  boolean dirCreated=false;
  try {
    directory=(FileConnection)Connector.open(path);
    if (!directory.exists()) {
      directory.mkdir();
      dirCreated=true;
    }
  }
 catch (  IOException ex) {
    dirCreated=false;
    throw new FileException("String_Node_Str");
  }
 finally {
    close(directory);
  }
  return dirCreated=false;
}
Program: 145254
Project: 145254
Buggy source:
public boolean deleteDirectory(String path) throws FileException {
  FileConnection directory=null;
  try {
    directory=(FileConnection)Connector.open(path);
    if (!directory.exists())     directory.rmdir();
  }
 catch (  IOException ex) {
    throw new FileException("String_Node_Str");
    return false;
  }
 finally {
    close(directory);
  }
  return true;
}

Fixed version (ground truth):
public boolean deleteDirectory(String path) throws FileException {
  FileConnection directory=null;
  boolean dirDeleted=false;
  try {
    directory=(FileConnection)Connector.open(path);
    if (directory.exists() && directory.isDirectory()) {
      directory.delete();
      dirDeleted=true;
    }
  }
 catch (  IOException ex) {
    dirDeleted=false;
    throw new FileException("String_Node_Str");
  }
 finally {
    close(directory);
  }
  return dirDeleted;
}
Program: 145255
Project: 145255
Buggy source:
private Date getModifiedDateRecursive(String fileName) throws FileException {
  FileConnection file=null;
  System.out.println("String_Node_Str" + fileName);
  if (!fileName.endsWith("String_Node_Str")) {
    fileName+="String_Node_Str";
  }
  try {
    file=(FileConnection)Connector.open(fileName);
    Date toReturn=new Date(file.lastModified());
    if (file.isDirectory()) {
      Enumeration filesBelow=listDirectory(fileName);
      while (filesBelow.hasMoreElements()) {
        String subFileName=(String)filesBelow.nextElement();
        String fullPathConstructed=fileName + subFileName;
        System.out.println("String_Node_Str" + fullPathConstructed);
        Date thisFileDate=getModifiedDateRecursive(fullPathConstructed);
        if (thisFileDate.getTime() > toReturn.getTime()) {
          toReturn=thisFileDate;
        }
      }
    }
 else {
    }
    return toReturn;
  }
 catch (  IOException ie) {
    throw new FileException("String_Node_Str");
  }
 finally {
    close(file);
  }
}

Fixed version (ground truth):
private Date getModifiedDateRecursive(String fileName) throws FileException {
  FileConnection file=null;
  System.out.println("String_Node_Str" + fileName);
  if (!fileName.endsWith("String_Node_Str")) {
    fileName+="String_Node_Str";
  }
  try {
    file=(FileConnection)Connector.open(fileName);
    Date toReturn=new Date(file.lastModified());
    if (file.isDirectory()) {
      Vector v=new Vector();
      addArrtoVec(v,listDirectory(fileName));
      Enumeration filesBelow=v.elements();
      while (filesBelow.hasMoreElements()) {
        String subFileName=(String)filesBelow.nextElement();
        String fullPathConstructed=fileName + subFileName;
        System.out.println("String_Node_Str" + fullPathConstructed);
        Date thisFileDate=getModifiedDateRecursive(fullPathConstructed);
        if (thisFileDate.getTime() > toReturn.getTime()) {
          toReturn=thisFileDate;
        }
      }
    }
 else {
    }
    return toReturn;
  }
 catch (  IOException ie) {
    throw new FileException("String_Node_Str");
  }
 finally {
    close(file);
  }
}
Program: 145256
Project: 145256
Buggy source:
public void registerService(IService service){
  services.put(service,service.getName());
}

Fixed version (ground truth):
public void registerService(IService service){
  services.put(service.getName(),service);
}
Program: 145258
Project: 145258
Buggy source:
public void run(){
  try {
    IDataPayload payload=message.getPayloadData();
    HttpHeaderAppendingVisitor visitor=new HttpHeaderAppendingVisitor();
    IDataPayload httpload=(IDataPayload)payload.accept(visitor);
    HttpTransportDestination destination=(HttpTransportDestination)message.getDestination();
    reliableHttpPost(destination.getURL(),MD5,visitor.getOverallContentType(),httpload);
    message.setStatus(TransportMessage.STATUS_DELIVERED);
    System.out.println("String_Node_Str" + message.getStatus());
    message.setChanged();
    message.notifyObservers(message.getReplyloadData());
  }
 catch (  ClassCastException e) {
    Alert alert=new Alert("String_Node_Str",e.getMessage(),null,AlertType.ERROR);
    throw new IllegalArgumentException(message.getDestination() + "String_Node_Str");
  }
catch (  IOException e) {
    Alert alert=new Alert("String_Node_Str",e.getMessage(),null,AlertType.ERROR);
    System.out.println(e.getMessage());
  }
catch (  OtherIOException e) {
    Alert alert=new Alert("String_Node_Str",e.getMessage(),null,AlertType.ERROR);
    System.out.println(e.getMessage());
  }
catch (  java.lang.SecurityException se) {
    Alert alert=new Alert("String_Node_Str",se.getMessage(),null,AlertType.ERROR);
    message.setStatus(TransportMessage.STATUS_FAILED);
    System.out.println("String_Node_Str" + message.getStatus());
    message.setChanged();
    message.notifyObservers(null);
  }
 finally {
    cleanUp(in);
    cleanUp(out);
    cleanUp(con);
  }
}

Fixed version (ground truth):
public void run(){
  try {
    IDataPayload payload=message.getPayloadData();
    HttpHeaderAppendingVisitor visitor=new HttpHeaderAppendingVisitor();
    IDataPayload httpload=(IDataPayload)payload.accept(visitor);
    HttpTransportDestination destination=(HttpTransportDestination)message.getDestination();
    reliableHttpPost(destination.getURL(),MD5,visitor.getOverallContentType(),httpload);
    message.setStatus(TransportMessage.STATUS_DELIVERED);
    System.out.println("String_Node_Str" + message.getStatus());
    message.setChanged();
    message.notifyObservers(message.getReplyloadData());
  }
 catch (  ClassCastException e) {
    Alert alert=new Alert("String_Node_Str",e.getMessage(),null,AlertType.ERROR);
    throw new IllegalArgumentException(message.getDestination() + "String_Node_Str");
  }
catch (  IOException e) {
    Alert alert=new Alert("String_Node_Str",e.getMessage(),null,AlertType.ERROR);
    System.out.println("String_Node_Str" + e.getMessage());
    e.printStackTrace();
  }
catch (  OtherIOException e) {
    Alert alert=new Alert("String_Node_Str",e.getMessage(),null,AlertType.ERROR);
    System.out.println("String_Node_Str" + e.getMessage());
    e.printStackTrace();
  }
catch (  java.lang.SecurityException se) {
    Alert alert=new Alert("String_Node_Str",se.getMessage(),null,AlertType.ERROR);
    message.setStatus(TransportMessage.STATUS_FAILED);
    System.out.println("String_Node_Str" + message.getStatus());
    message.setChanged();
    message.notifyObservers(null);
  }
 finally {
    cleanUp(in);
    cleanUp(out);
    cleanUp(con);
  }
}
Program: 145259
Project: 145259
Buggy source:
private int reliableRequestLastByte(String url,int MD5) throws IOException {
  int numTries=0;
  int r=-1;
  while (numTries < MAX_NUM_RETRIES) {
    numTries++;
    try {
      HttpConnection con=(HttpConnection)Connector.open(url);
      con.setRequestMethod(HttpConnection.HEAD);
      setDefaultRequestProperties(con);
      con.setRequestProperty("String_Node_Str",String.valueOf(MD5));
      OutputStream out=con.openOutputStream();
      out.flush();
      out.close();
      r=readLastByteReceived(con);
    }
 catch (    IOException e) {
      cleanUp(out);
      cleanUp(con);
      continue;
    }
    break;
  }
  if (numTries >= MAX_NUM_RETRIES) {
    throw new IOException();
  }
  cleanUp(con);
  return r;
}

Fixed version (ground truth):
private int reliableRequestLastByte(String url,int MD5) throws IOException {
  int numTries=0;
  int r=-1;
  while (numTries < MAX_NUM_RETRIES) {
    numTries++;
    try {
      HttpConnection con=(HttpConnection)Connector.open(url);
      con.setRequestMethod(HttpConnection.HEAD);
      setDefaultRequestProperties(con);
      con.setRequestProperty("String_Node_Str",String.valueOf(MD5));
      OutputStream out=con.openOutputStream();
      out.flush();
      out.close();
      r=readLastByteReceived(con);
    }
 catch (    IOException e) {
      cleanUp(out);
      cleanUp(con);
      try {
        Thread.sleep(5000);
      }
 catch (      InterruptedException e2) {
      }
      continue;
    }
    break;
  }
  if (numTries >= MAX_NUM_RETRIES) {
    throw new IOException("String_Node_Str");
  }
  cleanUp(con);
  return r;
}
Program: 145260
Project: 145260
Buggy source:
public void stopPlaying() throws MediaException {
  playP.stop();
  System.err.println("String_Node_Str");
  form.removeCommand(stopCommand);
  form.addCommand(playCommand);
  form.addCommand(recordCommand);
}

Fixed version (ground truth):
public void stopPlaying() throws MediaException {
  playP.stop();
  System.err.println("String_Node_Str");
  messageItem.setText("String_Node_Str");
  form.removeCommand(stopCommand);
  form.addCommand(playCommand);
  form.addCommand(recordCommand);
  form.addCommand(saveCommand);
}
Program: 145261
Project: 145261
Buggy source:
public void stopCapturing() throws MediaException, IOException {
  System.err.println("String_Node_Str");
  recordControl.commit();
  form.removeCommand(stopCommand);
  form.addCommand(recordCommand);
  form.addCommand(finishCommand);
  form.addCommand(saveCommand);
  messageItem.setText("String_Node_Str");
  recordP.stop();
}

Fixed version (ground truth):
public void stopCapturing() throws MediaException, IOException {
  System.err.println("String_Node_Str");
  recordControl.commit();
  form.removeCommand(stopCommand);
  form.addCommand(recordCommand);
  form.addCommand(finishCommand);
  form.addCommand(saveCommand);
  messageItem.setText("String_Node_Str");
  recordP.stop();
  messageItem.setText("String_Node_Str");
}
Program: 145262
Project: 145262
Buggy source:
public AudioCaptureActivity(IShell shell){
  parentShell=shell;
  display=JavaRosaServiceProvider.instance().getDisplay();
  ++counter;
}

Fixed version (ground truth):
public AudioCaptureActivity(IShell shell){
  parentShell=shell;
  display=JavaRosaServiceProvider.instance().getDisplay();
}
Program: 145263
Project: 145263
Buggy source:
public FileDataPointer getRecordedAudio(){
  recordFile=new FileDataPointer(fullName);
  return recordFile;
}

Fixed version (ground truth):
public FileDataPointer getRecordedAudio(){
  if (recordFile == null)   recordFile=new FileDataPointer(fullName);
  return recordFile;
}
Program: 145264
Project: 145264
Buggy source:
private String saveFile(String filename,byte[] sound){
  String rootName=FileUtility.getDefaultRoot();
  String restorepath="String_Node_Str" + rootName + "String_Node_Str";
  FileUtility.createDirectory(restorepath);
  String fullName=restorepath + "String_Node_Str" + filename;
  if (FileUtility.createFile(fullName,sound)) {
    System.out.println("String_Node_Str" + fullName);
    return fullName;
  }
 else {
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
private String saveFile(String filename,byte[] sound){
  try {
    if (recordP.getState() == Player.STARTED && recordP.getState() != Player.CLOSED) {
      stopCapturing();
      recordControl.reset();
    }
  }
 catch (  MediaException me) {
    System.err.println("String_Node_Str");
  }
catch (  IOException ioe) {
    System.err.println("String_Node_Str");
  }
  String rootName=FileUtility.getDefaultRoot();
  String restorepath="String_Node_Str" + rootName + "String_Node_Str";
  FileUtility.createDirectory(restorepath);
  String fullName=restorepath + "String_Node_Str" + filename;
  if (FileUtility.createFile(fullName,sound)) {
    System.out.println("String_Node_Str" + fullName);
    messageItem.setText("String_Node_Str" + fullName);
    recordFile=new FileDataPointer(fullName);
    ++counter;
    return fullName;
  }
 else {
    return "String_Node_Str";
  }
}
Program: 145265
Project: 145265
Buggy source:
public void playAudio() throws MediaException, IOException {
  System.err.println("String_Node_Str");
  ByteArrayInputStream recordedInputStream=new ByteArrayInputStream(audioDataStream.toByteArray());
  checkStreamSize(audioDataStream);
  playP=Manager.createPlayer(recordedInputStream,"String_Node_Str");
  playP.prefetch();
  playP.start();
  System.err.println("String_Node_Str");
  form.removeCommand(saveCommand);
  form.removeCommand(playCommand);
  form.removeCommand(recordCommand);
  form.addCommand(stopCommand);
}

Fixed version (ground truth):
public void playAudio() throws MediaException, IOException {
  System.err.println("String_Node_Str");
  ByteArrayInputStream recordedInputStream=new ByteArrayInputStream(audioDataStream.toByteArray());
  checkStreamSize(audioDataStream);
  playP=Manager.createPlayer(recordedInputStream,"String_Node_Str");
  messageItem.setText("String_Node_Str");
  playP.prefetch();
  playP.start();
  System.err.println("String_Node_Str");
  messageItem.setText("String_Node_Str");
  form.removeCommand(saveCommand);
  form.removeCommand(playCommand);
  form.removeCommand(recordCommand);
  form.addCommand(stopCommand);
}