nus-yam/ex-repair huggingface dataset:
Program: 58291
Project: 58291
Buggy source:
@Override public void onNavigationDrawerItemSelected(int position){
  FragmentManager fragmentManager=getFragmentManager();
  if (position == 0) {
    fragmentManager.beginTransaction().setCustomAnimations(android.R.animator.fade_in,android.R.animator.fade_out,android.R.animator.fade_in,android.R.animator.fade_out).replace(R.id.container,HomeFragment.newInstance()).commit();
  }
 else   if (position == 1) {
    fragmentManager.beginTransaction().setCustomAnimations(android.R.animator.fade_in,android.R.animator.fade_out,android.R.animator.fade_in,android.R.animator.fade_out).replace(R.id.container,WakelocksFragment.newInstance()).addToBackStack("String_Node_Str").commit();
  }
 else   if (position == 2) {
    fragmentManager.beginTransaction().setCustomAnimations(android.R.animator.fade_in,android.R.animator.fade_out,android.R.animator.fade_in,android.R.animator.fade_out).replace(R.id.container,AlarmsFragment.newInstance()).addToBackStack("String_Node_Str").commit();
  }
 else   if (position == 3) {
    Intent intent=new Intent(this,SettingsActivity.class);
    startActivity(intent);
  }
}

Fixed version (ground truth):
@Override public void onNavigationDrawerItemSelected(int position){
  FragmentManager fragmentManager=getFragmentManager();
  if (position == 0) {
    if (fragmentManager.getBackStackEntryCount() == 0) {
      fragmentManager.beginTransaction().setCustomAnimations(android.R.animator.fade_in,android.R.animator.fade_out,android.R.animator.fade_in,android.R.animator.fade_out).replace(R.id.container,HomeFragment.newInstance(),"String_Node_Str").commit();
    }
 else {
      fragmentManager.beginTransaction().setCustomAnimations(android.R.animator.fade_in,android.R.animator.fade_out,android.R.animator.fade_in,android.R.animator.fade_out).replace(R.id.container,HomeFragment.newInstance(),"String_Node_Str").addToBackStack("String_Node_Str").commit();
    }
  }
 else   if (position == 1) {
    fragmentManager.beginTransaction().setCustomAnimations(android.R.animator.fade_in,android.R.animator.fade_out,android.R.animator.fade_in,android.R.animator.fade_out).replace(R.id.container,WakelocksFragment.newInstance(),"String_Node_Str").addToBackStack("String_Node_Str").commit();
  }
 else   if (position == 2) {
    fragmentManager.beginTransaction().setCustomAnimations(android.R.animator.fade_in,android.R.animator.fade_out,android.R.animator.fade_in,android.R.animator.fade_out).replace(R.id.container,AlarmsFragment.newInstance(),"String_Node_Str").addToBackStack("String_Node_Str").commit();
  }
 else   if (position == 3) {
    Intent intent=new Intent(this,SettingsActivity.class);
    startActivity(intent);
  }
}
Program: 58292
Project: 58292
Buggy source:
@Override public void onDrawerClosed(View drawerView){
  super.onDrawerClosed(drawerView);
  if (!isAdded()) {
    return;
  }
  getActivity().invalidateOptionsMenu();
}

Fixed version (ground truth):
@Override public void onDrawerClosed(View drawerView){
  super.onDrawerClosed(drawerView);
  mClosing=false;
  if (!isAdded()) {
    return;
  }
  getActivity().invalidateOptionsMenu();
}
Program: 58293
Project: 58293
Buggy source:
private void selectItem(int position){
  mCurrentSelectedPosition=position;
  if (mDrawerListView != null) {
    mDrawerListView.setItemChecked(position,true);
  }
  if (mDrawerLayout != null) {
    mDrawerLayout.closeDrawer(mFragmentContainerView);
  }
  if (mCallbacks != null) {
    mCallbacks.onNavigationDrawerItemSelected(position);
  }
}

Fixed version (ground truth):
private void selectItem(int position){
  mCurrentSelectedPosition=position;
  if (mDrawerListView != null) {
    mDrawerListView.setItemChecked(position,true);
  }
  if (mDrawerLayout != null) {
    mDrawerLayout.closeDrawer(mFragmentContainerView);
    mClosing=true;
  }
  if (mCallbacks != null) {
    mCallbacks.onNavigationDrawerItemSelected(position);
  }
}
Program: 58294
Project: 58294
Buggy source:
/** 
 * Users of this fragment must call this method to set up the navigation drawer interactions.
 * @param fragmentId   The android:id of this fragment in its activity's layout.
 * @param drawerLayout The DrawerLayout containing this fragment's UI.
 */
public void setUp(int fragmentId,DrawerLayout drawerLayout){
  mFragmentContainerView=getActivity().findViewById(fragmentId);
  mDrawerLayout=drawerLayout;
  mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow,GravityCompat.START);
  ActionBar actionBar=getActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
  actionBar.setHomeButtonEnabled(true);
  mDrawerToggle=new ActionBarDrawerToggle(getActivity(),mDrawerLayout,R.drawable.ic_drawer,R.string.navigation_drawer_open,R.string.navigation_drawer_close){
    @Override public void onDrawerClosed(    View drawerView){
      super.onDrawerClosed(drawerView);
      if (!isAdded()) {
        return;
      }
      getActivity().invalidateOptionsMenu();
    }
    @Override public void onDrawerOpened(    View drawerView){
      super.onDrawerOpened(drawerView);
      if (!isAdded()) {
        return;
      }
      getActivity().invalidateOptionsMenu();
    }
  }
;
  mDrawerLayout.post(new Runnable(){
    @Override public void run(){
      mDrawerToggle.syncState();
    }
  }
);
  mDrawerLayout.setDrawerListener(mDrawerToggle);
}

Fixed version (ground truth):
/** 
 * Users of this fragment must call this method to set up the navigation drawer interactions.
 * @param fragmentId   The android:id of this fragment in its activity's layout.
 * @param drawerLayout The DrawerLayout containing this fragment's UI.
 */
