nus-yam/ex-repair huggingface dataset:
Program: 189607
Project: 189607
Buggy source:
private void initializeLaunchIntentSpinner(){
  if (applicationAdapter != null) {
    getLaunchIntentSpinner().setAdapter(applicationAdapter);
    setSelectedLaunchIntent();
  }
}

Fixed version (ground truth):
private void initializeLaunchIntentSpinner(){
  if (applicationAdapter != null) {
    getLaunchIntentSpinner().setAdapter(applicationAdapter);
    setSelectedLaunchIntent();
    getView().findViewById(R.id.launch_intent).setVisibility(View.VISIBLE);
    getView().findViewById(R.id.launch_intent_progress_bar).setVisibility(View.GONE);
  }
}
Program: 189610
Project: 189610
Buggy source:
@Override protected void onPostExecute(KnockResult result){
  FragmentManager fragmentManager=activity.getSupportFragmentManager();
  Fragment dialog=fragmentManager.findFragmentByTag(ProgressDialogFragment.TAG);
  if (dialog != null)   ((ProgressDialogFragment)dialog).dismiss();
  if (result.isSuccess()) {
    if (StringUtils.isNotBlank(result.getLaunchIntentPackage())) {
      Intent launchIntent=activity.getPackageManager().getLaunchIntentForPackage(result.getLaunchIntentPackage());
      activity.startActivity(launchIntent);
    }
 else {
      showToast(activity.getString(R.string.toast_msg_knocking_complete));
    }
  }
 else {
    showToast(activity.getString(R.string.toast_msg_knocking_failed) + result.getError());
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(KnockResult result){
  FragmentManager fragmentManager=activity.getSupportFragmentManager();
  Fragment dialog=fragmentManager.findFragmentByTag(ProgressDialogFragment.TAG);
  if (dialog != null)   ((ProgressDialogFragment)dialog).dismiss();
  if (result.isSuccess()) {
    if (StringUtils.isNotBlank(result.getLaunchIntentPackage())) {
      Intent launchIntent=activity.getPackageManager().getLaunchIntentForPackage(result.getLaunchIntentPackage());
      if (launchIntent == null) {
        showToast("String_Node_Str" + result.getLaunchIntentPackage());
      }
 else {
        activity.startActivity(launchIntent);
      }
    }
 else {
      showToast(activity.getString(R.string.toast_msg_knocking_complete));
    }
  }
 else {
    showToast(activity.getString(R.string.toast_msg_knocking_failed) + result.getError());
  }
}
Program: 189611
Project: 189611
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  hostDataManager=new HostDataManager(getActivity());
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setRetainInstance(true);
  hostDataManager=new HostDataManager(getActivity());
}
Program: 189612
Project: 189612
Buggy source:
public RetrieveInstalledApplicationsTask(Context context,String selectedLaunchIntent){
  this.context=context;
  this.dialog=new ProgressDialog(context);
  this.selectedLaunchIntent=selectedLaunchIntent;
}

Fixed version (ground truth):
public RetrieveInstalledApplicationsTask(String selectedLaunchIntent){
  this.selectedLaunchIntent=selectedLaunchIntent;
}
Program: 189613
Project: 189613
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  EditText delayEditText=getDelayEditText();
  Bundle args=getArguments();
  String selectedLaunchIntent=null;
  if (savedInstanceState != null) {
    delayEditText.setText(savedInstanceState.getString(DELAY_BUNDLE_KEY));
    selectedLaunchIntent=savedInstanceState.getString(LAUNCH_INTENT_BUNDLE_KEY);
  }
 else   if (args != null) {
    Long hostId=args.getLong(EditHostActivity.HOST_ID_BUNDLE_KEY);
    Host host=hostDataManager.getHost(hostId);
    delayEditText.setText(new Integer(host.getDelay()).toString());
    selectedLaunchIntent=host.getLaunchIntentPackage();
  }
  RetrieveInstalledApplicationsTask retrieveAppsTask=new RetrieveInstalledApplicationsTask(getActivity(),selectedLaunchIntent);
  retrieveAppsTask.execute();
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  EditText delayEditText=getDelayEditText();
  Bundle args=getArguments();
  String selectedLaunchIntent=null;
  if (savedInstanceState != null) {
    delayEditText.setText(savedInstanceState.getString(DELAY_BUNDLE_KEY));
    selectedLaunchIntent=savedInstanceState.getString(LAUNCH_INTENT_BUNDLE_KEY);
  }
 else   if (args != null) {
    Long hostId=args.getLong(EditHostActivity.HOST_ID_BUNDLE_KEY);
    Host host=hostDataManager.getHost(hostId);
    delayEditText.setText(new Integer(host.getDelay()).toString());
    selectedLaunchIntent=host.getLaunchIntentPackage();
  }
  FragmentTransaction ft=getFragmentManager().beginTransaction();
  Fragment prev=getFragmentManager().findFragmentByTag("String_Node_Str");
  if (prev != null)   ft.remove(prev);
  ft.addToBackStack(null);
  dialogFragment=ProgressDialogFragment.newInstance(getString(R.string.progress_dialog_retrieving_applications));
  dialogFragment.show(ft,"String_Node_Str");
  RetrieveInstalledApplicationsTask retrieveAppsTask=new RetrieveInstalledApplicationsTask(selectedLaunchIntent);
  retrieveAppsTask.execute();
}
Program: 189614
Project: 189614
Buggy source:
@Override protected void onPreExecute(){
  dialog.setMessage(context.getResources().getString(R.string.progress_dialog_retrieving_applications));
  dialog.setCancelable(false);
  dialog.show();
}

Fixed version (ground truth):
@Override protected void onPreExecute(){
}
Program: 189615
Project: 189615
Buggy source:
@Override public void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putString(DELAY_BUNDLE_KEY,getDelayEditText().getText().toString());
  outState.putString(LAUNCH_INTENT_BUNDLE_KEY,((Application)getLaunchIntentSpinner().getSelectedItem()).getIntent());
}

