Bug 320162 E4CommandProcessor.createBinding catch IllegalArgumentException which is never thrown
The code looks like this: TriggerSequence sequence = null; try { sequence = bs.createSequence(keySequence); } catch (IllegalArgumentException ex) { // the sequence is not complete Activator.trace(Policy.DEBUG_MENUS, "failed to create: " + binding, ex); //$NON-NLS-1$ return null; } But when looking at code in KeySequence.getInstance the only Exceptions thrown are: * NPE * ParseException (catched in BindingServiceImpl) I guess the code should catch the NPE and not the never thrown IAE
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4CommandProcessor.java
for (MCommandParameter cmdParm : modelParms) {
				parmList.add(new Parameter(cmdParm.getElementId(), cmdParm.getName(), null, null,
						cmdParm.isOptional()));
			}
			parms = parmList.toArray(new Parameter[parmList.size()]);
		}
		Category cat = undefinedCategory;
		if (cmd.getCategory() != null) {
			cat = cs.getCategory(cmd.getCategory().getElementId());
		}
		cs.defineCommand(id, name, null, cat, parms);
	}
	public static void watchForCommandChanges(IEclipseContext context) {
		final MApplication application = context.get(MApplication.class);
		final ECommandService cs = (ECommandService) context.get(ECommandService.class.getName());
		final Category undefinedCategory = cs.getCategory(MApplication.class.getName());
		IEventBroker broker = context.get(IEventBroker.class);
		EventHandler handler = new EventHandler() {
			public void handleEvent(Event event) {
				if (application == event.getProperty(UIEvents.EventTags.ELEMENT)) {
					if (UIEvents.EventTypes.ADD.equals(event.getProperty(UIEvents.EventTags.TYPE))) {
						Object obj = event.getProperty(UIEvents.EventTags.NEW_VALUE);
						if (obj instanceof MCommand) {
							createCommand(cs, undefinedCategory, (MCommand) obj);
						} else if (obj instanceof MCategory) {
							createCategory(cs, (MCategory) obj);
						}
					}
				}
			}