ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Glick <Jesse.Gl...@netbeans.com>
Subject Re: [PATCH] classloader jumbo patch
Date Wed, 31 Jan 2001 13:20:23 GMT
No reply to this one yet, so gently asking again whether this will make
it into 1.3, or whether I will need to ship a patched ant.jar with
NetBeans...doable but not desirable.

#1 is the important part, since without this nothing works inside the
IDE. So I am reattaching it, this time as a standalone patch without #2.
Original description below for reference.

For #2, it may suffice for NetBeans to automatically define some
additional properties, like:

	-Dnetbeans.filesystems.path=/my/sources/part1:/my/sources/part2

and so on (taken from GUI project configuration). Then

	<taskdef name="foo" classname="MyCustomTask"/>

will still not work, but this more explicit version will:

	<taskdef name="foo" classname="MyCustomTask">
	  <classpath>
	    <pathelement path="${netbeans.filesystems.path}"/>
	  </classpath>
	</taskdef>

I tried this and it seems OK, provided AntClassLoader is patched.

Thanks,
-Jesse

Jesse Glick wrote:
> 1. AntClassLoader. [This patch can actually stand on its own, if the one
> reference to project.getDefaultClassLoader() is changed to e.g.
> AntClassLoader.class.getClassLoader().] AntClassLoader currently when
> trying to resolve "system" classes, uses the primordial classloader. If
> Ant itself was *not* loaded with the primordial classloader, this is
> unworkable: e.g. a user task may be loadable but Task itself is not
> (from within that AntClassLoader) -> NoClassDefFoundError when
> resolving. The patch simply makes the loading work logically, wherever
> Ant itself was loaded from.
> 
> Furthermore, previously AntClassLoader under Java 2 would provide no
> permissions for loaded classes. This means that in a VM with an
> installed security manager, any task performing a controlled action
> (pretty much any task at all: e.g. open a file, ...) would throw
> AccessControlException and be useless. The patch (under Java 2) supplies
> loaded classes with the same permissions as Ant itself (matching the
> commandline behavior), under the assumption that tasks and build scripts
> are trusted and there is no sandboxing needed or wanted. Under JDK 1.1,
> it should compile (note the reflection calls) but do nothing different;
> someone with a 1.1 installation, please double-check!

-- 
Jesse Glick   <mailto:Jesse.Glick@netbeans.com>
NetBeans, Open APIs  <http://www.netbeans.org/>
tel (+4202) 3300-9161 Sun Micro x49161 Praha CR
Mime
View raw message