Program: 166833
Project: 166833
Buggy source:
protected void writeMethodInvocation(T methodInvocationNode,@Nullable Expression expression,SimpleName methodName,List typeArguments,List arguments,IMethodBinding methodBinding){
  String methodNameString=methodName.getIdentifier();
  ArrayList<Expression> args=new ArrayList<>();
  for (  Object argument : arguments)   args.add((Expression)argument);
  if (expression != null) {
    writeNode(expression);
    copySpaceAndComments();
    if (writeMethodMappedToOperatorOverload(methodNameString,args,methodBinding))     return;
    @Nullable ITypeBinding expressionTypeBinding=expression.resolveTypeBinding();
    if (expressionTypeBinding != null && isFunctionalInterface(expressionTypeBinding)) {
      match("String_Node_Str");
      skipSpaceAndComments();
      match(methodNameString);
      skipSpaceAndComments();
      writeMethodInvocationArgumentList(arguments);
      return;
    }
    matchAndWrite("String_Node_Str");
    copySpaceAndComments();
  }
  ITypeBinding objectType;
  if (expression != null)   objectType=expression.resolveTypeBinding();
 else   objectType=methodBinding.getDeclaringClass();
  if (writeMappedObjectMethod(methodInvocationNode,methodNameString,args,methodBinding))   return;
  if (implementsInterface(objectType,"String_Node_Str"))   if (writeMappedListMethod(methodInvocationNode,methodNameString,args,methodBinding))   return;
  if (isType(objectType,"String_Node_Str"))   writeMappedStringMethod(methodInvocationNode,methodNameString,args,methodBinding);
 else   if (isType(objectType,"String_Node_Str"))   writeMappedStringBuilderMethod(methodInvocationNode,methodNameString,args,methodBinding);
 else {
    if (typeArguments != null && !typeArguments.isEmpty()) {
      writeNodeAtDifferentPosition(methodName);
      matchAndWrite("String_Node_Str");
      writeCommaDelimitedNodes(typeArguments,(      Type type) -> {
        copySpaceAndComments();
        writeNode(type);
      }
);
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      setPositionToEndOfNode(methodName);
    }
 else     matchAndWrite(methodNameString);
    copySpaceAndComments();
    writeMethodInvocationArgumentList(arguments);
  }
}

Fixed version (ground truth):
protected void writeMethodInvocation(T methodInvocationNode,@Nullable Expression expression,SimpleName methodName,List typeArguments,List arguments,IMethodBinding methodBinding){
  String methodNameString=methodName.getIdentifier();
  ArrayList<Expression> args=new ArrayList<>();
  for (  Object argument : arguments)   args.add((Expression)argument);
  ITypeBinding objectType;
  if (expression != null)   objectType=expression.resolveTypeBinding();
 else   objectType=methodBinding.getDeclaringClass();
  boolean addParentheses=false;
  if (isType(objectType,"String_Node_Str") && methodNameString.equals("String_Node_Str"))   addParentheses=true;
  if (addParentheses)   write("String_Node_Str");
  if (expression != null) {
    writeNode(expression);
    copySpaceAndComments();
    if (writeMethodMappedToOperatorOverload(methodNameString,args,methodBinding))     return;
    @Nullable ITypeBinding expressionTypeBinding=expression.resolveTypeBinding();
    if (expressionTypeBinding != null && isFunctionalInterface(expressionTypeBinding)) {
      match("String_Node_Str");
      skipSpaceAndComments();
      match(methodNameString);
      skipSpaceAndComments();
      writeMethodInvocationArgumentList(arguments);
      return;
    }
    matchAndWrite("String_Node_Str");
    copySpaceAndComments();
  }
  if (writeMappedObjectMethod(methodInvocationNode,methodNameString,args,methodBinding))   ;
 else   if (implementsInterface(objectType,"String_Node_Str") && writeMappedListMethod(methodInvocationNode,methodNameString,args,methodBinding))   ;
 else   if (isType(objectType,"String_Node_Str"))   writeMappedStringMethod(methodInvocationNode,methodNameString,args,methodBinding);
 else   if (isType(objectType,"String_Node_Str"))   writeMappedStringBuilderMethod(methodInvocationNode,methodNameString,args,methodBinding);
 else {
    if (typeArguments != null && !typeArguments.isEmpty()) {
      writeNodeAtDifferentPosition(methodName);
      matchAndWrite("String_Node_Str");
      writeCommaDelimitedNodes(typeArguments,(      Type type) -> {
        copySpaceAndComments();
        writeNode(type);
      }
);
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      setPositionToEndOfNode(methodName);
    }
 else     matchAndWrite(methodNameString);
    copySpaceAndComments();
    writeMethodInvocationArgumentList(arguments);
  }
  if (addParentheses)   write("String_Node_Str");
}