BJ Hargrave wrote:

The first sentence of the javadoc for Bundle.loadClass says:

> Loads the specified class using this bundle's class loader.

Doesn't this already imply that one should expect similar behavior to ClassLoader.loadClass? :-)

Hmmm. Good question. Of course, we probably shouldn't strive to create a spec that needs to be interpreted by implication. :-P

-> richard

--

*BJ Hargrave*
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the _OSGi Alliance_ <http://www.osgi.org/>_
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>      

office: +1 386 848 1781
mobile: +1 386 848 3788






From:   "Karl Pauls" <[EMAIL PROTECTED]>
To:     "OSGi Developer Mail List" <[email protected]>
Date:   2008/08/12 03:24 PM
Subject: Re: [osgi-dev] Should Bundle.loadClass throw NoClassDefFoundError


------------------------------------------------------------------------



> If something additional needs to be spec'ed then I suggest we add a
> statement that the Bundle.loadClass method behaves like
> ClassLoader.loadClass but listing all the possible errors probably is not > feasible (ClassLoader.loadClass does not list them either, so referencing
> ClassLoader probably is not much help). We could call out
> NoClassDefFoundError but there are others which Niclas mentioned earlier, > VerifierError, LinkageError etc. Do we really want to list each of these.
>
> I'm also do not think we should spec that Bundle.loadClass() must capture
> loading Errors and figure out what went wrong and re-throw a
> ClassNotFoundException. I think we need Bundle.loadClass to behave as much
> like ClassLoader.loadClass as possible.

I would be fine with the statement that Bundle.loadClass behaves as
much like ClassLoader.loadClass as possible. Thanks at any rate, at
least it is clear now that the spec allows the way
we implement it in Felix.

regards,

Karl

> Tom
>
>
>
> "Niclas Hedhman" ---08/12/2008 01:17:05 AM---On Tue, Aug 12, 2008 at 1:44
> PM, Richard S. Hall <[EMAIL PROTECTED]> wrote: > Well, we are talkin
>
>
> From:
> "Niclas Hedhman" <[EMAIL PROTECTED]>
> To:
> "OSGi Developer Mail List" <[email protected]>
> Date:
> 08/12/2008 01:17 AM
> Subject:
> Re: [osgi-dev] Should Bundle.loadClass throw NoClassDefFoundError
> ________________________________
>
>
> On Tue, Aug 12, 2008 at 1:44 PM, Richard S. Hall <[EMAIL PROTECTED]>
> wrote:
>
>> Well, we are talking about ones you should expect to see...NCDFE are
>> reasonably common when loading classes, especially for beginners in the
>> OSGi
>> environment. So, assuming that there is no value in trying to report such
>> errors in a standard way, I can accept that it may not be convenient to
>> list
>> them and it is fair to simply say that this behaves like
>> ClassLoader.loadClass().
>
> Or perhaps, capture the NoClassDefFoundError, figure out what went
> wrong, and throw a new ClassNotFoundException explaining the problem.
>
>
> Cheers
> Niclas
> _______________________________________________
> OSGi Developer Mail List
> [email protected]
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>
>
>
> _______________________________________________
> OSGi Developer Mail List
> [email protected]
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>



--
Karl Pauls
[EMAIL PROTECTED]
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

------------------------------------------------------------------------

_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to