nus-yam/ex-repair huggingface dataset:
Program: 145173
Project: 145173
Buggy source:
public Detail parse() throws InvalidStructureException, IOException, XmlPullParserException {
  checkNode("String_Node_Str");
  String id=parser.getAttributeValue(null,"String_Node_Str");
  getNextTagInBlock("String_Node_Str");
  checkNode("String_Node_Str");
  getNextTagInBlock("String_Node_Str");
  Text title=new TextParser(parser).parse();
  getNextTagInBlock("String_Node_Str");
  Filter filter=Filter.EmptyFilter();
  if (parser.getName().toLowerCase().equals("String_Node_Str")) {
    filter=new FilterParser(parser).parse();
    getNextTagInBlock("String_Node_Str");
  }
  FormInstance model=parseModel();
  Vector<Text> headers=new Vector<Text>();
  ;
  Vector<Text> templates=new Vector<Text>();
  while (nextTagInBlock("String_Node_Str")) {
    checkNode("String_Node_Str");
    if (nextTagInBlock("String_Node_Str")) {
      checkNode("String_Node_Str");
      parser.nextTag();
      checkNode("String_Node_Str");
      Text header=new TextParser(parser).parse();
      headers.addElement(header);
    }
    if (nextTagInBlock("String_Node_Str")) {
      checkNode("String_Node_Str");
      parser.nextTag();
      checkNode("String_Node_Str");
      Text template=new TextParser(parser).parse();
      templates.addElement(template);
    }
  }
  Detail d=new Detail(id,title,model,headers,templates,filter);
  return d;
}

Fixed version (ground truth):
public Detail parse() throws InvalidStructureException, IOException, XmlPullParserException {
  checkNode("String_Node_Str");
  String id=parser.getAttributeValue(null,"String_Node_Str");
  getNextTagInBlock("String_Node_Str");
  checkNode("String_Node_Str");
  getNextTagInBlock("String_Node_Str");
  Text title=new TextParser(parser).parse();
  getNextTagInBlock("String_Node_Str");
  Filter filter=Filter.EmptyFilter();
  if (parser.getName().toLowerCase().equals("String_Node_Str")) {
    filter=new FilterParser(parser).parse();
    getNextTagInBlock("String_Node_Str");
  }
  FormInstance model=parseModel();
  Vector<Text> headers=new Vector<Text>();
  Vector<Text> templates=new Vector<Text>();
  Vector<Integer> headerHints=new Vector<Integer>();
  Vector<Integer> templateHints=new Vector<Integer>();
  while (nextTagInBlock("String_Node_Str")) {
    checkNode("String_Node_Str");
    if (nextTagInBlock("String_Node_Str")) {
      checkNode("String_Node_Str");
      headerHints.addElement(new Integer(getWidth()));
      parser.nextTag();
      checkNode("String_Node_Str");
      Text header=new TextParser(parser).parse();
      headers.addElement(header);
    }
    if (nextTagInBlock("String_Node_Str")) {
      checkNode("String_Node_Str");
      templateHints.addElement(new Integer(getWidth()));
      parser.nextTag();
      checkNode("String_Node_Str");
      Text template=new TextParser(parser).parse();
      templates.addElement(template);
    }
  }
  Detail d=new Detail(id,title,model,headers,templates,filter,toArray(headerHints),toArray(templateHints));
  return d;
}
Program: 145174
Project: 145174
Buggy source:
public void configureApp(MIDlet m){
  failsafeInit(m);
  Logger.log("String_Node_Str","String_Node_Str");
  this.midlet=m;
  J2MEDisplay.init(m);
  loadModules();
  setProperties();
  registerAddtlStorage();
  StorageManager.repairAll();
  manager=new CommCareManager();
  manager.init(CommCareUtil.getProfileReference());
  UserUtility.populateAdminUser();
  inDemoMode=false;
  purgeScheduler();
  manager.initialize();
  LanguageUtils.initializeLanguage(true,"String_Node_Str");
}

Fixed version (ground truth):
public void configureApp(MIDlet m){
  failsafeInit(m);
  Logger.log("String_Node_Str","String_Node_Str");
  this.midlet=m;
  J2MEDisplay.init(m);
  loadModules();
  setProperties();
  registerAddtlStorage();
  StorageManager.repairAll();
  manager=new CommCareManager();
  manager.init(CommCareUtil.getProfileReference());
  UserUtility.populateAdminUser();
  inDemoMode=false;
  purgeScheduler();
  Localization.setLocale("String_Node_Str");
  manager.initialize();
  LanguageUtils.initializeLanguage(true,"String_Node_Str");
}
Program: 145175
Project: 145175
Buggy source:
public CommCareHomeScreen(CommCareHomeController controller,Vector<Suite> suites,boolean adminMode,boolean reviewEnabled){
  super("String_Node_Str",List.IMPLICIT);
  this.controller=controller;
  Enumeration en=suites.elements();
  while (en.hasMoreElements()) {
    Suite suite=(Suite)en.nextElement();
    for (    Menu m : suite.getMenus()) {
      if ("String_Node_Str".equals(m.getId())) {
        for (        String id : m.getCommandIds()) {
          Entry e=suite.getEntries().get(id);
          int location=append(e.getText().evaluate(),null);
          suiteTable.put(new Integer(location),suite);
          entryTable.put(new Integer(location),e);
        }
      }
 else       if (m.getRoot().equals("String_Node_Str")) {
        int location=append(m.getName().evaluate(),null);
        suiteTable.put(new Integer(location),suite);
        menuTable.put(new Integer(location),m);
      }
    }
  }
  if (reviewEnabled) {
    append(reviewRecent);
  }
  append(sendAllUnsent);
  setSendUnsent();
  setCommandListener(controller);
  setSelectCommand(select);
  addCommand(exit);
  if (adminMode) {
    addCommand(admSettings);
    addCommand(admNewUser);
    addCommand(admEditUsers);
    addCommand(admBackupRestore);
    addCommand(admResetDemo);
    addCommand(admUpgrade);
  }
}

