Summary: | IlegalAccessError from separate compilation | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Ron Bodkin <rbodkin+LISTS> | ||||||
Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> | ||||||
Status: | RESOLVED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | aclement | ||||||
Version: | 1.5.0 | ||||||||
Target Milestone: | 1.5.4 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Ron Bodkin
2006-01-23 02:20:04 EST
Created attachment 33448 [details]
Woven file that references private method
Created attachment 33449 [details]
The pertypewithin aspect
The basic idiom of this aspect is the following:
public aspect LogManagement pertypewithin(LogOwner+) {
declare parents: ... implements LogOwner;
after() returning: staticinitialization(*) {
managedClass = thisJoinPointStaticPart.getSignature().getDeclaringType();
initialize();
}
private void initialize() {
if (factory != null) {
logger = getLogger(managedClass);
...
}
public void LogOwner.logInfo(String message) {
}
void around(String message) : call(void LogOwner.logInfo(String)) && args(message) {
logger.info(message);
}
}
From javap -private -c -l GlassboxInitializationImpl ... 35: invokestatic #171; //Method glassbox/util/logging/api/LogManagement.a jc$around$glassbox_util_logging_api_LogManagement$9$ff3f21f8_aroundBody17$advice :(Lglassbox/util/logging/api/LogManagement;Ljava/lang/String;Lorg/aspectj/runtim e/internal/AroundClosure;Lorg/aspectj/lang/JoinPoint;Lglassbox/util/logging/api/ LogManagement$HandleUninitialized;Lorg/aspectj/runtime/internal/AroundClosure;Lo rg/aspectj/lang/JoinPoint;)Ljava/lang/Object; From javap -private -c -l LogManagement ... private static final java.lang.Object ajc$around$glassbox_util_logging_api_LogMa nagement$9$ff3f21f8_aroundBody17$advice(glassbox.util.logging.api.LogManagement, java.lang.String, org.aspectj.runtime.internal.AroundClosure, org.aspectj.lang. JoinPoint, glassbox.util.logging.api.LogManagement$HandleUninitialized, org.aspe ctj.runtime.internal.AroundClosure, org.aspectj.lang.JoinPoint); Code: 0: aload 5 2: astore 8 4: aload_0 5: aload_1 6: aload_2 7: aload_3 8: invokestatic #453; //Method ajc$around$glassbox_util_logging_api_LogM anagement$9$ff3f21f8_aroundBody16:(Lglassbox/util/logging/api/LogManagement;Ljav a/lang/String;Lorg/aspectj/runtime/internal/AroundClosure;Lorg/aspectj/lang/Join Point;)V 11: aconst_null 12: areturn 13: pop ... If I build with -Xnoline end-to-end, this error goes away (thanks for suggesting I test that Andy!). The code that is being generated in this case is so ugly/inefficient that I'm looking more closely to see if there's a reasonable alternative to the approach I've been using to access the field from the pertypewithin aspect... which hopefully will also work around this issue. Ron ... I get an error very similar to this if I mess about with the typemap strategy for looking after types. Was this bug seen on 1.5.0 final - on HEAD or on a patched HEAD? Each one. I was able to reproduce it with 1.5.0 final. take a look if time... interestingly this is exactly the problem I saw when mixing annotation style and code style aspects in a hierarchy. I suspect this might be fixed now because of what I did for the other bug. suspected fixed after making those other changes. |