nus-yam/ex-repair huggingface dataset:
Program: 172587
Project: 172587
Buggy source:
@Test public void multiFilterDemo() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.GREATER_THAN_OR_EQUAL,2);
  FilterDescriptor priceFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.LESS_THAN,15);
  Map<String,Object> queryParams=mybatisQueryProvider.getWhereQueryParamMap(Product.class,"String_Node_Str",idFilter,priceFilter);
  Product productView=northwindDao.getProductByDynamic(queryParams).stream().findFirst().orElse(null);
  assertEquals(Integer.valueOf(2),productView.getProductID());
}

Fixed version (ground truth):
@Test public void multiFilterDemo() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.GREATER_THAN_OR_EQUAL,2);
  FilterDescriptor priceFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.LESS_THAN,15);
  Map<String,Object> queryParams=MybatisQueryProvider.getWhereQueryParamMap(Product.class,"String_Node_Str",idFilter,priceFilter);
  Product productView=northwindDao.getProductByDynamic(queryParams).stream().findFirst().orElse(null);
  assertEquals(Integer.valueOf(2),productView.getProductID());
}
Program: 172588
Project: 172588
Buggy source:
@Test public void testEndWith() throws Exception {
  FilterDescriptor nameFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.END_WITH,"String_Node_Str");
  Map<String,Object> queryParams=mybatisQueryProvider.getWhereQueryParamMap(ProductView.class,"String_Node_Str",nameFilter);
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals("String_Node_Str",productViews.get(0).getCategoryName());
}

Fixed version (ground truth):
@Test public void testEndWith() throws Exception {
  FilterDescriptor nameFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.END_WITH,"String_Node_Str");
  Map<String,Object> queryParams=MybatisQueryProvider.getWhereQueryParamMap(ProductView.class,"String_Node_Str",nameFilter);
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals("String_Node_Str",productViews.get(0).getCategoryName());
}
Program: 172589
Project: 172589
Buggy source:
@Test public void testGroupFilter() throws Exception {
  FilterGroupDescriptor groupIdFilter=new FilterGroupDescriptor();
  FilterDescriptor idFilter1=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.GREATER_THAN,"String_Node_Str");
  FilterDescriptor idFilter2=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.LESS_THAN,"String_Node_Str");
  groupIdFilter.addFilters(idFilter1,idFilter2);
  FilterDescriptor priceFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.GREATER_THAN,10);
  Map<String,Object> queryParams=mybatisQueryProvider.getWhereQueryParamMap(Product.class,"String_Node_Str",groupIdFilter,priceFilter);
  northwindDao.getProductByDynamic(queryParams);
}

Fixed version (ground truth):
@Test public void testGroupFilter() throws Exception {
  FilterGroupDescriptor groupIdFilter=new FilterGroupDescriptor();
  FilterDescriptor idFilter1=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.GREATER_THAN,"String_Node_Str");
  FilterDescriptor idFilter2=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.LESS_THAN,"String_Node_Str");
  groupIdFilter.addFilters(idFilter1,idFilter2);
  FilterDescriptor priceFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.GREATER_THAN,10);
  Map<String,Object> queryParams=MybatisQueryProvider.getWhereQueryParamMap(Product.class,"String_Node_Str",groupIdFilter,priceFilter);
  northwindDao.getProductByDynamic(queryParams);
}
Program: 172590
Project: 172590
Buggy source:
@Test public void testEqualNull() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.EQUAL,null);
  ParamExpression paramExpression=mybatisQueryProvider.getWhereExpression(ProductView.class,idFilter);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(paramExpression.getParamMap());
  queryParams.put("String_Node_Str",paramExpression.getExpression());
  ProductView productView=northwindDao.getProductViewsByDynamic(queryParams).stream().findFirst().orElse(null);
  assertEquals(null,productView);
}

Fixed version (ground truth):
@Test public void testEqualNull() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.EQUAL,null);
  ParamExpression paramExpression=MybatisQueryProvider.getWhereExpression(ProductView.class,idFilter);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(paramExpression.getParamMap());
  queryParams.put("String_Node_Str",paramExpression.getExpression());
  ProductView productView=northwindDao.getProductViewsByDynamic(queryParams).stream().findFirst().orElse(null);
  assertEquals(null,productView);
}
Program: 172591
Project: 172591
Buggy source:
@Test public void testLessThan() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.LESS_THAN,3);
  ParamExpression paramExpression=mybatisQueryProvider.getWhereExpression(ProductView.class,idFilter);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(paramExpression.getParamMap());
  queryParams.put("String_Node_Str",paramExpression.getExpression());
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals(true,productViews.stream().allMatch(x -> x.getProductID() < 3));
}

Fixed version (ground truth):
@Test public void testLessThan() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.LESS_THAN,3);
  ParamExpression paramExpression=MybatisQueryProvider.getWhereExpression(ProductView.class,idFilter);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(paramExpression.getParamMap());
  queryParams.put("String_Node_Str",paramExpression.getExpression());
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals(true,productViews.stream().allMatch(x -> x.getProductID() < 3));
}
Program: 172592
Project: 172592
Buggy source:
@Test public void testNotEqual() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.NOT_EQUAL,2);
  ParamExpression paramExpression=mybatisQueryProvider.getWhereExpression(ProductView.class,idFilter);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(paramExpression.getParamMap());
  queryParams.put("String_Node_Str",paramExpression.getExpression());
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals(true,productViews.stream().noneMatch(x -> x.getProductID() == 2));
}

Fixed version (ground truth):
@Test public void testNotEqual() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.NOT_EQUAL,2);
  ParamExpression paramExpression=MybatisQueryProvider.getWhereExpression(ProductView.class,idFilter);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(paramExpression.getParamMap());
  queryParams.put("String_Node_Str",paramExpression.getExpression());
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals(true,productViews.stream().noneMatch(x -> x.getProductID() == 2));
}
Program: 172593
Project: 172593
Buggy source:
@Test public void testNotIn() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.NOT_IN,new int[]{2,4});
  Map<String,Object> queryParams=mybatisQueryProvider.getWhereQueryParamMap(ProductView.class,"String_Node_Str",idFilter);
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals(Long.valueOf(1),productViews.get(0).getProductID());
  assertEquals(Long.valueOf(3),productViews.get(1).getProductID());
}

Fixed version (ground truth):
@Test public void testNotIn() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.NOT_IN,new int[]{2,4});
  Map<String,Object> queryParams=MybatisQueryProvider.getWhereQueryParamMap(ProductView.class,"String_Node_Str",idFilter);
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals(Long.valueOf(1),productViews.get(0).getProductID());
  assertEquals(Long.valueOf(3),productViews.get(1).getProductID());
}
Program: 172594
Project: 172594
Buggy source:
@Test public void simpleDemo() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.GREATER_THAN_OR_EQUAL,2);
  Map<String,Object> queryParams=mybatisQueryProvider.getWhereQueryParamMap(Product.class,"String_Node_Str",idFilter);
  northwindDao.getProductByDynamic(queryParams);
}

Fixed version (ground truth):
@Test public void simpleDemo() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.GREATER_THAN_OR_EQUAL,2);
  Map<String,Object> queryParams=MybatisQueryProvider.getWhereQueryParamMap(Product.class,"String_Node_Str",idFilter);
  northwindDao.getProductByDynamic(queryParams);
}
Program: 172595
Project: 172595
Buggy source:
@Test public void testNotEqualNull() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.NOT_EQUAL,null);
  ParamExpression paramExpression=mybatisQueryProvider.getWhereExpression(ProductView.class,idFilter);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(paramExpression.getParamMap());
  queryParams.put("String_Node_Str",paramExpression.getExpression());
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals(true,productViews.stream().noneMatch(x -> x.getProductID() == null));
}

Fixed version (ground truth):
@Test public void testNotEqualNull() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.NOT_EQUAL,null);
  ParamExpression paramExpression=MybatisQueryProvider.getWhereExpression(ProductView.class,idFilter);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(paramExpression.getParamMap());
  queryParams.put("String_Node_Str",paramExpression.getExpression());
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals(true,productViews.stream().noneMatch(x -> x.getProductID() == null));
}
Program: 172596
Project: 172596
Buggy source:
@Test public void testSort() throws Exception {
  SortDescriptor priceSort=new SortDescriptor("String_Node_Str",SortDirection.DESC);
  Map<String,Object> queryParams=mybatisQueryProvider.getSortQueryParamMap(Product.class,"String_Node_Str",priceSort);
  northwindDao.getProductByDynamic(queryParams);
}

Fixed version (ground truth):
@Test public void testSort() throws Exception {
  SortDescriptor priceSort=new SortDescriptor("String_Node_Str",SortDirection.DESC);
  Map<String,Object> queryParams=MybatisQueryProvider.getSortQueryParamMap(Product.class,"String_Node_Str",priceSort);
  northwindDao.getProductByDynamic(queryParams);
}
Program: 172597
Project: 172597
Buggy source:
@Test public void testFilterSort() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.NOT_EQUAL,4);
  SortDescriptor priceSort=new SortDescriptor("String_Node_Str",SortDirection.ASC);
  Map<String,Object> filterParams=mybatisQueryProvider.getWhereQueryParamMap(Product.class,"String_Node_Str",idFilter);
  Map<String,Object> sortParams=mybatisQueryProvider.getSortQueryParamMap(Product.class,"String_Node_Str",priceSort);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(filterParams);
  queryParams.putAll(sortParams);
  northwindDao.getProductByDynamic(queryParams);
}

Fixed version (ground truth):
@Test public void testFilterSort() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.NOT_EQUAL,4);
  SortDescriptor priceSort=new SortDescriptor("String_Node_Str",SortDirection.ASC);
  Map<String,Object> filterParams=MybatisQueryProvider.getWhereQueryParamMap(Product.class,"String_Node_Str",idFilter);
  Map<String,Object> sortParams=MybatisQueryProvider.getSortQueryParamMap(Product.class,"String_Node_Str",priceSort);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(filterParams);
  queryParams.putAll(sortParams);
  northwindDao.getProductByDynamic(queryParams);
}
Program: 172598
Project: 172598
Buggy source:
@Test public void testStartWith() throws Exception {
  FilterDescriptor nameFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.START_WITH,"String_Node_Str");
  Map<String,Object> queryParams=mybatisQueryProvider.getWhereQueryParamMap(ProductView.class,"String_Node_Str",nameFilter);
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals("String_Node_Str",productViews.get(0).getCategoryName());
}

Fixed version (ground truth):
@Test public void testStartWith() throws Exception {
  FilterDescriptor nameFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.START_WITH,"String_Node_Str");
  Map<String,Object> queryParams=MybatisQueryProvider.getWhereQueryParamMap(ProductView.class,"String_Node_Str",nameFilter);
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals("String_Node_Str",productViews.get(0).getCategoryName());
}
Program: 172599
Project: 172599
Buggy source:
@Test public void testLessThanOrEqual() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.LESS_THAN_OR_EQUAL,3);
  ParamExpression paramExpression=mybatisQueryProvider.getWhereExpression(ProductView.class,idFilter);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(paramExpression.getParamMap());
  queryParams.put("String_Node_Str",paramExpression.getExpression());
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals(true,productViews.stream().allMatch(x -> x.getProductID() <= 3));
}

