nus-yam/ex-repair huggingface dataset:
Program: 93731
Project: 93731
Buggy source:
/** 
 * Returns the merger class that is best suited for the given   {@link DiffElement}. Merger classes can be managed via   {@link #addMergerType(Class,Class)} and {@link #removeMergerType(Class)}.
 * @param element {@link DiffElement} we want a merger for.
 * @return The merger class that is best suited for the given {@link DiffElement}.
 */
private static Class<? extends IMerger> getBestMerger(DiffElement element){
  Class<? extends IMerger> mergerClass=DefaultMerger.class;
  EObject leftElement=(EObject)ClassUtils.invokeMethod(element,"String_Node_Str");
  if (leftElement == null)   leftElement=(EObject)ClassUtils.invokeMethod(element,"String_Node_Str");
  String resourceFileExtension=null;
  if (leftElement != null)   resourceFileExtension=leftElement.eResource().getURI().fileExtension();
  if (resourceFileExtension == null)   resourceFileExtension=ALL_EXTENSIONS;
  final Map<Class<? extends DiffElement>,Class<? extends IMerger>> mergersMap;
  if (EMFPlugin.IS_ECLIPSE_RUNNING)   mergersMap=getMergerTypes(resourceFileExtension);
 else   mergersMap=MERGER_TYPES;
  if (mergersMap.containsKey(element.getClass())) {
    mergerClass=mergersMap.get(element.getClass());
  }
 else {
    for (    Class<? extends DiffElement> clazz : mergersMap.keySet()) {
      if (clazz.isInstance(element)) {
        mergerClass=mergersMap.get(clazz);
        break;
      }
    }
  }
  return mergerClass;
}

Fixed version (ground truth):
/** 
 * Returns the merger class that is best suited for the given   {@link DiffElement}. Merger classes can be managed via   {@link #addMergerType(Class,Class)} and {@link #removeMergerType(Class)}.
 * @param element {@link DiffElement} we want a merger for.
 * @return The merger class that is best suited for the given {@link DiffElement}.
 */
private static Class<? extends IMerger> getBestMerger(DiffElement element){
  Class<? extends IMerger> mergerClass=DefaultMerger.class;
  EObject rightElement=(EObject)ClassUtils.invokeMethod(element,"String_Node_Str");
  if (rightElement == null) {
    rightElement=(EObject)ClassUtils.invokeMethod(element,"String_Node_Str");
  }
  String resourceFileExtension=null;
  if (rightElement != null) {
    resourceFileExtension=rightElement.eResource().getURI().fileExtension();
  }
  if (resourceFileExtension == null) {
    resourceFileExtension=ALL_EXTENSIONS;
  }
  final Map<Class<? extends DiffElement>,Class<? extends IMerger>> mergersMap;
  if (EMFPlugin.IS_ECLIPSE_RUNNING) {
    mergersMap=getMergerTypes(resourceFileExtension);
  }
 else {
    mergersMap=MERGER_TYPES;
  }
  if (mergersMap.containsKey(element.getClass())) {
    mergerClass=mergersMap.get(element.getClass());
  }
 else {
    for (    final Class<? extends DiffElement> clazz : mergersMap.keySet()) {
      if (clazz.isInstance(element)) {
        mergerClass=mergersMap.get(clazz);
        break;
      }
    }
  }
  return mergerClass;
}
Program: 93732
Project: 93732
Buggy source:
/** 
 * Handles the creation of the merger for a given   {@link DiffElement}.
 * @param element {@link DiffElement} for which we need a merger.
 * @return The merger adapted to <code>element</code>, <code>null</code> if it cannot beinstantiated.
 */
public static IMerger createMerger(DiffElement element){
  final Class<? extends IMerger> mergerClass=getBestMerger(element);
  IMerger elementMerger=null;
  try {
    elementMerger=mergerClass.newInstance();
    elementMerger.setDiffElement(element);
  }
 catch (  InstantiationException e) {
    EMFComparePlugin.log(e.getMessage(),false);
  }
catch (  IllegalAccessException e) {
    EMFComparePlugin.log(e.getMessage(),false);
  }
  return elementMerger;
}

Fixed version (ground truth):
/** 
 * Handles the creation of the merger for a given   {@link DiffElement}.
 * @param element {@link DiffElement} for which we need a merger.
 * @return The merger adapted to <code>element</code>, <code>null</code> if it cannot be instantiated.
 */
public static IMerger createMerger(DiffElement element){
  final Class<? extends IMerger> mergerClass=getBestMerger(element);
  IMerger elementMerger=null;
  try {
    elementMerger=mergerClass.newInstance();
    elementMerger.setDiffElement(element);
  }
 catch (  final InstantiationException e) {
    EMFComparePlugin.log(e.getMessage(),false);
  }
catch (  final IllegalAccessException e) {
    EMFComparePlugin.log(e.getMessage(),false);
  }
  return elementMerger;
}
Program: 93733
Project: 93733
Buggy source:
/** 
 * Creates a new model content merge viewer and intializes it.
 * @param parent Parent composite for this viewer.
 * @param config The configuration object.
 */
public ModelContentMergeViewer(Composite parent,CompareConfiguration config){
  super(SWT.NONE,ResourceBundle.getBundle(BUNDLE_NAME),config);
  configuration=config;
  buildControl(parent);
  getCenterPart().addPaintListener(new CenterPaintListener());
  configuration.addPropertyChangeListener(new IPropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent event){
      if (event.getProperty().equals(EMFCompareConstants.PROPERTY_STRUCTURE_SELECTION)) {
        Object selected=null;
        if (event.getNewValue() instanceof IStructuredSelection) {
          selected=((IStructuredSelection)event.getNewValue()).getFirstElement();
        }
        if (selected instanceof DiffElement) {
          currentDiff=(DiffElement)selected;
          leftPart.navigateToDiff(currentDiff);
          rightPart.navigateToDiff(currentDiff);
        }
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Creates a new model content merge viewer and intializes it.
 * @param parent Parent composite for this viewer.
 * @param config The configuration object.
 */
public ModelContentMergeViewer(Composite parent,CompareConfiguration config){
  super(SWT.NONE,ResourceBundle.getBundle(BUNDLE_NAME),config);
  configuration=config;
  buildControl(parent);
  updateColors();
  configuration.addPropertyChangeListener(new IPropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent event){
      if (event.getProperty().equals(EMFCompareConstants.PROPERTY_STRUCTURE_SELECTION)) {
        Object selected=null;
        if (event.getNewValue() instanceof IStructuredSelection) {
          selected=((IStructuredSelection)event.getNewValue()).getFirstElement();
        }
        if (selected instanceof DiffElement) {
          currentDiff=(DiffElement)selected;
          leftPart.navigateToDiff(currentDiff);
          rightPart.navigateToDiff(currentDiff);
        }
      }
    }
  }
);
  EMFCompareUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent event){
      if (event.getProperty().endsWith("String_Node_Str")) {
        updateColors();
      }
    }
  }
);
}
Program: 93734
Project: 93734
Buggy source:
public void propertyChange(PropertyChangeEvent event){
  if (event.getProperty().equals(EMFCompareConstants.PROPERTY_STRUCTURE_SELECTION)) {
    Object selected=null;
    if (event.getNewValue() instanceof IStructuredSelection) {
      selected=((IStructuredSelection)event.getNewValue()).getFirstElement();
    }
    if (selected instanceof DiffElement) {
      currentDiff=(DiffElement)selected;
      leftPart.navigateToDiff(currentDiff);
      rightPart.navigateToDiff(currentDiff);
    }
  }
}

Fixed version (ground truth):
public void propertyChange(PropertyChangeEvent event){
  if (event.getProperty().endsWith("String_Node_Str")) {
    updateColors();
  }
}
Program: 93737
Project: 93737
Buggy source:
private void drawLine(PaintEvent event,TableItem tableItem){
  final Rectangle tableBounds=properties.getTable().getBounds();
  final Rectangle tableItemBounds=tableItem.getBounds();
  final IPreferenceStore comparePreferences=EMFCompareUIPlugin.getDefault().getPreferenceStore();
  tableItem.setBackground(new Color(tableItem.getDisplay(),PreferenceConverter.getColor(comparePreferences,EMFCompareConstants.PREFERENCES_KEY_HIGHLIGHT_COLOR)));
  event.gc.setLineWidth(2);
  event.gc.setForeground(new Color(tableItem.getDisplay(),PreferenceConverter.getColor(comparePreferences,EMFCompareConstants.PREFERENCES_KEY_CHANGED_COLOR)));
  event.gc.drawLine(getTotalColumnsWidth(),tableItemBounds.y + tableItemBounds.height / 2,tableBounds.width,tableItemBounds.y + tableItemBounds.height / 2);
}

Fixed version (ground truth):
private void drawLine(PaintEvent event,TableItem tableItem){
  final Rectangle tableBounds=properties.getTable().getBounds();
  final Rectangle tableItemBounds=tableItem.getBounds();
  tableItem.setBackground(new Color(tableItem.getDisplay(),parentViewer.getHighlightColor()));
  event.gc.setLineWidth(2);
  event.gc.setForeground(new Color(tableItem.getDisplay(),parentViewer.getChangedColor()));
  event.gc.drawLine(getTotalColumnsWidth(),tableItemBounds.y + tableItemBounds.height / 2,tableBounds.width,tableItemBounds.y + tableItemBounds.height / 2);
}
Program: 93738
Project: 93738
Buggy source:
/** 
 * Load a model from an   {@link java.io.InputStream  InputStream}.
 * @param stream the inputstream to load from
 * @param fileName the original filename
 * @return the loaded model
 * @throws IOException If the given file does not exist.
 */
@SuppressWarnings("String_Node_Str") public static EObject load(InputStream stream,String fileName) throws IOException {
  EObject result=null;
  String fileExtension=fileName.substring(fileName.lastIndexOf("String_Node_Str") + 1);
  if (fileExtension == null || fileExtension.length() == 0) {
    fileExtension=Resource.Factory.Registry.DEFAULT_EXTENSION;
  }
  final ResourceSet resourceSet=new ResourceSetImpl();
  final Resource.Factory.Registry reg=Resource.Factory.Registry.INSTANCE;
  final Object resourceFactory=reg.getExtensionToFactoryMap().get(fileExtension);
  if (resourceFactory != null) {
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(fileExtension,resourceFactory);
  }
 else {
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(fileExtension,new XMIResourceFactoryImpl());
  }
  final Resource modelResource=resourceSet.createResource(URI.createURI(fileName));
  modelResource.load(stream,Collections.EMPTY_MAP);
  if (modelResource.getContents().size() > 0)   result=(EObject)modelResource.getContents().get(0);
  return result;
}

Fixed version (ground truth):
/** 
 * Load a model from an   {@link java.io.InputStream  InputStream} in a given {@link ResourceSet}.
 * @param stream The inputstream to load from
 * @param fileName The original filename
 * @param resourceSet The  {@link ResourceSet} to load the model in.
 * @return The loaded model
 * @throws IOException If the given file does not exist.
 */
@SuppressWarnings("String_Node_Str") public static EObject load(InputStream stream,String fileName,ResourceSet resourceSet) throws IOException {
  EObject result=null;
  String fileExtension=fileName.substring(fileName.lastIndexOf("String_Node_Str") + 1);
  if (fileExtension == null || fileExtension.length() == 0) {
    fileExtension=Resource.Factory.Registry.DEFAULT_EXTENSION;
  }
  final Resource.Factory.Registry reg=Resource.Factory.Registry.INSTANCE;
  final Object resourceFactory=reg.getExtensionToFactoryMap().get(fileExtension);
  if (resourceFactory != null) {
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(fileExtension,resourceFactory);
  }
 else {
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(fileExtension,new XMIResourceFactoryImpl());
  }
  final Resource modelResource=resourceSet.createResource(URI.createURI(fileName));
  modelResource.load(stream,Collections.EMPTY_MAP);
  if (modelResource.getContents().size() > 0)   result=(EObject)modelResource.getContents().get(0);
  return result;
}
Program: 93739
Project: 93739
Buggy source:
@Override public void onTimeSet(TimePicker timePicker,int hour,int minute){
  Calendar date=new GregorianCalendar(this.year,this.month,this.day,hour,minute);
switch (callerId) {
case R.id.add_new_scheduled_recording_set_start_time_button:
    ((TextView)findViewById(R.id.add_new_scheduled_recording_start_time_text)).setText(DateUtils.getDateTimeString(date.getTimeInMillis()));
  break;
case R.id.add_new_scheduled_recording_set_end_time_button:
((TextView)findViewById(R.id.add_new_scheduled_recording_end_time_text)).setText(DateUtils.getDateTimeString(date.getTimeInMillis()));
break;
}
}

