nus-yam/ex-repair huggingface dataset:
Program: 45391
Project: 45391
Buggy source:
@Override public void execute() throws MojoExecutionException, MojoFailureException {
  if (sourceKeystore == null) {
    sourceKeystore=keystore;
    sourceStorepass=storepass;
  }
  try {
    importer=CertificateImporter.openOrCreate(sourceKeystore,sourceStorepass.toCharArray());
  }
 catch (  SSLToolsException e) {
    throw new MojoExecutionException("String_Node_Str" + e.getMessage(),e);
  }
  Map<String,SSLToolsException> errors=new LinkedHashMap<String,SSLToolsException>();
  if (importServers != null) {
    String[] servers=importServers.split("String_Node_Str");
    importAll(Arrays.asList(servers),errors);
  }
  if (servers != null) {
    importAll(servers,errors);
  }
  if (importServers == null && servers == null) {
    importProjectCerts(errors);
  }
  if (importer != null && importer.isChanged()) {
    try {
      importer.save(keystore,storepass.toCharArray());
    }
 catch (    SSLToolsException e) {
      throw new MojoExecutionException("String_Node_Str" + e.getMessage(),e);
    }
  }
  if (!errors.isEmpty()) {
    if (stopOnFailure) {
      throw new SSLToolsMojoException(errors);
    }
 else {
      getLog().info(SSLToolsMojoException.formatSummary(errors));
    }
  }
}

Fixed version (ground truth):
@Override public void execute() throws MojoExecutionException, MojoFailureException {
  if (sourceKeystore == null) {
    sourceKeystore=keystore;
  }
  if (sourceStorepass == null) {
    sourceStorepass=storepass;
  }
  try {
    importer=CertificateImporter.openOrCreate(sourceKeystore,sourceStorepass.toCharArray());
  }
 catch (  SSLToolsException e) {
    throw new MojoExecutionException("String_Node_Str" + e.getMessage(),e);
  }
  Map<String,SSLToolsException> errors=new LinkedHashMap<String,SSLToolsException>();
  Set<String> seen=new HashSet<String>();
  if (importServers != null) {
    String[] servers=importServers.split("String_Node_Str");
    importAll(Arrays.asList(servers),seen,errors);
  }
  if (servers != null) {
    importAll(servers,seen,errors);
  }
  if (importServers == null && servers == null) {
    importProjectCerts(seen,errors);
  }
  if (importer != null && importer.isChanged()) {
    try {
      importer.save(keystore,storepass.toCharArray());
    }
 catch (    SSLToolsException e) {
      throw new MojoExecutionException("String_Node_Str" + e.getMessage(),e);
    }
  }
  if (!errors.isEmpty()) {
    if (stopOnFailure) {
      throw new SSLToolsMojoException(errors);
    }
 else {
      getLog().info(SSLToolsMojoException.formatSummary(errors));
    }
  }
}
Program: 45392
Project: 45392
Buggy source:
private void importRepos(List<Repository> repos,MirrorSelector mirrorSelector,Map<String,SSLToolsException> errors){
  if (repos != null) {
    for (    Repository repo : repos) {
      String url=repo.getUrl();
      if (mirrorSelector != null) {
        RemoteRepository mirror=mirrorSelector.getMirror(new RemoteRepository(repo.getId(),repo.getLayout(),url));
        if (mirror != null) {
          url=mirror.getUrl();
        }
      }
      importCerts(url,errors);
    }
  }
}

Fixed version (ground truth):
private void importRepos(List<Repository> repos,MirrorSelector mirrorSelector,Set<String> seen,Map<String,SSLToolsException> errors){
  if (repos != null) {
    for (    Repository repo : repos) {
      String url=repo.getUrl();
      if (mirrorSelector != null) {
        RemoteRepository mirror=mirrorSelector.getMirror(new RemoteRepository(repo.getId(),repo.getLayout(),url));
        if (mirror != null) {
          url=mirror.getUrl();
        }
      }
      importCerts(url,seen,errors);
    }
  }
}
Program: 45393
Project: 45393
Buggy source:
private void importAll(Iterable<String> servers,Map<String,SSLToolsException> errors){
  for (  String server : servers) {
    String host=server;
    int port=-1;
    int idx=server.indexOf("String_Node_Str");
    if (idx > 0) {
      host=server.substring(0,idx);
      port=Integer.parseInt(server.substring(idx + 1));
    }
    try {
      importer.importServerCertificates(host,port,sourceKeystore,sourceStorepass.toCharArray(),keystore,storepass.toCharArray());
    }
 catch (    SSLToolsException e) {
      errors.put(server,e);
    }
  }
}

Fixed version (ground truth):
private void importAll(Iterable<String> servers,Set<String> seen,Map<String,SSLToolsException> errors){
  for (  String server : servers) {
    if (seen.contains(server)) {
      continue;
    }
    seen.add(server);
    String host=server;
    int port=-1;
    int idx=server.indexOf("String_Node_Str");
    if (idx > 0) {
      host=server.substring(0,idx);
      port=Integer.parseInt(server.substring(idx + 1));
    }
    try {
      importer.importServerCertificates(host,port,sourceKeystore,sourceStorepass.toCharArray(),keystore,storepass.toCharArray());
    }
 catch (    SSLToolsException e) {
      errors.put(server,e);
    }
  }
}
Program: 45394
Project: 45394
Buggy source:
@Override public String toString(){
  return String.format("String_Node_Str",id,firstName,lastName);
}

Fixed version (ground truth):
@Override public String toString(){
  return String.format("String_Node_Str",getId(),getName());
}
Program: 45395
Project: 45395
Buggy source:
@GET @Produces(APPLICATION_XML) public String getAllUsers_Xml(){
  final StringBuffer buf=new StringBuffer();
  final ListIterator<User> iter=users.listIterator();
  while (iter.hasNext()) {
    if (!iter.hasPrevious()) {
      buf.append("String_Node_Str");
    }
    buf.append(iter.next().toXml());
    if (!iter.hasNext()) {
      buf.append("String_Node_Str");
    }
  }
  return buf.toString();
}

