aboutsummaryrefslogtreecommitdiffstats
path: root/loadtime/src
diff options
context:
space:
mode:
authoraclement <aclement>2010-06-16 18:14:07 +0000
committeraclement <aclement>2010-06-16 18:14:07 +0000
commit2251050afdb26ea2521c584fa79d74bd4698ebd9 (patch)
tree4678fa8c86f9e53b6a3a550bc05c964f901a4aae /loadtime/src
parent4663836a13bcd71211a227c69a43b332c11d18a4 (diff)
downloadaspectj-2251050afdb26ea2521c584fa79d74bd4698ebd9.tar.gz
aspectj-2251050afdb26ea2521c584fa79d74bd4698ebd9.zip
310506: optional aspects
Diffstat (limited to 'loadtime/src')
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java13
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) });