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.
Created attachment 162856 [details] Fragment of code when Netbeans hangs up To reproduce the bug: 1) Type comment next to the foreach loop: /* @var $x {class_name} 2) hit ENTER when first hint appears 3) Netbeans hangs up and doesn't respond to any key Full 1 processor thread is taken. Only killing netbeans process can help (you can wait forever and nothing happens). It was reproduced at least 3 times in a row.
Please, create a thread dump [1] once this problem occurs. Also, it is always a good idea to attach the IDE log [2] (again, once the problem occurs, of course). BTW if the IDE is just "busy" (and not frozen) it would be great if you could create and attach a profiler snapshot [3] (start profiling, reproduce problem, stop profiling). Simply reopen this issue, thanks. [1] http://wiki.netbeans.org/GenerateThreadDump [2] http://wiki.netbeans.org/FaqLogMessagesFile [3] http://wiki.netbeans.org/FaqProfileMeNow
Created attachment 162862 [details] Thread dump log
Created attachment 162863 [details] Netbeans log
I've attached log files. Hope it helps resolve the issue.
(In reply to malmsteenforce from comment #4) > I've attached log files. Hope it helps resolve the issue. Thank you! It's reproducible with the following code: <?php class Example { } $closure = (static function ($examples) { $i = 0; foreach ($examples as $example) { /* @var $example Exa $i++; ?> <?php } }); ?> It seems that if there is no closing tag for the comment, an infinite loop occurs. I'll try looking at it. Just a workaround: First of all, please write a closing tag (*/). You can also use a useful code template. Please try the following steps: 1. type "vdoc" 2. push the TAB key soon 3. a code template is added 4. you can move to a variable name and a class name if you push the TAB e.g. foreach ($examples as $example) { vdoc[TAB] $i++; -> foreach ($examples as $example) { /* @var $example ClassName */ $i++; Thanks.
Created attachment 162899 [details] proposed patch Tests were passed even if the fix is not applied when I created tests first. The cause is the caret position for GSFParser. So I added the setUnitTestCaretPosition method (public static) to it.(I used the same way as TokenFormatter.) But I'm not sure whether this is proper. Tomas, what do you think? Thanks.
(In reply to junichi11 from comment #6) > Tomas, what do you think? Seems fine to me. Perhaps remove the "public" modifier from the method, if possible. Thanks!
Created attachment 162904 [details] proposed patch v2 (In reply to Tomas Mysik from comment #7) > Seems fine to me. Perhaps remove the "public" modifier from the method, if > possible. Thanks a lot for your answer! I was worried about that. I improved a bit to not use it in the source package. First, removed the "public" modifier, then created a utility class(GSFPHPParserTestUtil) for the GSFPHPParser class in the unit test package. If you are OK, I can push the fix tomorrow. Thanks!
Patch seems fine to me. Thanks a lot!
Great to hear. Thanks!
Fixed. http://hg.netbeans.org/web-main/rev/963ae780203c I have changed a patch a bit because IllegalAccessError occurred in PHPFormatterQATest. (Set -1 not in tearDown() but at the end of the test method.) Thanks!
Thanks a lot, Junichi!
You are welcome:)
Integrated into 'main-silver', will be available in build *201611160001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/963ae780203c User: Junichi Yamamoto <junichi11@netbeans.org> Log: #268920 - Netbeans hangs up when hitting autocomplete