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"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.5
    • 1.7.5
    • java
    • 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

        1. AVRO-1300.20130418-104121.patch
          4 kB
          Christophe Taton

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: