nus-yam/ex-repair huggingface dataset:
Program: 8801
Project: 8801
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  if (mRootView == null) {
    mRootView=inflater.inflate(R.layout.weather_fragment,container,false);
    initViews(mRootView);
    isPrepared=true;
    isLoaded=false;
    if (isVisible) {
      if (isNeedRequestNet()) {
        getWeather(mCurCity.getPostID());
      }
 else {
        loadWeatherInfoFromLocal();
      }
    }
 else {
      loadWeatherInfoFromLocal();
    }
  }
 else {
    ViewGroup mRootParent=(ViewGroup)mRootView.getParent();
    if (mRootParent != null) {
      mRootParent.removeView(mRootView);
    }
    if (isLoaded) {
      updateWeatherView();
    }
 else {
      if (isVisible) {
switch (mAsynState) {
case INIT:
          if (isNeedRequestNet()) {
            mAsynState=AsynTaskState.PROCESSING;
            getWeather(mCurCity.getPostID());
            if (mPullRefreshScrollView.getState() != State.MANUAL_REFRESHING)             mPullRefreshScrollView.setRefreshing();
          }
 else {
            loadWeatherInfoFromLocal();
          }
        break;
case PROCESSING:
      if (mPullRefreshScrollView.getState() != State.MANUAL_REFRESHING)       mPullRefreshScrollView.setRefreshing();
    break;
case RPOCESSED:
  if (mPullRefreshScrollView.getState() != State.MANUAL_REFRESHING)   mPullRefreshScrollView.setRefreshing();
break;
case COMPLETE:
updateWeatherView();
break;
}
}
 else {
}
}
}
return mRootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mCurCity=getArguments().getParcelable(ARG_CITY);
  Log.i("String_Node_Str","String_Node_Str" + "String_Node_Str" + mCurCity.getName() + "String_Node_Str"+ mRootView+ "String_Node_Str"+ isVisible+ "String_Node_Str"+ isLoaded);
  if (mRootView == null) {
    mRootView=inflater.inflate(R.layout.weather_fragment,container,false);
    initViews(mRootView);
    isPrepared=true;
    isLoaded=false;
    if (isVisible) {
      if (isNeedRequestNet()) {
        getWeather(mCurCity.getPostID());
      }
 else {
        loadWeatherInfoFromLocal();
      }
    }
 else {
      loadWeatherInfoFromLocal();
    }
  }
 else {
    ViewGroup mRootParent=(ViewGroup)mRootView.getParent();
    if (mRootParent != null) {
      mRootParent.removeView(mRootView);
    }
    if (isLoaded) {
      updateWeatherView();
    }
 else {
      if (isVisible) {
switch (mAsynState) {
case INIT:
          if (isNeedRequestNet()) {
            getWeather(mCurCity.getPostID());
          }
 else {
            loadWeatherInfoFromLocal();
          }
        break;
case PROCESSING:
case RPOCESSED:
      if (!mPullRefreshScrollView.isRefreshing())       mPullRefreshScrollView.setRefreshing();
    break;
case COMPLETE:
  updateWeatherView();
break;
}
}
 else {
}
}
}
return mRootView;
}
Program: 8802
Project: 8802
Buggy source:
@Override public void onErrorResponse(VolleyError error){
  mAsynState=AsynTaskState.RPOCESSED;
  mPullRefreshScrollView.onRefreshComplete();
  if (getActivity() != null)   Toast.makeText(getActivity(),"String_Node_Str" + mCurCity.getName(),Toast.LENGTH_SHORT).show();
  mAsynState=AsynTaskState.COMPLETE;
}

Fixed version (ground truth):
@Override public void onErrorResponse(VolleyError error){
  mAsynState=AsynTaskState.RPOCESSED;
  if (mPullRefreshScrollView.isRefreshing())   mPullRefreshScrollView.onRefreshComplete();
  if (getActivity() != null)   Toast.makeText(getActivity(),"String_Node_Str" + mCurCity.getName(),Toast.LENGTH_SHORT).show();
  mAsynState=AsynTaskState.COMPLETE;
}
Program: 8803
Project: 8803
Buggy source:
private void updateUI(){
  L.i("String_Node_Str");
  if (mTmpCities.isEmpty()) {
    visibleAddCityBtn();
    return;
  }
  mFragmentAdapter=new WeatherPagerAdapter(this);
  mFragmentAdapter.addAllItems(mTmpCities);
  mMainViewPager.setAdapter(mFragmentAdapter);
  mMainViewPager.setOffscreenPageLimit(mFragmentAdapter.getCount() - 1);
  mCirclePageIndicator.setViewPager(mMainViewPager);
  mCirclePageIndicator.setOnPageChangeListener(this);
  mMenuAdapter.addContent(mTmpCities);
  if (mAddCityBtn.getVisibility() == View.VISIBLE)   mAddCityBtn.setVisibility(View.GONE);
  if (mTmpCities.size() > 1)   mCirclePageIndicator.setVisibility(View.VISIBLE);
 else   mCirclePageIndicator.setVisibility(View.GONE);
  mShareBtn.setEnabled(true);
  int defaultTab=PreferenceUtils.getPrefInt(this,INSTANCESTATE_TAB,0);
  if (defaultTab > (mTmpCities.size() - 1))   defaultTab=0;
  mMainViewPager.setCurrentItem(defaultTab,true);
  mTitleTextView.setText(mFragmentAdapter.getPageTitle(defaultTab));
  if (mTmpCities.get(defaultTab).getIsLocation())   mLocationIV.setVisibility(View.VISIBLE);
 else   mLocationIV.setVisibility(View.GONE);
}

Fixed version (ground truth):
private void updateUI(){
  L.i("String_Node_Str");
  if (mTmpCities.isEmpty()) {
    visibleAddCityBtn();
    return;
  }
  mFragmentAdapter.addAllItems(mTmpCities);
  mMenuAdapter.addContent(mTmpCities);
  if (mAddCityBtn.getVisibility() == View.VISIBLE)   mAddCityBtn.setVisibility(View.GONE);
  if (mTmpCities.size() > 1)   mCirclePageIndicator.setVisibility(View.VISIBLE);
 else   mCirclePageIndicator.setVisibility(View.GONE);
  mShareBtn.setEnabled(true);
  int defaultTab=PreferenceUtils.getPrefInt(this,INSTANCESTATE_TAB,0);
  if (defaultTab > (mTmpCities.size() - 1))   defaultTab=0;
  mMainViewPager.setCurrentItem(defaultTab,true);
  mTitleTextView.setText(mFragmentAdapter.getPageTitle(defaultTab));
  if (mTmpCities.get(defaultTab).getIsLocation())   mLocationIV.setVisibility(View.VISIBLE);
 else   mLocationIV.setVisibility(View.GONE);
}
Program: 8804
Project: 8804
Buggy source:
@Override protected void onPause(){
  super.onPause();
  PreferenceUtils.setPrefInt(this,INSTANCESTATE_TAB,mMainViewPager.getCurrentItem());
  if (mFragmentAdapter != null)   mFragmentAdapter.clearItems();
}

