nus-yam/ex-repair huggingface dataset:
Program: 35127
Project: 35127
Buggy source:
@Override public void afterParse(CoinData coinData,Transaction tx){
  UtxoData utxoData=(UtxoData)coinData;
  if (null != utxoData.getInputs()) {
    for (    UtxoInput input : utxoData.getInputs()) {
      input.setTxHash(tx.getHash());
    }
  }
  if (tx instanceof LockNulsTransaction) {
    utxoData.getOutputs().get(0).setStatus(OutPutStatusEnum.UTXO_UNCONFIRM_CONSENSUS_LOCK);
  }
}

Fixed version (ground truth):
@Override public void afterParse(CoinData coinData,Transaction tx){
  UtxoData utxoData=(UtxoData)coinData;
  if (null != utxoData.getInputs()) {
    for (    UtxoInput input : utxoData.getInputs()) {
      input.setTxHash(tx.getHash());
    }
  }
  if (tx instanceof LockNulsTransaction) {
    utxoData.getOutputs().get(0).setStatus(OutPutStatusEnum.UTXO_UNCONFIRMED_CONSENSUS_LOCK);
  }
}
Program: 35130
Project: 35130
Buggy source:
private void approveProcessOutput(List<UtxoOutput> outputs,Transaction tx,Set<String> addressSet){
  for (int i=0; i < outputs.size(); i++) {
    UtxoOutput output=outputs.get(i);
    if (tx instanceof LockNulsTransaction && i == 0) {
      output.setStatus(OutPutStatusEnum.UTXO_UNCONFIRM_CONSENSUS_LOCK);
    }
 else     if (output.getLockTime() > 0) {
      output.setStatus(OutPutStatusEnum.UTXO_UNCONFIRM_TIME_LOCK);
    }
 else {
      output.setStatus(OutPutStatusEnum.UTXO_UNCONFIRM_UNSPEND);
    }
    ledgerCacheService.putUtxo(output.getKey(),output);
    addressSet.add(output.getAddress());
  }
}

Fixed version (ground truth):
private void approveProcessOutput(List<UtxoOutput> outputs,Transaction tx,Set<String> addressSet){
  for (int i=0; i < outputs.size(); i++) {
    UtxoOutput output=outputs.get(i);
    if (tx instanceof LockNulsTransaction && i == 0 && output.getLockTime() == 0) {
      output.setStatus(OutPutStatusEnum.UTXO_UNCONFIRMED_CONSENSUS_LOCK);
    }
 else     if (output.getLockTime() > 0) {
      output.setStatus(OutPutStatusEnum.UTXO_UNCONFIRMED_TIME_LOCK);
    }
 else {
      output.setStatus(OutPutStatusEnum.UTXO_UNCONFIRMED_UNSPENT);
    }
    ledgerCacheService.putUtxo(output.getKey(),output);
    addressSet.add(output.getAddress());
  }
}
Program: 35131
Project: 35131
Buggy source:
private void processDataInput(UtxoData utxoData,List<UtxoInputPo> inputPoList,List<UtxoOutput> spends,List<UtxoOutputPo> spendPoList,Set<String> addressSet){
  boolean update;
  for (int i=0; i < utxoData.getInputs().size(); i++) {
    UtxoInput input=utxoData.getInputs().get(i);
    UtxoOutput spend=ledgerCacheService.getUtxo(input.getKey());
    if (spend == null) {
      throw new NulsRuntimeException(ErrorCode.DATA_NOT_FOUND,"String_Node_Str");
    }
    update=ledgerCacheService.updateUtxoStatus(spend.getKey(),OutPutStatusEnum.UTXO_SPENT,OutPutStatusEnum.UTXO_CONFIRM_SPEND);
    if (!update) {
      Log.error("String_Node_Str" + spend.getStatus().name());
      throw new NulsRuntimeException(ErrorCode.UTXO_STATUS_CHANGE);
    }
    spends.add(spend);
    spendPoList.add(UtxoTransferTool.toOutputPojo(spend));
    inputPoList.add(UtxoTransferTool.toInputPojo(input));
    addressSet.add(spend.getAddress());
  }
}

Fixed version (ground truth):
private void processDataInput(UtxoData utxoData,List<UtxoInputPo> inputPoList,List<UtxoOutput> spends,List<UtxoOutputPo> spendPoList,Set<String> addressSet){
  boolean update;
  for (int i=0; i < utxoData.getInputs().size(); i++) {
    UtxoInput input=utxoData.getInputs().get(i);
    UtxoOutput spend=ledgerCacheService.getUtxo(input.getKey());
    if (spend == null) {
      throw new NulsRuntimeException(ErrorCode.DATA_NOT_FOUND,"String_Node_Str");
    }
    update=ledgerCacheService.updateUtxoStatus(spend.getKey(),OutPutStatusEnum.UTXO_SPENT,OutPutStatusEnum.UTXO_CONFIRMED_SPENT);
    if (!update) {
      Log.error("String_Node_Str" + spend.getStatus().name());
      throw new NulsRuntimeException(ErrorCode.UTXO_STATUS_CHANGE);
    }
    spends.add(spend);
    spendPoList.add(UtxoTransferTool.toOutputPojo(spend));
    inputPoList.add(UtxoTransferTool.toInputPojo(input));
    addressSet.add(spend.getAddress());
  }
}
Program: 35133
Project: 35133
Buggy source:
@Override @DbSession public void unlockTxRollback(String txHash){
  boolean b=true;
  int index=0;
  while (b) {
    UtxoOutput output=ledgerCacheService.getUtxo(txHash + "String_Node_Str" + index);
    if (output != null) {
      if (OutPutStatusEnum.UTXO_UNCONFIRM_UNSPEND == output.getStatus()) {
        output.setStatus(OutPutStatusEnum.UTXO_UNCONFIRM_CONSENSUS_LOCK);
      }
 else       if (OutPutStatusEnum.UTXO_CONFIRM_UNSPEND == output.getStatus()) {
        output.setStatus(OutPutStatusEnum.UTXO_CONFIRM_CONSENSUS_LOCK);
      }
      UtxoTransactionTool.getInstance().calcBalance(output.getAddress(),false);
      index++;
    }
 else {
      b=false;
    }
  }
  txDao.lockTxOutput(txHash);
}