Fixed version (ground truth):
public CommCareHomeScreen(CommCareHomeController controller,Vector<Suite> suites,boolean adminMode,boolean reviewEnabled){
  super("String_Node_Str",List.IMPLICIT);
  this.controller=controller;
  Enumeration en=suites.elements();
  while (en.hasMoreElements()) {
    Suite suite=(Suite)en.nextElement();
    for (    Menu m : suite.getMenus()) {
      if ("String_Node_Str".equals(m.getId())) {
        for (        String id : m.getCommandIds()) {
          Entry e=suite.getEntries().get(id);
          int location=append(e.getText().evaluate(),null);
          suiteTable.put(new Integer(location),suite);
          entryTable.put(new Integer(location),e);
        }
      }
 else       if (m.getRoot().equals("String_Node_Str")) {
        int location=append(m.getName().evaluate(),null);
        suiteTable.put(new Integer(location),suite);
        menuTable.put(new Integer(location),m);
      }
    }
  }
  if (reviewEnabled) {
    reviewRecent=new ChoiceItem(Localization.get("String_Node_Str"),null,List.IMPLICIT);
    append(reviewRecent);
  }
  append(sendAllUnsent);
  setSendUnsent();
  setCommandListener(controller);
  setSelectCommand(select);
  addCommand(exit);
  if (adminMode) {
    addCommand(admSettings);
    addCommand(admNewUser);
    addCommand(admEditUsers);
    addCommand(admBackupRestore);
    addCommand(admResetDemo);
    addCommand(admUpgrade);
  }
}
Program: 145176
Project: 145176
Buggy source:
public void populateDynamicChoices(ItemsetBinding itemset,TreeElement questionElement){
  Vector<SelectChoice> choices=new Vector<SelectChoice>();
  TreeReference contextRef=questionElement.getParent().getRef();
  Vector<TreeReference> matches=itemset.nodesetExpr.evalNodeset(this.getInstance(),new EvaluationContext(exprEvalContext,contextRef));
  for (int i=0; i < matches.size(); i++) {
    TreeReference item=matches.elementAt(i);
    String label=itemset.labelExpr.evalReadable(this.getInstance(),new EvaluationContext(exprEvalContext,item));
    String value=null;
    TreeElement copyNode=null;
    if (itemset.copyMode) {
      copyNode=this.getInstance().resolveReference(itemset.copyRef.contextualize(item));
    }
 else {
      value=itemset.valueExpr.evalReadable(this.getInstance(),new EvaluationContext(exprEvalContext,item));
    }
    SelectChoice choice=new SelectChoice(label,value != null ? value : "String_Node_Str" + i,itemset.labelIsItext);
    choice.setIndex(i);
    if (itemset.copyMode)     choice.copyNode=copyNode;
    choices.addElement(choice);
  }
  itemset.setChoices(choices,this.getLocalizer());
}

Fixed version (ground truth):
public void populateDynamicChoices(ItemsetBinding itemset){
  Vector<SelectChoice> choices=new Vector<SelectChoice>();
  Vector<TreeReference> matches=itemset.nodesetExpr.evalNodeset(this.getInstance(),new EvaluationContext(exprEvalContext,itemset.contextRef));
  for (int i=0; i < matches.size(); i++) {
    TreeReference item=matches.elementAt(i);
    String label=itemset.labelExpr.evalReadable(this.getInstance(),new EvaluationContext(exprEvalContext,item));
    String value=null;
    TreeElement copyNode=null;
    if (itemset.copyMode) {
      copyNode=this.getInstance().resolveReference(itemset.copyRef.contextualize(item));
    }
 else {
      value=itemset.valueExpr.evalReadable(this.getInstance(),new EvaluationContext(exprEvalContext,item));
    }
    SelectChoice choice=new SelectChoice(label,value != null ? value : "String_Node_Str" + i,itemset.labelIsItext);
    choice.setIndex(i);
    if (itemset.copyMode)     choice.copyNode=copyNode;
    choices.addElement(choice);
  }
  if (choices.size() == 0) {
    throw new RuntimeException("String_Node_Str" + itemset.nodesetRef + "String_Node_Str");
  }
  itemset.setChoices(choices,this.getLocalizer());
}
Program: 145177
Project: 145177
Buggy source:
public void writeExternal(DataOutputStream out) throws IOException {
  ExtUtil.write(out,nodesetRef);
  ExtUtil.write(out,new ExtWrapTagged(nodesetExpr));
  ExtUtil.write(out,labelRef);
  ExtUtil.write(out,new ExtWrapTagged(labelExpr));
  ExtUtil.write(out,new ExtWrapNullable(valueRef));
  ExtUtil.write(out,new ExtWrapNullable(valueExpr == null ? null : new ExtWrapTagged(valueExpr)));
  ExtUtil.write(out,new ExtWrapNullable(copyRef));
  ExtUtil.writeBool(out,labelIsItext);
  ExtUtil.writeBool(out,copyMode);
}

Fixed version (ground truth):
public void writeExternal(DataOutputStream out) throws IOException {
  ExtUtil.write(out,nodesetRef);
  ExtUtil.write(out,new ExtWrapTagged(nodesetExpr));
  ExtUtil.write(out,contextRef);
  ExtUtil.write(out,labelRef);
  ExtUtil.write(out,new ExtWrapTagged(labelExpr));
  ExtUtil.write(out,new ExtWrapNullable(valueRef));
  ExtUtil.write(out,new ExtWrapNullable(valueExpr == null ? null : new ExtWrapTagged(valueExpr)));
  ExtUtil.write(out,new ExtWrapNullable(copyRef));
  ExtUtil.writeBool(out,labelIsItext);
  ExtUtil.writeBool(out,copyMode);
}
Program: 145178
Project: 145178
Buggy source:
public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  nodesetRef=(TreeReference)ExtUtil.read(in,TreeReference.class,pf);
  nodesetExpr=(IConditionExpr)ExtUtil.read(in,new ExtWrapTagged(),pf);
  labelRef=(TreeReference)ExtUtil.read(in,TreeReference.class,pf);
  labelExpr=(IConditionExpr)ExtUtil.read(in,new ExtWrapTagged(),pf);
  valueRef=(TreeReference)ExtUtil.read(in,new ExtWrapNullable(TreeReference.class),pf);
  valueExpr=(IConditionExpr)ExtUtil.read(in,new ExtWrapNullable(new ExtWrapTagged()),pf);
  copyRef=(TreeReference)ExtUtil.read(in,new ExtWrapNullable(TreeReference.class),pf);
  labelIsItext=ExtUtil.readBool(in);
  copyMode=ExtUtil.readBool(in);
}

Fixed version (ground truth):
public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  nodesetRef=(TreeReference)ExtUtil.read(in,TreeReference.class,pf);
  nodesetExpr=(IConditionExpr)ExtUtil.read(in,new ExtWrapTagged(),pf);
  contextRef=(TreeReference)ExtUtil.read(in,TreeReference.class,pf);
  labelRef=(TreeReference)ExtUtil.read(in,TreeReference.class,pf);
  labelExpr=(IConditionExpr)ExtUtil.read(in,new ExtWrapTagged(),pf);
  valueRef=(TreeReference)ExtUtil.read(in,new ExtWrapNullable(TreeReference.class),pf);
  valueExpr=(IConditionExpr)ExtUtil.read(in,new ExtWrapNullable(new ExtWrapTagged()),pf);
  copyRef=(TreeReference)ExtUtil.read(in,new ExtWrapNullable(TreeReference.class),pf);
  labelIsItext=ExtUtil.readBool(in);
  copyMode=ExtUtil.readBool(in);
}
Program: 145179
Project: 145179
Buggy source:
public Vector<SelectChoice> getSelectChoices(){
  QuestionDef q=getQuestion();
  ItemsetBinding itemset=q.getDynamicChoices();
  if (itemset != null) {
    if (!dynamicChoicesPopulated) {
      form.populateDynamicChoices(itemset,mTreeElement);
      dynamicChoicesPopulated=true;
    }
    Vector<SelectChoice> choices=itemset.getChoices();
    if (choices.size() == 0) {
      throw new RuntimeException("String_Node_Str");
    }
    return choices;
  }
 else {
    return getQuestion().getChoices();
  }
}

Fixed version (ground truth):
public Vector<SelectChoice> getSelectChoices(){
  QuestionDef q=getQuestion();
  ItemsetBinding itemset=q.getDynamicChoices();
  if (itemset != null) {
    if (!dynamicChoicesPopulated) {
      form.populateDynamicChoices(itemset);
      dynamicChoicesPopulated=true;
    }
    return itemset.getChoices();
  }
 else {
    return getQuestion().getChoices();
  }
}
Program: 145181
Project: 145181
Buggy source:
/** 
 * Write everything from input stream to output stream, byte by byte then close the streams
 * @param in
 * @param out
 * @throws IOException
 */
public static void writeFromInputToOutput(InputStream in,OutputStream out) throws IOException {
  int val=in.read();
  while (val != -1) {
    System.out.println("String_Node_Str" + val);
    out.write(val);
    val=in.read();
  }
}

Fixed version (ground truth):
/** 
 * Write everything from input stream to output stream, byte by byte then close the streams
 * @param in
 * @param out
 * @throws IOException
 */
public static void writeFromInputToOutput(InputStream in,OutputStream out) throws IOException {
  int val=in.read();
  while (val != -1) {
    out.write(val);
    val=in.read();
  }
}
Program: 145182
Project: 145182
Buggy source:
public static Long toInt(Object o){
  Double val=toNumeric(o);
  return new Long((long)Math.floor(val.doubleValue()));
}

Fixed version (ground truth):
public static Double toInt(Object o){
  Double val=toNumeric(o);
  if (val.isInfinite() || val.isNaN()) {
    return val;
  }
 else   if (val.doubleValue() >= Long.MAX_VALUE || val.doubleValue() <= Long.MIN_VALUE) {
    return val;
  }
 else {
    long l=val.longValue();
    Double dbl=new Double(l);
    if (l == 0 && (val.doubleValue() < 0. || val.equals(new Double(-0.)))) {
      dbl=new Double(-0.);
    }
    return dbl;
  }
}
Program: 145183
Project: 145183
Buggy source:
public static Date toDate(Object o){
  if (o instanceof Double) {
    double d=((Double)o).doubleValue();
    if (Math.abs(d - (int)d) > 1.0e-12) {
      throw new XPathTypeMismatchException("String_Node_Str");
    }
    o=toInt(o);
  }
  if (o instanceof Long) {
    Date dt=DateUtils.getDate(1970,1,1);
    dt.setTime(dt.getTime() + ((Long)o).longValue() * 86400000l + 43200000l);
    return DateUtils.roundDate(dt);
  }
 else   if (o instanceof String) {
    Date d=DateUtils.parseDate((String)o);
    if (d == null) {
      throw new XPathTypeMismatchException("String_Node_Str");
    }
 else {
      return d;
    }
  }
 else   if (o instanceof Date) {
    return DateUtils.roundDate((Date)o);
  }
 else {
    throw new XPathTypeMismatchException("String_Node_Str");
  }
}

Fixed version (ground truth):
public static Date toDate(Object o){
  if (o instanceof Double) {
    Double n=toInt(o);
    if (n.isInfinite() || n.isNaN() || n.doubleValue() > Integer.MAX_VALUE || n.doubleValue() < Integer.MIN_VALUE) {
      throw new XPathTypeMismatchException("String_Node_Str");
    }
    return DateUtils.dateAdd(DateUtils.getDate(1970,1,1),n.intValue());
  }
 else   if (o instanceof String) {
    Date d=DateUtils.parseDate((String)o);
    if (d == null) {
      throw new XPathTypeMismatchException("String_Node_Str");
    }
 else {
      return d;
    }
  }
 else   if (o instanceof Date) {
    return DateUtils.roundDate((Date)o);
  }
 else {
    throw new XPathTypeMismatchException("String_Node_Str");
  }
}
Program: 145184
Project: 145184
Buggy source:
public String substituteStringArgs(String templateStr){
  return form.fillTemplateString(templateStr,index.getReference());
}

Fixed version (ground truth):
public String substituteStringArgs(String templateStr){
  if (templateStr == null) {
    return null;
  }
  return form.fillTemplateString(templateStr,index.getReference());
}
Program: 145185
Project: 145185
Buggy source:
public void saveAndExit(){
  transitions.formEntrySaved(this.getModel().getForm(),this.getModel().getForm().getInstance(),true);
}

Fixed version (ground truth):
public void saveAndExit(){
  this.getModel().getForm().postProcessInstance();
  transitions.formEntrySaved(this.getModel().getForm(),this.getModel().getForm().getInstance(),true);
}
Program: 145186
Project: 145186
Buggy source:
public TreeReference getRef(){
  TreeElement elem=this;
  TreeReference ref=TreeReference.selfRef();
  while (elem != null) {
    TreeReference step;
    if (name != null) {
      step=TreeReference.selfRef();
      step.add(this.name,this.multiplicity);
    }
 else {
      step=TreeReference.rootRef();
    }
    ref=ref.parent(step);
    elem=elem.parent;
  }
  return ref;
}

