nus-yam/ex-repair huggingface dataset:
Program: 42828
Project: 42828
Buggy source:
@Override public boolean isAgencySetupRequired(){
  boolean setupRequired=false;
  if (currentDbVersion > 0 && currentDbVersion != getCurrentDbVersion()) {
    setupRequired=true;
  }
 else   if (!SqlUtils.isDbExist(getContext(),getDbName())) {
    setupRequired=true;
  }
 else   if (SqlUtils.getCurrentDbVersion(getContext(),getDbName()) != getCurrentDbVersion()) {
    setupRequired=true;
  }
  return setupRequired;
}

Fixed version (ground truth):
@Override public boolean isAgencySetupRequired(){
  if (currentDbVersion > 0 && currentDbVersion != getCurrentDbVersion()) {
    return true;
  }
  if (!SqlUtils.isDbExist(getContext(),getDbName())) {
    return true;
  }
  if (SqlUtils.getCurrentDbVersion(getContext(),getDbName()) != getCurrentDbVersion()) {
    return true;
  }
  return false;
}
Program: 42829
Project: 42829
Buggy source:
@Override public boolean isAgencySetupRequired(){
  boolean setupRequired=false;
  if (currentDbVersion > 0 && currentDbVersion != getCurrentDbVersion()) {
    setupRequired=true;
  }
 else   if (!SqlUtils.isDbExist(getContext(),getDbName())) {
    setupRequired=true;
  }
 else   if (SqlUtils.getCurrentDbVersion(getContext(),getDbName()) != getCurrentDbVersion()) {
    setupRequired=true;
  }
  return setupRequired;
}

Fixed version (ground truth):
@Override public boolean isAgencySetupRequired(){
  if (currentDbVersion > 0 && currentDbVersion != getCurrentDbVersion()) {
    return true;
  }
  if (!SqlUtils.isDbExist(getContext(),getDbName())) {
    return true;
  }
  if (SqlUtils.getCurrentDbVersion(getContext(),getDbName()) != getCurrentDbVersion()) {
    return true;
  }
  return false;
}
Program: 42831
Project: 42831
Buggy source:
private void setupView(View view){
  if (view == null) {
    return;
  }
  AbsListView absListView=(AbsListView)view.findViewById(isShowingListInsteadOfGrid() ? R.id.list : R.id.grid);
  linkAdapterWithListView(absListView);
  absListView.setOnItemClickListener(this);
  switchView(view);
}

Fixed version (ground truth):
private void setupView(View view){
  if (view == null) {
    return;
  }
  AbsListView absListView=(AbsListView)view.findViewById(isShowingListInsteadOfGrid() ? R.id.list : R.id.grid);
  linkAdapterWithListView(view);
  absListView.setOnItemClickListener(this);
  switchView(view);
}
Program: 42832
Project: 42832
Buggy source:
private void onFragmentVisible(){
  if (this.fragmentVisible) {
    return;
  }
  if (!isResumed()) {
    return;
  }
  this.fragmentVisible=true;
  switchView(getView());
  if (this.adapter == null || !this.adapter.isInitialized()) {
    LoaderUtils.restartLoader(this,ROUTES_LOADER,null,this);
  }
  checkIfShowingListInsteadOfGridChanged();
  getActivity().supportInvalidateOptionsMenu();
  updateListGridToggleMenuItem();
}

Fixed version (ground truth):
private void onFragmentVisible(){
  if (this.fragmentVisible) {
    return;
  }
  if (!isResumed()) {
    return;
  }
  this.fragmentVisible=true;
  switchView(getView());
  if (this.adapter == null || !this.adapter.isInitialized()) {
    LoaderUtils.restartLoader(this,ROUTES_LOADER,null,this);
  }
  checkIfShowingListInsteadOfGridChanged();
  if (getActivity() != null) {
    getActivity().invalidateOptionsMenu();
  }
  updateListGridToggleMenuItem();
}
Program: 42833
Project: 42833
Buggy source:
public static void destroyAd(Activity activity){
  if (!AD_ENABLED) {
    return;
  }
  View adLayout=activity == null ? null : activity.findViewById(R.id.ad_layout);
  if (adLayout != null) {
    AdView adView=(AdView)adLayout.findViewById(R.id.ad);
    if (adView != null) {
      adView.destroy();
    }
  }
  adLoaded=null;
  if (setupAdTask != null) {
    setupAdTask.cancel(true);
  }
  setupAdTask=null;
}

Fixed version (ground truth):
public static void destroyAd(Activity activity){
  if (!AD_ENABLED) {
    return;
  }
  View adLayout=activity == null ? null : activity.findViewById(R.id.ad_layout);
  if (adLayout != null) {
    AdView adView=(AdView)adLayout.findViewById(R.id.ad);
    if (adView != null) {
      try {
        adView.removeAllViews();
        adView.destroy();
      }
 catch (      Throwable t) {
        MTLog.w(TAG,t,"String_Node_Str");
      }
    }
  }
  adLoaded=null;
  if (setupAdTask != null) {
    setupAdTask.cancel(true);
  }
  setupAdTask=null;
}
Program: 42837
Project: 42837
Buggy source:
private void updateCommonViewManual(int position,View convertView){
  if (convertView == null || convertView.getTag() == null || !(convertView.getTag() instanceof CommonViewHolder)) {
    return;
  }
  CommonViewHolder holder=(CommonViewHolder)convertView.getTag();
  POIManager poim=getItem(position);
  updateCommonView(holder,poim);
}

Fixed version (ground truth):
private void updateCommonViewManual(int position,View convertView){
  if (convertView == null || convertView.getTag() == null || !(convertView.getTag() instanceof CommonViewHolder)) {
    return;
  }
  CommonViewHolder holder=(CommonViewHolder)convertView.getTag();
  POIManager poim=getItem(position);
  updateCommonView(holder,poim);
  updatePOIStatus(holder.statusViewHolder,poim);
}
Program: 42838
Project: 42838
Buggy source:
public Boolean isServiceUpdateWarning(Context context){
  if (this.serviceUpdates == null || this.lastFindServiceUpdateTimestampMs < 0 || this.inFocus || !areServiceUpdatesUseful()) {
    findServiceUpdates(context,false);
    return null;
  }
  return ServiceUpdate.isSeverityWarning(this.serviceUpdates);
}

Fixed version (ground truth):
public Boolean isServiceUpdateWarning(Context context){
  if (this.serviceUpdates == null || this.lastFindServiceUpdateTimestampMs < 0 || this.inFocus || !areServiceUpdatesUseful()) {
    findServiceUpdates(context,false);
  }
  return ServiceUpdate.isSeverityWarning(this.serviceUpdates);
}
Program: 42839
Project: 42839
Buggy source:
private void updateABDrawerOpened(){
  getActionBar().setTitle(mDrawerTitle);
  getActionBar().setSubtitle(mDrawerSubtitle);
  if (mDrawerIcon > 0) {
    getActionBar().setIcon(mDrawerIcon);
  }
 else {
    getActionBar().setIcon(new ColorDrawable(getResources().getColor(android.R.color.transparent)));
  }
  if (mDrawerBgColor != null) {
    getActionBar().setBackgroundDrawable(new ColorDrawable(mDrawerBgColor));
  }
 else {
    getActionBar().setBackgroundDrawable(null);
  }
  this.mDrawerToggle.setDrawerIndicatorEnabled(true);
  invalidateOptionsMenu();
}