Fixed version (ground truth):
@Override @DbSession public void unlockTxRollback(String txHash){
  boolean b=true;
  int index=0;
  while (b) {
    UtxoOutput output=ledgerCacheService.getUtxo(txHash + "String_Node_Str" + index);
    if (output != null) {
      if (OutPutStatusEnum.UTXO_UNCONFIRMED_UNSPENT == output.getStatus()) {
        output.setStatus(OutPutStatusEnum.UTXO_UNCONFIRMED_CONSENSUS_LOCK);
      }
 else       if (OutPutStatusEnum.UTXO_CONFIRMED_UNSPENT == output.getStatus()) {
        output.setStatus(OutPutStatusEnum.UTXO_CONFIRMED_CONSENSUS_LOCK);
      }
      UtxoTransactionTool.getInstance().calcBalance(output.getAddress(),false);
      index++;
    }
 else {
      b=false;
    }
  }
  txDao.lockTxOutput(txHash);
}
Program: 35134
Project: 35134
Buggy source:
@Override public void unlockTxApprove(String txHash,long rockTime){
  boolean b=true;
  int index=0;
  while (b) {
    UtxoOutput output=ledgerCacheService.getUtxo(txHash + "String_Node_Str" + index);
    if (output != null) {
      if (rockTime > 0) {
        if (OutPutStatusEnum.UTXO_UNCONFIRM_CONSENSUS_LOCK == output.getStatus()) {
          output.setStatus(OutPutStatusEnum.UTXO_UNCONFIRM_TIME_LOCK);
        }
 else         if (OutPutStatusEnum.UTXO_CONFIRM_CONSENSUS_LOCK == output.getStatus()) {
          output.setStatus(OutPutStatusEnum.UTXO_CONFIRM_TIME_LOCK);
        }
      }
 else {
        if (OutPutStatusEnum.UTXO_UNCONFIRM_CONSENSUS_LOCK == output.getStatus()) {
          output.setStatus(OutPutStatusEnum.UTXO_UNCONFIRM_UNSPEND);
        }
 else         if (OutPutStatusEnum.UTXO_CONFIRM_CONSENSUS_LOCK == output.getStatus()) {
          output.setStatus(OutPutStatusEnum.UTXO_CONFIRM_UNSPEND);
        }
      }
      UtxoTransactionTool.getInstance().calcBalance(output.getAddress(),false);
      index++;
    }
 else {
      b=false;
    }
  }
}

