nus-yam/ex-repair huggingface dataset:
Program: 34950
Project: 34950
Buggy source:
public static JaxRsFactoryBeanCustomizer findBeanCustomizer(Class<?> c,Bus bus){
  List<JaxRsFactoryBeanCustomizer> beanCustomizers=(List<JaxRsFactoryBeanCustomizer>)bus.getProperty(JaxRsConstants.ENDPOINT_LIST_BEANCUSTOMIZER);
  Map<String,BeanCustomizerContext> beanCustomizerContexts=(Map<String,BeanCustomizerContext>)bus.getProperty(JaxRsConstants.ENDPOINT_BEANCUSTOMIZER_CONTEXTOBJ);
  if (beanCustomizers == null || beanCustomizers.isEmpty() || beanCustomizerContexts == null) {
    return null;
  }
  JaxRsFactoryBeanCustomizer rtn=null;
  for (  JaxRsFactoryBeanCustomizer beanCustomizer : beanCustomizers) {
    if (beanCustomizer.isCustomizableBean(c,beanCustomizerContexts.get(Integer.toString(beanCustomizer.hashCode())))) {
      return beanCustomizer;
    }
  }
  return rtn;
}

Fixed version (ground truth):
public static JaxRsFactoryBeanCustomizer findBeanCustomizer(Class<?> c,Bus bus){
  List<JaxRsFactoryBeanCustomizer> beanCustomizers=(List<JaxRsFactoryBeanCustomizer>)bus.getProperty(JaxRsConstants.ENDPOINT_LIST_BEANCUSTOMIZER);
  Map<String,BeanCustomizerContext> beanCustomizerContexts=(Map<String,BeanCustomizerContext>)bus.getProperty(JaxRsConstants.ENDPOINT_BEANCUSTOMIZER_CONTEXTOBJ);
  if (beanCustomizers == null || beanCustomizers.isEmpty() || beanCustomizerContexts == null) {
    return null;
  }
  JaxRsFactoryBeanCustomizer rtn=null;
  for (  JaxRsFactoryBeanCustomizer beanCustomizer : beanCustomizers) {
    if (beanCustomizer.isCustomizableBean(c,beanCustomizerContexts.get(createCustomizerKey(beanCustomizer)))) {
      return beanCustomizer;
    }
  }
  return rtn;
}
Program: 34952
Project: 34952
Buggy source:
public Object getBeanCustomizerContext(JaxRsFactoryBeanCustomizer customizer){
  return beanCustomizerContexts.get(Integer.toString(customizer.hashCode()));
}

