nus-yam/ex-repair huggingface dataset:
Program: 175341
Project: 175341
Buggy source:
private void applyAttributes(AttributeSet attrs){
  TypedArray a=getContext().getTheme().obtainStyledAttributes(attrs,R.styleable.EditCredit,0,0);
  try {
    setSeparator(Separator.values()[a.getInt(R.styleable.EditCredit_separator,Separator.NONE.ordinal())]);
    setDisabledCardsInternal(a.getInt(R.styleable.EditCredit_disabledCards,0));
    setDrawableGravity(Gravity.values()[a.getInt(R.styleable.EditCredit_iconGravity,Gravity.END.ordinal())]);
  }
  finally {
    a.recycle();
  }
}

Fixed version (ground truth):
private void applyAttributes(AttributeSet attrs){
  TypedArray a=getContext().getTheme().obtainStyledAttributes(attrs,R.styleable.EditCredit,0,0);
  try {
    setSeparator(Separator.values()[a.getInt(R.styleable.EditCredit_separator,Separator.NONE.ordinal())]);
    setDisabledCardsInternal(a.getInt(R.styleable.EditCredit_disabledCards,0));
    setDrawableGravity(Gravity.values()[a.getInt(R.styleable.EditCredit_drawableGravity,Gravity.END.ordinal())]);
  }
  finally {
    a.recycle();
  }
}
Program: 175342
Project: 175342
Buggy source:
private void setDisabledCardsInternal(int disabledCards){
  List<Card> cards=new ArrayList<>();
  if (containsFlag(disabledCards,Card.VISA.value)) {
    cards.add(Card.VISA);
  }
  if (containsFlag(disabledCards,Card.MASTERCARD.value)) {
    cards.add(Card.MASTERCARD);
  }
  if (!containsFlag(disabledCards,Card.AMEX.value)) {
    cards.add(Card.AMEX);
  }
  setDisabledCards(cards.toArray(new Card[0]));
}

Fixed version (ground truth):
private void setDisabledCardsInternal(int disabledCards){
  List<Card> cards=new ArrayList<>();
  if (containsFlag(disabledCards,Card.VISA.value)) {
    cards.add(Card.VISA);
  }
  if (containsFlag(disabledCards,Card.MASTERCARD.value)) {
    cards.add(Card.MASTERCARD);
  }
  if (containsFlag(disabledCards,Card.AMEX.value)) {
    cards.add(Card.AMEX);
  }
  setDisabledCards(cards.toArray(new Card[0]));
}
Program: 175343
Project: 175343
Buggy source:
private void findViewsById(){
  mEditCredit=findViewById(R.id.editcredit);
  separatorsRadioGroup=findViewById(R.id.separators_radio_group);
  gravityRadioGroup=findViewById(R.id.gravity_radio_group);
  validateButton=findViewById(R.id.btn_validate);
  getNumberButton=findViewById(R.id.btn_get_number);
  visaCheckBox=findViewById(R.id.chk_visa);
  masterCardCheckBox=findViewById(R.id.chk_mastercard);
  americanExpressCheckBox=findViewById(R.id.chk_amex);
}

Fixed version (ground truth):
private void findViewsById(){
  mEditCredit=findViewById(R.id.editcredit);
  separatorsRadioGroup=findViewById(R.id.separators_radio_group);
  gravityRadioGroup=findViewById(R.id.gravity_radio_group);
  validateButton=findViewById(R.id.btn_validate);
  getNumberButton=findViewById(R.id.btn_get_number);
  visaCheckBox=findViewById(R.id.chk_visa);
  masterCardCheckBox=findViewById(R.id.chk_mastercard);
  americanExpressCheckBox=findViewById(R.id.chk_amex);
  discoverCheckBox=findViewById(R.id.chk_discover);
}
Program: 175344
Project: 175344
Buggy source:
@Bean("String_Node_Str") public AuthorizingRealm authRealm(@Qualifier("String_Node_Str") SimpleCredentialsMatcher matcher){
  RestAuthRealm authRealm=new RestAuthRealm();
  authRealm.setCredentialsMatcher(matcher);
  return authRealm;
}

