}
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
}
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;
+ }
}
public Enumeration getResources(String name) throws IOException {
return loader.getResources(name);
}
-
+
+ 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;
+ }
}
protected void setUp() throws Exception {