Fixed version (ground truth):
public Object getBeanCustomizerContext(JaxRsFactoryBeanCustomizer customizer){
  return beanCustomizerContexts.get(createCustomizerKey(customizer));
}
Program: 34954
Project: 34954
Buggy source:
public static boolean isEJBCDI(Class<?> c,Bus bus){
  List<JaxRsFactoryBeanCustomizer> beanCustomizers=(List<JaxRsFactoryBeanCustomizer>)bus.getProperty(JaxRsConstants.ENDPOINT_LIST_BEANCUSTOMIZER);
  Map<String,BeanCustomizerContext> beanCustomizerContexts=(Map<String,BeanCustomizerContext>)bus.getProperty(JaxRsConstants.ENDPOINT_BEANCUSTOMIZER_CONTEXTOBJ);
  if (beanCustomizers == null || beanCustomizers.isEmpty() || beanCustomizerContexts == null) {
    return false;
  }
  for (  JaxRsFactoryBeanCustomizer beanCustomizer : beanCustomizers) {
    if (beanCustomizer.isCustomizableBean(c,beanCustomizerContexts.get(Integer.toString(beanCustomizer.hashCode())))) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isEJBCDI(Class<?> c,Bus bus){
  List<JaxRsFactoryBeanCustomizer> beanCustomizers=(List<JaxRsFactoryBeanCustomizer>)bus.getProperty(JaxRsConstants.ENDPOINT_LIST_BEANCUSTOMIZER);
  Map<String,BeanCustomizerContext> beanCustomizerContexts=(Map<String,BeanCustomizerContext>)bus.getProperty(JaxRsConstants.ENDPOINT_BEANCUSTOMIZER_CONTEXTOBJ);
  if (beanCustomizers == null || beanCustomizers.isEmpty() || beanCustomizerContexts == null) {
    return false;
  }
  for (  JaxRsFactoryBeanCustomizer beanCustomizer : beanCustomizers) {
    if (beanCustomizer.isCustomizableBean(c,beanCustomizerContexts.get(CustomizerUtils.createCustomizerKey(beanCustomizer)))) {
      return true;
    }
  }
  return false;
}
Program: 34956
Project: 34956
Buggy source:
@Override public boolean handleAttribute(DDParser parser,String nsURI,String localName,int index) throws ParseException {
  if (nsURI == null) {
    if (parser.version >= 24 && "String_Node_Str".equals(localName)) {
      version=parser.parseTokenAttributeValue(index);
      return true;
    }
    if (parser.version >= 24 && "String_Node_Str".equals(localName)) {
      metadata_complete=parser.parseBooleanAttributeValue(index);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean handleAttribute(DDParser parser,String nsURI,String localName,int index) throws ParseException {
  if (nsURI == null || XMLConstants.NULL_NS_URI.equals(nsURI)) {
    if (parser.version >= 24 && "String_Node_Str".equals(localName)) {
      version=parser.parseTokenAttributeValue(index);
      return true;
    }
    if (parser.version >= 24 && "String_Node_Str".equals(localName)) {
      metadata_complete=parser.parseBooleanAttributeValue(index);
      return true;
    }
  }
  return false;
}
Program: 34957
Project: 34957
Buggy source:
@Test public void testSingleHealthChecks() throws Exception {
  testSingleOutcomeUP();
  testSingleOutcomeDOWN();
  testCheckUPWithData();
  testCheckDOWNWithData();
}

Fixed version (ground truth):
@Test public void testSingleHealthChecks() throws Exception {
  testJsonReceived();
  testSingleOutcomeUP();
  testSingleOutcomeDOWN();
  testCheckUPWithData();
  testCheckDOWNWithData();
}
Program: 34958
Project: 34958
Buggy source:
@Test public void testJsonReceived() throws Exception {
  URL healthURL=new URL("String_Node_Str" + server1.getHostname() + "String_Node_Str"+ server1.getHttpDefaultPort()+ "String_Node_Str");
  HttpURLConnection con=HttpUtils.getHttpConnection(healthURL,200,10 * 1000);
  assertEquals("String_Node_Str",con.getHeaderField("String_Node_Str"));
  BufferedReader br=HttpUtils.getConnectionStream(con);
  Json.createReader(br);
  JsonObject jsonResponse=Json.createReader(br).readObject();
  br.close();
  log("String_Node_Str","String_Node_Str" + jsonResponse.toString());
  assertNotNull("String_Node_Str",jsonResponse.getString("String_Node_Str"));
  JsonArray checks=(JsonArray)jsonResponse.get("String_Node_Str");
  assertEquals(1,checks.size());
  assertEquals("String_Node_Str",((JsonObject)checks.get(0)).getString("String_Node_Str"));
  assertEquals(jsonResponse.getString("String_Node_Str"),"String_Node_Str");
}

Fixed version (ground truth):
public void testJsonReceived() throws Exception {
  URL healthURL=new URL("String_Node_Str" + server1.getHostname() + "String_Node_Str"+ server1.getHttpDefaultPort()+ "String_Node_Str");
  HttpURLConnection con=HttpUtils.getHttpConnection(healthURL,200,10 * 1000);
  assertEquals("String_Node_Str",con.getHeaderField("String_Node_Str"));
  BufferedReader br=HttpUtils.getConnectionStream(con);
  Json.createReader(br);
  JsonObject jsonResponse=Json.createReader(br).readObject();
  br.close();
  log("String_Node_Str","String_Node_Str" + jsonResponse.toString());
  assertNotNull("String_Node_Str",jsonResponse.getString("String_Node_Str"));
  JsonArray checks=(JsonArray)jsonResponse.get("String_Node_Str");
  assertEquals(1,checks.size());
  assertEquals("String_Node_Str",((JsonObject)checks.get(0)).getString("String_Node_Str"));
  assertEquals(jsonResponse.getString("String_Node_Str"),"String_Node_Str");
}
Program: 34959
Project: 34959
Buggy source:
@Override public void handleErrorResponse(HttpServletResponse response,int httpErrorCode){
  if (!response.isCommitted()) {
    response.setStatus(httpErrorCode);
  }
  String errorMessage=getErrorMessage();
  response.setHeader(AUTH_HEADER,errorMessage);
  writeResponseBody(response,httpErrorCode);
}

Fixed version (ground truth):
@Override public void handleErrorResponse(HttpServletResponse response,int httpErrorCode){
  if (!response.isCommitted()) {
    response.setStatus(httpErrorCode);
  }
  String errorMessage=getErrorMessage();
  response.setHeader(AUTH_HEADER,errorMessage);
}
Program: 34960
Project: 34960
Buggy source:
private AppModuleName setAppModuleNames(IServletContext isc){
  WebAppConfig webAppConfig=isc.getWebAppConfig();
  if (webAppConfig.isSystemApp())   return null;
  WebModuleMetaData webModuleMetaData=((WebAppConfigExtended)webAppConfig).getMetaData();
  String appName=webModuleMetaData.getApplicationMetaData().getName();
  if (!appName.equals("String_Node_Str")) {
    String moduleName=webModuleMetaData.getJ2EEName().toString();
    return addAppModuleNames(appName,moduleName);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
private AppModuleName setAppModuleNames(IServletContext isc){
  WebAppConfig webAppConfig=isc.getWebAppConfig();
  if (webAppConfig.isSystemApp()) {
    Tr.debug(tc,"String_Node_Str",webAppConfig.getApplicationName());
    return null;
  }
  if (isOsgiApp(isc)) {
    Tr.debug(tc,"String_Node_Str",webAppConfig.getApplicationName());
    return null;
  }
  WebModuleMetaData webModuleMetaData=((WebAppConfigExtended)webAppConfig).getMetaData();
  String appName=webModuleMetaData.getApplicationMetaData().getName();
  String moduleName=webModuleMetaData.getJ2EEName().toString();
  return addAppModuleNames(appName,moduleName);
}
Program: 34961
Project: 34961
Buggy source:
private OutputWriter getOutputWriter(RESTRequest request,RESTResponse response) throws IOException, HTTPNotAcceptableException, HTTPMethodNotAllowedException {
  String method=request.getMethod();
  String accept=request.getHeader(Constants.ACCEPT_HEADER);
  Writer writer=response.getWriter();
  if (accept == null) {
    accept=Constants.ACCEPT_HEADER_TEXT;
  }
  if (Constants.METHOD_GET.equals(method)) {
    if (accept.contains(Constants.ACCEPT_HEADER_TEXT)) {
      return new PrometheusMetricWriter(writer);
    }
 else     if (accept.contains(Constants.ACCEPT_HEADER_JSON)) {
      return new JSONMetricWriter(writer);
    }
 else {
      Tr.event(tc,"String_Node_Str");
      return new PrometheusMetricWriter(writer);
    }
  }
 else   if (Constants.METHOD_OPTIONS.equals(method)) {
    if (accept.contains(Constants.ACCEPT_HEADER_TEXT)) {
      throw new HTTPNotAcceptableException();
    }
    if (accept.contains(Constants.ACCEPT_HEADER_JSON)) {
      return new JSONMetadataWriter(writer);
    }
 else {
      throw new HTTPNotAcceptableException();
    }
  }
 else {
    throw new HTTPMethodNotAllowedException();
  }
}

Fixed version (ground truth):
private OutputWriter getOutputWriter(RESTRequest request,RESTResponse response) throws IOException, HTTPNotAcceptableException, HTTPMethodNotAllowedException {
  String method=request.getMethod();
  String accept=request.getHeader(Constants.ACCEPT_HEADER);
  Writer writer=response.getWriter();
  if (accept == null) {
    accept=Constants.ACCEPT_HEADER_TEXT;
  }
  if (Constants.METHOD_GET.equals(method)) {
    if (accept.contains(Constants.ACCEPT_HEADER_TEXT)) {
      return new PrometheusMetricWriter(writer);
    }
 else     if (accept.contains(Constants.ACCEPT_HEADER_JSON)) {
      return new JSONMetricWriter(writer);
    }
 else {
      Tr.event(tc,"String_Node_Str");
      return new PrometheusMetricWriter(writer);
    }
  }
 else   if (Constants.METHOD_OPTIONS.equals(method)) {
    if (accept.contains(Constants.ACCEPT_HEADER_JSON)) {
      return new JSONMetadataWriter(writer);
    }
 else {
      throw new HTTPNotAcceptableException();
    }
  }
 else {
    throw new HTTPMethodNotAllowedException();
  }
}
Program: 34962
Project: 34962
Buggy source:
@NonNull @Override protected HomeActivityComponent createComponent(){
  N26SamplesApplication app=N26SamplesApplication.class.cast(getApplication());
  ActivityModule activityModule=new ActivityModule();
  return app.getComponent().createHomeActivityComponent(activityModule);
}

Fixed version (ground truth):
@NonNull @Override protected HomeActivityComponent createComponent(){
  N26SamplesApplication app=N26SamplesApplication.class.cast(getApplication());
  ActivityModule activityModule=new ActivityModule(this);
  return app.getComponent().createHomeActivityComponent(activityModule);
}
Program: 34963
Project: 34963
Buggy source:
@ForActivity @Provides Context provideContext(@NonNull final AppCompatActivity activity){
  return activity;
}

Fixed version (ground truth):
@ForActivity @Provides Context provideContext(){
  return activity;
}
Program: 34965
Project: 34965
Buggy source:
/** 
 * 同步网络时间
 */
private void syncWebTime(){
  int count=0;
  long sum=0L;
  for (int i=0; i < urlList.size(); i++) {
    long localBeforeTime=System.currentTimeMillis();
    long netTime=getWebTime(urlList.get(i));
    if (netTime == 0) {
      continue;
    }
    long localEndTime=System.currentTimeMillis();
    long value=(netTime + (localEndTime - localBeforeTime) / 2) - localEndTime;
    if (value > 0) {
      count++;
      sum+=value;
    }
  }
  if (count > 0) {
    netTimeOffset=sum / count;
  }
  lastSyncTime=currentTimeMillis();
}

Fixed version (ground truth):
/** 
 * 同步网络时间
 */
private void syncWebTime(){
  int count=0;
  long sum=0L;
  for (int i=0; i < urlList.size(); i++) {
    long localBeforeTime=System.currentTimeMillis();
    long netTime=getWebTime(urlList.get(i));
    if (netTime == 0) {
      continue;
    }
    long localEndTime=System.currentTimeMillis();
    long value=(netTime + (localEndTime - localBeforeTime) / 2) - localEndTime;
    count++;
    sum+=value;
  }
  if (count > 0) {
    netTimeOffset=sum / count;
  }
  lastSyncTime=currentTimeMillis();
}
Program: 34966
Project: 34966
Buggy source:
/** 
 * 同步网络时间
 */
private void syncWebTime(){
  int count=0;
  long sum=0L;
  for (int i=0; i < urlList.size(); i++) {
    long localBeforeTime=System.currentTimeMillis();
    long netTime=getWebTime(urlList.get(i));
    if (netTime == 0) {
      continue;
    }
    long localEndTime=System.currentTimeMillis();
    long value=(netTime + (localEndTime - localBeforeTime) / 2) - localEndTime;
    if (value > 0) {
      count++;
      sum+=value;
    }
  }
  if (count > 0) {
    netTimeOffset=sum / count;
  }
  lastSyncTime=currentTimeMillis();
}

Fixed version (ground truth):
/** 
 * 同步网络时间
 */
private void syncWebTime(){
  int count=0;
  long sum=0L;
  for (int i=0; i < urlList.size(); i++) {
    long localBeforeTime=System.currentTimeMillis();
    long netTime=getWebTime(urlList.get(i));
    if (netTime == 0) {
      continue;
    }
    long localEndTime=System.currentTimeMillis();
    long value=(netTime + (localEndTime - localBeforeTime) / 2) - localEndTime;
    count++;
    sum+=value;
  }
  if (count > 0) {
    netTimeOffset=sum / count;
  }
  lastSyncTime=currentTimeMillis();
}
Program: 34968
Project: 34968
Buggy source:
public static String getPwdOptional(){
  return getPwdOptional(null);
}

Fixed version (ground truth):
/** 
 * 得到用户输入的密码,允许不输入 提示信息为默认
 * @return
 */
public static String getPwdOptional(){
  return getPwdOptional(null);
}
Program: 34969
Project: 34969
Buggy source:
private void initHandlers(){
  MessageBusService messageBusService=NulsContext.getServiceBean(MessageBusService.class);
  messageBusService.subscribeMessage(BlockMessage.class,new BlockMessageHandler());
  messageBusService.subscribeMessage(BlocksHashMessage.class,new BlocksHashHandler());
  messageBusService.subscribeMessage(GetBlocksHashMessage.class,new GetBlocksHashHandler());
  messageBusService.subscribeMessage(NotFoundMessage.class,new NotFoundHander());
  messageBusService.subscribeMessage(GetBlockMessage.class,new GetBlockHandler());
  messageBusService.subscribeMessage(GetBlocksByHashMessage.class,new GetBlocksByHashHandler());
  messageBusService.subscribeMessage(GetBlocksByHeightMessage.class,new GetBlocksByHeightHandler());
  messageBusService.subscribeMessage(GetTxGroupRequest.class,new GetTxGroupHandler());
  messageBusService.subscribeMessage(TxGroupMessage.class,new TxGroupHandler());
  messageBusService.subscribeMessage(TransactionMessage.class,new TransactionMessageHandler());
  messageBusService.subscribeMessage(SmallBlockMessage.class,new SmallBlockHandler());
  messageBusService.subscribeMessage(CompleteMessage.class,new CompleteHandler());
  messageBusService.subscribeMessage(ReactMessage.class,new ReactMessageHandler());
  messageBusService.subscribeMessage(ForwardSmallBlockMessage.class,new ForwardSmallBlockHandler());
  messageBusService.subscribeMessage(ForwardTxMessage.class,new ForwardTxMessageHandler());
}

Fixed version (ground truth):
private void initHandlers(){
  MessageBusService messageBusService=NulsContext.getServiceBean(MessageBusService.class);
  messageBusService.subscribeMessage(BlockMessage.class,new BlockMessageHandler());
  messageBusService.subscribeMessage(BlocksHashMessage.class,new BlocksHashHandler());
  messageBusService.subscribeMessage(GetBlocksHashMessage.class,new GetBlocksHashHandler());
  messageBusService.subscribeMessage(NotFoundMessage.class,new NotFoundHander());
  messageBusService.subscribeMessage(GetBlockMessage.class,new GetBlockHandler());
  messageBusService.subscribeMessage(GetBlocksByHashMessage.class,new GetBlocksByHashHandler());
  messageBusService.subscribeMessage(GetBlocksByHeightMessage.class,new GetBlocksByHeightHandler());
  messageBusService.subscribeMessage(GetTxGroupRequest.class,new GetTxGroupHandler());
  messageBusService.subscribeMessage(TxGroupMessage.class,new TxGroupHandler());
  messageBusService.subscribeMessage(TransactionMessage.class,new TransactionMessageHandler());
  messageBusService.subscribeMessage(SmallBlockMessage.class,new SmallBlockHandler());
  messageBusService.subscribeMessage(CompleteMessage.class,new CompleteHandler());
  messageBusService.subscribeMessage(ReactMessage.class,new ReactMessageHandler());
  messageBusService.subscribeMessage(GetTxMessage.class,new GetTxMessageHandler());
  messageBusService.subscribeMessage(GetSmallBlockMessage.class,new GetSmallBlockHandler());
  messageBusService.subscribeMessage(ForwardSmallBlockMessage.class,new ForwardSmallBlockHandler());
  messageBusService.subscribeMessage(ForwardTxMessage.class,new ForwardTxMessageHandler());
}
Program: 34970
Project: 34970
Buggy source:
@Override public int compare(Transaction o1,Transaction o2){
  if (o1.getTime() < o2.getTime()) {
    return -1;
  }
 else   if (o1.getTime() > o2.getTime()) {
    return 1;
  }
 else {
    for (    Coin coin : o1.getCoinData().getFrom()) {
      NulsByteBuffer buffer=new NulsByteBuffer(coin.getOwner());
      NulsDigestData hash=null;
      try {
        hash=buffer.readHash();
      }
 catch (      NulsException e) {
        Log.error(e);
      }
      if (o2.getHash().equals(hash)) {
        return 1;
      }
    }
    for (    Coin coin : o2.getCoinData().getFrom()) {
      NulsByteBuffer buffer=new NulsByteBuffer(coin.getOwner());
      NulsDigestData hash=null;
      try {
        hash=buffer.readHash();
      }
 catch (      NulsException e) {
        Log.error(e);
      }
      if (o1.getHash().equals(hash)) {
        return -1;
      }
    }
  }
  return 0;
}

Fixed version (ground truth):
@Override public int compare(Transaction o1,Transaction o2){
  if (o1.getHash().equals(o2.getHash())) {
    return 0;
  }
  if (o1.getTime() < o2.getTime()) {
    return -1;
  }
 else   if (o1.getTime() > o2.getTime()) {
    return 1;
  }
 else {
    for (    Coin coin : o1.getCoinData().getFrom()) {
      NulsByteBuffer buffer=new NulsByteBuffer(coin.getOwner());
      NulsDigestData hash=null;
      try {
        hash=buffer.readHash();
      }
 catch (      NulsException e) {
        Log.error(e);
      }
      if (o2.getHash().equals(hash)) {
        return 1;
      }
    }
    for (    Coin coin : o2.getCoinData().getFrom()) {
      NulsByteBuffer buffer=new NulsByteBuffer(coin.getOwner());
      NulsDigestData hash=null;
      try {
        hash=buffer.readHash();
      }
 catch (      NulsException e) {
        Log.error(e);
      }
      if (o1.getHash().equals(hash)) {
        return -1;
      }
    }
  }
  return 0;
}
Program: 34973
Project: 34973
Buggy source:
@Override public Result transferFee(byte[] from,byte[] to,Na values,String remark,Na price){
  Result<Account> accountResult=accountService.getAccount(from);
  if (accountResult.isFailed()) {
    return accountResult;
  }
  TransferTransaction tx=new TransferTransaction();
  try {
    tx.setRemark(remark.getBytes(NulsConfig.DEFAULT_ENCODING));
  }
 catch (  UnsupportedEncodingException e) {
    return Result.getFailed(LedgerErrorCode.PARAMETER_ERROR);
  }
  tx.setTime(TimeService.currentTimeMillis());
  CoinData coinData=new CoinData();
  Coin toCoin=new Coin(to,values);
  coinData.getTo().add(toCoin);
  Na fee=getTxFee(from,values,tx.size(),price);
  return Result.getSuccess().setData(fee);
}

Fixed version (ground truth):
@Override public Result transferFee(byte[] from,byte[] to,Na values,String remark,Na price){
  Result<Account> accountResult=accountService.getAccount(from);
  if (accountResult.isFailed()) {
    return accountResult;
  }
  TransferTransaction tx=new TransferTransaction();
  try {
    tx.setRemark(remark.getBytes(NulsConfig.DEFAULT_ENCODING));
  }
 catch (  UnsupportedEncodingException e) {
    return Result.getFailed(LedgerErrorCode.PARAMETER_ERROR);
  }
  tx.setTime(TimeService.currentTimeMillis());
  CoinData coinData=new CoinData();
  Coin toCoin=new Coin(to,values);
  coinData.getTo().add(toCoin);
  Na fee=getTxFee(from,values,tx.size(),price);
  Result result=Result.getSuccess().setData(fee);
  return result;
}
Program: 34974
Project: 34974
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")}) public RpcClientResult transferFee(@BeanParam() TransferFeeForm form){
  if (form == null) {
    return Result.getFailed(KernelErrorCode.PARAMETER_ERROR).toRpcClientResult();
  }
  if (!Address.validAddress(form.getAddress())) {
    return Result.getFailed(AccountLedgerErrorCode.ADDRESS_ERROR).toRpcClientResult();
  }
  if (!Address.validAddress(form.getToAddress())) {
    return Result.getFailed(AccountLedgerErrorCode.ADDRESS_ERROR).toRpcClientResult();
  }
  if (form.getAmount() <= 0) {
    return Result.getFailed(KernelErrorCode.PARAMETER_ERROR).toRpcClientResult();
  }
  if (!validTxRemark(form.getRemark())) {
    return Result.getFailed(KernelErrorCode.PARAMETER_ERROR).toRpcClientResult();
  }
  Na value=Na.valueOf(form.getAmount());
  Result result=accountLedgerService.transferFee(AddressTool.getAddress(form.getAddress()),AddressTool.getAddress(form.getToAddress()),value,form.getRemark(),TransactionFeeCalculator.MIN_PRECE_PRE_1024_BYTES);
  if (result.isSuccess()) {
    Map<String,Object> map=new HashMap<>();
    map.put("String_Node_Str",result.getData());
    result.setData(map);
  }
  return result.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")}) public RpcClientResult transferFee(@BeanParam() TransferFeeForm form){
  if (form == null) {
    return Result.getFailed(KernelErrorCode.PARAMETER_ERROR).toRpcClientResult();
  }
  if (!Address.validAddress(form.getAddress())) {
    return Result.getFailed(AccountLedgerErrorCode.ADDRESS_ERROR).toRpcClientResult();
  }
  if (!Address.validAddress(form.getToAddress())) {
    return Result.getFailed(AccountLedgerErrorCode.ADDRESS_ERROR).toRpcClientResult();
  }
  if (form.getAmount() <= 0) {
    return Result.getFailed(KernelErrorCode.PARAMETER_ERROR).toRpcClientResult();
  }
  if (!validTxRemark(form.getRemark())) {
    return Result.getFailed(KernelErrorCode.PARAMETER_ERROR).toRpcClientResult();
  }
  Na value=Na.valueOf(form.getAmount());
  Result result=accountLedgerService.transferFee(AddressTool.getAddress(form.getAddress()),AddressTool.getAddress(form.getToAddress()),value,form.getRemark(),TransactionFeeCalculator.MIN_PRECE_PRE_1024_BYTES);
  return result.toRpcClientResult();
}
Program: 34975
Project: 34975
Buggy source:
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) @ApiOperation("String_Node_Str") @ApiResponses(value={@ApiResponse(code=200,message="String_Node_Str",response=RpcClientResult.class)}) public RpcClientResult aliasFee(@BeanParam() AccountAliasFeeForm form){
  if (!Address.validAddress(form.getAddress())) {
    return Result.getFailed(AccountErrorCode.ADDRESS_ERROR).toRpcClientResult();
  }
  if (StringUtils.isBlank(form.getAlias())) {
    return Result.getFailed(AccountErrorCode.PARAMETER_ERROR).toRpcClientResult();
  }
  Result result=accountService.getAliasFee(form.getAddress(),form.getAlias());
  if (result.isSuccess()) {
    Map<String,Object> map=new HashMap<>();
    map.put("String_Node_Str",result.getData());
    result.setData(map);
  }
  return result.toRpcClientResult();
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) @ApiOperation("String_Node_Str") @ApiResponses(value={@ApiResponse(code=200,message="String_Node_Str",response=RpcClientResult.class)}) public RpcClientResult aliasFee(@BeanParam() AccountAliasFeeForm form){
  if (!Address.validAddress(form.getAddress())) {
    return Result.getFailed(AccountErrorCode.ADDRESS_ERROR).toRpcClientResult();
  }
  if (StringUtils.isBlank(form.getAlias())) {
    return Result.getFailed(AccountErrorCode.PARAMETER_ERROR).toRpcClientResult();
  }
  Result result=accountService.getAliasFee(form.getAddress(),form.getAlias());
  return result.toRpcClientResult();
}
Program: 34980
Project: 34980
Buggy source:
public void refreshBalanceIfNesessary(){
  lock.lock();
  try {
    long bestHeight=NulsContext.getInstance().getBestHeight();
    if (balanceMap.isEmpty()) {
      return;
    }
    for (    String address : balanceMap.keySet()) {
      BalanceCacheEntity entity=balanceMap.get(address);
      if (entity == null) {
        balanceMap.remove(address);
        continue;
      }
      if (entity.getEarlistLockTime() == 0L && entity.getLowestLockHeigh() == 0L) {
        continue;
      }
      if (entity.getLowestLockHeigh() > 0L && entity.getLowestLockHeigh() <= bestHeight) {
        balanceMap.remove(address);
        continue;
      }
      if (entity.getEarlistLockTime() > 0L && entity.getEarlistLockTime() <= TimeService.currentTimeMillis()) {
        balanceMap.remove(address);
        continue;
      }
    }
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
public void refreshBalanceIfNesessary(){
  lock.lock();
  try {
    long bestHeight=NulsContext.getInstance().getBestHeight();
    Set<String> set=new HashSet<>(balanceMap.keySet());
    for (    String address : set) {
      BalanceCacheEntity entity=balanceMap.get(address);
      if (entity == null) {
        balanceMap.remove(address);
        continue;
      }
      if (entity.getEarlistLockTime() == 0L && entity.getLowestLockHeigh() == 0L) {
        continue;
      }
      if (entity.getLowestLockHeigh() > 0L && entity.getLowestLockHeigh() <= bestHeight) {
        balanceMap.remove(address);
        continue;
      }
      if (entity.getEarlistLockTime() > 0L && entity.getEarlistLockTime() <= TimeService.currentTimeMillis()) {
        balanceMap.remove(address);
        continue;
      }
    }
  }
  finally {
    lock.unlock();
  }
}
Program: 34981
Project: 34981
Buggy source:
/** 
 * 获取网络时间 todo 可优化为哪个地址延迟小使用哪个
 */
private long getWebTime(){
  NTPUDPClient client=new NTPUDPClient();
  try {
    client.open();
  }
 catch (  SocketException e) {
    Log.error(e);
    return 0L;
  }
  for (int i=0; i < urlList.size(); i++) {
    client.setDefaultTimeout(1000);
    try {
      InetAddress inetAddress=InetAddress.getByName(urlList.get(i));
      TimeInfo timeInfo=client.getTime(inetAddress);
      return timeInfo.getReturnTime();
    }
 catch (    Exception e) {
      continue;
    }
  }
  return 0L;
}

Fixed version (ground truth):
/** 
 * 获取网络时间 todo 可优化为哪个地址延迟小使用哪个
 */
private long getWebTime(){
  NTPUDPClient client=new NTPUDPClient();
  try {
    client.open();
  }
 catch (  SocketException e) {
    Log.error(e);
    return 0L;
  }
  for (int i=0; i < urlList.size(); i++) {
    client.setDefaultTimeout(1000);
    try {
      InetAddress inetAddress=InetAddress.getByName(urlList.get(i));
      TimeInfo timeInfo=client.getTime(inetAddress);
      return timeInfo.getMessage().getTransmitTimeStamp().getTime();
    }
 catch (    Exception e) {
      continue;
    }
  }
  return 0L;
}
Program: 34982
Project: 34982
Buggy source:
public static void main(String[] args){
  List<String> addressList=getAddressList();
  for (  String toAddress : addressList) {
    String address="String_Node_Str";
    long amount=2000200000000L;
    String password="String_Node_Str";
    String remark="String_Node_Str";
    String param="String_Node_Str" + address + "String_Node_Str"+ toAddress+ "String_Node_Str"+ password+ "String_Node_Str"+ amount+ "String_Node_Str"+ remark+ "String_Node_Str";
    String url="String_Node_Str";
    int successCount=0;
    for (int i=0; i < 1; i++) {
      String res=post(url,param,"String_Node_Str");
      if (res.indexOf("String_Node_Str") != -1) {
        successCount++;
      }
      System.out.println(successCount + "String_Node_Str" + res);
    }
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  List<String> addressList=getAddressList();
  for (  String toAddress : addressList) {
    String address="String_Node_Str";
    long amount=2018L;
    String password="String_Node_Str";
    String remark="String_Node_Str";
    String param="String_Node_Str" + address + "String_Node_Str"+ toAddress+ "String_Node_Str"+ password+ "String_Node_Str"+ amount+ "String_Node_Str"+ remark+ "String_Node_Str";
    String url="String_Node_Str";
    int successCount=0;
    for (int i=0; i < 10000; i++) {
      String res=post(url,param,"String_Node_Str");
      if (res.indexOf("String_Node_Str") != -1) {
        successCount++;
      }
      System.out.println(successCount + "String_Node_Str" + res);
      try {
        Thread.sleep(1000L);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
}
Program: 34983
Project: 34983
Buggy source:
public void refreshBalanceIfNesessary(){
  lock.lock();
  try {
    long bestHeight=NulsContext.getInstance().getBestHeight();
    for (    String address : balanceMap.keySet()) {
      BalanceCacheEntity entity=balanceMap.get(address);
      if (entity == null) {
        balanceMap.remove(address);
        continue;
      }
      if (entity.getEarlistLockTime() == 0L && entity.getLowestLockHeigh() == 0L) {
        continue;
      }
      if (entity.getLowestLockHeigh() > 0L && entity.getLowestLockHeigh() <= bestHeight) {
        balanceMap.remove(address);
        continue;
      }
      if (entity.getEarlistLockTime() > 0L && entity.getEarlistLockTime() <= TimeService.currentTimeMillis()) {
        balanceMap.remove(address);
        continue;
      }
    }
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
public void refreshBalanceIfNesessary(){
  lock.lock();
  try {
    long bestHeight=NulsContext.getInstance().getBestHeight();
    if (balanceMap.isEmpty()) {
      return;
    }
    for (    String address : balanceMap.keySet()) {
      BalanceCacheEntity entity=balanceMap.get(address);
      if (entity == null) {
        balanceMap.remove(address);
        continue;
      }
      if (entity.getEarlistLockTime() == 0L && entity.getLowestLockHeigh() == 0L) {
        continue;
      }
      if (entity.getLowestLockHeigh() > 0L && entity.getLowestLockHeigh() <= bestHeight) {
        balanceMap.remove(address);
        continue;
      }
      if (entity.getEarlistLockTime() > 0L && entity.getEarlistLockTime() <= TimeService.currentTimeMillis()) {
        balanceMap.remove(address);
        continue;
      }
    }
  }
  finally {
    lock.unlock();
  }
}
Program: 34984
Project: 34984
Buggy source:
/** 
 * 获取账户余额
 * @param address
 * @return
 */
public Result<Balance> getBalance(byte[] address){
  lock.lock();
  try {
    if (address == null || address.length != AddressTool.HASH_LENGTH) {
      return Result.getFailed(AccountLedgerErrorCode.PARAMETER_ERROR);
    }
    String addressKey=Base58.encode(address);
    BalanceCacheEntity entity=balanceMap.get(addressKey);
    Balance balance=null;
    if (entity == null || (entity.getEarlistLockTime() > 0L && entity.getEarlistLockTime() <= TimeService.currentTimeMillis())) {
      try {
        balance=calBalanceByAddress(address);
      }
 catch (      NulsException e) {
        Log.info("String_Node_Str" + Base58.encode(address) + "String_Node_Str");
      }
    }
 else {
      balance=entity.getBalance();
    }
    return Result.getSuccess().setData(balance);
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * 获取账户余额
 */
public Result<Balance> getBalance(byte[] address){
  lock.lock();
  try {
    if (address == null || address.length != AddressTool.HASH_LENGTH) {
      return Result.getFailed(AccountLedgerErrorCode.PARAMETER_ERROR);
    }
    String addressKey=Base58.encode(address);
    BalanceCacheEntity entity=balanceMap.get(addressKey);
    Balance balance=null;
    if (entity == null || (entity.getEarlistLockTime() > 0L && entity.getEarlistLockTime() <= TimeService.currentTimeMillis())) {
      try {
        balance=calBalanceByAddress(address);
      }
 catch (      NulsException e) {
        Log.info("String_Node_Str" + Base58.encode(address) + "String_Node_Str");
      }
    }
 else {
      balance=entity.getBalance();
    }
    return Result.getSuccess().setData(balance);
  }
  finally {
    lock.unlock();
  }
}
Program: 34986
Project: 34986
Buggy source:
@Override public Result validPassword(Account account,String password){
  if (null == account) {
    return Result.getFailed(AccountErrorCode.PARAMETER_ERROR);
  }
  Result result=new Result();
  result.setSuccess(account.validatePassword(password));
  return result;
}

Fixed version (ground truth):
@Override public Result validPassword(Account account,String password){
  if (null == account) {
    return Result.getFailed(AccountErrorCode.PARAMETER_ERROR);
  }
  boolean rs=account.validatePassword(password);
  if (!rs) {
    return Result.getFailed(AccountErrorCode.PARAMETER_ERROR);
  }
  return Result.getSuccess();
}
Program: 34987
Project: 34987
Buggy source:
/** 
 * 根据密码加密账户(给账户设置密码) Password-encrypted account (set password for account)
 */
public void encrypt(String password,boolean isForce) throws NulsException {
  if (this.isEncrypted()) {
    if (isForce) {
      if (isLocked()) {
        throw new NulsException(AccountErrorCode.ACCOUNT_IS_ALREADY_ENCRYPTED_AND_LOCKED);
      }
    }
 else {
      throw new NulsException(AccountErrorCode.ACCOUNT_IS_ALREADY_ENCRYPTED);
    }
  }
 else {
    ECKey eckey=this.getEcKey();
    byte[] privKeyBytes=eckey.getPrivKeyBytes();
    EncryptedData encryptedPrivateKey=AESEncrypt.encrypt(privKeyBytes,EncryptedData.DEFAULT_IV,new KeyParameter(Sha256Hash.hash(password.getBytes())));
    eckey.setEncryptedPrivateKey(encryptedPrivateKey);
    ECKey result=ECKey.fromEncrypted(encryptedPrivateKey,getPubKey());
    this.setPriKey(new byte[0]);
    this.setEcKey(result);
    this.setEncryptedPriKey(encryptedPrivateKey.getEncryptedBytes());
  }
}

Fixed version (ground truth):
/** 
 * 根据密码加密账户(给账户设置密码) Password-encrypted account (set password for account)
 */
public void encrypt(String password,boolean isForce) throws NulsException {
  if (this.isEncrypted()) {
    if (isForce) {
      if (isLocked()) {
        throw new NulsException(AccountErrorCode.ACCOUNT_IS_ALREADY_ENCRYPTED_AND_LOCKED);
      }
    }
 else {
      throw new NulsException(AccountErrorCode.ACCOUNT_IS_ALREADY_ENCRYPTED);
    }
  }
  ECKey eckey=this.getEcKey();
  byte[] privKeyBytes=eckey.getPrivKeyBytes();
  EncryptedData encryptedPrivateKey=AESEncrypt.encrypt(privKeyBytes,EncryptedData.DEFAULT_IV,new KeyParameter(Sha256Hash.hash(password.getBytes())));
  eckey.setEncryptedPrivateKey(encryptedPrivateKey);
  ECKey result=ECKey.fromEncrypted(encryptedPrivateKey,getPubKey());
  this.setPriKey(new byte[0]);
  this.setEcKey(result);
  this.setEncryptedPriKey(encryptedPrivateKey.getEncryptedBytes());
}
Program: 34988
Project: 34988
Buggy source:
@POST @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) @ApiOperation("String_Node_Str") @ApiResponses(value={@ApiResponse(code=200,message="String_Node_Str",response=Result.class)}) public RpcClientResult validationPassword(@PathParam("String_Node_Str") String address,@ApiParam(name="String_Node_Str",value="String_Node_Str",required=true) AccountPasswordForm form){
  if (!Address.validAddress(address)) {
    return Result.getFailed(AccountErrorCode.ADDRESS_ERROR).toRpcClientResult();
  }
  if (StringUtils.isBlank(form.getPassword())) {
    return Result.getFailed(AccountErrorCode.PARAMETER_ERROR).toRpcClientResult();
  }
  Result<Account> rs=accountService.getAccount(address);
  if (rs.isFailed()) {
    return Result.getFailed(AccountErrorCode.ACCOUNT_NOT_EXIST).toRpcClientResult();
  }
  Account account=rs.getData();
  boolean res=account.validatePassword(form.getPassword());
  Result result=new Result();
  result.setSuccess(res);
  return result.toRpcClientResult();
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) @ApiOperation("String_Node_Str") @ApiResponses(value={@ApiResponse(code=200,message="String_Node_Str",response=Result.class)}) public RpcClientResult validationPassword(@PathParam("String_Node_Str") String address,@ApiParam(name="String_Node_Str",value="String_Node_Str",required=true) AccountPasswordForm form){
  if (!Address.validAddress(address)) {
    return Result.getFailed(AccountErrorCode.ADDRESS_ERROR).toRpcClientResult();
  }
  if (StringUtils.isBlank(form.getPassword())) {
    return Result.getFailed(AccountErrorCode.PARAMETER_ERROR).toRpcClientResult();
  }
  Result<Account> rs=accountService.getAccount(address);
  if (rs.isFailed()) {
    return Result.getFailed(AccountErrorCode.ACCOUNT_NOT_EXIST).toRpcClientResult();
  }
  Account account=rs.getData();
  if (account.validatePassword(form.getPassword())) {
    return Result.getSuccess().toRpcClientResult();
  }
 else {
    return Result.getFailed(AccountErrorCode.PASSWORD_IS_WRONG).toRpcClientResult();
  }
}
Program: 34990
Project: 34990
Buggy source:
@Override public CommandResult execute(String[] args){
  String password=CommandHelper.getPwdOptional();
  int count=1;
  if (args.length == 2) {
    count=Integer.parseInt(args[1]);
  }
  Map<String,Object> parameters=new HashMap<>();
  parameters.put("String_Node_Str",password);
  parameters.put("String_Node_Str",count);
  RpcClientResult result=restFul.post("String_Node_Str",parameters);
  if (result.isFailed()) {
    return CommandResult.getFailed(result.getMsg());
  }
  return CommandResult.getResult(result);
}

Fixed version (ground truth):
@Override public CommandResult execute(String[] args){
  String password=CommandHelper.getPwdOptional();
  if (StringUtils.isNotBlank(password)) {
    CommandHelper.confirmPwd(password);
  }
  int count=1;
  if (args.length == 2) {
    count=Integer.parseInt(args[1]);
  }
  Map<String,Object> parameters=new HashMap<>();
  parameters.put("String_Node_Str",password);
  parameters.put("String_Node_Str",count);
  RpcClientResult result=restFul.post("String_Node_Str",parameters);
  if (result.isFailed()) {
    return CommandResult.getFailed(result.getMsg());
  }
  return CommandResult.getResult(result);
}
Program: 34991
Project: 34991
Buggy source:
@Override public boolean argsValidate(String[] args){
  boolean result;
  do {
    int length=args.length;
    if (length != 4 && length != 5) {
      result=false;
      break;
    }
    if (!CommandHelper.checkArgsIsNull(args)) {
      result=false;
      break;
    }
    if (!Address.validAddress(args[1]) || !Address.validAddress(args[2])) {
      return false;
    }
    if (!StringUtils.isNumberGtZero(args[3])) {
      result=false;
      break;
    }
    TransferForm form=getTransferForm(args);
    paramsData.set(form);
    result=StringUtils.isNotBlank(form.getToAddress());
    if (!result) {
      break;
    }
    result=form.getAmount() > 0;
  }
 while (false);
  return result;
}

Fixed version (ground truth):
@Override public boolean argsValidate(String[] args){
  boolean result;
  do {
    int length=args.length;
    if (length != 4 && length != 5) {
      result=false;
      break;
    }
    if (!CommandHelper.checkArgsIsNull(args)) {
      result=false;
      break;
    }
    if (!Address.validAddress(args[1]) || !Address.validAddress(args[2])) {
      return false;
    }
    if (!StringUtils.isNuls(args[3])) {
      result=false;
      break;
    }
    TransferForm form=getTransferForm(args);
    paramsData.set(form);
    result=StringUtils.isNotBlank(form.getToAddress());
    if (!result) {
      break;
    }
    result=form.getAmount() > 0;
  }
 while (false);
  return result;
}
Program: 34993
Project: 34993
Buggy source:
@Override public Result<Integer> saveConfirmedTransactionList(List<Transaction> txs){
  List<Transaction> savedTxList=new ArrayList<>();
  Result result;
  for (int i=0; i < txs.size(); i++) {
    result=saveConfirmedTransaction(txs.get(i));
    if (result.isSuccess() && (int)result.getData() == 1) {
      savedTxList.add(txs.get(i));
    }
 else {
      rollbackTransaction(savedTxList,false);
      return result;
    }
  }
  balanceManager.refreshBalance();
  return Result.getSuccess().setData(savedTxList.size());
}

Fixed version (ground truth):
@Override public Result<Integer> saveConfirmedTransactionList(List<Transaction> txs){
  List<Transaction> savedTxList=new ArrayList<>();
  Result result;
  for (int i=0; i < txs.size(); i++) {
    result=saveConfirmedTransaction(txs.get(i));
    if (result.isSuccess() && result.getData() != null && (int)result.getData() == 1) {
      savedTxList.add(txs.get(i));
    }
 else     if (result.isSuccess() && result.getData() != null && (int)result.getData() == 0) {
      continue;
    }
 else {
      rollbackTransaction(savedTxList,false);
      return result;
    }
  }
  balanceManager.refreshBalance();
  return Result.getSuccess().setData(savedTxList.size());
}
Program: 34994
Project: 34994
Buggy source:
@Override public boolean argsValidate(String[] args){
  int length=args.length;
  if (length < 7 || length > 8) {
    return false;
  }
  if (!CommandHelper.checkArgsIsNull(args)) {
    return false;
  }
  if (!StringUtils.validAddressSimple(args[1]) || !StringUtils.validAddressSimple(args[2]) || StringUtils.isBlank(args[3])|| StringUtils.isBlank(args[4])|| StringUtils.isBlank(args[5])|| StringUtils.isBlank(args[6])) {
    return false;
  }
  if (!StringUtils.isNumberGtZero(args[3])) {
    return false;
  }
  if (!StringUtils.isNumberGtZero(args[4])) {
    return false;
  }
  if (length == 8 && !StringUtils.validAddressSimple(args[7])) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean argsValidate(String[] args){
  int length=args.length;
  if (length < 5 || length > 6) {
    return false;
  }
  if (!CommandHelper.checkArgsIsNull(args)) {
    return false;
  }
  if (!StringUtils.validAddressSimple(args[1]) || !StringUtils.validAddressSimple(args[2]) || StringUtils.isBlank(args[3])|| StringUtils.isBlank(args[4])) {
    return false;
  }
  if (!StringUtils.isNumberGtZero(args[3])) {
    return false;
  }
  if (!StringUtils.isNumberGtZero(args[4])) {
    return false;
  }
  if (length == 6 && !StringUtils.validAddressSimple(args[5])) {
    return false;
  }
  return true;
}
Program: 34995
Project: 34995
Buggy source:
@Override public CommandResult execute(String[] args){
  String address=args[1];
  RpcClientResult res=CommandHelper.getPassword(address,restFul);
  if (res.isFailed() && !res.getCode().equals(KernelErrorCode.SUCCESS.getCode())) {
    return CommandResult.getFailed(res.getMsg());
  }
  String password=(String)res.getData();
  Map<String,Object> parameters=new HashMap<>();
  parameters.put("String_Node_Str",address);
  parameters.put("String_Node_Str",args[2]);
  parameters.put("String_Node_Str",Double.valueOf(args[3]));
  Long deposit=null;
  try {
    Na na=Na.parseNuls(args[4]);
    deposit=na.getValue();
  }
 catch (  Exception e) {
    return CommandResult.getFailed("String_Node_Str");
  }
  parameters.put("String_Node_Str",deposit);
  parameters.put("String_Node_Str",args[5]);
  parameters.put("String_Node_Str",args[6]);
  parameters.put("String_Node_Str",password);
  if (args.length == 8) {
    parameters.put("String_Node_Str",args[7]);
  }
  RpcClientResult result=restFul.post("String_Node_Str",parameters);
  if (result.isFailed()) {
    return CommandResult.getFailed(result.getMsg());
  }
  return CommandResult.getResult(result);
}

Fixed version (ground truth):
@Override public CommandResult execute(String[] args){
  String address=args[1];
  RpcClientResult res=CommandHelper.getPassword(address,restFul);
  if (res.isFailed() && !res.getCode().equals(KernelErrorCode.SUCCESS.getCode())) {
    return CommandResult.getFailed(res.getMsg());
  }
  String password=(String)res.getData();
  Map<String,Object> parameters=new HashMap<>();
  parameters.put("String_Node_Str",address);
  parameters.put("String_Node_Str",args[2]);
  parameters.put("String_Node_Str",Double.valueOf(args[3]));
  Long deposit=null;
  try {
    Na na=Na.parseNuls(args[4]);
    deposit=na.getValue();
  }
 catch (  Exception e) {
    return CommandResult.getFailed("String_Node_Str");
  }
  parameters.put("String_Node_Str",deposit);
  parameters.put("String_Node_Str",password);
  if (args.length == 6) {
    parameters.put("String_Node_Str",args[5]);
  }
  RpcClientResult result=restFul.post("String_Node_Str",parameters);
  if (result.isFailed()) {
    return CommandResult.getFailed(result.getMsg());
  }
  return CommandResult.getResult(result);
}
Program: 34996
Project: 34996
Buggy source:
/** 
 * 别名规则:只允许使用小写字母、数字、下划线（下划线不能在两端）1~30字节
 * @param alias
 * @return
 */
public static boolean validAlias(String alias){
  try {
    if (isBlank(alias)) {
      return false;
    }
    alias=alias.trim();
    byte[] aliasBytes=alias.getBytes("String_Node_Str");
    if (aliasBytes.length < 1 || aliasBytes.length > 30) {
      return false;
    }
    if (alias.matches("String_Node_Str")) {
      return true;
    }
 else {
      return false;
    }
  }
 catch (  UnsupportedEncodingException e) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * 别名规则:只允许使用小写字母、数字、下划线（下划线不能在两端）1~20字节
 * @param alias
 * @return
 */
public static boolean validAlias(String alias){
  try {
    if (isBlank(alias)) {
      return false;
    }
    alias=alias.trim();
    byte[] aliasBytes=alias.getBytes("String_Node_Str");
    if (aliasBytes.length < 1 || aliasBytes.length > 20) {
      return false;
    }
    if (alias.matches("String_Node_Str")) {
      return true;
    }
 else {
      return false;
    }
  }
 catch (  UnsupportedEncodingException e) {
    return false;
  }
}
Program: 34999
Project: 34999
Buggy source:
@Override public CommandResult execute(String[] args){
  String address=args[1];
  RpcClientResult result=restFul.get("String_Node_Str" + address,null);
  if (result.isFailed()) {
    return CommandResult.getFailed(result.getMsg());
  }
  List<Map<String,Object>> list=(List<Map<String,Object>>)((Map)result.getData()).get("String_Node_Str");
  for (  Map<String,Object> map : list) {
    map.put("String_Node_Str",CommandHelper.naToNuls(map.get("String_Node_Str")));
    map.put("String_Node_Str",CommandHelper.naToNuls(map.get("String_Node_Str")));
    map.put("String_Node_Str",CommandHelper.naToNuls(map.get("String_Node_Str")));
  }
  result.setData(list);
  return CommandResult.getResult(result);
}

Fixed version (ground truth):
@Override public CommandResult execute(String[] args){
  String address=args[1];
  RpcClientResult result=restFul.get("String_Node_Str" + address,null);
  if (result.isFailed()) {
    return CommandResult.getFailed(result.getMsg());
  }
  List<Map<String,Object>> list=(List<Map<String,Object>>)result.getData();
  for (  Map<String,Object> map : list) {
    map.put("String_Node_Str",CommandHelper.naToNuls(map.get("String_Node_Str")));
    map.put("String_Node_Str",CommandHelper.naToNuls(map.get("String_Node_Str")));
    map.put("String_Node_Str",CommandHelper.naToNuls(map.get("String_Node_Str")));
  }
  result.setData(list);
  return CommandResult.getResult(result);
}