[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Small URLClassLoader bug fix
From: |
Jeroen Frijters |
Subject: |
RE: Small URLClassLoader bug fix |
Date: |
Tue, 22 Oct 2002 10:17:57 +0200 |
Hi,
Thanks, Mark. This version contains a new bug, though ;-)
Here is the fix:
--- \URLClassLoader.java Tue Oct 22 09:55:00 2002
+++ URLClassLoader.java Tue Oct 22 10:11:20 2002
@@ -366,7 +366,7 @@
Resource getResource(String name)
{
File file = new File(dir, name);
- if (file != null)
+ if (file.exists())
return new FileResource(this, name, file);
else
return null;
Regards,
Jeroen
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On Behalf Of Mark Wielaard
> Sent: Tuesday, October 22, 2002 00:42
> To: Jeroen Frijters
> Cc: address@hidden
> Subject: Re: Small URLClassLoader bug fix
>
>
> Hi,
>
> On Sat, 2002-10-19 at 18:40, Jeroen Frijters wrote:
> > After getting the latest code from CVS, I ran into a problem
> > (ClassFormatError). Turned out to be due to a small bug in
> > java.net.URLClassLoader.
> >
> > 269c269,272
> > < in.read(classData);
> > ---
> > > int pos = 0;
> > > while(length - pos > 0) {
> > > pos += in.read(classData, pos, length - pos);
> > > }
>
> Thanks. I also fixed the other problem we talked about in
> private email
> (URLClassLoader only worked for files ending in .jar or .zip).
>
> Attached is the beginning of a rewrite of URLClassLoader based on the
> patches of the Intel Orp developers (which also contained
> this fix). It
> also tries to do something sensible with the security context of the
> caller of newInstance and always creates the correct Package and
> CodeSource for a newly loaded class. I don't have time to finish and
> test this now but it seems to work (for me). Will try to finish it at
> the end of the week or next weekend.
>
> Cheers,
>
> Mark
>