nus-yam/ex-repair huggingface dataset:
Program: 145266
Project: 145266
Buggy source:
public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  ExtUtil.read(in,new ExtWrapTagged());
}

Fixed version (ground truth):
public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  pointer=(IDataPointer)ExtUtil.read(in,new ExtWrapTagged());
}
Program: 145267
Project: 145267
Buggy source:
public void run(){
  String destinationUrl=((SmsTransportDestination)message.getDestination()).getSmsAddress();
  try {
    SMSSplitTransportMessage sp=new SMSSplitTransportMessage(message);
    sp.splitMessage();
    mconn=(MessageConnection)Connector.open(destinationUrl);
    Enumeration e=sp.getMessageParts().elements();
    TextMessage tmsg;
    while (e.hasMoreElements()) {
      tmsg=(TextMessage)mconn.newMessage(MessageConnection.TEXT_MESSAGE);
      tmsg.setAddress(destinationUrl);
      String payload=new String(((ByteArrayOutputStream)e.nextElement()).toByteArray());
      System.out.println("String_Node_Str" + payload);
      mconn.send(tmsg);
      tmsg=null;
    }
  }
 catch (  IOException e) {
    System.err.println("String_Node_Str");
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void run(){
  String destinationUrl=((SmsTransportDestination)message.getDestination()).getSmsAddress();
  try {
    SMSSplitTransportMessage sp=new SMSSplitTransportMessage(message);
    sp.splitMessage();
    mconn=(MessageConnection)Connector.open(destinationUrl);
    Enumeration e=sp.getMessageParts().elements();
    TextMessage tmsg;
    while (e.hasMoreElements()) {
      tmsg=(TextMessage)mconn.newMessage(MessageConnection.TEXT_MESSAGE);
      tmsg.setAddress(destinationUrl);
      String payload=new String(((ByteArrayOutputStream)e.nextElement()).toByteArray());
      System.out.println("String_Node_Str" + payload);
      tmsg.setPayloadText(payload);
      mconn.send(tmsg);
    }
  }
 catch (  IOException e) {
    System.err.println("String_Node_Str");
    e.printStackTrace();
  }
}
Program: 145268
Project: 145268
Buggy source:
private HttpHeaderAppendingVisitor(String divider){
  this.divider=divider;
}

Fixed version (ground truth):
private HttpHeaderAppendingVisitor(String divider){
  this.divider=divider;
  this.top=false;
}
Program: 145269
Project: 145269
Buggy source:
public HttpTransportHeader(){
  headers.put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public HttpTransportHeader(){
}
Program: 145270
Project: 145270
Buggy source:
public void writeExternal(DataOutputStream out) throws IOException {
  ExtUtil.write(out,new ExtWrapList(payloads));
}

Fixed version (ground truth):
public void writeExternal(DataOutputStream out) throws IOException {
  ExtUtil.write(out,new ExtWrapListPoly(payloads));
}
Program: 145271
Project: 145271
Buggy source:
public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  payloads=(Vector)ExtUtil.read(in,new ExtWrapList(new ExtWrapTagged()),pf);
}

Fixed version (ground truth):
public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  payloads=(Vector)ExtUtil.read(in,new ExtWrapListPoly(),pf);
}
Program: 145272
Project: 145272
Buggy source:
public int read() throws IOException {
  if (currentStream == -1) {
    throw new IOException("String_Node_Str");
  }
  InputStream cur=((InputStream)streams.elementAt(currentStream));
  int next=cur.read();
  if (next != -1) {
    return next;
  }
  while (next != -1 && currentStream + 1 < streams.size()) {
    currentStream++;
    cur=((InputStream)streams.elementAt(currentStream));
    next=cur.read();
  }
  return next;
}

Fixed version (ground truth):
public int read() throws IOException {
  if (currentStream == -1) {
    throw new IOException("String_Node_Str");
  }
  InputStream cur=((InputStream)streams.elementAt(currentStream));
  int next=cur.read();
  if (next != -1) {
    return next;
  }
  while (next == -1 && currentStream + 1 < streams.size()) {
    currentStream++;
    cur=((InputStream)streams.elementAt(currentStream));
    next=cur.read();
  }
  return next;
}
Program: 145273
Project: 145273
Buggy source:
public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  name=ExtUtil.readString(in);
  reference=(IDataReference)ExtUtil.read(in,new ExtWrapTagged(),pf);
  Vector attStrings=ExtUtil.nullIfEmpty((Vector)ExtUtil.read(in,new ExtWrapList(),pf));
  setAttributesFromSingleStringVector(attStrings);
  value=(IAnswerData)ExtUtil.read(in,new ExtWrapNullable(new ExtWrapTagged()),pf);
}

Fixed version (ground truth):
public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  name=ExtUtil.readString(in);
  reference=(IDataReference)ExtUtil.read(in,new ExtWrapTagged(),pf);
  Vector attStrings=ExtUtil.nullIfEmpty((Vector)ExtUtil.read(in,new ExtWrapList(String.class),pf));
  setAttributesFromSingleStringVector(attStrings);
  value=(IAnswerData)ExtUtil.read(in,new ExtWrapNullable(new ExtWrapTagged()),pf);
}
Program: 145274
Project: 145274
Buggy source:
private IAnswerData preloadContext(String preloadParams){
  String value="String_Node_Str";
  String userVal=this.context.getCurrentUser();
  System.out.println("String_Node_Str" + userVal);
  if ("String_Node_Str".equals(preloadParams) && userVal != "String_Node_Str") {
    value=userVal;
  }
  System.out.println(value);
  return new StringData(value);
}

