On Sunday 11 July 2004 13:50, David Holmes wrote:
> I wrote:
> > > Consequently application code should have every right to assert that
> > > "this.getClass().getClassLoader()" is never null.
>
> Jeroen responded:
> > Sure, but, IMHO, if you write a library you cannot assume that your
> > library won't be loaded by the bootstrap class loader.
>
> Good point. There's nothing stopping a user from putting everything on
> bootclasspath. I wonder how many library writers actually consider that?

Why do you think people write stuff like
   Class c;
   ClassLoader cl = this.getClass().getClassLoader();
   if (cl == null) {
     c = Class.forName(classname);
   }
   else {
     c = Class.forName(classname, false, cl);
   }

Which gets tedious, real fast. :-{

Chris

-- 
Chris Gray                      /k/ Embedded Java Solutions
Embedded & Mobile Java, OSGi        http://www.kiffer.be/k/
[EMAIL PROTECTED]                         +32 3 216 0369



_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to