This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
NetBeans IDE Dev (Build 200809071401) I have a project P. I have two copies of that project located in ~/src1/P and ~/src2/P and both copies are checked out of the same subversion repository. The following events occur in the order listed (there are no race conditions): - open project in ~/src1/P - open project in ~/src2/P (I modify the name in nbproject/project.xml to make them distinguishable) - change the configuration in ~/src1/P (add source directories) - check in the changes in ~/src1/P - close ~/src2/P (so I can update the source tree with the changes from ~/src1/P) - update ~/src2/P, confirm that the updates show up in the project directory - reopen project in ~/src2/P At this point ~/src2/P will have reverted to the previous state and will revert the files under ~/src2/P/nbproject back to their previous state. That is, it does not open the project, but uses what appears to be already in memory. Not good. Note that if I exit out of netbeans ide and restart before reopening the project in ~/src2/P, the project is correctly updated.
possibly memory leak in our code (remains old project configuration) or on NB side
A simpler scenario to reliably reproduce this issue: - create sample project (I used Arguments) in IDE - close it - change Arguments/nbproject/private/configurations.xml with external editor (I edited <args>) - reopen project in IDE - go to project properties and see that external changes are not applied (in my case value of Run->Arguments is not changed)
This issue is caused by project caching performed by org.netbeans.api.project.ProjectManager. Instead of reloading the project from disk ProjectManager gets it from a private hashtable of TimedWeakReferences. That is, if no garbage collection happens between project closing and reopening, then changes are not loaded from disk. At the same time J2SE projects are not subject to this issue. Java projects are also cached by ProjectManager, but they somehow track external changes of the files. Changes done in open J2SE project are immediately visible in project properties. Something similar should be implemented for C/C++ projects.
The idea is to set project descriptor to null when project is closed (ProjectOpenedHookImpl.projectClosed). This will force re-reading of project configuration files when the project is next opened.
Another idea is to add a FileChangeListener for nbproject/configurations.xml and nbproject/private/configurations.xml to track external changes. This is a cleaner approach and surprisingly seems to be easier to implement :)
which one is safest?
Fixed in http://hg.netbeans.org/main/rev/3c6cb9ce5d18. ConfigurationDescriptorProvider now listens for changes of configurations.xml file and reloads descriptor if necessary.
Integrated into 'main-golden', will be available in build *200809120201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/3c6cb9ce5d18 User: Alexey Vladykin <alexey_vladykin@netbeans.org> Log: Fixed IZ#146701: can't update project through subversion, or any other
*** Issue 123943 has been marked as a duplicate of this issue. ***