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 - Give warning when accessing file system from EDT
Summary: Give warning when accessing file system from EDT
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Egor Ushakov
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 218138
  Show dependency tree
 
Reported: 2012-10-17 15:12 UTC by Egor Ushakov
Modified: 2013-07-25 08:55 UTC (History)
5 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
proposed patch for FileUtil.normalizeFileImpl (1.04 KB, patch)
2012-10-22 13:08 UTC, Egor Ushakov
Details | Diff
proposed patch 2 (6.89 KB, patch)
2013-07-23 12:23 UTC, Egor Ushakov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.