Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-1300

Copy-constructor for specific record builders: Builder(Builder other) does not copy the fields from builder "other"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.5
    • Fix Version/s: 1.7.5
    • Component/s: java
    • Labels:
      None

      Description

      Here is a test that fails:

      @Test
      public void test()

      { final Player.Builder builder = Player.newBuilder() .setFirstName("FirstName"); final Player.Builder other = Player.newBuilder(builder); Assert.assertEquals("FirstName", other.getFirstName()); }

      The generated code looks like:

      /** Creates a new Player RecordBuilder by copying an existing Builder */
      public static avro.examples.baseball.Player.Builder newBuilder(avro.examples.baseball.Player.Builder other)

      { return new avro.examples.baseball.Player.Builder(other); }

      /** Creates a Builder by copying an existing Builder */
      private Builder(avro.examples.baseball.Player.Builder other)

      { super(other); // calls SpecificRecordBuilderBase(SpecificRecordBuilderBase<T> other) }

        Attachments

          Activity

            People

            • Assignee:
              kryzthov Christophe Taton
              Reporter:
              kryzthov Christophe Taton
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: