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 212051 - DELETE shortcut on mac deletes two chars instead of one
Summary: DELETE shortcut on mac deletes two chars instead of one
Status: RESOLVED DUPLICATE of bug 219853
Alias: None
Product: editor
Classification: Unclassified
Component: Actions/Menu/Toolbar (show other bugs)
Version: 7.1.2
Hardware: Macintosh Mac OS X
: P2 normal with 3 votes (vote)
Assignee: Miloslav Metelka
URL: http://bugs.sun.com/bugdatabase/view_...
Keywords: JDK_SPECIFIC
: 212741 215810 241794 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-04 04:37 UTC by n4tcv
Modified: 2014-02-13 10:11 UTC (History)
9 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 n4tcv 2012-05-04 04:37:41 UTC
Product Version = NetBeans IDE 7.1.2 (Build 201204101705)
Operating System = Mac OS X version 10.7.3 running on x86_64
Java; VM; Vendor = 1.7.0_04
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.0-b21
Comment 1 Tomas Danek 2012-05-09 09:39:37 UTC
I assume you are not able to reproduce right after IDE start (but after a while of working with it),  are you?

I think we are dealing here with JDK bug:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7154512

If you have any clues how to reproduce problem, please share them.
Comment 2 Jaroslav Tulach 2012-05-17 09:32:38 UTC
I don't have Mac, so I am not the right one to investigate the problem. Anyway you are likely talking about copy and paste in editor, right?
Comment 3 David Strupl 2012-05-18 08:39:57 UTC
I am on mac. Just tried with 7u4. Works for me.
Comment 4 viretp 2012-05-18 19:16:44 UTC
I have the same problem. I'm on mac using jdk 1.7.0_04 and NetBeans IDE 7.1.2. That's really very annoying...
Comment 5 Miloslav Metelka 2012-05-22 08:23:43 UTC
This seems like JDK issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7154512 very likely (related issue is http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7154072 ). We should wait for a JDK update to check whether the issue gets resolved.
Comment 6 Miloslav Metelka 2012-05-24 10:48:50 UTC
*** Bug 212741 has been marked as a duplicate of this bug. ***
Comment 7 rdelaplante 2012-05-24 12:38:56 UTC
The JDK bug says it was fixed in JDK 7u4-b18.  I encounter this bug in JDK 7u4-b21 so if it is a JDK bug, it is not fixed.
Comment 8 Tomas Danek 2012-05-24 12:50:49 UTC
I believe it's not fixed as well. However we need to provide JDK team information, so that they'll be able to fix this.
Do you have any clues how to reproduce this, or is it happening just randomly?