Fixed version (ground truth):
@Test public void testLessThanOrEqual() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.LESS_THAN_OR_EQUAL,3);
  ParamExpression paramExpression=MybatisQueryProvider.getWhereExpression(ProductView.class,idFilter);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(paramExpression.getParamMap());
  queryParams.put("String_Node_Str",paramExpression.getExpression());
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals(true,productViews.stream().allMatch(x -> x.getProductID() <= 3));
}
Program: 172600
Project: 172600
Buggy source:
@Test public void testBetween() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.BETWEEN,new int[]{2,4});
  Map<String,Object> queryParams=mybatisQueryProvider.getWhereQueryParamMap(ProductView.class,"String_Node_Str",idFilter);
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams).stream().sorted(Comparator.comparing(ProductView::getProductID)).collect(Collectors.toList());
  assertEquals(Long.valueOf(2),productViews.get(0).getProductID());
  assertEquals(Long.valueOf(3),productViews.get(1).getProductID());
  assertEquals(Long.valueOf(4),productViews.get(2).getProductID());
}

Fixed version (ground truth):
@Test public void testBetween() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.BETWEEN,new int[]{2,4});
  Map<String,Object> queryParams=MybatisQueryProvider.getWhereQueryParamMap(ProductView.class,"String_Node_Str",idFilter);
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams).stream().sorted(Comparator.comparing(ProductView::getProductID)).collect(Collectors.toList());
  assertEquals(Long.valueOf(2),productViews.get(0).getProductID());
  assertEquals(Long.valueOf(3),productViews.get(1).getProductID());
  assertEquals(Long.valueOf(4),productViews.get(2).getProductID());
}
Program: 172601
Project: 172601
Buggy source:
@Test public void testEqual() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.EQUAL,2);
  ParamExpression paramExpression=mybatisQueryProvider.getWhereExpression(ProductView.class,idFilter);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(paramExpression.getParamMap());
  queryParams.put("String_Node_Str",paramExpression.getExpression());
  ProductView productView=northwindDao.getProductViewsByDynamic(queryParams).stream().findFirst().orElse(null);
  assertEquals(Long.valueOf(2),productView.getProductID());
}

Fixed version (ground truth):
@Test public void testEqual() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.EQUAL,2);
  ParamExpression paramExpression=MybatisQueryProvider.getWhereExpression(ProductView.class,idFilter);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(paramExpression.getParamMap());
  queryParams.put("String_Node_Str",paramExpression.getExpression());
  ProductView productView=northwindDao.getProductViewsByDynamic(queryParams).stream().findFirst().orElse(null);
  assertEquals(Long.valueOf(2),productView.getProductID());
}
Program: 172602
Project: 172602
Buggy source:
@Test public void testGreaterThan() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.GREATER_THAN,2);
  ParamExpression paramExpression=mybatisQueryProvider.getWhereExpression(ProductView.class,idFilter);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(paramExpression.getParamMap());
  queryParams.put("String_Node_Str",paramExpression.getExpression());
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals(true,productViews.stream().allMatch(x -> x.getProductID() > 2));
}

Fixed version (ground truth):
@Test public void testGreaterThan() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.GREATER_THAN,2);
  ParamExpression paramExpression=MybatisQueryProvider.getWhereExpression(ProductView.class,idFilter);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(paramExpression.getParamMap());
  queryParams.put("String_Node_Str",paramExpression.getExpression());
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals(true,productViews.stream().allMatch(x -> x.getProductID() > 2));
}
Program: 172603
Project: 172603
Buggy source:
@Test public void testMultiSort() throws Exception {
  SortDescriptor priceSort=new SortDescriptor("String_Node_Str",SortDirection.DESC);
  SortDescriptor idSort=new SortDescriptor("String_Node_Str",SortDirection.DESC);
  Map<String,Object> queryParams=mybatisQueryProvider.getSortQueryParamMap(Product.class,"String_Node_Str",priceSort,idSort);
  northwindDao.getProductByDynamic(queryParams);
}

Fixed version (ground truth):
@Test public void testMultiSort() throws Exception {
  SortDescriptor priceSort=new SortDescriptor("String_Node_Str",SortDirection.DESC);
  SortDescriptor idSort=new SortDescriptor("String_Node_Str",SortDirection.DESC);
  Map<String,Object> queryParams=MybatisQueryProvider.getSortQueryParamMap(Product.class,"String_Node_Str",priceSort,idSort);
  northwindDao.getProductByDynamic(queryParams);
}
Program: 172604
Project: 172604
Buggy source:
@Test public void testGreaterThanOrEqual() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.GREATER_THAN_OR_EQUAL,2);
  ParamExpression paramExpression=mybatisQueryProvider.getWhereExpression(ProductView.class,idFilter);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(paramExpression.getParamMap());
  queryParams.put("String_Node_Str",paramExpression.getExpression());
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals(true,productViews.stream().allMatch(x -> x.getProductID() >= 2));
}

Fixed version (ground truth):
@Test public void testGreaterThanOrEqual() throws Exception {
  FilterDescriptor idFilter=new FilterDescriptor(FilterCondition.AND,"String_Node_Str",FilterOperator.GREATER_THAN_OR_EQUAL,2);
  ParamExpression paramExpression=MybatisQueryProvider.getWhereExpression(ProductView.class,idFilter);
  Map<String,Object> queryParams=new HashMap<>();
  queryParams.putAll(paramExpression.getParamMap());
  queryParams.put("String_Node_Str",paramExpression.getExpression());
  List<ProductView> productViews=northwindDao.getProductViewsByDynamic(queryParams);
  assertEquals(true,productViews.stream().allMatch(x -> x.getProductID() >= 2));
}
Program: 172605
Project: 172605
Buggy source:
@Test public void TestGetQueryColumn(){
  ColumnInfo result=EntityCache.getInstance().getColumnInfo(Student.class,"String_Node_Str");
  assertEquals("String_Node_Str",result.getQueryColumn());
  result=EntityCache.getInstance().getColumnInfo(Student.class,"String_Node_Str");
  assertEquals("String_Node_Str",result.getQueryColumn());
}

