nus-yam/ex-repair huggingface dataset:
Program: 28305
Project: 28305
Buggy source:
/** 
 * 水平翻转图像
 * @return this
 */
public Img flip(){
  final BufferedImage image=this.srcImage;
  int width=image.getWidth();
  int height=image.getHeight();
  int type=ImageUtil.toBufferedImage(image).getTransparency();
  final BufferedImage destImg=new BufferedImage(width,height,type);
  Graphics2D graphics2d=destImg.createGraphics();
  graphics2d.drawImage(image,0,0,width,height,width,0,0,height,null);
  graphics2d.dispose();
  this.destImage=destImg;
  return this;
}

Fixed version (ground truth):
/** 
 * 水平翻转图像
 * @return this
 */
public Img flip(){
  final BufferedImage image=this.srcImage;
  int width=image.getWidth();
  int height=image.getHeight();
  final BufferedImage destImg=new BufferedImage(width,height,getTypeInt());
  Graphics2D graphics2d=destImg.createGraphics();
  graphics2d.drawImage(image,0,0,width,height,width,0,0,height,null);
  graphics2d.dispose();
  this.destImage=destImg;
  return this;
}
Program: 28306
Project: 28306
Buggy source:
/** 
 * 将元素值设置为数组的某个位置，当给定的index大于数组长度，则追加
 * @param array 已有数组
 * @param newElements 新元素
 * @return 新数组或原有数组
 * @since 4.1.2
 */
public static Object setOrAppend(Object array,int index,Object value){
  if (index < length(array)) {
    Array.set(array,index,value);
    return array;
  }
 else {
    return append(array,value);
  }
}

Fixed version (ground truth):
/** 
 * 将元素值设置为数组的某个位置，当给定的index大于数组长度，则追加
 * @param array 已有数组
 * @param index 位置，大于长度追加，否则替换
 * @param value 新值
 * @return 新数组或原有数组
 * @since 4.1.2
 */
public static Object setOrAppend(Object array,int index,Object value){
  if (index < length(array)) {
    Array.set(array,index,value);
    return array;
  }
 else {
    return append(array,value);
  }
}
Program: 28307
Project: 28307
Buggy source:
/** 
 * 从URL对象中获取不被编码的路径Path<br> 对于本地路径，URL对象的getPath方法对于包含中文或空格时会被编码，导致本读路径读取错误。<br> 此方法将URL转为URI后获取路径用于解决路径被编码的问题
 * @param url {@link URL}
 * @return 路径
 * @since 3.0.8
 */
public static String getDecodedPath(URL url){
  if (null == url) {
    return null;
  }
  URI uri=null;
  try {
    uri=toURI(url);
  }
 catch (  UtilException e) {
  }
  return (null != uri) ? uri.getPath() : url.getPath();
}

Fixed version (ground truth):
/** 
 * 从URL对象中获取不被编码的路径Path<br> 对于本地路径，URL对象的getPath方法对于包含中文或空格时会被编码，导致本读路径读取错误。<br> 此方法将URL转为URI后获取路径用于解决路径被编码的问题
 * @param url {@link URL}
 * @return 路径
 * @since 3.0.8
 */
public static String getDecodedPath(URL url){
  if (null == url) {
    return null;
  }
  String path=null;
  try {
    path=URLUtil.toURI(url).getPath();
  }
 catch (  UtilException e) {
  }
  return (null != path) ? path : url.getPath();
}
Program: 28308
Project: 28308
Buggy source:
@Test public void getAbsolutePathTest(){
  String absolutePath=FileUtil.getAbsolutePath("String_Node_Str");
  String absolutePath2=FileUtil.getAbsolutePath(absolutePath);
  Assert.assertNotNull(absolutePath2);
  Assert.assertEquals(absolutePath,absolutePath2);
}

Fixed version (ground truth):
@Test public void getAbsolutePathTest(){
  String absolutePath=FileUtil.getAbsolutePath("String_Node_Str");
  Assert.assertNotNull(absolutePath);
  String absolutePath2=FileUtil.getAbsolutePath(absolutePath);
  Assert.assertNotNull(absolutePath2);
  Assert.assertEquals(absolutePath,absolutePath2);
}
Program: 28309
Project: 28309
Buggy source:
/** 
 * 获取数字类型值
 * @param value 值
 * @param numFmtString 格式
 * @return 数字，可以是Double、Long
 * @since 4.1.0
 */
private static Number getNumberValue(String value,String numFmtString){
  double numValue=Double.parseDouble(value);
  if (null != numFmtString && numFmtString.indexOf(StrUtil.C_DOT) < 0) {
    final long longPart=(long)numValue;
    if (longPart == numValue) {
      return longPart;
    }
  }
  return numValue;
}

Fixed version (ground truth):
/** 
 * 获取数字类型值
 * @param value 值
 * @param numFmtString 格式
 * @return 数字，可以是Double、Long
 * @since 4.1.0
 */
private static Number getNumberValue(String value,String numFmtString){
  if (StrUtil.isBlank(value)) {
    return null;
  }
  double numValue=Double.parseDouble(value);
  if (null != numFmtString && numFmtString.indexOf(StrUtil.C_DOT) < 0) {
    final long longPart=(long)numValue;
    if (longPart == numValue) {
      return longPart;
    }
  }
  return numValue;
}
Program: 28310
Project: 28310
Buggy source:
/** 
 * 将可序列化的对象转换为XML写入文件，已经存在的文件将被覆盖<br> Writes serializable object to a XML file. Existing file will be overwritten
 * @param < T > 对象类型
 * @param dest 目标文件
 * @param t 对象
 * @throws IOException IO异常
 */
public static <T>void writeObjectAsXml(File dest,T t) throws IOException {
  XMLEncoder xmlenc=null;
  try {
    xmlenc=new XMLEncoder(FileUtil.getOutputStream(dest));
    xmlenc.writeObject(t);
  }
  finally {
    IoUtil.close(xmlenc);
  }
}

Fixed version (ground truth):
/** 
 * 将可序列化的对象转换为XML写入文件，已经存在的文件将被覆盖<br> Writes serializable object to a XML file. Existing file will be overwritten
 * @param dest 目标文件
 * @param bean 对象
 * @throws IOException IO异常
 */
public static void writeObjectAsXml(File dest,Object bean) throws IOException {
  XMLEncoder xmlenc=null;
  try {
    xmlenc=new XMLEncoder(FileUtil.getOutputStream(dest));
    xmlenc.writeObject(bean);
  }
  finally {
    IoUtil.close(xmlenc);
  }
}
Program: 28311
Project: 28311
Buggy source:
/** 
 * 格式化日期间隔输出<br>
 * @return 格式化后的字符串
 */
