BJ Hargrave wrote:

NoClassDefFoundError is an Error which is unchecked and can be thrown anywhere. Given that Bundle.loadClass is patterned after ClassLoader.loadClass, one should expect similar results.

I agree that it should be possible to throw it from Bundle.loadClass(), but the fact that it is unchecked is not necessarily a reason for not listing it. We list IllegalStateException on that method and this is unchecked too.

-> 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:     [email protected]
Date:   2008/08/11 04:18 PM
Subject:        [osgi-dev] Should Bundle.loadClass throw NoClassDefFoundError


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



Hi,

I have a question regarding the Bundle.loadClass(String) method. It
throws a ClassNotFoundException if the class can not be found but what
happens if the class depends on something that can not be found. In
the Classloader case that would result in a NoClassDefFoundError but
that is not mentioned in the spec. I think the
Bundle.loadClass(String) method should be allowed to throw a
NoClassDefFoundError in this case and that is what Apache Felix is
doing atm. Is this correct (and should that then be reflected in the
spec)?

regards,

Karl

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