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

Bug 315092

Summary: API Baseline becomes empty
Product: [Eclipse Project] PDE Reporter: Darin Wright <darin.eclipse>
Component: API ToolsAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie, Olivier_Thomann
Version: 3.6Flags: Michael_Rennie: review+
darin.eclipse: review+
Target Milestone: 3.6.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix none

Description Darin Wright CLA 2010-05-31 10:57:53 EDT
3.6 RC3

I was running an API use scan and getting no results against a baseline that was not the workspace baseline. It turned out the baseline was empty.

Steps to reproduce an empty baseline:

* Start a new empty workspace
* Define an API baseline named A that points to Eclipse 3.2.2
* Defint an API baseline named B that points to Eclipse 3.3
* Set baseline B as default
* Create a new plug-in project a.b.c from a template
* Re-open the baseline pref page, and look at the contents of baseline A - it will be empty
Comment 1 Olivier Thomann CLA 2010-06-01 14:55:08 EDT
Reproduced. I'll try in self-hosting.
Comment 2 Olivier Thomann CLA 2010-06-03 09:53:40 EDT
I don't get it anymore. I keep investigating it.
Comment 3 Olivier Thomann CLA 2010-06-03 10:36:58 EDT
Got it again.
We can only got it if we create the baselines and do a build within the same session.
The problem comes from the fact that the baseline has no longer any components already initialized but its handle is not saved in the handle cache. This is because in the save method when the baselines are persisted on disk, the corresponding handle is not saved within the handle cache. So since there is no entry in the handle cache for the corresponding baseline, its contents cannot be restored.
Once the baseline is reopen as empty, its original contents will be overridden on disk on the next save action. So the baseline will need to be reinitialized from scratch.
Comment 4 Olivier Thomann CLA 2010-06-03 10:37:41 EDT
Created attachment 170963 [details]
Proposed fix
Comment 5 Olivier Thomann CLA 2010-06-03 10:38:25 EDT
With this patch, I can no longer get an empty baseline. I also renamed some "profile" into "baseline" in the same patch.

Darin, please review.
Comment 6 Olivier Thomann CLA 2010-06-03 11:01:23 EDT
The only thing that worries me is the fact that the save action in not synchronized. I don't know if the save action can be called concurrently.
Comment 7 Olivier Thomann CLA 2010-06-15 12:40:04 EDT
Michael, please review.
Comment 8 Michael Rennie CLA 2010-06-17 13:49:52 EDT
+1 works well.
Comment 9 Michael Rennie CLA 2010-06-18 10:36:57 EDT
applied to HEAD and 3.6.1