public String format(){
  final StringBuilder sb=new StringBuilder();
  if (betweenMs > 0) {
    long day=betweenMs / DateUnit.DAY.getMillis();
    long hour=betweenMs / DateUnit.HOUR.getMillis() - day * 24;
    long minute=betweenMs / DateUnit.MINUTE.getMillis() - day * 24 * 60 - hour * 60;
    long second=betweenMs / DateUnit.SECOND.getMillis() - ((day * 24 + hour) * 60 + minute) * 60;
    long millisecond=betweenMs - (((day * 24 + hour) * 60 + minute) * 60 + second) * 1000;
    final int level=this.level.ordinal();
    int levelCount=0;
    if (isLevelCountValid(levelCount) && 0 != day && level >= Level.DAY.ordinal()) {
      sb.append(day).append(Level.DAY.name);
      levelCount++;
    }
    if (isLevelCountValid(levelCount) && 0 != hour && level >= Level.HOUR.ordinal()) {
      sb.append(hour).append(Level.HOUR.name);
      levelCount++;
    }
    if (isLevelCountValid(levelCount) && 0 != minute && level >= Level.SECOND.ordinal()) {
      sb.append(minute).append(Level.SECOND.name);
      levelCount++;
    }
    if (isLevelCountValid(levelCount) && 0 != second && level >= Level.MINUTE.ordinal()) {
      sb.append(second).append(Level.MINUTE.name);
      levelCount++;
    }
    if (isLevelCountValid(levelCount) && 0 != millisecond && level >= Level.MILLSECOND.ordinal()) {
      sb.append(millisecond).append(Level.MILLSECOND.name);
      levelCount++;
    }
  }
  if (StrUtil.isEmpty(sb)) {
    sb.append(0).append(this.level.name);
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * 格式化日期间隔输出<br>
 * @return 格式化后的字符串
 */
public String format(){
  final StringBuilder sb=new StringBuilder();
  if (betweenMs > 0) {
    long day=betweenMs / DateUnit.DAY.getMillis();
    long hour=betweenMs / DateUnit.HOUR.getMillis() - day * 24;
    long minute=betweenMs / DateUnit.MINUTE.getMillis() - day * 24 * 60 - hour * 60;
    long second=betweenMs / DateUnit.SECOND.getMillis() - ((day * 24 + hour) * 60 + minute) * 60;
    long millisecond=betweenMs - (((day * 24 + hour) * 60 + minute) * 60 + second) * 1000;
    final int level=this.level.ordinal();
    int levelCount=0;
    if (isLevelCountValid(levelCount) && 0 != day && level >= Level.DAY.ordinal()) {
      sb.append(day).append(Level.DAY.name);
      levelCount++;
    }
    if (isLevelCountValid(levelCount) && 0 != hour && level >= Level.HOUR.ordinal()) {
      sb.append(hour).append(Level.HOUR.name);
      levelCount++;
    }
    if (isLevelCountValid(levelCount) && 0 != minute && level >= Level.MINUTE.ordinal()) {
      sb.append(minute).append(Level.MINUTE.name);
      levelCount++;
    }
    if (isLevelCountValid(levelCount) && 0 != second && level >= Level.SECOND.ordinal()) {
      sb.append(second).append(Level.SECOND.name);
      levelCount++;
    }
    if (isLevelCountValid(levelCount) && 0 != millisecond && level >= Level.MILLSECOND.ordinal()) {
      sb.append(millisecond).append(Level.MILLSECOND.name);
      levelCount++;
    }
  }
  if (StrUtil.isEmpty(sb)) {
    sb.append(0).append(this.level.name);
  }
  return sb.toString();
}
Program: 28312
Project: 28312
Buggy source:
@Test public void betweenTest(){
  String dateStr1="String_Node_Str";
  Date date1=DateUtil.parse(dateStr1);
  String dateStr2="String_Node_Str";
  Date date2=DateUtil.parse(dateStr2);
  long betweenMonth=DateUtil.betweenMonth(date1,date2,false);
  Assert.assertEquals(1,betweenMonth);
  betweenMonth=DateUtil.betweenMonth(date2,date1,false);
  Assert.assertEquals(1,betweenMonth);
  long betweenDay=DateUtil.between(date1,date2,DateUnit.DAY);
  Assert.assertEquals(31,betweenDay);
  betweenDay=DateUtil.between(date2,date1,DateUnit.DAY);
  Assert.assertEquals(31,betweenDay);
  long between=DateUtil.between(date1,date2,DateUnit.MS);
  String formatBetween=DateUtil.formatBetween(between,Level.MINUTE);
  Assert.assertEquals("String_Node_Str",formatBetween);
}

Fixed version (ground truth):
@Test public void betweenTest(){
  String dateStr1="String_Node_Str";
  Date date1=DateUtil.parse(dateStr1);
  String dateStr2="String_Node_Str";
  Date date2=DateUtil.parse(dateStr2);
  long betweenMonth=DateUtil.betweenMonth(date1,date2,false);
  Assert.assertEquals(1,betweenMonth);
  betweenMonth=DateUtil.betweenMonth(date2,date1,false);
  Assert.assertEquals(1,betweenMonth);
  long betweenDay=DateUtil.between(date1,date2,DateUnit.DAY);
  Assert.assertEquals(31,betweenDay);
  betweenDay=DateUtil.between(date2,date1,DateUnit.DAY);
  Assert.assertEquals(31,betweenDay);
  long betweenHour=DateUtil.between(date1,date2,DateUnit.HOUR);
  Assert.assertEquals(745,betweenHour);
  betweenHour=DateUtil.between(date2,date1,DateUnit.HOUR);
  Assert.assertEquals(745,betweenHour);
  long betweenMinute=DateUtil.between(date1,date2,DateUnit.MINUTE);
  Assert.assertEquals(44721,betweenMinute);
  betweenMinute=DateUtil.between(date2,date1,DateUnit.MINUTE);
  Assert.assertEquals(44721,betweenMinute);
  long betweenSecond=DateUtil.between(date1,date2,DateUnit.SECOND);
  Assert.assertEquals(2683311,betweenSecond);
  betweenSecond=DateUtil.between(date2,date1,DateUnit.SECOND);
  Assert.assertEquals(2683311,betweenSecond);
  long betweenMS=DateUtil.between(date1,date2,DateUnit.MS);
  Assert.assertEquals(2683311000L,betweenMS);
  betweenMS=DateUtil.between(date2,date1,DateUnit.MS);
  Assert.assertEquals(2683311000L,betweenMS);
}
Program: 28313
Project: 28313
Buggy source:
/** 
 * 从Content-Disposition头中获取文件名
 * @return 文件名，empty表示无
 */
private String getFileNameFromDisposition(){
  String fileName=header(Header.CONTENT_DISPOSITION);
  if (StrUtil.isNotBlank(fileName)) {
    fileName=StrUtil.subAfter(fileName,"String_Node_Str",true);
  }
  return fileName;
}

Fixed version (ground truth):
/** 
 * 从Content-Disposition头中获取文件名
 * @return 文件名，empty表示无
 */
private String getFileNameFromDisposition(){
  String fileName=null;
  final String desposition=header(Header.CONTENT_DISPOSITION);
  if (StrUtil.isNotBlank(desposition)) {
    fileName=ReUtil.get("String_Node_Str",desposition,1);
    if (StrUtil.isBlank(fileName)) {
      fileName=StrUtil.subAfter(desposition,"String_Node_Str",true);
    }
  }
  return fileName;
}
Program: 28314
Project: 28314
Buggy source:
/** 
 * 计算组合数，即C(n, m) = n!/((n-m)! * m!)
 * @param n 总数
 * @param m 选择的个数
 * @return 组合数
 */
public static long count(int n,int m){
  if (n == m) {
    return NumberUtil.factorial(n) / NumberUtil.factorial(m);
  }
  return (n > m) ? NumberUtil.factorial(n) / NumberUtil.factorial(n - m) / NumberUtil.factorial(m) : 0;
}

Fixed version (ground truth):
/** 
 * 计算组合数，即C(n, m) = n!/((n-m)! * m!)
 * @param n 总数
 * @param m 选择的个数
 * @return 组合数
 */
public static long count(int n,int m){
  if (0 == m) {
    return 1;
  }
  if (n == m) {
    return NumberUtil.factorial(n) / NumberUtil.factorial(m);
  }
  return (n > m) ? NumberUtil.factorial(n) / NumberUtil.factorial(n - m) / NumberUtil.factorial(m) : 0;
}
Program: 28315
Project: 28315
Buggy source:
@Test public void selectTest(){
  Arrangement arrangement=new Arrangement(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"});
  List<String[]> list=arrangement.select(2);
  Assert.assertEquals(Arrangement.count(4,2),list.size());
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(0));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(1));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(2));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(3));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(4));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(5));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(6));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(7));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(8));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(9));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(10));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(11));
  List<String[]> selectAll=arrangement.selectAll();
  Assert.assertEquals(Arrangement.countAll(4),selectAll.size());
}

Fixed version (ground truth):
@Test public void selectTest(){
  Arrangement arrangement=new Arrangement(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"});
  List<String[]> list=arrangement.select(2);
  Assert.assertEquals(Arrangement.count(4,2),list.size());
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(0));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(1));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(2));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(3));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(4));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(5));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(6));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(7));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(8));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(9));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(10));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(11));
  List<String[]> selectAll=arrangement.selectAll();
  Assert.assertEquals(Arrangement.countAll(4),selectAll.size());
  List<String[]> list2=arrangement.select(0);
  Assert.assertTrue(1 == list2.size());
}
Program: 28316
Project: 28316
Buggy source:
@Test public void arrangementTest(){
  long result=Arrangement.count(4,2);
  Assert.assertEquals(12,result);
  long resultAll=Arrangement.countAll(4);
  Assert.assertEquals(64,resultAll);
}

Fixed version (ground truth):
@Test public void arrangementTest(){
  long result=Arrangement.count(4,2);
  Assert.assertEquals(12,result);
  result=Arrangement.count(4,1);
  Assert.assertEquals(4,result);
  result=Arrangement.count(4,0);
  Assert.assertEquals(1,result);
  long resultAll=Arrangement.countAll(4);
  Assert.assertEquals(64,resultAll);
}
Program: 28317
Project: 28317
Buggy source:
@Test public void countTest(){
  long result=Combination.count(5,2);
  Assert.assertEquals(10,result);
  result=Combination.count(5,5);
  Assert.assertEquals(1,result);
  long resultAll=Combination.countAll(5);
  Assert.assertEquals(31,resultAll);
}

Fixed version (ground truth):
@Test public void countTest(){
  long result=Combination.count(5,2);
  Assert.assertEquals(10,result);
  result=Combination.count(5,5);
  Assert.assertEquals(1,result);
  result=Combination.count(5,0);
  Assert.assertEquals(1,result);
  long resultAll=Combination.countAll(5);
  Assert.assertEquals(31,resultAll);
}
Program: 28318
Project: 28318
Buggy source:
@Test public void selectTest(){
  Combination combination=new Combination(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"});
  List<String[]> list=combination.select(2);
  Assert.assertEquals(Combination.count(5,2),list.size());
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(0));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(1));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(2));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(3));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(4));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(5));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(6));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(7));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(8));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(9));
  List<String[]> selectAll=combination.selectAll();
  Assert.assertEquals(Combination.countAll(5),selectAll.size());
}

Fixed version (ground truth):
@Test public void selectTest(){
  Combination combination=new Combination(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"});
  List<String[]> list=combination.select(2);
  Assert.assertEquals(Combination.count(5,2),list.size());
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(0));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(1));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(2));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(3));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(4));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(5));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(6));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(7));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(8));
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str"},list.get(9));
  List<String[]> selectAll=combination.selectAll();
  Assert.assertEquals(Combination.countAll(5),selectAll.size());
  List<String[]> list2=combination.select(0);
  Assert.assertTrue(1 == list2.size());
}
Program: 28319
Project: 28319
Buggy source:
/** 
 * 全排列
 * @return 全排列结果
 */
public List<String[]> selectAll(){
  final List<String[]> result=new ArrayList<>((int)countAll(this.datas.length));
  for (int i=1; i <= this.datas.length; i++) {
    result.addAll(select(i));
  }
  return result;
}

Fixed version (ground truth):
/** 
 * 排列所有组合，即A(n, 1) + A(n, 2) + A(n, 3)...
 * @return 全排列结果
 */
public List<String[]> selectAll(){
  final List<String[]> result=new ArrayList<>((int)countAll(this.datas.length));
  for (int i=1; i <= this.datas.length; i++) {
    result.addAll(select(i));
  }
  return result;
}
Program: 28320
Project: 28320
Buggy source:
/** 
 * 计算排列数，即A(n, m) = n!/(n-m)!
 * @param n 总数
 * @param m 选择的个数
 * @return 排列数
 */
public static long arrangementCount(int n,int m){
  return Arrangement.count(n,m);
}