Fixed version (ground truth):
@Bean("String_Node_Str") public AuthorizingRealm authRealm(@Qualifier("String_Node_Str") CredentialsMatcher matcher){
  RestAuthRealm authRealm=new RestAuthRealm();
  authRealm.setCredentialsMatcher(matcher);
  return authRealm;
}
Program: 175345
Project: 175345
Buggy source:
protected Result response(AdminVersionLicense license,Map<String,Object> result){
  try {
    String json=JSON.toJSONString(result);
    PrivateKey privateKey=SerializeUtil.deserialize(Base64.getDecoder().decode(license.getPrivateKey()),PrivateKey.class);
    String data=Base64.getEncoder().encodeToString(RSAUtil.encrypt(json.getBytes(),privateKey));
    return Result.wrapResult(data);
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
protected Result response(AdminVersionLicense license,Map<String,Object> result){
  try {
    String json=JSON.toJSONString(result);
    String key=DESUtil.buildSecurityKey();
    String encryptString=DESUtil.encrypt(json,key);
    PrivateKey privateKey=SerializeUtil.deserialize(Base64.getDecoder().decode(license.getPrivateKey()),PrivateKey.class);
    String encryptKey=Base64.getEncoder().encodeToString(RSAUtil.encrypt(key.getBytes(),privateKey));
    ClientVO client=new ClientVO();
    client.setCode(encryptString);
    client.setKey(encryptKey);
    return Result.wrapResult(JSON.toJSONString(client));
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 175347
Project: 175347
Buggy source:
private List<Menu> buildMenu(AdminUsers buildUser){
  List<AdminAdminNav> navList=adminAdminNavService.getClientMenu(buildUser);
  Map<Long,List<AdminAdminNav>> navMap=new HashMap<>();
  for (  AdminAdminNav item : navList) {
    List<AdminAdminNav> list=navMap.get(item.getPid());
    if (CollectionUtils.isEmpty(list)) {
      list=new ArrayList<>();
    }
    list.add(item);
    navMap.put(item.getPid(),list);
  }
  List<Menu> menus=new ArrayList<>();
  for (  AdminAdminNav item : navMap.get(0L)) {
    Menu menu=BeanUtil.copy(item,Menu.class);
    menu.setChild(processMenu(item,navMap));
    menus.add(menu);
  }
  return menus;
}

Fixed version (ground truth):
private List<Menu> buildMenu(AdminUsers buildUser){
  List<AdminAdminNav> navList=adminAdminNavService.getClientMenu(buildUser);
  Map<Long,List<AdminAdminNav>> navMap=new HashMap<>();
  for (  AdminAdminNav item : navList) {
    List<AdminAdminNav> list=navMap.get(item.getPid());
    if (CollectionUtils.isEmpty(list)) {
      list=new ArrayList<>();
    }
    list.add(item);
    navMap.put(item.getPid(),list);
  }
  List<Menu> menus=new ArrayList<>();
  if (CollectionUtils.isEmpty(navMap)) {
    return menus;
  }
  for (  AdminAdminNav item : navMap.get(0L)) {
    Menu menu=BeanUtil.copy(item,Menu.class);
    menu.setChild(processMenu(item,navMap));
    menus.add(menu);
  }
  return menus;
}
Program: 175348
Project: 175348
Buggy source:
private String request(String api,Map<String,Object> param){
  String url=String.format("String_Node_Str",rbacShiroUrl,api);
  try {
    Connection.Response response=Jsoup.connect(url).method(Connection.Method.POST).timeout(300).data(ImmutableMap.of("String_Node_Str",RSAUtil.encrypt(param,publicKey),"String_Node_Str",uuid,"String_Node_Str",licenseKey)).ignoreContentType(true).execute();
    JSONObject object=JSONObject.parseObject(response.body(),JSONObject.class);
    if (!object.getBoolean("String_Node_Str")) {
      throw new AuthenticationException(response.body());
    }
    byte[] jsonBytes=RSAUtil.decrypt(Base64.getDecoder().decode(object.getString("String_Node_Str")),publicKey);
    return new String(jsonBytes,"String_Node_Str");
  }
 catch (  Exception e) {
    throw new AuthenticationException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private String request(String api,Map<String,Object> param){
  String url=String.format("String_Node_Str",rbacShiroUrl,api);
  try {
    Connection.Response response=Jsoup.connect(url).method(Connection.Method.POST).timeout(300).data(ImmutableMap.of("String_Node_Str",URLEncoder.encode(RSAUtil.encrypt(param,publicKey),"String_Node_Str"),"String_Node_Str",uuid,"String_Node_Str",licenseKey)).ignoreContentType(true).execute();
    JSONObject object=JSONObject.parseObject(response.body(),JSONObject.class);
    if (!object.getBoolean("String_Node_Str")) {
      throw new AuthenticationException(response.body());
    }
    String data=object.getString("String_Node_Str");
    JSONObject client=JSON.parseObject(data);
    String encryptKey=client.getString("String_Node_Str");
    byte[] jsonBytes=RSAUtil.decrypt(Base64.getDecoder().decode(encryptKey),publicKey);
    String key=new String(jsonBytes,"String_Node_Str");
    return DESUtil.decrypt(client.getString("String_Node_Str"),key);
  }
 catch (  Exception e) {
    throw new AuthenticationException("String_Node_Str",e);
  }
}
Program: 175349
Project: 175349
Buggy source:
/** 
 * 给登录用户授权
 * @param principalCollection
 * @return
 */
@Override protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection){
  Profile profile=(Profile)principalCollection.fromRealm(this.getClass().getName()).iterator().next();
  Map<String,Object> param=new HashMap<>();
  param.put("String_Node_Str",profile.getUuid());
  String result=request("String_Node_Str",param);
  SimpleAuthorizationInfo info=new SimpleAuthorizationInfo();
  AuthInfo authInfo=JSON.parseObject(result,new TypeReference<AuthInfo>(){
  }
.getType());
  Set<String> permissions=new HashSet<>();
  permissions.addAll(authInfo.getPermissions());
  info.addStringPermissions(permissions);
  Subject subject=SecurityUtils.getSubject();
  Session session=subject.getSession();
  session.setAttribute("String_Node_Str",authInfo);
  session.setAttribute("String_Node_Str",profile);
  return info;
}

Fixed version (ground truth):
/** 
 * 给登录用户授权
 * @param principalCollection
 * @return
 */
@Override protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection){
  Profile profile=(Profile)principalCollection.fromRealm(this.getClass().getName()).iterator().next();
  Map<String,Object> param=new HashMap<>();
  param.put("String_Node_Str",profile.getUuid());
  String result=request("String_Node_Str",param);
  SimpleAuthorizationInfo info=new SimpleAuthorizationInfo();
  AuthInfo authInfo=JSON.parseObject(result,new TypeReference<AuthInfo>(){
  }
.getType());
  Set<String> permissions=new HashSet<>();
  permissions.addAll(authInfo.getPermission());
  info.addStringPermissions(permissions);
  Subject subject=SecurityUtils.getSubject();
  Session session=subject.getSession();
  session.setAttribute("String_Node_Str",authInfo);
  session.setAttribute("String_Node_Str",profile);
  return info;
}
Program: 175350
Project: 175350
Buggy source:
private static void updateNavbarData(Context context,XpNavBarSetting setting){
  List<ShortCut> shortCutData=setting.getShortCutData();
  int iconScale=setting.getIconSize();
  int homePosition=setting.getHomePointPosition();
  boolean rootDown=setting.isRootDown();
  int clearMemLevel=setting.getClearMenLevel();
  boolean chameleonNavbar=setting.isChameleonNavbar();
  int navbarHeight=setting.getNavbarHeight();
  boolean vibrate=setting.isVibrate();
  boolean navbarHightOpt=setting.isNavbarHeightOpt();
  setHomePointPosition(onHomeNavbar);
  DataHook.rootDown=rootDown;
  DataHook.iconScale=iconScale;
  DataHook.clearMenLevel=clearMemLevel;
  DataHook.chameleonNavbar=chameleonNavbar;
  DataHook.homePointPosition=homePosition;
  DataHook.vibrate=vibrate;
  DataHook.navbarOpt=navbarHightOpt;
  musicControllerPanel.updateIconSize();
  btnFuncFactory.clearAllBtn();
  if (shortCutData != null && shortCutData.size() != 0) {
    DataHook.shortCutList=shortCutData;
    for (    ShortCut sc : shortCutData) {
      btnFuncFactory.createBtnAndSetFunc(exNavbar,sc);
    }
  }
  if (DataHook.navbarHeight != navbarHeight && navbarHightOpt) {
    setNavbarHeight(context,navbarHeight);
    DataHook.navbarHeight=navbarHeight;
  }
 else   if (!navbarHightOpt) {
    navbarHeight=-1;
    DataHook.navbarHeight=-1;
    setNavbarHeight(context,navbarHeight);
  }
}

Fixed version (ground truth):
private static void updateNavbarData(Context context,XpNavBarSetting setting){
  List<ShortCut> shortCutData=setting.getShortCutData();
  int iconScale=setting.getIconSize();
  int homePosition=setting.getHomePointPosition();
  boolean rootDown=setting.isRootDown();
  int clearMemLevel=setting.getClearMenLevel();
  boolean chameleonNavbar=setting.isChameleonNavbar();
  int navbarHeight=setting.getNavbarHeight();
  boolean vibrate=setting.isVibrate();
  boolean navbarHightOpt=setting.isNavbarHeightOpt();
  setHomePointPosition(onHomeNavbar);
  DataHook.rootDown=rootDown;
  DataHook.iconScale=iconScale;
  DataHook.clearMenLevel=clearMemLevel;
  DataHook.chameleonNavbar=chameleonNavbar;
  DataHook.homePointPosition=homePosition;
  DataHook.vibrate=vibrate;
  DataHook.navbarOpt=navbarHightOpt;
  musicControllerPanel.updateIconSize();
  btnFuncFactory.clearAllBtn();
  if (shortCutData != null && shortCutData.size() != 0) {
    DataHook.shortCutList=shortCutData;
    for (    ShortCut sc : shortCutData) {
      btnFuncFactory.createBtnAndSetFunc(exNavbar,sc);
    }
  }
  if (navbarHightOpt) {
    setNavbarHeight(context,navbarHeight);
    DataHook.navbarHeight=navbarHeight;
  }
 else {
    navbarHeight=-1;
    DataHook.navbarHeight=-1;
    setNavbarHeight(context,navbarHeight);
  }
}
Program: 175351
Project: 175351
Buggy source:
private static void hookNavBar(ViewGroup rootView,ViewGroup navbarView){
  rootNavbarView=rootView;
  Context context=rootView.getContext();
  ViewPager vpXpHook=new ViewPager(context);
  exNavbar=new LinearLayout(context);
  musicControllerPanel=new MusicControllerPanel(context);
  onHomeNavbar=new LinearLayout(context);
  initExNavbar(vpXpHook,exNavbar);
  initHomeNavbar(onHomeNavbar,vpXpHook);
  initMusicPanel(musicControllerPanel);
  initVpHook(vpXpHook,navbarView,exNavbar,musicControllerPanel,onHomeNavbar);
  initBroadcast(context);
  initClipBoardListener(context);
  ViewGroup.LayoutParams params=new ViewGroup.LayoutParams(ViewPager.LayoutParams.MATCH_PARENT,ViewPager.LayoutParams.MATCH_PARENT);
  rootView.addView(vpXpHook,0,params);
  setNavbarHeight(context,DataHook.navbarHeight);
}

Fixed version (ground truth):
private static void hookNavBar(ViewGroup rootView,ViewGroup navbarView){
  rootNavbarView=rootView;
  Context context=rootView.getContext();
  ViewPager vpXpHook=new ViewPager(context);
  exNavbar=new LinearLayout(context);
  musicControllerPanel=new MusicControllerPanel(context);
  onHomeNavbar=new LinearLayout(context);
  initExNavbar(vpXpHook,exNavbar);
  initHomeNavbar(onHomeNavbar,vpXpHook);
  initMusicPanel(musicControllerPanel);
  initVpHook(vpXpHook,navbarView,exNavbar,musicControllerPanel,onHomeNavbar);
  initBroadcast(context);
  initClipBoardListener(context);
  ViewGroup.LayoutParams params=new ViewGroup.LayoutParams(ViewPager.LayoutParams.MATCH_PARENT,ViewPager.LayoutParams.MATCH_PARENT);
  rootView.addView(vpXpHook,0,params);
  if (DataHook.navbarOpt) {
    setNavbarHeight(context,DataHook.navbarHeight);
  }
}
Program: 175353
Project: 175353
Buggy source:
@Override protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
  final Context mContext=(Context)XposedHelpers.getObjectField(param.thisObject,"String_Node_Str");
  WindowManager wm=(WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE);
  screenH=wm.getDefaultDisplay().getHeight();
  final Resources resources=mContext.getResources();
  final int resourceId=resources.getIdentifier("String_Node_Str","String_Node_Str","String_Node_Str");
  defaultNavbarH=resources.getDimensionPixelSize(resourceId);
  navbarH=defaultNavbarH;
  if (navbarH == 0) {
    navbarH=150;
  }
  BroadcastReceiver screenShotReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      try {
        int type=intent.getIntExtra(ConstantStr.TYPE,-1);
switch (type) {
case ConstantStr.TAKE_SCREENSHOT:
          if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
            XposedHelpers.callMethod(param.thisObject,"String_Node_Str",1);
          }
 else {
            XposedHelpers.callMethod(param.thisObject,"String_Node_Str");
          }
        break;
case ConstantStr.HIDE_NAVBAR:
{
        setNavBarDimensions(param.thisObject,0,defaultNavbarH);
      }
    break;
case ConstantStr.NAVBAR_H:
{
    navbarH=resources.getDimensionPixelSize(resourceId);
    navbarH=(int)(navbarH * (((float)intent.getIntExtra(ConstantStr.NAVBAR_HEIGHT,100) / 100)));
    setNavBarDimensions(param.thisObject,navbarH,defaultNavbarH);
  }
break;
}
}
 catch (Exception e) {
XpLog.e(e);
}
}
}
;
IntentFilter filter=new IntentFilter(XpNavBarAction.ACTION_PHONE_WINDOW_MANAGER);
mContext.registerReceiver(screenShotReceiver,filter);
gesturesListener=new GesturesListener(mContext,new GesturesListener.Callbacks(){
@Override public void onSwipeFromTop(){
}
@Override public void onSwipeFromBottom(){
setNavBarDimensions(param.thisObject,navbarH,defaultNavbarH);
}
@Override public void onSwipeFromRight(){
}
@Override public void onDebug(){
}
}
);
}

