Program: 75104
Project: 75104
Buggy source:
/** 
 * Fix the refactoring when the set of cross-analyzed types changes.
 * @param state The current state of the type analyzer.
 */
public void handle(TypeAnalyzerState state){
  Set crossAnalyzedTypes=state.getCrossAnalyzedTypes();
  Iterator crossAnalysisIter=crossAnalyzedTypes.iterator();
  while (crossAnalysisIter.hasNext()) {
    String nextClassName=(String)crossAnalysisIter.next();
    List list=(List)_checkParentFields.get(nextClassName);
    if (list != null) {
      Iterator nodesIter=list.iterator();
      while (nodesIter.hasNext()) {
        removeNode((ASTNode)nodesIter.next());
        nodesIter.remove();
      }
    }
    list=(List)_checkParentMethods.get(nextClassName);
    if (list != null) {
      Iterator nodesIter=list.iterator();
      while (nodesIter.hasNext()) {
        removeNode((ASTNode)nodesIter.next());
        nodesIter.remove();
      }
    }
    list=(List)_fixParentRestoreMethods.get(nextClassName);
    if (list != null) {
      Iterator nodesIter=list.iterator();
      while (nodesIter.hasNext()) {
        Block body=(Block)nodesIter.next();
        AST ast=body.getAST();
        String methodName=_getRestoreMethodName(false);
        SuperMethodInvocation superRestore=ast.newSuperMethodInvocation();
        superRestore.setName(ast.newSimpleName(methodName));
        superRestore.arguments().add(ast.newSimpleName("String_Node_Str"));
        superRestore.arguments().add(ast.newSimpleName("String_Node_Str"));
        body.statements().add(0,ast.newExpressionStatement(superRestore));
        nodesIter.remove();
      }
    }
    list=(List)_fixSetCheckpoint.get(nextClassName);
    if (list != null) {
      Iterator nodesIter=list.iterator();
      while (nodesIter.hasNext()) {
        Block body=(Block)nodesIter.next();
        AST ast=body.getAST();
        Statement invocation=_createSetCheckpointInvocation(ast);
        List statements=body.statements();
        statements.add(statements.size() - 2,invocation);
        nodesIter.remove();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Fix the refactoring when the set of cross-analyzed types changes.
 * @param state The current state of the type analyzer.
 */
public void handle(TypeAnalyzerState state){
  Set crossAnalyzedTypes=state.getCrossAnalyzedTypes();
  Iterator crossAnalysisIter=crossAnalyzedTypes.iterator();
  while (crossAnalysisIter.hasNext()) {
    String nextClassName=(String)crossAnalysisIter.next();
    List list=(List)_checkParentFields.get(nextClassName);
    if (list != null) {
      Iterator nodesIter=list.iterator();
      while (nodesIter.hasNext()) {
        removeNode((ASTNode)nodesIter.next());
        nodesIter.remove();
      }
    }
    list=(List)_checkParentMethods.get(nextClassName);
    if (list != null) {
      Iterator nodesIter=list.iterator();
      while (nodesIter.hasNext()) {
        removeNode((ASTNode)nodesIter.next());
        nodesIter.remove();
      }
    }
    list=(List)_fixParentRestoreMethods.get(nextClassName);
    if (list != null) {
      Iterator nodesIter=list.iterator();
      while (nodesIter.hasNext()) {
        Block body=(Block)nodesIter.next();
        AST ast=body.getAST();
        String methodName=_getRestoreMethodName(false);
        SuperMethodInvocation superRestore=ast.newSuperMethodInvocation();
        superRestore.setName(ast.newSimpleName(methodName));
        superRestore.arguments().add(ast.newSimpleName("String_Node_Str"));
        superRestore.arguments().add(ast.newSimpleName("String_Node_Str"));
        List statements=body.statements();
        statements.remove(statements.size() - 1);
        statements.add(ast.newExpressionStatement(superRestore));
        nodesIter.remove();
      }
    }
    list=(List)_fixSetCheckpoint.get(nextClassName);
    if (list != null) {
      Iterator nodesIter=list.iterator();
      while (nodesIter.hasNext()) {
        Block body=(Block)nodesIter.next();
        AST ast=body.getAST();
        Statement invocation=_createSetCheckpointInvocation(ast);
        List statements=body.statements();
        statements.add(statements.size() - 2,invocation);
        nodesIter.remove();
      }
    }
  }
}