Community
Participate
Working Groups
Currently, when we reference classes (by Qualified Name) in a model, the only option we have to resolve that class at runtime is to use our ClassLoaderHelper. This helper uses a cache to make sure classes are only resolved once. However, the initial loading uses a buddy-policy: dependent to explore pretty much all bundles that depend on Papyrus (directly or indirectly), in order to find that class. When this was implemented, we had ~40 bundles or so, but this approach really doesn't scale well with hundreds of bundles. Last year we reached the OSGi Cache limit for bundles; and even when letting XWT use our ClassLoaderHelper to use the cache again, we still have significant initial load times. The issue becomes worse when we introduce custom class loaders such as E(fx)clipse extension for JavaFX 11. I see two options to improve on this: 1) Do as everyone else in Eclipse, and add the bundle ID in addition to the Class Qualified Name, so we know exactly in which bundle to look (Using the right class loader rather than exploring hundreds of class loaders). Unfortunately, this requires updating all our metamodels, and all our models as well (Properties, Palettes, Architecture, ElementTypes...). This would be a long term solution. For this, we could use the standard bundleclass:/<bundleID>/<classQName> syntax rather than just using <classQName> 2) Since all the class qualified names that are passed to the ClassLoaderHelper are coming from a Model, and this model was usually loaded via a platform:/plugin/ URI, we can retrieve the initial bundle (Or at least, a Bundle that depends on the Bundle containing the class to load; which is already helpful) I'll start investigating Option 2), to pass a Model or Extension Point contributor ID to the ClassLoaderHelper, to help narrowing down the list of bundles to explore. Option 1) should be considered on the long term; maybe for 5.0
New Gerrit change created: https://git.eclipse.org/r/138724
Gerrit change https://git.eclipse.org/r/138724 was merged to [master]. Commit: http://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/commit/?id=f13d47654fd242d83b6e7db2d2aac29fc478bbdf
New Gerrit change created: https://git.eclipse.org/r/141989
I change it because test was in regression. Remove deprecated because if not some classes cannot be found. The method loadClass (name, bundle) cannot find wanted classes... I have removed call loops: loadClass(name) calls loadClass (name, bundle) that can call loadClass(name)....
I repopen it because a regression bug was found
Gerrit change https://git.eclipse.org/r/141989 was merged to [master]. Commit: http://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/commit/?id=26ee2e4530d065612cde5b8beea909d9dc95d656