diff options
Diffstat (limited to 'loadtime')
-rw-r--r-- | loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java index 0db0220c4..134de582f 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java @@ -451,6 +451,15 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor { info("register aspect " + aspectClassName); // System.err.println("? ClassLoaderWeavingAdaptor.registerAspects() aspectName=" + aspectClassName + // ", loader=" + loader + ", bundle=" + weavingContext.getClassLoaderName()); + String requiredType = definition.getAspectRequires(aspectClassName); + if (requiredType != null) { + // This aspect expresses that it requires a type to be around, otherwise it should 'switch off' + ((BcelWorld) weaver.getWorld()).addAspectRequires(aspectClassName, requiredType); + } + String definedScope = definition.getScopeForAspect(aspectClassName); + if (definedScope != null) { + ((BcelWorld) weaver.getWorld()).addScopedAspect(aspectClassName, definedScope); + } // ResolvedType aspect = weaver.addLibraryAspect(aspectClassName); @@ -461,10 +470,6 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor { namespace = namespace.append(";").append(aspectClassName); } - String definedScope = definition.getScopeForAspect(aspectClassName); - if (definedScope != null) { - ((BcelWorld) weaver.getWorld()).addScopedAspect(aspectClassName, definedScope); - } } else { // warn("aspect excluded: " + aspectClassName); lint("aspectExcludedByConfiguration", new String[] { aspectClassName, getClassLoaderName(loader) }); |