nus-yam/ex-repair huggingface dataset:
Program: 39915
Project: 39915
Buggy source:
@Override public void onSuccess(){
  assertTrue(strategy.isAuthorized());
  OAuth2AccessToken token=strategy.getToken();
  assertNotNull(token);
  System.out.println(token);
  System.out.println(token.getAccessToken());
  System.out.println("String_Node_Str" + token.getExpiresIn());
}

Fixed version (ground truth):
@Override public void onSuccess(){
  assertFalse(true);
}
Program: 39916
Project: 39916
Buggy source:
private void updateAllCalls(List<BluetoothHeadsetClientCall> calls){
  totalCalls=0;
  if (calls == null || calls.size() == 0) {
    onCall=false;
    callNumber="String_Node_Str";
    callId=0;
    ringingNumber="String_Node_Str";
    ringing=false;
    return;
  }
  for (  BluetoothHeadsetClientCall call : calls) {
    Log.v(TAG,"String_Node_Str");
    int state=call.getState();
switch (state) {
case BluetoothHeadsetClientCall.CALL_STATE_ACTIVE:
      onCall=true;
    callNumber=call.getNumber();
  callId=call.getId();
totalCalls++;
break;
case BluetoothHeadsetClientCall.CALL_STATE_HELD:
case BluetoothHeadsetClientCall.CALL_STATE_HELD_BY_RESPONSE_AND_HOLD:
totalCalls++;
break;
case BluetoothHeadsetClientCall.CALL_STATE_DIALING:
totalCalls++;
break;
case BluetoothHeadsetClientCall.CALL_STATE_ALERTING:
totalCalls++;
break;
case BluetoothHeadsetClientCall.CALL_STATE_INCOMING:
case BluetoothHeadsetClientCall.CALL_STATE_WAITING:
ringingNumber=call.getNumber();
ringing=true;
totalCalls++;
break;
case BluetoothHeadsetClientCall.CALL_STATE_TERMINATED:
break;
}
}
}

Fixed version (ground truth):
private boolean updateAllCalls(List<BluetoothHeadsetClientCall> calls){
  int o_totalCalls=totalCalls;
  boolean o_onCall=onCall;
  String o_callNumber=callNumber;
  int o_callId=callId;
  String o_ringingNumber=ringingNumber;
  boolean o_ringing=ringing;
  totalCalls=0;
  onCall=false;
  callNumber="String_Node_Str";
  callId=0;
  ringingNumber="String_Node_Str";
  ringing=false;
  if (calls == null || calls.size() == 0)   return true;
  for (  BluetoothHeadsetClientCall call : calls) {
    Log.v(TAG,"String_Node_Str" + call.getState());
    int state=call.getState();
switch (state) {
case BluetoothHeadsetClientCall.CALL_STATE_ACTIVE:
      onCall=true;
    callNumber=call.getNumber();
  callId=call.getId();
totalCalls++;
break;
case BluetoothHeadsetClientCall.CALL_STATE_HELD:
case BluetoothHeadsetClientCall.CALL_STATE_HELD_BY_RESPONSE_AND_HOLD:
totalCalls++;
break;
case BluetoothHeadsetClientCall.CALL_STATE_DIALING:
totalCalls++;
break;
case BluetoothHeadsetClientCall.CALL_STATE_ALERTING:
totalCalls++;
break;
case BluetoothHeadsetClientCall.CALL_STATE_INCOMING:
case BluetoothHeadsetClientCall.CALL_STATE_WAITING:
ringingNumber=call.getNumber();
ringing=true;
totalCalls++;
break;
case BluetoothHeadsetClientCall.CALL_STATE_TERMINATED:
break;
}
}
return (o_totalCalls != totalCalls || o_onCall != onCall || o_callId != callId || o_ringing != ringing || !o_callNumber.contentEquals(callNumber) || !o_ringingNumber.contentEquals(ringingNumber));
}
Program: 39922
Project: 39922
Buggy source:
private void processBeanDefinitions(Set<BeanDefinitionHolder> beanDefinitions){
  GenericBeanDefinition definition;
  for (  BeanDefinitionHolder holder : beanDefinitions) {
    definition=(GenericBeanDefinition)holder.getBeanDefinition();
    logger.info("String_Node_Str" + holder.getBeanName() + "String_Node_Str"+ definition.getBeanClassName()+ "String_Node_Str");
    definition.getPropertyValues().add("String_Node_Str",definition.getBeanClassName());
    definition.setBeanClass(MapperFactoryBean.class);
    definition.getPropertyValues().add("String_Node_Str",mapperFactory);
    definition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE);
  }
}

Fixed version (ground truth):
private void processBeanDefinitions(Set<BeanDefinitionHolder> beanDefinitions){
  GenericBeanDefinition definition;
  for (  BeanDefinitionHolder holder : beanDefinitions) {
    definition=(GenericBeanDefinition)holder.getBeanDefinition();
    logger.info("String_Node_Str" + holder.getBeanName() + "String_Node_Str"+ definition.getBeanClassName()+ "String_Node_Str");
    definition.getPropertyValues().add("String_Node_Str",definition.getBeanClassName());
    definition.setBeanClass(MapperBean.class);
    definition.getPropertyValues().add("String_Node_Str",new RuntimeBeanReference(this.mapperFactoryBeanId));
    definition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE);
  }
}
Program: 39923
Project: 39923
Buggy source:
@Override public T getObject() throws Exception {
  return mapperFactory.getMapper(this.mapperInterface);
}

Fixed version (ground truth):
@Override public MapperFactory getObject() throws Exception {
  if (this.mapperFactory == null) {
    afterPropertiesSet();
  }
  return this.mapperFactory;
}
Program: 39924
Project: 39924
Buggy source:
@Override public Class<T> getObjectType(){
  return this.mapperInterface;
}

Fixed version (ground truth):
@Override public Class<?> getObjectType(){
  return MapperFactory.class;
}
Program: 39925
Project: 39925
Buggy source:
@Override public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry){
  ClassPathMapperScanner scanner=new ClassPathMapperScanner(registry);
  scanner.setMapperFactory(mapperFactory);
  scanner.setAnnotationClass(this.annotationClass);
  scanner.setResourceLoader(this.applicationContext);
  scanner.registerFilters();
  scanner.scan(StringUtils.tokenizeToStringArray(this.basePackage,ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS));
}

Fixed version (ground truth):
@Override public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry){
  ClassPathMapperScanner scanner=new ClassPathMapperScanner(registry);
  scanner.setMapperFactoryBeanId(this.mapperFactoryBeanId);
  scanner.setAnnotationClass(this.annotationClass);
  scanner.setResourceLoader(this.applicationContext);
  scanner.registerFilters();
  scanner.scan(StringUtils.tokenizeToStringArray(this.basePackage,ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS));
}
Program: 39926
Project: 39926
Buggy source:
@Override public void afterPropertiesSet() throws Exception {
  notNull(this.basePackage,"String_Node_Str");
  addResources();
}

