You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/01/10 17:48:39 UTC

[jira] [Commented] (THRIFT-3539) Use self.process_* instead of Processor.process_* in generated processor code

    [ https://issues.apache.org/jira/browse/THRIFT-3539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15091111#comment-15091111 ] 

ASF GitHub Bot commented on THRIFT-3539:
----------------------------------------

GitHub user tbartelmess opened a pull request:

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

    THRIFT-3539 Use self.process_foo instead of Processor.process_foo

    https://issues.apache.org/jira/browse/THRIFT-3539

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

    $ git pull https://github.com/tbartelmess/thrift THRIFT-3539

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

    https://github.com/apache/thrift/pull/784.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 #784
    
----
commit 07e13aeda01387114d06ccfd6b57b21d81855c48
Author: Thomas Bartelmess <tb...@marketcircle.com>
Date:   2016-01-10T16:48:02Z

    Use self.process_foo instead of Processor.process_foo
    
    THRIFT-3539

----


> Use self.process_* instead of Processor.process_* in generated processor code
> -----------------------------------------------------------------------------
>
>                 Key: THRIFT-3539
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3539
>             Project: Thrift
>          Issue Type: Bug
>            Reporter: Thomas Bartelmess
>
> In our codebase we ended up overriding the process_* handlers because we had some special requirements, how exceptions are handled.
> in the __init__ function of processor the self._processMap refers to all the process_* functions on the Processor class.
> {code}
> def __init__(self):
>   self._processMap = {}
>   self._processMap = Processor.process_foo
> {code}
> The processor should refer to the functions using self, so when they are overridden in the subclass, the subclass implementation is used.
> {code}
> def __init__(self):
>   self._processMap = {}
>   self._processMap = self.process_foo
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)