nus-yam/ex-repair huggingface dataset:
Program: 142054
Project: 142054
Buggy source:
private void initUKRForLogin(){
  if (shouldGenerateFirstKey()) {
    SecretKey newKey=CryptUtil.generateSemiRandomKey();
    if (newKey == null) {
      return;
    }
    String sandboxId=PropertyUtils.genUUID().replace("String_Node_Str","String_Node_Str");
    ukrForLogin=new UserKeyRecord(username,UserKeyRecord.generatePwdHash(password),newKey.getEncoded(),new Date(),new Date(Long.MAX_VALUE),sandboxId);
  }
 else {
    ukrForLogin=UserKeyRecord.getCurrentValidRecordByPassword(CommCareApplication._().getCurrentApp(),username,password,true);
    if (ukrForLogin == null) {
      Logger.log(AndroidLogger.TYPE_ERROR_ASSERTION,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void initUKRForLogin(){
  if (shouldGenerateFirstKey()) {
    SecretKey newKey=CryptUtil.generateSemiRandomKey();
    if (newKey == null) {
      return;
    }
    String sandboxId=PropertyUtils.genUUID().replace("String_Node_Str","String_Node_Str");
    ukrForLogin=new UserKeyRecord(username,UserKeyRecord.generatePwdHash(password),ByteEncrypter.wrapByteArrayWithString(newKey.getEncoded(),password),new Date(),new Date(Long.MAX_VALUE),sandboxId);
  }
 else {
    ukrForLogin=UserKeyRecord.getCurrentValidRecordByPassword(CommCareApplication._().getCurrentApp(),username,password,true);
    if (ukrForLogin == null) {
      Logger.log(AndroidLogger.TYPE_ERROR_ASSERTION,"String_Node_Str");
    }
  }
}
Program: 142055
Project: 142055
Buggy source:
@Override public void onClick(View v){
  startRecording();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  stopRecording();
}
Program: 142056
Project: 142056
Buggy source:
@Override public void onDismiss(DialogInterface dialog){
  super.onDismiss(dialog);
  if (recorder != null) {
    recorder.release();
    setRecorder(null);
  }
  toggleRecording.setEnabled(true);
  toggleRecording.setBackgroundResource(R.drawable.record_start);
  toggleRecording.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      startRecording();
    }
  }
);
  instruction.setText(Localization.get("String_Node_Str"));
  saveRecording.setEnabled(false);
  saveRecording.setBackgroundColor(getResources().getColor(R.color.transparent));
  saveRecording.setTextColor(getResources().getColor(R.color.grey));
  mpc.setPercent(0);
}

Fixed version (ground truth):
@Override public void onDismiss(DialogInterface dialog){
  super.onDismiss(dialog);
  if (recorder != null) {
    recorder.release();
    this.recorder=null;
  }
}
Program: 142057
Project: 142057
Buggy source:
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  layout=(LinearLayout)inflater.inflate(R.layout.recording_fragment,container);
  prepareButtons();
  prepareText();
  setWindowSize();
  fileName=Environment.getExternalStorageDirectory().getAbsolutePath() + FILE_EXT;
  return layout;
}

Fixed version (ground truth):
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  layout=(LinearLayout)inflater.inflate(R.layout.recording_fragment,container);
  enableScreenRotation();
  prepareButtons();
  prepareText();
  setWindowSize();
  fileName=Environment.getExternalStorageDirectory().getAbsolutePath() + FILE_EXT;
  return layout;
}
Program: 142058
Project: 142058
Buggy source:
private void stopRecording(){
  mpc.setPercent(mpc.getPercent());
  mpc.setStartColor(getResources().getColor(R.color.blue_grey));
  mpc.setEndColor(getResources().getColor(R.color.blue_grey));
  recorder.stop();
  toggleRecording.setEnabled(false);
  toggleRecording.setBackgroundResource(R.drawable.record_complete);
  saveRecording.setEnabled(true);
  enableScreenRotation();
  instruction.setText(Localization.get("String_Node_Str"));
  saveRecording.setTextColor(getResources().getColor(R.color.white));
  saveRecording.setBackgroundColor(getResources().getColor(R.color.cc_attention_positive_color));
}

Fixed version (ground truth):
private void stopRecording(){
  mpc.setPercent(mpc.getPercent());
  mpc.setStartColor(getResources().getColor(R.color.blue_grey));
  mpc.setEndColor(getResources().getColor(R.color.blue_grey));
  recorder.stop();
  toggleRecording.setEnabled(false);
  toggleRecording.setBackgroundResource(R.drawable.record_complete);
  saveRecording.setEnabled(true);
  instruction.setText(Localization.get("String_Node_Str"));
  saveRecording.setTextColor(getResources().getColor(R.color.white));
  saveRecording.setBackgroundColor(getResources().getColor(R.color.cc_attention_positive_color));
}
Program: 142059
Project: 142059
Buggy source:
@Override protected void togglePlayButton(boolean enabled){
  mPlayButton.setEnabled(enabled);
}

Fixed version (ground truth):
@Override protected void togglePlayButton(boolean enabled){
  if (enabled) {
    mPlayButton.setBackgroundResource(R.drawable.play);
  }
 else {
    mPlayButton.setBackgroundResource(R.drawable.play_disabled);
  }
  mPlayButton.setEnabled(enabled);
}
Program: 142060
Project: 142060
Buggy source:
public AudioWidget(Context context,final FormEntryPrompt prompt,PendingCalloutInterface pic){
  super(context,prompt);
  initializeButtons(prompt);
  setupLayout();
  this.pendingCalloutInterface=pic;
  mInstanceFolder=FormEntryActivity.mInstancePath.substring(0,FormEntryActivity.mInstancePath.lastIndexOf("String_Node_Str") + 1);
  setOrientation(LinearLayout.VERTICAL);
  mBinaryName=prompt.getAnswerText();
  if (mBinaryName != null) {
    togglePlayButton(true);
    File f=new File(mInstanceFolder + mBinaryName);
    checkFileSize(f);
  }
 else {
    disablePlayButton();
  }
  String acq=prompt.getAppearanceHint();
  if ((QuestionWidget.ACQUIREFIELD.equalsIgnoreCase(acq))) {
    mChooseButton.setVisibility(View.GONE);
  }
}

Fixed version (ground truth):
public AudioWidget(Context context,final FormEntryPrompt prompt,PendingCalloutInterface pic){
  super(context,prompt);
  initializeButtons(prompt);
  setupLayout();
  this.pendingCalloutInterface=pic;
  mInstanceFolder=FormEntryActivity.mInstancePath.substring(0,FormEntryActivity.mInstancePath.lastIndexOf("String_Node_Str") + 1);
  setOrientation(LinearLayout.VERTICAL);
  mBinaryName=prompt.getAnswerText();
  if (mBinaryName != null) {
    togglePlayButton(true);
    File f=new File(mInstanceFolder + mBinaryName);
    checkFileSize(f);
  }
 else {
    togglePlayButton(false);
  }
  String acq=prompt.getAppearanceHint();
  if ((QuestionWidget.ACQUIREFIELD.equalsIgnoreCase(acq))) {
    mChooseButton.setVisibility(View.GONE);
  }
}
Program: 142061
Project: 142061
Buggy source:
@Override public void clearAnswer(){
  deleteMedia();
  disablePlayButton();
}

Fixed version (ground truth):
@Override public void clearAnswer(){
  deleteMedia();
  togglePlayButton(false);
}
Program: 142062
Project: 142062
Buggy source:
@Override public void onDismiss(DialogInterface dialog){
  super.onDismiss(dialog);
  if (recorder != null) {
    recorder.release();
    setRecorder(null);
  }
  toggleRecording.setEnabled(true);
  toggleRecording.setBackgroundResource(R.drawable.record_start);
  toggleRecording.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      startRecording();
    }
  }
);
  saveRecording.setEnabled(false);
  instruction.setText(Localization.get("String_Node_Str"));
  saveRecording.setBackgroundColor(getResources().getColor(R.color.transparent));
  saveRecording.setTextColor(getResources().getColor(R.color.grey));
}

Fixed version (ground truth):
@Override public void onDismiss(DialogInterface dialog){
  super.onDismiss(dialog);
  if (recorder != null) {
    recorder.release();
    setRecorder(null);
  }
  toggleRecording.setEnabled(true);
  toggleRecording.setBackgroundResource(R.drawable.record_start);
  toggleRecording.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      startRecording();
    }
  }
);
  instruction.setText(Localization.get("String_Node_Str"));
  saveRecording.setEnabled(false);
  saveRecording.setBackgroundColor(getResources().getColor(R.color.transparent));
  saveRecording.setTextColor(getResources().getColor(R.color.grey));
}
Program: 142063
Project: 142063
Buggy source:
protected void prepareText(){
  header=(TextView)layout.findViewById(R.id.recording_header);
  instruction=(TextView)layout.findViewById(R.id.recording_instruction);
  header.setText(Localization.get("String_Node_Str"));
  instruction.setText(Localization.get("String_Node_Str"));
}

Fixed version (ground truth):
protected void prepareText(){
  TextView header=(TextView)layout.findViewById(R.id.recording_header);
  instruction=(TextView)layout.findViewById(R.id.recording_instruction);
  header.setText(Localization.get("String_Node_Str"));
  instruction.setText(Localization.get("String_Node_Str"));
}
Program: 142064
Project: 142064
Buggy source:
private void startRecording(){
  disableRotation();
  if (recorder == null) {
    recorder=new MediaRecorder();
  }
  setupRecorder();
  recorder.start();
  toggleRecording.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      stopRecording();
    }
  }
);
  toggleRecording.setBackgroundResource(R.drawable.record_in_progress);
  instruction.setText(Localization.get("String_Node_Str"));
  myProgress.setVisibility(View.VISIBLE);
}

Fixed version (ground truth):
private void startRecording(){
  disableScreenRotation();
  if (recorder == null) {
    recorder=new MediaRecorder();
  }
  setupRecorder();
  recorder.start();
  toggleRecording.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      stopRecording();
    }
  }
);
  toggleRecording.setBackgroundResource(R.drawable.record_in_progress);
  instruction.setText(Localization.get("String_Node_Str"));
  myProgress.setVisibility(View.VISIBLE);
}
Program: 142065
Project: 142065
Buggy source:
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  layout=(LinearLayout)inflater.inflate(R.layout.recording_fragment,container);
  prepareButtons();
  prepareText();
  setWindowSize();
  fileName=Environment.getExternalStorageDirectory().getAbsolutePath();
  fileName+=FILE_EXT;
  return layout;
}

Fixed version (ground truth):
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  layout=(LinearLayout)inflater.inflate(R.layout.recording_fragment,container);
  prepareButtons();
  prepareText();
  setWindowSize();
  fileName=Environment.getExternalStorageDirectory().getAbsolutePath() + FILE_EXT;
  return layout;
}
Program: 142066
Project: 142066
Buggy source:
private void stopRecording(){
  recorder.stop();
  toggleRecording.setEnabled(false);
  toggleRecording.setBackgroundResource(R.drawable.record_complete);
  saveRecording.setEnabled(true);
  enableRotation();
  myProgress.setVisibility(View.INVISIBLE);
  instruction.setText(Localization.get("String_Node_Str"));
  saveRecording.setTextColor(getResources().getColor(R.color.white));
  saveRecording.setBackgroundColor(getResources().getColor(R.color.green));
}

Fixed version (ground truth):
private void stopRecording(){
  recorder.stop();
  toggleRecording.setEnabled(false);
  toggleRecording.setBackgroundResource(R.drawable.record_complete);
  saveRecording.setEnabled(true);
  enableScreenRotation();
  myProgress.setVisibility(View.INVISIBLE);
  instruction.setText(Localization.get("String_Node_Str"));
  saveRecording.setTextColor(getResources().getColor(R.color.white));
  saveRecording.setBackgroundColor(getResources().getColor(R.color.green));
}
Program: 142067
Project: 142067
Buggy source:
/** 
 * Decides if we should actually be on the home screen, or else should redirect elsewhere
 */
private void attemptDispatchHomeScreen(){
  try {
    CommCareApplication._().getSession();
  }
 catch (  SessionUnavailableException e) {
    setResult(RESULT_OK);
    this.finish();
    return;
  }
  if (CommCareApplication._().isSyncPending(false)) {
    handlePendingSync();
  }
 else   if (CommCareApplication._().isConsumerApp() && !sessionNavigationProceedingAfterOnResume) {
  }
 else {
    uiController.refreshView();
  }
}

