Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337742 - FACET_PROJECT_NAME not updated in DataModel when project name is changed for facet added after opening the new project wizard
Summary: FACET_PROJECT_NAME not updated in DataModel when project name is changed for ...
Status: RESOLVED FIXED
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: Faceted Project Framework (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0.5 P   Edit
Assignee: Roberto Sanchez Herrera CLA
QA Contact: Konstantin Komissarchik CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-21 12:21 EST by Roberto Sanchez Herrera CLA
Modified: 2011-02-25 17:40 EST (History)
1 user (show)

See Also:
ccc: review+


Attachments
patch (1.93 KB, patch)
2011-02-21 12:39 EST, Roberto Sanchez Herrera CLA
no flags Details | Diff
Patch 2 (2.58 KB, patch)
2011-02-23 15:36 EST, Roberto Sanchez Herrera CLA
ccc: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roberto Sanchez Herrera CLA 2011-02-21 12:21:32 EST
Build Identifier: WTP R-3.0.5-20090521045405

The property FACET_PROJECT_NAME is not updated in the DataModel, when the project name is canged in the New Project wizard, for a facet that is added after opening the new project wizard. This problem is caused during the merge of the original and local IFacetedProjectWorkingCopy objects in class FacetsSelectionDialog.  

This problem does not occur in newer versions of WTP because the class FacetsSelectionDialog was changed (in version 1.4) to use only one copy of the IFacetedProjectWorkingCopy, taking away this problem (along with the capacity of canceling changes in the Project Facets Dialog, making the Cancel button useless)

Reproducible: Always

Steps to Reproduce:
1. Open the new project wizard (for example, the new utility project wizard)
2. Type in the name of the project (for example, Test)
3. Click on the modify button for adding a facet
4. Add a facet that uses the FACET_PROJECT_NAME (for example, select the dynamic web module facet - you will have to unlock and remove the utility facet first) and click OK 
5. Change the name of the project (for example, Test2) and click Next until you see the Web module panel. Note that the context root (which shows the FACET_PROJECT_NAME property) has the old project name.
Comment 1 Roberto Sanchez Herrera CLA 2011-02-21 12:39:55 EST
Created attachment 189426 [details]
patch

With this patch, FacetsSelectionDialog will use only one copy of the IFacetedProjectWorkingCopy, fixing the problem reported in this bug (and also will make the Cancel button useless, as I commented in the problem report).
Comment 2 Konstantin Komissarchik CLA 2011-02-21 13:29:24 EST
This looks to be a direct back-port of the fix done in a later release. In which case my only concern is making sure that all files changed by the original fix are patched. Unfortunately, it's been long enough that I do not have recollection about which files were affected (or whether this is the only one). May want to search CVS history for other references to the original bug.

You may also want to back-port the more recent fix to remove the cancel button.
Comment 3 Roberto Sanchez Herrera CLA 2011-02-23 15:36:47 EST
Created attachment 189637 [details]
Patch 2

Updated patch that also removes the Cancel button
Comment 4 Roberto Sanchez Herrera CLA 2011-02-23 15:44:57 EST
I looked on the history of each file in plugins org.eclipse.wst.common.project.facet.core and org.eclipse.wst.common.project.facet.ui for modifications using bugzilla 246448, and found some:

GridLayoutUtil
FacetedProjectFramework
IFacetedProject
IFacetedProjectWorkingCopy

But looks like none of them are related to the changes included in the patch in this bugzilla
Comment 5 Roberto Sanchez Herrera CLA 2011-02-23 17:18:51 EST
After another search, I found that these were the files changed by bugzilla
246448, but still looks like none of the changes are related to the patch in
this bug (except FacetsSelectionDialog)

Plugin: org.eclipse.wst.common.project.facet.core:

FacetedProjectFramework
IFacetedProject
IFacetedProjectWorkingCopy
DelayedClassLoadingListener
FacetedProject
FacetedProjectFrameworkImpl
FacetedProjectPropertyTester
FacetedProjectWorkingCopy
PresetsExtensionPoint
ProjectFacetPreferences (Created)
ProjectFacetPreferencesGroup (Created)
RuntimeManagerImpl
CollectionsUtil (Created)
DomUtil (Created)
FileUtil
MiscUtil
PluginUtil
ProgressMonitorUtil
XmlParseException (created)
XMLWriter (Created)
Pluginutil.properties
MANIFEST.MF
plugin.xml
some schemas (coyright)



Plugin: org.eclipse.wst.common.project.facet.ui

FacetsSelectionDialog
EnhancedComposite (Created)
GridLayoutUtil
TableWrapLayoutUtil
plugin.xml
some schemas (coyright)
Comment 6 Konstantin Komissarchik CLA 2011-02-23 17:23:39 EST
I think there is something wrong with the search methodology. The stated results are improbable. This might be difficult/impractical to do with CVS, so we may need to just assume that all changes were contained in FacetsSelectionDialog and test this patch really well.
Comment 7 Carl Anderson CLA 2011-02-25 17:40:39 EST
Committed to R3_0_5_patches