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 170677 - Confusing F5 and Ctrl+F5 shortcuts
Summary: Confusing F5 and Ctrl+F5 shortcuts
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: REGRESSION
Depends on:
Blocks: 152576
  Show dependency tree
 
Reported: 2009-08-19 18:50 UTC by Alexander Pepin
Modified: 2009-09-03 08:46 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot of the Debug menu (155.96 KB, image/png)
2009-08-20 07:33 UTC, Vojtech Sigler
Details
Exported active netbeans profile (should be the default as I do not remember changing it) (24.89 KB, text/xml)
2009-08-20 07:34 UTC, Vojtech Sigler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pepin 2009-08-19 18:50:42 UTC
Now F5 in menu (as well as in toolbar tooltip) is assign to  "Debug Main Project" in fact it's still working for
"Continue"  (as it worked before) whereas Ctrl+F5 now assigned to "Continue" is working for "Debug Main Project". Please
implement UI changes as soon as practical as lots of our debugger tests fail because of that.
Comment 1 Martin Entlicher 2009-08-19 21:44:30 UTC
Not true.
In default "NetBeans" keymap profile, "Debug Main Project" is CTRL-F5. And CTRL-F5 does not work for Continue.
"F5" is assigned to "Continue" and does not work for "Debug Main Project".

In "NetBeans 5.5" keymap profile, it works exactly vice-versa.
"Debug Main Project" is F5 and Continue is CTRL-F5.

FYI: In the future, we might enhance F5 to also work as "Debug Main Project" if no debugging session is running - see
issue #90133.

If you still see the behavior you describe, please provide the build number and keymap profile that you have active.
Comment 2 Vojtech Sigler 2009-08-20 07:31:53 UTC
Actually I get the same in today's build.

Product Version: NetBeans IDE Dev (Build 200908171401)
Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01
System: Linux version 2.6.28-15-generic running on i386; UTF-8; en_US (nb)

I'll attach a screenshot as well as the keymap profile.
The problem is that in the Debug menu, the shortcut for Debug Main Project says F5 and for Continue Ctrl+F5, but in
reality, F5 will not invoke debug (Ctrl+F5 will) and Ctrl+F5 will not invoke continue whereas F5 will.
Comment 3 Vojtech Sigler 2009-08-20 07:33:00 UTC
Created attachment 86493 [details]
Screenshot of the Debug menu
Comment 4 Vojtech Sigler 2009-08-20 07:34:00 UTC
Created attachment 86494 [details]
Exported active netbeans profile (should be the default as I do not remember changing it)
Comment 5 Martin Entlicher 2009-08-20 08:20:08 UTC
O.K. then someone made a regression...
Comment 6 Martin Entlicher 2009-08-20 14:44:26 UTC
There were no changes in defaults/src/org/netbeans/modules/defaults/mf-layer.xml, so it should behave as I see it in my
build 090803.
Comment 7 Vojtech Sigler 2009-08-24 09:51:04 UTC
It still persists in latest trunk build (200908221401).

I also get F5 for Debug project and Ctrl+F5 for continue in my custom build I built from trunk this morning (090824).
Comment 8 Martin Entlicher 2009-08-24 16:57:37 UTC
Not sure where this belongs to, but certainly not to debugger!
Regardless of which keymap profile I select, the shortcuts remain the same.
It looks like both shortcuts are active - the visible in menus and set in currently active profile.
Comment 9 Jiri Skrivanek 2009-08-28 14:45:01 UTC
It seems there is a wrong shortcut in defaults\mf-layer.xml (Ctrl+F5, D-F5.shadow for Debug Main Project). Correct
shortcut in the menu is from spi.debugger.ui\src\org\netbeans\modules\debugger\resources\mf-layer.xml but "acting"
shortcut is from defaults\src\org\netbeans\modules\defaults\mf-layer.xml. If I change shortcut in Options, it starts to
behave consistently. I guess it must be fixed in defaults\mf-layer.xml. But Maxi, Vito is there a way to prevent such
clashes?
Comment 10 Martin Entlicher 2009-08-28 15:39:30 UTC
Returning back - I'm not aware about any bug in debugger modules.
I doubt that the problem is in defaults/src/org/netbeans/modules/defaults/mf-layer.xml - This was the first place I've
looked at and the last change there was on Jun 13. AFAIK it worked fine at that time!

