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

Bug 311200

Summary: Regression in ProjectReferenceWizardFragment.getAvailableProjects(etc)
Product: [WebTools] WTP Common Tools Reporter: Carl Anderson <ccc>
Component: wst.commonAssignee: Rob Stryker <stryker>
Status: RESOLVED FIXED QA Contact: Carl Anderson <ccc>
Severity: major    
Priority: P2 CC: cbridgha, david_williams, stryker
Version: 3.2Flags: david_williams: pmc_approved+
stryker: pmc_approved? (raghunathan.srinivasan)
stryker: pmc_approved? (naci.dai)
stryker: pmc_approved? (deboer)
stryker: pmc_approved? (neil.hauge)
stryker: pmc_approved? (kaloyan)
cbridgha: review+
ccc: review+
Target Milestone: 3.2 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard: PMC_approved
Bug Depends on: 310873    
Bug Blocks:    
Attachments:
Description Flags
Patch to fix the logic none

Description Carl Anderson CLA 2010-04-30 11:56:53 EDT
I just tried this with the 0429 S build (which should be the M7 declare).  I created an EAR 6.0 with all of its child modules, brought up the Deployment Assembly (which shows the 4 projects), selected Add-> Project, and all 4 projects were still in the list to add.

It seems like bug 310873 was not a complete fix.

+++ This bug was initially created as a clone of Bug #310873 +++

Subsequent actions after initially adding/removing references don't recognize the current state of the model - only the state on disk
Comment 1 Carl Anderson CLA 2010-04-30 11:57:27 EDT
Assigning to Chuck for initial investigation.
Comment 2 Rob Stryker CLA 2010-05-02 10:34:19 EDT
Um... I've updated from CVS and I cannot replicate this.

Admittedly I just created a Dynamic web and an EAR and when i open the ear's module assembly page, the War shows. Then I try to add a new Project Reference, and the Web project does *not* show.

So where is the error?
Comment 3 Rob Stryker CLA 2010-05-02 10:50:18 EDT
Interesting. When I add the EJB project and client, all 4 show up in the wizard.
Comment 4 Rob Stryker CLA 2010-05-02 11:01:35 EDT
ProjectReferenceWizardFragment.getAvailableProjects(etc) is coded incorrectly.
Comment 5 Rob Stryker CLA 2010-05-03 01:28:30 EDT
Created attachment 166748 [details]
Patch to fix the logic
Comment 6 Rob Stryker CLA 2010-05-03 01:29:17 EDT
request approval for logic fix
Comment 7 Chuck Bridgham CLA 2010-05-04 14:31:22 EDT
Approved - thanks - this regression was rushed in - last minute...   these fixes clean up the logic.
Comment 8 Rob Stryker CLA 2010-05-04 23:41:33 EDT
Carl:

I already committed this, but I accidentally got the wrong approval. I should have been seeking yours. I apologize. Please either give your approval or instruct me to revert the patch.
Comment 9 Rob Stryker CLA 2010-05-04 23:44:29 EDT
I've backed out the commit. We are after m7 and require PMC approvals, which I obviously forgot. Also Carl needs to approve of this.
Comment 10 Rob Stryker CLA 2010-05-04 23:51:03 EDT
Seeking PMC now, not to try to pre-empt Carl's approval but realizing we are working on a tightened schedule. Since Chuck already approved of the fix, I expect Carl will as well. So just trying to grab approvals a little quicker. PMC approval conditional on Carl's approval would be appreciated.
Comment 11 Carl Anderson CLA 2010-05-05 09:15:41 EDT
I approve of this patch.

Looking at CVS, Rob reverted his "not yet approved" commit.
Comment 12 Carl Anderson CLA 2010-05-05 09:25:37 EDT
Rob, since we are now in RC1, the person submitting this for PMC approval needs to answer the questions in http://wiki.eclipse.org/WTP_PMC_Defect_Review , in the "How To Prepare a PMC Defect Candidate" section.

Since I am familiar with this bug, and want the fix in as soon as possible, I will attempt to do so:

This is a bad bug- it allows for multiple references to the same child module to be added, which can really mess things up at deploy time.  The workaround here would be for the user to go through the list manually and make sure that there is only one instance of each module added, but that is an unrealistic workaround- it would be far better to prevent the user from adding a reference more than once in the first place.
This fix has been tested by hand by Rob, Chuck and myself.
As Rob stated in comment #4, ProjectReferenceWizardFragment.getAvailableProjects() was not terminating its iteration through the list of existing projects when it should have.
The risk is limited to the Deployment Assembly page, and it is a relatively safe fix.
Comment 13 David Williams CLA 2010-05-05 15:17:53 EDT
I think I'd need to make a boolean table to know if you got all the ands and nots correct, but will take your word on it. :)
Comment 14 Rob Stryker CLA 2010-05-06 05:11:22 EDT
dropped to head