[
https://jira.jboss.org/jira/browse/JBAOP-722?page=com.atlassian.jira.plug...
]
Flavia Rainone updated JBAOP-722:
---------------------------------
Description:
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 an anonymous 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$1 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$1)
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.
was:
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.
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 an anonymous 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$1 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$1) 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