Bug 498100

Summary: Can't weave compiled aspects
Product: [Tools] AspectJ Reporter: Eduard Matsukov <archinamon>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: NEW --- QA Contact:
Severity: major    
Priority: P3 CC: aclement
Version: 1.8.9   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
ajc crash none

Description Eduard Matsukov CLA 2016-07-18 17:50:23 EDT
Created attachment 263174 [details]
ajc crash

I have two-step compilation with ajc:

1) compile only aj-sources, so no -aspectpath, -inpath paramenters. In -sourceroots only generated java-sources (annotation processors, etc.) and aj-files set.
2) weave hole project with a separate task, so no -sourceroots param, but -aspectpath and -path are lead to all the jars and build directories with .class files.

I got a crash in ajc :(

Maybe some point I lost?

Sorry for marking 'major', but this thing important in building development instrument for Android I'm working on :)
Comment 1 Andrew Clement CLA 2016-07-27 14:46:31 EDT
That error, in particular the:

org.aspectj.apache.bcel.classfile.ConstantFieldref cannot be cast to org.aspectj.apache.bcel.classfile.ConstantUtf8

suggests something else has modified the classfiles between step (1) producing them and step (2) reprocessing them.

Any kind of trip through some other tool maybe adversely affect the constant pool ordering and the encoded constant pool references in the aspectJ attributes will then be wrong. Are you sure there isn't another tool doing something in the meantime?