Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338780

Summary: BasicIndexOutOfRangeException loading platform:/resource
Product: [Modeling] TMF Reporter: Ed Willink <ed>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: sebastian.zarnekow
Version: 2.0.0Flags: sebastian.zarnekow: indigo+
Target Milestone: M6   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

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