Bug 125420 [Commands] parameters: allow commands to specify return type
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/Command.java
final boolean categoryChanged = category != null;
		category = null;
		final boolean parametersChanged = parameters != null;
		parameters = null;
		final String[] stateIds = getStateIds();
		if (stateIds != null) {
			if (handler instanceof IObjectWithState) {
				final IObjectWithState handlerWithState = (IObjectWithState) handler;
				for (int i = 0; i < stateIds.length; i++) {
					final String stateId = stateIds[i];
					handlerWithState.removeState(stateId);
					final IState state = getState(stateId);
					removeState(stateId);
					state.dispose();
				}
			} else {
				for (int i = 0; i < stateIds.length; i++) {
					final String stateId = stateIds[i];
					final IState state = getState(stateId);
					removeState(stateId);
					state.dispose();
				}
			}
		}
		fireCommandChanged(new CommandEvent(this, categoryChanged,
				definedChanged, descriptionChanged, false, nameChanged,
				parametersChanged));
	}
}