Bug 95285

Summary: Regression: cannot install new features without re-starting eclipse
Product: [Eclipse Project] Platform Reporter: Dorian Birsan <birsan>
Component: Update (deprecated - use Eclipse>Equinox>p2)Assignee: Branko Tripkovic <btripkov>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P1 CC: eclipse, john.arthorne
Version: 3.1   
Target Milestone: 3.1 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
configurator patch
none
core patch none

Description Dorian Birsan CLA 2005-05-14 21:49:07 EDT
M7:

I tried installing the core plugin from 
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-core-
home/updates

and I was prompted to restart (no prompt for "apply now"), even though this 
was a new plugin on a brand new M7 installation.
Comment 1 Dorian Birsan CLA 2005-05-24 10:20:45 EDT
*** Bug 94732 has been marked as a duplicate of this bug. ***
Comment 2 Dorian Birsan CLA 2005-06-02 15:48:39 EDT
This should be looked at in 3.1
Comment 3 Branko Tripkovic CLA 2005-06-07 14:38:31 EDT
Created attachment 22540 [details]
configurator patch
Comment 4 Branko Tripkovic CLA 2005-06-07 14:39:02 EDT
Created attachment 22541 [details]
core patch
Comment 5 Branko Tripkovic CLA 2005-06-07 14:40:08 EDT
this bug is caused by runtime going with relative paths. I have made changes in
the update configurator and core to handle this. The patches are posted now.
Dorian and Rafaelo could you please look at this two patches. Thanks.
Comment 6 Dorian Birsan CLA 2005-06-07 15:19:36 EDT
+1
Patch looks good. Just a couple of more comments to the new method and the old 
method would be good so we know the url's are relative.
Thanks Branko.
Comment 7 Rafael Chaves CLA 2005-06-07 15:22:50 EDT
Branko, could you describe in more detail what is happening with the current
implementation that causes the problem?
Comment 8 Konrad Kolosowski CLA 2005-06-07 15:27:42 EDT
I have just released Branko's patches.
Brako, please add some Javadoc to the code and comments here of what was wrong.
Comment 9 Branko Tripkovic CLA 2005-06-07 16:10:50 EDT
The problem was that we are comparing urls of plug-ins in order to see if we
need to restart, this is done in the method:
org.eclipse.update.internal.core.InstallConfiguration#isRestartNeeded

but somewhere between m6 & m7 runtime started returning relative instead of
absolute paths( i guess you know of this ;) ) 

so this line: 
URL[] newBundlePaths = runtimeConfig.getPluginPath();
was still giving absloute paths, but this line:
Bundle[] oldBundles = UpdateCore.getPlugin().getBundleContext().getBundles();,
was now giving us relative paths, and of course they would never match which
caused us to force restart always.

I was hoping you could look at it and check if it might introduce some other
regression. We have already tested it, but you handled switch to relative paths
so you might see something we don't. 

Thanks
Comment 10 Rafael Chaves CLA 2005-06-07 16:35:17 EDT
Ok, got it now, thanks. 

The patch seems fine with me. Just to clarify, Bundle.getLocation() returns
whatever string was passed in when installing the bundle. That was changed
recently in the Update configurator by request of Platform/Core.

Note that since the location has not much meaning, it is not very safe to rely
on it for anything (unless you are the one installing bundles). But this is not
an issue with the patch, the existing code does that.

Comment 11 Branko Tripkovic CLA 2005-06-07 16:43:15 EDT
thanks a lot rafael. I will mark this as fixed now.