Summary: | ResourcesPlugin.getWorkspace() should never return null | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Jerome Lanneluc <jerome_lanneluc> |
Component: | Resources | Assignee: | John Arthorne <john.arthorne> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 2.1 | ||
Target Milestone: | 3.1 M2 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Jerome Lanneluc
2003-03-07 06:50:09 EST
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. 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. |