Bug 221353 - Faces-config contains info from old project
Summary: Faces-config contains info from old project
Status: CLOSED FIXED
Alias: None
Product: Java Server Faces
Classification: WebTools
Component: JSF Tools (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M7   Edit
Assignee: Debajit Adhikary CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
: 209137 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-04 11:56 EST by Xiaonan Jiang CLA
Modified: 2008-08-04 11:03 EDT (History)
6 users (show)

See Also:


Attachments
The Source page in the FacesConfigEditor now disposes all the relevant models correctly (4.43 KB, patch)
2008-04-16 15:22 EDT, Debajit Adhikary CLA
no flags Details | Diff
Updated patch to enhance FacesConfigEditor.dispose() (4.50 KB, patch)
2008-04-18 19:11 EDT, Debajit Adhikary CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xiaonan Jiang CLA 2008-03-04 11:56:02 EST
Build ID: 3.0M5-20080218

Steps To Reproduce:
I had a dynamic web project named "Prj" with a bunch of modifications to faces-config. I deleted this project, and checked the box to remove its contents from the disk.

Every time I create a new dynamic web project named "Prj", its faces-config file contains the data that I pasted into the old project.

The old project seems to be cached and isn't actually deleted when the project is.

More information:
Comment 1 Raghunathan Srinivasan CLA 2008-03-27 20:27:30 EDT
*** Bug 209137 has been marked as a duplicate of this bug. ***
Comment 2 Debajit Adhikary CLA 2008-04-11 20:26:16 EDT
A consistent way to reproduce the bug is as follows (Step 3 below has been added to the original steps, to make it reproduce consistently).

(1) Create a new dynamic web project (JSF)

(2) Make one or more modifications to faces-config.xml (add a managed bean for instance)

(3) Click on the Source tab in the faces-config.xml editor.

(4) Delete the project (check "Delete project contents on disk")

(5) Create a new dynamic web project (JSF) with the same project name you'd entered in Step 1

(6) Open faces-config.xml. You should be able to see the changes you had made the last time. 


The problem it appears, is when the Source tab is clicked (even once) within the Faces-Config Editor. 

Apparently, clicking on the Source tab increments the reference count for an edit (ModelManagerImpl.SharedObject.referenceCountForEdit), and this increase in the reference count never gets decremented (when the editor is closed etc.). As a result, the in-memory copy of the model is returned each time, even though the XML file itself may have changed.

Comment 3 Debajit Adhikary CLA 2008-04-16 15:22:37 EDT
Created attachment 96317 [details]
The Source page in the FacesConfigEditor now disposes all the relevant models correctly

Please review the attached patch for this bug-fix.
Comment 4 Debajit Adhikary CLA 2008-04-16 15:28:49 EDT
Please review the attached patch for this bug-fix
Comment 5 Debajit Adhikary CLA 2008-04-18 19:11:07 EDT
Created attachment 96683 [details]
Updated patch to enhance FacesConfigEditor.dispose()
Comment 6 Debajit Adhikary CLA 2008-04-18 19:17:17 EDT
Please review the updated patch (attached) for this bug-fix
Comment 7 Gerry Kessler CLA 2008-04-21 15:48:25 EDT
Checked in 4/21/08.
Comment 8 David Williams CLA 2008-04-24 00:47:16 EDT
mass change to add 'contributed' keyword based on bugzilla query, please correct if that's not accurate (by marking patches as obsolete and removing the 'contributed' keyword. 
Comment 9 Raghunathan Srinivasan CLA 2008-06-18 18:29:32 EDT
Hi Xiaonan,

Could you please verify this bugs so that we can close it for 3.0?

Thanks
Comment 10 Xiaonan Jiang CLA 2008-08-04 11:03:26 EDT
Verified.