public void setUp(int fragmentId,DrawerLayout drawerLayout){
  mFragmentContainerView=getActivity().findViewById(fragmentId);
  mDrawerLayout=drawerLayout;
  mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow,GravityCompat.START);
  ActionBar actionBar=getActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
  actionBar.setHomeButtonEnabled(true);
  mDrawerToggle=new ActionBarDrawerToggle(getActivity(),mDrawerLayout,R.drawable.ic_drawer,R.string.navigation_drawer_open,R.string.navigation_drawer_close){
    @Override public void onDrawerClosed(    View drawerView){
      super.onDrawerClosed(drawerView);
      mClosing=false;
      if (!isAdded()) {
        return;
      }
      getActivity().invalidateOptionsMenu();
    }
    @Override public void onDrawerOpened(    View drawerView){
      super.onDrawerOpened(drawerView);
      if (!isAdded()) {
        return;
      }
      getActivity().invalidateOptionsMenu();
    }
  }
;
  mDrawerLayout.post(new Runnable(){
    @Override public void run(){
      mDrawerToggle.syncState();
    }
  }
);
  mDrawerLayout.setDrawerListener(mDrawerToggle);
}
Program: 58295
Project: 58295
Buggy source:
@Override public void onCreateOptionsMenu(Menu menu,MenuInflater inflater){
  if (mDrawerLayout != null && isDrawerOpen()) {
    inflater.inflate(R.menu.global,menu);
    showGlobalContextActionBar();
  }
  super.onCreateOptionsMenu(menu,inflater);
}

Fixed version (ground truth):
@Override public void onCreateOptionsMenu(Menu menu,MenuInflater inflater){
  if (mDrawerLayout != null && isDrawerOpen() && !mClosing) {
    inflater.inflate(R.menu.global,menu);
    showGlobalContextActionBar();
  }
  super.onCreateOptionsMenu(menu,inflater);
}
Program: 58296
Project: 58296
Buggy source:
private void updateEnabledAlarm(boolean b){
  String blockName="String_Node_Str" + mStat.getName() + "String_Node_Str";
  if (!mTaskerMode) {
    SharedPreferences prefs=getActivity().getSharedPreferences("String_Node_Str" + "String_Node_Str",Context.MODE_WORLD_READABLE);
    SharedPreferences.Editor editor=prefs.edit();
    editor.putBoolean(blockName,b);
    editor.commit();
  }
  getView().findViewById(R.id.editAlarmSeconds).setEnabled(b);
  View panel=(View)getView().findViewById(R.id.settingsPanel);
  panel.setBackgroundColor(b ? getResources().getColor(R.color.background_panel_enabled) : getResources().getColor(R.color.background_panel_disabled));
  panel.setAlpha(b ? 1 : (float).4);
  if (mClearListener != null) {
    mClearListener.onAlarmCleared();
  }
}

Fixed version (ground truth):
private void updateEnabledAlarm(boolean b){
  String blockName="String_Node_Str" + mStat.getName() + "String_Node_Str";
  if (!mTaskerMode) {
    SharedPreferences prefs=getActivity().getSharedPreferences("String_Node_Str" + "String_Node_Str",Context.MODE_WORLD_READABLE);
    SharedPreferences.Editor editor=prefs.edit();
    editor.putBoolean(blockName,b);
    editor.commit();
  }
  getView().findViewById(R.id.editAlarmSeconds).setEnabled(b);
  View panel=(View)getView().findViewById(R.id.settingsPanel);
  TypedValue backgroundValue=new TypedValue();
  Resources.Theme theme=getActivity().getTheme();
  int resId=b ? R.attr.background_panel_enabled : R.attr.background_panel_disabled;
  boolean success=theme.resolveAttribute(resId,backgroundValue,true);
  Drawable backgroundColor=getResources().getDrawable(R.drawable.header_background_dark);
  if (success) {
    backgroundColor=getResources().getDrawable(backgroundValue.resourceId);
  }
  panel.setBackgroundDrawable(backgroundColor);
  panel.setAlpha(b ? 1 : (float).4);
  if (mClearListener != null) {
    mClearListener.onAlarmCleared();
  }
}
Program: 58297
Project: 58297
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  String action=intent.getAction();
  if (action.equals(SEND_STATS_ACTION)) {
    HashMap<String,BaseStats> stats=null;
    try {
      stats=(HashMap<String,BaseStats>)intent.getSerializableExtra("String_Node_Str");
    }
 catch (    RuntimeException rte) {
      stats=new HashMap<String,BaseStats>();
    }
    int statType=intent.getIntExtra("String_Node_Str",-1);
    long runningSince=intent.getLongExtra("String_Node_Str",-1);
    UnbounceStatsCollection collection=UnbounceStatsCollection.getInstance();
    collection.populateSerializableStats(stats,statType,runningSince);
    collection.saveIfNeeded(context);
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  String action=intent.getAction();
  if (action.equals(SEND_STATS_ACTION)) {
    HashMap<String,BaseStats> stats=null;
    try {
      stats=(HashMap<String,BaseStats>)intent.getSerializableExtra("String_Node_Str");
      Iterator<BaseStats> iter=stats.values().iterator();
      if (iter.hasNext()) {
        BaseStats testStat=iter.next();
        if (!(testStat instanceof BaseStats)) {
          throw new ClassCastException();
        }
      }
    }
 catch (    RuntimeException rte) {
      stats=new HashMap<String,BaseStats>();
    }
    int statType=intent.getIntExtra("String_Node_Str",-1);
    long runningSince=intent.getLongExtra("String_Node_Str",-1);
    UnbounceStatsCollection collection=UnbounceStatsCollection.getInstance();
    collection.populateSerializableStats(stats,statType,runningSince);
    collection.saveIfNeeded(context);
  }
}
Program: 58298
Project: 58298
Buggy source:
private void warnUnknownAlarm(final Switch onOff){
  new AlertDialog.Builder(getActivity()).setTitle("String_Node_Str").setMessage("String_Node_Str").setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      onOff.setChecked(true);
      updateEnabledAlarm(true);
    }
  }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      onOff.setChecked(false);
      updateEnabledAlarm(false);
    }
  }
).setIcon(android.R.drawable.ic_dialog_alert).show();
}

