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 198307

Summary: UserTask is not run in some circumstances.
Product: editor Reporter: Petr Pisl <ppisl>
Component: Parsing & IndexingAssignee: Tomas Zezula <tzezula>
Status: VERIFIED FIXED    
Severity: normal CC: mmirilovic
Priority: P1    
Version: 7.0   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 197887    
Attachments: PHPCTF.diff

Description Petr Pisl 2011-05-04 09:16:14 UTC
PHP templates are applied according the context. For this reason the PHPCodeTemplateFilter should have uptodate parse result and run an UserTask to find the context. The PHPCodeTemplateFilter should wait for the result of UserTask, but the user task is not returned due to a deadlock in Parsing API.
Comment 1 Tomas Zezula 2011-05-04 09:51:16 UTC
The reason is that PHP submits twice the UT (PHPCodeTeplateFilter) into runWhenScanFInished one by CC second by teb expansion. The CC thread locked the infrastructure and wait until the rWSF is done but it cannot complete as it waits on the end of CC.
Comment 2 Tomas Zezula 2011-05-04 11:13:16 UTC
Fixed jet-main http://hg.netbeans.org/jet-main/rev/b1f1ea0ec50c
Comment 3 Tomas Zezula 2011-05-04 11:15:48 UTC
Don't forgot to fix the PHPCodeTemplateFilter to use the Future<Future<Void>> :-)
See attached diff, only the future.get(),get() should be changed to:
try {
    future.get(TIMEOUT,TU.MS).get(TIMEOUT,TU.MS)
} catch (TimeoutException te) {
}
Comment 4 Tomas Zezula 2011-05-04 11:16:17 UTC
Created attachment 108099 [details]
PHPCTF.diff
Comment 5 Petr Pisl 2011-05-04 12:58:27 UTC
Thanks to Tomas for the quick fix.
Comment 6 Tomas Zezula 2011-05-04 13:08:52 UTC
:-)
Comment 7 Marian Mirilovic 2011-05-04 15:13:07 UTC
This issue is connected with issue 197887 (P1) ... so Petr, would you mind to fix it into 7.0 Patch 1 ?
Comment 8 Petr Pisl 2011-05-04 15:32:51 UTC
Yes, it would be good to have it in the patch. Without this, the fix for issue #197887 doesn't work.
Comment 9 Tomas Zezula 2011-05-04 17:02:47 UTC
Unfortunately the fix is even more complicated.
Some refactoring unit tests are failing as they expect that parseWhenScanFinished do ordering, this is not stated in the javadoc, but semantic of the method does it. So there can be clients which relay on it as the refactoring unit test.
I have changed the fix.
Comment 10 Tomas Zezula 2011-05-04 17:08:01 UTC
Fixed jet-main http://hg.netbeans.org/jet-main/rev/d2c12aa34466
Comment 11 Quality Engineering 2011-05-05 06:13:18 UTC
Integrated into 'main-golden', will be available in build *201105050000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/b1f1ea0ec50c
User: Tomas Zezula <tzezula@netbeans.org>
Log: #198307:UserTask is not run in some circumstances
Comment 12 Tomas Zezula 2011-05-16 16:35:05 UTC
For the list of included fixed bugs please check http://wiki.netbeans.org/NetBeans70PatchesInfo