Ctrl+F5, D-F5.shadow is *CORRECT* for Debug Main Project in NetBeans!! Since there is a correct shortcut, can you please
explain why do we see F5 there?
Comment 11 Jiri Skrivanek 2009-08-28 20:49:35 UTC
Then the problem is in spi.debugger.ui\src\org\netbeans\modules\debugger\resources\mf-layer.xml

    <folder name="Shortcuts">
        <file name="F5.shadow">
            <attr name="originalFile"
stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-DebugMainProjectAction.instance"/>
	</file>
        <file name="D-F5.shadow">
            <attr name="originalFile"
stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-ContinueAction.instance"/>
        </file>

Comment 12 Martin Entlicher 2009-08-28 21:34:49 UTC
Please note that the latest modification of this part of that file was done on Jun 16 2007! So do not tell me that there
is a problem. The shortcuts work fine in 6.7.1 and they also worked fine ~month ago in 6.8.
So what if you find out how who screwed things up? I'm sure there was no related change in debugger.
Comment 13 Jiri Skrivanek 2009-09-01 13:45:59 UTC
I am sorry I was confused by different definition of shortcuts in two mentioned layers. The regression was caused by
fixing issue 152576 (http://hg.netbeans.org/main-golden/rev/89657b845762).
Comment 14 Jesse Glick 2009-09-01 15:35:18 UTC
The root problem is indeed the useless and conflicting definitions in spi.debugger.ui, which should be deleted. I will
work on making ValidateLayerConsistencyTest detect this kind of misconfiguration.

As to the incorrect resolution of the conflict from the standpoint of accelerators, that is easy enough to fix:
core-main #587a2df3e762
Comment 15 Martin Entlicher 2009-09-01 16:23:24 UTC
I was really not willing to search for the root of the problem, since the bug is evidently in the keymap support!
Keymap options present *DIFFERENT* shortcuts from what I see in menus. If keymaps are taken from module's layers I do
not understand why we have NetBeans profile in defaults/mf-layer.xml.
Someone who messed this up should make it clear!
Comment 16 Jesse Glick 2009-09-01 16:32:40 UTC
To clarify what I wrote before: Keymaps/<current>/ does override Shortcuts/ as always. There was a bug (introduced by
fix of #152576) that this override was not reflected in the accelerator displayed in the menu item / toolbar button (as
opposed to actual accelerator used by the keystroke processor and shown in Options); now fixed in #587a2df3e762.

The issue remains that the debugger module registers Shortcuts/ bindings which are (1) useless (overridden in every
keymap), (2) inconsistent with the standard "NetBeans" keymap binding. Whoever swapped F5 and C-F5 failed to do it
across the board. I am working on writing a test for this kind of situation as well as correcting it for the specific
case of the debugger.
Comment 17 Martin Entlicher 2009-09-01 16:46:41 UTC
So if it's O.K. to delete all shortcuts from spi.debugger.ui/src/org/netbeans/modules/debugger/resources/mf-layer.xml,
I'll happily do it. I wonder why it was not deleted with introduction of NetBeans profile in keymaps.
Comment 18 Jesse Glick 2009-09-01 17:37:09 UTC
I will take care of the incorrect shortcuts in spi.debugger.ui. Still working on writing a test which accurately
captures the problem and checking whether there are other similar cases.

As to why the base shortcut definitions were not removed when the keymaps were introduced, I am not sure. Perhaps an
oversight.
Comment 19 Jesse Glick 2009-09-01 18:46:13 UTC
In core-main #e23414da833c I am removing those bindings in Shortcuts which are anyway made (possibly via different
keystrokes) in every keymap, since these are almost certainly superfluous. I am leaving alone those Shortcuts bindings
for which at least one keymap lacks a definition, as with that keymap active you would otherwise have no shortcut for
the action at all, which could be a regression (though in some cases it is likely that the omission of the action from a
nondefault keymap is simply an oversight).

The situation is necessarily messy because there is a longstanding conflict between modularity on the one hand - keeping
UI definitions as close to the implementing code as possible - and the desire to centralize keymap definitions. Perhaps
a better system would involve deleting the explicit NetBeans keymap, moving all its bindings to Shortcuts in the
implementing module, and permitting nondefault keymaps to mask default bindings using _hidden files or add new bindings
but otherwise inheriting from the default keymap. This would be some work, though, and there is a risk of
incompatibility for users with customized keymaps.
Comment 20 Quality Engineering 2009-09-03 08:46:05 UTC
Integrated into 'main-golden', will be available in build *200909021401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/587a2df3e762
User: Jesse Glick <jglick@netbeans.org>
Log: #170677: if a keymap overrides the base shortcut definition, always use its accelerator, regardless of the usual ordering.