nus-yam/ex-repair huggingface dataset:
Program: 50203
Project: 50203
Buggy source:
@Override public Evaluation evaluate(Path inPath){
  Node curNode=inPath.endNode();
  if (curNode.hasProperty("String_Node_Str")) {
    return Evaluation.EXCLUDE_AND_CONTINUE;
  }
  TLongArrayList curNodeDescendantIds=new TLongArrayList((long[])curNode.getProperty("String_Node_Str"));
  if (!curNodeDescendantIds.containsAll(mrcaTest)) {
    return Evaluation.INCLUDE_AND_CONTINUE;
  }
  TLongArrayList curNodeOutgroupIds=new TLongArrayList((long[])curNode.getProperty("String_Node_Str"));
  if (!curNodeOutgroupIds.containsAll(outmrcaTest)) {
    return Evaluation.INCLUDE_AND_CONTINUE;
  }
  return Evaluation.EXCLUDE_AND_PRUNE;
}

Fixed version (ground truth):
@Override public Evaluation evaluate(Path inPath){
  Node curNode=inPath.endNode();
  if (curNode.hasProperty("String_Node_Str")) {
    return Evaluation.EXCLUDE_AND_CONTINUE;
  }
  TLongArrayList curNodeDescendantIds=new TLongArrayList((long[])curNode.getProperty("String_Node_Str"));
  if (!curNodeDescendantIds.containsAll(mrcaTest)) {
    return Evaluation.INCLUDE_AND_CONTINUE;
  }
  return Evaluation.EXCLUDE_AND_PRUNE;
}
Program: 50207
Project: 50207
Buggy source:
/** 
 * Resolve conflicts among the relationships stored in candidateRels. For more info, see description above for setConflictResolver, and also the ResolutionMethod classes. TODO: include the branch and bound option (new resolver?), size option (new resolver?), others?
 */
private void resolveConflicts(){
  if (resolver != null) {
    bestRels=resolver.resolveConflicts(candidateRels);
  }
 else {
    bestRels=candidateRels;
  }
  System.out.println("String_Node_Str");
  for (  Relationship rel : bestRels) {
    System.out.println("String_Node_Str" + rel.getId());
  }
}

Fixed version (ground truth):
/** 
 * Resolve conflicts among the relationships stored in candidateRels. For more info, see description above for setConflictResolver, and also the ResolutionMethod classes. TODO: include the branch and bound option (new resolver?), size option (new resolver?), others?
 */
private void resolveConflicts(){
  if (resolver != null) {
    bestRels=resolver.resolveConflicts(candidateRels);
  }
 else {
    bestRels=candidateRels;
  }
}
Program: 50209
Project: 50209
Buggy source:
/** 
 * the return codes are 0 - no conflict 1 - regular conflict 2 - candidate contains saved and is compatible
 * @param candidate
 * @param saved
 * @return 
 */
private int testForConflict(Relationship candidate,Relationship saved){
  if (!candRelDescendantIdsMap.containsKey(candidate)) {
    storeDescendants(candidate);
  }
  if (!candRelDescendantIdsMap.containsKey(saved)) {
    storeDescendants(saved);
  }
  if (LicaUtil.containsAnyt4jUnsorted(candRelDescendantIdsMap.get(saved),candRelDescendantIdsMap.get(candidate))) {
    if (candRelDescendantIdsMap.get(candidate).containsAll(candRelDescendantIdsMap.get(saved))) {
      return 2;
    }
    return 1;
  }
 else {
    return 0;
  }
}

Fixed version (ground truth):
/** 
 * tests for conflict and returns a ConflictType from the enum above
 * @param candidate
 * @param saved
 * @return 
 */
private ConflictType testForConflict(Relationship rel1,Relationship rel2){
  if (!candRelDescendantIdsMap.containsKey(rel1)) {
    storeDescendants(rel1);
  }
  if (!candRelDescendantIdsMap.containsKey(rel2)) {
    storeDescendants(rel2);
  }
  if (LicaUtil.containsAnyt4jUnsorted(candRelDescendantIdsMap.get(rel2),candRelDescendantIdsMap.get(rel1))) {
    if (candRelDescendantIdsMap.get(rel1).containsAll(candRelDescendantIdsMap.get(rel2))) {
      return ConflictType.SECOND_SUBSETOF_FIRST;
    }
 else     if (candRelDescendantIdsMap.get(rel2).containsAll(candRelDescendantIdsMap.get(rel1))) {
      return ConflictType.FIRST_SUBSETOF_SECOND;
    }
    return ConflictType.INCOMPATIBLE;
  }
 else {
    return ConflictType.NO_CONFLICT;
  }
}
Program: 50210
Project: 50210
Buggy source:
@Override public Iterable<Relationship> resolveConflicts(Iterable<Relationship> rels){
  initialize();
  Iterator<Relationship> relsIter=rels.iterator();
  HashSet<Relationship> removeSaved=new HashSet<Relationship>();
  while (relsIter.hasNext()) {
    Relationship candidate=relsIter.next();
    System.out.println("String_Node_Str" + candidate.getId() + "String_Node_Str");
    boolean saveRel=true;
    HashSet<Relationship> tremoveSaved=new HashSet<Relationship>();
    for (    Relationship saved : bestRels) {
      int tfc=testForConflict(candidate,saved);
      if (tfc == 1) {
        saveRel=false;
        break;
      }
 else       if (tfc == 2) {
        System.out.println("String_Node_Str" + saved + "String_Node_Str"+ candidate);
        tremoveSaved.add(saved);
      }
    }
    if (saveRel) {
      System.out.println("String_Node_Str" + candidate.getId() + "String_Node_Str");
      bestRels.add(candidate);
      removeSaved.addAll(tremoveSaved);
    }
 else {
      System.out.println("String_Node_Str" + candidate.getId() + "String_Node_Str");
    }
  }
  for (  Relationship rel : removeSaved) {
    System.out.println("String_Node_Str" + rel);
    bestRels.remove(rel);
  }
  return bestRels;
}