Fixed version (ground truth):
private void warnUnknownAlarm(final Switch onOff){
  new AlertDialog.Builder(getActivity()).setTitle(R.string.alert_unknown_alarm_title).setMessage(R.string.alert_unknown_alarm_content).setPositiveButton(R.string.dialog_unbounce,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      onOff.setChecked(true);
      updateEnabledAlarm(true);
    }
  }
).setNegativeButton(R.string.dialog_cancel,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      onOff.setChecked(false);
      updateEnabledAlarm(false);
    }
  }
).setIcon(android.R.drawable.ic_dialog_alert).show();
}
Program: 58299
Project: 58299
Buggy source:
private void warnLicensing(final Switch onOff){
  new AlertDialog.Builder(getActivity()).setTitle("String_Node_Str").setMessage("String_Node_Str").setNeutralButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      onOff.setChecked(false);
      updateEnabledAlarm(false);
    }
  }
).setIcon(android.R.drawable.ic_dialog_info).show();
}

Fixed version (ground truth):
private void warnLicensing(final Switch onOff){
  new AlertDialog.Builder(getActivity()).setTitle(R.string.alert_nopro_title).setMessage(R.string.alert_nopro_content).setNeutralButton(R.string.dialog_ok,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      onOff.setChecked(false);
      updateEnabledAlarm(false);
    }
  }
).setIcon(android.R.drawable.ic_dialog_info).show();
}
Program: 58301
Project: 58301
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  if (mListener != null)   mListener.onAlarmsSetTitle("String_Node_Str");
  mAdapter.sort();
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  if (mListener != null)   mListener.onAlarmsSetTitle(getResources().getString(R.string.title_alarms));
  mAdapter.sort();
}
Program: 58302
Project: 58302
Buggy source:
@Override public void onHiddenChanged(boolean hidden){
  super.onHiddenChanged(hidden);
  if (!hidden) {
    if (mListener != null) {
      mListener.onAlarmsSetTitle("String_Node_Str");
      mListener.onAlarmsSetTaskerTitle("String_Node_Str");
    }
    if (mReloadOnShow) {
      mReloadOnShow=false;
      mAdapter=new AlarmsAdapter(getActivity(),UnbounceStatsCollection.getInstance().toAlarmArrayList(getActivity()));
      mAdapter.sort();
      setListAdapter(mAdapter);
    }
  }
}

Fixed version (ground truth):
@Override public void onHiddenChanged(boolean hidden){
  super.onHiddenChanged(hidden);
  if (!hidden) {
    if (mListener != null) {
      mListener.onAlarmsSetTitle(getResources().getString(R.string.title_alarms));
      mListener.onAlarmsSetTaskerTitle(getResources().getString(R.string.tasker_choose_alarm));
    }
    if (mReloadOnShow) {
      mReloadOnShow=false;
      mAdapter=new AlarmsAdapter(getActivity(),UnbounceStatsCollection.getInstance().toAlarmArrayList(getActivity()));
      mAdapter.sort();
      setListAdapter(mAdapter);
    }
  }
}
Program: 58305
Project: 58305
Buggy source:
/** 
 * Per the navigation drawer design guidelines, updates the action bar to show the global app 'context', rather than just what's in the current screen.
 */
private void showGlobalContextActionBar(){
  ActionBar actionBar=getActionBar();
  actionBar.setDisplayShowTitleEnabled(true);
  actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
  actionBar.setTitle("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Per the navigation drawer design guidelines, updates the action bar to show the global app 'context', rather than just what's in the current screen.
 */
private void showGlobalContextActionBar(){
  ActionBar actionBar=getActionBar();
  actionBar.setDisplayShowTitleEnabled(true);
  actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
  actionBar.setTitle(R.string.app_name);
}
Program: 58306
Project: 58306
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mDrawerListView=(ListView)inflater.inflate(R.layout.fragment_navigation_drawer,container,false);
  mDrawerListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      selectItem(position);
    }
  }
);
  mDrawerListView.setAdapter(new ArrayAdapter<String>(getActionBar().getThemedContext(),android.R.layout.simple_list_item_activated_1,android.R.id.text1,new String[]{getString(R.string.title_home),getString(R.string.title_wakelocks),getString(R.string.title_alarms),"String_Node_Str"}));
  mDrawerListView.setItemChecked(mCurrentSelectedPosition,true);
  return mDrawerListView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mDrawerListView=(ListView)inflater.inflate(R.layout.fragment_navigation_drawer,container,false);
  mDrawerListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      selectItem(position);
    }
  }
);
  mDrawerListView.setAdapter(new ArrayAdapter<String>(getActionBar().getThemedContext(),android.R.layout.simple_list_item_activated_1,android.R.id.text1,new String[]{getString(R.string.title_home),getString(R.string.title_wakelocks),getString(R.string.title_alarms),getString(R.string.title_settings)}));
  mDrawerListView.setItemChecked(mCurrentSelectedPosition,true);
  return mDrawerListView;
}
Program: 58307
Project: 58307
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getPreferenceManager().setSharedPreferencesMode(MODE_WORLD_READABLE);
  addPreferencesFromResource(R.xml.preferences);
  final SharedPreferences sharedPref=getPreferenceScreen().getSharedPreferences();
  sharedPref.registerOnSharedPreferenceChangeListener(this);
  onSharedPreferenceChanged(sharedPref,"String_Node_Str");
  onSharedPreferenceChanged(sharedPref,"String_Node_Str");
  Preference pref=(Preference)findPreference("String_Node_Str");
  pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      new AlertDialog.Builder(getActivity()).setTitle("String_Node_Str").setMessage("String_Node_Str").setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int which){
          SettingsHelper.resetToDefaults(sharedPref);
          Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
        }
      }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int which){
        }
      }
).setIcon(android.R.drawable.ic_dialog_alert).show();
      return true;
    }
  }
);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getPreferenceManager().setSharedPreferencesMode(MODE_WORLD_READABLE);
  addPreferencesFromResource(R.xml.preferences);
  final SharedPreferences sharedPref=getPreferenceScreen().getSharedPreferences();
  sharedPref.registerOnSharedPreferenceChangeListener(this);
  onSharedPreferenceChanged(sharedPref,"String_Node_Str");
  onSharedPreferenceChanged(sharedPref,"String_Node_Str");
  Preference pref=(Preference)findPreference("String_Node_Str");
  pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      new AlertDialog.Builder(getActivity()).setTitle(R.string.alert_reset_settings_title).setMessage(R.string.alert_reset_settings_content).setPositiveButton(R.string.dialog_reset,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int which){
          SettingsHelper.resetToDefaults(sharedPref);
          Toast.makeText(getActivity(),R.string.reset_settings_confirmation,Toast.LENGTH_SHORT).show();
        }
      }
).setNegativeButton(R.string.dialog_cancel,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialog,        int which){
        }
      }
).setIcon(android.R.drawable.ic_dialog_alert).show();
      return true;
    }
  }
);
}
Program: 58308
Project: 58308
Buggy source:
@Override public boolean onPreferenceClick(Preference preference){
  new AlertDialog.Builder(getActivity()).setTitle("String_Node_Str").setMessage("String_Node_Str").setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      SettingsHelper.resetToDefaults(sharedPref);
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
    }
  }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
    }
  }
).setIcon(android.R.drawable.ic_dialog_alert).show();
  return true;
}