Fixed version (ground truth):
private IAnswerData preloadContext(String preloadParams){
  String value="String_Node_Str";
  if ("String_Node_Str".equals(preloadParams)) {
    String userVal=this.context.getCurrentUser();
    System.out.println("String_Node_Str" + userVal);
    if (userVal != null && userVal.length() > 0)     value=userVal;
  }
  System.out.println(value);
  return new StringData(value);
}
Program: 145275
Project: 145275
Buggy source:
public Chatterbox(String formTitle,FormEntryModel model,FormEntryController controller){
  super(formTitle);
  this.model=model;
  this.controller=controller;
  controller.setView(this);
  widgetFactory=new ChatterboxWidgetFactory(this);
  multiLingual=(model.getForm().getLocalizer() != null);
  questionIndexes=new SortedIntSet();
  activeQuestionIndex=INDEX_NOT_SET;
  model.registerObservable(this);
  initGUI();
  KEY_CENTER_LETS_HOPE=13;
}

Fixed version (ground truth):
public Chatterbox(String formTitle,FormEntryModel model,FormEntryController controller){
  super(formTitle);
  this.model=model;
  this.controller=controller;
  controller.setFormEntryView(this);
  widgetFactory=new ChatterboxWidgetFactory(this);
  multiLingual=(model.getForm().getLocalizer() != null);
  questionIndexes=new SortedIntSet();
  activeQuestionIndex=INDEX_NOT_SET;
  model.registerObservable(this);
  initGUI();
  KEY_CENTER_LETS_HOPE=13;
}
Program: 145276
Project: 145276
Buggy source:
private void init(){
  loadModules();
  registerPrototypes();
  loadProperties();
  JavaRosaServiceProvider.instance().getTransportManager().registerTransportMethod(new HttpTransportMethod());
  FormDefRMSUtility formDef=(FormDefRMSUtility)JavaRosaServiceProvider.instance().getStorageManager().getRMSStorageProvider().getUtility(FormDefRMSUtility.getUtilityName());
  formDef.addReferencePrototype(new XPathReference());
  if (formDef.getNumberOfRecords() == 0) {
    formDef.writeToRMS(XFormUtils.getFormFromResource("String_Node_Str"));
    formDef.writeToRMS(XFormUtils.getFormFromResource("String_Node_Str"));
    formDef.writeToRMS(XFormUtils.getFormFromResource("String_Node_Str"));
    formDef.writeToRMS(XFormUtils.getFormFromResource("String_Node_Str"));
    formDef.writeToRMS(XFormUtils.getFormFromResource("String_Node_Str"));
    formDef.writeToRMS(XFormUtils.getFormFromResource("String_Node_Str"));
  }
}

Fixed version (ground truth):
private void init(){
  loadModules();
  loadProperties();
  JavaRosaServiceProvider.instance().getTransportManager().registerTransportMethod(new HttpTransportMethod());
  FormDefRMSUtility formDef=(FormDefRMSUtility)JavaRosaServiceProvider.instance().getStorageManager().getRMSStorageProvider().getUtility(FormDefRMSUtility.getUtilityName());
  formDef.addReferencePrototype(new XPathReference());
  if (formDef.getNumberOfRecords() == 0) {
    formDef.writeToRMS(XFormUtils.getFormFromResource("String_Node_Str"));
    formDef.writeToRMS(XFormUtils.getFormFromResource("String_Node_Str"));
    formDef.writeToRMS(XFormUtils.getFormFromResource("String_Node_Str"));
    formDef.writeToRMS(XFormUtils.getFormFromResource("String_Node_Str"));
    formDef.writeToRMS(XFormUtils.getFormFromResource("String_Node_Str"));
    formDef.writeToRMS(XFormUtils.getFormFromResource("String_Node_Str"));
  }
}
Program: 145277
Project: 145277
Buggy source:
private void registerPrototypes(){
  String[] classes={"String_Node_Str","String_Node_Str"};
  JavaRosaServiceProvider.instance().registerPrototypes(classes);
  JavaRosaServiceProvider.instance().registerPrototypes(XPathParseTool.xpathClasses);
}

Fixed version (ground truth):
private void registerPrototypes(){
  String[] classes={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  JavaRosaServiceProvider.instance().registerPrototypes(classes);
  JavaRosaServiceProvider.instance().registerPrototypes(XPathParseTool.xpathClasses);
}
Program: 145278
Project: 145278
Buggy source:
public void registerModule(Context context){
  DataModelTreeRMSUtility dataModel=new DataModelTreeRMSUtility(DataModelTreeRMSUtility.getUtilityName());
  FormDefRMSUtility formDef=new FormDefRMSUtility(FormDefRMSUtility.getUtilityName());
  formDef.addModelPrototype(new DataModelTree());
  JavaRosaServiceProvider.instance().getStorageManager().getRMSStorageProvider().registerRMSUtility(dataModel);
  JavaRosaServiceProvider.instance().getStorageManager().getRMSStorageProvider().registerRMSUtility(formDef);
}

Fixed version (ground truth):
public void registerModule(Context context){
  DataModelTreeRMSUtility dataModel=new DataModelTreeRMSUtility(DataModelTreeRMSUtility.getUtilityName());
  FormDefRMSUtility formDef=new FormDefRMSUtility(FormDefRMSUtility.getUtilityName());
  formDef.addModelPrototype(new DataModelTree());
  JavaRosaServiceProvider.instance().getStorageManager().getRMSStorageProvider().registerRMSUtility(dataModel);
  JavaRosaServiceProvider.instance().getStorageManager().getRMSStorageProvider().registerRMSUtility(formDef);
  String[] classes={"String_Node_Str","String_Node_Str"};
  JavaRosaServiceProvider.instance().registerPrototypes(classes);
}
Program: 145279
Project: 145279
Buggy source:
/** 
 * Write the group definition object to the supplied stream. 
 */
public void writeExternal(DataOutputStream dos) throws IOException {
  dos.writeInt(getID());
  ExternalizableHelperDeprecated.writeUTF(dos,getName());
  ExternalizableHelperDeprecated.writeUTF(dos,getLongText());
  ExternalizableHelperDeprecated.writeUTF(dos,getShortText());
  ExternalizableHelperDeprecated.writeUTF(dos,getLongTextID());
  ExternalizableHelperDeprecated.writeUTF(dos,getShortTextID());
  dos.writeBoolean(getRepeat());
  ExternalizableHelperDeprecated.writeExternalGeneric(getChildren(),dos);
}

Fixed version (ground truth):
/** 
 * Write the group definition object to the supplied stream. 
 */
public void writeExternal(DataOutputStream dos) throws IOException {
  ExtUtil.writeNumeric(dos,getID());
  ExtUtil.write(dos,new ExtWrapNullable(getName()));
  ExtUtil.write(dos,new ExtWrapNullable(getLongText()));
  ExtUtil.write(dos,new ExtWrapNullable(getShortText()));
  ExtUtil.write(dos,new ExtWrapNullable(getLongTextID()));
  ExtUtil.write(dos,new ExtWrapNullable(getShortTextID()));
  ExtUtil.writeBool(dos,getRepeat());
  ExtUtil.write(dos,new ExtWrapListPoly(getChildren()));
}
Program: 145280
Project: 145280
Buggy source:
/** 
 * Reads a group definition object from the supplied stream. 
 */
public void readExternal(DataInputStream dis,PrototypeFactory pf) throws IOException, DeserializationException {
  if (!ExternalizableHelperDeprecated.isEOF(dis)) {
    PrototypeFactoryDeprecated factory=new PrototypeFactoryDeprecated();
    factory.addNewPrototype(QuestionDef.class.getName(),QuestionDef.class);
    factory.addNewPrototype(GroupDef.class.getName(),GroupDef.class);
    setID(dis.readInt());
    setName(ExternalizableHelperDeprecated.readUTF(dis));
    setLongText(ExternalizableHelperDeprecated.readUTF(dis));
    setShortText(ExternalizableHelperDeprecated.readUTF(dis));
    setLongTextID(ExternalizableHelperDeprecated.readUTF(dis),null);
    setShortTextID(ExternalizableHelperDeprecated.readUTF(dis),null);
    setRepeat(dis.readBoolean());
    ExternalizableHelperDeprecated.readExternal(dis,factory);
  }
}

Fixed version (ground truth):
/** 
 * Reads a group definition object from the supplied stream. 
 */
public void readExternal(DataInputStream dis,PrototypeFactory pf) throws IOException, DeserializationException {
  setID(ExtUtil.readInt(dis));
  setName((String)ExtUtil.read(dis,new ExtWrapNullable(String.class),pf));
  setLongText((String)ExtUtil.read(dis,new ExtWrapNullable(String.class),pf));
  setShortText((String)ExtUtil.read(dis,new ExtWrapNullable(String.class),pf));
  setLongTextID((String)ExtUtil.read(dis,new ExtWrapNullable(String.class),pf),null);
  setShortTextID((String)ExtUtil.read(dis,new ExtWrapNullable(String.class),pf),null);
  setRepeat(ExtUtil.readBool(dis));
  setChildren((Vector)ExtUtil.read(dis,new ExtWrapListPoly(),pf));
}
Program: 145281
Project: 145281
Buggy source:
public void readExternal(DataInputStream dis,PrototypeFactory pf) throws IOException, DeserializationException {
  setID(ExtUtil.readInt(dis));
  setName((String)ExtUtil.read(dis,new ExtWrapNullable(String.class)));
  setAppearanceAttr((String)ExtUtil.read(dis,new ExtWrapNullable(String.class)));
  setLongText((String)ExtUtil.read(dis,new ExtWrapNullable(String.class)));
  setShortText((String)ExtUtil.read(dis,new ExtWrapNullable(String.class)));
  setHelpText((String)ExtUtil.read(dis,new ExtWrapNullable(String.class)));
  setLongTextID((String)ExtUtil.read(dis,new ExtWrapNullable(String.class)),null);
  setShortTextID((String)ExtUtil.read(dis,new ExtWrapNullable(String.class)),null);
  setHelpTextID((String)ExtUtil.read(dis,new ExtWrapNullable(String.class)),null);
  setDataType(ExtUtil.readInt(dis));
  setControlType(ExtUtil.readInt(dis));
  setRequired(ExtUtil.readBool(dis));
  setVisible(ExtUtil.readBool(dis));
  setEnabled(ExtUtil.readBool(dis));
  setLocked(ExtUtil.readBool(dis));
  setSelectItemIDs((OrderedHashtable)ExtUtil.nullIfEmpty((OrderedHashtable)ExtUtil.read(dis,new ExtWrapMap(String.class,String.class,true))),ExtUtil.nullIfEmpty((Vector)ExtUtil.read(dis,new ExtWrapList(Boolean.class))),null);
  if (getSelectItemIDs() != null && (controlType == Constants.CONTROL_SELECT_MULTI || controlType == Constants.CONTROL_SELECT_ONE)) {
    localizeSelectMap(null);
  }
  binding=(IDataReference)ExtUtil.read(dis,new ExtWrapNullable(new ExtWrapTagged()));
}

Fixed version (ground truth):
public void readExternal(DataInputStream dis,PrototypeFactory pf) throws IOException, DeserializationException {
  setID(ExtUtil.readInt(dis));
  setName((String)ExtUtil.read(dis,new ExtWrapNullable(String.class),pf));
  setAppearanceAttr((String)ExtUtil.read(dis,new ExtWrapNullable(String.class),pf));
  setLongText((String)ExtUtil.read(dis,new ExtWrapNullable(String.class),pf));
  setShortText((String)ExtUtil.read(dis,new ExtWrapNullable(String.class),pf));
  setHelpText((String)ExtUtil.read(dis,new ExtWrapNullable(String.class),pf));
  setLongTextID((String)ExtUtil.read(dis,new ExtWrapNullable(String.class),pf),null);
  setShortTextID((String)ExtUtil.read(dis,new ExtWrapNullable(String.class),pf),null);
  setHelpTextID((String)ExtUtil.read(dis,new ExtWrapNullable(String.class),pf),null);
  setDataType(ExtUtil.readInt(dis));
  setControlType(ExtUtil.readInt(dis));
  setRequired(ExtUtil.readBool(dis));
  setVisible(ExtUtil.readBool(dis));
  setEnabled(ExtUtil.readBool(dis));
  setLocked(ExtUtil.readBool(dis));
  setSelectItemIDs((OrderedHashtable)ExtUtil.nullIfEmpty((OrderedHashtable)ExtUtil.read(dis,new ExtWrapMap(String.class,String.class,true),pf)),ExtUtil.nullIfEmpty((Vector)ExtUtil.read(dis,new ExtWrapList(Boolean.class),pf)),null);
  if (getSelectItemIDs() != null && (controlType == Constants.CONTROL_SELECT_MULTI || controlType == Constants.CONTROL_SELECT_ONE)) {
    localizeSelectMap(null);
  }
  binding=(IDataReference)ExtUtil.read(dis,new ExtWrapNullable(new ExtWrapTagged()),pf);
}
Program: 145282
Project: 145282
Buggy source:
protected void readNodeAttributes(DataInputStream in) throws IOException {
  this.name=ExternalizableHelperDeprecated.readUTF(in);
}

Fixed version (ground truth):
protected void readNodeAttributes(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  this.name=ExternalizableHelperDeprecated.readUTF(in);
}
Program: 145283
Project: 145283
Buggy source:
public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  readNodeAttributes(in);
  int numChildren=in.readInt();
  for (int i=0; i < numChildren; ++i) {
    boolean group=in.readBoolean();
    if (group) {
      String className=in.readUTF();
      QuestionDataGroup newGroup=(QuestionDataGroup)this.getRoot().factory.getNewInstance(className);
      if (newGroup == null) {
        throw new DeserializationException("String_Node_Str" + "String_Node_Str" + className + "String_Node_Str"+ "String_Node_Str");
      }
      newGroup.setRoot(this.getRoot());
      newGroup.readExternal(in,pf);
      newGroup.setRoot(newGroup);
      addChild(newGroup);
    }
 else {
      QuestionDataElement element=new QuestionDataElement();
      element.setRoot(this.getRoot());
      element.readExternal(in,pf);
      addChild(element);
    }
  }
}

