Program: 142224
Project: 142224
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent intent){
switch (requestCode) {
case BARCODE_FETCH:
    if (resultCode == Activity.RESULT_OK) {
      String result=intent.getStringExtra("String_Node_Str");
      this.searchbox.setText(result);
    }
  break;
case CALLOUT:
if (resultCode == Activity.RESULT_OK) {
  String result=intent.getStringExtra("String_Node_Str");
  if (result != null) {
    this.searchbox.setText(result);
    break;
  }
  Callout callout=shortSelect.getCallout();
  for (  String key : callout.getResponses()) {
    result=intent.getStringExtra(key);
    if (result != null) {
      this.searchbox.setText(result);
      break;
    }
  }
}
case CONFIRM_SELECT:
resuming=true;
if (resultCode == RESULT_OK && !mViewMode) {
returnWithResult(intent);
return;
}
 else {
if (mResultIsMap) {
mResultIsMap=false;
Intent i=new Intent(this,EntityMapActivity.class);
this.startActivityForResult(i,MAP_SELECT);
return;
}
if (inAwesomeMode) {
TreeReference r=SerializationUtil.deserializeFromIntent(intent,EntityDetailActivity.CONTEXT_REFERENCE,TreeReference.class);
if (r != null && adapter != null) {
  this.displayReferenceAwesome(r,adapter.getPosition(r));
  updateSelectedItem(r,true);
}
releaseCurrentMediaEntity();
}
return;
}
case MAP_SELECT:
if (resultCode == RESULT_OK) {
TreeReference r=SerializationUtil.deserializeFromIntent(intent,EntityDetailActivity.CONTEXT_REFERENCE,TreeReference.class);
if (inAwesomeMode) {
this.displayReferenceAwesome(r,adapter.getPosition(r));
}
 else {
Intent i=this.getDetailIntent(r,null);
if (mNoDetailMode) {
returnWithResult(i);
}
 else {
mResultIsMap=true;
i.putExtra("String_Node_Str",adapter.getPosition(r));
startActivityForResult(i,CONFIRM_SELECT);
}
return;
}
}
 else {
refreshView();
return;
}
default :
super.onActivityResult(requestCode,resultCode,intent);
}
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent intent){
switch (requestCode) {
case BARCODE_FETCH:
    if (resultCode == Activity.RESULT_OK) {
      String result=intent.getStringExtra("String_Node_Str");
      this.searchbox.setText(result);
    }
  break;
case CALLOUT:
if (resultCode == Activity.RESULT_OK) {
  String result=intent.getStringExtra("String_Node_Str");
  if (result != null) {
    this.searchbox.setText(result);
    break;
  }
  Callout callout=shortSelect.getCallout();
  for (  String key : callout.getResponses()) {
    result=intent.getExtras().getString(key);
    if (result != null) {
      this.searchbox.setText(result);
      break;
    }
  }
}
break;
case CONFIRM_SELECT:
resuming=true;
if (resultCode == RESULT_OK && !mViewMode) {
returnWithResult(intent);
return;
}
 else {
if (mResultIsMap) {
mResultIsMap=false;
Intent i=new Intent(this,EntityMapActivity.class);
this.startActivityForResult(i,MAP_SELECT);
return;
}
if (inAwesomeMode) {
TreeReference r=SerializationUtil.deserializeFromIntent(intent,EntityDetailActivity.CONTEXT_REFERENCE,TreeReference.class);
if (r != null && adapter != null) {
this.displayReferenceAwesome(r,adapter.getPosition(r));
updateSelectedItem(r,true);
}
releaseCurrentMediaEntity();
}
return;
}
case MAP_SELECT:
if (resultCode == RESULT_OK) {
TreeReference r=SerializationUtil.deserializeFromIntent(intent,EntityDetailActivity.CONTEXT_REFERENCE,TreeReference.class);
if (inAwesomeMode) {
this.displayReferenceAwesome(r,adapter.getPosition(r));
}
 else {
Intent i=this.getDetailIntent(r,null);
if (mNoDetailMode) {
returnWithResult(i);
}
 else {
mResultIsMap=true;
i.putExtra("String_Node_Str",adapter.getPosition(r));
startActivityForResult(i,CONFIRM_SELECT);
}
return;
}
}
 else {
refreshView();
return;
}
default :
super.onActivityResult(requestCode,resultCode,intent);
}
}