Fixed version (ground truth):
@Test public void TestGetQueryColumn(){
  ColumnInfo result=EntityCache.getInstance().getColumnInfo(Student.class,"String_Node_Str");
  assertEquals("String_Node_Str",result.getQueryColumn());
  result=EntityCache.getInstance().getColumnInfo(Student.class,"String_Node_Str");
  assertEquals("String_Node_Str",result.getQueryColumn());
  assertEquals("String_Node_Str",result.getTableOrAlias());
}
Program: 172606
Project: 172606
Buggy source:
public <T>FilterDescriptor(FilterCondition condition,Class<T> entityClass,Function<T,Object> getFieldFunc,FilterOperator operator,Object value){
  this.setCondition(condition);
  this.operator=operator;
  this.propertyPath=CommonsHelper.getPropertryName(entityClass,getFieldFunc);
  this.value=value;
}

Fixed version (ground truth):
public <T>FilterDescriptor(FilterCondition condition,Class<T> entityClass,Function<T,Object> getFieldFunc,FilterOperator operator,Object value){
  this.setCondition(condition);
  this.operator=operator;
  this.propertyPath=CommonsHelper.getPropertyName(entityClass,getFieldFunc);
  this.value=value;
}
Program: 172607
Project: 172607
Buggy source:
public <T>SortDescriptor(Class<T> entityClass,Function<T,Object> getFieldFunc,SortDirection sortDirection){
  this.propertyPath=CommonsHelper.getPropertryName(entityClass,getFieldFunc);
  this.sortDirection=sortDirection;
}

Fixed version (ground truth):
public <T>SortDescriptor(Class<T> entityClass,Function<T,Object> getFieldFunc,SortDirection sortDirection){
  this.propertyPath=CommonsHelper.getPropertyName(entityClass,getFieldFunc);
  this.sortDirection=sortDirection;
}
Program: 172608
Project: 172608
Buggy source:
public static <T>String obtainGetMethodName(final Class<T> target,final Function<T,Object> getMethodFunc){
  Methref<T> methodRef=Methref.on(target);
  getMethodFunc.apply(methodRef.to());
  return methodRef.ref();
}

Fixed version (ground truth):
public static synchronized <T>String obtainGetMethodName(final Class<T> target,final Function<T,Object> getMethodFunc){
  Methref<T> methodRef=Methref.on(target);
  getMethodFunc.apply(methodRef.to());
  return methodRef.ref();
}
Program: 172609
Project: 172609
Buggy source:
@Test public void testGetPropertyName(){
  String result=CommonsHelper.getPropertryName(Student.class,Student::getAge);
  assertEquals("String_Node_Str",result);
}

Fixed version (ground truth):
@Test public void testGetPropertyName(){
  String result=CommonsHelper.getPropertyName(Student.class,Student::getAge);
  assertEquals("String_Node_Str",result);
}
Program: 172610
Project: 172610
Buggy source:
@Test public void testObtainGetMethodName(){
  String result=CommonsHelper.obtainGetMethodName(Student.class,Student::getAge);
  assertEquals("String_Node_Str",result);
  result=CommonsHelper.obtainGetMethodName(Student.class,(o) -> o.getName());
  assertEquals("String_Node_Str",result);
}

Fixed version (ground truth):
@Test public void testObtainGetMethodName(){
  int[] servers=new int[]{1,2,3,4,5,6,7,8,9,10};
  Arrays.stream(servers).parallel().forEach((a) -> {
    String result=CommonsHelper.obtainGetMethodName(Student.class,Student::getAge);
    assertEquals("String_Node_Str",result);
    result=CommonsHelper.obtainGetMethodName(Student.class,(o) -> o.getName());
    assertEquals("String_Node_Str",result);
    result=CommonsHelper.obtainGetMethodName(Student.class,(o) -> o.getNote());
    assertEquals("String_Node_Str",result);
  }
);
}
Program: 172611
Project: 172611
Buggy source:
/** 
 * Add filters boolean.
 * @param newFilters the new filters
 * @return the boolean
 */
public boolean addFilters(Collection<FilterDescriptorBase> newFilters){
  if (newFilters == null) {
    return false;
  }
  return filters.addAll(newFilters);
}

Fixed version (ground truth):
/** 
 * Add filters boolean.
 * @param newFilters the new filters
 * @return the boolean
 */
public boolean addFilters(final FilterDescriptorBase... newFilters){
  return filters.addAll(Arrays.asList(newFilters));
}
Program: 172612
Project: 172612
Buggy source:
private synchronized Map<String,DbColumnInfo> getPropertyDbColumnInfoMap(Class entityClass){
  if (entityClass == null) {
    throw new NullPointerException(ParamConstants.ENTITY_CLASS);
  }
  Map<String,DbColumnInfo> propertyDbColumnMap;
  if (dbColumnInfoCacheMap.containsKey(entityClass)) {
    propertyDbColumnMap=dbColumnInfoCacheMap.get(entityClass);
  }
 else {
    Map<String,DbColumnInfo> map=new HashMap<>();
    Field[] properties=ReflectHelper.getProperties(entityClass);
    for (    Field field : properties) {
      field.setAccessible(true);
      DbColumnInfo dbColumnInfo=new DbColumnInfo();
      dbColumnInfo.setField(field);
      String pName=field.getName();
      boolean updateIfNull=EntityHelper.isPropertyUpdateIfNull(pName,properties);
      String dbColumnName=EntityHelper.getDBColumnNameByProperty(pName,properties);
      dbColumnInfo.setUpdateIfNull(updateIfNull);
      dbColumnInfo.setDbColumnName(dbColumnName);
      map.put(pName,dbColumnInfo);
    }
    dbColumnInfoCacheMap.put(entityClass,map);
    propertyDbColumnMap=map;
  }
  return propertyDbColumnMap;
}