Fixed version (ground truth):
@GET @Produces(APPLICATION_XML) public List<User> getAllUsers_Xml(){
  return users;
}
Program: 45396
Project: 45396
Buggy source:
@Override public void onEnable(){
  PluginDescriptionFile pdfFile=this.getDescription();
  File worldsYml=new File(getDataFolder() + "String_Node_Str");
  File mainYml=new File(getDataFolder() + "String_Node_Str");
  setupFile(worldsYml);
  setupFile(mainYml);
  if (!setupDependencies())   this.getServer().getPluginManager().disablePlugin(this);
  wConfig=new Configuration(worldsYml);
  wConfig.load();
  mConfig=getConfiguration();
  List<World> worlds=getServer().getWorlds();
  for (  World world : worlds)   setupWorld(world.getName());
  PluginManager pm=getServer().getPluginManager();
  pm.registerEvent(Event.Type.WORLD_LOAD,worldLoadListener,Priority.Monitor,this);
  pm.registerEvent(Event.Type.CUSTOM_EVENT,combatListener,Priority.Monitor,this);
  log.info(plugName + "String_Node_Str" + pdfFile.getVersion()+ "String_Node_Str");
}

Fixed version (ground truth):
@Override public void onEnable(){
  PluginDescriptionFile pdfFile=this.getDescription();
  File worldsYml=new File(getDataFolder() + "String_Node_Str");
  File mainYml=new File(getDataFolder() + "String_Node_Str");
  setupFile(worldsYml);
  setupFile(mainYml);
  wConfig=new Configuration(worldsYml);
  wConfig.load();
  mConfig=getConfiguration();
  List<World> worlds=getServer().getWorlds();
  for (  World world : worlds)   setupWorld(world.getName());
  PluginManager pm=getServer().getPluginManager();
  pm.registerEvent(Event.Type.WORLD_LOAD,worldLoadListener,Priority.Monitor,this);
  pm.registerEvent(Event.Type.CUSTOM_EVENT,combatListener,Priority.Monitor,this);
  log.info(plugName + "String_Node_Str" + pdfFile.getVersion()+ "String_Node_Str");
}
Program: 45397
Project: 45397
Buggy source:
public void onEntityDeath(EntityDeathEvent event){
  if (KKKreditzHandler.isValidHandler() || !isValidEntity(event.getEntity()))   return;
  LivingEntity cEntity=(LivingEntity)event.getEntity();
  if (entityMap.containsKey(cEntity)) {
    Player player=entityMap.remove(cEntity);
    if (player == null)     return;
 else {
      CreatureType cType=getCType(cEntity);
      if (!KKPermissions.reward(player,cType.getName()))       return;
      KKWorldConfig conf=KillaKreditz.worldConfig.get(player.getWorld().getName());
      if (conf.get(cType) == null)       return;
 else {
        double reward=getReward(conf.getMinReward(cType),conf.getMaxReward(cType),conf.getChance(cType)) * KKPermissions.multiplier(player);
        if (reward == 0)         return;
 else {
          KKKreditzHandler.rewardPlayer(player.getName(),reward);
          player.sendMessage("String_Node_Str" + KKKreditzHandler.formatCurrency(reward) + "String_Node_Str"+ cType.getName());
        }
      }
    }
  }
}

Fixed version (ground truth):
public void onEntityDeath(EntityDeathEvent event){
  if (KKKreditzHandler.isValidHandler() || !isValidEntity(event.getEntity()))   return;
  LivingEntity cEntity=(LivingEntity)event.getEntity();
  if (entityMap.containsKey(cEntity)) {
    Player player=entityMap.remove(cEntity);
    if (player == null)     return;
 else {
      CreatureType cType=getCType(cEntity);
      if (!KKPermissions.reward(player,cType.getName().toLowerCase()))       return;
      KKWorldConfig conf=KillaKreditz.worldConfig.get(player.getWorld().getName());
      if (conf.get(cType) == null)       return;
 else {
        double reward=getReward(conf.getMinReward(cType),conf.getMaxReward(cType),conf.getChance(cType)) * KKPermissions.multiplier(player);
        if (reward == 0)         return;
 else {
          KKKreditzHandler.rewardPlayer(player.getName(),reward);
          player.sendMessage("String_Node_Str" + KKKreditzHandler.formatCurrency(reward) + "String_Node_Str"+ cType.getName());
        }
      }
    }
  }
}
Program: 45399
Project: 45399
Buggy source:
public boolean isStationary(int duration){
  boolean result=false;
  double accelerometerActivityLevel=9.1;
  if ((accelerometerActivityLevel > SensorConstants.MIN_ACCELEROMETER_STATIONARY_LEVEL && accelerometerActivityLevel < SensorConstants.MAX_ACCELEROMETER_STATIONARY_LEVEL) && isLocationChanged(duration)) {
    result=true;
  }
  return result;
}

Fixed version (ground truth):
public boolean isStationary(int duration){
  boolean result=false;
  double accelerometerActivityLevel=checkAccelerometerActivityLevel(duration);
  if ((accelerometerActivityLevel > SensorConstants.MIN_ACCELEROMETER_STATIONARY_LEVEL && accelerometerActivityLevel < SensorConstants.MAX_ACCELEROMETER_STATIONARY_LEVEL) && !isLocationChanged(duration)) {
    result=true;
  }
  return result;
}
Program: 45400
Project: 45400
Buggy source:
public GeoLocationLogger(){
  super();
  this.locationManager=(LocationManager)AndSensor.getContext().getSystemService(android.content.Context.LOCATION_SERVICE);
  this.locationSensor=LocationManager.GPS_PROVIDER;
  setDelayBetweenLogging(60 * 1000);
}

Fixed version (ground truth):
public GeoLocationLogger(){
  super();
  this.locationManager=(LocationManager)AndSensor.getContext().getSystemService(android.content.Context.LOCATION_SERVICE);
  this.locationSensor=LocationManager.NETWORK_PROVIDER;
  setDelayBetweenLogging(5000);
}
Program: 45401
Project: 45401
Buggy source:
public void onClick(DialogInterface dialog,int which){
  tracker.trackEvent("String_Node_Str",resorts[which],"String_Node_Str",0);
  app_title=getString(R.string.app_name) + "String_Node_Str" + resorts[which];
  try {
switch (which) {
case 0:
      Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
    load_mtbuller();
  break;
case 1:
Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
load_mthotham();
break;
case 2:
Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
load_fallscreek();
break;
case 3:
Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
load_bawbaw();
break;
case 4:
Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
load_perisher();
break;
case 5:
Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
load_thredbo();
break;
case 6:
Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
load_selwyn();
case 7:
Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
load_charlotte();
break;
case 8:
Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
load_lakemountain();
break;
}
}
 catch (IOException e) {
e.printStackTrace();
}
MainPhone.this.setTitle(app_title);
}

Fixed version (ground truth):
public void onClick(DialogInterface dialog,int which){
  tracker.trackEvent("String_Node_Str",resorts[which],"String_Node_Str",0);
  app_title=getString(R.string.app_name) + "String_Node_Str" + resorts[which];
  try {
switch (which) {
case 0:
      Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
    load_mtbuller();
  break;
case 1:
Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
load_mthotham();
break;
case 2:
Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
load_fallscreek();
break;
case 3:
Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
load_bawbaw();
break;
case 4:
Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
load_perisher();
break;
case 5:
Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
load_thredbo();
break;
case 6:
Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
load_selwyn();
break;
case 7:
Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
load_charlotte();
break;
case 8:
Utils.WriteSettings(MainPhone.this,"String_Node_Str","String_Node_Str");
load_lakemountain();
break;
}
}
 catch (IOException e) {
e.printStackTrace();
}
MainPhone.this.setTitle(app_title);
}
Program: 45403
Project: 45403
Buggy source:
public void onPlayerQuit(PlayerQuitEvent event){
  Player p=event.getPlayer();
  unregisterPlayerVotes(p);
}

Fixed version (ground truth):
public void onPlayerQuit(PlayerQuitEvent event){
}
Program: 45404
Project: 45404
Buggy source:
public void sync(World world,Server s){
  if (!this.yes.isEmpty()) {
    for (    Player item : this.yes) {
      if (!this.all.contains(item)) {
        this.yes.remove(item);
      }
 else {
      }
    }
  }
  if (!this.no.isEmpty()) {
    for (    Player item : this.no) {
      if (!this.all.contains(item)) {
        this.no.remove(item);
      }
 else {
      }
    }
  }
}

Fixed version (ground truth):
public void sync(World world,Server s){
  List<Player> delthis=s.matchPlayer("String_Node_Str");
  delthis.clear();
  if (!this.yes.isEmpty()) {
    for (    Player item : this.yes) {
      if (!this.all.contains(item)) {
        delthis.add(item);
      }
    }
    for (    Player item : delthis) {
      this.yes.remove(item);
    }
    delthis.clear();
  }
  if (!this.no.isEmpty()) {
    for (    Player item : this.no) {
      if (!this.all.contains(item)) {
        delthis.add(item);
      }
 else {
      }
    }
    for (    Player item : delthis) {
      this.no.remove(item);
    }
    delthis.clear();
  }
}
Program: 45405
Project: 45405
Buggy source:
@Override protected void onNewIntent(final Intent intent){
  super.onNewIntent(intent);
  ShoppingListItem shoppingListItem=(ShoppingListItem)intent.getParcelableExtra("String_Node_Str");
  if (shoppingListItem != null) {
    toaster("String_Node_Str" + shoppingListItem.toString());
    items.add(shoppingListItem);
    onContentChanged();
  }
 else {
  }
}

Fixed version (ground truth):
@Override protected void onNewIntent(final Intent intent){
  ShoppingListItem shoppingListItem=(ShoppingListItem)intent.getParcelableExtra("String_Node_Str");
  if (shoppingListItem != null) {
    toaster("String_Node_Str" + shoppingListItem.toString());
    myListAdapter.addItem(shoppingListItem);
  }
 else {
  }
}
Program: 45406
Project: 45406
Buggy source:
private void configureList(){
  LayoutInflater inflater=(LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);
  if (inflater != null) {
    ListView.FixedViewInfo fvi=getListView().new FixedViewInfo();
    fvi.data=null;
    fvi.isSelectable=false;
    fvi.view=inflater.inflate(R.layout.shopping_list_header,null);
    ArrayList<ListView.FixedViewInfo> footers=new ArrayList<ListView.FixedViewInfo>();
    ArrayList<ListView.FixedViewInfo> headers=new ArrayList<ListView.FixedViewInfo>();
    headers.add(fvi);
    adapter=new HeaderViewListAdapter(headers,footers,new MyListAdapter(items,ShoppingListActivity.this));
  }
 else {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    adapter=new MyListAdapter(items,ShoppingListActivity.this);
  }
  setListAdapter(adapter);
  ListView listView=getListView();
  listView.setTextFilterEnabled(true);
  listView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    final AdapterView<?> adapterView,    final View view,    final int i,    final long l){
      Toast.makeText(getApplicationContext(),adapter.getItem(i).toString(),Toast.LENGTH_SHORT).show();
    }
  }
);
}

Fixed version (ground truth):
private void configureList(){
  LayoutInflater inflater=(LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);
  myListAdapter=new MyListAdapter(items,ShoppingListActivity.this);
  if (inflater != null) {
    ListView.FixedViewInfo fvi=getListView().new FixedViewInfo();
    fvi.data=null;
    fvi.isSelectable=false;
    fvi.view=inflater.inflate(R.layout.shopping_list_header,null);
    ArrayList<ListView.FixedViewInfo> footers=new ArrayList<ListView.FixedViewInfo>();
    ArrayList<ListView.FixedViewInfo> headers=new ArrayList<ListView.FixedViewInfo>();
    headers.add(fvi);
    adapter=new HeaderViewListAdapter(headers,footers,myListAdapter);
  }
 else {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    adapter=myListAdapter;
  }
  setListAdapter(adapter);
  ListView listView=getListView();
  listView.setTextFilterEnabled(true);
  listView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    final AdapterView<?> adapterView,    final View view,    final int i,    final long l){
      Toast.makeText(getApplicationContext(),adapter.getItem(i).toString(),Toast.LENGTH_SHORT).show();
    }
  }
);
}
Program: 45407
Project: 45407
Buggy source:
@Override protected void onNewIntent(final Intent intent){
  super.onNewIntent(intent);
  toaster("String_Node_Str" + intent.getStringExtra("String_Node_Str"));
}

Fixed version (ground truth):
@Override protected void onNewIntent(final Intent intent){
  super.onNewIntent(intent);
  ShoppingListItem shoppingListItem=(ShoppingListItem)intent.getParcelableExtra("String_Node_Str");
  toaster("String_Node_Str" + shoppingListItem.toString());
}
Program: 45408
Project: 45408
Buggy source:
private boolean toaster(String message){
  Toast.makeText(this,message,Toast.LENGTH_SHORT).show();
  return true;
}

Fixed version (ground truth):
private boolean toaster(String message){
  Toast.makeText(this,message,Toast.LENGTH_LONG).show();
  return true;
}
Program: 45409
Project: 45409
Buggy source:
@Override protected void onCreate(final Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.shopping_list_item);
  final ShoppingListItem shoppingListItem=new ShoppingListItem();
  List<String> items=new ArrayList<String>();
  items.add("String_Node_Str");
  items.add("String_Node_Str");
  items.add("String_Node_Str");
  items.add("String_Node_Str");
  items.add("String_Node_Str");
  ArrayAdapter<String> itemsAdapter=new ArrayAdapter<String>(ShoppingListItemActivity.this,android.R.layout.simple_dropdown_item_1line,items);
  AutoCompleteTextView itemNameACTV=(AutoCompleteTextView)findViewById(R.id.shopping_list_item_actv);
  itemNameACTV.setAdapter(itemsAdapter);
  itemNameACTV.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(){
    @Override public void onItemSelected(    final AdapterView<?> adapterView,    final View view,    final int i,    final long l){
      shoppingListItem.name=(String)adapterView.getItemAtPosition(i);
    }
    @Override public void onNothingSelected(    final AdapterView<?> adapterView){
    }
  }
);
  Button button=(Button)findViewById(R.id.shopping_list_item_add_button);
  button.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    final View view){
      EditText quantityText=(EditText)findViewById(R.id.shopping_list_item_qty_editText);
      shoppingListItem.quantity=Integer.parseInt(quantityText.getText().toString());
      EditText costText=(EditText)findViewById(R.id.shopping_list_item_cost_editText);
      shoppingListItem.cost=Float.parseFloat(costText.getText().toString());
      CheckBox saveItemCheckBox=(CheckBox)findViewById(R.id.shopping_list_item_save_item);
      shoppingListItem.save=saveItemCheckBox.isChecked();
      finish();
      Intent intent=new Intent(ShoppingListItemActivity.this,ShoppingListActivity.class);
      intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
      Bundle bundle=new Bundle();
      bundle.putString("String_Node_Str",shoppingListItem.name);
      bundle.putFloat("String_Node_Str",shoppingListItem.cost);
      bundle.putFloat("String_Node_Str",shoppingListItem.quantity);
      bundle.putBoolean("String_Node_Str",shoppingListItem.save);
      intent.putExtras(bundle);
      startActivity(intent);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(final Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.shopping_list_item);
  final ShoppingListItem shoppingListItem=new ShoppingListItem();
  final AutoCompleteTextView itemNameACTV=createItemNameDropDown();
  createAddButton(shoppingListItem,itemNameACTV);
}
Program: 45410
Project: 45410
Buggy source:
@Override public void onClick(final View view){
  EditText quantityText=(EditText)findViewById(R.id.shopping_list_item_qty_editText);
  shoppingListItem.quantity=Integer.parseInt(quantityText.getText().toString());
  EditText costText=(EditText)findViewById(R.id.shopping_list_item_cost_editText);
  shoppingListItem.cost=Float.parseFloat(costText.getText().toString());
  CheckBox saveItemCheckBox=(CheckBox)findViewById(R.id.shopping_list_item_save_item);
  shoppingListItem.save=saveItemCheckBox.isChecked();
  finish();
  Intent intent=new Intent(ShoppingListItemActivity.this,ShoppingListActivity.class);
  intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  Bundle bundle=new Bundle();
  bundle.putString("String_Node_Str",shoppingListItem.name);
  bundle.putFloat("String_Node_Str",shoppingListItem.cost);
  bundle.putFloat("String_Node_Str",shoppingListItem.quantity);
  bundle.putBoolean("String_Node_Str",shoppingListItem.save);
  intent.putExtras(bundle);
  startActivity(intent);
}

Fixed version (ground truth):
@Override public void onClick(final View view){
  shoppingListItem.quantity=Integer.parseInt(editTextDataRetriever.getText(ShoppingListItemActivity.this,R.id.shopping_list_item_qty_editText));
  shoppingListItem.cost=Float.parseFloat(editTextDataRetriever.getText(ShoppingListItemActivity.this,R.id.shopping_list_item_cost_editText));
  shoppingListItem.save=editTextDataRetriever.<CheckBox>findView(ShoppingListItemActivity.this,R.id.shopping_list_item_save_item).isChecked();
  shoppingListItem.name=itemNameACTV.getEditableText().toString();
  startShoppingListActivity(shoppingListItem);
}
Program: 45413
Project: 45413
Buggy source:
private void analyzeClan(){
  try {
    findMembers(clan);
  }
 catch (  Throwable t) {
    log.error("String_Node_Str" + clan.getName() + "String_Node_Str"+ t.getMessage(),t);
  }
  for (  ClanMember clanMember : clan.getClanMembers()) {
    parseMemberDetails(clanMember);
  }
  Battle battle=new Battle();
  battle.setProvince(landingZone.getName());
  clan.getConcurrentBattles().add(battle);
  clanCache.put(clan.getName(),clan);
  findConcurrentBattles(clan);
}

Fixed version (ground truth):
private void analyzeClan(){
  try {
    findMembers(clan);
  }
 catch (  Throwable t) {
    log.error("String_Node_Str" + clan.getName() + "String_Node_Str"+ t.getMessage(),t);
  }
  for (  ClanMember clanMember : clan.getClanMembers()) {
    parseMemberDetails(clanMember);
  }
  Battle battle=new Battle();
  battle.setProvince(landingZone.getName());
  clanCache.put(clan.getName(),clan);
  findConcurrentBattles(clan);
}
Program: 45415
Project: 45415
Buggy source:
private SharedData asyncDoPut(WonderlandClientID senderID,String key,SharedData value){
  MapTaskRunner async=getTaskRunner();
  if (async != null) {
    async.getTasks().add(new PutTask(senderID,key,value));
    return get(key);
  }
  return syncDoPut(senderID,key,value);
}

Fixed version (ground truth):
private SharedData asyncDoPut(WonderlandClientID senderID,String key,SharedData value){
  MapTaskRunner async=getTaskRunner();
  if (async != null) {
    async.getTasks().add(new PutTask(senderID,key,value));
    return get(key);
  }
  return syncDoPut(senderID,key,value,true);
}
Program: 45416
Project: 45416
Buggy source:
private SharedData syncDoPut(WonderlandClientID senderID,String key,SharedData value){
  SharedData current=super.put(key,value);
  if (value.equals(current)) {
    return value;
  }
  version++;
  CellMessage message=ChangeValueMessage.put(getName(),version,key,value);
  channelRef.get().sendAll(senderID,message);
  return current;
}