Fixed version (ground truth):
@Override public boolean onPreferenceClick(Preference preference){
  new AlertDialog.Builder(getActivity()).setTitle(R.string.alert_reset_settings_title).setMessage(R.string.alert_reset_settings_content).setPositiveButton(R.string.dialog_reset,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      SettingsHelper.resetToDefaults(sharedPref);
      Toast.makeText(getActivity(),R.string.reset_settings_confirmation,Toast.LENGTH_SHORT).show();
    }
  }
).setNegativeButton(R.string.dialog_cancel,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
    }
  }
).setIcon(android.R.drawable.ic_dialog_alert).show();
  return true;
}
Program: 58309
Project: 58309
Buggy source:
private void warnUnknownWakelock(final Switch onOff){
  new AlertDialog.Builder(getActivity()).setTitle("String_Node_Str").setMessage("String_Node_Str").setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      onOff.setChecked(true);
      updateEnabledWakelock(true);
    }
  }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      onOff.setChecked(false);
      updateEnabledWakelock(false);
    }
  }
).setIcon(android.R.drawable.ic_dialog_alert).show();
}

Fixed version (ground truth):
private void warnUnknownWakelock(final Switch onOff){
  new AlertDialog.Builder(getActivity()).setTitle(R.string.alert_unknown_wakelock_title).setMessage(R.string.alert_unknown_wakelock_content).setPositiveButton(R.string.dialog_unbounce,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      onOff.setChecked(true);
      updateEnabledWakelock(true);
    }
  }
).setNegativeButton(R.string.dialog_cancel,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      onOff.setChecked(false);
      updateEnabledWakelock(false);
    }
  }
).setIcon(android.R.drawable.ic_dialog_alert).show();
}
Program: 58310
Project: 58310
Buggy source:
private void warnLicensing(final Switch onOff){
  new AlertDialog.Builder(getActivity()).setTitle("String_Node_Str").setMessage("String_Node_Str").setNeutralButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      onOff.setChecked(false);
      updateEnabledWakelock(false);
    }
  }
).setIcon(android.R.drawable.ic_dialog_info).show();
}

Fixed version (ground truth):
private void warnLicensing(final Switch onOff){
  new AlertDialog.Builder(getActivity()).setTitle(R.string.alert_nopro_title).setMessage(R.string.alert_nopro_content).setNeutralButton(R.string.dialog_ok,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      onOff.setChecked(false);
      updateEnabledWakelock(false);
    }
  }
).setIcon(android.R.drawable.ic_dialog_info).show();
}
Program: 58312
Project: 58312
Buggy source:
private void switchToDetail(int position){
  ListView list=(ListView)getActivity().findViewById(android.R.id.list);
  View listItem=list.getChildAt(position - list.getFirstVisiblePosition());
  final Rect startBounds=new Rect();
  listItem.getGlobalVisibleRect(startBounds);
  final Rect finalBounds=new Rect();
  final Point globalOffset=new Point();
  list.getGlobalVisibleRect(finalBounds,globalOffset);
  startBounds.offset(-globalOffset.x,-globalOffset.y);
  finalBounds.offset(-globalOffset.x,-globalOffset.y);
  FragmentManager fragmentManager=getFragmentManager();
  WakelockDetailFragment newFrag=WakelockDetailFragment.newInstance(startBounds.top,finalBounds.top,startBounds.bottom,finalBounds.bottom,(WakelockStats)mAdapter.getItem(position),mTaskerMode);
  newFrag.attachClearListener(this);
  fragmentManager.beginTransaction().setCustomAnimations(R.animator.expand_in,R.animator.noop,R.animator.noop,R.animator.expand_out).hide(this).add(R.id.container,newFrag,"String_Node_Str").addToBackStack(null).commit();
}

Fixed version (ground truth):
private void switchToDetail(int position){
  ListView list=(ListView)getActivity().findViewById(android.R.id.list);
  View listItem=list.getChildAt(position - list.getFirstVisiblePosition());
  if (listItem == null) {
    throw new IndexOutOfBoundsException("String_Node_Str" + position + "String_Node_Str"+ list.getFirstVisiblePosition());
  }
  final Rect startBounds=new Rect();
  listItem.getGlobalVisibleRect(startBounds);
  final Rect finalBounds=new Rect();
  final Point globalOffset=new Point();
  list.getGlobalVisibleRect(finalBounds,globalOffset);
  startBounds.offset(-globalOffset.x,-globalOffset.y);
  finalBounds.offset(-globalOffset.x,-globalOffset.y);
  FragmentManager fragmentManager=getFragmentManager();
  WakelockDetailFragment newFrag=WakelockDetailFragment.newInstance(startBounds.top,finalBounds.top,startBounds.bottom,finalBounds.bottom,(WakelockStats)mAdapter.getItem(position),mTaskerMode);
  newFrag.attachClearListener(this);
  fragmentManager.beginTransaction().setCustomAnimations(R.animator.expand_in,R.animator.noop,R.animator.noop,R.animator.expand_out).hide(this).add(R.id.container,newFrag,"String_Node_Str").addToBackStack(null).commit();
}
Program: 58313
Project: 58313
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  if (mListener != null)   mListener.onWakelocksSetTitle("String_Node_Str");
  mAdapter.sort(!mSortByTime);
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  if (mListener != null)   mListener.onWakelocksSetTitle(getResources().getString(R.string.title_wakelocks));
  mAdapter.sort(!mSortByTime);
}
Program: 58314
Project: 58314
Buggy source:
@Override public void onHiddenChanged(boolean hidden){
  super.onHiddenChanged(hidden);
  if (!hidden) {
    if (mListener != null) {
      mListener.onWakelocksSetTitle("String_Node_Str");
      mListener.onWakelocksSetTaskerTitle("String_Node_Str");
    }
    if (mReloadOnShow) {
      mReloadOnShow=false;
      mAdapter=new WakelocksAdapter(getActivity(),UnbounceStatsCollection.getInstance().toWakelockArrayList(getActivity()));
      mAdapter.sort(!mSortByTime);
      setListAdapter(mAdapter);
    }
  }
}