Fixed version (ground truth):
@Override public void unlockTxApprove(String txHash,long rockTime){
  boolean b=true;
  int index=0;
  while (b) {
    UtxoOutput output=ledgerCacheService.getUtxo(txHash + "String_Node_Str" + index);
    if (output != null) {
      if (rockTime > 0) {
        if (OutPutStatusEnum.UTXO_UNCONFIRMED_CONSENSUS_LOCK == output.getStatus()) {
          output.setStatus(OutPutStatusEnum.UTXO_UNCONFIRMED_TIME_LOCK);
        }
 else         if (OutPutStatusEnum.UTXO_CONFIRMED_CONSENSUS_LOCK == output.getStatus()) {
          output.setStatus(OutPutStatusEnum.UTXO_CONFIRMED_TIME_LOCK);
        }
      }
 else {
        if (OutPutStatusEnum.UTXO_UNCONFIRMED_CONSENSUS_LOCK == output.getStatus()) {
          output.setStatus(OutPutStatusEnum.UTXO_UNCONFIRMED_UNSPENT);
        }
 else         if (OutPutStatusEnum.UTXO_CONFIRMED_CONSENSUS_LOCK == output.getStatus()) {
          output.setStatus(OutPutStatusEnum.UTXO_CONFIRMED_UNSPENT);
        }
      }
      UtxoTransactionTool.getInstance().calcBalance(output.getAddress(),false);
      index++;
    }
 else {
      b=false;
    }
  }
}
Program: 35135
Project: 35135
Buggy source:
public void checkUtxoTimeLock(List<UtxoOutput> outputList){
  long currentTime=TimeService.currentTimeMillis();
  long genesisTime=NulsContext.getInstance().getGenesisBlock().getHeader().getTime();
  long bestHeight=NulsContext.getInstance().getNetBestBlockHeight();
  for (  UtxoOutput output : outputList) {
    if (output.isLocked()) {
      if (output.getLockTime() >= genesisTime && output.getLockTime() <= currentTime) {
        if (OutPutStatusEnum.UTXO_CONFIRM_TIME_LOCK.equals(output.getStatus())) {
          output.setStatus(OutPutStatusEnum.UTXO_CONFIRM_UNSPEND);
        }
 else         if (OutPutStatusEnum.UTXO_UNCONFIRM_TIME_LOCK.equals(output.getStatus())) {
          output.setStatus(OutPutStatusEnum.UTXO_UNCONFIRM_UNSPEND);
        }
      }
 else       if (output.getLockTime() < genesisTime && output.getLockTime() >= bestHeight) {
        if (OutPutStatusEnum.UTXO_CONFIRM_TIME_LOCK.equals(output.getStatus())) {
          output.setStatus(OutPutStatusEnum.UTXO_CONFIRM_UNSPEND);
        }
 else         if (OutPutStatusEnum.UTXO_UNCONFIRM_TIME_LOCK.equals(output.getStatus())) {
          output.setStatus(OutPutStatusEnum.UTXO_UNCONFIRM_UNSPEND);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void checkUtxoTimeLock(List<UtxoOutput> outputList){
  long currentTime=TimeService.currentTimeMillis();
  long genesisTime=NulsContext.getInstance().getGenesisBlock().getHeader().getTime();
  long bestHeight=NulsContext.getInstance().getNetBestBlockHeight();
  for (  UtxoOutput output : outputList) {
    if (output.isLocked()) {
      if (output.getLockTime() >= genesisTime && output.getLockTime() <= currentTime) {
        if (OutPutStatusEnum.UTXO_CONFIRMED_TIME_LOCK.equals(output.getStatus())) {
          output.setStatus(OutPutStatusEnum.UTXO_CONFIRMED_UNSPENT);
        }
 else         if (OutPutStatusEnum.UTXO_UNCONFIRMED_TIME_LOCK.equals(output.getStatus())) {
          output.setStatus(OutPutStatusEnum.UTXO_UNCONFIRMED_UNSPENT);
        }
      }
 else       if (output.getLockTime() < genesisTime && output.getLockTime() >= bestHeight) {
        if (OutPutStatusEnum.UTXO_CONFIRMED_TIME_LOCK.equals(output.getStatus())) {
          output.setStatus(OutPutStatusEnum.UTXO_CONFIRMED_UNSPENT);
        }
 else         if (OutPutStatusEnum.UTXO_UNCONFIRMED_TIME_LOCK.equals(output.getStatus())) {
          output.setStatus(OutPutStatusEnum.UTXO_UNCONFIRMED_UNSPENT);
        }
      }
    }
  }
}
Program: 35136
Project: 35136
Buggy source:
public Integer getSeverPort(){
  if (severPort == null) {
    severPort=0;
  }
  return severPort;
}

Fixed version (ground truth):
public Integer getSeverPort(){
  return severPort;
}
Program: 35137
Project: 35137
Buggy source:
@Override public void parse(NulsByteBuffer buffer) throws NulsException {
  magicNumber=(int)buffer.readVarInt();
  port=(int)buffer.readVarInt();
  ip=new String(buffer.readByLengthByte());
  this.groupSet=ConcurrentHashMap.newKeySet();
}

Fixed version (ground truth):
@Override public void parse(NulsByteBuffer buffer) throws NulsException {
  magicNumber=(int)buffer.readVarInt();
  port=(int)buffer.readVarInt();
  severPort=port;
  ip=new String(buffer.readByLengthByte());
  this.groupSet=ConcurrentHashMap.newKeySet();
}
Program: 35138
Project: 35138
Buggy source:
@Override public int size(){
  int s=0;
  s+=VarInt.sizeOf(magicNumber);
  s+=VarInt.sizeOf(getSeverPort());
  s+=1;
  try {
    s+=ip.getBytes(NulsContext.DEFAULT_ENCODING).length;
  }
 catch (  UnsupportedEncodingException e) {
    Log.error(e);
  }
  return s;
}

Fixed version (ground truth):
@Override public int size(){
  int s=0;
  s+=VarInt.sizeOf(magicNumber);
  s+=VarInt.sizeOf(severPort);
  s+=1;
  try {
    s+=ip.getBytes(NulsContext.DEFAULT_ENCODING).length;
  }
 catch (  UnsupportedEncodingException e) {
    Log.error(e);
  }
  return s;
}
Program: 35139
Project: 35139
Buggy source:
public static boolean isNumberGtZero(String str){
  Matcher isNum=GT_ZERO_NUMBER_PATTERN.matcher(str);
  if (!isNum.matches()) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
public static boolean isNumberGtZero(String str){
  if (StringUtils.isBlank(str)) {
    return false;
  }
  Matcher isNum=GT_ZERO_NUMBER_PATTERN.matcher(str);
  if (!isNum.matches()) {
    return false;
  }
  return true;
}
Program: 35140
Project: 35140
Buggy source:
public static boolean isNumber(String str){
  Matcher isNum=NUMBER_PATTERN.matcher(str);
  if (!isNum.matches()) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
public static boolean isNumber(String str){
  if (StringUtils.isBlank(str)) {
    return false;
  }
  Matcher isNum=NUMBER_PATTERN.matcher(str);
  if (!isNum.matches()) {
    return false;
  }
  return true;
}
Program: 35141
Project: 35141
Buggy source:
@Override public boolean argsValidate(String[] args){
  return true;
}

Fixed version (ground truth):
@Override public boolean argsValidate(String[] args){
  int length=args.length;
  if (length > 1)   return false;
  return true;
}
Program: 35142
Project: 35142
Buggy source:
private void sdkInit(){
  String port=null;
  try {
    port=NulsContext.MODULES_CONFIG.getCfgValue(RpcConstant.CFG_RPC_SECTION,RpcConstant.CFG_RPC_SERVER_PORT);
  }
 catch (  NulsException e) {
  }
  if (StringUtils.isBlank(port)) {
    SdkManager.init("String_Node_Str" + RpcConstant.DEFAULT_IP + "String_Node_Str"+ RpcConstant.DEFAULT_PORT);
  }
 else {
    SdkManager.init("String_Node_Str" + RpcConstant.DEFAULT_IP + "String_Node_Str"+ port);
  }
}

Fixed version (ground truth):
private void sdkInit(){
  String port=null;
  try {
    NulsContext.MODULES_CONFIG=ConfigLoader.loadIni(NulsConstant.MODULES_CONFIG_FILE);
    port=NulsContext.MODULES_CONFIG.getCfgValue(RpcConstant.CFG_RPC_SECTION,RpcConstant.CFG_RPC_SERVER_PORT);
  }
 catch (  IOException e) {
    Log.error("String_Node_Str",e);
    throw new NulsRuntimeException(ErrorCode.FAILED,"String_Node_Str");
  }
catch (  NulsException e) {
  }
  if (StringUtils.isBlank(port)) {
    SdkManager.init("String_Node_Str" + RpcConstant.DEFAULT_IP + "String_Node_Str"+ RpcConstant.DEFAULT_PORT);
  }
 else {
    SdkManager.init("String_Node_Str" + port);
  }
}
Program: 35145
Project: 35145
Buggy source:
public String getCommissionRate(){
  return commissionRate;
}

Fixed version (ground truth):
public double getCommissionRate(){
  return commissionRate;
}
Program: 35146
Project: 35146
Buggy source:
public void setCommissionRate(String commissionRate){
  this.commissionRate=commissionRate;
}

Fixed version (ground truth):
public void setCommissionRate(double commissionRate){
  this.commissionRate=commissionRate;
}
Program: 35147
Project: 35147
Buggy source:
public static void main(String[] args) throws IOException {
  CommandHandler instance=new CommandHandler();
  instance.init();
  System.out.print(CommandConstant.COMMAND_PS1);
  Scanner scan=new Scanner(System.in);
  while (scan.hasNextLine()) {
    String read=scan.nextLine().trim();
    if (StringUtils.isBlank(read)) {
      System.out.print(CommandConstant.COMMAND_PS1);
      continue;
    }
    System.out.print(CommandConstant.COMMAND_PS1 + instance.processCommand(read.split("String_Node_Str")) + "String_Node_Str"+ CommandConstant.COMMAND_PS1);
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  CommandHandler instance=new CommandHandler();
  instance.init();
  System.out.print(CommandConstant.COMMAND_PS1);
  Scanner scan=new Scanner(System.in);
  while (scan.hasNextLine()) {
    String read=scan.nextLine().trim();
    if (StringUtils.isBlank(read)) {
      System.out.print(CommandConstant.COMMAND_PS1);
      continue;
    }
    System.out.print(instance.processCommand(read.split("String_Node_Str")) + "String_Node_Str" + CommandConstant.COMMAND_PS1);
  }
}
Program: 35148
Project: 35148
Buggy source:
public static CommandResult getResult(RpcClientResult rpcResult){
  if (null == rpcResult) {
    return CommandResult.getFailed("String_Node_Str");
  }
  CommandResult result=new CommandResult();
  result.setSuccess(rpcResult.isSuccess());
  String message=rpcResult.getMsg();
  if (StringUtils.isBlank(message)) {
    message="String_Node_Str";
  }
 else {
    message+="String_Node_Str";
  }
  if (rpcResult.getData() != null) {
    try {
      message+=JSONUtils.obj2json(rpcResult.getData());
    }
 catch (    Exception e) {
      Log.error(e);
    }
  }
  result.setMessage(message);
  return result;
}

Fixed version (ground truth):
public static CommandResult getResult(RpcClientResult rpcResult){
  if (null == rpcResult) {
    return CommandResult.getFailed("String_Node_Str");
  }
  CommandResult result=new CommandResult();
  result.setSuccess(rpcResult.isSuccess());
  String message=rpcResult.getMsg();
  if (StringUtils.isBlank(message)) {
    message="String_Node_Str";
  }
 else {
    message+="String_Node_Str";
  }
  if (rpcResult.getData() != null) {
    try {
      message+=JSONUtils.obj2PrettyJson(rpcResult.getData());
    }
 catch (    Exception e) {
      Log.error(e);
    }
  }
  result.setMessage(message);
  return result;
}
Program: 35149
Project: 35149
Buggy source:
@Override public String getHelp(){
  return null;
}

Fixed version (ground truth):
@Override public String getHelp(){
  CommandBulider builder=new CommandBulider();
  builder.newLine(getCommandDescription());
  return builder.toString();
}
Program: 35150
Project: 35150
Buggy source:
public AccountDto(Map<String,Object> map){
  address=(String)map.get("String_Node_Str");
  alias=(String)map.get("String_Node_Str");
  pubKey=(String)map.get("String_Node_Str");
  extend=(String)map.get("String_Node_Str");
  createTime=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
}

Fixed version (ground truth):
public AccountDto(Map<String,Object> map){
  address=(String)map.get("String_Node_Str");
  alias=(String)map.get("String_Node_Str");
  pubKey=(String)map.get("String_Node_Str");
  extend=(String)map.get("String_Node_Str");
  createTime=StringUtils.parseLong(map.get("String_Node_Str"));
}
Program: 35151
Project: 35151
Buggy source:
public BalanceDto(Map<String,Object> map){
  balance=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  usable=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  locked=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
}

Fixed version (ground truth):
public BalanceDto(Map<String,Object> map){
  balance=StringUtils.parseLong(map.get("String_Node_Str"));
  usable=StringUtils.parseLong(map.get("String_Node_Str"));
  locked=StringUtils.parseLong(map.get("String_Node_Str"));
}
Program: 35152
Project: 35152
Buggy source:
public BlockDto(Map<String,Object> map,boolean all){
  this.hash=(String)map.get("String_Node_Str");
  this.preHash=(String)map.get("String_Node_Str");
  this.merkleHash=(String)map.get("String_Node_Str");
  this.time=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  this.height=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  this.txCount=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  this.packingAddress=(String)map.get("String_Node_Str");
  this.scriptSign=(String)map.get("String_Node_Str");
  this.roundIndex=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  this.consensusMemberCount=(Integer)map.get("String_Node_Str");
  this.roundStartTime=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  this.packingIndexOfRound=(Integer)map.get("String_Node_Str");
  this.reward=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  this.fee=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  this.confirmCount=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  this.size=(Integer)map.get("String_Node_Str");
  if (all) {
    this.txList=new ArrayList<>();
    for (    Map<String,Object> tx : (List<Map<String,Object>>)map.get("String_Node_Str")) {
      this.txList.add(new TransactionDto(tx));
    }
  }
}

Fixed version (ground truth):
public BlockDto(Map<String,Object> map,boolean all){
  this.hash=(String)map.get("String_Node_Str");
  this.preHash=(String)map.get("String_Node_Str");
  this.merkleHash=(String)map.get("String_Node_Str");
  this.time=StringUtils.parseLong(map.get("String_Node_Str"));
  this.height=StringUtils.parseLong(map.get("String_Node_Str"));
  this.txCount=StringUtils.parseLong(map.get("String_Node_Str"));
  this.packingAddress=(String)map.get("String_Node_Str");
  this.scriptSign=(String)map.get("String_Node_Str");
  this.roundIndex=StringUtils.parseLong(map.get("String_Node_Str"));
  this.consensusMemberCount=(Integer)map.get("String_Node_Str");
  this.roundStartTime=StringUtils.parseLong(map.get("String_Node_Str"));
  this.packingIndexOfRound=(Integer)map.get("String_Node_Str");
  this.reward=StringUtils.parseLong(map.get("String_Node_Str"));
  this.fee=StringUtils.parseLong(map.get("String_Node_Str"));
  this.confirmCount=StringUtils.parseLong(map.get("String_Node_Str"));
  this.size=(Integer)map.get("String_Node_Str");
  if (all) {
    this.txList=new ArrayList<>();
    for (    Map<String,Object> tx : (List<Map<String,Object>>)map.get("String_Node_Str")) {
      this.txList.add(new TransactionDto(tx));
    }
  }
}
Program: 35153
Project: 35153
Buggy source:
public ConsensusAddressInfoDto(Map<String,Object> map){
  this.agentCount=(Integer)map.get("String_Node_Str");
  this.totalDeposit=(Integer)map.get("String_Node_Str");
  this.reward=(Long)map.get("String_Node_Str");
  this.joinAgentCount=(Integer)map.get("String_Node_Str");
  this.usableBalance=(Long)map.get("String_Node_Str");
  this.rewardOfDay=(Long)map.get("String_Node_Str");
}

Fixed version (ground truth):
public ConsensusAddressInfoDto(Map<String,Object> map){
  this.agentCount=(Integer)map.get("String_Node_Str");
  this.totalDeposit=(Integer)map.get("String_Node_Str");
  this.reward=StringUtils.parseLong(map.get("String_Node_Str"));
  this.joinAgentCount=(Integer)map.get("String_Node_Str");
  this.usableBalance=StringUtils.parseLong(map.get("String_Node_Str"));
  this.rewardOfDay=StringUtils.parseLong(map.get("String_Node_Str"));
}
Program: 35154
Project: 35154
Buggy source:
public ConsensusAgentInfoDto(Map<String,Object> map){
  this.agentAddress=(String)map.get("String_Node_Str");
  this.agentName=(String)map.get("String_Node_Str");
  this.status=(Integer)map.get("String_Node_Str");
  this.owndeposit=(Long)map.get("String_Node_Str");
  this.totalDeposit=(Long)map.get("String_Node_Str");
  this.commissionRate=(Double)map.get("String_Node_Str");
  this.creditRatio=(Double)map.get("String_Node_Str");
  this.memberCount=(Integer)map.get("String_Node_Str");
  this.introduction=(String)map.get("String_Node_Str");
  this.startTime=(Long)map.get("String_Node_Str");
  this.packedCount=(Integer)map.get("String_Node_Str");
  this.reward=(Long)map.get("String_Node_Str");
}

Fixed version (ground truth):
public ConsensusAgentInfoDto(Map<String,Object> map){
  this.agentAddress=(String)map.get("String_Node_Str");
  this.agentName=(String)map.get("String_Node_Str");
  this.status=(Integer)map.get("String_Node_Str");
  this.owndeposit=StringUtils.parseLong(map.get("String_Node_Str"));
  this.totalDeposit=StringUtils.parseLong(map.get("String_Node_Str"));
  this.commissionRate=(Double)map.get("String_Node_Str");
  this.creditRatio=(Double)map.get("String_Node_Str");
  this.memberCount=(Integer)map.get("String_Node_Str");
  this.introduction=(String)map.get("String_Node_Str");
  this.startTime=StringUtils.parseLong(map.get("String_Node_Str"));
  this.packedCount=(Integer)map.get("String_Node_Str");
  this.reward=StringUtils.parseLong(map.get("String_Node_Str"));
}
Program: 35155
Project: 35155
Buggy source:
public ConsensusIntegratedDto(Map<String,Object> map){
  this.agentCount=(Integer)map.get("String_Node_Str");
  this.rewardOfDay=(Long)map.get("String_Node_Str");
  this.consensusAccountNumber=(Integer)map.get("String_Node_Str");
  this.totalDeposit=(Long)map.get("String_Node_Str");
}

Fixed version (ground truth):
public ConsensusIntegratedDto(Map<String,Object> map){
  this.agentCount=(Integer)map.get("String_Node_Str");
  this.rewardOfDay=StringUtils.parseLong(map.get("String_Node_Str"));
  this.consensusAccountNumber=(Integer)map.get("String_Node_Str");
  this.totalDeposit=StringUtils.parseLong(map.get("String_Node_Str"));
}
Program: 35156
Project: 35156
Buggy source:
public InfoDto(Map<String,Object> map){
  localBestHeight=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  netBestHeight=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  timeOffset=(String)map.get("String_Node_Str");
  inCount=(Integer)map.get("String_Node_Str");
  outCount=(Integer)map.get("String_Node_Str");
}

Fixed version (ground truth):
public InfoDto(Map<String,Object> map){
  localBestHeight=StringUtils.parseLong(map.get("String_Node_Str"));
  netBestHeight=StringUtils.parseLong(map.get("String_Node_Str"));
  timeOffset=(String)map.get("String_Node_Str");
  inCount=(Integer)map.get("String_Node_Str");
  outCount=(Integer)map.get("String_Node_Str");
}
Program: 35157
Project: 35157
Buggy source:
public InputDto(Map<String,Object> map){
  index=(Integer)map.get("String_Node_Str");
  fromHash=(String)map.get("String_Node_Str");
  fromIndex=(Integer)map.get("String_Node_Str");
  address=(String)map.get("String_Node_Str");
  value=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
}

Fixed version (ground truth):
public InputDto(Map<String,Object> map){
  index=(Integer)map.get("String_Node_Str");
  fromHash=(String)map.get("String_Node_Str");
  fromIndex=(Integer)map.get("String_Node_Str");
  address=(String)map.get("String_Node_Str");
  value=StringUtils.parseLong(map.get("String_Node_Str"));
}
Program: 35158
Project: 35158
Buggy source:
public NetworkDto(Map<String,Object> map){
  this.localBestHeight=(Long)map.get("String_Node_Str");
  this.netBestHeight=(Long)map.get("String_Node_Str");
  this.timeOffset=(String)map.get("String_Node_Str");
  this.inCount=(Integer)map.get("String_Node_Str");
  this.outCount=(Integer)map.get("String_Node_Str");
}

Fixed version (ground truth):
public NetworkDto(Map<String,Object> map){
  this.localBestHeight=StringUtils.parseLong(map.get("String_Node_Str"));
  this.netBestHeight=StringUtils.parseLong(map.get("String_Node_Str"));
  this.timeOffset=(String)map.get("String_Node_Str");
  this.inCount=(Integer)map.get("String_Node_Str");
  this.outCount=(Integer)map.get("String_Node_Str");
}
Program: 35159
Project: 35159
Buggy source:
public OutputDto(Map<String,Object> map){
  index=(Integer)map.get("String_Node_Str");
  address=(String)map.get("String_Node_Str");
  value=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  createTime=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  lockTime=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  type=(Integer)map.get("String_Node_Str");
  status=(Integer)map.get("String_Node_Str");
}

Fixed version (ground truth):
public OutputDto(Map<String,Object> map){
  index=(Integer)map.get("String_Node_Str");
  address=(String)map.get("String_Node_Str");
  value=StringUtils.parseLong(map.get("String_Node_Str"));
  createTime=StringUtils.parseLong(map.get("String_Node_Str"));
  lockTime=StringUtils.parseLong(map.get("String_Node_Str"));
  type=(Integer)map.get("String_Node_Str");
  status=(Integer)map.get("String_Node_Str");
}
Program: 35160
Project: 35160
Buggy source:
public TransactionDto(Map<String,Object> map){
  hash=(String)map.get("String_Node_Str");
  type=(Integer)map.get("String_Node_Str");
  index=(Integer)map.get("String_Node_Str");
  time=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  blockHeight=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  fee=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  value=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  transferType=(Integer)map.get("String_Node_Str");
  remark=(String)map.get("String_Node_Str");
  scriptSig=(String)map.get("String_Node_Str");
  status=(Integer)map.get("String_Node_Str");
  confirmCount=Long.parseLong("String_Node_Str" + map.get("String_Node_Str"));
  size=(Integer)map.get("String_Node_Str");
  inputs=new ArrayList<>();
  List<Map<String,Object>> inputMapList=(List<Map<String,Object>>)map.get("String_Node_Str");
  for (  Map<String,Object> inputMap : inputMapList) {
    inputs.add(new InputDto(inputMap));
  }
  outputs=new ArrayList<>();
  List<Map<String,Object>> outputMapList=(List<Map<String,Object>>)map.get("String_Node_Str");
  for (  Map<String,Object> outputMap : outputMapList) {
    outputs.add(new OutputDto(outputMap));
  }
}

Fixed version (ground truth):
public TransactionDto(Map<String,Object> map){
  hash=(String)map.get("String_Node_Str");
  type=(Integer)map.get("String_Node_Str");
  index=(Integer)map.get("String_Node_Str");
  time=StringUtils.parseLong(map.get("String_Node_Str"));
  blockHeight=StringUtils.parseLong(map.get("String_Node_Str"));
  fee=StringUtils.parseLong(map.get("String_Node_Str"));
  value=StringUtils.parseLong(map.get("String_Node_Str"));
  transferType=(Integer)map.get("String_Node_Str");
  remark=(String)map.get("String_Node_Str");
  scriptSig=(String)map.get("String_Node_Str");
  status=(Integer)map.get("String_Node_Str");
  confirmCount=StringUtils.parseLong(map.get("String_Node_Str"));
  size=(Integer)map.get("String_Node_Str");
  inputs=new ArrayList<>();
  List<Map<String,Object>> inputMapList=(List<Map<String,Object>>)map.get("String_Node_Str");
  for (  Map<String,Object> inputMap : inputMapList) {
    inputs.add(new InputDto(inputMap));
  }
  outputs=new ArrayList<>();
  List<Map<String,Object>> outputMapList=(List<Map<String,Object>>)map.get("String_Node_Str");
  for (  Map<String,Object> outputMap : outputMapList) {
    outputs.add(new OutputDto(outputMap));
  }
}
Program: 35161
Project: 35161
Buggy source:
@POST @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public RpcResult backup(AccountParamForm form){
  if (StringUtils.isNotBlank(form.getAddress()) && !Address.validAddress(form.getAddress())) {
    return RpcResult.getFailed(ErrorCode.PARAMETER_ERROR);
  }
  if (StringUtils.validPassword(form.getPassword())) {
    return RpcResult.getFailed(ErrorCode.PARAMETER_ERROR);
  }
  Result result;
  if (StringUtils.isNotBlank(form.getAddress())) {
    result=accountService.exportAccount(form.getAddress(),form.getPassword());
  }
 else {
    result=this.accountService.exportAccounts(form.getPassword());
  }
  return new RpcResult(result);
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public RpcResult backup(AccountParamForm form){
  if (StringUtils.isNotBlank(form.getAddress()) && !Address.validAddress(form.getAddress())) {
    return RpcResult.getFailed(ErrorCode.PARAMETER_ERROR);
  }
  if (!StringUtils.validPassword(form.getPassword())) {
    return RpcResult.getFailed(ErrorCode.PARAMETER_ERROR);
  }
  Result result;
  if (StringUtils.isNotBlank(form.getAddress())) {
    result=accountService.exportAccount(form.getAddress(),form.getPassword());
  }
 else {
    result=this.accountService.exportAccounts(form.getPassword());
  }
  return new RpcResult(result);
}
Program: 35163
Project: 35163
Buggy source:
@Override protected void serializeToStream(NulsOutputStreamBuffer stream) throws IOException {
  stream.writeVarInt(deposit.getValue());
  stream.writeString(delegateAddress);
  stream.writeDouble(this.commissionRate);
  stream.writeString(this.introduction);
  stream.writeBoolean(seed);
  stream.writeString(agentName);
}

Fixed version (ground truth):
@Override protected void serializeToStream(NulsOutputStreamBuffer stream) throws IOException {
  stream.writeVarInt(deposit.getValue());
  stream.writeString(agentAddress);
  stream.writeDouble(this.commissionRate);
  stream.writeString(this.introduction);
  stream.writeBoolean(seed);
  stream.writeString(agentName);
}
Program: 35164
Project: 35164
Buggy source:
@Override protected void parse(NulsByteBuffer byteBuffer) throws NulsException {
  this.deposit=Na.valueOf(byteBuffer.readVarInt());
  this.delegateAddress=byteBuffer.readString();
  this.commissionRate=byteBuffer.readDouble();
  this.introduction=byteBuffer.readString();
  this.seed=byteBuffer.readBoolean();
  this.agentName=byteBuffer.readString();
}

Fixed version (ground truth):
@Override protected void parse(NulsByteBuffer byteBuffer) throws NulsException {
  this.deposit=Na.valueOf(byteBuffer.readVarInt());
  this.agentAddress=byteBuffer.readString();
  this.commissionRate=byteBuffer.readDouble();
  this.introduction=byteBuffer.readString();
  this.seed=byteBuffer.readBoolean();
  this.agentName=byteBuffer.readString();
}
Program: 35165
Project: 35165
Buggy source:
@Override public int size(){
  int size=0;
  size+=Utils.sizeOfLong(deposit.getValue());
  size+=Utils.sizeOfString(this.delegateAddress);
  size+=Utils.sizeOfDouble(this.commissionRate);
  size+=Utils.sizeOfString(this.introduction);
  size+=Utils.sizeOfBoolean(seed);
  size+=Utils.sizeOfString(agentName);
  return size;
}

Fixed version (ground truth):
@Override public int size(){
  int size=0;
  size+=Utils.sizeOfLong(deposit.getValue());
  size+=Utils.sizeOfString(this.agentAddress);
  size+=Utils.sizeOfDouble(this.commissionRate);
  size+=Utils.sizeOfString(this.introduction);
  size+=Utils.sizeOfBoolean(seed);
  size+=Utils.sizeOfString(agentName);
  return size;
}
Program: 35166
Project: 35166
Buggy source:
public void initConsensusStatusInfo(){
  List<Consensus<Agent>> agentList=consensusCacheManager.getCachedAgentList();
  ConsensusStatusInfo info=new ConsensusStatusInfo();
  for (  String address : NulsContext.LOCAL_ADDRESS_LIST) {
    if (this.seedNodeList.contains(address)) {
      info.setAccount(accountService.getAccount(address));
      info.setStatus(ConsensusStatusEnum.IN.getCode());
      break;
    }
    for (    Consensus<Agent> agent : agentList) {
      if (agent.getExtend().getDelegateAddress().equals(address)) {
        info.setAccount(accountService.getAccount(address));
        info.setStatus(agent.getExtend().getStatus());
        if (ConsensusStatusEnum.IN.getCode() == info.getStatus()) {
          break;
        }
      }
    }
  }
  if (info.getAccount() == null) {
    info.setStatus(ConsensusStatusEnum.NOT_IN.getCode());
  }
  this.consensusStatusInfo=info;
}

Fixed version (ground truth):
public void initConsensusStatusInfo(){
  List<Consensus<Agent>> agentList=consensusCacheManager.getCachedAgentList();
  ConsensusStatusInfo info=new ConsensusStatusInfo();
  for (  String address : NulsContext.LOCAL_ADDRESS_LIST) {
    if (this.seedNodeList.contains(address)) {
      info.setAccount(accountService.getAccount(address));
      info.setStatus(ConsensusStatusEnum.IN.getCode());
      break;
    }
    for (    Consensus<Agent> agent : agentList) {
      if (agent.getExtend().getAgentAddress().equals(address)) {
        info.setAccount(accountService.getAccount(address));
        info.setStatus(agent.getExtend().getStatus());
        if (ConsensusStatusEnum.IN.getCode() == info.getStatus()) {
          break;
        }
      }
    }
  }
  if (info.getAccount() == null) {
    info.setStatus(ConsensusStatusEnum.NOT_IN.getCode());
  }
  this.consensusStatusInfo=info;
}
Program: 35167
Project: 35167
Buggy source:
@Override public void startConsensus(String address,String password,Map<String,Object> paramsMap) throws NulsException {
  Account account=this.accountService.getAccount(address);
  if (null == account) {
    throw new NulsRuntimeException(ErrorCode.FAILED,"String_Node_Str" + address);
  }
  if (paramsMap == null || paramsMap.size() < 2) {
    throw new NulsRuntimeException(ErrorCode.NULL_PARAMETER);
  }
  if (!account.validatePassword(password)) {
    throw new NulsRuntimeException(ErrorCode.PASSWORD_IS_WRONG);
  }
  JoinConsensusParam params=new JoinConsensusParam(paramsMap);
  if (StringUtils.isNotBlank(params.getIntroduction())) {
    Agent agent=new Agent();
    agent.setDelegateAddress(params.getAgentAddress());
    agent.setDeposit(Na.valueOf(params.getDeposit()));
    agent.setIntroduction(params.getIntroduction());
    agent.setSeed(params.isSeed());
    agent.setCommissionRate(params.getCommissionRate());
    agent.setAgentName(params.getAgentName());
    try {
      this.registerAgent(agent,account,password);
    }
 catch (    IOException e) {
      throw new NulsRuntimeException(e);
    }
    return;
  }
  try {
    this.joinTheConsensus(account,password,params.getDeposit(),params.getAgentAddress());
  }
 catch (  IOException e) {
    throw new NulsRuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public void startConsensus(String address,String password,Map<String,Object> paramsMap) throws NulsException {
  Account account=this.accountService.getAccount(address);
  if (null == account) {
    throw new NulsRuntimeException(ErrorCode.FAILED,"String_Node_Str" + address);
  }
  if (paramsMap == null || paramsMap.size() < 2) {
    throw new NulsRuntimeException(ErrorCode.NULL_PARAMETER);
  }
  if (!account.validatePassword(password)) {
    throw new NulsRuntimeException(ErrorCode.PASSWORD_IS_WRONG);
  }
  JoinConsensusParam params=new JoinConsensusParam(paramsMap);
  if (StringUtils.isNotBlank(params.getIntroduction())) {
    Agent agent=new Agent();
    agent.setAgentAddress(params.getAgentAddress());
    agent.setDeposit(Na.valueOf(params.getDeposit()));
    agent.setIntroduction(params.getIntroduction());
    agent.setSeed(params.isSeed());
    agent.setCommissionRate(params.getCommissionRate());
    agent.setAgentName(params.getAgentName());
    try {
      this.registerAgent(agent,account,password);
    }
 catch (    IOException e) {
      throw new NulsRuntimeException(e);
    }
    return;
  }
  try {
    this.joinTheConsensus(account,password,params.getDeposit(),params.getAgentAddress());
  }
 catch (  IOException e) {
    throw new NulsRuntimeException(e);
  }
}
Program: 35169
Project: 35169
Buggy source:
private List<Consensus<Agent>> getDefaultSeedList() throws IOException {
  List<Consensus<Agent>> seedList=new ArrayList<>();
  if (consensusManager.getSeedNodeList() == null) {
    return seedList;
  }
  for (  String address : consensusManager.getSeedNodeList()) {
    Consensus<Agent> member=new ConsensusAgentImpl();
    member.setAddress(address);
    Agent agent=new Agent();
    agent.setDelegateAddress(address);
    agent.setStartTime(0);
    agent.setIntroduction("String_Node_Str");
    agent.setCommissionRate(0);
    agent.setStatus(ConsensusStatusEnum.IN.getCode());
    agent.setSeed(true);
    agent.setDeposit(Na.ZERO);
    member.setExtend(agent);
    seedList.add(member);
  }
  return seedList;
}

Fixed version (ground truth):
private List<Consensus<Agent>> getDefaultSeedList() throws IOException {
  List<Consensus<Agent>> seedList=new ArrayList<>();
  if (consensusManager.getSeedNodeList() == null) {
    return seedList;
  }
  for (  String address : consensusManager.getSeedNodeList()) {
    Consensus<Agent> member=new ConsensusAgentImpl();
    member.setAddress(address);
    Agent agent=new Agent();
    agent.setAgentAddress(address);
    agent.setStartTime(0);
    agent.setIntroduction("String_Node_Str");
    agent.setCommissionRate(0);
    agent.setStatus(ConsensusStatusEnum.IN.getCode());
    agent.setSeed(true);
    agent.setDeposit(Na.ZERO);
    member.setExtend(agent);
    seedList.add(member);
  }
  return seedList;
}
Program: 35170
Project: 35170
Buggy source:
public static DelegateAccountPo agentToPojo(Consensus<Agent> bean){
  if (null == bean) {
    return null;
  }
  DelegateAccountPo po=new DelegateAccountPo();
  po.setAddress(bean.getAddress());
  po.setDeposit(bean.getExtend().getDeposit().getValue());
  po.setStartTime(bean.getExtend().getStartTime());
  po.setRemark(bean.getExtend().getIntroduction());
  po.setNodeAddress(bean.getExtend().getDelegateAddress());
  po.setId(bean.getAddress());
  po.setStatus(bean.getExtend().getStatus());
  po.setAgentName(bean.getExtend().getAgentName());
  po.setCommissionRate(bean.getExtend().getCommissionRate());
  return po;
}

Fixed version (ground truth):
public static DelegateAccountPo agentToPojo(Consensus<Agent> bean){
  if (null == bean) {
    return null;
  }
  DelegateAccountPo po=new DelegateAccountPo();
  po.setAddress(bean.getAddress());
  po.setDeposit(bean.getExtend().getDeposit().getValue());
  po.setStartTime(bean.getExtend().getStartTime());
  po.setRemark(bean.getExtend().getIntroduction());
  po.setNodeAddress(bean.getExtend().getAgentAddress());
  po.setId(bean.getAddress());
  po.setStatus(bean.getExtend().getStatus());
  po.setAgentName(bean.getExtend().getAgentName());
  po.setCommissionRate(bean.getExtend().getCommissionRate());
  return po;
}
Program: 35171
Project: 35171
Buggy source:
@Override protected void serializeToStream(NulsOutputStreamBuffer stream) throws IOException {
  stream.writeVarInt(index);
  stream.writeInt64(value);
  stream.writeInt48(lockTime);
  stream.writeNulsData(script);
}

Fixed version (ground truth):
@Override protected void serializeToStream(NulsOutputStreamBuffer stream) throws IOException {
  stream.writeVarInt(index);
  stream.writeInt64(value);
  stream.writeInt48(lockTime);
  stream.writeNulsData(p2PKHScript);
}
Program: 35172
Project: 35172
Buggy source:
public byte[] getOwner(){
  return ((P2PKHScript)this.getScript()).getPublicKeyDigest().getDigestBytes();
}

Fixed version (ground truth):
public byte[] getOwner(){
  return this.getP2PKHScript().getPublicKeyDigest().getDigestBytes();
}
Program: 35173
Project: 35173
Buggy source:
@Override protected void parse(NulsByteBuffer byteBuffer) throws NulsException {
  if (byteBuffer == null) {
    return;
  }
  index=(int)byteBuffer.readVarInt();
  value=byteBuffer.readInt64();
  lockTime=byteBuffer.readInt48();
  script=byteBuffer.readNulsData(new P2PKHScript());
  Address addressObj=new Address(NulsContext.getInstance().getChainId(NulsContext.CHAIN_ID),script.getBytes());
  this.address=addressObj.toString();
}

Fixed version (ground truth):
@Override protected void parse(NulsByteBuffer byteBuffer) throws NulsException {
  if (byteBuffer == null) {
    return;
  }
  index=(int)byteBuffer.readVarInt();
  value=byteBuffer.readInt64();
  lockTime=byteBuffer.readInt48();
  p2PKHScript=byteBuffer.readNulsData(new P2PKHScript());
  Address addressObj=new Address(NulsContext.getInstance().getChainId(NulsContext.CHAIN_ID),this.getOwner());
  this.address=addressObj.toString();
}
Program: 35174
Project: 35174
Buggy source:
@Override public int size(){
  int s=0;
  s+=VarInt.sizeOf(index);
  s+=8;
  s+=Utils.sizeOfInt48();
  s+=Utils.sizeOfNulsData(script);
  return s;
}

Fixed version (ground truth):
@Override public int size(){
  int s=0;
  s+=VarInt.sizeOf(index);
  s+=8;
  s+=Utils.sizeOfInt48();
  s+=Utils.sizeOfNulsData(p2PKHScript);
  return s;
}
Program: 35176
Project: 35176
Buggy source:
public static UtxoOutputPo toOutputPojo(UtxoOutput output){
  UtxoOutputPo po=new UtxoOutputPo();
  po.setTxHash(output.getTxHash().getDigestHex());
  po.setOutIndex(output.getIndex());
  po.setValue(output.getValue());
  po.setLockTime(output.getLockTime());
  po.setAddress(output.getAddress());
  if (null != output.getScript()) {
    po.setScript(output.getScript().getBytes());
  }
  po.setStatus((byte)output.getStatus());
  return po;
}

Fixed version (ground truth):
public static UtxoOutputPo toOutputPojo(UtxoOutput output){
  UtxoOutputPo po=new UtxoOutputPo();
  po.setTxHash(output.getTxHash().getDigestHex());
  po.setOutIndex(output.getIndex());
  po.setValue(output.getValue());
  po.setLockTime(output.getLockTime());
  po.setAddress(output.getAddress());
  if (null != output.getP2PKHScript()) {
    po.setScript(output.getP2PKHScript().getBytes());
  }
  po.setStatus((byte)output.getStatus());
  return po;
}
Program: 35177
Project: 35177
Buggy source:
public static UtxoOutput toOutput(UtxoOutputPo po){
  UtxoOutput output=new UtxoOutput();
  output.setTxHash(new NulsDigestData(Hex.decode(po.getTxHash())));
  output.setIndex(po.getOutIndex());
  output.setLockTime(po.getLockTime());
  output.setValue(po.getValue());
  output.setAddress(po.getAddress());
  try {
    output.setScript(new P2PKHScript(po.getScript()));
  }
 catch (  Exception e) {
    Log.error(e);
  }
  output.setStatus(po.getStatus());
  if (po.getCreateTime() != null) {
    output.setCreateTime(po.getCreateTime());
  }
  if (po.getTxType() != null) {
    output.setTxType(po.getTxType());
  }
  return output;
}

Fixed version (ground truth):
public static UtxoOutput toOutput(UtxoOutputPo po){
  UtxoOutput output=new UtxoOutput();
  output.setTxHash(new NulsDigestData(Hex.decode(po.getTxHash())));
  output.setIndex(po.getOutIndex());
  output.setLockTime(po.getLockTime());
  output.setValue(po.getValue());
  output.setAddress(po.getAddress());
  try {
    output.setP2PKHScript(new P2PKHScript(po.getScript()));
  }
 catch (  Exception e) {
    Log.error(e);
  }
  output.setStatus(po.getStatus());
  if (po.getCreateTime() != null) {
    output.setCreateTime(po.getCreateTime());
  }
  if (po.getTxType() != null) {
    output.setTxType(po.getTxType());
  }
  return output;
}
Program: 35178
Project: 35178
Buggy source:
public static NulsDigestData calcDigestData(byte[] data,short digestAlgType){
  NulsDigestData digestData=new NulsDigestData();
  digestData.setDigestAlgType(digestAlgType);
  if ((short)0 == digestAlgType) {
    byte[] content=Sha256Hash.hashTwice(data);
    digestData.digestBytes=content;
    return digestData;
  }
  if ((short)1 == digestAlgType) {
    byte[] content=Utils.sha256hash160(data);
    return digestData;
  }
  return null;
}

Fixed version (ground truth):
public static NulsDigestData calcDigestData(byte[] data,short digestAlgType){
  NulsDigestData digestData=new NulsDigestData();
  digestData.setDigestAlgType(digestAlgType);
  if ((short)0 == digestAlgType) {
    byte[] content=Sha256Hash.hashTwice(data);
    digestData.digestBytes=content;
    return digestData;
  }
  if ((short)1 == digestAlgType) {
    byte[] content=Utils.sha256hash160(data);
    digestData.digestBytes=content;
    return digestData;
  }
  return null;
}
Program: 35179
Project: 35179
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.getSuccess();
  }
  Account defaultAcct=getDefaultAccount();
  if (!defaultAcct.decrypt(password)) {
    return Result.getFailed(ErrorCode.PASSWORD_IS_WRONG);
  }
  try {
    defaultAcct.encrypt(password);
    account.encrypt(password);
  }
 catch (  NulsException e) {
  }
  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);
  return Result.getSuccess();
}

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.getSuccess();
  }
 else {
    accountPo=new AccountPo();
  }
  Account defaultAcct=getDefaultAccount();
  if (!defaultAcct.decrypt(password)) {
    return Result.getFailed(ErrorCode.PASSWORD_IS_WRONG);
  }
  try {
    defaultAcct.encrypt(password);
    account.encrypt(password);
  }
 catch (  NulsException e) {
  }
  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);
  return Result.getSuccess();
}