Bug 348784 - "Argument not valid" exception when locking project facet using the Project Facets Dialog after it has been opened previously
Summary: "Argument not valid" exception when locking project facet using the Project F...
Status: RESOLVED FIXED
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: Faceted Project Framework (show other bugs)
Version: 3.2.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2.5   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact: Konstantin Komissarchik CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-08 13:28 EDT by Musa CLA
Modified: 2011-10-06 01:03 EDT (History)
3 users (show)

See Also:
shr31223: review? (konstantin)


Attachments
exception (5.20 KB, text/plain)
2011-06-08 13:31 EDT, Musa CLA
no flags Details
Proposed patch for R3_2_maintenance (2.66 KB, patch)
2011-09-12 17:36 EDT, Roberto Sanchez Herrera CLA
no flags Details | Diff
Proposed patch for R3_2_maintenance (v2) (2.90 KB, patch)
2011-09-13 10:58 EDT, Roberto Sanchez Herrera CLA
konstantin: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Musa CLA 2011-06-08 13:28:59 EDT
Build Identifier: 20110218-0911

The cause of the issue is that when you open the Project Facets Dialog several times (Without closing the (Static or Dynamic) Web Project Wizard), the FacetDetailsDialog is registered a listener in the FacetedProjectWorkingCopy's  listeners map.

When closed, the FacetDetailsDialog is not removed from this Map for event type FIXED_FACETS_CHANGED, so when you open and close the Project Facets Dialog a couple of times, a couple of disposed FacetDetailsDialog will remain in the listeners map, and when a FIXED_FACETS_CHANGED event occurs, it will notify to all the disposed FacetDetailsDialog, which causes the "Argument not valid" exception for each disposed FacetDetailsDialog.

Reproducible: Always

Steps to Reproduce:
1. Open the New Static Web Project Wizard
2. Click the Modify button to open the Project Facets Dialog
3. Close it.
4. Open the project Facets Dialog again. This time, add a new project facet and Lock it (Right click > Lock).
5. An Error with message "Argument not valid" will appear in the Error log.
Comment 1 Musa CLA 2011-06-08 13:31:37 EDT
Created attachment 197624 [details]
exception

Exception stack trace attached.
Comment 2 Konstantin Komissarchik CLA 2011-06-08 14:34:44 EDT
Will look into this for 3.3.1 release.
Comment 3 Roberto Sanchez Herrera CLA 2011-09-12 17:36:46 EDT
Created attachment 203193 [details]
Proposed patch for R3_2_maintenance

Hello Konstantin, I hope you do not mind, but I took the liberty to create a patch for this exception. I used as a base the R3_2_maintenance branch. Do you think it is possible to change the target to WTP 3.2.5 instead of 3.3.1?
Comment 4 Konstantin Komissarchik CLA 2011-09-13 10:36:16 EDT
The patch looks pretty good, but since the dispose listener is created in the same context as the listener that needs to be removed, it should be possible to tighten up the code by not creating a new class field and the handleDisposeEvent() method.
Comment 5 Konstantin Komissarchik CLA 2011-09-13 10:36:47 EDT
Also, don't forget to update the contribution header in the class.
Comment 6 Roberto Sanchez Herrera CLA 2011-09-13 10:58:56 EDT
Created attachment 203252 [details]
Proposed patch for R3_2_maintenance (v2)

Second version of the patch, following Konstantin's suggestions. I updated the contribution header, and removed the class field and the handleDisposeEvent() method.
Comment 7 Roberto Sanchez Herrera CLA 2011-09-20 13:25:59 EDT
Hi Konstantin, have you had time to take a look on the second patch? Thank you.
Comment 8 Konstantin Komissarchik CLA 2011-09-20 13:41:04 EDT
I am going to take a look and hopefully commit the patch when Indigo SR2 opens for development as I want to apply this to all branches at once.
Comment 9 Roberto Sanchez Herrera CLA 2011-09-23 18:10:59 EDT
Ok, sounds good. Thank you.
Comment 10 Roberto Sanchez Herrera CLA 2011-10-03 15:51:36 EDT
Hi, I think Indigo SR2 is now open, and PMC for 3.2.5 begins next week. It would be great if this defect can be handled this week before PMC.
Comment 11 Carl Anderson CLA 2011-10-03 15:55:04 EDT
(In reply to comment #8)
> I am going to take a look and hopefully commit the patch when Indigo SR2 opens
> for development as I want to apply this to all branches at once.

SR2 is open.  3.2.5 starts its shutdown on 10/6, so PMC review would be needed then.  Juno is open.  So the best time to commit this would be before EOD 10/5.
Comment 12 Konstantin Komissarchik CLA 2011-10-06 01:03:02 EDT
Released fix to 3.2.x, 3.3.x and HEAD. Thanks!