Fixed version (ground truth):
/** 
 * Decides if we should actually be on the home screen, or else should redirect elsewhere
 */
private void attemptDispatchHomeScreen(){
  try {
    CommCareApplication._().getSession();
  }
 catch (  SessionUnavailableException e) {
    setResult(RESULT_OK);
    this.finish();
    return;
  }
  if (CommCareApplication._().isSyncPending(false)) {
    handlePendingSync();
  }
 else   if (CommCareApplication._().isConsumerApp() && !sessionNavigationProceedingAfterOnResume) {
    sessionNavigationProceedingAfterOnResume=false;
    enterRootModule();
  }
 else {
    uiController.refreshView();
  }
}
Program: 142068
Project: 142068
Buggy source:
private void handleGetCommand(AndroidSessionWrapper asw){
  Intent i;
  String command=asw.getSession().getCommand();
  if (useGridMenu(command)) {
    i=new Intent(getApplicationContext(),MenuGrid.class);
  }
 else {
    i=new Intent(getApplicationContext(),MenuList.class);
  }
  i.putExtra(SessionFrame.STATE_COMMAND_ID,command);
  addPendingDataExtra(i,asw.getSession());
  startActivityForResult(i,GET_COMMAND);
}

Fixed version (ground truth):
private void handleGetCommand(AndroidSessionWrapper asw){
  Intent i;
  String command=asw.getSession().getCommand();
  if (useGridMenu(command)) {
    i=new Intent(this,MenuGrid.class);
  }
 else {
    i=new Intent(this,MenuList.class);
  }
  i.putExtra(SessionFrame.STATE_COMMAND_ID,command);
  addPendingDataExtra(i,asw.getSession());
  startActivityForResult(i,GET_COMMAND);
}
Program: 142069
Project: 142069
Buggy source:
/** 
 * Decides if we should actually be on the home screen, or else should redirect elsewhere
 */
private void attemptDispatchHomeScreen(){
  try {
    CommCareApplication._().getSession();
  }
 catch (  SessionUnavailableException e) {
    setResult(RESULT_OK);
    this.finish();
    return;
  }
  if (CommCareApplication._().isSyncPending(false)) {
    handlePendingSync();
  }
 else   if (CommCareApplication._().isConsumerApp() && !sessionNavigationProceedingAfterOnResume) {
    enterRootModule();
  }
 else {
    uiController.refreshView();
  }
}

Fixed version (ground truth):
/** 
 * Decides if we should actually be on the home screen, or else should redirect elsewhere
 */
private void attemptDispatchHomeScreen(){
  try {
    CommCareApplication._().getSession();
  }
 catch (  SessionUnavailableException e) {
    setResult(RESULT_OK);
    this.finish();
    return;
  }
  if (CommCareApplication._().isSyncPending(false)) {
    handlePendingSync();
  }
 else   if (CommCareApplication._().isConsumerApp() && !sessionNavigationProceedingAfterOnResume) {
  }
 else {
    uiController.refreshView();
  }
}
Program: 142070
Project: 142070
Buggy source:
void enterRootModule(){
  Intent i;
  if (useGridMenu(org.commcare.suite.model.Menu.ROOT_MENU_ID)) {
    i=new Intent(getApplicationContext(),MenuGrid.class);
  }
 else {
    i=new Intent(getApplicationContext(),MenuList.class);
  }
  addPendingDataExtra(i,CommCareApplication._().getCurrentSessionWrapper().getSession());
  startActivityForResult(i,GET_COMMAND);
}

Fixed version (ground truth):
void enterRootModule(){
  Intent i;
  if (useGridMenu(org.commcare.suite.model.Menu.ROOT_MENU_ID)) {
    i=new Intent(this,MenuGrid.class);
  }
 else {
    i=new Intent(this,MenuList.class);
  }
  addPendingDataExtra(i,CommCareApplication._().getCurrentSessionWrapper().getSession());
  startActivityForResult(i,GET_COMMAND);
}
Program: 142071
Project: 142071
Buggy source:
private void checkForChangedCCZ(){
  alreadyCheckedForAppFilesChange=true;
  Intent i=new Intent(getApplicationContext(),UpdateActivity.class);
  startActivity(i);
}

Fixed version (ground truth):
private void checkForChangedCCZ(){
  alreadyCheckedForAppFilesChange=true;
  Intent i=new Intent(this,UpdateActivity.class);
  startActivityForResult(i,UPDATE_CONSUMER_APP);
}
Program: 142072
Project: 142072
Buggy source:
@Override protected long getCurrentMillis(){
  int day=Integer.parseInt(dayTxt.getText().toString());
  int month=monthArrayPointer + 1;
  int year=Integer.parseInt(yearTxt.getText().toString());
  if (day > myCal.getActualMaximum(Calendar.DAY_OF_MONTH)) {
    dayTxt.setText(String.valueOf(myCal.getActualMaximum(Calendar.DAY_OF_MONTH)));
    day=Integer.parseInt(dayTxt.getText().toString());
  }
  return toMillisFromJavaEpoch(year,month,day,millisOfDayOffset);
}

Fixed version (ground truth):
@Override protected long getCurrentMillis(){
  if (dayTxt.getText().toString().equals("String_Node_Str")) {
    dayTxt.setText(String.valueOf(myCal.get(Calendar.DAY_OF_MONTH)));
  }
  if (monthTxt.getText().toString().equals("String_Node_Str")) {
    monthTxt.setText(monthsArray[monthArrayPointer]);
  }
  if (yearTxt.getText().toString().equals("String_Node_Str")) {
    yearTxt.setText(String.valueOf(myCal.get(Calendar.YEAR)));
  }
  int day=Integer.parseInt(dayTxt.getText().toString());
  int month=monthArrayPointer + 1;
  int year=Integer.parseInt(yearTxt.getText().toString());
  if (day > myCal.getActualMaximum(Calendar.DAY_OF_MONTH)) {
    dayTxt.setText(String.valueOf(myCal.getActualMaximum(Calendar.DAY_OF_MONTH)));
    day=Integer.parseInt(dayTxt.getText().toString());
  }
  return toMillisFromJavaEpoch(year,month,day,millisOfDayOffset);
}
Program: 142073
Project: 142073
Buggy source:
private void initOnClick(){
  decMonth.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      myCal.add(Calendar.MONTH,-1);
      updateCalendar();
    }
  }
);
  incMonth.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      myCal.add(Calendar.MONTH,1);
      updateCalendar();
    }
  }
);
  decYear.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      myCal.add(Calendar.YEAR,-1);
      updateCalendar();
    }
  }
);
  incYear.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      myCal.add(Calendar.YEAR,1);
      updateCalendar();
    }
  }
);
  myGrid.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      Date date=(Date)parent.getItemAtPosition(position);
      myCal.setTime(date);
      updateCalendar();
    }
  }
);
}

Fixed version (ground truth):
private void initOnClick(){
  decMonth.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      myCal.add(Calendar.MONTH,-1);
      refresh();
    }
  }
);
  incMonth.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      myCal.add(Calendar.MONTH,1);
      refresh();
    }
  }
);
  decYear.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      myCal.add(Calendar.YEAR,-1);
      refresh();
    }
  }
);
  incYear.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      myCal.add(Calendar.YEAR,1);
      refresh();
    }
  }
);
  myGrid.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      Date date=(Date)parent.getItemAtPosition(position);
      myCal.setTime(date);
      refresh();
    }
  }
);
}
Program: 142074
Project: 142074
Buggy source:
@Override public void onClick(View v){
  myCal.add(Calendar.YEAR,1);
  updateCalendar();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  myCal.add(Calendar.YEAR,1);
  refresh();
}
Program: 142075
Project: 142075
Buggy source:
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  Date date=(Date)parent.getItemAtPosition(position);
  myCal.setTime(date);
  updateCalendar();
}

Fixed version (ground truth):
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  Date date=(Date)parent.getItemAtPosition(position);
  myCal.setTime(date);
  refresh();
}
Program: 142076
Project: 142076
Buggy source:
public CalendarWidget(Context context,FormEntryPrompt prompt){
  super(context,prompt);
  LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  myLayout=(LinearLayout)inflater.inflate(R.layout.calendar_widget,null);
  addView(myLayout);
  myCal=Calendar.getInstance();
  initDisplay();
  initMonths();
  initWeekDays();
  updateCalendar();
  initOnClick();
}

Fixed version (ground truth):
public CalendarWidget(Context context,FormEntryPrompt prompt,Calendar cal){
  super(context,prompt);
  LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  myLayout=(LinearLayout)inflater.inflate(R.layout.calendar_widget,null);
  addView(myLayout);
  myCal=cal;
  initDisplay();
  initMonths();
  initWeekDays();
  refresh();
  initOnClick();
}
Program: 142077
Project: 142077
Buggy source:
public void setDate(DateData newDate){
  Date nextDate=(Date)newDate.getValue();
  myCal.setTimeInMillis(nextDate.getTime());
  updateCalendar();
}

Fixed version (ground truth):
public void setDate(DateData newDate){
  Date nextDate=(Date)newDate.getValue();
  myCal.setTimeInMillis(nextDate.getTime());
  refresh();
}
Program: 142078
Project: 142078
Buggy source:
@Override public void clearAnswer(){
  myCal=Calendar.getInstance();
  updateCalendar();
}

Fixed version (ground truth):
@Override public void clearAnswer(){
  myCal=Calendar.getInstance();
  refresh();
}
Program: 142079
Project: 142079
Buggy source:
@Override protected void inflateView(Context context){
  LayoutInflater vi=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View vv=vi.inflate(R.layout.gregorian_date_widget,null);
  addView(vv);
}

Fixed version (ground truth):
@Override protected void inflateView(Context context){
  LayoutInflater vi=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  myView=(LinearLayout)vi.inflate(R.layout.gregorian_date_widget,null);
  addView(myView);
}
Program: 142080
Project: 142080
Buggy source:
public void clearAll(){
  dayTxt.setText("String_Node_Str");
  monthTxt.setText("String_Node_Str");
  yearTxt.setText("String_Node_Str");
  super.setFocus(getContext());
}

Fixed version (ground truth):
private void clearAll(){
  dayTxt.setText("String_Node_Str");
  monthTxt.setText("String_Node_Str");
  yearTxt.setText("String_Node_Str");
  super.setFocus(getContext());
}
Program: 142082
Project: 142082
Buggy source:
@Override public void afterTextChanged(Editable s){
  String contents=s.toString();
  if (contents.length() > 0) {
    int maxYear=myCal.get(Calendar.YEAR) + 1;
    if (Integer.parseInt(contents) > maxYear) {
      s.clear();
      s.append(String.valueOf(maxYear));
    }
  }
}

Fixed version (ground truth):
@Override public void afterTextChanged(Editable s){
  String contents=s.toString();
  if (contents.length() >= 4) {
    int maxYear=myCal.get(Calendar.YEAR) + 1;
    if (Integer.parseInt(contents) > maxYear) {
      s.clear();
      s.append(String.valueOf(maxYear));
    }
    myCal.set(Calendar.YEAR,Integer.parseInt(contents));
  }
}
Program: 142083
Project: 142083
Buggy source:
public void setDate(DateData newDate){
  Date nextDate=(Date)newDate.getValue();
  updateDateDisplay(nextDate.getTime());
}

Fixed version (ground truth):
protected void setDate(DateData newDate){
  Date nextDate=(Date)newDate.getValue();
  updateDateDisplay(nextDate.getTime());
}
Program: 142084
Project: 142084
Buggy source:
@Override public void onClick(View v){
  openCalendar();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  closeCalendar();
}
Program: 142085
Project: 142085
Buggy source:
@Override public IAnswerData getAnswer(){
  if (myCal.getVisibility() != GONE) {
    closeCalendar();
  }
  return myGreg.getAnswer();
}

Fixed version (ground truth):
@Override public IAnswerData getAnswer(){
  if (myCal.getVisibility() != GONE) {
    closeCalendar();
  }
  return super.getAnswer();
}
Program: 142086
Project: 142086
Buggy source:
protected void openCalendar(){
  if (myGreg.getAnswer() != null) {
    myCal.setDate((DateData)myGreg.getAnswer());
  }
 else {
    myCal.setDate(new DateData(new Date()));
  }
  myGreg.setFocus(getContext());
  myGreg.setVisibility(GONE);
  myCal.setVisibility(VISIBLE);
}

