[
http://jira.jboss.com/jira/browse/JBAOP-565?page=comments#action_12410839 ]
Flavia Rainone commented on JBAOP-565:
--------------------------------------
This bug has manifested since svn revision #72748 (JBAOP-545).
The reason for this is that the duplicate instrumentation of class
org.jboss.test.aop.regression.jbaop484superproxyadvised.Base during the execution of
SuperClassIsAdvisedByProxyTestCase.testClassAdvisorAndNotInstanceAdvisor() generated an
inconsistency between the superClassAdvisor of
org.jboss.test.aop.regression.jbaop484superproxyadvised.Child and the result of
isBaseClass(Child.class). Since the first instrumentation of Base resulted in an not woven
class, isBaseClass(Child.class) returns true (it checks if
AOPClassPool.isClassLoadedButNotWoven(Base.class) is true, which is). But, on the other
hand, superClassAdvisor points to the generated advisor of Base, which was created and
added to javassist as a result of the second instrumentation of the same class, Base.
Since revision #72748, as an optimization, calls to isBaseClass were replaced by checks on
the nulity of superClassAdvisor, which evidenced this bug.
SuperClassesFirstWeavingStrategy instruments classes already loaded
-------------------------------------------------------------------
Key: JBAOP-565
URL:
http://jira.jboss.com/jira/browse/JBAOP-565
Project: JBoss AOP
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 2.0.0.CR8
Reporter: Flavia Rainone
Assigned To: Flavia Rainone
Fix For: 2.0.0.GA
The method SuperClassesFirstWeavingStrategy tries to transform super classes that have
already been loaded.
As a result, on load time weaving we can see inconsistent transformations if there are
aspects added/removed between two transformations of the same class.
This bug can be seen when running the regression test
jbaop484superproxyadvised.SuperClassIsAdvisedByProxyTestCase.testClassAdvisorAndNotInstanceAdvisor():
java.lang.RuntimeException: java.lang.NullPointerException
at
org.jboss.aop.proxy.container.GeneratedAOPProxyFactory.getProxy(GeneratedAOPProxyFactory.java:124)
at
org.jboss.aop.proxy.container.GeneratedAOPProxyFactory.createAdvisedProxy(GeneratedAOPProxyFactory.java:85)
at
org.jboss.test.aop.regression.jbaop484superproxyadvised.SuperClassIsAdvisedByProxyTestCase.createProxy(SuperClassIsAdvisedByProxyTestCase.java:196)
at
org.jboss.test.aop.regression.jbaop484superproxyadvised.SuperClassIsAdvisedByProxyTestCase.testClassAdvisorAndNotInstanceAdvisor(SuperClassIsAdvisedByProxyTestCase.java:137)
Caused by: java.lang.NullPointerException
at
org.jboss.aop.proxy.container.ContainerProxyFactory.createProxyMethods(ContainerProxyFactory.java:631)
at
org.jboss.aop.proxy.container.ContainerProxyFactory.addMethodsAndMixins(ContainerProxyFactory.java:523)
at
org.jboss.aop.proxy.container.ContainerProxyFactory.createProxyCtClass(ContainerProxyFactory.java:215)
at
org.jboss.aop.proxy.container.ContainerProxyFactory.createProxyCtClass(ContainerProxyFactory.java:187)
at
org.jboss.aop.proxy.container.ContainerProxyFactory.generateProxy(ContainerProxyFactory.java:154)
at
org.jboss.aop.proxy.container.ContainerProxyFactory.getProxyClass(ContainerProxyFactory.java:144)
at
org.jboss.aop.proxy.container.ContainerProxyFactory.getProxyClass(ContainerProxyFactory.java:118)
at
org.jboss.aop.proxy.container.GeneratedAOPProxyFactory.generateProxy(GeneratedAOPProxyFactory.java:130)
at
org.jboss.aop.proxy.container.GeneratedAOPProxyFactory.getProxy(GeneratedAOPProxyFactory.java:116)
... 20 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira