Bug 195824 - FileAlreadyLockedException in checkstyle.AuxPropsImpl.copyToCacheDir
FileAlreadyLockedException in checkstyle.AuxPropsImpl.copyToCacheDir
Status: RESOLVED FIXED
Product: projects
Classification: Unclassified
Component: Maven
7.0
All All
: P3 (vote)
: 7.2
Assigned To: Milos Kleint
issues@projects
EXCEPTIONS_REPORT
: THREAD
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-22 19:43 UTC by rdelaplante
Modified: 2012-03-17 10:35 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments
stacktrace (9.12 KB, text/plain)
2011-02-22 19:43 UTC, rdelaplante
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rdelaplante 2011-02-22 19:43:27 UTC
Build: NetBeans IDE Dev (Build 201102160501)
VM: Java HotSpot(TM) Client VM, 16.3-b01, Java(TM) SE Runtime Environment, 1.6.0_20-b02
OS: Linux

User Comments:
rdelaplante: I opened the IDE and got this exception




Stacktrace: 
java.lang.Throwable: Locked by:
   at org.openide.filesystems.FileLock.<init>(FileLock.java:83)
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile.<init>(LockForFile.java:91)
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.LockForFile.tryLock(LockForFile.java:102)
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.lock(FileObj.java:337)
   at org.openide.filesystems.FileObject.delete(FileObject.java:363)
   at org.netbeans.modules.maven.format.checkstyle.AuxPropsImpl.copyToCacheDir(AuxPropsImpl.java:113)
Comment 1 rdelaplante 2011-02-22 19:43:32 UTC
Created attachment 106313 [details]
stacktrace
Comment 2 Jesse Glick 2011-02-28 16:17:48 UTC
Might be a race condition.
Comment 3 Milos Kleint 2012-03-13 15:19:22 UTC
I'm not clear how it could happen in the current codebase, given that all cases of copying the file are protected by synchronized (AuxPropsImpl.this)

https://hg.netbeans.org/core-main/rev/1fa8b682089e makes sure that we use just one method to copy files and avoid deleting the file if it exists.
Comment 4 Quality Engineering 2012-03-17 10:35:48 UTC
Integrated into 'main-golden', will be available in build *201203170400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/1fa8b682089e
User: Milos Kleint <mkleint@netbeans.org>
Log: #195824 unify ways of copying the checkstyle config file to a configuration area.. never delete, just overwrite.


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