Fixed version (ground truth):
private SharedData syncDoPut(WonderlandClientID senderID,String key,SharedData value,boolean notifyIfEqual){
  version++;
  SharedData current=super.put(key,value);
  if (!notifyIfEqual && value.equals(current)) {
    return value;
  }
  CellMessage message=ChangeValueMessage.put(getName(),version,key,value);
  channelRef.get().sendAll(senderID,message);
  return current;
}
Program: 45417
Project: 45417
Buggy source:
@Override public boolean isEmpty(){
  return keySet().isEmpty();
}

Fixed version (ground truth):
@Override public boolean isEmpty(){
  MapTaskRunner async=getTaskRunner();
  if (async != null) {
    Set<String> initial=new LinkedHashSet<String>(super.keySet());
    async.adjustKeySet(initial);
    return initial.isEmpty();
  }
 else {
    return super.isEmpty();
  }
}
Program: 45418
Project: 45418
Buggy source:
private void addRevalidationListener(ViewCellCacheRevalidationListener listener){
  revalidationsListeners.add(listener);
}

Fixed version (ground truth):
void addRevalidationListener(ViewCellCacheRevalidationListener listener){
  revalidationsListeners.add(listener);
}
Program: 45419
Project: 45419
Buggy source:
private void removeRevalidationListener(ViewCellCacheRevalidationListener listener){
  revalidationsListeners.remove(listener);
}

Fixed version (ground truth):
void removeRevalidationListener(ViewCellCacheRevalidationListener listener){
  revalidationsListeners.remove(listener);
}
Program: 45420
Project: 45420
Buggy source:
/** 
 * Create a scanned classloader that scans the given urls.
 * @param urls the urls to scan
 * @param parent the parent classlaoder to delegate to
 */
public ScannedClassLoader(URL[] urls,ClassLoader parent){
  super(urls,parent);
  Set<URL> urlSet=new HashSet<URL>(Arrays.asList(urls));
  while (parent != null && !(parent instanceof ScannedClassLoader)) {
    if (parent instanceof URLClassLoader) {
      urlSet.addAll(Arrays.asList(((URLClassLoader)parent).getURLs()));
    }
    parent=parent.getParent();
  }
  createDB(urlSet.toArray(new URL[urlSet.size()]));
}

Fixed version (ground truth):
/** 
 * Create a scanned classloader that scans the given urls.
 * @param urls the urls to scan
 * @param parent the parent classlaoder to delegate to
 */
public ScannedClassLoader(URL[] urls,ClassLoader parent){
  super(urls,parent);
  createDB(urls);
}
Program: 45421
Project: 45421
Buggy source:
@Override protected void addDefaultComponents(Entity entity,Node rootNode){
  super.addDefaultComponents(entity,rootNode);
  applyTransparency(TransparencyMode.DEFAULT,transparency);
}

Fixed version (ground truth):
@Override protected void addDefaultComponents(Entity entity,Node rootNode){
  super.addDefaultComponents(entity,rootNode);
  if (transparency != null) {
    applyTransparency(TransparencyMode.DEFAULT,transparency);
  }
}
Program: 45423
Project: 45423
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void updateFrame(){
  for (  FrameChange frameChg : frameChanges) {
switch (frameChg) {
case ATTACH_FRAME:
      attachFrame();
    break;
case DETACH_FRAME:
  detachFrame();
break;
case REATTACH_FRAME:
reattachFrame();
break;
case UPDATE_TITLE:
frameUpdateTitle();
break;
case UPDATE_USER_RESIZABLE:
frameUpdateUserResizable();
break;
}
}
frameChanges.clear();
frameUpdate();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void updateFrame(){
  if (inCleanup) {
    return;
  }
  for (  FrameChange frameChg : frameChanges) {
switch (frameChg) {
case ATTACH_FRAME:
      attachFrame();
    break;
case DETACH_FRAME:
  detachFrame();
break;
case REATTACH_FRAME:
reattachFrame();
break;
case UPDATE_TITLE:
frameUpdateTitle();
break;
case UPDATE_USER_RESIZABLE:
frameUpdateUserResizable();
break;
}
}
frameChanges.clear();
frameUpdate();
}
Program: 45424
Project: 45424
Buggy source:
protected void componentResized(final HUDComponent2D component){
  if (logger.isLoggable(Level.FINEST)) {
    logger.finest("String_Node_Str" + component);
  }
  final HUDComponentState state=(HUDComponentState)hudStateMap.get(component);
  if (state == null) {
    return;
  }
  final HUDView2D view=state.getView();
  if (view != null) {
    view.setSizeApp(component.getSize());
  }
}

Fixed version (ground truth):
protected void componentResized(final HUDComponent2D component){
  if (logger.isLoggable(Level.FINEST)) {
    logger.finest("String_Node_Str" + component);
  }
  final HUDComponentState state=(HUDComponentState)hudStateMap.get(component);
  if (state == null) {
    return;
  }
  final HUDView2D view=state.getView();
  if (view != null) {
    view.setSizeApp(component.getSize());
    component.setLocation(view.getLocation());
  }
}
Program: 45425
Project: 45425
Buggy source:
public static Set<GroupDTO> getGroupsForUser(String baseUrl,String userId,boolean members,CredentialManager cm) throws IOException, JAXBException {
  String urlStr="String_Node_Str" + members;
  urlStr+="String_Node_Str" + userId;
  return getGroups(baseUrl,urlStr,cm);
}

Fixed version (ground truth):
public static Set<GroupDTO> getGroupsForUser(String baseUrl,String userId,boolean members,CredentialManager cm) throws IOException, JAXBException {
  String urlStr="String_Node_Str" + members;
  urlStr+="String_Node_Str" + URLEncoder.encode(userId,"String_Node_Str");
  return getGroups(baseUrl,urlStr,cm);
}
Program: 45427
Project: 45427
Buggy source:
public JmeClientSession createSession(ServerSessionManager manager,WonderlandServerInfo server,ClassLoader loader){
  JmeClientSession session=new JmeClientSession(manager,server,loader);
  session.setInitialPosition(initialPosition,initialLook);
  return session;
}

Fixed version (ground truth):
public JmeClientSession createSession(ServerSessionManager manager,WonderlandServerInfo server,ClassLoader loader){
  if (primary && !manager.equals(LoginManager.getPrimary())) {
    LoginManager.setPrimary(manager);
  }
  JmeClientSession session=new JmeClientSession(manager,server,loader);
  session.setInitialPosition(initialPosition,initialLook);
  return session;
}
Program: 45428
Project: 45428
Buggy source:
public boolean shouldDownload(ServerSessionManager sessionManager,URL jarURL){
  return false;
}

Fixed version (ground truth):
public boolean shouldDownload(ServerSessionManager sessionManager,JarURI uri){
  return false;
}
Program: 45429
Project: 45429
Buggy source:
/** 
 * Set up the classloader with module jar URLs for this server
 * @param serverURL the URL of the server to connect to
 * @return the classloader setup with this server's URLs
 */
private ScannedClassLoader setupClassLoader(String serverURL){
  fireConnecting(BUNDLE.getString("String_Node_Str"));
  ModulePluginList list=ModuleUtils.fetchPluginJars(serverURL);
  List<URL> urls=new ArrayList<URL>();
  if (list == null) {
    logger.warning("String_Node_Str" + "String_Node_Str");
    return new ScannedClassLoader(new URL[0],getClass().getClassLoader());
  }
  for (  JarURI uri : list.getJarURIs()) {
    try {
      URL url=uri.toURL();
      if (LoginManager.getPluginFilter().shouldDownload(this,url)) {
        urls.add(url);
      }
    }
 catch (    Exception excp) {
      excp.printStackTrace();
    }
  }
  return new ScannedClassLoader(urls.toArray(new URL[0]),getClass().getClassLoader());
}

Fixed version (ground truth):
/** 
 * Set up the classloader with module jar URLs for this server
 * @param serverURL the URL of the server to connect to
 * @return the classloader setup with this server's URLs
 */
private ScannedClassLoader setupClassLoader(String serverURL){
  fireConnecting(BUNDLE.getString("String_Node_Str"));
  ModulePluginList list=ModuleUtils.fetchPluginJars(serverURL);
  List<URL> urls=new ArrayList<URL>();
  if (list == null) {
    logger.warning("String_Node_Str" + "String_Node_Str");
    return new ScannedClassLoader(new URL[0],getClass().getClassLoader());
  }
  for (  JarURI uri : list.getJarURIs()) {
    try {
      if (LoginManager.getPluginFilter().shouldDownload(this,uri)) {
        urls.add(uri.toURL());
      }
    }
 catch (    Exception excp) {
      excp.printStackTrace();
    }
  }
  return new ScannedClassLoader(urls.toArray(new URL[0]),getClass().getClassLoader());
}
Program: 45430
Project: 45430
Buggy source:
/** 
 * Find and return all the classes from the classLoader that implement the CellServerStateSPI inteface
 * @param classLoader
 * @return
 */
private static Class[] getClasses(ScannedClassLoader classLoader){
  Set<Class> setupClasses=new LinkedHashSet<Class>(Arrays.asList(coreSetupClasses));
  Iterator<CellState> it=classLoader.getInstances(ServerState.class,CellState.class);
  while (it.hasNext()) {
    setupClasses.add(it.next().getClass());
  }
  Iterator<CellServerStateSPI> it2=classLoader.getAll(ServerState.class,CellServerStateSPI.class);
  while (it2.hasNext()) {
    setupClasses.add(it2.next().getClass());
  }
  return setupClasses.toArray(new Class[0]);
}

Fixed version (ground truth):
/** 
 * Find and return all the classes from the classLoader that implement the CellServerStateSPI inteface
 * @param classLoader
 * @return
 */
private static Class[] getClasses(ScannedClassLoader classLoader){
  Set<Class> setupClasses=new LinkedHashSet<Class>(coreClasses);
  Iterator<CellState> it=classLoader.getInstances(ServerState.class,CellState.class);
  while (it.hasNext()) {
    setupClasses.add(it.next().getClass());
  }
  Iterator<CellServerStateSPI> it2=classLoader.getAll(ServerState.class,CellServerStateSPI.class);
  while (it2.hasNext()) {
    setupClasses.add(it2.next().getClass());
  }
  logger.fine("String_Node_Str" + setupClasses.toString());
  return setupClasses.toArray(new Class[0]);
}
Program: 45431
Project: 45431
Buggy source:
/** 
 * Create a scanned classloader that scans the given urls.
 * @param urls the urls to scan
 * @param parent the parent classlaoder to delegate to
 */
public ScannedClassLoader(URL[] urls,ClassLoader parent){
  super(urls,parent);
  createDB(urls);
}

Fixed version (ground truth):
/** 
 * Create a scanned classloader that scans the given urls.
 * @param urls the urls to scan
 * @param parent the parent classlaoder to delegate to
 */
public ScannedClassLoader(URL[] urls,ClassLoader parent){
  super(urls,parent);
  Set<URL> urlSet=new HashSet<URL>(Arrays.asList(urls));
  while (parent != null && !(parent instanceof ScannedClassLoader)) {
    if (parent instanceof URLClassLoader) {
      urlSet.addAll(Arrays.asList(((URLClassLoader)parent).getURLs()));
    }
    parent=parent.getParent();
  }
  createDB(urlSet.toArray(new URL[urlSet.size()]));
}
Program: 45432
Project: 45432
Buggy source:
/** 
 * Get the name of all classes that are annotated with the given annotation.
 * @param annotation the annotation to search for
 */
public Set<String> getClasses(Class<? extends Annotation> clazz){
  String name=clazz.getName();
  Set<String> out=annotationDB.getAnnotationIndex().get(name);
  if (out == null) {
    out=Collections.emptySet();
  }
  return out;
}

Fixed version (ground truth):
/** 
 * Get the name of all classes that are annotated with the given annotation.
 * @param annotation the annotation to search for
 */
public Set<String> getClasses(Class<? extends Annotation> clazz){
  String name=clazz.getName();
  Set<String> out=new LinkedHashSet<String>();
  Set<String> classes=annotationDB.getAnnotationIndex().get(name);
  if (classes != null) {
    out.addAll(classes);
  }
  ClassLoader parent=getParent();
  while (parent != null) {
    if (parent instanceof ScannedClassLoader) {
      out.addAll(((ScannedClassLoader)parent).getClasses(clazz));
      break;
    }
    parent=parent.getParent();
  }
  return out;
}
Program: 45434
Project: 45434
Buggy source:
/** 
 * Adds a new module to be uninstall.
 */
public void add(String moduleName,ModuleInfo moduleInfo){
  this.uninstallModules.put(moduleName,moduleInfo);
  ModuleInfo[] infos=this.uninstallList.getModuleInfos();
  List<ModuleInfo> list=new LinkedList(Arrays.asList(infos));
  list.add(moduleInfo);
  ModuleInfo[] newInfos=list.toArray(new ModuleInfo[]{});
  this.uninstallList.setModuleInfos(newInfos);
  FileWriter writer=null;
  try {
    writer=new FileWriter(uninstallFile);
    this.uninstallList.encode(writer);
  }
 catch (  JAXBException ex) {
    Logger.getLogger(UninstallManager.class.getName()).log(Level.WARNING,null,ex);
  }
catch (  IOException ex) {
    Logger.getLogger(UninstallManager.class.getName()).log(Level.WARNING,null,ex);
  }
 finally {
    RunUtil.close(writer);
  }
}

Fixed version (ground truth):
/** 
 * Adds a new module to be uninstall.
 */
public void add(String moduleName,ModuleInfo moduleInfo){
  this.uninstallModules.put(moduleName,moduleInfo);
  ModuleInfo[] infos=this.uninstallList.getModuleInfos();
  List<ModuleInfo> list=new LinkedList(Arrays.asList(infos));
  list.add(moduleInfo);
  ModuleInfo[] newInfos=list.toArray(new ModuleInfo[]{});
  this.uninstallList.setModuleInfos(newInfos);
  write();
}
Program: 45435
Project: 45435
Buggy source:
/** 
 * Removes an existing module, given its name. 
 */
public void remove(String moduleName){
  Logger logger=ModuleManager.getLogger();
  this.uninstallModules.remove(moduleName);
  ModuleInfo[] infos=this.uninstallList.getModuleInfos();
  List<ModuleInfo> list=new LinkedList(Arrays.asList(infos));
  Iterator<ModuleInfo> it=list.iterator();
  while (it.hasNext() == true) {
    ModuleInfo info=it.next();
    if (info.getName().equals(moduleName) == true) {
      it.remove();
      break;
    }
  }
  ModuleInfo[] newInfos=list.toArray(new ModuleInfo[]{});
  this.uninstallList.setModuleInfos(newInfos);
  FileWriter writer=null;
  try {
    writer=new FileWriter(uninstallFile);
    this.uninstallList.encode(writer);
  }
 catch (  JAXBException ex) {
    Logger.getLogger(UninstallManager.class.getName()).log(Level.WARNING,null,ex);
  }
catch (  IOException ex) {
    Logger.getLogger(UninstallManager.class.getName()).log(Level.WARNING,null,ex);
  }
 finally {
    RunUtil.close(writer);
  }
}

Fixed version (ground truth):
/** 
 * Removes an existing module, given its name. 
 */
public void remove(String moduleName){
  Logger logger=ModuleManager.getLogger();
  this.uninstallModules.remove(moduleName);
  ModuleInfo[] infos=this.uninstallList.getModuleInfos();
  List<ModuleInfo> list=new LinkedList(Arrays.asList(infos));
  Iterator<ModuleInfo> it=list.iterator();
  while (it.hasNext() == true) {
    ModuleInfo info=it.next();
    if (info.getName().equals(moduleName) == true) {
      it.remove();
      break;
    }
  }
  ModuleInfo[] newInfos=list.toArray(new ModuleInfo[]{});
  this.uninstallList.setModuleInfos(newInfos);
  write();
}
Program: 45437
Project: 45437
Buggy source:
/** 
 * Set the root for this node and all it's children
 * @param root
 */
void setRoot(SpatialCell root,ViewCacheSet viewCacheSet,Identity identity){
  this.rootNode=(SpatialCellImpl)root;
  if (isRoot && root == null) {
synchronized (spaces) {
      for (      Space s : spaces) {
        s.removeRootSpatialCell(this);
      }
      spaces.clear();
      spaces=null;
    }
    isRoot=false;
    readWriteLock=null;
    this.viewCacheSet=null;
    return;
  }
  if (root == this) {
    if (!isRoot) {
      readWriteLock=new ReentrantReadWriteLock(true);
      this.viewCacheSet=new ViewCacheSet();
      isRoot=true;
      spaces=new HashSet();
    }
    BoundingVolume newWorldBounds;
    try {
      acquireRootWriteLock();
      newWorldBounds=updateWorldTransform(identity);
    }
  finally {
      releaseRootWriteLock();
    }
    computeSpaces(newWorldBounds);
  }
 else {
    this.viewCacheSet=viewCacheSet;
  }
  if (children != null) {
    for (    SpatialCellImpl s : children) {
      s.setRoot(root,this.viewCacheSet,identity);
    }
  }
}

Fixed version (ground truth):
/** 
 * Set the root for this node and all it's children
 * @param root
 */
void setRoot(SpatialCell root,ViewCacheSet viewCacheSet,Identity identity){
  this.rootNode=(SpatialCellImpl)root;
  if (isRoot && root == null) {
synchronized (spaces) {
      for (      Space s : spaces) {
        s.removeRootSpatialCell(this);
      }
      spaces.clear();
      spaces=null;
    }
    isRoot=false;
    readWriteLock=null;
    this.viewCacheSet=null;
    return;
  }
  if (root == this) {
    if (!isRoot) {
      readWriteLock=new ReentrantReadWriteLock(true);
      this.viewCacheSet=new ViewCacheSet();
      isRoot=true;
      spaces=new HashSet();
    }
    BoundingVolume newWorldBounds;
    try {
      acquireRootWriteLock();
      newWorldBounds=updateWorldTransform(identity);
    }
  finally {
      releaseRootWriteLock();
    }
    computeSpaces(newWorldBounds);
  }
 else {
    this.viewCacheSet=viewCacheSet;
    viewCachesAddedOrRemoved(viewCacheSet.getCaches(),true,false,this);
  }
  if (children != null) {
    for (    SpatialCellImpl s : children) {
      s.setRoot(root,this.viewCacheSet,identity);
    }
  }
}
Program: 45438
Project: 45438
Buggy source:
void viewCachesAddedOrRemoved(Collection<ViewCache> caches,boolean added,SpatialCellImpl cell){
  for (  ViewCache c : caches) {
    if (added) {
      c.addViewUpdateListener(cellID,this);
    }
 else {
      c.removeViewUpdateListener(cellID,this);
    }
  }
  if (children != null) {
    for (    SpatialCellImpl child : children) {
      child.viewCachesAddedOrRemoved(caches,added,child);
    }
  }
}

Fixed version (ground truth):
static void viewCachesAddedOrRemoved(Collection<ViewCache> caches,boolean added,boolean notifyChildren,SpatialCellImpl cell){
  for (  ViewCache c : caches) {
    if (added) {
      c.addViewUpdateListener(cell.getCellID(),cell);
    }
 else {
      c.removeViewUpdateListener(cell.getCellID(),cell);
    }
  }
  if (notifyChildren && cell.getChildren() != null) {
    for (    SpatialCellImpl child : cell.getChildren()) {
      viewCachesAddedOrRemoved(caches,added,true,child);
    }
  }
}
Program: 45439
Project: 45439
Buggy source:
public void setMaxEntries(int maxEntries){
  if (maxEntries <= 0) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  }
  this.maxEntries=maxEntries;
  Preferences prefs=Preferences.userNodeForPackage(LogViewerFrame.class);
  prefs.putInt("String_Node_Str",maxEntries);
  while (entries.size() > getMaxEntries()) {
    removeOldestRecord();
  }
}

