This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC Patch: only add absolute file paths to URLClassLoader


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]