Program: 12106
Project: 12106
Buggy source:
private void traverse(MappingState state,PDGNodeMapping nodeMapping){
  PDGNode nodeG1=nodeMapping.getNodeG1();
  PDGNode nodeG2=nodeMapping.getNodeG2();
  Iterator<GraphEdge> nodeG1EdgeIterator=nodeG1.getDependenceIterator();
  while (nodeG1EdgeIterator.hasNext()) {
    PDGDependence edgeG1=(PDGDependence)nodeG1EdgeIterator.next();
    Iterator<GraphEdge> nodeG2EdgeIterator=nodeG2.getDependenceIterator();
    while (nodeG2EdgeIterator.hasNext()) {
      PDGDependence edgeG2=(PDGDependence)nodeG2EdgeIterator.next();
      PDGEdgeMapping edgeMapping=new PDGEdgeMapping(edgeG1,edgeG2);
      if (edgeMapping.isCompatible(nodeMapping)) {
        PDGNode dstNodeG1=null;
        PDGNode dstNodeG2=null;
        if (edgeG1.getSrc().equals(nodeG1) && edgeG2.getSrc().equals(nodeG2)) {
          dstNodeG1=(PDGNode)edgeG1.getDst();
          dstNodeG2=(PDGNode)edgeG2.getDst();
        }
 else         if (edgeG1.getDst().equals(nodeG1) && edgeG2.getDst().equals(nodeG2)) {
          dstNodeG1=(PDGNode)edgeG1.getSrc();
          dstNodeG2=(PDGNode)edgeG2.getSrc();
        }
        if (dstNodeG1 != null && dstNodeG2 != null) {
          if (dstNodeG1 instanceof PDGMethodEntryNode && dstNodeG2 instanceof PDGMethodEntryNode) {
            if (!state.edgeMappings.contains(edgeMapping)) {
              state.edgeMappings.add(edgeMapping);
              state.propagateEdgeMappingToChildren(edgeMapping);
            }
          }
          ASTNodeMatcher astNodeMatcher=new ASTNodeMatcher(nodeMapping.getTypeRoot1(),nodeMapping.getTypeRoot2());
          boolean match;
          if (dstNodeG1 instanceof PDGMethodEntryNode || dstNodeG2 instanceof PDGMethodEntryNode)           match=false;
 else           match=dstNodeG1.getASTStatement().subtreeMatch(astNodeMatcher,dstNodeG2.getASTStatement());
          if (match && astNodeMatcher.isParameterizable()) {
            PDGNodeMapping dstNodeMapping=new PDGNodeMapping(dstNodeG1,dstNodeG2,astNodeMatcher);
            MappingState childState=state.getChildStateWithNodeMapping(dstNodeMapping);
            if (childState != null) {
              if (!childState.edgeMappings.contains(edgeMapping)) {
                childState.edgeMappings.add(edgeMapping);
                childState.propagateEdgeMappingToChildren(edgeMapping);
              }
            }
 else             if (!state.containsAtLeastOneNodeInMappings(dstNodeMapping)) {
              MappingState newMappingState=state.copy();
              state.children.add(newMappingState);
              newMappingState.edgeMappings.add(edgeMapping);
              newMappingState.nodeMappings.add(dstNodeMapping);
              traverse(newMappingState,dstNodeMapping);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void traverse(MappingState state,PDGNodeMapping nodeMapping,Set<PDGNode> visitedNodesG1,Set<PDGNode> visitedNodesG2){
  PDGNode nodeG1=nodeMapping.getNodeG1();
  PDGNode nodeG2=nodeMapping.getNodeG2();
  if (visitedNodesG1.contains(nodeG1) && visitedNodesG2.contains(nodeG2))   return;
  visitedNodesG1.add(nodeG1);
  visitedNodesG2.add(nodeG2);
  Iterator<GraphEdge> nodeG1EdgeIterator=nodeG1.getDependenceIterator();
  while (nodeG1EdgeIterator.hasNext()) {
    PDGDependence edgeG1=(PDGDependence)nodeG1EdgeIterator.next();
    Iterator<GraphEdge> nodeG2EdgeIterator=nodeG2.getDependenceIterator();
    while (nodeG2EdgeIterator.hasNext()) {
      PDGDependence edgeG2=(PDGDependence)nodeG2EdgeIterator.next();
      PDGEdgeMapping edgeMapping=new PDGEdgeMapping(edgeG1,edgeG2);
      if (edgeMapping.isCompatible(nodeMapping)) {
        PDGNode dstNodeG1=null;
        PDGNode dstNodeG2=null;
        if (edgeG1.getSrc().equals(nodeG1) && edgeG2.getSrc().equals(nodeG2)) {
          dstNodeG1=(PDGNode)edgeG1.getDst();
          dstNodeG2=(PDGNode)edgeG2.getDst();
        }
 else         if (edgeG1.getDst().equals(nodeG1) && edgeG2.getDst().equals(nodeG2)) {
          dstNodeG1=(PDGNode)edgeG1.getSrc();
          dstNodeG2=(PDGNode)edgeG2.getSrc();
        }
        if (dstNodeG1 != null && dstNodeG2 != null) {
          if (dstNodeG1 instanceof PDGMethodEntryNode && dstNodeG2 instanceof PDGMethodEntryNode) {
            if (!state.edgeMappings.contains(edgeMapping)) {
              state.edgeMappings.add(edgeMapping);
              state.propagateEdgeMappingToChildren(edgeMapping);
            }
          }
          ASTNodeMatcher astNodeMatcher=new ASTNodeMatcher(nodeMapping.getTypeRoot1(),nodeMapping.getTypeRoot2());
          boolean match;
          if (dstNodeG1 instanceof PDGMethodEntryNode || dstNodeG2 instanceof PDGMethodEntryNode)           match=false;
 else           match=dstNodeG1.getASTStatement().subtreeMatch(astNodeMatcher,dstNodeG2.getASTStatement());
          if (match && astNodeMatcher.isParameterizable()) {
            PDGNode nodeG1ControlParent=dstNodeG1.getControlDependenceParent();
            PDGNode nodeG2ControlParent=dstNodeG2.getControlDependenceParent();
            boolean proceedToNodeMapping=false;
            if (state.containsBothNodesInMappings(nodeG1ControlParent,nodeG2ControlParent))             proceedToNodeMapping=true;
            if (!state.containsNodeG1InMappings(nodeG1ControlParent) && !state.containsNodeG2InMappings(nodeG2ControlParent))             proceedToNodeMapping=true;
            if (proceedToNodeMapping) {
              PDGNodeMapping dstNodeMapping=new PDGNodeMapping(dstNodeG1,dstNodeG2,astNodeMatcher);
              MappingState childState=state.getChildStateWithNodeMapping(dstNodeMapping);
              if (childState != null) {
                if (!childState.edgeMappings.contains(edgeMapping)) {
                  childState.edgeMappings.add(edgeMapping);
                  childState.propagateEdgeMappingToChildren(edgeMapping);
                }
              }
 else               if (!state.containsAtLeastOneNodeInMappings(dstNodeMapping)) {
                MappingState newMappingState=state.copy();
                state.children.add(newMappingState);
                newMappingState.edgeMappings.add(edgeMapping);
                newMappingState.nodeMappings.add(dstNodeMapping);
                traverse(newMappingState,dstNodeMapping,visitedNodesG1,visitedNodesG2);
              }
            }
          }
        }
      }
    }
  }
}