Fixed version (ground truth):
@Override protected void onPause(){
  super.onPause();
  PreferenceUtils.setPrefInt(this,INSTANCESTATE_TAB,mMainViewPager.getCurrentItem());
}
Program: 8805
Project: 8805
Buggy source:
private void initViews(){
  setSwipeBackEnable(false);
  mBlurImageView=(ImageView)findViewById(R.id.blur_overlay_img);
  mRootView=(FrameLayout)findViewById(R.id.root_view);
  mAddCityBtn=(Button)findViewById(R.id.add_city_btn);
  mAddCityBtn.setOnClickListener(this);
  mTitleTextView=(TextView)findViewById(R.id.location_city_textview);
  mLocationIV=(ImageView)findViewById(R.id.curr_loc_icon);
  mMainViewPager=(ViewPager)findViewById(R.id.main_viewpager);
  mCirclePageIndicator=(CirclePageIndicator)findViewById(R.id.indicator);
  mTitleTextView.setOnClickListener(this);
  findViewById(R.id.sidebarButton).setOnClickListener(this);
  mShareBtn=(ImageView)findViewById(R.id.shareButton);
  mShareBtn.setOnClickListener(this);
}

Fixed version (ground truth):
private void initViews(){
  setSwipeBackEnable(false);
  mBlurImageView=(ImageView)findViewById(R.id.blur_overlay_img);
  mRootView=(FrameLayout)findViewById(R.id.root_view);
  mAddCityBtn=(Button)findViewById(R.id.add_city_btn);
  mAddCityBtn.setOnClickListener(this);
  mTitleTextView=(TextView)findViewById(R.id.location_city_textview);
  mLocationIV=(ImageView)findViewById(R.id.curr_loc_icon);
  mMainViewPager=(ViewPager)findViewById(R.id.main_viewpager);
  mFragmentAdapter=new WeatherPagerAdapter(this);
  mMainViewPager.setAdapter(mFragmentAdapter);
  mCirclePageIndicator=(CirclePageIndicator)findViewById(R.id.indicator);
  mCirclePageIndicator.setViewPager(mMainViewPager);
  mCirclePageIndicator.setOnPageChangeListener(this);
  mTitleTextView.setOnClickListener(this);
  findViewById(R.id.sidebarButton).setOnClickListener(this);
  mShareBtn=(ImageView)findViewById(R.id.shareButton);
  mShareBtn.setOnClickListener(this);
}
Program: 8806
Project: 8806
Buggy source:
/** 
 * Method that sets the current page position.
 * @param currentPage The current page.
 */
public void setCurrentPage(final int currentPage){
  mCurrentPage=currentPage;
}

Fixed version (ground truth):
/** 
 * Method that sets the current page position.
 * @param currentPage The current page.
 */
public void setCurrentPage(final int currentPage){
  mCurrentPage=currentPage;
  Log.i("String_Node_Str","String_Node_Str" + currentPage);
  if (mCurrentPage < 0 || mCurrentPage >= getCount())   return;
  final WeakReference<Fragment> weakFragment=mFragmentArray.get(currentPage);
  Log.i("String_Node_Str","String_Node_Str" + weakFragment);
  if (weakFragment != null && weakFragment.get() != null) {
    WeatherFragment fragment=(WeatherFragment)weakFragment.get();
    Log.i("String_Node_Str","String_Node_Str" + fragment);
    fragment.refreshUI();
  }
}
Program: 8807
Project: 8807
Buggy source:
@Override protected void onResume(){
  super.onResume();
  mTmpCities=getTmpCities();
  if (!mTmpCities.isEmpty()) {
    updateUI();
  }
 else {
    startActivity(new Intent(MainActivity.this,QueryCityActivity.class));
  }
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  mTmpCities=getTmpCities();
  if (!mTmpCities.isEmpty()) {
    updateUI();
  }
 else {
    if (PreferenceUtils.getPrefBoolean(this,FIRST_RUN_APP,true)) {
      startActivity(new Intent(MainActivity.this,QueryCityActivity.class));
      PreferenceUtils.setPrefBoolean(this,FIRST_RUN_APP,false);
    }
  }
}
Program: 8808
Project: 8808
Buggy source:
public CharSequence formatBigMessage(String city){
  final TextAppearanceSpan notificationSubjectSpan=new TextAppearanceSpan(this,R.style.NotificationPrimaryText);
  final String message=!TextUtils.isEmpty(city) ? city : "String_Node_Str";
  String afterStr="String_Node_Str";
  SpannableStringBuilder spannableStringBuilder=new SpannableStringBuilder(city);
  if (!TextUtils.isEmpty(afterStr)) {
    spannableStringBuilder.append(afterStr);
    spannableStringBuilder.setSpan(notificationSubjectSpan,city.length(),city.length() + afterStr.length(),0);
  }
  return spannableStringBuilder;
}

Fixed version (ground truth):
public CharSequence formatBigMessage(String city){
  final TextAppearanceSpan notificationSubjectSpan=new TextAppearanceSpan(this,R.style.NotificationPrimaryText);
  final String message=!TextUtils.isEmpty(city) ? city : "String_Node_Str";
  String afterStr="String_Node_Str";
  SpannableStringBuilder spannableStringBuilder=new SpannableStringBuilder(message);
  if (!TextUtils.isEmpty(afterStr)) {
    spannableStringBuilder.append(afterStr);
    spannableStringBuilder.setSpan(notificationSubjectSpan,message.length(),message.length() + afterStr.length(),0);
  }
  return spannableStringBuilder;
}
Program: 8809
Project: 8809
Buggy source:
/** 
 * 更新天气信息界面
 */
private void updateWeatherView(WeatherInfo weatherInfo){
  if (WeatherSpider.isEmpty(weatherInfo)) {
    Toast.makeText(mActivity,"String_Node_Str",Toast.LENGTH_SHORT).show();
    return;
  }
  if (!isVisible)   return;
  isLoaded=true;
  if (weatherInfo.isNewData())   Toast.makeText(mActivity,mCurCity.getName() + "String_Node_Str",Toast.LENGTH_SHORT).show();
  RealTime realTime=weatherInfo.getRealTime();
  AQI aqi=weatherInfo.getAqi();
  Forecast forecast=weatherInfo.getForecast();
  Index index=weatherInfo.getIndex();
  int type=realTime.getAnimation_type();
  mNormalImageView.setImageResource(WeatherIconUtils.getWeatherNromalBg(type));
  mBlurredImageView.setImageResource(WeatherIconUtils.getWeatherBlurBg(type));
  mCurWeatherIV.setImageResource(WeatherIconUtils.getWeatherIcon(type));
  mCurWeatherTV.setText(realTime.getWeather_name());
  mCurFeelsTempTV.setText(realTime.getTemp() + "String_Node_Str");
  mCurHighTempTV.setText(forecast.getTmpHigh(1) + "String_Node_Str");
  mCurLowTempTV.setText(forecast.getTmpLow(1) + "String_Node_Str");
  mCurWeatherCopyTV.setText(TimeUtils.getDay(realTime.getPub_time()) + "String_Node_Str");
  mWeatherAdapter=new WeatherListAdapter(getActivity());
  mListView.setAdapter(mWeatherAdapter);
  mWeatherAdapter.setWeather(realTime,aqi,forecast,index);
}

