Program: 12112
Project: 12112
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) {
        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()) {
        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();
}