Program: 12108
Project: 12108
Buggy source:
private void processPDGNodes(){
  if (monitor != null)   monitor.beginTask("String_Node_Str",pdg1.getTotalNumberOfStatements() * pdg2.getTotalNumberOfStatements());
  List<MappingState> finalStates=new ArrayList<MappingState>();
  Iterator<GraphNode> nodeIterator1=pdg1.getNodeIterator();
  while (nodeIterator1.hasNext()) {
    PDGNode node1=(PDGNode)nodeIterator1.next();
    Iterator<GraphNode> nodeIterator2=pdg2.getNodeIterator();
    List<MappingState> currentStates=new ArrayList<MappingState>();
    while (nodeIterator2.hasNext()) {
      PDGNode node2=(PDGNode)nodeIterator2.next();
      ASTNodeMatcher astNodeMatcher=new ASTNodeMatcher(iCompilationUnit1,iCompilationUnit2);
      boolean match=node1.getASTStatement().subtreeMatch(astNodeMatcher,node2.getASTStatement());
      if (match && astNodeMatcher.isParameterizable()) {
        PDGNodeMapping mapping=new PDGNodeMapping(node1,node2,astNodeMatcher);
        if (finalStates.isEmpty()) {
          MappingState state=new MappingState(null,mapping);
          List<MappingState> maxStates=state.getMaximumCommonSubGraphs();
          for (          MappingState temp : maxStates) {
            if (!currentStates.contains(temp)) {
              currentStates.add(temp);
            }
          }
        }
 else {
          for (          MappingState previousState : finalStates) {
            MappingState state=new MappingState(previousState,mapping);
            List<MappingState> maxStates=state.getMaximumCommonSubGraphs();
            for (            MappingState temp : maxStates) {
              if (!currentStates.contains(temp)) {
                currentStates.add(temp);
              }
            }
          }
        }
      }
      if (monitor != null)       monitor.worked(1);
    }
    if (!currentStates.isEmpty())     finalStates=getMaximumStates(currentStates);
  }
  maximumStates=finalStates;
  if (monitor != null)   monitor.done();
}

Fixed version (ground truth):
private void processPDGNodes(){
  if (monitor != null)   monitor.beginTask("String_Node_Str",pdg1.getTotalNumberOfStatements() * pdg2.getTotalNumberOfStatements());
  List<MappingState> finalStates=new ArrayList<MappingState>();
  Iterator<GraphNode> nodeIterator1=pdg1.getNodeIterator();
  while (nodeIterator1.hasNext()) {
    PDGNode node1=(PDGNode)nodeIterator1.next();
    Iterator<GraphNode> nodeIterator2=pdg2.getNodeIterator();
    List<MappingState> currentStates=new ArrayList<MappingState>();
    while (nodeIterator2.hasNext()) {
      PDGNode node2=(PDGNode)nodeIterator2.next();
      ASTNodeMatcher astNodeMatcher=new ASTNodeMatcher(iCompilationUnit1,iCompilationUnit2);
      boolean match=node1.getASTStatement().subtreeMatch(astNodeMatcher,node2.getASTStatement());
      if (match && astNodeMatcher.isParameterizable()) {
        if (finalStates.isEmpty()) {
          PDGNodeMapping mapping=new PDGNodeMapping(node1,node2,astNodeMatcher);
          MappingState state=new MappingState(null,mapping);
          List<MappingState> maxStates=state.getMaximumCommonSubGraphs();
          for (          MappingState temp : maxStates) {
            if (!currentStates.contains(temp)) {
              currentStates.add(temp);
            }
          }
        }
 else {
          for (          MappingState previousState : finalStates) {
            PDGNode nodeG1ControlParent=node1.getControlDependenceParent();
            PDGNode nodeG2ControlParent=node2.getControlDependenceParent();
            boolean proceedToNodeMapping=false;
            if (previousState.containsBothNodesInMappings(nodeG1ControlParent,nodeG2ControlParent))             proceedToNodeMapping=true;
            if (!previousState.containsNodeG1InMappings(nodeG1ControlParent) && !previousState.containsNodeG2InMappings(nodeG2ControlParent))             proceedToNodeMapping=true;
            if (proceedToNodeMapping) {
              PDGNodeMapping mapping=new PDGNodeMapping(node1,node2,astNodeMatcher);
              MappingState state=new MappingState(previousState,mapping);
              List<MappingState> maxStates=state.getMaximumCommonSubGraphs();
              for (              MappingState temp : maxStates) {
                if (!currentStates.contains(temp)) {
                  currentStates.add(temp);
                }
              }
            }
          }
        }
      }
      if (monitor != null)       monitor.worked(1);
    }
    if (!currentStates.isEmpty())     finalStates=getMaximumStates(currentStates);
  }
  maximumStates=finalStates;
  if (monitor != null)   monitor.done();
}