Merge branch 'stable-2.7'
* stable-2.7: Set version to 2.7 Fix installation of plugins Fix change stuck in SUBMITTED state but actually merged Remove documentation links from admin page NPE when deleting draft patch set when previous draft already deleted Fix example for 'test-submit rule' in Prolog cookbook Mark ALREADY_MERGED changes as merged in the DB and run hooks Conflicts: gerrit-acceptance-tests/pom.xml gerrit-antlr/pom.xml gerrit-cache-h2/pom.xml gerrit-common/pom.xml gerrit-extension-api/pom.xml gerrit-gwtdebug/pom.xml gerrit-gwtexpui/pom.xml gerrit-gwtui/pom.xml gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/AdminConstants.properties gerrit-httpd/pom.xml gerrit-launcher/pom.xml gerrit-main/pom.xml gerrit-openid/pom.xml gerrit-patch-commonsnet/pom.xml gerrit-patch-jgit/pom.xml gerrit-pgm/pom.xml gerrit-plugin-api/pom.xml gerrit-plugin-archetype/pom.xml gerrit-plugin-gwt-archetype/pom.xml gerrit-plugin-gwtui/pom.xml gerrit-plugin-js-archetype/pom.xml gerrit-prettify/pom.xml gerrit-reviewdb/pom.xml gerrit-server/pom.xml gerrit-sshd/pom.xml gerrit-util-cli/pom.xml gerrit-util-ssl/pom.xml gerrit-war/pom.xml plugins/commit-message-length-validator plugins/replication plugins/reviewnotes pom.xml Change-Id: Iacb961caf52032e7e445be9ed81376db849e171b
This commit is contained in:
@@ -60,10 +60,7 @@ public class DispatchCommandProvider implements Provider<DispatchCommand> {
|
||||
return new RegistrationHandle() {
|
||||
@Override
|
||||
public void remove() {
|
||||
if (!m.remove(name.value(), commandProvider)) {
|
||||
throw new IllegalStateException(String.format(
|
||||
"can not unregister command: %s", name.value()));
|
||||
}
|
||||
m.remove(name.value(), commandProvider);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -71,11 +68,12 @@ public class DispatchCommandProvider implements Provider<DispatchCommand> {
|
||||
public RegistrationHandle replace(final CommandName name,
|
||||
final Provider<Command> cmd) {
|
||||
final ConcurrentMap<String, CommandProvider> m = getMap();
|
||||
m.put(name.value(), new CommandProvider(cmd, null));
|
||||
final CommandProvider commandProvider = new CommandProvider(cmd, null);
|
||||
m.put(name.value(), commandProvider);
|
||||
return new RegistrationHandle() {
|
||||
@Override
|
||||
public void remove() {
|
||||
m.remove(name.value(), cmd);
|
||||
m.remove(name.value(), commandProvider);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user