Fixed version (ground truth):
@Override public void onHiddenChanged(boolean hidden){
  super.onHiddenChanged(hidden);
  if (!hidden) {
    if (mListener != null) {
      mListener.onWakelocksSetTitle(getResources().getString(R.string.title_wakelocks));
      mListener.onWakelocksSetTaskerTitle(getResources().getString(R.string.tasker_choose_wakelock));
    }
    if (mReloadOnShow) {
      mReloadOnShow=false;
      mAdapter=new WakelocksAdapter(getActivity(),UnbounceStatsCollection.getInstance().toWakelockArrayList(getActivity()));
      mAdapter.sort(!mSortByTime);
      setListAdapter(mAdapter);
    }
  }
}
Program: 58317
Project: 58317
Buggy source:
public int compare(AlarmStats o1,AlarmStats o2){
  if (categorize) {
    int categoryCompare=((Boolean)o2.getBlockingEnabled()).compareTo(o1.getBlockingEnabled());
    if (categoryCompare == 0) {
      return ((Long)o2.getAllowedCount()).compareTo(o1.getAllowedCount());
    }
 else {
      return categoryCompare;
    }
  }
 else {
    return ((Long)o2.getAllowedCount()).compareTo(o1.getAllowedCount());
  }
}

Fixed version (ground truth):
public int compare(AlarmStats o1,AlarmStats o2){
  if (categorize) {
    int blockingCompare=((Boolean)o2.getBlockingEnabled()).compareTo(o1.getBlockingEnabled());
    if (blockingCompare != 0)     return blockingCompare;
    int safetyCompare=((Integer)EventLookup.isSafe(o2.getName())).compareTo(EventLookup.isSafe(o1.getName()));
    if (safetyCompare != 0)     return safetyCompare;
    return ((Long)o2.getAllowedCount()).compareTo(o1.getAllowedCount());
  }
 else {
    return ((Long)o2.getAllowedCount()).compareTo(o1.getAllowedCount());
  }
}
Program: 58318
Project: 58318
Buggy source:
public static Comparator<AlarmStats> getAlarmListComparator(final boolean categorize){
  return new Comparator<AlarmStats>(){
    public int compare(    AlarmStats o1,    AlarmStats o2){
      if (categorize) {
        int categoryCompare=((Boolean)o2.getBlockingEnabled()).compareTo(o1.getBlockingEnabled());
        if (categoryCompare == 0) {
          return ((Long)o2.getAllowedCount()).compareTo(o1.getAllowedCount());
        }
 else {
          return categoryCompare;
        }
      }
 else {
        return ((Long)o2.getAllowedCount()).compareTo(o1.getAllowedCount());
      }
    }
  }
;
}

Fixed version (ground truth):
public static Comparator<AlarmStats> getAlarmListComparator(final boolean categorize){
  return new Comparator<AlarmStats>(){
    public int compare(    AlarmStats o1,    AlarmStats o2){
      if (categorize) {
        int blockingCompare=((Boolean)o2.getBlockingEnabled()).compareTo(o1.getBlockingEnabled());
        if (blockingCompare != 0)         return blockingCompare;
        int safetyCompare=((Integer)EventLookup.isSafe(o2.getName())).compareTo(EventLookup.isSafe(o1.getName()));
        if (safetyCompare != 0)         return safetyCompare;
        return ((Long)o2.getAllowedCount()).compareTo(o1.getAllowedCount());
      }
 else {
        return ((Long)o2.getAllowedCount()).compareTo(o1.getAllowedCount());
      }
    }
  }
;
}
Program: 58319
Project: 58319
Buggy source:
@Override public void onHiddenChanged(boolean hidden){
  super.onHiddenChanged(hidden);
  if (!hidden) {
    if (mListener != null)     mListener.onAlarmsSetTitle("String_Node_Str");
    if (mReloadOnShow) {
      mReloadOnShow=false;
      mAdapter=new AlarmsAdapter(getActivity(),UnbounceStatsCollection.getInstance().toAlarmArrayList(getActivity()));
      mAdapter.sort(SortWakeLocks.getAlarmListComparator());
      mAdapter.notifyDataSetChanged();
      setListAdapter(mAdapter);
    }
  }
}

Fixed version (ground truth):
@Override public void onHiddenChanged(boolean hidden){
  super.onHiddenChanged(hidden);
  if (!hidden) {
    if (mListener != null)     mListener.onAlarmsSetTitle("String_Node_Str");
    if (mReloadOnShow) {
      mReloadOnShow=false;
      mAdapter=new AlarmsAdapter(getActivity(),UnbounceStatsCollection.getInstance().toAlarmArrayList(getActivity()));
      mAdapter.sort();
      setListAdapter(mAdapter);
    }
  }
}
Program: 58320
Project: 58320
Buggy source:
public String getDurationAllowedFormatted(){
  long days=TimeUnit.MILLISECONDS.toDays(mAllowedDuration);
  mAllowedDuration-=TimeUnit.DAYS.toMillis(days);
  long hours=TimeUnit.MILLISECONDS.toHours(mAllowedDuration);
  mAllowedDuration-=TimeUnit.HOURS.toMillis(hours);
  long minutes=TimeUnit.MILLISECONDS.toMinutes(mAllowedDuration);
  mAllowedDuration-=TimeUnit.MINUTES.toMillis(minutes);
  long seconds=TimeUnit.MILLISECONDS.toSeconds(mAllowedDuration);
  StringBuilder sb=new StringBuilder(64);
  sb.append(days);
  sb.append("String_Node_Str");
  sb.append(hours);
  sb.append("String_Node_Str");
  sb.append(minutes);
  sb.append("String_Node_Str");
  sb.append(seconds);
  sb.append("String_Node_Str");
  return (sb.toString());
}

