You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Peter Stavrinides <P....@albourne.com> on 2011/10/27 12:11:35 UTC

Possible regression Tapestry 5.1 to 5.3

Hi all,

We noticed some odd behaviour today in one of our apps, it appears when we use the pattern detailed below, the onSuccessFromStep1() event gets invoked twice by Tapestry, this was not the case in 5.1:

public abstract class BaseClass {
   public abstract Object onSuccessFromStep1();
}


public class SubClass extends BaseClass{

@Override
public Object onSuccessFromStep1() {
   if (!foundErrors()) 
	incrementStep();
   return null;
}

}

Of course a simple workaround is to remove the @Override, but that really defeats the purpose of using a base class.

regards,
Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Possible regression Tapestry 5.1 to 5.3

Posted by Peter Stavrinides <P....@albourne.com>.
> Probably a bug, but may only be fixed in 5.4 or 5.3.1 at this point.
Opened a new Jira: https://issues.apache.org/jira/browse/TAP5-1736

Regards,
Peter


----- Original Message -----
From: "Howard Lewis Ship" <hl...@gmail.com>
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Thursday, 27 October, 2011 20:28:36 GMT +02:00 Athens, Bucharest, Istanbul
Subject: Re: Possible regression Tapestry 5.1 to 5.3

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.

Probably a bug, but may only be fixed in 5.4 or 5.3.1 at this point.


On Thu, Oct 27, 2011 at 3:26 AM, Peter Stavrinides
<P....@albourne.com> wrote:
> FYI: returning true will also work, so I am happy to use that as a workaround instead, but I am still puzzled as to why it gets invoked twice? I suspect this is going to cause issues when I need to return an Object.
>
> cheers,
> Peter
>
> ----- Original Message -----
> From: "Peter Stavrinides" <P....@albourne.com>
> To: "Tapestry Mailing List" <us...@tapestry.apache.org>
> Sent: Thursday, 27 October, 2011 13:11:35 GMT +02:00 Athens, Bucharest, Istanbul
> Subject: Possible regression Tapestry 5.1 to 5.3
>
> Hi all,
>
> We noticed some odd behaviour today in one of our apps, it appears when we use the pattern detailed below, the onSuccessFromStep1() event gets invoked twice by Tapestry, this was not the case in 5.1:
>
> public abstract class BaseClass {
>   public abstract Object onSuccessFromStep1();
> }
>
>
> public class SubClass extends BaseClass{
>
> @Override
> public Object onSuccessFromStep1() {
>   if (!foundErrors())
>        incrementStep();
>   return null;
> }
>
> }
>
> Of course a simple workaround is to remove the @Override, but that really defeats the purpose of using a base class.
>
> regards,
> Peter
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Possible regression Tapestry 5.1 to 5.3

Posted by Howard Lewis Ship <hl...@gmail.com>.
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.

Probably a bug, but may only be fixed in 5.4 or 5.3.1 at this point.


On Thu, Oct 27, 2011 at 3:26 AM, Peter Stavrinides
<P....@albourne.com> wrote:
> FYI: returning true will also work, so I am happy to use that as a workaround instead, but I am still puzzled as to why it gets invoked twice? I suspect this is going to cause issues when I need to return an Object.
>
> cheers,
> Peter
>
> ----- Original Message -----
> From: "Peter Stavrinides" <P....@albourne.com>
> To: "Tapestry Mailing List" <us...@tapestry.apache.org>
> Sent: Thursday, 27 October, 2011 13:11:35 GMT +02:00 Athens, Bucharest, Istanbul
> Subject: Possible regression Tapestry 5.1 to 5.3
>
> Hi all,
>
> We noticed some odd behaviour today in one of our apps, it appears when we use the pattern detailed below, the onSuccessFromStep1() event gets invoked twice by Tapestry, this was not the case in 5.1:
>
> public abstract class BaseClass {
>   public abstract Object onSuccessFromStep1();
> }
>
>
> public class SubClass extends BaseClass{
>
> @Override
> public Object onSuccessFromStep1() {
>   if (!foundErrors())
>        incrementStep();
>   return null;
> }
>
> }
>
> Of course a simple workaround is to remove the @Override, but that really defeats the purpose of using a base class.
>
> regards,
> Peter
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Possible regression Tapestry 5.1 to 5.3

Posted by Peter Stavrinides <P....@albourne.com>.
FYI: returning true will also work, so I am happy to use that as a workaround instead, but I am still puzzled as to why it gets invoked twice? I suspect this is going to cause issues when I need to return an Object.

cheers,
Peter

----- Original Message -----
From: "Peter Stavrinides" <P....@albourne.com>
To: "Tapestry Mailing List" <us...@tapestry.apache.org>
Sent: Thursday, 27 October, 2011 13:11:35 GMT +02:00 Athens, Bucharest, Istanbul
Subject: Possible regression Tapestry 5.1 to 5.3

Hi all,

We noticed some odd behaviour today in one of our apps, it appears when we use the pattern detailed below, the onSuccessFromStep1() event gets invoked twice by Tapestry, this was not the case in 5.1:

public abstract class BaseClass {
   public abstract Object onSuccessFromStep1();
}


public class SubClass extends BaseClass{

@Override
public Object onSuccessFromStep1() {
   if (!foundErrors()) 
	incrementStep();
   return null;
}

}

Of course a simple workaround is to remove the @Override, but that really defeats the purpose of using a base class.

regards,
Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org