Fixed version (ground truth):
/** 
 * 更新天气信息界面
 */
private void updateWeatherView(WeatherInfo weatherInfo){
  if (WeatherSpider.isEmpty(weatherInfo)) {
    Toast.makeText(mActivity,"String_Node_Str",Toast.LENGTH_SHORT).show();
    return;
  }
  if (!isVisible)   return;
  isLoaded=true;
  if (weatherInfo.isNewData())   Toast.makeText(mActivity,mCurCity.getName() + "String_Node_Str",Toast.LENGTH_SHORT).show();
  RealTime realTime=weatherInfo.getRealTime();
  AQI aqi=weatherInfo.getAqi();
  Forecast forecast=weatherInfo.getForecast();
  Index index=weatherInfo.getIndex();
  int type=realTime.getAnimation_type();
  mNormalImageView.setImageResource(WeatherIconUtils.getWeatherNromalBg(type));
  mBlurredImageView.setImageResource(WeatherIconUtils.getWeatherBlurBg(type));
  mCurWeatherIV.setImageResource(WeatherIconUtils.getWeatherIcon(type));
  mCurWeatherTV.setText(realTime.getWeather_name());
  mCurFeelsTempTV.setText(realTime.getTemp() + "String_Node_Str");
  mCurHighTempTV.setText(forecast.getTmpHigh(1) + "String_Node_Str");
  mCurLowTempTV.setText(forecast.getTmpLow(1) + "String_Node_Str");
  mCurWeatherCopyTV.setText(TimeUtils.getDay(realTime.getPub_time()) + "String_Node_Str");
  mWeatherAdapter.setWeather(realTime,aqi,forecast,index);
}
Program: 8810
Project: 8810
Buggy source:
/** 
 * 初始化所有的view
 * @param view
 */
private void initViews(View view){
  mListView=(ListView)view.findViewById(R.id.drag_list);
  mNormalImageView=(ImageView)view.findViewById(R.id.weather_background);
  mBlurredImageView=(ImageView)view.findViewById(R.id.weather_background_blurred);
  mBlurredImageView.setAlpha(0f);
  mPullRefreshScrollView=(PullToRefreshScrollView)view.findViewById(R.id.pull_refresh_scrollview);
  mPullRefreshScrollView.setOnRefreshListener(this);
  mPullRefreshScrollView.setOnPullEventListener(this);
  mListHeaderView=LayoutInflater.from(getActivity()).inflate(R.layout.weather_current_condition,null);
  int displayHeight=SystemUtils.getDisplayHeight(getActivity());
  mHeaderHeight=displayHeight - getResources().getDimensionPixelSize(R.dimen.abs__action_bar_default_height);
  mListHeaderView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,mHeaderHeight));
  int backgroundHeight=displayHeight + mHeaderHeight / 8;
  mNormalImageView.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,backgroundHeight));
  mBlurredImageView.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,backgroundHeight));
  mListView.addHeaderView(mListHeaderView,null,false);
  mListView.setOnScrollListener(mOnScrollListener);
  initCurWeatherViews(view);
}

Fixed version (ground truth):
/** 
 * 初始化所有的view
 * @param view
 */
private void initViews(View view){
  mListView=(ListView)view.findViewById(R.id.drag_list);
  mWeatherAdapter=new WeatherListAdapter(getActivity());
  mListView.setAdapter(mWeatherAdapter);
  mNormalImageView=(ImageView)view.findViewById(R.id.weather_background);
  mBlurredImageView=(ImageView)view.findViewById(R.id.weather_background_blurred);
  mBlurredImageView.setAlpha(0f);
  mPullRefreshScrollView=(PullToRefreshScrollView)view.findViewById(R.id.pull_refresh_scrollview);
  mPullRefreshScrollView.setOnRefreshListener(this);
  mPullRefreshScrollView.setOnPullEventListener(this);
  mListHeaderView=LayoutInflater.from(getActivity()).inflate(R.layout.weather_current_condition,null);
  int displayHeight=SystemUtils.getDisplayHeight(getActivity());
  mHeaderHeight=displayHeight - getResources().getDimensionPixelSize(R.dimen.abs__action_bar_default_height);
  mListHeaderView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,mHeaderHeight));
  int backgroundHeight=displayHeight + mHeaderHeight / 8;
  mNormalImageView.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,backgroundHeight));
  mBlurredImageView.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,backgroundHeight));
  mListView.addHeaderView(mListHeaderView,null,false);
  mListView.setOnScrollListener(mOnScrollListener);
  initCurWeatherViews(view);
}
Program: 8811
Project: 8811
Buggy source:
@SuppressWarnings("String_Node_Str") public void onActivityCreate(){
  mActivity.getWindow().setBackgroundDrawable(new ColorDrawable(0));
  mActivity.getWindow().getDecorView().setBackgroundDrawable(null);
  mSwipeBackLayout=(SwipeBackLayout)LayoutInflater.from(mActivity).inflate(com.way.yahoo.R.layout.swipeback_layout,null);
  mSwipeBackLayout.addSwipeListener(new SwipeBackLayout.SwipeListener(){
    @Override public void onScrollStateChange(    int state,    float scrollPercent){
      if (state == SwipeBackLayout.STATE_IDLE && scrollPercent == 0) {
        convertActivityFromTranslucent();
      }
    }
    @Override public void onEdgeTouch(    int edgeFlag){
      convertActivityToTranslucent();
    }
    @Override public void onScrollOverThreshold(){
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void onActivityCreate(){
  mActivity.getWindow().setBackgroundDrawable(new ColorDrawable(0));
  mActivity.getWindow().getDecorView().setBackgroundDrawable(null);
  mSwipeBackLayout=(SwipeBackLayout)LayoutInflater.from(mActivity).inflate(com.way.yahoo.R.layout.swipeback_layout,null);
  mSwipeBackLayout.addSwipeListener(new SwipeBackLayout.SwipeListener(){
    @Override public void onScrollStateChange(    int state,    float scrollPercent){
      if (state == SwipeBackLayout.STATE_IDLE && scrollPercent == 0) {
        convertActivityFromTranslucent();
      }
    }
    @Override public void onEdgeTouch(    int edgeFlag){
      convertActivityToTranslucent();
    }
    @Override public void onScrollOverThreshold(){
    }
    @Override public void onScrollLeftChange(    int left){
    }
  }
);
}
Program: 8812
Project: 8812
Buggy source:
@Override public boolean tryCaptureView(View view,int i){
  boolean ret=mDragHelper.isEdgeTouched(mEdgeFlag,i);
  if (ret) {
    if (mDragHelper.isEdgeTouched(EDGE_LEFT,i)) {
      mTrackingEdge=EDGE_LEFT;
    }
 else     if (mDragHelper.isEdgeTouched(EDGE_RIGHT,i)) {
      mTrackingEdge=EDGE_RIGHT;
    }
 else     if (mDragHelper.isEdgeTouched(EDGE_BOTTOM,i)) {
      mTrackingEdge=EDGE_BOTTOM;
    }
    if (mListeners != null && !mListeners.isEmpty()) {
      for (      SwipeListener listener : mListeners) {
        listener.onEdgeTouch(mTrackingEdge);
      }
    }
    mIsScrollOverValid=true;
  }
  return ret;
}

Fixed version (ground truth):
@Override public boolean tryCaptureView(View view,int i){
  boolean ret=mDragHelper.isEdgeTouched(mEdgeFlag,i);
  if (ret) {
    if (mDragHelper.isEdgeTouched(EDGE_LEFT,i)) {
      mTrackingEdge=EDGE_LEFT;
    }
 else     if (mDragHelper.isEdgeTouched(EDGE_RIGHT,i)) {
      mTrackingEdge=EDGE_RIGHT;
    }
 else     if (mDragHelper.isEdgeTouched(EDGE_BOTTOM,i)) {
      mTrackingEdge=EDGE_BOTTOM;
    }
    if (mListeners != null && !mListeners.isEmpty()) {
      for (      SwipeListener listener : mListeners) {
        listener.onEdgeTouch(mTrackingEdge);
      }
    }
    mIsScrollOverValid=true;
  }
  boolean directionCheck=false;
  if (mEdgeFlag == EDGE_LEFT || mEdgeFlag == EDGE_RIGHT) {
    directionCheck=!mDragHelper.checkTouchSlop(ViewDragHelper.DIRECTION_VERTICAL,i);
  }
 else   if (mEdgeFlag == EDGE_BOTTOM) {
    directionCheck=!mDragHelper.checkTouchSlop(ViewDragHelper.DIRECTION_HORIZONTAL,i);
  }
 else   if (mEdgeFlag == EDGE_ALL) {
    directionCheck=true;
  }
  return ret & directionCheck;
}
Program: 8813
Project: 8813
Buggy source:
@Override public void onViewPositionChanged(View changedView,int left,int top,int dx,int dy){
  super.onViewPositionChanged(changedView,left,top,dx,dy);
  if ((mTrackingEdge & EDGE_LEFT) != 0) {
    mScrollPercent=Math.abs((float)left / (mContentView.getWidth() + mShadowLeft.getIntrinsicWidth()));
  }
 else   if ((mTrackingEdge & EDGE_RIGHT) != 0) {
    mScrollPercent=Math.abs((float)left / (mContentView.getWidth() + mShadowRight.getIntrinsicWidth()));
  }
 else   if ((mTrackingEdge & EDGE_BOTTOM) != 0) {
    mScrollPercent=Math.abs((float)top / (mContentView.getHeight() + mShadowBottom.getIntrinsicHeight()));
  }
  mContentLeft=left;
  mContentTop=top;
  invalidate();
  if (mScrollPercent < mScrollThreshold && !mIsScrollOverValid) {
    mIsScrollOverValid=true;
  }
  if (mListeners != null && !mListeners.isEmpty() && mDragHelper.getViewDragState() == STATE_DRAGGING && mScrollPercent >= mScrollThreshold && mIsScrollOverValid) {
    mIsScrollOverValid=false;
    for (    SwipeListener listener : mListeners) {
      listener.onScrollOverThreshold();
    }
  }
  if (mScrollPercent >= 1) {
    if (!mActivity.isFinishing())     mActivity.finish();
  }
}

Fixed version (ground truth):
@Override public void onViewPositionChanged(View changedView,int left,int top,int dx,int dy){
  for (  SwipeListener listener : mListeners) {
    listener.onScrollLeftChange(left);
  }
  super.onViewPositionChanged(changedView,left,top,dx,dy);
  if ((mTrackingEdge & EDGE_LEFT) != 0) {
    mScrollPercent=Math.abs((float)left / (mContentView.getWidth() + mShadowLeft.getIntrinsicWidth()));
  }
 else   if ((mTrackingEdge & EDGE_RIGHT) != 0) {
    mScrollPercent=Math.abs((float)left / (mContentView.getWidth() + mShadowRight.getIntrinsicWidth()));
  }
 else   if ((mTrackingEdge & EDGE_BOTTOM) != 0) {
    mScrollPercent=Math.abs((float)top / (mContentView.getHeight() + mShadowBottom.getIntrinsicHeight()));
  }
  mContentLeft=left;
  mContentTop=top;
  invalidate();
  if (mScrollPercent < mScrollThreshold && !mIsScrollOverValid) {
    mIsScrollOverValid=true;
  }
  if (mListeners != null && !mListeners.isEmpty() && mDragHelper.getViewDragState() == STATE_DRAGGING && mScrollPercent >= mScrollThreshold && mIsScrollOverValid) {
    mIsScrollOverValid=false;
    for (    SwipeListener listener : mListeners) {
      listener.onScrollOverThreshold();
    }
  }
  if (mScrollPercent >= 1) {
    if (!mActivity.isFinishing()) {
      mActivity.finish();
      mActivity.overridePendingTransition(0,0);
    }
  }
}
Program: 8817
Project: 8817
Buggy source:
public LLand(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  setFocusable(true);
  PARAMS=new Params(getResources());
  setTimeOfDay();
}

Fixed version (ground truth):
public LLand(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  setFocusable(true);
  PARAMS=new Params(getResources());
  mTimeOfDay=irand(0,SKIES.length);
  if (Build.VERSION.SDK_INT >= 17)   setLayoutDirection(LAYOUT_DIRECTION_LTR);
}
Program: 8818
Project: 8818
Buggy source:
@Override public boolean onTrackballEvent(MotionEvent ev){
  if (DEBUG)   L("String_Node_Str",ev);
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
    poke();
  return true;
case MotionEvent.ACTION_UP:
unpoke();
return true;
}
return false;
}

Fixed version (ground truth):
@Override public boolean onTrackballEvent(MotionEvent ev){
  L("String_Node_Str",ev);
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
    poke();
  return true;
case MotionEvent.ACTION_UP:
unpoke();
return true;
}
return false;
}
Program: 8819
Project: 8819
Buggy source:
public Player(Context context){
  super(context);
  setBackgroundResource(R.drawable.android);
  if (Build.VERSION.SDK_INT >= 21) {
    getBackground().setTintMode(PorterDuff.Mode.SRC_ATOP);
    getBackground().setTint(0xFF00FF00);
    setOutlineProvider(new ViewOutlineProvider(){
      @TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void getOutline(      View view,      Outline outline){
        final int w=view.getWidth();
        final int h=view.getHeight();
        final int ix=(int)(w * 0.3f);
        final int iy=(int)(h * 0.2f);
        outline.setRect(ix,iy,w - ix,h - iy);
      }
    }
);
  }
}

Fixed version (ground truth):
public Player(Context context){
  super(context);
  setBackgroundResource(R.drawable.android);
  if (Build.VERSION.SDK_INT >= 21) {
    getBackground().setTintMode(PorterDuff.Mode.SRC_ATOP);
    getBackground().setTint(sColors[0]);
    setOutlineProvider(new ViewOutlineProvider(){
      @TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void getOutline(      View view,      Outline outline){
        final int w=view.getWidth();
        final int h=view.getHeight();
        final int ix=(int)(w * 0.3f);
        final int iy=(int)(h * 0.2f);
        outline.setRect(ix,iy,w - ix,h - iy);
      }
    }
);
  }
}
Program: 8820
Project: 8820
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  if (DEBUG)   L("String_Node_Str",ev);
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
    poke();
  return true;
case MotionEvent.ACTION_UP:
unpoke();
return true;
}
return false;
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent ev){
  L("String_Node_Str",ev);
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
    poke();
  return true;
case MotionEvent.ACTION_UP:
unpoke();
return true;
}
return false;
}
Program: 8822
Project: 8822
Buggy source:
private void poke(){
  L("String_Node_Str");
  if (mFrozen)   return;
  if (!mAnimating) {
    reset();
    startGame(true);
  }
 else   if (!mPlaying) {
    startGame(true);
  }
  mDroid.boost();
  if (DEBUG) {
    mDroid.dv*=DEBUG_SPEED_MULTIPLIER;
    mDroid.animate().setDuration((long)(200 / DEBUG_SPEED_MULTIPLIER));
  }
}

