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 267224

Summary: Code Assistance submenu UI issue
Product: cnd Reporter: ilia
Component: -- Other --Assignee: ilia
Status: REOPENED ---    
Severity: normal CC: creinke, kosmonaffft
Priority: P3    
Version: 8.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Bug appearance - type 1
Bug appearance - type 2
UI snapshot

Description ilia 2016-07-20 10:30:48 UTC
Code Assistance context menu -> expand submenu: items "Configure Code Assistance" and "Failed Directives" are not selectable/ invisible sometimes.
Comment 1 ilia 2016-07-28 10:29:19 UTC
Created attachment 161480 [details]
Bug appearance - type 1
Comment 2 ilia 2016-07-28 10:29:47 UTC
Created attachment 161481 [details]
Bug appearance - type 2
Comment 3 ilia 2016-07-28 10:30:45 UTC
Fixed in:
  https://hg.netbeans.org/cnd-main/rev/53a5ebc46f3a

Removed lazy initialization (no notable profit from lazy initialization were found for this specific case). 

I did an investigation for this problem, however, even with investigation I don't understand the real cause of this issue.

The problem is appearing in Java cluster too (See attachments [1] and [2]).

[1] Bug appearance - type 1
[2] Bug appearance - type 2
Comment 4 ilia 2016-07-28 10:34:47 UTC
Created attachment 161482 [details]
UI snapshot
Comment 5 ilia 2016-07-28 11:40:50 UTC
Investigation:

I've investigated both Java part (Open Required Projects submenu) and CND part (Code Assistance submenu). Results are identical. The only difference: if Java menu is stuck, all JMenuItems are stuck. If CND menu is stuck, only Node.Presenters are stuck, other JMenuItems are OK (Code assistance submenu consists from basic JMenuItems and presenters (Actions$MenuItem).

-------------

I attached a debugger and made an UI screenshot. The results are interesting (see a screenshot [3]:

When the bug appears (no difference if it's a case 1 or 2) the bounds of a glitchy JMenuItems are [x=0, y=0, width=0, height=0].
When submenu is created all items have zero bounds, because they are invisible yet.

So i traced the moment of bounds change for a glitchy menu item (Configure code assistance) in hope that i'll see a moment when bounds are set to 0.

Breakpoint:
  Component:223 (field "x"). Modification only.
Breakpoint Condition: getText().startsWith("Configure")

Result: I don't see someone changes size to [x=0, y=0, width=0, height=0].
So, seems item doesn't change size after created.

-------------------

This issue seems so appear when class AAA extends JMenu and overrides getPopupMenu() method.
Comment 6 Quality Engineering 2016-08-02 01:58:27 UTC
Integrated into 'main-silver', will be available in build *201608020002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/53a5ebc46f3a
User: Ilia Gromov <ilia@netbeans.org>
Log: Fixed #267224 - Code Assistance submenu UI issue
Comment 7 Alexander Simon 2016-09-01 07:15:29 UTC
The menu behavior is worse then was.
Previous:
- sometimes menu is not accessible. It is not big deal - invoke again.
Now:
- sometimes menu has wrong content and user can invoke wrong menu item.
For example: content menu may show "not checked code assistance" for project with enabled code assistance.

Please rollback the fix or provide additional fix.
Comment 8 Vladimir Kvashin 2016-09-13 12:16:18 UTC
Ilia, are you going to backout changes? We are getting close to RC1, 
please either do this ASAP or ask someone other does this.
Comment 10 Alexander Simon 2016-09-20 14:36:32 UTC
Rollback was transplanted to releases, branch release82, change set:
http://hg.netbeans.org/releases/rev/ef1fc6f24729
Comment 11 Alexander Simon 2016-09-20 14:37:28 UTC
downgrade priority
Comment 12 Alexander Simon 2016-10-03 18:45:57 UTC
*** Bug 268327 has been marked as a duplicate of this bug. ***
Comment 13 Alexander Simon 2016-10-09 17:00:13 UTC
*** Bug 232861 has been marked as a duplicate of this bug. ***