Fixed version (ground truth):
/** 
 * 计算排列数，即A(n, n) = n!
 * @param n 总数
 * @return 排列数
 */
public static long arrangementCount(int n){
  return Arrangement.count(n);
}
Program: 28321
Project: 28321
Buggy source:
/** 
 * 组合选择（从列表中选择n个组合）
 * @param datas 待选列表
 * @param m 选择个数
 */
public static List<String[]> combinationSelect(String[] datas,int m){
  return new Combination(datas).select(m);
}

Fixed version (ground truth):
/** 
 * 组合选择（从列表中选择n个组合）
 * @param datas 待选列表
 * @param m 选择个数
 * @return 所有组合列表
 */
public static List<String[]> combinationSelect(String[] datas,int m){
  return new Combination(datas).select(m);
}
Program: 28322
Project: 28322
Buggy source:
/** 
 * 排列选择（从列表中选择n个排列）
 * @param datas 待选列表
 * @param m 选择个数
 */
public static List<String[]> arrangementSelect(String[] datas,int m){
  return new Arrangement(datas).select(m);
}

Fixed version (ground truth):
/** 
 * 全排列选择（列表全部参与排列）
 * @param datas 待选列表
 * @return 所有排列列表
 */
public static List<String[]> arrangementSelect(String[] datas){
  return new Arrangement(datas).select();
}
Program: 28323
Project: 28323
Buggy source:
/** 
 * 金额转为中文形式
 * @param n 数字
 * @return 中文大写数字
 * @since 3.2.3
 */
public static String digitToChinese(Number n){
  return DigitChineseFormater.format(n);
}

Fixed version (ground truth):
/** 
 * 金额转为中文形式
 * @param n 数字
 * @return 中文大写数字
 * @since 3.2.3
 */
public static String digitToChinese(Number n){
  if (null == n) {
    return "String_Node_Str";
  }
  return NumberChineseFormater.format(n.doubleValue(),true,true);
}
Program: 28325
Project: 28325
Buggy source:
/** 
 * 把一个 0~9999 之间的整数转换为汉字的字符串，如果是 0 则返回 ""
 * @param amountPart 数字部分
 * @param numArray 字典
 * @return 转换后的汉字
 */
private static String toChinese(int amountPart,String[] numArray){
  if (amountPart < 0 || amountPart > 10000) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String[] units=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  int temp=amountPart;
  String amountStr=new Integer(amountPart).toString();
  int amountStrLength=amountStr.length();
  boolean lastIsZero=true;
  String chineseStr="String_Node_Str";
  for (int i=0; i < amountStrLength; i++) {
    if (temp == 0)     break;
    int digit=temp % 10;
    if (digit == 0) {
      if (!lastIsZero)       chineseStr="String_Node_Str" + chineseStr;
      lastIsZero=true;
    }
 else {
      chineseStr=numArray[digit] + units[i] + chineseStr;
      lastIsZero=false;
    }
    temp=temp / 10;
  }
  return chineseStr;
}

Fixed version (ground truth):
/** 
 * 把一个 0~9999 之间的整数转换为汉字的字符串，如果是 0 则返回 ""
 * @param amountPart 数字部分
 * @param isUseTraditional 是否使用繁体单位
 * @return 转换后的汉字
 */
private static String toChinese(int amountPart,boolean isUseTraditional){
  String[] numArray=isUseTraditional ? traditionalDigits : simpleDigits;
  String[] units=isUseTraditional ? traditionalUnits : simpleUnits;
  int temp=amountPart;
  String chineseStr="String_Node_Str";
  boolean lastIsZero=true;
  for (int i=0; temp > 0; i++) {
    if (temp == 0) {
      break;
    }
    int digit=temp % 10;
    if (digit == 0) {
      if (false == lastIsZero) {
        chineseStr="String_Node_Str" + chineseStr;
      }
      lastIsZero=true;
    }
 else {
      chineseStr=numArray[digit] + units[i] + chineseStr;
      lastIsZero=false;
    }
    temp=temp / 10;
  }
  return chineseStr;
}
Program: 28326
Project: 28326
Buggy source:
/** 
 * 解码Base64
 * @param in 输入
 * @param pos 开始位置
 * @param length 长度
 * @return 解码后的bytes
 */
public static byte[] decode(byte[] in,int pos,int length){
  final IntWrapper offset=new IntWrapper(pos);
  byte sestet0;
  byte sestet1;
  byte sestet2;
  byte sestet3;
  int maxPos=pos + length - 1;
  int octetId=0;
  byte[] octet=new byte[length * 3 / 4];
  while (offset.value <= maxPos) {
    sestet0=getNextValidDecodeByte(in,offset,maxPos);
    sestet1=getNextValidDecodeByte(in,offset,maxPos);
    sestet2=getNextValidDecodeByte(in,offset,maxPos);
    sestet3=getNextValidDecodeByte(in,offset,maxPos);
    if (PADDING != sestet1) {
      octet[octetId++]=(byte)((sestet0 << 2) | (sestet1 >>> 4));
    }
    if (PADDING != sestet2) {
      octet[octetId++]=(byte)(((sestet1 & 0xf) << 4) | (sestet2 >>> 2));
    }
    if (PADDING != sestet3) {
      octet[octetId++]=(byte)(((sestet2 & 3) << 6) | sestet3);
    }
  }
  if (octetId == octet.length) {
    return octet;
  }
 else {
    return (byte[])ArrayUtil.copy(octet,new byte[octetId],octetId);
  }
}

Fixed version (ground truth):
/** 
 * 解码Base64
 * @param in 输入
 * @param pos 开始位置
 * @param length 长度
 * @return 解码后的bytes
 */
public static byte[] decode(byte[] in,int pos,int length){
  if (ArrayUtil.isEmpty(in)) {
    return in;
  }
  final IntWrapper offset=new IntWrapper(pos);
  byte sestet0;
  byte sestet1;
  byte sestet2;
  byte sestet3;
  int maxPos=pos + length - 1;
  int octetId=0;
  byte[] octet=new byte[length * 3 / 4];
  while (offset.value <= maxPos) {
    sestet0=getNextValidDecodeByte(in,offset,maxPos);
    sestet1=getNextValidDecodeByte(in,offset,maxPos);
    sestet2=getNextValidDecodeByte(in,offset,maxPos);
    sestet3=getNextValidDecodeByte(in,offset,maxPos);
    if (PADDING != sestet1) {
      octet[octetId++]=(byte)((sestet0 << 2) | (sestet1 >>> 4));
    }
    if (PADDING != sestet2) {
      octet[octetId++]=(byte)(((sestet1 & 0xf) << 4) | (sestet2 >>> 2));
    }
    if (PADDING != sestet3) {
      octet[octetId++]=(byte)(((sestet2 & 3) << 6) | sestet3);
    }
  }
  if (octetId == octet.length) {
    return octet;
  }
 else {
    return (byte[])ArrayUtil.copy(octet,new byte[octetId],octetId);
  }
}
Program: 28327
Project: 28327
Buggy source:
/** 
 * Map转Map
 * @param srcMap 源Map
 * @param targetMap 目标Map
 */