Fixed version (ground truth):
public TreeReference getRef(){
  TreeElement elem=this;
  TreeReference ref=TreeReference.selfRef();
  while (elem != null) {
    TreeReference step;
    if (elem.name != null) {
      step=TreeReference.selfRef();
      step.add(elem.name,elem.multiplicity);
    }
 else {
      step=TreeReference.rootRef();
    }
    ref=ref.parent(step);
    elem=elem.parent;
  }
  return ref;
}
Program: 145187
Project: 145187
Buggy source:
public static Object getRefValue(FormInstance model,TreeReference ref){
  TreeElement node=((FormInstance)model).resolveReference(ref);
  if (node == null) {
    throw new XPathTypeMismatchException("String_Node_Str" + ref.toString() + "String_Node_Str");
  }
  return unpackValue(node.isRelevant() ? node.getValue() : null);
}

Fixed version (ground truth):
public static Object getRefValue(FormInstance model,TreeReference ref){
  TreeElement node=model.resolveReference(ref);
  if (node == null) {
    throw new XPathTypeMismatchException("String_Node_Str" + ref.toString() + "String_Node_Str");
  }
  return unpackValue(node.isRelevant() ? node.getValue() : null);
}
Program: 145188
Project: 145188
Buggy source:
protected FormEntryController getController(){
  Vector<IPreloadHandler> preloaders=JRDemoContext._().getPreloaders();
  FormDefFetcher fetcher=new FormDefFetcher(new RMSRetreivalMethod(formID),preloaders);
  return new FormEntryController(new FormEntryViewFactory(),fetcher,false);
}

Fixed version (ground truth):
protected FormEntryController getController(){
  Vector<IPreloadHandler> preloaders=JRDemoContext._().getPreloaders();
  FormDefFetcher fetcher=new FormDefFetcher(new RMSRetreivalMethod(formID),preloaders);
  return new FormEntryController(new JRDemoFormEntryViewFactory(),fetcher,false);
}
Program: 145189
Project: 145189
Buggy source:
public FormEntryController(int savedInstanceID,IFormEntryViewFactory viewFactory,FormDefFetcher fetcher,boolean readOnly,FormIndex firstQuestion,DataCaptureServiceRegistry dataCapture){
  FormDef theForm=fetcher.getFormDef();
  this.dataCapture=dataCapture;
  model=new FormEntryModel(theForm,savedInstanceID,firstQuestion,readOnly);
  viewFactory.getFormEntryView("String_Node_Str",model,this);
}

Fixed version (ground truth):
public FormEntryController(int savedInstanceID,IFormEntryViewFactory viewFactory,FormDefFetcher fetcher,boolean readOnly,FormIndex firstQuestion,DataCaptureServiceRegistry dataCapture){
  FormDef theForm=fetcher.getFormDef();
  this.dataCapture=dataCapture;
  model=new FormEntryModel(theForm,savedInstanceID,firstQuestion,readOnly);
  viewFactory.getFormEntryView(model,this);
}
Program: 145190
Project: 145190
Buggy source:
IFormEntryView getFormEntryView(String viewType,FormEntryModel model,FormEntryController controller);

Fixed version (ground truth):
IFormEntryView getFormEntryView(FormEntryModel model,FormEntryController controller);
Program: 145191
Project: 145191
Buggy source:
public IFormEntryView getFormEntryView(String viewType,FormEntryModel model,FormEntryController controller){
  return new Chatterbox(viewType,model,controller);
}

Fixed version (ground truth):
public IFormEntryView getFormEntryView(FormEntryModel model,FormEntryController controller){
  return new Chatterbox(title,model,controller);
}
Program: 145192
Project: 145192
Buggy source:
public void removeAll(){
  storage.removeAll();
}

Fixed version (ground truth):
public void removeAll(EntityFilter ef){
  storage.removeAll(ef);
}
Program: 145193
Project: 145193
Buggy source:
/** 
 * @param message
 * @throws IOException
 */
public void updateMessage(TransportMessage message) throws TransportException {
  try {
    if (message.getStatus() == TransportMessageStatus.CACHED) {
      IStorageUtilityIndexed cache=storage(Q_STORENAME);
      if (cache.getIDsForValue("String_Node_Str",message.getCacheIdentifier()).size() > 0) {
        storage(Q_STORENAME).write(message);
      }
    }
  }
 catch (  StorageFullException e) {
    throw new TransportException(e);
  }
}

Fixed version (ground truth):
/** 
 * @param message
 * @throws IOException
 */
public void updateMessage(TransportMessage message) throws TransportException {
  try {
    if (message.getStatus() == TransportMessageStatus.CACHED) {
      IStorageUtilityIndexed cache=storage(Q_STORENAME);
      if (cache.getIDsForValue("String_Node_Str",message.getCacheIdentifier()).size() > 0) {
        storage(Q_STORENAME).write(message);
      }
      updateCachedCounts();
    }
  }
 catch (  StorageFullException e) {
    throw new TransportException(e);
  }
}
Program: 145195
Project: 145195
Buggy source:
public Object getMetaData(String fieldName){
  if (fieldName.equals("String_Node_Str")) {
    return name;
  }
  if (fieldName.equals("String_Node_Str")) {
    return model.schema;
  }
 else {
    throw new IllegalArgumentException();
  }
}

Fixed version (ground truth):
public Object getMetaData(String fieldName){
  if (fieldName.equals("String_Node_Str")) {
    return name;
  }
  if (fieldName.equals("String_Node_Str")) {
    return ExtUtil.emptyIfNull(model.schema);
  }
 else {
    throw new IllegalArgumentException();
  }
}
Program: 145196
Project: 145196
Buggy source:
/** 
 * Write an object to the store. Will either add a new record, or update the existing record (if one exists) for the object's ID. This function should never be used in conjunction with add() and update() within the same StorageUtility
 * @param p object to store
 * @throws StorageFullException if there is not enough room to store the object
 */
public void write(Persistable p) throws StorageFullException {
  typeCheck(p);
  RMSRecordLoc newLoc=null;
synchronized (getAccessLock()) {
    RMSStorageInfo info=getInfoRecord();
    int id=p.getID();
    if (id == -1 && allocateIDs) {
      id=info.nextRecordID;
      p.setID(id);
      info.nextRecordID++;
    }
    byte[] data=ExtUtil.serialize(p);
    Hashtable idIndex=getIDIndexRecord();
    boolean recordExists=idIndex.containsKey(new Integer(id));
    setDirty();
    int bytesNeededEstimate=(recordExists ? 20 : 40);
    if (!setReserveBuffer(bytesNeededEstimate)) {
      setClean();
      throw new StorageFullException();
    }
    if (recordExists) {
      RMSRecordLoc loc=(RMSRecordLoc)idIndex.get(new Integer(id));
      newLoc=updateRecord(loc,data,info);
    }
 else {
      newLoc=addRecord(data,info);
      if (newLoc != null) {
        info.numRecords++;
      }
    }
    setReserveBuffer(0);
    if (newLoc == null) {
      setClean();
      throw new StorageFullException();
    }
    idIndex.put(new Integer(id),newLoc);
    commitIndex(info,idIndex);
    setClean();
    storageModified();
  }
}

Fixed version (ground truth):
/** 
 * Write an object to the store. Will either add a new record, or update the existing record (if one exists) for the object's ID. This function should never be used in conjunction with add() and update() within the same StorageUtility
 * @param p object to store
 * @throws StorageFullException if there is not enough room to store the object
 */
public void write(Persistable p) throws StorageFullException {
  typeCheck(p);
  RMSRecordLoc newLoc=null;
synchronized (getAccessLock()) {
    RMSStorageInfo info=getInfoRecord();
    int id=p.getID();
    if (allocateIDs) {
      if (id == -1) {
        id=info.nextRecordID;
        p.setID(id);
        info.nextRecordID++;
      }
 else       if (id >= info.nextRecordID) {
        info.nextRecordID=id + 1;
      }
    }
    byte[] data=ExtUtil.serialize(p);
    Hashtable idIndex=getIDIndexRecord();
    boolean recordExists=idIndex.containsKey(new Integer(id));
    setDirty();
    int bytesNeededEstimate=(recordExists ? 20 : 40);
    if (!setReserveBuffer(bytesNeededEstimate)) {
      setClean();
      throw new StorageFullException();
    }
    if (recordExists) {
      RMSRecordLoc loc=(RMSRecordLoc)idIndex.get(new Integer(id));
      newLoc=updateRecord(loc,data,info);
    }
 else {
      newLoc=addRecord(data,info);
      if (newLoc != null) {
        info.numRecords++;
      }
    }
    setReserveBuffer(0);
    if (newLoc == null) {
      setClean();
      throw new StorageFullException();
    }
    idIndex.put(new Integer(id),newLoc);
    commitIndex(info,idIndex);
    setClean();
    storageModified();
  }
}
Program: 145197
Project: 145197
Buggy source:
public PropertyUpdateController(PropertiesScreen screen){
  this.screen=screen;
  changes=new Hashtable();
  this.screen.setCommandListener(this);
  this.screen.setItemStateListener(this);
  this.screen.addCommand(CMD_DONE);
  this.screen.addCommand(CMD_CANCEL);
}

Fixed version (ground truth):
public PropertyUpdateController(PropertyUpdateState listener,PropertiesScreen screen){
  this.screen=screen;
  this.listener=listener;
  changes=new Hashtable();
  this.screen.setCommandListener(this);
  this.screen.setItemStateListener(this);
  this.screen.addCommand(CMD_DONE);
  this.screen.addCommand(CMD_CANCEL);
}
Program: 145198
Project: 145198
Buggy source:
public void save(){
  boolean postProcessModified=model.getForm().postProcessModel();
  if (!model.isSaved() || postProcessModified) {
    FormDef form=model.getForm();
    IStorageUtility instances=StorageManager.getStorage(DataModelTree.STORAGE_KEY);
    DataModelTree instance=(DataModelTree)form.getDataModel();
    int instanceID=model.getInstanceID();
    instance.setName(form.getTitle());
    instance.setFormId(form.getID());
    instance.setDateSaved(new Date());
    try {
      instances.write(instance);
    }
 catch (    StorageFullException e) {
      throw new RuntimeException("String_Node_Str");
    }
    model.modelSaved(instanceID);
  }
}

