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 120855 - Move waitScanFinish into TestUtil
Summary: Move waitScanFinish into TestUtil
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords: T9Y
Depends on:
Blocks: 122852
  Show dependency tree
 
Reported: 2007-11-01 17:44 UTC by Andrei Badea
Modified: 2008-02-22 09:32 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Badea 2007-11-01 17:44:26 UTC
In tests I have seen SourceUtils.isScanInProgress() returning false and SU.waitScanFinished() returning successfully
when RepositoryUpdater was still scanning (proved by a task passed to JavaSource.runWhenScanFinished() not being
executed synchronously). No, this isn't caused by a stray event. See the XXX comment in EjbActionGroupTest in j2ee/ejbcore.

Please make these method behave as they used to, so that the scenario above holds.
Comment 1 Andrei Badea 2007-11-28 09:52:04 UTC
Marking as defect because this also delays JavaSource user action tasks without user feedback that there is a scan in
progress, as seen in issue 122852.
Comment 2 Jan Lahoda 2008-01-15 23:22:00 UTC
These methods are inherently unsafe (their semantics does not guarantee that the background scan does not start right
after the method returned). Moreover, waitScanFinished is deprecated. Please use runWhenScanFinished, which is a
supported method.
Comment 3 Andrei Badea 2008-01-21 13:26:31 UTC
Quoting from desc1: "proved by a task passed to JavaSource.runWhenScanFinished() not being
executed synchronously"

I'm obviously using runWhenScanFinished(). I'm also talking about tests, where I control the events and there is no way
for the Java infrastructure to start running again.
Comment 4 Jan Becicka 2008-02-14 11:43:14 UTC
Tomasi, please take a look at it. Thanks
Comment 5 Tomas Zezula 2008-02-20 18:29:27 UTC
It was actually caused by race condition the SU.wSF can caused. The method shouldn't be used in code but it may sense to create
similar barrier method in the TestUtil.
There is also call for:
TestUtil.setIndexFolder()
TestUtil.scheduleAndWait()
TestUtil.setEnableLibraries()

Even if I forgot something, it's on the Andrei's board, so he can check ;-)
Comment 6 Tomas Zezula 2008-02-21 15:58:32 UTC
Fixed: cc7257880f67
Comment 7 Andrei Badea 2008-02-22 09:32:33 UTC
> ... it's on the Andrei's board, so he can check ;-)

He has checked. Looks very good, thanks!