Fixed version (ground truth):
@Override public Iterable<Relationship> resolveConflicts(Iterable<Relationship> rels){
  initialize();
  Iterator<Relationship> relsIter=rels.iterator();
  HashSet<Relationship> savedRelsToRemove=new HashSet<Relationship>();
  while (relsIter.hasNext()) {
    Relationship candidate=relsIter.next();
    System.out.println("String_Node_Str" + getIdString(candidate) + "String_Node_Str");
    boolean candidatePassed=true;
    for (    Relationship saved : bestRels) {
      ConflictType tfc=testForConflict(candidate,saved);
      if (tfc == ConflictType.INCOMPATIBLE) {
        System.out.println("String_Node_Str" + getIdString(saved));
        System.out.println("String_Node_Str" + candidate.getId() + "String_Node_Str");
        candidatePassed=false;
        break;
      }
 else       if (tfc == ConflictType.FIRST_SUBSETOF_SECOND) {
        System.out.println("String_Node_Str" + candidate.getId() + "String_Node_Str"+ getIdString(saved)+ "String_Node_Str"+ getIdString(candidate.getEndNode())+ "String_Node_Str");
        candidatePassed=false;
        break;
      }
 else       if (tfc == ConflictType.SECOND_SUBSETOF_FIRST) {
        System.out.println("String_Node_Str" + getIdString(saved) + "String_Node_Str"+ getIdString(candidate));
        savedRelsToRemove.add(saved);
      }
    }
    if (candidatePassed) {
      System.out.println("String_Node_Str" + candidate.getId() + "String_Node_Str");
      bestRels.add(candidate);
    }
    System.out.println("String_Node_Str");
  }
  for (  Relationship rel : savedRelsToRemove) {
    System.out.println("String_Node_Str" + getIdString(rel));
    bestRels.remove(rel);
  }
  return bestRels;
}
Program: 50211
Project: 50211
Buggy source:
private void storeDescendants(Relationship rel){
  TLongArrayList descendantIds=new TLongArrayList((long[])rel.getStartNode().getProperty("String_Node_Str"));
  candRelDescendantIdsMap.put(rel,descendantIds);
  if (descendantIds.size() > 1) {
    String name=null;
    if (rel.getStartNode().hasProperty("String_Node_Str")) {
      name=String.valueOf(rel.getStartNode().getProperty("String_Node_Str"));
    }
 else {
      name=rel.getStartNode().toString();
    }
    System.out.println(name + "String_Node_Str" + descendantIds.size()+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private void storeDescendants(Relationship rel){
  TLongArrayList descendantIds=new TLongArrayList((long[])rel.getStartNode().getProperty("String_Node_Str"));
  candRelDescendantIdsMap.put(rel,descendantIds);
  if (descendantIds.size() > 1) {
    System.out.println("String_Node_Str" + getIdString(rel.getStartNode()) + "String_Node_Str"+ descendantIds.size()+ "String_Node_Str");
  }
}
Program: 50212
Project: 50212
Buggy source:
private static Boolean checkDeprecated(List<Object> metaData){
  Boolean deprecated=false;
  for (  Object meta : metaData) {
    JSONObject j=(JSONObject)meta;
    if (((String)j.get("String_Node_Str")).compareTo("String_Node_Str") == 0) {
      if ((j.get("String_Node_Str")) != null) {
        String currentTag=(String)j.get("String_Node_Str");
        if (currentTag.startsWith("String_Node_Str"))         ;
{
          return true;
        }
      }
 else {
        throw new RuntimeException("String_Node_Str" + j);
      }
    }
  }
  return deprecated;
}

Fixed version (ground truth):
private static Boolean checkDeprecated(List<Object> metaData){
  Boolean deprecated=false;
  for (  Object meta : metaData) {
    JSONObject j=(JSONObject)meta;
    if (((String)j.get("String_Node_Str")).compareTo("String_Node_Str") == 0) {
      if ((j.get("String_Node_Str")) != null) {
        String currentTag=(String)j.get("String_Node_Str");
        if (currentTag.startsWith("String_Node_Str")) {
          return true;
        }
      }
 else {
        throw new RuntimeException("String_Node_Str" + j);
      }
    }
  }
  return deprecated;
}
Program: 50213
Project: 50213
Buggy source:
/** 
 * This will return the MRCA using the taxonomic relationships. This only requires the nodes that we are looking for.
 * @param nodeSet
 * @return
 */
public static Node getTaxonomicLICA(List<Node> nodeSet){
  Node retaln=null;
  Node firstNode=nodeSet.get(0);
  Node innode=firstNode;
  ArrayList<Long> nodeSetLongs=new ArrayList<Long>();
  for (  Node nd : nodeSet) {
    nodeSetLongs.add(nd.getId());
  }
  boolean going=true;
  while (going) {
    innode=innode.getSingleRelationship(RelTypes.TAXCHILDOF,Direction.OUTGOING).getEndNode();
    long[] dbnodei=(long[])innode.getProperty("String_Node_Str");
    HashSet<Long> Ldbnodei=new HashSet<Long>();
    for (    long temp : dbnodei) {
      Ldbnodei.add(temp);
    }
    boolean containsall=Ldbnodei.containsAll(nodeSetLongs);
    if (containsall == true) {
      retaln=innode;
      going=false;
    }
    if (going == false) {
      break;
    }
  }
  return retaln;
}

Fixed version (ground truth):
/** 
 * This will return the MRCA using the taxonomic relationships. This only requires the nodes that we are looking for.
 * @param nodeSet
 * @return
 */
public static Node getTaxonomicLICA(List<Node> nodeSet){
  Node retaln=null;
  Node firstNode=nodeSet.get(0);
  Node innode=firstNode;
  ArrayList<Long> nodeSetLongs=new ArrayList<Long>();
  for (  Node nd : nodeSet) {
    nodeSetLongs.add(nd.getId());
  }
  boolean going=true;
  while (going) {
    try {
      innode=innode.getSingleRelationship(RelTypes.TAXCHILDOF,Direction.OUTGOING).getEndNode();
    }
 catch (    Exception e) {
      break;
    }
    long[] dbnodei=(long[])innode.getProperty("String_Node_Str");
    HashSet<Long> Ldbnodei=new HashSet<Long>();
    for (    long temp : dbnodei) {
      Ldbnodei.add(temp);
    }
    boolean containsall=Ldbnodei.containsAll(nodeSetLongs);
    if (containsall == true) {
      retaln=innode;
      going=false;
    }
    if (going == false) {
      break;
    }
  }
  return retaln;
}
Program: 50215
Project: 50215
Buggy source:
public static boolean writePropertyNameColonIfFound(StringBuffer buffer,Node nd,String propertyName,boolean prependComma){
  if (nd.hasProperty(propertyName)) {
    if (prependComma) {
      buffer.append("String_Node_Str");
    }
 else {
      buffer.append("String_Node_Str");
    }
    buffer.append(propertyName);
    buffer.append("String_Node_Str");
    return true;
  }
  return false;
}

Fixed version (ground truth):
public static boolean writePropertyNameColonIfFound(StringBuffer buffer,Node nd,String propertyName,boolean prependComma){
  if (nd.hasProperty(propertyName)) {
    if (prependComma) {
      buffer.append("String_Node_Str");
    }
    escapePropertyColon(buffer,propertyName);
    return true;
  }
  return false;
}
Program: 50216
Project: 50216
Buggy source:
public static void writeSourceToMetaMapForArgus(StringBuffer buffer,Object n2m){
  buffer.append("String_Node_Str");
  HashMap<String,Node> name2metanode=(HashMap<String,Node>)n2m;
  boolean first=true;
  for (  Map.Entry<String,Node> n2mEl : name2metanode.entrySet()) {
    if (first) {
      first=false;
    }
 else {
      buffer.append("String_Node_Str");
    }
    String source=n2mEl.getKey();
    Node metadataNode=n2mEl.getValue();
    buffer.append("String_Node_Str");
    buffer.append(source);
    buffer.append("String_Node_Str");
    if (metadataNode == null) {
      buffer.append("String_Node_Str");
    }
 else {
      boolean prevProperties=false;
      buffer.append("String_Node_Str");
      prevProperties=writeStringPropertyIfFound(buffer,metadataNode,"String_Node_Str",prevProperties);
      prevProperties=writeStringPropertyIfFound(buffer,metadataNode,"String_Node_Str",prevProperties);
      prevProperties=writeStringPropertyIfFound(buffer,metadataNode,"String_Node_Str",prevProperties);
      prevProperties=writeStringPropertyIfFound(buffer,metadataNode,"String_Node_Str",prevProperties);
      prevProperties=writeStringPropertyIfFound(buffer,metadataNode,"String_Node_Str",prevProperties);
      prevProperties=writeIntegerPropertyIfFound(buffer,metadataNode,"String_Node_Str",prevProperties);
      buffer.append("String_Node_Str");
    }
  }
  buffer.append("String_Node_Str");
}

Fixed version (ground truth):
public static void writeSourceToMetaMapForArgus(StringBuffer buffer,Object n2m){
  buffer.append("String_Node_Str");
  HashMap<String,Node> name2metanode=(HashMap<String,Node>)n2m;
  boolean first=true;
  for (  Map.Entry<String,Node> n2mEl : name2metanode.entrySet()) {
    if (first) {
      first=false;
    }
 else {
      buffer.append("String_Node_Str");
    }
    String source=n2mEl.getKey();
    Node metadataNode=n2mEl.getValue();
    if (source == null || source.length() == 0) {
      escapePropertyColon(buffer,"String_Node_Str");
    }
 else {
      escapePropertyColon(buffer,source);
    }
    if (metadataNode == null) {
      buffer.append("String_Node_Str");
    }
 else {
      boolean wrotePrev=false;
      buffer.append("String_Node_Str");
      wrotePrev=writeStringPropertyIfFound(buffer,metadataNode,"String_Node_Str",wrotePrev) || wrotePrev;
      wrotePrev=writeStringPropertyIfFound(buffer,metadataNode,"String_Node_Str",wrotePrev) || wrotePrev;
      wrotePrev=writeStringPropertyIfFound(buffer,metadataNode,"String_Node_Str",wrotePrev) || wrotePrev;
      wrotePrev=writeStringPropertyIfFound(buffer,metadataNode,"String_Node_Str",wrotePrev) || wrotePrev;
      wrotePrev=writeStringPropertyIfFound(buffer,metadataNode,"String_Node_Str",wrotePrev) || wrotePrev;
      wrotePrev=writeIntegerPropertyIfFound(buffer,metadataNode,"String_Node_Str",wrotePrev) || wrotePrev;
      buffer.append("String_Node_Str");
    }
  }
  buffer.append("String_Node_Str");
}
Program: 50219
Project: 50219
Buggy source:
/** 
 * Get the list of sources that have been loaded in the graph
 */
public String getSourceList(){
  StringBuffer sb=new StringBuffer();
  IndexHits<Node> hits=sourceMetaIndex.query("String_Node_Str");
  while (hits.hasNext()) {
    Node n=hits.next();
    sb.append(n.getProperty("String_Node_Str") + "String_Node_Str");
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Get the list of sources that have been loaded in the graph
 */
public String getSourceList(){
  StringBuffer sb=new StringBuffer();
  IndexHits<Node> hits=sourceMetaIndex.query("String_Node_Str","String_Node_Str");
  while (hits.hasNext()) {
    Node n=hits.next();
    sb.append(n.getProperty("String_Node_Str") + "String_Node_Str");
  }
  return sb.toString();
}
Program: 50222
Project: 50222
Buggy source:
private static LinkedList<Node> getAncestorsPlusSelf(Node node,RelationshipExpander expander){
  LinkedList<Node> ancestors=new LinkedList<Node>();
  ancestors.add(node);
  Iterator<Relationship> relIterator=expander.expand(node).iterator();
  while (relIterator.hasNext()) {
    Relationship rel=relIterator.next();
    node=rel.getOtherNode(node);
    ancestors.add(node);
    relIterator=expander.expand(node).iterator();
  }
  return ancestors;
}

Fixed version (ground truth):
/** 
 * Returns a list of nodes starting at `node` and including every node  in the "first" path created using the RelationshipExpander to the root. For instance if `expander` was created using Traversal.expanderForTypes(RelTypes.MRCACHILDOF, Direction.OUTGOING) then this function will return `node` and all of its ancestors.
 * @param node starting Node
 * @param expander RelationshipExpander wraps a relationship that should not contain any cycles
 * @return LinkedList of nodes whichi starts with `node` and includeseach first node returned by the iterator created by calling   expander.expand(node).iterator();
 */
private static LinkedList<Node> getAncestorsPlusSelf(Node node,RelationshipExpander expander){
  LinkedList<Node> ancestors=new LinkedList<Node>();
  ancestors.add(node);
  Iterator<Relationship> relIterator=expander.expand(node).iterator();
  while (relIterator.hasNext()) {
    Relationship rel=relIterator.next();
    node=rel.getOtherNode(node);
    ancestors.add(node);
    relIterator=expander.expand(node).iterator();
  }
  return ancestors;
}
Program: 50223
Project: 50223
Buggy source:
private static void lookForCommonAncestor(LinkedList<Node> commonAncestors,Node currentNode,RelationshipExpander expander){
  while (currentNode != null) {
    for (int i=0; i < commonAncestors.size(); i++) {
      Node node=commonAncestors.get(i);
      if (node.getId() == currentNode.getId()) {
        for (int j=0; j < i; j++) {
          commonAncestors.pollFirst();
        }
        return;
      }
    }
    Iterator<Relationship> relIt=expander.expand(currentNode).iterator();
    if (relIt.hasNext()) {
      Relationship rel=relIt.next();
      currentNode=rel.getOtherNode(currentNode);
    }
 else {
      currentNode=null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Shortens the commonAncestors list, such that it starts with the first element of commonAncestors which is an ancestor of currentNode. If none of the 
 * @param commonAncestors LinkedList of Nodes that should represent a node -> root path
 * @param expander RelationshipExpander wraps a relationship that should not contain any cycles (e.g. the node->root path via a Traversal.expanderForTypes(RelTypes.MRCACHILDOF, Direction.OUTGOING) )
 * @return true if a common ancestor is found, or false indicating that `commonAncestors` did not have a node in the path that started with `currentNode'
 */
private static boolean lookForCommonAncestor(LinkedList<Node> commonAncestors,Node currentNode,RelationshipExpander expander){
  while (currentNode != null) {
    for (int i=0; i < commonAncestors.size(); i++) {
      Node node=commonAncestors.get(i);
      if (node.getId() == currentNode.getId()) {
        for (int j=0; j < i; j++) {
          commonAncestors.pollFirst();
        }
        return true;
      }
    }
    Iterator<Relationship> relIt=expander.expand(currentNode).iterator();
    if (relIt.hasNext()) {
      Relationship rel=relIt.next();
      currentNode=rel.getOtherNode(currentNode);
    }
 else {
      currentNode=null;
    }
  }
  return false;
}
Program: 50224
Project: 50224
Buggy source:
/** 
 * @param nodeSet Set of nodes for which the LCA will be found.
 * @param relationshipType Relationship type used to look for the LCA
 * @param relationshipDirection Direction of the relationships used (seen from the descendant node)
 * @return The LCA node if there's one, null otherwise.
 */
public static Node lowestCommonAncestor(List<Node> nodeSet,RelationshipExpander expander){
  Node lowerCommonAncestor=null;
  if (nodeSet.size() > 1) {
    Node firstNode=nodeSet.get(0);
    LinkedList<Node> firstAncestors=getAncestorsPlusSelf(firstNode,expander);
    for (int i=1; i < nodeSet.size() && !firstAncestors.isEmpty(); i++) {
      Node currentNode=nodeSet.get(i);
      lookForCommonAncestor(firstAncestors,currentNode,expander);
    }
    if (!firstAncestors.isEmpty()) {
      lowerCommonAncestor=firstAncestors.get(0);
    }
  }
  return lowerCommonAncestor;
}

Fixed version (ground truth):
/** 
 * Return the lowest common ancestor of the nodes in `nodeSet` or null (if they do not share a common ancestor).
 * @param nodeSet Set of nodes for which the LCA will be found.
 * @param expander RelationshipExpander which determines which relationships will be traversed when looking for the least common ancestor
 * @return The LCA node if there's one, null otherwise.
 */
public static Node lowestCommonAncestor(List<Node> nodeSet,RelationshipExpander expander){
  Node lowerCommonAncestor=null;
  if (nodeSet.size() > 1) {
    Node firstNode=nodeSet.get(0);
    LinkedList<Node> firstAncestors=getAncestorsPlusSelf(firstNode,expander);
    for (int i=1; i < nodeSet.size() && !firstAncestors.isEmpty(); i++) {
      Node currentNode=nodeSet.get(i);
      if (!lookForCommonAncestor(firstAncestors,currentNode,expander)) {
        return null;
      }
    }
    if (!firstAncestors.isEmpty()) {
      lowerCommonAncestor=firstAncestors.get(0);
    }
  }
  return lowerCommonAncestor;
}
Program: 50225
Project: 50225
Buggy source:
private void processMRCAS(){
  for (int i=0; i < jt.getInternalNodeCount(); i++) {
    JadeNode tnode=jt.getInternalNode(i);
    ArrayList<JadeNode> nds=tnode.getTips();
    ArrayList<Node> hit_nodes=new ArrayList<Node>();
    for (int j=0; j < nds.size(); j++) {
      IndexHits<Node> hits=nodeIndex.get("String_Node_Str",nds.get(j).getName().replace("String_Node_Str","String_Node_Str"));
      hit_nodes.add(hits.getSingle());
      Node tnode1=hits.getSingle();
      hits.close();
    }
    expander=Traversal.expanderForTypes(RelTypes.CHILDOF,Direction.OUTGOING);
    Node ancestor=AncestorUtil.lowestCommonAncestor(hit_nodes,expander);
    System.out.println(ancestor.getProperty("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void processMRCAS(){
  for (int i=0; i < jt.getInternalNodeCount(); i++) {
    JadeNode tnode=jt.getInternalNode(i);
    ArrayList<JadeNode> nds=tnode.getTips();
    ArrayList<Node> hit_nodes=new ArrayList<Node>();
    for (int j=0; j < nds.size(); j++) {
      IndexHits<Node> hits=nodeIndex.get("String_Node_Str",nds.get(j).getName().replace("String_Node_Str","String_Node_Str"));
      hit_nodes.add(hits.getSingle());
      Node tnode1=hits.getSingle();
      hits.close();
    }
    expander=Traversal.expanderForTypes(RelTypes.MRCACHILDOF,Direction.OUTGOING);
    Node ancestor=AncestorUtil.lowestCommonAncestor(hit_nodes,expander);
    System.out.println(ancestor.getProperty("String_Node_Str"));
  }
}
Program: 50226
Project: 50226
Buggy source:
public void preProcessTree(String filename){
  TreeReader tr=new TreeReader();
  String ts="String_Node_Str";
  try {
    BufferedReader br=new BufferedReader(new FileReader(filename));
    ts=br.readLine();
    br.close();
  }
 catch (  IOException ioe) {
  }
  tr.setTree(ts);
  jt=tr.readTree();
  processMRCAS();
}

Fixed version (ground truth):
public void preProcessTree(String filename){
  TreeReader tr=new TreeReader();
  String ts="String_Node_Str";
  try {
    BufferedReader br=new BufferedReader(new FileReader(filename));
    ts=br.readLine();
    br.close();
  }
 catch (  IOException ioe) {
  }
  tr.setTree(ts);
  jt=tr.readTree();
  System.out.println("String_Node_Str");
  System.exit(0);
}
Program: 50227
Project: 50227
Buggy source:
public static void printHelp(){
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.exit(0);
}

Fixed version (ground truth):
public static void printHelp(){
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.exit(0);
}
Program: 50228
Project: 50228
Buggy source:
/** 
 * @param args
 */
public static void main(String[] args){
  System.out.println("String_Node_Str");
  if (args.length < 3) {
    printHelp();
  }
 else   if (args[0] == "String_Node_Str") {
    printHelp();
  }
 else {
    System.out.println("String_Node_Str");
    MainRunner mr=new MainRunner();
    if (args.length != 3) {
      System.err.println("String_Node_Str");
      printHelp();
    }
    if (args[0].compareTo("String_Node_Str") == 0 || args[0].compareTo("String_Node_Str") == 0) {
      mr.taxonomyLoadParser(args);
    }
 else     if (args[0].compareTo("String_Node_Str") == 0) {
      mr.taxonomyQueryParser(args);
    }
 else     if (args[0].compareTo("String_Node_Str") == 0) {
      mr.graphImporterParser(args);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param args
 */
public static void main(String[] args){
  System.out.println("String_Node_Str");
  if (args.length < 3) {
    printHelp();
  }
 else   if (args[0] == "String_Node_Str") {
    printHelp();
  }
 else {
    System.out.println("String_Node_Str");
    MainRunner mr=new MainRunner();
    if (args.length != 3) {
      System.err.println("String_Node_Str");
      printHelp();
    }
    if (args[0].compareTo("String_Node_Str") == 0 || args[0].compareTo("String_Node_Str") == 0) {
      mr.taxonomyLoadParser(args);
    }
 else     if (args[0].compareTo("String_Node_Str") == 0) {
      mr.taxonomyQueryParser(args);
    }
 else     if (args[0].compareTo("String_Node_Str") == 0 || args[0].compareTo("String_Node_Str") == 0) {
      mr.graphImporterParser(args);
    }
  }
}
Program: 50229
Project: 50229
Buggy source:
public void graphImporterParser(String[] args){
  String filename=args[1];
  String graphname=args[2];
  GraphImporter gi=new GraphImporter(graphname);
  if (args[0].compareTo("String_Node_Str") == 0) {
    System.out.println("String_Node_Str" + filename);
    gi.preProcessTree(filename);
  }
 else {
    System.err.println("String_Node_Str");
    gi.shutdownDB();
    printHelp();
  }
  gi.shutdownDB();
}

Fixed version (ground truth):
public void graphImporterParser(String[] args){
  String filename=args[1];
  String graphname=args[2];
  GraphImporter gi=new GraphImporter(graphname);
  if (args[0].compareTo("String_Node_Str") == 0) {
    System.out.println("String_Node_Str" + filename);
    gi.preProcessTree(filename);
    gi.processMRCAS();
  }
 else   if (args[0].compareTo("String_Node_Str") == 0) {
    System.out.println("String_Node_Str" + filename);
    gi.preProcessTree(filename);
    gi.initializeGraphDB();
  }
 else {
    System.err.println("String_Node_Str");
    gi.shutdownDB();
    printHelp();
  }
  gi.shutdownDB();
}
Program: 50233
Project: 50233
Buggy source:
/** 
 * Main method.
 * @param args command line args.
 * @throws com.martiansoftware.jsap.JSAPException error parsing
 * @throws java.io.IOException error parsing or executing.
 */
public static void main(final String[] args) throws JSAPException, IOException {
  new SuggestPositionSlicesMode().configure(args).execute();
}

Fixed version (ground truth):
/** 
 * Main method.
 * @param args command line args.
 * @throws com.martiansoftware.jsap.JSAPException error parsing
 * @throws java.io.IOException                    error parsing or executing.
 */
public static void main(final String[] args) throws JSAPException, IOException {
  new SuggestPositionSlicesMode().configure(args).execute();
}
Program: 50234
Project: 50234
Buggy source:
/** 
 * Configure.
 * @param args command line arguments
 * @return this object for chaining
 * @throws java.io.IOException error parsing
 * @throws com.martiansoftware.jsap.JSAPException error parsing
 */
@Override public AbstractCommandLineMode configure(final String[] args) throws IOException, JSAPException {
  final JSAPResult jsapResult=parseJsapArguments(args);
  final String[] inputFiles=jsapResult.getStringArray("String_Node_Str");
  basenames=AlignmentReaderImpl.getBasenames(inputFiles);
  annotationFilename=jsapResult.getString("String_Node_Str");
  outputFilename=jsapResult.getString("String_Node_Str");
  modulo=jsapResult.getInt("String_Node_Str");
  numberOfSlices=jsapResult.getInt("String_Node_Str");
  numBytesPerSlice=jsapResult.getInt("String_Node_Str");
  if (!(jsapResult.userSpecified("String_Node_Str") || jsapResult.userSpecified("String_Node_Str"))) {
    System.err.println("String_Node_Str");
    System.exit(1);
  }
  restrictPerChromosome=jsapResult.getBoolean("String_Node_Str");
  if (jsapResult.userSpecified("String_Node_Str") && jsapResult.userSpecified("String_Node_Str")) {
    System.err.println("String_Node_Str");
    System.exit(1);
  }
  useModulo=jsapResult.userSpecified("String_Node_Str");
  if (!useModulo)   System.err.println("String_Node_Str" + numBytesPerSlice);
  return this;
}

Fixed version (ground truth):
/** 
 * Configure.
 * @param args command line arguments
 * @return this object for chaining
 * @throws java.io.IOException                    error parsing
 * @throws com.martiansoftware.jsap.JSAPException error parsing
 */
@Override public AbstractCommandLineMode configure(final String[] args) throws IOException, JSAPException {
  final JSAPResult jsapResult=parseJsapArguments(args);
  final String[] inputFiles=jsapResult.getStringArray("String_Node_Str");
  basenames=AlignmentReaderImpl.getBasenames(inputFiles);
  annotationFilename=jsapResult.getString("String_Node_Str");
  outputFilename=jsapResult.getString("String_Node_Str");
  modulo=jsapResult.getInt("String_Node_Str");
  numberOfSlices=jsapResult.getInt("String_Node_Str");
  numBytesPerSlice=jsapResult.getInt("String_Node_Str");
  if (!(jsapResult.userSpecified("String_Node_Str") || jsapResult.userSpecified("String_Node_Str"))) {
    System.err.println("String_Node_Str");
    System.exit(1);
  }
  restrictPerChromosome=jsapResult.getBoolean("String_Node_Str");
  if (jsapResult.userSpecified("String_Node_Str") && jsapResult.userSpecified("String_Node_Str")) {
    System.err.println("String_Node_Str");
    System.exit(1);
  }
  useModulo=jsapResult.userSpecified("String_Node_Str");
  if (!useModulo)   System.err.println("String_Node_Str" + numBytesPerSlice);
  return this;
}
Program: 50236
Project: 50236
Buggy source:
private void recordNumAlignedReads(String[] inputFilenames){
  numMatchedReads=new int[samples.length];
  String[] sampleIds=AlignmentReaderImpl.getBasenames(inputFilenames);
  for (int i=0; i < sampleIds.length; i++) {
    sampleIds[i]=FilenameUtils.getName(sampleIds[i]);
    if (sampleIds[i].equals(samples[i])) {
      numMatchedReads[i]=Math.min(1,getNumMatchedReads(inputFilenames[i]));
    }
  }
}

Fixed version (ground truth):
private void recordNumAlignedReads(String[] inputFilenames){
  numMatchedReads=new int[samples.length];
  String[] sampleIds=AlignmentReaderImpl.getBasenames(inputFilenames);
  for (int i=0; i < sampleIds.length; i++) {
    sampleIds[i]=FilenameUtils.getName(sampleIds[i]);
    if (sampleIds[i].equals(samples[i])) {
      numMatchedReads[i]=Math.max(1,getNumMatchedReads(inputFilenames[i]));
    }
  }
}
Program: 50237
Project: 50237
Buggy source:
/** 
 * Simply order eir by to string, alphabetically.
 * @param eir1 first indel
 * @param eir2 second indel
 * @return sort order
 */
@Override public int compare(final EquivalentIndelRegion eir1,final EquivalentIndelRegion eir2){
  return eir1.to.compareTo(eir2.to);
}

Fixed version (ground truth):
/** 
 * Simply order eir by to string, alphabetically.
 * @param eir1 first indel
 * @param eir2 second indel
 * @return sort order
 */
public int compare(final EquivalentIndelRegion eir1,final EquivalentIndelRegion eir2){
  return eir1.to.compareTo(eir2.to);
}
Program: 50238
Project: 50238
Buggy source:
boolean isPossibleSomaticVariation(SampleCountInfo[] sampleCounts){
}

Fixed version (ground truth):
boolean isPossibleSomaticVariation(SampleCountInfo[] sampleCounts){
  for (  int sampleIndex : somaticSampleIndices) {
    SampleCountInfo somaticCounts=sampleCounts[sampleIndex];
    for (int genotypeIndex=0; genotypeIndex < somaticCounts.getGenotypeMaxIndex(); genotypeIndex++) {
      boolean parentHasGenotype=false;
      boolean strict=true;
      float maxGermlineOrParentsFrequency=0;
      int fatherSampleIndex=sample2FatherSampleIndex[sampleIndex];
      int minGermlineCoverage=Integer.MAX_VALUE;
      if (fatherSampleIndex != -1) {
        SampleCountInfo fatherCounts=sampleCounts[fatherSampleIndex];
        minGermlineCoverage=Math.min(fatherCounts.coverage(),minGermlineCoverage);
        parentHasGenotype|=fatherCounts.getGenotypeCount(genotypeIndex) > fatherCounts.failedCount;
        maxGermlineOrParentsFrequency=Math.max(maxGermlineOrParentsFrequency,fatherCounts.frequency(genotypeIndex));
      }
      int motherSampleIndex=sample2MotherSampleIndex[sampleIndex];
      if (motherSampleIndex != -1) {
        SampleCountInfo motherCounts=sampleCounts[motherSampleIndex];
        minGermlineCoverage=Math.min(motherCounts.coverage(),minGermlineCoverage);
        parentHasGenotype|=motherCounts.getGenotypeCount(genotypeIndex) > motherCounts.failedCount;
        maxGermlineOrParentsFrequency=Math.max(maxGermlineOrParentsFrequency,motherCounts.frequency(genotypeIndex));
      }
      boolean germlineHasPhenotype=false;
      int germlineSampleIndices[]=sample2GermlineSampleIndices[sampleIndex];
      for (      int germlineSampleIndex : germlineSampleIndices) {
        if (germlineSampleIndex != -1) {
          SampleCountInfo germlineCounts=sampleCounts[germlineSampleIndex];
          minGermlineCoverage=Math.min(germlineCounts.coverage(),minGermlineCoverage);
          germlineHasPhenotype|=germlineCounts.getGenotypeCount(genotypeIndex) >= 10;
          maxGermlineOrParentsFrequency=Math.max(maxGermlineOrParentsFrequency,germlineCounts.frequency(genotypeIndex));
        }
      }
      boolean somaticHasGenotype=somaticCounts.getGenotypeCount(genotypeIndex) > 0;
      if (parentHasGenotype || germlineHasPhenotype || !somaticHasGenotype) {
        isSomaticCandidate[sampleIndex][genotypeIndex]=false;
        isStrictSomaticCandidate[sampleIndex][genotypeIndex]=false;
      }
 else {
        int somaticCoverage=sampleCounts[sampleIndex].coverage();
        if (minGermlineCoverage < somaticCoverage / 2) {
          isSomaticCandidate[sampleIndex][genotypeIndex]=false;
        }
 else {
          if (somaticCounts.frequency(genotypeIndex) > 3 * maxGermlineOrParentsFrequency) {
            isSomaticCandidate[sampleIndex][genotypeIndex]=true;
          }
          isStrictSomaticCandidate[sampleIndex][genotypeIndex]=strict && isSomaticCandidate[sampleIndex][genotypeIndex];
        }
      }
    }
  }
  return isSomaticCandidate();
}
Program: 50240
Project: 50240
Buggy source:
private DiscoverVariantPositionData makeListWithScoresStranded(SampleCountInfo[] sampleCounts,IntArrayList qualityScores){
  IntIterator nextQualityIterator=qualityScores.iterator();
  DiscoverVariantPositionData list=new DiscoverVariantPositionData();
  for (  SampleCountInfo sampleInfo : sampleCounts) {
    for (int baseIndex=0; baseIndex < SampleCountInfo.BASE_MAX_INDEX; baseIndex++) {
      for (int i=0; i < sampleInfo.getGenotypeCount(baseIndex,true); i++) {
        PositionBaseInfo info=new PositionBaseInfo();
        nextQualityIterator=makeBase(true,qualityScores,nextQualityIterator,list,sampleInfo,baseIndex,info);
      }
      for (int i=0; i < sampleInfo.getGenotypeCount(baseIndex,false); i++) {
        PositionBaseInfo info=new PositionBaseInfo();
        nextQualityIterator=makeBase(false,qualityScores,nextQualityIterator,list,sampleInfo,baseIndex,info);
      }
    }
  }
  return list;
}

Fixed version (ground truth):
private DiscoverVariantPositionData makeListWithScoresStranded(SampleCountInfo[] sampleCounts,IntArrayList qualityScores){
  IntIterator nextQualityIterator=qualityScores.iterator();
  DiscoverVariantPositionData list=new DiscoverVariantPositionData();
  for (  SampleCountInfo sampleInfo : sampleCounts) {
    for (int baseIndex=0; baseIndex < SampleCountInfo.BASE_MAX_INDEX; baseIndex++) {
      for (int i=0; i < sampleInfo.getGenotypeCount(baseIndex,true); i++) {
        nextQualityIterator=makeBase(true,qualityScores,nextQualityIterator,list,sampleInfo,baseIndex);
      }
      for (int i=0; i < sampleInfo.getGenotypeCount(baseIndex,false); i++) {
        nextQualityIterator=makeBase(false,qualityScores,nextQualityIterator,list,sampleInfo,baseIndex);
      }
    }
  }
  return list;
}
Program: 50241
Project: 50241
Buggy source:
private DiscoverVariantPositionData makeListWithScores(SampleCountInfo[] sampleCounts,IntArrayList qualityScores){
  IntIterator nextQualityIterator=qualityScores.iterator();
  DiscoverVariantPositionData list=new DiscoverVariantPositionData();
  for (  SampleCountInfo sampleInfo : sampleCounts) {
    for (int baseIndex=0; baseIndex < SampleCountInfo.BASE_MAX_INDEX; baseIndex++) {
      for (int i=0; i < sampleInfo.getGenotypeCount(baseIndex); i++) {
        PositionBaseInfo info=new PositionBaseInfo();
        nextQualityIterator=makeBase(true,qualityScores,nextQualityIterator,list,sampleInfo,baseIndex,info);
      }
    }
  }
  return list;
}

Fixed version (ground truth):
private DiscoverVariantPositionData makeListWithScores(SampleCountInfo[] sampleCounts,IntArrayList qualityScores){
  IntIterator nextQualityIterator=qualityScores.iterator();
  DiscoverVariantPositionData list=new DiscoverVariantPositionData();
  for (  SampleCountInfo sampleInfo : sampleCounts) {
    for (int baseIndex=0; baseIndex < SampleCountInfo.BASE_MAX_INDEX; baseIndex++) {
      for (int i=0; i < sampleInfo.getGenotypeCount(baseIndex,true); i++) {
        nextQualityIterator=makeBase(true,qualityScores,nextQualityIterator,list,sampleInfo,baseIndex);
      }
    }
  }
  return list;
}
Program: 50242
Project: 50242
Buggy source:
@Test public void testAdjustVarCount(){
  QualityScoreFilter adjuster1=new QualityScoreFilter();
  adjuster1.setNoRandomSampling(true);
  LeftOverFilter adjuster2=new LeftOverFilter(0);
  SampleCountInfo[] sampleCounts=makeTwoSampleCounts();
  assertEquals(5,sampleCounts[0].refCount);
  assertEquals(11,sampleCounts[0].varCount);
  assertEquals(10,sampleCounts[1].refCount);
  assertEquals(6,sampleCounts[1].varCount);
  IntArrayList scores=IntArrayList.wrap(new int[]{10,20,30,40,40,40,40});
  final DiscoverVariantPositionData list=makeListWithScores(sampleCounts,scores);
  assertEquals(Arrays.toString(list.elements()),"String_Node_Str");
  assertEquals(32,list.size());
  ObjectSet<PositionBaseInfo> filteredList=new ObjectArraySet<PositionBaseInfo>();
  adjuster1.filterGenotypes(list,sampleCounts,filteredList);
  adjuster2.filterGenotypes(list,sampleCounts,filteredList);
  System.out.println("String_Node_Str" + list);
  System.out.println("String_Node_Str" + filteredList);
  CountFixer fixer=new CountFixer();
  fixer.fix(list,sampleCounts,filteredList);
  assertEquals(Arrays.toString(sampleCounts),"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  assertEquals("String_Node_Str",filteredList.toString());
  assertEquals(20,filteredList.size());
  assertEquals(0,sampleCounts[0].refCount);
  assertEquals(0,sampleCounts[0].varCount);
  assertEquals(10,sampleCounts[1].refCount);
  assertEquals(6 - 6,sampleCounts[1].varCount);
}

Fixed version (ground truth):
@Test public void testAdjustVarCount(){
  QualityScoreFilter adjuster1=new QualityScoreFilter();
  adjuster1.setNoRandomSampling(true);
  LeftOverFilter adjuster2=new LeftOverFilter(0);
  SampleCountInfo[] sampleCounts=makeTwoSampleCounts();
  assertEquals(5,sampleCounts[0].refCount);
  assertEquals(11,sampleCounts[0].varCount);
  assertEquals(10,sampleCounts[1].refCount);
  assertEquals(6,sampleCounts[1].varCount);
  IntArrayList scores=IntArrayList.wrap(new int[]{10,20,30,40,40,40,40});
  final DiscoverVariantPositionData list=makeListWithScores(sampleCounts,scores);
  assertEquals(32,list.size());
  ObjectSet<PositionBaseInfo> filteredList=new ObjectArraySet<PositionBaseInfo>();
  adjuster1.filterGenotypes(list,sampleCounts,filteredList);
  adjuster2.filterGenotypes(list,sampleCounts,filteredList);
  System.out.println("String_Node_Str" + list);
  System.out.println("String_Node_Str" + filteredList);
  CountFixer fixer=new CountFixer();
  fixer.fix(list,sampleCounts,filteredList);
  assertEquals(20,filteredList.size());
  assertEquals(0,sampleCounts[0].refCount);
  assertEquals(0,sampleCounts[0].varCount);
  assertEquals(10,sampleCounts[1].refCount);
  assertEquals(6 - 6,sampleCounts[1].varCount);
}
Program: 50243
Project: 50243
Buggy source:
private IntIterator makeBase(boolean strandMatchedForward,IntArrayList qualityScores,IntIterator nextQualityIterator,DiscoverVariantPositionData list,SampleCountInfo sampleInfo,int baseIndex,PositionBaseInfo info){
  final char base=sampleInfo.base(baseIndex);
  info.to=base;
  if (base == 'A') {
    info.matchesReference=true;
    info.from=base;
    info.matchesForwardStrand=strandMatchedForward;
  }
  info.readerIndex=sampleInfo.sampleIndex;
  if (!nextQualityIterator.hasNext()) {
    nextQualityIterator=qualityScores.iterator();
  }
  info.readIndex=1;
  info.qualityScore=(byte)nextQualityIterator.nextInt();
  list.add(info);
  System.out.println("String_Node_Str" + info);
  return nextQualityIterator;
}

Fixed version (ground truth):
private IntIterator makeBase(boolean strandMatchedForward,IntArrayList qualityScores,IntIterator nextQualityIterator,DiscoverVariantPositionData list,SampleCountInfo sampleInfo,int baseIndex){
  PositionBaseInfo info=new PositionBaseInfo();
  final char base=sampleInfo.base(baseIndex);
  info.to=base;
  if (base == 'A') {
    info.matchesReference=true;
    info.from=base;
  }
  info.matchesForwardStrand=strandMatchedForward;
  info.readerIndex=sampleInfo.sampleIndex;
  if (!nextQualityIterator.hasNext()) {
    nextQualityIterator=qualityScores.iterator();
  }
  info.readIndex=1;
  info.qualityScore=(byte)nextQualityIterator.nextInt();
  list.add(info);
  System.out.println("String_Node_Str" + info);
  return nextQualityIterator;
}
Program: 50244
Project: 50244
Buggy source:
private ReferenceLocation[] restrictPerChromosome(ReferenceLocation[] breakpoints,ConcatSortedAlignmentReader reader){
  ObjectArrayList<ReferenceLocation> result=new ObjectArrayList<ReferenceLocation>();
  int lastTargetIndex=-1;
  int index=0;
  for (  ReferenceLocation breakpoint : breakpoints) {
    if (breakpoint.targetIndex != lastTargetIndex) {
      if (lastTargetIndex != -1) {
        result.add(new ReferenceLocation(lastTargetIndex,reader.getTargetLength(lastTargetIndex)));
        result.add(new ReferenceLocation(breakpoint.targetIndex,0));
        System.out.println("String_Node_Str" + lastTargetIndex);
      }
      lastTargetIndex=breakpoint.targetIndex;
    }
    result.add(breakpoint);
    index++;
  }
  return result.toArray(new ReferenceLocation[result.size()]);
}

Fixed version (ground truth):
private ReferenceLocation[] restrictPerChromosome(ReferenceLocation[] breakpoints,ConcatSortedAlignmentReader reader){
  ObjectArrayList<ReferenceLocation> result=new ObjectArrayList<ReferenceLocation>();
  int lastTargetIndex=-1;
  int index=0;
  for (  ReferenceLocation breakpoint : breakpoints) {
    if (breakpoint.targetIndex != lastTargetIndex) {
      if (lastTargetIndex != -1) {
        result.add(new ReferenceLocation(lastTargetIndex,reader.getTargetLength(lastTargetIndex)));
        result.add(new ReferenceLocation(breakpoint.targetIndex,0));
        System.out.println("String_Node_Str" + lastTargetIndex);
        numBreakPointAdded++;
      }
      lastTargetIndex=breakpoint.targetIndex;
    }
    result.add(breakpoint);
    index++;
  }
  return result.toArray(new ReferenceLocation[result.size()]);
}
Program: 50246
Project: 50246
Buggy source:
public void initStorage(int numSamples){
  super.initStorage(numSamples);
  distinctIndelsWithCount=new int[numSamples];
}

Fixed version (ground truth):
public void initStorage(int numSamples){
  super.initStorage(numSamples);
  if (distinctIndelsWithCount == null) {
    distinctIndelsWithCount=new int[numSamples];
  }
 else {
    Arrays.fill(distinctIndelsWithCount,0);
  }
}
Program: 50247
Project: 50247
Buggy source:
@Override public void filterGenotypes(DiscoverVariantPositionData list,SampleCountInfo[] sampleCounts,ObjectSet<PositionBaseInfo> filteredSet){
  Arrays.fill(distinctIndelsWithCount,0);
  int likelyIndelArtifact=0;
  for (  SampleCountInfo sci : sampleCounts) {
    for (    EquivalentIndelRegion indel : sci.getEquivalentIndelRegions()) {
      if (indel.getFrequency() > 0) {
        distinctIndelsWithCount[sci.sampleIndex]++;
      }
    }
    if (distinctIndelsWithCount[sci.sampleIndex] >= 2) {
      likelyIndelArtifact++;
    }
  }
  if (likelyIndelArtifact >= sampleCounts.length / 4) {
    for (    SampleCountInfo sci : sampleCounts) {
      final int disctingIndelsInSample=distinctIndelsWithCount[sci.sampleIndex];
      for (      EquivalentIndelRegion indel : sci.getEquivalentIndelRegions()) {
        indel.markFiltered();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void filterGenotypes(DiscoverVariantPositionData list,SampleCountInfo[] sampleCounts,ObjectSet<PositionBaseInfo> filteredSet){
  resetCounters();
  initStorage(sampleCounts.length);
  int likelyIndelArtifact=0;
  for (  SampleCountInfo sci : sampleCounts) {
    for (    EquivalentIndelRegion indel : sci.getEquivalentIndelRegions()) {
      if (indel.getFrequency() > 0) {
        distinctIndelsWithCount[sci.sampleIndex]++;
      }
    }
    if (distinctIndelsWithCount[sci.sampleIndex] >= 2) {
      likelyIndelArtifact++;
    }
  }
  if (likelyIndelArtifact >= sampleCounts.length / 4) {
    for (    SampleCountInfo sci : sampleCounts) {
      final int disctingIndelsInSample=distinctIndelsWithCount[sci.sampleIndex];
      for (      EquivalentIndelRegion indel : sci.getEquivalentIndelRegions()) {
        indel.markFiltered();
      }
    }
  }
}
Program: 50249
Project: 50249
Buggy source:
private void appendPValueColumns(String[] inputFiles,ObjectSet<String> selection){
  String firstFile=inputFiles[0];
  try {
    VCFParser parser=new VCFParser(firstFile);
    parser.readHeader();
    GroupAssociations groupAssociations=parser.getGroupAssociations();
    ObjectArraySet<String> pValueColumns=groupAssociations.getColumnsWithGroup("String_Node_Str");
    System.out.println("String_Node_Str" + pValueColumns);
    for (    String columnName : pValueColumns) {
      if (columnName.startsWith("String_Node_Str")) {
        selection.add(columnName.substring("String_Node_Str".length(),columnName.length()));
      }
 else {
        selection.add(columnName);
      }
    }
  }
 catch (  VCFParser.SyntaxException e) {
    LOG.error("String_Node_Str");
  }
catch (  IOException e) {
    LOG.error("String_Node_Str");
  }
}

Fixed version (ground truth):
private void appendPValueColumns(String[] inputFiles,ObjectSet<String> selection){
  String firstFile=inputFiles[0];
  try {
    VCFParser parser=new VCFParser(firstFile);
    parser.readHeader();
    GroupAssociations groupAssociations=parser.getGroupAssociations();
    ObjectArraySet<String> pValueColumns=groupAssociations.getColumnsWithGroup("String_Node_Str");
    if (pValueColumns != null) {
      System.out.println("String_Node_Str" + pValueColumns);
      for (      String columnName : pValueColumns) {
        if (columnName.startsWith("String_Node_Str")) {
          selection.add(columnName.substring("String_Node_Str".length(),columnName.length()));
        }
 else {
          selection.add(columnName);
        }
      }
    }
  }
 catch (  VCFParser.SyntaxException e) {
    LOG.error("String_Node_Str");
  }
catch (  IOException e) {
    LOG.error("String_Node_Str");
  }
}