Program: 35162
Project: 35162
Buggy source:
@Override @DbSession public Result importAccount(String priKey,String password){
  Account account=null;
  try {
    account=AccountTool.createAccount(priKey);
  }
 catch (  NulsException e) {
    return Result.getFailed("String_Node_Str");
  }
  AccountPo accountPo=accountDao.get(account.getAddress().getBase58());
  if (accountPo != null) {
    return Result.getFailed(ErrorCode.ACCOUNT_EXIST);
  }
 else {
    accountPo=new AccountPo();
  }
  Account defaultAcct=getDefaultAccount();
  if (defaultAcct != null) {
    try {
      if (!defaultAcct.decrypt(password)) {
        return Result.getFailed(ErrorCode.PASSWORD_IS_WRONG);
      }
      defaultAcct.encrypt(password);
    }
 catch (    NulsException e) {
      e.printStackTrace();
    }
  }
  try {
    account.encrypt(password);
  }
 catch (  NulsException e) {
    e.printStackTrace();
  }
  AccountTool.toPojo(account,accountPo);
  AliasPo aliasPo=aliasDataService.getByAddress(accountPo.getAddress());
  if (aliasPo != null) {
    account.setAlias(aliasPo.getAlias());
    accountPo.setAlias(aliasPo.getAlias());
  }
  accountDao.save(accountPo);
  ledgerService.saveTxInLocal(accountPo.getAddress());
  accountCacheService.putAccount(account);
  NulsContext.LOCAL_ADDRESS_LIST.add(accountPo.getAddress());
  ledgerService.getBalance(accountPo.getAddress());
  AccountImportedNotice notice=new AccountImportedNotice();
  notice.setEventBody(account);
  eventBroadcaster.publishToLocal(notice);
  Result result=Result.getSuccess();
  result.setObject(accountPo.getAddress());
  return result;
}

Fixed version (ground truth):
@Override @DbSession public Result importAccount(String priKey,String password){
  Account account=null;
  try {
    account=AccountTool.createAccount(priKey);
  }
 catch (  NulsException e) {
    return Result.getFailed("String_Node_Str");
  }
  AccountPo accountPo=accountDao.get(account.getAddress().getBase58());
  if (accountPo != null) {
    return Result.getFailed(ErrorCode.ACCOUNT_EXIST);
  }
 else {
    accountPo=new AccountPo();
  }
  Account defaultAcct=getDefaultAccount();
  if (defaultAcct != null) {
    try {
      if (!defaultAcct.decrypt(password)) {
        return Result.getFailed(ErrorCode.PASSWORD_IS_WRONG);
      }
      defaultAcct.encrypt(password);
    }
 catch (    NulsException e) {
      e.printStackTrace();
    }
  }
  try {
    account.encrypt(password);
  }
 catch (  NulsException e) {
    e.printStackTrace();
  }
  AccountTool.toPojo(account,accountPo);
  AliasPo aliasPo=aliasDataService.getByAddress(accountPo.getAddress());
  if (aliasPo != null) {
    account.setAlias(aliasPo.getAlias());
    accountPo.setAlias(aliasPo.getAlias());
  }
  accountDao.save(accountPo);
  ledgerService.saveTxInLocal(accountPo.getAddress());
  accountCacheService.putAccount(account);
  NulsContext.LOCAL_ADDRESS_LIST.add(accountPo.getAddress());
  ledgerService.getBalance(accountPo.getAddress());
  if (getDefaultAccount() == null) {
    setDefaultAccount(account.getAddress().getBase58());
  }
  AccountImportedNotice notice=new AccountImportedNotice();
  notice.setEventBody(account);
  eventBroadcaster.publishToLocal(notice);
  Result result=Result.getSuccess();
  result.setObject(accountPo.getAddress());
  return result;
}