Fixed version (ground truth):
private synchronized Map<String,DbColumnInfo> getPropertyDbColumnInfoMap(Class entityClass){
  if (entityClass == null) {
    throw new NullPointerException(ENTITY_CLASS);
  }
  Map<String,DbColumnInfo> propertyDbColumnMap;
  if (dbColumnInfoCacheMap.containsKey(entityClass)) {
    propertyDbColumnMap=dbColumnInfoCacheMap.get(entityClass);
  }
 else {
    Map<String,DbColumnInfo> map=new HashMap<>();
    Field[] properties=ReflectHelper.getProperties(entityClass);
    for (    Field field : properties) {
      field.setAccessible(true);
      DbColumnInfo dbColumnInfo=new DbColumnInfo();
      dbColumnInfo.setField(field);
      String pName=field.getName();
      boolean updateIfNull=EntityHelper.isPropertyUpdateIfNull(pName,properties);
      String dbColumnName=EntityHelper.getDBColumnNameByProperty(pName,properties);
      dbColumnInfo.setUpdateIfNull(updateIfNull);
      dbColumnInfo.setDbColumnName(dbColumnName);
      map.put(pName,dbColumnInfo);
    }
    dbColumnInfoCacheMap.put(entityClass,map);
    propertyDbColumnMap=map;
  }
  return propertyDbColumnMap;
}
Program: 172613
Project: 172613
Buggy source:
synchronized String[] getPropertyNames(final Class entityClass){
  if (entityClass == null) {
    throw new NullPointerException(ParamConstants.ENTITY_CLASS);
  }
  if (propertyNameCacheMap.containsKey(entityClass)) {
    return propertyNameCacheMap.get(entityClass);
  }
 else {
    Field[] fields=ReflectHelper.getProperties(entityClass);
    Collection<String> propertyNames=new ArrayList<>();
    for (    Field field : fields) {
      propertyNames.add(field.getName());
    }
    String[] fieldArray=propertyNames.toArray(new String[propertyNames.size()]);
    propertyNameCacheMap.put(entityClass,fieldArray);
    return fieldArray;
  }
}