Fixed version (ground truth):
@Override public void afterPropertiesSet() throws Exception {
  notNull(this.basePackage,"String_Node_Str");
}
Program: 39927
Project: 39927
Buggy source:
@Override public String handleToken(String content){
  Object value=MVELUtils.eval(content,bindings);
  String srtValue=(value == null ? "String_Node_Str" : String.valueOf(value));
  return srtValue;
}

Fixed version (ground truth):
@Override public String handleToken(String content){
  Object value=MVELUtils.eval(content,bindings);
  if (value == null) {
    return "String_Node_Str";
  }
 else   if (value instanceof Date) {
    DateFormat df=new SimpleDateFormat(DEFAULT_DATE_FORMAT);
    df.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
    return df.format(value);
  }
 else {
    return String.valueOf(value);
  }
}
Program: 39928
Project: 39928
Buggy source:
public String parse(String raw,Map<String,Object> bindings){
  ParameterHandler handler=new ParameterHandler(bindings);
  TokenParser parser1=new TokenParser("String_Node_Str","String_Node_Str",handler);
  TokenParser parser2=new TokenParser("String_Node_Str","String_Node_Str",handler);
  String result=parser1.parse(raw);
  result=parser2.parse(result);
  return result;
}

Fixed version (ground truth):
public String parse(String raw,Map<String,Object> bindings){
  PlaceholderHandler handler=new PlaceholderHandler(bindings);
  TokenParser parser=new TokenParser("String_Node_Str","String_Node_Str",handler);
  String result=parser.parse(raw);
  return result;
}
Program: 39929
Project: 39929
Buggy source:
@Test public void test(){
  MapperFactory configuration=new MapperFactory();
  configuration.setHttpHosts("String_Node_Str");
  configuration.addResource("String_Node_Str");
  DemoDao demoDao=configuration.getMapper(DemoDao.class);
  Demo demo=new Demo();
  demo.setId(3L);
  demo.setCheckType(0);
  demo.setCheckId(1L);
  demo.setDataDt("String_Node_Str");
  demo.setCreatedAt(LocalDate.now().toString());
  demo.setUpdatedAt(LocalDate.now().toString());
  String json="String_Node_Str";
  demo.setCheckValueJson(json);
  demoDao.index(demo);
}

Fixed version (ground truth):
@Test public void test(){
  MapperFactory mapperFactory=new MapperFactory();
  mapperFactory.setHttpHosts("String_Node_Str");
  mapperFactory.addResource("String_Node_Str");
  DemoDao demoDao=mapperFactory.getMapper(DemoDao.class);
  Demo demo=new Demo();
  demo.setId(3L);
  demo.setDate(new Date());
  demoDao.index(demo);
}
Program: 39930
Project: 39930
Buggy source:
@Test public void test(){
  ApplicationContext applicationContext=new ClassPathXmlApplicationContext("String_Node_Str");
  DemoDao demoDao=applicationContext.getBean(DemoDao.class);
  Demo demo=new Demo();
  demo.setId(3L);
  demo.setCheckType(0);
  demo.setCheckId(1L);
  demo.setDataDt("String_Node_Str");
  demo.setCreatedAt(LocalDate.now().toString());
  demo.setUpdatedAt(LocalDate.now().toString());
  String json="String_Node_Str";
  demo.setCheckValueJson(json);
  demoDao.index(demo);
  demoDao.update();
  boolean b=demoDao.bulk();
  System.out.println(b);
  List<Demo> list=demoDao.mget();
  System.out.println(JSON.toJSON(list));
}

Fixed version (ground truth):
@Test public void test(){
  ApplicationContext applicationContext=new ClassPathXmlApplicationContext("String_Node_Str");
  DemoDao demoDao=applicationContext.getBean(DemoDao.class);
  Demo demo=new Demo();
  demo.setId(61L);
  demo.setAge(new ArrayList<>());
  demo.setDate(new Date());
  demoDao.index(demo);
  demoDao.update();
  boolean b=demoDao.bulk();
  System.out.println(b);
  List<Demo> list=demoDao.mget();
  System.out.println(JSON.toJSON(list));
}
Program: 39933
Project: 39933
Buggy source:
/** 
 * 功能描述：图书同步 1：全量同步 2：增量同步
 * @param type
 * @return
 */
@ResponseBody @LogDetail(businessType=BUSSINESS_TYPE,logRemark="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ResponseBean allsynchronization(Integer type){
  return new ResponseBean(bookService.AllSynchronization(type));
}

Fixed version (ground truth):
/** 
 * 功能描述：图书同步 1：全量同步 2：增量同步
 * @param type
 * @return
 */
@ResponseBody @LogDetail(businessType=BUSSINESS_TYPE,logRemark="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public ResponseBean allsynchronization(Integer type){
  return new ResponseBean(bookService.AllSynchronization(type));
}
Program: 39934
Project: 39934
Buggy source:
/** 
 * 功能描述：图书同步 1：全量同步 2：增量同步
 * @param type
 * @return
 */
@ResponseBody @LogDetail(businessType=BUSSINESS_TYPE,logRemark="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public ResponseBean allsynchronization(Integer type){
  return new ResponseBean(bookService.AllSynchronization(type));
}

Fixed version (ground truth):
/** 
 * 功能描述：图书同步 1：全量同步 2：增量同步
 * @param type
 * @return
 */
@ResponseBody @LogDetail(businessType=BUSSINESS_TYPE,logRemark="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ResponseBean allsynchronization(Integer type){
  return new ResponseBean(bookService.AllSynchronization(type));
}
Program: 39939
Project: 39939
Buggy source:
@Test @Ignore public void fromDeclarationEtcBOList() throws CheckedServiceException, FileNotFoundException, IOException, IllegalArgumentException, IllegalAccessException {
  Workbook workbook=excelHelper.fromDeclarationEtcBOList(materialService.getMaterialById(2L),materialExtensionService.getMaterialExtensionByMaterialId(2L),declarationService.declarationEtcBO(2L,null,null,null,null,null,null,null,null,null),"String_Node_Str");
  String path=this.getClass().getResource("String_Node_Str").getPath().concat("String_Node_Str");
  FileOutputStream out=new FileOutputStream(path);
  workbook.write(out);
  out.flush();
  out.close();
}

