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.
I'm making this P1, because this has happened to me several times in the past few months, and thought it may due to retouche changes and may require some time to stabilize. But is still there and very annoying. This is how it happens to me - type the variable and then "." to get the code completion dialog. - Then double click on the method (mostly some static method) you want. Nothing happens. I mean the method name was not appended to after the "." Now the editor has gone readonly (but no indicator) in the tab title. Close and open the Java file again. Still the file is read only and can not edit. Close the project and reopen the project, and open the Java file. Now the file is editable. Note this is not always reproducible.
OK, we are able to reproduce it on Mac. Just after start of NB. Selecting an item in CC with double-click moves the focus out of the editor. Workaround, which worked for us was to open some dialog and then go back to editor. It will gain the focus again. We are looking into it. For now it looks like a Mac JDK focus specific problem.
Also please notice that there is another issue which may have similar symptoms. See #89893.
Another similar issue is issue 65326
Steps: 1) Restart IDE with a source already opened. 2) Invoke completion automatically e.g. type "s." after "String s; ". 3) First invocation typically only shows the completion for a short time and closes automagically. I guess it might be because of CompletionImpl:517 if the keyevents would arrive in a strange manner. 4) Next attempts to press Ctrl-SPACE do not do anything. Only switching to another component or external app and back restores normal behavior. 5) Ctrl-SPACE; double-click CASE_INSENSITIVE_ORDER static field; caret stops blinking in the editor. 6) Focus is in Project Configurations combobox. Pressing down arrow opens the listbox with configurations. 7) If the Build toolbar gets hidden the focus is broken. From the opposite component in the focus event it seems that the focus is in the popup itself (it's a panel inside a layered pane in a root pane of a main window). That popup is however no longer visible. Strange. The problem can be reproduced even when allowing the popups (completion and javadoc) to be focusable (currently they are parented to editor pane but they are non-focusable). Disabling the hideAll() code in CompletionImpl.mouseClicked() does not help either (the popups get closed by JavaCompletionItem.defaultAction() which calls hideCompletion() and hideDocumentation()). Simple requesting of the focus to the editor pane does not help. I remember that in early Swing times it was necessary to first request a focus into corresponding frame and then into the component itself. We should possibly try that. We should also try to first request focus into the editor pane and then close the popup whether that does not make any difference.
I've tried the mentioned things but it did not help to resolve the problem. BTW there appears to be no focusLost() sent when popup has a focus and I click into the explorer tab. Strange. It's probably just related to using j.s.Popup but it in fact prevents us from closing the completion popup automatically when clicking to another component within the IDE. I'll try few more things. IMHO this is not a P1 since switching to another app and back should resolve the problem. Reassigning to editor since this is a non-java specific problem.
Should be fixed together with #96717.