Fixed version (ground truth):
@Override public void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putString(DELAY_BUNDLE_KEY,getDelayEditText().getText().toString());
  if (getLaunchIntentSpinner().getSelectedItem() != null)   outState.putString(LAUNCH_INTENT_BUNDLE_KEY,((Application)getLaunchIntentSpinner().getSelectedItem()).getIntent());
}
Program: 189616
Project: 189616
Buggy source:
@Override protected void onPostExecute(List<Application> applications){
  ArrayAdapter<Application> adapter=new ApplicationArrayAdapter(getActivity(),applications);
  Spinner launchAppSpinner=getLaunchIntentSpinner();
  launchAppSpinner.setAdapter(adapter);
  if (selectedLaunchIntent != null) {
    for (int i=0; i < adapter.getCount(); i++) {
      Application application=adapter.getItem(i);
      if (application.getIntent().equals(selectedLaunchIntent)) {
        launchAppSpinner.setSelection(i);
        break;
      }
    }
  }
  if (dialog.isShowing())   dialog.dismiss();
}

Fixed version (ground truth):
@Override protected void onPostExecute(List<Application> applications){
  ApplicationArrayAdapter adapter=new ApplicationArrayAdapter(getActivity(),applications);
  Spinner launchAppSpinner=getLaunchIntentSpinner();
  launchAppSpinner.setAdapter(adapter);
  if (selectedLaunchIntent != null) {
    for (int i=0; i < adapter.getCount(); i++) {
      Application application=adapter.getItem(i);
      if (application.getIntent().equals(selectedLaunchIntent)) {
        launchAppSpinner.setSelection(i);
        break;
      }
    }
  }
  if (dialogFragment.isAdded())   dialogFragment.dismiss();
}
Program: 189617
Project: 189617
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.edit_host);
  resources=getResources();
  hostDataManager=new HostDataManager(getApplicationContext());
  hostFragment=new HostFragment();
  portsFragment=new PortsFragment();
  miscFragment=new MiscFragment();
  getSupportActionBar().setHomeButtonEnabled(true);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
  ActionBar.Tab hostTab=getSupportActionBar().newTab();
  hostTab.setText(resources.getString(R.string.host_tab_name));
  hostTab.setTabListener(this);
  ActionBar.Tab portsTab=getSupportActionBar().newTab();
  portsTab.setText(resources.getString(R.string.ports_tab_name));
  portsTab.setTabListener(this);
  ActionBar.Tab miscTab=getSupportActionBar().newTab();
  miscTab.setText(resources.getString(R.string.misc_tab_name));
  miscTab.setTabListener(this);
  getSupportActionBar().addTab(hostTab);
  getSupportActionBar().addTab(portsTab);
  getSupportActionBar().addTab(miscTab);
  if (savedInstanceState != null) {
    getSupportActionBar().setSelectedNavigationItem(savedInstanceState.getInt("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.edit_host);
  hostDataManager=new HostDataManager(getApplicationContext());
  getSupportActionBar().setHomeButtonEnabled(true);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
  addTab(getString(R.string.host_tab_name));
  addTab(getString(R.string.ports_tab_name));
  addTab(getString(R.string.misc_tab_name));
  if (savedInstanceState != null) {
    getSupportActionBar().setSelectedNavigationItem(savedInstanceState.getInt("String_Node_Str"));
  }
}
Program: 189618
Project: 189618
Buggy source:
private void saveHost(){
  String hostLabel=hostFragment.getHostLabelEditTextView().getText().toString();
  String hostname=hostFragment.getHostnameEditTextView().getText().toString();
  LinearLayout portListView=portsFragment.getPortListLinearLayoutView();
  if (portListView != null) {
    for (int i=0; i < portListView.getChildCount(); i++) {
      View row=portListView.getChildAt(i);
      EditText portEditText=(EditText)row.findViewById(R.id.port_row_port);
      Spinner protocolSpinner=(Spinner)row.findViewById(R.id.port_row_protocol);
      System.out.println(portEditText.getText().toString());
      System.out.println(protocolSpinner.getSelectedItem().toString());
    }
  }
  EditText delayEditTextView=miscFragment.getDelayEdit();
  int delay=0;
  if (delayEditTextView != null) {
    String delayStr=delayEditTextView.getText().toString();
    delay=(delayStr != null && delayStr.length() > 0) ? Integer.parseInt(delayStr) : 0;
  }
  Host host=new Host();
  host.setLabel(hostLabel);
  host.setHostname(hostname);
  host.setDelay(delay);
}

Fixed version (ground truth):
private void saveHost(){
  HostFragment hostFragment=(HostFragment)getSupportFragmentManager().findFragmentByTag(getString(R.string.host_tab_name));
  PortsFragment portsFragment=(PortsFragment)getSupportFragmentManager().findFragmentByTag(getString(R.string.ports_tab_name));
  MiscFragment miscFragment=(MiscFragment)getSupportFragmentManager().findFragmentByTag(getString(R.string.misc_tab_name));
  String hostLabel=hostFragment.getHostLabelEditTextView().getText().toString();
  String hostname=hostFragment.getHostnameEditTextView().getText().toString();
  if (portsFragment != null) {
    LinearLayout portListView=portsFragment.getPortListLinearLayoutView();
    for (int i=0; i < portListView.getChildCount(); i++) {
      View row=portListView.getChildAt(i);
      EditText portEditText=(EditText)row.findViewById(R.id.port_row_port);
      Spinner protocolSpinner=(Spinner)row.findViewById(R.id.port_row_protocol);
      System.out.println(portEditText.getText().toString());
      System.out.println(protocolSpinner.getSelectedItem().toString());
    }
  }
  int delay=0;
  if (miscFragment != null) {
    EditText delayEditTextView=miscFragment.getDelayEdit();
    String delayStr=delayEditTextView.getText().toString();
    delay=(delayStr != null && delayStr.length() > 0) ? Integer.parseInt(delayStr) : 0;
  }
  Host host=new Host();
  host.setLabel(hostLabel);
  host.setHostname(hostname);
  host.setDelay(delay);
}
Program: 189619
Project: 189619
Buggy source:
@Override public void onTabSelected(Tab tab,FragmentTransaction ft){
switch (tab.getPosition()) {
case TAB_HOST_INDEX:
    ft.replace(R.id.fragment_content,hostFragment,resources.getString(R.string.host_tab_name));
  break;
case TAB_PORTS_INDEX:
ft.replace(R.id.fragment_content,portsFragment,resources.getString(R.string.ports_tab_name));
break;
case TAB_MISC_INDEX:
ft.replace(R.id.fragment_content,miscFragment,resources.getString(R.string.misc_tab_name));
break;
default :
break;
}
}

Fixed version (ground truth):
@Override public void onTabSelected(Tab tab,FragmentTransaction ft){
  Fragment hostFragment=getSupportFragmentManager().findFragmentByTag(getString(R.string.host_tab_name));
  Fragment portsFragment=getSupportFragmentManager().findFragmentByTag(getString(R.string.ports_tab_name));
  Fragment miscFragment=getSupportFragmentManager().findFragmentByTag(getString(R.string.misc_tab_name));
switch (tab.getPosition()) {
case TAB_HOST_INDEX:
    if (hostFragment == null) {
      hostFragment=new HostFragment();
      ft.add(R.id.fragment_content,hostFragment,getString(R.string.host_tab_name));
    }
  ft.show(hostFragment);
if (portsFragment != null) ft.hide(portsFragment);
if (miscFragment != null) ft.hide(miscFragment);
break;
case TAB_PORTS_INDEX:
if (portsFragment == null) {
portsFragment=new PortsFragment();
ft.add(R.id.fragment_content,portsFragment,getString(R.string.ports_tab_name));
}
ft.show(portsFragment);
if (hostFragment != null) ft.hide(hostFragment);
if (miscFragment != null) ft.hide(miscFragment);
break;
case TAB_MISC_INDEX:
if (miscFragment == null) {
miscFragment=new MiscFragment();
ft.add(R.id.fragment_content,miscFragment,getString(R.string.misc_tab_name));
}
ft.show(miscFragment);
if (hostFragment != null) ft.hide(hostFragment);
if (portsFragment != null) ft.hide(portsFragment);
break;
}
}
Program: 189620
Project: 189620
Buggy source:
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putInt("String_Node_Str",getSupportActionBar().getSelectedNavigationIndex());
  outState.putIntArray("String_Node_Str",new int[]{});
  outState.putIntArray("String_Node_Str",new int[]{});
  outState.putString("String_Node_Str",null);
  outState.putString("String_Node_Str",null);
}

Fixed version (ground truth):
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putInt("String_Node_Str",getSupportActionBar().getSelectedNavigationIndex());
}
Program: 189621
Project: 189621
Buggy source:
@Override public void suggestionSelected(TransportSuggestion s){
  connector.setOnRoundtrip(true);
  serverRpc.suggestionSelected(s.index);
  stopAskingForSuggestions();
}

