Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-4177

Java compiler produces deep copy constructor that could make shallow copy instead

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.9.2
    • 0.11.0
    • Java - Compiler
    • None

    Description

      Java compiler produces deep copy constructor that makes shallow copies for referenced objects from collections when they are defined after the root object in the thrift file.

      For example, consider following thrift file:

      struct Foo {
      1: optional list<Bar> bars,
      }

      struct Bar {
      1: optional string value,
      }

      new Foo().deepCopy() will produce a copy of Foo with a copy of a list that reference the same Bar object.

      Attachments

        Issue Links

          Activity

            People

              jking3 James E. King III
              afds Deniss Afonin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: