Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342339 - [EMF Runtime Extensions] Make sure that EcorePlatformUtil#getFile() methods can be safely called in standalone applications
Summary: [EMF Runtime Extensions] Make sure that EcorePlatformUtil#getFile() methods c...
Status: CLOSED FIXED
Alias: None
Product: Sphinx
Classification: Automotive
Component: Core (show other bugs)
Version: 0.7.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.7.0   Edit
Assignee: Stephan Eberle CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-08 20:31 EDT by Stephan Eberle CLA
Modified: 2021-07-14 02:15 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Eberle CLA 2011-04-08 20:31:00 EDT
= Problem description =
Calling EcorePlatformUtil#getFile(Resoure) and EcorePlatformUtil#getFile(URI) in standalone applications currently causes an IllegalStateException indicating that the workspace is closed. This comes from the fact that the WorkspaceSynchonizer#getFile(URI) method that is ultimately invoked by both of aforementioned methods attempts to access the workspace by calling ResourcesPlugin#getWorkspace() but the latter has never been initialized.

= Resolution proposal =
Add a Platform#isRunning() test to EcorePlatformUtil#getFile(Resoure) and EcorePlatformUtil#getFile(URI) and let them return null if it evaluates to false.
Comment 1 Stephan Eberle CLA 2011-04-08 20:31:21 EDT
Fixed as proposed in description.
Comment 2 Balazs Grill CLA 2021-07-14 02:15:27 EDT
Mass-closing Resolved tickets