Fixed version (ground truth):
private void poke(){
  L("String_Node_Str");
  if (mFrozen)   return;
  if (!mAnimating) {
    reset();
    start(true);
  }
 else   if (!mPlaying) {
    start(true);
  }
  mDroid.boost();
  if (DEBUG) {
    mDroid.dv*=DEBUG_SPEED_MULTIPLIER;
    mDroid.animate().setDuration((long)(200 / DEBUG_SPEED_MULTIPLIER));
  }
}
Program: 8823
Project: 8823
Buggy source:
public Pop(Context context,float h){
  super(context,h);
  int idx=2 * irand(0,POPS.length / 2);
  setBackgroundResource(POPS[idx]);
  setScaleX(frand() < 0.5f ? -1 : 1);
  mRotate=POPS[idx + 1] == 0 ? 0 : (frand() < 0.5f ? -1 : 1);
  if (Build.VERSION.SDK_INT >= 21) {
    setOutlineProvider(new ViewOutlineProvider(){
      @TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void getOutline(      View view,      Outline outline){
        final int pad=(int)(getWidth() * 0.02f);
        outline.setOval(pad,pad,getWidth() - pad,getHeight() - pad);
      }
    }
);
  }
}

Fixed version (ground truth):
public Pop(Context context,float h){
  super(context,h);
  int idx=3 * irand(0,POPS.length / 3);
  setBackgroundResource(POPS[idx]);
  setAlpha((float)(POPS[idx + 2]) / 255);
  setScaleX(frand() < 0.5f ? -1 : 1);
  mRotate=POPS[idx + 1] == 0 ? 0 : (frand() < 0.5f ? -1 : 1);
  if (Build.VERSION.SDK_INT >= 21)   setOutlineProvider(new ViewOutlineProvider(){
    @TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void getOutline(    View view,    Outline outline){
      final int pad=(int)(getWidth() * 0.02f);
      outline.setOval(pad,pad,getWidth() - pad,getHeight() - pad);
    }
  }
);
}
Program: 8824
Project: 8824
Buggy source:
@Override protected void onSizeChanged(int w,int h,int oldw,int oldh){
  stopGame();
  reset();
  if (AUTOSTART) {
    startGame(false);
  }
}

Fixed version (ground truth):
@Override protected void onSizeChanged(int w,int h,int oldw,int oldh){
  stop();
  reset();
  if (AUTOSTART) {
    start(false);
  }
}
Program: 8825
Project: 8825
Buggy source:
@Override public boolean onGenericMotionEvent(MotionEvent ev){
  if (DEBUG)   L("String_Node_Str",ev);
  return false;
}

Fixed version (ground truth):
@Override public boolean onGenericMotionEvent(MotionEvent ev){
  L("String_Node_Str",ev);
  return false;
}
Program: 8827
Project: 8827
Buggy source:
@Override public boolean onKeyDown(int keyCode,KeyEvent ev){
  if (DEBUG)   L("String_Node_Str",keyCode);
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_SPACE:
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_BUTTON_A:
    poke();
  return true;
}
return false;
}

Fixed version (ground truth):
@Override public boolean onKeyDown(int keyCode,KeyEvent ev){
  L("String_Node_Str",keyCode);
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_SPACE:
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_BUTTON_A:
    poke();
  return true;
}
return false;
}
Program: 8828
Project: 8828
Buggy source:
public boolean intersects(Player p){
  final int N=p.corners.length / 2;
  for (int i=0; i < N; i++) {
    final int x=(int)p.corners[i * 2];
    final int y=(int)p.corners[i * 2 + 1];
    final int deltaX=x - cx;
    final int deltaY=y - cy;
    final double hypot=Math.hypot(deltaX,deltaY);
    if (hypot <= r)     return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean intersects(Player p){
  final int N=p.corners.length / 2;
  for (int i=0; i < N; i++) {
    final int x=(int)p.corners[i * 2];
    final int y=(int)p.corners[i * 2 + 1];
    if (Math.hypot(x - cx,y - cy) <= r)     return true;
  }
  return false;
}
Program: 8829
Project: 8829
Buggy source:
public static final void L(String s,Object... objects){
  if (DEBUG) {
    Log.d(TAG,String.format(s,objects));
  }
}

Fixed version (ground truth):
public static void L(String s,Object... objects){
  if (DEBUG) {
    Log.d(TAG,String.format(s,objects));
  }
}
Program: 8830
Project: 8830
Buggy source:
@TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void getOutline(View view,Outline outline){
  outline.setRect(0,0,getWidth(),getHeight());
}

Fixed version (ground truth):
@Override public void getOutline(View view,Outline outline){
  outline.setRect(0,0,getWidth(),getHeight());
}
Program: 8831
Project: 8831
Buggy source:
@Override public void onAttachedToWindow(){
  super.onAttachedToWindow();
  setWillNotDraw(false);
  if (Build.VERSION.SDK_INT >= 21)   setOutlineProvider(new ViewOutlineProvider(){
    @TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void getOutline(    View view,    Outline outline){
      outline.setRect(0,0,getWidth(),getHeight());
    }
  }
);
}

Fixed version (ground truth):
@Override public void onAttachedToWindow(){
  super.onAttachedToWindow();
  setWillNotDraw(false);
  if (Build.VERSION.SDK_INT >= 21)   setOutlineProvider(new ViewOutlineProvider(){
    @Override public void getOutline(    View view,    Outline outline){
      outline.setRect(0,0,getWidth(),getHeight());
    }
  }
);
}
Program: 8832
Project: 8832
Buggy source:
@Override public boolean onKeyUp(int keyCode,KeyEvent ev){
  if (DEBUG)   L("String_Node_Str",keyCode);
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_SPACE:
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_BUTTON_A:
    unpoke();
  return true;
}
return false;
}

Fixed version (ground truth):
@Override public boolean onKeyUp(int keyCode,KeyEvent ev){
  L("String_Node_Str",keyCode);
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_SPACE:
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_BUTTON_A:
    unpoke();
  return true;
}
return false;
}
Program: 8833
Project: 8833
Buggy source:
private void setScore(int score){
  mScore=score;
  if (mScoreField != null)   mScoreField.setText(String.valueOf(score));
}