Fixed version (ground truth):
@Override public void onTimeSet(TimePicker timePicker,int hour,int minute){
  Calendar date=new GregorianCalendar(this.year,this.month,this.day,hour,minute);
switch (callerId) {
case R.id.add_new_scheduled_recording_set_start_time_button:
    startDateTime=date.getTimeInMillis();
  ((TextView)findViewById(R.id.add_new_scheduled_recording_start_time_text)).setText(DateUtils.getDateTimeString(startDateTime));
break;
case R.id.add_new_scheduled_recording_set_end_time_button:
endDateTime=date.getTimeInMillis();
((TextView)findViewById(R.id.add_new_scheduled_recording_end_time_text)).setText(DateUtils.getDateTimeString(endDateTime));
break;
}
}
Program: 93740
Project: 93740
Buggy source:
private String getTimestamp(){
  Calendar calendar=new GregorianCalendar(TimeZone.getDefault());
  StringBuilder timestamp=new StringBuilder();
  timestamp.append(calendar.get(Calendar.YEAR));
  timestamp.append(("String_Node_Str"));
  timestamp.append(StringUtils.pad(calendar.get(Calendar.MONTH)));
  timestamp.append(("String_Node_Str"));
  timestamp.append(StringUtils.pad(calendar.get(Calendar.DAY_OF_MONTH)));
  timestamp.append(("String_Node_Str"));
  timestamp.append(StringUtils.pad(calendar.get(Calendar.HOUR_OF_DAY)));
  timestamp.append(("String_Node_Str"));
  timestamp.append(StringUtils.pad(calendar.get(Calendar.MINUTE)));
  timestamp.append(("String_Node_Str"));
  timestamp.append(StringUtils.pad(calendar.get(Calendar.SECOND)));
  return timestamp.toString();
}

Fixed version (ground truth):
private String getTimestamp(){
  Calendar calendar=new GregorianCalendar();
  StringBuilder timestamp=new StringBuilder();
  timestamp.append(calendar.get(Calendar.YEAR));
  timestamp.append(("String_Node_Str"));
  timestamp.append(StringUtils.pad(calendar.get(Calendar.MONTH) + 1));
  timestamp.append(("String_Node_Str"));
  timestamp.append(StringUtils.pad(calendar.get(Calendar.DAY_OF_MONTH)));
  timestamp.append(("String_Node_Str"));
  timestamp.append(StringUtils.pad(calendar.get(Calendar.HOUR_OF_DAY)));
  timestamp.append(("String_Node_Str"));
  timestamp.append(StringUtils.pad(calendar.get(Calendar.MINUTE)));
  timestamp.append(("String_Node_Str"));
  timestamp.append(StringUtils.pad(calendar.get(Calendar.SECOND)));
  return timestamp.toString();
}
Program: 93741
Project: 93741
Buggy source:
public void onPrepared(MediaPlayer mediaPlayer){
  mediaPlayer.start();
  StringBuilder status=new StringBuilder(getString(R.string.playing_string));
  if (!StringUtils.IsNullOrEmpty(radioDetailsToPlay.getStationName())) {
    status.append("String_Node_Str").append(radioDetailsToPlay.getStationName());
  }
  caller.updateUIForPlaying(true,status.toString());
  NotificationHelper.showNotification(getApplicationContext(),NotificationHelper.NOTIFICATION_PLAYING_ID,radioDetailsToPlay,status.toString(),status.toString());
}

Fixed version (ground truth):
public void onPrepared(MediaPlayer mediaPlayer){
  mediaPlayer.start();
  buffering=false;
  StringBuilder status=new StringBuilder(getString(R.string.playing_string));
  if (!StringUtils.IsNullOrEmpty(radioDetailsToPlay.getStationName())) {
    status.append("String_Node_Str").append(radioDetailsToPlay.getStationName());
  }
  caller.updateUIForPlaying(true,status.toString());
  NotificationHelper.showNotification(getApplicationContext(),NotificationHelper.NOTIFICATION_PLAYING_ID,radioDetailsToPlay,status.toString(),status.toString());
}
Program: 93743
Project: 93743
Buggy source:
private void play(final RadioDetails radioDetails){
  if (playerServiceBound) {
    if (playerService.alreadyPlaying()) {
      AlertDialog.Builder builder=new AlertDialog.Builder(this);
      builder.setMessage("String_Node_Str").setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialogInterface,        int i){
          Log.d(TAG,"String_Node_Str");
          playerService.stopPlaying(RadioActivity.this);
          updateUIForPlaying(true,getString(R.string.buffering_string));
          playerService.startPlaying(RadioActivity.this,radioDetails);
        }
      }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialogInterface,        int i){
        }
      }
);
      builder.create().show();
    }
 else {
      Log.d(TAG,"String_Node_Str");
      playerService.startPlaying(this,radioDetails);
      updateUIForPlaying(true,getString(R.string.buffering_string));
    }
  }
 else {
    Log.e(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
private void play(final RadioDetails radioDetails){
  if (playerServiceBound) {
    if (playerService.alreadyPlaying()) {
      AlertDialog.Builder builder=new AlertDialog.Builder(this);
      builder.setMessage("String_Node_Str").setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialogInterface,        int i){
          Log.d(TAG,"String_Node_Str");
          playerService.stopPlaying(RadioActivity.this);
          StringBuilder status=new StringBuilder(getString(R.string.buffering_string)).append("String_Node_Str").append(radioDetails.getStationName());
          updateUIForPlaying(true,status.toString());
          playerService.startPlaying(RadioActivity.this,radioDetails);
        }
      }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface dialogInterface,        int i){
        }
      }
);
      builder.create().show();
    }
 else {
      Log.d(TAG,"String_Node_Str");
      playerService.startPlaying(this,radioDetails);
      StringBuilder status=new StringBuilder(getString(R.string.buffering_string)).append("String_Node_Str").append(radioDetails.getStationName());
      updateUIForPlaying(true,status.toString());
    }
  }
 else {
    Log.e(TAG,"String_Node_Str");
  }
}
Program: 93744
Project: 93744
Buggy source:
public String getStationName(){
  return _stationName;
}

Fixed version (ground truth):
public String getStationName(){
  return StringUtils.IsNullOrEmpty(_stationName) ? "String_Node_Str" : _stationName;
}
Program: 93745
Project: 93745
Buggy source:
public void stopRecording(RadioActivity view){
  Log.d(TAG,"String_Node_Str");
  caller=view;
  RadioApplication radioApplication=(RadioApplication)this.getApplicationContext();
  RecordingTask recordingTask=radioApplication.getRecordingTask();
  recordingTask.cancel(true);
  view.setStatus("String_Node_Str");
  cancelNotification(NotificationService.PLAYING_ID);
  recordingTask=null;
  radioApplication.setRecordingTask(recordingTask);
}

Fixed version (ground truth):
public void stopRecording(RadioActivity view){
  Log.d(TAG,"String_Node_Str");
  caller=view;
  RadioApplication radioApplication=(RadioApplication)this.getApplicationContext();
  RecordingTask recordingTask=radioApplication.getRecordingTask();
  recordingTask.cancel(true);
  view.setStatus("String_Node_Str");
  cancelNotification(NotificationService.RECORDING_ID);
  recordingTask=null;
  radioApplication.setRecordingTask(recordingTask);
}
Program: 93746
Project: 93746
Buggy source:
@Override public Map<Email,Future<Void>> deliverPostponedMails(){
  Map<Email,Future<Void>> deliveries=new HashMap<Email,Future<Void>>();
  LOGGER.debug("String_Node_Str",deliveries.size());
  while (!this.mailQueue.isEmpty()) {
    Email nextMail=this.mailQueue.poll();
    Future<Void> sendingResult=this.asyncSend(nextMail);
    deliveries.put(nextMail,sendingResult);
  }
  return deliveries;
}

Fixed version (ground truth):
@Override public Map<Email,Future<Void>> deliverPostponedMails(){
  Map<Email,Future<Void>> deliveries=new HashMap<Email,Future<Void>>();
  LOGGER.debug("String_Node_Str",this.mailQueue.size());
  while (!this.mailQueue.isEmpty()) {
    Email nextMail=this.mailQueue.poll();
    Future<Void> sendingResult=this.asyncSend(nextMail);
    deliveries.put(nextMail,sendingResult);
  }
  return deliveries;
}
Program: 93747
Project: 93747
Buggy source:
public DefaultTemplateMail(String templateName,Freemarker freemarker,Localization localization,AsyncMailer mailer,String appLocation,Object... nameParameters) throws IOException {
  this.templateName=templateName;
  this.appLocation=appLocation;
  this.nameParameters=nameParameters;
  this.template=freemarker.use(templateName + "String_Node_Str");
  this.localization=localization;
  this.mailer=mailer;
}

Fixed version (ground truth):
public DefaultTemplateMail(String templateName,Freemarker freemarker,Localization localization,AsyncMailer mailer,String appLocation,Object... nameParameters) throws IOException {
  this.templateName=templateName;
  this.appLocation=appLocation;
  this.nameParameters=nameParameters;
  this.template=freemarker.use(templateName);
  this.localization=localization;
  this.mailer=mailer;
}
Program: 93748
Project: 93748
Buggy source:
/** 
 * Add a new world
 * @param world
 * @return if the world was added successfully
 */
private synchronized boolean addWorld(final ACWorld world){
  final String name=world.getName();
  if (name == null) {
    throw new NullPointerException();
  }
  final ACWorld ref=worlds.get(name);
  if (ref != null) {
    return false;
  }
  worlds.put(name.toUpperCase(),world);
  return true;
}

Fixed version (ground truth):
/** 
 * Add a new world
 * @param world
 * @return if the world was added successfully
 */
private synchronized boolean addWorld(final ACWorld world){
  final String name=world.getName();
  if (name == null) {
    throw new NullPointerException();
  }
  worlds.put(name.toUpperCase(),world);
  return true;
}
Program: 93749
Project: 93749
Buggy source:
@Override public void run(){
  try {
    ConfigEnum.save();
  }
 catch (  final IOException e) {
  }
}

Fixed version (ground truth):
@Override public void run(){
  SQLPlayer.initPrepStmt();
  try {
    ConfigEnum.save();
  }
 catch (  final IOException e) {
  }
}
Program: 93751
Project: 93751
Buggy source:
/** 
 * Add a new world
 * @param world
 */
private synchronized boolean addWorld(final ACWorld world){
  final String name=world.getName();
  if (name == null) {
    throw new NullPointerException();
  }
  final ACWorld ref=worlds.get(name);
  if (ref != null) {
    return false;
  }
  worlds.put(name,world);
  return true;
}

Fixed version (ground truth):
/** 
 * Add a new world
 * @param world
 * @return if the world was added successfully
 */
private synchronized boolean addWorld(final ACWorld world){
  final String name=world.getName();
  if (name == null) {
    throw new NullPointerException();
  }
  final ACWorld ref=worlds.get(name);
  if (ref != null) {
    return false;
  }
  worlds.put(name.toUpperCase(),world);
  return true;
}
Program: 93752
Project: 93752
Buggy source:
ACWorld demandACWorld(final World world){
  final String name=world.getName();
  ACWorld result=worlds.get(name);
  if (result == null) {
    result=worldFactory.createWorld(world);
    addWorld(result);
    result=worlds.get(name);
  }
  return result;
}

Fixed version (ground truth):
ACWorld demandACWorld(final World world){
  final String name=world.getName();
  ACWorld result=worlds.get(name);
  if (result == null) {
    result=worldFactory.createWorld(world);
    addWorld(result);
    result=worlds.get(name.toUpperCase());
  }
  return result;
}
Program: 93753
Project: 93753
Buggy source:
@Override public void execute(final CommandSender sender,final CommandArgs args) throws PlayerNotFound, ActionNotPermitedException {
  Player target;
  try {
    target=Users.getUser(sender,args,permNode);
  }
 catch (  final PlayerNotFound e) {
    target=Users.getUserParam(sender,args,permNode);
  }
  if (args.length == 0) {
    sender.sendMessage(ChatColor.YELLOW + "String_Node_Str");
    sender.sendMessage(ChatColor.GOLD + MaterialContainer.possibleEnchantment());
    return;
  }
  final HashMap<String,String> replace=new HashMap<String,String>();
  final MaterialContainer inHand=new MaterialContainer(target.getItemInHand());
  Give.setEnchantements(sender,args,inHand,target.equals(sender) ? 0 : 1);
  final Player finalTarget=target;
  ACPluginManager.scheduleSyncTask(new Runnable(){
    @Override public void run(){
      finalTarget.setItemInHand(inHand.getItemStack());
    }
  }
);
  replace.put("String_Node_Str",target.getItemInHand().getType().name());
  LocaleHelper.SUCCESS_ENCHANT.sendLocale(sender,replace);
  if (!sender.equals(target)) {
    LocaleHelper.SUCCESS_ENCHANT.sendLocale(target,replace);
  }
}

