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 219853 - when pressing "delete" key (not backspace, the other), it deletes 2 spaces instead of 1
Summary: when pressing "delete" key (not backspace, the other), it deletes 2 spaces in...
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: JDK Problems (show other bugs)
Version: 7.2
Hardware: Macintosh (x86) Mac OS X
: P2 normal with 5 votes (vote)
Assignee: Miloslav Metelka
URL: http://bugs.sun.com/bugdatabase/view_...
Keywords:
: 212051 224544 225941 226019 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-10 19:14 UTC by lschnoller
Modified: 2014-01-30 12:05 UTC (History)
13 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Detailed logs of odd delete key behavior (554.87 KB, text/plain)
2013-02-11 09:49 UTC, hadrabap
Details
Patched org-openide-util.jar (730.74 KB, application/octet-stream)
2013-02-11 15:28 UTC, Miloslav Metelka
Details
Detailed logs with patched org-openide-util.jar (127.47 KB, text/plain)
2013-02-11 16:01 UTC, hadrabap
Details
NB Dev Log (build:2013-02-11:2300) (88.38 KB, text/plain)
2013-02-13 01:42 UTC, brettryan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lschnoller 2012-10-10 19:14:41 UTC
This error is hard to track because it happens only after opening the program and using it for a while. So, say i open netbeans and start developing. At one point, i don't know how or when, this failure starts happening without recovery until i restart the program. It affects three things:

1. the delete key (not the backspace, the one that deletes forward) starts deleting two characters at a time, instead of one.

2. after copy, it pastes the text twice, one chunk after the other.

3. when doing a cut, it doesn't paste the code at all.

This happens progamming php and javascript on a mac (note: i generally use an external keyboard, but i think the error happens using the regular keyboard as well). This is a priority 1 fix for mac users. When this happens often i have to stop and use other IDE, it becomes terribly slow and uncomfortable to use.

Thanks!

Lucas
Comment 1 Svata Dedic 2012-10-11 12:36:43 UTC
This is a really severe issue, but is not reported by other users using NB 7.2 / 7.3 on MacOSX so far.

You wrote:
> This happens progamming php and javascript on a mac (note: i generally use an
> external keyboard, but i think the error happens using the regular keyboard as
> well). This is a priority 1 fix for mac users. When this happens often i have

Could you please use the internal keyboard for a while, so we can rule out for example a HW problem on your external kbd (or some other hw-specific reasons) ?
Comment 2 Jan Becicka 2012-10-11 13:05:10 UTC
Works for me as well. I'm using cheap Genius external keyboard.
Product Version: NetBeans IDE 7.2 (Build 201207171143)
Java: 1.6.0_31; Java HotSpot(TM) 64-Bit Server VM 20.6-b01-415
System: Mac OS X version 10.8.2 running on x86_64; MacRoman; en_US (nb)
Comment 3 brettryan 2013-02-06 02:57:41 UTC
This still is a problem, I am experiencing this in NB 7.3 RC1.

I have two identically configured instances on two identical machines, one experiences the problem the other does not.

Both running OS X Mountain Lion (10.8.2) both with the same NB settings (exported and imported).

Same standard apple bluetooth keyboard on both machines. Only difference is one machine is an 2009 iMac while the other is a 2012 iMac.

I might point out that it's not the keyboard as if I remote desktop to each of the machines the behaviour remains, i.e. If I am on the machine that is giving the strange behaviour and press back-delete it deletes two characters, remote to other machine and it does not do this.


