Program: 86044
Project: 86044
Buggy source:
/** 
 * Result of taking a picture or video
 * @Override onActivityResult
 */
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (resultCode == RESULT_OK) {
switch (requestCode) {
case INTENT_CODE_ACTIVITY_PICTURE:
      Toast.makeText(this,getResources().getString(R.string.imageSavedIn) + pictureSavePath,Toast.LENGTH_LONG).show();
    AlertDialog.Builder dialogBuilder=new AlertDialog.Builder(this);
  final View dialogView=getLayoutInflater().inflate(R.layout.dialog_upload_picture,null);
Bitmap picture=BitmapFactory.decodeFile(pictureSavePath);
((ImageView)dialogView.findViewById(R.id.image)).setImageBitmap(picture);
dialogBuilder.setView(dialogView);
dialogBuilder.setCancelable(false);
dialogBuilder.setPositiveButton(R.string.uploadImage,new DialogInterface.OnClickListener(){
@Override public void onClick(DialogInterface dialogInterface,int i){
String fileName=((EditText)dialogView.findViewById(R.id.imageName)).getText().toString();
if (fileName.length() == 0) fileName="String_Node_Str" + new SimpleDateFormat("String_Node_Str").format(new Date());
;
startUploadingFile(fileName + "String_Node_Str",pictureSavePath);
}
}
);
dialogBuilder.setNegativeButton(R.string.cancel,null);
dialogBuilder.create().show();
break;
case INTENT_CODE_ACTIVITY_VIDEO:
Toast.makeText(this,getResources().getString(R.string.videoSavedIn) + pictureSavePath,Toast.LENGTH_LONG).show();
break;
case INTENT_CODE_ACTIVITY_FILE_CHOOSER:
Uri uri=data.getData();
String path=getRealPathFromURI(uri);
String fileName=path.substring(path.lastIndexOf("String_Node_Str") + 1);
if (fileName.length() == 0) {
fileName="String_Node_Str";
}
Log.i("String_Node_Str","String_Node_Str" + fileName + "String_Node_Str"+ path);
startUploadingFile(fileName,path);
break;
}
}
 else if (resultCode == RESULT_CANCELED) {
}
 else {
Toast.makeText(this,R.string.mediaError,Toast.LENGTH_LONG).show();
}
}

Fixed version (ground truth):
/** 
 * Result of taking a picture or video
 * @Override onActivityResult
 */
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (resultCode == RESULT_OK) {
switch (requestCode) {
case INTENT_CODE_ACTIVITY_PICTURE:
      Toast.makeText(this,getResources().getString(R.string.imageSavedIn) + pictureSavePath,Toast.LENGTH_LONG).show();
    final View dialogView=getLayoutInflater().inflate(R.layout.dialog_upload_picture,null);
  Bitmap picture=BitmapFactory.decodeFile(pictureSavePath);
((ImageView)dialogView.findViewById(R.id.image)).setImageBitmap(picture);
new AlertDialog.Builder(this).setIcon(R.drawable.take_picture_light).setTitle("String_Node_Str").setView(dialogView).setCancelable(false).setPositiveButton(R.string.uploadImage,new DialogInterface.OnClickListener(){
@Override public void onClick(DialogInterface dialogInterface,int i){
  String fileName=((EditText)dialogView.findViewById(R.id.imageName)).getText().toString();
  if (fileName.length() == 0)   fileName="String_Node_Str" + new SimpleDateFormat("String_Node_Str").format(new Date());
  ;
  startUploadingFile(fileName + "String_Node_Str",pictureSavePath);
}
}
).setNegativeButton(R.string.cancel,null).create().show();
break;
case INTENT_CODE_ACTIVITY_VIDEO:
Toast.makeText(this,getResources().getString(R.string.videoSavedIn) + pictureSavePath,Toast.LENGTH_LONG).show();
break;
case INTENT_CODE_ACTIVITY_FILE_CHOOSER:
Uri uri=data.getData();
String path=getRealPathFromURI(uri);
String fileName=path.substring(path.lastIndexOf("String_Node_Str") + 1);
if (fileName.length() == 0) {
fileName="String_Node_Str";
}
Log.i("String_Node_Str","String_Node_Str" + fileName + "String_Node_Str"+ path);
startUploadingFile(fileName,path);
break;
}
}
 else if (resultCode == RESULT_CANCELED) {
}
 else {
Toast.makeText(this,R.string.mediaError,Toast.LENGTH_LONG).show();
}
}