Fixed version (ground truth):
@Override public void execute(final CommandSender sender,final CommandArgs args) throws PlayerNotFound, ActionNotPermitedException {
  Player target;
  try {
    target=Users.getUser(sender,args,permNode);
  }
 catch (  final PlayerNotFound e) {
    target=Users.getUserParam(sender,args,permNode);
  }
  if (args.length == 0) {
    sender.sendMessage(ChatColor.YELLOW + "String_Node_Str");
    sender.sendMessage(ChatColor.GOLD + MaterialContainer.possibleEnchantment());
    return;
  }
  if (target == null) {
    return;
  }
  final HashMap<String,String> replace=new HashMap<String,String>();
  final ItemStack itemInHand=target.getItemInHand();
  if (itemInHand == null || (itemInHand != null && itemInHand.getType().equals(Material.AIR))) {
    LocaleHelper.ERROR_HOLD_ITEM.sendLocale(sender);
    return;
  }
  final MaterialContainer inHand=new MaterialContainer(itemInHand);
  Give.setEnchantements(sender,args,inHand,target.equals(sender) ? 0 : 1);
  final Player finalTarget=target;
  ACPluginManager.scheduleSyncTask(new Runnable(){
    @Override public void run(){
      finalTarget.setItemInHand(inHand.getItemStack());
    }
  }
);
  replace.put("String_Node_Str",itemInHand.getType().name());
  LocaleHelper.SUCCESS_ENCHANT.sendLocale(sender,replace);
  if (!sender.equals(target)) {
    LocaleHelper.SUCCESS_ENCHANT.sendLocale(target,replace);
  }
}
Program: 93754
Project: 93754
Buggy source:
/** 
 * @param oldFactory
 * @param newFactory
 */
public WorldConverter(final IWorldFactory oldFactory,final IWorldFactory newFactory){
  super();
  this.oldFactory=oldFactory;
  this.newFactory=newFactory;
}

Fixed version (ground truth):
/** 
 * @param oldFactory
 * @param newFactory
 */
public WorldConverter(final AbstractWorldFactory oldFactory,final AbstractWorldFactory newFactory){
  super();
  this.oldFactory=oldFactory;
  this.newFactory=newFactory;
}
Program: 93755
Project: 93755
Buggy source:
/** 
 */
public FileWorldFactory(final String directory){
  this.directory=directory;
  for (  final World w : ACPluginManager.getServer().getWorlds()) {
    bukkitWorlds.put(w.getName().toLowerCase(),w);
  }
}

Fixed version (ground truth):
/** 
 */
public FileWorldFactory(final String directory){
  this.directory=directory;
}
Program: 93756
Project: 93756
Buggy source:
/** 
 * @param oldFactory
 * @param newFactory
 * @param world
 */
public WorldConvertTask(final IWorldFactory oldFactory,final IWorldFactory newFactory,final World world){
  super();
  this.oldFactory=oldFactory;
  this.newFactory=newFactory;
  this.world=world;
}

Fixed version (ground truth):
/** 
 * @param oldFactory
 * @param newFactory
 * @param world
 */
public WorldConvertTask(final AbstractWorldFactory oldFactory,final AbstractWorldFactory newFactory,final World world){
  super();
  this.oldFactory=oldFactory;
  this.newFactory=newFactory;
  this.world=world;
}
Program: 93757
Project: 93757
Buggy source:
/** 
 * To convert the ACWorld using an another factory
 * @param factory
 */
public void convertFactory(final IWorldFactory factory){
  new WorldConverter(worldFactory,factory).convert();
  DebugLog.INSTANCE.info("String_Node_Str");
  this.worldFactory=factory;
}

Fixed version (ground truth):
/** 
 * To convert the ACWorld using an another factory
 * @param factory
 */
public void convertFactory(final AbstractWorldFactory factory){
  new WorldConverter(worldFactory,factory).convert();
  DebugLog.INSTANCE.info("String_Node_Str");
  this.worldFactory=factory;
}
Program: 93758
Project: 93758
Buggy source:
/** 
 * @param worldFactory the worldFactory to set
 */
public void setWorldFactory(final IWorldFactory worldFactory){
  if (this.worldFactory == null) {
    this.worldFactory=worldFactory;
  }
}

Fixed version (ground truth):
/** 
 * @param worldFactory the worldFactory to set
 */
public void setWorldFactory(final AbstractWorldFactory worldFactory){
  if (this.worldFactory == null) {
    this.worldFactory=worldFactory;
  }
}
Program: 93759
Project: 93759
Buggy source:
/** 
 */
public SQLWorldFactory(){
  insertWorld=Database.DATABASE.prepare("String_Node_Str");
  getWorld=Database.DATABASE.prepare("String_Node_Str");
  for (  final World w : ACPluginManager.getServer().getWorlds()) {
    bukkitWorlds.put(w.getName().toLowerCase(),w);
  }
}

Fixed version (ground truth):
/** 
 */
public SQLWorldFactory(){
  insertWorld=Database.DATABASE.prepare("String_Node_Str");
  getWorld=Database.DATABASE.prepare("String_Node_Str");
}
Program: 93760
Project: 93760
Buggy source:
private static void teleport(final Player player,final Location toLocation){
  final Object server=MinecraftReflection.getHandle(player.getServer());
  final Object entityPlayer=MinecraftReflection.getHandle(player);
  final Object toWorld=MinecraftReflection.getHandle(toLocation.getWorld());
  final int dimension=FieldUtils.getField(toWorld,"String_Node_Str");
  final Object activeContainer=FieldUtils.getField(entityPlayer,"String_Node_Str");
  final Object defaultContainer=FieldUtils.getField(entityPlayer,"String_Node_Str");
  if (player.getWorld().equals(toLocation.getWorld())) {
    MinecraftReflection.teleportPlayer(player,toLocation);
  }
 else {
    if (activeContainer != defaultContainer) {
      final MethodHandler closeInventory=new MethodHandler(entityPlayer.getClass(),"String_Node_Str");
      closeInventory.invoke(entityPlayer);
    }
    final MethodHandler moveToWorld=new MethodHandler(server.getClass(),"String_Node_Str",entityPlayer.getClass(),int.class,boolean.class,toLocation.getClass());
    moveToWorld.invoke(server,entityPlayer,dimension,true,toLocation);
  }
}

Fixed version (ground truth):
private static void teleport(final Player player,final Location toLocation){
  final Object server=MinecraftReflection.getHandle(player.getServer());
  final Object entityPlayer=MinecraftReflection.getHandle(player);
  final Object toWorld=MinecraftReflection.getHandle(toLocation.getWorld());
  if (player.getWorld().equals(toLocation.getWorld())) {
    MinecraftReflection.teleportPlayer(player,toLocation);
  }
 else {
    try {
      final Object activeContainer=FieldUtils.getField(entityPlayer,"String_Node_Str");
      final Object defaultContainer=FieldUtils.getField(entityPlayer,"String_Node_Str");
      if (activeContainer != defaultContainer) {
        final MethodHandler closeInventory=new MethodHandler(entityPlayer.getClass(),"String_Node_Str");
        closeInventory.invoke(entityPlayer);
      }
    }
 catch (    final Throwable e) {
      DebugLog.INSTANCE.log(Level.SEVERE,"String_Node_Str" + entityPlayer + "String_Node_Str"+ entityPlayer.getClass()+ "String_Node_Str",e);
    }
    final int dimension=FieldUtils.getField(toWorld,"String_Node_Str");
    final MethodHandler moveToWorld=new MethodHandler(server.getClass(),"String_Node_Str",entityPlayer.getClass(),int.class,boolean.class,toLocation.getClass());
    moveToWorld.invoke(server,entityPlayer,dimension,true,toLocation);
  }
}
Program: 93761
Project: 93761
Buggy source:
/** 
 */
public PlayerInformation(final Player p){
  final PlayerInventory inventory=p.getInventory();
  items=Arrays.copyOf(inventory.getContents(),inventory.getContents().length);
  armor=Arrays.copyOf(inventory.getArmorContents(),inventory.getArmorContents().length);
  xp=p.getExp();
  level=p.getLevel();
  System.out.println("String_Node_Str" + xp);
  System.out.println("String_Node_Str" + level);
}

Fixed version (ground truth):
/** 
 */
public PlayerInformation(final Player p){
  final PlayerInventory inventory=p.getInventory();
  items=Arrays.copyOf(inventory.getContents(),inventory.getContents().length);
  armor=Arrays.copyOf(inventory.getArmorContents(),inventory.getArmorContents().length);
  xp=p.getExp();
  level=p.getLevel();
}
Program: 93762
Project: 93762
Buggy source:
@Override public void addPermWarp(String name,Location loc,String perm){
}

Fixed version (ground truth):
@Override public void addPermWarp(final String name,final Location loc,final String perm){
}
Program: 93764
Project: 93764
Buggy source:
@EventHandler(priority=EventPriority.HIGH) public void onPlayerQuit(final PlayerQuitEvent event){
  final Player p=event.getPlayer();
  final ACPlayer player=ACPlayer.getPlayer(p);
  player.setInformation("String_Node_Str",System.currentTimeMillis());
  ACPluginManager.getScheduler().runTaskAsynchronously(ACPluginManager.getCorePlugin(),new Runnable(){
    @Override public void run(){
      final int imLvl=ACHelper.getInstance().getLimit(p,Type.Limit.IMMUNITY,"String_Node_Str");
      player.setInformation("String_Node_Str",imLvl == Integer.MAX_VALUE ? ConfigEnum.DIMMUNITY.getInt() : imLvl);
    }
  }
);
  if (ConfigEnum.JQMSG.getBoolean() && !SuperPermissions.isApiSet()) {
    final HashMap<String,String> replace=new HashMap<String,String>();
    replace.put("String_Node_Str",Utils.getPlayerName(p,null,true));
    event.setQuitMessage(Utils.I18n("String_Node_Str",replace));
  }
  if (player.hasPower(Type.FAKEQUIT)) {
    event.setQuitMessage(null);
  }
 else   if (InvisibleWorker.getInstance().hasInvisiblePowers(p)) {
    event.setQuitMessage(null);
  }
  player.setInformation("String_Node_Str",p.getGameMode());
  PlayerManager.getInstance().setOffline(player);
  ACHelper.getInstance().removeDisconnectedPlayer(p);
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGH) public void onPlayerQuit(final PlayerQuitEvent event){
  final Player p=event.getPlayer();
  final ACPlayer player=ACPlayer.getPlayer(p);
  player.setInformation("String_Node_Str",System.currentTimeMillis());
  final int imLvl=ACHelper.getInstance().getLimit(p,Type.Limit.IMMUNITY,"String_Node_Str");
  player.setInformation("String_Node_Str",imLvl == Integer.MAX_VALUE ? ConfigEnum.DIMMUNITY.getInt() : imLvl);
  if (ConfigEnum.JQMSG.getBoolean() && !SuperPermissions.isApiSet()) {
    final HashMap<String,String> replace=new HashMap<String,String>();
    replace.put("String_Node_Str",Utils.getPlayerName(p,null,true));
    event.setQuitMessage(Utils.I18n("String_Node_Str",replace));
  }
  if (player.hasPower(Type.FAKEQUIT)) {
    event.setQuitMessage(null);
  }
 else   if (InvisibleWorker.getInstance().hasInvisiblePowers(p)) {
    event.setQuitMessage(null);
  }
  player.setInformation("String_Node_Str",p.getGameMode());
  PlayerManager.getInstance().setOffline(player);
  ACHelper.getInstance().removeDisconnectedPlayer(p);
}
Program: 93765
Project: 93765
Buggy source:
@Override public void run(){
  final int imLvl=ACHelper.getInstance().getLimit(p,Type.Limit.IMMUNITY,"String_Node_Str");
  player.setInformation("String_Node_Str",imLvl == Integer.MAX_VALUE ? ConfigEnum.DIMMUNITY.getInt() : imLvl);
}

Fixed version (ground truth):
@Override public void run(){
  DebugLog.INSTANCE.info("String_Node_Str" + p.getName());
  DebugLog.INSTANCE.info("String_Node_Str");
  if (ConfigEnum.AUTO_AFK.getBoolean()) {
    AFKWorker.getInstance().updateTimeStamp(p);
  }
  DebugLog.INSTANCE.info("String_Node_Str");
  DebugLog.INSTANCE.info("String_Node_Str");
  final int imLvl=ACHelper.getInstance().getLimit(p,Type.Limit.IMMUNITY,"String_Node_Str");
  player.setInformation("String_Node_Str",imLvl == Integer.MAX_VALUE ? ConfigEnum.DIMMUNITY.getInt() : imLvl);
  DebugLog.INSTANCE.info("String_Node_Str");
  DebugLog.INSTANCE.info("String_Node_Str");
  if (player.hasPower(Type.SPYMSG)) {
    ACHelper.getInstance().addSpy(p);
  }
  DebugLog.INSTANCE.info("String_Node_Str");
  DebugLog.INSTANCE.info("String_Node_Str");
  final long lastConn=player.getInformation("String_Node_Str").getLong(0);
  player.setInformation("String_Node_Str",System.currentTimeMillis());
  DebugLog.INSTANCE.info("String_Node_Str");
  DebugLog.INSTANCE.info("String_Node_Str");
  final long modifTime=TextLocale.NEWS.getModifTime();
  if (ConfigEnum.NEWS.getBoolean() && (modifTime == 0 || lastConn <= modifTime)) {
    Utils.sParsedLocale(p,"String_Node_Str");
  }
  DebugLog.INSTANCE.info("String_Node_Str");
  DebugLog.INSTANCE.info("String_Node_Str");
  if (ConfigEnum.RULES.getBoolean() && !ConfigEnum.FJ_RULES.getBoolean()) {
    Utils.sParsedLocale(p,"String_Node_Str");
  }
  DebugLog.INSTANCE.info("String_Node_Str");
  DebugLog.INSTANCE.info("String_Node_Str");
  if (ConfigEnum.TPREQUEST.getBoolean() && !player.hasPower(Type.TP_REQUEST) && PermissionManager.hasPerm(p,"String_Node_Str",false)) {
    player.setPower(Type.TP_REQUEST);
  }
  DebugLog.INSTANCE.info("String_Node_Str");
}
Program: 93766
Project: 93766
Buggy source:
@Override public String getPermissionLimit(final Player p,final String limit){
  String result=null;
  if (mChat) {
    result=Reader.getInfo(p.getName(),InfoType.USER,p.getWorld().getName(),"String_Node_Str" + limit);
  }
  if (result == null || (result != null && result.isEmpty())) {
    final Pattern regex=Pattern.compile("String_Node_Str" + limit.toLowerCase() + "String_Node_Str");
    Set<PermissionAttachmentInfo> permissions=null;
    if (ACHelper.isMainThread()) {
      permissions=p.getEffectivePermissions();
    }
 else {
      final Callable<Set<PermissionAttachmentInfo>> perms=new Callable<Set<PermissionAttachmentInfo>>(){
        @Override public Set<PermissionAttachmentInfo> call() throws Exception {
          return p.getEffectivePermissions();
        }
      }
;
      final Future<Set<PermissionAttachmentInfo>> permTask=ACPluginManager.getScheduler().callSyncMethod(ACPluginManager.getCorePlugin(),perms);
      try {
        permissions=permTask.get();
        DebugLog.INSTANCE.info("String_Node_Str" + p.getName());
      }
 catch (      final InterruptedException e) {
        DebugLog.INSTANCE.info("String_Node_Str" + p.getName());
      }
catch (      final ExecutionException e) {
        DebugLog.INSTANCE.info("String_Node_Str" + p.getName());
      }
    }
    return permissionCheck(permissions,regex);
  }
 else {
    return result;
  }
}

Fixed version (ground truth):
@Override public String getPermissionLimit(final Player p,final String limit){
  String result=null;
  if (mChat) {
    result=Reader.getInfo(p.getName(),InfoType.USER,p.getWorld().getName(),"String_Node_Str" + limit);
  }
  if (result == null || (result != null && result.isEmpty())) {
    final Pattern regex=Pattern.compile("String_Node_Str" + limit.toLowerCase() + "String_Node_Str");
    Set<PermissionAttachmentInfo> permissions=null;
    if (ACHelper.isMainThread()) {
      permissions=p.getEffectivePermissions();
    }
 else {
      final Callable<Set<PermissionAttachmentInfo>> perms=new Callable<Set<PermissionAttachmentInfo>>(){
        @Override public Set<PermissionAttachmentInfo> call() throws Exception {
          return p.getEffectivePermissions();
        }
      }
;
      final Future<Set<PermissionAttachmentInfo>> permTask=ACPluginManager.getScheduler().callSyncMethod(ACPluginManager.getCorePlugin(),perms);
      try {
        permissions=permTask.get();
        DebugLog.INSTANCE.info("String_Node_Str" + p.getName());
      }
 catch (      final InterruptedException e) {
        DebugLog.INSTANCE.info("String_Node_Str" + p.getName());
      }
catch (      final ExecutionException e) {
        DebugLog.INSTANCE.info("String_Node_Str" + p.getName());
      }
catch (      final CancellationException e) {
        DebugLog.INSTANCE.info("String_Node_Str" + p.getName());
      }
    }
    return permissionCheck(permissions,regex);
  }
 else {
    return result;
  }
}
Program: 93768
Project: 93768
Buggy source:
public static Location buildLocation(final ConfigurationSection section,final ACWorld world) throws Exception {
}

Fixed version (ground truth):
public static Location buildLocation(final ConfigurationSection section,final ACWorld world){
}
Program: 93769
Project: 93769
Buggy source:
public static boolean importESHomes(final ExtendedConfiguration userFile,final String playerName){
  Set<String> nodeList;
  ConfigurationSection home=null, homes=null;
  Location homeLoc=null;
  if (userFile == null) {
    ACLogger.info("String_Node_Str" + playerName);
    return false;
  }
  homes=userFile.getConfigurationSection("String_Node_Str");
  if (homes != null) {
    nodeList=homes.getKeys(false);
    for (    final String name : nodeList) {
      home=homes.getConfigurationSection(name);
      final ACWorld w=ACWorld.getWorld(home.getString("String_Node_Str"));
      try {
        homeLoc=buildLocation(home,w);
      }
 catch (      final Exception e) {
        ACLogger.info("String_Node_Str" + playerName);
        DebugLog.INSTANCE.log(Level.WARNING,"String_Node_Str" + playerName,e);
        return false;
      }
      ACPlayer.getPlayer(playerName).setHome(name,homeLoc);
    }
  }
 else {
    ACLogger.info("String_Node_Str" + playerName);
    return false;
  }
  return true;
}

