You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Steve Eynon <st...@alienfactory.co.uk> on 2011/10/11 07:13:36 UTC

[T5.2.6] / [T5.3] Possible (minor) bug in ImportWorker

I might have this all wrong but thought it's worth a mention...

When org.apache.tapestry5.internal.transform.ImportWorker adds stack
advice to the setupRender() method, it calls invocation.proceed()
multiple times, once per added stack:

line 119:

private MethodAdvice createImportStackAdvice(final String[] stacks) {
    return new MethodAdvice() {
        public void advise(MethodInvocation invocation) {
            for (String stack : stacks) {
                javascriptSupport.importStack(stack);

                invocation.proceed();
            }
        }
    };
}

Should not invocation.proceed() be outside the for loop, or does it not matter?

I was just poking around looking for examples of adding advice to
lifecycle methods.

Steve.

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


Re: [T5.2.6] / [T5.3] Possible (minor) bug in ImportWorker

Posted by Howard Lewis Ship <hl...@gmail.com>.
Good catch!

On Mon, Oct 10, 2011 at 10:13 PM, Steve Eynon
<st...@alienfactory.co.uk> wrote:
> I might have this all wrong but thought it's worth a mention...
>
> When org.apache.tapestry5.internal.transform.ImportWorker adds stack
> advice to the setupRender() method, it calls invocation.proceed()
> multiple times, once per added stack:
>
> line 119:
>
> private MethodAdvice createImportStackAdvice(final String[] stacks) {
>    return new MethodAdvice() {
>        public void advise(MethodInvocation invocation) {
>            for (String stack : stacks) {
>                javascriptSupport.importStack(stack);
>
>                invocation.proceed();
>            }
>        }
>    };
> }
>
> Should not invocation.proceed() be outside the for loop, or does it not matter?
>
> I was just poking around looking for examples of adding advice to
> lifecycle methods.
>
> Steve.
>
> ---------------------------------------------------------------------
> 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