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 177696 - 4s - org.openide.explorer.ExplorerActionsImpl.updatePasteAction() blocked by WinNT I/O
Summary: 4s - org.openide.explorer.ExplorerActionsImpl.updatePasteAction() blocked by ...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: PERFORMANCE
: 186505 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-11-26 10:45 UTC by Exceptions Reporter
Modified: 2010-06-16 13:23 UTC (History)
8 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 158003


Attachments
nps snapshot (256.00 KB, application/nps)
2009-11-26 10:45 UTC, Exceptions Reporter
Details
nps snapshot (256.00 KB, application/nps)
2010-01-10 16:23 UTC, emiddio
Details
nps snapshot (256.00 KB, application/nps)
2010-01-10 16:25 UTC, emiddio
Details
nps snapshot (256.00 KB, application/nps)
2010-01-10 16:29 UTC, emiddio
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2009-11-26 10:45:22 UTC
Build: NetBeans IDE 6.8 Beta (Build 200910212001)
VM: Java HotSpot(TM) 64-Bit Server VM, 14.3-b01, Java(TM) SE Runtime Environment, 1.6.0_17-b04
OS: Windows 7, 6.1, amd64

User Comments:
GUEST: Sometimes Netbeans occur any errors while I am coding. For example error which I have been see that is error "Null Point Exeption".
This error occur when I am designing GUI or when I add plugin.
When that I usually restart or ignore if it's not bring about bad effects for my work.

GUEST: doubleclicking on another class to edit it


Maximum slowness yet reported was 6709 ms, average is 4852
Comment 1 Exceptions Reporter 2009-11-26 10:45:27 UTC
Created attachment 91742 [details]
nps snapshot
Comment 2 emiddio 2010-01-10 16:23:50 UTC
Created attachment 93156 [details]
nps snapshot
Comment 3 emiddio 2010-01-10 16:25:50 UTC
Created attachment 93157 [details]
nps snapshot
Comment 4 emiddio 2010-01-10 16:29:51 UTC
Created attachment 93159 [details]
nps snapshot
Comment 5 Jaroslav Tulach 2010-05-25 07:32:26 UTC
*** Bug 186505 has been marked as a duplicate of this bug. ***
Comment 6 Jaroslav Tulach 2010-05-25 07:35:23 UTC
This is what happens on slow shares:

java.io.WinNTFileSystem.canonicalize0(Native Method)
java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:396)
java.io.File.getCanonicalPath(File.java:559)
java.io.File.getCanonicalFile(File.java:583)
org.openide.filesystems.FileUtil.normalizeFileOnWindows(FileUtil.java:1656)
org.openide.filesystems.FileUtil.normalizeFile(FileUtil.java:1563)
org.openide.loaders.DataFolder$FolderNode.createNodeTransferable(:1365)
org.openide.loaders.DataFolder$FolderNode.createPasteTypes(DataFolder.java:1346)
Comment 7 Jaroslav Tulach 2010-05-25 07:44:33 UTC
I can change the FolderNode to be much faster by just using the file f:

@@ -1419,7 +1419,8 @@
         Transferable createNodeTransferable( File f ) {
             Transferable result = null;
-            FileObject fo = FileUtil.toFileObject(FileUtil.normalizeFile(f));
+            assert (f = FileUtil.normalizeFile(f)) != null;
+            FileObject fo = FileUtil.toFileObject(f);
             if( null != fo ) {
                 try {
                     DataObject dob = DataObject.find( fo );

however that may contradict Jesse's f2e72f53aad9. It will prevent the assert, but it may violate some assumptions about normalized files which I don't understand.
Comment 8 Jesse Glick 2010-05-27 14:04:56 UTC
You can't just turn off the call to FileUtil.normalizeFile, or the IAEs will reappear that I fixed in f2e72f53aad9. (If assertions are off, the problem will likely make itself felt somewhere further down the line, as you will have a nonnormal DataObject floating around.)

Anyway the whole paste type calculation could perhaps be done lazily. It seems silly to be getting the DataNode for a file which happens to be in the clipboard just in case the user might paste it! The flow of control is rather convoluted so I'm not sure how to fix it - some kind of proxy.

updatePasteAction should also perhaps call updatePasteTypes asynch (with OwnPaste.setPasteTypes then rescheduling the setEnabled into EQ). This would make a whole class of EQ-blocking bugs disappear. Of course the work would in this case still be being done in the background whereas it probably does not need to be done at all.
Comment 9 Jaroslav Tulach 2010-06-16 13:23:20 UTC
Now, when the call to FileUtil.normalizeFile is cached (due to bug 183308), the problem with too often disk touches, shall also be solved.