Fixed version (ground truth):
public void setMaxEntries(int maxEntries){
  if (maxEntries <= 0) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  }
  this.maxEntries=maxEntries;
  Preferences prefs=Preferences.userNodeForPackage(LogViewerFrame.class);
  prefs.putInt("String_Node_Str",maxEntries);
  processRecords();
}
Program: 45441
Project: 45441
Buggy source:
protected String format(LogRecord record){
  StringBuffer out=new StringBuffer();
  out.append(record.getLevel());
  out.append("String_Node_Str");
  out.append(DateFormat.getTimeInstance().format(new Date(record.getMillis())));
  out.append("String_Node_Str");
  out.append(record.getSourceClassName());
  out.append("String_Node_Str");
  out.append(record.getSourceMethodName());
  out.append("String_Node_Str");
  if (record.getMessage() != null) {
    out.append(record.getMessage());
    out.append("String_Node_Str");
  }
  if (record.getThrown() != null) {
    out.append(formatThrowable(record.getThrown()));
  }
  return out.toString();
}

Fixed version (ground truth):
/** 
 * Format the given record, and add it to the given string builder. Return the length of text added to the builder.
 */
protected int format(LogRecord record,StringBuilder builder){
  int startLen=builder.length();
  builder.append(record.getLevel());
  builder.append("String_Node_Str");
  builder.append(DateFormat.getTimeInstance().format(new Date(record.getMillis())));
  builder.append("String_Node_Str");
  builder.append(record.getSourceClassName());
  builder.append("String_Node_Str");
  builder.append(record.getSourceMethodName());
  builder.append("String_Node_Str");
  if (record.getMessage() != null) {
    builder.append(record.getMessage());
    builder.append("String_Node_Str");
  }
  if (record.getThrown() != null) {
    builder.append(formatThrowable(record.getThrown()));
  }
  return builder.length() - startLen;
}
Program: 45442
Project: 45442
Buggy source:
protected void addRecord(LogRecord record){
  String str=format(record);
  ManualScrollEditorPane mspe=(ManualScrollEditorPane)logPane;
  Position pos=mspe.preModify();
  boolean atEnd=mspe.atEnd();
  try {
    final Document doc=logPane.getDocument();
    Position end=doc.getEndPosition();
    doc.insertString(end.getOffset() - 1,str,null);
  }
 catch (  BadLocationException ble) {
    logger.log(Level.WARNING,"String_Node_Str",ble);
    return;
  }
  LogEntry entry=new LogEntry();
  entry.record=record;
  entry.length=str.length();
  entries.add(entries.size(),entry);
  while (entries.size() > getMaxEntries()) {
    removeOldestRecord();
  }
  mspe.postModify(pos,atEnd);
}

