Community
Participate
Working Groups
Build 20030306 As shown in bug 33998, ResourcesPlugin.getWorkspace() can return null on shut down. However null is not specified as a valid return value.
This will only return null if the resources plugin has already been shut down. Since plugins are shut down in pre-requisite order, this means the JDT UI is leaving threads running after its plugin shutdown() method has exited. This is dangerous and should be fixed. Almost all of our API methods will fail in unpredictable ways if they are invoked after the plugin has shutdown. I don't think we can reasonably document the behaviour of our API in these circumstances.
Entered bug 34800 agaist JDT/UI.
I think the best we can do here is throw a descriptive runtime exception stating that the resources plugin has been shutdown. That's what we currently do with the runtime plugin API.
Runtime currently uses IllegalStateExeption in these cases.
I updated the spec of getWorkspace() in March 2004 with the line: "The workspace is not accessible after the resources plug-in has shutdown." I have now fixed the implementation to throw IllegalStateException when the Resources plugin has been shutdown. This effectively changes the exception from NullPointerException to IllegalStateException, which is a more accurate description of the situation.