Program: 26932
Project: 26932
Buggy source:
@Override public void onWriteDefinition(TypeSpec.Builder typeBuilder){
  typeBuilder.addField(FieldSpec.builder(ClassName.get(String.class),AUTHORITY,Modifier.PRIVATE,Modifier.STATIC,Modifier.FINAL).initializer("String_Node_Str",authority).build());
  int code=0;
  for (  TableEndpointDefinition endpointDefinition : endpointDefinitions) {
    for (    ContentUriDefinition contentUriDefinition : endpointDefinition.contentUriDefinitions) {
      typeBuilder.addField(FieldSpec.builder(TypeName.INT,contentUriDefinition.name,Modifier.PRIVATE,Modifier.STATIC,Modifier.FINAL).initializer(String.valueOf(code)).build());
      code++;
    }
  }
  FieldSpec.Builder uriField=FieldSpec.builder(ClassNames.URI_MATCHER,URI_MATCHER,Modifier.PRIVATE,Modifier.STATIC,Modifier.FINAL);
  CodeBlock.Builder initializer=CodeBlock.builder().addStatement("String_Node_Str",ClassNames.URI_MATCHER,ClassNames.URI_MATCHER).add("String_Node_Str");
  for (  TableEndpointDefinition endpointDefinition : endpointDefinitions) {
    for (    ContentUriDefinition contentUriDefinition : endpointDefinition.contentUriDefinitions) {
      String path;
      if (contentUriDefinition.path != null) {
        path="String_Node_Str" + contentUriDefinition.path + "String_Node_Str";
      }
 else {
        path=CodeBlock.builder().add("String_Node_Str",contentUriDefinition.elementClassName,contentUriDefinition.name).build().toString();
      }
      initializer.addStatement("String_Node_Str",URI_MATCHER,AUTHORITY,path,contentUriDefinition.name);
    }
  }
  initializer.add("String_Node_Str");
  typeBuilder.addField(uriField.initializer(initializer.build()).build());
  typeBuilder.addMethod(MethodSpec.methodBuilder("String_Node_Str").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC,Modifier.FINAL).addStatement("String_Node_Str",databaseName).returns(ClassName.get(String.class)).build());
  MethodSpec.Builder getTypeBuilder=MethodSpec.methodBuilder("String_Node_Str").addAnnotation(Override.class).addParameter(ClassNames.URI,"String_Node_Str").returns(ClassName.get(String.class)).addModifiers(Modifier.PUBLIC,Modifier.FINAL);
  CodeBlock.Builder getTypeCode=CodeBlock.builder().addStatement("String_Node_Str",ClassName.get(String.class)).beginControlFlow("String_Node_Str",URI_MATCHER);
  for (  TableEndpointDefinition tableEndpointDefinition : endpointDefinitions) {
    for (    ContentUriDefinition uriDefinition : tableEndpointDefinition.contentUriDefinitions) {
      getTypeCode.beginControlFlow("String_Node_Str",uriDefinition.name).addStatement("String_Node_Str",uriDefinition.type).addStatement("String_Node_Str").endControlFlow();
    }
  }
  getTypeCode.beginControlFlow("String_Node_Str").addStatement("String_Node_Str",ClassName.get(IllegalArgumentException.class),"String_Node_Str","String_Node_Str").endControlFlow();
  getTypeCode.endControlFlow();
  getTypeCode.addStatement("String_Node_Str");
  getTypeBuilder.addCode(getTypeCode.build());
  typeBuilder.addMethod(getTypeBuilder.build());
  for (  FlowWriter writer : methods) {
    writer.write(javaWriter);
  }
}

Fixed version (ground truth):
@Override public void onWriteDefinition(TypeSpec.Builder typeBuilder){
  typeBuilder.addField(FieldSpec.builder(ClassName.get(String.class),AUTHORITY,Modifier.PRIVATE,Modifier.STATIC,Modifier.FINAL).initializer("String_Node_Str",authority).build());
  int code=0;
  for (  TableEndpointDefinition endpointDefinition : endpointDefinitions) {
    for (    ContentUriDefinition contentUriDefinition : endpointDefinition.contentUriDefinitions) {
      typeBuilder.addField(FieldSpec.builder(TypeName.INT,contentUriDefinition.name,Modifier.PRIVATE,Modifier.STATIC,Modifier.FINAL).initializer(String.valueOf(code)).build());
      code++;
    }
  }
  FieldSpec.Builder uriField=FieldSpec.builder(ClassNames.URI_MATCHER,URI_MATCHER,Modifier.PRIVATE,Modifier.STATIC,Modifier.FINAL);
  CodeBlock.Builder initializer=CodeBlock.builder().addStatement("String_Node_Str",ClassNames.URI_MATCHER,ClassNames.URI_MATCHER).add("String_Node_Str");
  for (  TableEndpointDefinition endpointDefinition : endpointDefinitions) {
    for (    ContentUriDefinition contentUriDefinition : endpointDefinition.contentUriDefinitions) {
      String path;
      if (contentUriDefinition.path != null) {
        path="String_Node_Str" + contentUriDefinition.path + "String_Node_Str";
      }
 else {
        path=CodeBlock.builder().add("String_Node_Str",contentUriDefinition.elementClassName,contentUriDefinition.name).build().toString();
      }
      initializer.addStatement("String_Node_Str",URI_MATCHER,AUTHORITY,path,contentUriDefinition.name);
    }
  }
  initializer.add("String_Node_Str");
  typeBuilder.addField(uriField.initializer(initializer.build()).build());
  typeBuilder.addMethod(MethodSpec.methodBuilder("String_Node_Str").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC,Modifier.FINAL).addStatement("String_Node_Str",databaseName).returns(ClassName.get(String.class)).build());
  MethodSpec.Builder getTypeBuilder=MethodSpec.methodBuilder("String_Node_Str").addAnnotation(Override.class).addParameter(ClassNames.URI,"String_Node_Str").returns(ClassName.get(String.class)).addModifiers(Modifier.PUBLIC,Modifier.FINAL);
  CodeBlock.Builder getTypeCode=CodeBlock.builder().addStatement("String_Node_Str",ClassName.get(String.class)).beginControlFlow("String_Node_Str",URI_MATCHER);
  for (  TableEndpointDefinition tableEndpointDefinition : endpointDefinitions) {
    for (    ContentUriDefinition uriDefinition : tableEndpointDefinition.contentUriDefinitions) {
      getTypeCode.beginControlFlow("String_Node_Str",uriDefinition.name).addStatement("String_Node_Str",uriDefinition.type).addStatement("String_Node_Str").endControlFlow();
    }
  }
  getTypeCode.beginControlFlow("String_Node_Str").addStatement("String_Node_Str",ClassName.get(IllegalArgumentException.class),"String_Node_Str","String_Node_Str").endControlFlow();
  getTypeCode.endControlFlow();
  getTypeCode.addStatement("String_Node_Str");
  getTypeBuilder.addCode(getTypeCode.build());
  typeBuilder.addMethod(getTypeBuilder.build());
  for (  MethodDefinition method : methods) {
    MethodSpec methodSpec=method.getMethodSpec();
    if (methodSpec != null) {
      typeBuilder.addMethod(methodSpec);
    }
  }
}