Fixed version (ground truth):
private void setScore(int score){
  mScore=score;
  if (mScoreField != null) {
    mScoreField.setText(DEBUG_IDDQD ? "String_Node_Str" : String.valueOf(score));
  }
}
Program: 8835
Project: 8835
Buggy source:
@Override protected Texture getLoadingScreenTexture(){
  int index=Collections.binarySearch(AVAILABLE_WIDTHS,Main.getUserSettings().getAppSettings().getWidth());
  if (index < 0) {
    index=Math.min(AVAILABLE_WIDTHS.size() - 1,~index + 1);
  }
  String screen=SCREENS.get(AVAILABLE_WIDTHS.get(index));
  TextureKey texKey=new TextureKey("String_Node_Str" + screen);
  return assetManager.loadTexture(texKey);
}

Fixed version (ground truth):
@Override protected Texture getLoadingScreenTexture(){
  int index=Collections.binarySearch(AVAILABLE_WIDTHS,Main.getUserSettings().getAppSettings().getWidth());
  if (index < 0) {
    index=Math.min(AVAILABLE_WIDTHS.size() - 1,~index + 1);
  }
  String screen=SCREENS.get(AVAILABLE_WIDTHS.get(index));
  TextureKey texKey=new TextureKey(getLocalizedLoadingScreenTextureFolder() + screen);
  return assetManager.loadTexture(texKey);
}
Program: 8836
Project: 8836
Buggy source:
@Override protected Texture getLoadingScreenTexture(){
  int index=Collections.binarySearch(AVAILABLE_WIDTHS,Main.getUserSettings().getAppSettings().getWidth());
  if (index < 0) {
    index=Math.min(AVAILABLE_WIDTHS.size() - 1,~index + 1);
  }
  String screen=SCREENS.get(AVAILABLE_WIDTHS.get(index));
  TextureKey texKey=new TextureKey("String_Node_Str" + screen);
  return assetManager.loadTexture(texKey);
}

Fixed version (ground truth):
@Override protected Texture getLoadingScreenTexture(){
  int index=Collections.binarySearch(AVAILABLE_WIDTHS,Main.getUserSettings().getAppSettings().getWidth());
  if (index < 0) {
    index=Math.min(AVAILABLE_WIDTHS.size() - 1,~index + 1);
  }
  String screen=SCREENS.get(AVAILABLE_WIDTHS.get(index));
  TextureKey texKey=new TextureKey(getLocalizedLoadingScreenTextureFolder() + screen);
  return assetManager.loadTexture(texKey);
}
Program: 8837
Project: 8837
Buggy source:
/** 
 * Convert a single KMF to JME object
 * @param assetManager assetManager, for finding stuff
 * @param entry KMF / name entry
 * @param destination destination directory
 * @throws RuntimeException May fail
 */
private void convertModel(AssetManager assetManager,Entry<String,KmfFile> entry,String destination,EngineTexturesFile engineTexturesFile) throws RuntimeException {
  KmfAssetInfo ai=new KmfAssetInfo(assetManager,new AssetKey(entry.getKey()),entry.getValue(),true);
  KmfModelLoader kmfModelLoader=new KmfModelLoader();
  try {
    Node n=(Node)kmfModelLoader.load(ai);
    BinaryExporter exporter=BinaryExporter.getInstance();
    File file=new File(destination.concat(entry.getKey().substring(0,entry.getKey().length() - 4)).concat("String_Node_Str"));
    exporter.save(n,file);
  }
 catch (  Exception ex) {
    String msg="String_Node_Str" + entry.getKey() + "String_Node_Str";
    logger.log(Level.SEVERE,msg,ex);
    throw new RuntimeException(msg,ex);
  }
}

Fixed version (ground truth):
/** 
 * Convert a single KMF to JME object
 * @param assetManager assetManager, for finding stuff
 * @param entry KMF / name entry
 * @param destination destination directory
 * @throws RuntimeException May fail
 */
private void convertModel(AssetManager assetManager,Entry<String,KmfFile> entry,String destination,EngineTexturesFile engineTexturesFile) throws RuntimeException {
  KmfAssetInfo ai=new KmfAssetInfo(assetManager,new AssetKey(entry.getKey()),entry.getValue(),true);
  KmfModelLoader kmfModelLoader=new KmfModelLoader();
  try {
    Node n=(Node)kmfModelLoader.load(ai);
    BinaryExporter exporter=BinaryExporter.getInstance();
    File file=new File(destination.concat(entry.getKey().substring(0,entry.getKey().length() - 4)).concat("String_Node_Str"));
    exporter.save(n,file);
  }
 catch (  Exception ex) {
    String msg="String_Node_Str" + entry.getKey() + "String_Node_Str";
    LOGGER.log(Level.SEVERE,msg,ex);
    throw new RuntimeException(msg,ex);
  }
}
Program: 8840
Project: 8840
Buggy source:
/** 
 * Convert all the original DK II assets to our formats and copy to our working folder
 */
public void convertAssets(){
  long start=System.currentTimeMillis();
  String currentFolder=getCurrentFolder();
  logger.log(Level.INFO,"String_Node_Str",dungeonKeeperFolder);
  logger.log(Level.INFO,"String_Node_Str",currentFolder);
  currentFolder=currentFolder.concat(ASSETS_FOLDER).concat(File.separator);
  convertTextures(dungeonKeeperFolder,currentFolder.concat(TEXTURES_FOLDER).concat(File.separator));
  convertModels(dungeonKeeperFolder,currentFolder.concat(MODELS_FOLDER).concat(File.separator),assetManager);
  convertMouseCursors(dungeonKeeperFolder,currentFolder.concat(MOUSE_CURSORS_FOLDER).concat(File.separator));
  convertSounds(dungeonKeeperFolder,currentFolder.concat(SOUNDS_FOLDER).concat(File.separator));
  convertTexts(dungeonKeeperFolder,currentFolder.concat(TEXTS_FOLDER).concat(File.separator));
  convertPaths(dungeonKeeperFolder,currentFolder.concat(PATHS_FOLDER).concat(File.separator));
  convertHiScores(dungeonKeeperFolder);
  convertFonts(dungeonKeeperFolder,currentFolder.concat(FONTS_FOLDER).concat(File.separator));
  generateMapThumbnails(dungeonKeeperFolder,currentFolder.concat(MAP_THUMBNAILS_FOLDER).concat(File.separator));
  long duration=System.currentTimeMillis() - start;
  logger.log(Level.INFO,"String_Node_Str",TimeUnit.SECONDS.convert(duration,TimeUnit.MILLISECONDS));
}

Fixed version (ground truth):
/** 
 * Convert all the original DK II assets to our formats and copy to our working folder
 */
public void convertAssets(){
  long start=System.currentTimeMillis();
  String currentFolder=getCurrentFolder();
  LOGGER.log(Level.INFO,"String_Node_Str",dungeonKeeperFolder);
  LOGGER.log(Level.INFO,"String_Node_Str",currentFolder);
  currentFolder=currentFolder.concat(ASSETS_FOLDER).concat(File.separator);
  convertTextures(dungeonKeeperFolder,currentFolder.concat(TEXTURES_FOLDER).concat(File.separator));
  convertModels(dungeonKeeperFolder,currentFolder.concat(MODELS_FOLDER).concat(File.separator),assetManager);
  convertMouseCursors(dungeonKeeperFolder,currentFolder.concat(MOUSE_CURSORS_FOLDER).concat(File.separator));
  convertSounds(dungeonKeeperFolder,currentFolder.concat(SOUNDS_FOLDER).concat(File.separator));
  convertTexts(dungeonKeeperFolder,currentFolder.concat(TEXTS_FOLDER).concat(File.separator));
  convertPaths(dungeonKeeperFolder,currentFolder.concat(PATHS_FOLDER).concat(File.separator));
  convertHiScores(dungeonKeeperFolder);
  convertFonts(dungeonKeeperFolder,currentFolder.concat(FONTS_FOLDER).concat(File.separator));
  generateMapThumbnails(dungeonKeeperFolder,currentFolder.concat(MAP_THUMBNAILS_FOLDER).concat(File.separator));
  long duration=System.currentTimeMillis() - start;
  LOGGER.log(Level.INFO,"String_Node_Str",TimeUnit.SECONDS.convert(duration,TimeUnit.MILLISECONDS));
}
Program: 8841
Project: 8841
Buggy source:
/** 
 * Extracts the wad files and updates the progress bar
 * @param i current entry number
 * @param total total entry number
 * @param wad wad file
 * @param destination destination directory
 */
private void extractTextureContainer(int i,int total,WadFile wad,String destination){
  for (  final String entry : wad.getWadFileEntries()) {
    updateStatus(i,total,ConvertProcess.TEXTURES);
    i++;
    if (entry.endsWith("String_Node_Str")) {
      LoadingScreenFile lsf=new LoadingScreenFile(wad.getFileData(entry));
      try {
        File dest=wad.extractFileData(entry,destination,true);
        String destFilename=dest.getCanonicalPath();
        ImageIO.write(lsf.getImage(),"String_Node_Str",new File(destFilename.substring(0,destFilename.length() - 3).concat("String_Node_Str")));
      }
 catch (      IOException ex) {
        throw new RuntimeException("String_Node_Str" + entry + "String_Node_Str",ex);
      }
    }
 else {
      wad.extractFileData(entry,destination);
    }
  }
}

Fixed version (ground truth):
/** 
 * Extracts the wad files and updates the progress bar
 * @param i current entry number
 * @param total total entry number
 * @param wad wad file
 * @param destination destination directory
 */
private void extractTextureContainer(int i,int total,WadFile wad,String destination){
  for (  final String entry : wad.getWadFileEntries()) {
    updateStatus(i,total,ConvertProcess.TEXTURES);
    i++;
    if (entry.endsWith("String_Node_Str")) {
      LoadingScreenFile lsf=new LoadingScreenFile(wad.getFileData(entry));
      try {
        File destFile=new File(destination + entry);
        String destFilename=destFile.getCanonicalPath();
        destFile.getParentFile().mkdirs();
        ImageIO.write(lsf.getImage(),"String_Node_Str",new File(destFilename.substring(0,destFilename.length() - 3).concat("String_Node_Str")));
      }
 catch (      IOException ex) {
        throw new RuntimeException("String_Node_Str" + entry + "String_Node_Str",ex);
      }
    }
 else {
      wad.extractFileData(entry,destination);
    }
  }
}
Program: 8842
Project: 8842
Buggy source:
/** 
 * Generates thumbnails out of map files (only the skirmish/mp)
 * @param dungeonKeeperFolder DK II main folder
 * @param destination Destination folder
 */
private void generateMapThumbnails(String dungeonKeeperFolder,String destination){
  if (!ConvertProcess.MAP_THUMBNAILS.isOutdated()) {
    return;
  }
  logger.log(Level.INFO,"String_Node_Str",destination);
  updateStatus(null,null,ConvertProcess.MAP_THUMBNAILS);
  File destFolder=new File(destination);
  AssetUtils.deleteFolder(destFolder);
  destFolder.mkdirs();
  try {
    File f=new File(dungeonKeeperFolder + PathUtils.DKII_MAPS_FOLDER);
    File[] files=f.listFiles(new FilenameFilter(){
      @Override public boolean accept(      File dir,      String name){
        return name.toLowerCase().endsWith("String_Node_Str");
      }
    }
);
    List<KwdFile> maps=new ArrayList<>(files.length);
    for (    File file : files) {
      KwdFile kwd=new KwdFile(dungeonKeeperFolder,file,false);
      if (kwd.getGameLevel().getLvlFlags().contains(LevFlag.IS_SKIRMISH_LEVEL) || kwd.getGameLevel().getLvlFlags().contains(LevFlag.IS_MULTIPLAYER_LEVEL)) {
        maps.add(kwd);
      }
    }
    int i=0;
    int total=maps.size();
    for (    KwdFile kwd : maps) {
      updateStatus(i,total,ConvertProcess.MAP_THUMBNAILS);
      genererateMapThumbnail(kwd,destination);
      i++;
    }
  }
 catch (  Exception ex) {
    String msg="String_Node_Str" + destination + "String_Node_Str";
    logger.log(Level.WARNING,msg,ex);
  }
}