Fixed version (ground truth):
public void save(){
  boolean postProcessModified=model.getForm().postProcessModel();
  if (!model.isSaved() || postProcessModified) {
    FormDef form=model.getForm();
    IStorageUtility instances=StorageManager.getStorage(DataModelTree.STORAGE_KEY);
    DataModelTree instance=(DataModelTree)form.getDataModel();
    instance.setName(form.getTitle());
    instance.setFormId(form.getID());
    instance.setDateSaved(new Date());
    try {
      instances.write(instance);
    }
 catch (    StorageFullException e) {
      throw new RuntimeException("String_Node_Str");
    }
    model.modelSaved(instance.getID());
  }
}
Program: 145199
Project: 145199
Buggy source:
public static Alert showError(String title,String message,Displayable next,CommandListener customListener){
  final Alert alert=new Alert(title,message,null,AlertType.ERROR);
  alert.setTimeout(Alert.FOREVER);
  if (customListener != null) {
    if (next != null) {
      System.err.println("String_Node_Str");
    }
    alert.setCommandListener(customListener);
  }
  if (next == null) {
    display.setCurrent(alert);
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
  return alert;
}

Fixed version (ground truth):
public static Alert showError(String title,String message,Displayable next,CommandListener customListener){
  final Alert alert=new Alert(title,message,null,AlertType.ERROR);
  alert.setTimeout(Alert.FOREVER);
  if (customListener != null) {
    if (next != null) {
      System.err.println("String_Node_Str");
    }
    alert.setCommandListener(customListener);
  }
  if (next == null) {
    display.setCurrent(alert);
  }
 else {
    display.setCurrent(alert,next);
  }
  return alert;
}
Program: 145200
Project: 145200
Buggy source:
public void registerModule(Context context){
}

Fixed version (ground truth):
public void registerModule(){
}
Program: 145201
Project: 145201
Buggy source:
private static Selection getSelection(String choice,QuestionDef q){
  Selection s=new Selection(choice);
  if (q != null) {
    q.localizeSelectMap(null);
    int index=q.getSelectedItemIndex(choice);
    s.attachQuestionDef(q);
    return (index != -1 ? s : null);
  }
  return s;
}

Fixed version (ground truth):
private static Selection getSelection(String choice,QuestionDef q){
  Selection s=new Selection(choice);
  if (q != null) {
    if (q.getSelectItems() == null)     q.localizeSelectMap(null);
    int index=q.getSelectedItemIndex(choice);
    s.attachQuestionDef(q);
    return (index != -1 ? s : null);
  }
  return s;
}
Program: 145202
Project: 145202
Buggy source:
/** 
 * @param loginActivity
 */
private void init(){
  this.users=StorageManager.getStorage(User.STORAGE_KEY);
  boolean recordsExist=this.users.getNumRecords() > 0;
  System.out.println("String_Node_Str" + recordsExist);
  User tempUser=new User();
  tempUser.setUsername("String_Node_Str");
  if (recordsExist) {
    int lowestID=-1;
    IStorageIterator ui=users.iterate();
    while (ui.hasMore()) {
      int userID=ui.nextID();
      if (lowestID == -1 || userID < lowestID)       lowestID=userID;
    }
    tempUser=(User)users.read(lowestID);
  }
  initLoginControls(tempUser.getUsername());
  showVersions();
}

Fixed version (ground truth):
/** 
 * @param loginActivity
 */
private void init(){
  this.users=StorageManager.getStorage(User.STORAGE_KEY);
  boolean recordsExist=this.users.getNumRecords() > 0;
  System.out.println("String_Node_Str" + recordsExist);
  User tempUser=new User();
  tempUser.setUsername("String_Node_Str");
  if (recordsExist) {
    int highestID=-1;
    IStorageIterator ui=users.iterate();
    while (ui.hasMore()) {
      int userID=ui.nextID();
      if (highestID == -1 || userID > highestID)       highestID=userID;
    }
    tempUser=(User)users.read(highestID);
  }
  initLoginControls(tempUser.getUsername());
  showVersions();
}
Program: 145203
Project: 145203
Buggy source:
public String getName(){
  return null;
}

Fixed version (ground truth):
public String getName(){
  return getType();
}
Program: 145204
Project: 145204
Buggy source:
private Date getBeginningOfWeek(){
  Calendar c=Calendar.getInstance();
  int dow=c.get(Calendar.DAY_OF_WEEK);
  int dom=c.get(Calendar.DAY_OF_MONTH);
  c.set(Calendar.DAY_OF_WEEK,Calendar.SUNDAY);
  c.set(Calendar.DAY_OF_MONTH,dom - (dow - 1));
  return DateUtils.roundDate(c.getTime());
}

Fixed version (ground truth):
private Date getBeginningOfWeek(int weeksago){
  return DateUtils.getPastPeriodDate(new Date(),"String_Node_Str","String_Node_Str",true,true,weeksago);
}
Program: 145205
Project: 145205
Buggy source:
private DataModelDateFilter getFilterForOption(int i){
  Date start=new Date(0);
  Date end=new Date();
  if (i == 0) {
    start=DateUtils.roundDate(new Date());
  }
 else   if (i == 1) {
    end=DateUtils.roundDate(new Date());
    start=new Date(end.getTime() - DateUtils.DAY_IN_MS);
  }
 else   if (i == 2) {
    start=getBeginningOfWeek();
  }
 else   if (i == 3) {
    end=getBeginningOfWeek();
    start=new Date(end.getTime() - DateUtils.DAY_IN_MS * 7);
  }
  return new DataModelDateFilter(start,end);
}

Fixed version (ground truth):
private DataModelDateFilter getFilterForOption(int i){
  Date start=new Date(0);
  Date end=new Date();
  if (i == 0) {
    start=DateUtils.roundDate(new Date());
  }
 else   if (i == 1) {
    end=DateUtils.roundDate(new Date());
    start=new Date(end.getTime() - DateUtils.DAY_IN_MS);
  }
 else   if (i == 2) {
    start=getBeginningOfWeek(0);
  }
 else   if (i == 3) {
    end=getBeginningOfWeek(0);
    start=getBeginningOfWeek(1);
  }
  System.out.println(DateUtils.formatDate(start,DateUtils.FORMAT_HUMAN_READABLE_SHORT) + "String_Node_Str" + DateUtils.formatDate(end,DateUtils.FORMAT_HUMAN_READABLE_SHORT));
  return new DataModelDateFilter(start,end);
}
Program: 145207
Project: 145207
Buggy source:
public static TransportMessage sendBlocking(TransportMessage message) throws TransportException {
  if (message.isCacheable()) {
    MESSAGE_STORE.cache(message);
  }
  Transporter transporter=message.createTransporter();
  transporter.setMessage(message);
  transporter.send();
  if (message.getStatus() == TransportMessageStatus.SENT) {
    MESSAGE_STORE.decache(message);
  }
 else {
    message.setStatus(TransportMessageStatus.CACHED);
    MESSAGE_STORE.updateMessage(message);
  }
  return message;
}

Fixed version (ground truth):
public static TransportMessage sendBlocking(TransportMessage message) throws TransportException {
  if (message.isCacheable()) {
    MESSAGE_STORE.cache(message);
  }
  Transporter transporter=message.createTransporter();
  transporter.setMessage(message);
  transporter.send();
  if (message.isCacheable()) {
    if (message.getStatus() == TransportMessageStatus.SENT) {
      MESSAGE_STORE.decache(message);
    }
 else {
      message.setStatus(TransportMessageStatus.CACHED);
      MESSAGE_STORE.updateMessage(message);
    }
  }
  return message;
}
Program: 145208
Project: 145208
Buggy source:
/** 
 * Write everything from input stream to output stream, byte by byte then close the streams
 * @param in
 * @param out
 * @throws IOException
 */
public static void writeFromInputToOutput(InputStream in,OutputStream out) throws IOException {
  int val=in.read();
  while (val != -1) {
    out.write(val);
    val=in.read();
  }
}

Fixed version (ground truth):
/** 
 * Write everything from input stream to output stream, byte by byte then close the streams
 * @param in
 * @param out
 * @throws IOException
 */
public static void writeFromInputToOutput(InputStream in,OutputStream out) throws IOException {
  int val=in.read();
  while (val != -1) {
    System.out.println("String_Node_Str" + val);
    out.write(val);
    val=in.read();
  }
}
Program: 145209
Project: 145209
Buggy source:
public static TransportMessage sendBlocking(TransportMessage message) throws TransportException {
  if (message.isCacheable()) {
    MESSAGE_STORE.cache(message);
  }
  Transporter transporter=message.createTransporter();
  transporter.setMessage(message);
  transporter.send();
  if (message.isCacheable()) {
    if (message.getStatus() == TransportMessageStatus.SENT) {
      MESSAGE_STORE.decache(message);
    }
 else {
      message.setStatus(TransportMessageStatus.CACHED);
      MESSAGE_STORE.updateMessage(message);
    }
  }
  return message;
}

Fixed version (ground truth):
/** 
 * @param message
 * @return
 * @throws TransportException
 */
public static TransportMessage sendBlocking(TransportMessage message) throws TransportException {
  if (message.isCacheable()) {
    MESSAGE_STORE.cache(message);
  }
  Transporter transporter=message.createTransporter();
  transporter.setMessage(message);
  transporter.send();
  if (message.isCacheable()) {
    if (message.getStatus() == TransportMessageStatus.SENT) {
      MESSAGE_STORE.decache(message);
    }
 else {
      message.setStatus(TransportMessageStatus.CACHED);
      MESSAGE_STORE.updateMessage(message);
    }
  }
  return message;
}
Program: 145210
Project: 145210
Buggy source:
/** 
 * Any messages which aren't successfully sent in QueuingThreads are then "Cached". Applications can activate new attempts to send the CachedMessages via this sendCached method
 */
public static void sendCached(TransportListener listener) throws TransportException {
  Vector messages=getCachedMessages();
  if (messages.size() > 0) {
    TransportMessage m=(TransportMessage)messages.elementAt(0);
    Transporter transporter=m.createTransporter();
    BulkSender sender=new BulkSender(transporter,messages,MESSAGE_STORE,listener);
    sender.send();
  }
  throw new TransportException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Any messages which aren't successfully sent in SendingThreads are then "Cached". Applications can activate new attempts to send the CachedMessages via this sendCached method
 */
public static void sendCached(TransportListener listener) throws TransportException {
  Vector messages=getCachedMessages();
  if (messages.size() > 0) {
    TransportMessage m=(TransportMessage)messages.elementAt(0);
    Transporter transporter=m.createTransporter();
    BulkSender sender=new BulkSender(transporter,messages,MESSAGE_STORE,listener);
    sender.send();
  }
  throw new TransportException("String_Node_Str");
}
Program: 145211
Project: 145211
Buggy source:
/** 
 * @param url
 * @return
 * @throws IOException
 */
private HttpConnection getConnection(String url) throws IOException {
  HttpConnection conn;
  Object o=Connector.open(url);
  if (o instanceof HttpConnection) {
    conn=(HttpConnection)o;
    conn.setRequestMethod(HttpConnection.POST);
    conn.setRequestProperty("String_Node_Str","String_Node_Str");
    conn.setRequestProperty("String_Node_Str","String_Node_Str");
    conn.setRequestProperty("String_Node_Str","String_Node_Str");
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + url);
  }
  return conn;
}

Fixed version (ground truth):
/** 
 * @param url
 * @return
 * @throws IOException
 */
private HttpConnection getConnection(String url) throws IOException {
  HttpConnection conn=(HttpConnection)Connector.open(url);
  conn.setRequestMethod(HttpConnection.POST);
  conn.setRequestProperty("String_Node_Str","String_Node_Str");
  conn.setRequestProperty("String_Node_Str","String_Node_Str");
  conn.setRequestProperty("String_Node_Str","String_Node_Str");
  conn.setRequestProperty("String_Node_Str","String_Node_Str");
  return conn;
}
Program: 145212
Project: 145212
Buggy source:
public TransportMessage send(){
  HttpConnection conn=null;
  try {
    String url=message.getDestinationURL();
    System.out.println("String_Node_Str" + url);
    conn=getConnection(url);
    if (conn.getResponseCode() == HttpConnection.HTTP_OK) {
      writeToConnection(conn,this.message.getContentStream());
      readResponse(conn,this.message);
    }
    conn.close();
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
    this.message.setFailureReason(e.getMessage());
    this.message.incrementFailureCount();
  }
 finally {
    if (conn != null)     try {
      conn.close();
    }
 catch (    IOException e) {
    }
  }
  return message;
}

Fixed version (ground truth):
public TransportMessage send(){
  HttpConnection conn=null;
  byte[] o=(byte[])this.message.getContent();
  String content=new String(o);
  System.out.println("String_Node_Str" + content);
  DataInputStream is=null;
  DataOutputStream os=null;
  try {
    HttpConnectionWrapper.logger.setLevel(Level.FINE);
    conn=new HttpConnectionWrapper(getConnection(message.getDestinationURL()));
    conn.setRequestProperty("String_Node_Str",new Integer(content.length()).toString());
    os=(DataOutputStream)conn.openDataOutputStream();
    os.writeUTF(content);
    is=(DataInputStream)conn.openDataInputStream();
    int ch;
    StringBuffer sb=new StringBuffer();
    while ((ch=is.read()) != -1) {
      sb.append((char)ch);
    }
    System.out.println("String_Node_Str" + sb.toString());
    message.setResponseBody(sb.toString());
    is.close();
    this.message.setResponseCode(conn.getResponseCode());
    conn.close();
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + e.getClass() + "String_Node_Str"+ e.getMessage());
    message.setFailureReason(e.getMessage());
    message.incrementFailureCount();
  }
 finally {
    if (is != null) {
      try {
        is.close();
      }
 catch (      IOException e) {
      }
    }
    if (os != null) {
      try {
        os.close();
      }
 catch (      IOException e) {
      }
    }
    if (conn != null)     try {
      conn.close();
    }
 catch (    IOException e) {
    }
  }
  return message;
}
Program: 145215
Project: 145215
Buggy source:
/** 
 * Provides text representing a span of time. NOTE: Should probably just be a "format date" entry
 * @param d The date to be compared against the current date.
 * @return a string which is a human readable representation of the difference betweenthe provided date and the current date.  
 */
