Program: 7614
Project: 7614
Buggy source:
/** 
 * Updates a row in the database
 */
@Override public int update(final Uri uri,final ContentValues values,final String where,final String[] whereArgs){
  Helpers.validateSelection(where,sAppReadableColumnsSet);
  SQLiteDatabase db=mOpenHelper.getWritableDatabase();
  int count;
  boolean startService=false;
  ContentValues filteredValues;
  if (Binder.getCallingPid() != Process.myPid()) {
    filteredValues=new ContentValues();
    copyString(Downloads.Impl.COLUMN_APP_DATA,values,filteredValues);
    copyInteger(Downloads.Impl.COLUMN_VISIBILITY,values,filteredValues);
    Integer i=values.getAsInteger(Downloads.Impl.COLUMN_CONTROL);
    if (i != null) {
      filteredValues.put(Downloads.Impl.COLUMN_CONTROL,i);
      startService=true;
    }
    copyInteger(Downloads.Impl.COLUMN_CONTROL,values,filteredValues);
    copyString(Downloads.Impl.COLUMN_TITLE,values,filteredValues);
    copyString(Downloads.Impl.COLUMN_DESCRIPTION,values,filteredValues);
  }
 else {
    filteredValues=values;
    String filename=values.getAsString(Downloads.Impl._DATA);
    if (filename != null) {
      Cursor c=query(uri,new String[]{Downloads.Impl.COLUMN_TITLE},null,null,null);
      if (!c.moveToFirst() || c.getString(0) == null) {
        values.put(Downloads.Impl.COLUMN_TITLE,new File(filename).getName());
      }
      c.close();
    }
    Integer status=values.getAsInteger(Downloads.Impl.COLUMN_STATUS);
    boolean isRestart=status != null && status == Downloads.Impl.STATUS_PENDING;
    if (isRestart) {
      startService=true;
    }
  }
  int match=sURIMatcher.match(uri);
switch (match) {
case MY_DOWNLOADS:
case MY_DOWNLOADS_ID:
case ALL_DOWNLOADS:
case ALL_DOWNLOADS_ID:
    String fullWhere=getWhereClause(uri,where,match);
  if (filteredValues.size() > 0) {
    count=db.update(DB_TABLE,filteredValues,fullWhere,whereArgs);
  }
 else {
    count=0;
  }
break;
default :
Log.d(Constants.TAG,"String_Node_Str" + uri);
throw new UnsupportedOperationException("String_Node_Str" + uri);
}
notifyContentChanged(uri,match);
if (startService) {
Context context=getContext();
context.startService(new Intent(context,DownloadService.class));
}
return count;
}

Fixed version (ground truth):
/** 
 * Updates a row in the database
 */
@Override public int update(final Uri uri,final ContentValues values,final String where,final String[] whereArgs){
  Helpers.validateSelection(where,sAppReadableColumnsSet);
  SQLiteDatabase db=mOpenHelper.getWritableDatabase();
  int count;
  boolean startService=false;
  ContentValues filteredValues;
  if (Binder.getCallingPid() != Process.myPid()) {
    filteredValues=new ContentValues();
    copyString(Downloads.Impl.COLUMN_APP_DATA,values,filteredValues);
    copyInteger(Downloads.Impl.COLUMN_VISIBILITY,values,filteredValues);
    Integer i=values.getAsInteger(Downloads.Impl.COLUMN_CONTROL);
    if (i != null) {
      filteredValues.put(Downloads.Impl.COLUMN_CONTROL,i);
      startService=true;
    }
    copyInteger(Downloads.Impl.COLUMN_CONTROL,values,filteredValues);
    copyString(Downloads.Impl.COLUMN_TITLE,values,filteredValues);
    copyString(Downloads.Impl.COLUMN_DESCRIPTION,values,filteredValues);
  }
 else {
    filteredValues=values;
    String filename=values.getAsString(Downloads.Impl._DATA);
    if (filename != null) {
      Cursor c=query(uri,new String[]{Downloads.Impl.COLUMN_TITLE},null,null,null);
      if (!c.moveToFirst() || c.getString(0).isEmpty()) {
        values.put(Downloads.Impl.COLUMN_TITLE,new File(filename).getName());
      }
      c.close();
    }
    Integer status=values.getAsInteger(Downloads.Impl.COLUMN_STATUS);
    boolean isRestart=status != null && status == Downloads.Impl.STATUS_PENDING;
    if (isRestart) {
      startService=true;
    }
  }
  int match=sURIMatcher.match(uri);
switch (match) {
case MY_DOWNLOADS:
case MY_DOWNLOADS_ID:
case ALL_DOWNLOADS:
case ALL_DOWNLOADS_ID:
    String fullWhere=getWhereClause(uri,where,match);
  if (filteredValues.size() > 0) {
    count=db.update(DB_TABLE,filteredValues,fullWhere,whereArgs);
  }
 else {
    count=0;
  }
break;
default :
Log.d(Constants.TAG,"String_Node_Str" + uri);
throw new UnsupportedOperationException("String_Node_Str" + uri);
}
notifyContentChanged(uri,match);
if (startService) {
Context context=getContext();
context.startService(new Intent(context,DownloadService.class));
}
return count;
}