Fixed version (ground truth):
public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  readNodeAttributes(in,pf);
  int numChildren=in.readInt();
  for (int i=0; i < numChildren; ++i) {
    boolean group=in.readBoolean();
    if (group) {
      String className=in.readUTF();
      QuestionDataGroup newGroup=(QuestionDataGroup)this.getRoot().factory.getNewInstance(className);
      if (newGroup == null) {
        throw new DeserializationException("String_Node_Str" + "String_Node_Str" + className + "String_Node_Str"+ "String_Node_Str");
      }
      newGroup.setRoot(this.getRoot());
      newGroup.readExternal(in,pf);
      newGroup.setRoot(newGroup);
      addChild(newGroup);
    }
 else {
      QuestionDataElement element=new QuestionDataElement();
      element.setRoot(this.getRoot());
      element.readExternal(in,pf);
      addChild(element);
    }
  }
}
Program: 145284
Project: 145284
Buggy source:
public static PrototypeFactory convertPrototypeFactory(PrototypeFactoryDeprecated pfd){
  PrototypeFactory pf=new PrototypeFactory();
  for (Enumeration e=pfd.prototypes.keys(); e.hasMoreElements(); ) {
    pf.addClass((Class)pfd.prototypes.get(e.nextElement()));
  }
  return pf;
}

Fixed version (ground truth):
public static PrototypeFactory convertPrototypeFactory(PrototypeFactoryDeprecated pfd){
  PrototypeFactory pf=ExtUtil.defaultPrototypes();
  for (Enumeration e=pfd.prototypes.keys(); e.hasMoreElements(); ) {
    pf.addClass((Class)pfd.prototypes.get(e.nextElement()));
  }
  return pf;
}
Program: 145285
Project: 145285
Buggy source:
public void readNodeAttributes(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  super.readNodeAttributes(in);
  String className=in.readUTF();
  reference=(IDataReference)this.getRoot().getFactory().getNewInstance(className);
  if (reference == null) {
    throw new DeserializationException("String_Node_Str" + "String_Node_Str");
  }
  reference.readExternal(in,pf);
}

Fixed version (ground truth):
public void readNodeAttributes(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  super.readNodeAttributes(in,pf);
  String className=in.readUTF();
  reference=(IDataReference)this.getRoot().getFactory().getNewInstance(className);
  if (reference == null) {
    throw new DeserializationException("String_Node_Str" + "String_Node_Str");
  }
  reference.readExternal(in,pf);
}
Program: 145286
Project: 145286
Buggy source:
public void writeExternal(DataOutputStream out) throws IOException {
  ExternalizableHelperDeprecated.writeUTF(out,nodeset);
}

Fixed version (ground truth):
public void writeExternal(DataOutputStream out) throws IOException {
  ExtUtil.writeString(out,nodeset);
}
Program: 145287
Project: 145287
Buggy source:
public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  nodeset=ExternalizableHelperDeprecated.readUTF(in);
}

Fixed version (ground truth):
public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  nodeset=ExtUtil.readString(in);
}
Program: 145288
Project: 145288
Buggy source:
public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  expr=(XPathExpression)ExtUtil.read(in,new ExtWrapTagged());
}

Fixed version (ground truth):
public void readExternal(DataInputStream in,PrototypeFactory pf) throws IOException, DeserializationException {
  expr=(XPathExpression)ExtUtil.read(in,new ExtWrapTagged(),pf);
}
Program: 145291
Project: 145291
Buggy source:
public void start(Context context){
  this.listOfForms=new Map();
  this.formIDs=new Vector();
  getXForms();
  User loggedInUser=(User)context.getElement("String_Node_Str");
  if (loggedInUser.isAdminUser())   this.formsList.addCommand(CMD_ADD_USER);
  this.positionToId=this.formsList.loadView(listOfForms);
  parent.setDisplay(this,this.formsList);
  this.context=context;
}