public static String getDifferenceFromToday(Date d){
  String daysAgoStr;
  double daysAgo=(int)(DateUtils.daysSinceEpoch(new Date()) - DateUtils.daysSinceEpoch(d));
  daysAgoStr=(daysAgo < 0 ? "String_Node_Str" : daysAgo == 0 ? "String_Node_Str" : daysAgo == 1 ? "String_Node_Str" : daysAgo == 2 ? "String_Node_Str" : daysAgo + "String_Node_Str");
  if (daysAgo >= 0 && daysAgo < 1) {
    return "String_Node_Str";
  }
 else   if (daysAgo >= 1 && daysAgo < 2) {
    return "String_Node_Str";
  }
 else   if (daysAgo >= 2 && daysAgo < 30) {
    return daysAgo + "String_Node_Str";
  }
 else   if (daysAgo < 0 && daysAgo > -1) {
    return "String_Node_Str";
  }
 else   if (daysAgo < -1) {
    return daysAgo + "String_Node_Str";
  }
  return daysAgoStr;
}

Fixed version (ground truth):
/** 
 * Provides text representing a span of time. NOTE: Should probably just be a "format date" entry
 * @param d The date to be compared against the current date.
 * @return a string which is a human readable representation of the difference betweenthe provided date and the current date.  
 */