Fixed version (ground truth):
@Test public void fromDeclarationEtcBOList() throws CheckedServiceException, FileNotFoundException, IOException, IllegalArgumentException, IllegalAccessException {
  Workbook workbook=excelHelper.fromDeclarationEtcBOList(materialService.getMaterialById(2L),materialExtensionService.getMaterialExtensionByMaterialId(2L),declarationService.declarationEtcBO(2L,null,null,null,null,null,null,null,null,null),"String_Node_Str");
  String path=this.getClass().getResource("String_Node_Str").getPath().concat("String_Node_Str");
  FileOutputStream out=new FileOutputStream(path);
  workbook.write(out);
  out.flush();
  out.close();
}
Program: 39941
Project: 39941
Buggy source:
@Test public void fromDeclarationEtcBOList() throws CheckedServiceException, FileNotFoundException, IOException, IllegalArgumentException, IllegalAccessException {
  Workbook workbook=excelHelper.fromDeclarationEtcBOList(materialService.getMaterialById(2L),materialExtensionService.getMaterialExtensionByMaterialId(2L),declarationService.declarationEtcBO(2L,null,null,null,null,null,null,null,null,null),"String_Node_Str");
  String path=this.getClass().getResource("String_Node_Str").getPath().concat("String_Node_Str");
  FileOutputStream out=new FileOutputStream(path);
  workbook.write(out);
  out.flush();
  out.close();
}

Fixed version (ground truth):
@Test @Ignore public void fromDeclarationEtcBOList() throws CheckedServiceException, FileNotFoundException, IOException, IllegalArgumentException, IllegalAccessException {
  Workbook workbook=excelHelper.fromDeclarationEtcBOList(materialService.getMaterialById(2L),materialExtensionService.getMaterialExtensionByMaterialId(2L),declarationService.declarationEtcBO(2L,null,null,null,null,null,null,null,null,null),"String_Node_Str");
  String path=this.getClass().getResource("String_Node_Str").getPath().concat("String_Node_Str");
  FileOutputStream out=new FileOutputStream(path);
  workbook.write(out);
  out.flush();
  out.close();
}
Program: 39942
Project: 39942
Buggy source:
/** 
 * 审核视频
 * @introduction
 * @author Mryang
 * @createDate 2018年2月6日 下午5:34:12
 * @param pageSize
 * @param pageNumber
 * @param bookName
 * @return
 */
@ResponseBody @RequestMapping(value="String_Node_Str",method=RequestMethod.PUT) @LogDetail(businessType=BUSSINESS_TYPE,logRemark="String_Node_Str") public ResponseBean<Integer> audit(HttpServletRequest request,Long id,Boolean isAuth){
  BookVideo bookVideo=new BookVideo();
  bookVideo.setId(id).setAuthDate(new Date()).setAuthUserId(SessionUtil.getPmphUserBySessionId(CookiesUtil.getSessionId(request)).getId()).setIsAuth(isAuth == null ? false : isAuth);
  return new ResponseBean(bookVideoService.updateBookVideo(bookVideo));
}

Fixed version (ground truth):
/** 
 * 审核视频
 * @introduction
 * @author Mryang
 * @createDate 2018年2月6日 下午5:34:12
 * @return
 */
@ResponseBody @RequestMapping(value="String_Node_Str",method=RequestMethod.PUT) @LogDetail(businessType=BUSSINESS_TYPE,logRemark="String_Node_Str") public ResponseBean<Integer> audit(HttpServletRequest request,Long id,Boolean isAuth){
  if (ObjectUtil.isNull(id)) {
    return new ResponseBean(new CheckedServiceException(CheckedExceptionBusiness.BOOK_VEDIO,CheckedExceptionResult.NULL_PARAM,"String_Node_Str"));
  }
  if (ObjectUtil.isNull(isAuth)) {
    return new ResponseBean(new CheckedServiceException(CheckedExceptionBusiness.BOOK_VEDIO,CheckedExceptionResult.NULL_PARAM,"String_Node_Str"));
  }
  String sessionId=CookiesUtil.getSessionId(request);
  if (StringUtil.isEmpty(sessionId)) {
    return new ResponseBean(new CheckedServiceException(CheckedExceptionBusiness.BOOK_VEDIO,CheckedExceptionResult.USER_SESSION,"String_Node_Str"));
  }
  BookVideo bookVideo=new BookVideo();
  bookVideo.setId(id).setAuthDate(new Date()).setAuthUserId(SessionUtil.getPmphUserBySessionId(sessionId).getId()).setIsAuth(isAuth);
  return new ResponseBean(bookVideoService.updateBookVideo(bookVideo));
}
Program: 39948
Project: 39948
Buggy source:
public double[] forward(int[] x,int action){
  double ans=0;
  for (int j=0; j < 100; j++) {
    for (int i=0; i < 64; i++)     sum[0][j]+=x[i] * w[0][i][j];
    sum[0][j]=LRelu(sum[0][j] + b[0][j]);
  }
  for (int k=1; k <= 2; k++)   for (int j=0; j < 100; j++) {
    for (int i=0; i < 100; i++)     sum[k][j]+=sum[k - 1][i] * w[k][i][j];
    sum[k][j]=LRelu(sum[k][j] + b[k][j]);
  }
  for (int i=0; i < 64; i++) {
    for (int j=0; j < 100; j++)     sum[3][j]+=sum[2][i] * w[3][i][j];
    sum[3][i]+=b[3][i];
  }
  return sum[3];
}

Fixed version (ground truth):
public double[] forward(int[] x,int action){
  double ans=0;
  for (int j=0; j < 100; j++) {
    for (int i=0; i < 64; i++)     sum[0][j]+=x[i] * w[0][i][j];
    sum[0][j]=LRelu(sum[0][j] + b[0][j]);
  }
  for (int k=1; k <= 2; k++)   for (int j=0; j < 100; j++) {
    for (int i=0; i < 100; i++)     sum[k][j]+=sum[k - 1][i] * w[k][i][j];
    sum[k][j]=LRelu(sum[k][j] + b[k][j]);
  }
  for (int i=0; i < 64; i++) {
    for (int j=0; j < 100; j++)     sum[3][j]+=sum[2][i] * w[3][i][j];
    sum[3][i]=Math.tanh(sum[3][i] + b[3][i]);
  }
  return sum[3];
}
Program: 39949
Project: 39949
Buggy source:
public void backward(double[] y,double[] t){
  double[][] error;
  error=new double[3][];
  for (int i=0; i < 2; i++)   error[i]=new double[100];
  error[2]=new double[64];
  double temp=0;
  for (int i=0; i < 64; i++)   error[2][i]=de(y[i]) * (y[i] - t[i]);
  for (int i=0; i < 100; i++) {
    temp=0;
    for (int j=0; j < 64; j++) {
      adam(3,i,j,error[2][j] * sum[3][j]);
      adam_b(3,j,error[2][j]);
      temp+=error[2][j] * w[3][i][j];
      adam(2,i,j,error[2][i] * sum[2][i]);
    }
    error[1][i]=de(sum[2][i]) * temp;
    adam_b(2,i,error[2][i]);
  }
  for (int k=1; k >= 0; k--)   for (int i=0; i < 100; i++) {
    temp=0;
    for (int j=0; j < 100; j++) {
      temp+=error[k][j] * w[k + 1][i][j];
      adam(k,i,j,error[k][i] * sum[k][i]);
    }
    if (k > 0)     error[k - 1][i]=de(sum[k][i]) * temp;
    adam_b(k,i,error[k][i]);
  }
}