Fixed version (ground truth):
protected void openCalendar(){
  myCal.refresh();
  setFocus(getContext());
  myView.setVisibility(GONE);
  myCal.setVisibility(VISIBLE);
}
Program: 142087
Project: 142087
Buggy source:
public Prototype1(Context con,FormEntryPrompt prompt){
  super(con,prompt);
  myGreg=new GregorianDateWidget(con,prompt);
  myCal=new CalendarWidget(con,prompt);
  myCal.setVisibility(GONE);
  myGreg.removeQuestionText();
  myCal.removeQuestionText();
  addView(myCal);
  addView(myGreg);
  initButtons();
}

Fixed version (ground truth):
public Prototype1(Context con,FormEntryPrompt prompt){
  super(con,prompt);
  myCal=new CalendarWidget(con,prompt,getMyCal());
  myCal.setVisibility(GONE);
  myCal.removeQuestionText();
  addView(myCal);
  initButtons();
}
Program: 142088
Project: 142088
Buggy source:
protected void closeCalendar(){
  myGreg.setDate((DateData)myCal.getAnswer());
  myCal.setVisibility(GONE);
  myGreg.setVisibility(VISIBLE);
}

Fixed version (ground truth):
protected void closeCalendar(){
  refresh();
  myCal.setVisibility(GONE);
  myView.setVisibility(VISIBLE);
}
Program: 142089
Project: 142089
Buggy source:
private void initView(){
  findViewById(R.id.dayupbtn).setVisibility(GONE);
  findViewById(R.id.daydownbtn).setVisibility(GONE);
  findViewById(R.id.monthupbtn).setVisibility(GONE);
  findViewById(R.id.monthdownbtn).setVisibility(GONE);
  findViewById(R.id.yearupbtn).setVisibility(GONE);
  findViewById(R.id.yeardownbtn).setVisibility(GONE);
  findViewById(R.id.clearall).setVisibility(GONE);
  findViewById(R.id.widgetinfo).setVisibility(GONE);
  ImageButton openCalendar=new ImageButton(getContext());
  openCalendar.setImageResource(R.drawable.avatar_vellum_date);
  super.addCalendarButton(openCalendar);
  addView(openCalendar);
  LinearLayout.LayoutParams calParams=(LinearLayout.LayoutParams)openCalendar.getLayoutParams();
  calParams.gravity=Gravity.RIGHT;
  calParams.width=LayoutParams.WRAP_CONTENT;
  calParams.height=LayoutParams.WRAP_CONTENT;
}

Fixed version (ground truth):
private void initView(){
  findViewById(R.id.dayupbtn).setVisibility(GONE);
  findViewById(R.id.daydownbtn).setVisibility(GONE);
  findViewById(R.id.monthupbtn).setVisibility(GONE);
  findViewById(R.id.monthdownbtn).setVisibility(GONE);
  findViewById(R.id.yearupbtn).setVisibility(GONE);
  findViewById(R.id.yeardownbtn).setVisibility(GONE);
  findViewById(R.id.clearall).setVisibility(GONE);
  findViewById(R.id.widgetinfo).setVisibility(GONE);
  final ImageButton openCalendar=new ImageButton(getContext());
  openCalendar.setImageResource(R.drawable.avatar_vellum_date);
  openCalendar.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      openCalendar();
    }
  }
);
  myView.addView(openCalendar);
  LinearLayout.LayoutParams calParams=(LinearLayout.LayoutParams)openCalendar.getLayoutParams();
  calParams.gravity=Gravity.RIGHT;
  calParams.width=LayoutParams.WRAP_CONTENT;
  calParams.height=LayoutParams.WRAP_CONTENT;
}
Program: 142090
Project: 142090
Buggy source:
@Override public void onClick(View v){
  Date current=(Date)getMyGreg().getAnswer().getValue();
  Calendar cal=Calendar.getInstance();
  cal.setTime(current);
  cal.add(Calendar.DATE,-7);
  getMyGreg().setDate(new DateData(cal.getTime()));
}

Fixed version (ground truth):
@Override public void onClick(View v){
  Date current=(Date)getAnswer().getValue();
  Calendar cal=Calendar.getInstance();
  cal.setTime(current);
  cal.add(Calendar.DATE,-7);
  setDate(new DateData(cal.getTime()));
}
Program: 142092
Project: 142092
Buggy source:
private ArrayList<Field> getPersistedFieldsInOrder(){
  ArrayList<Field> orderings;
synchronized (fieldOrderings) {
    orderings=fieldOrderings.get(this.getClass());
    if (orderings == null) {
      orderings=new ArrayList<>();
      fieldOrderings.put(this.getClass(),orderings);
    }
  }
synchronized (orderings) {
    if (orderings.size() == 0) {
      for (      Field f : this.getClass().getDeclaredFields()) {
        if (f.isAnnotationPresent(Persisting.class)) {
          orderings.add(f);
        }
      }
      Collections.sort(orderings,orderedComparator);
    }
    return orderings;
  }
}

Fixed version (ground truth):
private ArrayList<Field> getPersistedFieldsInOrder(){
  ArrayList<Field> orderings;
synchronized (fieldOrderings) {
    orderings=fieldOrderings.get(this.getClass());
    if (orderings == null) {
      orderings=new ArrayList<>();
      fieldOrderings.put(this.getClass(),orderings);
    }
    if (orderings.size() == 0) {
      for (      Field f : this.getClass().getDeclaredFields()) {
        if (f.isAnnotationPresent(Persisting.class)) {
          orderings.add(f);
        }
      }
      Collections.sort(orderings,orderedComparator);
    }
    return orderings;
  }
}
Program: 142093
Project: 142093
Buggy source:
public String getMetaDataFieldForRecord(int recordId,String rawFieldName){
  String rid=String.valueOf(recordId);
  String scrubbedName=AndroidTableBuilder.scrubName(rawFieldName);
  Cursor c=helper.getHandle().query(table,new String[]{scrubbedName},DatabaseHelper.ID_COL + "String_Node_Str",new String[]{rid},null,null,null);
  try {
    if (c.getCount() == 0) {
      throw new NoSuchElementException("String_Node_Str" + table + "String_Node_Str"+ recordId);
    }
    c.moveToFirst();
    return c.getString(c.getColumnIndexOrThrow(scrubbedName));
  }
  finally {
    if (c != null) {
      c.close();
    }
  }
}