Fixed version (ground truth):
@Override public void suggestionSelected(TransportSuggestion s){
  serverRpc.suggestionSelected(s.index);
  stopAskingForSuggestions();
}
Program: 189622
Project: 189622
Buggy source:
/** 
 * Print local variables on a suspended thread. Takes the topmost stack frame and lists all local variables and their values.
 * @param t suspended thread
 */
protected void printLocalVariables(ThreadReference t){
  if (!t.isSuspended()) {
    return;
  }
  try {
    if (t.frameCount() == 0) {
      System.out.println("String_Node_Str");
    }
 else {
      StackFrame sf=t.frame(0);
      List<LocalVariable> locals=sf.visibleVariables();
      if (locals.size() == 0) {
        System.out.println("String_Node_Str");
        return;
      }
      for (      LocalVariable lv : locals) {
        System.out.println(lv.typeName() + "String_Node_Str" + lv.name()+ "String_Node_Str"+ sf.getValue(lv));
      }
    }
  }
 catch (  IncompatibleThreadStateException ex) {
    Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE,null,ex);
  }
catch (  AbsentInformationException ex) {
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Print local variables on a suspended thread. Takes the topmost stack frame and lists all local variables and their values.
 * @param t suspended thread
 */
protected void printLocalVariables(ThreadReference t){
  if (!t.isSuspended()) {
    return;
  }
  try {
    if (t.frameCount() == 0) {
      System.out.println("String_Node_Str");
    }
 else {
      StackFrame sf=t.frame(0);
      List<LocalVariable> locals=sf.visibleVariables();
      if (locals.isEmpty()) {
        System.out.println("String_Node_Str");
        return;
      }
      for (      LocalVariable lv : locals) {
        System.out.println(lv.typeName() + "String_Node_Str" + lv.name()+ "String_Node_Str"+ sf.getValue(lv));
      }
    }
  }
 catch (  IncompatibleThreadStateException ex) {
    Logger.getLogger(Debugger.class.getName()).log(Level.SEVERE,null,ex);
  }
catch (  AbsentInformationException ex) {
    System.out.println("String_Node_Str");
  }
}
Program: 189623
Project: 189623
Buggy source:
public static ConfidenceLevel toConfidenceLevel(String dqQuality){
  ConfidenceLevel confidenceLevel;
  if ("String_Node_Str".equals(dqQuality)) {
    confidenceLevel=ConfidenceLevel.Certainly;
  }
 else   if ("String_Node_Str".equals(dqQuality)) {
    confidenceLevel=ConfidenceLevel.Possibly;
  }
 else   if ("String_Node_Str".equals(dqQuality)) {
    confidenceLevel=ConfidenceLevel.Apparently;
  }
 else   if ("String_Node_Str".equals(dqQuality)) {
    confidenceLevel=ConfidenceLevel.Perhaps;
  }
 else {
    confidenceLevel=null;
    Marker qualityContext=ConversionContext.getDetachedMarker("String_Node_Str");
    ConversionContext.addReference(qualityContext);
    try {
      logger.warn(ConversionContext.getContext(),"String_Node_Str",dqQuality);
    }
  finally {
      ConversionContext.removeReference(qualityContext);
    }
  }
  return confidenceLevel;
}

Fixed version (ground truth):
public static ConfidenceLevel toConfidenceLevel(String dqQuality){
  ConfidenceLevel confidenceLevel;
  if ("String_Node_Str".equals(dqQuality)) {
    confidenceLevel=ConfidenceLevel.Certainly;
  }
 else   if ("String_Node_Str".equals(dqQuality)) {
    confidenceLevel=ConfidenceLevel.Possibly;
  }
 else   if ("String_Node_Str".equals(dqQuality)) {
    confidenceLevel=ConfidenceLevel.Apparently;
  }
 else   if ("String_Node_Str".equals(dqQuality)) {
    confidenceLevel=ConfidenceLevel.Perhaps;
  }
 else {
    confidenceLevel=null;
    if (dqQuality != null) {
      Marker qualityContext=ConversionContext.getDetachedMarker("String_Node_Str");
      ConversionContext.addReference(qualityContext);
      try {
        logger.warn(ConversionContext.getContext(),"String_Node_Str",dqQuality);
      }
  finally {
        ConversionContext.removeReference(qualityContext);
      }
    }
  }
  return confidenceLevel;
}
Program: 189624
Project: 189624
Buggy source:
@BeforeClass public void setUp() throws Exception {
  SequentialIdentifierGenerator.reset();
  URL gedcomUrl=this.getClass().getClassLoader().getResource("String_Node_Str");
  File gedcomFile=new File(gedcomUrl.toURI());
  ModelParser modelParser=new ModelParser();
  gedcom=modelParser.parseGedcom(gedcomFile);
  assertNotNull(gedcom);
  assertNotNull(gedcom.getPeople());
  assertNotNull(gedcom.getSources());
  assertNotNull(gedcom.getRepositories());
}

Fixed version (ground truth):
@BeforeClass public void setUp() throws Exception {
  SequentialIdentifierGenerator.reset();
  URL gedcomUrl=this.getClass().getClassLoader().getResource("String_Node_Str");
  File gedcomFile=new File(gedcomUrl.toURI());
  ModelParser modelParser=new ModelParser();
  gedcom=modelParser.parseGedcom(gedcomFile);
  assertNotNull(gedcom);
  assertNotNull(gedcom.getPeople());
  assertEquals(gedcom.getPeople().size(),5);
  assertNotNull(gedcom.getFamilies());
  assertEquals(gedcom.getFamilies().size(),2);
  assertNotNull(gedcom.getSources());
  assertEquals(gedcom.getSources().size(),1);
  assertNotNull(gedcom.getRepositories());
  assertEquals(gedcom.getRepositories().size(),1);
}
Program: 189625
Project: 189625
Buggy source:
private void processFacts(Person gedxPerson,List<EventFact> facts,GedcomxConversionResult result) throws IOException {
  if (facts == null) {
    return;
  }
  for (  EventFact fact : facts) {
    Fact gedxFact=FactMapper.toFact(fact,result);
    if (gedxFact == null) {
      fact.getType();
      if (fact.getTag() != null && fact.getTag().equalsIgnoreCase("String_Node_Str")) {
        processSex(gedxPerson,fact);
      }
    }
  }
}

Fixed version (ground truth):
private void processFacts(Person gedxPerson,List<EventFact> facts,GedcomxConversionResult result) throws IOException {
  if (facts == null) {
    return;
  }
  for (  EventFact fact : facts) {
    Fact gedxFact=FactMapper.toFact(fact,result);
    if (gedxFact == null) {
      fact.getType();
      if (fact.getTag() != null && fact.getTag().equalsIgnoreCase("String_Node_Str")) {
        processSex(gedxPerson,fact);
      }
    }
    if (gedxFact != null) {
      gedxPerson.addFact(gedxFact);
    }
  }
}
Program: 189626
Project: 189626
Buggy source:
/** 
 * Load/reload the main and advanced configuration.
 */
public static void load(){
  if (!CONFIG_FILE.exists()) {
    FileUtils.copyJarConfig(CONFIG_FILE);
    if (!ADVANCED_FILE.exists())     FileUtils.copyJarConfig(ADVANCED_FILE);
  }
 else {
    loadFile(config,CONFIG_FILE);
    if (!ADVANCED_FILE.exists())     FileUtils.copyJarConfig(ADVANCED_FILE);
    loadFile(advanced,ADVANCED_FILE);
    configVersion=advanced.getInt("String_Node_Str",4);
    if (configVersion < 8)     ConfigUpdater.importFrom(configVersion);
 else {
      for (      ConfigValue<Boolean> v : booleans.values())       v.load();
      for (      ConfigValue<Integer> v : integers.values())       v.load();
      alias.load();
      if (configVersion == 8)       loadLightWeight();
    }
    advanced.set("String_Node_Str",CONFIG_VERSION);
    configVersion=CONFIG_VERSION;
    write();
  }
  loadWorlds();
}

Fixed version (ground truth):
/** 
 * Load/reload the main and advanced configuration.
 */
public static void load(){
  if (!CONFIG_FILE.exists()) {
    FileUtils.copyJarConfig(CONFIG_FILE);
    if (!ADVANCED_FILE.exists())     FileUtils.copyJarConfig(ADVANCED_FILE);
  }
 else {
    loadFile(config,CONFIG_FILE);
    if (!ADVANCED_FILE.exists())     FileUtils.copyJarConfig(ADVANCED_FILE);
    loadFile(advanced,ADVANCED_FILE);
    configVersion=advanced.getInt("String_Node_Str",4);
    if (configVersion < 8)     ConfigUpdater.importFrom(configVersion);
 else {
      for (      ConfigValue<Boolean> v : booleans.values())       v.load();
      CreeperLog.setDebug(getBool(CfgVal.DEBUG));
      for (      ConfigValue<Integer> v : integers.values())       v.load();
      alias.load();
      if (configVersion == 8)       loadLightWeight();
    }
    advanced.set("String_Node_Str",CONFIG_VERSION);
    configVersion=CONFIG_VERSION;
    write();
  }
  loadWorlds();
}
Program: 189627
Project: 189627
Buggy source:
/** 
 * Replace all explosions near a player.
 * @param sender The sender. If it is the console, then the command is ignored.
 * @param args The command arguments.
 */
private void healNear(CommandSender sender,String[] args){
  if (sender instanceof Player) {
    Player player=(Player)sender;
    boolean hasPermission=checkPermissions(player,"String_Node_Str","String_Node_Str");
    Player target;
    if (args.length > 1) {
      hasPermission=hasPermission || checkPermissions(player,"String_Node_Str");
      if (!hasPermission) {
        player.sendMessage(getMessage("String_Node_Str",player.getWorld().getName(),sender.getName(),null,null,null,null));
        return;
      }
      target=Bukkit.getServer().getPlayer(args[1]);
      if (target == null) {
        player.sendMessage(ChatColor.RED + "String_Node_Str");
        return;
      }
    }
 else {
      hasPermission=hasPermission || checkPermissions(player,"String_Node_Str");
      if (!hasPermission) {
        sender.sendMessage(getMessage("String_Node_Str",null,sender.getName(),null,null,null,null));
        return;
      }
      target=player;
    }
    ExplodedBlockManager.replaceNear(target);
  }
 else   if (args.length > 1) {
    Player target=Bukkit.getServer().getPlayer(args[1]);
    if (target == null) {
      sender.sendMessage(ChatColor.RED + "String_Node_Str");
      return;
    }
    ExplodedBlockManager.replaceNear(target);
  }
 else   sender.sendMessage(ChatColor.RED + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Replace all explosions near a player.
 * @param sender The sender. If it is the console, then the command is ignored.
 * @param args The command arguments.
 */
private void healNear(CommandSender sender,String[] args){
  if (sender instanceof Player) {
    Player player=(Player)sender;
    boolean hasPermission=checkPermissions(player,"String_Node_Str","String_Node_Str","String_Node_Str");
    Player target;
    if (args.length > 1) {
      if (!hasPermission) {
        player.sendMessage(getMessage("String_Node_Str",player.getWorld().getName(),sender.getName(),null,null,null,null));
        return;
      }
      target=Bukkit.getServer().getPlayer(args[1]);
      if (target == null) {
        player.sendMessage(ChatColor.RED + "String_Node_Str");
        return;
      }
    }
 else {
      hasPermission=hasPermission || checkPermissions(player,"String_Node_Str");
      if (!hasPermission) {
        sender.sendMessage(getMessage("String_Node_Str",null,sender.getName(),null,null,null,null));
        return;
      }
      target=player;
    }
    ExplodedBlockManager.replaceNear(target);
  }
 else   if (args.length > 1) {
    Player target=Bukkit.getServer().getPlayer(args[1]);
    if (target == null) {
      sender.sendMessage(ChatColor.RED + "String_Node_Str");
      return;
    }
    ExplodedBlockManager.replaceNear(target);
  }
 else   sender.sendMessage(ChatColor.RED + "String_Node_Str");
}
Program: 189628
Project: 189628
Buggy source:
/** 
 * Handle the commands concerning boolean settings.
 * @param world The world in which to change the setting.
 * @param key The setting to change.
 * @param args The arguments of the command.
 * @param setting The name of the setting.
 * @param sender The sender who performed the command.
 */
private void booleanCmd(WorldConfig world,WCfgVal key,String[] args,String setting,CommandSender sender){
  if (sender instanceof Player && !checkPermissions((Player)sender,"String_Node_Str"))   sender.sendMessage(getMessage("String_Node_Str",null,sender.getName(),null,null,null,null));
  if (args.length == 1)   world.setBool(key,!world.getBool(key));
 else   if (args[1].equalsIgnoreCase("String_Node_Str") || args[1].equalsIgnoreCase("String_Node_Str"))   world.setBool(key,true);
 else   if (args[1].equalsIgnoreCase("String_Node_Str") || args[1].equalsIgnoreCase("String_Node_Str"))   world.setBool(key,false);
 else {
    sender.sendMessage("String_Node_Str" + args[0] + "String_Node_Str");
    sender.sendMessage("String_Node_Str" + setting + "String_Node_Str");
    return;
  }
  sender.sendMessage(ChatColor.GREEN + setting + "String_Node_Str"+ world.getBool(key));
}

Fixed version (ground truth):
/** 
 * Handle the commands concerning boolean settings.
 * @param world The world in which to change the setting.
 * @param key The setting to change.
 * @param args The arguments of the command.
 * @param setting The name of the setting.
 * @param sender The sender who performed the command.
 */
private void booleanCmd(WorldConfig world,WCfgVal key,String[] args,String setting,CommandSender sender){
  if (sender instanceof Player && !checkPermissions((Player)sender,"String_Node_Str"))   sender.sendMessage(getMessage("String_Node_Str",null,sender.getName(),null,null,null,null));
  if (world == null) {
    for (    World w : Bukkit.getServer().getWorlds())     booleanCmd(CreeperConfig.getWorld(w),key,args,setting,sender);
    return;
  }
  if (args.length == 1)   world.setBool(key,!world.getBool(key));
 else   if (args[1].equalsIgnoreCase("String_Node_Str") || args[1].equalsIgnoreCase("String_Node_Str"))   world.setBool(key,true);
 else   if (args[1].equalsIgnoreCase("String_Node_Str") || args[1].equalsIgnoreCase("String_Node_Str"))   world.setBool(key,false);
 else {
    sender.sendMessage("String_Node_Str" + args[0] + "String_Node_Str");
    sender.sendMessage("String_Node_Str" + setting + "String_Node_Str");
    return;
  }
  sender.sendMessage(ChatColor.GREEN + setting + "String_Node_Str"+ world.getBool(key));
}
Program: 189629
Project: 189629
Buggy source:
/** 
 * Create a new CreeperBlock of the right class. Factory method that should be used as a constructor.
 * @param blockState The block to be represented.
 * @return A new CreeperBlock of the right subclass.
 */
public static CreeperBlock newBlock(BlockState blockState){
  if (PluginHandler.isSpoutEnabled() && SpoutBlock.isCustomBlock(blockState))   return new SpoutBlock(blockState);
  if (blockState instanceof InventoryHolder)   return new CreeperChest(blockState);
  if (blockState.getType().hasGravity())   return new CreeperPhysicsBlock(blockState);
switch (blockState.getType()) {
case BED_BLOCK:
    return new CreeperBed(blockState);
case RAILS:
case POWERED_RAIL:
case DETECTOR_RAIL:
  return new CreeperRail(blockState);
case SKULL:
return new CreeperHead(blockState);
case PISTON_BASE:
case PISTON_STICKY_BASE:
case PISTON_EXTENSION:
return new CreeperPiston(blockState);
case WOODEN_DOOR:
case IRON_DOOR_BLOCK:
return new CreeperDoor(blockState);
case NOTE_BLOCK:
return new CreeperNoteBlock((NoteBlock)blockState);
case SIGN_POST:
case WALL_SIGN:
return new CreeperSign((Sign)blockState);
case MOB_SPAWNER:
return new CreeperMonsterSpawner((CreatureSpawner)blockState);
case WOOD_PLATE:
case STONE_PLATE:
return new CreeperPlate(blockState);
case GRASS:
return new CreeperGrass(blockState);
case SMOOTH_BRICK:
case SMOOTH_STAIRS:
return new CreeperBrick(blockState);
case TNT:
case FIRE:
case AIR:
return null;
default :
return new CreeperBlock(blockState);
}
}

Fixed version (ground truth):
/** 
 * Create a new CreeperBlock of the right class. Factory method that should be used as a constructor.
 * @param blockState The block to be represented.
 * @return A new CreeperBlock of the right subclass.
 */
public static CreeperBlock newBlock(BlockState blockState){
  if (PluginHandler.isSpoutEnabled() && SpoutBlock.isCustomBlock(blockState))   return new SpoutBlock(blockState);
  if (blockState instanceof InventoryHolder)   return new CreeperChest(blockState);
  if (blockState.getType().hasGravity())   return new CreeperPhysicsBlock(blockState);
switch (blockState.getType()) {
case BED_BLOCK:
    return new CreeperBed(blockState);
case RAILS:
case POWERED_RAIL:
case DETECTOR_RAIL:
  return new CreeperRail(blockState);
case SKULL:
return new CreeperHead(blockState);
case PISTON_BASE:
case PISTON_STICKY_BASE:
case PISTON_EXTENSION:
return new CreeperPiston(blockState);
case WOODEN_DOOR:
case IRON_DOOR_BLOCK:
return new CreeperDoor(blockState);
case NOTE_BLOCK:
return new CreeperNoteBlock((NoteBlock)blockState);
case SIGN_POST:
case WALL_SIGN:
return new CreeperSign((Sign)blockState);
case MOB_SPAWNER:
return new CreeperMonsterSpawner((CreatureSpawner)blockState);
case WOOD_PLATE:
case STONE_PLATE:
return new CreeperPlate(blockState);
case GRASS:
return new CreeperGrass(blockState);
case SMOOTH_BRICK:
case SMOOTH_STAIRS:
return new CreeperBrick(blockState);
case WOOD_BUTTON:
case STONE_BUTTON:
return new CreeperButton(blockState);
case TNT:
case FIRE:
case AIR:
return null;
default :
return new CreeperBlock(blockState);
}
}
Program: 189630
Project: 189630
Buggy source:
/** 
 * Add an element to the map. It is placed in the correct zone, created if necessary.
 * @param el The element.
 * @param x The x coordinate.
 * @param y The y coordinate.
 */
public void addElement(T el,double x,double y){
  if (el == null)   return;
  Point p=new Point((int)(x / BLOCK_SIZE),(int)(y / BLOCK_SIZE));
  LinkedList<T> list=map.get(p);
  if (list == null) {
    list=new LinkedList<T>();
    map.put(p,new LinkedList<T>());
  }
  list.add(el);
}

Fixed version (ground truth):
/** 
 * Add an element to the map. It is placed in the correct zone, created if necessary.
 * @param el The element.
 * @param x The x coordinate.
 * @param y The y coordinate.
 */
public void addElement(T el,double x,double y){
  if (el == null)   return;
  Point p=new Point((int)(x / BLOCK_SIZE),(int)(y / BLOCK_SIZE));
  LinkedList<T> list=map.get(p);
  if (list == null) {
    list=new LinkedList<T>();
    map.put(p,list);
  }
  list.add(el);
}
Program: 189631
Project: 189631
Buggy source:
@Override public boolean replace(boolean shouldDrop){
  Painting p=getWorld().spawn(location.getBlock().getRelative(hanging.getAttachedFace()).getLocation(),Painting.class);
  p.teleport(location);
  p.setFacingDirection(hanging.getFacing(),true);
  p.setArt(((Painting)hanging).getArt());
  return true;
}

Fixed version (ground truth):
@Override public boolean replace(boolean shouldDrop){
  try {
    Painting p=getWorld().spawn(location.getBlock().getRelative(hanging.getAttachedFace()).getLocation(),Painting.class);
    p.teleport(location);
    p.setFacingDirection(hanging.getFacing(),true);
    p.setArt(((Painting)hanging).getArt());
  }
 catch (  IllegalArgumentException e) {
    return false;
  }
  return true;
}
Program: 189632
Project: 189632
Buggy source:
@Override public final boolean replace(boolean shouldDrop){
  Block block=getBlock();
  int blockId=block.getTypeId();
  if (!CreeperConfig.overwriteBlocks && !isEmpty(blockId)) {
    if (CreeperConfig.dropDestroyedBlocks)     drop();
    return true;
  }
 else   if (CreeperConfig.overwriteBlocks && !isEmpty(blockId) && CreeperConfig.dropDestroyedBlocks) {
    CreeperBlock b=CreeperBlock.newBlock(block.getState());
    b.drop();
    b.remove();
  }
  if (!shouldDrop && isDependent(getTypeId()) && isEmpty(getBlock().getRelative(getAttachingFace()).getTypeId())) {
    delay_replacement();
    return true;
  }
 else   update();
  checkForAscendingRails();
  return true;
}

Fixed version (ground truth):
@Override public final boolean replace(boolean shouldDrop){
  Block block=getBlock();
  int blockId=block.getTypeId();
  if (!CreeperConfig.overwriteBlocks && !isEmpty(blockId)) {
    if (CreeperConfig.dropDestroyedBlocks)     drop();
    return true;
  }
 else   if (CreeperConfig.overwriteBlocks && !isEmpty(blockId) && CreeperConfig.dropDestroyedBlocks) {
    CreeperBlock b=CreeperBlock.newBlock(block.getState());
    if (b != null) {
      b.drop();
      b.remove();
    }
  }
  if (!shouldDrop && isDependent(getTypeId()) && isEmpty(getBlock().getRelative(getAttachingFace()).getTypeId())) {
    delay_replacement();
    return true;
  }
 else   update();
  checkForAscendingRails();
  return true;
}
Program: 189633
Project: 189633
Buggy source:
@Override public void clean(){
  Iterator<LinkedList<CreeperExplosion>> iter=map.values().iterator();
  while (iter.hasNext()) {
    LinkedList<CreeperExplosion> list=iter.next();
    Iterator<CreeperExplosion> it=list.iterator();
    while (it.hasNext()) {
      CreeperExplosion e=it.next();
      if (e.getBlockList().isEmpty())       it.remove();
    }
    if (list.isEmpty())     iter.remove();
  }
}

Fixed version (ground truth):
@Override public void clean(){
  Iterator<LinkedList<CreeperExplosion>> iter=map.values().iterator();
  while (iter.hasNext()) {
    LinkedList<CreeperExplosion> list=iter.next();
    Iterator<CreeperExplosion> it=list.iterator();
    while (it.hasNext()) {
      CreeperExplosion e=it.next();
      if (e.isEmpty())       it.remove();
    }
    if (list.isEmpty())     iter.remove();
  }
}
Program: 189634
Project: 189634
Buggy source:
public static WorldConfig loadWorld(World world){
  String name=world.getName();
  WorldConfig returnValue=world_config.get(name);
  if (returnValue == null) {
    try {
      returnValue=new WorldConfig(name,getDataFolder());
    }
 catch (    Exception e) {
      log.severe("String_Node_Str" + name);
      log.severe(e.getMessage());
    }
  }
  return returnValue;
}

Fixed version (ground truth):
public static WorldConfig loadWorld(World world){
  String name=world.getName();
  WorldConfig returnValue=world_config.get(name);
  if (returnValue == null) {
    try {
      returnValue=new WorldConfig(name,getDataFolder());
    }
 catch (    Exception e) {
      log.severe("String_Node_Str" + name);
      log.severe(e.getMessage());
    }
  }
  world_config.put(name,returnValue);
  return returnValue;
}
Program: 189635
Project: 189635
Buggy source:
public static void checkReplace(boolean blockPerBlock){
  Date now=new Date();
  Iterator<CreeperExplosion> iter=explosionList.iterator();
  while (iter.hasNext()) {
    CreeperExplosion cEx=iter.next();
    Date time=cEx.getTime();
    List<Replaceable> blockList=cEx.getBlockList();
    Date after=new Date(time.getTime() + CreeperConfig.waitBeforeHeal * 1000);
    if (after.before(now)) {
      if (!blockPerBlock) {
        BlockManager.replace_blocks(blockList);
        iter.remove();
      }
 else {
        if (!blockList.isEmpty())         BlockManager.replace_one_block(blockList);
        if (blockList.isEmpty()) {
          explosionIndex.removeElement(cEx,cEx.getLocation().getX(),cEx.getLocation().getZ());
          iter.remove();
        }
      }
    }
 else     break;
  }
  PaintingsManager.replacePaintings(now);
}

Fixed version (ground truth):
public static void checkReplace(boolean blockPerBlock){
  Date now=new Date();
  Iterator<CreeperExplosion> iter=explosionList.iterator();
  while (iter.hasNext()) {
    CreeperExplosion cEx=iter.next();
    Date time=cEx.getTime();
    List<Replaceable> blockList=cEx.getBlockList();
    Date after=new Date(time.getTime() + CreeperConfig.waitBeforeHeal * 1000);
    if (after.before(now)) {
      if (!blockPerBlock) {
        BlockManager.replace_blocks(blockList);
        iter.remove();
      }
 else {
        if (!blockList.isEmpty())         BlockManager.replace_one_block(blockList);
        if (blockList.isEmpty()) {
          if (!CreeperConfig.lightweightMode)           explosionIndex.removeElement(cEx,cEx.getLocation().getX(),cEx.getLocation().getZ());
          iter.remove();
        }
      }
    }
 else     break;
  }
  PaintingsManager.replacePaintings(now);
}
Program: 189636
Project: 189636
Buggy source:
public void restore(){
  super.update(true);
  if (hasNeighbor()) {
    neighbor.update(true);
    Inventory i=((InventoryHolder)chest.getState()).getInventory();
    ItemStack[] both;
    ItemStack[] otherInv=neighborInventory;
    ItemStack[] newInv=storedInventory;
    if (neighbor.isRight())     both=CreeperUtils.concat(otherInv,newInv);
 else     both=CreeperUtils.concat(newInv,otherInv);
    i.setContents(both);
  }
 else   ((InventoryHolder)chest.getState()).getInventory().setContents(storedInventory);
}

Fixed version (ground truth):
public void restore(){
  super.update(true);
  try {
    if (hasNeighbor()) {
      neighbor.update(true);
      Inventory i=((InventoryHolder)chest.getState()).getInventory();
      ItemStack[] both;
      ItemStack[] otherInv=neighborInventory;
      ItemStack[] newInv=storedInventory;
      if (neighbor.isRight())       both=CreeperUtils.concat(otherInv,newInv);
 else       both=CreeperUtils.concat(newInv,otherInv);
      i.setContents(both);
    }
 else     ((InventoryHolder)chest.getState()).getInventory().setContents(storedInventory);
  }
 catch (  java.lang.ClassCastException e) {
    CreeperLog.warning("String_Node_Str");
    CreeperLog.warning(chest.getClass().getCanonicalName());
    CreeperLog.displayBlockLocation(chest,true);
    e.printStackTrace();
  }
}
Program: 189637
Project: 189637
Buggy source:
public static void displayBlockLocation(Block block){
  Location loc=block.getLocation();
  debug(block.getType() + "String_Node_Str" + loc.getBlockX()+ "String_Node_Str"+ loc.getBlockY()+ "String_Node_Str"+ loc.getBlockZ());
}

Fixed version (ground truth):
public static void displayBlockLocation(Block block,boolean force){
  Location loc=block.getLocation();
  String s=block.getType() + "String_Node_Str" + loc.getBlockX()+ "String_Node_Str"+ loc.getBlockY()+ "String_Node_Str"+ loc.getBlockZ();
  if (force)   warning(s);
 else   debug(s);
}
Program: 189639
Project: 189639
Buggy source:
private static void copyJarConfig(File file){
  OutputStream outStream=null;
  try {
    file.createNewFile();
    InputStream templateIn=plugin.getResource("String_Node_Str");
    outStream=new FileOutputStream(file);
    int read=0;
    byte[] bytes=new byte[1024];
    while ((read=templateIn.read(bytes)) != -1) {
      outStream.write(bytes,0,read);
    }
    templateIn.close();
    outStream.flush();
    outStream.close();
    CreeperLog.logInfo("String_Node_Str",1);
  }
 catch (  Exception e) {
    CreeperLog.warning("String_Node_Str");
    CreeperLog.warning(e.getMessage());
    if (outStream != null) {
      try {
        outStream.flush();
        outStream.close();
      }
 catch (      IOException e1) {
        e1.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
public static void copyJarConfig(File file,String resource){
  OutputStream outStream=null;
  try {
    file.createNewFile();
    InputStream templateIn=plugin.getResource(resource);
    outStream=new FileOutputStream(file);
    int read=0;
    byte[] bytes=new byte[1024];
    while ((read=templateIn.read(bytes)) != -1) {
      outStream.write(bytes,0,read);
    }
    templateIn.close();
    outStream.flush();
    outStream.close();
    CreeperLog.logInfo("String_Node_Str",1);
  }
 catch (  Exception e) {
    CreeperLog.warning("String_Node_Str" + file.getName());
    CreeperLog.warning(e.getMessage());
    if (outStream != null) {
      try {
        outStream.flush();
        outStream.close();
      }
 catch (      IOException e1) {
        e1.printStackTrace();
      }
    }
  }
}
Program: 189640
Project: 189640
Buggy source:
public CreeperConfig(CreeperHeal instance){
  plugin=instance;
  yml=new File(getDataFolder() + "String_Node_Str");
  configFile=plugin.getConfig();
  if (!new File(getDataFolder().toString()).exists()) {
    new File(getDataFolder().toString()).mkdir();
  }
  if (!yml.exists()) {
    CreeperLog.warning("String_Node_Str");
    copyJarConfig(yml);
  }
  load();
  write();
}

Fixed version (ground truth):
public CreeperConfig(CreeperHeal instance){
  plugin=instance;
  yml=new File(getDataFolder() + "String_Node_Str");
  configFile=plugin.getConfig();
  if (!new File(getDataFolder().toString()).exists()) {
    new File(getDataFolder().toString()).mkdir();
  }
  if (!yml.exists()) {
    CreeperLog.warning("String_Node_Str");
    copyJarConfig(yml,"String_Node_Str");
  }
  load();
  write();
}
Program: 189642
Project: 189642
Buggy source:
public static void logInfo(String msg,int level){
  logLevel=CreeperConfig.logLevel;
  if (level <= logLevel) {
    log.info("String_Node_Str" + msg);
    record("String_Node_Str" + msg);
  }
}

Fixed version (ground truth):
public static void logInfo(String msg,int level){
  if (logLevel == -42)   if (CreeperConfig.logLevel != -42)   logLevel=CreeperConfig.logLevel;
  if (level <= logLevel) {
    log.info("String_Node_Str" + msg);
    record("String_Node_Str" + msg);
  }
}
Program: 189643
Project: 189643
Buggy source:
private static void createNewFile(File file){
  try {
    file.createNewFile();
    boolean success=false;
    InputStream templateIn=plugin.getResource("String_Node_Str");
    OutputStream outStream=new FileOutputStream(file);
    int read=0;
    byte[] bytes=new byte[1024];
    while ((read=templateIn.read(bytes)) != -1) {
      outStream.write(bytes,0,read);
    }
    templateIn.close();
    outStream.flush();
    outStream.close();
    if (success)     CreeperLog.logInfo("String_Node_Str",1);
 else     CreeperLog.warning("String_Node_Str");
  }
 catch (  Exception e) {
    CreeperLog.warning("String_Node_Str");
    CreeperLog.warning(e.getMessage());
  }
}

Fixed version (ground truth):
private static void createNewFile(File file){
  try {
    file.createNewFile();
    InputStream templateIn=plugin.getResource("String_Node_Str");
    OutputStream outStream=new FileOutputStream(file);
    int read=0;
    byte[] bytes=new byte[1024];
    while ((read=templateIn.read(bytes)) != -1) {
      outStream.write(bytes,0,read);
    }
    templateIn.close();
    outStream.flush();
    outStream.close();
    CreeperLog.logInfo("String_Node_Str",1);
  }
 catch (  Exception e) {
    CreeperLog.warning("String_Node_Str");
    CreeperLog.warning(e.getMessage());
  }
}
Program: 189644
Project: 189644
Buggy source:
private JMenu buildAiMenu(){
  JMenuItem aiEnabledItem;
  JMenuItem evolveItem;
  aiEnabledItem=new JCheckBoxMenuItem();
  aiEnabledItem.setText("String_Node_Str");
  aiEnabledItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A,ActionEvent.CTRL_MASK));
  aiEnabledItem.addActionListener((e) -> ai.setEnabled(((JMenuItem)e.getSource()).isSelected()));
  evolveItem=new JCheckBoxMenuItem();
  evolveItem.setText("String_Node_Str");
  evolveItem.addActionListener((e) -> ai.setTraining(((JMenuItem)e.getSource()).isSelected()));
  JMenu menu=new JMenu("String_Node_Str");
  menu.add(aiEnabledItem);
  menu.add(evolveItem);
  menu.add(buildSpeedMenu());
  return menu;
}

Fixed version (ground truth):
private JMenu buildAiMenu(){
  JMenuItem aiEnabledItem;
  JMenuItem evolveItem;
  aiEnabledItem=new JCheckBoxMenuItem();
  aiEnabledItem.setText("String_Node_Str");
  aiEnabledItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A,InputEvent.CTRL_MASK));
  aiEnabledItem.addActionListener((e) -> ai.setEnabled(((JMenuItem)e.getSource()).isSelected()));
  evolveItem=new JCheckBoxMenuItem();
  evolveItem.setText("String_Node_Str");
  evolveItem.addActionListener((e) -> ai.setTraining(((JMenuItem)e.getSource()).isSelected()));
  JMenu menu=new JMenu("String_Node_Str");
  menu.add(aiEnabledItem);
  menu.add(evolveItem);
  menu.add(buildSpeedMenu());
  return menu;
}
Program: 189645
Project: 189645
Buggy source:
public void start(){
  try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  }
 catch (  ClassNotFoundException|InstantiationException|IllegalAccessException|UnsupportedLookAndFeelException e1) {
    e1.printStackTrace();
  }
  frame=new JFrame();
  frame.setTitle("String_Node_Str");
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setMinimumSize(new Dimension(300,600));
  frame.setLocationRelativeTo(null);
  frame.getContentPane().setLayout(new BorderLayout());
  frame.getContentPane().add(this,BorderLayout.CENTER);
  buildMenu(frame);
  frame.setVisible(true);
  new Thread(this).start();
}

Fixed version (ground truth):
public void start(){
  try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  }
 catch (  ClassNotFoundException|InstantiationException|IllegalAccessException|UnsupportedLookAndFeelException e1) {
    e1.printStackTrace();
  }
  frame=new JFrame();
  frame.setTitle("String_Node_Str");
  frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  frame.setMinimumSize(new Dimension(300,600));
  frame.setLocationRelativeTo(null);
  frame.getContentPane().setLayout(new BorderLayout());
  frame.getContentPane().add(this,BorderLayout.CENTER);
  buildMenu(frame);
  frame.setVisible(true);
  new Thread(this).start();
}