Program: 178340
Project: 178340
Buggy source:
private void addNewPoi(String title,String description){
  ContentValues mValues=new ContentValues();
  Location mLocation=LocationCollector.getLocation();
  if (mLocation == null) {
    Toast.makeText(this,R.string.new_poi_toast_location_error,Toast.LENGTH_SHORT).show();
  }
  mValues.put(MapItemsContract.PointsOfInterest.Table.PHONE_NUMBER,phoneNumber);
  mValues.put(MapItemsContract.PointsOfInterest.Table.SUBSCRIBER_ID,subscriberId);
  if (latitude == -1) {
    latitude=mLocation.getLatitude();
    longitude=mLocation.getLongitude();
  }
  mValues.put(MapItemsContract.PointsOfInterest.Table.LATITUDE,latitude);
  mValues.put(MapItemsContract.PointsOfInterest.Table.LONGITUDE,longitude);
  mValues.put(MapItemsContract.PointsOfInterest.Table.TIMESTAMP,System.currentTimeMillis());
  mValues.put(MapItemsContract.PointsOfInterest.Table.TIMEZONE,TimeZone.getDefault().getID());
  mValues.put(MapItemsContract.PointsOfInterest.Table.TITLE,title);
  mValues.put(MapItemsContract.PointsOfInterest.Table.DESCRIPTION,description);
  String mHash=HashUtils.hashPointOfInterestMessage(phoneNumber,latitude,longitude,title,description);
  mValues.put(MapItemsContract.PointsOfInterest.Table.HASH,mHash);
  try {
    Uri newRecord=getContentResolver().insert(MapItemsContract.PointsOfInterest.CONTENT_URI,mValues);
    BinaryFileWriter.writePointOfInterest(this,newRecord.getLastPathSegment());
    if (V_LOG) {
      Log.v(TAG,"String_Node_Str" + newRecord.getLastPathSegment());
    }
  }
 catch (  SQLException e) {
    Log.e(TAG,"String_Node_Str",e);
    Toast.makeText(this,R.string.new_poi_toast_save_error,Toast.LENGTH_SHORT).show();
  }
}

Fixed version (ground truth):
private boolean addNewPoi(String title,String description){
  ContentValues mValues=new ContentValues();
  if (latitude == -1 || longitude == -1) {
    Toast.makeText(this,R.string.new_poi_toast_location_error,Toast.LENGTH_SHORT).show();
    return false;
  }
  mValues.put(MapItemsContract.PointsOfInterest.Table.PHONE_NUMBER,phoneNumber);
  mValues.put(MapItemsContract.PointsOfInterest.Table.SUBSCRIBER_ID,subscriberId);
  mValues.put(MapItemsContract.PointsOfInterest.Table.LATITUDE,latitude);
  mValues.put(MapItemsContract.PointsOfInterest.Table.LONGITUDE,longitude);
  mValues.put(MapItemsContract.PointsOfInterest.Table.TIMESTAMP,System.currentTimeMillis());
  mValues.put(MapItemsContract.PointsOfInterest.Table.TIMEZONE,TimeZone.getDefault().getID());
  mValues.put(MapItemsContract.PointsOfInterest.Table.TITLE,title);
  mValues.put(MapItemsContract.PointsOfInterest.Table.DESCRIPTION,description);
  String mHash=HashUtils.hashPointOfInterestMessage(phoneNumber,latitude,longitude,title,description);
  mValues.put(MapItemsContract.PointsOfInterest.Table.HASH,mHash);
  try {
    Uri newRecord=getContentResolver().insert(MapItemsContract.PointsOfInterest.CONTENT_URI,mValues);
    BinaryFileWriter.writePointOfInterest(this,newRecord.getLastPathSegment());
    if (V_LOG) {
      Log.v(TAG,"String_Node_Str" + newRecord.getLastPathSegment());
    }
  }
 catch (  SQLException e) {
    Log.e(TAG,"String_Node_Str",e);
    Toast.makeText(this,R.string.new_poi_toast_save_error,Toast.LENGTH_SHORT).show();
    return false;
  }
  return true;
}