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 195824 - FileAlreadyLockedException in checkstyle.AuxPropsImpl.copyToCacheDir
Summary: FileAlreadyLockedException in checkstyle.AuxPropsImpl.copyToCacheDir
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Milos Kleint
URL:
Keywords: THREAD
Depends on:
Blocks:
 
Reported: 2011-02-22 19:43 UTC by rdelaplante
Modified: 2012-03-17 10:35 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 176925


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.