Program: 88781
Project: 88781
Buggy source:
/** 
 * Propagates new points-to information of node src to all its successors. 
 */
protected final boolean handleVarNode(final VarNode src){
  boolean ret=false;
  if (src.getReplacement() != src)   throw new RuntimeException("String_Node_Str" + src + "String_Node_Str"+ src.getReplacement());
  final PointsToSetInternal newP2Set=src.getP2Set().getNewSet();
  if (newP2Set.isEmpty())   return false;
  if (ofcg != null) {
    QueueReader addedEdges=pag.edgeReader();
    if (ofcg.wantReachingTypes(src)) {
      newP2Set.forall(new P2SetVisitor(){
        public final void visit(        Node n){
          ofcg.addReachingType(n.getType());
        }
      }
);
    }
    ofcg.doneReachingTypes();
    if (ofcg.wantStringConstants(src)) {
      Set constants=newP2Set.possibleStringConstants();
      if (constants == null) {
        ofcg.newStringConstant(src,null);
      }
 else {
        for (Iterator constantIt=constants.iterator(); constantIt.hasNext(); ) {
          final String constant=(String)constantIt.next();
          ofcg.newStringConstant(src,constant);
        }
      }
    }
    ofcg.doneStringConstants();
    while (true) {
      Node addedSrc=(Node)addedEdges.next();
      if (addedSrc == null)       break;
      Node addedTgt=(Node)addedEdges.next();
      ret=true;
      if (addedSrc instanceof VarNode) {
        if (addedTgt instanceof VarNode) {
          VarNode edgeSrc=(VarNode)addedSrc;
          VarNode edgeTgt=(VarNode)addedTgt;
          if (edgeTgt.makeP2Set().addAll(edgeSrc.getP2Set(),null))           varNodeWorkList.add(edgeTgt);
        }
      }
 else       if (addedSrc instanceof AllocNode) {
        AllocNode edgeSrc=(AllocNode)addedSrc;
        VarNode edgeTgt=(VarNode)addedTgt;
        if (edgeTgt.makeP2Set().add(edgeSrc))         varNodeWorkList.add(edgeTgt);
      }
    }
  }
  Node[] simpleTargets=pag.simpleLookup(src);
  for (int i=0; i < simpleTargets.length; i++) {
    if (simpleTargets[i].makeP2Set().addAll(newP2Set,null)) {
      varNodeWorkList.add((VarNode)simpleTargets[i]);
      ret=true;
    }
  }
  Node[] storeTargets=pag.storeLookup(src);
  for (int i=0; i < storeTargets.length; i++) {
    final FieldRefNode fr=(FieldRefNode)storeTargets[i];
    final SparkField f=fr.getField();
    ret=fr.getBase().getP2Set().forall(new P2SetVisitor(){
      public final void visit(      Node n){
        AllocDotField nDotF=pag.makeAllocDotField((AllocNode)n,f);
        if (nDotF.makeP2Set().addAll(newP2Set,null)) {
          returnValue=true;
        }
      }
    }
) | ret;
  }
  final HashSet storesToPropagate=new HashSet();
  final HashSet loadsToPropagate=new HashSet();
  Collection fieldRefs=src.getAllFieldRefs();
  for (Iterator frIt=fieldRefs.iterator(); frIt.hasNext(); ) {
    final FieldRefNode fr=(FieldRefNode)frIt.next();
    final SparkField field=fr.getField();
    final Node[] storeSources=pag.storeInvLookup(fr);
    if (storeSources.length > 0) {
      newP2Set.forall(new P2SetVisitor(){
        public final void visit(        Node n){
          AllocDotField nDotF=pag.makeAllocDotField((AllocNode)n,field);
          for (int i=0; i < storeSources.length; i++) {
            Node[] pair={storeSources[i],nDotF.getReplacement()};
            storesToPropagate.add(pair);
          }
        }
      }
);
    }
    final Node[] loadTargets=pag.loadLookup(fr);
    if (loadTargets.length > 0) {
      newP2Set.forall(new P2SetVisitor(){
        public final void visit(        Node n){
          AllocDotField nDotF=pag.findAllocDotField((AllocNode)n,field);
          if (nDotF != null) {
            for (int i=0; i < loadTargets.length; i++) {
              Node[] pair={nDotF.getReplacement(),loadTargets[i]};
              loadsToPropagate.add(pair);
            }
          }
        }
      }
);
    }
  }
  src.getP2Set().flushNew();
  for (Iterator pIt=storesToPropagate.iterator(); pIt.hasNext(); ) {
    final Node[] p=(Node[])pIt.next();
    VarNode storeSource=(VarNode)p[0];
    AllocDotField nDotF=(AllocDotField)p[1];
    if (nDotF.makeP2Set().addAll(storeSource.getP2Set(),null)) {
      ret=true;
    }
  }
  for (Iterator pIt=loadsToPropagate.iterator(); pIt.hasNext(); ) {
    final Node[] p=(Node[])pIt.next();
    AllocDotField nDotF=(AllocDotField)p[0];
    VarNode loadTarget=(VarNode)p[1];
    if (loadTarget.makeP2Set().addAll(nDotF.getP2Set(),null)) {
      varNodeWorkList.add(loadTarget);
      ret=true;
    }
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Propagates new points-to information of node src to all its successors. 
 */
protected final boolean handleVarNode(final VarNode src){
  boolean ret=false;
  if (src.getReplacement() != src)   throw new RuntimeException("String_Node_Str" + src + "String_Node_Str"+ src.getReplacement());
  final PointsToSetInternal newP2Set=src.getP2Set().getNewSet();
  if (newP2Set.isEmpty())   return false;
  if (ofcg != null) {
    QueueReader addedEdges=pag.edgeReader();
    if (ofcg.wantReachingTypes(src)) {
      newP2Set.forall(new P2SetVisitor(){
        public final void visit(        Node n){
          ofcg.addReachingType(n.getType());
        }
      }
);
    }
    ofcg.doneReachingTypes();
    if (ofcg.wantStringConstants(src)) {
      Set constants=newP2Set.possibleStringConstants();
      if (constants == null) {
        ofcg.newStringConstant(src,null);
      }
 else {
        for (Iterator constantIt=constants.iterator(); constantIt.hasNext(); ) {
          final String constant=(String)constantIt.next();
          ofcg.newStringConstant(src,constant);
        }
      }
    }
    ofcg.doneStringConstants();
    while (true) {
      Node addedSrc=(Node)addedEdges.next();
      if (addedSrc == null)       break;
      Node addedTgt=(Node)addedEdges.next();
      ret=true;
      if (addedSrc instanceof VarNode) {
        if (addedTgt instanceof VarNode) {
          VarNode edgeSrc=(VarNode)addedSrc.getReplacement();
          VarNode edgeTgt=(VarNode)addedTgt.getReplacement();
          if (edgeTgt.makeP2Set().addAll(edgeSrc.getP2Set(),null))           varNodeWorkList.add(edgeTgt);
        }
      }
 else       if (addedSrc instanceof AllocNode) {
        AllocNode edgeSrc=(AllocNode)addedSrc;
        VarNode edgeTgt=(VarNode)addedTgt.getReplacement();
        if (edgeTgt.makeP2Set().add(edgeSrc))         varNodeWorkList.add(edgeTgt);
      }
    }
  }
  Node[] simpleTargets=pag.simpleLookup(src);
  for (int i=0; i < simpleTargets.length; i++) {
    if (simpleTargets[i].makeP2Set().addAll(newP2Set,null)) {
      varNodeWorkList.add((VarNode)simpleTargets[i]);
      ret=true;
    }
  }
  Node[] storeTargets=pag.storeLookup(src);
  for (int i=0; i < storeTargets.length; i++) {
    final FieldRefNode fr=(FieldRefNode)storeTargets[i];
    final SparkField f=fr.getField();
    ret=fr.getBase().getP2Set().forall(new P2SetVisitor(){
      public final void visit(      Node n){
        AllocDotField nDotF=pag.makeAllocDotField((AllocNode)n,f);
        if (nDotF.makeP2Set().addAll(newP2Set,null)) {
          returnValue=true;
        }
      }
    }
) | ret;
  }
  final HashSet storesToPropagate=new HashSet();
  final HashSet loadsToPropagate=new HashSet();
  Collection fieldRefs=src.getAllFieldRefs();
  for (Iterator frIt=fieldRefs.iterator(); frIt.hasNext(); ) {
    final FieldRefNode fr=(FieldRefNode)frIt.next();
    final SparkField field=fr.getField();
    final Node[] storeSources=pag.storeInvLookup(fr);
    if (storeSources.length > 0) {
      newP2Set.forall(new P2SetVisitor(){
        public final void visit(        Node n){
          AllocDotField nDotF=pag.makeAllocDotField((AllocNode)n,field);
          for (int i=0; i < storeSources.length; i++) {
            Node[] pair={storeSources[i],nDotF.getReplacement()};
            storesToPropagate.add(pair);
          }
        }
      }
);
    }
    final Node[] loadTargets=pag.loadLookup(fr);
    if (loadTargets.length > 0) {
      newP2Set.forall(new P2SetVisitor(){
        public final void visit(        Node n){
          AllocDotField nDotF=pag.findAllocDotField((AllocNode)n,field);
          if (nDotF != null) {
            for (int i=0; i < loadTargets.length; i++) {
              Node[] pair={nDotF.getReplacement(),loadTargets[i]};
              loadsToPropagate.add(pair);
            }
          }
        }
      }
);
    }
  }
  src.getP2Set().flushNew();
  for (Iterator pIt=storesToPropagate.iterator(); pIt.hasNext(); ) {
    final Node[] p=(Node[])pIt.next();
    VarNode storeSource=(VarNode)p[0];
    AllocDotField nDotF=(AllocDotField)p[1];
    if (nDotF.makeP2Set().addAll(storeSource.getP2Set(),null)) {
      ret=true;
    }
  }
  for (Iterator pIt=loadsToPropagate.iterator(); pIt.hasNext(); ) {
    final Node[] p=(Node[])pIt.next();
    AllocDotField nDotF=(AllocDotField)p[0];
    VarNode loadTarget=(VarNode)p[1];
    if (loadTarget.makeP2Set().addAll(nDotF.getP2Set(),null)) {
      varNodeWorkList.add(loadTarget);
      ret=true;
    }
  }
  return ret;
}