Fixed version (ground truth):
public String getDurationAllowedFormatted(){
  long allowedTime=mAllowedDuration;
  long days=TimeUnit.MILLISECONDS.toDays(allowedTime);
  allowedTime-=TimeUnit.DAYS.toMillis(days);
  long hours=TimeUnit.MILLISECONDS.toHours(allowedTime);
  allowedTime-=TimeUnit.HOURS.toMillis(hours);
  long minutes=TimeUnit.MILLISECONDS.toMinutes(allowedTime);
  allowedTime-=TimeUnit.MINUTES.toMillis(minutes);
  long seconds=TimeUnit.MILLISECONDS.toSeconds(allowedTime);
  StringBuilder sb=new StringBuilder(64);
  sb.append(days);
  sb.append("String_Node_Str");
  sb.append(hours);
  sb.append("String_Node_Str");
  sb.append(minutes);
  sb.append("String_Node_Str");
  sb.append(seconds);
  sb.append("String_Node_Str");
  return (sb.toString());
}
Program: 58322
Project: 58322
Buggy source:
@Override public boolean onPreferenceClick(Preference preference){
  mHelper.launchPurchaseFlow(SettingsActivity.this,"String_Node_Str",10,SettingsActivity.this.mPurchaseFinishedListener,"String_Node_Str");
  return true;
}

Fixed version (ground truth):
@Override public boolean onPreferenceClick(Preference preference){
  ((SettingsActivity)getActivity()).mHelper.launchPurchaseFlow(getActivity(),"String_Node_Str",10,((SettingsActivity)getActivity()).mPurchaseFinishedListener,"String_Node_Str");
  return true;
}
Program: 58323
Project: 58323
Buggy source:
private void try19To20WakeLockHook(final LoadPackageParam lpparam,final XSharedPreferences prefs){
  findAndHookMethod("String_Node_Str",lpparam.classLoader,"String_Node_Str",android.os.IBinder.class,int.class,String.class,String.class,android.os.WorkSource.class,int.class,int.class,new XC_MethodHook(){
    @Override protected void beforeHookedMethod(    MethodHookParam param) throws Throwable {
      String wakeLockName=(String)param.args[2];
      handleWakeLock(param,prefs,wakeLockName);
    }
  }
);
}

