Program: 39360
Project: 39360
Buggy source:
/** 
 * 修改账户通用方法
 * @param editType
 * @param accountID
 * @param remark
 * @param typeID
 * @param money
 * @param accountName
 * @param callback
 * @param handler
 */
private void editAccount(final int editType,final long accountID,final String remark,final int typeID,final double money,final String accountName,final Callback callback,final Handler handler){
  if (canSync()) {
    Account account=accountLocalDao.getAccountByID(accountID,_context);
    if (!TextUtils.isEmpty(account.getObjectID())) {
      AVAccount avAccount=DataConvertUtil.convertAccount2AVAccount(account);
      avAccount.setAccountIsDel(false);
      if (editType == EDIT_TYPE_DEL) {
        avAccount.setAccountIsDel(true);
      }
 else       if (editType == EDIT_TYPE_ACCOUNT_TYPE) {
        avAccount.setAccountTypeId(typeID);
      }
 else       if (editType == EDIT_TYPE_ACCOUNT_MONEY) {
        avAccount.setAccountMoney(money);
      }
 else       if (editType == EDIT_TYPE_ACCOUNT_REMARK) {
        avAccount.setAccountRemark(remark);
      }
 else       if (editType == EDIT_TYPE_ACCOUNT_NAME) {
        avAccount.setAccountName(accountName);
      }
 else       if (editType == EDIT_TYPE_ACCOUNT_COLOR) {
        avAccount.setAccountColor(remark);
      }
      avAccount.saveInBackground(new SaveCallback(){
        @Override public void done(        AVException e){
          getAvEx(e);
          if (e == null) {
            callback.doSth(true,null);
          }
 else {
            callback.doSth(false,null);
          }
          sendEmptyMessage(handler,Constant.MSG_SUCCESS);
        }
      }
);
      return;
    }
    AVQuery<AVAccount> query=AVObject.getQuery(AVAccount.class);
    query.whereEqualTo(AVAccount.ACCOUNT_ID,accountID);
    query.whereEqualTo(AVAccount.USER,MyAVUser.getCurrentUser());
    query.findInBackground(new FindCallback<AVAccount>(){
      @Override public void done(      List<AVAccount> list,      AVException e){
        if (e == null) {
          AVAccount avAccount=null;
          if (list.size() > 0) {
            avAccount=list.get(0);
          }
 else {
            Account account=accountLocalDao.getAccountByID(accountID,_context);
            avAccount=DataConvertUtil.convertAccount2AVAccount(account);
          }
          if (editType == EDIT_TYPE_DEL) {
            avAccount.setAccountIsDel(true);
          }
 else           if (editType == EDIT_TYPE_ACCOUNT_TYPE) {
            avAccount.setAccountTypeId(typeID);
          }
 else           if (editType == EDIT_TYPE_ACCOUNT_MONEY) {
            avAccount.setAccountMoney(money);
          }
 else           if (editType == EDIT_TYPE_ACCOUNT_REMARK) {
            avAccount.setAccountRemark(remark);
          }
 else           if (editType == EDIT_TYPE_ACCOUNT_NAME) {
            avAccount.setAccountName(accountName);
          }
 else           if (editType == EDIT_TYPE_ACCOUNT_COLOR) {
            avAccount.setAccountColor(remark);
          }
          final String objId=avAccount.getObjectId();
          avAccount.saveInBackground(new SaveCallback(){
            @Override public void done(            AVException e){
              if (e == null) {
                callback.doSth(true,objId);
              }
 else {
                getAvEx(e);
                callback.doSth(false,objId);
              }
              sendEmptyMessage(handler,Constant.MSG_SUCCESS);
            }
          }
);
        }
 else {
          getAvEx(e);
          callback.doSth(false,null);
          sendEmptyMessage(handler,Constant.MSG_SUCCESS);
        }
      }
    }
);
  }
 else {
    callback.doSth(false,null);
    sendEmptyMessage(handler,Constant.MSG_SUCCESS);
  }
}

