nus-yam/ex-repair huggingface dataset:
Program: 44728
Project: 44728
Buggy source:
public void jailPlayer(CommandSender sender,String[] args){
  args[0]=args[0].toLowerCase();
  Player player=this.getServer().getPlayer(args[0]);
  if (player == null) {
    sender.sendMessage(ChatColor.RED + "String_Node_Str" + args[0]+ "String_Node_Str");
    return;
  }
  if (jailed.getProperty(args[0]) != null) {
    sender.sendMessage(ChatColor.RED + "String_Node_Str");
    return;
  }
  player.teleport(new Location(player.getWorld(),jailCoords[0],jailCoords[1],jailCoords[2]));
  if (!newPerms) {
    String groupName=permissions.getGroup(this.getServer().getWorlds().get(0).getName(),args[0]);
    jailed.setProperty(args[0],groupName);
    perms.setProperty("String_Node_Str" + args[0] + "String_Node_Str",jailGroup);
  }
 else {
    String[] groupName=permissions.getGroups(this.getServer().getWorlds().get(0).getName(),args[0]);
    List groupList=Arrays.asList(groupName);
    if (groupList == null)     groupList=new ArrayList();
    jailed.setProperty(args[0],groupList);
    List jailList=new ArrayList();
    jailList.add(jailGroup);
    perms.setProperty("String_Node_Str" + args[0] + "String_Node_Str",jailList);
  }
  jailed.save();
  perms.save();
  this.getServer().dispatchCommand(((CraftServer)getServer()).getServer().console,"String_Node_Str");
  sender.sendMessage(ChatColor.AQUA + "String_Node_Str");
}

