Thrift
  1. Thrift
  2. THRIFT-317

Issues with Java struct validation

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9
    • Labels:
      None

      Description

      The generated validate() methods don't call validate() on their child structs directly. Instead, they wait until the child structs' write() method is called. This could lead to structs being partially written to the wire before encountering an invalid substruct. Additionally, users calling validate() directly would not get the expected behavior.

      1. thrift-317.patch
        3 kB
        Bryan Duxbury

        Activity

        Hide
        Hudson added a comment -

        Integrated in Thrift #373 (See https://builds.apache.org/job/Thrift/373/)
        THRIFT-317. java: Issues with Java struct validation

        Nested structs will now be validated before serialization starts.

        bryanduxbury : http://svn.apache.org/viewvc/?view=rev&rev=1225035
        Files :

        • /thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc
        • /thrift/trunk/lib/java/test/org/apache/thrift/TestStruct.java
        • /thrift/trunk/test/ThriftTest.thrift
        Show
        Hudson added a comment - Integrated in Thrift #373 (See https://builds.apache.org/job/Thrift/373/ ) THRIFT-317 . java: Issues with Java struct validation Nested structs will now be validated before serialization starts. bryanduxbury : http://svn.apache.org/viewvc/?view=rev&rev=1225035 Files : /thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc /thrift/trunk/lib/java/test/org/apache/thrift/TestStruct.java /thrift/trunk/test/ThriftTest.thrift
        Hide
        Bryan Duxbury added a comment -

        I just committed this.

        Show
        Bryan Duxbury added a comment - I just committed this.
        Hide
        Bryan Duxbury added a comment -

        I think that this does the trick. Want to try it out, Diwaker?

        Show
        Bryan Duxbury added a comment - I think that this does the trick. Want to try it out, Diwaker?
        Hide
        Diwaker Gupta added a comment -

        Bump. This is becoming a show stopper for us. As always, I'll try and provide a patch if possible.

        Show
        Diwaker Gupta added a comment - Bump. This is becoming a show stopper for us. As always, I'll try and provide a patch if possible.

          People

          • Assignee:
            Bryan Duxbury
            Reporter:
            Bryan Duxbury
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development