Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Bug in BundleLoader's findClass(String, boolean)?

Hello,

I've come across what appears to be a bug in the findClass(String, boolean) method in org.eclipse.osgi.framework.internal.core.BundleLoader. It doesn't seem to cope with arrays of basic Java types. For example, if I call

    findClass(String[].class.getName())

...it throws a ClassNotFoundException.

From my reading of the OSGi spec, it sounds like it should be delegating to the parent classloader in such a case. However, looking at the code, the actual test it does is

    name.startsWith(JAVA_PACKAGE)

...which in the case of an array will fail (the name of String[].class is '[Ljava.lang.String;', for example).

Should this code be changed so that, rather than just checking whether the class's name starts with 'java.', it checks whether the underlying type is a 'java.*' type?

Thank you,

David Shepherdson


Back to the top