Fixed version (ground truth):
/** 
 * Generates thumbnails out of map files (only the skirmish/mp)
 * @param dungeonKeeperFolder DK II main folder
 * @param destination Destination folder
 */
private void generateMapThumbnails(String dungeonKeeperFolder,String destination){
  if (!ConvertProcess.MAP_THUMBNAILS.isOutdated()) {
    return;
  }
  LOGGER.log(Level.INFO,"String_Node_Str",destination);
  updateStatus(null,null,ConvertProcess.MAP_THUMBNAILS);
  File destFolder=new File(destination);
  AssetUtils.deleteFolder(destFolder);
  destFolder.mkdirs();
  try {
    File f=new File(dungeonKeeperFolder + PathUtils.DKII_MAPS_FOLDER);
    File[] files=f.listFiles(new FilenameFilter(){
      @Override public boolean accept(      File dir,      String name){
        return name.toLowerCase().endsWith("String_Node_Str");
      }
    }
);
    List<KwdFile> maps=new ArrayList<>(files.length);
    for (    File file : files) {
      KwdFile kwd=new KwdFile(dungeonKeeperFolder,file,false);
      if (kwd.getGameLevel().getLvlFlags().contains(LevFlag.IS_SKIRMISH_LEVEL) || kwd.getGameLevel().getLvlFlags().contains(LevFlag.IS_MULTIPLAYER_LEVEL)) {
        maps.add(kwd);
      }
    }
    int i=0;
    int total=maps.size();
    for (    KwdFile kwd : maps) {
      updateStatus(i,total,ConvertProcess.MAP_THUMBNAILS);
      genererateMapThumbnail(kwd,destination);
      i++;
    }
  }
 catch (  Exception ex) {
    String msg="String_Node_Str" + destination + "String_Node_Str";
    LOGGER.log(Level.WARNING,msg,ex);
  }
}
Program: 8844
Project: 8844
Buggy source:
/** 
 * Extract and copy DK II HiScores
 * @param dungeonKeeperFolder DK II main folder
 */
private void convertHiScores(String dungeonKeeperFolder){
  if (!ConvertProcess.HI_SCORES.isOutdated()) {
    return;
  }
  logger.log(Level.INFO,"String_Node_Str");
  updateStatus(0,1,ConvertProcess.HI_SCORES);
  try {
    File file=new File(dungeonKeeperFolder + "String_Node_Str");
    HiScoresFile originalHiScores=new HiScoresFile(file);
    HiScores hiScores=new HiScores();
    for (    HiScoresEntry entry : originalHiScores.getHiScoresEntries()) {
      hiScores.add(entry.getScore(),entry.getName(),entry.getLevel());
    }
    updateStatus(1,1,ConvertProcess.HI_SCORES);
  }
 catch (  Exception ex) {
    logger.log(Level.WARNING,"String_Node_Str",ex);
  }
}

Fixed version (ground truth):
/** 
 * Extract and copy DK II HiScores
 * @param dungeonKeeperFolder DK II main folder
 */
private void convertHiScores(String dungeonKeeperFolder){
  if (!ConvertProcess.HI_SCORES.isOutdated()) {
    return;
  }
  LOGGER.log(Level.INFO,"String_Node_Str");
  updateStatus(0,1,ConvertProcess.HI_SCORES);
  try {
    File file=new File(dungeonKeeperFolder + "String_Node_Str");
    HiScoresFile originalHiScores=new HiScoresFile(file);
    HiScores hiScores=new HiScores();
    for (    HiScoresEntry entry : originalHiScores.getHiScoresEntries()) {
      hiScores.add(entry.getScore(),entry.getName(),entry.getLevel());
    }
    updateStatus(1,1,ConvertProcess.HI_SCORES);
  }
 catch (  Exception ex) {
    LOGGER.log(Level.WARNING,"String_Node_Str",ex);
  }
}
Program: 8848
Project: 8848
Buggy source:
/** 
 * Extract and copy DK II mouse cursors
 * @param dungeonKeeperFolder DK II main folder
 * @param destination Destination folder
 */
private void convertMouseCursors(String dungeonKeeperFolder,String destination){
  if (!ConvertProcess.MOUSE_CURSORS.isOutdated()) {
    return;
  }
  logger.log(Level.INFO,"String_Node_Str",destination);
  updateStatus(null,null,ConvertProcess.MOUSE_CURSORS);
  AssetUtils.deleteFolder(new File(destination));
  WadFile wadFile=new WadFile(new File(dungeonKeeperFolder + PathUtils.DKII_DATA_FOLDER + "String_Node_Str"));
  int i=0;
  int total=wadFile.getWadFileEntryCount();
  File destinationFolder=new File(getAssetsFolder().concat(SPRITES_FOLDER).concat(File.separator));
  AssetUtils.deleteFolder(destinationFolder);
  destinationFolder.mkdirs();
  for (  String fileName : wadFile.getWadFileEntries()) {
    updateStatus(i,total,ConvertProcess.MOUSE_CURSORS);
    i++;
    File extracted=wadFile.extractFileData(fileName,destination);
    if (fileName.toLowerCase().endsWith("String_Node_Str")) {
      SprFile sprFile=new SprFile(extracted);
      try {
        sprFile.extract(destinationFolder.getPath(),fileName.substring(0,fileName.length() - 4));
        extracted.delete();
      }
 catch (      Exception ex) {
        logger.log(Level.SEVERE,"String_Node_Str",ex);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Extract and copy DK II mouse cursors
 * @param dungeonKeeperFolder DK II main folder
 * @param destination Destination folder
 */
private void convertMouseCursors(String dungeonKeeperFolder,String destination){
  if (!ConvertProcess.MOUSE_CURSORS.isOutdated()) {
    return;
  }
  LOGGER.log(Level.INFO,"String_Node_Str",destination);
  updateStatus(null,null,ConvertProcess.MOUSE_CURSORS);
  AssetUtils.deleteFolder(new File(destination));
  WadFile wadFile=new WadFile(new File(dungeonKeeperFolder + PathUtils.DKII_DATA_FOLDER + "String_Node_Str"));
  int i=0;
  int total=wadFile.getWadFileEntryCount();
  File destinationFolder=new File(getAssetsFolder().concat(SPRITES_FOLDER).concat(File.separator));
  AssetUtils.deleteFolder(destinationFolder);
  destinationFolder.mkdirs();
  for (  String fileName : wadFile.getWadFileEntries()) {
    updateStatus(i,total,ConvertProcess.MOUSE_CURSORS);
    i++;
    File extracted=wadFile.extractFileData(fileName,destination);
    if (fileName.toLowerCase().endsWith("String_Node_Str")) {
      SprFile sprFile=new SprFile(extracted);
      try {
        sprFile.extract(destinationFolder.getPath(),fileName.substring(0,fileName.length() - 4));
        extracted.delete();
      }
 catch (      Exception ex) {
        LOGGER.log(Level.SEVERE,"String_Node_Str",ex);
      }
    }
  }
}