Fixed version (ground truth):
private void updateABDrawerOpened(){
  getActionBar().setTitle(mDrawerTitle);
  getActionBar().setSubtitle(mDrawerSubtitle);
  if (mDrawerIcon > 0) {
    getActionBar().setIcon(mDrawerIcon);
    getActionBar().setDisplayShowHomeEnabled(true);
  }
 else {
    getActionBar().setDisplayShowHomeEnabled(false);
  }
  if (mDrawerBgColor != null) {
    getActionBar().setBackgroundDrawable(new ColorDrawable(mDrawerBgColor));
  }
 else {
    getActionBar().setBackgroundDrawable(null);
  }
  this.mDrawerToggle.setDrawerIndicatorEnabled(true);
  invalidateOptionsMenu();
}
Program: 42840
Project: 42840
Buggy source:
private void updateABDrawerClosed(){
  getActionBar().setTitle(mTitle);
  getActionBar().setSubtitle(mSubtitle);
  if (mIcon > 0) {
    getActionBar().setIcon(mIcon);
  }
 else {
    getActionBar().setIcon(new ColorDrawable(getResources().getColor(android.R.color.transparent)));
  }
  if (mBgColor != null) {
    getActionBar().setBackgroundDrawable(new ColorDrawable(mBgColor));
  }
 else {
    getActionBar().setBackgroundDrawable(null);
  }
  this.mDrawerToggle.setDrawerIndicatorEnabled(getSupportFragmentManager().getBackStackEntryCount() < 1);
  invalidateOptionsMenu();
}

Fixed version (ground truth):
private void updateABDrawerClosed(){
  getActionBar().setTitle(mTitle);
  getActionBar().setSubtitle(mSubtitle);
  if (mIcon > 0) {
    getActionBar().setIcon(mIcon);
    getActionBar().setDisplayShowHomeEnabled(true);
  }
 else {
    getActionBar().setDisplayShowHomeEnabled(false);
  }
  if (mBgColor != null) {
    getActionBar().setBackgroundDrawable(new ColorDrawable(mBgColor));
  }
 else {
    getActionBar().setBackgroundDrawable(null);
  }
  this.mDrawerToggle.setDrawerIndicatorEnabled(getSupportFragmentManager().getBackStackEntryCount() < 1);
  invalidateOptionsMenu();
}
Program: 42841
Project: 42841
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  mTitle=mDrawerTitle=getTitle();
  mSubtitle=mDrawerSubtitle=getActionBar().getSubtitle();
  mIcon=mDrawerIcon=R.drawable.ic_launcher;
  mBgColor=mDrawerBgColor=ABFragment.NO_BG_COLOR;
  mDrawerLayout=(DrawerLayout)findViewById(R.id.drawer_layout);
  mDrawerList=(ListView)findViewById(R.id.left_drawer);
  mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow,GravityCompat.START);
  mDrawerListAdapter=new MenuAdapter(this);
  mDrawerList.setAdapter(mDrawerListAdapter);
  mDrawerList.setOnItemClickListener(this);
  getActionBar().setDisplayHomeAsUpEnabled(true);
  getActionBar().setHomeButtonEnabled(true);
  mDrawerToggle=new ActionBarDrawerToggle(this,mDrawerLayout,R.drawable.ic_drawer,R.string.drawer_open,R.string.drawer_close){
    @Override public void onDrawerClosed(    View view){
      updateABDrawerClosed();
    }
    @Override public void onDrawerOpened(    View drawerView){
      updateABDrawerOpened();
    }
  }
;
  mDrawerLayout.setDrawerListener(mDrawerToggle);
  getSupportFragmentManager().addOnBackStackChangedListener(this);
  if (savedInstanceState == null) {
    final String itemId=PreferenceUtils.getPrefLcl(this,PreferenceUtils.PREFS_LCL_ROOT_SCREEN_ITEM_ID,MenuAdapter.ITEM_ID_SELECTED_SCREEN_DEFAULT);
    selectItem(this.mDrawerListAdapter.getScreenItemPosition(itemId));
  }
 else {
    onRestoreState(savedInstanceState);
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  mTitle=mDrawerTitle=getTitle();
  mSubtitle=mDrawerSubtitle=getActionBar().getSubtitle();
  mIcon=mDrawerIcon=R.drawable.ic_launcher;
  mBgColor=mDrawerBgColor=ABFragment.NO_BG_COLOR;
  mDrawerLayout=(DrawerLayout)findViewById(R.id.drawer_layout);
  mDrawerList=(ListView)findViewById(R.id.left_drawer);
  mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow,GravityCompat.START);
  mDrawerListAdapter=new MenuAdapter(this);
  mDrawerList.setAdapter(mDrawerListAdapter);
  mDrawerList.setOnItemClickListener(this);
  getActionBar().setDisplayHomeAsUpEnabled(true);
  getActionBar().setHomeButtonEnabled(true);
  mDrawerToggle=new ActionBarDrawerToggle(this,mDrawerLayout,R.drawable.ic_drawer,R.string.drawer_open,R.string.drawer_close){
    @Override public void onDrawerClosed(    View view){
      updateABDrawerClosed();
    }
    @Override public void onDrawerOpened(    View drawerView){
      updateABDrawerOpened();
    }
    @Override public void onDrawerStateChanged(    int newState){
      mDrawerState=newState;
    }
  }
;
  mDrawerLayout.setDrawerListener(mDrawerToggle);
  getSupportFragmentManager().addOnBackStackChangedListener(this);
  if (savedInstanceState == null) {
    final String itemId=PreferenceUtils.getPrefLcl(this,PreferenceUtils.PREFS_LCL_ROOT_SCREEN_ITEM_ID,MenuAdapter.ITEM_ID_SELECTED_SCREEN_DEFAULT);
    selectItem(this.mDrawerListAdapter.getScreenItemPosition(itemId));
  }
 else {
    onRestoreState(savedInstanceState);
  }
}
Program: 42842
Project: 42842
Buggy source:
private void updateAB(){
  if (isDrawerOpen()) {
    updateABDrawerOpened();
  }
 else {
    updateABDrawerClosed();
  }
}