Fixed version (ground truth):
public void start(Context context){
  this.listOfForms=new Map();
  this.formIDs=new Vector();
  getXForms();
  if (context.getElement("String_Node_Str") != null) {
    User loggedInUser=(User)context.getElement("String_Node_Str");
    if (loggedInUser.isAdminUser())     this.formsList.addCommand(CMD_ADD_USER);
  }
  this.positionToId=this.formsList.loadView(listOfForms);
  parent.setDisplay(this,this.formsList);
  this.context=context;
}
Program: 145292
Project: 145292
Buggy source:
public void commandAction(Command command,Displayable s){
  if (command == backCommand) {
    this.show();
  }
 else   if (command == exitNoSaveCommand) {
    controller.exit();
  }
 else   if (command == exitSaveCommand) {
    controller.save();
    controller.exit();
  }
 else   if (command == saveCommand) {
    controller.save();
  }
 else   if (command == List.SELECT_COMMAND) {
    int i=((List)screen).getSelectedIndex();
    QuestionDef a=(QuestionDef)indexHash.elementAt(i);
    controller.selectQuestion(a.getID() - 1);
    int b=model.getQuestionIndex();
    backCommand=new Command("String_Node_Str",Command.BACK,2);
    FormViewManager manager=new FormViewManager("String_Node_Str",model,controller,b,this);
    manager.show();
  }
}

Fixed version (ground truth):
public void commandAction(Command command,Displayable s){
  if (command == backCommand) {
    this.show();
  }
 else   if (command == exitNoSaveCommand) {
    controller.exit();
  }
 else   if (command == exitSaveCommand) {
    controller.save();
    controller.exit();
  }
 else   if (command == saveCommand) {
    controller.save();
  }
 else   if (command == List.SELECT_COMMAND) {
    int i=((List)screen).getSelectedIndex();
    int b=indexHash.get(i);
    FormViewManager manager=new FormViewManager("String_Node_Str",model,controller,b,this);
    controller.selectQuestion(indexHash.get(i));
  }
}
Program: 145293
Project: 145293
Buggy source:
protected void createView(){
  ((List)screen).deleteAll();
  indexHash=new Vector();
  for (int i=0; i < model.getNumQuestions(); i++) {
    if (model.isRelevant(i)) {
      String stringVal;
      IAnswerData val=model.getForm().getValue(model.getQuestion(i));
      if (val == null) {
        stringVal="String_Node_Str";
      }
 else {
        stringVal=val.getDisplayText();
      }
      ((List)screen).append(model.getQuestion(i).getShortText() + "String_Node_Str" + stringVal,null);
      indexHash.addElement(model.getQuestion(i));
    }
  }
}

Fixed version (ground truth):
protected void createView(){
  ((List)screen).deleteAll();
  indexHash=new SortedIntSet();
  for (int i=0; i < model.getNumQuestions(); i++) {
    if (model.isRelevant(i)) {
      String stringVal;
      IAnswerData val=model.getForm().getValue(model.getQuestion(i));
      if (val == null) {
        stringVal="String_Node_Str";
      }
 else {
        stringVal=val.getDisplayText();
      }
      ((List)screen).append(model.getQuestion(i).getShortText() + "String_Node_Str" + stringVal,null);
      indexHash.add(i);
    }
  }
}
Program: 145294
Project: 145294
Buggy source:
/** 
 * Preload the Data Model with the preload values that are enumerated in the data bindings.
 */
public void preloadModel(){
  IAnswerData preload=null;
  Enumeration en=getBindings().elements();
  while (en.hasMoreElements()) {
    DataBinding binding=(DataBinding)en.nextElement();
    preload=null;
    if (binding.getPreload() != null)     preload=preloader.getQuestionPreload(binding.getPreload(),binding.getPreloadParams());
    if (preload != null) {
      setValue(binding.getReference(),preload);
    }
  }
}

Fixed version (ground truth):
/** 
 * Preload the Data Model with the preload values that are enumerated in the data bindings.
 */
public void preloadModel(){
  IAnswerData preload=null;
  if (getBindings() == null)   return;
  Enumeration en=getBindings().elements();
  while (en.hasMoreElements()) {
    DataBinding binding=(DataBinding)en.nextElement();
    preload=null;
    if (binding.getPreload() != null)     preload=preloader.getQuestionPreload(binding.getPreload(),binding.getPreloadParams());
    if (preload != null) {
      setValue(binding.getReference(),preload);
    }
  }
}
Program: 145296
Project: 145296
Buggy source:
public void commandAction(Command command,Displayable s){
  if (command == backCommand) {
    this.show();
  }
 else   if (command == exitNoSaveCommand) {
    controller.exit();
  }
 else   if (command == exitSaveCommand) {
    controller.save();
    controller.exit();
  }
 else   if (command == saveCommand) {
    controller.save();
  }
 else   if (command == List.SELECT_COMMAND) {
    int i=((List)screen).getSelectedIndex();
    System.out.println("String_Node_Str" + i);
    QuestionDef a=(QuestionDef)indexHash.elementAt(i);
    controller.selectQuestion(a.getID() - 1);
    System.out.println("String_Node_Str" + a.getID());
    int b=model.getQuestionIndex();
    System.out.println("String_Node_Str" + b);
    backCommand=new Command("String_Node_Str",Command.BACK,2);
    FormViewManager manager=new FormViewManager("String_Node_Str",model,controller,b,this);
    manager.show();
  }
}

Fixed version (ground truth):
public void commandAction(Command command,Displayable s){
  if (command == backCommand) {
    this.show();
  }
 else   if (command == exitNoSaveCommand) {
    controller.exit();
  }
 else   if (command == exitSaveCommand) {
    controller.save();
    controller.exit();
  }
 else   if (command == saveCommand) {
    controller.save();
  }
 else   if (command == List.SELECT_COMMAND) {
    int i=((List)screen).getSelectedIndex();
    QuestionDef a=(QuestionDef)indexHash.elementAt(i);
    controller.selectQuestion(a.getID() - 1);
    int b=model.getQuestionIndex();
    backCommand=new Command("String_Node_Str",Command.BACK,2);
    FormViewManager manager=new FormViewManager("String_Node_Str",model,controller,b,this);
    manager.show();
  }
}
Program: 145297
Project: 145297
Buggy source:
public void commandAction(Command c,Item i){
  System.out.println("String_Node_Str");
  if (i == expandedStyle.getInteractiveWidget() && c == nextCommand) {
    cbox.questionAnswered();
  }
 else {
    cbox.commandAction(c,cbox);
  }
}

Fixed version (ground truth):
public void commandAction(Command c,Item i){
  System.out.println("String_Node_Str");
  if (i == expandedStyle.getInteractiveWidget() && c == nextCommand) {
    if (!cbox.isMenuOpened())     cbox.questionAnswered();
  }
 else {
    cbox.commandAction(c,cbox);
  }
}
Program: 145298
Project: 145298
Buggy source:
public void getView(int qIndex){
  prompt=model.getQuestion(qIndex);
  int qType=prompt.getDataType();
switch (qType) {
case Constants.DATATYPE_DATE:
    widget=new DateQuestionWidget(prompt);
  controller.setDisplay(widget);
break;
case Constants.DATATYPE_LIST_MULTIPLE:
widget=new SelectQuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
case Constants.DATATYPE_LIST_EXCLUSIVE:
widget=new Select1QuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
case Constants.DATATYPE_TEXT:
widget=new TextQuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
case Constants.DATATYPE_TIME:
widget=new TimeQuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
case Constants.DATATYPE_INTEGER:
widget=new NumericQuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
default :
System.out.println("String_Node_Str");
break;
}
}

Fixed version (ground truth):
public void getView(int qIndex){
  prompt=model.getQuestion(qIndex);
  int qType=prompt.getDataType();
  int contType=prompt.getControlType();
  System.out.println("String_Node_Str" + qType + "String_Node_Str"+ contType);
  System.out.println("String_Node_Str" + Constants.DATATYPE_LIST_EXCLUSIVE);
switch (contType) {
case Constants.CONTROL_INPUT:
switch (qType) {
case Constants.DATATYPE_DATE:
      widget=new DateQuestionWidget(prompt);
    controller.setDisplay(widget);
  break;
case Constants.DATATYPE_TIME:
widget=new TimeQuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
case Constants.DATATYPE_INTEGER:
widget=new NumericQuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
}
break;
case Constants.CONTROL_SELECT_ONE:
widget=new Select1QuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
case Constants.CONTROL_SELECT_MULTI:
widget=new SelectQuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
case Constants.CONTROL_TEXTAREA:
widget=new TextQuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
default :
System.out.println("String_Node_Str");
break;
}
}
Program: 145299
Project: 145299
Buggy source:
public void commandAction(Command command,Displayable s){
  if (command == backCommand) {
    this.show();
  }
 else   if (command == exitNoSaveCommand) {
    controller.exit();
  }
 else   if (command == exitSaveCommand) {
    controller.save();
    controller.exit();
  }
 else   if (command == saveCommand) {
    controller.save();
  }
 else   if (command == List.SELECT_COMMAND) {
    int i=((List)screen).getSelectedIndex();
    controller.selectQuestion(i);
    backCommand=new Command("String_Node_Str",Command.BACK,2);
    FormViewManager manager=new FormViewManager("String_Node_Str",model,controller,i,this);
    manager.show();
  }
}

Fixed version (ground truth):
public void commandAction(Command command,Displayable s){
  if (command == backCommand) {
    this.show();
  }
 else   if (command == exitNoSaveCommand) {
    controller.exit();
  }
 else   if (command == exitSaveCommand) {
    controller.save();
    controller.exit();
  }
 else   if (command == saveCommand) {
    controller.save();
  }
 else   if (command == List.SELECT_COMMAND) {
    int i=((List)screen).getSelectedIndex();
    System.out.println("String_Node_Str" + i);
    QuestionDef a=(QuestionDef)indexHash.elementAt(i);
    controller.selectQuestion(a.getID() - 1);
    System.out.println("String_Node_Str" + a.getID());
    int b=model.getQuestionIndex();
    System.out.println("String_Node_Str" + b);
    backCommand=new Command("String_Node_Str",Command.BACK,2);
    FormViewManager manager=new FormViewManager("String_Node_Str",model,controller,b,this);
    manager.show();
  }
}
Program: 145300
Project: 145300
Buggy source:
protected void createView(){
  ((List)screen).deleteAll();
  for (int i=0; i < model.getNumQuestions(); i++) {
    if (model.isRelevant(i)) {
      String stringVal;
      IAnswerData val=model.getForm().getValue(model.getQuestion(i));
      if (val == null) {
        System.out.println("String_Node_Str");
        stringVal=null;
      }
 else {
        stringVal=val.getDisplayText();
      }
      if (stringVal == null) {
        stringVal=new String("String_Node_Str");
      }
      ((List)screen).append(model.getQuestion(i).getShortText() + "String_Node_Str" + stringVal,null);
    }
  }
}

Fixed version (ground truth):
protected void createView(){
  ((List)screen).deleteAll();
  indexHash=new Vector();
  for (int i=0; i < model.getNumQuestions(); i++) {
    if (model.isRelevant(i)) {
      String stringVal;
      IAnswerData val=model.getForm().getValue(model.getQuestion(i));
      if (val == null) {
        System.out.println("String_Node_Str");
        stringVal=null;
      }
 else {
        stringVal=val.getDisplayText();
      }
      if (stringVal == null) {
        stringVal=new String("String_Node_Str");
      }
      ((List)screen).append(model.getQuestion(i).getShortText() + "String_Node_Str" + stringVal,null);
      indexHash.addElement(model.getQuestion(i));
    }
  }
}
Program: 145301
Project: 145301
Buggy source:
public Select1QuestionWidget(QuestionDef question){
  super(question);
}

Fixed version (ground truth):
public Select1QuestionWidget(QuestionDef question){
  super(question);
  this.q=question;
}
Program: 145302
Project: 145302
Buggy source:
public IAnswerData getWidgetValue(){
  return null;
}

Fixed version (ground truth):
public IAnswerData getWidgetValue(){
  int selectedIndex=-1;
  for (int i=0; i < cg.size(); i++) {
    if (cg.isSelected(i)) {
      selectedIndex=i;
      break;
    }
  }
  return (selectedIndex == -1 ? null : new SelectOneData(new Selection(selectedIndex,q)));
}
Program: 145303
Project: 145303
Buggy source:
public SelectQuestionWidget(QuestionDef question){
  super(question);
}

