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

namespaces handled wrongly in acrionscript 3.0 implementation

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.2
    • Component/s: AS3 - Compiler
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      1. if no namespace declared for thrift file - no package declaration is created in generated source files. this leads to compilation time error. should be empty package declaration.
      2. when extending other service with namespace, generated source extend fully qualified parent service, which is compilation time error (at least for apache flex 4.9 compiler). should be generated proper import, and simple extends declaration.

      Both of these issues can be observed, using tutorial example files, with minor changes to shared.thrift file. adding namespace declaration in shared.thrift, we can see generated actionscript file:

      Calculator.as
      /**
       * Autogenerated by Thrift Compiler (0.9.1)
       *
       * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
       *  @generated
       */
      {
      
      import org.apache.thrift.Set;
      import flash.utils.ByteArray;
      import flash.utils.Dictionary;
      
      import org.apache.thrift.*;
      import org.apache.thrift.meta_data.*;
      import org.apache.thrift.protocol.*;
      
      
        /**
         * Ahh, now onto the cool part, defining a service. Services just need a name
         * and can optionally inherit from another service using the extends keyword.
         */
        public interface Calculator extends shared.SharedService {
      

      which should look like:

      Calculator.as
      /**
       * Autogenerated by Thrift Compiler (0.9.1)
       *
       * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
       *  @generated
       */
      package {
      
      import org.apache.thrift.Set;
      import flash.utils.ByteArray;
      import flash.utils.Dictionary;
      
      import org.apache.thrift.*;
      import org.apache.thrift.meta_data.*;
      import org.apache.thrift.protocol.*;
      
      import shared.SharedService;
      
        /**
         * Ahh, now onto the cool part, defining a service. Services just need a name
         * and can optionally inherit from another service using the extends keyword.
         */
        public interface Calculator extends SharedService {
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dimalev dima levchenko
                Reporter:
                dimalev dima levchenko
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: