Interceptors delegating chain forwarding to scoped objects cause infinite loope loop
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
A JeeUnit test that reproduces the problem in Java SE (2.1.0.Final)
@RunWith(JeeunitRunner.class)
public class InterceptorTest {
@Inject
Intercepted bean;
@Test
{ bean.method(); }public void test() throws Exception
@InterceptorBinding
{ElementType.METHOD, ElementType.TYPE}@Target(
)
@Retention(RetentionPolicy.RUNTIME)
static public @interface InterceptMe {}
@InterceptMe
@Interceptor @Priority(1)
static class AnInterceptor {
@Inject
ScopedBean delegate;
@AroundInvoke
{ return delegate.execute(ctx); }public Object intercept(final InvocationContext ctx) throws Exception
}
@ApplicationScoped
static class ScopedBean {
public Object execute(InvocationContext ctx) throws Exception
{ return ctx.proceed(); }}
@InterceptMe
static class Intercepted {
public void method()
{ System.out.println(this+" is doing it"); }}
}