@@ -0,0 +1,2920 @@
+package com.fasterxml.jackson.databind.deser.builder;%0A%0Aimport java.beans.ConstructorProperties;%0A%0Aimport com.fasterxml.jackson.annotation.*;%0A%0Aimport com.fasterxml.jackson.databind.*;%0Aimport com.fasterxml.jackson.databind.annotation.JsonDeserialize;%0Aimport com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;%0A%0A// %5Bdatabind#2686%5D: Not sure if this can ever be solved as%0A//  setter/builder is on Builder class, but it is called after%0A//  building completes, i.e. on wrong class.%0A%0Apublic class BuilderWithBackRef2686Test extends BaseMapTest%0A%7B%0A    // %5Bdatabind#2686%5D%0A    public static class Container %7B%0A        private Content forward;%0A%0A        private String containerValue;%0A%0A        @JsonManagedReference%0A        public Content getForward() %7B%0A             return forward;%0A        %7D%0A%0A        @JsonManagedReference%0A        public void setForward(Content forward) %7B%0A             this.forward = forward;%0A        %7D%0A%0A        public String getContainerValue() %7B%0A             return containerValue;%0A        %7D%0A%0A        public void setContainerValue(String containerValue) %7B%0A             this.containerValue = containerValue;%0A        %7D%0A   %7D%0A%0A    @JsonDeserialize(builder = Content.Builder.class) // Works when removing this, i.e. using the constructor%0A    public static class Content %7B%0A//         @JsonBackReference%0A         private Container back;%0A%0A         private String contentValue;%0A         %0A         @ConstructorProperties(%7B %22back%22, %22contentValue%22 %7D)%0A         public Content(Container back, String contentValue) %7B%0A              this.back = back;%0A              this.contentValue = contentValue;%0A         %7D%0A%0A         public String getContentValue() %7B%0A              return contentValue;%0A         %7D%0A%0A         @JsonBackReference%0A         public Container getBack() %7B%0A              return back;%0A         %7D%0A%0A         @JsonPOJOBuilder(withPrefix = %22%22)%0A         public static class Builder %7B%0A             private Container back;%0A             private String contentValue;%0A%0A              @JsonBackReference%0A              Builder back(Container b) %7B%0A                   this.back = b;%0A                   return this;%0A              %7D%0A%0A              Builder contentValue(String cv) %7B%0A                   this.contentValue = cv;%0A                   return this;%0A              %7D%0A              %0A              Content build() %7B%0A                   return new Content(back, contentValue);%0A              %7D%0A         %7D%0A    %7D%0A%0A    private final ObjectMapper MAPPER = sharedMapper();%0A%0A%0A    public void testBuildWithBackRefs2686() throws Exception%0A    %7B%0A        Container container = new Container();%0A        container.containerValue = %22containerValue%22;%0A        Content content = new Content(container, %22contentValue%22);%0A        container.forward = content;%0A     %0A        String json = MAPPER.writeValueAsString(container);%0A        Container result = MAPPER.readValue(json, Container.class); // Exception here%0A%0A        assertNotNull(result);%0A    %7D%0A%7D%0A

Add failing test for #2686