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

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.2
    • Fix Version/s: 0.11.0
    • Component/s: Java - Compiler
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: