[jboss-jira] [JBoss JIRA] Commented: (JBAOP-722) Wrapper Generated for Inner Class Constructor May Not Invoke the Interceptor Chain

Flavia Rainone (JIRA) jira-events at lists.jboss.org
Tue Apr 21 09:46:22 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBAOP-722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12463416#action_12463416 ] 

Flavia Rainone commented on JBAOP-722:
--------------------------------------

Added a TODO associated with this Jira on org.jboss.test.aop.rebuildingchain.ConstructorExecutionSyncThread$Pojo, showing how to reproduce the described scenario.

> Wrapper Generated for Inner Class Constructor May Not Invoke the Interceptor Chain
> ----------------------------------------------------------------------------------
>
>                 Key: JBAOP-722
>                 URL: https://jira.jboss.org/jira/browse/JBAOP-722
>             Project: JBoss AOP
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 2.1.0.GA
>            Reporter: Flavia Rainone
>            Assignee: Flavia Rainone
>             Fix For: 2.1.1.GA
>
>
> When the default constructor of an inner class is invoked by the external class, and this inner class lacks the constructor declaration, the JVM compiles this as a call to the constructor that receives the external class as a parameter.
> Take a look at the sample below:
> public class ExternalClass
> {
>     public void invokeIt() { new Pojo();}
>    private static class Pojo {}
> }
> Wen this code is compiled, this is what the JVM will generate:
> public class ExternalClass
> {
>    public void invokeIt() {new Pojo(null);}
>    
>    private static class Pojo
>    {
>        public Pojo() {}
>        public Pojo (ExternalClass ec) {}
> }
> If the execution of the default constructor needs to be intercepted on the scenario above, JBoss AOP will get confused with the constructor stuff, and the interception won't take place.. JBoss AOP will generate an empty wrapper for the Pojo(ExternalClass) constructor, and a wrapper that delegates to the interceptor chain for the default constructor. But, given that the first constructor is invoked, no interception will take place.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list