Fixed version (ground truth):
private void updateAB(){
  if (mDrawerState != DrawerLayout.STATE_IDLE) {
    return;
  }
  if (isDrawerOpen()) {
    updateABDrawerOpened();
  }
 else {
    updateABDrawerClosed();
  }
}
Program: 42843
Project: 42843
Buggy source:
@Override public void onUserLocationChanged(Location newLocation){
  if (newLocation != null) {
    this.userLocation=newLocation;
    if (this.agencyTypePagerAdapter != null) {
      this.agencyTypePagerAdapter.setUserLocation(newLocation);
    }
    if (this.nearbyLocation == null) {
      setNewNearbyLocation(newLocation);
    }
    boolean requireNotifyAB=false;
    if (LocationUtils.areAlmostTheSame(this.nearbyLocation,this.userLocation)) {
      if (this.userAwayFromNearbyLocation) {
        requireNotifyAB=true;
        this.userAwayFromNearbyLocation=false;
      }
    }
 else {
      if (!this.userAwayFromNearbyLocation) {
        requireNotifyAB=true;
        this.userAwayFromNearbyLocation=true;
      }
    }
    if (requireNotifyAB) {
      ((MainActivity)getActivity()).notifyABChange();
    }
  }
}

Fixed version (ground truth):
@Override public void onUserLocationChanged(Location newLocation){
  if (newLocation != null) {
    this.userLocation=newLocation;
    final List<Fragment> fragments=getChildFragmentManager().getFragments();
    if (fragments != null) {
      for (      Fragment fragment : fragments) {
        if (fragment != null && fragment instanceof MTActivityWithLocation.UserLocationListener) {
          ((MTActivityWithLocation.UserLocationListener)fragment).onUserLocationChanged(this.userLocation);
        }
      }
    }
    if (this.agencyTypePagerAdapter != null) {
      this.agencyTypePagerAdapter.setUserLocation(newLocation);
    }
    if (this.nearbyLocation == null) {
      setNewNearbyLocation(newLocation);
    }
    boolean requireNotifyAB=false;
    if (LocationUtils.areAlmostTheSame(this.nearbyLocation,this.userLocation)) {
      if (this.userAwayFromNearbyLocation) {
        requireNotifyAB=true;
        this.userAwayFromNearbyLocation=false;
      }
    }
 else {
      if (!this.userAwayFromNearbyLocation) {
        requireNotifyAB=true;
        this.userAwayFromNearbyLocation=true;
      }
    }
    if (requireNotifyAB) {
      ((MainActivity)getActivity()).notifyABChange();
    }
  }
}
Program: 42844
Project: 42844
Buggy source:
public void onFragmentInvisible(){
  if (!this.fragmentVisible) {
    return;
  }
  this.fragmentVisible=false;
  if (this.adapter != null) {
    this.adapter.onPause();
  }
}

Fixed version (ground truth):
private void onFragmentInvisible(){
  if (!this.fragmentVisible) {
    return;
  }
  this.fragmentVisible=false;
  if (this.adapter != null) {
    this.adapter.onPause();
  }
}
Program: 42845
Project: 42845
Buggy source:
public void onFragmentVisisble(){
  if (this.fragmentVisible) {
    return;
  }
  this.fragmentVisible=true;
  if (this.adapter == null) {
    initAdapter();
  }
 else {
    if (this.adapter.getPoisCount() > 0) {
      this.adapter.onResume();
      this.adapter.refreshFavorites();
    }
  }
  NearbyFragment nearbyFragment=(NearbyFragment)getActivity().getSupportFragmentManager().findFragmentByTag(NearbyFragment.FRAGMENT_TAG);
  if (nearbyFragment != null) {
    useNewNearbyLocation(nearbyFragment.getNearbyLocation(),false);
    onUserLocationChanged(nearbyFragment.getUserLocation());
  }
}

