tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TAP5-1736) Overriding a base class abstract event handler method causes the sub-class method to be invoked twice
Date Mon, 01 Sep 2014 23:19:21 GMT

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

ASF subversion and git services commented on TAP5-1736:
-------------------------------------------------------

Commit df93764ad8b5ecdda365f2c205e652692993e084 in tapestry-5's branch refs/heads/master from
[~hlship]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=df93764 ]

TAP5-1736: Overriding a base class abstract event handler method causes the sub-class method
to be invoked twice


> Overriding a base class abstract event handler method causes the sub-class method to
be invoked twice
> -----------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1736
>                 URL: https://issues.apache.org/jira/browse/TAP5-1736
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3
>            Reporter: Peter Stavrinides
>            Assignee: Howard M. Lewis Ship
>             Fix For: 5.4
>
>
> As of Tapestry 5.3.0 overridden base class methods are causing a second submit, behaviour
not present in Tapestry 5.1:
> public abstract class BaseClass {
>    public abstract Object onSuccessFromStep1();
> }
>  public class SubClass extends BaseClass{
> @Override
> public Object onSuccessFromStep1() {
>    if (!foundErrors())
>         incrementStep();
>    return null;
> }
> }
> onSuccessFromStep1()  is invoked twice in this example... the simple workaround is to
return true, but this will not suffice when handling objects. 
> Comment from Howard:
> I suspect Tapestry is not recognizing that
> SubClass.onSuccessFromStep1() is an override of
> BaseClass.onSuccessFromStep1() (perhaps the abstract flag is throwing
> it).
> So, Tapestry builds code for BaseClass, and implements
> dispatchComponentEvent() to invoke onSuccessFromStep1().
> It then builds code for SubClass, sees onSuccessFromStep1(), doesn't
> think it's an override of the base class method (for whatever reason),
> and implements dispatchComponentEvent() to (a) invoke
> super.dispatchComponentEvent(), and (b) invoke onSuccessFromStep1().
> Thus two invocations.



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

Mime
View raw message