Bug 460735

Summary: NoClassDefFoundError when woven with Pertypewithin clause using @Aspect
Product: [Tools] AspectJ Reporter: Yogesh Thanaseelan <ythanaseelan>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: NEW --- QA Contact:
Severity: blocker    
Priority: P3    
Version: 1.8.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Yogesh Thanaseelan CLA 2015-02-24 14:47:50 EST
The class file generated using iajc task misses some of the generated transient variable defintions when Pertypewithin clause is used with @Aspect annotation. This results in NoClassDefFoundError while accessing the class at runtime.

Steps:
1. write an aspect with @Aspect annotation and applicable for perTypeWithin( pattern matched using annotation ).
2. In the java file that needs to be woven, mention the annotation matching that aspect's target annotation.
3. When iajc runs, the generated class file is not complete. The class files uses some generated aspect instance variables which doesnt have any variable defintion.

This issue doesnt happen consistently and when it works fine, these variables are defined properly and they are defined as transient variables.

Will attach a sample program once I find a pattern to reproduce this problem consistently.

Since this is happening inconsistently, we couldnt use the aspects in our code base.
It works consistently when we use the default singleton instantiation approach.

We are using java 1.7 and aspectj 1.8.5. Happens with Aspectj 1.7.3 version as well.