Fixed version (ground truth):
public void backward(double[] y,double[] t){
  double[][] error;
  error=new double[3][];
  for (int i=0; i < 2; i++)   error[i]=new double[100];
  error[2]=new double[64];
  double temp=0;
  for (int i=0; i < 64; i++)   error[2][i]=(1 - Math.pow(y[i],2.0)) * (y[i] - t[i]);
  for (int i=0; i < 100; i++) {
    temp=0;
    for (int j=0; j < 64; j++) {
      adam(3,i,j,error[2][j] * sum[3][j]);
      adam_b(3,j,error[2][j]);
      temp+=error[2][j] * w[3][i][j];
      adam(2,i,j,error[2][i] * sum[2][i]);
    }
    error[1][i]=de(sum[2][i]) * temp;
    adam_b(2,i,error[2][i]);
  }
  for (int k=1; k >= 0; k--)   for (int i=0; i < 100; i++) {
    temp=0;
    for (int j=0; j < 100; j++) {
      temp+=error[k][j] * w[k + 1][i][j];
      adam(k,i,j,error[k][i] * sum[k][i]);
    }
    if (k > 0)     error[k - 1][i]=de(sum[k][i]) * temp;
    adam_b(k,i,error[k][i]);
  }
}
Program: 39950
Project: 39950
Buggy source:
private double evaluate(int[] x){
  double sum=0;
  for (int i=0; i <= 64; i++) {
    if (x[i] == hold)     sum+=value[i] * (32.0 / (double)(pt.hand)) + 0.32 / (double)(65.0 - pt.hand);
 else     if (x[i] == -hold)     sum-=value[i] * (32.0 / (double)(pt.hand)) + 0.32 / (double)(65.0 - pt.hand);
  }
  return sum;
}

Fixed version (ground truth):
private double evaluate(int[] x){
  double sum=0;
  int hand=0;
  for (int i=0; i <= 64; i++)   if (x[i] != 0)   hand++;
  for (int i=0; i <= 64; i++) {
    if (x[i] == hold)     sum+=value[i] * (32.0 / (double)(hand)) + 0.32 / (double)(65.0 - hand);
 else     if (x[i] == -hold)     sum-=value[i] * (32.0 / (double)(hand)) + 0.32 / (double)(65.0 - hand);
  }
  return sum;
}
Program: 39951
Project: 39951
Buggy source:
/** 
 * List Parts, check which parts have been uploaded.
 */
private ListPartsResult listPart() throws CosXmlServiceException, CosXmlClientException {
  listPartsRequest=new ListPartsRequest(bucket,cosPath,uploadId);
  setSignTime(listPartsRequest);
  return cosXmlService.listParts(listPartsRequest);
}

Fixed version (ground truth):
/** 
 * List Parts, check which parts have been uploaded.
 */
private ListPartsResult listPart() throws CosXmlServiceException, CosXmlClientException {
  listPartsRequest=new ListPartsRequest(bucket,cosPath,uploadId);
  setSignTime(listPartsRequest);
  setRequestHeaders(listPartsRequest);
  return cosXmlService.listParts(listPartsRequest);
}
Program: 39952
Project: 39952
Buggy source:
/** 
 * complete multi upload.
 */
private CompleteMultiUploadResult completeMultiUpload() throws CosXmlServiceException, CosXmlClientException {
  completeMultiUploadRequest=new CompleteMultiUploadRequest(bucket,cosPath,uploadId,null);
  for (  Map.Entry<Integer,SlicePartStruct> entry : partStructMap.entrySet()) {
    SlicePartStruct slicePartStruct=entry.getValue();
    completeMultiUploadRequest.setPartNumberAndETag(slicePartStruct.partNumber,slicePartStruct.eTag);
  }
  setSignTime(completeMultiUploadRequest);
  return cosXmlService.completeMultiUpload(completeMultiUploadRequest);
}

Fixed version (ground truth):
/** 
 * complete multi upload.
 */
private CompleteMultiUploadResult completeMultiUpload() throws CosXmlServiceException, CosXmlClientException {
  completeMultiUploadRequest=new CompleteMultiUploadRequest(bucket,cosPath,uploadId,null);
  for (  Map.Entry<Integer,SlicePartStruct> entry : partStructMap.entrySet()) {
    SlicePartStruct slicePartStruct=entry.getValue();
    completeMultiUploadRequest.setPartNumberAndETag(slicePartStruct.partNumber,slicePartStruct.eTag);
  }
  setSignTime(completeMultiUploadRequest);
  setRequestHeaders(completeMultiUploadRequest);
  return cosXmlService.completeMultiUpload(completeMultiUploadRequest);
}
Program: 39953
Project: 39953
Buggy source:
/** 
 * init multi,then get uploadId
 */
private InitMultipartUploadResult initMultiUpload() throws CosXmlServiceException, CosXmlClientException {
  initMultipartUploadRequest=new InitMultipartUploadRequest(bucket,cosPath);
  setSignTime(initMultipartUploadRequest);
  return cosXmlService.initMultipartUpload(initMultipartUploadRequest);
}

Fixed version (ground truth):
/** 
 * init multi,then get uploadId
 */
private InitMultipartUploadResult initMultiUpload() throws CosXmlServiceException, CosXmlClientException {
  initMultipartUploadRequest=new InitMultipartUploadRequest(bucket,cosPath);
  setSignTime(initMultipartUploadRequest);
  setRequestHeaders(initMultipartUploadRequest);
  return cosXmlService.initMultipartUpload(initMultipartUploadRequest);
}
Program: 39954
Project: 39954
Buggy source:
/** 
 * upload Part,  concurrence upload file parts.
 */
private void uploadPart(final int partNumber,long offset,long contentLength,CosXmlResultListener cosXmlResultListener){
  final UploadPartRequest uploadPartRequest=new UploadPartRequest(bucket,cosPath,partNumber,srcPath,offset,contentLength,uploadId);
  uploadPartRequestLongMap.put(uploadPartRequest,0L);
  setSignTime(uploadPartRequest);
  uploadPartRequest.setProgressListener(new CosXmlProgressListener(){
    @Override public void onProgress(    long complete,    long target){
synchronized (objectSync) {
        long dataLen=ALREADY_SEND_DATA_LEN.addAndGet(complete - uploadPartRequestLongMap.get(uploadPartRequest));
        uploadPartRequestLongMap.put(uploadPartRequest,complete);
        if (cosXmlProgressListener != null) {
          cosXmlProgressListener.onProgress(dataLen,fileLength);
        }
      }
    }
  }
);
  cosXmlService.uploadPartAsync(uploadPartRequest,cosXmlResultListener);
}

Fixed version (ground truth):
/** 
 * upload Part,  concurrence upload file parts.
 */
private void uploadPart(final int partNumber,long offset,long contentLength,CosXmlResultListener cosXmlResultListener){
  final UploadPartRequest uploadPartRequest=new UploadPartRequest(bucket,cosPath,partNumber,srcPath,offset,contentLength,uploadId);
  uploadPartRequestLongMap.put(uploadPartRequest,0L);
  setSignTime(uploadPartRequest);
  try {
    setRequestHeaders(uploadPartRequest);
  }
 catch (  CosXmlClientException e) {
    cosXmlResultListener.onFail(putObjectRequest,e,null);
    return;
  }
  uploadPartRequest.setProgressListener(new CosXmlProgressListener(){
    @Override public void onProgress(    long complete,    long target){
synchronized (objectSync) {
        long dataLen=ALREADY_SEND_DATA_LEN.addAndGet(complete - uploadPartRequestLongMap.get(uploadPartRequest));
        uploadPartRequestLongMap.put(uploadPartRequest,complete);
        if (cosXmlProgressListener != null) {
          cosXmlProgressListener.onProgress(dataLen,fileLength);
        }
      }
    }
  }
);
  cosXmlService.uploadPartAsync(uploadPartRequest,cosXmlResultListener);
}
Program: 39955
Project: 39955
Buggy source:
/** 
 * abort multi upload
 */
