Program: 155850
Project: 155850
Buggy source:
@Override public boolean process(Set<? extends TypeElement> annotations,RoundEnvironment roundEnv){
  RealmVersionChecker updateChecker=new RealmVersionChecker(processingEnv);
  updateChecker.executeRealmVersionUpdate();
  for (  Element classElement : roundEnv.getElementsAnnotatedWith(RealmClass.class)) {
    String className;
    String packageName;
    List<VariableElement> fields=new ArrayList<VariableElement>();
    List<VariableElement> indexedFields=new ArrayList<VariableElement>();
    List<String> expectedGetters=new ArrayList<String>();
    List<String> expectedSetters=new ArrayList<String>();
    List<ExecutableElement> methods=new ArrayList<ExecutableElement>();
    if (!classElement.getKind().equals(ElementKind.CLASS)) {
      error("String_Node_Str",classElement);
    }
    TypeElement typeElement=(TypeElement)classElement;
    className=typeElement.getSimpleName().toString();
    if (typeElement.toString().endsWith("String_Node_Str") || typeElement.toString().endsWith("String_Node_Str")) {
      continue;
    }
    note("String_Node_Str" + className);
    classesToValidate.add(typeElement.toString());
    Element enclosingElement=typeElement.getEnclosingElement();
    if (!enclosingElement.getKind().equals(ElementKind.PACKAGE)) {
      error("String_Node_Str",classElement);
    }
    TypeElement parentElement=(TypeElement)processingEnv.getTypeUtils().asElement(typeElement.getSuperclass());
    if (!parentElement.toString().endsWith("String_Node_Str")) {
      error("String_Node_Str",classElement);
    }
    PackageElement packageElement=(PackageElement)enclosingElement;
    packageName=packageElement.getQualifiedName().toString();
    for (    Element element : typeElement.getEnclosedElements()) {
      ElementKind elementKind=element.getKind();
      if (elementKind.equals(ElementKind.FIELD)) {
        VariableElement variableElement=(VariableElement)element;
        String fieldName=variableElement.getSimpleName().toString();
        if (variableElement.getAnnotation(Ignore.class) != null) {
          continue;
        }
        if (variableElement.getAnnotation(Index.class) != null) {
          String elementTypeCanonicalName=variableElement.asType().toString();
          if (elementTypeCanonicalName.equals("String_Node_Str")) {
            indexedFields.add(variableElement);
          }
 else {
            error("String_Node_Str" + element);
            return true;
          }
        }
        if (!variableElement.getModifiers().contains(Modifier.PRIVATE)) {
          error("String_Node_Str",variableElement);
        }
        fields.add(variableElement);
        expectedGetters.add(fieldName);
        expectedSetters.add(fieldName);
      }
 else       if (elementKind.equals(ElementKind.METHOD)) {
        ExecutableElement executableElement=(ExecutableElement)element;
        methods.add(executableElement);
      }
    }
    List<String> fieldNames=new ArrayList<String>();
    for (    VariableElement field : fields) {
      fieldNames.add(field.getSimpleName().toString());
    }
    for (    ExecutableElement executableElement : methods) {
      Set<Modifier> modifiers=executableElement.getModifiers();
      if (modifiers.contains(Modifier.STATIC)) {
        continue;
      }
 else       if (!modifiers.contains(Modifier.PUBLIC)) {
        error("String_Node_Str",executableElement);
      }
      String methodName=executableElement.getSimpleName().toString();
      if (methodName.startsWith("String_Node_Str") || methodName.startsWith("String_Node_Str")) {
        boolean found=false;
        if (methodName.startsWith("String_Node_Str")) {
          String methodMinusIs=methodName.substring(2);
          String methodMinusIsCapitalised=lowerFirstChar(methodMinusIs);
          if (fieldNames.contains(methodName)) {
            expectedGetters.remove(methodName);
            found=true;
          }
 else           if (fieldNames.contains(methodMinusIs)) {
            expectedGetters.remove(methodMinusIs);
            found=true;
          }
 else           if (fieldNames.contains(methodMinusIsCapitalised)) {
            expectedGetters.remove(methodMinusIsCapitalised);
            found=true;
          }
        }
        if (!found && methodName.startsWith("String_Node_Str")) {
          String methodMinusGet=methodName.substring(3);
          String methodMinusGetCapitalised=lowerFirstChar(methodMinusGet);
          if (fieldNames.contains(methodMinusGet)) {
            expectedGetters.remove(methodMinusGet);
            found=true;
          }
 else           if (fieldNames.contains(methodMinusGetCapitalised)) {
            expectedGetters.remove(methodMinusGetCapitalised);
            found=true;
          }
        }
        if (!found) {
          note(String.format("String_Node_Str",methodName));
        }
      }
 else       if (methodName.startsWith("String_Node_Str")) {
        boolean found=false;
        String methodMinusSet=methodName.substring(3);
        String methodMinusSetCapitalised=lowerFirstChar(methodMinusSet);
        if (fieldNames.contains(methodMinusSet)) {
          expectedSetters.remove(methodMinusSet);
          found=true;
        }
 else         if (fieldNames.contains(methodMinusSetCapitalised)) {
          expectedSetters.remove(methodMinusSetCapitalised);
          found=true;
        }
        if (!found) {
          note(String.format("String_Node_Str",methodName));
        }
      }
 else {
        error("String_Node_Str",executableElement);
      }
    }
    for (    String expectedGetter : expectedGetters) {
      error("String_Node_Str" + expectedGetter);
    }
    for (    String expectedSetter : expectedSetters) {
      error("String_Node_Str" + expectedSetter);
    }
    RealmProxyClassGenerator sourceCodeGenerator=new RealmProxyClassGenerator(processingEnv,className,packageName,fields,indexedFields);
    try {
      sourceCodeGenerator.generate();
    }
 catch (    IOException e) {
      error(e.getMessage(),classElement);
    }
catch (    UnsupportedOperationException e) {
      error(e.getMessage(),classElement);
    }
  }
  if (!done) {
    RealmValidationListGenerator validationGenerator=new RealmValidationListGenerator(processingEnv,classesToValidate);
    try {
      validationGenerator.generate();
      done=true;
    }
 catch (    IOException e) {
      error(e.getMessage());
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean process(Set<? extends TypeElement> annotations,RoundEnvironment roundEnv){
  RealmVersionChecker updateChecker=new RealmVersionChecker(processingEnv);
  updateChecker.executeRealmVersionUpdate();
  for (  Element classElement : roundEnv.getElementsAnnotatedWith(RealmClass.class)) {
    String className;
    String packageName;
    List<VariableElement> fields=new ArrayList<VariableElement>();
    List<VariableElement> indexedFields=new ArrayList<VariableElement>();
    Set<VariableElement> ignoredFields=new HashSet<VariableElement>();
    Set<String> expectedGetters=new HashSet<String>();
    Set<String> expectedSetters=new HashSet<String>();
    Set<ExecutableElement> methods=new HashSet<ExecutableElement>();
    Map<String,String> getters=new HashMap<String,String>();
    Map<String,String> setters=new HashMap<String,String>();
    if (!classElement.getKind().equals(ElementKind.CLASS)) {
      error("String_Node_Str",classElement);
    }
    TypeElement typeElement=(TypeElement)classElement;
    className=typeElement.getSimpleName().toString();
    if (typeElement.toString().endsWith("String_Node_Str") || typeElement.toString().endsWith("String_Node_Str")) {
      continue;
    }
    note("String_Node_Str" + className);
    classesToValidate.add(typeElement.toString());
    Element enclosingElement=typeElement.getEnclosingElement();
    if (!enclosingElement.getKind().equals(ElementKind.PACKAGE)) {
      error("String_Node_Str",classElement);
    }
    TypeElement parentElement=(TypeElement)processingEnv.getTypeUtils().asElement(typeElement.getSuperclass());
    if (!parentElement.toString().endsWith("String_Node_Str")) {
      error("String_Node_Str",classElement);
    }
    PackageElement packageElement=(PackageElement)enclosingElement;
    packageName=packageElement.getQualifiedName().toString();
    for (    Element element : typeElement.getEnclosedElements()) {
      ElementKind elementKind=element.getKind();
      if (elementKind.equals(ElementKind.FIELD)) {
        VariableElement variableElement=(VariableElement)element;
        String fieldName=variableElement.getSimpleName().toString();
        if (variableElement.getAnnotation(Ignore.class) != null) {
          ignoredFields.add(variableElement);
          continue;
        }
        if (variableElement.getAnnotation(Index.class) != null) {
          String elementTypeCanonicalName=variableElement.asType().toString();
          if (elementTypeCanonicalName.equals("String_Node_Str")) {
            indexedFields.add(variableElement);
          }
 else {
            error("String_Node_Str" + element);
            return true;
          }
        }
        if (!variableElement.getModifiers().contains(Modifier.PRIVATE)) {
          error("String_Node_Str",variableElement);
        }
        fields.add(variableElement);
        expectedGetters.add(fieldName);
        expectedSetters.add(fieldName);
      }
 else       if (elementKind.equals(ElementKind.METHOD)) {
        ExecutableElement executableElement=(ExecutableElement)element;
        methods.add(executableElement);
      }
    }
    List<String> fieldNames=new ArrayList<String>();
    List<String> ignoreFieldNames=new ArrayList<String>();
    for (    VariableElement field : fields) {
      fieldNames.add(field.getSimpleName().toString());
    }
    for (    VariableElement ignoredField : ignoredFields) {
      fieldNames.add(ignoredField.getSimpleName().toString());
      ignoreFieldNames.add(ignoredField.getSimpleName().toString());
    }
    for (    ExecutableElement executableElement : methods) {
      String methodName=executableElement.getSimpleName().toString();
      Set<Modifier> modifiers=executableElement.getModifiers();
      if (modifiers.contains(Modifier.STATIC)) {
        continue;
      }
 else       if (!modifiers.contains(Modifier.PUBLIC)) {
        error("String_Node_Str",executableElement);
      }
      if (methodName.startsWith("String_Node_Str") || methodName.startsWith("String_Node_Str")) {
        boolean found=false;
        if (methodName.startsWith("String_Node_Str")) {
          String methodMinusIs=methodName.substring(2);
          String methodMinusIsCapitalised=lowerFirstChar(methodMinusIs);
          if (fieldNames.contains(methodName)) {
            expectedGetters.remove(methodName);
            if (!ignoreFieldNames.contains(methodName)) {
              getters.put(methodName,methodName);
            }
            found=true;
          }
 else           if (fieldNames.contains(methodMinusIs)) {
            expectedGetters.remove(methodMinusIs);
            if (!ignoreFieldNames.contains(methodMinusIs)) {
              getters.put(methodMinusIs,methodName);
            }
            found=true;
          }
 else           if (fieldNames.contains(methodMinusIsCapitalised)) {
            expectedGetters.remove(methodMinusIsCapitalised);
            if (!ignoreFieldNames.contains(methodMinusIsCapitalised)) {
              getters.put(methodMinusIsCapitalised,methodName);
            }
            found=true;
          }
        }
        if (!found && methodName.startsWith("String_Node_Str")) {
          String methodMinusGet=methodName.substring(3);
          String methodMinusGetCapitalised=lowerFirstChar(methodMinusGet);
          if (fieldNames.contains(methodMinusGet)) {
            expectedGetters.remove(methodMinusGet);
            if (!ignoreFieldNames.contains(methodMinusGet)) {
              getters.put(methodMinusGet,methodName);
            }
            found=true;
          }
 else           if (fieldNames.contains(methodMinusGetCapitalised)) {
            expectedGetters.remove(methodMinusGetCapitalised);
            if (!ignoreFieldNames.contains(methodMinusGetCapitalised)) {
              getters.put(methodMinusGetCapitalised,methodName);
            }
            found=true;
          }
        }
        if (!found) {
          note(String.format("String_Node_Str",methodName));
        }
      }
 else       if (methodName.startsWith("String_Node_Str")) {
        boolean found=false;
        String methodMinusSet=methodName.substring(3);
        String methodMinusSetCapitalised=lowerFirstChar(methodMinusSet);
        String methodMenusSetPlusIs="String_Node_Str" + methodMinusSet;
        if (fieldNames.contains(methodMinusSet)) {
          expectedSetters.remove(methodMinusSet);
          if (!ignoreFieldNames.contains(methodMinusSet)) {
            setters.put(methodMinusSet,methodName);
          }
          found=true;
        }
 else         if (fieldNames.contains(methodMinusSetCapitalised)) {
          expectedSetters.remove(methodMinusSetCapitalised);
          if (!ignoreFieldNames.contains(methodMinusSetCapitalised)) {
            setters.put(methodMinusSetCapitalised,methodName);
          }
          found=true;
        }
 else         if (fieldNames.contains(methodMenusSetPlusIs)) {
          expectedSetters.remove(methodMenusSetPlusIs);
          if (!ignoreFieldNames.contains(methodMenusSetPlusIs)) {
            setters.put(methodMenusSetPlusIs,methodName);
          }
          found=true;
        }
        if (!found) {
          note(String.format("String_Node_Str",methodName));
        }
      }
 else {
        error("String_Node_Str",executableElement);
      }
    }
    for (    String expectedGetter : expectedGetters) {
      error("String_Node_Str" + expectedGetter);
    }
    for (    String expectedSetter : expectedSetters) {
      error("String_Node_Str" + expectedSetter);
    }
    RealmProxyClassGenerator sourceCodeGenerator=new RealmProxyClassGenerator(processingEnv,className,packageName,fields,getters,setters,indexedFields);
    try {
      sourceCodeGenerator.generate();
    }
 catch (    IOException e) {
      error(e.getMessage(),classElement);
    }
catch (    UnsupportedOperationException e) {
      error(e.getMessage(),classElement);
    }
  }
  if (!done) {
    RealmValidationListGenerator validationGenerator=new RealmValidationListGenerator(processingEnv,classesToValidate);
    try {
      validationGenerator.generate();
      done=true;
    }
 catch (    IOException e) {
      error(e.getMessage());
    }
  }
  return true;
}