Fixed version (ground truth):
public SelectQuestionWidget(QuestionDef question){
  super(question);
  this.q=question;
}
Program: 145304
Project: 145304
Buggy source:
public IAnswerData getWidgetValue(){
  return null;
}

Fixed version (ground truth):
public IAnswerData getWidgetValue(){
  Vector vs=new Vector();
  for (int i=0; i < cg.size(); i++) {
    if (cg.isSelected(i))     vs.addElement(new Selection(i,q));
  }
  return (vs.size() == 0 ? null : new SelectMultiData(vs));
}
Program: 145305
Project: 145305
Buggy source:
public IAnswerData getWidgetValue(){
  if (timePicker.getDate() != null) {
    return new DateData(timePicker.getDate());
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public IAnswerData getWidgetValue(){
  if (timePicker.getDate() != null) {
    return new TimeData(timePicker.getDate());
  }
 else {
    return null;
  }
}
Program: 145306
Project: 145306
Buggy source:
public void getView(int qIndex){
  prompt=model.getQuestion(qIndex);
  int qType=prompt.getDataType();
  int contType=prompt.getControlType();
  System.out.println("String_Node_Str" + qType + "String_Node_Str"+ contType);
  System.out.println("String_Node_Str" + Constants.DATATYPE_LIST_EXCLUSIVE);
switch (contType) {
case Constants.CONTROL_INPUT:
switch (qType) {
case Constants.DATATYPE_DATE:
      widget=new DateQuestionWidget(prompt);
    controller.setDisplay(widget);
  break;
case Constants.DATATYPE_TIME:
widget=new TimeQuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
case Constants.DATATYPE_INTEGER:
widget=new NumericQuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
}
break;
case Constants.CONTROL_SELECT_ONE:
widget=new Select1QuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
case Constants.CONTROL_SELECT_MULTI:
widget=new SelectQuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
case Constants.CONTROL_TEXTAREA:
widget=new TextQuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
default :
System.out.println("String_Node_Str");
break;
}
}

Fixed version (ground truth):
public void getView(int qIndex){
  prompt=model.getQuestion(qIndex);
  int qType=prompt.getDataType();
  int contType=prompt.getControlType();
  System.out.println("String_Node_Str" + qType + "String_Node_Str"+ contType);
  System.out.println("String_Node_Str" + Constants.DATATYPE_LIST_EXCLUSIVE);
switch (contType) {
case Constants.CONTROL_INPUT:
switch (qType) {
case Constants.DATATYPE_DATE:
      widget=new DateQuestionWidget(prompt);
    widget.setCommandListener(this);
  widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
case Constants.DATATYPE_TIME:
widget=new TimeQuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
case Constants.DATATYPE_INTEGER:
widget=new NumericQuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
}
break;
case Constants.CONTROL_SELECT_ONE:
widget=new Select1QuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
case Constants.CONTROL_SELECT_MULTI:
widget=new SelectQuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
case Constants.CONTROL_TEXTAREA:
widget=new TextQuestionWidget(prompt);
widget.setCommandListener(this);
widget.setItemCommandListner(this);
controller.setDisplay(widget);
break;
default :
System.out.println("String_Node_Str");
break;
}
}
Program: 145307
Project: 145307
Buggy source:
private void jumpToQuestion(int questionIndex){
  if (questionIndex != INDEX_NOT_SET && !model.isRelevant(questionIndex))   throw new IllegalStateException();
  if (questionIndex > activeQuestionIndex) {
    if (activeQuestionIndex != INDEX_NOT_SET) {
      ((ChatterboxWidget)get(questionIndexes.indexOf(activeQuestionIndex,true))).setViewState(ChatterboxWidget.VIEW_COLLAPSED);
    }
    for (int i=activeQuestionIndex + 1; i <= questionIndex; i++) {
      putQuestion(i,i == questionIndex);
    }
  }
 else   if (questionIndex <= activeQuestionIndex) {
    for (int i=activeQuestionIndex; i > questionIndex; i--) {
      removeFrame(i);
    }
    if (questionIndex != INDEX_NOT_SET) {
      ((ChatterboxWidget)get(questionIndex)).setViewState(ChatterboxWidget.VIEW_EXPANDED);
    }
  }
  if (activeQuestionIndex != questionIndex) {
    activeQuestionIndex=questionIndex;
    ChatterboxWidget widget=(ChatterboxWidget)get(questionIndexes.indexOf(activeQuestionIndex,true));
    this.focus(widget,true);
    widget.showCommands();
    progressBar.setValue(questionIndex);
  }
  babysitStyles();
}

Fixed version (ground truth):
private void jumpToQuestion(int questionIndex){
  if (questionIndex != INDEX_NOT_SET && !model.isRelevant(questionIndex))   throw new IllegalStateException();
  if (questionIndex > activeQuestionIndex) {
    if (activeQuestionIndex != INDEX_NOT_SET) {
      ((ChatterboxWidget)get(questionIndexes.indexOf(activeQuestionIndex,true))).setViewState(ChatterboxWidget.VIEW_COLLAPSED);
    }
    for (int i=activeQuestionIndex + 1; i <= questionIndex; i++) {
      putQuestion(i,i == questionIndex);
    }
  }
 else   if (questionIndex <= activeQuestionIndex) {
    for (int i=activeQuestionIndex; i > questionIndex; i--) {
      removeFrame(i);
    }
    if (questionIndex != INDEX_NOT_SET) {
      ((ChatterboxWidget)get(questionIndexes.indexOf(questionIndex,true))).setViewState(ChatterboxWidget.VIEW_EXPANDED);
    }
  }
  if (activeQuestionIndex != questionIndex) {
    activeQuestionIndex=questionIndex;
    ChatterboxWidget widget=(ChatterboxWidget)get(questionIndexes.indexOf(activeQuestionIndex,true));
    this.focus(widget,true);
    widget.showCommands();
    progressBar.setValue(questionIndex);
  }
  babysitStyles();
}
Program: 145308
Project: 145308
Buggy source:
public void readExternal(DataInputStream in) throws IOException {
  super.readExternal(in);
  this.formName=in.readUTF();
  this.version=in.readInt();
  this.dateSaved=new Date(in.readLong());
  this.formIdReference=in.readInt();
}

Fixed version (ground truth):
public void readExternal(DataInputStream in) throws IOException, InstantiationException, IllegalAccessException, UnavailableExternalizerException {
  super.readExternal(in);
  this.formName=in.readUTF();
  this.version=in.readInt();
  this.dateSaved=new Date(in.readLong());
  this.formIdReference=in.readInt();
}
Program: 145309
Project: 145309
Buggy source:
public void readExternal(DataInputStream in) throws IOException {
  super.readExternal(in);
  this.formName=ExternalizableHelper.readUTF(in);
  this.version=in.readInt();
  this.type=in.readInt();
}

Fixed version (ground truth):
public void readExternal(DataInputStream in) throws IOException, InstantiationException, IllegalAccessException, UnavailableExternalizerException {
  super.readExternal(in);
  this.formName=ExternalizableHelper.readUTF(in);
  this.version=in.readInt();
  this.type=in.readInt();
}
Program: 145310
Project: 145310
Buggy source:
/** 
 * (non-Javadoc)
 * @see org.javarosa.core.util.clforms.storage.Externalizable#readExternal(DataInputStream)
 */
public void readExternal(DataInputStream in) throws IOException {
  this.name=in.readUTF();
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @see org.javarosa.core.util.clforms.storage.Externalizable#readExternal(DataInputStream)
 */
public void readExternal(DataInputStream in) throws IOException, InstantiationException, IllegalAccessException, UnavailableExternalizerException {
  this.name=in.readUTF();
}
Program: 145311
Project: 145311
Buggy source:
public void readExternal(DataInputStream in) throws IOException {
  this.recordId=in.readInt();
  this.size=in.readInt();
}

Fixed version (ground truth):
public void readExternal(DataInputStream in) throws IOException, InstantiationException, IllegalAccessException, UnavailableExternalizerException {
  this.recordId=in.readInt();
  this.size=in.readInt();
}
Program: 145312
Project: 145312
Buggy source:
public void readExternal(DataInputStream in) throws IOException {
  super.readExternal(in);
  this.patientRecordId=in.readInt();
  this.patientName=in.readUTF();
  this.patientId=ExternalizableHelper.readUTF(in);
}

Fixed version (ground truth):
public void readExternal(DataInputStream in) throws IOException, InstantiationException, IllegalAccessException, UnavailableExternalizerException {
  super.readExternal(in);
  this.patientRecordId=in.readInt();
  this.patientName=in.readUTF();
  this.patientId=ExternalizableHelper.readUTF(in);
}
Program: 145313
Project: 145313
Buggy source:
public void readExternal(DataInputStream in) throws IOException {
  super.readExternal(in);
  this.formId=in.readInt();
}

Fixed version (ground truth):
public void readExternal(DataInputStream in) throws IOException, InstantiationException, IllegalAccessException, UnavailableExternalizerException {
  super.readExternal(in);
  this.formId=in.readInt();
}
Program: 145314
Project: 145314
Buggy source:
/** 
 * Preloads a StringData object for the preload type 'property'
 * @param preloadParams The parameters determining the property to be retrieved
 * @return A preload property value if the parameters can be parsed,null otherwise
 */
private IAnswerData preloadProperty(String preloadParams){
  String propname=preloadParams;
  String propval=JavaRosaServiceProvider.instance().getPropertyManager().getSingularProperty(propname);
  String preloadVal=null;
  if (propval != null && propval.length() > 0) {
    preloadVal=propval;
  }
  StringData data=new StringData(preloadVal);
  return data;
}

Fixed version (ground truth):
/** 
 * Preloads a StringData object for the preload type 'property'
 * @param preloadParams The parameters determining the property to be retrieved
 * @return A preload property value if the parameters can be parsed,null otherwise
 */
private IAnswerData preloadProperty(String preloadParams){
  String propname=preloadParams;
  String propval=JavaRosaServiceProvider.instance().getPropertyManager().getSingularProperty(propname);
  StringData preloadVal=null;
  if (propval != null && propval.length() > 0) {
    preloadVal=new StringData(propval);
  }
  return preloadVal;
}
Program: 145315
Project: 145315
Buggy source:
/** 
 * Preloads a StringData object for the preload type 'timestamp' s
 * @param preloadParams The parameters determining the timestamp
 * @return A preload string value if the parameters can be parsed,null otherwise
 */
private IAnswerData preloadTimestamp(String preloadParams){
  String value=null;
  if ("String_Node_Str".equals(preloadParams)) {
    value=DateUtils.formatDateToTimeStamp(new Date());
  }
  return new StringData(value);
}

Fixed version (ground truth):
/** 
 * Preloads a StringData object for the preload type 'timestamp' s
 * @param preloadParams The parameters determining the timestamp
 * @return A preload string value if the parameters can be parsed,null otherwise
 */
private IAnswerData preloadTimestamp(String preloadParams){
  StringData value=null;
  if ("String_Node_Str".equals(preloadParams)) {
    value=new StringData(DateUtils.formatDateToTimeStamp(new Date()));
  }
  return value;
}
Program: 145316
Project: 145316
Buggy source:
public boolean handlePostProcess(IFormDataModel model,IDataReference ref,String params){
  IAnswerData data=model.getDataValue(ref);
  if ("String_Node_Str".equals(params)) {
    patient.setVaccinations((ImmunizationData)data);
    return true;
  }
 else {
  }
  return false;
}

Fixed version (ground truth):
public boolean handlePostProcess(IFormDataModel model,IDataReference ref,String params){
  IAnswerData data=model.getDataValue(ref);
  if ("String_Node_Str".equals(params)) {
    patient.setVaccinations((ImmunizationData)((ImmunizationAnswerData)data).getValue());
    return true;
  }
 else {
  }
  return false;
}