Fixed version (ground truth):
public String getMetaDataFieldForRecord(int recordId,String rawFieldName){
  String rid=String.valueOf(recordId);
  String scrubbedName=AndroidTableBuilder.scrubName(rawFieldName);
  Cursor c=helper.getHandle().query(table,new String[]{scrubbedName},DatabaseHelper.ID_COL + "String_Node_Str",new String[]{rid},null,null,null);
  try {
    if (c.getCount() == 0) {
      throw new NoSuchElementException("String_Node_Str" + table + "String_Node_Str"+ recordId);
    }
    c.moveToFirst();
    return c.getString(c.getColumnIndexOrThrow(scrubbedName));
  }
  finally {
    c.close();
  }
}
Program: 142094
Project: 142094
Buggy source:
/** 
 * Return all records from this SqlStorage object for which, for each field in fieldNames, the record has the correct corresponding value in values
 */
public Vector<T> getRecordsForValues(String[] fieldNames,Object[] values){
  Pair<String,String[]> whereClause=helper.createWhereAndroid(fieldNames,values,em,null);
  Cursor c=helper.getHandle().query(table,new String[]{DatabaseHelper.ID_COL,DatabaseHelper.DATA_COL},whereClause.first,whereClause.second,null,null,null);
  try {
    if (c.getCount() == 0) {
      return new Vector<>();
    }
 else {
      c.moveToFirst();
      Vector<T> indices=new Vector<>();
      int index=c.getColumnIndexOrThrow(DatabaseHelper.DATA_COL);
      while (!c.isAfterLast()) {
        byte[] data=c.getBlob(index);
        indices.add(newObject(data,c.getInt(c.getColumnIndexOrThrow(DatabaseHelper.ID_COL))));
        c.moveToNext();
      }
      return indices;
    }
  }
  finally {
    if (c != null) {
      c.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * Return all records from this SqlStorage object for which, for each field in fieldNames, the record has the correct corresponding value in values
 */
public Vector<T> getRecordsForValues(String[] fieldNames,Object[] values){
  Pair<String,String[]> whereClause=helper.createWhereAndroid(fieldNames,values,em,null);
  Cursor c=helper.getHandle().query(table,new String[]{DatabaseHelper.ID_COL,DatabaseHelper.DATA_COL},whereClause.first,whereClause.second,null,null,null);
  try {
    if (c.getCount() == 0) {
      return new Vector<>();
    }
 else {
      c.moveToFirst();
      Vector<T> indices=new Vector<>();
      int index=c.getColumnIndexOrThrow(DatabaseHelper.DATA_COL);
      while (!c.isAfterLast()) {
        byte[] data=c.getBlob(index);
        indices.add(newObject(data,c.getInt(c.getColumnIndexOrThrow(DatabaseHelper.ID_COL))));
        c.moveToNext();
      }
      return indices;
    }
  }
  finally {
    c.close();
  }
}
Program: 142095
Project: 142095
Buggy source:
@Override public boolean exists(int id){
  Cursor c;
  c=helper.getHandle().query(table,new String[]{DatabaseHelper.ID_COL},DatabaseHelper.ID_COL + "String_Node_Str",new String[]{String.valueOf(id)},null,null,null);
  try {
    int queryCount=c.getCount();
    if (queryCount == 0) {
      return false;
    }
 else     if (queryCount > 1) {
      throw new InvalidIndexException("String_Node_Str" + id,"String_Node_Str");
    }
  }
  finally {
    if (c != null) {
      c.close();
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean exists(int id){
  Cursor c=helper.getHandle().query(table,new String[]{DatabaseHelper.ID_COL},DatabaseHelper.ID_COL + "String_Node_Str",new String[]{String.valueOf(id)},null,null,null);
  try {
    int queryCount=c.getCount();
    if (queryCount == 0) {
      return false;
    }
 else     if (queryCount > 1) {
      throw new InvalidIndexException("String_Node_Str" + id,"String_Node_Str");
    }
  }
  finally {
    c.close();
  }
  return true;
}
Program: 142096
Project: 142096
Buggy source:
@Override public byte[] readBytes(int id){
  Cursor c=helper.getHandle().query(table,new String[]{DatabaseHelper.ID_COL,DatabaseHelper.DATA_COL},DatabaseHelper.ID_COL + "String_Node_Str",new String[]{String.valueOf(id)},null,null,null);
  try {
    c.moveToFirst();
    return c.getBlob(c.getColumnIndexOrThrow(DatabaseHelper.DATA_COL));
  }
  finally {
    if (c != null) {
      c.close();
    }
  }
}

Fixed version (ground truth):
@Override public byte[] readBytes(int id){
  Cursor c=helper.getHandle().query(table,new String[]{DatabaseHelper.ID_COL,DatabaseHelper.DATA_COL},DatabaseHelper.ID_COL + "String_Node_Str",new String[]{String.valueOf(id)},null,null,null);
  try {
    if (!c.moveToFirst()) {
      throw new NoSuchElementException("String_Node_Str" + table + "String_Node_Str"+ id);
    }
    return c.getBlob(c.getColumnIndexOrThrow(DatabaseHelper.DATA_COL));
  }
  finally {
    c.close();
  }
}
Program: 142097
Project: 142097
Buggy source:
public T getRecordForValues(String[] rawFieldNames,Object[] values) throws NoSuchElementException, InvalidIndexException {
  SQLiteDatabase appDb=helper.getHandle();
  Cursor c;
  Pair<String,String[]> whereClause=helper.createWhereAndroid(rawFieldNames,values,em,null);
  c=appDb.query(table,new String[]{DatabaseHelper.ID_COL,DatabaseHelper.DATA_COL},whereClause.first,whereClause.second,null,null,null);
  try {
    int queryCount=c.getCount();
    if (queryCount == 0) {
      throw new NoSuchElementException("String_Node_Str" + table + "String_Node_Str"+ Arrays.toString(rawFieldNames)+ "String_Node_Str"+ Arrays.toString(values));
    }
 else     if (queryCount > 1) {
      throw new InvalidIndexException("String_Node_Str" + Arrays.toString(rawFieldNames) + "String_Node_Str"+ Arrays.toString(values),Arrays.toString(rawFieldNames));
    }
    c.moveToFirst();
    byte[] data=c.getBlob(c.getColumnIndexOrThrow(DatabaseHelper.DATA_COL));
    return newObject(data,c.getInt(c.getColumnIndexOrThrow(DatabaseHelper.ID_COL)));
  }
  finally {
    if (c != null) {
      c.close();
    }
  }
}

Fixed version (ground truth):
public T getRecordForValues(String[] rawFieldNames,Object[] values) throws NoSuchElementException, InvalidIndexException {
  SQLiteDatabase appDb=helper.getHandle();
  Pair<String,String[]> whereClause=helper.createWhereAndroid(rawFieldNames,values,em,null);
  Cursor c=appDb.query(table,new String[]{DatabaseHelper.ID_COL,DatabaseHelper.DATA_COL},whereClause.first,whereClause.second,null,null,null);
  try {
    int queryCount=c.getCount();
    if (queryCount == 0) {
      throw new NoSuchElementException("String_Node_Str" + table + "String_Node_Str"+ Arrays.toString(rawFieldNames)+ "String_Node_Str"+ Arrays.toString(values));
    }
 else     if (queryCount > 1) {
      throw new InvalidIndexException("String_Node_Str" + Arrays.toString(rawFieldNames) + "String_Node_Str"+ Arrays.toString(values),Arrays.toString(rawFieldNames));
    }
    c.moveToFirst();
    byte[] data=c.getBlob(c.getColumnIndexOrThrow(DatabaseHelper.DATA_COL));
    return newObject(data,c.getInt(c.getColumnIndexOrThrow(DatabaseHelper.ID_COL)));
  }
  finally {
    c.close();
  }
}
Program: 142098
Project: 142098
Buggy source:
@Override public NotificationMessage createFromParcel(Parcel source){
  String[] array=new String[3];
  source.readStringArray(array);
  Date date=new Date(source.readLong());
  return new NotificationMessage(array[0],array[1],array[2],array[3],date);
}

Fixed version (ground truth):
@Override public NotificationMessage createFromParcel(Parcel source){
  String[] array=new String[4];
  source.readStringArray(array);
  Date date=new Date(source.readLong());
  return new NotificationMessage(array[0],array[1],array[2],array[3],date);
}
Program: 142099
Project: 142099
Buggy source:
@Test public void notificationParcellingTest(){
  NotificationMessage sampleNotification=new NotificationMessage("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",new Date());
  Parcel parcel=Parcel.obtain();
  sampleNotification.writeToParcel(parcel,0);
  parcel.setDataPosition(0);
  NotificationMessage createdFromParcel=NotificationMessage.CREATOR.createFromParcel(parcel);
  Assert.assertEquals(sampleNotification,createdFromParcel);
}

Fixed version (ground truth):
/** 
 * Write NotificationMessage to parcel and read it back out again
 */
@Test public void notificationParcellingTest(){
  NotificationMessage sampleNotification=new NotificationMessage("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",new Date());
  Parcel parcel=Parcel.obtain();
  sampleNotification.writeToParcel(parcel,0);
  parcel.setDataPosition(0);
  NotificationMessage createdFromParcel=NotificationMessage.CREATOR.createFromParcel(parcel);
  Assert.assertEquals(sampleNotification,createdFromParcel);
}
Program: 142100
Project: 142100
Buggy source:
public ModernHttpRequester buildModernHttpRequester(Context context,URL url,Hashtable<String,String> params,boolean isAuthenticatedRequest,boolean isPostRequest){
  return new ModernHttpRequester(context,url,params,isAuthenticatedRequest,isPostRequest);
}

Fixed version (ground truth):
public ModernHttpRequester buildModernHttpRequester(Context context,URL url,HashMap<String,String> params,boolean isAuthenticatedRequest,boolean isPostRequest){
  return new ModernHttpRequester(context,url,params,isAuthenticatedRequest,isPostRequest);
}
Program: 142101
Project: 142101
Buggy source:
private void loadStateFromIntent(Intent intent){
  if (intent.hasExtra(URL_KEY) && intent.hasExtra(PARAMS_KEY)) {
    String urlString=intent.getStringExtra(URL_KEY);
    try {
      url=new URL(urlString);
    }
 catch (    MalformedURLException e) {
      enterErrorState(Localization.get("String_Node_Str",urlString));
    }
    params=(Hashtable<String,String>)intent.getSerializableExtra(PARAMS_KEY);
  }
 else {
    enterErrorState(Localization.get("String_Node_Str"));
  }
}

Fixed version (ground truth):
private void loadStateFromIntent(Intent intent){
  if (intent.hasExtra(URL_KEY) && intent.hasExtra(PARAMS_KEY)) {
    String urlString=intent.getStringExtra(URL_KEY);
    try {
      url=new URL(urlString);
    }
 catch (    MalformedURLException e) {
      enterErrorState(Localization.get("String_Node_Str",urlString));
    }
    Object o=intent.getSerializableExtra(PARAMS_KEY);
    params=(HashMap<String,String>)o;
  }
 else {
    enterErrorState(Localization.get("String_Node_Str"));
  }
}
Program: 142102
Project: 142102
Buggy source:
private void makeQueryRequest(){
  clearErrorState();
  URL url=null;
  String urlString=remoteQuerySessionManager.getBaseUrl();
  try {
    url=new URL(urlString);
  }
 catch (  MalformedURLException e) {
    enterErrorState(Localization.get("String_Node_Str",urlString));
  }
  if (url != null) {
    SimpleHttpTask httpTask;
    try {
      httpTask=new SimpleHttpTask(this,url,remoteQuerySessionManager.getRawQueryParams(),false);
    }
 catch (    ModernHttpRequester.PlainTextPasswordException e) {
      enterErrorState(Localization.get("String_Node_Str",url.toString()));
      return;
    }
    httpTask.connect((CommCareTaskConnector)this);
    httpTask.executeParallel();
  }
}

Fixed version (ground truth):
private void makeQueryRequest(){
  clearErrorState();
  URL url=null;
  String urlString=remoteQuerySessionManager.getBaseUrl();
  try {
    url=new URL(urlString);
  }
 catch (  MalformedURLException e) {
    enterErrorState(Localization.get("String_Node_Str",urlString));
  }
  if (url != null) {
    SimpleHttpTask httpTask;
    try {
      httpTask=new SimpleHttpTask(this,url,new HashMap<>(remoteQuerySessionManager.getRawQueryParams()),false);
    }
 catch (    ModernHttpRequester.PlainTextPasswordException e) {
      enterErrorState(Localization.get("String_Node_Str",url.toString()));
      return;
    }
    httpTask.connect((CommCareTaskConnector)this);
    httpTask.executeParallel();
  }
}
Program: 142103
Project: 142103
Buggy source:
public void request(){
  HttpURLConnection httpConnection=null;
  try {
    httpConnection=setupConnection(buildUrl());
    processResponse(httpConnection);
  }
 catch (  IOException e) {
    responseProcessor.handleIOException(e);
  }
 finally {
    if (httpConnection != null) {
      httpConnection.disconnect();
    }
  }
}

Fixed version (ground truth):
public void request(){
  HttpURLConnection httpConnection=null;
  try {
    httpConnection=setupConnection(buildUrl());
    processResponse(httpConnection);
  }
 catch (  IOException e) {
    e.printStackTrace();
    responseProcessor.handleIOException(e);
  }
 finally {
    if (httpConnection != null) {
      httpConnection.disconnect();
    }
  }
}
Program: 142104
Project: 142104
Buggy source:
public ModernHttpRequester(Context context,URL url,Hashtable<String,String> params,boolean isAuthenticatedRequest,boolean isPostRequest){
  this.isPostRequest=isPostRequest;
  this.context=context;
  this.params=params;
  this.url=url;
  setupAuthentication(isAuthenticatedRequest);
}

Fixed version (ground truth):
public ModernHttpRequester(Context context,URL url,HashMap<String,String> params,boolean isAuthenticatedRequest,boolean isPostRequest){
  this.isPostRequest=isPostRequest;
  this.context=context;
  this.params=params;
  this.url=url;
  setupAuthentication(isAuthenticatedRequest);
}
Program: 142105
Project: 142105
Buggy source:
private InputStream getResponseStream(HttpURLConnection con) throws IOException {
  long dataSizeGuess=setContentLengthProps(con);
  BitCache cache=BitCacheFactory.getCache(context,dataSizeGuess);
  cache.initializeCache();
  OutputStream cacheOut=cache.getCacheStream();
  AndroidStreamUtil.writeFromInputToOutput(con.getInputStream(),cacheOut);
  return cache.retrieveCache();
}

Fixed version (ground truth):
private InputStream getResponseStream(HttpURLConnection con) throws IOException {
  InputStream connectionStream;
  try {
    connectionStream=con.getInputStream();
  }
 catch (  IOException e) {
    return null;
  }
  long dataSizeGuess=setContentLengthProps(con);
  BitCache cache=BitCacheFactory.getCache(context,dataSizeGuess);
  cache.initializeCache();
  OutputStream cacheOut=cache.getCacheStream();
  AndroidStreamUtil.writeFromInputToOutput(connectionStream,cacheOut);
  return cache.retrieveCache();
}
Program: 142106
Project: 142106
Buggy source:
private void buildPostPayload(HttpURLConnection httpConnection) throws IOException {
  String paramsString=buildUrlWithParams().getQuery();
  int bodySize=paramsString.length();
  httpConnection.setFixedLengthStreamingMode(bodySize);
  httpConnection.setRequestProperty("String_Node_Str","String_Node_Str");
  httpConnection.setRequestProperty("String_Node_Str",bodySize + "String_Node_Str");
  OutputStream os=httpConnection.getOutputStream();
  BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(os,"String_Node_Str"));
  writer.write(paramsString);
  writer.flush();
  writer.close();
  os.close();
}

Fixed version (ground truth):
private void buildPostPayload(HttpURLConnection httpConnection) throws IOException {
  String paramsString=buildUrlWithParams().getQuery();
  Log.d(TAG,paramsString);
  int bodySize=paramsString.length();
  httpConnection.setFixedLengthStreamingMode(bodySize);
  httpConnection.setRequestProperty("String_Node_Str","String_Node_Str");
  httpConnection.setRequestProperty("String_Node_Str",bodySize + "String_Node_Str");
  OutputStream os=httpConnection.getOutputStream();
  BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(os,"String_Node_Str"));
  writer.write(paramsString);
  writer.flush();
  writer.close();
  os.close();
}
Program: 142107
Project: 142107
Buggy source:
protected HttpURLConnection setupConnection(URL builtUrl) throws IOException {
  HttpURLConnection httpConnection=(HttpURLConnection)builtUrl.openConnection();
  if (isPostRequest) {
    setupConnectionInner(httpConnection);
    httpConnection.setRequestMethod("String_Node_Str");
    httpConnection.setDoOutput(true);
    buildPostPayload(httpConnection);
  }
 else {
    setupConnectionInner(httpConnection);
    httpConnection.setRequestMethod("String_Node_Str");
  }
  return httpConnection;
}

Fixed version (ground truth):
protected HttpURLConnection setupConnection(URL builtUrl) throws IOException {
  Log.d(TAG,builtUrl.toString());
  HttpURLConnection httpConnection=(HttpURLConnection)builtUrl.openConnection();
  if (isPostRequest) {
    setupConnectionInner(httpConnection);
    httpConnection.setRequestMethod("String_Node_Str");
    httpConnection.setDoOutput(true);
    buildPostPayload(httpConnection);
  }
 else {
    setupConnectionInner(httpConnection);
    httpConnection.setRequestMethod("String_Node_Str");
  }
  return httpConnection;
}
Program: 142108
Project: 142108
Buggy source:
public SimpleHttpTask(Context context,URL url,Hashtable<String,String> params,boolean isPostRequest){
  taskId=SIMPLE_HTTP_TASK_ID;
  requestor=CommCareApplication._().buildModernHttpRequester(context,url,params,true,isPostRequest);
  requestor.setResponseProcessor(this);
}

Fixed version (ground truth):
public SimpleHttpTask(Context context,URL url,HashMap<String,String> params,boolean isPostRequest){
  taskId=SIMPLE_HTTP_TASK_ID;
  requestor=CommCareApplication._().buildModernHttpRequester(context,url,params,true,isPostRequest);
  requestor.setResponseProcessor(this);
}
Program: 142110
Project: 142110
Buggy source:
public void clearExternalData(){
  setCurrent(full);
  isFilteringByCalloutResult=false;
  externalData.clear();
}

Fixed version (ground truth):
public void clearExternalData(){
  isFilteringByCalloutResult=false;
  setCurrent(full);
  externalData.clear();
}