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 46089

Summary: VSS: An exception thrown when nbproject/project.properties is not writable and you modify some properties in project customizer
Product: projects Reporter: Marek Fukala <mfukala>
Component: AntAssignee: Jesse Glick <jglick>
Status: CLOSED FIXED    
Severity: blocker CC: mentlicher
Priority: P3    
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 57748    
Bug Blocks: 41535, 57480    
Attachments: org.netbeans.modules.vcscore.VcsFileSystem$FileLockUserQuestionException: Do you want to checkout the file to make it writable?

Description Marek Fukala 2004-07-13 14:23:19 UTC
This applies for those properties whose change
causes the project.properties file to be updated.

The exception says:
org.netbeans.modules.vcscore.VcsFileSystem$FileLockUserQuestionException:
Do you want to checkout the file to make it writable?

There should be a yes/no dialog asking the
question in the exception message.

To reproduce:
1) create a new workdir for a VSS project using
versioning manager
2) create a web project in the workdir
3) add project files into the VSS
=> the files are made read-only (nature of the VSS)
4) open project customizer
try to change a property chich change causes
project.properties file to be changed.

=> the exception is thrown.
Comment 1 Marek Fukala 2004-07-13 14:23:39 UTC
Created attachment 16221 [details]
org.netbeans.modules.vcscore.VcsFileSystem$FileLockUserQuestionException: Do you want to checkout the file to make it writable?
Comment 2 Petr Jiricka 2004-07-14 13:11:16 UTC
Marku, this seems to be coming from the projects infrastructure code.
Can you please check whether this also happens for Java projects? Thanks.
Comment 3 Marek Fukala 2004-07-14 14:42:01 UTC
You are right - this is a problem of all kinds of project. 
For j2se - try to add a library or so and you will see the some exception.
I am not sure who this should be reassigned to - projects? can you do
that? thanx.
Comment 4 Petr Jiricka 2004-07-14 14:48:56 UTC
Reassigning to the Projects module.
Comment 5 Jesse Glick 2004-07-14 18:17:43 UTC
Will try to catch UserQuestionException in such cases (written by
AntProjectHelper) and handle it properly. Not sure how that will
interact with threading considerations.
Comment 6 Jesse Glick 2004-08-12 02:25:43 UTC
Have a patch which I hope works; do not have VSS to test on, so
someone else will have to verify.

Patch checks for UserQuestionException thrown whenever writing
project.xml, private.xml, project.properties, or private.properties
(via AntProjectHelper). Displays OK/Cancel dialog asynchronously. If
user accepts, and confirmed() does not throw a new error, the write is
retried. Otherwise the IDE's notion of the project state is reverted
to what remains on disk. I.e. if you had opened the project
customizer, made some changes, clicked OK, then got this dialog and
decided not to lock the file, your changes would be reverted.

If UQE is thrown when trying to automatically regenerate
build-impl.xml (or the associated genfiles.properties), the operation
is just skipped and no dialog is shown.

BTW Martin: it seems that vcscore does not include the file name in
the exception's localized message. Probably it should mention the
absolute path, as otherwise the user would not typically guess that
e.g. ~/projects/myproj/nbproject/project.xml is the file the IDE is
trying to write to.
Comment 7 Jesse Glick 2004-08-12 05:54:09 UTC
committed   * Up-To-Date  1.4        
ant/project/src/org/netbeans/modules/project/ant/Bundle.properties
added       * Up-To-Date  1.1        
ant/project/src/org/netbeans/modules/project/ant/UserQuestionHandler.java
committed   * Up-To-Date  1.22       
ant/project/src/org/netbeans/spi/project/support/ant/AntProjectHelper.java
committed   * Up-To-Date  1.7        
ant/project/src/org/netbeans/spi/project/support/ant/GeneratedFilesHelper.java
committed   * Up-To-Date  1.8        
ant/project/src/org/netbeans/spi/project/support/ant/ProjectProperties.java
Comment 8 Marian Mirilovic 2005-12-20 15:45:45 UTC
This issue was solved long time ago. Because nobody has reopened it neither
added comments, we are verifying/closing it now. 
If you are still able to reproduce the problem, please reopen. Thanks in advance.