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

Summary: Move waitScanFinish into TestUtil
Product: java Reporter: Andrei Badea <abadea>
Component: SourceAssignee: Tomas Zezula <tzezula>
Status: VERIFIED FIXED    
Severity: blocker Keywords: T9Y
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 122852    

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!