Program: 178326
Project: 178326
Buggy source:
/** 
 * write a POI message to the file
 * @param context a context object used to get a content resolver object
 * @param recordId the unique record identifier for the location record
 * @throws IllegalArgumentException if the context parameter is null
 * @throws IllegalArgumentException if a record cannot be found
 */
public static void writePointOfInterest(Context context,String recordId){
  if (context == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String mOutputPath=Environment.getExternalStorageDirectory().getPath();
  mOutputPath+=context.getString(R.string.system_path_binary_data);
  if (FileUtils.isDirectoryWritable(mOutputPath) == false) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  ContentResolver mContentResolver=context.getContentResolver();
  Uri mContentUri=Uri.parse(PointsOfInterestContract.CONTENT_URI.toString() + "String_Node_Str" + recordId);
  Cursor mCursor=mContentResolver.query(mContentUri,null,null,null,null);
  if (mCursor.getCount() == 0) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  mCursor.moveToFirst();
  String mPhotoName=mCursor.getString(mCursor.getColumnIndex(PointsOfInterestContract.Table.PHOTO));
  if (mPhotoName != null) {
    Rhizome.addFile(context,MediaUtils.getMediaStore() + mPhotoName);
  }
  String mFileName=mCursor.getString(mCursor.getColumnIndex(LocationsContract.Table.PHONE_NUMBER));
  mFileName=mFileName.replace("String_Node_Str","String_Node_Str");
  mFileName=mFileName.replace("String_Node_Str","String_Node_Str");
  mFileName=mFileName + "String_Node_Str" + TimeUtils.getTodayWithHour()+ BinaryFileContract.POI_EXT;
  FileOutputStream mOutput=null;
  try {
    try {
      mOutput=new FileOutputStream(mOutputPath + mFileName,true);
      BinaryFileContract.writeLocationRecord(mCursor,mOutput);
    }
  finally {
      mOutput.close();
    }
    Rhizome.addFile(context,mOutputPath + mFileName);
  }
 catch (  FileNotFoundException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
catch (  IOException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
 finally {
    try {
      if (mOutput != null) {
        mOutput.close();
      }
    }
 catch (    IOException e) {
      Log.e(TAG,"String_Node_Str",e);
    }
    mCursor.close();
  }
}

Fixed version (ground truth):
/** 
 * write a POI message to the file
 * @param context a context object used to get a content resolver object
 * @param recordId the unique record identifier for the location record
 * @throws IllegalArgumentException if the context parameter is null
 * @throws IllegalArgumentException if a record cannot be found
 */
public static void writePointOfInterest(Context context,String recordId){
  if (context == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String mOutputPath=Environment.getExternalStorageDirectory().getPath();
  mOutputPath+=context.getString(R.string.system_path_binary_data);
  if (FileUtils.isDirectoryWritable(mOutputPath) == false) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  ContentResolver mContentResolver=context.getContentResolver();
  Uri mContentUri=Uri.parse(PointsOfInterestContract.CONTENT_URI.toString() + "String_Node_Str" + recordId);
  Cursor mCursor=mContentResolver.query(mContentUri,null,null,null,null);
  if (mCursor.getCount() == 0) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  mCursor.moveToFirst();
  String mPhotoName=mCursor.getString(mCursor.getColumnIndex(PointsOfInterestContract.Table.PHOTO));
  if (mPhotoName != null) {
    Rhizome.addFile(context,MediaUtils.getMediaStore() + mPhotoName);
  }
  String mFileName=mCursor.getString(mCursor.getColumnIndex(LocationsContract.Table.PHONE_NUMBER));
  mFileName=mFileName.replace("String_Node_Str","String_Node_Str");
  mFileName=mFileName.replace("String_Node_Str","String_Node_Str");
  mFileName=mFileName + "String_Node_Str" + TimeUtils.getTodayWithHour()+ BinaryFileContract.POI_EXT;
  FileOutputStream mOutput=null;
  try {
    try {
      mOutput=new FileOutputStream(mOutputPath + mFileName,true);
      BinaryFileContract.writePointOfInterestRecord(mCursor,mOutput);
    }
  finally {
      mOutput.close();
    }
    Rhizome.addFile(context,mOutputPath + mFileName);
  }
 catch (  FileNotFoundException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
catch (  IOException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
 finally {
    try {
      if (mOutput != null) {
        mOutput.close();
      }
    }
 catch (    IOException e) {
      Log.e(TAG,"String_Node_Str",e);
    }
    mCursor.close();
  }
}