Program: 12270
Project: 12270
Buggy source:
private void modifyMovedMethodInvocationInTargetClass(){
  ExpressionExtractor expressionExtractor=new ExpressionExtractor();
  MethodDeclaration[] methodDeclarations=targetTypeDeclaration.getMethods();
  for (  MethodDeclaration methodDeclaration : methodDeclarations) {
    Block methodBody=methodDeclaration.getBody();
    List<Statement> statements=methodBody.statements();
    Map<String,Integer> invokerCounterMap=new LinkedHashMap<String,Integer>();
    for (    Statement statement : statements) {
      List<Expression> methodInvocations=expressionExtractor.getMethodInvocations(statement);
      for (      Expression expression : methodInvocations) {
        if (expression instanceof MethodInvocation) {
          MethodInvocation methodInvocation=(MethodInvocation)expression;
          if (identicalSignature(sourceMethod,methodInvocation)) {
            Expression invoker=methodInvocation.getExpression();
            if (invoker instanceof SimpleName) {
              SimpleName simpleName=(SimpleName)invoker;
              targetRewriter.remove(simpleName,null);
              String identifier=simpleName.getIdentifier();
              if (invokerCounterMap.containsKey(identifier)) {
                invokerCounterMap.put(identifier,invokerCounterMap.get(identifier) + 1);
              }
 else {
                invokerCounterMap.put(identifier,1);
              }
            }
            List<Expression> arguments=methodInvocation.arguments();
            for (            Expression argument : arguments) {
              if (argument instanceof ThisExpression) {
                ListRewrite argumentRewrite=targetRewriter.getListRewrite(methodInvocation,MethodInvocation.ARGUMENTS_PROPERTY);
                argumentRewrite.remove(argument,null);
              }
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void modifyMovedMethodInvocationInTargetClass(){
  ExpressionExtractor expressionExtractor=new ExpressionExtractor();
  MethodDeclaration[] methodDeclarations=targetTypeDeclaration.getMethods();
  for (  MethodDeclaration methodDeclaration : methodDeclarations) {
    Block methodBody=methodDeclaration.getBody();
    if (methodBody != null) {
      List<Statement> statements=methodBody.statements();
      Map<String,Integer> invokerCounterMap=new LinkedHashMap<String,Integer>();
      for (      Statement statement : statements) {
        List<Expression> methodInvocations=expressionExtractor.getMethodInvocations(statement);
        for (        Expression expression : methodInvocations) {
          if (expression instanceof MethodInvocation) {
            MethodInvocation methodInvocation=(MethodInvocation)expression;
            if (identicalSignature(sourceMethod,methodInvocation)) {
              Expression invoker=methodInvocation.getExpression();
              if (invoker instanceof SimpleName) {
                SimpleName simpleName=(SimpleName)invoker;
                targetRewriter.remove(simpleName,null);
                String identifier=simpleName.getIdentifier();
                if (invokerCounterMap.containsKey(identifier)) {
                  invokerCounterMap.put(identifier,invokerCounterMap.get(identifier) + 1);
                }
 else {
                  invokerCounterMap.put(identifier,1);
                }
              }
              List<Expression> arguments=methodInvocation.arguments();
              for (              Expression argument : arguments) {
                if (argument instanceof ThisExpression) {
                  ListRewrite argumentRewrite=targetRewriter.getListRewrite(methodInvocation,MethodInvocation.ARGUMENTS_PROPERTY);
                  argumentRewrite.remove(argument,null);
                }
              }
            }
          }
        }
      }
    }
  }
}