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 216544 - Throwable: Locked by in refactoring.java.ui.SafeDeleteUI
Summary: Throwable: Locked by in refactoring.java.ui.SafeDeleteUI
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Actions/Menu/Toolbar (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-08 15:07 UTC by Sergey Petrov
Modified: 2016-01-06 12:17 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 191393


Attachments
stacktrace (4.90 KB, text/plain)
2012-08-08 15:07 UTC, Sergey Petrov
Details
stacktrace (5.86 KB, text/plain)
2013-08-06 02:14 UTC, MackSix
Details
Project to use for reproduction (14.58 KB, application/zip)
2013-08-06 02:59 UTC, MackSix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Petrov 2012-08-08 15:07:22 UTC
Build: NetBeans IDE Dev (Build 20120808-5b64fdbbc16e)
VM: Java HotSpot(TM) Client VM, 20.6-b01, Java(TM) SE Runtime Environment, 1.6.0_31-b05
OS: Windows 7

User Comments:
sj-nb: see second comment in issue 216537,
after this error, I tried to remove package containing all entities and got number of dialogs like "can't save" and finally this exception




Stacktrace: 
java.lang.Throwable: Locked by:
   at org.openide.filesystems.FileLock.<init>(FileLock.java:85)
   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:359)
   at org.openide.loaders.MultiDataObject$Entry.takeLock(MultiDataObject.java:1356)
   at org.netbeans.modules.openide.loaders.SimpleES$Environment.takeLock(SimpleES.java:188)
Comment 1 Sergey Petrov 2012-08-08 15:07:24 UTC
Created attachment 122878 [details]
stacktrace
Comment 2 Jaroslav Tulach 2012-08-09 09:41:58 UTC
EditorModule.reformat and refactoring.java.ui.SafeDeleteUI collide. Which one is supposed to win?
Comment 3 Exceptions Reporter 2013-03-25 13:42:43 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=191393
Comment 4 MackSix 2013-08-06 02:14:12 UTC
Created attachment 138324 [details]
stacktrace

Using Undo of Formatting. There is something wrong with the Formatting if I have a package or file selected in the Project Window that may be part of this. 
1. Opened 2 files in a package.
2. Placed cursor on package name in Project Window.
3. Source>>Format and got a dialog box to confirm format recursively of package or file. 
4. Click OK.
5. Put focus on one of the files in editor and click Undo button.
6. Put focus on package name and click Undo button.
This exception was thrown. I am not sure I can reproduce it.
Comment 5 MackSix 2013-08-06 02:58:42 UTC
Reproducible:


1. Open the 2 files in the attached project. (FormattingProject)
2. Placed cursor on package name in Project Window.
3. Do Source>>Format and confirm dialog box to recursively format package or file. 
4. Click OK.
5. Put focus on one of the files in editor and click Undo button.
6. Put focus on package name "formattingproject" in Project window and click Undo button.

This exception was thrown.

Product Version: NetBeans IDE Dev (Build 201308042300)
Updates: Updates available
Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b16
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 6 MackSix 2013-08-06 02:59:15 UTC
Created attachment 138327 [details]
Project to use for reproduction
Comment 7 MackSix 2013-08-06 03:15:32 UTC
(In reply to comment #5)
> Reproducible:
> 
> 
> 1. Open the 2 files in the attached project. (FormattingProject)
> 2. Placed cursor on package name in Project Window.
> 3. Do Source>>Format and confirm dialog box to recursively format package or
> file. 
> 4. Click OK.
> 5. Put focus on one of the files in editor and click Undo button.
> 6. Put focus on package name "formattingproject" in Project window and click
> Undo button.
> 
> This exception was thrown.
> 
> Product Version: NetBeans IDE Dev (Build 201308042300)
> Updates: Updates available
> Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01
> Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b16
> System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)

If the exception is not thrown, do this and repeat the steps above and it should happen.

1. Goto Tools>>Options>>Editor>>Formatting, Language:Java, Category Wrapping and set the first 3 dropdowns to "If Long".
2. Click Apply button.
3. Switch to Category: Tabs and Indent and Uncheck "Use all language settings".
4. Change Right Margin to 40.
5. Click Apply button.
Comment 8 Ralph Ruijs 2015-03-09 11:04:30 UTC
org.netbeans.editor.Utilities.runWithOnSaveTasksDisabled should block and make sure previously started tasks are finished.