Fixed version (ground truth):
/** 
 * Called by the handler to add a new record to the log. This method queues the record and schedules the actual update to happen on the AWT event thread.
 * @param record the record to process
 */
protected synchronized void addRecord(LogRecord record){
  boolean schedule=workQueue.isEmpty();
  workQueue.add(record);
  if (schedule) {
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        processRecords();
      }
    }
);
  }
}
Program: 45443
Project: 45443
Buggy source:
@Override public void publish(final LogRecord record){
  record.getSourceMethodName();
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      LogViewerFrame.getInstance().addRecord(record);
    }
  }
);
}

Fixed version (ground truth):
@Override public void publish(final LogRecord record){
  record.getSourceMethodName();
  LogViewerFrame.getInstance().addRecord(record);
}
Program: 45444
Project: 45444
Buggy source:
@Override protected void done(){
  if (inPTT) {
    inPTT=false;
    setMute(true);
  }
  if (pttReleaseTimer == this) {
    pttReleaseTimer=null;
  }
}

Fixed version (ground truth):
@Override protected void done(){
  if (inPTT && !isCancelled()) {
    inPTT=false;
    setMute(true);
  }
  if (pttReleaseTimer == this) {
    pttReleaseTimer=null;
  }
}
Program: 45445
Project: 45445
Buggy source:
@Override public ViewFactory getViewFactory(){
  final ViewFactory sf=super.getViewFactory();
  return new ViewFactory(){
    public View create(    Element element){
      if (element.getName().equals(AbstractDocument.ParagraphElementName)) {
        return new ParagraphView(element){
          @Override public void layout(          int width,          int height){
            super.layout(Short.MAX_VALUE,height);
          }
          @Override public float getMinimumSpan(          int axis){
            return super.getPreferredSpan(axis);
          }
        }
;
      }
      return sf.create(element);
    }
  }
;
}

Fixed version (ground truth):
@Override public ViewFactory getViewFactory(){
  final ViewFactory sf=super.getViewFactory();
  return new ViewFactory(){
    public View create(    Element element){
      if (element.getName().equals(AbstractDocument.ParagraphElementName)) {
        return new ParagraphView(element){
          @Override public void layout(          int width,          int height){
            try {
              super.layout(Short.MAX_VALUE,height);
            }
 catch (            Throwable t) {
              logger.log(Level.WARNING,"String_Node_Str",t);
            }
          }
          @Override public float getMinimumSpan(          int axis){
            return super.getPreferredSpan(axis);
          }
        }
;
      }
      return sf.create(element);
    }
  }
;
}