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 60459 - Code completion does not work with Mustang
Summary: Code completion does not work with Mustang
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P1 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords: JDK_SPECIFIC
: 60171 60378 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-06-23 17:40 UTC by giorgio42
Modified: 2007-11-05 13:38 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description giorgio42 2005-06-23 17:40:17 UTC
Using the latest qbuild 200506211800 when I press the . or at other occasions
when the code completion should appear, either nothing happens or the window
comes up very shortly, then disappears again.
Comment 1 _ alexlamsl 2005-06-27 21:19:25 UTC
Same here - with qbuild 200506211800 or 200506231800 and Mustang b41!!!

Help~ ><"
Comment 2 Milan Kubec 2005-06-28 08:37:36 UTC
Yes, CC is completly unusable on recent Mustang builds. Sometimes after pressing
Ctrl+Enter only Javadoc window is shown. It seems that after invoking CC the
editor (or even whole IDE) looses focus.

Please Dusan could you take a look at it and provide some evaluation. Thanks.
Comment 3 Miloslav Metelka 2005-06-28 18:55:50 UTC
I was just testing on RH Linux on b42. No apparent problems encountered.
On what OS are you testing? Could you please test with b42 as well? Thanks.
Comment 4 Milan Kubec 2005-06-29 08:27:13 UTC
Just tried JDK 6.0 b42 on dev-200506281800 on Win XP and it really doesn't work
at all.
Comment 5 Martin Roskanin 2005-06-29 09:07:20 UTC
*** Issue 60171 has been marked as a duplicate of this issue. ***
Comment 6 _ alexlamsl 2005-06-29 12:02:44 UTC
I was using b41 on WinXP as well - have exactly the same problems as the first 
comment described
Comment 7 Roman Strobl 2005-07-02 18:07:20 UTC
As far as I know, this bug occurs only on Windows OS.
Comment 8 pzgyuanf 2005-07-03 08:25:00 UTC
jdk1.5.0_04 on windows2000 either.
Comment 9 _ alexlamsl 2005-07-03 11:12:29 UTC
Hmmm - a different Windows Platform with a JDK of standard release quality.

That breaks the pattern that we have build up so far doesn't it? ^^"

BTW, since none of the Mustang releases works I'm now using jdk1.5.0_04 on 
WinXP.
Comment 10 Roman Strobl 2005-07-03 17:50:34 UTC
I didn't encounter this bug on Linux or Solaris, that's why I think it's
Windows-OS specific. We have changed code completion's window into a pop-up
window. The advantage is that you can display code completion even if it's
bigger than the editor (e.g. in situations it's close to the borders of IDE.).
Dusane or Milo, can you investigate why it happens and if we cannot avoid this
behaviour, we should file it as a JDK bug. Thanks!
Comment 11 _ alexlamsl 2005-07-04 01:49:49 UTC
agree - I am just surprised why that would happen to jdk1.5.0_04 at all~

preliminary evidence ---> problem with the latest Mustang builds

the last one with jdk1.5.0_04 on Win2K <----- ?!?!?!?!
Comment 12 Roman Strobl 2005-07-07 12:48:41 UTC
*** Issue 60378 has been marked as a duplicate of this issue. ***
Comment 13 Martin Roskanin 2005-07-12 12:48:05 UTC
It seems it is problem of JDK.

javax.swing.Popup will receive a focus after popup showing. It will cause a
focusLost event to be fired on JEditorPane. The listener is attaching in
CompletionImpl. In Completionimpl.focusLost the hideAll() action is called.
So now it works as follows:
1. completion is computed and shown in javax.swing.Popup.
2. Popup will receive the focus - JDK 1.6 issue, regression from JDK1.5
3. focus is lost in JEditorPane and completion is closed

I have already entered the issue against JDK 1.6
After accepting I will close this one as WONTFIX, as I do not see a workaround.
Comment 14 Roman Strobl 2005-07-13 10:28:33 UTC
Mato, what is the number of the JDK bug? The solution for the case that JDK team
won't be able to fix it in JDK 6 is to use the old, lighter pop-up. We'll need
to communicate with JDK team to find out if they can fix this in time.
Comment 15 Martin Roskanin 2005-07-13 10:32:53 UTC
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6295914
(It may take a day or two before the bug shows up in external database)
Comment 16 Miloslav Metelka 2005-08-29 16:59:50 UTC
IMHO we should try to parent to pane and examine the focusLost() events and
attempt to match them to opened popup(s) - there may be up to three possible
ones - completion,doc and tip popups. The PopupFactory does not give access to
the actual component being constructed but I hope that the content component's
parent i.e. contents.getParent() should work and could be checked in
focusEvent.getOppositeComponent() or possibly use
SwingUtilities.findFocusOwner(pane).
Comment 17 giorgio42 2005-08-29 18:02:10 UTC
I am testing with the daily build from 28.8. and jdk1.6.0, b48, and code
completion seems to work now.

Cheers
Georg
Comment 18 Miloslav Metelka 2005-09-05 10:51:12 UTC
Romane, could you please check whether this works on b49 on XP and I'll then
close the issue. Thanks.
Comment 19 Roman Strobl 2005-09-05 12:57:36 UTC
It works with b49, marking issue as fixed. Feel free to reopen if it won't work
on this build or any newer.
Comment 20 Roman Strobl 2005-10-26 20:52:32 UTC
Verified.