Bug 190736 - slowRename to prevent rename to be done in AWT
slowRename to prevent rename to be done in AWT
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: Explorer
7.0
PC Solaris
: P4 (vote)
: 7.1
Assigned To: Jaroslav Tulach
issues@platform
: API_REVIEW_FAST
Depends on:
Blocks: 195108
  Show dependency treegraph
 
Reported: 2010-10-04 06:36 UTC by Vladimir Voskresensky
Modified: 2011-07-29 12:06 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
ExplorerViews honor "slowRename" property. FolderNode provides it if there is registered handler (13.94 KB, patch)
2011-06-16 07:27 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2010-10-04 06:36:02 UTC
Product Version: NetBeans IDE Dev (Build 101004-93a39f6d308d)
Java: 1.6.0_14; Java HotSpot(TM) Client VM 14.0-b16
System: SunOS version 5.10 running on x86; UTF-8; ru_RU (nb)
Userdir: /export/home/vv159170/.netbeans/dev

INFO [org.netbeans.modules.mercurial]: Warning: launching external process in AWT
java.lang.Exception
        at org.netbeans.modules.mercurial.MercurialInterceptor.doMove(MercurialInterceptor.java:155)
        at org.netbeans.modules.versioning.FilesystemInterceptor$DelegatingInterceptor.doMove(FilesystemInterceptor.java:515)
        at org.netbeans.modules.versioning.FilesystemInterceptor$DelegatingInterceptor$1.handle(FilesystemInterceptor.java:573)
        at org.netbeans.modules.masterfs.ProvidedExtensionsProxy$DelegatingIOHandler$1.run(ProvidedExtensionsProxy.java:490)
        at org.netbeans.modules.masterfs.ProvidedExtensionsProxy.runCheckCode(ProvidedExtensionsProxy.java:458)
        at org.netbeans.modules.masterfs.ProvidedExtensionsProxy.access$300(ProvidedExtensionsProxy.java:66)
        at org.netbeans.modules.masterfs.ProvidedExtensionsProxy$DelegatingIOHandler.handle(ProvidedExtensionsProxy.java:487)
        at org.netbeans.modules.masterfs.filebasedfs.naming.FileName.rename(FileName.java:82)
        at org.netbeans.modules.masterfs.filebasedfs.naming.NamingFactory.rename(NamingFactory.java:106)
        at org.netbeans.modules.masterfs.filebasedfs.fileobjects.BaseFileObj.rename(BaseFileObj.java:383)
        at org.netbeans.modules.masterfs.filebasedfs.fileobjects.BaseFileObj$1.call(BaseFileObj.java:432)
        at org.netbeans.modules.masterfs.filebasedfs.fileobjects.BaseFileObj$1.call(BaseFileObj.java:429)
        at org.netbeans.modules.masterfs.filebasedfs.FileBasedFileSystem.runAsInconsistent(FileBasedFileSystem.java:115)
        at org.netbeans.modules.masterfs.filebasedfs.fileobjects.BaseFileObj.rename(BaseFileObj.java:436)
        at org.openide.loaders.FileEntry$Folder.rename(FileEntry.java:441)
        at org.openide.loaders.MultiDataObject.handleRename(MultiDataObject.java:533)
        at org.openide.loaders.DataFolder.handleRename(DataFolder.java:703)
        at org.openide.loaders.DataObject$1Op.run(DataObject.java:671)
        at org.openide.loaders.DataObject$1WrapRun.run(DataObject.java:868)
        at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:125)
        at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:566)
        at org.openide.loaders.DataObjectPool.runAtomicActionSimple(DataObjectPool.java:229)
        at org.openide.loaders.DataObject.invokeAtomicAction(DataObject.java:885)
        at org.openide.loaders.DataObject.rename(DataObject.java:685)
        at org.netbeans.modules.refactoring.impl.FolderRenameHandlerImpl.handleRename(FolderRenameHandlerImpl.java:80)
        at org.openide.loaders.DataFolder$FolderNode.setName(DataFolder.java:1375)
        at org.openide.nodes.FilterNode.setName(FilterNode.java:499)
        at org.openide.explorer.view.TreeViewCellEditor.editingStopped(TreeViewCellEditor.java:141)
        at javax.swing.AbstractCellEditor.fireEditingStopped(AbstractCellEditor.java:125)
        at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(DefaultCellEditor.java:350)
        at javax.swing.DefaultCellEditor.stopCellEditing(DefaultCellEditor.java:215)
        at javax.swing.DefaultCellEditor$EditorDelegate.actionPerformed(DefaultCellEditor.java:367)
        at javax.swing.JTextField.fireActionPerformed(JTextField.java:492)
        at javax.swing.JTextField.postActionEvent(JTextField.java:705)
        at javax.swing.JTextField$NotifyAction.actionPerformed(JTextField.java:820)
        at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1636)
        at javax.swing.JComponent.processKeyBinding(JComponent.java:2851)
        at javax.swing.JComponent.processKeyBindings(JComponent.java:2886)
        at javax.swing.JComponent.processKeyEvent(JComponent.java:2814)
        at java.awt.Component.processEvent(Component.java:6040)
        at java.awt.Container.processEvent(Container.java:2041)
        at java.awt.Component.dispatchEventImpl(Component.java:4630)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1848)
        at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:704)
        at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:969)
        at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:841)
        at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:668)
        at java.awt.Component.dispatchEventImpl(Component.java:4502)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Window.dispatchEventImpl(Window.java:2475)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:137)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Comment 1 Jaroslav Tulach 2011-01-03 12:12:25 UTC