What is interesting is I need to undo twice to get both deletes back, it's not as if it was a single delete.
Comment 4 Marian Mirilovic 2013-02-06 08:27:07 UTC
(In reply to comment #3)
> This still is a problem, I am experiencing this in NB 7.3 RC1.

brettryan, thanks for a nice summary ... what JDK you use on both machines ?
Comment 5 Marian Mirilovic 2013-02-06 08:27:26 UTC
*** Bug 224544 has been marked as a duplicate of this bug. ***
Comment 6 brettryan 2013-02-06 09:36:18 UTC
Good point, turns out I haven't kept both up to date:

Machine with problem:
  java version "1.7.0_10"
  Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
  Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

Machine without problem:
  java version "1.7.0_11"
  Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
  Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

Will update JDK to same b21 on both machines and then try again with 7u13 to see if the problem still persists.
Comment 7 brettryan 2013-02-06 11:39:24 UTC
I have upgraded JDK to 7 u11 and the problem ceases to exist

  java version "1.7.0_11"
  Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
  Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
Comment 8 Marian Mirilovic 2013-02-06 12:27:45 UTC
Ok, so as it looks like JDK 7u11 works fine.

Please if you will face the same issue again, with 7u11 or newer, reopen this issue with the version of JDK & NB you used. Thanks in advance, closing as worksforme for now.
Comment 9 hadrabap 2013-02-07 13:04:17 UTC
I'm experiencing exactly the same issue here. In Java Application project.

---

Product Version: NetBeans IDE 7.2.1 (Build 201210100934)
Java: 1.7.0_13; Java HotSpot(TM) 64-Bit Server VM 23.7-b01
System: Mac OS X version 10.7.5 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/petr/Library/Application Support/NetBeans/7.2.1
Cache directory: /Users/petr/Library/Caches/NetBeans/7.2.1

---

I have never seen this problem with Apple's default 1.6 JDK. Seems to me to be JDK7 related.

My hardware configuration is the default (factory) one; no external peripherals except Magic Mouse. It should be software related problem. If you think its keyboard-related, I have to mention that I have additional kexts installed on my machine. Mainly a few kexts used by Parallels Desktop which are injecting USBs etc. But everything worked well while I have been using JDK6...

---

In up-coming days I'm about to work quite intesively with NetBeans. I'm able to install daily build and I want to help you investigating the problem. Tell me what I should do (more detailed logging, JVM snapshot, heap dumps...).

Thanks in advance.
Comment 10 Milutin Kristofic 2013-02-07 14:14:32 UTC
I added logs to editor actions.
http://hg.netbeans.org/jet-main/rev/89c3ea3ec65f

If problems prevails, please run dev netbeans with log: ./netbeans
-J-Dorg.netbeans.editor.BaseKit.level=400 

and attach logs. It is printing stacktrace. I expect to have 2 stacktraces when
problem occurs.
Comment 11 Stanislav Aubrecht 2013-02-07 15:22:11 UTC
Also please run the IDE with -J-Dorg.netbeans.core.windows.ShortcutAndMenuKeyEventProcessor.level=0 command-line switch and attach your IDE log. That switch will record every key-stroke and works in all NetBeans versions (including daily builds), thanks.
Comment 12 Marian Mirilovic 2013-02-10 06:49:30 UTC
*** Bug 225941 has been marked as a duplicate of this bug. ***
Comment 13 Marian Mirilovic 2013-02-10 06:55:35 UTC
IMPORTANT - Anybody on CC/reporters:

we are treating this bug as a stopper for NB 7.3 release. Please help us find the root-cause, so we can fix/workaround this issue into 7.3

TO-DO :
1. download latest development build 
http://bits.netbeans.org/download/trunk/nightly/latest/

2. run IDE with 
-J-Dorg.netbeans.editor.BaseKit.level=400 
-J-Dorg.netbeans.core.windows.ShortcutAndMenuKeyEventProcessor.level=0

3. attach here a log file


QUESTION :
- be specific JDK version/build number
- Does it happen only with 'DELETE' & COPY/PASTE , or you can experience the same problem with typing ?


Thanks in advance!
Comment 14 markuszeller 2013-02-10 07:44:09 UTC
On my system this problem occurs immediately - but on another machine not at all.
I am having the exact same settings used via import/export.

On my MBP, the problem is there - at any time, immediately.
Deleting key mappings did not solve it, yet.
When the DELETE key is removed from mapping, nothing happens. When put in again and mapped to delete next character, then it double kills.
Comment 15 markuszeller 2013-02-10 07:49:05 UTC
Copy & Paste works fine for me. I had the problem one, but could be solved by just rebooting the Mac, because pbcopy and pbpaste were malfunctioning!
Comment 16 markuszeller 2013-02-10 07:50:15 UTC
Here is a hint which may help you debugging the double character removal:

When I do it for the first time, the IDE log throws two lines!

WARNING [org.netbeans.modules.editor.settings.storage.keybindings.KeyMapsStorage]: The keybinding 'A-MOUSE_WHEEL_UP' in Editors/Keybindings/NetBeans/Defaults/org-netbeans-modules-editor-keybindings.xml may not work correctly on Mac. Keybindings starting with Alt or Ctrl should be coded with latin capital letters 'O' or 'D' respectively. For details see org.openide.util.Utilities.stringToKey().
WARNING [org.netbeans.modules.editor.settings.storage.keybindings.KeyMapsStorage]: The keybinding 'A-MOUSE_WHEEL_DOWN' in Editors/Keybindings/NetBeans/Defaults/org-netbeans-modules-editor-keybindings.xml may not work correctly on Mac. Keybindings starting with Alt or Ctrl should be coded with latin capital letters 'O' or 'D' respectively. For details see org.openide.util.Utilities.stringToKey().
Comment 17 markuszeller 2013-02-10 08:01:08 UTC
It is currently mapped to Zoom Text in/out.
BUT, when I clear the mapping, it comes back after leaving the preferences window!
So A-MOUSE_WHEEL_DOWN is again in that field!
Comment 18 Miloslav Metelka 2013-02-10 11:21:55 UTC
If you clear the A-MOUSE_WHEEL_DOWN it should not come back after IDE restart so there's some bug in the settings storage.

The warning itself however is not severe and it has no relation to the doubling problem. The IDE warns that A-MOUSE_WHEEL_DOWN is not specified as a platform neutral keybinding in settings but that's ok we want Alt+MouseWheelDown on all platforms so we don't use 'O' and 'D' modifiers (platform neutral modifiers).

IMHO this problem could be a variant of http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7154512 (mentioned in issue #212051 ). Not sure what all the fixes are (found just http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7154072 which looks fixed in 7u4).
Comment 19 hadrabap 2013-02-11 09:49:26 UTC
Created attachment 131230 [details]
Detailed logs of odd delete key behavior

Reproduced on:

Product Version: NetBeans IDE Dev (Build 201302082300)
Java: 1.7.0_13; Java HotSpot(TM) 64-Bit Server VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_13-b20
System: Mac OS X version 10.7.5 running on x86_64; US-ASCII; en_US (nb)
User directory: /Users/petr/Library/Application Support/NetBeans/dev
Cache directory: /Users/petr/Library/Caches/NetBeans/dev

I've added both requested additional logging parameters.

The odd delete key behavior happened in the end of my session. I just closed NetBeans and submitted the log file here.
Comment 20 Miloslav Metelka 2013-02-11 15:27:07 UTC
hadrabap thanks for the log.
There's an extra call to delete action through the ActionInvoker:
DeleteCharAction stackTrace: 
java.lang.Thread.getStackTrace(Thread.java:1567)
org.netbeans.editor.BaseKit$DeleteCharAction.actionPerformed(BaseKit.java:1767)
org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:339)
org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:93)
org.openide.util.actions.ActionInvoker$ActionRunnable.actionPerformed(ActionInvoker.java:162)
org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:109)
org.netbeans.modules.openide.actions.ActionsBridgeImpl.invokeAction(ActionsBridgeImpl.java:60)
org.openide.util.actions.ActionInvoker$ActionRunnable.doRun(ActionInvoker.java:153)
org.openide.util.actions.ActionInvoker$2.run(ActionInvoker.java:110)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2048)

We need to find out caller of ActionInvoker.invokeAction() so I've patched the method to output its parameters and callstack. I'll attach the patched org-openide-util.jar
 Could you please replace original $nbinst/netbeans/platform/lib/org-openide-util.jar with the patched one and then do "touch $nbinst/netbeans/platform/.lastModified" to rebuild all-* caches in userdir (or alternatively remove $nbuserdir/var/cache/all-* files) and start the IDE.
You can verify that patching worked by invoking "Delete" action from "Edit" menu (instead of pressing Del key) - it should output things like

INFO [org.openide.util.actions.ActionInvoker]: ...

followed by a stacktrace

java.lang.Exception
	at org.openide.util.actions.ActionInvoker.invokeAction(ActionInvoker.java:91)
	at org.openide.awt.GeneralAction$BaseDelAction.actionPerformed(GeneralAction.java:234)
...

Please try to reproduce the problem (with both the -J-D switches given earlier) and attach the log file again. Thanks.
Comment 21 Miloslav Metelka 2013-02-11 15:28:22 UTC
Created attachment 131242 [details]
Patched org-openide-util.jar
Comment 22 hadrabap 2013-02-11 16:01:37 UTC
Created attachment 131248 [details]
Detailed logs with patched org-openide-util.jar

Hi Miroslav, I'm attaching new log file. Hope it helps.
Comment 23 hadrabap 2013-02-11 16:12:48 UTC
Just to summarize and answer Your questions stated above (Comment 13).

The problem is related only to the delete key (Fn+Backspace) on my machine. The clipboard works as expected. Also other keys and keyboard shortcuts work as expected.

There is one interesting point I just found.

1. Start IDE
2. Check that Delete key deletes single character per hit
3. Invoke Edit -> Delete
4. Hit Delete key -> deletes two-times.

It seems the Delete action from the menu bar triggers this issue. Reproducible on every start and/or during long-term session.

Hope it helps.

Thanks in advance,

PETR
Comment 24 ebakke 2013-02-11 22:47:46 UTC
I just want to report that I am experiencing this issue as well. Here are the symptoms:

* I am using NetBeans 7.2.1 on MacOS 10.8.2 with Java 7 (see detailed infor below). My MacBook Air keyboard does not have a "delete" key, but I am using an external USB keyboard.
* The bug manifests itself after working in the NetBeans IDE for a while, after which it is permanent until I restart the IDE. In the past month, this has happened at least three times. (So it's pretty rare.) It is possible that it happens in response to something I do myself, but I have not been able to figure out what. I never use the "Delete" command from the "Edit" menu (which has been mentioned as a way to trigger the bug in other comments--I haven't tried it).
* The bug is: When I select a piece of text in the editor and press the delete key (on my external keyboard, since my laptop doesn't have one), the editor acts as if the key was pressed twice. So if I type in "asdf" and select "a" and press delete, the text remaining is "df".
* Once the bug has been triggered, it occurs in every editor. I can create a new plain text file and the bug will still be present in the simple text editor. So it should be unrelated to autocompletion, code folding functionality etc.

Version information:
Product Version: NetBeans IDE 7.2.1 (Build 201210100934)
Java: 1.7.0_13; Java HotSpot(TM) 64-Bit Server VM 23.7-b01
System: Mac OS X version 10.8.2 running on x86_64; US-ASCII; en_US (nb)
Comment 25 ebakke 2013-02-11 22:53:06 UTC
After restarting my IDE, I can confirm that I am able to reproduce the bug in the way described by hadrabap. The bug exhibits itself in a plain text editor when pressing Fn+Backspace (=delete) on my MacBook Air after first using the Delete command from the Edit menu and then selecting some text. In fact, under certain conditions the double delete happens even with no text selected.

Again, this is on Java 7 and NetBeans 7.2.1 (see my previous post for detailed version information).
Comment 26 Stepan Zebra 2013-02-12 12:50:04 UTC
(In reply to comment #25)
> After restarting my IDE, I can confirm that I am able to reproduce the bug in
> the way described by hadrabap. The bug exhibits itself in a plain text editor
> when pressing Fn+Backspace (=delete) on my MacBook Air after first using the
> Delete command from the Edit menu and then selecting some text. In fact, under
> certain conditions the double delete happens even with no text selected.
> 
> Again, this is on Java 7 and NetBeans 7.2.1 (see my previous post for detailed
> version information).

I can reproduce the same problem following given steps. No trouble with Copy/Paste though.

Product Version: NetBeans IDE 7.3 (Build 201302062200)
Java: 1.7.0_15; Java HotSpot(TM) 64-Bit Server VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_15-b02
System: Mac OS X version 10.8.2 running on x86_64; US-ASCII; en_US (nb)
Comment 27 Petr Jiricka 2013-02-12 15:17:55 UTC
Some time ago I hit bug 225192, which may be related. However, right now I can not reproduce.
Comment 28 markuszeller 2013-02-12 15:40:09 UTC
As far as I can see, all users having this problem are using a MacBook Pro/Air? On my iMac everything runs fine.
Comment 29 brettryan 2013-02-12 16:10:58 UTC
(In reply to comment #28)
> As far as I can see, all users having this problem are using a MacBook Pro/Air?

No, in my comment I mentioned i am using two iMacs.

I upgraded my '12 iMac from rc1 to rc2 today and now it is also exhibiting the problem.
Comment 30 Marian Mirilovic 2013-02-12 17:07:30 UTC
*** Bug 226019 has been marked as a duplicate of this bug. ***
Comment 31 hadrabap 2013-02-12 21:23:35 UTC
Hi Oracle guys!

Based on recent comments, it seems You're not able to reproduce the issue locally.

Facts:
1. There are at least three users able to reproduce (incl. myself)
2. It seems its hardware related (only users using laptops (macBook [Pro|Air]) are experiencing this issue) (Confirmation required).
3. I'm unable to reproduce the issue with any other Java-based application.
4. I'm located at Prague

Results:
Because of I'm located at Prague and I assume the NetBeans Team is located at Prague as well, I suggest anybody of You guys from NetBeans involved into this issue to contact me at my personal e-mail: hadrabap@gmail.com.

I have absolutely no problems to visit You and attend your desk (I guess its Chodov) and allow You to attach Your debugger to connect to my NetBeans instance over the net running on my laptop…

So, please, give me a contact, leave Your phone number; I'll call You back… If you're interesting… 

I'm available almost immediately… Let me know…

PETR

P.S.: Tomorrow I'm about to debug the development version…
Comment 32 Miloslav Metelka 2013-02-12 22:26:03 UTC
I'm able to reproduce the problem on a Mac of QE when using menu Edit->Delete and I've already spent considerable time debugging the problem. But I did not find a culprit code yet. The problem is the following stacktrace

	at org.openide.util.actions.ActionInvoker.invokeAction(ActionInvoker.java:91)
	at org.openide.awt.GeneralAction$BaseDelAction.actionPerformed(GeneralAction.java:234)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
	at com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:128)
	at java.awt.MenuItem.processActionEvent(MenuItem.java:669)
	at java.awt.MenuItem.processEvent(MenuItem.java:628)
	at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:351)
	at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:339)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:732)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:688)
	at java.awt.EventQueue$3.run(EventQueue.java:686)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.awt.EventQueue$4.run(EventQueue.java:702)
	at java.awt.EventQueue$4.run(EventQueue.java:700)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

The menu item gets clicked even when the menu is not active. Since it does not seem to happen on JDK 1.6 it's IMHO a JDK issue. But I understand that we must somehow resolve the problem so that it does not affect NB users.
Tomorrow I'll continue debugging and possibly patch the event queue to see how the problematic item gets added to it.
Comment 33 brettryan 2013-02-13 01:42:22 UTC
Created attachment 131331 [details]
NB Dev Log (build:2013-02-11:2300)

I can reproduce on NB Dev (2013-02-11 23:00) with the following details.

Arguments:

    -J-Dorg.netbeans.editor.BaseKit.level=400
    -J-Dorg.netbeans.core.windows.ShortcutAndMenuKeyEventProcessor.level=0

Hardware:

    2012 iMac Desktop with standard apple bluetooth keyboard. Not a laptop.

JDK:

    java version "1.7.0_13"
    Java(TM) SE Runtime Environment (build 1.7.0_13-b20)
    Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

OS:

    OS X 10.8.2
    Build 12C60

Also tested with JDK 1.7.0_11 and same result.

Steps to reproduce:

    1. Launch IDE with above parameters ensuring to use JDK 1.7
    2. Open a file and place the caret in the middle of text
    3. Press DELETE (fn+DELETE)
    4. Confirm only one character gets deleted
    5. Press CMD+Z to undo
    6. Invoke Edit > Delete with mouse
    7. Confirm only one character gets deleted
    8. Press CMD+Z to undo
    9. Press DELETE (fn+DELETE)
    10. Two characters are now being deleted.
Comment 34 Miloslav Metelka 2013-02-13 16:52:07 UTC
Observations:
Both NB 7.3 and NB 7.2.1 behave the same. The problem is reproducible on JDK 1.7 and 1.8ea but not on JDK 1.6 so this is a JDK regression though there may be something NB-specific which triggers that.

Problem can be reproduced by just clicking on "Edit" menu and clicking again on it to close it (no need to choose "Delete" menu item).

Debugging:
ScreenMenuItem calls addActionListener(this) in its addNotify() and removeActionListener(this) in its removeNotify().
 ScreenMenuItem.actionPerformed() contains the following:

    public void actionPerformed(final ActionEvent e) {
        fMenuItem.doClick(0); // This takes care of all the different events
    }

If the problem gets reproduced the addNotify() gets called but removeNotify() not.
I've tried to find out who calls EventQueue.postEvent(AWTEvent) with the ActionEvent but it comes from SunToolkit.flushPendingEvents() so I've ceased that way for now and I'll try instead to compare the calls for other menu items in the Edit menu that obviously do not get trigerred twice.
Comment 35 Marian Mirilovic 2013-02-13 17:01:25 UTC
Ok, removing this bug from the list of stoppers for 7.3 - as we do not have a fix yet & it isn't regression in NB 7.3 itself, I propose to not hold NB 7.3 and:
- find out whether it's and JDK bug, if so we need to report to JDK team and escalate
- if not we need to find out workaround and we can release that as a part of NB 7.3 Patch 1 (2nd half of March)
Comment 36 Miloslav Metelka 2013-02-14 09:52:52 UTC
Ok.
Some more observations:
It seems that the problem is related to "Delete" key being part of a shortcut. Besides "Delete" itself the problem may be reproduced in the same way with "Control+Delete" and "Command+Delete". So if I bind other actions under the Edit menu to one of these shortcut they start to show the same bad behavior.
For some reason "Alt+Delete" works fine.
Comment 37 Tomas Hurka 2013-02-14 14:23:58 UTC
It looks like it is a JDK bug. I have a test case, which uses just Swing to reproduce the problem. I will file JDK bug tomorrow.
Comment 38 Tomas Hurka 2013-02-14 14:27:24 UTC
Note that JDK 6 works fine, so the workaround is to run NetBeans on JDK 6.
Comment 39 Tomas Hurka 2013-02-18 09:03:44 UTC
JDK bug #8008366 <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8008366> was filed for this issue.
Comment 40 Miloslav Metelka 2013-02-18 10:17:54 UTC
For those who would still require JDK 1.7 for some reason I've made a possible workaround for the problem - ignoring all invocations of delete-char-action in editor from menu.
 The delete action will work normally when invoked by keyboard in the editor. When invoked from menu (either by user or as a false invocation by the JDK bug) the action will do nothing.
 For the workaround to work it's necessary to run NB with the following option (possibly see http://wiki.netbeans.org/FaqStartupParameters or http://wiki.netbeans.org/FaqNetbeansConf):

-J-Dnetbeans.editor.disable.delete.from.screen.menu=true