Fixed version (ground truth):
private void try19To20WakeLockHook(LoadPackageParam lpparam,final XSharedPreferences prefs){
  findAndHookMethod("String_Node_Str",lpparam.classLoader,"String_Node_Str",android.os.IBinder.class,int.class,String.class,String.class,android.os.WorkSource.class,int.class,int.class,new XC_MethodHook(){
    @Override protected void beforeHookedMethod(    MethodHookParam param) throws Throwable {
      String wakeLockName=(String)param.args[2];
      handleWakeLock(param,prefs,wakeLockName);
    }
  }
);
}
Program: 58325
Project: 58325
Buggy source:
@Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
  XSharedPreferences prefs=new XSharedPreferences(nlpFix.class.getPackage().getName());
  prefs.reload();
  String wakeLockName=(String)param.args[2];
  if (wakeLockName.equals("String_Node_Str")) {
    int collectorMaxFreq=tryParseInt(prefs.getString("String_Node_Str","String_Node_Str"));
    collectorMaxFreq*=1000;
    if (collectorMaxFreq != 0) {
      final long now=SystemClock.elapsedRealtime();
      long timeSinceLastWakelock=now - mLastNlpCollectorWakelock;
      if (timeSinceLastWakelock < collectorMaxFreq) {
        XposedBridge.log("String_Node_Str" + timeSinceLastWakelock + "String_Node_Str"+ collectorMaxFreq);
        param.setResult(null);
      }
 else {
        XposedBridge.log("String_Node_Str");
        mLastNlpCollectorWakelock=now;
      }
    }
  }
 else   if (wakeLockName.equals("String_Node_Str")) {
    int nlpMaxFreq=tryParseInt(prefs.getString("String_Node_Str","String_Node_Str"));
    nlpMaxFreq*=1000;
    if (nlpMaxFreq != 0) {
      final long now=SystemClock.elapsedRealtime();
      long timeSinceLastWakelock=now - mLastNlpWakelock;
      if (timeSinceLastWakelock < nlpMaxFreq) {
        XposedBridge.log("String_Node_Str" + timeSinceLastWakelock + "String_Node_Str"+ nlpMaxFreq);
        param.setResult(null);
      }
 else {
        XposedBridge.log("String_Node_Str");
        mLastNlpWakelock=now;
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
  XSharedPreferences prefs=new XSharedPreferences(nlpFix.class.getPackage().getName());
  prefs.reload();
  String wakeLockName=(String)param.args[2];
  String dt=DateFormat.getDateTimeInstance().format(new Date(System.currentTimeMillis()));
  if (wakeLockName.equals("String_Node_Str")) {
    int collectorMaxFreq=tryParseInt(prefs.getString("String_Node_Str","String_Node_Str"));
    collectorMaxFreq*=1000;
    if (collectorMaxFreq != 0) {
      final long now=SystemClock.elapsedRealtime();
      long timeSinceLastWakelock=now - mLastNlpCollectorWakelock;
      if (timeSinceLastWakelock < collectorMaxFreq) {
        param.setResult(null);
      }
 else {
        XposedBridge.log(dt + "String_Node_Str" + collectorMaxFreq);
        mLastNlpCollectorWakelock=now;
      }
    }
  }
 else   if (wakeLockName.equals("String_Node_Str")) {
    int nlpMaxFreq=tryParseInt(prefs.getString("String_Node_Str","String_Node_Str"));
    nlpMaxFreq*=1000;
    if (nlpMaxFreq != 0) {
      final long now=SystemClock.elapsedRealtime();
      long timeSinceLastWakelock=now - mLastNlpWakelock;
      if (timeSinceLastWakelock < nlpMaxFreq) {
        param.setResult(null);
      }
 else {
        XposedBridge.log(dt + "String_Node_Str" + nlpMaxFreq);
        mLastNlpWakelock=now;
      }
    }
  }
}
Program: 58327
Project: 58327
Buggy source:
/** 
 * Gets the distance to jump based on the current cursor position. <p> Returns null if the cursor is inside the window and no auto-scrolling should occur. </p>
 * @param cursorX the cursor-x position in this {@link PanningWindow}
 * @param cursorY the cursor-y position in this {@link PanningWindow}
 * @return the distance to jump, or null if no jump should occur
 */
private Point2D getDistanceToJump(final double cursorX,final double cursorY){
  double jumpX=0;
  double jumpY=0;
  final double baseAmount=parameters.getBaseJumpAmount();
  final double additionalAmount=jumpsTaken + parameters.getJumpAmountIncreasePerJump();
  final double distance=Math.min(baseAmount + additionalAmount,parameters.getMaxJumpAmount());
  if (cursorX <= parameters.getInsetToBeginScroll()) {
    jumpX=-distance;
  }
 else   if (cursorX >= getWidth() - parameters.getInsetToBeginScroll()) {
    jumpX=distance;
  }
  if (cursorY <= parameters.getInsetToBeginScroll()) {
    jumpY=-distance;
  }
 else   if (cursorY >= getHeight() - parameters.getInsetToBeginScroll()) {
    jumpY=distance;
  }
  if (jumpX == 0 && jumpY == 0) {
    return null;
  }
 else {
    return new Point2D(Math.round(jumpX),Math.round(jumpY));
  }
}

Fixed version (ground truth):
/** 
 * Gets the distance to jump based on the current cursor position. <p> Returns null if the cursor is inside the window and no auto-scrolling should occur. </p>
 * @param cursorX the cursor-x position in this {@link PanningWindow}
 * @param cursorY the cursor-y position in this {@link PanningWindow}
 * @return the distance to jump, or null if no jump should occur
 */
private Point2D getDistanceToJump(final double cursorX,final double cursorY){
  double jumpX=0;
  double jumpY=0;
  final double baseAmount=parameters.getBaseJumpAmount();
  final double additionalAmount=jumpsTaken * parameters.getJumpAmountIncreasePerJump();
  final double distance=Math.min(baseAmount + additionalAmount,parameters.getMaxJumpAmount());
  if (cursorX <= parameters.getInsetToBeginScroll()) {
    jumpX=-distance;
  }
 else   if (cursorX >= getWidth() - parameters.getInsetToBeginScroll()) {
    jumpX=distance;
  }
  if (cursorY <= parameters.getInsetToBeginScroll()) {
    jumpY=-distance;
  }
 else   if (cursorY >= getHeight() - parameters.getInsetToBeginScroll()) {
    jumpY=distance;
  }
  if (jumpX == 0 && jumpY == 0) {
    return null;
  }
 else {
    return new Point2D(Math.round(jumpX),Math.round(jumpY));
  }
}
Program: 58328
Project: 58328
Buggy source:
/** 
 * Starts the auto-scrolling.
 */
private void startScrolling(){
  isScrolling=true;
  jumpsTaken=0;
  final KeyFrame frame=new KeyFrame(Duration.millis(parameters.getJumpPeriod()),event -> {
    if (dragEventTarget != null && isScrolling && jumpDistance != null) {
      panBy(jumpDistance.getX(),jumpDistance.getY());
      dragEventTarget.fireEvent(currentDragEvent);
      jumpsTaken++;
    }
  }
);
  timeline=new Timeline();
  timeline.setCycleCount(Timeline.INDEFINITE);
  timeline.getKeyFrames().add(frame);
  timeline.play();
}

Fixed version (ground truth):
/** 
 * Starts the auto-scrolling.
 */
private void startScrolling(){
  isScrolling=true;
  jumpsTaken=0;
  final KeyFrame frame=new KeyFrame(Duration.millis(parameters.getJumpPeriod()),event -> {
    if (dragEventTarget != null && isScrolling && jumpDistance != null) {
      panBy(jumpDistance.getX(),jumpDistance.getY());
      dragEventTarget.fireEvent(currentDragEvent);
      jumpsTaken++;
    }
  }
);
  timeline=new Timeline();
  timeline.setCycleCount(Animation.INDEFINITE);
  timeline.getKeyFrames().add(frame);
  timeline.play();
}
Program: 58330
Project: 58330
Buggy source:
/** 
 * Creates a new default node skin instance.
 * @param node the {@link GNode} the skin is being created for
 */
public DefaultNodeSkin(final GNode node){
  super(node);
  performChecks();
  background.widthProperty().bind(border.widthProperty().subtract(border.strokeWidthProperty().multiply(2)));
  background.heightProperty().bind(border.heightProperty().subtract(border.strokeWidthProperty().multiply(2)));
  border.widthProperty().bind(getRoot().widthProperty());
  border.heightProperty().bind(getRoot().heightProperty());
  border.getStyleClass().setAll(STYLE_CLASS_BORDER);
  background.getStyleClass().setAll(STYLE_CLASS_BACKGROUND);
  getRoot().getChildren().addAll(border,background);
  getRoot().setMinSize(MIN_WIDTH,MIN_HEIGHT);
  addSelectionHalo();
  addSelectionListener();
}

Fixed version (ground truth):
/** 
 * Creates a new default node skin instance.
 * @param node the {@link GNode} the skin is being created for
 */
public DefaultNodeSkin(final GNode node){
  super(node);
  performChecks();
  background.widthProperty().bind(border.widthProperty().subtract(border.strokeWidthProperty().multiply(2)));
  background.heightProperty().bind(border.heightProperty().subtract(border.strokeWidthProperty().multiply(2)));
  border.widthProperty().bind(getRoot().widthProperty());
  border.heightProperty().bind(getRoot().heightProperty());
  border.getStyleClass().setAll(STYLE_CLASS_BORDER);
  background.getStyleClass().setAll(STYLE_CLASS_BACKGROUND);
  getRoot().getChildren().addAll(border,background);
  getRoot().setMinSize(MIN_WIDTH,MIN_HEIGHT);
  background.addEventFilter(MouseEvent.MOUSE_DRAGGED,this::filterMouseDragged);
  addSelectionHalo();
  addSelectionListener();
}
Program: 58331
Project: 58331
Buggy source:
/** 
 * Creates the content of the node skin - header, title, close button, etc.
 */
private void createContent(){
  final HBox header=new HBox();
  header.getStyleClass().setAll(STYLE_CLASS_HEADER);
  header.setAlignment(Pos.CENTER);
  title.getStyleClass().setAll(STYLE_CLASS_TITLE);
  final Region filler=new Region();
  HBox.setHgrow(filler,Priority.ALWAYS);
  final Button closeButton=new Button();
  closeButton.getStyleClass().setAll(STYLE_CLASS_BUTTON);
  header.getChildren().addAll(title,filler,closeButton);
  contentRoot.getChildren().add(header);
  getRoot().getChildren().add(contentRoot);
  closeButton.setGraphic(AwesomeIcon.TIMES.node());
  closeButton.setCursor(Cursor.DEFAULT);
  closeButton.setOnAction(event -> Commands.removeNode(getGraphEditor().getModel(),getNode()));
  contentRoot.minWidthProperty().bind(getRoot().widthProperty());
  contentRoot.prefWidthProperty().bind(getRoot().widthProperty());
  contentRoot.maxWidthProperty().bind(getRoot().widthProperty());
  contentRoot.minHeightProperty().bind(getRoot().heightProperty());
  contentRoot.prefHeightProperty().bind(getRoot().heightProperty());
  contentRoot.maxHeightProperty().bind(getRoot().heightProperty());
  contentRoot.setLayoutX(BORDER_WIDTH);
  contentRoot.setLayoutY(BORDER_WIDTH);
  contentRoot.getStyleClass().setAll(STYLE_CLASS_BACKGROUND);
}

Fixed version (ground truth):
/** 
 * Creates the content of the node skin - header, title, close button, etc.
 */
private void createContent(){
  header.getStyleClass().setAll(STYLE_CLASS_HEADER);
  header.setAlignment(Pos.CENTER);
  title.getStyleClass().setAll(STYLE_CLASS_TITLE);
  final Region filler=new Region();
  HBox.setHgrow(filler,Priority.ALWAYS);
  final Button closeButton=new Button();
  closeButton.getStyleClass().setAll(STYLE_CLASS_BUTTON);
  header.getChildren().addAll(title,filler,closeButton);
  contentRoot.getChildren().add(header);
  getRoot().getChildren().add(contentRoot);
  closeButton.setGraphic(AwesomeIcon.TIMES.node());
  closeButton.setCursor(Cursor.DEFAULT);
  closeButton.setOnAction(event -> Commands.removeNode(getGraphEditor().getModel(),getNode()));
  contentRoot.minWidthProperty().bind(getRoot().widthProperty());
  contentRoot.prefWidthProperty().bind(getRoot().widthProperty());
  contentRoot.maxWidthProperty().bind(getRoot().widthProperty());
  contentRoot.minHeightProperty().bind(getRoot().heightProperty());
  contentRoot.prefHeightProperty().bind(getRoot().heightProperty());
  contentRoot.maxHeightProperty().bind(getRoot().heightProperty());
  contentRoot.setLayoutX(BORDER_WIDTH);
  contentRoot.setLayoutY(BORDER_WIDTH);
  contentRoot.getStyleClass().setAll(STYLE_CLASS_BACKGROUND);
}
Program: 58332
Project: 58332
Buggy source:
/** 
 * Creates a new   {@link TitledNodeSkin} instance.
 * @param node the {link GNode} this skin is representing
 */
public TitledNodeSkin(final GNode node){
  super(node);
  border.getStyleClass().setAll(STYLE_CLASS_BORDER);
  border.widthProperty().bind(getRoot().widthProperty());
  border.heightProperty().bind(getRoot().heightProperty());
  getRoot().getChildren().add(border);
  getRoot().setMinSize(MIN_WIDTH,MIN_HEIGHT);
  addSelectionHalo();
  addSelectionListener();
  createContent();
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link TitledNodeSkin} instance.
 * @param node the {link GNode} this skin is representing
 */
public TitledNodeSkin(final GNode node){
  super(node);
  border.getStyleClass().setAll(STYLE_CLASS_BORDER);
  border.widthProperty().bind(getRoot().widthProperty());
  border.heightProperty().bind(getRoot().heightProperty());
  getRoot().getChildren().add(border);
  getRoot().setMinSize(MIN_WIDTH,MIN_HEIGHT);
  addSelectionHalo();
  addSelectionListener();
  createContent();
  contentRoot.addEventFilter(MouseEvent.MOUSE_DRAGGED,this::filterMouseDragged);
}
Program: 58333
Project: 58333
Buggy source:
/** 
 * Creates a new   {@link TreeNodeSkin} instance.
 * @param node the {link GNode} this skin is representing
 */
public TreeNodeSkin(final GNode node){
  super(node);
  background.widthProperty().bind(border.widthProperty().subtract(border.strokeWidthProperty().multiply(2)));
  background.heightProperty().bind(border.heightProperty().subtract(border.strokeWidthProperty().multiply(2)));
  border.widthProperty().bind(getRoot().widthProperty());
  border.heightProperty().bind(getRoot().heightProperty());
  border.getStyleClass().setAll(STYLE_CLASS_BORDER);
  background.getStyleClass().setAll(STYLE_CLASS_BACKGROUND);
  getRoot().getChildren().addAll(border,background);
  getRoot().setMinSize(MIN_WIDTH,MIN_HEIGHT);
  addSelectionHalo();
  addSelectionListener();
  addButton();
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link TreeNodeSkin} instance.
 * @param node the {link GNode} this skin is representing
 */
public TreeNodeSkin(final GNode node){
  super(node);
  background.widthProperty().bind(border.widthProperty().subtract(border.strokeWidthProperty().multiply(2)));
  background.heightProperty().bind(border.heightProperty().subtract(border.strokeWidthProperty().multiply(2)));
  border.widthProperty().bind(getRoot().widthProperty());
  border.heightProperty().bind(getRoot().heightProperty());
  border.getStyleClass().setAll(STYLE_CLASS_BORDER);
  background.getStyleClass().setAll(STYLE_CLASS_BACKGROUND);
  getRoot().getChildren().addAll(border,background);
  getRoot().setMinSize(MIN_WIDTH,MIN_HEIGHT);
  addSelectionHalo();
  addSelectionListener();
  addButton();
  background.addEventFilter(MouseEvent.MOUSE_DRAGGED,this::filterMouseDragged);
}