private void abortMultiUpload(final CosXmlResultListener cosXmlResultListener){
  if (uploadId == null)   return;
  AbortMultiUploadRequest abortMultiUploadRequest=new AbortMultiUploadRequest(bucket,cosPath,uploadId);
  setSignTime(abortMultiUploadRequest);
  cosXmlService.abortMultiUploadAsync(abortMultiUploadRequest,new CosXmlResultListener(){
    @Override public void onSuccess(    CosXmlRequest request,    CosXmlResult result){
      cosXmlResultListener.onSuccess(request,result);
      realCancel();
      clear();
    }
    @Override public void onFail(    CosXmlRequest request,    CosXmlClientException exception,    CosXmlServiceException serviceException){
      cosXmlResultListener.onFail(request,exception,serviceException);
      realCancel();
      clear();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * abort multi upload
 */
private void abortMultiUpload(final CosXmlResultListener cosXmlResultListener){
  if (uploadId == null)   return;
  AbortMultiUploadRequest abortMultiUploadRequest=new AbortMultiUploadRequest(bucket,cosPath,uploadId);
  setSignTime(abortMultiUploadRequest);
  try {
    setRequestHeaders(abortMultiUploadRequest);
  }
 catch (  CosXmlClientException e) {
    cosXmlResultListener.onFail(abortMultiUploadRequest,e,null);
    return;
  }
  cosXmlService.abortMultiUploadAsync(abortMultiUploadRequest,new CosXmlResultListener(){
    @Override public void onSuccess(    CosXmlRequest request,    CosXmlResult result){
      cosXmlResultListener.onSuccess(request,result);
      realCancel();
      clear();
    }
    @Override public void onFail(    CosXmlRequest request,    CosXmlClientException exception,    CosXmlServiceException serviceException){
      cosXmlResultListener.onFail(request,exception,serviceException);
      realCancel();
      clear();
    }
  }
);
}
Program: 39956
Project: 39956
Buggy source:
private void updateSlicePart(ListPartsResult listPartsResult){
  if (listPartsResult != null && listPartsResult.listParts != null) {
    List<ListParts.Part> parts=listPartsResult.listParts.parts;
    if (parts != null) {
      for (      ListParts.Part part : parts) {
        if (partStructMap.containsKey(part.partNumber)) {
          SlicePartStruct slicePartStruct=partStructMap.get(part.partNumber);
          slicePartStruct.isAlreadyUpload=true;
          slicePartStruct.eTag=part.eTag;
          UPLOAD_PART_COUNT.decrementAndGet();
          ALREADY_SEND_DATA_LEN.addAndGet(Long.parseLong(part.size));
        }
      }
    }
  }
}

Fixed version (ground truth):
private void updateSlicePart(ListPartsResult listPartsResult){
  if (listPartsResult != null && listPartsResult.listParts != null) {
    List<ListParts.Part> parts=listPartsResult.listParts.parts;
    if (parts != null) {
      for (      ListParts.Part part : parts) {
        if (partStructMap.containsKey(Integer.valueOf(part.partNumber))) {
          SlicePartStruct slicePartStruct=partStructMap.get(Integer.valueOf(part.partNumber));
          slicePartStruct.isAlreadyUpload=true;
          slicePartStruct.eTag=part.eTag;
          UPLOAD_PART_COUNT.decrementAndGet();
          ALREADY_SEND_DATA_LEN.addAndGet(Long.parseLong(part.size));
        }
      }
    }
  }
}
Program: 39958
Project: 39958
Buggy source:
protected void initPartNumber() throws CosXmlClientException {
  if (srcPath != null) {
    File file=new File(srcPath);
    if (!file.exists()) {
      throw new CosXmlClientException("String_Node_Str");
    }
    fileLength=file.length();
  }
  if (fileLength > 0 && sliceSize > 0) {
    int count=(int)(fileLength / sliceSize);
    int i=1;
    for (; i < count; ++i) {
      PartStruct partStruct=new PartStruct();
      partStruct.partNumber=i;
      partStruct.alreadyUpload=false;
      partStruct.offset=(i - 1) * sliceSize;
      partStruct.sliceSize=sliceSize;
      partStructMap.put(i,partStruct);
    }
    PartStruct partStruct=new PartStruct();
    partStruct.partNumber=i;
    partStruct.alreadyUpload=false;
    partStruct.offset=(i - 1) * sliceSize;
    partStruct.sliceSize=(int)(fileLength - partStruct.offset);
    partStructMap.put(i,partStruct);
    UPLOAD_PART_COUNT.set(count);
  }
}

Fixed version (ground truth):
protected void initPartNumber() throws CosXmlClientException {
  if (srcPath != null) {
    File file=new File(srcPath);
    if (!file.exists()) {
      throw new CosXmlClientException("String_Node_Str");
    }
    fileLength=file.length();
  }
  if (fileLength > 0 && sliceSize > 0) {
    int count=(int)(fileLength / sliceSize);
    int i=1;
    for (; i < count; ++i) {
      PartStruct partStruct=new PartStruct();
      partStruct.partNumber=i;
      partStruct.alreadyUpload=false;
      partStruct.offset=(i - 1) * sliceSize;
      partStruct.sliceSize=sliceSize;
      partStructMap.put(i,partStruct);
    }
    PartStruct partStruct=new PartStruct();
    partStruct.partNumber=i;
    partStruct.alreadyUpload=false;
    partStruct.offset=(i - 1) * sliceSize;
    partStruct.sliceSize=(int)(fileLength - partStruct.offset);
    partStructMap.put(i,partStruct);
    UPLOAD_PART_COUNT.set(i);
  }
}
Program: 39959
Project: 39959
Buggy source:
public void checkParameters() throws CosXmlClientException {
  if (bucket == null) {
    throw new CosXmlClientException("String_Node_Str");
  }
  if (cosPath == null) {
    throw new CosXmlClientException("String_Node_Str");
  }
  if (appid == null) {
    throw new CosXmlClientException("String_Node_Str");
  }
  if (region == null) {
    throw new CosXmlClientException("String_Node_Str");
  }
  try {
    cosPath=URLEncodeUtils.cosPathEncode(cosPath);
  }
 catch (  UnsupportedEncodingException e) {
    throw new CosXmlClientException(e);
  }
}

Fixed version (ground truth):
public void checkParameters() throws CosXmlClientException {
  if (bucket == null) {
    throw new CosXmlClientException("String_Node_Str");
  }
  if (cosPath == null) {
    throw new CosXmlClientException("String_Node_Str");
  }
  if (appid == null) {
    throw new CosXmlClientException("String_Node_Str");
  }
  if (region == null) {
    throw new CosXmlClientException("String_Node_Str");
  }
  cosPath=URLEncodeUtils.cosPathEncode(cosPath);
}
Program: 39960
Project: 39960
Buggy source:
private synchronized void realCancel(){
  if (mInitMultipartUploadRequest != null) {
    cosXmlService.cancel(mInitMultipartUploadRequest);
  }
  mInitMultipartUploadRequest=null;
  if (mListPartsRequest != null) {
    cosXmlService.cancel(mListPartsRequest);
  }
  mListPartsRequest=null;
  if (uploadPartRequestLongMap != null) {
    Set<UploadPartRequest> set=uploadPartRequestLongMap.keySet();
    Iterator<UploadPartRequest> iterator=set.iterator();
    while (iterator.hasNext()) {
      cosXmlService.cancel(iterator.next());
    }
    uploadPartRequestLongMap.clear();
  }
  uploadPartRequestLongMap=null;
  if (mCompleteMultiUploadRequest != null) {
    cosXmlService.cancel(mCompleteMultiUploadRequest);
  }
  mCompleteMultiUploadRequest=null;
  if (partStructMap != null) {
    partStructMap.clear();
  }
  partStructMap=null;
}

Fixed version (ground truth):
private synchronized void realCancel(){
  if (mInitMultipartUploadRequest != null) {
    cosXmlService.cancel(mInitMultipartUploadRequest);
  }
  if (mListPartsRequest != null) {
    cosXmlService.cancel(mListPartsRequest);
  }
  if (uploadPartRequestLongMap != null) {
    Set<UploadPartRequest> set=uploadPartRequestLongMap.keySet();
    Iterator<UploadPartRequest> iterator=set.iterator();
    while (iterator.hasNext()) {
      cosXmlService.cancel(iterator.next());
    }
  }
  if (mCompleteMultiUploadRequest != null) {
    cosXmlService.cancel(mCompleteMultiUploadRequest);
  }
}
Program: 39963
Project: 39963
Buggy source:
@ParameterizedTest @ArgumentsSource(PrintConsumerArgumentsProvider.class) void testDefault(List<Output> in,String expected){
  PrintStream stdOut=System.out;
  try {
    OutputStream outStream=new ByteArrayOutputStream();
    PrintStream printStream=new PrintStream(outStream,true);
    System.setOut(printStream);
    PrintConsumer printConsumer=new PrintConsumer();
    printConsumer.consumeOutput(in);
    String actual=outStream.toString();
    assertThat(actual).isEqualTo(expected);
  }
  finally {
    System.setOut(stdOut);
  }
}

Fixed version (ground truth):
@ParameterizedTest @ArgumentsSource(PrintConsumerArgumentsProvider.class) void testDefault(List<Output> in,String expected) throws UnsupportedEncodingException {
  PrintStream stdOut=System.out;
  try {
    ByteArrayOutputStream outStream=new ByteArrayOutputStream();
    PrintStream printStream=new PrintStream(outStream,true,StandardCharsets.UTF_8.name());
    System.setOut(printStream);
    PrintConsumer printConsumer=new PrintConsumer();
    printConsumer.consumeOutput(in);
    String actual=outStream.toString(StandardCharsets.UTF_8.name());
    assertThat(actual).isEqualTo(expected);
  }
  finally {
    System.setOut(stdOut);
  }
}
Program: 39964
Project: 39964
Buggy source:
@ParameterizedTest @ArgumentsSource(PrintConsumerArgumentsProvider.class) void testSingle(List<Output> in,String expected){
  OutputStream outStream=new ByteArrayOutputStream();
  PrintStream printStream=new PrintStream(outStream,true);
  PrintConsumer printConsumer=new PrintConsumer(printStream);
  printConsumer.consumeOutput(in);
  String actual=outStream.toString();
  assertThat(actual).isEqualTo(expected);
}

Fixed version (ground truth):
@ParameterizedTest @ArgumentsSource(PrintConsumerArgumentsProvider.class) void testSingle(List<Output> in,String expected) throws UnsupportedEncodingException {
  ByteArrayOutputStream outStream=new ByteArrayOutputStream();
  PrintStream printStream=new PrintStream(outStream,true,StandardCharsets.UTF_8.name());
  PrintConsumer printConsumer=new PrintConsumer(printStream);
  printConsumer.consumeOutput(in);
  String actual=outStream.toString(StandardCharsets.UTF_8.name());
  assertThat(actual).isEqualTo(expected);
}
Program: 39965
Project: 39965
Buggy source:
public static void main(String[] args){
  ConnectionData connectionDataProd=new ConnectionData("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  ConnectionData connectionDataTest=new ConnectionData("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  JUnitGeneratorSettings jUnitGeneratorSettings=new JUnitGeneratorSettings(connectionDataTest,"String_Node_Str","String_Node_Str",true,true,true,false,true);
  Pipeline pipeline=Pipeline.builder().queryRunner(new EvoSQLRunner()).connectionData(connectionDataProd).sqlQuery(QUERY_TO_RUN).resultProcessor(new Pipeline.ResultProcessor(new JUnit5TestGenerator(jUnitGeneratorSettings),new PostgreSQLOptions(),new FileConsumer(Paths.get("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str")))).resultProcessor(new Pipeline.ResultProcessor(new JUnit5TestGenerator(jUnitGeneratorSettings),new PostgreSQLOptions(),new PrintConsumer())).build();
  Connection c=null;
  try {
    c=DriverManager.getConnection(connectionDataProd.getConnectionString());
    Statement aids=c.createStatement();
    aids.execute("String_Node_Str");
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
  pipeline.execute();
}

Fixed version (ground truth):
public static void main(String[] args){
  ConnectionData connectionDataProd=new ConnectionData("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  ConnectionData connectionDataTest=new ConnectionData("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  JUnitGeneratorSettings jUnitGeneratorSettings=new JUnitGeneratorSettings(connectionDataTest,"String_Node_Str","String_Node_Str",true,true,true,false,true);
  Pipeline pipeline=Pipeline.builder().queryRunner(new EvoSQLRunner()).connectionData(connectionDataProd).sqlQuery(QUERY_TO_RUN).resultProcessor(new Pipeline.ResultProcessor(new JUnit5TestGenerator(jUnitGeneratorSettings),new PostgreSQLOptions(),new FileConsumer(Paths.get("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str")))).resultProcessor(new Pipeline.ResultProcessor(new JUnit5TestGenerator(jUnitGeneratorSettings),new PostgreSQLOptions(),new PrintConsumer())).build();
  pipeline.execute();
}
Program: 39966
Project: 39966
Buggy source:
/** 
 * Generates a method specification for the runSQL method.
 * @return method.
 */
private MethodSpec generateRunSQL(){
  MethodSpec.Builder runSQL=MethodSpec.methodBuilder("String_Node_Str").addModifiers(Modifier.PRIVATE,Modifier.STATIC).returns(TypeName.INT).addParameter(String.class,"String_Node_Str").addParameter(boolean.class,"String_Node_Str");
  if (jUnitGeneratorSettings.isGenerateSqlExecutorImplementation()) {
    runSQL.addJavadoc("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str").beginControlFlow("String_Node_Str").addStatement("String_Node_Str",Connection.class,DriverManager.class,NAME_DB_JDBC_URL,NAME_DB_USER,NAME_DB_PASSWORD).addStatement("String_Node_Str" + "String_Node_Str",Statement.class).beginControlFlow("String_Node_Str").addStatement("String_Node_Str").addStatement("String_Node_Str").nextControlFlow("String_Node_Str").addStatement("String_Node_Str",ResultSet.class).beginControlFlow("String_Node_Str").addStatement("String_Node_Str").nextControlFlow("String_Node_Str").addStatement("String_Node_Str").endControlFlow().nextControlFlow("String_Node_Str",SQLException.class).addStatement("String_Node_Str").addStatement("String_Node_Str").endControlFlow();
  }
 else {
    runSQL.addJavadoc("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str").addComment("String_Node_Str").addStatement("String_Node_Str");
  }
  return runSQL.build();
}

Fixed version (ground truth):
/** 
 * Generates a method specification for the runSQL method.
 * @return method.
 */
private MethodSpec generateRunSQL(){
  MethodSpec.Builder runSQL=MethodSpec.methodBuilder("String_Node_Str").addModifiers(Modifier.PRIVATE,Modifier.STATIC).returns(TypeName.INT).addParameter(String.class,"String_Node_Str").addParameter(boolean.class,"String_Node_Str");
  if (jUnitGeneratorSettings.isGenerateSqlExecutorImplementation()) {
    runSQL.addJavadoc("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str").beginControlFlow("String_Node_Str").addStatement("String_Node_Str",Connection.class,DriverManager.class,NAME_DB_JDBC_URL,NAME_DB_USER,NAME_DB_PASSWORD).addStatement("String_Node_Str" + "String_Node_Str",Statement.class).beginControlFlow("String_Node_Str").addStatement("String_Node_Str").addStatement("String_Node_Str").nextControlFlow("String_Node_Str").addStatement("String_Node_Str",ResultSet.class).beginControlFlow("String_Node_Str").addStatement("String_Node_Str").nextControlFlow("String_Node_Str").addStatement("String_Node_Str").endControlFlow().endControlFlow().nextControlFlow("String_Node_Str",SQLException.class).addStatement("String_Node_Str").addStatement("String_Node_Str").endControlFlow();
  }
 else {
    runSQL.addJavadoc("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str").addComment("String_Node_Str").addStatement("String_Node_Str");
  }
  return runSQL.build();
}
Program: 39967
Project: 39967
Buggy source:
@Test void constructorTest(){
  List<String> columns=new ArrayList<>();
  columns.add("String_Node_Str");
  columns.add("String_Node_Str");
  TableSchema tableSchema=new TableSchema("String_Node_Str",columns);
  assertThat(tableSchema.getName()).isEqualTo("String_Node_Str");
  assertThat(tableSchema.getColumns()).isEqualTo(columns);
}

Fixed version (ground truth):
@Test void constructorTest(){
  List<FixtureColumn> columns=new ArrayList<>();
  columns.add(new FixtureColumn("String_Node_Str","String_Node_Str"));
  columns.add(new FixtureColumn("String_Node_Str","String_Node_Str"));
  TableSchema tableSchema=new TableSchema("String_Node_Str",columns);
  assertThat(tableSchema.getName()).isEqualTo("String_Node_Str");
  assertThat(tableSchema.getColumns()).isEqualTo(columns);
}
Program: 39968
Project: 39968
Buggy source:
@Override public void run(){
  new MaterialDialog.Builder(activity).cancelable(false).title(stringValuesMap.get(Constants.ANDVERSION_WHATSNEW_TITLE)).content(features).positiveText(Constants.ANDVERSION_OK).show();
}

Fixed version (ground truth):
@Override public void run(){
  new MaterialDialog.Builder(activity).cancelable(false).title(stringValuesMap.get(Constants.ANDVERSION_WHATSNEW_TITLE)).content(features).positiveText(stringValuesMap.get(Constants.ANDVERSION_OK)).show();
}
Program: 39969
Project: 39969
Buggy source:
@Override public void showUpdateFeatures(final String features){
  final HashMap<String,String> stringValuesMap=mPresenter.getStringValues();
  activity.runOnUiThread(new Runnable(){
    @Override public void run(){
      new MaterialDialog.Builder(activity).cancelable(false).title(stringValuesMap.get(Constants.ANDVERSION_WHATSNEW_TITLE)).content(features).positiveText(Constants.ANDVERSION_OK).show();
    }
  }
);
}

Fixed version (ground truth):
@Override public void showUpdateFeatures(final String features){
  final HashMap<String,String> stringValuesMap=mPresenter.getStringValues();
  activity.runOnUiThread(new Runnable(){
    @Override public void run(){
      new MaterialDialog.Builder(activity).cancelable(false).title(stringValuesMap.get(Constants.ANDVERSION_WHATSNEW_TITLE)).content(features).positiveText(stringValuesMap.get(Constants.ANDVERSION_OK)).show();
    }
  }
);
}
Program: 39970
Project: 39970
Buggy source:
public double calculate(String expression) throws ParsingException {
  ArrayList<Object> tokens=toReversePolishNotation(expression);
  Stack<Double> stack=new Stack<>();
  for (  Object token : tokens) {
    if (token instanceof Double) {
      stack.add((Double)token);
    }
 else     if (token.equals("String_Node_Str")) {
      double a;
      try {
        a=stack.pop();
        stack.push(-a);
      }
 catch (      EmptyStackException e) {
        throw new ParsingException("String_Node_Str");
      }
    }
 else {
      double a, b;
      try {
        a=stack.pop();
        b=stack.pop();
      }
 catch (      EmptyStackException e) {
        throw new ParsingException("String_Node_Str");
      }
      String operator=(String)token;
switch (operator) {
case "String_Node_Str":
        stack.add(a * b);
      break;
case "String_Node_Str":
    stack.add(a + b);
  break;
case "String_Node_Str":
stack.add(b / a);
break;
case "String_Node_Str":
stack.add(b - a);
}
}
}
if (stack.size() != 1) {
throw new ParsingException("String_Node_Str");
}
return stack.remove(stack.size() - 1);
}

Fixed version (ground truth):
public double calculate(String expression) throws ParsingException {
  ArrayList<Object> tokens=toReversePolishNotation(expression);
  Stack<Double> stack=new Stack<>();
  for (  Object token : tokens) {
    if (token instanceof Double) {
      stack.add((Double)token);
    }
 else     if (token.equals("String_Node_Str")) {
      double a;
      try {
        a=stack.pop();
        stack.push(-a);
      }
 catch (      EmptyStackException e) {
        throw new ParsingException("String_Node_Str");
      }
    }
 else {
      double a;
      double b;
      try {
        a=stack.pop();
        b=stack.pop();
      }
 catch (      EmptyStackException e) {
        throw new ParsingException("String_Node_Str");
      }
      String operator=(String)token;
switch (operator) {
case "String_Node_Str":
        stack.add(a * b);
      break;
case "String_Node_Str":
    stack.add(a + b);
  break;
case "String_Node_Str":
stack.add(b / a);
break;
case "String_Node_Str":
stack.add(b - a);
break;
default :
break;
}
}
}
if (stack.size() != 1) {
throw new ParsingException("String_Node_Str");
}
return stack.remove(stack.size() - 1);
}
Program: 39972
Project: 39972
Buggy source:
private void fstPriorityHandler(char symbol,Integer pos,Character currentPrev,Character prevAtRebuilded,Stack<Character> temp) throws ParsingException {
  if ("String_Node_Str".indexOf(currentPrev) != -1) {
    throw new ParsingException("String_Node_Str");
  }
  if (NUMBERS.indexOf(prevAtRebuilded) != -1) {
    rebuildedExpression+="String_Node_Str";
    prevAtRebuilded=' ';
  }
  if (temp.peek() == '*' || temp.peek() == '/') {
    prevAtRebuilded=' ';
    rebuildedExpression+=temp.pop() + "String_Node_Str";
  }
 else {
    temp.add(symbol);
    currentPrev=symbol;
    pos++;
  }
}

Fixed version (ground truth):
private void fstPriorityHandler(char symbol,Stack<Character> temp) throws ParsingException {
  if ("String_Node_Str".indexOf(currentPrev) != -1) {
    throw new ParsingException("String_Node_Str");
  }
  if (NUMBERS.indexOf(prevAtRebuilded) != -1) {
    rebuildedExpression+="String_Node_Str";
    prevAtRebuilded=' ';
  }
  if (temp.peek() == '*' || temp.peek() == '/') {
    prevAtRebuilded=' ';
    rebuildedExpression+=temp.pop() + "String_Node_Str";
  }
 else {
    temp.add(symbol);
    currentPrev=symbol;
    pos++;
  }
}
Program: 39973
Project: 39973
Buggy source:
private void sndPriorityHandler(char symbol,Integer pos,Character currentPrev,Character prevAtRebuilded,Stack<Character> temp) throws ParsingException {
  if ("String_Node_Str".indexOf(currentPrev) != -1) {
    throw new ParsingException("String_Node_Str");
  }
  if (NUMBERS.indexOf(prevAtRebuilded) != -1) {
    rebuildedExpression+="String_Node_Str";
    prevAtRebuilded=' ';
  }
  if ("String_Node_Str".indexOf(currentPrev) != -1) {
    currentPrev=symbol;
    prevAtRebuilded=symbol;
    rebuildedExpression+=symbol;
    pos++;
    return;
  }
  if (temp.peek() == '#' || temp.peek() == '(') {
    temp.add(symbol);
    currentPrev=symbol;
    pos++;
  }
 else {
    prevAtRebuilded=' ';
    rebuildedExpression+=temp.pop() + "String_Node_Str";
  }
}

Fixed version (ground truth):
private void sndPriorityHandler(char symbol,Stack<Character> temp) throws ParsingException {
  if ("String_Node_Str".indexOf(currentPrev) != -1) {
    throw new ParsingException("String_Node_Str");
  }
  if (NUMBERS.indexOf(prevAtRebuilded) != -1) {
    rebuildedExpression+="String_Node_Str";
    prevAtRebuilded=' ';
  }
  if ("String_Node_Str".indexOf(currentPrev) != -1) {
    currentPrev=symbol;
    prevAtRebuilded=symbol;
    rebuildedExpression+=symbol;
    pos++;
    return;
  }
  if (temp.peek() == '#' || temp.peek() == '(') {
    temp.add(symbol);
    currentPrev=symbol;
    pos++;
  }
 else {
    prevAtRebuilded=' ';
    rebuildedExpression+=temp.pop() + "String_Node_Str";
  }
}
Program: 39974
Project: 39974
Buggy source:
private void endSymbol(Integer pos,Character currentPrev,Character prevAtRebuilded,Stack<Character> temp) throws ParsingException {
  if (temp.peek() == '(') {
    throw new ParsingException("String_Node_Str");
  }
  if (temp.peek() == '#') {
    temp.pop();
  }
 else {
    if (NUMBERS.indexOf(prevAtRebuilded) != -1) {
      rebuildedExpression=rebuildedExpression.concat("String_Node_Str");
    }
    prevAtRebuilded=' ';
    rebuildedExpression=rebuildedExpression.concat(temp.pop() + "String_Node_Str");
  }
}

Fixed version (ground truth):
private void endSymbol(Stack<Character> temp) throws ParsingException {
  if (temp.peek() == '(') {
    throw new ParsingException("String_Node_Str");
  }
  if (temp.peek() == '#') {
    temp.pop();
  }
 else {
    if (NUMBERS.indexOf(prevAtRebuilded) != -1) {
      rebuildedExpression=rebuildedExpression.concat("String_Node_Str");
    }
    prevAtRebuilded=' ';
    rebuildedExpression=rebuildedExpression.concat(temp.pop() + "String_Node_Str");
  }
}