Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338780 - BasicIndexOutOfRangeException loading platform:/resource
Summary: BasicIndexOutOfRangeException loading platform:/resource
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Windows Vista
: P3 enhancement (vote)
Target Milestone: M6   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-03 04:26 EST by Ed Willink CLA
Modified: 2017-09-19 18:13 EDT (History)
1 user (show)

See Also:
sebastian.zarnekow: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2011-03-03 04:26:33 EST
XtextLinkingService.loadEPackage attempts to load a resource and only considers the alternate load strategy for platform:/resource after an exception has been thrown deep within EMF for access to an empty Resource.getContents().get(0).

The exception is disconcerting to me as a developer and rather inefficient.

Since uri.isPlatformResource() is relatively cheap, would it not make more sense to test for a platform, resource before attempting an inappropriate load?

[Please hoist the if clause out of the catch clause.]
Comment 1 Sebastian Zarnekow CLA 2011-03-03 04:42:53 EST
Hi Ed,

it was just yesterday when we added code that populates the uri map of the resourceset's uri converter with the information from the platform resource map similar to what the sample editor does. The catch-case should no longer be reached for valid platform:/plugin and platform:/resource uris.

- Sebastian
Comment 2 Karsten Thoms CLA 2017-09-19 18:02:51 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 18:13:04 EDT
Closing all bugs that were set to RESOLVED before Neon.0