Program: 142144
Project: 142144
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent intent){
switch (requestCode) {
case BARCODE_FETCH:
    processBarcodeFetch(resultCode,intent);
  break;
case CALLOUT:
processCalloutResult(resultCode,intent);
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);
}
AudioController.INSTANCE.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;
}
case LOCATION_REQUEST:
if (resultCode == RESULT_OK) {
hereFunctionHandler.setLocationString(FormEntryActivity.LOCATION_RESULT);
}
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:
    processBarcodeFetch(resultCode,intent);
  break;
case CALLOUT:
processCalloutResult(resultCode,intent);
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);
}
AudioController.INSTANCE.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;
}
case LOCATION_REQUEST:
if (resultCode == RESULT_OK) {
hereFunctionHandler.setLocationString(intent.getStringExtra(FormEntryActivity.LOCATION_RESULT));
}
default :
super.onActivityResult(requestCode,resultCode,intent);
}
}