Bug 264874 - WeavingAdaptor doesn't support URLs, in particular not jar://
Summary: WeavingAdaptor doesn't support URLs, in particular not jar://
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Runtime (show other bugs)
Version: 1.6.3   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-13 12:04 EST by Martin Probst CLA
Modified: 2013-06-24 11:07 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Probst CLA 2009-02-13 12:04:42 EST
I'd like to restrict AspectJ to treat certain files in a jar file as aspects (not doing that blows the memory limit of the JVM):

URL aspect = new URL("jar:file:/foo.jar!/baz/bam");
loader = new WeavingURLClassLoader(classpath, {aspectURL}, parent); 

The problem is that FileUtil.makeClassPath only takes the path component of a URL, thus ignoring the jar:// protocol. It also doesn't handle http or any other than file URLs properly, around line 1361:

	public static List makeClasspath(URL[] urls) {
		List ret = new LinkedList();
		if (urls != null) {
			for (int i = 0; i < urls.length; i++) {
				ret.add(urls[i].getPath());
			}
		}
		return ret;
	}

The WeavingAdaptor then takes this Stringified URL and just treats it like a path to a local file, without handling any protocols (that are already no longer present in the URL).
Comment 1 Andrew Clement CLA 2009-02-17 11:10:41 EST
If you submit a patch for it, I will look to integrate it.
Comment 2 Andrew Clement CLA 2013-06-24 11:07:01 EDT
unsetting the target field which is currently set for something already released