Fixed version (ground truth):
@Override protected void afterHookedMethod(MethodHookParam param) throws Throwable {
  setNavBarDimensions(param.thisObject,navbarH,defaultNavbarH);
}
Program: 175354
Project: 175354
Buggy source:
public static void hook(ClassLoader classLoader) throws Throwable {
  final Class<?> slideTouchEvent=classLoader.loadClass("String_Node_Str");
  XposedHelpers.findAndHookMethod(slideTouchEvent,"String_Node_Str",float.class,new XC_MethodReplacement(){
    @Override protected Object replaceHookedMethod(    MethodHookParam param) throws Throwable {
      return null;
    }
  }
);
}

Fixed version (ground truth):
public static void hook(ClassLoader classLoader) throws Throwable {
  try {
    final Class<?> slideTouchEvent=classLoader.loadClass("String_Node_Str");
    XposedHelpers.findAndHookMethod(slideTouchEvent,"String_Node_Str",float.class,new XC_MethodReplacement(){
      @Override protected Object replaceHookedMethod(      MethodHookParam param) throws Throwable {
        return null;
      }
    }
);
  }
 catch (  Exception e) {
  }
}
Program: 175355
Project: 175355
Buggy source:
/** 
 * @param poolId 根据指定id获取一个连接池
 * @return RedisPools对象
 * @throws Exception 加载异常
 */
public RedisPools getRedisPool(String poolId) throws Exception {
  currentPoolId=poolId;
  RedisPools pool=null;
  if (poolMap.containsKey(poolId)) {
    logger.info(NoticeInfo.ALREADY_EXIST_POOL + poolId);
    return poolMap.get(poolId);
  }
  try {
    configFile=PropertyFile.getProperties(propertyFile);
  }
 catch (  IOException e) {
    e.printStackTrace();
    throw new ReadConfigException(ExceptionInfo.OPEN_CONFIG_FAILED + propertyFile,e,PoolManagement.class);
  }
  String pre=poolId + Configs.SEPARATE;
  RedisPoolProperty poolProperty;
  if (configFile.getString(pre + Configs.NAME) == null) {
    logger.error(ExceptionInfo.POOL_NOT_EXIST_CONFIG);
    throw new Exception(ExceptionInfo.POOL_NOT_EXIST_CONFIG);
  }
 else {
    pool=new RedisPools();
    poolProperty=RedisPoolProperty.initByIdFromConfig(poolId);
    pool.setProperty(poolProperty);
  }
  pool.initialPool();
  logger.info("String_Node_Str" + poolId + "String_Node_Str"+ pool+ "String_Node_Str"+ poolProperty.toString());
  if (pool.available()) {
    poolMap.put(poolId,pool);
    return pool;
  }
 else {
    throw new RedisConnectionException(ExceptionInfo.POOL_NOT_AVAILABLE,PoolManagement.class);
  }
}

Fixed version (ground truth):
/** 
 * @param poolId 根据指定id获取一个连接池
 * @return RedisPools对象
 * @throws Exception 加载异常
 */
public RedisPools getRedisPool(String poolId) throws Exception {
  currentPoolId=poolId;
  RedisPools pool=null;
  if (poolMap.containsKey(poolId)) {
    logger.info(NoticeInfo.ALREADY_EXIST_POOL + poolId);
    return poolMap.get(poolId);
  }
  try {
    configFile=PropertyFile.getProperties(propertyFile);
  }
 catch (  IOException e) {
    e.printStackTrace();
    throw new ReadConfigException(ExceptionInfo.OPEN_CONFIG_FAILED + propertyFile,e,PoolManagement.class);
  }
  String pre=poolId + Configs.SEPARATE;
  RedisPoolProperty poolProperty;
  if (configFile.getString(pre + Configs.NAME) == null) {
    throw new RedisConnectionException(ExceptionInfo.POOL_NOT_EXIST_CONFIG,PoolManagement.class);
  }
 else {
    pool=new RedisPools();
    poolProperty=RedisPoolProperty.initByIdFromConfig(poolId);
    pool.setProperty(poolProperty);
  }
  pool.initialPool();
  logger.info("String_Node_Str" + poolId + "String_Node_Str"+ pool+ "String_Node_Str"+ poolProperty.toString());
  if (pool.available()) {
    poolMap.put(poolId,pool);
    return pool;
  }
 else {
    throw new RedisConnectionException(ExceptionInfo.POOL_NOT_AVAILABLE,PoolManagement.class);
  }
}
Program: 175356
Project: 175356
Buggy source:
public static Map<String,RedisPoolProperty> getAllPoolConfig() throws ReadConfigException {
  Map<String,RedisPoolProperty> map=new HashMap<>();
  int maxId=0;
  MythProperties properties=null;
  try {
    maxId=getMaxId();
    properties=getProperties(Configs.propertyFile);
  }
 catch (  IOException e) {
    e.printStackTrace();
    logger.error("String_Node_Str");
  }
  for (int i=Configs.START_ID; i <= maxId; i++) {
    String poolId=properties.getString(i + Configs.SEPARATE + Configs.POOL_ID);
    if (poolId == null)     continue;
    RedisPoolProperty property=RedisPoolProperty.initByIdFromConfig(poolId);
    map.put(poolId,property);
  }
  return map;
}

Fixed version (ground truth):
public static Map<String,RedisPoolProperty> getAllPoolConfig() throws ReadConfigException {
  Map<String,RedisPoolProperty> map=new HashMap<>();
  int maxId=0;
  MythProperties properties=null;
  try {
    maxId=getMaxId();
    properties=getProperties(Configs.propertyFile);
  }
 catch (  IOException e) {
    e.printStackTrace();
    logger.error(ExceptionInfo.OPEN_CONFIG_FAILED,e);
    return map;
  }
  for (int i=Configs.START_ID; i <= maxId; i++) {
    String poolId=properties.getString(i + Configs.SEPARATE + Configs.POOL_ID);
    if (poolId == null)     continue;
    RedisPoolProperty property=RedisPoolProperty.initByIdFromConfig(poolId);
    map.put(poolId,property);
  }
  return map;
}
Program: 175357
Project: 175357
Buggy source:
public static int getMaxId() throws IOException {
  MythProperties props=getProperties(Configs.propertyFile);
  String maxId=props.getString("String_Node_Str");
  if (maxId == null) {
    save("String_Node_Str",Configs.START_ID + "String_Node_Str");
    props=getProperties(Configs.propertyFile);
    maxId=props.getString("String_Node_Str");
  }
  return Integer.parseInt(maxId);
}

Fixed version (ground truth):
/** 
 * 获得最大的id，如果最开始没有就要新增
 * @return 返回最大的id（已用）
 * @throws IOException 文件异常
 */
public static int getMaxId() throws IOException {
  MythProperties props=getProperties(Configs.propertyFile);
  String maxId=props.getString(Configs.MAX_POOL_ID);
  if (maxId == null) {
    save(Configs.MAX_POOL_ID,Configs.START_ID + "String_Node_Str");
    props=getProperties(Configs.propertyFile);
    maxId=props.getString(Configs.MAX_POOL_ID);
  }
  return Integer.parseInt(maxId);
}
Program: 175358
Project: 175358
Buggy source:
/** 
 * 得到配置文件对象
 * @param propertyFile 文件名以及路径（完整）
 * @return
 * @throws IOException
 */
public static MythProperties getProperties(String propertyFile) throws IOException {
  MythProperties props=new MythProperties();
  File file=new File(propertyFile);
  if (!file.exists())   if (file.createNewFile()) {
    logger.info("String_Node_Str");
  }
 else {
    logger.info("String_Node_Str");
  }
  InputStream is;
  try {
    is=new BufferedInputStream(new FileInputStream(propertyFile));
  }
 catch (  FileNotFoundException e) {
    throw new IllegalArgumentException();
  }
  props.load(is);
  is.close();
  return props;
}

Fixed version (ground truth):
/** 
 * 得到配置文件对象
 * @param propertyFile 文件名以及路径（完整）
 * @return 配置文件的对象
 * @throws IOException
 */
public static MythProperties getProperties(String propertyFile) throws IOException {
  MythProperties props=new MythProperties();
  File file=new File(propertyFile);
  if (!file.exists()) {
    if (file.createNewFile()) {
      logger.info(ExceptionInfo.CREATE_CONFIG_SUCCESS);
    }
 else {
      logger.info(ExceptionInfo.CREATE_CONFIG_FIALED);
    }
  }
  InputStream is;
  try {
    is=new BufferedInputStream(new FileInputStream(propertyFile));
  }
 catch (  FileNotFoundException e) {
    throw new IllegalArgumentException();
  }
  props.load(is);
  is.close();
  return props;
}
Program: 175359
Project: 175359
Buggy source:
public static RedisPoolProperty initByIdFromConfig(String id){
  RedisPoolProperty property=new RedisPoolProperty();
  String pre=id + Configs.SEPARATE;
  List<String> lists=MythReflect.getFieldByClass(RedisPoolProperty.class);
  Map<String,Object> map=new HashMap<>();
  MythProperties config=null;
  try {
    config=PropertyFile.getProperties(Configs.propertyFile);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  for (  String field : lists) {
    map.put(field,config.getString(pre + field));
  }
  try {
    property=(RedisPoolProperty)MythReflect.setFieldsValue(property,map);
  }
 catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
  return property;
}

Fixed version (ground truth):
public static RedisPoolProperty initByIdFromConfig(String id){
  RedisPoolProperty property=new RedisPoolProperty();
  String pre=id + Configs.SEPARATE;
  List<String> lists=MythReflect.getFieldByClass(RedisPoolProperty.class);
  Map<String,Object> map=new HashMap<>();
  MythProperties config=null;
  try {
    config=PropertyFile.getProperties(Configs.propertyFile);
    for (    String field : lists) {
      map.put(field,config.getString(pre + field));
    }
    property=(RedisPoolProperty)MythReflect.setFieldsValue(property,map);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return property;
}
Program: 175360
Project: 175360
Buggy source:
/** 
 * 初始化Redis连接池
 */
protected void initialPool(){
  try {
    JedisPoolConfig config=new JedisPoolConfig();
    config.setMaxTotal(property.getMaxActive());
    config.setMaxIdle(property.getMaxIdle());
    config.setMaxWaitMillis(property.getMaxWaitMills());
    config.setTestOnBorrow(property.isTestOnBorrow());
    if (property.getPassword() != null && property.getPassword().length() > 0) {
      jedisPool=new JedisPool(config,property.getHost(),property.getPort(),property.getTimeout(),property.getPassword());
    }
 else {
      jedisPool=new JedisPool(config,property.getHost(),property.getPort(),property.getTimeout());
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + e);
  }
}

Fixed version (ground truth):
/** 
 * 初始化Redis连接池
 */
protected void initialPool(){
  try {
    JedisPoolConfig config=new JedisPoolConfig();
    config.setMaxTotal(property.getMaxActive());
    config.setMaxIdle(property.getMaxIdle());
    config.setMaxWaitMillis(property.getMaxWaitMills());
    config.setTestOnBorrow(property.isTestOnBorrow());
    if (property.getPassword() != null && property.getPassword().length() > 0) {
      jedisPool=new JedisPool(config,property.getHost(),property.getPort(),property.getTimeout(),property.getPassword());
    }
 else {
      jedisPool=new JedisPool(config,property.getHost(),property.getPort(),property.getTimeout());
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    logger.error("String_Node_Str" + e);
  }
}
Program: 175361
Project: 175361
Buggy source:
/** 
 * @param object 要赋值的对象
 * @param maps 属性名-属性值 映射
 * @throws IllegalAccessException 可能没有权限
 */
public static Object setFieldsValue(Object object,Map<String,Object> maps) throws IllegalAccessException {
  target=object.getClass();
  Field[] fields=target.getDeclaredFields();
  for (  Field field : fields) {
    field.setAccessible(true);
    String type=field.getType().getName();
switch (type) {
case "String_Node_Str":
      field.set(object,Integer.parseInt(maps.get(field.getName()).toString()));
    break;
case "String_Node_Str":
  field.set(object,maps.get(field.getName()));
break;
case "String_Node_Str":
field.set(object,"String_Node_Str".equals(maps.get(field.getName()).toString()));
break;
}
}
return object;
}

Fixed version (ground truth):
/** 
 * @param object 要赋值的对象
 * @param maps 属性名-属性值 映射
 * @throws IllegalAccessException 可能没有权限
 */
public static Object setFieldsValue(Object object,Map<String,Object> maps) throws IllegalAccessException {
  target=object.getClass();
  for (  Field field : target.getDeclaredFields()) {
    field.setAccessible(true);
    String type=field.getType().getName();
switch (type) {
case "String_Node_Str":
      field.set(object,Integer.parseInt(maps.get(field.getName()).toString()));
    break;
case "String_Node_Str":
  field.set(object,maps.get(field.getName()));
break;
case "String_Node_Str":
field.set(object,"String_Node_Str".equals(maps.get(field.getName()).toString()));
break;
}
}
return object;
}
Program: 175362
Project: 175362
Buggy source:
/** 
 * @param object 对象
 * @return 返回 对象的所有 属性-值 map
 * @throws IllegalAccessException 没有权限访问
 */
public static Map<String,Object> getFieldsValue(Object object) throws IllegalAccessException {
  Map<String,Object> map=new HashMap<>();
  target=object.getClass();
  Field[] fields=target.getDeclaredFields();
  for (  Field field : fields) {
    field.setAccessible(true);
    Object value=field.get(object);
    String name=field.getName();
    map.put(name,value);
  }
  return map;
}

Fixed version (ground truth):
/** 
 * @param object 对象
 * @return 返回 对象的所有 属性-值 map
 * @throws IllegalAccessException 没有权限访问
 */
public static Map<String,Object> getFieldsValue(Object object) throws IllegalAccessException {
  Map<String,Object> map=new HashMap<>();
  target=object.getClass();
  for (  Field field : target.getDeclaredFields()) {
    field.setAccessible(true);
    Object value=field.get(object);
    String name=field.getName();
    map.put(name,value);
  }
  return map;
}
Program: 175363
Project: 175363
Buggy source:
@Test @InSequence(1) public void countedConstructorCalled(){
  long count=1L + Math.round(Math.random() * 10);
  for (int i=0; i < count; i++)   instance.get();
  assertThat("String_Node_Str",registry.getCounters(),hasKey(COUNTER_NAME));
  Counter counter=registry.getCounters().get(COUNTER_NAME);
  assertThat("String_Node_Str",counter.getCount(),is(equalTo(count)));
}

Fixed version (ground truth):
@Test @InSequence(1) public void countedConstructorCalled(){
  long count=1L + Math.round(Math.random() * 10);
  for (int i=0; i < count; i++) {
    instance.get();
  }
  assertThat("String_Node_Str",registry.getCounters(),hasKey(COUNTER_NAME));
  Counter counter=registry.getCounters().get(COUNTER_NAME);
  assertThat("String_Node_Str",counter.getCount(),is(equalTo(count)));
}
Program: 175364
Project: 175364
Buggy source:
@Test @InSequence(1) public void meteredConstructorCalled(){
  long count=1L + Math.round(Math.random() * 10);
  for (int i=0; i < count; i++)   instance.get();
  assertThat("String_Node_Str",registry.getMeters(),hasKey(METER_NAME));
  Meter meter=registry.getMeters().get(METER_NAME);
  assertThat("String_Node_Str",meter.getCount(),is(equalTo(count)));
}

Fixed version (ground truth):
@Test @InSequence(1) public void meteredConstructorCalled(){
  long count=1L + Math.round(Math.random() * 10);
  for (int i=0; i < count; i++) {
    instance.get();
  }
  assertThat("String_Node_Str",registry.getMeters(),hasKey(METER_NAME));
  Meter meter=registry.getMeters().get(METER_NAME);
  assertThat("String_Node_Str",meter.getCount(),is(equalTo(count)));
}
Program: 175365
Project: 175365
Buggy source:
@Override public boolean hasNext(){
  if (this.exception != null) {
    throw new RuntimeException("String_Node_Str",this.exception);
  }
  return this.cursor < this.entities.size() - 1;
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  if (this.exception != null) {
    throw new RuntimeException("String_Node_Str",this.exception);
  }
  return this.cursor < this.entities.size();
}
Program: 175366
Project: 175366
Buggy source:
private double getMaxLongitude(DataTilePos pos){
  return this.getLongitude(pos) + this.tileSize.getZ();
}

Fixed version (ground truth):
private double getMaxLongitude(DataTilePos pos){
  return (pos.getTileZ() + 1) * this.tileSize.getZ();
}
Program: 175367
Project: 175367
Buggy source:
private double getMaxLatitude(DataTilePos pos){
  return this.getLatitude(pos) + this.tileSize.getX();
}

Fixed version (ground truth):
private double getMaxLatitude(DataTilePos pos){
  return (pos.getTileX() + 1) * this.tileSize.getX();
}
Program: 175368
Project: 175368
Buggy source:
private boolean isWayInBounds(OsmWay way,double minLatitude,double minLongitude,double maxLatitude,double maxLongitude){
  double wayMinLatitude=Double.MAX_VALUE;
  double wayMinLongitude=Double.MAX_VALUE;
  double wayMaxLatitude=-Double.MAX_VALUE;
  double wayMaxLongitude=-Double.MAX_VALUE;
  for (int i=0; i < way.getNumberOfNodes(); i++) {
    try {
      OsmNode node=this.getNode(way.getNodeId(i));
      double latitude=node.getLatitude();
      if (latitude < wayMinLatitude) {
        wayMinLatitude=latitude;
      }
      if (latitude > wayMaxLatitude) {
        wayMaxLatitude=latitude;
      }
      double longitude=node.getLongitude();
      if (longitude < wayMinLongitude) {
        wayMinLongitude=longitude;
      }
      if (longitude > wayMaxLongitude) {
        wayMaxLongitude=longitude;
      }
    }
 catch (    EntityNotFoundException e) {
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean isWayInBounds(OsmWay way,double minLatitude,double minLongitude,double maxLatitude,double maxLongitude){
  double wayMinLatitude=Double.MAX_VALUE;
  double wayMinLongitude=Double.MAX_VALUE;
  double wayMaxLatitude=-Double.MAX_VALUE;
  double wayMaxLongitude=-Double.MAX_VALUE;
  for (int i=0; i < way.getNumberOfNodes(); i++) {
    try {
      OsmNode node=this.getNode(way.getNodeId(i));
      double latitude=node.getLatitude();
      if (latitude < wayMinLatitude) {
        wayMinLatitude=latitude;
      }
      if (latitude > wayMaxLatitude) {
        wayMaxLatitude=latitude;
      }
      double longitude=node.getLongitude();
      if (longitude < wayMinLongitude) {
        wayMinLongitude=longitude;
      }
      if (longitude > wayMaxLongitude) {
        wayMaxLongitude=longitude;
      }
    }
 catch (    EntityNotFoundException e) {
    }
  }
  return minLatitude < wayMaxLatitude && maxLatitude > wayMinLatitude && minLongitude < wayMaxLongitude && maxLongitude > wayMinLongitude;
}
Program: 175370
Project: 175370
Buggy source:
private Collection<Result> collectPolygons(OsmTile osmTile){
  List<Result> results=new ArrayList<>();
  for (  Type type : this.polygonTypes) {
    Collection<MultiPolygon> coverPolygons=osmTile.collectPolygons(type.filter);
    if (!coverPolygons.isEmpty()) {
      results.add(new Result(type.id,coverPolygons));
    }
  }
  return results;
}

Fixed version (ground truth):
private Collection<Result> collectPolygons(DataView view,OsmTile osmTile){
  List<Result> results=new ArrayList<>();
  for (  Type type : this.polygonTypes) {
    Collection<MultiPolygon> coverPolygons=osmTile.collectPolygons(view,this.geoCoordinateState,type.filter);
    if (!coverPolygons.isEmpty()) {
      results.add(new Result(type.id,coverPolygons));
    }
  }
  return results;
}
Program: 175371
Project: 175371
Buggy source:
@Override public void adapt(RegionData data,int x,int z,int width,int height){
  OsmTile osmTile=data.getOrExcept(this.osmComponent);
  CoverRasterTile coverTile=data.getOrExcept(this.coverComponent);
  Collection<Result> polygons=this.collectPolygons(osmTile);
  if (!polygons.isEmpty()) {
    RasterCanvas canvas=new RasterCanvas(width,height);
    canvas.setOrigin(x,z);
    for (    Result result : polygons) {
      canvas.setColor(result.id + 1);
      for (      MultiPolygon polygon : result.polygons) {
        Area shape=OsmShapeProducer.toShape(polygon,this.geoCoordinateState);
        Rectangle bounds=shape.getBounds();
        if (bounds.getWidth() > 2 && bounds.getHeight() > 2) {
          canvas.fill(shape);
        }
      }
    }
    for (int localZ=0; localZ < height; localZ++) {
      for (int localX=0; localX < width; localX++) {
        int value=canvas.getData(localX,localZ);
        if (value != 0) {
          CoverType<?> coverType=this.coverTypes.get(value - 1);
          coverTile.set(localX,localZ,coverType);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void adapt(RegionData data,int x,int z,int width,int height){
  OsmTile osmTile=data.getOrExcept(this.osmComponent);
  CoverRasterTile coverTile=data.getOrExcept(this.coverComponent);
  Collection<Result> polygons=this.collectPolygons(new DataView(x,z,width,height),osmTile);
  if (!polygons.isEmpty()) {
    RasterCanvas canvas=new RasterCanvas(width,height);
    canvas.setOrigin(x,z);
    for (    Result result : polygons) {
      canvas.setColor(result.id + 1);
      for (      MultiPolygon polygon : result.polygons) {
        Area shape=OsmShapeProducer.toShape(polygon,this.geoCoordinateState);
        Rectangle bounds=shape.getBounds();
        if (bounds.getWidth() > 2 && bounds.getHeight() > 2) {
          canvas.fill(shape);
        }
      }
    }
    for (int localZ=0; localZ < height; localZ++) {
      for (int localX=0; localX < width; localX++) {
        int value=canvas.getData(localX,localZ);
        if (value != 0) {
          CoverType<?> coverType=this.coverTypes.get(value - 1);
          coverTile.set(localX,localZ,coverType);
        }
      }
    }
  }
}
Program: 175372
Project: 175372
Buggy source:
protected void rasterizeLineSegment(DataView view,ShortRasterTile resultTile,double originX,double originY,double targetX,double targetY,int bankType){
  Interpolation.interpolateLine(originX,originY,targetX,targetY,false,point -> {
    int localX=point.x - view.getX();
    int localY=point.y - view.getY();
    if (localX >= 0 && localY >= 0 && localX < view.getWidth() && localY < view.getHeight()) {
      resultTile.setShort(localX,localY,(short)bankType);
      this.freeNeighbors(view,resultTile,localX,localY);
    }
  }
);
}

Fixed version (ground truth):
protected void rasterizeLineSegment(DataView view,ShortRasterTile resultTile,double originX,double originY,double targetX,double targetY,int bankType){
  Interpolation.interpolateLine(originX,originY,targetX,targetY,false,point -> {
    int localX=point.x - view.getX();
    int localY=point.y - view.getY();
    if (localX >= 0 && localY >= 0 && localX < view.getWidth() && localY < view.getHeight()) {
      short currentBankType=resultTile.getShort(localX,localY);
      if ((currentBankType & TYPE_MASK) != BANK) {
        resultTile.setShort(localX,localY,(short)bankType);
      }
 else {
        resultTile.setShort(localX,localY,(short)(currentBankType | (bankType & ~TYPE_MASK)));
      }
      this.freeNeighbors(view,resultTile,localX,localY);
    }
  }
);
}
Program: 175373
Project: 175373
Buggy source:
@Override protected ShortRasterTile applyWater(DataView view,ShortRasterTile waterTile,OsmTile osmTile){
  List<OsmWay> coastlines=osmTile.getWays().stream().filter(way -> OsmDataParser.hasTag(way,"String_Node_Str","String_Node_Str")).collect(Collectors.toList());
  if (!coastlines.isEmpty()) {
    ShortRasterTile resultTile=waterTile.copy();
    short[] bankMap=resultTile.getShortData();
    for (    OsmWay coastline : coastlines) {
      List<Point> linePoints=this.collectLinePoints(OsmDataParser.createLines(osmTile,coastline));
      this.rasterizeLine(view,resultTile,linePoints);
    }
    this.reduceProblematicPoints(view,bankMap);
    this.floodCoastMap(view,resultTile);
    return resultTile;
  }
  return waterTile;
}

Fixed version (ground truth):
@Override protected ShortRasterTile applyWater(DataView view,ShortRasterTile waterTile,OsmTile osmTile){
  List<OsmWay> coastlines=osmTile.getWays().stream().filter(way -> OsmDataParser.hasTag(way,"String_Node_Str","String_Node_Str")).collect(Collectors.toList());
  if (!coastlines.isEmpty()) {
    ShortRasterTile resultTile=waterTile.copy();
    short[] bankMap=resultTile.getShortData();
    for (    OsmWay coastline : coastlines) {
      List<Point> linePoints=this.collectLinePoints(OsmDataParser.createLines(osmTile,coastline));
      this.rasterizeLine(view,resultTile,linePoints);
    }
    this.reduceProblematicPoints(view,bankMap);
    DebugImageWriter.write("String_Node_Str" + view.getX() + "String_Node_Str"+ view.getY(),bankMap,BANK_DEBUG,view.getWidth(),view.getHeight());
    this.floodCoastMap(view,resultTile);
    DebugImageWriter.write("String_Node_Str" + view.getX() + "String_Node_Str"+ view.getY()+ "String_Node_Str",bankMap,BANK_DEBUG,view.getWidth(),view.getHeight());
    return resultTile;
  }
  return waterTile;
}
Program: 175374
Project: 175374
Buggy source:
protected void reduceProblematicPoints(DataView view,short[] bankMap){
  int width=view.getWidth();
  int height=view.getHeight();
  for (int localY=0; localY < height; localY++) {
    for (int localX=0; localX < width; localX++) {
      int index=localX + localY * width;
      int bankType=bankMap[index];
      if (this.isFillingBankType(bankType)) {
        int upType=(localY > 0) ? bankMap[index - width] : bankType;
        int leftType=(localX > 0) ? bankMap[index - 1] : bankType;
        int downType=(localY < height - 1) ? bankMap[index + width] : bankType;
        int rightType=(localX < width - 1) ? bankMap[index + 1] : bankType;
        if ((upType != bankType && downType != bankType) ^ (leftType != bankType && rightType != bankType)) {
          bankMap[index]=BANK;
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void reduceProblematicPoints(DataView view,short[] bankMap){
  int width=view.getWidth();
  int height=view.getHeight();
  for (int localY=0; localY < height; localY++) {
    for (int localX=0; localX < width; localX++) {
      int index=localX + localY * width;
      int bankType=bankMap[index];
      if (this.isFillingBankType(bankType)) {
        if ((bankType & BANK_UP_FLAG) != 0 && (bankType & BANK_DOWN_FLAG) != 0) {
          bankMap[index]=BANK;
        }
 else {
          int upType=(localY > 0) ? bankMap[index - width] : bankType;
          int leftType=(localX > 0) ? bankMap[index - 1] : bankType;
          int downType=(localY < height - 1) ? bankMap[index + width] : bankType;
          int rightType=(localX < width - 1) ? bankMap[index + 1] : bankType;
          if ((upType != bankType && downType != bankType) && (leftType != bankType && rightType != bankType)) {
            bankMap[index]=BANK;
          }
        }
      }
    }
  }
}
Program: 175375
Project: 175375
Buggy source:
@Override public DataView getParentView(DataView view){
  return view.grow(8,8,8,8);
}

Fixed version (ground truth):
@Override public DataView getParentView(DataView view){
  return view;
}
Program: 175376
Project: 175376
Buggy source:
@Override protected ShortRasterTile applyWater(DataView view,ShortRasterTile waterTile,OsmTile osmTile){
  Collection<MultiPolygon> waterPolygons=osmTile.collectPolygons(this::isWaterArea);
  if (!waterPolygons.isEmpty()) {
    ShortRasterTile resultTile=waterTile.copy();
    RasterCanvas canvas=new RasterCanvas(view.getWidth(),view.getHeight());
    canvas.setOrigin(view.getX(),view.getY());
    canvas.setColor(RIVER_COLOR);
    for (    MultiPolygon polygon : waterPolygons) {
      Area shape=OsmShapeProducer.toShape(polygon,this.geoCoordinateState);
      Rectangle bounds=shape.getBounds();
      if (bounds.getWidth() > 2 && bounds.getHeight() > 2) {
        canvas.fill(shape);
      }
    }
    this.fillExistingWater(view,resultTile,canvas);
    for (int localZ=0; localZ < view.getHeight(); localZ++) {
      for (int localX=0; localX < view.getWidth(); localX++) {
        int value=canvas.getData(localX,localZ);
        if (value == RIVER_COLOR) {
          resultTile.setShort(localX,localZ,RIVER);
        }
      }
    }
    return resultTile;
  }
  return waterTile;
}

Fixed version (ground truth):
@Override protected ShortRasterTile applyWater(DataView view,ShortRasterTile waterTile,OsmTile osmTile){
  Collection<MultiPolygon> waterPolygons=osmTile.collectPolygons(view,this.geoCoordinateState,this::isWaterArea);
  if (!waterPolygons.isEmpty()) {
    ShortRasterTile resultTile=waterTile.copy();
    RasterCanvas canvas=new RasterCanvas(view.getWidth(),view.getHeight());
    canvas.setOrigin(view.getX(),view.getY());
    canvas.setColor(RIVER_COLOR);
    for (    MultiPolygon polygon : waterPolygons) {
      Area shape=OsmShapeProducer.toShape(polygon,this.geoCoordinateState);
      Rectangle bounds=shape.getBounds();
      if (bounds.getWidth() > 2 && bounds.getHeight() > 2) {
        canvas.fill(shape);
      }
    }
    this.fillExistingWater(view,resultTile,canvas);
    DebugImageWriter.write("String_Node_Str" + view.getX() + "String_Node_Str"+ view.getY(),resultTile.getData(),OsmCoastlineLayer.BANK_DEBUG,view.getWidth(),view.getHeight());
    for (int localZ=0; localZ < view.getHeight(); localZ++) {
      for (int localX=0; localX < view.getWidth(); localX++) {
        int value=canvas.getData(localX,localZ);
        if (value == RIVER_COLOR) {
          resultTile.setShort(localX,localZ,RIVER);
        }
      }
    }
    DebugImageWriter.write("String_Node_Str" + view.getX() + "String_Node_Str"+ view.getY()+ "String_Node_Str",resultTile.getData(),OsmCoastlineLayer.BANK_DEBUG,view.getWidth(),view.getHeight());
    return resultTile;
  }
  return waterTile;
}
Program: 175377
Project: 175377
Buggy source:
public Collection<MultiPolygon> collectPolygons(Predicate<OsmEntity> filter){
  List<MultiPolygon> polygons=this.getRelations().stream().filter(filter).map(relation -> OsmDataParser.createArea(this,relation)).filter(Objects::nonNull).collect(Collectors.toList());
  polygons.addAll(this.getWays().stream().filter(filter).map(way -> OsmDataParser.createArea(this,way)).filter(Objects::nonNull).collect(Collectors.toList()));
  return polygons;
}

Fixed version (ground truth):
public Collection<MultiPolygon> collectPolygons(DataView view,CoordinateState geoCoordinate,Predicate<OsmEntity> filter){
  double minLatitude=geoCoordinate.getZ(view.getX(),view.getY());
  double minLongitude=geoCoordinate.getX(view.getMaxX(),view.getMaxY());
  double maxLatitude=geoCoordinate.getZ(view.getMaxX(),view.getMaxY());
  double maxLongitude=geoCoordinate.getX(view.getX(),view.getY());
  List<MultiPolygon> polygons=this.getRelations().stream().filter(filter).filter(relation -> this.isRelationInBounds(relation,minLatitude,minLongitude,maxLatitude,maxLongitude)).map(relation -> OsmDataParser.createArea(this,relation)).filter(Objects::nonNull).collect(Collectors.toList());
  polygons.addAll(this.getWays().stream().filter(filter).filter(way -> this.isWayInBounds(way,minLatitude,minLongitude,maxLatitude,maxLongitude)).map(way -> OsmDataParser.createArea(this,way)).filter(Objects::nonNull).collect(Collectors.toList()));
  return polygons;
}
Program: 175378
Project: 175378
Buggy source:
private void collectCompletedTiles(){
  if (this.queuedTiles.isEmpty()) {
    return;
  }
  Set<DataTileKey<?>> completedTiles=new HashSet<>();
  for (  TileFuture<?> future : this.queuedTiles.values()) {
    if (future.isComplete()) {
      TiledDataAccess parsedResult=this.parseResult(future);
      this.tileCache.put(future.key,parsedResult);
      completedTiles.add(future.key);
    }
  }
  completedTiles.forEach(this.queuedTiles::remove);
  System.out.println(this.tileCache.size());
}

Fixed version (ground truth):
private void collectCompletedTiles(){
  if (this.queuedTiles.isEmpty()) {
    return;
  }
  Set<DataTileKey<?>> completedTiles=new HashSet<>();
  for (  TileFuture<?> future : this.queuedTiles.values()) {
    if (future.isComplete()) {
      TiledDataAccess parsedResult=this.parseResult(future);
      this.tileCache.put(future.key,parsedResult);
      completedTiles.add(future.key);
    }
  }
  completedTiles.forEach(this.queuedTiles::remove);
}
Program: 175379
Project: 175379
Buggy source:
private void buildFaces(BufferBuilder builder,List<EnumFacing> faces,IBlockState state,Biome biome,BlockPos pos){
  int color=this.getBlockColor(state,biome,pos);
  int red=(color >> 16) & 0xFF;
  int green=(color >> 8) & 0xFF;
  int blue=color & 0xFF;
  builder.setTranslation(pos.getX(),pos.getY(),pos.getZ());
  for (  EnumFacing face : faces) {
    this.buildFace(builder,face,red,green,blue);
  }
}

Fixed version (ground truth):
private void buildFaces(BufferBuilder builder,List<EnumFacing> faces,IBlockState state,Biome biome,BlockPos pos,int x,int z){
  int color=this.getBlockColor(state,biome,pos);
  int red=(color >> 16) & 0xFF;
  int green=(color >> 8) & 0xFF;
  int blue=color & 0xFF;
  builder.setTranslation(x,pos.getY(),z);
  for (  EnumFacing face : faces) {
    this.buildFace(builder,face,red,green,blue);
  }
}