Fixed version (ground truth):
/** 
 * 修改账户通用方法
 * @param editType
 * @param accountID
 * @param remark
 * @param typeID
 * @param money
 * @param accountName
 * @param callback
 * @param handler
 */
private void editAccount(final int editType,final long accountID,final String remark,final int typeID,final double money,final String accountName,final Callback callback,final Handler handler){
  if (canSync()) {
    Account account=accountLocalDao.getAccountByID(accountID,_context);
    if (account.getIsDel()) {
      sendEmptyMessage(handler,Constant.MSG_SUCCESS);
      return;
    }
    if (!TextUtils.isEmpty(account.getObjectID())) {
      AVAccount avAccount=DataConvertUtil.convertAccount2AVAccount(account);
      avAccount.setAccountIsDel(account.getIsDel());
      if (editType == EDIT_TYPE_DEL) {
        avAccount.setAccountIsDel(true);
      }
 else       if (editType == EDIT_TYPE_ACCOUNT_TYPE) {
        avAccount.setAccountTypeId(typeID);
      }
 else       if (editType == EDIT_TYPE_ACCOUNT_MONEY) {
        avAccount.setAccountMoney(money);
      }
 else       if (editType == EDIT_TYPE_ACCOUNT_REMARK) {
        avAccount.setAccountRemark(remark);
      }
 else       if (editType == EDIT_TYPE_ACCOUNT_NAME) {
        avAccount.setAccountName(accountName);
      }
 else       if (editType == EDIT_TYPE_ACCOUNT_COLOR) {
        avAccount.setAccountColor(remark);
      }
      avAccount.saveInBackground(new SaveCallback(){
        @Override public void done(        AVException e){
          getAvEx(e);
          if (e == null) {
            callback.doSth(true,null);
          }
 else {
            callback.doSth(false,null);
          }
          sendEmptyMessage(handler,Constant.MSG_SUCCESS);
        }
      }
);
      return;
    }
    AVQuery<AVAccount> query=AVObject.getQuery(AVAccount.class);
    query.whereEqualTo(AVAccount.ACCOUNT_ID,accountID);
    query.whereEqualTo(AVAccount.USER,MyAVUser.getCurrentUser());
    query.findInBackground(new FindCallback<AVAccount>(){
      @Override public void done(      List<AVAccount> list,      AVException e){
        if (e == null) {
          AVAccount avAccount=null;
          if (list.size() > 0) {
            avAccount=list.get(0);
          }
 else {
            Account account=accountLocalDao.getAccountByID(accountID,_context);
            avAccount=DataConvertUtil.convertAccount2AVAccount(account);
          }
          if (editType == EDIT_TYPE_DEL) {
            avAccount.setAccountIsDel(true);
          }
 else           if (editType == EDIT_TYPE_ACCOUNT_TYPE) {
            avAccount.setAccountTypeId(typeID);
          }
 else           if (editType == EDIT_TYPE_ACCOUNT_MONEY) {
            avAccount.setAccountMoney(money);
          }
 else           if (editType == EDIT_TYPE_ACCOUNT_REMARK) {
            avAccount.setAccountRemark(remark);
          }
 else           if (editType == EDIT_TYPE_ACCOUNT_NAME) {
            avAccount.setAccountName(accountName);
          }
 else           if (editType == EDIT_TYPE_ACCOUNT_COLOR) {
            avAccount.setAccountColor(remark);
          }
          final String objId=avAccount.getObjectId();
          avAccount.saveInBackground(new SaveCallback(){
            @Override public void done(            AVException e){
              if (e == null) {
                callback.doSth(true,objId);
              }
 else {
                getAvEx(e);
                callback.doSth(false,objId);
              }
              sendEmptyMessage(handler,Constant.MSG_SUCCESS);
            }
          }
);
        }
 else {
          getAvEx(e);
          callback.doSth(false,null);
          sendEmptyMessage(handler,Constant.MSG_SUCCESS);
        }
      }
    }
);
  }
 else {
    callback.doSth(false,null);
    sendEmptyMessage(handler,Constant.MSG_SUCCESS);
  }
}