Disable assertions for KeyCommandSet when running in gwtdebug mode

The com.google.gwtexpui.globalkey.client.KeyCommandSet has some
assertions that are currently evaluated when running Gerrit in the
gwtdebug mode, but which are not evaluated when running Gerrit via the
pgm daemon. These assertions e.g. cause failures if a KeyCommand is
registered multiple times. E.g. at the moment the CommitMessageBlock
is registering a KeyCommand for starring a change. This registration
is done whenever the display method is invoked. This is e.g. the case
when the change gets abandoned/restored. If running in gwtdebug mode
the assertion failure on re-registering the KeyCommand for starring the
change makes the popup for the abandon/restore message stay open.
Afterwards a browser refresh is needed to recover from this state. This
is annoying when debugging and it is also confusing to see these errors
in debug mode when everything is fine when running Gerrit via the pgm
daemon. This is why this change disables the assertions for the
KeyCommandSet class when running in debug mode. Alternatively we could
of course try to fix the code so that re-registration of keys is not
happening.

Change-Id: I16ee8aa30281922cda08fc31cd966e07c194c926
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
1 file changed