mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-02-27 17:00:50 +01:00
Avoid IllegalStateExceptions
The DefaultNamespaceManager has not been a singleton. Because of this, instances could be removed before the event has been handled completely and therefore the handler could no longer be removed from the queue, resulting in an IllegalStateException. By making the manager a singleton, it is no longer garbage collected and therefore we do not get the exception any longer. Committed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com> Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
This commit is contained in:
@@ -29,6 +29,7 @@ import sonia.scm.HandlerEventType;
|
||||
import sonia.scm.event.ScmEventBus;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import java.util.Collection;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -36,6 +37,7 @@ import java.util.stream.Collectors;
|
||||
import static sonia.scm.ContextEntry.ContextBuilder.entity;
|
||||
import static sonia.scm.NotFoundException.notFound;
|
||||
|
||||
@Singleton
|
||||
public class DefaultNamespaceManager implements NamespaceManager {
|
||||
|
||||
private final RepositoryManager repositoryManager;
|
||||
|
||||
Reference in New Issue
Block a user