RFC Patch: only add absolute file paths to URLClassLoader

Tom Tromey tromey@redhat.com
Sun Jul 24 21:02:00 GMT 2005


>>>>> "Anthony" == Anthony Green <green@redhat.com> writes:

Anthony> If bug.class is in your cwd, this currently prints file:./bug.class.
Anthony> But I believe this should really be an absolute path, like
Anthony> file:///tmp/bug.class, or something like that.

I think this is also PR 20198.

Anthony> This patch simply makes sure we only add absolute paths to
Anthony> URLClassLoader.  But now that I think about it, maybe we should turn
Anthony> these into absolute paths within URLClassLoader itself.  Comments?

Let's do a test to see if the jdk does this in URLClassLoader or not.
I'm not sure how exactly we could test this... maybe 'strace -eopen'
would tell us?  The question is whether we canonicalize in
URLClassLoader or when creating the CodeSource (and resources and
whatnot).

Another question is whether we should use File.getCanonicalPath here
instead of getAbsolutePath.

Could you find out these answers?
In any case it is clear we need this or something like it.

Tom



More information about the Java-patches mailing list