Skip to content

Commit 84b6d63

Browse files
committed
Make spyPart shortcut attribute optional
The shortcut attribute on the org.eclipse.pde.spy.core.spyPart extension point is not declared as required in its schema, but SpyProcessor would NPE when a contribution omitted it (keySequence.equals in bindSpyKeyBinding). Skip key-binding registration when no shortcut is provided so a spy can opt into discoverability via the spy stack toolbar without claiming a global keystroke.
1 parent 5c5792d commit 84b6d63

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# To force a version qualifier update add the bug here
22
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1184
3-
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1659
3+
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1659
4+
https://github.com/eclipse-pde/eclipse.pde/pull/2326

ui/org.eclipse.pde.spy.core/src/org/eclipse/pde/spy/core/SpyProcessor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ public void process(IExtensionRegistry extRegistry) {
8181
// Bind the command with the binding, and add the view ID as
8282
// parameter.
8383
// The part class name will be the ID of the part descriptor
84-
bindSpyKeyBinding(bindingTable, shortCut, command, partID);
84+
if (shortCut != null && !shortCut.isBlank()) {
85+
bindSpyKeyBinding(bindingTable, shortCut, command, partID);
86+
}
8587

8688
// Add the descriptor in application
8789
addSpyPartDescriptor(partID, partName, iconPath, partClass, desc);

0 commit comments

Comments
 (0)