Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 211358 - Locked by:csl.core.GsfDataObject$GenericEditorSupport$Environment.takeLock
Locked by:csl.core.GsfDataObject$GenericEditorSupport$Environment.takeLock
Product: php
Classification: Unclassified
Component: FTP Support
All All
: P3 (vote)
: 7.2
Assigned To: Tomas Mysik
Depends on: 213141
  Show dependency treegraph
Reported: 2012-04-17 23:38 UTC by budgie67
Modified: 2012-05-30 05:31 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT

stacktrace (3.96 KB, text/plain)
2012-04-17 23:39 UTC, budgie67

Note You need to log in before you can comment on or make changes to this bug.
Description budgie67 2012-04-17 23:38:57 UTC
Build: NetBeans IDE Dev (Build 201204170400)
VM: Java HotSpot(TM) Client VM, 20.6-b01, Java(TM) SE Runtime Environment, 1.6.0_31-b05
OS: Windows 7

User Comments:
GUEST: Downloading and syncronising from ftp.

budgie67: file save

inkubus08: download remote file

bartdeslagmulder: Download from remote srouce (FTP).

java.lang.Throwable: Locked by:
   at org.openide.filesystems.FileLock.<init>(
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile.<init>(
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile.tryLock(
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.lock(
   at org.openide.loaders.MultiDataObject$Entry.takeLock(
   at org.netbeans.modules.csl.core.GsfDataObject$GenericEditorSupport$Environment.takeLock(
Comment 1 budgie67 2012-04-17 23:39:05 UTC
Created attachment 118428 [details]
Comment 2 Svata Dedic 2012-05-24 14:14:01 UTC
I have (at least I think) found a race condition in concurrent access to 'locked' property in FileLock, which might cause a bogus warning to be printed from its finalizer.

Except the above... the last report, which contains a really erroneous situation uses IDE from 2011-02-14. All relevant reports show a conflict between org.netbeans.modules.php.project.connections.RemoteClient.renameLocalFileTo and a modified document opened in the editor.

The relevant code has been changed in commit 4e89e166eff1 in Jan 2012; Tomas please verify whether this defect still applies, I don't think so.
Comment 3 Tomas Mysik 2012-05-25 04:31:09 UTC
Well, locking of the target file is still there so I am not sure that this should not happen anymore; is there anything I can do (improve) on the PHP side?
(I use the file lock since I am going to replace the content of the file.)

Comment 4 Svata Dedic 2012-05-25 14:08:02 UTC
Not sure; in the original stacktraces (see c.f., RemoteClient.renameLocalFileTo attempted to lock the file, but the file was already locked by EditorSupport because the user had been typing in the file's editor.

Maybe some better recovery from FileAlreadyLockedException would be useful: e.g. ask the user whether the unsaved changes should be thrown away or something like that.
Comment 5 Tomas Mysik 2012-05-28 06:06:11 UTC
OK, taking over, will ty to fix it.

Comment 6 Tomas Mysik 2012-05-29 08:59:31 UTC
Correct fix depends on issue #213141.
Comment 7 Tomas Mysik 2012-05-29 11:46:12 UTC
Should be fixed (work around for #213141 will be removed once it is fixed).

Thanks for reporting.
Comment 8 Quality Engineering 2012-05-30 05:31:15 UTC
Integrated into 'main-golden', will be available in build *201205300001* on (upload may still be in progress)
User: Tomas Mysik <>
Log: #211358 - Locked by:csl.core.GsfDataObject$GenericEditorSupport$Environment.takeLock

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo