Program: 142336
Project: 142336
Buggy source:
@Override public int update(Uri uri,ContentValues values,String where,String[] whereArgs){
  init();
  SQLiteDatabase db=mDbHelper.getWritableDatabase();
  int count=0;
switch (sUriMatcher.match(uri)) {
case FORMS:
    if (values.containsKey(FormsColumns.MD5_HASH)) {
      values.remove(FormsColumns.MD5_HASH);
    }
  if (values.containsKey(FormsColumns.FORM_FILE_PATH)) {
    String formFile=values.getAsString(FormsColumns.FORM_FILE_PATH);
    values.put(FormsColumns.MD5_HASH,FileUtil.getMd5Hash(new File(formFile)));
  }
Cursor c=null;
try {
c=this.query(uri,null,where,whereArgs,null);
if (c.getCount() > 0) {
  c.moveToPosition(-1);
  while (c.moveToNext()) {
    if (values.containsKey(FormsColumns.FORM_FILE_PATH)) {
      String newFile=values.getAsString(FormsColumns.FORM_FILE_PATH);
      String delFile=c.getString(c.getColumnIndex(FormsColumns.FORM_FILE_PATH));
      if (newFile.equalsIgnoreCase(delFile)) {
      }
 else {
        FileUtil.deleteFileOrDir(delFile);
      }
      FileUtil.deleteFileOrDir(c.getString(c.getColumnIndex(FormsColumns.JRCACHE_FILE_PATH)));
    }
  }
}
}
  finally {
if (c != null) {
  c.close();
}
}
if (values.containsKey(FormsColumns.DATE) == true) {
Date today=new Date();
String ts=new SimpleDateFormat("String_Node_Str").format(today);
values.put(FormsColumns.DISPLAY_SUBTEXT,"String_Node_Str" + ts);
}
count=db.update(FORMS_TABLE_NAME,values,where,whereArgs);
break;
case FORM_ID:
String formId=uri.getPathSegments().get(1);
Cursor update=null;
try {
update=this.query(uri,null,where,whereArgs,null);
if (update.getCount() > 0) {
update.moveToFirst();
if (values.containsKey(FormsColumns.MD5_HASH)) {
values.remove(FormsColumns.MD5_HASH);
}
if (values.containsKey(FormsColumns.JRCACHE_FILE_PATH)) {
FileUtil.deleteFileOrDir(update.getString(update.getColumnIndex(FormsColumns.JRCACHE_FILE_PATH)));
}
if (values.containsKey(FormsColumns.FORM_FILE_PATH)) {
String formFile=values.getAsString(FormsColumns.FORM_FILE_PATH);
String oldFile=update.getString(update.getColumnIndex(FormsColumns.FORM_FILE_PATH));
if (formFile != null && formFile.equalsIgnoreCase(oldFile)) {
}
 else {
FileUtil.deleteFileOrDir(oldFile);
}
FileUtil.deleteFileOrDir(update.getString(update.getColumnIndex(FormsColumns.JRCACHE_FILE_PATH)));
String newMd5=FileUtil.getMd5Hash(new File(formFile));
values.put(FormsColumns.MD5_HASH,newMd5);
values.put(FormsColumns.JRCACHE_FILE_PATH,"String_Node_Str" + newMd5 + "String_Node_Str");
}
if (values.containsKey(FormsColumns.DATE) == true) {
Date today=new Date();
String ts=new SimpleDateFormat("String_Node_Str").format(today);
values.put(FormsColumns.DISPLAY_SUBTEXT,"String_Node_Str" + ts);
}
count=db.update(FORMS_TABLE_NAME,values,FormsColumns._ID + "String_Node_Str" + formId+ (!TextUtils.isEmpty(where) ? "String_Node_Str" + where + ')' : "String_Node_Str"),whereArgs);
}
 else {
Log.e(t,"String_Node_Str");
}
}
  finally {
if (update != null) {
update.close();
}
}
break;
default :
throw new IllegalArgumentException("String_Node_Str" + uri);
}
getContext().getContentResolver().notifyChange(uri,null);
return count;
}

