summaryrefslogtreecommitdiffstats
path: root/loadtime/src
diff options
context:
space:
mode:
authoraclement <aclement>2006-08-14 14:22:33 +0000
committeraclement <aclement>2006-08-14 14:22:33 +0000
commitddb5eea1bf53bda27c51750b1966044df97d95a1 (patch)
tree5d40ba3256c5cd70796ce6b40de11eb5c75ca008 /loadtime/src
parent0dde33db7477bb59728ad181f15b979d91310388 (diff)
downloadaspectj-ddb5eea1bf53bda27c51750b1966044df97d95a1.tar.gz
aspectj-ddb5eea1bf53bda27c51750b1966044df97d95a1.zip
133770 'call and ltw': isLocallyDefined() implemented - may not be right for all classloader hierarchies (especially non-delegating ones) - but its a start!
Diffstat (limited to 'loadtime/src')
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptor.java3
-rw-r--r--loadtime/src/org/aspectj/weaver/loadtime/DefaultWeavingContext.java15
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;
+ }
}