This workaround will be present in Dev builds only.
http://hg.netbeans.org/jet-main/rev/e62044c35fe8
Comment 41 djs 2013-02-20 00:08:05 UTC
For what it's worth I clicked help and update and the problems seems to have gone away.
Comment 42 Quality Engineering 2013-02-20 05:26:39 UTC
Integrated into 'main-golden', will be available in build *201302192300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e62044c35fe8
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #219853 - when pressing "delete" key (not backspace, the other), it deletes 2 spaces instead of 1 - possible workaround by disabling delete from edit menu.
Comment 43 markuszeller 2013-02-20 07:56:39 UTC
(In reply to comment #41)
> For what it's worth I clicked help and update and the problems seems to have
> gone away.

Where did you select Help / Update? The Netbeans IDE says, there is no.
Comment 44 markuszeller 2013-02-20 08:09:47 UTC
(In reply to comment #43)
> (In reply to comment #41)
> > For what it's worth I clicked help and update and the problems seems to have
> > gone away.
> 
> Where did you select Help / Update? The Netbeans IDE says, there is no.

Java 7 Update 15 solved the issue for me, too!!!
Yeah! Happy coding, again!
Comment 45 brettryan 2013-02-25 02:55:44 UTC
I have upgraded to NB 7.3 final and JDK 1.7.0_15 and the problem has now returned.

Product Version: NetBeans IDE 7.3 (Build 201302132200)
Java: 1.7.0_15; Java HotSpot(TM) 64-Bit Server VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_15-b03
System: Mac OS X version 10.8.2 running on x86_64; US-ASCII; en_AU (nb)
User directory: /Users/bryan/Library/Application Support/NetBeans/7.3
Cache directory: /Users/bryan/Library/Caches/NetBeans/7.3
Comment 46 markuszeller 2013-02-25 07:08:30 UTC
I had the same and was able to solve it doing following.

Close NB 7.3

Delete contents of
~/Library/Application Support/Netbeans/7.3/

Move contents of
~/Library/Application Support/Netbeans/7.3rc2/
into
~/Library/Application Support/Netbeans/7.3/

Start NB 7.3 again. Voila.
Comment 47 brettryan 2013-02-25 07:13:23 UTC
(In reply to comment #46)
> I had the same and was able to solve it doing following.
> 
> Close NB 7.3
> 
> Delete contents of
> ~/Library/Application Support/Netbeans/7.3/
> 
> Move contents of
> ~/Library/Application Support/Netbeans/7.3rc2/
> into
> ~/Library/Application Support/Netbeans/7.3/
> 
> Start NB 7.3 again. Voila.

What is the specific change that is being copied? I always delete my dev profile when I no longer need it so can not perform this action.
Comment 48 markuszeller 2013-02-25 07:19:31 UTC
Sorry, I can not tell you, because I copied the entire folder contents. I did this because I do not want to install all plugins again and do not want to lose editors history and keyrings.

May you can try exporting the settings and re-import into final via the Preferences menu.
Comment 49 Tomas Hurka 2013-02-25 08:02:02 UTC
(In reply to comment #45)
> I have upgraded to NB 7.3 final and JDK 1.7.0_15 and the problem has now
> returned.
This is a bug in JDK, which is not yet fixed. It will not be fixed in NetBeans.
Comment 50 Marian Mirilovic 2013-03-06 17:35:09 UTC
Reporters,
could some of you test new Development build and confirm the switch disables "Edit|Delete" main menu item ? If so and you haven't faced any other related problem, we will include this workaround into NB 7.3 Patch 1 (GA March/21 2013). Thanks in advance!
Comment 51 sishbi 2013-03-07 16:39:15 UTC
Still present on JDK 1.7 u17 and NB 7.3
Note: modifying keymap to clear 'delete previous character' reduces the impact of the issue.
Comment 52 Tomas Danek 2013-03-11 15:41:32 UTC
Fix does not work on my Mac, debugging shows that 
evt.getSource() instanceof java.awt.MenuItem
is false. Changing to 
evt.getSource() instanceof javax.swing.JMenuItem
makes fix work.


(In reply to comment #40)
> For those who would still require JDK 1.7 for some reason I've made a possible
> workaround for the problem - ignoring all invocations of delete-char-action in
> editor from menu.
>  The delete action will work normally when invoked by keyboard in the editor.
> When invoked from menu (either by user or as a false invocation by the JDK bug)
> the action will do nothing.
>  For the workaround to work it's necessary to run NB with the following option
> (possibly see http://wiki.netbeans.org/FaqStartupParameters or
> http://wiki.netbeans.org/FaqNetbeansConf):
> 
> -J-Dnetbeans.editor.disable.delete.from.screen.menu=true
> 
> This workaround will be present in Dev builds only.
> http://hg.netbeans.org/jet-main/rev/e62044c35fe8
Comment 53 Miloslav Metelka 2013-03-12 12:06:26 UTC
http://hg.netbeans.org/jet-main/rev/2c21fe2d19b2
Comment 54 Tomas Danek 2013-03-13 09:12:57 UTC
I've put changeset into my custom build and it works; delete action from menu is ignored.
Comment 55 Miloslav Metelka 2013-03-13 13:58:47 UTC
In release73 (for patch1):
e62044c35fe8 transplanted to d96c5facc750
2c21fe2d19b2 transplanted to 861e8c8ea544
Comment 56 Quality Engineering 2013-03-14 02:08:58 UTC
Integrated into 'main-golden', will be available in build *201303132300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/2c21fe2d19b2
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #219853 - when pressing "delete" key (not backspace, the other), it deletes 2 spaces instead of 1 - additional fix.
Comment 57 sishbi 2013-03-14 10:35:01 UTC
Verified in NetBeans build 201303132300 - when will this be made available in non-dev build?
7.3 sr1 ?
Comment 58 Quality Engineering 2013-03-14 21:16:23 UTC
Integrated into 'releases', will be available in build *201303141828* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/d96c5facc750
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #219853 - when pressing "delete" key (not backspace, the other), it deletes 2 spaces instead of 1 - possible workaround by disabling delete from edit menu.
(transplanted from e62044c35fe89ae551bfe3fbb297ab625aaad122)
Comment 59 sishbi 2013-03-21 14:56:55 UTC
This is still occurring on Dev Build 201303132300.
I can reproduce it with the following steps:
1. Choose 'Delete Next Character' from the Edit Menu
2. Type the 'Delete' key
3. 2 characters are deleted every time.

I can see in the Preferences->Keymap that the 'Delete Next Character' item (from the Edit menu) is mapped to the Delete key but I would not expect to have to use a menu item to delete the next character when making normal edits.
Also if the Delete key is unmapped from that menu item then you cannot use the Delete key at all!

Any other suggestions for a work-around / solution?
Comment 60 franciscodiaztrepat 2013-04-24 13:30:51 UTC
Still happening, I don't need to do anything to reproduce it. it is always like this.

Product Version: NetBeans IDE 7.3 (Build 201302132200)
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b12
System: Mac OS X version 10.8.3 running on x86_64; US-ASCII; en_US (nb)
User directory: /Users/franciscotrepat/Library/Application Support/NetBeans/7.3
Cache directory: /Users/franciscotrepat/Library/Caches/NetBeans/7.3
Comment 61 ebakke 2013-04-25 16:50:04 UTC
Still happening on 201304242301 on MacOS Java 1.7.0_21.
Comment 62 David Strupl 2013-06-20 12:22:21 UTC
As already noted the bug must be fixed in JDK.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8008366
Unfortunately the fix is for 7u40 so we will have to still wait. It cannot be fully fixed on NetBeans side. Meanwhile please use the
-J-Dnetbeans.editor.disable.delete.from.screen.menu=true
in etc/netbeans.conf to disable the delete from the main menu. Please don't reopen this bug unless you will get it on JDK 7u40 or later.
Comment 63 David Strupl 2013-06-20 12:24:11 UTC
*** Bug 212051 has been marked as a duplicate of this bug. ***
Comment 64 heimburg 2013-11-21 05:56:15 UTC
Apologies if I'm missing something, but is the workaround not available in Netbeans 7.4? I can't get the parameter mentioned below (-J-Dnetbeans.editor.disable.delete.from.screen.menu=true) to do anything, either from the command-line or netbeans.conf, in build 201310111528.

If the work-around is only in NB 7.3, can I request it be added to 7.4, as it looks like this bug will never be fixed for any version of Java 7 (as the status is Fixed only for Java 8)? 

(And even if I'm misunderstanding the status line and it's actually been fixed in 7u40 or 7u45, those builds are not usable for NB development on MacOS because of NB bug #236101. To avoid persistent lock-ups of the IDE, we're stuck using 7u25.)
Comment 65 Antonin Nebuzelsky 2013-11-21 09:24:53 UTC
That's a question for Mila. Reassigning.
Comment 66 isuftin 2014-01-17 14:49:43 UTC
Still showing up on NetBeans 7.4 and Java 1.7u25-b15
Comment 67 pamelus 2014-01-30 12:05:57 UTC
On NetBeans7.4 Build 201310111528 and Java 1.7.0_25-b15 Miloslav's workaround (-J-Dnetbeans.editor.disable.delete.from.screen.menu=true added to netbeans_default_options in netbeans.conf) works as expected and fixes this issue.