Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320420 - Unnecessary load of all registered EPackages
Summary: Unnecessary load of all registered EPackages
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: SR1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 321432 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-07-20 12:46 EDT by Ed Willink CLA
Modified: 2017-09-19 15:52 EDT (History)
2 users (show)

See Also:
sebastian.zarnekow: helios+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2010-07-20 12:46:22 EDT
Given an editor for a multi-package model such as OCLinEcore in which the OCLinEcoreCST package defines a concrete type that refines an abstract type in the BaseCST package, the installation of proxies discovers that the type in the BaseCST package is abstract and so searches for a concrete sub-type. No problem.

But, with the concrete sub-type in another package, LazyLinker.findInstantiableCompatible searches all possible URIs and eventually finds the package from which the editor was derived in the first place.

a) this is very inefficient
b) because of Bug 320417 whereby EMF wraps a CNFE when loading a class-less JST EPackage registration, the search is terminated before the required package is found; editor initialization gives a very obscure message.

b) the loop should catch a WrappedException
a) local packages should be searched first
? should global packages be search at all?

Effectively this means that Xtext and JST are incompatible.
Comment 1 Sebastian Zarnekow CLA 2010-07-30 12:50:41 EDT
Besides the suggestions, we should provide a hook that allows to define the packages that should be searched first.

What are local packages?
Comment 2 Ed Willink CLA 2010-07-30 13:02:33 EDT
Minimal local: the current packages (imported by the editor grammar)

Inherited local: the packages of the transitive closure of the inheritance of the classes in the current packages

Maximal local: the packages of the transitive closure of the references of the classes in the current packages  

I suspect that "Inherited local" is enough for this problem, but there seems no justification going beyond "Maximal local" except when doing a Content Assist/Quick Fix and even then I think there should be a click-through to authorize loading all packages (which is much more costly and less well-behaved than loading all Java classes).
Comment 3 Ed Willink CLA 2010-07-31 09:43:12 EDT
*** Bug 321432 has been marked as a duplicate of this bug. ***
Comment 4 Sebastian Zarnekow CLA 2010-08-02 10:27:43 EDT
Fixed in HEAD. See LazyLinker#globalFindInstantiableCompatible for details.
Comment 5 Karsten Thoms CLA 2017-09-19 15:52:20 EDT
Closing bug which were set to RESOLVED before Eclipse Neon.0.