Fixed version (ground truth):
synchronized String[] getPropertyNames(final Class entityClass){
  if (entityClass == null) {
    throw new NullPointerException(ENTITY_CLASS);
  }
  if (propertyNameCacheMap.containsKey(entityClass)) {
    return propertyNameCacheMap.get(entityClass);
  }
 else {
    Field[] fields=ReflectHelper.getProperties(entityClass);
    Collection<String> propertyNames=new ArrayList<>();
    for (    Field field : fields) {
      propertyNames.add(field.getName());
    }
    String[] fieldArray=propertyNames.toArray(new String[propertyNames.size()]);
    propertyNameCacheMap.put(entityClass,fieldArray);
    return fieldArray;
  }
}
Program: 172614
Project: 172614
Buggy source:
synchronized QueryColumnInfo getQueryColumnInfo(Class entityClass,String propertyName){
  if (entityClass == null) {
    throw new NullPointerException(ParamConstants.ENTITY_CLASS);
  }
  if (propertyName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Map<String,QueryColumnInfo> propertyQueryColumnMap;
  if (queryColumnInfoCacheMap.containsKey(entityClass)) {
    propertyQueryColumnMap=queryColumnInfoCacheMap.get(entityClass);
  }
 else {
    Field[] properties=ReflectHelper.getProperties(entityClass);
    Map<String,QueryColumnInfo> map=new HashMap<>();
    for (    Field p : properties) {
      String pName=p.getName();
      String queryColumn=EntityHelper.getQueryColumnByProperty(pName,properties);
      QueryColumnInfo queryColumnInfo=new QueryColumnInfo();
      queryColumnInfo.setQueryColumn(queryColumn);
      queryColumnInfo.setField(p);
      map.put(pName,queryColumnInfo);
    }
    queryColumnInfoCacheMap.put(entityClass,map);
    propertyQueryColumnMap=map;
  }
  if (!propertyQueryColumnMap.containsKey(propertyName)) {
    throw new PropertyNotFoundInternalException(String.format("String_Node_Str",propertyName));
  }
  return propertyQueryColumnMap.get(propertyName);
}

Fixed version (ground truth):
synchronized QueryColumnInfo getQueryColumnInfo(Class entityClass,String propertyName){
  if (entityClass == null) {
    throw new NullPointerException(ENTITY_CLASS);
  }
  if (propertyName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Map<String,QueryColumnInfo> propertyQueryColumnMap;
  if (queryColumnInfoCacheMap.containsKey(entityClass)) {
    propertyQueryColumnMap=queryColumnInfoCacheMap.get(entityClass);
  }
 else {
    Field[] properties=ReflectHelper.getProperties(entityClass);
    Map<String,QueryColumnInfo> map=new HashMap<>();
    for (    Field p : properties) {
      String pName=p.getName();
      String queryColumn=EntityHelper.getQueryColumnByProperty(pName,properties);
      QueryColumnInfo queryColumnInfo=new QueryColumnInfo();
      queryColumnInfo.setQueryColumn(queryColumn);
      queryColumnInfo.setField(p);
      map.put(pName,queryColumnInfo);
    }
    queryColumnInfoCacheMap.put(entityClass,map);
    propertyQueryColumnMap=map;
  }
  if (!propertyQueryColumnMap.containsKey(propertyName)) {
    throw new PropertyNotFoundInternalException(String.format("String_Node_Str",propertyName));
  }
  return propertyQueryColumnMap.get(propertyName);
}
Program: 172615
Project: 172615
Buggy source:
public ConfigurationBuilder loadConfiguration() throws Exception {
  flowMaps.clear();
  Map<String,Flow> flows=flowFileTranslator.getNodes();
  flowMaps.putAll(flows);
  Map<String,Node> externalRules=ruleSetTranslator.getNodes();
  Collection<Flow> fvalues=flowMaps.values();
  for (  Flow flow : fvalues) {
    if (flow.getNodes() == null || flow.getNodes().isEmpty()) {
      continue;
    }
    mergeRulesFromExternal(flow,externalRules);
  }
  return builder;
}

Fixed version (ground truth):
public ConfigurationBuilder loadConfiguration() throws Exception {
  flowMaps.clear();
  Map<String,Flow> flows=flowFileTranslator.getNodes();
  flowMaps.putAll(flows);
  Collection<Flow> fvalues=flowMaps.values();
  for (  Flow flow : fvalues) {
    if (flow.getNodes() == null || flow.getNodes().isEmpty()) {
      continue;
    }
    flow.nodeList2NodeMap();
    Map<String,Node> externalRules=ruleSetTranslator.getNodes();
    logger.debug("String_Node_Str" + flow.getId() + "String_Node_Str");
    mergeRulesFromExternal(flow,externalRules);
  }
  return builder;
}
Program: 172616
Project: 172616
Buggy source:
private void mergeRulesFromExternal(Flow flow,Map<String,Node> externalRules){
  Map<String,Node> flowMapNodes=flow.getNodeMap();
  Iterator<String> ite=flowMapNodes.keySet().iterator();
  while (ite.hasNext()) {
    String key=ite.next();
    Node fNode=flowMapNodes.get(key);
    if (fNode.isExternal()) {
      Node rule=externalRules.get(key);
      if (rule != null) {
        rule.setFromNodeId(fNode.getFromNodeId());
        rule.setToNodeId(fNode.getToNodeId());
        flowMapNodes.put(key,rule);
      }
    }
  }
  flow.setNodeMap(flowMapNodes);
}

Fixed version (ground truth):
private void mergeRulesFromExternal(Flow flow,Map<String,Node> externalRules){
  Map<String,Node> flowMapNodes=flow.getNodeMap();
  Iterator<String> ite=flowMapNodes.keySet().iterator();
  while (ite.hasNext()) {
    String key=ite.next();
    Node fNode=flowMapNodes.get(key);
    if (fNode.isExternal()) {
      Node rule=externalRules.get(key);
      if (rule != null) {
        rule.setFromNodeId(fNode.getFromNodeId());
        rule.setToNodeId(fNode.getToNodeId());
        flowMapNodes.put(key,rule);
      }
    }
  }
}
Program: 172617
Project: 172617
Buggy source:
private void runFlowNode(Event event,String nodeId) throws Exception {
  if (StringUtils.isBlank(nodeId)) {
    return;
  }
  Node node=getNodeById(event,nodeId);
  if (node == null) {
    return;
  }
  String nextNodeId=nodeExecutorMap.get(node.getType()).execute(event,node);
  runFlowNode(event,nextNodeId);
}

Fixed version (ground truth):
private void runFlowNode(Event event,String nodeId) throws Exception {
  if (StringUtils.isBlank(nodeId)) {
    return;
  }
  Node node=getNodeById(event,nodeId);
  if (node == null) {
    return;
  }
  String nextNodeId=nodeExecutorMap.get(node.getType()).execute(event,node);
  logger.debug("String_Node_Str" + nodeId + "String_Node_Str"+ nextNodeId+ "String_Node_Str");
  runFlowNode(event,nextNodeId);
}
Program: 172618
Project: 172618
Buggy source:
public Map<String,Node> getNodeMap(){
  for (  Node node : nodes) {
    nodeMap.put(node.getId(),node);
  }
  return nodeMap;
}

Fixed version (ground truth):
public Map<String,Node> getNodeMap(){
  return nodeMap;
}
Program: 172619
Project: 172619
Buggy source:
public String execute(Event event,Node node) throws Exception {
  Parallel parallel=(Parallel)node;
  logger.debug("String_Node_Str" + node.getId() + "String_Node_Str"+ event.getEventId()+ "String_Node_Str"+ parallel.getLines().size()+ "String_Node_Str");
  List<Line> lines=parallel.getLines();
  for (  Line line : lines) {
    if (eventListener != null) {
      eventListener.executeNewEvent(event.createNewEvent(),line.getToNodeId());
    }
  }
  return null;
}

Fixed version (ground truth):
public String execute(Event event,Node node) throws Exception {
  Parallel parallel=(Parallel)node;
  logger.debug("String_Node_Str" + node.getId() + "String_Node_Str"+ event.getEventId()+ "String_Node_Str"+ parallel.getLines().size()+ "String_Node_Str");
  List<Line> lines=parallel.getLines();
  for (  Line line : lines) {
    if (eventListener != null) {
      eventListener.addMultiEvent(event.createNewEvent(),line.getToNodeId());
    }
  }
  return null;
}
Program: 172620
Project: 172620
Buggy source:
public Map<String,Node> getNodes() throws Exception {
  Map<String,Node> ruleMaps=new HashMap<String,Node>();
  File file=null;
  if (StringUtils.isEmpty(ruleSetFolder)) {
    URL url=GeneralRuleSetExecutor.class.getClassLoader().getResource(ruleSetFolderName);
    file=new File(url.getFile());
  }
 else {
    file=new File(ruleSetFolder);
  }
  File[] rsf=file.listFiles(new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      return name.endsWith(ruleFileExtension);
    }
  }
);
  for (int i=0; i < rsf.length; i++) {
    Node node=loadRuleSetFromFile(rsf[i]);
    if (node != null) {
      ruleMaps.put(node.getId(),node);
    }
  }
  return ruleMaps;
}

Fixed version (ground truth):
public Map<String,Node> getNodes() throws Exception {
  Map<String,Node> ruleMaps=new HashMap<String,Node>();
  File file=null;
  if (StringUtils.isEmpty(ruleSetFolder)) {
    URL url=FileRuleSetTranslator.class.getClassLoader().getResource(ruleSetFolderName);
    file=new File(url.getFile());
  }
 else {
    file=new File(ruleSetFolder);
  }
  File[] rsf=file.listFiles(new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      return name.endsWith(ruleFileExtension);
    }
  }
);
  for (int i=0; i < rsf.length; i++) {
    Node node=loadRuleSetFromFile(rsf[i]);
    if (node != null) {
      ruleMaps.put(node.getId(),node);
    }
  }
  return ruleMaps;
}
Program: 172621
Project: 172621
Buggy source:
/** 
 * Flips all dimensions d0,d1,...,dn -> dn,...,d1,d0 
 */
