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.

Bug 146701 - can't update project through subversion, or any other
Summary: can't update project through subversion, or any other
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: PC Linux
: P1 blocker (vote)
Assignee: Alexey Vladykin
URL:
Keywords:
: 123943 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-09-09 21:13 UTC by tbrunhoff
Modified: 2008-10-13 19:34 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tbrunhoff 2008-09-09 21:13:15 UTC
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.
Comment 1 Vladimir Voskresensky 2008-09-09 22:54:23 UTC
possibly memory leak in our code (remains old project configuration) or on NB side
Comment 2 Alexey Vladykin 2008-09-10 14:18:49 UTC
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)
Comment 3 Alexey Vladykin 2008-09-10 15:21:13 UTC
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.
Comment 4 Alexey Vladykin 2008-09-10 18:03:46 UTC
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.
Comment 5 Alexey Vladykin 2008-09-10 18:45:57 UTC
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 :)
Comment 6 Thomas Preisler 2008-09-11 01:04:46 UTC
which one is safest?
Comment 7 Alexey Vladykin 2008-09-11 13:54:15 UTC
Fixed in http://hg.netbeans.org/main/rev/3c6cb9ce5d18.
ConfigurationDescriptorProvider now listens for changes of configurations.xml file and reloads descriptor if necessary.
Comment 8 Quality Engineering 2008-09-12 05:57:53 UTC
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
Comment 9 Alexey Vladykin 2008-10-13 19:34:15 UTC
*** Issue 123943 has been marked as a duplicate of this issue. ***