Program: 34978
Project: 34978
Buggy source:
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value="String_Node_Str",notes="String_Node_Str") @ApiResponses(value={@ApiResponse(code=200,message="String_Node_Str",response=String.class)}) public RpcClientResult getCreateAgentFee(@BeanParam() GetCreateAgentFeeForm form) throws NulsException {
  AssertUtil.canNotEmpty(form);
  AssertUtil.canNotEmpty(form.getAgentAddress(),"String_Node_Str");
  AssertUtil.canNotEmpty(form.getCommissionRate(),"String_Node_Str");
  AssertUtil.canNotEmpty(form.getDeposit(),"String_Node_Str");
  AssertUtil.canNotEmpty(form.getPackingAddress(),"String_Node_Str");
  if (StringUtils.isBlank(form.getRewardAddress())) {
    form.setRewardAddress(form.getAgentAddress());
  }
  CreateAgentTransaction tx=new CreateAgentTransaction();
  tx.setTime(TimeService.currentTimeMillis());
  Agent agent=new Agent();
  agent.setAgentAddress(AddressTool.getAddress(form.getAgentAddress()));
  agent.setPackingAddress(AddressTool.getAddress(form.getPackingAddress()));
  if (StringUtils.isBlank(form.getRewardAddress())) {
    agent.setRewardAddress(agent.getAgentAddress());
  }
 else {
    agent.setRewardAddress(AddressTool.getAddress(form.getRewardAddress()));
  }
  agent.setDeposit(Na.valueOf(form.getDeposit()));
  agent.setCommissionRate(form.getCommissionRate());
  tx.setTxData(agent);
  CoinData coinData=new CoinData();
  List<Coin> toList=new ArrayList<>();
  toList.add(new Coin(agent.getAgentAddress(),agent.getDeposit(),-1));
  coinData.setTo(toList);
  tx.setCoinData(coinData);
  CoinDataResult result=accountLedgerService.getCoinData(agent.getAgentAddress(),agent.getDeposit(),tx.size() + P2PKHScriptSig.DEFAULT_SERIALIZE_LENGTH,TransactionFeeCalculator.OTHER_PRECE_PRE_1024_BYTES);
  tx.getCoinData().setFrom(result.getCoinList());
  if (null != result.getChange()) {
    tx.getCoinData().getTo().add(result.getChange());
  }
  Na fee=TransactionFeeCalculator.getMaxFee(tx.size() + P2PKHScriptSig.DEFAULT_SERIALIZE_LENGTH);
  Map<String,Object> valueMap=new HashMap<>();
  valueMap.put("String_Node_Str",fee.getValue());
  return Result.getSuccess().setData(valueMap).toRpcClientResult();
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value="String_Node_Str",notes="String_Node_Str") @ApiResponses(value={@ApiResponse(code=200,message="String_Node_Str",response=String.class)}) public RpcClientResult getCreateAgentFee(@BeanParam() GetCreateAgentFeeForm form) throws NulsException {
  AssertUtil.canNotEmpty(form);
  AssertUtil.canNotEmpty(form.getAgentAddress(),"String_Node_Str");
  AssertUtil.canNotEmpty(form.getCommissionRate(),"String_Node_Str");
  AssertUtil.canNotEmpty(form.getDeposit(),"String_Node_Str");
  AssertUtil.canNotEmpty(form.getPackingAddress(),"String_Node_Str");
  if (StringUtils.isBlank(form.getRewardAddress())) {
    form.setRewardAddress(form.getAgentAddress());
  }
  CreateAgentTransaction tx=new CreateAgentTransaction();
  tx.setTime(TimeService.currentTimeMillis());
  Agent agent=new Agent();
  agent.setAgentAddress(AddressTool.getAddress(form.getAgentAddress()));
  agent.setPackingAddress(AddressTool.getAddress(form.getPackingAddress()));
  if (StringUtils.isBlank(form.getRewardAddress())) {
    agent.setRewardAddress(agent.getAgentAddress());
  }
 else {
    agent.setRewardAddress(AddressTool.getAddress(form.getRewardAddress()));
  }
  agent.setDeposit(Na.valueOf(form.getDeposit()));
  agent.setCommissionRate(form.getCommissionRate());
  tx.setTxData(agent);
  CoinData coinData=new CoinData();
  List<Coin> toList=new ArrayList<>();
  toList.add(new Coin(agent.getAgentAddress(),agent.getDeposit(),-1));
  coinData.setTo(toList);
  tx.setCoinData(coinData);
  CoinDataResult result=accountLedgerService.getCoinData(agent.getAgentAddress(),agent.getDeposit(),tx.size() + P2PKHScriptSig.DEFAULT_SERIALIZE_LENGTH,TransactionFeeCalculator.OTHER_PRECE_PRE_1024_BYTES);
  tx.getCoinData().setFrom(result.getCoinList());
  if (null != result.getChange()) {
    tx.getCoinData().getTo().add(result.getChange());
  }
  Na fee=TransactionFeeCalculator.getMaxFee(tx.size() + P2PKHScriptSig.DEFAULT_SERIALIZE_LENGTH);
  return Result.getSuccess().setData(fee).toRpcClientResult();
}