public static <T extends RealType<T>>RandomAccessibleInterval<T> reverse(RandomAccessibleInterval<T> image){
  RandomAccessibleInterval<T> reversed=image;
  for (int d=0; d < image.numDimensions() / 2; d++) {
    reversed=Views.permute(reversed,d,image.numDimensions() - d - 1);
  }
  return reversed;
}

Fixed version (ground truth):
/** 
 * Flips all dimensions   {@code d0,d1,...,dn -> dn,...,d1,d0}. 
 */
public static <T extends RealType<T>>RandomAccessibleInterval<T> reverse(RandomAccessibleInterval<T> image){
  RandomAccessibleInterval<T> reversed=image;
  for (int d=0; d < image.numDimensions() / 2; d++) {
    reversed=Views.permute(reversed,d,image.numDimensions() - d - 1);
  }
  return reversed;
}
Program: 172622
Project: 172622
Buggy source:
/** 
 * Returns the default instance for the specified quantity type.
 * @param < Q > The type of the quantity
 * @param type the quantity type
 * @return the quantity factory for the specified type
 */
@SuppressWarnings("String_Node_Str") public static <Q extends Quantity<Q>>ProxyQuantityFactory<Q> getInstance(final Class<Q> type){
  logger.log(LOG_LEVEL,"String_Node_Str" + type + "String_Node_Str"+ type.isInterface());
  ProxyQuantityFactory<Q> factory;
  if (!type.isInterface()) {
    if (type != null && type.getInterfaces() != null & type.getInterfaces().length > 0) {
      logger.log(LOG_LEVEL,"String_Node_Str" + type.getInterfaces()[0]);
      Class<?> type2=type.getInterfaces()[0];
      factory=INSTANCES.get(type2);
      if (factory != null)       return factory;
      if (!AbstractQuantity.class.isAssignableFrom(type2))       throw new ClassCastException();
      factory=new Default<>((Class<Q>)type2);
      INSTANCES.put(type2,factory);
    }
 else {
      factory=INSTANCES.get(type);
      if (factory != null)       return factory;
      if (!AbstractQuantity.class.isAssignableFrom(type))       throw new ClassCastException();
      factory=new Default<>(type);
      INSTANCES.put(type,factory);
    }
  }
 else {
    factory=INSTANCES.get(type);
    if (factory != null)     return factory;
    if (!Quantity.class.isAssignableFrom(type))     throw new ClassCastException();
    factory=new Default<>(type);
    INSTANCES.put(type,factory);
  }
  return factory;
}

Fixed version (ground truth):
/** 
 * Returns the default instance for the specified quantity type.
 * @param < Q > The type of the quantity
 * @param type the quantity type
 * @return the quantity factory for the specified type
 */
@SuppressWarnings("String_Node_Str") public static <Q extends Quantity<Q>>ProxyQuantityFactory<Q> getInstance(final Class<Q> type){
  if (type == null) {
    throw new NullPointerException();
  }
  logger.log(LOG_LEVEL,"String_Node_Str" + type + "String_Node_Str"+ type.isInterface());
  if (!type.isInterface() && type.getInterfaces().length > 0) {
    logger.log(LOG_LEVEL,"String_Node_Str" + type.getInterfaces()[0]);
    Class<?> type2=findQuantityAssignableInterface(type);
    return returnOrCreateFactoryForQuantityAssignableType((Class<Q>)type2);
  }
 else {
    return returnOrCreateFactoryForQuantityAssignableType(type);
  }
}
Program: 172623
Project: 172623
Buggy source:
/** 
 * Overrides the default implementation of the factory for the specified quantity type.
 * @param < Q > The type of the quantity
 * @param type the quantity type
 * @param factory the quantity factory
 */
protected static <Q extends Quantity<Q>>void setInstance(final Class<Q> type,ProxyQuantityFactory<Q> factory){
  if (!AbstractQuantity.class.isAssignableFrom(type))   throw new ClassCastException();
  INSTANCES.put(type,factory);
}

Fixed version (ground truth):
/** 
 * Overrides the default implementation of the factory for the specified quantity type.
 * @param < Q > The type of the quantity
 * @param type the quantity type
 * @param factory the quantity factory
 */
protected static <Q extends Quantity<Q>>void setInstance(final Class<Q> type,ProxyQuantityFactory<Q> factory){
  throwClassCastExceptionIfNotQuantityAssignable(type);
  INSTANCES.put(type,factory);
}
Program: 172624
Project: 172624
Buggy source:
private void drawBackground(Canvas canvas,double shipBobSin){
  Rect dst=new Rect(0,(int)(shipBobSin * 10),mWidth,mHeight);
  canvas.drawBitmap(bgsScaled[0],null,dst,null);
}

Fixed version (ground truth):
private void drawBackground(Canvas canvas,double shipBobSin){
  canvas.drawBitmap(bgsScaled[0],0,(int)(shipBobSin * 10),null);
}
Program: 172626
Project: 172626
Buggy source:
@Override public void surfaceCreated(SurfaceHolder surfaceHolder){
  mThread=new RunThread(surfaceHolder);
  mThread.start();
}

Fixed version (ground truth):
@Override public void surfaceCreated(SurfaceHolder surfaceHolder){
}
Program: 172627
Project: 172627
Buggy source:
@Override public void surfaceChanged(SurfaceHolder surfaceHolder,final int format,final int width,final int height){
  mWidth=width;
  mHeight=height;
  for (int b=0; b < bgs.length; b++) {
    int bgw=bgs[b].getWidth();
    int bgh=bgs[b].getHeight();
    int bgw2=(int)(bgw / (double)bgh * mHeight);
    Rect src=new Rect(bgw > mWidth ? Utils.getRand(bgw - mWidth - 1) : 0,0,bgw,bgh);
    Rect dest=new Rect(0,0,bgw2,mHeight);
    bgsScaled[b]=Bitmap.createBitmap(mWidth,mHeight,Bitmap.Config.ARGB_8888);
    Canvas c=new Canvas(bgsScaled[b]);
    c.drawBitmap(bgs[b],src,dest,null);
  }
  for (int b=0; b < fgtops.length; b++) {
    int bgw=fgtops[b].getWidth();
    int bgh=fgtops[b].getHeight();
    int bgh2=(int)(bgh / (double)bgw * mWidth);
    Rect src=new Rect(0,0,bgw,bgh);
    Rect dest=new Rect(0,0,mWidth,bgh2);
    fgtopsScaled[b]=Bitmap.createBitmap(mWidth,bgh2,Bitmap.Config.ARGB_8888);
    Canvas c=new Canvas(fgtopsScaled[b]);
    c.drawBitmap(fgtops[b],src,dest,null);
  }
  for (int b=0; b < fgbottoms.length; b++) {
    int bgw=fgbottoms[b].getWidth();
    int bgh=fgbottoms[b].getHeight();
    int bgh2=(int)(bgh / (double)bgw * mWidth);
    Rect src=new Rect(0,0,bgw,bgh);
    Rect dest=new Rect(0,0,mWidth,bgh2);
    fgbottomsScaled[b]=Bitmap.createBitmap(mWidth,bgh2,Bitmap.Config.ARGB_8888);
    Canvas c=new Canvas(fgbottomsScaled[b]);
    c.drawBitmap(fgbottoms[b],src,dest,null);
  }
  Log.d("String_Node_Str",mWidth + "String_Node_Str" + mHeight);
}

Fixed version (ground truth):
@Override public void surfaceChanged(SurfaceHolder surfaceHolder,final int format,final int width,final int height){
  mWidth=width;
  mHeight=height;
  for (int b=0; b < bgs.length; b++) {
    int bgw=bgs[b].getWidth();
    int bgh=bgs[b].getHeight();
    int bgw2=(int)(bgw / (double)bgh * mHeight);
    Rect src=new Rect(bgw > mWidth ? Utils.getRand(bgw - mWidth - 1) : 0,0,bgw,bgh);
    Rect dest=new Rect(0,0,bgw2,mHeight);
    bgsScaled[b]=Bitmap.createBitmap(mWidth,mHeight,Bitmap.Config.ARGB_8888);
    Canvas c=new Canvas(bgsScaled[b]);
    c.drawBitmap(bgs[b],src,dest,null);
  }
  for (int b=0; b < fgtops.length; b++) {
    int bgw=fgtops[b].getWidth();
    int bgh=fgtops[b].getHeight();
    int bgh2=(int)(bgh / (double)bgw * mWidth);
    Rect src=new Rect(0,0,bgw,bgh);
    Rect dest=new Rect(0,0,mWidth,bgh2);
    fgtopsScaled[b]=Bitmap.createBitmap(mWidth,bgh2,Bitmap.Config.ARGB_8888);
    Canvas c=new Canvas(fgtopsScaled[b]);
    c.drawBitmap(fgtops[b],src,dest,null);
  }
  for (int b=0; b < fgbottoms.length; b++) {
    int bgw=fgbottoms[b].getWidth();
    int bgh=fgbottoms[b].getHeight();
    int bgh2=(int)(bgh / (double)bgw * mWidth);
    Rect src=new Rect(0,0,bgw,bgh);
    Rect dest=new Rect(0,0,mWidth,bgh2);
    fgbottomsScaled[b]=Bitmap.createBitmap(mWidth,bgh2,Bitmap.Config.ARGB_8888);
    Canvas c=new Canvas(fgbottomsScaled[b]);
    c.drawBitmap(fgbottoms[b],src,dest,null);
  }
  Log.d("String_Node_Str",mWidth + "String_Node_Str" + mHeight);
  mThread=new RunThread(surfaceHolder);
  mThread.start();
}
Program: 172628
Project: 172628
Buggy source:
@Override public void surfaceDestroyed(SurfaceHolder surfaceHolder){
  mThread.stopRunning();
  mThread=null;
}

Fixed version (ground truth):
@Override public void surfaceDestroyed(SurfaceHolder surfaceHolder){
  if (mThread != null && mThread.isRunning()) {
    mThread.stopRunning();
  }
  mThread=null;
}
Program: 172629
Project: 172629
Buggy source:
public static boolean checkIdExists(String id){
  boolean check=false;
  id=AES256.encrypt(id);
  try {
    ResultSet rs=DB.executeQuery("String_Node_Str",id,"String_Node_Str");
    if (rs.getInt(1) == 1) {
      check=true;
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
  return check;
}

Fixed version (ground truth):
public static boolean checkIdExists(String id){
  boolean check=false;
  id=AES256.encrypt(id);
  try {
    ResultSet rs=DB.executeQuery("String_Node_Str",id);
    rs.next();
    if (rs.getInt(1) == 1) {
      check=true;
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
  return check;
}
Program: 172630
Project: 172630
Buggy source:
public void handle(RoutingContext context){
  String htmlName="String_Node_Str";
  if (userManager.isLogined(context)) {
    htmlName="String_Node_Str";
  }
  DmsTemplate templates=new DmsTemplate(htmlName);
  try {
    context.response().setStatusCode(200);
    context.response().end(templates.process());
    context.response().close();
  }
 catch (  TemplateException e) {
    Log.l("String_Node_Str");
  }
catch (  IOException e) {
    Log.l("String_Node_Str");
  }
}

Fixed version (ground truth):
public void handle(RoutingContext context){
  String htmlName="String_Node_Str";
  if (UserManager.isLogined(context)) {
    htmlName="String_Node_Str";
  }
  DmsTemplate templates=new DmsTemplate(htmlName);
  try {
    context.response().setStatusCode(200);
    context.response().end(templates.process());
    context.response().close();
  }
 catch (  TemplateException e) {
    Log.l("String_Node_Str");
  }
catch (  IOException e) {
    Log.l("String_Node_Str");
  }
}