Bug 154880 - DeltaProcessor does not set project references if first build is a project build
Summary: DeltaProcessor does not set project references if first build is a project build
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 critical (vote)
Target Milestone: 3.2.1   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-23 12:28 EDT by Kent Johnson CLA
Modified: 2006-09-18 12:59 EDT (History)
3 users (show)

See Also:


Attachments
Proposed fix (5.69 KB, patch)
2006-08-30 10:38 EDT, Jerome Lanneluc CLA
no flags Details | Diff
Test case (2.70 KB, patch)
2006-09-18 12:59 EDT, John Arthorne CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Johnson CLA 2006-08-23 12:28:57 EDT
When creating a new workspace with several projects, the DeltaProcessor will fail to set the project references correctly (and as a result, the build order will be wrong) if a project build runs before autobuild builds the entire workspace.

The delta attached to the PRE_BUILD event for the very first project build is relative to the entire workspace and contains all the information needed to set the project references for all projects. The additional PRE_BUILD events (whether they are triggered by project or workspace builds)do not contain the necessary information in their deltas since its assumed listeners have already seen the full delta.

The problem is caused by the check on the first line of DeltaProcessor.resourceChanged():

public void resourceChanged(IResourceChangeEvent event) {
  if (event.getSource() instanceof IWorkspace) {

I talked to Jerome and he believes this was a leftover from the very early days.

Removing the check fixes the problem trying to build our workspace from scratch.

This should be fixed for 3.2.1
Comment 1 Philipe Mulet CLA 2006-08-29 11:32:53 EDT
Not for 3.2.1, since the only known usecase has just moved to 3.3M1.
Comment 2 Philipe Mulet CLA 2006-08-29 12:04:34 EDT
Actually, talking with Kent, I think we should fix it for 3.2.1.
Fix is trivial, and PDE is now exposing our weakness in 3.2 through the feature builder. 
Comment 3 Jerome Lanneluc CLA 2006-08-30 10:38:01 EDT
Created attachment 49059 [details]
Proposed fix
Comment 4 Jerome Lanneluc CLA 2006-08-30 10:39:24 EDT
Proposed fix released for 3.2.1 in R3_2_maitenance branch and released for 3.3 M2 in HEAD.
Comment 5 Jerome Lanneluc CLA 2006-08-30 10:39:46 EDT
Regression test needed.
Comment 6 Olivier Thomann CLA 2006-09-11 14:35:39 EDT
Kent,

Could you please verify this one since I don't have a test case to do it?

Thanks.
Comment 7 Kent Johnson CLA 2006-09-12 10:43:59 EDT
Verified for 3.2.1 using build M20060908-1655
Comment 8 David Audel CLA 2006-09-18 10:38:00 EDT
Verified for 3.3 M2
Comment 9 John Arthorne CLA 2006-09-18 12:59:41 EDT
Created attachment 50398 [details]
Test case

For reference, this is a test case I wrote to verify the behaviour that Kent was seeing.  After calling build for an individual builder, autobuild is turned on, but the PRE_BUILD event for the workspace build is never received because nothing has changed since the last build.