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

generated java code may have name clashes with thrift library

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.5
    • 0.6
    • Java - Compiler
    • None

    Description

      We had a structure called 'State' in a thrift spec which caused the generated Java code to have a naming conflict; State conflicts with TAsynchMethodCall.State (an enum).

      Since part of the point of thrift is long-term compatibility and an evolving thrift spec, it's not very practical to have the potential for naming conflicts like this. So we want to fix it. But because it is at least slightly painful to do, I want to make sure people are fine with the intended fix.

      Proposed fix:

      (1) Remove t_java_generator::java_thrift_imports() completely.
      (2) Replace all references to imported Thrift library classes so their fully qualified class names.

      The generated code will be a bit less readable due to fully qualified class names, but the code should be correct and it should be obvious what comes from where (if fully qualified names matter that means a human is looking at the code, in which case importing * is not terribly nice anyway).

      Thoughts?

      Attachments

        1. thrift-0_5-libfqcn.patch
          44 kB
          Peter Schuller
        2. thrift-r1042609-libfqcn.patch
          45 kB
          Peter Schuller

        Activity

          People

            scode Peter Schuller
            scode Peter Schuller
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: