diff options
Diffstat (limited to 'loadtime/src')
-rw-r--r-- | loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java | 3 | ||||
-rw-r--r-- | loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java | 15 |
2 files changed, 17 insertions, 1 deletions
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java index 47b9368c6..161c8f62f 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java @@ -130,7 +130,8 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor { } bcelWorld = new LTWWorld( - classLoader, getMessageHandler(), new ICrossReferenceHandler() { + classLoader, weavingContext, // TODO when the world works in terms of the context, we can remove the loader... + getMessageHandler(), new ICrossReferenceHandler() { public void addCrossReference(ISourceLocation from, ISourceLocation to, IRelationship.Kind kind, boolean runtimeTest) { ;// for tools only } diff --git a/loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java b/loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java index 2ec089253..bd4c3280f 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java @@ -78,4 +78,19 @@ public class DefaultWeavingContext implements IWeavingContext { public String getSuffix () { return getClassLoaderName(); } + + public boolean isLocallyDefined(String classname) { + String asResource = classname.replace('.', '/').concat(".class"); + + URL localURL = loader.getResource(asResource); + if (localURL == null) return false; + + boolean isLocallyDefined = true; + ClassLoader parent = loader.getParent(); + if (parent != null) { + URL parentURL = parent.getResource(asResource); + if (localURL.equals(parentURL)) isLocallyDefined = false; + } + return isLocallyDefined; + } } |