Fixed version (ground truth):
private void onFragmentVisisble(){
  if (this.fragmentVisible) {
    return;
  }
  this.fragmentVisible=true;
  if (this.adapter == null) {
    initAdapter();
  }
 else {
    if (this.adapter.getPoisCount() > 0) {
      this.adapter.onResume();
      this.adapter.refreshFavorites();
    }
  }
  NearbyFragment nearbyFragment=(NearbyFragment)getActivity().getSupportFragmentManager().findFragmentByTag(NearbyFragment.FRAGMENT_TAG);
  if (nearbyFragment != null) {
    useNewNearbyLocation(nearbyFragment.getNearbyLocation(),false);
    onUserLocationChanged(nearbyFragment.getUserLocation());
  }
}
Program: 42847
Project: 42847
Buggy source:
@Override protected void onPostExecute(Integer lastPageSelected){
  if (lastPageSelected != null) {
    if (NearbyFragment.this.lastPageSelected == 0) {
      viewPager.setCurrentItem(lastPageSelected.intValue());
      NearbyFragment.this.lastPageSelected=lastPageSelected.intValue();
      onPageSelected(NearbyFragment.this.lastPageSelected);
    }
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(Integer lastPageSelected){
  if (NearbyFragment.this.lastPageSelected != 0) {
    return;
  }
  if (lastPageSelected != null) {
    NearbyFragment.this.lastPageSelected=lastPageSelected.intValue();
    viewPager.setCurrentItem(NearbyFragment.this.lastPageSelected);
  }
  onPageSelected(NearbyFragment.this.lastPageSelected);
}
Program: 42848
Project: 42848
Buggy source:
private void disableTimeChangeddReceiver(){
  if (this.timeChangedReceiverEnabled) {
    getContext().unregisterReceiver(this.timeChangedReceiver);
    this.timeChangedReceiverEnabled=false;
    this.nowToTheMinute=-1;
  }
}

Fixed version (ground truth):
private void disableTimeChangeddReceiver(){
  if (this.timeChangedReceiverEnabled) {
    getContext().unregisterReceiver(this.timeChangedReceiver);
    this.timeChangedReceiverEnabled=false;
    this.nowToTheMinute=-1l;
  }
}
Program: 42849
Project: 42849
Buggy source:
public void onDestroy(){
  disableTimeChangeddReceiver();
}

Fixed version (ground truth):
public void onDestroy(){
  disableTimeChangeddReceiver();
  if (this.pois != null) {
    this.pois.clear();
  }
  this.compassImgsWR.clear();
  this.poiStatusViewHoldersWR.clear();
}
Program: 42850
Project: 42850
Buggy source:
private void useNewNearbyLocation(Location newNearbyLocation,boolean force){
  if (!force && (newNearbyLocation == null || !this.fragmentVisible || LocationUtils.areTheSame(newNearbyLocation,this.nearbyLocation))) {
    return;
  }
  this.nearbyLocation=newNearbyLocation;
  if (this.adapter != null) {
    this.adapter.setPois(null);
    this.adapter.notifyDataSetChanged(true);
  }
  if (this.nearbyLocation == null) {
    final View view=getView();
    if (view != null) {
      if (view.findViewById(R.id.list) != null) {
        ((ListView)view.findViewById(R.id.list)).setSelectionFromTop(0,0);
      }
    }
  }
  this.ad=LocationUtils.DEFAULT_AROUND_DIFF;
  showLoading();
  if (this.nearbyLocation != null) {
    getLoaderManager().restartLoader(NEARBY_POIS_LOADER,null,this);
  }
}

Fixed version (ground truth):
private void useNewNearbyLocation(Location newNearbyLocation,boolean force){
  if (!force && (newNearbyLocation == null || !this.fragmentVisible || LocationUtils.areTheSame(newNearbyLocation,this.nearbyLocation))) {
    return;
  }
  this.nearbyLocation=newNearbyLocation;
  if (this.adapter != null) {
    this.adapter.clearAll();
    this.adapter.notifyDataSetChanged(true);
  }
  final View view=getView();
  if (view != null) {
    if (view.findViewById(R.id.list) != null) {
      ((ListView)view.findViewById(R.id.list)).setSelectionFromTop(0,0);
    }
  }
  this.ad=LocationUtils.DEFAULT_AROUND_DIFF;
  showLoading();
  if (this.nearbyLocation != null) {
    getLoaderManager().restartLoader(NEARBY_POIS_LOADER,null,this);
  }
}
Program: 42851
Project: 42851
Buggy source:
@Override public void onLoaderReset(Loader<List<POIManager>> loader){
  if (this.adapter != null) {
    this.adapter.setPois(null);
    this.adapter.onPause();
  }
}

Fixed version (ground truth):
@Override public void onLoaderReset(Loader<List<POIManager>> loader){
  if (this.adapter != null) {
    this.adapter.clearAll();
    this.adapter.onPause();
  }
}
Program: 42852
Project: 42852
Buggy source:
private void setupView(View view){
  if (view == null) {
    return;
  }
  AbsListView absListView=(AbsListView)view.findViewById(isShowingListInsteadOfGrid() ? R.id.list : R.id.grid);
  linkAdapterWithListView(absListView);
  absListView.setOnItemClickListener(this);
  switchView(view);
}

Fixed version (ground truth):
private void setupView(View view){
  if (view == null) {
    return;
  }
  AbsListView absListView=(AbsListView)view.findViewById(isShowingListInsteadOfGrid() ? R.id.list : R.id.grid);
  linkAdapterWithListView(view);
  absListView.setOnItemClickListener(this);
  switchView(view);
}
Program: 42853
Project: 42853
Buggy source:
private void onFragmentVisible(){
  if (this.fragmentVisible) {
    return;
  }
  if (!isResumed()) {
    return;
  }
  this.fragmentVisible=true;
  switchView(getView());
  if (this.adapter == null || !this.adapter.isInitialized()) {
    LoaderUtils.restartLoader(this,ROUTES_LOADER,null,this);
  }
  checkIfShowingListInsteadOfGridChanged();
  getActivity().supportInvalidateOptionsMenu();
  updateListGridToggleMenuItem();
}

Fixed version (ground truth):
private void onFragmentVisible(){
  if (this.fragmentVisible) {
    return;
  }
  if (!isResumed()) {
    return;
  }
  this.fragmentVisible=true;
  switchView(getView());
  if (this.adapter == null || !this.adapter.isInitialized()) {
    LoaderUtils.restartLoader(this,ROUTES_LOADER,null,this);
  }
  checkIfShowingListInsteadOfGridChanged();
  if (getActivity() != null) {
    getActivity().invalidateOptionsMenu();
  }
  updateListGridToggleMenuItem();
}
Program: 42854
Project: 42854
Buggy source:
public static void destroyAd(Activity activity){
  if (!AD_ENABLED) {
    return;
  }
  View adLayout=activity == null ? null : activity.findViewById(R.id.ad_layout);
  if (adLayout != null) {
    AdView adView=(AdView)adLayout.findViewById(R.id.ad);
    if (adView != null) {
      adView.destroy();
    }
  }
  adLoaded=null;
  if (setupAdTask != null) {
    setupAdTask.cancel(true);
  }
  setupAdTask=null;
}

Fixed version (ground truth):
public static void destroyAd(Activity activity){
  if (!AD_ENABLED) {
    return;
  }
  View adLayout=activity == null ? null : activity.findViewById(R.id.ad_layout);
  if (adLayout != null) {
    AdView adView=(AdView)adLayout.findViewById(R.id.ad);
    if (adView != null) {
      try {
        adView.removeAllViews();
        adView.destroy();
      }
 catch (      Throwable t) {
        MTLog.w(TAG,t,"String_Node_Str");
      }
    }
  }
  adLoaded=null;
  if (setupAdTask != null) {
    setupAdTask.cancel(true);
  }
  setupAdTask=null;
}
Program: 42858
Project: 42858
Buggy source:
private void updateCommonViewManual(int position,View convertView){
  if (convertView == null || convertView.getTag() == null || !(convertView.getTag() instanceof CommonViewHolder)) {
    return;
  }
  CommonViewHolder holder=(CommonViewHolder)convertView.getTag();
  POIManager poim=getItem(position);
  updateCommonView(holder,poim);
}

Fixed version (ground truth):
private void updateCommonViewManual(int position,View convertView){
  if (convertView == null || convertView.getTag() == null || !(convertView.getTag() instanceof CommonViewHolder)) {
    return;
  }
  CommonViewHolder holder=(CommonViewHolder)convertView.getTag();
  POIManager poim=getItem(position);
  updateCommonView(holder,poim);
  updatePOIStatus(holder.statusViewHolder,poim);
}
Program: 42859
Project: 42859
Buggy source:
private void updateABDrawerOpened(){
  getActionBar().setTitle(mDrawerTitle);
  getActionBar().setSubtitle(mDrawerSubtitle);
  if (mDrawerIcon > 0) {
    getActionBar().setIcon(mDrawerIcon);
  }
 else {
    getActionBar().setIcon(new ColorDrawable(getResources().getColor(android.R.color.transparent)));
  }
  if (mDrawerBgColor != null) {
    getActionBar().setBackgroundDrawable(new ColorDrawable(mDrawerBgColor));
  }
 else {
    getActionBar().setBackgroundDrawable(null);
  }
  this.mDrawerToggle.setDrawerIndicatorEnabled(true);
  invalidateOptionsMenu();
}

Fixed version (ground truth):
private void updateABDrawerOpened(){
  getActionBar().setTitle(mDrawerTitle);
  getActionBar().setSubtitle(mDrawerSubtitle);
  if (mDrawerIcon > 0) {
    getActionBar().setIcon(mDrawerIcon);
    getActionBar().setDisplayShowHomeEnabled(true);
  }
 else {
    getActionBar().setDisplayShowHomeEnabled(false);
  }
  if (mDrawerBgColor != null) {
    getActionBar().setBackgroundDrawable(new ColorDrawable(mDrawerBgColor));
  }
 else {
    getActionBar().setBackgroundDrawable(null);
  }
  this.mDrawerToggle.setDrawerIndicatorEnabled(true);
  invalidateOptionsMenu();
}
Program: 42860
Project: 42860
Buggy source:
private void updateABDrawerClosed(){
  getActionBar().setTitle(mTitle);
  getActionBar().setSubtitle(mSubtitle);
  if (mIcon > 0) {
    getActionBar().setIcon(mIcon);
  }
 else {
    getActionBar().setIcon(new ColorDrawable(getResources().getColor(android.R.color.transparent)));
  }
  if (mBgColor != null) {
    getActionBar().setBackgroundDrawable(new ColorDrawable(mBgColor));
  }
 else {
    getActionBar().setBackgroundDrawable(null);
  }
  this.mDrawerToggle.setDrawerIndicatorEnabled(getSupportFragmentManager().getBackStackEntryCount() < 1);
  invalidateOptionsMenu();
}

Fixed version (ground truth):
private void updateABDrawerClosed(){
  getActionBar().setTitle(mTitle);
  getActionBar().setSubtitle(mSubtitle);
  if (mIcon > 0) {
    getActionBar().setIcon(mIcon);
    getActionBar().setDisplayShowHomeEnabled(true);
  }
 else {
    getActionBar().setDisplayShowHomeEnabled(false);
  }
  if (mBgColor != null) {
    getActionBar().setBackgroundDrawable(new ColorDrawable(mBgColor));
  }
 else {
    getActionBar().setBackgroundDrawable(null);
  }
  this.mDrawerToggle.setDrawerIndicatorEnabled(getSupportFragmentManager().getBackStackEntryCount() < 1);
  invalidateOptionsMenu();
}
Program: 42861
Project: 42861
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  mTitle=mDrawerTitle=getTitle();
  mSubtitle=mDrawerSubtitle=getActionBar().getSubtitle();
  mIcon=mDrawerIcon=R.drawable.ic_launcher;
  mBgColor=mDrawerBgColor=ABFragment.NO_BG_COLOR;
  mDrawerLayout=(DrawerLayout)findViewById(R.id.drawer_layout);
  mDrawerList=(ListView)findViewById(R.id.left_drawer);
  mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow,GravityCompat.START);
  mDrawerListAdapter=new MenuAdapter(this);
  mDrawerList.setAdapter(mDrawerListAdapter);
  mDrawerList.setOnItemClickListener(this);
  getActionBar().setDisplayHomeAsUpEnabled(true);
  getActionBar().setHomeButtonEnabled(true);
  mDrawerToggle=new ActionBarDrawerToggle(this,mDrawerLayout,R.drawable.ic_drawer,R.string.drawer_open,R.string.drawer_close){
    @Override public void onDrawerClosed(    View view){
      updateABDrawerClosed();
    }
    @Override public void onDrawerOpened(    View drawerView){
      updateABDrawerOpened();
    }
  }
;
  mDrawerLayout.setDrawerListener(mDrawerToggle);
  getSupportFragmentManager().addOnBackStackChangedListener(this);
  if (savedInstanceState == null) {
    final String itemId=PreferenceUtils.getPrefLcl(this,PreferenceUtils.PREFS_LCL_ROOT_SCREEN_ITEM_ID,MenuAdapter.ITEM_ID_SELECTED_SCREEN_DEFAULT);
    selectItem(this.mDrawerListAdapter.getScreenItemPosition(itemId));
  }
 else {
    onRestoreState(savedInstanceState);
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  mTitle=mDrawerTitle=getTitle();
  mSubtitle=mDrawerSubtitle=getActionBar().getSubtitle();
  mIcon=mDrawerIcon=R.drawable.ic_launcher;
  mBgColor=mDrawerBgColor=ABFragment.NO_BG_COLOR;
  mDrawerLayout=(DrawerLayout)findViewById(R.id.drawer_layout);
  mDrawerList=(ListView)findViewById(R.id.left_drawer);
  mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow,GravityCompat.START);
  mDrawerListAdapter=new MenuAdapter(this);
  mDrawerList.setAdapter(mDrawerListAdapter);
  mDrawerList.setOnItemClickListener(this);
  getActionBar().setDisplayHomeAsUpEnabled(true);
  getActionBar().setHomeButtonEnabled(true);
  mDrawerToggle=new ActionBarDrawerToggle(this,mDrawerLayout,R.drawable.ic_drawer,R.string.drawer_open,R.string.drawer_close){
    @Override public void onDrawerClosed(    View view){
      updateABDrawerClosed();
    }
    @Override public void onDrawerOpened(    View drawerView){
      updateABDrawerOpened();
    }
    @Override public void onDrawerStateChanged(    int newState){
      mDrawerState=newState;
    }
  }
;
  mDrawerLayout.setDrawerListener(mDrawerToggle);
  getSupportFragmentManager().addOnBackStackChangedListener(this);
  if (savedInstanceState == null) {
    final String itemId=PreferenceUtils.getPrefLcl(this,PreferenceUtils.PREFS_LCL_ROOT_SCREEN_ITEM_ID,MenuAdapter.ITEM_ID_SELECTED_SCREEN_DEFAULT);
    selectItem(this.mDrawerListAdapter.getScreenItemPosition(itemId));
  }
 else {
    onRestoreState(savedInstanceState);
  }
}
Program: 42862
Project: 42862
Buggy source:
private void updateAB(){
  if (isDrawerOpen()) {
    updateABDrawerOpened();
  }
 else {
    updateABDrawerClosed();
  }
}

