Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-dev] org.osgi.framework.Bundle#getResources(String) needs to throw IOException


If your code does not call org.osgi.framework.Bundle#getResources(String) then you can ignore this message.

For Eclipse 3.1 a new method "getResoures" has been added org.osgi.framework.Bundle.  This method mirrors the ClassLoader#getResources method.  The ClassLoader#getResources method throws an IOException.  Currently the Bundle#getResources method does not specify that it throws an IOException.  Before M6 the Bundle#getResoures method will be changed to throw an IOException.  If you are calling this method please be sure you can handle an IOException being thrown.

This method is usually used by clients that want to create a ClassLoader object which wrappers a Bundle object.  I have only found the following two clients of this method:

1) org.eclipse.ant.core
        /org.eclipse.ant.core/src/org/eclipse/ant/core/AntCorePreferences.java
        NO CHANGE is required in AntCorePreferences.  The caller already throws an IOException

2) org.eclipse.pde.junit.runtime
        /org.eclipse.pde.junit.runtime/src/org/eclipse/pde/internal/junit/runtime/RemotePluginTestRunner.java
        The inner class BundleClassLoader needs to be updated to throw the IOException.
        I opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=88700 against PDE UI to fix this.

After PDE has updated their code I will make the change to Bundle#getResources.

Tom

Back to the top