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 220294

Summary: Give warning when accessing file system from EDT
Product: platform Reporter: Egor Ushakov <gorrus>
Component: FilesystemsAssignee: Egor Ushakov <gorrus>
Status: RESOLVED WONTFIX    
Severity: normal CC: issues, jhavlin, jtulach, mkleint, thurka
Priority: P3 Keywords: PERFORMANCE
Version: 7.2   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 218138    
Attachments: proposed patch for FileUtil.normalizeFileImpl
proposed patch 2

Description Egor Ushakov 2012-10-17 15:12:16 UTC
Accessing file system (maybe network) from EDT hangs the IDE,
to prevent coding this way we could add give warning in dev version if it happens, proposed places for this warning:

FileObj.canWrite
Utilities.toURI
FileUtil.normalizePath
Comment 1 Jaroslav Tulach 2012-10-22 09:14:43 UTC
Not that I am huge fan of such change, but if you pass an API review, I will not block it.
Comment 2 Egor Ushakov 2012-10-22 13:08:07 UTC
Created attachment 126326 [details]
proposed patch for FileUtil.normalizeFileImpl

Please review the proposed patch, for not it only covers FileUtil.normalizeFileImpl, I want to agree on general approach
Comment 3 Jaroslav Tulach 2013-07-23 10:22:22 UTC
Y01 Use EventQueue.isDispatchThread()

Y02 I would turn the check on only if asserts are enabled.
Comment 4 Egor Ushakov 2013-07-23 12:23:14 UTC
Created attachment 137619 [details]
proposed patch 2

the new proposed patch, I also think that such exceptions has to be reported once, so StackElementArray has to appear in Utilities. Maybe it is even better to introduce Exceptions.printStackTraceOnce based on that to simplify such cases.
Comment 5 Jaroslav Havlin 2013-07-24 08:33:45 UTC
The performance team has some more advanced tool for diagnosis of I/O calls.
So this warning should not be necessary.

CCing Tomas Hurka, who could provide more information about it.

Closing for now. Thank you for understanding.
Comment 6 Egor Ushakov 2013-07-24 09:09:20 UTC
This bug was not about diagnosis, but about avoiding regressions and bad coding practice. Can advanced tools you mention prevent regressions?
Comment 7 Tomas Hurka 2013-07-25 08:55:19 UTC
(In reply to comment #6)
> Can advanced tools you mention prevent regressions?
I think so.