Fixed version (ground truth):
@Override public int update(Uri uri,ContentValues values,String where,String[] whereArgs){
  init();
  SQLiteDatabase db=mDbHelper.getWritableDatabase();
  int count=0;
switch (sUriMatcher.match(uri)) {
case FORMS:
    if (values.containsKey(FormsColumns.MD5_HASH)) {
      values.remove(FormsColumns.MD5_HASH);
    }
  if (values.containsKey(FormsColumns.FORM_FILE_PATH)) {
    String formFile=values.getAsString(FormsColumns.FORM_FILE_PATH);
    values.put(FormsColumns.MD5_HASH,FileUtil.getMd5Hash(new File(formFile)));
  }
Cursor c=null;
try {
c=this.query(uri,null,where,whereArgs,null);
if (c.getCount() > 0) {
  c.moveToPosition(-1);
  while (c.moveToNext()) {
    if (values.containsKey(FormsColumns.FORM_FILE_PATH)) {
      String newFile=values.getAsString(FormsColumns.FORM_FILE_PATH);
      String delFile=c.getString(c.getColumnIndex(FormsColumns.FORM_FILE_PATH));
      if (newFile.equalsIgnoreCase(delFile)) {
      }
 else {
        FileUtil.deleteFileOrDir(delFile);
      }
      FileUtil.deleteFileOrDir(c.getString(c.getColumnIndex(FormsColumns.JRCACHE_FILE_PATH)));
    }
  }
}
}
  finally {
if (c != null) {
  c.close();
}
}
if (values.containsKey(FormsColumns.DATE) == true) {
Date today=new Date();
String ts=new SimpleDateFormat("String_Node_Str").format(today);
values.put(FormsColumns.DISPLAY_SUBTEXT,"String_Node_Str" + ts);
}
count=db.update(FORMS_TABLE_NAME,values,where,whereArgs);
break;
case FORM_ID:
String formId=uri.getPathSegments().get(1);
Cursor update=null;
try {
update=this.query(uri,null,where,whereArgs,null);
if (update.getCount() > 0) {
update.moveToFirst();
if (values.containsKey(FormsColumns.MD5_HASH)) {
values.remove(FormsColumns.MD5_HASH);
}
if (values.containsKey(FormsColumns.JRCACHE_FILE_PATH)) {
FileUtil.deleteFileOrDir(update.getString(update.getColumnIndex(FormsColumns.JRCACHE_FILE_PATH)));
}
if (values.containsKey(FormsColumns.FORM_FILE_PATH)) {
String formFile=values.getAsString(FormsColumns.FORM_FILE_PATH);
String oldFile=update.getString(update.getColumnIndex(FormsColumns.FORM_FILE_PATH));
try {
if (new File(oldFile).getCanonicalPath().equals(new File(formFile).getCanonicalPath())) {
}
 else {
FileUtil.deleteFileOrDir(oldFile);
}
}
 catch (IOException ioe) {
}
FileUtil.deleteFileOrDir(update.getString(update.getColumnIndex(FormsColumns.JRCACHE_FILE_PATH)));
String newMd5=FileUtil.getMd5Hash(new File(formFile));
values.put(FormsColumns.MD5_HASH,newMd5);
values.put(FormsColumns.JRCACHE_FILE_PATH,"String_Node_Str" + newMd5 + "String_Node_Str");
}
if (values.containsKey(FormsColumns.DATE) == true) {
Date today=new Date();
String ts=new SimpleDateFormat("String_Node_Str").format(today);
values.put(FormsColumns.DISPLAY_SUBTEXT,"String_Node_Str" + ts);
}
count=db.update(FORMS_TABLE_NAME,values,FormsColumns._ID + "String_Node_Str" + formId+ (!TextUtils.isEmpty(where) ? "String_Node_Str" + where + ')' : "String_Node_Str"),whereArgs);
}
 else {
Log.e(t,"String_Node_Str");
}
}
  finally {
if (update != null) {
update.close();
}
}
break;
default :
throw new IllegalArgumentException("String_Node_Str" + uri);
}
getContext().getContentResolver().notifyChange(uri,null);
return count;
}