(In reply to comment #7)
> The JDK bug says it was fixed in JDK 7u4-b18.  I encounter this bug in JDK
> 7u4-b21 so if it is a JDK bug, it is not fixed.
Comment 9 rdelaplante 2012-05-24 13:35:36 UTC
It happens every time.   Just Command-X something to cut (or Command-C to copy), then Command-V to paste.
Comment 10 Tomas Danek 2012-05-24 14:31:41 UTC
Do you mean you are able to reproduce from scratch? I.e.
- start IDE with fresh userdir (/Applications/NetBeans/NetBeans\ 7.1.2.app/Contents/Resources/NetBeans/bin/netbeans --userdir /tmp/foo)
- create java se project
- copy some part of text using cmd-c, pasting with cmd-v?

Me not, but I've seen that IDE switched after long time being up to this buggy behavior.

(In reply to comment #9)
> It happens every time.   Just Command-X something to cut (or Command-C to
> copy), then Command-V to paste.
Comment 11 rdelaplante 2012-05-27 04:11:00 UTC
I leave NetBeans open for days or weeks, so I didn't think to restart it.  I recently restarted NetBeans and no longer experience these issues.  The reason I restarted it is because I noticed that I couldn't scroll down in the Projects tab. Every time I scrolled down it would automatically scroll back up.  I've seen this once before.. I think it was related to drag/dropping a file and read a ticket about it back then.
Comment 12 Tomas Danek 2012-05-28 09:08:52 UTC
yes, that's issue 211406 about scrolling, already filed to JDK team. 

If you figure out steps that trigger this weird copy paste behavior, please share them, thanks in advance.
Closing as INCOMPLETE for now.

(In reply to comment #11)
> I leave NetBeans open for days or weeks, so I didn't think to restart it.  I
> recently restarted NetBeans and no longer experience these issues.  The reason
> I restarted it is because I noticed that I couldn't scroll down in the Projects
> tab. Every time I scrolled down it would automatically scroll back up.  I've
> seen this once before.. I think it was related to drag/dropping a file and read
> a ticket about it back then.
Comment 13 Jiri Prox 2012-07-24 07:57:46 UTC
*** Bug 215810 has been marked as a duplicate of this bug. ***
Comment 14 swpalmer 2012-07-25 00:19:38 UTC
I don't know what triggers this.  But it is stuck in that mode until you restart.  The IDE is clearly aware of two actions for every paste, as undo will undo one at a time.  I also recall one time some dialog popped up twice (sorry I didn't catch what it was, but I had to cancel it twice) after doing a single paste.

Since this issue has three dupes should it be left open but incomplete? It appears to be a real issue that is as yet "unresolved"... But I'm not sure what the policy is.
Comment 15 Tomas Danek 2012-07-25 07:40:46 UTC
There's no chance JDK team will fix this without reproducible test case, unfortunately :-( that's why we leave it here "incomplete". Issue is indeed valid and relevant.
(In reply to comment #14)
> Since this issue has three dupes should it be left open but incomplete? It
> appears to be a real issue that is as yet "unresolved"... But I'm not sure what
> the policy is.
Comment 16 norasodan 2012-09-18 16:34:12 UTC
I have same problem on JDK 1.7.0_04-b21.

The IDE not starts with the bug. After some time of use, the shortcuts are triggered two times.
Comment 17 onClick 2012-11-06 03:31:17 UTC
This behavior occurs after the developer issues menu commands such as:
Edit > Find...
Edit > Replace...
or
Edit > Find in Project...
Edit > Replace in Project...
and after using:
Edit > Find Usage.

Interestingly, this behavior does not occur after issuing menu commands such as Refactor > Rename... .

Note: The doble paste does NOT occur during the use of the commands mentioned above but AFTER using them, that is, you first find and replace some text and then you copy and paste other text... here the duplicate starts occurring until you restart the IDE.

Interestingly also to mention as a workaround is that when you undo the double paste and redo the paste again, whereas using Edit > Undo and Edit > Redo or command-z and shift-command-z, the second paste (redo) is NOT duplicated any more but it shows a normal behavior.

Thanks a lot.
Comment 18 lizlissio 2012-12-19 22:22:02 UTC
NOT resolved - I have the NetBeans IDE 7.3 Beta 2 and it is STILL happening

Please fix this
Comment 19 Stanislav Aubrecht 2012-12-20 09:16:01 UTC
(In reply to comment #18)
> NOT resolved - I have the NetBeans IDE 7.3 Beta 2 and it is STILL happening
> 
> Please fix this

Please provide your JDK version info and reopen, thanks.
Comment 20 rdelaplante 2012-12-20 14:01:39 UTC
It would be interesting to see if this happens on older NetBeans versions such as 6.9, 7.0, etc.
Comment 21 onClick 2012-12-20 15:05:46 UTC
The bug is present with any JDK and from Netbeans version 7.0 and above. I can't tell whether lower versions were affected because I never used any version below 7.0. The bug is replicable. Just follow my lines in my last post.
Comment 22 onClick 2012-12-20 15:24:54 UTC
I forgot to mention that command Paste is not the only Edit command with bugs. Command Cut is also buggy. For example, this command cuts and extra line of code or an extra word in addition to those selected by you to cut and it also starts malfunctioning after using the Replace and Find commands set such as:

Edit > Find...
Edit > Replace...
or
Edit > Find in Project...
Edit > Replace in Project...
and after using:
Edit > Find Usage.

It's really annoying for us Mac users. 

Thank you.
Comment 23 David Strupl 2012-12-20 15:36:45 UTC
Hello,

I have a Mac (10.8.2) and have never ever seen this problem with whatever version of JDK. Sooo, cannot this be caused by Mac OSX version? One reporter claims problems on 10.7.3. What are the other users version of OSX? Without this info it is very hard to move forward ... Can someone with OSX 10.8.x see the problem?

Br, David
Comment 24 onClick 2012-12-20 16:20:53 UTC
Hi.

I'm one of those people who like to get every upgrade for his Mac OS, every upgrade for his JVM and every upgrade for his Netbeans IDE. So, I have the latest versions of Mac OS X (10.8.2), the latest version of Java for Mac by Oracle (1.7_09) and the latest Netbeans IDE (7.2.1). The bugs mentioned here are STILL present in these latest versions of software with a variant.

For this laboratory test you should use just the keyboard, do not use the Menu Items with the mouse, unless indicated.

Start Netbeans, create a Java Swing project, type some code, copy any part of the code, then paste it, everything works OK (remember, use just the keyboard [cmd-c, cmd-v], do not use the Menu Items). Now, to fire the bug, use the Menu Items and make an Edit > Find operation or use Edit > Replace, both have bugs, type something to find/replace in the little panel at the bottom of the screen, clic Replace or Replace All button, everything is working OK, right? But the bug has been fired already. THEN, select some text, copy the selected text with the keyboard (cmd-c), paste the copied text (cmd-v) somewhere else in your code and viola! There you have it, a text pasted TWICE! Now, undo the pasting (cmd-z), one instance of the copy is deleted not both instance as it would be expected, then redo (cmd-y) and there you have it, a text properly pasted ONCE.

I hope this helps. Thanks a lot really.
Comment 25 Stanislav Aubrecht 2012-12-20 16:23:03 UTC
Tomas, can you please try reproducing the steps in comment #24? Thanks.
Comment 26 Tomas Danek 2012-12-21 08:02:43 UTC
Still cannot reproduce:-( Am I doing something wrong?!

-start NetBeans with fresh userdir
-create Java|Java application
- into main method, type
System.out.println("");
- select whole line and copy + paste it several times (cmd-c , cmd-v)
- invoke from menu Edit > Replace , try to replace "" with "hello" , click Replace all
- replace is done correctly, click little x to close it
- try to copy paste --> still works fine

Product Version: NetBeans IDE Dev (Build 201212180001)
Java: 1.7.0_10; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_10-b18
System: Mac OS X version 10.8.2 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/tomas/Library/Application Support/NetBeans/dev
Cache directory: /Users/tomas/Library/Caches/NetBeans/dev

Can you please download and install latest JDK 7u10 (which btw fixes lot of problems that were preventing to run NetBeans smoothly on JDK 7u9) and see if you can still reproduce? Eventually correct my steps?

Thanks!
Comment 27 onClick 2012-12-21 21:54:45 UTC
Hi, Tomas.


Your steps were ok.

I updated my JDK to 7u10 and here are my new specs:

Product Version: NetBeans IDE 7.2.1 (Build 201210100934)
Java: 1.7.0_10; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
System: Mac OS X version 10.8.2 running on x86_64; US-ASCII; es_XL (nb)

With this update installed, I've played a while with some testing code and I've worked as usual several hours with a project I have in hands. Both the testing code and the project showed the bug just about yesterday.

I'm glad to tell you that I haven't been able to reproduce the bug again. I won't change the status of this bug, it's up to you. But I think more testing is needed. As I said, I'm working on a project that showed the bug just yesterday. So, I'll be working as usual, and see what happens. I suggest that all the other users that complained about this bug, get the JDK update, start testing and feedback.

Thank you for your support.
Comment 28 Antonin Nebuzelsky 2012-12-27 08:44:55 UTC
(In reply to comment #27)
> I'm glad to tell you that I haven't been able to reproduce the bug again. I
> won't change the status of this bug, it's up to you.

Closing for now. Thanks for the feedback.
Comment 29 ercee 2013-01-26 21:15:05 UTC
Same problem continues... 
Not always but sometimes when i press ones to cmd+c or +v or +x, the ide runs that shortcut twice.
When it starts, it wont stop by it self until restart the ide.

Product Version: NetBeans IDE 7.2.1 (Build 201210100934)
Java: 1.7.0_04; Java HotSpot(TM) 64-Bit Server VM 23.0-b21
System: Mac OS X version 10.8.2 running on x86_64; US-ASCII; en_US (nb)
User directory: /Users/erce/Library/Application Support/NetBeans/7.2.1
Cache directory: /Users/erce/Library/Caches/NetBeans/7.2.1
Comment 30 swpalmer 2013-01-26 21:50:57 UTC
According toe comment #27
http://netbeans.org/bugzilla/show_bug.cgi?id=212051#c27

the bug went away after updating the JDK to 7u10.  Since you are using an ancient 7u4, could you please update and confirm the bug is present with *recent* code before reopening the bug?
Comment 31 Tomas Danek 2013-01-27 10:49:22 UTC
Yes, as already said, please reopen again only if you are able to reproduce with JDK7 u10 and newer. Thanks.

(In reply to comment #30)
> According toe comment #27
> http://netbeans.org/bugzilla/show_bug.cgi?id=212051#c27
> 
> the bug went away after updating the JDK to 7u10.  Since you are using an
> ancient 7u4, could you please update and confirm the bug is present with
> *recent* code before reopening the bug?
Comment 32 swpalmer 2013-01-31 01:29:42 UTC
Note I just saw what I think is the same issue on OS X 10.8.2 with JDK 7u11 and NB 7.3 RC1

I this case I hit fn-Delete (to get true Delete, not Backspace) and it deleted two characters at a time.
Backspace would only delete one character.

I can't re-open or comment on JDK bugs, so I don't know what I should do.
Comment 33 onClick 2013-01-31 04:07:09 UTC
You're right. For yet undiscovered reasons, sometimes, fn+backspace command starts deleting two characters instead of one. I noted this behavior even before Java update 7u10 and it is still present. I hadn't decided to report it before because I haven't yet found out exactly what triggers it. I'm used to it already, anyway, as well as to the slow scanning of projects at startup and to the unwanted auto-selection of adjacent characters after deleting some portion of text. NetBeans is buggy but you have to prove it.


(In reply to comment #32)
> Note I just saw what I think is the same issue on OS X 10.8.2 with JDK 7u11 and
> NB 7.3 RC1
> 
> I this case I hit fn-Delete (to get true Delete, not Backspace) and it deleted
> two characters at a time.
> Backspace would only delete one character.
> 
> I can't re-open or comment on JDK bugs, so I don't know what I should do.
Comment 34 Tomas Danek 2013-01-31 08:41:02 UTC
guys, isolated steps to reproduce will be very helpful, without them there's no chance JDK team will fix such an issue.
Comment 35 mweissie 2013-05-21 06:30:30 UTC
This has not gone away.  Very Repeatable with 
Product Version: NetBeans IDE 7.2 (Build 201207171143)
Java: 1.7.0_05; Java HotSpot(TM) 64-Bit Server VM 23.1-b03
System: Mac OS X version 10.8.3 running on x86_64; US-ASCII; en_US (nb)

I suggest going onto a solid mac machine and open Xcode, SequelPro and a few other programs, and then launch NetBeans.  Do a find in Project or a find and replace in a file.  After that the copy paste buffer will always do a double paste.  

Very annoying as you need to restart.  I believe if only Netbeans is running, this may not happen, obviously memory related.
Comment 36 Antonin Nebuzelsky 2013-05-22 10:38:14 UTC
Stando, please evaluate.
Comment 37 Stanislav Aubrecht 2013-05-22 12:07:08 UTC
I can easily reproduce the problem with Fn+Backspace in 

Product Version: NetBeans IDE Dev (Build 20130516-a53c8bf17862)
Java: 1.7.0_17; Java HotSpot(TM) 64-Bit Server VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_17-b02

Steps to reproduce:
- open any text editor
- invoke menu Edit - Delete (one char is deleted)
- press fn+Backspace -> two characters are always deleted from now on. Menu Edit - Delete still deletes a single char

I cannot reproduce the problem with Meta+C/V/X keyboard shortcuts.

Reassigning to Actions sub-component for evaluation. Please reassign if it's an issue in opened.text module.
Comment 38 Jan Peska 2013-06-06 08:56:58 UTC
Follow Standa's repro steps. The BaseKit.DeleteCharAction is called twice. The second invocation is weird because comes from the menu item even when the menu is not opened. I was told that Editor guys dealt with similar problems before so I'm assigning it to Editor/Actions to evaluate.
Comment 39 David Strupl 2013-06-20 11:08:26 UTC
Reproducible on

Product Version: NetBeans IDE Dev (Build 20130620-9e5bd3d2310d)
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.4 running on x86_64; UTF-8; en_US (nb)

Interesting is that you have to follow Standa's steps: if you don't invoke delete from the main menu the keyboard behaves properly. Once you invoke the action from the main menu it starts to be broken.
Comment 40 David Strupl 2013-06-20 12:24:11 UTC
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.

*** This bug has been marked as a duplicate of bug 219853 ***
Comment 41 Jan Peska 2014-02-13 10:11:19 UTC
*** Bug 241794 has been marked as a duplicate of this bug. ***