private void convertMapToMap(Map<?,?> srcMap,Map<Object,Object> targetMap){
  final ConverterRegistry convert=ConverterRegistry.getInstance();
  for (  Entry<?,?> entry : srcMap.entrySet()) {
    targetMap.put(convert.convert(this.keyType,entry.getKey()),convert.convert(this.valueType,entry.getValue()));
  }
}

Fixed version (ground truth):
/** 
 * Map转Map
 * @param srcMap 源Map
 * @param targetMap 目标Map
 */
private void convertMapToMap(Map<?,?> srcMap,Map<Object,Object> targetMap){
  final ConverterRegistry convert=ConverterRegistry.getInstance();
  Object key;
  Object value;
  for (  Entry<?,?> entry : srcMap.entrySet()) {
    key=(null == this.keyType) ? entry.getKey() : convert.convert(this.keyType,entry.getKey());
    value=(null == this.valueType) ? entry.getValue() : convert.convert(this.keyType,entry.getValue());
    targetMap.put(key,value);
  }
}
Program: 28328
Project: 28328
Buggy source:
@Override @SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected Map<?,?> convertInternal(Object value){
  Map map=MapUtil.createMap(TypeUtil.getClass(this.mapType));
  Class<?> valueType=value.getClass();
  if (value instanceof Map) {
    convertMapToMap((Map)value,map);
  }
 else   if (BeanUtil.isBean(valueType)) {
    map=BeanUtil.beanToMap(value);
  }
 else {
    throw new UnsupportedOperationException(StrUtil.format("String_Node_Str",valueType.getName()));
  }
  return map;
}

Fixed version (ground truth):
@Override @SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected Map<?,?> convertInternal(Object value){
  Map map=null;
  if (value instanceof Map) {
    map=MapUtil.createMap(TypeUtil.getClass(this.mapType));
    convertMapToMap((Map)value,map);
  }
 else   if (BeanUtil.isBean(value.getClass())) {
    map=BeanUtil.beanToMap(value);
  }
 else {
    throw new UnsupportedOperationException(StrUtil.format("String_Node_Str",value.getClass().getName()));
  }
  return map;
}
Program: 28329
Project: 28329
Buggy source:
@Test public void mapToMapTest(){
  Map<String,Object> mapPre=MapBuilder.create(new HashMap<String,Object>()).put("String_Node_Str","String_Node_Str").put("String_Node_Str",45).map();
  LinkedHashMap<?,?> map=Convert.convert(LinkedHashMap.class,mapPre);
  Assert.assertEquals("String_Node_Str",map.get("String_Node_Str"));
  Assert.assertEquals(45,map.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void mapToMapTest(){
  Map<String,Object> srcMap=MapBuilder.create(new HashMap<String,Object>()).put("String_Node_Str","String_Node_Str").put("String_Node_Str",45).map();
  LinkedHashMap<?,?> map=Convert.convert(LinkedHashMap.class,srcMap);
  Assert.assertEquals("String_Node_Str",map.get("String_Node_Str"));
  Assert.assertEquals(45,map.get("String_Node_Str"));
}
Program: 28330
Project: 28330
Buggy source:
/** 
 * 比较两个字符串是否相等。
 * @param str1 要比较的字符串1
 * @param str2 要比较的字符串2
 * @param ignoreCase 是否忽略大小写
 * @return 如果两个字符串相同，或者都是<code>null</code>，则返回<code>true</code>
 * @since 3.2.0
 */
public static boolean equals(CharSequence str1,CharSequence str2,boolean ignoreCase){
  if (str1 == null) {
    return str2 == null;
  }
  if (ignoreCase) {
    return str1.toString().equalsIgnoreCase(str2.toString());
  }
 else {
    return str1.equals(str2);
  }
}

Fixed version (ground truth):
/** 
 * 比较两个字符串是否相等。
 * @param str1 要比较的字符串1
 * @param str2 要比较的字符串2
 * @param ignoreCase 是否忽略大小写
 * @return 如果两个字符串相同，或者都是<code>null</code>，则返回<code>true</code>
 * @since 3.2.0
 */
public static boolean equals(CharSequence str1,CharSequence str2,boolean ignoreCase){
  if (null == str1) {
    return str2 == null;
  }
  if (null == str2) {
    return false;
  }
  if (ignoreCase) {
    return str1.toString().equalsIgnoreCase(str2.toString());
  }
 else {
    return str1.equals(str2);
  }
}
Program: 28331
Project: 28331
Buggy source:
/** 
 * 转换值为指定类型
 * @param < T > 转换的目标类型（转换器转换到的类型）
 * @param type 类型
 * @param value 值
 * @return 转换后的值，默认为<code>null</code>
 * @throws ConvertException 转换器不存在
 */
public <T>T convert(Class<T> type,Object value) throws ConvertException {
  return convert(type,value,null);
}

Fixed version (ground truth):
/** 
 * 转换值为指定类型
 * @param < T > 转换的目标类型（转换器转换到的类型）
 * @param type 类型
 * @param value 值
 * @return 转换后的值，默认为<code>null</code>
 * @throws ConvertException 转换器不存在
 */
public <T>T convert(Type type,Object value) throws ConvertException {
  return convert(type,value,null);
}
Program: 28332
Project: 28332
Buggy source:
/** 
 * 构造
 * @param collectionType 集合类型
 * @param elementType 集合元素类型
 */
public CollectionConverter(Class<?> collectionType,Class<?> elementType){
  this.collectionType=collectionType;
  this.elementType=elementType;
}

Fixed version (ground truth):
/** 
 * 构造
 * @param collectionType 集合类型
 * @param elementType 集合元素类型
 */
public CollectionConverter(Type collectionType,Type elementType){
  this.collectionType=collectionType;
  this.elementType=elementType;
}
Program: 28333
Project: 28333
Buggy source:
/** 
 * 内部转换
 * @param value 值
 * @return 转换后的集合对象
 */
protected Collection<?> convertInternal(Object value){
  final Collection<Object> collection=CollectionUtil.create(this.collectionType);
  return CollUtil.addAll(collection,value,elementType);
}

Fixed version (ground truth):
/** 
 * 内部转换
 * @param value 值
 * @return 转换后的集合对象
 */
protected Collection<?> convertInternal(Object value){
  final Collection<Object> collection=CollectionUtil.create(TypeUtil.getClass(collectionType));
  return CollUtil.addAll(collection,value,elementType);
}
Program: 28334
Project: 28334
Buggy source:
/** 
 * JSON递归转换<br> 首先尝试JDK类型转换，如果失败尝试JSON转Bean
 * @param type 目标类型
 * @param value 值
 * @param ignoreError 是否忽略转换错误
 * @return 目标类型的值
 * @throws ConvertException 转换失败
 */
protected static Object jsonConvert(Type type,Object value,boolean ignoreError) throws ConvertException {
  if (null == value) {
    return null;
  }
  if (value instanceof JSONNull) {
    return null;
  }
  final Class<?> rowType=TypeUtil.getClass(type);
  if (null == rowType) {
    throw new IllegalArgumentException(StrUtil.format("String_Node_Str",type));
  }
  Object targetValue=null;
  if (value instanceof JSONObject) {
    targetValue=((JSONObject)value).toBean(rowType,ignoreError);
  }
 else   if (value instanceof JSONArray) {
    final JSONArray jsonArrayValue=(JSONArray)value;
    if (rowType.isArray()) {
      targetValue=jsonArrayValue.toArray(rowType,ignoreError);
    }
 else {
      targetValue=(new CollectionConverter(type)).convert(value,null);
    }
  }
  if (null == targetValue) {
    try {
      targetValue=ConverterRegistry.getInstance().convert(rowType,value);
    }
 catch (    ConvertException e) {
      if (ignoreError) {
        return null;
      }
 else {
        throw e;
      }
    }
  }
  if (null == targetValue && false == ignoreError) {
    if (value instanceof CharSequence && StrUtil.isBlank((CharSequence)value)) {
      return null;
    }
    throw new ConvertException("String_Node_Str",value,rowType.getName());
  }
  return targetValue;
}

Fixed version (ground truth):
/** 
 * JSON递归转换<br> 首先尝试JDK类型转换，如果失败尝试JSON转Bean
 * @param type 目标类型
 * @param value 值
 * @param ignoreError 是否忽略转换错误
 * @return 目标类型的值
 * @throws ConvertException 转换失败
 */
protected static Object jsonConvert(Type type,Object value,boolean ignoreError) throws ConvertException {
  if (null == value) {
    return null;
  }
  if (value instanceof JSONNull) {
    return null;
  }
  final Class<?> rowType=TypeUtil.getClass(type);
  if (null == rowType) {
    throw new IllegalArgumentException(StrUtil.format("String_Node_Str",type));
  }
  if (JSON.class.isAssignableFrom(rowType)) {
    return JSONUtil.parse(value);
  }
  Object targetValue=null;
  if (value instanceof JSONObject) {
    targetValue=((JSONObject)value).toBean(rowType,ignoreError);
  }
 else   if (value instanceof JSONArray) {
    if (rowType.isArray()) {
      targetValue=((JSONArray)value).toArray(rowType,ignoreError);
    }
 else {
      targetValue=(new CollectionConverter(rowType,TypeUtil.getTypeArgument(type))).convert(value,null);
    }
  }
  if (null == targetValue) {
    try {
      targetValue=ConverterRegistry.getInstance().convert(rowType,value);
    }
 catch (    ConvertException e) {
      if (ignoreError) {
        return null;
      }
      throw e;
    }
  }
  if (null == targetValue && false == ignoreError) {
    if (value instanceof CharSequence && StrUtil.isBlank((CharSequence)value)) {
      return null;
    }
    throw new ConvertException("String_Node_Str",value,rowType.getName());
  }
  return targetValue;
}
Program: 28335
Project: 28335
Buggy source:
@Test public void toBeanTest(){
  String json="String_Node_Str";
  Price price=JSONUtil.toBean(json,Price.class);
  Console.log("String_Node_Str" + price.getADT().get(0).get(0));
}

Fixed version (ground truth):
@Test public void toBeanTest(){
  String json="String_Node_Str";
  Price price=JSONUtil.toBean(json,Price.class);
  Assert.assertEquals("String_Node_Str",price.getADT().get(0).get(0).getBookingCode().get(0));
}
Program: 28336
Project: 28336
Buggy source:
/** 
 * 分组解密
 * @param data 数据
 * @param keyType 密钥类型
 * @param charset 加密前编码
 * @return 解密后的密文
 * @since 3.1.1
 */
public String decryptStr(String data,KeyType keyType,Charset charset){
  Key key=getKeyByType(keyType);
  int keyLength=((RSAKey)key).getModulus().bitLength() / 8;
  StringBuilder sb=StrUtil.builder();
  lock.lock();
  try {
    clipher.init(Cipher.DECRYPT_MODE,key);
    byte[] bcd=BCD.ascToBcd(StrUtil.bytes(data,charset));
    byte[][] arrays=ArrayUtil.split(bcd,keyLength);
    for (    byte[] arr : arrays) {
      sb.append(StrUtil.str(clipher.doFinal(arr),charset));
    }
  }
 catch (  Exception e) {
    throw new CryptoException(e);
  }
 finally {
    lock.unlock();
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * 分组解密
 * @param data 数据
 * @param keyType 密钥类型
 * @param charset 加密前编码
 * @return 解密后的密文
 * @since 3.1.1
 */
public String decryptStr(String data,KeyType keyType,Charset charset){
  Key key=getKeyByType(keyType);
  int MAX_DECRYPT_BLOCK=((RSAKey)key).getModulus().bitLength() / 8;
  byte[] dataBytes=BCD.ascToBcd(StrUtil.bytes(data,charset));
  lock.lock();
  try (ByteArrayOutputStream out=new ByteArrayOutputStream()){
    clipher.init(Cipher.DECRYPT_MODE,key);
    int inputLen=dataBytes.length;
    int offSet=0;
    byte[] cache;
    int i=0;
    while (inputLen - offSet > 0) {
      if (inputLen - offSet > MAX_DECRYPT_BLOCK) {
        cache=clipher.doFinal(dataBytes,offSet,MAX_DECRYPT_BLOCK);
      }
 else {
        cache=clipher.doFinal(dataBytes,offSet,inputLen - offSet);
      }
      out.write(cache,0,cache.length);
      i++;
      offSet=i * MAX_DECRYPT_BLOCK;
    }
    byte[] decryptedData=out.toByteArray();
    return StrUtil.str(decryptedData,charset);
  }
 catch (  Exception e) {
    throw new CryptoException(e);
  }
 finally {
    lock.unlock();
  }
}
Program: 28337
Project: 28337
Buggy source:
/** 
 * 分组加密
 * @param data 数据
 * @param keyType 密钥类型
 * @param charset 加密前编码
 * @return 加密后的密文
 * @throws CryptoException 加密异常
 * @since 3.1.1
 */
public String encryptStr(String data,KeyType keyType,Charset charset){
  Key key=getKeyByType(keyType);
  int keyLength=((RSAKey)key).getModulus().bitLength() / 8;
  StringBuilder sb=StrUtil.builder();
  lock.lock();
  try {
    clipher.init(Cipher.ENCRYPT_MODE,key);
    String[] datas=StrUtil.split(data,keyLength - 11);
    for (    String s : datas) {
      sb.append(BCD.bcdToStr(clipher.doFinal(StrUtil.bytes(s,charset))));
    }
  }
 catch (  Exception e) {
    throw new CryptoException(e);
  }
 finally {
    lock.unlock();
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * 分组加密
 * @param data 数据
 * @param keyType 密钥类型
 * @param charset 加密前编码
 * @return 加密后的密文
 * @throws CryptoException 加密异常
 * @since 3.1.1
 */
public String encryptStr(String data,KeyType keyType,Charset charset){
  Key key=getKeyByType(keyType);
  int MAX_ENCRYPT_BLOCK=((RSAKey)key).getModulus().bitLength() / 8 - 11;
  byte[] dataBytes=StrUtil.bytes(data,charset);
  lock.lock();
  try (ByteArrayOutputStream out=new ByteArrayOutputStream()){
    clipher.init(Cipher.ENCRYPT_MODE,key);
    int inputLen=dataBytes.length;
    int offSet=0;
    byte[] cache;
    int i=0;
    while (dataBytes.length - offSet > 0) {
      if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {
        cache=clipher.doFinal(dataBytes,offSet,MAX_ENCRYPT_BLOCK);
      }
 else {
        cache=clipher.doFinal(dataBytes,offSet,inputLen - offSet);
      }
      out.write(cache,0,cache.length);
      i++;
      offSet=i * MAX_ENCRYPT_BLOCK;
    }
    byte[] encryptedData=out.toByteArray();
    return BCD.bcdToStr(encryptedData);
  }
 catch (  Exception e) {
    throw new CryptoException(e);
  }
 finally {
    lock.unlock();
  }
}
Program: 28338
Project: 28338
Buggy source:
/** 
 * @param value
 * @return
 */
protected Collection<?> convertInternal(Object value){
  final Collection<Object> collection=CollectionUtil.create(this.collectionType);
  return CollectionUtil.addAll(collection,value,elementType);
}

Fixed version (ground truth):
/** 
 * 内部转换
 * @param value 值
 * @return 转换后的集合对象
 */
protected Collection<?> convertInternal(Object value){
  final Collection<Object> collection=CollectionUtil.create(this.collectionType);
  return CollectionUtil.addAll(collection,value,elementType);
}
Program: 28339
Project: 28339
Buggy source:
@Override public String toString(){
  return (null == this.url) ? "String_Node_Str" : this.url.toString();
}

Fixed version (ground truth):
/** 
 * 返回路径
 * @return 返回URL路径
 */
@Override public String toString(){
  return (null == this.url) ? "String_Node_Str" : this.url.toString();
}
Program: 28340
Project: 28340
Buggy source:
@Test public void readFromJarTest() throws IOException {
  final ClassPathResource resource=new ClassPathResource("String_Node_Str");
  File file=resource.getFile();
  Console.log(file);
  String result=IoUtil.read(resource.getStream(),CharsetUtil.CHARSET_UTF_8);
  Assert.assertNotNull(result);
}

Fixed version (ground truth):
@Test public void readFromJarTest() throws IOException {
  final ClassPathResource resource=new ClassPathResource("String_Node_Str");
  String result=resource.readUtf8Str();
  Assert.assertNotNull(result);
  result=resource.readUtf8Str();
  Assert.assertNotNull(result);
}
Program: 28341
Project: 28341
Buggy source:
/** 
 * 对增删改查做单元测试
 * @throws SQLException
 */
@Test public void crudTest() throws SQLException {
  SqlRunner runner=SqlRunner.create(DSFactory.get());
  Long id=runner.insertForGeneratedKey(Entity.create("String_Node_Str").set("String_Node_Str","String_Node_Str").set("String_Node_Str",66));
  Assert.assertTrue(id > 0);
  Entity result=runner.get("String_Node_Str","String_Node_Str","String_Node_Str");
  Assert.assertSame(66,(int)result.getInt("String_Node_Str"));
  int update=runner.update(Entity.create().set("String_Node_Str",88),Entity.create("String_Node_Str").set("String_Node_Str","String_Node_Str"));
  Assert.assertTrue(update > 0);
  Entity result2=runner.get("String_Node_Str","String_Node_Str","String_Node_Str");
  Assert.assertSame(88,(int)result2.getInt("String_Node_Str"));
  int del=runner.del("String_Node_Str","String_Node_Str","String_Node_Str");
  Assert.assertTrue(del > 0);
  Entity result3=runner.get("String_Node_Str","String_Node_Str","String_Node_Str");
  Assert.assertNull(result3);
}

Fixed version (ground truth):
/** 
 * 对增删改查做单元测试
 * @throws SQLException
 */
@Test @Ignore public void crudTest() throws SQLException {
  SqlRunner runner=SqlRunner.create(DSFactory.get());
  Long id=runner.insertForGeneratedKey(Entity.create("String_Node_Str").set("String_Node_Str","String_Node_Str").set("String_Node_Str",66));
  Assert.assertTrue(id > 0);
  Entity result=runner.get("String_Node_Str","String_Node_Str","String_Node_Str");
  Assert.assertSame(66,(int)result.getInt("String_Node_Str"));
  int update=runner.update(Entity.create().set("String_Node_Str",88),Entity.create("String_Node_Str").set("String_Node_Str","String_Node_Str"));
  Assert.assertTrue(update > 0);
  Entity result2=runner.get("String_Node_Str","String_Node_Str","String_Node_Str");
  Assert.assertSame(88,(int)result2.getInt("String_Node_Str"));
  int del=runner.del("String_Node_Str","String_Node_Str","String_Node_Str");
  Assert.assertTrue(del > 0);
  Entity result3=runner.get("String_Node_Str","String_Node_Str","String_Node_Str");
  Assert.assertNull(result3);
}
Program: 28342
Project: 28342
Buggy source:
/** 
 * 获取指定日期偏移指定时间后的时间
 * @param date 基准日期
 * @param dateField 偏移的粒度大小（小时、天、月等）{@link DateField}
 * @param offset 偏移量，正数为向后偏移，负数为向前偏移
 * @return 偏移后的日期
 * @deprecated please use {@link DateUtil#offset(Date,DateField,int)}
 */
public static DateTime offsetDate(Date date,DateField dateField,int offset){
  return offset(date,dateField,offset);
}

Fixed version (ground truth):
/** 
 * 获取指定日期偏移指定时间后的时间
 * @param date 基准日期
 * @param dateField 偏移的粒度大小（小时、天、月等）{@link DateField}
 * @param offset 偏移量，正数为向后偏移，负数为向前偏移
 * @return 偏移后的日期
 * @deprecated please use {@link DateUtil#offset(Date,DateField,int)}
 */
@Deprecated public static DateTime offsetDate(Date date,DateField dateField,int offset){
  return offset(date,dateField,offset);
}
Program: 28343
Project: 28343
Buggy source:
public int read() throws IOException {
  isInited=true;
  return in.read();
}

Fixed version (ground truth):
@Override public int read() throws IOException {
  isInited=true;
  return in.read();
}
Program: 28344
Project: 28344
Buggy source:
public void close() throws IOException {
  isInited=true;
  in.close();
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  isInited=true;
  in.close();
}
Program: 28345
Project: 28345
Buggy source:
/** 
 * 写入数据到文件
 * @param data 数据
 * @param dest 目标文件
 * @param off 数据开始位置
 * @param len 数据长度
 * @param append 是否追加模式
 * @return File
 * @throws IORuntimeException IO异常
 */
public static File writeBytes(byte[] data,File dest,int off,int len,boolean append) throws IORuntimeException {
  return FileWriter.create(dest).write(data,off,len);
}

Fixed version (ground truth):
/** 
 * 写入数据到文件
 * @param data 数据
 * @param dest 目标文件
 * @param off 数据开始位置
 * @param len 数据长度
 * @param isAppend 是否追加模式
 * @return File
 * @throws IORuntimeException IO异常
 */
public static File writeBytes(byte[] data,File dest,int off,int len,boolean isAppend) throws IORuntimeException {
  return FileWriter.create(dest).write(data,off,len,isAppend);
}
Program: 28346
Project: 28346
Buggy source:
/** 
 * 将列表写入文件
 * @param < T > 集合元素类型
 * @param list 列表
 * @param file 文件
 * @param charset 字符集
 * @param isAppend 是否追加
 * @return 文件
 * @throws IORuntimeException IO异常
 */
public static <T>File writeLines(Collection<T> list,File file,String charset,boolean isAppend) throws IORuntimeException {
  return FileWriter.create(file,CharsetUtil.charset(charset)).writeLines(list);
}

Fixed version (ground truth):
/** 
 * 将列表写入文件
 * @param < T > 集合元素类型
 * @param list 列表
 * @param file 文件
 * @param charset 字符集
 * @param isAppend 是否追加
 * @return 文件
 * @throws IORuntimeException IO异常
 */
public static <T>File writeLines(Collection<T> list,File file,String charset,boolean isAppend) throws IORuntimeException {
  return FileWriter.create(file,CharsetUtil.charset(charset)).writeLines(list,isAppend);
}
Program: 28347
Project: 28347
Buggy source:
/** 
 * 将Set排序（根据Entry的值）
 * @param set 被排序的Set
 * @return 排序后的Set
 */
public static List<Entry<Long,Long>> sortEntrySetToList(Set<Entry<Long,Long>> set){
  List<Entry<Long,Long>> list=new LinkedList<Map.Entry<Long,Long>>(set);
  Collections.sort(list,new Comparator<Entry<Long,Long>>(){
    @Override public int compare(    Entry<Long,Long> o1,    Entry<Long,Long> o2){
      if (o1.getValue() > o2.getValue()) {
        return 1;
      }
      if (o1.getValue() < o2.getValue()) {
        return -1;
      }
      return 0;
    }
  }
);
  return list;
}

Fixed version (ground truth):
/** 
 * 将Set排序（根据Entry的值）
 * @param set 被排序的Set
 * @return 排序后的Set
 */
public static List<Entry<Long,Long>> sortEntrySetToList(Set<Entry<Long,Long>> set){
  List<Entry<Long,Long>> list=new LinkedList<>(set);
  Collections.sort(list,new Comparator<Entry<Long,Long>>(){
    @Override public int compare(    Entry<Long,Long> o1,    Entry<Long,Long> o2){
      if (o1.getValue() > o2.getValue()) {
        return 1;
      }
      if (o1.getValue() < o2.getValue()) {
        return -1;
      }
      return 0;
    }
  }
);
  return list;
}
Program: 28348
Project: 28348
Buggy source:
/** 
 * 切取部分数据
 * @param < T > 集合元素类型
 * @param surplusAlaDatas 原数据
 * @param partSize 每部分数据的长度
 * @return 切取出的数据或null
 */
public static <T>List<T> popPart(Deque<T> surplusAlaDatas,int partSize){
  if (surplusAlaDatas == null || surplusAlaDatas.size() <= 0) {
    return null;
  }
  final List<T> currentAlaDatas=new ArrayList<T>();
  int size=surplusAlaDatas.size();
  if (size > partSize) {
    for (int i=0; i < partSize; i++) {
      currentAlaDatas.add(surplusAlaDatas.pop());
    }
  }
 else {
    for (int i=0; i < size; i++) {
      currentAlaDatas.add(surplusAlaDatas.pop());
    }
  }
  return currentAlaDatas;
}

Fixed version (ground truth):
/** 
 * 切取部分数据
 * @param < T > 集合元素类型
 * @param surplusAlaDatas 原数据
 * @param partSize 每部分数据的长度
 * @return 切取出的数据或null
 */
public static <T>List<T> popPart(Deque<T> surplusAlaDatas,int partSize){
  if (isEmpty(surplusAlaDatas)) {
    return null;
  }
  final List<T> currentAlaDatas=new ArrayList<>();
  int size=surplusAlaDatas.size();
  if (size > partSize) {
    for (int i=0; i < partSize; i++) {
      currentAlaDatas.add(surplusAlaDatas.pop());
    }
  }
 else {
    for (int i=0; i < size; i++) {
      currentAlaDatas.add(surplusAlaDatas.pop());
    }
  }
  return currentAlaDatas;
}