wglanzer opened a new issue, #6077:
URL: https://github.com/apache/netbeans/issues/6077

   ### Apache NetBeans version
   
   Apache NetBeans 18
   
   ### What happened
   
   I think that I found a strange behavior in 
org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile:hardLock#289. 
As I see, the outer Namesakes will be created for every filename and will be 
reused, if a file (even in another folder) has to be locked. So, if a lock gets 
inserted via "putInstance(File, LockForFile)", ALL files with the same name get 
hardLocked, if they don't exist.
   That means, that, if I create fileobjects (and retrieve their outputstream 
by "getOutputStream()") in parallel, it may be possible that the hardLock 
fails, because it already registered a lock during its own creation.
   
   Maybe a more practical thought here:
   - Thread1: FileObject A gets created; Retrieve the outputStream; Write 
something in it; Close
   - Thread2: During A-Creation it creates a new FileObject, with THE SAME 
NAME, but in a different path. This will cause a FileAlreadyLockedException, 
even if it should be possible.
   
   What do you think about this thought? Is it possible, or am I completely 
wrong?
   
   ### How to reproduce
   
   _No response_
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Mac OSX
   
   ### JDK
   
   13
   
   ### Apache NetBeans packaging
   
   Apache NetBeans platform
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to