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 119430 - Editor loses focus following light bulb action
Summary: Editor loses focus following light bulb action
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: Macintosh (x86) Mac OS X
: P3 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-19 03:58 UTC by j0ni
Modified: 2008-03-27 15:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
focus-patch.jar (30.67 KB, application/octet-stream)
2007-10-22 15:18 UTC, Jan Pokorsky
Details
patch logging to messages.log (31.92 KB, application/octet-stream)
2007-11-01 20:27 UTC, Jan Pokorsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description j0ni 2007-10-19 03:58:07 UTC
The editor loses focus and will not accept focus after I click on a lightbulb suggested action. The only way I have
found to restore focus in the editor is to close the file I modified and re-open it. As soon as the file is closed,
focus is restored to one of the other open file windows. While the modified file is open, focus is not available in any
editor session.

The following steps should reproduce the issue:

1. Create a new Java application project.
2. Type "throw new IOException();" in the main method
3. Click lightbulb and accept "add import for IOException"
4. Focus is lost

This is my system and build:

Product Version: NetBeans IDE Dev (Build 200710180000)
Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-87
System: Mac OS X version 10.4.10 running on i386; MacRoman; en_US (nb)
Comment 1 j0ni 2007-10-19 04:05:05 UTC
Incidentally, I cannot reproduce this in the Beta 1 build, only the various nightlies I have used since Beta 1. As you
will see from the description below, this is recorded against 2007-10-18's build. (Just for maximum clarity :))
Comment 2 Jan Lahoda 2007-10-19 09:22:01 UTC
Honzo, seems like an another occurrence of issue #65326 - would you have time to test it? Thanks.
Comment 3 Jan Pokorsky 2007-10-19 09:57:20 UTC
It is a focus bug of popup menu in Apple's java. You should filed it to their bug tracking system first.

I have put some workaround in editor hints ui already and it seemed to work. I will investigate next week since I do not
have access to any Mac now.

As a workaround to avoid this do not use mouse for hints for now.
Comment 4 j0ni 2007-10-19 16:38:55 UTC
@jpokorsky thanks for the suggestions. I'm puzzled by why it would show up in recent builds but not in beta 1, at least
in the same places. I had it occur when I followed another lightbulb menu item and had NB 6 beta 1 create a method in
another class, but it doesn't happen anywhere near as frequently.

I'd be happy to file a bug with apple - can you characterize it in a bit more detail? I will give the NB build as an
example, but I suspect you have a much clearer idea of how Apple's Java is failing here.

Thanks.
Comment 5 j0ni 2007-10-19 16:44:43 UTC
@jlahoda I agree with the comment:

------- Additional comments from jportway Sun Feb 25 15:40:30 +0000 2007 -------

on issue #65326. That comment describes the problem I'm having and my workaround. What would you like me to test? I have
determined that I cannot regain focus by clicking in the project tree and then back in the editor--someone else
suggested that a while ago.
Comment 6 Jan Pokorsky 2007-10-22 15:16:52 UTC
I have been trying to reproduce with the same configuration

Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-87
System: Mac OS X version 10.4.10 running on i386; MacRoman; en_US (nb)

using build 200710180000 and 20071022 and it works for me.

Can you reproduce it reliably?

If yes please try to place the following patch focus-patch.jar to
{nb.install.dir}/ide8/modules/patches/org-netbeans-spi-editor-hints, run the IDE in console and attach the output here.
Comment 7 Jan Pokorsky 2007-10-22 15:18:58 UTC
Created attachment 51414 [details]
focus-patch.jar
Comment 8 Jan Pokorsky 2007-11-01 20:22:59 UTC
I will add a new patch that logs messages to {nb.userdir}/var/log/messages.log
Comment 9 Jan Pokorsky 2007-11-01 20:27:38 UTC
Created attachment 52304 [details]
patch logging to messages.log
Comment 10 j0ni 2007-11-01 22:12:31 UTC
@jpokorsky

I'm not seeing this any more since upgrading to beta 2. I also upgraded my OS to Leopard at the weekend, so NB is now running under the build 1.5 release 
13 that ships with that. Again, no sign of this bug now.
Comment 11 Jan Pokorsky 2008-03-27 15:22:22 UTC
Closing as WORKSFORME.