Program: 174036
Project: 174036
Buggy source:
@Nonnull private MethodSpec buildLinkMethod() throws ArezProcessorException {
  final String methodName=getLinkMethodName();
  final MethodSpec.Builder builder=MethodSpec.methodBuilder(methodName);
  builder.addModifiers(Modifier.PRIVATE);
  GeneratorUtil.generateNotDisposedInvariant(_componentDescriptor,builder,methodName);
  final boolean isNullable=!getIdMethod().getReturnType().getKind().isPrimitive() && null == ProcessorUtil.findAnnotationByType(getIdMethod(),Constants.NONNULL_ANNOTATION_CLASSNAME);
  if ("String_Node_Str".equals(getLinkType())) {
    builder.addStatement("String_Node_Str",getIdMethod().getReturnType(),getIdMethod().getSimpleName());
    if (isNullable) {
      final CodeBlock.Builder nestedBlock=CodeBlock.builder();
      nestedBlock.beginControlFlow("String_Node_Str");
      buildLookup(nestedBlock);
      nestedBlock.endControlFlow();
      builder.addCode(nestedBlock.build());
    }
 else {
      buildLookup(builder);
    }
  }
 else {
    final CodeBlock.Builder block=CodeBlock.builder();
    block.beginControlFlow("String_Node_Str",getFieldName());
    block.addStatement("String_Node_Str",getIdMethod().getReturnType(),getIdMethod().getSimpleName());
    if (isNullable) {
      final CodeBlock.Builder nestedBlock=CodeBlock.builder();
      nestedBlock.beginControlFlow("String_Node_Str");
      buildLookup(nestedBlock);
      nestedBlock.endControlFlow();
      block.add(nestedBlock.build());
    }
 else {
      buildLookup(block);
    }
    block.endControlFlow();
    builder.addCode(block.build());
  }
  return builder.build();
}

Fixed version (ground truth):
@Nonnull private MethodSpec buildLinkMethod() throws ArezProcessorException {
  final String methodName=getLinkMethodName();
  final MethodSpec.Builder builder=MethodSpec.methodBuilder(methodName);
  builder.addModifiers(Modifier.PRIVATE);
  GeneratorUtil.generateNotDisposedInvariant(_componentDescriptor,builder,methodName);
  final boolean isNullable=!getIdMethod().getReturnType().getKind().isPrimitive() && null == ProcessorUtil.findAnnotationByType(getIdMethod(),Constants.NONNULL_ANNOTATION_CLASSNAME);
  if ("String_Node_Str".equals(getLinkType())) {
    builder.addStatement("String_Node_Str",getIdMethod().getReturnType(),getIdMethod().getSimpleName());
    if (isNullable) {
      final CodeBlock.Builder nestedBlock=CodeBlock.builder();
      nestedBlock.beginControlFlow("String_Node_Str");
      buildLookup(nestedBlock);
      nestedBlock.nextControlFlow("String_Node_Str");
      nestedBlock.addStatement("String_Node_Str",getFieldName());
      nestedBlock.endControlFlow();
      builder.addCode(nestedBlock.build());
    }
 else {
      buildLookup(builder);
    }
  }
 else {
    final CodeBlock.Builder block=CodeBlock.builder();
    block.beginControlFlow("String_Node_Str",getFieldName());
    block.addStatement("String_Node_Str",getIdMethod().getReturnType(),getIdMethod().getSimpleName());
    if (isNullable) {
      final CodeBlock.Builder nestedBlock=CodeBlock.builder();
      nestedBlock.beginControlFlow("String_Node_Str");
      buildLookup(nestedBlock);
      nestedBlock.endControlFlow();
      block.add(nestedBlock.build());
    }
 else {
      buildLookup(block);
    }
    block.endControlFlow();
    builder.addCode(block.build());
  }
  return builder.build();
}