public static String getDifferenceFromToday(Date d){
  String daysAgoStr="String_Node_Str";
  double daysAgo=(int)(DateUtils.daysSinceEpoch(new Date()) - DateUtils.daysSinceEpoch(d));
  daysAgoStr=(daysAgo < 0 ? "String_Node_Str" : daysAgo == 0 ? "String_Node_Str" : daysAgo == 1 ? "String_Node_Str" : daysAgo == 2 ? "String_Node_Str" : daysAgo + "String_Node_Str");
  if (daysAgo >= 0 && daysAgo < 1) {
    return "String_Node_Str";
  }
 else   if (daysAgo >= 1 && daysAgo < 2) {
    return "String_Node_Str";
  }
 else   if (daysAgo >= 2 && daysAgo < 30) {
    return daysAgo + "String_Node_Str";
  }
 else   if (daysAgo < 0 && daysAgo > -1) {
    return "String_Node_Str";
  }
 else   if (daysAgo < -1) {
    return daysAgo + "String_Node_Str";
  }
  return daysAgoStr;
}
Program: 145216
Project: 145216
Buggy source:
/** 
 * send all unsent forms
 */
private void executeSendAllUnsentCommand(){
  Enumeration en=this.models.elements();
  Vector unsent=new Vector();
  while (en.hasMoreElements()) {
    DataModelTreeMetaData data=(DataModelTreeMetaData)en.nextElement();
    DataModelTree model=new DataModelTree();
    ITransportManager tm=JavaRosaServiceProvider.instance().getTransportManager();
    try {
      this.dataModelRMSUtility.retrieveFromRMS(data.getRecordId(),model);
    }
 catch (    IOException e) {
      handleModelRetrieveException(e);
      return;
    }
catch (    DeserializationException e) {
      handleModelRetrieveException(e);
      return;
    }
    if (TransportMessage.STATUS_DELIVERED == tm.getModelDeliveryStatus(data.getRecordId(),true)) {
    }
 else {
      unsent.addElement(model);
    }
  }
  if (unsent.size() > 0) {
    Hashtable formSendArgs=new Hashtable();
    formSendArgs.put(returnKey,CMD_SEND_ALL_UNSENT);
    formSendArgs.put("String_Node_Str",unsent);
    this.parent.returnFromActivity(this,Constants.ACTIVITY_NEEDS_RESOLUTION,formSendArgs);
  }
 else {
    initView();
  }
}

Fixed version (ground truth):
/** 
 * send all unsent forms
 */
private void executeSendAllUnsentCommand(){
  Enumeration en=this.models.elements();
  Vector unsent=new Vector();
  while (en.hasMoreElements()) {
    DataModelTreeMetaData data=(DataModelTreeMetaData)en.nextElement();
    DataModelTree model=new DataModelTree();
    ITransportManager tm=JavaRosaServiceProvider.instance().getTransportManager();
    try {
      this.dataModelRMSUtility.retrieveFromRMS(data.getRecordId(),model);
    }
 catch (    IOException e) {
      handleModelRetrieveException(e);
      return;
    }
catch (    DeserializationException e) {
      handleModelRetrieveException(e);
      return;
    }
    if (TransportMessage.STATUS_DELIVERED == tm.getModelDeliveryStatus(data.getRecordId(),true)) {
    }
 else {
      XFormSerializingVisitor visitor=new XFormSerializingVisitor();
      IDataPayload payload;
      try {
        payload=visitor.createSerializedPayload(model);
        unsent.addElement(payload);
      }
 catch (      IOException e) {
        System.out.println("String_Node_Str" + model.getId());
        e.printStackTrace();
      }
    }
  }
  if (unsent.size() > 0) {
    Hashtable formSendArgs=new Hashtable();
    formSendArgs.put(returnKey,CMD_SEND_ALL_UNSENT);
    formSendArgs.put("String_Node_Str",unsent);
    this.parent.returnFromActivity(this,Constants.ACTIVITY_NEEDS_RESOLUTION,formSendArgs);
  }
 else {
    initView();
  }
}
Program: 145217
Project: 145217
Buggy source:
private void writeProperties(){
  Properties p=new Properties();
  p.setProperty(this.WTK_PATH,this.wtkPath);
  p.setProperty(this.NEW_FORM,this.newForm);
  p.setProperty(this.ORIGINAL_JAR_DIR,this.origJarDir);
  p.setProperty(this.OPEN_XML_WITH,openXMLWith);
  p.setProperty(this.OPEN_AT_END,openAtEnd.toString());
  p.setProperty(this.DEPLOY_JAR_PATH,deployJarTF.getText());
  File f=new File(this.PROPERTIES_FILE);
  try {
    if (!f.exists())     f.createNewFile();
    FileOutputStream fos=new FileOutputStream(f);
    p.store(fos,this.PROPERTIES_FILE);
    fos.flush();
    fos.close();
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void writeProperties(){
  Properties p=new Properties();
  p.setProperty(this.WTK_PATH,this.wtkPath);
  p.setProperty(this.NEW_FORM,this.newForm);
  p.setProperty(this.ORIGINAL_JAR_DIR,this.origJarDir);
  p.setProperty(this.OPEN_XML_WITH,openXMLWith);
  p.setProperty(this.OPEN_AT_END,openAtEnd.toString());
  String deploy=deployJarTF == null ? "String_Node_Str" : deployJarTF.getText();
  p.setProperty(this.DEPLOY_JAR_PATH,deploy);
  File f=new File(this.PROPERTIES_FILE);
  try {
    if (!f.exists())     f.createNewFile();
    FileOutputStream fos=new FileOutputStream(f);
    p.store(fos,this.PROPERTIES_FILE);
    fos.flush();
    fos.close();
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}