Program: 12182
Project: 12182
Buggy source:
private void generateGettersForAccessedFields(){
  AST contextAST=sourceTypeDeclaration.getAST();
  Set<VariableDeclarationFragment> accessedFields=new LinkedHashSet<VariableDeclarationFragment>();
  accessedFields.addAll(typeCheckElimination.getAccessedFields());
  accessedFields.addAll(typeCheckElimination.getSuperAccessedFields());
  for (  VariableDeclarationFragment fragment : accessedFields) {
    IMethodBinding getterMethodBinding=null;
    if (typeCheckElimination.getSuperAccessedFields().contains(fragment)) {
      getterMethodBinding=typeCheckElimination.getGetterMethodBindingOfSuperAccessedField(fragment.resolveBinding());
    }
 else {
      getterMethodBinding=findGetterMethodInContext(fragment.resolveBinding());
    }
    if (getterMethodBinding == null) {
      FieldDeclaration fieldDeclaration=(FieldDeclaration)fragment.getParent();
      int modifiers=fieldDeclaration.getModifiers();
      if (!fragment.equals(typeCheckElimination.getTypeField()) && !((modifiers & Modifier.PUBLIC) != 0 && (modifiers & Modifier.STATIC) != 0)) {
        MethodDeclaration newMethodDeclaration=contextAST.newMethodDeclaration();
        sourceRewriter.set(newMethodDeclaration,MethodDeclaration.RETURN_TYPE2_PROPERTY,fieldDeclaration.getType(),null);
        ListRewrite methodDeclarationModifiersRewrite=sourceRewriter.getListRewrite(newMethodDeclaration,MethodDeclaration.MODIFIERS2_PROPERTY);
        methodDeclarationModifiersRewrite.insertLast(contextAST.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD),null);
        String methodName=fragment.getName().getIdentifier();
        methodName="String_Node_Str" + methodName.substring(0,1).toUpperCase() + methodName.substring(1,methodName.length());
        sourceRewriter.set(newMethodDeclaration,MethodDeclaration.NAME_PROPERTY,contextAST.newSimpleName(methodName),null);
        Block methodDeclarationBody=contextAST.newBlock();
        ListRewrite methodDeclarationBodyStatementsRewrite=sourceRewriter.getListRewrite(methodDeclarationBody,Block.STATEMENTS_PROPERTY);
        ReturnStatement returnStatement=contextAST.newReturnStatement();
        sourceRewriter.set(returnStatement,ReturnStatement.EXPRESSION_PROPERTY,fragment.getName(),null);
        methodDeclarationBodyStatementsRewrite.insertLast(returnStatement,null);
        sourceRewriter.set(newMethodDeclaration,MethodDeclaration.BODY_PROPERTY,methodDeclarationBody,null);
        ListRewrite contextBodyRewrite=sourceRewriter.getListRewrite(sourceTypeDeclaration,TypeDeclaration.BODY_DECLARATIONS_PROPERTY);
        contextBodyRewrite.insertLast(newMethodDeclaration,null);
      }
    }
  }
}

Fixed version (ground truth):
private void generateGettersForAccessedFields(){
  AST contextAST=sourceTypeDeclaration.getAST();
  Set<VariableDeclarationFragment> accessedFields=new LinkedHashSet<VariableDeclarationFragment>();
  accessedFields.addAll(typeCheckElimination.getAccessedFields());
  accessedFields.addAll(typeCheckElimination.getSuperAccessedFields());
  for (  VariableDeclarationFragment fragment : accessedFields) {
    IMethodBinding getterMethodBinding=null;
    if (typeCheckElimination.getSuperAccessedFields().contains(fragment)) {
      for (      IVariableBinding fieldBinding : typeCheckElimination.getSuperAccessedFieldBindings()) {
        if (fieldBinding.isEqualTo(fragment.resolveBinding())) {
          getterMethodBinding=typeCheckElimination.getGetterMethodBindingOfSuperAccessedField(fieldBinding);
          break;
        }
      }
    }
 else {
      getterMethodBinding=findGetterMethodInContext(fragment.resolveBinding());
    }
    if (getterMethodBinding == null) {
      FieldDeclaration fieldDeclaration=(FieldDeclaration)fragment.getParent();
      int modifiers=fieldDeclaration.getModifiers();
      if (!fragment.equals(typeCheckElimination.getTypeField()) && !((modifiers & Modifier.PUBLIC) != 0 && (modifiers & Modifier.STATIC) != 0)) {
        MethodDeclaration newMethodDeclaration=contextAST.newMethodDeclaration();
        sourceRewriter.set(newMethodDeclaration,MethodDeclaration.RETURN_TYPE2_PROPERTY,fieldDeclaration.getType(),null);
        ListRewrite methodDeclarationModifiersRewrite=sourceRewriter.getListRewrite(newMethodDeclaration,MethodDeclaration.MODIFIERS2_PROPERTY);
        methodDeclarationModifiersRewrite.insertLast(contextAST.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD),null);
        String methodName=fragment.getName().getIdentifier();
        methodName="String_Node_Str" + methodName.substring(0,1).toUpperCase() + methodName.substring(1,methodName.length());
        sourceRewriter.set(newMethodDeclaration,MethodDeclaration.NAME_PROPERTY,contextAST.newSimpleName(methodName),null);
        Block methodDeclarationBody=contextAST.newBlock();
        ListRewrite methodDeclarationBodyStatementsRewrite=sourceRewriter.getListRewrite(methodDeclarationBody,Block.STATEMENTS_PROPERTY);
        ReturnStatement returnStatement=contextAST.newReturnStatement();
        sourceRewriter.set(returnStatement,ReturnStatement.EXPRESSION_PROPERTY,fragment.getName(),null);
        methodDeclarationBodyStatementsRewrite.insertLast(returnStatement,null);
        sourceRewriter.set(newMethodDeclaration,MethodDeclaration.BODY_PROPERTY,methodDeclarationBody,null);
        ListRewrite contextBodyRewrite=sourceRewriter.getListRewrite(sourceTypeDeclaration,TypeDeclaration.BODY_DECLARATIONS_PROPERTY);
        contextBodyRewrite.insertLast(newMethodDeclaration,null);
      }
    }
  }
}