Fixed version (ground truth):
public void jailPlayer(CommandSender sender,String[] args){
  Player player=this.getServer().getPlayer(args[0]);
  if (player == null) {
    sender.sendMessage(ChatColor.RED + "String_Node_Str" + args[0]+ "String_Node_Str");
    return;
  }
  args[0]=player.getName();
  if (!(args[0].equals(args[0].toLowerCase())) && jailed.getProperty(args[0].toLowerCase()) != null) {
    jailed.setProperty(args[0],args[0].toLowerCase());
    jailed.removeProperty(args[0].toLowerCase());
  }
  if (jailed.getProperty(args[0]) != null) {
    sender.sendMessage(ChatColor.RED + "String_Node_Str");
    return;
  }
  player.teleport(new Location(player.getWorld(),jailCoords[0],jailCoords[1],jailCoords[2]));
  if (!newPerms) {
    String groupName=permissions.getGroup(this.getServer().getWorlds().get(0).getName(),args[0]);
    jailed.setProperty(args[0],groupName);
    perms.setProperty("String_Node_Str" + args[0] + "String_Node_Str",jailGroup);
  }
 else {
    String[] groupName=permissions.getGroups(this.getServer().getWorlds().get(0).getName(),args[0]);
    List groupList=Arrays.asList(groupName);
    if (groupList == null)     groupList=new ArrayList();
    jailed.setProperty(args[0],groupList);
    List jailList=new ArrayList();
    jailList.add(jailGroup);
    perms.setProperty("String_Node_Str" + args[0] + "String_Node_Str",jailList);
  }
  jailed.save();
  perms.save();
  this.getServer().dispatchCommand(((CraftServer)getServer()).getServer().console,"String_Node_Str");
  sender.sendMessage(ChatColor.AQUA + "String_Node_Str");
}
Program: 44730
Project: 44730
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public void onEnable(){
  this.loadConfig();
  if (!useBukkitPermissions)   this.setupPermissions();
 else   bukkitPermissions=(PermissionsPlugin)this.getServer().getPluginManager().getPlugin("String_Node_Str");
  listener=new SimpleJailPlayerListener(this);
  this.getServer().getPluginManager().registerEvent(Event.Type.PLAYER_RESPAWN,listener,Priority.High,this);
  log.info("String_Node_Str" + this.getDescription().getName() + "String_Node_Str"+ this.getDescription().getVersion()+ "String_Node_Str");
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public void onEnable(){
  console=((CraftServer)this.getServer()).getServer().console;
  this.loadConfig();
  if (!useBukkitPermissions)   this.setupPermissions();
 else   bukkitPermissions=(PermissionsPlugin)this.getServer().getPluginManager().getPlugin("String_Node_Str");
  listener=new SimpleJailPlayerListener(this);
  this.getServer().getPluginManager().registerEvent(Event.Type.PLAYER_RESPAWN,listener,Priority.High,this);
  log.info("String_Node_Str" + this.getDescription().getName() + "String_Node_Str"+ this.getDescription().getVersion()+ "String_Node_Str");
}
Program: 44732
Project: 44732
Buggy source:
public void unjailPlayer(CommandSender sender,String[] args){
  Player player=this.getServer().getPlayer(args[0]);
  if (player == null) {
    sender.sendMessage(ChatColor.RED + "String_Node_Str" + args[0]+ "String_Node_Str");
    return;
  }
  args[0]=player.getName();
  if (!(args[0].equals(args[0].toLowerCase())) && jailed.getProperty(args[0].toLowerCase()) != null) {
    jailed.setProperty(args[0],args[0].toLowerCase());
    jailed.removeProperty(args[0].toLowerCase());
  }
  if (jailed.getProperty(args[0]) == null) {
    sender.sendMessage(ChatColor.RED + "String_Node_Str");
    return;
  }
  player.teleport(new Location(player.getWorld(),unjailCoords[0],unjailCoords[1],unjailCoords[2]));
  if (useBukkitPermissions || !newPerms) {
    this.setGroup(player,jailed.getString(args[0]));
  }
 else {
    if (jailed.getProperty(args[0]) instanceof String) {
      this.convertPermission(args[0]);
    }
    List groupList=jailed.getList(args[0]);
    if (groupList == null) {
      groupList=new ArrayList();
    }
    this.setGroup(player,groupList);
  }
  jailed.removeProperty(args[0]);
  jailed.save();
  if (!useBukkitPermissions)   perms.save();
  if (!useBukkitPermissions)   this.getServer().dispatchCommand(((CraftServer)getServer()).getServer().console,"String_Node_Str");
  sender.sendMessage(ChatColor.AQUA + "String_Node_Str");
}

Fixed version (ground truth):
public void unjailPlayer(CommandSender sender,String[] args){
  Player player=this.getServer().getPlayer(args[0]);
  if (player == null) {
    sender.sendMessage(ChatColor.RED + "String_Node_Str" + args[0]+ "String_Node_Str");
    return;
  }
  args[0]=player.getName();
  if (!(args[0].equals(args[0].toLowerCase())) && jailed.getProperty(args[0].toLowerCase()) != null) {
    jailed.setProperty(args[0],args[0].toLowerCase());
    jailed.removeProperty(args[0].toLowerCase());
  }
  if (jailed.getProperty(args[0]) == null) {
    sender.sendMessage(ChatColor.RED + "String_Node_Str");
    return;
  }
  player.teleport(new Location(player.getWorld(),unjailCoords[0],unjailCoords[1],unjailCoords[2]));
  if (useBukkitPermissions) {
    this.setGroup(player,jailed.getStringList(args[0],new ArrayList()));
  }
 else   if (!newPerms) {
    this.setGroup(player,jailed.getString(args[0]));
  }
 else {
    if (jailed.getProperty(args[0]) instanceof String) {
      this.convertPermission(args[0]);
    }
    List groupList=jailed.getList(args[0]);
    if (groupList == null) {
      groupList=new ArrayList();
    }
    this.setGroup(player,groupList);
  }
  jailed.removeProperty(args[0]);
  jailed.save();
  if (!useBukkitPermissions)   perms.save();
  if (!useBukkitPermissions)   this.getServer().dispatchCommand(((CraftServer)getServer()).getServer().console,"String_Node_Str");
  sender.sendMessage(ChatColor.AQUA + "String_Node_Str");
}
Program: 44734
Project: 44734
Buggy source:
public static int getBlockCurrent(Block b){
  Material mBlock=b.getType();
  int iData=(int)b.getData();
  if (mBlock == Material.LEVER || mBlock == Material.POWERED_RAIL) {
    return (iData & 0x08) == 0x08 ? 15 : 0;
  }
 else   if (mBlock == Material.IRON_DOOR_BLOCK || mBlock == Material.WOODEN_DOOR || mBlock == Material.TRAP_DOOR || mBlock == Material.FENCE_GATE) {
    return (iData & 0x04) == 0x04 ? 15 : 0;
  }
 else   if (mBlock == Material.REDSTONE_LAMP_OFF || mBlock == Material.REDSTONE_LAMP_ON || mBlock == Material.REDSTONE_TORCH_OFF || mBlock == Material.REDSTONE_TORCH_ON) {
    return keepAlives.contains(b) ? 15 : 0;
  }
  return b.getBlockPower();
}

Fixed version (ground truth):
public static int getBlockCurrent(Block b){
  Material mBlock=b.getType();
  int iData=(int)b.getData();
  if (mBlock == Material.LEVER || mBlock == Material.POWERED_RAIL) {
    return (iData & 0x08) == 0x08 ? 15 : 0;
  }
 else   if (mBlock == Material.IRON_DOOR_BLOCK || mBlock == Material.WOODEN_DOOR || mBlock == Material.SPRUCE_DOOR || mBlock == Material.BIRCH_DOOR || mBlock == Material.JUNGLE_DOOR || mBlock == Material.ACACIA_DOOR || mBlock == Material.DARK_OAK_DOOR || mBlock == Material.TRAP_DOOR || mBlock == Material.FENCE_GATE || mBlock == Material.SPRUCE_FENCE_GATE || mBlock == Material.BIRCH_FENCE_GATE || mBlock == Material.JUNGLE_FENCE_GATE || mBlock == Material.ACACIA_FENCE_GATE || mBlock == Material.DARK_OAK_FENCE_GATE) {
    return (iData & 0x04) == 0x04 ? 15 : 0;
  }
 else   if (mBlock == Material.REDSTONE_LAMP_OFF || mBlock == Material.REDSTONE_LAMP_ON || mBlock == Material.REDSTONE_TORCH_OFF || mBlock == Material.REDSTONE_TORCH_ON) {
    return keepAlives.contains(b) ? 15 : 0;
  }
  return b.getBlockPower();
}
Program: 44737
Project: 44737
Buggy source:
public static int getBlockCurrent(Block b){
  Material mBlock=b.getType();
  int iData=(int)b.getData();
  if (mBlock == Material.LEVER || mBlock == Material.POWERED_RAIL) {
    return (iData & 0x08) == 0x08 ? 15 : 0;
  }
 else   if (mBlock == Material.IRON_DOOR_BLOCK || mBlock == Material.WOODEN_DOOR || mBlock == Material.TRAP_DOOR || mBlock == Material.FENCE_GATE) {
    return (iData & 0x04) == 0x04 ? 15 : 0;
  }
  return b.getBlockPower();
}

Fixed version (ground truth):
public static int getBlockCurrent(Block b){
  Material mBlock=b.getType();
  int iData=(int)b.getData();
  if (mBlock == Material.LEVER || mBlock == Material.POWERED_RAIL) {
    return (iData & 0x08) == 0x08 ? 15 : 0;
  }
 else   if (mBlock == Material.IRON_DOOR_BLOCK || mBlock == Material.WOODEN_DOOR || mBlock == Material.TRAP_DOOR || mBlock == Material.FENCE_GATE) {
    return (iData & 0x04) == 0x04 ? 15 : 0;
  }
 else   if (mBlock == Material.REDSTONE_LAMP_OFF || mBlock == Material.REDSTONE_LAMP_ON || mBlock == Material.REDSTONE_TORCH_OFF || mBlock == Material.REDSTONE_TORCH_ON) {
    return keepAlives.contains(b) ? 15 : 0;
  }
  return b.getBlockPower();
}
Program: 44739
Project: 44739
Buggy source:
@EventHandler(priority=EventPriority.LOW) public void onBlockRedstoneChange(BlockRedstoneEvent event){
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.LOW) public void onBlockRedstoneChange(BlockRedstoneEvent event){
  if (CircuitManager.circuitExists(event.getBlock().getLocation())) {
    CircuitManager.activateCircuit(event.getBlock().getLocation(),event.getNewCurrent());
  }
  if (CircuitManager.shouldLeaveReceiverOn(event.getBlock())) {
    event.setNewCurrent(15);
  }
}
Program: 44743
Project: 44743
Buggy source:
public CircuitManager(final QuantumConnectors qc){
  this.plugin=qc;
}

Fixed version (ground truth):
public CircuitManager(final QuantumConnectors qc){
  this.plugin=qc;
  for (  World world : plugin.getServer().getWorlds()) {
    loadWorld(world);
  }
}
Program: 44744
Project: 44744
Buggy source:
public byte getTypeCode(String type) throws ApplicationFault {
  if (this.types.containsKey(type))   return this.types.get(type);
  throw new ApplicationFault("String_Node_Str" + type + "String_Node_Str");
}

Fixed version (ground truth):
public Byte getTypeCode(String type) throws ApplicationFault {
  if (StringUtils.isEmpty(type))   return null;
  if (this.types.containsKey(type))   return this.types.get(type);
  throw new ApplicationFault("String_Node_Str" + type + "String_Node_Str");
}
Program: 44745
Project: 44745
Buggy source:
/** 
 * Set a new stopword list. This also refreshes the existing list.
 * @param words
 * @throws SystemFault
 */
public void setStopwords(List<String> words) throws SystemFault {
  StopwordRefresh.add(words);
  Set<String> newStopWords=new HashSet<String>();
  newStopWords.addAll(words);
  Set<String> stopWordsTemp=this.stopWords;
  this.stopWords=newStopWords;
  stopWordsTemp.clear();
  stopWordsTemp=null;
}

Fixed version (ground truth):
/** 
 * Set a new stopword list. This also refreshes the existing list.
 * @param words
 * @throws SystemFault
 */
public void setStopwords(List<String> words) throws SystemFault {
  StopwordRefresh.add(words);
  Set<String> newStopWords=new HashSet<String>();
  newStopWords.addAll(words);
  this.stopWords=newStopWords;
}
Program: 44746
Project: 44746
Buggy source:
public Object process() throws ApplicationFault, SystemFault {
  NV nv=new NV(IOConstants.NAME_VALUE_BYTES,IOConstants.NAME_VALUE_BYTES);
  RecordScalar scalar=new RecordScalar(STOP_WORD_LISTS_KEY,nv);
  HReader.getScalar(IOConstants.TABLE_CONFIG,scalar);
  if (null != scalar.kv.data) {
    String words=new String(scalar.kv.data.toBytes());
    List<String> wordLst=StringUtils.fastSplit(words,STOPWORD_SEPARATOR);
    Set<String> stopWordsTemp=StopwordManager.getInstance().stopWords;
    StopwordManager.getInstance().stopWords=buildStopwords(wordLst);
    stopWordsTemp.clear();
    stopWordsTemp=null;
  }
  return null;
}

Fixed version (ground truth):
public Object process() throws ApplicationFault, SystemFault {
  NV nv=new NV(IOConstants.NAME_VALUE_BYTES,IOConstants.NAME_VALUE_BYTES);
  RecordScalar scalar=new RecordScalar(STOP_WORD_LISTS_KEY,nv);
  HReader.getScalar(IOConstants.TABLE_CONFIG,scalar);
  if (null != scalar.kv.data) {
    String words=new String(scalar.kv.data.toBytes());
    List<String> wordLst=StringUtils.fastSplit(words,STOPWORD_SEPARATOR);
    Set<String> stopWordsTemp=StopwordManager.getInstance().stopWords;
    StopwordManager.getInstance().stopWords=buildStopwords(wordLst);
    if (null != stopWordsTemp)     stopWordsTemp.clear();
    stopWordsTemp=null;
  }
  return null;
}
Program: 44747
Project: 44747
Buggy source:
/** 
 * This subsets across all MUST queries. Last 2 must queries are already in sync from the processing.
 * @param planner
 * @param lastMustQuery
 */
private void intersectMustQs(QueryPlanner planner,QueryTerm lastMustQuery){
  if (null == lastMustQuery)   return;
  int stepsT=planner.sequences.size();
  boolean ignoreNext=false;
  for (int step=stepsT - 1; step > -1; step--) {
    List<QueryTerm> curStep=planner.sequences.get(step);
    if (curStep.size() != 1)     continue;
    QueryTerm curQuery=curStep.get(0);
    if (curQuery.isOptional)     continue;
    if (lastMustQuery == curQuery) {
      ignoreNext=true;
      continue;
    }
    if (ignoreNext) {
      ignoreNext=false;
      continue;
    }
    Map<Long,TermList> curBuckets=curQuery.foundIds;
    Map<Long,TermList> lastBuckets=lastMustQuery.foundIds;
    int curBucketsT=curBuckets.size();
    Iterator<Long> curBucketsItr=curBuckets.keySet().iterator();
    for (int i=0; i < curBucketsT; i++) {
      Long bucketId=curBucketsItr.next();
      boolean hasElements=lastBuckets.containsKey(bucketId);
      if (hasElements) {
        hasElements=curBuckets.get(bucketId).intersect(lastBuckets.get(bucketId));
        if (!hasElements) {
          curBucketsItr.remove();
          lastBuckets.remove(bucketId);
        }
      }
 else {
        curBucketsItr.remove();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * This subsets across all MUST queries. Last 2 must queries are already in sync from the processing.
 * @param planner
 * @param lastMustQuery
 */
private void intersectMustQs(QueryPlanner planner,QueryTerm lastMustQuery){
  if (null == lastMustQuery)   return;
  int stepsT=planner.sequences.size();
  for (int step=stepsT - 1; step > -1; step--) {
    List<QueryTerm> curStep=planner.sequences.get(step);
    if (curStep.size() != 1)     continue;
    QueryTerm curQuery=curStep.get(0);
    if (curQuery.isOptional)     continue;
    if (lastMustQuery == curQuery)     continue;
    Map<Long,TermList> curBuckets=curQuery.foundIds;
    Map<Long,TermList> lastBuckets=lastMustQuery.foundIds;
    int curBucketsT=curBuckets.size();
    Iterator<Long> curBucketsItr=curBuckets.keySet().iterator();
    for (int i=0; i < curBucketsT; i++) {
      Long bucketId=curBucketsItr.next();
      boolean hasElements=lastBuckets.containsKey(bucketId);
      if (hasElements) {
        hasElements=curBuckets.get(bucketId).intersect(lastBuckets.get(bucketId));
        if (!hasElements) {
          curBucketsItr.remove();
          lastBuckets.remove(bucketId);
        }
      }
 else {
        curBucketsItr.remove();
      }
    }
  }
}
Program: 44749
Project: 44749
Buggy source:
public void testIndexFieldInsert(String id,String title,String teaser) throws Exception {
  HDocument hdoc=new HDocument();
  hdoc.originalId=new Storable(id);
  hdoc.title=new Storable(title);
  hdoc.fields=new ArrayList<HField>();
  HField fld=new HField("String_Node_Str",FileReaderUtil.toString("String_Node_Str"));
  hdoc.fields.add(fld);
  QueryResult res=IndexReader.getInstance().search(new QueryContext(id));
  IndexWriter.getInstance().insert(hdoc);
}

Fixed version (ground truth):
public void testIndexFieldInsert(String id,String title) throws Exception {
  HDocument hdoc=new HDocument();
  hdoc.originalId=new Storable(id);
  hdoc.title=new Storable(title);
  hdoc.fields=new ArrayList<HField>();
  HField fld=new HField("String_Node_Str",FileReaderUtil.toString("String_Node_Str"));
  hdoc.fields.add(fld);
  IndexWriter.getInstance().insert(hdoc);
  QueryResult res=IndexReader.getInstance().search(new QueryContext("String_Node_Str"));
  System.out.println(res.toString());
}
Program: 44750
Project: 44750
Buggy source:
public static void main(String[] args) throws Exception {
  IndexWriterTest t=new IndexWriterTest();
  Configuration conf=new Configuration();
  ServiceFactory.getInstance().init(conf,null);
  List<String> kwL=DictionaryManager.getInstance().getDictionary().getAll();
  for (  String kw : kwL) {
    System.out.println(kw.toString());
  }
  DictionaryManager.getInstance().deleteAll();
  t.testIndexMultiDoc("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  t.testIndexMultiDoc("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  t.testIndexMultiDoc("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  IndexWriterTest t=new IndexWriterTest();
  Configuration conf=new Configuration();
  ServiceFactory.getInstance().init(conf,null);
  List<String> kwL=DictionaryManager.getInstance().getDictionary().getAll();
  for (  String kw : kwL) {
    System.out.println(kw.toString());
  }
  DictionaryManager.getInstance().deleteAll();
  t.testIndexFieldInsert("String_Node_Str","String_Node_Str");
}
Program: 44751
Project: 44751
Buggy source:
public static boolean compareBytes(char[] inputBytes,char[] compareBytes){
  int inputBytesT=inputBytes.length;
  int compareBytesT=compareBytes.length;
  if (compareBytesT != inputBytesT)   return false;
  if (compareBytes[0] != inputBytes[0])   return false;
  if (compareBytes[compareBytesT - 1] != inputBytes[compareBytesT - 1])   return false;
switch (compareBytesT) {
case 3:
    return compareBytes[1] == inputBytes[1];
case 4:
  return compareBytes[1] == inputBytes[1] && compareBytes[2] == inputBytes[2];
case 5:
return compareBytes[1] == inputBytes[1] && compareBytes[2] == inputBytes[2] && compareBytes[3] == inputBytes[3];
case 6:
return compareBytes[1] == inputBytes[1] && compareBytes[3] == inputBytes[3] && compareBytes[2] == inputBytes[2] && compareBytes[4] == inputBytes[4];
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
case 27:
case 28:
case 29:
case 30:
for (int i=0; i < compareBytesT - 1; i++) {
if (compareBytes[i] != inputBytes[i]) return false;
}
break;
case 31:
for (int a=1; a <= 6; a++) {
if (!(compareBytes[a] == inputBytes[a] && compareBytes[a + 6] == inputBytes[a + 6] && compareBytes[a + 12] == inputBytes[a + 12] && compareBytes[a + 18] == inputBytes[a + 18] && compareBytes[a + 24] == inputBytes[a + 24])) return false;
}
break;
default :
for (int i=0; i < compareBytesT - 1; i++) {
if (compareBytes[i] != inputBytes[i]) return false;
}
}
return true;
}

Fixed version (ground truth):
public static boolean compareBytes(char[] inputBytes,char[] compareBytes){
  int inputBytesT=inputBytes.length;
  int compareBytesT=compareBytes.length;
  if (compareBytesT != inputBytesT)   return false;
  if (compareBytes[0] != inputBytes[0])   return false;
  if (compareBytes[compareBytesT - 1] != inputBytes[compareBytesT - 1])   return false;
switch (compareBytesT) {
case 3:
    return compareBytes[1] == inputBytes[1];
case 4:
  return compareBytes[1] == inputBytes[1] && compareBytes[2] == inputBytes[2];
case 5:
return compareBytes[1] == inputBytes[1] && compareBytes[2] == inputBytes[2] && compareBytes[3] == inputBytes[3];
case 6:
return compareBytes[1] == inputBytes[1] && compareBytes[3] == inputBytes[3] && compareBytes[2] == inputBytes[2] && compareBytes[4] == inputBytes[4];
default :
compareBytesT--;
for (int i=0; i < compareBytesT; i++) {
if (compareBytes[i] != inputBytes[i]) return false;
}
}
return true;
}
Program: 44752
Project: 44752
Buggy source:
public static List<NVBytes> getCompleteRow(String tableName,byte[] pk) throws ApplicationFault {
  HBaseFacade facade=null;
  HTableWrapper table=null;
  Result r=null;
  try {
    facade=HBaseFacade.getInstance();
    table=facade.getTable(tableName);
    Get getter=new Get(pk);
    if (table.exists(getter)) {
      r=table.get(getter);
      List<NVBytes> nvs=new ArrayList<NVBytes>(r.list().size());
      for (      KeyValue kv : r.list()) {
        nvs.add(new NVBytes(kv.getFamily(),kv.getQualifier(),kv.getValue()));
      }
      return nvs;
    }
    return null;
  }
 catch (  Exception ex) {
    throw new ApplicationFault("String_Node_Str" + pk.toString(),ex);
  }
 finally {
    if (null != facade && null != table)     facade.putTable(table);
  }
}

Fixed version (ground truth):
public static List<NVBytes> getCompleteRow(String tableName,byte[] pk,Filter filter) throws ApplicationFault {
  HBaseFacade facade=null;
  HTableWrapper table=null;
  Result r=null;
  try {
    facade=HBaseFacade.getInstance();
    table=facade.getTable(tableName);
    Get getter=new Get(pk);
    if (null != filter)     getter.setFilter(filter);
    if (table.exists(getter)) {
      r=table.get(getter);
      List<NVBytes> nvs=new ArrayList<NVBytes>(r.list().size());
      for (      KeyValue kv : r.list()) {
        nvs.add(new NVBytes(kv.getFamily(),kv.getQualifier(),kv.getValue()));
      }
      return nvs;
    }
    return null;
  }
 catch (  Exception ex) {
    throw new ApplicationFault("String_Node_Str" + pk.toString(),ex);
  }
 finally {
    if (null != facade && null != table)     facade.putTable(table);
  }
}
Program: 44753
Project: 44753
Buggy source:
public boolean visit(Object objQuery) throws ApplicationFault, SystemFault {
  HQuery query=(HQuery)objQuery;
  QueryContext ctx=query.ctx;
  QueryResult res=query.result;
  if (null == res)   return true;
  if (null == res.sortedDynamicWeights)   return true;
  int foundT=res.sortedDynamicWeights.length;
  int maxFetching=(ctx.documentFetchLimit < foundT) ? ctx.documentFetchLimit : foundT;
  List<DocTeaserWeight> weightedTeasers=new ArrayList<DocTeaserWeight>(maxFetching);
  for (int i=0; i < maxFetching; i++) {
    DocMetaWeight metaWt=(DocMetaWeight)res.sortedDynamicWeights[i];
    byte[] idB=metaWt.id.getBytes();
    List<NVBytes> flds=HReader.getCompleteRow(IOConstants.TABLE_PREVIEW,idB);
    weightedTeasers.add(new DocTeaserWeight(idB,flds,metaWt.weight));
  }
  res.teasers=weightedTeasers.toArray();
  DocTeaserWeight.sort(res.teasers);
  return true;
}

Fixed version (ground truth):
public boolean visit(Object objQuery) throws ApplicationFault, SystemFault {
  HQuery query=(HQuery)objQuery;
  QueryContext ctx=query.ctx;
  QueryResult res=query.result;
  if (null == res)   return true;
  if (null == res.sortedDynamicWeights)   return true;
  int foundT=res.sortedDynamicWeights.length;
  int maxFetching=(ctx.documentFetchLimit < foundT) ? ctx.documentFetchLimit : foundT;
  List<DocTeaserWeight> weightedTeasers=new ArrayList<DocTeaserWeight>(maxFetching);
  int termsMT=(null == query.planner.mustTerms) ? 0 : query.planner.mustTerms.size();
  int termsOT=(null == query.planner.optionalTerms) ? 0 : query.planner.optionalTerms.size();
  byte[][] wordsB=new byte[termsMT + termsOT][];
  for (int i=0; i < termsMT; i++) {
    wordsB[i]=new Storable(query.planner.mustTerms.get(i).wordOrig).toBytes();
  }
  for (int i=0; i < termsOT; i++) {
    wordsB[i + termsMT]=new Storable(query.planner.optionalTerms.get(i).wordOrig).toBytes();
  }
  TeaserFilter tf=new TeaserFilter(wordsB);
  for (int i=0; i < maxFetching; i++) {
    DocMetaWeight metaWt=(DocMetaWeight)res.sortedDynamicWeights[i];
    byte[] idB=metaWt.id.getBytes();
    List<NVBytes> flds=HReader.getCompleteRow(IOConstants.TABLE_PREVIEW,idB,tf);
    weightedTeasers.add(new DocTeaserWeight(idB,flds,metaWt.weight));
  }
  res.teasers=weightedTeasers.toArray();
  DocTeaserWeight.sort(res.teasers);
  return true;
}
Program: 44755
Project: 44755
Buggy source:
public boolean visit(Object objQuery) throws ApplicationFault, SystemFault {
  HQuery query=(HQuery)objQuery;
  QueryContext ctx=query.ctx;
  QueryPlanner planner=query.planner;
  QueryResult result=query.result;
  Map<String,DocWeight> sortedStaticMap=computeWeight(ctx,planner);
  result.sortedStaticWeights=sortedStaticMap.values().toArray();
  DocWeight.sort(result.sortedStaticWeights);
  return true;
}

Fixed version (ground truth):
public boolean visit(Object objQuery) throws ApplicationFault, SystemFault {
  L.l.debug("String_Node_Str");
  HQuery query=(HQuery)objQuery;
  QueryContext ctx=query.ctx;
  QueryPlanner planner=query.planner;
  QueryResult result=query.result;
  Map<String,DocWeight> sortedStaticMap=computeWeight(ctx,planner);
  result.sortedStaticWeights=sortedStaticMap.values().toArray();
  DocWeight.sort(result.sortedStaticWeights);
  sortedStaticMap.clear();
  sortedStaticMap=null;
  return true;
}
Program: 44756
Project: 44756
Buggy source:
/** 
 * Method is expected to initialize IDP selection in the client's browser by including appropriate source. By default page located at idpSelectionPath is included.
 * @param request request
 * @param response response
 * @throws ServletException error
 * @throws IOException io error
 */
protected void initializeSelection(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  logger.debug("String_Node_Str");
  response.setContentType("String_Node_Str");
  request.getRequestDispatcher(idpSelectionPath).include(request,response);
}

Fixed version (ground truth):
/** 
 * Method is expected to initialize IDP selection in the client's browser by including appropriate source. By default page located at idpSelectionPath is included.
 * @param request request
 * @param response response
 * @throws ServletException error
 * @throws IOException io error
 */
protected void initializeSelection(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  logger.debug("String_Node_Str");
  request.getRequestDispatcher(idpSelectionPath).forward(request,response);
}
Program: 44757
Project: 44757
Buggy source:
/** 
 * Verifies that entry point will redirect user to IDP selection if login parameter is not set to true and idpSelectionPath is set.
 * @throws Exception error
 */
@Test public void testIDPSelection() throws Exception {
  RequestDispatcher dispatcher=createMock(RequestDispatcher.class);
  entryPoint.setIdpSelectionPath("String_Node_Str");
  expect(request.getParameter(SAMLEntryPoint.LOGIN_PARAMETER)).andReturn("String_Node_Str");
  expect(request.getRequestDispatcher("String_Node_Str")).andReturn(dispatcher);
  expect(request.getHeader("String_Node_Str")).andReturn("String_Node_Str");
  expect(request.getHeader(org.springframework.security.saml.SAMLConstants.PAOS_HTTP_HEADER)).andReturn(null);
  response.setContentType("String_Node_Str");
  dispatcher.include(request,response);
  replay(dispatcher);
  replayMock();
  entryPoint.commence(request,response,null);
  verifyMock();
  verify(dispatcher);
}

Fixed version (ground truth):
/** 
 * Verifies that entry point will redirect user to IDP selection if login parameter is not set to true and idpSelectionPath is set.
 * @throws Exception error
 */
@Test public void testIDPSelection() throws Exception {
  RequestDispatcher dispatcher=createMock(RequestDispatcher.class);
  entryPoint.setIdpSelectionPath("String_Node_Str");
  expect(request.getParameter(SAMLEntryPoint.LOGIN_PARAMETER)).andReturn("String_Node_Str");
  expect(request.getRequestDispatcher("String_Node_Str")).andReturn(dispatcher);
  expect(request.getHeader("String_Node_Str")).andReturn("String_Node_Str");
  expect(request.getHeader(org.springframework.security.saml.SAMLConstants.PAOS_HTTP_HEADER)).andReturn(null);
  dispatcher.forward(request,response);
  replay(dispatcher);
  replayMock();
  entryPoint.commence(request,response,null);
  verifyMock();
  verify(dispatcher);
}
Program: 44758
Project: 44758
Buggy source:
protected void verifyAuthenticationStatement(AuthnStatement auth,BasicSAMLMessageContext context) throws AuthenticationException {
  if (!isDateTimeSkewValid(MAX_AUTHENTICATION_TIME,auth.getAuthnInstant())) {
    log.debug("String_Node_Str",auth.getAuthnInstant());
    throw new CredentialsExpiredException("String_Node_Str");
  }
  if (auth.getSessionNotOnOrAfter() != null && auth.getSessionNotOnOrAfter().isAfter(new Date().getTime())) {
    log.debug("String_Node_Str",auth.getSessionNotOnOrAfter());
    throw new CredentialsExpiredException("String_Node_Str");
  }
  if (auth.getSubjectLocality() != null) {
    HTTPInTransport httpInTransport=(HTTPInTransport)context.getInboundMessageTransport();
    if (auth.getSubjectLocality().getAddress() != null) {
      if (!httpInTransport.getPeerAddress().equals(auth.getSubjectLocality().getAddress())) {
        throw new BadCredentialsException("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
protected void verifyAuthenticationStatement(AuthnStatement auth,BasicSAMLMessageContext context) throws AuthenticationException {
  if (!isDateTimeSkewValid(MAX_AUTHENTICATION_TIME,auth.getAuthnInstant())) {
    log.debug("String_Node_Str",auth.getAuthnInstant());
    throw new CredentialsExpiredException("String_Node_Str");
  }
  if (auth.getSessionNotOnOrAfter() != null && !(new DateTime()).isBefore(auth.getSessionNotOnOrAfter())) {
    log.debug("String_Node_Str",auth.getSessionNotOnOrAfter());
    throw new CredentialsExpiredException("String_Node_Str");
  }
  if (auth.getSubjectLocality() != null) {
    HTTPInTransport httpInTransport=(HTTPInTransport)context.getInboundMessageTransport();
    if (auth.getSubjectLocality().getAddress() != null) {
      if (!httpInTransport.getPeerAddress().equals(auth.getSubjectLocality().getAddress())) {
        throw new BadCredentialsException("String_Node_Str");
      }
    }
  }
}
Program: 44759
Project: 44759
Buggy source:
public void deleteFile(String fileName){
  ArrayList<Integer> tmp=new ArrayList<Integer>();
  if (fileEntry.containsKey(fileName)) {
    int pageEntry=fileEntry.get(fileName);
    int nextEntry=pageEntry;
    for (int i=pageEntry; nextEntry != finalPage; ) {
      tmp.add(nextEntry);
      cleanPage(nextEntry);
      nextEntry=pageAccessTable[i];
      i=nextEntry;
    }
    for (int i=0; i < tmp.size(); i++) {
      markPage(tmp.get(i),freePage);
    }
  }
 else   System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public void deleteFile(String fileName){
  ArrayList<Integer> tmp=new ArrayList<Integer>();
  if (fileEntry.containsKey(fileName)) {
    int pageEntry=fileEntry.get(fileName);
    int nextEntry=pageEntry;
    for (int i=pageEntry; nextEntry != finalPage; ) {
      tmp.add(nextEntry);
      nextEntry=pageAllocateTable[i];
      i=nextEntry;
    }
    for (int i=0; i < tmp.size(); i++) {
      markPage(tmp.get(i),freePage);
    }
    fileEntry.remove(fileName);
  }
 else   System.out.println("String_Node_Str" + fileName + "String_Node_Str");
}
Program: 44760
Project: 44760
Buggy source:
public void openFile(String fileName){
  if (fileEntry.containsKey(fileName)) {
    openFile.add(fileName);
  }
 else   System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public void openFile(String fileName){
  if (fileEntry.containsKey(fileName)) {
    openFile.add(fileName);
  }
 else   System.out.println("String_Node_Str" + fileName + "String_Node_Str");
}
Program: 44761
Project: 44761
Buggy source:
public int getFreePageNum(){
  int flag;
  int freePageNum=-1;
  for (int i=0; i < tableLength; i++) {
    flag=pageAccessTable[i];
    if (flag == 0) {
      freePageNum=i;
      break;
    }
  }
  return freePageNum;
}

Fixed version (ground truth):
public int getFreePageNum(){
  int flag;
  int freePageNum=-1;
  for (int i=0; i < tableLength; i++) {
    flag=pageAllocateTable[i];
    if (flag == 0) {
      freePageNum=i;
      break;
    }
  }
  return freePageNum;
}
Program: 44762
Project: 44762
Buggy source:
public void openDB(){
  try {
    disk.seek(0);
    int flag;
    byte[] pageFlag=new byte[4];
    for (int i=0; i < tableLength; i++) {
      disk.read(pageFlag,0,4);
      flag=byteToInt(pageFlag);
      pageAccessTable[i]=flag;
    }
    if (creatFileEntry == 0) {
      createFile("String_Node_Str");
      creatFileEntry=1;
    }
    StringBuffer sb=new StringBuffer();
    sb=readFile("String_Node_Str");
    String fileName=new String();
    int pageNum=0;
    String[] ss=sb.toString().split("String_Node_Str");
    for (int i=0; i < ss.length - 1; i++) {
      if (i == 0 | i % 2 == 0) {
        fileName=ss[i];
      }
 else {
        pageNum=Integer.parseInt(ss[i]);
      }
      fileEntry.put(fileName,pageNum);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void openDB(){
  try {
    disk.seek(0);
    int flag;
    byte[] pageFlag=new byte[4];
    for (int i=0; i < tableLength; i++) {
      disk.read(pageFlag,0,4);
      flag=byteToInt(pageFlag);
      pageAllocateTable[i]=flag;
    }
    if (creatFileFlag == 0) {
      fileEntry.put("String_Node_Str",fileEntryPageNum);
      markPage(fileEntryPageNum,finalPage);
      creatFileFlag=1;
    }
    StringBuffer sb=new StringBuffer();
    sb=readFile("String_Node_Str");
    String fileName=new String();
    int pageNum=0;
    String[] ss=sb.toString().split("String_Node_Str");
    for (int i=0; i < ss.length - 1; i++) {
      if (i == 0 | i % 2 == 0) {
        fileName=ss[i];
      }
 else {
        pageNum=Integer.parseInt(ss[i]);
      }
      fileEntry.put(fileName,pageNum);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 44763
Project: 44763
Buggy source:
public void createDisk(String diskName){
  try {
    disk=new RandomAccessFile(diskName,"String_Node_Str");
    byte[] diskInit=new byte[diskSize];
    Arrays.fill(diskInit,zero);
    disk.seek(0);
    disk.write(diskInit);
    disk.seek(0);
    for (int i=0; i < tableSize / pageSize; i++) {
      disk.write(dp,0,4);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void createDisk(String diskName){
  try {
    disk=new RandomAccessFile(diskName,"String_Node_Str");
    byte[] diskInit=new byte[diskSize];
    Arrays.fill(diskInit,zero);
    disk.seek(0);
    disk.write(diskInit);
    disk.seek(0);
    for (int i=0; i < tableSize / pageSize + 1; i++) {
      disk.write(dp,0,4);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 44764
Project: 44764
Buggy source:
public boolean createFile(String fileName){
  int pageEntry=-1;
  pageEntry=getFreePageNum();
  fileEntry.put(fileName,pageEntry);
  markPage(pageEntry,finalPage);
  if (pageEntry != -1)   return true;
 else   return false;
}

Fixed version (ground truth):
public boolean createFile(String fileName){
  if (fileEntry.containsKey(fileName)) {
    System.out.println("String_Node_Str");
    return false;
  }
 else {
    int pageEntry=-1;
    pageEntry=getFreePageNum();
    fileEntry.put(fileName,pageEntry);
    markPage(pageEntry,finalPage);
    if (pageEntry != -1)     return true;
 else     return false;
  }
}
Program: 44765
Project: 44765
Buggy source:
public void closeDB(){
  try {
    disk.seek(0);
    int flag;
    byte[] pageFlag=new byte[4];
    for (int i=0; i < tableLength; i++) {
      flag=pageAccessTable[i];
      pageFlag=intToByte(flag);
      disk.write(pageFlag,0,4);
    }
    StringBuffer sb=new StringBuffer();
    String fileName=new String();
    String pageNum=new String();
    Iterator it=fileEntry.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry entry=(Map.Entry)it.next();
      fileName=(String)entry.getKey();
      pageNum=entry.getValue().toString();
      sb.append(fileName).append("String_Node_Str").append(pageNum).append("String_Node_Str");
    }
    openFile("String_Node_Str");
    writeFile("String_Node_Str",sb);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void closeDB(){
  try {
    disk.seek(0);
    int flag;
    byte[] pageFlag=new byte[4];
    for (int i=0; i < tableLength; i++) {
      flag=pageAllocateTable[i];
      pageFlag=intToByte(flag);
      disk.write(pageFlag,0,4);
    }
    StringBuffer sb=new StringBuffer();
    String fileName=new String();
    String pageNum=new String();
    Iterator it=fileEntry.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry entry=(Map.Entry)it.next();
      fileName=(String)entry.getKey();
      pageNum=entry.getValue().toString();
      sb.append(fileName).append("String_Node_Str").append(pageNum).append("String_Node_Str");
    }
    openFile("String_Node_Str");
    writeFile("String_Node_Str",sb);
    fileEntry.clear();
    fileEntry.put("String_Node_Str",200);
    openFile.clear();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 44766
Project: 44766
Buggy source:
public void markPage(int pageNum,int mark){
  pageAccessTable[pageNum]=mark;
}

Fixed version (ground truth):
public void markPage(int pageNum,int mark){
  pageAllocateTable[pageNum]=mark;
}
Program: 44767
Project: 44767
Buggy source:
public StringBuffer readFile(String fileName){
  StringBuffer rs=new StringBuffer();
  if (fileEntry.containsKey(fileName)) {
    int pageEntry=fileEntry.get(fileName);
    int nextEntry=pageEntry;
    byte[] page=new byte[pageSize];
    String s;
    for (int i=pageEntry; nextEntry != finalPage; ) {
      readPage(nextEntry,page);
      s=new String(page);
      rs.append(s);
      nextEntry=pageAccessTable[i];
      i=nextEntry;
    }
    return rs;
  }
 else {
    System.out.println("String_Node_Str");
    rs=null;
    return rs;
  }
}

Fixed version (ground truth):
public StringBuffer readFile(String fileName){
  StringBuffer rs=new StringBuffer();
  if (fileEntry.containsKey(fileName)) {
    int pageEntry=fileEntry.get(fileName);
    int nextEntry=pageEntry;
    byte[] page=new byte[pageSize];
    String s;
    for (int i=pageEntry; nextEntry != finalPage; ) {
      readPage(nextEntry,page);
      s=new String(page);
      rs.append(s);
      nextEntry=pageAllocateTable[i];
      i=nextEntry;
    }
    return rs;
  }
 else {
    System.out.println("String_Node_Str" + fileName + "String_Node_Str");
    rs=null;
    return rs;
  }
}
Program: 44768
Project: 44768
Buggy source:
public void writeFile(String fileName,StringBuffer content){
  if (openFile.contains(fileName)) {
    int pageEntry=fileEntry.get(fileName);
    int nextEntry=pageEntry;
    int prevEntry=pageEntry;
    for (int i=0; i < content.length(); i=i + pageSize) {
      byte[] page=new byte[pageSize];
      page=splitStringToByte(content,i);
      if (i == 0) {
        writePage(pageEntry,page);
        markPage(pageEntry,dirtyPage);
      }
 else {
        prevEntry=nextEntry;
        nextEntry=getFreePageNum();
        writePage(nextEntry,page);
        markPage(prevEntry,nextEntry);
        markPage(nextEntry,dirtyPage);
      }
    }
    markPage(nextEntry,finalPage);
  }
 else   System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public void writeFile(String fileName,StringBuffer content){
  if (openFile.contains(fileName) && fileEntry.containsKey(fileName)) {
    int pageEntry=fileEntry.get(fileName);
    int nextEntry=pageEntry;
    int prevEntry=pageEntry;
    for (int i=0; i < content.length(); i=i + pageSize) {
      byte[] page=new byte[pageSize];
      page=splitStringToByte(content,i);
      if (i == 0) {
        writePage(pageEntry,page);
        markPage(pageEntry,dirtyPage);
      }
 else {
        prevEntry=nextEntry;
        nextEntry=getFreePageNum();
        writePage(nextEntry,page);
        markPage(prevEntry,nextEntry);
        markPage(nextEntry,dirtyPage);
      }
    }
    markPage(nextEntry,finalPage);
  }
 else   System.out.println("String_Node_Str" + fileName);
}
Program: 44769
Project: 44769
Buggy source:
@Override public String call(){
  int sumCD=Integer.parseInt(subtitles.get(index).getSubSumCD());
  if (sumCD != 1 && subtitles.get(0).getTargetFolder() == null)   for (int i=0; i < sumCD; i++) {
    downloadSubtitle(subtitles.get(index + i),true);
  }
 else {
    downloadSubtitle(subtitles.get(index),false);
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String call(){
  int sumCD=Integer.parseInt(subtitles.get(index).getSubSumCD());
  targetFolder=subtitles.get(0).getTargetFolder();
  if (targetFolder == null) {
    for (int i=0; i < sumCD; i++)     try {
      downloadSubtitle(subtitles.get(index + i),true);
    }
 catch (    IOException e) {
      logger.severe("String_Node_Str");
      JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
      return null;
    }
  }
 else   try {
    downloadSubtitle(subtitles.get(index),false);
  }
 catch (  IOException e) {
    logger.severe("String_Node_Str");
    JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
    return null;
  }
  JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE);
  return "String_Node_Str";
}
Program: 44770
Project: 44770
Buggy source:
/** 
 * downloads subtitle file
 * @param subtitle > structure with information about subtitle
 * @param origFileName > if true, subtitle file name will be retrieved from API server, otherwise movie name will be used
 * @return > null if something screwed, proper string otherwise
 */
private String downloadSubtitle(Subtitle subtitle,boolean origFileName){
  String downloadLink=subtitle.getSubDownloadLink();
  String gzFileName="String_Node_Str";
  String targetFolder=subtitle.getTargetFolder();
  String subFileName=null;
  if (origFileName)   subFileName=subtitle.getSubFileName() + "String_Node_Str" + subtitle.getSubFormat();
 else   subFileName=subtitle.getSourceFileName() + "String_Node_Str" + subtitle.getSubFormat();
  if (targetFolder == null) {
    if ((targetFolder=invokeSaveWindow(targetFolder)) == null)     return null;
    targetFolder+=System.getProperty("String_Node_Str");
  }
  try {
    HttpConn.HttpDownloadFile(downloadLink,targetFolder + gzFileName);
  }
 catch (  IOException e) {
    logger.severe("String_Node_Str");
    JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
    return null;
  }
  Zip.unGZip(targetFolder + gzFileName,targetFolder + subFileName,true);
  JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE);
  logger.log(Level.INFO,"String_Node_Str" + targetFolder + subFileName+ "String_Node_Str");
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * downloads subtitle file
 * @param subtitle > structure with information about subtitle
 * @param origFileName > if true, subtitle file name will be retrieved from API server, otherwise movie name will be used
 * @return > null if something screwed, proper string otherwise
 * @throws IOException 
 */
private String downloadSubtitle(Subtitle subtitle,boolean origFileName) throws IOException {
  String downloadLink=subtitle.getSubDownloadLink();
  String gzFileName="String_Node_Str";
  String subFileName=null;
  if (origFileName)   subFileName=subtitle.getSubFileName();
 else   subFileName=subtitle.getSourceFileName() + "String_Node_Str" + subtitle.getSubFormat();
  if (targetFolder == null) {
    if ((targetFolder=invokeSaveWindow(targetFolder)) == null)     return null;
    targetFolder+=System.getProperty("String_Node_Str");
  }
  HttpConn.HttpDownloadFile(downloadLink,targetFolder + gzFileName);
  Zip.unGZip(targetFolder + gzFileName,targetFolder + subFileName,true);
  logger.log(Level.INFO,"String_Node_Str" + targetFolder + subFileName+ "String_Node_Str");
  return "String_Node_Str";
}
Program: 44771
Project: 44771
Buggy source:
/** 
 * show found subtitles in listbox 
 */
private void showSubtitles(){
  if (dontPrint)   return;
  subtitleListModel.clear();
  if (subtitles.size() == 0) {
    subtitleListModel.add(0,"String_Node_Str");
    return;
  }
  for (  Subtitle sub : subtitles) {
    String release="String_Node_Str";
    if (sub.getReleaseName().length() > 2) {
      release=sub.getReleaseName();
      if (release.indexOf("String_Node_Str") != -1)       release=release.substring(release.indexOf("String_Node_Str") + 1);
    }
    String subtitleInfo=sub.getMovieName() + "String_Node_Str" + sub.getMovieYear()+ "String_Node_Str"+ sub.getLanguageName()+ "String_Node_Str"+ sub.getSubDlCount()+ "String_Node_Str"+ "String_Node_Str"+ sub.getSubActualCD()+ "String_Node_Str"+ sub.getSubSumCD()+ "String_Node_Str"+ sub.getSubAddDate()+ "String_Node_Str"+ "String_Node_Str"+ release;
    subtitleListModel.addElement(subtitleInfo);
    sub.setTargetFolder(gui.getSelectedFolder());
    try {
      Thread.sleep(10);
    }
 catch (    InterruptedException eaten) {
    }
  }
  return;
}

Fixed version (ground truth):
/** 
 * show found subtitles in listbox 
 */
private void showSubtitles(){
  if (dontPrint)   return;
  subtitleListModel.clear();
  if (subtitles.size() == 0) {
    subtitleListModel.add(0,"String_Node_Str");
    return;
  }
  for (  Subtitle sub : subtitles) {
    String release="String_Node_Str";
    if (sub.getReleaseName().length() > 2) {
      release=sub.getReleaseName();
      if (release.indexOf("String_Node_Str") != -1)       release=release.substring(release.indexOf("String_Node_Str") + 1);
    }
    String subtitleInfo=sub.getMovieName() + "String_Node_Str" + sub.getMovieYear()+ "String_Node_Str"+ sub.getLanguageName()+ "String_Node_Str"+ sub.getSubDlCount()+ "String_Node_Str"+ "String_Node_Str"+ sub.getSubActualCD()+ "String_Node_Str"+ sub.getSubSumCD()+ "String_Node_Str"+ sub.getSubAddDate()+ "String_Node_Str"+ "String_Node_Str"+ release;
    subtitleListModel.addElement(subtitleInfo);
    if (inputSearch == null)     sub.setTargetFolder(gui.getSelectedFolder());
 else     sub.setTargetFolder(null);
    try {
      Thread.sleep(10);
    }
 catch (    InterruptedException eaten) {
    }
  }
  return;
}