Fixed version (ground truth):
private void updateAB(){
  if (mDrawerState != DrawerLayout.STATE_IDLE) {
    return;
  }
  if (isDrawerOpen()) {
    updateABDrawerOpened();
  }
 else {
    updateABDrawerClosed();
  }
}
Program: 42863
Project: 42863
Buggy source:
@Override public void onUserLocationChanged(Location newLocation){
  if (newLocation != null) {
    this.userLocation=newLocation;
    if (this.agencyTypePagerAdapter != null) {
      this.agencyTypePagerAdapter.setUserLocation(newLocation);
    }
    if (this.nearbyLocation == null) {
      setNewNearbyLocation(newLocation);
    }
    boolean requireNotifyAB=false;
    if (LocationUtils.areAlmostTheSame(this.nearbyLocation,this.userLocation)) {
      if (this.userAwayFromNearbyLocation) {
        requireNotifyAB=true;
        this.userAwayFromNearbyLocation=false;
      }
    }
 else {
      if (!this.userAwayFromNearbyLocation) {
        requireNotifyAB=true;
        this.userAwayFromNearbyLocation=true;
      }
    }
    if (requireNotifyAB) {
      ((MainActivity)getActivity()).notifyABChange();
    }
  }
}

Fixed version (ground truth):
@Override public void onUserLocationChanged(Location newLocation){
  if (newLocation != null) {
    this.userLocation=newLocation;
    final List<Fragment> fragments=getChildFragmentManager().getFragments();
    if (fragments != null) {
      for (      Fragment fragment : fragments) {
        if (fragment != null && fragment instanceof MTActivityWithLocation.UserLocationListener) {
          ((MTActivityWithLocation.UserLocationListener)fragment).onUserLocationChanged(this.userLocation);
        }
      }
    }
    if (this.agencyTypePagerAdapter != null) {
      this.agencyTypePagerAdapter.setUserLocation(newLocation);
    }
    if (this.nearbyLocation == null) {
      setNewNearbyLocation(newLocation);
    }
    boolean requireNotifyAB=false;
    if (LocationUtils.areAlmostTheSame(this.nearbyLocation,this.userLocation)) {
      if (this.userAwayFromNearbyLocation) {
        requireNotifyAB=true;
        this.userAwayFromNearbyLocation=false;
      }
    }
 else {
      if (!this.userAwayFromNearbyLocation) {
        requireNotifyAB=true;
        this.userAwayFromNearbyLocation=true;
      }
    }
    if (requireNotifyAB) {
      ((MainActivity)getActivity()).notifyABChange();
    }
  }
}
Program: 42864
Project: 42864
Buggy source:
public void onFragmentInvisible(){
  if (!this.fragmentVisible) {
    return;
  }
  this.fragmentVisible=false;
  if (this.adapter != null) {
    this.adapter.onPause();
  }
}

Fixed version (ground truth):
private void onFragmentInvisible(){
  if (!this.fragmentVisible) {
    return;
  }
  this.fragmentVisible=false;
  if (this.adapter != null) {
    this.adapter.onPause();
  }
}
Program: 42865
Project: 42865
Buggy source:
public void onFragmentVisisble(){
  if (this.fragmentVisible) {
    return;
  }
  this.fragmentVisible=true;
  if (this.adapter == null) {
    initAdapter();
  }
 else {
    if (this.adapter.getPoisCount() > 0) {
      this.adapter.onResume();
      this.adapter.refreshFavorites();
    }
  }
  NearbyFragment nearbyFragment=(NearbyFragment)getActivity().getSupportFragmentManager().findFragmentByTag(NearbyFragment.FRAGMENT_TAG);
  if (nearbyFragment != null) {
    useNewNearbyLocation(nearbyFragment.getNearbyLocation(),false);
    onUserLocationChanged(nearbyFragment.getUserLocation());
  }
}

Fixed version (ground truth):
private void onFragmentVisisble(){
  if (this.fragmentVisible) {
    return;
  }
  this.fragmentVisible=true;
  if (this.adapter == null) {
    initAdapter();
  }
 else {
    if (this.adapter.getPoisCount() > 0) {
      this.adapter.onResume();
      this.adapter.refreshFavorites();
    }
  }
  NearbyFragment nearbyFragment=(NearbyFragment)getActivity().getSupportFragmentManager().findFragmentByTag(NearbyFragment.FRAGMENT_TAG);
  if (nearbyFragment != null) {
    useNewNearbyLocation(nearbyFragment.getNearbyLocation(),false);
    onUserLocationChanged(nearbyFragment.getUserLocation());
  }
}
Program: 42867
Project: 42867
Buggy source:
@Override protected void onPostExecute(Integer lastPageSelected){
  if (lastPageSelected != null) {
    if (NearbyFragment.this.lastPageSelected == 0) {
      viewPager.setCurrentItem(lastPageSelected.intValue());
      NearbyFragment.this.lastPageSelected=lastPageSelected.intValue();
      onPageSelected(NearbyFragment.this.lastPageSelected);
    }
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(Integer lastPageSelected){
  if (NearbyFragment.this.lastPageSelected != 0) {
    return;
  }
  if (lastPageSelected != null) {
    NearbyFragment.this.lastPageSelected=lastPageSelected.intValue();
    viewPager.setCurrentItem(NearbyFragment.this.lastPageSelected);
  }
  onPageSelected(NearbyFragment.this.lastPageSelected);
}
Program: 42868
Project: 42868
Buggy source:
private void useNewNearbyLocation(Location newNearbyLocation,boolean force){
  if (!force && (newNearbyLocation == null || !this.fragmentVisible || LocationUtils.areTheSame(newNearbyLocation,this.nearbyLocation))) {
    return;
  }
  this.nearbyLocation=newNearbyLocation;
  if (this.adapter != null) {
    this.adapter.setPois(null);
    this.adapter.notifyDataSetChanged(true);
  }
  if (this.nearbyLocation == null) {
    final View view=getView();
    if (view != null) {
      if (view.findViewById(R.id.list) != null) {
        ((ListView)view.findViewById(R.id.list)).setSelectionFromTop(0,0);
      }
    }
  }
  this.ad=LocationUtils.DEFAULT_AROUND_DIFF;
  showLoading();
  if (this.nearbyLocation != null) {
    getLoaderManager().restartLoader(NEARBY_POIS_LOADER,null,this);
  }
}

Fixed version (ground truth):
private void useNewNearbyLocation(Location newNearbyLocation,boolean force){
  if (!force && (newNearbyLocation == null || !this.fragmentVisible || LocationUtils.areTheSame(newNearbyLocation,this.nearbyLocation))) {
    return;
  }
  this.nearbyLocation=newNearbyLocation;
  if (this.adapter != null) {
    this.adapter.clearAll();
    this.adapter.notifyDataSetChanged(true);
  }
  final View view=getView();
  if (view != null) {
    if (view.findViewById(R.id.list) != null) {
      ((ListView)view.findViewById(R.id.list)).setSelectionFromTop(0,0);
    }
  }
  this.ad=LocationUtils.DEFAULT_AROUND_DIFF;
  showLoading();
  if (this.nearbyLocation != null) {
    getLoaderManager().restartLoader(NEARBY_POIS_LOADER,null,this);
  }
}
Program: 42869
Project: 42869
Buggy source:
@Override public void onLoaderReset(Loader<List<POIManager>> loader){
  if (this.adapter != null) {
    this.adapter.setPois(null);
    this.adapter.onPause();
  }
}

Fixed version (ground truth):
@Override public void onLoaderReset(Loader<List<POIManager>> loader){
  if (this.adapter != null) {
    this.adapter.clearAll();
    this.adapter.onPause();
  }
}
Program: 42870
Project: 42870
Buggy source:
private void useNewNearbyLocation(Location newNearbyLocation,boolean force){
  if (!force && (newNearbyLocation == null || !this.fragmentVisible || LocationUtils.areTheSame(newNearbyLocation,this.nearbyLocation))) {
    return;
  }
  this.nearbyLocation=newNearbyLocation;
  if (this.adapter != null) {
    this.adapter.clearAll();
    this.adapter.notifyDataSetChanged(true);
  }
  final View view=getView();
  if (view != null) {
    if (view.findViewById(R.id.list) != null) {
      ((ListView)view.findViewById(R.id.list)).setSelectionFromTop(0,0);
    }
  }
  this.ad=LocationUtils.DEFAULT_AROUND_DIFF;
  showLoading();
  if (this.nearbyLocation != null) {
    getLoaderManager().restartLoader(NEARBY_POIS_LOADER,null,this);
  }
}

Fixed version (ground truth):
private void useNewNearbyLocation(Location newNearbyLocation,boolean force){
  if (!force && (newNearbyLocation == null || !this.fragmentVisible || LocationUtils.areTheSame(newNearbyLocation,this.nearbyLocation))) {
    return;
  }
  this.nearbyLocation=newNearbyLocation;
  if (this.adapter != null) {
    this.adapter.clear();
  }
  final View view=getView();
  if (view != null) {
    if (view.findViewById(R.id.list) != null) {
      ((ListView)view.findViewById(R.id.list)).setSelectionFromTop(0,0);
    }
  }
  this.ad=LocationUtils.DEFAULT_AROUND_DIFF;
  showLoading();
  if (this.nearbyLocation != null) {
    getLoaderManager().restartLoader(NEARBY_POIS_LOADER,null,this);
  }
}
Program: 42871
Project: 42871
Buggy source:
@Override public void onLoaderReset(Loader<List<POIManager>> loader){
  if (this.adapter != null) {
    this.adapter.clearAll();
    this.adapter.onPause();
  }
}

Fixed version (ground truth):
@Override public void onLoaderReset(Loader<List<POIManager>> loader){
  if (this.adapter != null) {
    this.adapter.clear();
    this.adapter.onPause();
  }
}
Program: 42873
Project: 42873
Buggy source:
@Override protected void configure(){
  bind(LicenseService.class).in(Singleton.class);
  bind(ConfigurationService.class).in(Singleton.class);
  bind(SocketService.class).in(Singleton.class);
  bind(PublicOpKeyService.class).in(Singleton.class);
  bind(RpService.class).in(Singleton.class);
  bind(HttpService.class).in(Singleton.class);
  bind(SqlPersistenceProvider.class).to(H2PersistenceProvider.class).in(Singleton.class);
  bind(PersistenceService.class).to(PersistenceServiceImpl.class).in(Singleton.class);
  bind(MigrationService.class).in(Singleton.class);
  bind(DiscoveryService.class).in(Singleton.class);
  bind(ValidationService.class).in(Singleton.class);
  bind(TimeService.class).in(Singleton.class);
  bind(StateService.class).in(Singleton.class);
  bind(Configuration.class).toProvider(ConfigurationService.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(LicenseService.class).in(Singleton.class);
  bind(ConfigurationService.class).in(Singleton.class);
  bind(SocketService.class).in(Singleton.class);
  bind(PublicOpKeyService.class).in(Singleton.class);
  bind(RpService.class).in(Singleton.class);
  bind(HttpService.class).in(Singleton.class);
  bind(IntrospectionService.class).in(Singleton.class);
  bind(SqlPersistenceProvider.class).to(H2PersistenceProvider.class).in(Singleton.class);
  bind(PersistenceService.class).to(PersistenceServiceImpl.class).in(Singleton.class);
  bind(MigrationService.class).in(Singleton.class);
  bind(DiscoveryService.class).in(Singleton.class);
  bind(ValidationService.class).in(Singleton.class);
  bind(TimeService.class).in(Singleton.class);
  bind(StateService.class).in(Singleton.class);
  bind(Configuration.class).toProvider(ConfigurationService.class);
}
Program: 42874
Project: 42874
Buggy source:
@Override public CommandResponse execute(IntrospectAccessTokenParams params) throws Exception {
  getValidationService().validate(params);
  final IntrospectionService introspectionService=ProxyFactory.create(IntrospectionService.class,getDiscoveryService().getConnectDiscoveryResponseByOxdId(params.getOxdId()).getIntrospectionEndpoint(),getHttpService().getClientExecutor());
  IntrospectionResponse response=null;
  try {
    response=introspectionService.introspectToken("String_Node_Str" + getUmaTokenService().getPat(params.getOxdId()).getToken(),params.getAccessToken());
  }
 catch (  ClientResponseFailure e) {
    int status=e.getResponse().getStatus();
    LOG.debug("String_Node_Str" + e.getResponse().getEntity(String.class) + "String_Node_Str"+ status,e);
    if (status == 400 || status == 401) {
      LOG.debug("String_Node_Str");
      getUmaTokenService().obtainPat(params.getOxdId());
      response=introspectionService.introspectToken("String_Node_Str" + getUmaTokenService().getPat(params.getOxdId()).getToken(),params.getAccessToken());
    }
 else {
      throw e;
    }
  }
  return CommandResponse.ok().setData(new POJONode(response));
}

Fixed version (ground truth):
@Override public CommandResponse execute(IntrospectAccessTokenParams params) throws Exception {
  getValidationService().validate(params);
  final IntrospectionService introspectionService=getInstance(IntrospectionService.class);
  IntrospectionResponse response=introspectionService.introspectToken(params.getOxdId(),params.getAccessToken());
  return CommandResponse.ok().setData(new POJONode(response));
}
Program: 42875
Project: 42875
Buggy source:
public IntrospectionResponse introspect(String accessToken,String oxdId){
  if (StringUtils.isBlank(accessToken)) {
    throw new ErrorResponseException(ErrorResponseCode.BLANK_PROTECTION_ACCESS_TOKEN);
  }
  final RpService rpService=ServerLauncher.getInjector().getInstance(RpService.class);
  final Rp rp=rpService.getRp(oxdId);
  if (StringUtils.isNotBlank(rp.getSetupOxdId())) {
    oxdId=rp.getSetupOxdId();
  }
  LOG.trace("String_Node_Str" + rpService.getRp(oxdId));
  final DiscoveryService discoveryService=ServerLauncher.getInjector().getInstance(DiscoveryService.class);
  final String introspectionEndpoint=discoveryService.getConnectDiscoveryResponseByOxdId(oxdId).getIntrospectionEndpoint();
  final UmaTokenService umaTokenService=ServerLauncher.getInjector().getInstance(UmaTokenService.class);
  final HttpService httpService=ServerLauncher.getInjector().getInstance(HttpService.class);
  final IntrospectionService introspectionService=ProxyFactory.create(IntrospectionService.class,introspectionEndpoint,httpService.getClientExecutor());
  IntrospectionResponse response=null;
  try {
    response=introspectionService.introspectToken("String_Node_Str" + umaTokenService.getPat(oxdId).getToken(),accessToken);
  }
 catch (  ClientResponseFailure e) {
    int status=e.getResponse().getStatus();
    LOG.debug("String_Node_Str" + e.getResponse().getEntity(String.class) + "String_Node_Str"+ status,e);
    if (status == 400 || status == 401) {
      LOG.debug("String_Node_Str");
      umaTokenService.obtainPat(oxdId);
      response=introspectionService.introspectToken("String_Node_Str" + umaTokenService.getPat(oxdId).getToken(),accessToken);
    }
 else {
      throw e;
    }
  }
  if (!response.isActive()) {
    LOG.debug("String_Node_Str");
    throw new ErrorResponseException(ErrorResponseCode.INACTIVE_PROTECTION_ACCESS_TOKEN);
  }
  return response;
}

Fixed version (ground truth):
public IntrospectionResponse introspect(String accessToken,String oxdId){
  if (StringUtils.isBlank(accessToken)) {
    throw new ErrorResponseException(ErrorResponseCode.BLANK_PROTECTION_ACCESS_TOKEN);
  }
  final RpService rpService=ServerLauncher.getInjector().getInstance(RpService.class);
  final Rp rp=rpService.getRp(oxdId);
  if (StringUtils.isNotBlank(rp.getSetupOxdId())) {
    oxdId=rp.getSetupOxdId();
  }
  LOG.trace("String_Node_Str" + rpService.getRp(oxdId));
  final IntrospectionService introspectionService=ServerLauncher.getInjector().getInstance(IntrospectionService.class);
  final IntrospectionResponse response=introspectionService.introspectToken(oxdId,accessToken);
  if (!response.isActive()) {
    LOG.debug("String_Node_Str");
    throw new ErrorResponseException(ErrorResponseCode.INACTIVE_PROTECTION_ACCESS_TOKEN);
  }
  return response;
}
Program: 42876
Project: 42876
Buggy source:
public Rp getRp(String oxdId){
  Connection conn=null;
  try {
    conn=provider.getConnection();
    conn.setAutoCommit(false);
    PreparedStatement query=conn.prepareStatement("String_Node_Str");
    query.setString(1,oxdId);
    ResultSet rs=query.executeQuery();
    rs.next();
    String data=rs.getString("String_Node_Str");
    query.close();
    conn.commit();
    Rp rp=MigrationService.parseRp(data);
    if (rp != null) {
      LOG.debug("String_Node_Str" + oxdId + "String_Node_Str"+ rp);
      return rp;
    }
 else {
      LOG.error("String_Node_Str" + oxdId);
      throw new RuntimeException("String_Node_Str" + oxdId);
    }
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str" + oxdId + "String_Node_Str"+ e.getMessage(),e);
    rollbackSilently(conn);
    throw new RuntimeException(e);
  }
 finally {
    IOUtils.closeSilently(conn);
  }
}

Fixed version (ground truth):
public Rp getRp(String oxdId){
  Connection conn=null;
  try {
    conn=provider.getConnection();
    conn.setAutoCommit(false);
    PreparedStatement query=conn.prepareStatement("String_Node_Str");
    query.setString(1,oxdId);
    ResultSet rs=query.executeQuery();
    rs.next();
    String data=rs.getString("String_Node_Str");
    query.close();
    conn.commit();
    Rp rp=MigrationService.parseRp(data);
    if (rp != null) {
      LOG.debug("String_Node_Str" + oxdId + "String_Node_Str"+ rp);
      return rp;
    }
 else {
      LOG.error("String_Node_Str" + oxdId);
      return null;
    }
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str" + oxdId + "String_Node_Str"+ e.getMessage(),e);
    rollbackSilently(conn);
    return null;
  }
 finally {
    IOUtils.closeSilently(conn);
  }
}
Program: 42877
Project: 42877
Buggy source:
public boolean remove(String oxdId){
  return persistenceService.remove(oxdId);
}

Fixed version (ground truth):
public boolean remove(String oxdId){
  boolean ok=persistenceService.remove(oxdId);
  if (ok) {
    rpMap.remove(oxdId);
  }
  return ok;
}
Program: 42878
Project: 42878
Buggy source:
public static String getConfPath(){
  return Tester.class.getProtectionDomain().getCodeSource().getLocation().getPath() + File.separator + ConfigurationService.TEST_FILE_NAME;
}

Fixed version (ground truth):
public static String getConfPath(){
  String workingDir=System.getProperty("String_Node_Str");
  System.out.println("String_Node_Str" + workingDir);
  return workingDir + "String_Node_Str" + File.separator+ ConfigurationService.TEST_FILE_NAME;
}
Program: 42879
Project: 42879
Buggy source:
public static void setSystemConfPath(){
  System.setProperty(ConfigurationService.CONF_SYS_PROPERTY_NAME,getConfPath());
}

Fixed version (ground truth):
public static void setSystemConfPath(){
  System.setProperty(ConfigurationService.CONF_SYS_PROPERTY_NAME,getConfPath());
  System.out.println(ConfigurationService.CONF_SYS_PROPERTY_NAME + "String_Node_Str" + System.getProperty(ConfigurationService.CONF_SYS_PROPERTY_NAME));
}
Program: 42880
Project: 42880
Buggy source:
@Test(invocationCount=10,threadPoolSize=10) public void stressTest() throws IOException {
  final Rp rp=configurationService.defaultRp();
  rp.setOxdId(UUID.randomUUID().toString());
  rp.setPat(UUID.randomUUID().toString());
  service.create(rp);
  for (int i=0; i < 11; i++) {
    EXECUTOR_SERVICE.submit(new Runnable(){
      @Override public void run(){
        try {
          rp.setPat(UUID.randomUUID().toString());
          service.update(rp);
          System.out.println("String_Node_Str" + rp.getPat() + "String_Node_Str"+ rp.getOxdId());
        }
 catch (        Throwable e) {
          throw new AssertionError("String_Node_Str" + rp.getOxdId());
        }
      }
    }
);
  }
}

Fixed version (ground truth):
@Test(invocationCount=10,threadPoolSize=10,enabled=false) public void stressTest() throws IOException {
  final Rp rp=configurationService.defaultRp();
  rp.setOxdId(UUID.randomUUID().toString());
  rp.setPat(UUID.randomUUID().toString());
  service.create(rp);
  for (int i=0; i < 11; i++) {
    EXECUTOR_SERVICE.submit(new Runnable(){
      @Override public void run(){
        try {
          rp.setPat(UUID.randomUUID().toString());
          service.update(rp);
          System.out.println("String_Node_Str" + rp.getPat() + "String_Node_Str"+ rp.getOxdId());
        }
 catch (        Throwable e) {
          throw new AssertionError("String_Node_Str" + rp.getOxdId());
        }
      }
    }
);
  }
}
Program: 42881
Project: 42881
Buggy source:
@Test public void persist() throws Exception {
  Rp rp=newRp();
  service.create(rp);
  assertEquals(service.getRps().size(),2);
  rp.setClientName("String_Node_Str");
  service.update(rp);
  assertEquals(service.getRp(rp.getOxdId()).getClientName(),"String_Node_Str");
  assertEquals(persistenceService.getRp(rp.getOxdId()).getClientName(),"String_Node_Str");
}

Fixed version (ground truth):
@Test public void persist() throws Exception {
  Rp rp=newRp();
  service.create(rp);
  assertEquals(service.getRps().size(),1);
  rp.setClientName("String_Node_Str");
  service.update(rp);
  assertEquals(service.getRp(rp.getOxdId()).getClientName(),"String_Node_Str");
  assertEquals(persistenceService.getRp(rp.getOxdId()).getClientName(),"String_Node_Str");
}