Fixed version (ground truth):
public static boolean importESHomes(final ExtendedConfiguration userFile,final String playerName){
  Set<String> nodeList;
  ConfigurationSection home=null, homes=null;
  Location homeLoc=null;
  if (userFile == null) {
    ACLogger.info("String_Node_Str" + playerName);
    return false;
  }
  homes=userFile.getConfigurationSection("String_Node_Str");
  if (homes != null) {
    nodeList=homes.getKeys(false);
    for (    final String name : nodeList) {
      home=homes.getConfigurationSection(name);
      final ACWorld w=ACWorld.getWorld(home.getString("String_Node_Str"));
      try {
        homeLoc=buildLocation(home,w);
      }
 catch (      final Exception e) {
        ACLogger.info("String_Node_Str" + playerName);
        DebugLog.INSTANCE.log(Level.WARNING,"String_Node_Str" + playerName,e);
        return false;
      }
      ACPlayer.getPlayer(playerName).setHome(name,homeLoc);
    }
  }
 else {
    if (ConfigEnum.VERBOSE.getBoolean()) {
      ACLogger.info("String_Node_Str" + playerName + "String_Node_Str");
    }
    return false;
  }
  return false;
}
Program: 93773
Project: 93773
Buggy source:
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onCreatureSpawn(final CreatureSpawnEvent event){
  final Entity e=event.getEntity();
  if (e instanceof HumanEntity)   return;
  final World world=e.getWorld();
  final ACWorld acWorld=ACWorld.getWorld(world.getName());
  final List<LivingEntity> livEntities=world.getLivingEntities();
  Integer limit=acWorld.getInformation(Type.MOB_LIMIT.toString()).getInt(-1);
  if (limit != -1) {
    if ((livEntities.size() - world.getPlayers().size()) >= limit)     event.setCancelled(true);
  }
  if (!event.isCancelled()) {
    final Class<? extends Entity> entityClass=e.getClass();
    final String entityName=entityClass.getSimpleName();
    limit=acWorld.getMobLimit(entityName);
    if (limit == -1)     return;
    final int count=world.getEntitiesByClass(entityClass).size();
    if (count >= limit)     event.setCancelled(true);
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void onCreatureSpawn(final CreatureSpawnEvent event){
  final Entity e=event.getEntity();
  if (e instanceof HumanEntity)   return;
  final World world=e.getWorld();
  final ACWorld acWorld;
  try {
    acWorld=ACWorld.getWorld(world.getName());
  }
 catch (  final WorldNotLoaded e2) {
    return;
  }
  final List<LivingEntity> livEntities=world.getLivingEntities();
  Integer limit=acWorld.getInformation(Type.MOB_LIMIT.toString()).getInt(-1);
  if (limit != -1) {
    if ((livEntities.size() - world.getPlayers().size()) >= limit)     event.setCancelled(true);
  }
  if (!event.isCancelled()) {
    final Class<? extends Entity> entityClass=e.getClass();
    final String entityName=entityClass.getSimpleName();
    limit=acWorld.getMobLimit(entityName);
    if (limit == -1)     return;
    final int count=world.getEntitiesByClass(entityClass).size();
    if (count >= limit)     event.setCancelled(true);
  }
}
Program: 93774
Project: 93774
Buggy source:
@EventHandler(priority=EventPriority.LOWEST) public void onPlayerLogin(final PlayerLoginEvent event){
  if (!event.getResult().equals(Result.ALLOWED))   return;
  Ban player=ACHelper.getInstance().getBan(event.getPlayer().getName());
  if (player != null)   event.disallow(Result.KICK_BANNED,player.getReason());
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.LOWEST) public void onPlayerLogin(final PlayerLoginEvent event){
  if (!event.getResult().equals(Result.ALLOWED))   return;
  Ban player=ACHelper.getInstance().getBan(event.getPlayer().getName());
  if (player == null)   player=ACHelper.getInstance().getBan(event.getAddress().toString().substring(1));
  if (player != null)   event.disallow(Result.KICK_BANNED,player.getReason());
}
Program: 93776
Project: 93776
Buggy source:
@Override public boolean argsCheck(final String... args){
  return args.length >= 1;
}

Fixed version (ground truth):
@Override public boolean argsCheck(final String... args){
  return args != null && args.length >= 1;
}
Program: 93778
Project: 93778
Buggy source:
/** 
 * Translate the id or name to a material
 * @param mat
 * @return Material
 */
public static MaterialContainer checkMaterial(final String mat){
  MaterialContainer mc=new MaterialContainer();
  try {
    if (oddItem != null) {
      final ItemStack is=OddItem.getItemStack(mat);
      if (is != null) {
        return new MaterialContainer(is);
      }
    }
  }
 catch (  final Exception e) {
  }
  String[] info=new String[2];
  if (mat.contains("String_Node_Str")) {
    info=mat.split("String_Node_Str");
    mc=new MaterialContainer(info[0],info[1]);
  }
 else {
    info[0]=mat;
    info[1]="String_Node_Str";
    if ((mc=ACHelper.getInstance().getAlias(info[0])) == null) {
      mc=new MaterialContainer(info[0],info[1]);
    }
  }
  return mc;
}

Fixed version (ground truth):
/** 
 * Translate the id or name to a material
 * @param mat
 * @return Material
 * @throws InvalidInputException if the input is invalid
 */
public static MaterialContainer checkMaterial(final String mat) throws InvalidInputException {
  MaterialContainer mc=new MaterialContainer();
  try {
    if (oddItem != null) {
      final ItemStack is=OddItem.getItemStack(mat);
      if (is != null) {
        return new MaterialContainer(is);
      }
    }
  }
 catch (  final Exception e) {
  }
  String[] info=new String[2];
  if (mat.contains("String_Node_Str")) {
    info=mat.split("String_Node_Str");
    if (info.length < 2)     throw new InvalidInputException(mat);
    mc=new MaterialContainer(info[0],info[1]);
  }
 else {
    info[0]=mat;
    info[1]="String_Node_Str";
    if ((mc=ACHelper.getInstance().getAlias(info[0])) == null) {
      mc=new MaterialContainer(info[0],info[1]);
    }
  }
  return mc;
}
Program: 93779
Project: 93779
Buggy source:
/** 
 * Translate the id or name to a material
 * @param mat
 * @return Material
 */
public MaterialContainer checkMaterial(final CommandSender sender,final String mat){
  final MaterialContainer m=Utils.checkMaterial(mat);
  if (m.isNull()) {
    final HashMap<String,String> replace=new HashMap<String,String>();
    replace.put("String_Node_Str",mat);
    Utils.sI18n(sender,"String_Node_Str",replace);
  }
  return m;
}

Fixed version (ground truth):
/** 
 * Translate the id or name to a material
 * @param mat
 * @return Material
 */
public MaterialContainer checkMaterial(final CommandSender sender,final String mat){
  MaterialContainer m=null;
  try {
    m=Utils.checkMaterial(mat);
  }
 catch (  final InvalidInputException e) {
    final HashMap<String,String> replace=new HashMap<String,String>();
    replace.put("String_Node_Str",mat);
    Utils.sI18n(sender,"String_Node_Str",replace);
    return null;
  }
  if (m.isNull()) {
    final HashMap<String,String> replace=new HashMap<String,String>();
    replace.put("String_Node_Str",mat);
    Utils.sI18n(sender,"String_Node_Str",replace);
  }
  return m;
}