Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 220294 - Give warning when accessing file system from EDT
Give warning when accessing file system from EDT
Product: platform
Classification: Unclassified
Component: Filesystems
All All
: P3 (vote)
Assigned To: Egor Ushakov
Depends on:
Blocks: 218138
  Show dependency treegraph
Reported: 2012-10-17 15:12 UTC by Egor Ushakov
Modified: 2013-07-25 08:55 UTC (History)
5 users (show)

See Also:

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:

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.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo