Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315092 - API Baseline becomes empty
Summary: API Baseline becomes empty
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: API Tools (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6.1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-31 10:57 EDT by Darin Wright CLA
Modified: 2010-08-10 16:28 EDT (History)
2 users (show)

See Also:
Michael_Rennie: review+
darin.eclipse: review+


Attachments
Proposed fix (6.29 KB, patch)
2010-06-03 10:37 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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