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

Fix word-extraction substr bug in initialism code

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.3
    • Fix Version/s: 0.10.0
    • Component/s: Go - Compiler
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      GitHub user prashantv opened a pull request:

      https://github.com/apache/thrift/pull/625

      Fix word-extraction substr bug in initialism code

      Initialisms were not handled in the second word or later. E.g. for the given Thrift file,
      ```thrift
      service S

      { void get_id() }

      ```

      The generated code was using `GetIdArgs` instead of `GetIDArgs`. This was happening because fix_common_initialism was passing the position of the underscore to substr when extracting the word, when substr expects a length.

      You can merge this pull request into a Git repository by running:

      $ git pull https://github.com/prashantv/thrift initialism_fix

      Alternatively you can review and apply these changes as the patch at:

      https://github.com/apache/thrift/pull/625.patch

      To close this pull request, make a commit to your master/trunk branch
      with (at least) the following in the commit message:

      This closes #625


      commit 7df89525116a456b25fff2c903078fece4cb6a2a
      Author: Prashant Varanasi <prashant@uber.com>
      Date: 2015-09-24T22:06:47Z

      Fix word-extraction substr bug in initialism code

      Initialisms were not handled in the second word or later.

      fix_common_initialism was passing the position of the underscore to
      substr when extracting the word, when substr expects a length.



      If your project is set up for it, you can reply to this email and have your
      reply appear on GitHub as well. If your project does not have this feature
      enabled and wishes so, or if the feature is enabled but not working, please
      contact infrastructure at infrastructure@apache.org or file a JIRA ticket
      with INFRA.

        Attachments

          Activity

            People

            • Assignee:
              prashantv Prashant V
              Reporter:
              jensg Jens Geyer
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: