This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 419749 - [Workbench] [e4 Workbench] - Remove the deprecated PackageAdmin
Summary: [Workbench] [e4 Workbench] - Remove the deprecated PackageAdmin
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Lars Vogel CLA
QA Contact: Paul Webster CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-17 13:19 EDT by Missing name Mising name CLA
Modified: 2014-04-07 06:12 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name Mising name CLA 2013-10-17 13:19:03 EDT
Inside the new "org.eclipse.e4.ui.workbench" bundle there are still some calls to the now deprecated "org.osgi.service.packageadmin.PackageAdmin". I think that newly implemented bundles shouldn't use old and deprecated APIs.

If the team is fine with this idea, I would like to provide a Gerrit-Patch.
Comment 1 Lars Vogel CLA 2013-10-17 16:44:23 EDT
+1 for replacing deprecated API calls. 

I have not looked into this in detail but from a first glace the new API looks relatively verbose: http://www.eclipse.org/forums/index.php/mv/msg/205719/1075453/#msg_1075453

Rene, I suggest you replace one call with the new API and we see what Paul says to the change.
Comment 2 Paul Webster CLA 2013-10-18 09:18:32 EDT
I'm open to this kind of change, but as Lars mentions we should see an example of replacing one of our uses.

PW
Comment 3 Missing name Mising name CLA 2013-10-25 11:36:50 EDT
I finally found the time to make a gerrit commit which entirely removes the PackageAdmin calls from the “org.eclipse.e4.ui.workbench”.

As I mentioned in a comment inside the code there is a small performance loss with the new solution inside of the “topoSort” method, because of some “class-loading breaks”. Nobody used BundleWiring so far and so my topoSort implementation has to take the burden to do the loading of all the required BundleWiring-Classes. That's way it loses some time ;-( . But if the BundleWiring-classes were already loaded it will beat the old topoSort.

Here are some measurements on my machine:
old topoSort: ~3ms
new topoSort: ~4ms ;-(
new topoSort but the BundleWiring-classes are already loaded: ~1ms

So I hope that more people will remove their PackageAdmin dependencies in favor of the OSGi Wiring-Framework and so the new topoSort can shine with its performance.

Gerrit-Commit:  https://git.eclipse.org/r/#/c/17772/
Comment 4 Paul Webster CLA 2013-10-25 13:16:54 EDT
Tom, I'm not so familiar with the new wiring package that replaces PackageAdmin.  Could you please give https://git.eclipse.org/r/#/c/17772/ a quick review?  It looks reasonable to me.

PW
Comment 5 Missing name Mising name CLA 2013-11-07 14:37:23 EST
Hi,

I finally adapted the code to also resolve the re-Exports as it is done in the old topoSort, but the resolving via BundleWiring is really slow (about 5 times slower than the PackageAdmin; all the time is lost in the new ModelAssembler#resolveReExports). So I think thats not the way to go, I hope that someone of you can give me a hint on how to boost the performance.

BTW, the processModel() method is not very dynamic aware is this really wanted? Because I thought about an idea which uses an ExtensionTracker and a way which contributes to the model dynamically. Which means add the fragment to the model if possible. If it can't be added because the model element to which it wants to contribute doesn't exist so far (= the need for the topoSort), it will be kept outside of the model until it becomes available.

Regards
  René
Comment 6 Lars Vogel CLA 2014-02-26 04:34:29 EST
(In reply to René Brandstetter from comment #5)
> Hi,
> 
> I finally adapted the code to also resolve the re-Exports as it is done in
> the old topoSort, but the resolving via BundleWiring is really slow (about 5
> times slower than the PackageAdmin; all the time is lost in the new
> ModelAssembler#resolveReExports). So I think thats not the way to go, I hope
> that someone of you can give me a hint on how to boost the performance.
> 
> BTW, the processModel() method is not very dynamic aware is this really
> wanted? Because I thought about an idea which uses an ExtensionTracker and a
> way which contributes to the model dynamically. Which means add the fragment
> to the model if possible. If it can't be added because the model element to
> which it wants to contribute doesn't exist so far (= the need for the
> topoSort), it will be kept outside of the model until it becomes available.
> 
> Regards
>   René

Any updates Tom / Paul?
Comment 7 Missing name Mising name CLA 2014-02-26 05:26:21 EST
I think it's my fault that both didn't check the current gerrit review, because I only put my comments on gerrit and not into this bug. So here a small update on the current state: The topoSort method is now as fast as the deprecated PackageAdminImpl, because the 3.10 equinox environment has performance improvement in the wiring stuff and the PackageAdminImpl implementation also switched to bundlewiring. So I just copied the  implementation from there ;-)
Comment 9 Thomas Watson CLA 2014-03-20 03:33:29 EDT
(In reply to René Brandstetter from comment #7)
> I think it's my fault that both didn't check the current gerrit review,
> because I only put my comments on gerrit and not into this bug. So here a
> small update on the current state: The topoSort method is now as fast as the
> deprecated PackageAdminImpl, because the 3.10 equinox environment has
> performance improvement in the wiring stuff and the PackageAdminImpl
> implementation also switched to bundlewiring. So I just copied the 
> implementation from there ;-)

Just to be clear, none of this was your fault.  The unresponsiveness was completely from my end.  I thank you for your contribution and I apologize for taking so long to review your changes.  Thanks to Lars for giving me a kick during the hackathon at eclipse con to do the review.
Comment 10 Lars Vogel CLA 2014-04-07 06:11:49 EDT
ModelAssembler still works correctly AFAICS. Thanks again Rene!
Comment 11 Lars Vogel CLA 2014-04-07 06:12:00 EDT
Tested with Build id: I20140402-0100