We can create some API between Node & Explorer to allow node to request async rename. Something like: node.getValue("asyncRename").

Anyway then the refactoring needs to create some contract between the FolderNode and FolderRenameHandlerImpl to know that FolderNode shall return the node.getValue("asyncRename") -> Boolean.TRUE.

All of this is an API enhancement request from explorer or datasystems point of view. If this is also a bug, then it belongs to refactoring, as it is the FolderRenameHandlerImpl that does something slow in AWT.
Comment 2 Jan Becicka 2011-01-03 13:14:53 UTC
1. Refactoring just implements FolderRenameHandler. It it is obvious, that implementors will do IO operations inside handleRename method. Rescheduling of this IO tasks should not be done in impls, but in UI part (FolderNode)
2. Even if you uninstall refactoring module, the stack trace will be similar, because FolderRenameHandler just calls dataObject.rename() which will be called even if there will be no FolderRenameHandler installed in the Lookup.
Comment 3 Jaroslav Tulach 2011-01-04 08:12:08 UTC
From the point of view of explorer&propertysheet, this is just an enhancement.

If Vladimir thinks this is a bug, he can either report it directly to refactoring or simulate it without refactoring and then report it to datasystems.

Btw. adding Ondřej on CC, as the warning is printed by his module.
Comment 4 Jaroslav Tulach 2011-06-16 07:27:12 UTC
Created attachment 108922 [details]
ExplorerViews honor "slowRename" property. FolderNode provides it if there is registered handler
Comment 5 Jesse Glick 2011-06-21 18:50:34 UTC
[JG01] Would it not be simpler (no API change) for FolderNode.setName to just do its work asynch? No code other than explorer views ought to be calling Node.set... anyway.
Comment 6 Jaroslav Tulach 2011-06-28 07:07:22 UTC
It would be simpler, but that would be an incompatible change, I am afraid.

Unless objections are raised I'll go with "slowRename".
Comment 7 Quality Engineering 2011-07-01 14:05:25 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/d49cb1e754b2
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #190736: Support for slowRename outside of AWT dispatch thread
Comment 8 Jaroslav Tulach 2011-07-29 12:06:09 UTC
Already fixed, I think...


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